PhotonWeapon
Member
Maybe I'm just dumb, but could anyone tell me what is going on in this part of Scene_Battle:
I'm guessing the first couple lines must be putting active (i.e. in-party, non-dead) enemies and players into the array but I don't get much the rest. How is the DBS determining the turn order here?
I'm just curious because I'd want to do a similar turn order in a custom script, or find some easier way to do so.
Code:
#--------------------------------------------------------------------------
# * Make Action Orders
#--------------------------------------------------------------------------
def make_action_orders
# Initialize @action_battlers array
@action_battlers = []
# Add enemy to @action_battlers array
for enemy in $game_troop.enemies
@action_battlers.push(enemy)
end
# Add actor to @action_battlers array
for actor in $game_party.actors
@action_battlers.push(actor)
end
# Decide action speed for all
for battler in @action_battlers
battler.make_action_speed
end
# Line up action speed in order from greatest to least
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
I'm guessing the first couple lines must be putting active (i.e. in-party, non-dead) enemies and players into the array but I don't get much the rest. How is the DBS determining the turn order here?
I'm just curious because I'd want to do a similar turn order in a custom script, or find some easier way to do so.