#============================================================================== # ■ 特定のタイミングでコモンイベント # # 作者 : 葦路ムラクモ # URL     : http://ashiromurakumo.blog103.fc2.com/ # # 特定の操作を行ったときに指定したコモンイベントを発生させます。 # ・装備を変えたとき # ・セーブデータをロードしたとき # ・戦闘終了時 # ・並び順を変更したとき # #============================================================================== module Ashimura module Ashimura_MenuCommon #-------------------------------------------------------------------------- # ● コモンイベントIDの指定 #-------------------------------------------------------------------------- #発生させたいコモンイベントを指定してください。(0はなにもしない) CE_ID_EQUIP = 0 #装備終了時のコモンイベントID CE_ID_LOAD = 0 #ロード時のコモンイベントID CE_ID_BATTLE = 0 #戦闘終了時のコモンイベントID CE_ID_FORMATION = 0 #並び替え変更時のコモンイベントID end end #============================================================================== # ■ Scene_Equip #------------------------------------------------------------------------------ #  装備画面の処理を行うクラスです。 #============================================================================== class Scene_Equip < Scene_MenuBase #-------------------------------------------------------------------------- # ● スロット[決定] #-------------------------------------------------------------------------- def on_item_ok Sound.play_equip @actor.change_equip(@slot_window.index, @item_window.item) @slot_window.activate @slot_window.refresh @item_window.unselect @item_window.refresh if Ashimura::Ashimura_MenuCommon::CE_ID_EQUIP != 0 interpreter = Scene_Menu::Game_Interpreter.new interpreter.setup($data_common_events[Ashimura::Ashimura_MenuCommon::CE_ID_EQUIP].list) interpreter.update while interpreter.running? end end end #============================================================================== # ■ Scene_Load #------------------------------------------------------------------------------ #  ロード画面の処理を行うクラスです。 #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # ● ロード成功時の処理 #-------------------------------------------------------------------------- def on_load_success Sound.play_load fadeout_all $game_system.on_after_load SceneManager.goto(Scene_Map) if Ashimura::Ashimura_MenuCommon::CE_ID_LOAD != 0 interpreter = Scene_Menu::Game_Interpreter.new interpreter.setup($data_common_events[Ashimura::Ashimura_MenuCommon::CE_ID_LOAD].list) interpreter.update while interpreter.running? end end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_spriteset @info_viewport.dispose RPG::ME.stop if Ashimura::Ashimura_MenuCommon::CE_ID_BATTLE != 0 interpreter = Scene_Menu::Game_Interpreter.new interpreter.setup($data_common_events[Ashimura::Ashimura_MenuCommon::CE_ID_BATTLE].list) interpreter.update while interpreter.running? end end end #============================================================================== # ■ Scene_Menu #------------------------------------------------------------------------------ #  メニュー画面の処理を行うクラスです。 #============================================================================== class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # ● 並び替え[決定] #-------------------------------------------------------------------------- def on_formation_ok if @status_window.pending_index >= 0 $game_party.swap_order(@status_window.index, @status_window.pending_index) @status_window.pending_index = -1 @status_window.redraw_item(@status_window.index) else @status_window.pending_index = @status_window.index end @status_window.activate if Ashimura::Ashimura_MenuCommon::CE_ID_FORMATION != 0 interpreter = Scene_Menu::Game_Interpreter.new interpreter.setup($data_common_events[Ashimura::Ashimura_MenuCommon::CE_ID_FORMATION].list) interpreter.update while interpreter.running? end end end