mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-21 07:42:25 +02:00
Creates additional unit tests for endure
This commit is contained in:
parent
843244a1d2
commit
1ebab2de57
@ -22,7 +22,7 @@ describe("Moves - Endure", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.moveset([ Moves.THUNDER, Moves.BULLET_SEED, Moves.TOXIC ])
|
.moveset([ Moves.THUNDER, Moves.BULLET_SEED, Moves.TOXIC, Moves.SHEER_COLD ])
|
||||||
.ability(Abilities.SKILL_LINK)
|
.ability(Abilities.SKILL_LINK)
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
@ -50,16 +50,37 @@ describe("Moves - Endure", () => {
|
|||||||
expect(game.scene.getEnemyPokemon()!.hp).toBe(1);
|
expect(game.scene.getEnemyPokemon()!.hp).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shouldn't prevent fainting from indirect damage", async () => {
|
it("should let the pokemon survive against OHKO moves", async () => {
|
||||||
game.override.enemyLevel(100);
|
await game.classicMode.startBattle([ Species.MAGIKARP ]);
|
||||||
await game.classicMode.startBattle([ Species.ARCEUS ]);
|
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
enemy.hp = 2;
|
|
||||||
|
|
||||||
game.move.select(Moves.TOXIC);
|
game.move.select(Moves.SHEER_COLD);
|
||||||
await game.phaseInterceptor.to("VictoryPhase");
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
expect(enemy.isFainted()).toBe(true);
|
expect(enemy.isFainted()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
// comprehensive indirect damage test copied from Reviver Seed test
|
||||||
|
it.each([
|
||||||
|
{ moveType: "Damaging Move Chip Damage", move: Moves.SALT_CURE },
|
||||||
|
{ moveType: "Chip Damage", move: Moves.LEECH_SEED },
|
||||||
|
{ moveType: "Trapping Chip Damage", move: Moves.WHIRLPOOL },
|
||||||
|
{ moveType: "Status Effect Damage", move: Moves.TOXIC },
|
||||||
|
{ moveType: "Weather", move: Moves.SANDSTORM },
|
||||||
|
])("should not prevent fainting from $moveType", async ({ move }) => {
|
||||||
|
game.override
|
||||||
|
.enemyLevel(1)
|
||||||
|
.startingLevel(100)
|
||||||
|
.enemySpecies(Species.MAGIKARP)
|
||||||
|
.moveset(move)
|
||||||
|
.enemyMoveset(Moves.ENDURE);
|
||||||
|
await game.classicMode.startBattle([ Species.MAGIKARP, Species.FEEBAS ]);
|
||||||
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
enemy.damageAndUpdate(enemy.hp - 1);
|
||||||
|
|
||||||
|
game.move.select(move);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
|
expect(enemy.isFainted()).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user