Add back applyPreLeaveFieldAttrs

Attribute was removed due to absence in a cherry-pick
This commit is contained in:
Sirz Benjie 2025-02-08 22:48:35 -06:00
parent 7a4f4cfb15
commit 64025954d6
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -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<boolean> {
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<boolean> {
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<PreLeaveFieldAbAttr>,
pokemon: Pokemon,
simulated: boolean = false,
...args: any[]
): void {
return applyAbAttrsInternal<PreLeaveFieldAbAttr>(
attrType,
pokemon,
(attr, passive) =>
attr.applyPreLeaveField(pokemon, passive, simulated, args),
args,
true,
simulated
);
}
export function applyPreStatStageChangeAbAttrs(
attrType: Constructor<PreStatStageChangeAbAttr>,
pokemon: Pokemon | null,