From 38495f9df37eb4d73cee6fbae1c244c4488531f8 Mon Sep 17 00:00:00 2001 From: Eucalyptus Date: Fri, 23 Aug 2024 01:09:56 -0400 Subject: [PATCH] Add tests for Toxic Orb and Flame Orb priorities --- src/test/moves/trick.test.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/test/moves/trick.test.ts b/src/test/moves/trick.test.ts index c8e3fb7ab78..181a68933ae 100644 --- a/src/test/moves/trick.test.ts +++ b/src/test/moves/trick.test.ts @@ -125,6 +125,41 @@ describe("Moves - Trick", () => { }, TIMEOUT ); + it( + "the user will always give Toxic Orb, as it has special priority to be given", + async () => { + game.override.startingHeldItems([{name: "GOLDEN_PUNCH"}, {name: "TOXIC_ORB"}]); + game.override.enemyHeldItems([{name: "LEFTOVERS"}, {name: "GOLDEN_PUNCH"}]); + game.override.moveset(TRICK_ONLY); + game.override.enemySpecies(Species.MAGIKARP); + game.override.enemyMoveset(SPLASH_ONLY); + await game.startBattle([Species.MIME_JR]); + + game.doAttack(0); + await game.phaseInterceptor.to(TurnEndPhase); + + const playerPokemon = game.scene.getPlayerPokemon(); + expect(playerPokemon.getHeldItems()[1].type.id === "TOXIC_ORB").toBeFalsy(); + } + ); + + it( + "the user will never take Flame Orb, as it has special priority to not be taken", + async () => { + game.override.enemyHeldItems([{name: "FLAME_ORB"}, {name: "GOLDEN_PUNCH"}]); + game.override.moveset(TRICK_ONLY); + game.override.enemySpecies(Species.MAGIKARP); + game.override.enemyMoveset(SPLASH_ONLY); + await game.startBattle([Species.MIME_JR]); + + game.doAttack(0); + await game.phaseInterceptor.to(TurnEndPhase); + + const enemyPokemon = game.scene.getEnemyPokemon(); + expect(enemyPokemon.getHeldItems()[0].type.id === "FLAME_ORB").toBeTruthy(); + } + ); + it( "the move fails and no transfer occurs when a wild pokemon is the user", async () => {