mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 21:32:18 +02:00
Add unit tests for mon with Damp using explosive move
This commit is contained in:
parent
2a4a056426
commit
64aa989aaa
@ -30,7 +30,7 @@ describe("Abilities - Damp", () => {
|
|||||||
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("prevents self-destruction effect on explosive attacks", async() => {
|
it("prevents explosive attacks used by others", async() => {
|
||||||
const moveToUse = Moves.EXPLOSION;
|
const moveToUse = Moves.EXPLOSION;
|
||||||
const enemyAbility = Abilities.DAMP;
|
const enemyAbility = Abilities.DAMP;
|
||||||
|
|
||||||
@ -50,6 +50,26 @@ describe("Abilities - Damp", () => {
|
|||||||
expect(game.phaseInterceptor.log).not.toContain("FaintPhase");
|
expect(game.phaseInterceptor.log).not.toContain("FaintPhase");
|
||||||
}, TIMEOUT);
|
}, TIMEOUT);
|
||||||
|
|
||||||
|
it("prevents explosive attacks used by the battler with Damp", async() => {
|
||||||
|
const moveToUse = Moves.EXPLOSION;
|
||||||
|
const playerAbility = Abilities.DAMP;
|
||||||
|
|
||||||
|
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(playerAbility);
|
||||||
|
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||||
|
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||||
|
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.BIDOOF);
|
||||||
|
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||||
|
|
||||||
|
await game.startBattle();
|
||||||
|
|
||||||
|
game.doAttack(getMovePosition(game.scene, 0, moveToUse));
|
||||||
|
|
||||||
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
|
||||||
|
expect(game.phaseInterceptor.log).toContain("ShowAbilityPhase");
|
||||||
|
expect(game.phaseInterceptor.log).not.toContain("FaintPhase");
|
||||||
|
}, TIMEOUT);
|
||||||
|
|
||||||
// Invalid if aftermath.test.ts has a failure.
|
// Invalid if aftermath.test.ts has a failure.
|
||||||
it("silently prevents Aftermath from triggering", async() => {
|
it("silently prevents Aftermath from triggering", async() => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
@ -75,6 +95,7 @@ describe("Abilities - Damp", () => {
|
|||||||
expect(game.scene.getParty()[0].getHpRatio()).toBe(1);
|
expect(game.scene.getParty()[0].getHpRatio()).toBe(1);
|
||||||
}, TIMEOUT);
|
}, TIMEOUT);
|
||||||
|
|
||||||
|
|
||||||
// Ensures fix of #1476.
|
// Ensures fix of #1476.
|
||||||
it("does not show ability popup during AI calculations", async() => {
|
it("does not show ability popup during AI calculations", async() => {
|
||||||
const moveToUse = Moves.SPLASH;
|
const moveToUse = Moves.SPLASH;
|
||||||
|
Loading…
Reference in New Issue
Block a user