From 78401189db9944cd0c5caae59f9334627c26aced Mon Sep 17 00:00:00 2001 From: Dean Date: Mon, 16 Jun 2025 20:55:15 -0700 Subject: [PATCH] Bandaid fix forecast --- src/field/arena.ts | 8 +++++++- src/phases/switch-summon-phase.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/field/arena.ts b/src/field/arena.ts index 8d7e5037852..82f7f5c857b 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -380,9 +380,15 @@ export class Arena { /** * Function to trigger all weather based form changes + * @param source - The Pokemon causing the changes by removing itself from the field */ - triggerWeatherBasedFormChanges(): void { + triggerWeatherBasedFormChanges(source?: Pokemon): void { globalScene.getField(true).forEach(p => { + // TODO - This is a bandaid. Abilities leaving the field needs a better approach than + // calling this method for every switch out that happens + if (p === source) { + return; + } const isCastformWithForecast = p.hasAbility(AbilityId.FORECAST) && p.species.speciesId === SpeciesId.CASTFORM; const isCherrimWithFlowerGift = p.hasAbility(AbilityId.FLOWER_GIFT) && p.species.speciesId === SpeciesId.CHERRIM; diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index 175621918a2..3a78c97c014 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -241,7 +241,7 @@ export class SwitchSummonPhase extends SummonPhase { globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); // Reverts to weather-based forms when weather suppressors (Cloud Nine/Air Lock) are switched out - globalScene.arena.triggerWeatherBasedFormChanges(); + globalScene.arena.triggerWeatherBasedFormChanges(pokemon); } queuePostSummon(): void {