From 7406415e7d08b118cc265a2d53641422bc1429cd Mon Sep 17 00:00:00 2001 From: Zach Day Date: Mon, 17 Jun 2024 16:30:36 -0400 Subject: [PATCH] Use array as parameter for FieldPreventMovesAbAttr --- src/data/ability.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 508e68a3af3..fb84067ac9a 100755 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -3294,16 +3294,16 @@ export class BlockRedirectAbAttr extends AbAttr { } * @param args [1] {@linkcode Pokemon} The user of the attack */ export class FieldPreventMovesAbAttr extends AbAttr { - public moveCondition: (Moves) => boolean; + public preventedMoves: Moves[]; - constructor(moveCondition: (Moves) => boolean) { + constructor(moves: Moves[]) { super(); - this.moveCondition = moveCondition; + this.preventedMoves = moves; } /** @param args See {@linkcode FieldPreventMovesAbAttr}. */ apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (this.moveCondition((args[0] as Move).id)) { + if (this.preventedMoves.includes((args[0] as Move).id)) { cancelled.value = true; return true; } @@ -3890,7 +3890,7 @@ export function initAbilities() { .attr(BlockOneHitKOAbAttr) .ignorable(), new Ability(Abilities.DAMP, 3) - .attr(FieldPreventMovesAbAttr, (move) => [Moves.EXPLOSION, Moves.SELF_DESTRUCT, Moves.MIND_BLOWN, Moves.MISTY_EXPLOSION].includes(move)) + .attr(FieldPreventMovesAbAttr, [Moves.EXPLOSION, Moves.SELF_DESTRUCT, Moves.MIND_BLOWN, Moves.MISTY_EXPLOSION]) .attr(PreventPostFaintContactDamageAbAttr) .ignorable(), new Ability(Abilities.LIMBER, 3)