#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 循环
loop do
# 按照地图、实例、主角的顺序刷新
# (本更新顺序不会在满足事件的执行条件下成为给予角色瞬间移动
# 的机会的重要因素)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# 系统 (计时器)、画面刷新
$game_system.update
$game_screen.update
# 如果主角在场所移动中就中断循环
unless $game_temp.player_transferring
break
end
# 执行场所移动
transfer_player
# 处理过渡中的情况下、中断循环
if $game_temp.transition_processing
break
end
end
# 刷新活动块
@spriteset.update
# 刷新信息窗口
@message_window.update
# 游戏结束的情况下
if $game_temp.gameover
# 切换的游戏结束画面
$scene = Scene_Gameover.new
return
end
# 返回标题画面的情况下
if $game_temp.to_title
# 切换到标题画面
$scene = Scene_Title.new
return
end
# 处理过渡中的情况下
if $game_temp.transition_processing
# 清除过渡处理中标志
$game_temp.transition_processing = false
# 执行过渡
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# 显示信息窗口中的情况下
if $game_temp.message_window_showing
return
end
# 遇敌计数为 0 且、且遇敌列表不为空的情况下
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# 不是在事件执行中或者禁止遇敌中
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# 确定队伍
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# 队伍有效的话
if $data_troops[troop_id] != nil
# 设置调用战斗标志
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 不是在事件执行中或菜单禁止中
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# 设置菜单调用标志以及 SE 演奏
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
# 调试模式为 ON 并且按下 F9 键的情况下
if $DEBUG and Input.press?(Input::F9)
# 设置调用调试标志
$game_temp.debug_calling = true
end
# 不在主角移动中的情况下
unless $game_player.moving?
# 执行各种画面的调用
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end