#============================================================================== # ★ コマンド入力時イベント ver1.0 by USK #------------------------------------------------------------------------------ # ・戦闘時のアクターコマンド入力時にアクター毎に設定したコモンイベントを #  並列処理で実行します。 # ・入力アクターが変わるときにコモンイベントは強制的に終了します。 #============================================================================== =begin アクターのメモ欄にと記述するとそのアクターの コマンド入力時に設定したIDのコモンイベントが並列処理で実行されます。用途と してはコマンド入力中のアクターの立ち絵表示やボタン入力による特殊機能の追加を 想定しています。 行目のPartyEventIdで設定したIDのコモンイベントがパーティコマンド入力時に 並列処理で実行されます。主にコマンド入力時のコモンイベントで表示した立ち絵等の 消去やボタン入力による特殊機能の追加の用途を想定しています。 行目のTurnEventIdで設定したIDのコモンイベントが全員のコマンド入力後、ターン 開始時に実行されます。主にコマンド入力時のコモンイベントで表示した立ち絵等の 消去の用途を想定しています。 =end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle PartyEventId = 0 #パーティコマンド入力時コモンイベント TurnEventId = 0 #全員のコマンド入力後のコモンイベント #-------------------------------------------------------------------------- # ● パーティコマンド選択の開始 #-------------------------------------------------------------------------- alias :usk_ae_start_party_command_selection :start_party_command_selection def start_party_command_selection process_party_event usk_ae_start_party_command_selection end #-------------------------------------------------------------------------- # ● アクターコマンド選択の開始 #-------------------------------------------------------------------------- alias :usk_ae_start_actor_command_selection :start_actor_command_selection def start_actor_command_selection process_actor_event usk_ae_start_actor_command_selection end #-------------------------------------------------------------------------- # ● ターン開始 #-------------------------------------------------------------------------- alias :usk_ae_turn_start :turn_start def turn_start process_turn_event usk_ae_turn_start end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def process_actor_event $game_troop.interpreter.clear @actor_command_selection_flag = true $game_temp.reserve_common_event(BattleManager.actor.battle_event) usk_ae_process_event end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def process_party_event $game_troop.interpreter.clear @actor_command_selection_flag = true $game_temp.reserve_common_event(PartyEventId) usk_ae_process_event end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def process_turn_event $game_troop.interpreter.clear @event_fiber = nil @actor_command_selection_flag = false $game_temp.reserve_common_event(TurnEventId) process_event end #-------------------------------------------------------------------------- # ● イベントの処理 #-------------------------------------------------------------------------- def usk_ae_process_event @event_fiber = Fiber.new { while !scene_changing? $game_troop.interpreter.update $game_troop.setup_battle_event wait_for_message wait_for_effect if $game_troop.all_dead? process_forced_action BattleManager.judge_win_loss break unless $game_troop.interpreter.running? Fiber.yield end @event_fiber = nil } end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super if BattleManager.in_turn? process_event process_action end if @actor_command_selection_flag @event_fiber.resume if @event_fiber && !(@skill_window.active || @item_window.active || @enemy_window.active) unless ($game_message.busy? && @status_window.close?) @status_window.open @party_command_window.open @actor_command_window.open end end BattleManager.judge_win_loss end end #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def battle_event actor.battle_event end end #============================================================================== # ■ RPG::Actor #============================================================================== class RPG::Actor #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def battle_event @battle_event = @note =~ //m ? $1.to_i : 0 end end