Fixed wish tests

This commit is contained in:
Bertie690 2025-07-23 12:28:19 -04:00
parent 2c207980d3
commit f942be8a8c
2 changed files with 7 additions and 3 deletions

View File

@ -152,8 +152,10 @@ export class WishTag extends PositionalTag implements WishArgs {
}
public shouldDisappear(): boolean {
// Disappear if no target.
// Disappear if no target or target is fainted.
// The source need not exist at the time of activation (since all we need is a simple message)
return !this.getTarget();
// TODO: Verify whether Wish shows a message if the Pokemon it would affect is KO'd on the turn of activation
const target = this.getTarget();
return !target || target.isFainted();
}
}

View File

@ -118,6 +118,8 @@ describe("Move - Wish", () => {
game.move.use(MoveId.WISH, BattlerIndex.PLAYER);
game.move.use(MoveId.WISH, BattlerIndex.PLAYER_2);
await game.move.forceEnemyMove(MoveId.WISH);
await game.move.forceEnemyMove(MoveId.WISH);
await game.toNextTurn();
expectWishActive(2);
@ -146,7 +148,7 @@ describe("Move - Wish", () => {
expect(blissey.hp).toBe(toDmgValue(blissey.getMaxHp() / 2) + 1);
});
it("should vanish if slot is empty", async () => {
it("should vanish and not play message if slot is empty", async () => {
game.override.battleStyle("double");
await game.classicMode.startBattle([SpeciesId.ALOMOMOLA, SpeciesId.BLISSEY]);