-
-
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.
[Balance] Endure Tokens only endure one hit (#4875)
* Endure Tokens only endure one hit * Add tests for Endure * Update docs --------- Co-authored-by: NightKev <[email protected]>
- Loading branch information
1 parent
413f2b8
commit 360a897
Showing
5 changed files
with
81 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
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
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,65 @@ | ||
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 } from "vitest"; | ||
|
||
describe("Moves - Endure", () => { | ||
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.THUNDER, Moves.BULLET_SEED, Moves.TOXIC ]) | ||
.ability(Abilities.SKILL_LINK) | ||
.startingLevel(100) | ||
.battleType("single") | ||
.disableCrits() | ||
.enemySpecies(Species.MAGIKARP) | ||
.enemyAbility(Abilities.NO_GUARD) | ||
.enemyMoveset(Moves.ENDURE); | ||
}); | ||
|
||
it("should let the pokemon survive with 1 HP", async () => { | ||
await game.classicMode.startBattle([ Species.ARCEUS ]); | ||
|
||
game.move.select(Moves.THUNDER); | ||
await game.phaseInterceptor.to("BerryPhase"); | ||
|
||
expect(game.scene.getEnemyPokemon()!.hp).toBe(1); | ||
}); | ||
|
||
it("should let the pokemon survive with 1 HP when hit with a multihit move", async () => { | ||
await game.classicMode.startBattle([ Species.ARCEUS ]); | ||
|
||
game.move.select(Moves.BULLET_SEED); | ||
await game.phaseInterceptor.to("BerryPhase"); | ||
|
||
expect(game.scene.getEnemyPokemon()!.hp).toBe(1); | ||
}); | ||
|
||
it("shouldn't prevent fainting from indirect damage", async () => { | ||
game.override.enemyLevel(100); | ||
await game.classicMode.startBattle([ Species.ARCEUS ]); | ||
|
||
const enemy = game.scene.getEnemyPokemon()!; | ||
enemy.hp = 2; | ||
|
||
game.move.select(Moves.TOXIC); | ||
await game.phaseInterceptor.to("VictoryPhase"); | ||
|
||
expect(enemy.isFainted()).toBe(true); | ||
}); | ||
}); |