#==============================================================================
# ■ Scene_SwdHCMenu
#------------------------------------------------------------------------------
# 轩辕剑外传·汉之云的菜单画面。
# BY:ad1234a
#==============================================================================
#————————————————————————————————————————
#——————————————————————————————————————
# 我自已增加的内容
#——————————————————————————————————————
class Scene_Map
def call_menu
# 清除商店调用菜单标志
$game_temp.menu_calling = false
# 已经设置了菜单 SE 演奏标志的情况下
if $game_temp.menu_beep
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1020")
# 清除菜单演奏 SE 标志
$game_temp.menu_beep = false
end
# 矫正主角姿势
$game_player.straighten
# 切换到菜单画面
$scene = Scene_SwdhcMenu.new
end
end
#————————————————————————————————————————
class Scene_SwdhcMenu
#--------------------------------------------------------------------------
# ● 初始化对像
# menu_index : 命令光标的初期位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成命令窗口
s2 = " "
s4 = " "
s3 = " "
s1 = " "
s5 = " "
#s6 = "结束游戏"
@command_window = Window_Command.new(160, [s1 , s2, s3, s4, s5])
@command_window.index = @menu_index
@command_window.opacity = 255
@command_window.x = 20
@command_window.y = 20
@command_window.windowskin = RPG::Cache.windowskin("")
# 同伴人数为 0 的情况下
if $game_party.actors.size == 0
# 物品、特技、装备、状态无效化
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# 禁止存档的情况下
if $game_system.save_disabled
# 存档无效
@command_window.disable_item(4)
end
#————————————————————————————————————————
#——————————————————————————————————————
# 我自已增加的内容
#——————————————————————————————————————
randmenu = rand(2)
case randmenu
when 0
#############################
@back = Sprite.new
@back.bitmap = Bitmap.new("Graphics/Pictures/菜单.jpg")
@back.x = 0
@back.y = 0
@back.z = 1
when 1
#############################
@back = Sprite.new
@back.bitmap = Bitmap.new("Graphics/Pictures/菜单2.jpg")
@back.x = 0
@back.y = 0
@back.z = 1
############################
end
@command1 = Sprite.new
@command1.bitmap = Bitmap.new("Graphics/Pictures/cmd3_Starus.png")
@command1.x = 20
@command1.y = 20
@command1.z = 1
############################
@command2 = Sprite.new
@command2.bitmap = Bitmap.new("Graphics/Pictures/cmd4_Item.png")
@command2.x = 20
@command2.y = 80
@command2.z = 1
############################
@command3 = Sprite.new
@command3.bitmap = Bitmap.new("Graphics/Pictures/cmd5_Equip.png")
@command3.x = 20
@command3.y = 140
@command3.z = 1
############################
@command4 = Sprite.new
@command4.bitmap = Bitmap.new("Graphics/Pictures/cmd7_Skill.png")
@command4.x = 25
@command4.y = 195
@command4.z = 1
############################
@command5 = Sprite.new
@command5.bitmap = Bitmap.new("Graphics/Pictures/cmd8_方技.png")
@command5.x = 25
@command5.y = 255
@command5.z = 1
############################
#————————————————————————————————————————
# 生成游戏时间窗口
# @playtime_window = Window_PlayTime.new
# @playtime_window.x = 0
# @playtime_window.y = 224
#生成步数窗口
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 352
# 生成金钱窗口
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# 生成挖矿窗口
@Kuang_window = Window_Kuang.new
@Kuang_window.x = 160
@Kuang_window.y = 416
# 生成开箱窗口
@Xiang_window = Window_Xiang.new
@Xiang_window.x = 320
@Xiang_window.y = 416
# 生成冶炼窗口
@Yelian_window = Window_Yelian.new
@Yelian_window.x = 480
@Yelian_window.y = 416
# 生成制毒窗口
@Du_window = Window_Du.new
@Du_window.x = 480
@Du_window.y = 352
# 生成制符窗口
@Zhifu_window = Window_Zhifu.new
@Zhifu_window.x = 320
@Zhifu_window.y = 352
# 生成状态窗口
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果切换画面就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@command_window.dispose
# @playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@Kuang_window.dispose
@Xiang_window.dispose
@Yelian_window.dispose
@Du_window.dispose
@Zhifu_window.dispose
@status_window.dispose
@back.dispose
#@steps.dispose
@command1.dispose
@command2.dispose
@command3.dispose
@command4.dispose
@command5.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@command_window.update
#@playtime_window.update
#@steps_window.update
@gold_window.update
@status_window.update
case @command_window.index
when 0
@command1.bitmap = Bitmap.new("Graphics/Pictures/cmd3_Starus_02.png")
@command2.bitmap = Bitmap.new("Graphics/Pictures/cmd4_Item.png")
@command3.bitmap = Bitmap.new("Graphics/Pictures/cmd5_Equip.png")
@command4.bitmap = Bitmap.new("Graphics/Pictures/cmd7_Skill.png")
@command5.bitmap = Bitmap.new("Graphics/Pictures/cmd8_方技.png")
when 1
@command1.bitmap = Bitmap.new("Graphics/Pictures/cmd3_Starus.png")
@command2.bitmap = Bitmap.new("Graphics/Pictures/cmd4_Item_02.png")
@command3.bitmap = Bitmap.new("Graphics/Pictures/cmd5_Equip.png")
@command4.bitmap = Bitmap.new("Graphics/Pictures/cmd7_Skill.png")
@command5.bitmap = Bitmap.new("Graphics/Pictures/cmd8_方技.png")
when 2
@command1.bitmap = Bitmap.new("Graphics/Pictures/cmd3_Starus.png")
@command2.bitmap = Bitmap.new("Graphics/Pictures/cmd4_Item.png")
@command3.bitmap = Bitmap.new("Graphics/Pictures/cmd5_Equip_02.png")
@command4.bitmap = Bitmap.new("Graphics/Pictures/cmd7_Skill.png")
@command5.bitmap = Bitmap.new("Graphics/Pictures/cmd8_方技.png")
when 3
@command1.bitmap = Bitmap.new("Graphics/Pictures/cmd3_Starus.png")
@command2.bitmap = Bitmap.new("Graphics/Pictures/cmd4_Item.png")
@command3.bitmap = Bitmap.new("Graphics/Pictures/cmd5_Equip.png")
@command4.bitmap = Bitmap.new("Graphics/Pictures/cmd7_Skill_02.png")
@command5.bitmap = Bitmap.new("Graphics/Pictures/cmd8_方技.png")
when 4
@command1.bitmap = Bitmap.new("Graphics/Pictures/cmd3_Starus.png")
@command2.bitmap = Bitmap.new("Graphics/Pictures/cmd4_Item.png")
@command3.bitmap = Bitmap.new("Graphics/Pictures/cmd5_Equip.png")
@command4.bitmap = Bitmap.new("Graphics/Pictures/cmd7_Skill.png")
@command5.bitmap = Bitmap.new("Graphics/Pictures/cmd8_方技_02.png")
end
# 命令窗口被激活的情况下: 调用 update_command
if @command_window.active
update_command
return
end
# 状态窗口被激活的情况下: 调用 update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (命令窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
Audio.se_play("Audio/SE/汉之云_1021")
# 切换的地图画面
$scene = Scene_Map.new
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 同伴人数为 0、存档、游戏结束以外的场合
if $game_party.actors.size == 0 and @command_window.index < 4
# 演奏冻结 SE
Audio.se_play("Audio/SE/汉之云_1015")
return
end
# 命令窗口的光标位置分支
case @command_window.index
when 0 # 状态
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 激活状态窗口
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 1 # 物品
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 切换到物品画面
$scene = Scene_Item.new
when 2 # 装备
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 激活状态窗口
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # 特技
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 激活状态窗口
@command_window.active = false
@status_window.active = true
@status_window.index = 0
return
when 4 # 存档
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 切换到存档画面
$scene = Scene_MenuBmenu.new
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (状态窗口被激活的情况下)
#--------------------------------------------------------------------------
def update_status
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 激活命令窗口
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置分支
case @command_window.index
when 3 # 特技
# 本角色的行动限制在 2 以上的情况下
if $game_party.actors[@status_window.index].restriction >= 2
# 演奏冻结 SE
Audio.se_play("Audio/SE/汉之云_1015")
return
end
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 切换到特技画面
$scene = Scene_Skill.new(@status_window.index)
when 2 # 装备
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 切换的装备画面
$scene = Scene_Equip.new(@status_window.index)
when 0 # 状态
# 演奏确定 SE
Audio.se_play("Audio/SE/汉之云_1034")
# 切换到状态画面
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
end