From 4dee409fcc71e94fd59ae28f7af178a9b4906ffb Mon Sep 17 00:00:00 2001 From: TaylorLeLievre Date: Sat, 7 Sep 2024 21:57:47 -0400 Subject: [PATCH] Added unit test --- src/test/arena/weather_strong_winds.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/arena/weather_strong_winds.test.ts b/src/test/arena/weather_strong_winds.test.ts index 8b2d3e2547e..9a0c028b5d5 100644 --- a/src/test/arena/weather_strong_winds.test.ts +++ b/src/test/arena/weather_strong_winds.test.ts @@ -1,4 +1,6 @@ import { allMoves } from "#app/data/move"; +import { StatusEffect } from "#app/enums/status-effect.js"; +import { TurnEndPhase } from "#app/phases/turn-end-phase.js"; import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; @@ -75,4 +77,21 @@ describe("Weather - Strong Winds", () => { await game.phaseInterceptor.to(TurnStartPhase); expect(enemy.getAttackTypeEffectiveness(allMoves[Moves.ROCK_SLIDE].type, pikachu)).toBe(1); }); + it("weather goes away when last trainer pokemon dies to indirect damage", async () => { + + game.override.enemyStatusEffect(StatusEffect.POISON); + + await game.startBattle([Species.MAGIKARP]); + + const enemy = game.scene.getEnemyPokemon()!; + + + enemy["hp"] = 0.0001; + + + game.move.select(Moves.SPLASH); + await game.phaseInterceptor.to(TurnEndPhase); + + expect(game.scene.arena.weather?.weatherType).toBeUndefined(); + }); });