#==============================================================================
# ■ 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