apply game.override.enemyHeldItems

This commit is contained in:
Felix Staud 2024-07-25 16:50:33 -07:00
parent 8e09714904
commit 133af2fc32
1 changed files with 25 additions and 22 deletions

View File

@ -1,15 +1,14 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phase from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Moves } from "#app/enums/moves.js";
import { Species } from "#app/enums/species.js";
import { BerryType } from "#app/enums/berry-type.js";
import { Abilities } from "#app/enums/abilities.js";
import { getMovePosition } from "../utils/gameManagerUtils";
import { CommandPhase, MoveEndPhase, SelectTargetPhase } from "#app/phases.js";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle.js";
import { allMoves } from "#app/data/move.js"; import { allMoves } from "#app/data/move.js";
import { Abilities } from "#app/enums/abilities.js";
import { BerryType } from "#app/enums/berry-type.js";
import { Moves } from "#app/enums/moves.js";
import { Species } from "#app/enums/species.js";
import { CommandPhase, MoveEndPhase, SelectTargetPhase } from "#app/phases.js";
import GameManager from "#app/test/utils/gameManager";
import Phase from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { getMovePosition } from "../utils/gameManagerUtils";
const TIMEOUT = 20 * 1000; // 20 seconds const TIMEOUT = 20 * 1000; // 20 seconds
@ -30,18 +29,22 @@ describe("Items - Grip Claw", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("double"); game.override
game.override.moveset([ Moves.POPULATION_BOMB, Moves.SPLASH ]); .battleType("double")
game.override.startingHeldItems([{name: "GRIP_CLAW", count: 5}, {name: "MULTI_LENS", count: 3}]); .moveset([Moves.POPULATION_BOMB, Moves.SPLASH])
game.override.enemySpecies(Species.SNORLAX); .startingHeldItems([
game.override.ability(Abilities.KLUTZ); { name: "GRIP_CLAW", count: 5 },
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); { name: "MULTI_LENS", count: 3 },
vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([ ])
{name: "BERRY", type: BerryType.SITRUS, count: 2}, .enemySpecies(Species.SNORLAX)
{name: "BERRY", type: BerryType.LUM, count: 2} .ability(Abilities.KLUTZ)
]); .enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH])
game.override.startingLevel(100); .enemyHeldItems([
game.override.enemyLevel(100); { name: "BERRY", type: BerryType.SITRUS, count: 2 },
{ name: "BERRY", type: BerryType.LUM, count: 2 },
])
.startingLevel(100)
.enemyLevel(100);
vi.spyOn(allMoves[Moves.POPULATION_BOMB], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[Moves.POPULATION_BOMB], "accuracy", "get").mockReturnValue(100);
}); });