From f942be8a8ce1f4da9847aa3c0456a1eb1cb95ec2 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Wed, 23 Jul 2025 12:28:19 -0400 Subject: [PATCH] Fixed wish tests --- src/data/positional-tags/positional-tag.ts | 6 ++++-- test/moves/wish.test.ts | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/data/positional-tags/positional-tag.ts b/src/data/positional-tags/positional-tag.ts index ae2234cb711..5ef23a1dc1a 100644 --- a/src/data/positional-tags/positional-tag.ts +++ b/src/data/positional-tags/positional-tag.ts @@ -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(); } } diff --git a/test/moves/wish.test.ts b/test/moves/wish.test.ts index 27a1cf99733..06969a4f560 100644 --- a/test/moves/wish.test.ts +++ b/test/moves/wish.test.ts @@ -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]);