From cce1653b70480c1bfe78549352428d708972491d Mon Sep 17 00:00:00 2001 From: Bertie690 <136088738+Bertie690@users.noreply.github.com> Date: Sun, 30 Nov 2025 16:25:44 -0500 Subject: [PATCH] [Refactor] Remove unused `PreSwitchOutClearWeatherAbAttr` class https://github.com/pagefaultgames/pokerogue/pull/6809 --- src/data/abilities/ability.ts | 61 +---------------------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index f703c4aa75f..bb54c2303f3 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -3361,6 +3361,7 @@ export class CommanderAbAttr extends AbAttr { /** * Base class for ability attributes that apply their effect when their user switches out. */ +// TODO: Clarify the differences between this and `PreLeaveFieldAbAttr` export abstract class PreSwitchOutAbAttr extends AbAttr { constructor(showAbility = true) { super(showAbility); @@ -3393,65 +3394,6 @@ export class PreSwitchOutResetStatusAbAttr extends PreSwitchOutAbAttr { } } -/** - * Clears Desolate Land/Primordial Sea/Delta Stream upon the Pokemon switching out. - */ -export class PreSwitchOutClearWeatherAbAttr extends PreSwitchOutAbAttr { - override apply({ pokemon, simulated }: AbAttrBaseParams): boolean { - // TODO: Evaluate why this is returning a boolean rather than relay - const weatherType = globalScene.arena.weather?.weatherType; - let turnOffWeather = false; - - // Clear weather only if user's ability matches the weather and no other pokemon has the ability. - switch (weatherType) { - case WeatherType.HARSH_SUN: - if ( - pokemon.hasAbility(AbilityId.DESOLATE_LAND) - && globalScene - .getField(true) - .filter(p => p !== pokemon) - .filter(p => p.hasAbility(AbilityId.DESOLATE_LAND)).length === 0 - ) { - turnOffWeather = true; - } - break; - case WeatherType.HEAVY_RAIN: - if ( - pokemon.hasAbility(AbilityId.PRIMORDIAL_SEA) - && globalScene - .getField(true) - .filter(p => p !== pokemon) - .filter(p => p.hasAbility(AbilityId.PRIMORDIAL_SEA)).length === 0 - ) { - turnOffWeather = true; - } - break; - case WeatherType.STRONG_WINDS: - if ( - pokemon.hasAbility(AbilityId.DELTA_STREAM) - && globalScene - .getField(true) - .filter(p => p !== pokemon) - .filter(p => p.hasAbility(AbilityId.DELTA_STREAM)).length === 0 - ) { - turnOffWeather = true; - } - break; - } - - if (simulated) { - return turnOffWeather; - } - - if (turnOffWeather) { - globalScene.arena.trySetWeather(WeatherType.NONE); - return true; - } - - return false; - } -} - export class PreSwitchOutHealAbAttr extends PreSwitchOutAbAttr { override canApply({ pokemon }: AbAttrBaseParams): boolean { return !pokemon.isFullHp(); @@ -6730,7 +6672,6 @@ const AbilityAttrs = Object.freeze({ CommanderAbAttr, PreSwitchOutAbAttr, PreSwitchOutResetStatusAbAttr, - PreSwitchOutClearWeatherAbAttr, PreSwitchOutHealAbAttr, PreSwitchOutFormChangeAbAttr, PreLeaveFieldAbAttr,