Bandaid fix forecast

This commit is contained in:
Dean 2025-06-16 20:55:15 -07:00
parent 8bc6b4b9fa
commit 78401189db
2 changed files with 8 additions and 2 deletions

View File

@ -380,9 +380,15 @@ export class Arena {
/** /**
* Function to trigger all weather based form changes * 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 => { 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 isCastformWithForecast = p.hasAbility(AbilityId.FORECAST) && p.species.speciesId === SpeciesId.CASTFORM;
const isCherrimWithFlowerGift = p.hasAbility(AbilityId.FLOWER_GIFT) && p.species.speciesId === SpeciesId.CHERRIM; const isCherrimWithFlowerGift = p.hasAbility(AbilityId.FLOWER_GIFT) && p.species.speciesId === SpeciesId.CHERRIM;

View File

@ -241,7 +241,7 @@ export class SwitchSummonPhase extends SummonPhase {
globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);
// Reverts to weather-based forms when weather suppressors (Cloud Nine/Air Lock) are switched out // Reverts to weather-based forms when weather suppressors (Cloud Nine/Air Lock) are switched out
globalScene.arena.triggerWeatherBasedFormChanges(); globalScene.arena.triggerWeatherBasedFormChanges(pokemon);
} }
queuePostSummon(): void { queuePostSummon(): void {