查看: 2429|回复: 3

[已经解决] 请教,关于升级加点脚本,如何在开启某个变量或者开关后

[复制链接]
梦石
0
星屑
50
在线时间
41 小时
注册时间
2014-8-7
回帖
53
发表于 2014-12-27 04:45:46 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 RyanBern 于 2014-12-27 09:42 编辑

关于升级加点脚本,如何在开启某个变量或者开关后,
角色每升一级所增加的点数 在原有的基础上额外增加一点呢? 谢谢各位大大。
用的脚本是下面的这个:

[pre lang="Ruby"]#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


# 脚本使用设定:


LEVEL_UP_POINT = 4  # 每升一级所增加的点数
LEVEL_UP_VARIABLE = 100  # 储存角色点数的变量编号与角色id编号的差值
                         # 默认情况 = 100,
                         # 则是数据库里1号角色的加点数存于101号变量
                         # 3号角色的加点数存于103号变量。
                         # 你可以直接操作变量赠与角色可分配点数

# 每增加一次点数,各项能力值的变化:357-410行
                        
# 使用方法介绍:

# 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
# 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
# 1-99级全部等于一个相同数值就行了。

# 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
# 默认都是0号

# 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
# 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new

# 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG

#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  处理角色的类。(再定义)
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 更改 EXP
  #     exp : 新的 EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    @exp = [exp, 0].max
    # 升级
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # 增加4点可自由分配的点数
      if self.id > 30
      $game_variables[self.id + LEVEL_UP_VARIABLE] += 5
    else
      $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
      ($db_point[@actor_id])[5] += LEVEL_UP_POINT #加的1行
    end
      # 学会特技
      for j in $data_classes[@class_id].learnings
        
        if j.level == @level
          if @level >= 99
          else
          learn_skill(j.skill_id)
          end
        end
      end
    end
    # 降级
    while @exp < @exp_list[@level]
      # 遗忘特技
      for j in $data_classes[@class_id].learnings
        
        if j.level == @level
          if @level >= 99
          else
          forget_skill(j.skill_id)
          end
        end
      end
      @level -= 1
    end
    # 修正当前的 HP 与 SP 超过最大值
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
    $game_temp.common_event_id = 178
  end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  游戏中全部窗口的超级类(追加定义)
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● 描绘 HP
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     width : 描画目标的宽
  #--------------------------------------------------------------------------
  def draw_actor_hp_lvup(actor, x, y)
    self.contents.font.color = Color.new(79,39,0,255)
    if $temp_hp == 0
      self.contents.font.color = Color.new(79,39,0,255)
      self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
    else
      maxhp = actor.maxhp + $temp_hp.to_i
      self.contents.font.color = Color.new(79,39,0,255)
#      self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
      self.contents.font.color = normal_color      
#      self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
      if $temp_hp >=0
        self.contents.font.color = Color.new(0, 255, 0)
        self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
#        self.contents.draw_text(x + 155, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(0, 255, 0)
        self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
#        self.contents.draw_text(x + 155, y, 36, 32, " -",2)
      end
#      self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
      self.contents.font.color = Color.new(79,39,0,255)
#      self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘 SP
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     width : 描画目标的宽
  #--------------------------------------------------------------------------
  def draw_actor_sp_lvup(actor, x, y)
    self.contents.font.color = Color.new(79,39,0,255)
    if $temp_sp == 0
      self.contents.font.color = Color.new(79,39,0,255)
      self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
    else
      maxsp = actor.maxsp + $temp_sp.to_i
      self.contents.font.color = Color.new(79,39,0,255)
#      self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
      self.contents.font.color = normal_color      
#      self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
      if $temp_sp >=0
        self.contents.font.color = Color.new(0, 255, 0)
        self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
#        self.contents.draw_text(x + 155, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(0, 255, 0)
        self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
#        self.contents.draw_text(x + 155, y, 36, 32, " -",2)
      end
#      self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
      self.contents.font.color = Color.new(79,39,0,255)
