mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-23 12:38:09 +00:00
[Unittest] remove held item rng (white herb) from intimidate.test.ts (#3151)
This commit is contained in:
parent
7fac3269e1
commit
f0335afbe0
@ -1,23 +1,18 @@
|
|||||||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import {
|
import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, SelectStarterPhase, TurnInitPhase } from "#app/phases";
|
||||||
CommandPhase, DamagePhase, EncounterPhase,
|
import { Mode } from "#app/ui/ui";
|
||||||
EnemyCommandPhase, SelectStarterPhase,
|
import { BattleStat } from "#app/data/battle-stat";
|
||||||
TurnInitPhase,
|
import { generateStarter, getMovePosition } from "#app/test/utils/gameManagerUtils";
|
||||||
} from "#app/phases";
|
import { Command } from "#app/ui/command-ui-handler";
|
||||||
import {Mode} from "#app/ui/ui";
|
import { Status, StatusEffect } from "#app/data/status-effect";
|
||||||
import {BattleStat} from "#app/data/battle-stat";
|
import { GameModes, getGameMode } from "#app/game-mode";
|
||||||
import {generateStarter, getMovePosition} from "#app/test/utils/gameManagerUtils";
|
|
||||||
import {Command} from "#app/ui/command-ui-handler";
|
|
||||||
import {Status, StatusEffect} from "#app/data/status-effect";
|
|
||||||
import {GameModes, getGameMode} from "#app/game-mode";
|
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
|
||||||
|
|
||||||
describe("Abilities - Intimidate", () => {
|
describe("Abilities - Intimidate", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
let game: GameManager;
|
let game: GameManager;
|
||||||
@ -40,18 +35,20 @@ describe("Abilities - Intimidate", () => {
|
|||||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE);
|
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE);
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("single - wild with switch", async() => {
|
it("single - wild with switch", async () => {
|
||||||
await game.runToSummon([
|
await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
game.onNextPrompt(
|
||||||
Species.POOCHYENA,
|
"CheckSwitchPhase",
|
||||||
]);
|
Mode.CONFIRM,
|
||||||
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
|
() => {
|
||||||
game.setMode(Mode.MESSAGE);
|
game.setMode(Mode.MESSAGE);
|
||||||
game.endPhase();
|
game.endPhase();
|
||||||
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
|
},
|
||||||
|
() => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase)
|
||||||
|
);
|
||||||
await game.phaseInterceptor.to(CommandPhase, false);
|
await game.phaseInterceptor.to(CommandPhase, false);
|
||||||
expect(game.scene.getParty()[0].species.speciesId).toBe(Species.MIGHTYENA);
|
expect(game.scene.getParty()[0].species.speciesId).toBe(Species.MIGHTYENA);
|
||||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
@ -70,16 +67,18 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("single - boss should only trigger once then switch", async() => {
|
it("single - boss should only trigger once then switch", async () => {
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10);
|
||||||
await game.runToSummon([
|
await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
game.onNextPrompt(
|
||||||
Species.POOCHYENA,
|
"CheckSwitchPhase",
|
||||||
]);
|
Mode.CONFIRM,
|
||||||
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
|
() => {
|
||||||
game.setMode(Mode.MESSAGE);
|
game.setMode(Mode.MESSAGE);
|
||||||
game.endPhase();
|
game.endPhase();
|
||||||
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
|
},
|
||||||
|
() => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase)
|
||||||
|
);
|
||||||
await game.phaseInterceptor.to(CommandPhase, false);
|
await game.phaseInterceptor.to(CommandPhase, false);
|
||||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
@ -97,16 +96,18 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("single - trainer should only trigger once with switch", async() => {
|
it("single - trainer should only trigger once with switch", async () => {
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
||||||
await game.runToSummon([
|
await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
game.onNextPrompt(
|
||||||
Species.POOCHYENA,
|
"CheckSwitchPhase",
|
||||||
]);
|
Mode.CONFIRM,
|
||||||
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
|
() => {
|
||||||
game.setMode(Mode.MESSAGE);
|
game.setMode(Mode.MESSAGE);
|
||||||
game.endPhase();
|
game.endPhase();
|
||||||
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
|
},
|
||||||
|
() => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase)
|
||||||
|
);
|
||||||
await game.phaseInterceptor.to(CommandPhase, false);
|
await game.phaseInterceptor.to(CommandPhase, false);
|
||||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
@ -124,17 +125,19 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
||||||
}, 200000);
|
}, 200000);
|
||||||
|
|
||||||
it("double - trainer should only trigger once per pokemon", async() => {
|
it("double - trainer should only trigger once per pokemon", async () => {
|
||||||
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
||||||
await game.runToSummon([
|
await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
game.onNextPrompt(
|
||||||
Species.POOCHYENA,
|
"CheckSwitchPhase",
|
||||||
]);
|
Mode.CONFIRM,
|
||||||
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
|
() => {
|
||||||
game.setMode(Mode.MESSAGE);
|
game.setMode(Mode.MESSAGE);
|
||||||
game.endPhase();
|
game.endPhase();
|
||||||
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
|
},
|
||||||
|
() => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase)
|
||||||
|
);
|
||||||
await game.phaseInterceptor.to(CommandPhase, false);
|
await game.phaseInterceptor.to(CommandPhase, false);
|
||||||
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
||||||
@ -148,17 +151,19 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("double - wild: should only trigger once per pokemon", async() => {
|
it("double - wild: should only trigger once per pokemon", async () => {
|
||||||
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
||||||
await game.runToSummon([
|
await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
game.onNextPrompt(
|
||||||
Species.POOCHYENA,
|
"CheckSwitchPhase",
|
||||||
]);
|
Mode.CONFIRM,
|
||||||
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
|
() => {
|
||||||
game.setMode(Mode.MESSAGE);
|
game.setMode(Mode.MESSAGE);
|
||||||
game.endPhase();
|
game.endPhase();
|
||||||
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
|
},
|
||||||
|
() => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase)
|
||||||
|
);
|
||||||
await game.phaseInterceptor.to(CommandPhase, false);
|
await game.phaseInterceptor.to(CommandPhase, false);
|
||||||
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
||||||
@ -172,17 +177,19 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("double - boss: should only trigger once per pokemon", async() => {
|
it("double - boss: should only trigger once per pokemon", async () => {
|
||||||
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10);
|
||||||
await game.runToSummon([
|
await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
game.onNextPrompt(
|
||||||
Species.POOCHYENA,
|
"CheckSwitchPhase",
|
||||||
]);
|
Mode.CONFIRM,
|
||||||
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
|
() => {
|
||||||
game.setMode(Mode.MESSAGE);
|
game.setMode(Mode.MESSAGE);
|
||||||
game.endPhase();
|
game.endPhase();
|
||||||
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
|
},
|
||||||
|
() => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase)
|
||||||
|
);
|
||||||
await game.phaseInterceptor.to(CommandPhase, false);
|
await game.phaseInterceptor.to(CommandPhase, false);
|
||||||
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
|
||||||
@ -196,13 +203,10 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("single - wild next wave opp triger once, us: none", async() => {
|
it("single - wild next wave opp triger once, us: none", async () => {
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(2);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(2);
|
||||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.AERIAL_ACE]);
|
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.AERIAL_ACE]);
|
||||||
await game.startBattle([
|
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
|
||||||
Species.POOCHYENA,
|
|
||||||
]);
|
|
||||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
||||||
@ -225,13 +229,10 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("single - wild next turn - no retrigger on next turn", async() => {
|
it("single - wild next turn - no retrigger on next turn", async () => {
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(2);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(2);
|
||||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||||
await game.startBattle([
|
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
|
||||||
Species.POOCHYENA,
|
|
||||||
]);
|
|
||||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
||||||
@ -252,14 +253,11 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("single - trainer should only trigger once and each time he switch", async() => {
|
it("single - trainer should only trigger once and each time he switch", async () => {
|
||||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.VOLT_SWITCH,Moves.VOLT_SWITCH,Moves.VOLT_SWITCH,Moves.VOLT_SWITCH]);
|
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH]);
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
||||||
await game.startBattle([
|
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
|
||||||
Species.POOCHYENA,
|
|
||||||
]);
|
|
||||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
||||||
@ -279,7 +277,6 @@ describe("Abilities - Intimidate", () => {
|
|||||||
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
|
||||||
|
|
||||||
|
|
||||||
game.onNextPrompt("CommandPhase", Mode.COMMAND, () => {
|
game.onNextPrompt("CommandPhase", Mode.COMMAND, () => {
|
||||||
game.scene.ui.setMode(Mode.FIGHT, (game.scene.getCurrentPhase() as CommandPhase).getFieldIndex());
|
game.scene.ui.setMode(Mode.FIGHT, (game.scene.getCurrentPhase() as CommandPhase).getFieldIndex());
|
||||||
});
|
});
|
||||||
@ -295,14 +292,11 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
|
||||||
}, 200000);
|
}, 200000);
|
||||||
|
|
||||||
it("single - trainer should only trigger once whatever turn we are", async() => {
|
it("single - trainer should only trigger once whatever turn we are", async () => {
|
||||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]);
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
|
||||||
await game.startBattle([
|
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
|
||||||
Species.POOCHYENA,
|
|
||||||
]);
|
|
||||||
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
||||||
@ -322,7 +316,6 @@ describe("Abilities - Intimidate", () => {
|
|||||||
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
|
|
||||||
|
|
||||||
game.onNextPrompt("CommandPhase", Mode.COMMAND, () => {
|
game.onNextPrompt("CommandPhase", Mode.COMMAND, () => {
|
||||||
game.scene.ui.setMode(Mode.FIGHT, (game.scene.getCurrentPhase() as CommandPhase).getFieldIndex());
|
game.scene.ui.setMode(Mode.FIGHT, (game.scene.getCurrentPhase() as CommandPhase).getFieldIndex());
|
||||||
});
|
});
|
||||||
@ -338,12 +331,14 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("double - wild vs only 1 on player side", async() => {
|
it("double - wild vs only 1 on player side", async () => {
|
||||||
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
||||||
await game.runToSummon([
|
vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "COIN_CASE" }]);
|
||||||
Species.MIGHTYENA,
|
await game.runToSummon([Species.MIGHTYENA]);
|
||||||
]);
|
// Get rid of any modifiers that may alter power
|
||||||
|
game.scene.clearEnemyHeldItemModifiers();
|
||||||
|
game.scene.clearEnemyModifiers();
|
||||||
await game.phaseInterceptor.to(CommandPhase, false);
|
await game.phaseInterceptor.to(CommandPhase, false);
|
||||||
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
||||||
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
|
||||||
@ -354,17 +349,14 @@ describe("Abilities - Intimidate", () => {
|
|||||||
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2);
|
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("double - wild vs only 1 alive on player side", async() => {
|
it("double - wild vs only 1 alive on player side", async () => {
|
||||||
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double");
|
||||||
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
|
||||||
await game.runToTitle();
|
await game.runToTitle();
|
||||||
|
|
||||||
game.onNextPrompt("TitlePhase", Mode.TITLE, () => {
|
game.onNextPrompt("TitlePhase", Mode.TITLE, () => {
|
||||||
game.scene.gameMode = getGameMode(GameModes.CLASSIC);
|
game.scene.gameMode = getGameMode(GameModes.CLASSIC);
|
||||||
const starters = generateStarter(game.scene, [
|
const starters = generateStarter(game.scene, [Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
Species.MIGHTYENA,
|
|
||||||
Species.POOCHYENA,
|
|
||||||
]);
|
|
||||||
const selectStarterPhase = new SelectStarterPhase(game.scene);
|
const selectStarterPhase = new SelectStarterPhase(game.scene);
|
||||||
game.scene.pushPhase(new EncounterPhase(game.scene, false));
|
game.scene.pushPhase(new EncounterPhase(game.scene, false));
|
||||||
selectStarterPhase.initBattle(starters);
|
selectStarterPhase.initBattle(starters);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user