diff --git a/src/data/ability.ts b/src/data/ability.ts index 0eaa0acbefb..465108ba6e3 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2841,7 +2841,7 @@ export class PreSwitchOutFormChangeAbAttr extends PreSwitchOutAbAttr { } export class PreLeaveFieldAbAttr extends AbAttr { - applyPreLeaveField(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean | Promise { + applyPreLeaveField(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { return false; } } @@ -2856,7 +2856,7 @@ export class PreLeaveFieldClearWeatherAbAttr extends PreLeaveFieldAbAttr { * @param args N/A * @returns Returns `true` if the weather clears, otherwise `false`. */ - applyPreLeaveField(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean | Promise { + applyPreLeaveField(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { const weatherType = globalScene.arena.weather?.weatherType; let turnOffWeather = false; @@ -5646,6 +5646,23 @@ export function applyPreSwitchOutAbAttrs( ); } +export function applyPreLeaveFieldAbAttrs( + attrType: Constructor, + pokemon: Pokemon, + simulated: boolean = false, + ...args: any[] +): void { + return applyAbAttrsInternal( + attrType, + pokemon, + (attr, passive) => + attr.applyPreLeaveField(pokemon, passive, simulated, args), + args, + true, + simulated + ); +} + export function applyPreStatStageChangeAbAttrs( attrType: Constructor, pokemon: Pokemon | null,