#      self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘能力值
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     type  : 能力值种类 (0~4)
  #--------------------------------------------------------------------------
  def draw_actor_lvup(actor, x, y, type)   
    # 定义数字颜色
    lvup = Color.new(79,39,0,255)   
    upcolor = Color.new(0, 255, 0)
    downcolor = Color.new(79,39,0,255)
    self.contents.font.color = normal_color   
    case type
    when 0
        parameter_name = $data_system.words.str
        parameter_value = actor.str
        parameter_value_temp = parameter_value + $temp_str.to_i
      if $temp_str != 0
#        lvup = upcolor
#        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_str >= 0
          lvup = upcolor
          self.contents.font.color = lvup
          parameter_name = $data_system.words.str
          parameter_value = actor.str
#          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          lvup = downcolor
          self.contents.font.color = lvup#Color.new(255,255,0,255)
          parameter_name = $data_system.words.str
          parameter_value = actor.str
#          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
#        self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
        self.contents.font.color = Color.new(255, 0, 0)
#        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 1
      parameter_name = $data_system.words.dex
      parameter_value = actor.dex
      parameter_value_temp = parameter_value + $temp_dex.to_i
      if $temp_dex != 0
#        lvup = upcolor
#        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_dex >= 0
          lvup = upcolor
          self.contents.font.color = lvup
          parameter_name = $data_system.words.dex
          parameter_value = actor.dex
#          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          lvup = downcolor
          self.contents.font.color = lvup#Color.new(255,255,0,255)
          parameter_name = $data_system.words.dex
          parameter_value = actor.dex
#          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
#        self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
        self.contents.font.color = Color.new(255, 0, 0)
#        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 2
      parameter_name = $data_system.words.agi
      parameter_value = actor.agi
      parameter_value_temp = parameter_value + $temp_agi.to_i
      if $temp_agi != 0
#        lvup = upcolor
#        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_agi >= 0
          lvup = upcolor
          self.contents.font.color = lvup
          parameter_name = $data_system.words.agi
          parameter_value = actor.agi
#          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          lvup = downcolor
          self.contents.font.color = lvup#Color.new(255,255,0,255)
          parameter_name = $data_system.words.agi
          parameter_value = actor.agi
#          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
#        self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
        self.contents.font.color = Color.new(255, 0, 0)
#        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 3
      parameter_name = $data_system.words.int
      parameter_value = actor.int
      parameter_value_temp = parameter_value + $temp_int.to_i
      if $temp_int != 0
#        lvup = upcolor
#        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_int >= 0
          lvup = upcolor
          self.contents.font.color = lvup
          parameter_name = $data_system.words.int
          parameter_value = actor.int
#          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          lvup = downcolor
          self.contents.font.color = lvup#Color.new(255,255,0,255)
          parameter_name = $data_system.words.int
          parameter_value = actor.int
#          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
#        self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
        self.contents.font.color = Color.new(255, 0, 0)
#        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 4
      parameter_name = ""
      parameter_value = $point
      if $point != 0
        lvup = upcolor
      end
    end   
    self.contents.font.color = Color.new(79,39,0,255)
    self.contents.draw_text(x, y, 120, 32, parameter_name)
    self.contents.font.color = Color.new(79,39,0,255)
    self.contents.draw_text(x + 450, y, 36, 32, parameter_value.to_s)   
    if type != 4
      self.contents.draw_text(x + 480, y, 36, 32, " →")
    end  
    self.contents.font.color = lvup
    self.contents.draw_text(x + 510, y, 60, 32, parameter_value_temp.to_s)
    self.contents.font.color = Color.new(79,39,0,255)  
  end
