Fixed minor bugs in the files

encore was basing targets off of the PRIOR move, not the encored one. mb
This commit is contained in:
Bertie690 2025-08-05 21:19:22 -04:00
parent 93c3422f91
commit 5653ec83be
2 changed files with 3 additions and 2 deletions

View File

@ -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 =

View File

@ -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)