From 63feb88eea0864ea5b67176d6f625ba8b1949290 Mon Sep 17 00:00:00 2001 From: PrabbyDD <147005742+PrabbyDD@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:14:10 -0700 Subject: [PATCH] [Test] Update roost tests, related to #4164 (#4230) * updating roost tests to be more consistent * updating roost tests to be more consistent * updating roost tests to be more consistent --- src/test/moves/roost.test.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/test/moves/roost.test.ts b/src/test/moves/roost.test.ts index df7fc7096b0..c1fc962e876 100644 --- a/src/test/moves/roost.test.ts +++ b/src/test/moves/roost.test.ts @@ -1,3 +1,4 @@ +import { BattlerIndex } from "#app/battle"; import { Type } from "#app/data/type"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Moves } from "#app/enums/moves"; @@ -29,10 +30,9 @@ describe("Moves - Roost", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RELICANTH); game.override.startingLevel(100); - game.override.enemyLevel(60); + game.override.enemyLevel(100); game.override.enemyMoveset(Moves.EARTHQUAKE); game.override.moveset([Moves.ROOST, Moves.BURN_UP, Moves.DOUBLE_SHOCK]); - game.override.starterForms({ [Species.ROTOM]: 4 }); }); /** @@ -55,6 +55,7 @@ describe("Moves - Roost", () => { const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemonStartingHP = playerPokemon.hp; game.move.select(Moves.ROOST); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); // Should only be normal type, and NOT flying type @@ -81,6 +82,7 @@ describe("Moves - Roost", () => { const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemonStartingHP = playerPokemon.hp; game.move.select(Moves.ROOST); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); // Should only be normal type, and NOT flying type @@ -108,6 +110,7 @@ describe("Moves - Roost", () => { const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemonStartingHP = playerPokemon.hp; game.move.select(Moves.ROOST); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); // Should only be pure fighting type and grounded @@ -131,13 +134,15 @@ describe("Moves - Roost", () => { test( "Pokemon with levitate after using roost should lose flying type but still be unaffected by ground moves", async () => { + game.override.starterForms({ [Species.ROTOM]: 4 }); await game.classicMode.startBattle([Species.ROTOM]); const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemonStartingHP = playerPokemon.hp; game.move.select(Moves.ROOST); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); - // Should only be pure fighting type and grounded + // Should only be pure eletric type and grounded let playerPokemonTypes = playerPokemon.getTypes(); expect(playerPokemonTypes[0] === Type.ELECTRIC).toBeTruthy(); expect(playerPokemonTypes.length === 1).toBeTruthy(); @@ -145,7 +150,7 @@ describe("Moves - Roost", () => { await game.phaseInterceptor.to(TurnEndPhase); - // Should have lost HP and is now back to being fighting/flying + // Should have lost HP and is now back to being electric/flying playerPokemonTypes = playerPokemon.getTypes(); expect(playerPokemon.hp).toBe(playerPokemonStartingHP); expect(playerPokemonTypes[0] === Type.ELECTRIC).toBeTruthy(); @@ -162,6 +167,7 @@ describe("Moves - Roost", () => { const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemonStartingHP = playerPokemon.hp; game.move.select(Moves.BURN_UP); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); // Should only be pure flying type after burn up @@ -171,6 +177,7 @@ describe("Moves - Roost", () => { await game.phaseInterceptor.to(TurnEndPhase); game.move.select(Moves.ROOST); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); // Should only be typeless type after roost and is grounded @@ -200,6 +207,7 @@ describe("Moves - Roost", () => { const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemonStartingHP = playerPokemon.hp; game.move.select(Moves.DOUBLE_SHOCK); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); // Should only be pure flying type after burn up @@ -209,6 +217,7 @@ describe("Moves - Roost", () => { await game.phaseInterceptor.to(TurnEndPhase); game.move.select(Moves.ROOST); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase); // Should only be typeless type after roost and is grounded