查看: 1990|回复: 7

[已经解决] (转生次数)这几个字重叠在一起了每个角色上多有的

[复制链接]
梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
发表于 2016-2-5 17:13:27 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
[pre lang="ruby"]#==============================================================================
# ★ 【角色转生系统】★
#------------------------------------------------------------------------------
# ☆  by 芯☆淡茹水  
#==============================================================================
#◆ 使用方法:
#        复制该脚本,插入到 Main 前。
#        召唤转生系统的方法:事件 → 脚本  写入  $scene = Scene_Lx.new
#===============================================================================
#◆ 说明:
#        和一些网游的转生类似。角色随着转生次数的增加,各种属性(hp,sp,力量,
#      灵巧,,,等)的初始值会越来越高,而每升一级增加的属性也会越来越多。
#      (注意:数据库各角色的初始等级都设置为 1 级。)
#
#       由于手动设置的项目较多,在使用前,请先仔细阅读并设置下面的设置项。
#
#==============================================================================
#◆ 设置:
#================]
#------------------------------------------------------------------------------
LX_LEVEL = 60       #达到转生要求的最低等级。
#------------------------------------------------------------------------------
LX_VARIABLE = 200   #储存各角色转生次数的起始变量。比如:设置为 200 ,那么1号角
#                    色转生次数储存在 201 号变量,2号角色储存在 202 号变量,,,
#------------------------------------------------------------------------------
LX_N = 10           #转生前,角色的各属性除以设定的这个值,再乘以转生次数,加入
#                    到转生后的属性中。这个设定的值越高,加入转生后的属性就越
#                    少,反之就越多。
#------------------------------------------------------------------------------
LX_DX = false        #转生次数限制,限制写 true       不限制写  false
#------------------------------------------------------------------------------
LX_DX_N = 5         #转生最高次数限制,上面的限制设置写 true  该项才有效。
#------------------------------------------------------------------------------
LX_CLASS = false      #转生后是否改变角色职业,是 写入 true    否 写入 false
#------------------------------------------------------------------------------
LX_CLASS_ID = 1      #转生后,角色的职业ID。上面是否改变职业设置写 true
#                     该设置才有效。
#                     比如转生后,全部转为 1 号职业,从“新手”做起。
#------------------------------------------------------------------------------
LX_EVENT_ID = 1      #转生成功后激活的公共事件ID。公共事件里可设置一些转生成功后
#                    播放动画,以及一些提示等。
#------------------------------------------------------------------------------
LEVEL_UP = true     #推荐配合使用升级加点系统。如果工程里有升级加点系统
#                    请写 true    没有则写 false
#==============================================================================
##转生后角色各属性增加度设置:
#------------------------------------------------------------------------------
#(角色每升一级增加的属性 = 数据库设置的基本值 + 下面设置的增加度 乘以 转生次数)
#(比如设置HP为 10  ,转生 0 次 角色每升一级,角色的HP多增加 0 点;
#  转生 1 次 多增加 10 点;转生 2 次 多增加 20 点,,,,;以此类推。)
#------------------------------------------------------------------------------
LX_EXP = 2           # EXP曲线基础值和增加度。(一般设为 1 — 10)
#------------------------------------------------------------------------------
LX_HP = 10           # HP
#------------------------------------------------------------------------------
LX_SP = 8            # SP
#------------------------------------------------------------------------------
LX_STATE = 1         # 四项属性(力量,灵巧,速度,魔力)
#==============================================================================
###############################################################################
#==============================================================================
#★ 重新定义角色各属性
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 计算 EXP
  #--------------------------------------------------------------------------
  def make_exp_list
    actor = $data_actors[@actor_id]
    lx = ($game_variables[@actor_id + LX_VARIABLE] + 1) * LX_EXP
    actor.exp_inflation += lx
    actor.exp_basis += lx
    @exp_list[1] = 0
    pow_i = 2.4 + actor.exp_inflation / 100.0
    for i in 2..100
      if i > actor.final_level
        @exp_list = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list = @exp_list[i-1] + Integer(n)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取基本 MaxHP
  #--------------------------------------------------------------------------
  def base_maxhp
    lx = $game_variables[@actor_id + LX_VARIABLE] * @level
    return $data_actors[@actor_id].parameters[0, @level] + lx * LX_HP
  end
  #--------------------------------------------------------------------------
  # ● 获取基本 MaxSP
  #--------------------------------------------------------------------------
  def base_maxsp
    lx = $game_variables[@actor_id + LX_VARIABLE] * @level
    return $data_actors[@actor_id].parameters[1, @level] + lx * LX_SP
  end
  #--------------------------------------------------------------------------
  # ● 获取基本力量
  #--------------------------------------------------------------------------
  def base_str
    lx = $game_variables[@actor_id + LX_VARIABLE] * @level
    n = $data_actors[@actor_id].parameters[2, @level] + lx * LX_STATE
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.str_plus : 0
    n += armor1 != nil ? armor1.str_plus : 0
    n += armor2 != nil ? armor2.str_plus : 0
    n += armor3 != nil ? armor3.str_plus : 0
    n += armor4 != nil ? armor4.str_plus : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # ● 获取基本灵巧
  #--------------------------------------------------------------------------
  def base_dex
    lx = $game_variables[@actor_id + LX_VARIABLE] * @level
    n = $data_actors[@actor_id].parameters[3, @level] + lx * LX_STATE
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # ● 获取基本速度
  #--------------------------------------------------------------------------
  def base_agi
    lx = $game_variables[@actor_id + LX_VARIABLE] * @level
    n = $data_actors[@actor_id].parameters[4, @level] + lx * LX_STATE
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.agi_plus : 0
    n += armor1 != nil ? armor1.agi_plus : 0
    n += armor2 != nil ? armor2.agi_plus : 0
    n += armor3 != nil ? armor3.agi_plus : 0
    n += armor4 != nil ? armor4.agi_plus : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # ● 获取基本魔力
  #--------------------------------------------------------------------------
  def base_int
    lx = $game_variables[@actor_id + LX_VARIABLE] * @level
    n = $data_actors[@actor_id].parameters[5, @level] + lx * LX_STATE
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.int_plus : 0
    n += armor1 != nil ? armor1.int_plus : 0
    n += armor2 != nil ? armor2.int_plus : 0
    n += armor3 != nil ? armor3.int_plus : 0
    n += armor4 != nil ? armor4.int_plus : 0
    return [[n, 1].max, 999].min
  end
