try to account for passives

simplify ability check

remove logs
This commit is contained in:
LaukkaE 2024-04-12 23:53:46 +03:00
parent 24312559a9
commit f58c16c3c8

View File

@ -385,14 +385,14 @@ export class PostDefendAbAttr extends AbAttr {
} }
export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr { export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { 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; const attackPriority = new Utils.IntegerHolder(move.getMove().priority);
applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority);
if ((move.getMove().priority > 0 || pranksterStatus) && !cancelled.value && !move.getMove().isMultiTarget()) { if(attackPriority.value > 0 && !move.getMove().isMultiTarget()) {
cancelled.value = true; cancelled.value = true;
return true; return true;
} }
return false; return false;
} }
@ -1193,7 +1193,6 @@ export class IncrementMovePriorityAbAttr extends AbAttr {
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
if (!this.moveIncrementFunc(pokemon, args[0] as Move)) if (!this.moveIncrementFunc(pokemon, args[0] as Move))
return false; return false;
(args[1] as Utils.IntegerHolder).value += this.increaseAmount; (args[1] as Utils.IntegerHolder).value += this.increaseAmount;
return true; return true;
} }