mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 05:12:19 +02:00
fix for sparkly swirl apply check
fix for sparkly swirl apply check Update move.ts
This commit is contained in:
parent
1f1c243415
commit
0d6727b290
@ -972,11 +972,19 @@ export class PartyStatusCureAttr extends MoveEffectAttr {
|
|||||||
this.message = message;
|
this.message = message;
|
||||||
this.abilityCondition = abilityCondition;
|
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 {
|
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;
|
return false;
|
||||||
|
}
|
||||||
this.addPartyCurePhase(user);
|
this.addPartyCurePhase(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user