#==============================================================================
# ■ Scene_chuzhan
#------------------------------------------------------------------------------
# 处理菜单画面的类。
#==============================================================================
class Scene_chuzhan
#--------------------------------------------------------------------------
# ● 初始化对像
# chuzhan_index : 命令光标的初期位置
#--------------------------------------------------------------------------
def initialize(chuzhan_index = 0)
@chuzhan_index = chuzhan_index
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成命令窗口
s1 = "出战1"
s2 = "出战2"
s3 = "出战3"
s4 = "出战4"
s5 = "出战5"
@command1_window = Window_Chuzhan_Command.new(300, [s1, s2, s3, s4, s5])
@command1_window.index = @chuzhan_index
# 禁止存档的情况下
if $game_system.save_disabled
# 存档无效
@command1_window.disable_item(4)
end
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果切换画面就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@command1_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@command1_window.update
# 命令窗口被激活的情况下: 调用 update_command
if @command1_window.active
update_command
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (命令窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_Map.new
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置分支
case @command1_window.index
when 0 # 队组1出生点
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到物品画面
# $game_switches[队伍1] = true #/ false
$game_switches[20] = true
$game_switches[21] = false
$game_switches[22] = false
$game_switches[23] = false
$game_switches[24] = false
$scene = Scene_zhenwei.new
when 1 # 队组2出生点
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
$game_switches[20] = false
$game_switches[21] = true
$game_switches[22] = false
$game_switches[23] = false
$game_switches[24] = false
$scene = Scene_zhenwei.new
when 2 # 队组3出生点
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 激活状态窗口
$game_switches[20] = false
$game_switches[21] = false
$game_switches[22] = true
$game_switches[23] = false
$game_switches[24] = false
$scene = Scene_zhenwei.new
when 3 # 队组4出生点
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
$game_switches[20] = false
$game_switches[21] = false
$game_switches[22] = false
$game_switches[23] = true
$game_switches[24] = false
$scene = Scene_zhenwei.new
when 4 # 队组5出生点
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
$game_switches[20] = false
$game_switches[21] = false
$game_switches[22] = false
$game_switches[23] = false
$game_switches[24] = true
$scene = Scene_zhenwei.new
end
return
end
end
end