From 999801160d3f5e80aa55a255e2e9fca781c3a062 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Tue, 24 Jun 2025 19:25:38 -0400 Subject: [PATCH] Fixed oopsie with mirror move/copycat --- src/data/moves/move.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index a34b7222c34..41d954d2d14 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -7031,7 +7031,7 @@ export class NaturePowerAttr extends CallMoveAttr { } /** - * Attribute used to copy a previously-used move. + * Attribute used to copy the last move executed. * Used for {@linkcode MoveId.COPYCAT} and {@linkcode MoveId.MIRROR_MOVE}. */ export class CopyMoveAttr extends CallMoveAttr { @@ -7047,10 +7047,14 @@ export class CopyMoveAttr extends CallMoveAttr { super(selfTarget); } + /** + * If `selfTarget` is `true`, grab the last successful move used by anyone. + * Otherwise, select the last move used by the target. + */ override getMove(_user: Pokemon, target: Pokemon): MoveId { return this.selfTarget - ? globalScene.currentBattle.lastMove - : target.getLastXMoves()[0]?.move ?? MoveId.NONE + ? target.getLastXMoves()[0]?.move ?? MoveId.NONE + : globalScene.currentBattle.lastMove } getCondition(): MoveConditionFunc {