diff --git a/src/data/ability.ts b/src/data/ability.ts index 7c2fbeac77b..c287fe336c5 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -3579,24 +3579,22 @@ export class MoodyAbAttr extends PostTurnAbAttr { } } -export class PostTurnStatStageChangeAbAttr extends PostTurnAbAttr { +export class SpeedBoostAbAttr extends PostTurnAbAttr { private stats: BattleStat[]; private stages: number; - constructor(stats: BattleStat[], stages: number) { + constructor() { super(true); - this.stats = Array.isArray(stats) - ? stats - : [ stats ]; - this.stages = stages; + this.stats = Array.isArray([ Stat.SPD ]) + ? [ Stat.SPD ] + : [ Stat.SPD ]; + this.stages = 1; } applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { if (!simulated) { - if (!pokemon.hasAbility(Abilities.SPEED_BOOST)) { - pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); - } else if (pokemon.hasAbility(Abilities.SPEED_BOOST) && !pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) { + if (!pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) { pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); } else { return false; @@ -4865,7 +4863,7 @@ export function initAbilities() { .attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN), new Ability(Abilities.SPEED_BOOST, 3) - .attr(PostTurnStatStageChangeAbAttr, [ Stat.SPD ], 1), + .attr(SpeedBoostAbAttr), new Ability(Abilities.BATTLE_ARMOR, 3) .attr(BlockCritAbAttr) .ignorable(), diff --git a/src/phases/attempt-run-phase.ts b/src/phases/attempt-run-phase.ts index 44cb014083d..b4768dc9a26 100644 --- a/src/phases/attempt-run-phase.ts +++ b/src/phases/attempt-run-phase.ts @@ -10,13 +10,14 @@ import { NewBattlePhase } from "./new-battle-phase"; import { PokemonPhase } from "./pokemon-phase"; export class AttemptRunPhase extends PokemonPhase { - constructor(scene: BattleScene, fieldIndex: number) { - super(scene, fieldIndex); - } /** For testing purposes: this is to force the pokemon to fail and escape */ public forceFailEscape = false; + constructor(scene: BattleScene, fieldIndex: number) { + super(scene, fieldIndex); + } + start() { super.start();