#============================================================================== # ■ VX-RGSS2-19 魔法屋 [scene] by Claimh #============================================================================== class Scene_SkillShop < Scene_Base #-------------------------------------------------------------------------- # ● 初期化 #-------------------------------------------------------------------------- def initialize(shop_id) @shop_id = shop_id end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @cmd_window = Window_SkillShopCmd.new @list_window = Window_SkillShopList.new(SkillShop.make_list(@shop_id)) @actor_window = Window_SkillShopActor.new @mes_window = Window_SkillShopCaution.new @help_window = Window_Help.new @gold_window = Window_Gold.new(384, 56) # @list_window.help_window2 = @actor_window @list_window.help_window = @help_window end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @cmd_window.dispose @list_window.dispose @actor_window.dispose @mes_window.dispose @help_window.dispose @gold_window.dispose end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update if @mes_window.visible @mes_window.update elsif @cmd_window.active update_cmd elsif @list_window.active update_list elsif @actor_window.active update_actor end end #---------------------------------------------------------------------------- # ● フレーム更新 : コマンドウィンドウ #---------------------------------------------------------------------------- def update_cmd @cmd_window.update if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new return end if Input.trigger?(Input::C) Sound.play_decision case @cmd_window.index when 0 @cmd_window.active = false @list_window.active = true @list_window.index = 0 when 1 $scene = Scene_Map.new end end end #---------------------------------------------------------------------------- # ● フレーム更新 : リストウィンドウ #---------------------------------------------------------------------------- def update_list @list_window.update if Input.trigger?(Input::B) Sound.play_cancel @list_window.index = -1 @list_window.active = false @cmd_window.active = true return end if Input.trigger?(Input::C) unless @list_window.data.enable Sound.play_buzzer @mes_window.set_text(SkillShop::MesCmd::M_N_P) return end Sound.play_decision @list_window.active = false @actor_window.active = true @actor_window.index = 0 end end #---------------------------------------------------------------------------- # ● フレーム更新 : アクターウィンドウ #---------------------------------------------------------------------------- def update_actor @actor_window.update if Input.trigger?(Input::B) Sound.play_cancel @actor_window.index = -1 @actor_window.active = false @list_window.active = true return end if Input.trigger?(Input::C) unless @actor_window.enable Sound.play_buzzer @mes_window.set_text(@actor_window.message) return end Sound.play_shop $game_party.lose_gold(@list_window.data.price) @mes_window.set_text(SkillShop::MesCmd::M_S_C, @list_window.data.obj) @actor_window.actor.learn_skill(@list_window.data.id) @list_window.diff_refresh @actor_window.draw_i(@actor_window.index, true) @gold_window.refresh # @actor_window.index = -1 @actor_window.active = false @list_window.active = true end end end