diff --git a/src/data/ability.ts b/src/data/ability.ts index 3c71b880a98..fff03c40be7 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -3596,8 +3596,10 @@ export class PostTurnStatStageChangeAbAttr extends PostTurnAbAttr { if (!simulated) { if (!pokemon.hasAbility(Abilities.SPEED_BOOST)) { pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); + this.showAbility = true; } else if (pokemon.hasAbility(Abilities.SPEED_BOOST) && !pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) { pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); + this.showAbility = true; } else { this.showAbility = false; } diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index ed6a6ff8d46..119e550293c 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -238,10 +238,7 @@ export class SummonPhase extends PartyMemberPokemonPhase { this.scene.unshiftPhase(new ShinySparklePhase(this.scene, pokemon.getBattlerIndex())); } - /** Switch in status is set before the pokemon is summoned and the new turn begins, so it is preserved from switch-summon-phase */ - const switchedInStatus = pokemon.turnData?.switchedInThisTurn; pokemon.resetTurnData(); - pokemon.turnData.switchedInThisTurn = switchedInStatus; if (!this.loaded || [ BattleType.TRAINER, BattleType.MYSTERY_ENCOUNTER ].includes(this.scene.currentBattle.battleType) || (this.scene.currentBattle.waveIndex % 10) === 1) { this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index 137265d409a..01f60fc7246 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -105,10 +105,6 @@ export class SwitchSummonPhase extends SummonPhase { const party = this.player ? this.getParty() : this.scene.getEnemyParty(); const switchedInPokemon = party[this.slotIndex]; this.lastPokemon = this.getPokemon(); - if (this.switchType !== SwitchType.INITIAL_SWITCH) { - switchedInPokemon.resetTurnData(); - switchedInPokemon.turnData.switchedInThisTurn = true; - } applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, this.lastPokemon); if (this.switchType === SwitchType.BATON_PASS && switchedInPokemon) { (this.player ? this.scene.getEnemyField() : this.scene.getPlayerField()).forEach(enemyPokemon => enemyPokemon.transferTagsBySourceId(this.lastPokemon.id, switchedInPokemon.id)); @@ -189,6 +185,11 @@ export class SwitchSummonPhase extends SummonPhase { } } + if (this.switchType !== SwitchType.INITIAL_SWITCH) { + pokemon.resetTurnData(); + pokemon.turnData.switchedInThisTurn = true; + } + this.lastPokemon?.resetSummonData(); this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);