end
###############################################################################
#==============================================================================
#★ 转生场景
#==============================================================================
class Scene_Lx
  def main
    #选择窗口
    @command_window = Window_LxCommand.new
    @command_window.visible = false
    #帮助窗口
    @help_window = Window_LxHelp.new
    #状态窗口
    @status_window = Window_LxStatus.new
    #背景窗口
    @lxa_window = Window_LxBack.new
    @lxa_window.y = 64
    @lxb_window = Window_LxBack.new
    @lxb_window.y = 168
    @lxc_window = Window_LxBack.new
    @lxc_window.y = 272
    @lxd_window = Window_LxBack.new
    @lxd_window.y = 376
    #过渡
    Graphics.transition
    #循环
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    #释放窗口
    @command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @lxa_window.dispose
    @lxb_window.dispose
    @lxc_window.dispose
    @lxd_window.dispose
  end
  #刷新
  def update
    @command_window.update
    @status_window.update
    @help_window.update
    if Input.repeat?(Input::UP) or  Input.repeat?(Input::DOWN)
      @status_window.active = true
      return
    end
    if @status_window.active
      update_status
      return
    end
    if @command_window.active
      update_command
      return
    end
  end
  #刷新(状态窗口)
  def update_status
    @help_window.refresh     
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      level = $game_party.actors[@status_window.index].level
      #限制
      if level >= LX_LEVEL
        if LX_DX == true
          i = $game_party.actors[@status_window.index].id
          if $game_variables[i + LX_VARIABLE] < LX_DX_N
            $game_system.se_play($data_system.decision_se)
            @status_window.active = false
            @command_window.visible = true
            @command_window.active = true
            @command_window.index = 0
          else
            $game_system.se_play($data_system.buzzer_se)
            text =  "已达转生次数上限!"
            @help_window.contents.clear
            @help_window.contents.draw_text(170,0, 246, 32, text)
            @status_window.active = false
          end
        else
          $game_system.se_play($data_system.decision_se)
          @status_window.active = false
          @command_window.visible = true
          @command_window.active = true
          @command_window.index = 0
        end
      else
        $game_system.se_play($data_system.buzzer_se)
        text = LX_LEVEL.to_s
        text +=  "级后才能转生!"
        @help_window.contents.clear
        @help_window.contents.draw_text(190,0, 186, 32, text)
        @status_window.active = false
      end
      return
    end
  end
  #刷新(选择窗口)
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @status_window.active = true
      @command_window.visible = false
      @command_window.active = false
      @command_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        update_xdrs_lx
      when 1
        $game_system.se_play($data_system.cancel_se)
        @status_window.active = true
        @command_window.visible = false
        @command_window.active = false
        @command_window.index = -1
      end
      return
    end
  end
  #刷新(转生)
  def update_xdrs_lx
    #获取角色。
    actor = $game_party.actors[@status_window.index]
    i = actor.id
    #获取储存角色转生次数的变量ID.
    v = LX_VARIABLE + i
    #代入角色转生前的各数据,并计算最终增加的属性。
    n = $game_variables[v] + 1
    hp = actor.maxhp/LX_N * n
    sp = actor.maxsp/LX_N * n
    str = actor.str/LX_N * n
    dex = actor.dex/LX_N * n
    agi = actor.agi/LX_N * n
    int = actor.int/LX_N * n
    #角色初始化。
    $game_actors.setup(i)
    #确认转生后是否改变职业,是则变为设置的职业ID。
    if LX_CLASS == true
      actor.class_id = LX_CLASS_ID
    end
    #加入角色转生后增加的各种属性。
    actor.maxhp += hp
    actor.maxsp += sp
    actor.str += str
    actor.dex += dex
    actor.agi += agi
    actor.int += int
    #角色转生次数变量加 1 。
    $game_variables[v] += 1
    #回复。
    actor.recover_all
    #确认升级加点系统,转生后,如果有剩余点数未加,将变为 0 。
    #如果没有升级加点系统,跳过。
    if LEVEL_UP == true
      va = LEVEL_UP_VARIABLE + i
      $game_variables[va] = 0
    end
    #激活公共事件。
    $game_temp.common_event_id = LX_EVENT_ID
    #切换到地图场景。
    $scene = Scene_Map.new
  end
