From 4d89b76d344cf04f7865ea9e26234bc03149793d Mon Sep 17 00:00:00 2001 From: Zach Day Date: Fri, 9 Aug 2024 12:53:13 -0400 Subject: [PATCH] Inline struggle check function --- src/data/move.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 44b194d03b6..1cb05b47273 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6006,7 +6006,6 @@ const unknownTypeCondition: MoveConditionFunc = (user, target, move) => !user.ge /** Ensures that the target has at least one non-virtual, non-NONE move in its history. */ const targetHasMoveHistoryCondition: MoveConditionFunc = (user, target, move) => target.getLastXMoves().filter(m => m.move !== Moves.NONE && !m.virtual).length >= 1; -const targetLastMoveIsNotStruggleCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => target.getLastXMoves(1).at(0)?.move !== Moves.STRUGGLE; export type MoveTargetSet = { targets: BattlerIndex[]; @@ -6213,7 +6212,7 @@ export function initMoves() { new StatusMove(Moves.DISABLE, Type.NORMAL, 100, 20, -1, 0, 1) .attr(AddBattlerTagAttr, BattlerTagType.DISABLED, false, true) .condition(targetHasMoveHistoryCondition) - .condition(targetLastMoveIsNotStruggleCondition) + .condition((user, target, move) => target.getLastXMoves().at(0)?.move !== Moves.STRUGGLE) .condition(failOnMaxCondition), new AttackMove(Moves.ACID, Type.POISON, MoveCategory.SPECIAL, 40, 100, 30, 10, 0, 1) .attr(StatChangeAttr, BattleStat.SPDEF, -1)