diff --git a/src/test/abilities/dry_skin.test.ts b/src/test/abilities/dry_skin.test.ts index b7e627ba548..a97914660bc 100644 --- a/src/test/abilities/dry_skin.test.ts +++ b/src/test/abilities/dry_skin.test.ts @@ -145,13 +145,14 @@ describe("Abilities - Dry Skin", () => { it("opposing water moves still heal regardless of accuracy check", async () => { await game.classicMode.startBattle(); - const enemyPokemon = game.scene.getEnemyPokemon()!; + const enemy = game.scene.getEnemyPokemon()!; game.move.select(Moves.WATER_GUN); + enemy.hp = enemy.hp - 1; await game.phaseInterceptor.to("MoveEffectPhase"); await game.move.forceMiss(); await game.phaseInterceptor.to("BerryPhase", false); - expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + expect(enemy.hp).toBe(enemy.getMaxHp()); }); }); diff --git a/src/test/abilities/flash_fire.test.ts b/src/test/abilities/flash_fire.test.ts index ab768dd4789..9c78de99575 100644 --- a/src/test/abilities/flash_fire.test.ts +++ b/src/test/abilities/flash_fire.test.ts @@ -38,7 +38,7 @@ describe("Abilities - Flash Fire", () => { it("immune to Fire-type moves", async () => { game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH); - await game.startBattle([Species.BLISSEY]); + await game.classicMode.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; @@ -49,7 +49,7 @@ describe("Abilities - Flash Fire", () => { it("not activate if the Pokémon is protected from the Fire-type move", async () => { game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.PROTECT]); - await game.startBattle([Species.BLISSEY]); + await game.classicMode.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; @@ -60,7 +60,7 @@ describe("Abilities - Flash Fire", () => { it("activated by Will-O-Wisp", async () => { game.override.enemyMoveset([Moves.WILL_O_WISP]).moveset(Moves.SPLASH); - await game.startBattle([Species.BLISSEY]); + await game.classicMode.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; @@ -76,7 +76,7 @@ describe("Abilities - Flash Fire", () => { it("activated after being frozen", async () => { game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH); game.override.statusEffect(StatusEffect.FREEZE); - await game.startBattle([Species.BLISSEY]); + await game.classicMode.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; @@ -88,7 +88,7 @@ describe("Abilities - Flash Fire", () => { it("not passing with baton pass", async () => { game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.BATON_PASS]); - await game.startBattle([Species.BLISSEY, Species.CHANSEY]); + await game.classicMode.startBattle([Species.BLISSEY, Species.CHANSEY]); // ensure use baton pass after enemy moved game.move.select(Moves.BATON_PASS); @@ -105,7 +105,7 @@ describe("Abilities - Flash Fire", () => { it("boosts Fire-type move when the ability is activated", async () => { game.override.enemyMoveset([Moves.FIRE_PLEDGE]).moveset([Moves.EMBER, Moves.SPLASH]); game.override.enemyAbility(Abilities.FLASH_FIRE).ability(Abilities.NONE); - await game.startBattle([Species.BLISSEY]); + await game.classicMode.startBattle([Species.BLISSEY]); const blissey = game.scene.getPlayerPokemon()!; const initialHP = 1000; blissey.hp = initialHP; @@ -128,21 +128,31 @@ describe("Abilities - Flash Fire", () => { }, 20000); it("still activates regardless of accuracy check", async () => { - game.override.moveset(Moves.FLAMETHROWER); - game.override.enemyMoveset(Moves.SPLASH); - game.override.enemySpecies(Species.MAGIKARP); - game.override.enemyAbility(Abilities.FLASH_FIRE); + game.override.moveset(Moves.FIRE_PLEDGE).enemyMoveset(Moves.EMBER); + game.override.enemyAbility(Abilities.NONE).ability(Abilities.FLASH_FIRE); + game.override.enemySpecies(Species.BLISSEY); + await game.classicMode.startBattle([Species.RATTATA]); - await game.classicMode.startBattle(); + const blissey = game.scene.getEnemyPokemon()!; + const initialHP = 1000; + blissey.hp = initialHP; - const enemyPokemon = game.scene.getEnemyPokemon()!; - - game.move.select(Moves.FLAMETHROWER); - await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + // first turn + game.move.select(Moves.FIRE_PLEDGE); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to("MoveEffectPhase"); - await game.move.forceMiss(); - await game.phaseInterceptor.to("BerryPhase", false); - expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + await game.phaseInterceptor.to(TurnEndPhase); + const originalDmg = initialHP - blissey.hp; + + expect(blissey.hp > 0); + blissey.hp = initialHP; + + // second turn + game.move.select(Moves.FIRE_PLEDGE); + await game.phaseInterceptor.to(TurnEndPhase); + const flashFireDmg = initialHP - blissey.hp; + + expect(flashFireDmg).toBeGreaterThan(originalDmg); }, 20000); }); diff --git a/src/test/abilities/sap_sipper.test.ts b/src/test/abilities/sap_sipper.test.ts index 0e9be34d54f..b73bc3d9e27 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -181,6 +181,6 @@ describe("Abilities - Sap Sipper", () => { await game.move.forceMiss(); await game.phaseInterceptor.to("BerryPhase", false); - expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1); }); }); diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index d1a57ad3c6a..9bd5de7df57 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -63,6 +63,7 @@ describe("Abilities - Volt Absorb", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.THUNDERBOLT); + enemyPokemon.hp = enemyPokemon.hp - 1; await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.phaseInterceptor.to("MoveEffectPhase");