From f2d7bcb29f86bfa53e19efbd8eeaabda7b87ffa9 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Thu, 20 Feb 2025 09:47:21 +0100 Subject: [PATCH] Using leaveField(true) so that stat changes are correctly applied by Baton Pass --- src/phases/switch-summon-phase.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index 8e90d55e2a2..48f8e26d1e8 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -146,7 +146,8 @@ export class SwitchSummonPhase extends SummonPhase { } else { switchedInPokemon.resetSummonData(); } - this.lastPokemon.leaveField(); + // We cannot clear stat changes yet because they are applied after the new mon is summoned + this.lastPokemon.leaveField(this.switchType === SwitchType.BATON_PASS || this.switchType === SwitchType.SHED_TAIL ? false : true); this.summon(); }; if (this.player) { @@ -184,11 +185,13 @@ export class SwitchSummonPhase extends SummonPhase { if (this.switchType === SwitchType.BATON_PASS && pokemon) { pokemon.transferSummon(this.lastPokemon); + this.lastPokemon.resetSummonData(); } else if (this.switchType === SwitchType.SHED_TAIL && pokemon) { const subTag = this.lastPokemon.getTag(SubstituteTag); if (subTag) { pokemon.summonData.tags.push(subTag); } + this.lastPokemon.resetSummonData(); } if (this.switchType !== SwitchType.INITIAL_SWITCH) {