mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 07:52:17 +02:00
fix comments
This commit is contained in:
parent
2d936cc34b
commit
fda81ddac9
@ -2052,11 +2052,11 @@ export class TurnStartPhase extends FieldPhase {
|
||||
case Command.RUN:
|
||||
let runningPokemon = pokemon;
|
||||
if (this.scene.currentBattle.double) {
|
||||
const playerPokemon = field.filter(pokemon => pokemon.isPlayer());
|
||||
// use the faster stats if not
|
||||
const fasterPokemon = playerPokemon[0].getStat(Stat.SPD) > playerPokemon[1].getStat(Stat.SPD) ? playerPokemon[0] : playerPokemon[1];
|
||||
// check if either active player pokemon has run away
|
||||
const hasRunAway = playerPokemon.find(p => p.hasAbility(Abilities.RUN_AWAY));
|
||||
const playerActivePokemon = field.filter(pokemon => pokemon.isPlayer());
|
||||
// find which active pokemon has faster speed
|
||||
const fasterPokemon = playerActivePokemon[0].getStat(Stat.SPD) > playerActivePokemon[1].getStat(Stat.SPD) ? playerActivePokemon[0] : playerActivePokemon[1];
|
||||
// check if either active pokemon has the ability "Run Away"
|
||||
const hasRunAway = playerActivePokemon.find(p => p.hasAbility(Abilities.RUN_AWAY));
|
||||
runningPokemon = hasRunAway !== undefined ? hasRunAway : fasterPokemon;
|
||||
}
|
||||
this.scene.unshiftPhase(new AttemptRunPhase(this.scene, runningPokemon.getFieldIndex()));
|
||||
|
Loading…
Reference in New Issue
Block a user