fix for sparkly swirl apply check

fix for sparkly swirl apply check

Update move.ts
This commit is contained in:
cgiang39 2024-05-17 16:56:23 -05:00
parent 1f1c243415
commit 0d6727b290

View File

@ -973,10 +973,18 @@ export class PartyStatusCureAttr extends MoveEffectAttr {
this.abilityCondition = abilityCondition; this.abilityCondition = abilityCondition;
} }
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { //The same as MoveEffectAttr.canApply, except it doesn't check for the target's HP.
if (!super.apply(user, target, move, args)) canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]) {
return false; const isTargetValid =
(this.selfTarget && user.hp && !user.getTag(BattlerTagType.FRENZY)) ||
(!this.selfTarget && (!target.getTag(BattlerTagType.PROTECTED) || move.hasFlag(MoveFlags.IGNORE_PROTECT)))
return !!isTargetValid;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!this.canApply(user, target, move, args)) {
return false;
}
this.addPartyCurePhase(user); this.addPartyCurePhase(user);
} }