#============================================================================== # ■ Scene_Blacksmith #============================================================================== class Scene_Blacksmith MODE_START = 0 MODE_END = 1 #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main start # 開始処理 Graphics.transition # トランジション実行 loop do Graphics.update # ゲーム画面を更新 Input.update # 入力情報を更新 update # フレーム更新 break if $scene != self # 画面が切り替わったらループを中断 end Graphics.update Graphics.freeze # トランジション準備 terminate # 終了処理 end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start @select_window = Window_BlacksmithCmd.new @armor_select_window = Window_BlacksmithArmSelect.new @left_window = Window_BlacksmithActors.new @right_window = Window_BlacksmithList.new @buy_window = Window_BlacksmithBuy.new @v_sts_window = Window_BlacksmithStatus.new @buy_cmd_window = Window_BlacksmithBuyCmd.new @help_window = Window_Help.new @gold_window = Window_Gold.new @gold_window.x = 480 @gold_window.y = 64 # @left_window.help_window = @help_window @left_window.help_window2 = @right_window @right_window.help_window = @help_window @right_window.help_window2 = @v_sts_window end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate @select_window.dispose @armor_select_window.dispose @left_window.dispose @right_window.dispose @buy_window.dispose @v_sts_window.dispose @buy_cmd_window.dispose @help_window.dispose @gold_window.dispose end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update if @select_window.active update_select elsif @armor_select_window.active update_arm_select elsif @left_window.active update_left elsif @right_window.active update_right elsif @buy_window.visible update_buy end end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update_select @select_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) case BlacksmithSetting::COMMAND[@select_window.index] when 0 @select_window.active = false @left_window.active = true @left_window.index = 0 @left_window.refresh(0) @right_window.set_mode(@left_window.actor, 0) when 1 @select_window.active = false @armor_select_window.active = true @armor_select_window.visible = true @armor_select_window.index = 0 when 2 $scene = Scene_Map.new end return end if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::LEFT) if @select_window.index == 0 @left_window.refresh(0) @left_window.flash(false) else @left_window.flash(true) end @right_window.refresh(nil) return end end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update_arm_select @armor_select_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @armor_select_window.active = false @armor_select_window.visible = false @select_window.active = true return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) @armor_select_window.active = false @armor_select_window.visible = false @left_window.active = true @left_window.index = 0 @left_window.flash(false) @left_window.refresh(@armor_select_window.index + 1) @right_window.set_mode(@left_window.actor, @armor_select_window.index + 1) return end end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update_left @left_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @left_window.active = false @left_window.act_stop @left_window.index = -1 @select_window.active = true @help_window.set_text("") return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) @left_window.active = false @right_window.active = true @v_sts_window.set_act(@left_window.actor) Graphics.update @right_window.update_help return end end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update_right @right_window.update @v_sts_window.act_update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @v_sts_window.delete @right_window.active = false @right_window.index = -1 @left_window.active = true @help_window.set_text("") return end if Input.trigger?(Input::C) data = @right_window.data if data.nil? or !data.visible? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @right_window.active = false @buy_window.visible = true @buy_window.refresh(@right_window.mode, data) if data.judge_result @buy_cmd_window.active = true @buy_cmd_window.visible = true @buy_cmd_window.index = 0 end return end end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update_buy @buy_cmd_window.update @v_sts_window.act_update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @buy_window.visible = false @buy_cmd_window.visible = false @buy_cmd_window.active = false @right_window.active = true return end if Input.trigger?(Input::C) unless @right_window.data.judge_result $game_system.se_play($data_system.buzzer_se) return end case @buy_cmd_window.index when 0 if Blacksmith::SUCCESS_SE != nil Audio.se_play("Audio/SE/" + Blacksmith::SUCCESS_SE) else $game_system.se_play($data_system.decision_se) end @right_window.execute @left_window.refresh @gold_window.refresh @help_window.set_text("") @right_window.index = -1 @v_sts_window.delete @buy_window.visible = false @buy_cmd_window.visible = false @buy_cmd_window.active = false @left_window.active = true when 1 $game_system.se_play($data_system.decision_se) @buy_window.visible = false @buy_cmd_window.visible = false @buy_cmd_window.active = false @right_window.active = true end return end end end