end
#==============================================================================
# ■ Window_lvup
#------------------------------------------------------------------------------
#  显示升级状态窗口。
#==============================================================================
class Window_Lvup < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 712, 999)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_ap2(@actor, -15,-16)
    draw_actor_class(@actor, 90,344)
    draw_actor_name(@actor, 90, 327)
    draw_actor_level(@actor, 90,368)
    draw_actor_state1(@actor, 188, 363)   
    draw_actor_hp_lvup(@actor, 302, 190)
    draw_actor_sp_lvup(@actor, 302, 215)
    draw_actor_lvup(@actor, -30, 253, 0)
    draw_actor_lvup(@actor, -30, 278, 1)
    draw_actor_lvup(@actor, -30, 301, 2)
    draw_actor_lvup(@actor, -30, 325, 3)
    draw_actor_lvup(@actor, 0, 350, 4)
  end
  #--------------------------------------------------------------------------
  # ● 名前の描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y, cx = 0, size = 16)
    self.contents.font.size = 16
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = Color.new(79,39,0,255)
    draw_text_normal(x, y, 236, 24, actor.name)
  end
  #--------------------------------------------------------------------------
  # ● クラスの描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_actor_class(actor, x, y, cx = 0, size = 16)
    self.contents.font.size = 16
    self.contents.font.color = Color.new(79,39,0,255)
    self.contents.draw_text(x, y, 236, 32, actor.class_name)
  end
  #--------------------------------------------------------------------------
  # ● 等级描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_actor_level(actor, x, y, cx = 0, size = 16)
    self.contents.font.size = size
    self.contents.font.italic = true
    self.contents.font.color = Color.new(79,39,0,255)
    draw_text_normal(x, y, 24, 24, actor.level.to_s)
    self.contents.font.italic = false
  end
  #--------------------------------------------------------------------------
  # ● 描绘状态
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     width : 描画目标的宽
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, cx = 0, size = 16)
    self.contents.font.size = size
    self.contents.font.italic = true
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = Color.new(79,39,0,255)
    self.contents.draw_text(x, y, width, 32, text)
    self.contents.font.italic = false
  end
  #--------------------------------------------------------------------------
  # ★ 文字列(影つき:通常色・無効色あり)の描画
  #--------------------------------------------------------------------------
  def draw_text_custom(x, y, width, height, str, color, align = 0)
    self.contents.font.size = 16
    self.contents.font.color = Color.new(79,39,0,255)

    self.contents.draw_text(x, y, width, height, str, align)
  end
  #--------------------------------------------------------------------------
  # ★ 文字列(影つき:通常色)の描画
  #--------------------------------------------------------------------------
  def draw_text_normal(x, y, width, height, str, align = 0)
    self.contents.font.size = 16
    self.contents.font.color = Color.new(79,39,0,255)

    self.contents.draw_text(x, y, width, height, str, align)
  end
