mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-21 15:52:18 +02:00
Adds destiny bond unit test
This commit is contained in:
parent
c1516da1f9
commit
ec7f73c78a
@ -1,3 +1,4 @@
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { allMoves } from "#app/data/move";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||
import type { PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
@ -105,9 +106,6 @@ describe("Items - Reviver Seed", () => {
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
enemy.damageAndUpdate(enemy.hp - 1);
|
||||
|
||||
const enemySeed = enemy.getHeldItems()[0] as PokemonInstantReviveModifier;
|
||||
vi.spyOn(enemySeed, "apply");
|
||||
|
||||
game.move.select(move);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
@ -141,4 +139,24 @@ describe("Items - Reviver Seed", () => {
|
||||
expect(playerSeed.apply).toHaveReturnedWith(false); // Reviver Seed triggers
|
||||
expect(player.isFainted()).toBeTruthy();
|
||||
});
|
||||
|
||||
it("should not activate the holder's reviver seed from Destiny Bond fainting", async () => {
|
||||
game.override
|
||||
.enemyLevel(100)
|
||||
.startingLevel(1)
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.moveset(Moves.DESTINY_BOND)
|
||||
.startingHeldItems([]) // reset held items to nothing so user doesn't revive and not trigger Destiny Bond
|
||||
.enemyMoveset(Moves.TACKLE);
|
||||
await game.classicMode.startBattle([ Species.MAGIKARP, Species.FEEBAS ]);
|
||||
const player = game.scene.getPlayerPokemon()!;
|
||||
player.damageAndUpdate(player.hp - 1);
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
||||
game.move.select(Moves.DESTINY_BOND);
|
||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(enemy.isFainted()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user