-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[P2] Diamond Storm should only trigger once when hitting multiple pok…
…emon (#4544) * Diamond Storm should only trigger once when hitting multiple pokemon * Also fix Clangorous Soulblaze just in case * Fix linting * Fix linting Oops missed this one
- Loading branch information
Showing
2 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { allMoves } from "#app/data/move"; | ||
import { Abilities } from "#enums/abilities"; | ||
import { Moves } from "#enums/moves"; | ||
import { Species } from "#enums/species"; | ||
import { Stat } from "#enums/stat"; | ||
import GameManager from "#test/utils/gameManager"; | ||
import Phaser from "phaser"; | ||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; | ||
|
||
describe("Moves - Diamond Storm", () => { | ||
let phaserGame: Phaser.Game; | ||
let game: GameManager; | ||
|
||
beforeAll(() => { | ||
phaserGame = new Phaser.Game({ | ||
type: Phaser.HEADLESS, | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
game.phaseInterceptor.restoreOg(); | ||
}); | ||
|
||
beforeEach(() => { | ||
game = new GameManager(phaserGame); | ||
game.override | ||
.moveset([ Moves.DIAMOND_STORM ]) | ||
.battleType("single") | ||
.enemySpecies(Species.MAGIKARP) | ||
.enemyAbility(Abilities.BALL_FETCH) | ||
.enemyMoveset(Moves.SPLASH); | ||
}); | ||
|
||
it("should only increase defense once even if hitting 2 pokemon", async () => { | ||
game.override.battleType("double"); | ||
const diamondStorm = allMoves[Moves.DIAMOND_STORM]; | ||
vi.spyOn(diamondStorm, "chance", "get").mockReturnValue(100); | ||
vi.spyOn(diamondStorm, "accuracy", "get").mockReturnValue(100); | ||
await game.classicMode.startBattle([ Species.FEEBAS ]); | ||
|
||
game.move.select(Moves.DIAMOND_STORM); | ||
await game.phaseInterceptor.to("BerryPhase"); | ||
|
||
expect(game.scene.getPlayerPokemon()!.getStatStage(Stat.DEF)).toBe(2); | ||
}); | ||
}); |