#__END__ #============================================================================== # ★ 連続戦闘 ver1.0 by USK #------------------------------------------------------------------------------ # ・ 戦闘終了時そのまま次の戦闘を開始します #============================================================================== =begin ・戦闘中任意のタイミングで「バトルの処理」のバトルイベントを使うと、戦闘勝利時  そのまま「バトルの処理」設定した敵グループと連戦になります。 ・15行目のBattleEndCommonValに設定した番号の変数に1以上の数値を入れると、戦闘  終了時経験値入手等の後に数値に対応した番号のコモンイベントが発生します。この  機能は連続戦闘を継続するかを選択したり、戦闘間の演出、対戦相手の選択などを想  しています。この数値は全戦闘終了時に0が代入されます。 =end BattleEndCommonVal = 1 #============================================================================== # ■ Game_Temp #============================================================================== class Game_Temp #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def next_troop @next_troop || [] end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def next_troop=(a) @next_troop = a.is_a?(Array) ? a : [] end end #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● バトルの処理 #-------------------------------------------------------------------------- alias :usk_rb_command_301 :command_301 def command_301 if $game_party.in_battle if @params[0] == 0 # 直接指定 troop_id = @params[1] elsif @params[0] == 1 # 変数で指定 troop_id = $game_variables[@params[1]] else # マップ指定の敵グループ troop_id = $game_player.make_encounter_troop_id end if $data_troops[troop_id] $game_temp.next_troop = [troop_id, @params[2], @params[3]] end Fiber.yield else usk_rb_command_301 end end end #============================================================================== # ■ BattleManager #============================================================================== module BattleManager class << self; alias :usk_rb_process_victory :process_victory; end #-------------------------------------------------------------------------- # ● 勝利の処理 #-------------------------------------------------------------------------- def self.process_victory if !$game_temp.next_troop.empty? process_victory_base if $game_variables[BattleEndCommonVal] > 0 $game_temp.reserve_common_event($game_variables[BattleEndCommonVal]) $game_variables[BattleEndCommonVal] = 0 end SceneManager.scene.next_battle elsif $game_variables[BattleEndCommonVal] > 0 process_victory_base $game_temp.reserve_common_event($game_variables[BattleEndCommonVal]) $game_variables[BattleEndCommonVal] = 0 SceneManager.scene.end_event else usk_rb_process_victory end return true end #-------------------------------------------------------------------------- # ● 勝利の処理 #-------------------------------------------------------------------------- def self.process_victory_base play_battle_end_me replay_bgm_and_bgs $game_message.add(sprintf(Vocab::Victory, $game_party.name)) display_exp gain_gold gain_drop_items gain_exp end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def self.process_return SceneManager.return battle_end(0) end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def next_battle $game_party.on_battle_end process_end_event BattleManager.setup(*$game_temp.next_troop) $game_temp.next_troop.clear dispose_spriteset create_spriteset battle_start end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def end_event process_end_event if $game_temp.next_troop.empty? BattleManager.process_return else BattleManager.setup(*$game_temp.next_troop) $game_temp.next_troop.clear dispose_spriteset create_spriteset battle_start end end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def process_end_event loop do $game_troop.interpreter.update $game_troop.setup_battle_event wait_for_message break unless $game_troop.interpreter.running? update_for_wait end end end