#=============================================================================== # # Yanfly Engine RD - Turn Order Fix # Last Date Updated: 2009.06.03 # Level: Easy # # For those that are using the default battle system, you've probably realized # sooner or later that turn order is only calculated once at the start of each # turn and retains that order even if speed has been changed in between turns. # This means that enemies which your actors have slowed on the same turn will # still act in the same order calculated for that turn. Agility status effects # and the like do not take effect until the following turn, which may become # rather useless for some. This script fixes that and recalculates turn order # after each and every action. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.06.03 - Bugfix to turn zero actions. # o 2009.05.27 - Started script and finished. #=============================================================================== # Instructions #=============================================================================== # # Just place the script somewhere above main. # #=============================================================================== # # Compatibility # - Incompatible: Any ATB and CTB systems obviously. # - Alias: Scene_Battle: start_main # - Overwrites: Scene_Battle: set_next_active_battler # #=============================================================================== $imported = {} if $imported == nil $imported["TurnOrderFix"] = true #=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #=============================================================================== #=============================================================================== # Scene_Battle #=============================================================================== unless $imported["SceneBattleReDux"] class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias start_main #-------------------------------------------------------------------------- alias start_main_tofix start_main unless $@ def start_main @performed_actors = [] start_main_tofix end #-------------------------------------------------------------------------- # overwrite set_next_active_battler #-------------------------------------------------------------------------- def set_next_active_battler @performed_actors = [] if @performed_actors == nil loop do if $game_troop.forcing_battler != nil @active_battler = $game_troop.forcing_battler @action_battlers.delete(@active_battler) $game_troop.forcing_battler = nil else make_action_orders @action_battlers -= @performed_actors @active_battler = @action_battlers.shift end @performed_actors.push(@active_battler) unless @active_battler == nil return if @active_battler == nil return if @active_battler.index != nil end end end end #=============================================================================== # # END OF FILE # #===============================================================================