mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
try to account for passives
simplify ability check remove logs
This commit is contained in:
parent
24312559a9
commit
f58c16c3c8
@ -385,15 +385,15 @@ 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()) {
|
|
||||||
cancelled.value = true;
|
if(attackPriority.value > 0 && !move.getMove().isMultiTarget()) {
|
||||||
return true;
|
cancelled.value = 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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user