-
-
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.
Remove
.edgeCase()
from fully implemented moves
This includes Sunsteel Strike, Moongeist Beam and Photon Geyser
- Loading branch information
Showing
2 changed files
with
62 additions
and
6 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,59 @@ | ||
import { allMoves, RandomMoveAttr } from "#app/data/move"; | ||
import { Abilities } from "#enums/abilities"; | ||
import { Moves } from "#enums/moves"; | ||
import { Species } from "#enums/species"; | ||
import GameManager from "#test/utils/gameManager"; | ||
import Phaser from "phaser"; | ||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; | ||
|
||
describe("Moves - Moongeist Beam", () => { | ||
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.MOONGEIST_BEAM, Moves.METRONOME ]) | ||
.ability(Abilities.BALL_FETCH) | ||
.startingLevel(200) | ||
.battleType("single") | ||
.disableCrits() | ||
.enemySpecies(Species.MAGIKARP) | ||
.enemyAbility(Abilities.STURDY) | ||
.enemyMoveset(Moves.SPLASH); | ||
}); | ||
|
||
// Also covers Photon Geyser and Sunsteel Strike | ||
it("should ignore enemy abilities", async () => { | ||
await game.classicMode.startBattle([ Species.MILOTIC ]); | ||
|
||
const enemy = game.scene.getEnemyPokemon()!; | ||
|
||
game.move.select(Moves.MOONGEIST_BEAM); | ||
await game.phaseInterceptor.to("BerryPhase"); | ||
|
||
expect(enemy.isFainted()).toBe(true); | ||
}); | ||
|
||
// Also covers Photon Geyser and Sunsteel Strike | ||
it("should not ignore enemy abilities when called by another move, such as metronome", async () => { | ||
await game.classicMode.startBattle([ Species.MILOTIC ]); | ||
vi.spyOn(allMoves[Moves.METRONOME].getAttrs(RandomMoveAttr)[0], "getMoveOverride").mockReturnValue(Moves.MOONGEIST_BEAM); | ||
|
||
game.move.select(Moves.METRONOME); | ||
await game.phaseInterceptor.to("BerryPhase"); | ||
|
||
expect(game.scene.getEnemyPokemon()!.isFainted()).toBe(false); | ||
expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].move).toBe(Moves.MOONGEIST_BEAM); | ||
}); | ||
}); |