From 0d6727b2909e6587902e377d2aaec120666e3e41 Mon Sep 17 00:00:00 2001 From: cgiang39 <146129103+charliegiang@users.noreply.github.com> Date: Fri, 17 May 2024 16:56:23 -0500 Subject: [PATCH] fix for sparkly swirl apply check fix for sparkly swirl apply check Update move.ts --- src/data/move.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 99ef179ad30..6e63c914897 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -972,11 +972,19 @@ export class PartyStatusCureAttr extends MoveEffectAttr { this.message = message; this.abilityCondition = abilityCondition; } + + //The same as MoveEffectAttr.canApply, except it doesn't check for the target's HP. + canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]) { + 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 (!super.apply(user, target, move, args)) + if (!this.canApply(user, target, move, args)) { return false; - + } this.addPartyCurePhase(user); }