查看: 2468|回复: 4

[已经过期] 快速加点

[复制链接]
梦石
0
星屑
3850
在线时间
1899 小时
注册时间
2010-6-19
回帖
917
发表于 2022-8-5 22:51:04 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 黑米馒头 于 2022-8-8 14:12 编辑

下面这个加点脚本,如何修改成,在加点的时候,按下左键,可以一次性加同属性点10点,按下右键,一次减10点~



[pre lang="ruby"]#==============================================================================
# ■ 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
    # 获取角色
    @actor = $game_party.actors[@actor_index]
    # 初始化临时量
    $temp_str = $temp_agi = $temp_int = $temp_hp = $temp_sp =
    $temp_dex = 0
    @temp_gg = @actor.gg
    @temp_lx = @actor.lx
    @temp_ll = @actor.ll
    @temp_mj = @actor.mj
    $point = @actor.qianli
    @qianli_z = $point
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
     #=======================================================================
     # ** 基础设置
     #=======================================================================
     @gg_maxhp = 10 #增加一点根骨,提高 10点 MAXHP
     @gg_maxsp = 0           #增加一点根骨,提高 0 点 MAXSP
     @gg_str = 0             #增加一点根骨,提高 0 点 力量
     @gg_dex = 0             #增加一点根骨,提高 0 点 灵巧
     @gg_agi = 0             #增加一点根骨,提高 0 点 速度
     @gg_int = 0             #增加一点根骨,提高 0 点 魔力
     #=======================================================================
     @lx_maxhp = 0           #增加一点灵性,提高 0 点 MAXHP
     @lx_maxsp = 6 #增加一点灵性,提高 6点 MAXSP
     @lx_str = 0             #增加一点灵性,提高 0 点 力量
     @lx_dex = 0             #增加一点灵性,提高 0 点 灵巧
     @lx_agi = 0             #增加一点灵性,提高 0 点 速度
     @lx_int = 1             #增加一点灵性,提高 1 点 魔力
     #=======================================================================
     @ll_maxhp = 0           #增加一点力量,提高 0 点 MAXHP
     @ll_maxsp = 0           #增加一点力量,提高 0 点 MAXSP
     @ll_str = 1             #增加一点力量,提高 1 点 力量
     @ll_dex = 0             #增加一点力量,提高 0 点 灵巧
     @ll_agi = 0             #增加一点力量,提高 0 点 速度
     @ll_int = 0             #增加一点力量,提高 0 点 魔力
     #=======================================================================
     @mj_maxhp = 0           #增加一点敏捷,提高 0 点 MAXHP
     @mj_maxsp = 0           #增加一点敏捷,提高 0 点 MAXSP
     @mj_str = 0             #增加一点敏捷,提高 0 点 力量
     @mj_dex = 1             #增加一点敏捷,提高 1 点 灵巧
     @mj_agi = 1             #增加一点敏捷,提高 1 点 速度
     @mj_int = 0             #增加一点敏捷,提高 0 点 魔力
     #=======================================================================
     # ** 主命令窗口
     s1 = "增加根骨 #{@temp_gg}"
     s2 = "增加灵性 #{@temp_lx}"
     s3 = "增加力量 #{@temp_ll}"
     s4 = "增加敏捷 #{@temp_mj}"
     s5 = "重新加点"
     s6 = "确认加点"
     @command_window = JD_Command.new(160, [s1, s2, s3, s4, s5, s6])
     @command_window.index = @menu_index
     # ** 状态窗口
     @jddl = JD_DL.new(@actor)
     @jddl.x = 160
     # ** 生成帮助
     @help_window = JD_Help.new([
     "每增加1点根骨:可以提高 1 ~ 8 点 MaxHP",
     "每增加1点灵性:可以提高 1 ~ 8 点 MaxSP,以及 1 点 魔力",
     "每增加1点力量:可以提高 1 点 力量",
     "每增加1点敏捷:可以提高 1 点 灵巧 和 1 点 速度"
     ])
     #=======================================================================
     # ** 以下脚本为非自定义内容!
     #=======================================================================
     # 执行过渡
     Graphics.transition
     # 主循环
     loop {
       Graphics.update
       Input.update
       update
       break if $scene != self
     }
     # 准备过渡
     Graphics.freeze
     # 释放窗口
     @command_window.dispose
     @jddl.dispose
     @help_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    #=============================================================
    # 按下 B 键的情况下
    #=============================================================
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      #===============================================================
      # ** 在这里设置 是返回 菜单 还是返回 地图
      #===============================================================
      # 切换到地图画面
      #$scene = Scene_Map.new # ** 返回地图
      $scene = Scene_Menu.new(6) # ** 返回菜单
      #===============================================================
      return
    end
    # 刷新命令窗口
    @command_window.update
    s1 = "增加根骨 #{@temp_gg}"
    s2 = "增加灵性 #{@temp_lx}"
    s3 = "增加力量 #{@temp_ll}"
    s4 = "增加敏捷 #{@temp_mj}"
    s5 = "重新加点"
    s6 = "确认加点"
    @command_window.commands([s1, s2, s3, s4, s5, s6])
    @command_window.refresh
    #=============================================================
    # 按下 C 键的情况下
    #=============================================================
    if Input.trigger?(Input::C)
       case @command_window.index
       # ** 处理根骨
       when 0
         # 潜力点不够终止处理
         if $point <= 0
           $game_system.se_play($data_system.buzzer_se)
           return
         end
         $point -= 1 # 减去临时点数
         # ** 属性增加
         $temp_hp += @gg_maxhp
         $temp_sp += @gg_maxsp
         $temp_str += @gg_str
         $temp_dex += @gg_dex
         $temp_agi += @gg_agi
         $temp_int += @gg_int
         # ** 根骨增加
         @temp_gg += 1
       # ** 处理灵性
       when 1
         # 潜力点不够终止处理
         if $point <= 0
           $game_system.se_play($data_system.buzzer_se)
           return
         end
         $point -= 1 # 减去临时点数
         # ** 属性增加
         $temp_hp += @lx_maxhp
         $temp_sp += @lx_maxsp
         $temp_str += @lx_str
         $temp_dex += @lx_dex
         $temp_agi += @lx_agi
         $temp_int += @lx_int
         # ** 灵性增加
         @temp_lx += 1
       # ** 处理力量
       when 2
         # 潜力点不够终止处理
         if $point <= 0
           $game_system.se_play($data_system.buzzer_se)
           return
         end
         $point -= 1 # 减去临时点数
         # ** 属性增加
         $temp_hp += @ll_maxhp
         $temp_sp += @ll_maxsp
         $temp_str += @ll_str
         $temp_dex += @ll_dex
         $temp_agi += @ll_agi
         $temp_int += @ll_int
         # ** 力量增加
         @temp_ll += 1
       # ** 处理敏捷
       when 3
         # 潜力点不够终止处理
         if $point <= 0
           $game_system.se_play($data_system.buzzer_se)
           return
         end
         $point -= 1 # 减去临时点数
         # ** 属性增加
         $temp_hp += @mj_maxhp
         $temp_sp += @mj_maxsp
         $temp_str += @mj_str
         $temp_dex += @mj_dex
         $temp_agi += @mj_agi
         $temp_int += @mj_int
         # ** 敏捷增加
         @temp_mj += 1
       when 4
         # 初始化临时量
         $temp_str =
         $temp_agi =
         $temp_int =
         $temp_hp =
         $temp_sp =
         $temp_dex = 0
         @temp_gg = @actor.gg
         @temp_lx = @actor.lx
         @temp_ll = @actor.ll
         @temp_mj = @actor.mj
         $point = @actor.qianli
       when 5
         # ** 确认加点
         @actor.maxhp += $temp_hp
       #  @actor.hp = @actor.maxhp   #(刚开始是这样)
         @actor.hp = @actor.maxhp if $temp_hp > 0  #(后来改成这样)
         @actor.maxsp += $temp_sp
       #  @actor.sp = @actor.maxsp   #(刚开始是这样)
         @actor.sp = @actor.maxsp if $temp_sp > 0  #(后来改成这样)
         @actor.str += $temp_str
         @actor.int += $temp_int
         @actor.agi += $temp_agi
         @actor.dex += $temp_dex
         # 初始化临时量
         $temp_str =
         $temp_agi =
         $temp_int =
         $temp_hp =
         $temp_sp =
         $temp_dex = 0
         # ** 确认属性
         @actor.qianli = $point
         @actor.gg = @temp_gg
         @actor.lx = @temp_lx
         @actor.ll = @temp_ll
         @actor.mj = @temp_mj
       end
       # 演奏确定SE
       $game_system.se_play($data_system.decision_se)
       # 刷新帮助窗口
       @jddl.refresh
   end

   # 按下 R 键的情况下
    if Input.trigger?(Input::R)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至下一位角色
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Lvup.new(@actor_index)
      return
    end
    # 按下 L 键的情况下
    if Input.trigger?(Input::L)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至上一位角色
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Lvup.new(@actor_index)
      return
    end
  end
end[/pre]
梦石
0
星屑
2876
在线时间
172 小时
注册时间
2020-8-9
回帖
100
发表于 2022-8-7 16:35:04 | 显示全部楼层
你在加减点的地方*10呗,如果想保留之前的加点模式,就判断一下点数,超过范围就进入快速加点模式,或者让玩家自己选
回复

使用道具 举报

梦石
1
星屑
24088
在线时间
3339 小时
注册时间
2011-7-8
回帖
3862

开拓者

发表于 2022-8-7 20:36:31 | 显示全部楼层
你这个脚本好像有个漏洞。每次进入场景的时候会随机决定,比如根骨,提高的MAXHP数,而且整个场景不退出就保持不变。那玩家就可以在进去的时候试一下根骨是不是+8HP,不是就切换下一个角色刷新随机数。

点评

那你还要不要改,要的话把新的脚本发出来?  发表于 2022-8-8 10:59
嗯,我后来改成固定数值了  发表于 2022-8-8 10:12
熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部