end
#==============================================================================
# ■ Scene_lvup
#------------------------------------------------------------------------------
#  处理升级画面的类。
#==============================================================================
class Scene_Lvup
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor_index : 角色索引
  #     menu_index : 选项起始位置
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0 , menu_index = 0)
    @actor_index = actor_index
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    @a = Sprite.new
    @a.bitmap = Bitmap.new("Graphics/Pictures/菜单类/加点菜单.png")
    @a.opacity=255
    s1 = ""
    s2 = ""
    s3 = ""
    s4 = ""
    s5 = ""
    s6 = ""
    s7 = ""
    @command_window = Window_Commandjd.new(128, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    @command_window.x = 185
    @command_window.y = 94#416
    # 获取角色
    @actor = $game_party.actors[@actor_index]
    # 将角色的剩余点数带入
    $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
    # 初始化临时量
    $temp_str = 0
    $temp_dex = 0
    $temp_agi = 0
    $temp_int = 0
    $temp_hp = 0
    $temp_sp = 0
    #=========================================================================
    # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
    #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
    #=========================================================================
    # 每提升一次力量,提升多少附加能力
    #=========================================================================
    @str_hp = 0     # 每提升一次力量附加提升多少HP
    @str_sp = 0     # 每提升一次力量附加提升多少SP
    @str_dex = 0    # 每提升一次力量附加提升多少灵巧
    @str_agi = 0.1    # 每提升一次力量附加提升多少速度
    @str_int = 0      # 每提升一次力量附加提升多少魔力
    @str_str = 5.2    # 每提升一次力量附加提升多少力量
    #=========================================================================
    # 每提升一次灵巧,提升多少附加能力
    #=========================================================================
    @dex_hp = 15     # 每提升一次速度附加提升多少HP
    @dex_sp = 0     # 每提升一次速度附加提升多少SP
    @dex_str = 0    # 每提升一次速度附加提升多少力量
    @dex_dex = 2.6    # 每提升一次速度附加提升多少灵巧
    @dex_int = 0    # 每提升一次速度附加提升多少魔力
    @dex_agi = 0    # 每提升一次速度附加提升多少速度
    #=========================================================================
    # 每提升一次速度,提升多少附加能力
    #=========================================================================
    @agi_hp = 0     # 每提升一次速度附加提升多少HP
    @agi_sp = 0     # 每提升一次速度附加提升多少SP
    @agi_str = 0    # 每提升一次速度附加提升多少力量
    @agi_dex = 0  # 每提升一次速度附加提升多少灵巧
    @agi_int = 0.1    # 每提升一次速度附加提升多少魔力
    @agi_agi = 5.2    # 每提升一次速度附加提升多少速度
    #=========================================================================
    # 每提升一次魔力,提升多少附加能力
    #=========================================================================
    @int_hp = 0     # 每提升一次魔力附加提升多少HP
    @int_sp = 60    # 每提升一次魔力附加提升多少SP
    @int_str = 0   # 每提升一次魔力附加提升多少力量
    @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
    @int_agi = 0   # 每提升一次魔力附加提升多少速度
    @int_int = 5.2   # 每提升一次魔力附加提升多少魔力
    #=========================================================================
    # 每提升一次体力,提升多少附加能力
    #=========================================================================
    @hp = 80       # 每提升一次体力提升多少HP
    @sp = 20       # 每提升一次体力提升多少SP
    @hp_str = 0   # 每提升一次体力提升多少力量
    @hp_dex = 0   # 每提升一次体力提升多少速度
    @hp_agi = 0   # 每提升一次体力提升多少灵巧
    @hp_int = 0   # 每提升一次体力提升多少魔力   
    # 定义说明文字
    @text_hp_sc = "体力可以增加生存的能力,可以延长生存的时间!"
    @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
    @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和必杀!和普通防御"
    @text_agi_sc = $data_system.words.agi + "可以提高回避、命中、逃跑成功率!"
    @text_int_sc = $data_system.words.int + "可以提高魔法的效果,可以增加1点魔法!和魔法防御"
    @text_save = "保存分配情况并返回游戏"
    @text_reset= "重新分配能力点数"
    @text_2 = "每增加一次此项能力值,可以提升能力值"
    @text_hp = "最大" + $data_system.words.hp + "值"
    @text_sp = "最大" + $data_system.words.sp + "值"
    @text_str = "最大" + $data_system.words.str + "值"
    @text_dex = "最大" + $data_system.words.dex + "值"
    @text_agi = "最大" + $data_system.words.agi + "值"
    @text_int = "最大" + $data_system.words.int + "值"
    s_disable
    # 生成状态窗口
    @lvup_window = Window_Lvup.new(@actor)
    @lvup_window.x = 0
    @lvup_window.y = 0     
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果切换画面就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @command_window.dispose
    @lvup_window.dispose
    @a.dispose
    @系统菜单.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
   
   
lcy = []
m = 0
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor.id <= 22
lcy[m] = i
m += 1
end
end

   
    # 刷新窗口
    @command_window.update
    # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
    s_disable
    @lvup_window.update
    #=============================================================
    # 按下 B 键的情况下
    #=============================================================
    if Input.trigger?(Input::B)
        for i in 0..4 #加的3行
          ($db_point[@actor.id]) = ($db_point_old[@actor.id])
        end
        for i in 0..4 #加的3行
          ($db_point_old[@actor.id]) = ($db_point[@actor.id])
        end
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 切换到地图画面
      $scene = Scene_Atactor1.new
      return
    end
    #=============================================================
    # 按下 C 键的情况下
    #=============================================================
    if Input.trigger?(Input::C)      
      if @command_window.index == 6
        for i in 0..4 #加的3行
          ($db_point_old[@actor.id]) = ($db_point[@actor.id])
        end
        for i in 0..4 #加的3行
          ($db_point[@actor.id]) = ($db_point_old[@actor.id])
        end
          # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 将角色的剩余点数带回
        $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
        # 将角色点数实际加上
        @actor.str += $temp_str
        @actor.dex += $temp_dex
        @actor.agi += $temp_agi
        @actor.int += $temp_int
        @actor.maxhp += $temp_hp
        @actor.maxsp += $temp_sp
        
        # 演奏光标 SE
        $game_system.se_play($data_system.cursor_se)
        # 移至下一位角色
        @actor_index += 1
        @actor_index %= lcy.size#$game_party.actors.size
#        p lcy.size
        # 切换到别的状态画面
        $scene = Scene_Lvup.new(@actor_index , @command_window.index)
#        $scene = Scene_Menu.new(0)
        
        return
      end
      if @command_window.index == 5
        for i in 0..4 #加的3行
          ($db_point[@actor.id]) = ($db_point_old[@actor.id])
        end
        for i in 0..4 #加的3行
          ($db_point_old[@actor.id]) = ($db_point[@actor.id])
        end
          # 演奏确定 SE
        $game_system.se_play($data_system.cancel_se)
          # 将角色的剩余点数带入
        $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
          # 初始化临时量
        $temp_str = 0
        $temp_dex = 0
        $temp_agi = 0
        $temp_int = 0
        $temp_hp = 0
        $temp_sp = 0
        @lvup_window.refresh
        return
      end
      if $point == 0
        # 演奏冻结 SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        if !($db_point_enable[@actor.id])[0] #加的判断
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        else
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_hp += @hp
        $temp_sp += @sp
        $temp_str += @hp_str
        $temp_dex += @hp_dex
        $temp_agi += @hp_agi
        $temp_int += @hp_int
        $point -= 1
        @lvup_window.refresh
        ($db_point[@actor.id])[0] += 1
        s_disable
        return
      end
      when 1
        if !($db_point_enable[@actor.id])[1]#加的判断
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        else
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_str += @str_str
        $temp_hp += @str_hp
        $temp_sp += @str_sp
        $temp_dex += @str_dex
        $temp_agi += @str_agi
        $temp_int += @str_int
        $point -= 1
        @lvup_window.refresh
        ($db_point[@actor.id])[1] += 1
        s_disable
        return
      end
      when 2
        if !($db_point_enable[@actor.id])[2]#加的判断
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        else
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_dex += @dex_dex
        $temp_hp += @dex_hp
        $temp_sp += @dex_sp
        $temp_str += @dex_str
        $temp_agi += @dex_agi
        $temp_int += @dex_int
        $point -= 1
        @lvup_window.refresh
        ($db_point[@actor.id])[2] += 1
        s_disable
        return
      end
      when 3
        if !($db_point_enable[@actor.id])[3]#加的判断
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        else
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_agi += @agi_agi
        $temp_hp += @agi_hp
        $temp_sp += @agi_sp
        $temp_str += @agi_str
        $temp_dex += @agi_dex
        $temp_int += @agi_int
        $point -= 1
        @lvup_window.refresh
        ($db_point[@actor.id])[3] += 1
        s_disable
        return
      end
      when 4
        if !($db_point_enable[@actor.id])[4]#加的判断
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        else
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_int += @int_int
        $temp_hp += @int_hp
        $temp_sp += @int_sp
        $temp_str += @int_str
        $temp_dex += @int_dex
        $temp_agi += @int_agi
        $point -= 1
        @lvup_window.refresh
        ($db_point[@actor.id])[4] += 1
        s_disable
        return
      end
    end
  end
    #=============================================================
    # 什么都没有按下的情况
    #=============================================================
    case @command_window.index   
    when 0  # 增加体力
      temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
      temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"

    when 1  # 增加力量
      temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
      temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"

    when 2  # 增加灵巧
      temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
      temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"

    when 3  # 增加速度
      temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
      temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"

    when 4  # 增加魔力
      temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
      temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"

    when 6 # 保存设定
#      @help_window.lvup_text(@text_save)
    when 5 # 点数重置
#      @help_window.lvup_text(@text_reset)     
   
  end

    #=============================================================
    # 按下R与L换人的情况
    #=============================================================      
    if Input.trigger?(Input::R)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至下一位角色
      @actor_index += 1
      @actor_index %= lcy.size#$game_party.actors.size
      # 切换到别的状态画面
      $scene = Scene_Lvup.new(@actor_index , @command_window.index)
      return
    end
    # 按下 L 键的情况下
    if Input.trigger?(Input::L)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至上一位角色
      @actor_index += lcy.size - 1#$game_party.actors.size - 1
      @actor_index %= lcy.size#$game_party.actors.size
      # 切换到别的状态画面
      $scene = Scene_Lvup.new(@actor_index , @command_window.index)
      return
    end

  end  
  #--------------------------------------------------------------------------
  # ● 选项明暗判断
  #--------------------------------------------------------------------------
  def s_disable
    # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
    if $point == 0
      @command_window.contents.font.color = Color.new(255, 255, 255, 128)
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
      @command_window.disable_item(4)
    else
      @command_window.contents.font.color = Color.new(255, 255, 255, 255)
      @command_window.able_item(0)
      @command_window.able_item(1)      
      @command_window.able_item(2)
      @command_window.able_item(3)
      @command_window.able_item(4)
      for i in 0 ..4 #加的判断
        if !($db_point_enable[@actor.id]) = ($db_point[@actor.id]) < (($db_point[@actor.id])[5] / 2)
          @command_window.contents.font.color = Color.new(255, 255, 255, 128)
          @command_window.disable_item(i)         
        end
      end
    end
  end
end[/pre]

评分

参与人数 1星屑 +35 收起 理由
︶ㄣ牛排ぶ + 35 手动认可奖励

查看全部评分

梦石
0
星屑
9557
在线时间
5074 小时
注册时间
2013-6-21
回帖
3459

开拓者贵宾剧作品鉴家

发表于 2014-12-27 09:58:18 | 显示全部楼层
本帖最后由 RyanBern 于 2014-12-27 19:10 编辑

脚本好像是经过了一些修改,想实现这一效果并不难,脚本的48行那里:
[pre lang="Ruby"]if self.id > 30
  $game_variables[self.id + LEVEL_UP_VARIABLE] += 5
else
  $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  ($db_point[@actor_id])[5] += LEVEL_UP_POINT #加的1行
end[/pre]
这里的意思是说,如果角色id大于30,那么升1级就加5点,否则就增加LEVEL_UP_POINT(这里的设定是4),下面那个$db_point没来及看是什么意思,不过为了保持一致性就一起改好了。
例如,打开开关1,角色(id在30以下)升一级获得额外2点(2+4=6)
[pre lang="Ruby"]if self.id > 30
  $game_variables[self.id + LEVEL_UP_VARIABLE] += 5
else
  ##修改
  # 打开开关1,id为3的角色额外获得2点,打开开关2,id为4的角色额外获得2点,以此类推
  extra_point = $game_switches[self.id - 2] ? 2 : 0
  $game_variables[self.id + LEVEL_UP_VARIABLE] += (LEVEL_UP_POINT + extra_point)
  ($db_point[@actor_id])[5] += (LEVEL_UP_POINT + extra_point)#加的1行
end[/pre]

点评

啊啊。可以了,非常感谢大人您。么么哒 谢谢您了跪谢  发表于 2014-12-27 20:32

评分

参与人数 1星屑 +200 收起 理由
︶ㄣ牛排ぶ + 200 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
41 小时
注册时间
2014-8-7
回帖
53
 楼主| 发表于 2014-12-27 16:37:22 | 显示全部楼层
RyanBern 发表于 2014-12-27 09:58
脚本好像是经过了一些修改,想实现这一效果并不难,脚本的48行那里:
if self.id > 30
  $game_variables[s ...

谢谢大大,那个不好意思,还想请问一下。。如果是 开关1打开 角色3 升级额外多一点,其他角色升级点数不变,开关2打开角色4额外多一点,以此类推,这种这么做呢? 不好意思谢谢您

点评

2L已经编辑,再去试试看行不行  发表于 2014-12-27 19:10
回复

使用道具 举报

梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2014-12-27 19:16:08 | 显示全部楼层
把 if self.id > 30下面的一部分脚本换成

  1.     if self.id > 30
  2.       $game_variables[self.id + LEVEL_UP_VARIABLE] += 5
  3.     else
  4.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  5.       ($db_point[@actor_id])[5] += LEVEL_UP_POINT #加的1行
  6.       ($db_point[@actor_id])[5] += 1 if $game_switches[1]#1号开关打开
  7.     end
  8.     $game_variables[self.id + LEVEL_UP_VARIABLE] += 1 if $game_switches[1]#1号开关打开
复制代码

点评

谢谢大  发表于 2014-12-27 20:32
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部