class Scene_Battle
def main
# 初始化战斗用的各种暂时数据
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# 初始化战斗用事件解释器
$game_system.battle_interpreter.setup(nil, 0)
# 准备队伍
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# 生成角色命令窗口
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
# ★新建选项
s5 = "公共事件"
# ★调整窗口及坐标
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
@actor_command_window.y = 128
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
# 生成其它窗口
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# 生成活动块
@spriteset = Spriteset_Battle.new
# 初始化等待计数
@wait_count = 0
# 执行过渡
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# 开始自由战斗回合
start_phase1
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 刷新地图
$game_map.refresh
# 准备过渡
Graphics.freeze
# 释放窗口
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# 释放活动块
@spriteset.dispose
# 标题画面切换中的情况
if $scene.is_a?(Scene_Title)
# 淡入淡出画面
Graphics.transition
Graphics.freeze
end
# 战斗测试或者游戏结束以外的画面切换中的情况
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end #--------------------------------------------------------------------------
# ● 刷新画面 (角色命令回合 : 基本命令)
#--------------------------------------------------------------------------
def update_phase3_basic_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 转向前一个角色的指令输入
phase3_prior_actor
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 角色指令窗口光标位置分之
case @actor_command_window.index
when 0 # 攻击
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
# 开始选择敌人
start_enemy_select
when 1 # 特技
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 1
# 开始选择特技
start_skill_select
when 2 # 防御
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 转向下一位角色的指令输入
phase3_next_actor
when 3 # 物品
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 2
# 开始选择物品
start_item_select
# ★新建分歧
when 4
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 执行
common_event = $data_common_events[@active_battler.id]
$game_system.battle_interpreter.setup(common_event.list, 0)
# 转到下一位角色的指令输入
phase3_next_actor
end
return
end
end
end