From f58c16c3c8f12f1e2e067a94fddc0c323a2a9fb3 Mon Sep 17 00:00:00 2001 From: LaukkaE Date: Fri, 12 Apr 2024 23:53:46 +0300 Subject: [PATCH] try to account for passives simplify ability check remove logs --- src/data/ability.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 59dc3753f97..e982fc0ed30 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -385,15 +385,15 @@ export class PostDefendAbAttr extends AbAttr { } export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr { - applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { - const pranksterStatus = attacker.getAbility().id === Abilities.PRANKSTER && move.getMove().category === MoveCategory.STATUS; - - if ((move.getMove().priority > 0 || pranksterStatus) && !cancelled.value && !move.getMove().isMultiTarget()) { - cancelled.value = true; - return true; - } - + const attackPriority = new Utils.IntegerHolder(move.getMove().priority); + applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority); + + if(attackPriority.value > 0 && !move.getMove().isMultiTarget()) { + cancelled.value = true; + return true; + } + return false; } } @@ -1193,7 +1193,6 @@ export class IncrementMovePriorityAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (!this.moveIncrementFunc(pokemon, args[0] as Move)) return false; - (args[1] as Utils.IntegerHolder).value += this.increaseAmount; return true; }