赞 | 1 |
VIP | 10 |
好人卡 | 2 |
积分 | 1 |
经验 | 132388 |
最后登录 | 2016-5-9 |
在线时间 | 34 小时 |
Lv1.梦旅人 冰王子
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 34 小时
- 注册时间
- 2008-1-27
- 帖子
- 1875
|
Scene_Menu New!改成这样
- #==============================================================================
- # ■ 仿轩辕剑式的菜单 BY 亿万星辰
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # menu_index : 命令光标的初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- @item_update = false
- @skill_update = false
- @equip_update = false
- @status_update = false
- @sys_update = false
- @equip_status_update = false
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- #----------------------------- 主菜单 -----------------------------------
- # 生成命令窗口
- @command_window = Window_MenuCommand.new(@menu_index)
- # 同伴人数为 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
- # 生成金钱窗口
- @gold_window = Window_Gold.new
- @gold_window.x = 0
- @gold_window.y = 416
- # 生成状态窗口
- @status_window = Window_MenuStatus.new
- @status_window.x = 0
- @status_window.y = 64
- #@status_window = Window_MenuEquip.new
- #@status_window.x = 0
- #@status_window.y = 64
- #@status_window.visible = false
- # 遮蔽窗口
- @dummy_window = Window_Base.new(160, 64, 480, 416)
- @dummy_window.back_opacity = 0
- @dummy_sprite = Sprite.new(Viewport.new(160, 64, 480, 416))
- @old_index = @menu_index
- case @menu_index
- when 0
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/item")
- when 1
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/skill")
- when 2
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/equip")
- when 3
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/status")
- when 4
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/system")
- end
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果切换画面就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @command_window.dispose
- @gold_window.dispose
- @status_window.dispose
- #@status_window.dispose
- @dummy_window.dispose
- @dummy_sprite.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- #----------------------------- 主菜单 -----------------------------------
- @command_window.update
- @gold_window.update
- @status_window.visible = true# and @status_window.visible = false if !@status_window.visible
- @status_window.update
- if @command_window.index != @old_index
- case @command_window.index
- when 0
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/item")
- when 1
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/skill")
- when 2
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/equip")
- when 3
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/status")
- when 4
- @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/system")
- end
- @old_index = @command_window.index
- end
- # 命令窗口被激活的情况下: 调用 update_command
- if @command_window.active
- update_command
- return
- end
- # 状态窗口被激活的情况下: 调用 update_status
- if @status_window.active
- if @item_update
- update_item_target
- return
- elsif @skill_update
- update_skill_target
- return
- elsif @equip_status_update
- update_status1
- else
- update_status
- return
- end
- end
-
- #----------------------------- 物品菜单 ---------------------------------
- if @item_update
- @item_help_window.update
- @item_window.update
- # 物品窗口被激活的情况下: 调用 update_item
- if @item_window.active
- update_item
- return
- end
- #----------------------------- 奇术菜单 ---------------------------------
- elsif @skill_update
- # 刷新窗口
- @skill_help_window.update
- @skill_window.update
- # 特技窗口被激活的情况下: 调用 update_skill
- if @skill_window.active
- update_skill
- return
- end
- #----------------------------- 装备菜单 ---------------------------------
- elsif @equip_update
- @equip_right_window.update
- @equip_item_window.update
- # 设置物品窗口的可视状态
- @equip_item_window1.visible = (@equip_right_window.index == 0)
- @equip_item_window2.visible = (@equip_right_window.index == 1)
- @equip_item_window3.visible = (@equip_right_window.index == 2)
- @equip_item_window4.visible = (@equip_right_window.index == 3)
- @equip_item_window5.visible = (@equip_right_window.index == 4)
- @equip_item_window6.visible = (@equip_right_window.index == 5)
- @equip_item_window7.visible = (@equip_right_window.index == 6)
- @equip_item_window8.visible = (@equip_right_window.index == 7)
- # 获取当前装备中的物品
- item1 = @equip_right_window.item
- # 设置当前的物品窗口到 @item_window
- case @equip_right_window.index
- when 0
- @equip_item_window = @equip_item_window1
- when 1
- @equip_item_window = @equip_item_window2
- when 2
- @equip_item_window = @equip_item_window3
- when 3
- @equip_item_window = @equip_item_window4
- when 4
- @equip_item_window = @equip_item_window5
- when 5
- @equip_item_window = @equip_item_window6
- when 6
- @equip_item_window = @equip_item_window7
- when 7
- @equip_item_window = @equip_item_window8
- end
- # 右窗口被激活的情况下
- if @equip_right_window.active
- # 删除变更装备后的能力
- # @status_window.set_new_parameters(nil, nil, nil, @status_window.index)
- end
- # 物品窗口被激活的情况下
- if @equip_item_window.active
- # 获取现在选中的物品
- item2 = @equip_item_window.item
- # 变更装备
- last_hp = @actor.hp
- last_sp = @actor.sp
- @actor.equip(@equip_right_window.index, item2 == nil ? 0 : item2.id)
- # 获取变更装备后的能力值
- new_atk = @actor.atk
- new_pdef = @actor.pdef
- new_mdef = @actor.mdef
- # 返回到装备
- @actor.equip(@equip_right_window.index, item1 == nil ? 0 : item1.id)
- @actor.hp = last_hp
- @actor.sp = last_sp
- # 描画左窗口
- # @status_window.set_new_parameters(new_atk, new_pdef, new_mdef, @status_window.index)
- end
- # 右侧窗口被激活的情况下: 调用 update_right
- if @equip_right_window.active
- update_right
- return
- end
- # 物品窗口被激活的情况下: 调用 update_item
- if @equip_item_window.active
- update_equip_item
- return
- end
- #----------------------------- 状态菜单 ---------------------------------
- elsif @status_update
- update_status_status
- return
- #----------------------------- 系统菜单 ---------------------------------
- elsif @sys_update
- if @end_window != nil and !@end_window.disposed?
- update_end
- elsif @bgm_window != nil and !@bgm_window.disposed? and @currentbgm_window != nil and !@currentbgm_window.disposed?
- update_bgm
- elsif @sfx_window != nil and !@sfx_window.disposed? and @currentsfx_window != nil and !@currentsfx_window.disposed?
- update_sfx
- elsif !@system_window.disposed?
- update_system
- end
- 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)
- # 同伴人数为 0、存档、游戏结束以外的场合
- if $game_party.actors.size == 0 and @command_window.index < 4
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 命令窗口的光标位置分支
- case @command_window.index
- when 0 # 物品
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
-
- # 生成帮助窗口、物品窗口
- @item_help_window = Window_Help_New.new
- @item_help_window.x = 160
- @item_help_window.y = 480 - 64
- @item_window = Window_Item_New.new
- # 关联帮助窗口
- @item_window.help_window = @item_help_window
- # 生成目标窗口 (设置为不可见・不活动)
-
- # 切换到物品画面
- @item_update = true
- @command_window.active = false
- when 1 # 特技
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活状态窗口
- @command_window.active = false
- @status_window.active = true
- @status_window.index = 0
- when 2 # 装备
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活状态窗口
- @command_window.active = false
- @status_window.active = true
- @status_window.index = 0
- @equip_status_update = true
- when 3 # 状态
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活状态窗口
- @command_window.active = false
- @status_window.active = true
- @status_window.index = 0
- when 4 # 存档
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- @system_window = Window_SysCommand.new
- @command_window.active = false
- @sys_update = true
- end
- 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 = -2
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 命令窗口的光标位置分支
- case @command_window.index
- when 1 # 特技
- # 本角色的行动限制在 2 以上的情况下
- if $game_party.actors[@status_window.index].restriction >= 2
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- @window_index = @status_window.index
- @actor = $game_party.actors[@status_window.index]
- # 生成帮助窗口、状态窗口、特技窗口
- @skill_help_window = Window_Help_New.new
- @skill_window = Window_Skill_New.new(@actor)
- # 关联帮助窗口
- @skill_window.help_window = @skill_help_window
- @skill_help_window.x = 160
- @skill_help_window.y = 480 - 64
- @status_window.active = false
- @skill_update = true
- when 3 # 状态
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到状态画面
- # 获取角色
- @actor = $game_party.actors[@status_window.index]
- # 生成状态窗口
- @status_status_window = Window_Status_New.new(@actor)
- @status_window.active = false
- @status_update = true
- end
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 物品刷新
- #--------------------------------------------------------------------------
- def update_item
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @item_help_window.dispose
- @item_window.dispose
- @item_update = false
- @command_window.active = true
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 获取物品窗口当前选中的物品数据
- @item = @item_window.item
- # 不使用物品的情况下
- unless @item.is_a?(RPG::Item)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 不能使用的情况下
- unless $game_party.item_can_use?(@item.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 效果范围是我方的情况下
- if @item.scope >= 3
- # 激活目标窗口
- @item_window.active = false
- @status_window.active = true
- # 设置效果范围 (单体/全体) 的对应光标位置
- if @item.scope == 4 || @item.scope == 6
- @status_window.index = -1
- else
- @status_window.index = 0
- end
- # 效果在我方以外的情况下
- else
- # 公共事件 ID 有效的情况下
- if @item.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @item.common_event_id
- # 演奏物品使用时的 SE
- $game_system.se_play(@item.menu_se)
- # 消耗品的情况下
- if @item.consumable
- # 使用的物品数减 1
- $game_party.lose_item(@item.id, 1)
- # 再描绘物品窗口的项目
- @item_window.draw_item(@item_window.index)
- end
- @item_help_window.dispose
- @item_window.dispose
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- return
- end
- end
- def update_item_target
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 由于物品用完而不能使用的场合
- unless $game_party.item_can_use?(@item.id)
- # 再次生成物品窗口的内容
- @item_window.refresh
- end
- # 删除目标窗口
- @item_window.active = true
- @status_window.index = -2
- @status_window.active = false
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 如果物品用完的情况下
- if $game_party.item_number(@item.id) == 0
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 目标是全体的情况下
- if @status_window.index == -1
- # 对同伴全体应用物品使用效果
- used = false
- for i in $game_party.actors
- used |= i.item_effect(@item)
- end
- end
- # 目标是单体的情况下
- if @status_window.index >= 0
- # 对目标角色应用物品的使用效果
- target = $game_party.actors[@status_window.index]
- used = target.item_effect(@item)
- end
- # 使用物品的情况下
- if used
- # 演奏物品使用时的 SE
- $game_system.se_play(@item.menu_se)
- # 消耗品的情况下
- if @item.consumable
- # 使用的物品数减 1
- $game_party.lose_item(@item.id, 1)
- # 再描绘物品窗口的项目
- @item_window.draw_item(@item_window.index)
- end
- # 再生成目标窗口的内容
- @status_window.refresh
- # 全灭的情况下
- if $game_party.all_dead?
- # 切换到游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 公共事件 ID 有效的情况下
- if @item.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @item.common_event_id
- @item_help_window.dispose
- @item_window.dispose
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- # 无法使用物品的情况下
- unless used
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- end
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 技能刷新
- #--------------------------------------------------------------------------
- def update_skill
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @skill_help_window.dispose
- @skill_window.dispose
- @skill_update = false
- @status_window.active = true
- @status_window.index = @window_index
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 获取特技窗口现在选择的特技的数据
- @skill = @skill_window.skill
- # 不能使用的情况下
- if @skill == nil or not @actor.skill_can_use?(@skill.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 效果范围是我方的情况下
- if @skill.scope >= 3
- # 激活目标窗口
- @skill_window.active = false
- @status_window.active = true
- # 设置效果范围 (单体/全体) 的对应光标位置
- if @skill.scope == 4 || @skill.scope == 6
- @status_window.index = -1
- elsif @skill.scope == 7
- @status_window.index = @actor_index - 10
- else
- @status_window.index = 0
- end
- # 效果在我方以外的情况下
- else
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @actor.sp -= @skill.sp_cost
- # 再生成各窗口的内容
- @skill_window.refresh
- @status_window.refresh
- @skill_help_window.dispose
- @skill_window.dispose
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- return
- end
- end
- def update_skill_target
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 删除目标窗口
- @skill_window.active = true
- @status_window.index = -2
- @status_window.active = false
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 因为 SP 不足而无法使用的情况下
- unless @actor.skill_can_use?(@skill.id)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 目标是全体的情况下
- if @status_window.index == -1
- # 对同伴全体应用特技使用效果
- used = false
- for i in $game_party.actors
- used |= i.skill_effect(@actor, @skill)
- end
- end
- # 目标是使用者的情况下
- if @status_window.index <= -2
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@status_window.index + 10]
- used = target.skill_effect(@actor, @skill)
- end
- # 目标是单体的情况下
- if @status_window.index >= 0
- # 对目标角色应用特技的使用效果
- target = $game_party.actors[@status_window.index]
- used = target.skill_effect(@actor, @skill)
- end
- # 使用特技的情况下
- if used
- # 演奏特技使用时的 SE
- $game_system.se_play(@skill.menu_se)
- # 消耗 SP
- @actor.sp -= @skill.sp_cost
- # 再生成各窗口内容
- @status_window.refresh
- @skill_window.refresh
- # 全灭的情况下
- if $game_party.all_dead?
- # 切换到游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 公共事件 ID 有效的情况下
- if @skill.common_event_id > 0
- # 预约调用公共事件
- $game_temp.common_event_id = @skill.common_event_id
- @skill_help_window.dispose
- @skill_window.dispose
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- end
- # 无法使用特技的情况下
- unless used
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- end
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 装备刷新
- #--------------------------------------------------------------------------
- def update_right
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @equip_help_window.dispose
- @equip_right_window.dispose
- @equip_item_window1.dispose
- @equip_item_window2.dispose
- @equip_item_window3.dispose
- @equip_item_window4.dispose
- @equip_item_window5.dispose
- @equip_item_window6.dispose
- @equip_item_window7.dispose
- @equip_item_window8.dispose
- @equip_update = false
- @status_window.active = true
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 固定装备的情况下
- if @actor.equip_fix?(@equip_right_window.index)
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活物品窗口
- @equip_right_window.active = false
- @equip_item_window.active = true
- @equip_item_window.index = 0
- return
- end
- end
- def update_equip_item
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 激活右侧窗口
- @equip_right_window.active = true
- @equip_item_window.active = false
- @equip_item_window.index = -1
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 演奏装备 SE
- $game_system.se_play($data_system.equip_se)
- # 获取物品窗口现在选择的装备数据
- item = @equip_item_window.item
- # 变更装备
- @actor.equip(@equip_right_window.index, item == nil ? 0 : item.id)
- # 激活右侧窗口
- @equip_right_window.active = true
- @equip_item_window.active = false
- @equip_item_window.index = -1
- # 再生成右侧窗口、物品窗口的内容
- @equip_right_window.refresh
- if @equip_right_window.index == 6 or @equip_right_window.index == 7
- @equip_item_window7.refresh
- @equip_item_window8.refresh
- else
- @equip_item_window.refresh
- end
- return
- end
- end
- def update_status1
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 激活命令窗口
- @command_window.active = true
- @status_window.active = false
- @equip_status_update = false
- @status_window.index = -2
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 命令窗口的光标位置分支
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- @equip_index = 0
- @actor = $game_party.actors[@status_window.index]
- @equip_help_window = Window_Help_New.new
- @equip_help_window.x = 160
- @equip_help_window.y = 480 - 64
- @equip_right_window = Window_EquipRight_New.new(@actor)
- @equip_item_window1 = Window_EquipItem_New.new(@actor, 0)
- @equip_item_window2 = Window_EquipItem_New.new(@actor, 1)
- @equip_item_window3 = Window_EquipItem_New.new(@actor, 2)
- @equip_item_window4 = Window_EquipItem_New.new(@actor, 3)
- @equip_item_window5 = Window_EquipItem_New.new(@actor, 4)
- @equip_item_window6 = Window_EquipItem_New.new(@actor, 5)
- @equip_item_window7 = Window_EquipItem_New.new(@actor, 6)
- @equip_item_window8 = Window_EquipItem_New.new(@actor, 6)
- # 关联帮助窗口
- @equip_right_window.help_window = @equip_help_window
- @equip_item_window1.help_window = @equip_help_window
- @equip_item_window2.help_window = @equip_help_window
- @equip_item_window3.help_window = @equip_help_window
- @equip_item_window4.help_window = @equip_help_window
- @equip_item_window5.help_window = @equip_help_window
- @equip_item_window6.help_window = @equip_help_window
- @equip_item_window7.help_window = @equip_help_window
- @equip_item_window8.help_window = @equip_help_window
- # 设置光标位置
- @equip_right_window.index = @equip_index
- @status_window.active = false
- #@equip_status_update = false
- @equip_update = true
- # 设置物品窗口的可视状态
- @equip_item_window1.visible = (@equip_right_window.index == 0)
- @equip_item_window2.visible = (@equip_right_window.index == 1)
- @equip_item_window3.visible = (@equip_right_window.index == 2)
- @equip_item_window4.visible = (@equip_right_window.index == 3)
- @equip_item_window5.visible = (@equip_right_window.index == 4)
- @equip_item_window6.visible = (@equip_right_window.index == 5)
- @equip_item_window7.visible = (@equip_right_window.index == 6)
- @equip_item_window8.visible = (@equip_right_window.index == 7)
- # 获取当前装备中的物品
- item1 = @equip_right_window.item
- # 设置当前的物品窗口到 @item_window
- case @equip_right_window.index
- when 0
- @equip_item_window = @equip_item_window1
- when 1
- @equip_item_window = @equip_item_window2
- when 2
- @equip_item_window = @equip_item_window3
- when 3
- @equip_item_window = @equip_item_window4
- when 4
- @equip_item_window = @equip_item_window5
- when 5
- @equip_item_window = @equip_item_window6
- when 6
- @equip_item_window = @equip_item_window7
- when 7
- @equip_item_window = @equip_item_window8
- end
- # 右窗口被激活的情况下
- if @equip_right_window.active
- # 删除变更装备后的能力
- # @status_window.set_new_parameters(nil, nil, nil)
- end
- # 物品窗口被激活的情况下
- if @equip_item_window.active
- # 获取现在选中的物品
- item2 = @equip_item_window.item
- # 变更装备
- last_hp = @actor.hp
- last_sp = @actor.sp
- @actor.equip(@equip_right_window.index, item2 == nil ? 0 : item2.id)
- # 获取变更装备后的能力值
- new_atk = @actor.atk
- new_pdef = @actor.pdef
- new_mdef = @actor.mdef
- # 返回到装备
- @actor.equip(@equip_right_window.index, item1 == nil ? 0 : item1.id)
- @actor.hp = last_hp
- @actor.sp = last_sp
- # 描画左窗口
- #@status_window.set_new_parameters(new_atk, new_pdef, new_mdef)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 状态刷新
- #--------------------------------------------------------------------------
- def update_status_status
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @status_status_window.dispose
- @status_update = false
- @status_window.active = true
- return
- end
- end
-
- def update_system
- @system_window.update
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @system_window.dispose
- @sys_update = false
- @command_window.active = true
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- case @system_window.index
- when 0
- @bgm_window = Window_BGM_Volume.new(80, ["0%", "17%", "34%", "50%", "67%", "84%", "100%"])
- @currentbgm_window = Window_CurrentBGM_Volume.new
- @system_window.active = false
- when 1
- @sfx_window = Window_SFX_Volume.new(80, ["0%", "17%", "34%", "50%", "67%", "84%", "100%"])
- @currentsfx_window = Window_CurrentSFX_Volume.new
- @system_window.active = false
- when 2
- @system_window.dispose
- $scene = Scene_Save.new
- when 3
- @system_window.dispose
- $scene = Scene_Load.new(true)
- when 4
- @end_window = Window_EndCommand.new
- @system_window.active = false
- end
- return
- end
- end
-
- def update_bgm
- @bgm_window.update
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @system_window.active = true
- @bgm_window.dispose
- @currentbgm_window.dispose
- return
- end
- if Input.trigger?(Input::C)
- case @bgm_window.index
- when 0
- $game_system.bgm_volume = 0
- $game_system.bgm_play($game_system.bgm_memorize)
- @currentbgm_window.refresh
- when 1
- $game_system.bgm_volume = 17
- $game_system.bgm_play($game_system.bgm_memorize)
- @currentbgm_window.refresh
- when 2
- $game_system.bgm_volume = 34
- $game_system.bgm_play($game_system.bgm_memorize)
- @currentbgm_window.refresh
- when 3
- $game_system.bgm_volume = 50
- $game_system.bgm_play($game_system.bgm_memorize)
- @currentbgm_window.refresh
- when 4
- $game_system.bgm_volume = 67
- $game_system.bgm_play($game_system.bgm_memorize)
- @currentbgm_window.refresh
- when 5
- $game_system.bgm_volume = 84
- $game_system.bgm_play($game_system.bgm_memorize)
- @currentbgm_window.refresh
- when 6
- $game_system.bgm_volume = 100
- $game_system.bgm_play($game_system.bgm_memorize)
- @currentbgm_window.refresh
- end
- return
- end
- end
-
- def update_sfx
- @sfx_window.update
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @sfx_window.dispose
- @currentsfx_window.dispose
- @system_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- case @sfx_window.index
- when 0
- $game_system.se_volume = 0
- $game_system.se_play($data_system.decision_se)
- @currentsfx_window.refresh
- when 1
- $game_system.se_volume = 17
- $game_system.se_play($data_system.decision_se)
- @currentsfx_window.refresh
- when 2
- $game_system.se_volume = 34
- $game_system.se_play($data_system.decision_se)
- @currentsfx_window.refresh
- when 3
- $game_system.se_volume = 50
- $game_system.se_play($data_system.decision_se)
- @currentsfx_window.refresh
- when 4
- $game_system.se_volume = 67
- $game_system.se_play($data_system.decision_se)
- @currentsfx_window.refresh
- when 5
- $game_system.se_volume = 84
- $game_system.se_play($data_system.decision_se)
- @currentsfx_window.refresh
- when 6
- $game_system.se_volume = 100
- $game_system.se_play($data_system.decision_se)
- @currentsfx_window.refresh
- end
- $game_map.autoplay
- return
- end
- end
-
- def update_end
- @end_window.update
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @end_window.dispose
- @system_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- case @end_window.index
- when 0
- @end_window.dispose
- @system_window.dispose
- command_to_title
- when 1
- command_shutdown
- end
- return
- end
- end
- def command_to_title
- $game_system.se_play($data_system.decision_se)
- Audio.bgm_fade(800)
- Audio.bgs_fade(800)
- Audio.me_fade(800)
- $scene = Scene_Title.new
- end
- def command_shutdown
- $game_system.se_play($data_system.decision_se)
- Audio.bgm_fade(800)
- Audio.bgs_fade(800)
- Audio.me_fade(800)
- $scene = nil
- end
- end
复制代码 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|