Class BattlePriorityHelper
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.BattlePriorityHelper
Calculates turn order in battles.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SpeedAbilityComparator
static final SpeedComparator
static final SpeedPriorityComparator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
Calculates the priority a Pokémon has for the turn.static void
Calculates turn order.static List<PixelmonWrapper>
getRedirectOrder
(List<PixelmonWrapper> pokemon) Gets the turn order of Pokémon without accounting for priority.static List<PixelmonWrapper>
getTargetOrder
(PixelmonWrapper user, List<PixelmonWrapper> pokemon) Gets the target order of Pokémon.static List<PixelmonWrapper>
getTurnOrder
(List<PixelmonWrapper> pokemon) Gets the turn order of Pokémon without accounting for priority.static void
recalculateMoveSpeed
(BattleController bc, int turn) Recalculates turn order for Pokémon that have not yet moved in the turn.
-
Field Details
-
SPEED_PRIORITY_COMPARATOR
-
SPEED_ABILITY_COMPARATOR
-
SPEED_COMPARATOR
-
-
Constructor Details
-
BattlePriorityHelper
public BattlePriorityHelper()
-
-
Method Details
-
checkMoveSpeed
Calculates turn order.- Parameters:
bc
- The battle to calculate turn order in.
-
recalculateMoveSpeed
Recalculates turn order for Pokémon that have not yet moved in the turn.- Parameters:
bc
- The battle to calculate turn order in.turn
- The current turn in the battle turn.
-
getTurnOrder
Gets the turn order of Pokémon without accounting for priority.- Parameters:
pokemon
- The Pokémon to get turn order for.- Returns:
- The turn order of Pokémon without accounting for priority.
-
getRedirectOrder
Gets the turn order of Pokémon without accounting for priority.- Parameters:
pokemon
- The Pokémon to get turn order for.- Returns:
- The turn order of Pokémon without accounting for priority.
-
getTargetOrder
public static List<PixelmonWrapper> getTargetOrder(PixelmonWrapper user, List<PixelmonWrapper> pokemon) Gets the target order of Pokémon.- Parameters:
user
- The Pokémon attacking.pokemon
- The Pokémon to get target order for.- Returns:
- The target order of Pokémon.
-
calculatePriority
Calculates the priority a Pokémon has for the turn.- Parameters:
p
- The Pokémon to calculate priority for.- Returns:
- The priority the Pokémon has for the turn.
-