mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-29 20:27:18 +00:00
[Move] fix for sparkly swirl apply check (#1059)
fix for sparkly swirl apply check Update move.ts Co-authored-by: Temps Ray <temps.ray@gmail.com>
This commit is contained in:
parent
aba9310ddf
commit
c746d0723f
11
src/data/move.ts
Executable file → Normal file
11
src/data/move.ts
Executable file → Normal file
@ -1251,11 +1251,18 @@ export class PartyStatusCureAttr extends MoveEffectAttr {
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user