mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 00:12:16 +02:00
PR Comments
This commit is contained in:
parent
a11d0f8243
commit
2d936cc34b
@ -2051,13 +2051,13 @@ export class TurnStartPhase extends FieldPhase {
|
|||||||
break;
|
break;
|
||||||
case Command.RUN:
|
case Command.RUN:
|
||||||
let runningPokemon = pokemon;
|
let runningPokemon = pokemon;
|
||||||
// check if either active player pokemon has run away
|
|
||||||
if (this.scene.currentBattle.double) {
|
if (this.scene.currentBattle.double) {
|
||||||
const playerPokemon = field.filter(pokemon => pokemon.isPlayer());
|
const playerPokemon = field.filter(pokemon => pokemon.isPlayer());
|
||||||
// use the faster stats if not
|
// use the faster stats if not
|
||||||
const fasterPokemon = playerPokemon[0].getStat(Stat.SPD) > playerPokemon[1].getStat(Stat.SPD) ? playerPokemon[0] : playerPokemon[1];
|
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 hasRunAway = playerPokemon.find(p => p.hasAbility(Abilities.RUN_AWAY));
|
||||||
runningPokemon = hasRunAway != undefined ? hasRunAway : fasterPokemon;
|
runningPokemon = hasRunAway !== undefined ? hasRunAway : fasterPokemon;
|
||||||
}
|
}
|
||||||
this.scene.unshiftPhase(new AttemptRunPhase(this.scene, runningPokemon.getFieldIndex()));
|
this.scene.unshiftPhase(new AttemptRunPhase(this.scene, runningPokemon.getFieldIndex()));
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user