From 5653ec83be839f028b26d082c810dbe5e0fc1382 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Tue, 5 Aug 2025 21:19:22 -0400 Subject: [PATCH] Fixed minor bugs in the files encore was basing targets off of the PRIOR move, not the encored one. mb --- src/data/battler-tags.ts | 2 +- test/moves/encore.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index da6b58cb7fc..a188b99cad8 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1288,7 +1288,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag { // TODO: Investigate this... const movesetMove = pokemon.getMoveset().find(m => m.moveId === this.moveId) ?? new PokemonMove(this.moveId); - const moveTargets = getMoveTargets(pokemon, movePhase.move.moveId); + const moveTargets = getMoveTargets(pokemon, this.moveId); // Spread moves and ones with only 1 valid target will use their normal targeting. // If not, target a random enemy in our target list const targets = diff --git a/test/moves/encore.test.ts b/test/moves/encore.test.ts index d9b60357a4a..510b36e8581 100644 --- a/test/moves/encore.test.ts +++ b/test/moves/encore.test.ts @@ -44,7 +44,7 @@ describe("Moves - Encore", () => { game.move.use(MoveId.ENCORE); await game.move.forceEnemyMove(MoveId.SPLASH); - await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toNextTurn(); expect(enemyPokemon).toHaveBattlerTag(BattlerTagType.ENCORE); @@ -69,6 +69,7 @@ describe("Moves - Encore", () => { expect(enemy.isMoveRestricted(MoveId.SPLASH)).toBe(false); }); + // TODO: Make test using `changeMoveset` it.todo("should end at turn end if the user forgets the Encored move"); // TODO: Make test (presumably involving Spite)