#============================================================================== # ■ RGSS3 戦闘中入れ替え挙動改造 by 星潟 #------------------------------------------------------------------------------ # ツクール工房A1様(http://a1tktk.web.fc2.com/)で配布されている # 戦闘中入れ替えを使用されている場合に # 生存している唯一の戦闘メンバーを # 戦闘不能状態の控えメンバーと入れ替える事により # 全滅してしまう現象を防止します。 # # 戦闘中入れ替えを導入されていない場合は導入する必要は一切ありません。 #============================================================================== class Game_Party < Game_Unit attr_reader :actors end class Window_MemberChange < Window_Selectable alias process_ok_protect process_ok def process_ok data = 0 members = $game_party.battle_members members.each do |member| data += 1 if member.alive? end if data == 0 Sound.play_buzzer return end if data == 1 && @from_actor >= 0 && (($game_party.members.include?(actor_data1) && !$game_party.members.include?(actor_data2) && actor_data1.alive? && !actor_data2.alive?) or (!$game_party.members.include?(actor_data1) && $game_party.members.include?(actor_data2) && !actor_data1.alive? && actor_data2.alive?)) Sound.play_buzzer return end process_ok_protect end def actor_data1 return $game_actors[$game_party.actors[@from_actor]] end def actor_data2 return $game_actors[$game_party.actors[self.index]] end end