end
###############################################################################
#==============================================================================
#★ 增加描绘转生次数的定义
#==============================================================================
class Window_Base < Window
  def draw_actor_xdrs_lx(actor, x, y)
    self.contents.font.color = text_color(3)
    self.contents.draw_text(8, 32, 120, 32, "转生次数:")
    i =  actor.id + LX_VARIABLE
    #self.z = 0
    self.contents.font.color = text_color(6)
    self.contents.draw_text(x,y, 80, 32, $game_variables.to_s)
  end
end
#===============================================================================
#★ 帮助窗口
#===============================================================================
class Window_LxHelp < Window_Base
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.draw_text(170, 0, 246, 32, "★请选择要转生的角色★")
  end
end
#===============================================================================
#★ 选择窗口
#===============================================================================
class Window_LxCommand < Window_Selectable
  def initialize
    super(240, 180, 160, 124)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 2
    @commands = ["是", "否"]
    refresh
    self.z = 999
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  def draw_item(index)
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 148, 32, "是否确定转生?")
    y = 30 + index * 32
    self.contents.font.color = normal_color
    self.contents.draw_text(0, y, 126, 32, @commands[index])
  end
  def update_cursor_rect
    self.cursor_rect.set(-5, 30 + index * 32, 134, 32)
  end
end
#===============================================================================
#★ 角色状态 + 选择角色窗口
#===============================================================================
class Window_LxStatus < Window_Selectable
  def initialize
    super(0, 64, 1200, 700)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    refresh
    self.index = 0
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
    x = ( i + 1 ) * 92 +25
    y = 44

    @column_max = 4
  
    actor = $game_party.actors
    bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)
    #  x = 5
    #  y = i * 104 - 3
    #  actor = $game_party.actors
      draw_actor_xdrs_lx(actor, x + 56, y + 130)
      draw_actor_graphic(actor, x + 35, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 134, y + 28)
      draw_actor_level(actor, x + 134, y)
      draw_actor_exp(actor, x + 300, y + 56)
      draw_actor_hp(actor, x + 300, y )
      draw_actor_sp(actor, x + 300, y + 26)
    end
  end
def update_cursor_rect
    # 光标位置不满 0 的情况下
    if @index <= -1
      self.cursor_rect.empty
      
      return
    end
    # 获取当前的行
#    row = @index / @column_max
    # 当前行被显示开头行前面的情况下
  #  if row < self.top_row
      # 从当前行向开头行滚动
#     self.top_row = row
#   end
    # 当前行被显示末尾行之后的情况下
#   if row > self.top_row + (self.page_row_max - 1)
      # 从当前行向末尾滚动
#     self.top_row = row - (self.page_row_max - 1)
#   end
    # 计算光标的宽
    cursor_width = 90
    #cursor_width = 536 / (@column_max + 1) + 1  #光标大小
    # 计算光标坐标
   
    x = 0 + @index % @column_max * (cursor_width + 1) - 4 #光标位置调节 覆盖31行
    y = @index / @column_max * 32 - self.oy
    # 更新国标矩形
    self.cursor_rect.set(x, y, cursor_width, 128)#(x, y, cursor_width, 32)
  
    end

