#encoding:utf-8
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 战斗画面·改
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 更新信息显示的显示端口
#--------------------------------------------------------------------------
def update_info_viewport
# move_info_viewport(0) if @party_command_window.active
move_info_viewport(128) if @actor_command_window.active
move_info_viewport(64) if BattleManager.in_turn?
end
#--------------------------------------------------------------------------
# ● 信息窗口打开时的更新
# 在状态窗口关闭完成前,信息窗口的打开度设置为 0 。
#--------------------------------------------------------------------------
def update_message_open
if $game_message.busy? && !@status_window.close?
@message_window.openness = 0
@status_window.close
# @party_command_window.close
@actor_command_window.close
end
end
#--------------------------------------------------------------------------
# ● 生成所有窗口
#--------------------------------------------------------------------------
def create_all_windows
create_message_window
create_scroll_text_window
create_log_window
create_status_window
create_info_viewport
# create_party_command_window
create_actor_command_window
create_help_window
create_skill_window
create_item_window
create_actor_window
create_enemy_window
end
#--------------------------------------------------------------------------
# ● 生成角色指令窗口
#--------------------------------------------------------------------------
def create_actor_command_window
@actor_command_window = Window_ActorCommand.new
@actor_command_window.viewport = @info_viewport
@actor_command_window.set_handler(:attack, method(:command_attack))
@actor_command_window.set_handler(:skill, method(:command_skill))
@actor_command_window.set_handler(:guard, method(:command_guard))
@actor_command_window.set_handler(:item, method(:command_item))
@actor_command_window.set_handler(:escape, method(:command_escape))
@actor_command_window.set_handler(:cancel, method(:prior_command))
@actor_command_window.x = Graphics.width
end
#--------------------------------------------------------------------------
# ● 开始队伍指令的选择
#--------------------------------------------------------------------------
def start_party_command_selection
unless scene_changing?
refresh_status
@status_window.unselect
@status_window.open
if BattleManager.input_start
# @actor_command_window.close
# @party_command_window.setup
@actor_command_window.active
command_fight
else
# @party_command_window.deactivate
turn_start
end
end
end
#--------------------------------------------------------------------------
# ● 开始角色指令的选择
#--------------------------------------------------------------------------
def start_actor_command_selection
@status_window.select(BattleManager.actor.index)
# @party_command_window.close
@actor_command_window.setup(BattleManager.actor)
end
#--------------------------------------------------------------------------
# ● 回合开始
#--------------------------------------------------------------------------
def turn_start
# @party_command_window.close
@actor_command_window.close
@status_window.unselect
@subject = nil
BattleManager.turn_start
@log_window.wait
@log_window.clear
end
end
#==============================================================================
# ■ Window_ActorCommand·改
#------------------------------------------------------------------------------
# 战斗画面中,选择角色行动的窗口。
#==============================================================================
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
return unless @actor
add_attack_command
add_skill_commands
add_guard_command
add_item_command
add_escape_command
end
#--------------------------------------------------------------------------
# ● 添加逃跑指令
#--------------------------------------------------------------------------
def add_escape_command
add_command(Vocab::escape, :escape, BattleManager.can_escape?)
end
end