# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@help_window.dispose
#@mhelp_window.dispose
@gold_window.dispose
@buy_window.dispose
@status_window.dispose
@command_window.dispose
screen.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@help_window.update
#@mhelp_window.update
@gold_window.update
@buy_window.update
@status_window.update
@command_window.update
# 购买窗口激活的情况下: 调用 update_buy
if @buy_window.active
update_buy
return
end
if @status_window.active
update_status
return
end
if @command_window.active
update_command
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (指令窗口激活的情况下)
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@status_window.index = -1
@command_window.active = false
@command_window.visible = false
@buy_window.active = true
return
end
if Input.trigger?(Input::C)
$can_learn=false
for j in $data_classes[$game_party.actors[@status_window.index].class_id].learnings
if j.skill_id == @skill.id
$can_learn=true
end
end
if @command_window.index == 1
if $game_party.actors[@status_window.index].skill_learn?(@skill.id) == false
$game_system.se_play($data_system.cancel_se)
return
else
$game_system.se_play($data_system.decision_se)
if $mShop_use_variable == 0
$game_party.gain_gold(@skill.price/2) #<-遗忘价格为学习的一半,/2的地方相同
$mShop_gold += @skill.price/2
else
$game_variables[$mShop_use_variable] += @skill.price/2
$mShop_gold += @skill.price/2
end
$game_party.actors[@status_window.index].forget_skill(@skill.id)
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
@status_window.index = -1
@buy_window.active = true
@command_window.active = false
@command_window.visible = false
end
elsif @command_window.index == 0
$nomoney=false
if $mShop_gold - @skill.price < 0
$nomoney=true
end
if $nomoney==true
$game_system.se_play($data_system.cancel_se)
return
end
if $can_learn==false
$game_system.se_play($data_system.cancel_se)
return
end
if $game_party.actors[@status_window.index].skill_learn?(@skill.id)
$game_system.se_play($data_system.cancel_se)
return
else
$game_system.se_play($data_system.decision_se)
if $mShop_use_variable == 0
$game_party.gain_gold([email protected])
$mShop_gold -= @skill.price
else
$game_variables[$mShop_use_variable] -= @skill.price
$mShop_gold -= @skill.price
end
$game_party.actors[@status_window.index].learn_skill(@skill.id)
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
@status_window.index = -1
@buy_window.active = true
@command_window.active = false
@command_window.visible = false
end