end  
  
#  def update_cursor_rect
#    self.cursor_rect.set(- 12, @index * 104 - 12 , self.width - 4 , 96)
#  end
#end
#===============================================================================
#★ 状态窗口背景
#===============================================================================
class Window_LxBack < Window_Base
  def initialize
    super(0, 0, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
end
#===============================================================================
#★ 重新描绘其它状态窗口,增加描绘转生次数。
#===============================================================================
class Window_Status < Window_Base
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    draw_actor_hp(@actor, 96, 112, 172)
    draw_actor_sp(@actor, 96, 144, 172)
    draw_actor_parameter(@actor, 96, 192, 0)
    draw_actor_parameter(@actor, 96, 224, 1)
    draw_actor_parameter(@actor, 96, 256, 2)
    draw_actor_parameter(@actor, 96, 304, 3)
    draw_actor_parameter(@actor, 96, 336, 4)
    draw_actor_parameter(@actor, 96, 368, 5)
    draw_actor_parameter(@actor, 96, 400, 6)
    draw_actor_xdrs_lx(@actor, 315, 0)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 48, 80, 32, "EXP")
    self.contents.draw_text(320, 80, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 160, 96, 32, "装备")
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end
#==============================================================================

################################################################################
class Window_MenuStatus < Window_Selectable
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
    x = ( i + 1 ) * 92 +25
    y = 44

    @column_max = 4
  
    actor = $game_party.actors
    bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)  
   #   x = 64
    #  y = i * 116
    #  actor = $game_party.actors
#      draw_actor_graphic(actor, x - 40, y + 80)
    draw_actor_xdrs_lx(actor, 60, y)
#     draw_actor_name(actor, x, y)
#     draw_actor_class(actor, x + 144, y)
#     draw_actor_level(actor, x, y + 32)
#     draw_actor_state(actor, x + 90, y + 32)
#     draw_actor_exp(actor, x, y + 64)
#     draw_actor_hp(actor, x + 236, y + 32)
#     draw_actor_sp(actor, x + 236, y + 64)
    end
  end
end[/pre]
3335555.jpg

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2016-2-5 19:53:28 | 显示全部楼层
class Window_Base < Window
  def draw_actor_xdrs_lx(actor, x, y)
    self.contents.font.color = text_color(3)
    self.contents.draw_text(8, 32, 120, 32, "转生次数:")
    i =  actor.id + LX_VARIABLE
    #self.z = 0
    self.contents.font.color = text_color(6)
    self.contents.draw_text(x,y, 80, 32, $game_variables[i].to_s)
  end
end
这段备份尝试自己修改一些参数
回复

使用道具 举报

梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2016-2-5 21:03:31 | 显示全部楼层
夜狠简单 发表于 2016-2-5 19:53
class Window_Base < Window
  def draw_actor_xdrs_lx(actor, x, y)
    self.contents.font.color = text ...


这段我改了,一下午了就就是没完成, 原来角色是竖者排的,用到横排的角色就重叠了,我不会脚本


回复

使用道具 举报

梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2016-2-5 21:12:21 | 显示全部楼层
夜狠简单 发表于 2016-2-5 19:53
class Window_Base < Window
  def draw_actor_xdrs_lx(actor, x, y)
    self.contents.font.color = text ...
  1. class Window_MenuStatus < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #--------------------------------------------------------------------------
  5.     def initialize(actor_index = 0, equip_index = 0)#def initialize(index = 0)
  6.     super(0, 64, 1200, 480)
  7.     self.contents = Bitmap.new(width - 32, height - 32)
  8.     refresh
  9.    # self.active = index
  10.     self.index =  index
  11.    # equip_index =

  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 刷新
  15.   #--------------------------------------------------------------------------
  16.     def refresh
  17.    
  18.     self.contents.clear
  19.    # @item_max = 4 #$game_party.actors.size
  20.   #  @item_may = 4
  21.   #  @column_max = 4
  22.   #  for i in 0...4   #$game_party.actors.size
  23.      
  24.    #   x = i * 116
  25.     #  y = 0
  26.       
  27.     @item_max = $game_party.actors.size
  28.     for i in 0...$game_party.actors.size
  29.     x = ( i + 1 ) * 92 +25
  30.     y = 44

  31.     @column_max = 4
  32.      

  33.     actor = $game_party.actors[i]
  34.     bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
  35.     cw = bitmap.width
  36.     ch = bitmap.height
  37.     src_rect = Rect.new(0, 0, cw, ch)
  38.     self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)
  39.      draw_actor_xdrs_lx(actor, 60, y)

  40.     #draw_actor_graphic(actor, x - 40, y + 80)
  41.      # draw_actor_name(actor, x, y)
  42. #      draw_actor_class(actor, x + 144, y)
  43. #      draw_actor_level(actor, x, y + 32)
  44. #     draw_actor_state(actor, x + 90, y + 32)
  45. #      draw_actor_exp(actor, x, y + 64)
  46. #      draw_actor_hp(actor, x + 236, y + 32)
  47. #      draw_actor_sp(actor, x + 236, y + 64)
  48.     #self.contents.draw_text(x - ch - 30 , y - cw/ 2, 84, 120, "转生次数:")
  49. #    draw_item(i)
  50.     end
  51.   end
  52.     def index=(index)
  53.     @index = index
  54.     # 刷新帮助文本 (update_help 定义了继承目标)
  55.     if self.active and @help_window != nil
  56.       update_help
  57.     end
  58.     # 刷新光标矩形
  59.     update_cursor_rect
  60.   end
  61.   
  62.   #--------------------------------------------------------------------------
  63.   # ● 更新光标举行
  64.   #--------------------------------------------------------------------------
  65.   def draw_item(index, color, font_name)
  66.     self.contents.font.color = color
  67.     self.contents.font.name = font_name
  68.     rect = Rect.new(113 * index, 4, self.contents.width - 128, 32)
  69.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  70.     self.contents.draw_text(rect, @menustatus[index])
  71.   end
  72. # def draw_item(index, color = normal_color)
  73. #   self.contents.font.color = color
  74. #   x = 104 + index * 80 + 40
  75. #    self.contents.draw_text(x-11, 0, 44, 32, @menustatus[index])
  76. # end
  77.   #--------------------------------------------------------------------------
  78.   # ● 项目无效化
  79.   #     index : 项目编号
  80.   #--------------------------------------------------------------------------
  81.   def disable_item(index)
  82.     draw_item(index, disabled_color)
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 刷新光标矩形
  86.   #--------------------------------------------------------------------------
  87. def update_cursor_rect
  88.     # 光标位置不满 0 的情况下
  89.     if @index <= -1
  90.       self.cursor_rect.empty
  91.       
  92.       return
  93.     end
  94.     # 获取当前的行
  95. #    row = @index / @column_max
  96.     # 当前行被显示开头行前面的情况下
  97.   #  if row < self.top_row
  98.       # 从当前行向开头行滚动
  99. #     self.top_row = row
  100. #   end
  101.     # 当前行被显示末尾行之后的情况下
  102. #   if row > self.top_row + (self.page_row_max - 1)
  103.       # 从当前行向末尾滚动
  104. #     self.top_row = row - (self.page_row_max - 1)
  105. #   end
  106.     # 计算光标的宽
  107.     cursor_width = 90
  108.     #cursor_width = 536 / (@column_max + 1) + 1  #光标大小
  109.     # 计算光标坐标
  110.    
  111.     x = 0 + @index % @column_max * (cursor_width + 1) - 4 #光标位置调节 覆盖31行
  112.     y = @index / @column_max * 32 - self.oy
  113.     # 更新国标矩形
  114.     self.cursor_rect.set(x, y, cursor_width, 128)#(x, y, cursor_width, 32)
  115.   
  116.     end

  117. end
复制代码
回复

使用道具 举报

梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2016-2-5 21:13:41 | 显示全部楼层
本帖最后由 金芒芒 于 2016-2-5 21:21 编辑
夜狠简单 发表于 2016-2-5 19:53
class Window_Base < Window
  def draw_actor_xdrs_lx(actor, x, y)
    self.contents.font.color = text ...


也可能是我的状态脚本出的问题  https://yunpan.cn/crTUptEX6J6bw (提取码:58eb)
状态脚本位置.jpg
Window base 脚本位置.jpg
回复

使用道具 举报

梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2016-2-6 00:00:18 | 显示全部楼层
360截图20160205235851242.jpg
脚本好多

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2016-2-6 08:14:01 | 显示全部楼层
本帖最后由 金芒芒 于 2016-2-6 08:17 编辑
夜狠简单 发表于 2016-2-6 00:00
脚本好多


就是这个X不知道是加什么还是-什么我把它换成(i+1)*95+25也分不开,你说脚本多这些还是只有菜单篇,还有战斗篇还没开始呢
回复

使用道具 举报

梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2016-2-6 09:06:44 | 显示全部楼层
夜狠简单 发表于 2016-2-6 00:00
脚本好多

X-CH就出来3Q温州小美女,有空来藤桥玩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部