apply game.override.moveset

This commit is contained in:
Felix Staud 2024-07-25 15:51:05 -07:00
parent bb1e3f7d20
commit 3242a084f1
82 changed files with 333 additions and 359 deletions

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { CommandPhase, MessagePhase, TurnInitPhase } from "#app/phases"; import { CommandPhase, MessagePhase, TurnInitPhase } from "#app/phases";
import i18next, { initI18n } from "#app/plugins/i18n";
import GameManager from "#app/test/utils/gameManager";
import { Mode } from "#app/ui/ui"; import { Mode } from "#app/ui/ui";
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";
import i18next, { initI18n } from "#app/plugins/i18n"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
@ -34,7 +33,7 @@ describe("Ability Timing", () => {
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.ICE_BEAM]); game.override.moveset([Moves.SPLASH, Moves.ICE_BEAM]);
}); });
it("should trigger after switch check", async() => { it("should trigger after switch check", async() => {

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { allMoves } from "#app/data/move.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { MoveEffectPhase } from "#app/phases"; import { MoveEffectPhase } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { allMoves } from "#app/data/move.js"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Aura Break", () => { describe("Abilities - Aura Break", () => {
@ -29,7 +28,7 @@ describe("Abilities - Aura Break", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]); game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
game.override.enemyAbility(Abilities.AURA_BREAK); game.override.enemyAbility(Abilities.AURA_BREAK);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { allMoves } from "#app/data/move.js"; import { allMoves } from "#app/data/move.js";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Battery", () => { describe("Abilities - Battery", () => {
@ -31,7 +30,7 @@ describe("Abilities - Battery", () => {
game.override.battleType("double"); game.override.battleType("double");
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
}); });

View File

@ -30,7 +30,7 @@ describe("Abilities - BATTLE BOND", () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.BATTLE_BOND); game.override.ability(Abilities.BATTLE_BOND);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import Phaser from "phaser";
import Overrides from "#app/overrides";
import { BattleStat } from "#app/data/battle-stat.js"; import { BattleStat } from "#app/data/battle-stat.js";
import { CommandPhase, MessagePhase } from "#app/phases.js";
import { getMovePosition } from "../utils/gameManagerUtils";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import { Moves } from "#app/enums/moves.js"; import { Moves } from "#app/enums/moves.js";
import { Species } from "#app/enums/species.js"; import { Species } from "#app/enums/species.js";
import { CommandPhase, MessagePhase } from "#app/phases.js";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
import GameManager from "../utils/gameManager";
import { getMovePosition } from "../utils/gameManagerUtils";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
const TIMEOUT = 20 * 1000; const TIMEOUT = 20 * 1000;
@ -30,7 +29,7 @@ describe("Abilities - COSTAR", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("double"); game.override.battleType("double");
game.override.ability(Abilities.COSTAR); game.override.ability(Abilities.COSTAR);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NASTY_PLOT]); game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
}); });

View File

@ -30,7 +30,7 @@ describe("Abilities - DISGUISE", () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.DISGUISE); game.override.ability(Abilities.DISGUISE);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });

View File

@ -35,7 +35,7 @@ describe("Abilities - Dry Skin", () => {
}); });
it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => { it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SUNNY_DAY, Moves.SPLASH]); game.override.moveset([Moves.SUNNY_DAY, Moves.SPLASH]);
await game.startBattle(); await game.startBattle();
@ -56,7 +56,7 @@ describe("Abilities - Dry Skin", () => {
}); });
it("during rain, gain 1/8 of maximum health at the end of each turn", async () => { it("during rain, gain 1/8 of maximum health at the end of each turn", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.RAIN_DANCE, Moves.SPLASH]); game.override.moveset([Moves.RAIN_DANCE, Moves.SPLASH]);
await game.startBattle(); await game.startBattle();
@ -79,7 +79,7 @@ describe("Abilities - Dry Skin", () => {
}); });
it("opposing fire attacks do 25% more damage", async () => { it("opposing fire attacks do 25% more damage", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLAMETHROWER]); game.override.moveset([Moves.FLAMETHROWER]);
await game.startBattle(); await game.startBattle();
@ -106,7 +106,7 @@ describe("Abilities - Dry Skin", () => {
}); });
it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => { it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]); game.override.moveset([Moves.WATER_GUN]);
await game.startBattle(); await game.startBattle();
@ -121,7 +121,7 @@ describe("Abilities - Dry Skin", () => {
}); });
it("opposing water attacks do not heal if they were protected from", async () => { it("opposing water attacks do not heal if they were protected from", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]); game.override.moveset([Moves.WATER_GUN]);
await game.startBattle(); await game.startBattle();
@ -137,7 +137,7 @@ describe("Abilities - Dry Skin", () => {
}); });
it("multi-strike water attacks only heal once", async () => { it("multi-strike water attacks only heal once", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN, Moves.WATER_SHURIKEN]); game.override.moveset([Moves.WATER_GUN, Moves.WATER_SHURIKEN]);
await game.startBattle(); await game.startBattle();

View File

@ -28,7 +28,7 @@ describe("Abilities - Hustle", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HUSTLE); vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HUSTLE);
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]); game.override.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]);
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5); vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5);
vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5); vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);

View File

@ -36,7 +36,7 @@ describe("Abilities - Ice Face", () => {
game.override.battleType("single"); game.override.battleType("single");
game.override.enemySpecies(Species.EISCUE); game.override.enemySpecies(Species.EISCUE);
game.override.enemyAbility(Abilities.ICE_FACE); game.override.enemyAbility(Abilities.ICE_FACE);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]); game.override.moveset([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]);
}); });
it("takes no damage from physical move and transforms to Noice", async () => { it("takes no damage from physical move and transforms to Noice", async () => {
@ -54,7 +54,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("takes no damage from the first hit of multihit physical move and transforms to Noice", async () => { it("takes no damage from the first hit of multihit physical move and transforms to Noice", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SURGING_STRIKES]); game.override.moveset([Moves.SURGING_STRIKES]);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1);
await game.startBattle([Species.HITMONLEE]); await game.startBattle([Species.HITMONLEE]);
@ -109,7 +109,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("transforms to Ice Face when Hail or Snow starts", async () => { it("transforms to Ice Face when Hail or Snow starts", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.QUICK_ATTACK]); game.override.moveset([Moves.QUICK_ATTACK]);
game.override.enemyMoveset([Moves.HAIL, Moves.HAIL, Moves.HAIL, Moves.HAIL]); game.override.enemyMoveset([Moves.HAIL, Moves.HAIL, Moves.HAIL, Moves.HAIL]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -132,7 +132,7 @@ describe("Abilities - Ice Face", () => {
it("transforms to Ice Face when summoned on arena with active Snow or Hail", async () => { it("transforms to Ice Face when summoned on arena with active Snow or Hail", async () => {
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SNOWSCAPE]); game.override.moveset([Moves.SNOWSCAPE]);
await game.startBattle([Species.EISCUE, Species.NINJASK]); await game.startBattle([Species.EISCUE, Species.NINJASK]);
@ -227,7 +227,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("cannot be suppressed", async () => { it("cannot be suppressed", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GASTRO_ACID]); game.override.moveset([Moves.GASTRO_ACID]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -243,7 +243,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("cannot be swapped with another ability", async () => { it("cannot be swapped with another ability", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SKILL_SWAP]); game.override.moveset([Moves.SKILL_SWAP]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);

View File

@ -205,7 +205,7 @@ describe("Abilities - Intimidate", () => {
it("single - wild next wave opp triger once, us: none", async () => { it("single - wild next wave opp triger once, us: none", async () => {
game.override.startingWave(2); game.override.startingWave(2);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.AERIAL_ACE]); game.override.moveset([Moves.AERIAL_ACE]);
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); await game.startBattle([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);
@ -231,7 +231,7 @@ describe("Abilities - Intimidate", () => {
it("single - wild next turn - no retrigger on next turn", async () => { it("single - wild next turn - no retrigger on next turn", async () => {
game.override.startingWave(2); game.override.startingWave(2);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); await game.startBattle([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);
@ -254,7 +254,7 @@ describe("Abilities - Intimidate", () => {
}, 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]); game.override.moveset([Moves.SPLASH]);
game.override.enemyMoveset([Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH]); game.override.enemyMoveset([Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH]);
game.override.startingWave(5); game.override.startingWave(5);
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
@ -293,7 +293,7 @@ describe("Abilities - Intimidate", () => {
}, 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]); game.override.moveset([Moves.SPLASH]);
game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
game.override.startingWave(5); game.override.startingWave(5);
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);

View File

@ -43,7 +43,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies and changes a pokemon's type", "ability applies and changes a pokemon's type",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -61,7 +61,7 @@ describe("Abilities - Protean", () => {
test.skip( test.skip(
"ability applies only once per switch in", "ability applies only once per switch in",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.AGILITY]); game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]); await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
@ -101,7 +101,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move has a variable type", "ability applies correctly even if the pokemon's move has a variable type",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WEATHER_BALL]); game.override.moveset([Moves.WEATHER_BALL]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -124,7 +124,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the type has changed by another ability", "ability applies correctly even if the type has changed by another ability",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.REFRIGERATE); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.REFRIGERATE);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -147,7 +147,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move calls another move", "ability applies correctly even if the pokemon's move calls another move",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.NATURE_POWER]); game.override.moveset([Moves.NATURE_POWER]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -166,7 +166,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move is delayed / charging", "ability applies correctly even if the pokemon's move is delayed / charging",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DIG]); game.override.moveset([Moves.DIG]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -184,7 +184,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move misses", "ability applies correctly even if the pokemon's move misses",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -207,7 +207,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move is protected against", "ability applies correctly even if the pokemon's move is protected against",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]); game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -226,7 +226,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move fails because of type immunity", "ability applies correctly even if the pokemon's move fails because of type immunity",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemySpecies(Species.GASTLY); game.override.enemySpecies(Species.GASTLY);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -245,7 +245,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if pokemon's type is the same as the move's type", "ability is not applied if pokemon's type is the same as the move's type",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -264,7 +264,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if pokemon is terastallized", "ability is not applied if pokemon is terastallized",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -284,7 +284,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if pokemon uses struggle", "ability is not applied if pokemon uses struggle",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]); game.override.moveset([Moves.STRUGGLE]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -302,7 +302,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if the pokemon's move fails", "ability is not applied if the pokemon's move fails",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]); game.override.moveset([Moves.BURN_UP]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -320,7 +320,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's Trick-or-Treat fails", "ability applies correctly even if the pokemon's Trick-or-Treat fails",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TRICK_OR_TREAT]); game.override.moveset([Moves.TRICK_OR_TREAT]);
game.override.enemySpecies(Species.GASTLY); game.override.enemySpecies(Species.GASTLY);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -339,7 +339,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly and the pokemon curses itself", "ability applies correctly and the pokemon curses itself",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]); game.override.moveset([Moves.CURSE]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);

View File

@ -1,20 +1,19 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { BattleStat } from "#app/data/battle-stat";
import Phaser from "phaser"; import { Stat } from "#app/data/pokemon-stat";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { import {
CommandPhase, CommandPhase,
EnemyCommandPhase, EnemyCommandPhase,
VictoryPhase VictoryPhase
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import GameManager from "#app/test/utils/gameManager";
import {Stat} from "#app/data/pokemon-stat";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import {BattleStat} from "#app/data/battle-stat"; import { Mode } from "#app/ui/ui";
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";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Moxie", () => { describe("Abilities - Moxie", () => {
@ -39,7 +38,7 @@ describe("Abilities - Moxie", () => {
game.override.enemyAbility(Abilities.MOXIE); game.override.enemyAbility(Abilities.MOXIE);
game.override.ability(Abilities.MOXIE); game.override.ability(Abilities.MOXIE);
game.override.startingLevel(2000); game.override.startingLevel(2000);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -44,7 +44,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should add second strike to attack move", "ability should add second strike to attack move",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -76,7 +76,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should apply secondary effects to both strikes", "ability should apply secondary effects to both strikes",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.POWER_UP_PUNCH]); game.override.moveset([Moves.POWER_UP_PUNCH]);
game.override.enemySpecies(Species.AMOONGUSS); game.override.enemySpecies(Species.AMOONGUSS);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -99,7 +99,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not apply to Status moves", "ability should not apply to Status moves",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BABY_DOLL_EYES]); game.override.moveset([Moves.BABY_DOLL_EYES]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -119,7 +119,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not apply to multi-hit moves", "ability should not apply to multi-hit moves",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DOUBLE_HIT]); game.override.moveset([Moves.DOUBLE_HIT]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -144,7 +144,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not apply to self-sacrifice moves", "ability should not apply to self-sacrifice moves",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SELF_DESTRUCT]); game.override.moveset([Moves.SELF_DESTRUCT]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -165,7 +165,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not apply to Rollout", "ability should not apply to Rollout",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ROLLOUT]); game.override.moveset([Moves.ROLLOUT]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -189,7 +189,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not apply multiplier to fixed-damage moves", "ability should not apply multiplier to fixed-damage moves",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_RAGE]); game.override.moveset([Moves.DRAGON_RAGE]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -211,7 +211,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not apply multiplier to counter moves", "ability should not apply multiplier to counter moves",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.COUNTER]); game.override.moveset([Moves.COUNTER]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -240,7 +240,7 @@ describe("Abilities - Parental Bond", () => {
"ability should not apply to multi-target moves", "ability should not apply to multi-target moves",
async () => { async () => {
game.override.battleType("double"); game.override.battleType("double");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE]); game.override.moveset([Moves.EARTHQUAKE]);
await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]); await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]);
@ -265,7 +265,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should apply to multi-target moves when hitting only one target", "ability should apply to multi-target moves when hitting only one target",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE]); game.override.moveset([Moves.EARTHQUAKE]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -285,7 +285,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should only trigger post-target move effects once", "ability should only trigger post-target move effects once",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MIND_BLOWN]); game.override.moveset([Moves.MIND_BLOWN]);
await game.startBattle([Species.PIDGEOT]); await game.startBattle([Species.PIDGEOT]);
@ -311,7 +311,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Burn Up only removes type after second strike with this ability", "Burn Up only removes type after second strike with this ability",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]); game.override.moveset([Moves.BURN_UP]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -338,7 +338,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Moves boosted by this ability and Multi-Lens should strike 4 times", "Moves boosted by this ability and Multi-Lens should strike 4 times",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -360,7 +360,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Super Fang boosted by this ability and Multi-Lens should strike twice", "Super Fang boosted by this ability and Multi-Lens should strike twice",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SUPER_FANG]); game.override.moveset([Moves.SUPER_FANG]);
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -391,7 +391,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Seismic Toss boosted by this ability and Multi-Lens should strike twice", "Seismic Toss boosted by this ability and Multi-Lens should strike twice",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SEISMIC_TOSS]); game.override.moveset([Moves.SEISMIC_TOSS]);
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -422,7 +422,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Hyper Beam boosted by this ability should strike twice, then recharge", "Hyper Beam boosted by this ability should strike twice, then recharge",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HYPER_BEAM]); game.override.moveset([Moves.HYPER_BEAM]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -452,7 +452,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Anchor Shot boosted by this ability should only trap the target after the second hit", "Anchor Shot boosted by this ability should only trap the target after the second hit",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ANCHOR_SHOT]); game.override.moveset([Moves.ANCHOR_SHOT]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -484,7 +484,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Smack Down boosted by this ability should only ground the target after the second hit", "Smack Down boosted by this ability should only ground the target after the second hit",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SMACK_DOWN]); game.override.moveset([Moves.SMACK_DOWN]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -513,7 +513,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"U-turn boosted by this ability should strike twice before forcing a switch", "U-turn boosted by this ability should strike twice before forcing a switch",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.U_TURN]); game.override.moveset([Moves.U_TURN]);
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
@ -539,7 +539,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"Wake-Up Slap boosted by this ability should only wake up the target after the second hit", "Wake-Up Slap boosted by this ability should only wake up the target after the second hit",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WAKE_UP_SLAP]); game.override.moveset([Moves.WAKE_UP_SLAP]);
vi.spyOn(Overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.SLEEP); vi.spyOn(Overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(StatusEffect.SLEEP);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -569,7 +569,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not cause user to hit into King's Shield more than once", "ability should not cause user to hit into King's Shield more than once",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyMoveset([Moves.KINGS_SHIELD,Moves.KINGS_SHIELD,Moves.KINGS_SHIELD,Moves.KINGS_SHIELD]); game.override.enemyMoveset([Moves.KINGS_SHIELD,Moves.KINGS_SHIELD,Moves.KINGS_SHIELD,Moves.KINGS_SHIELD]);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -591,7 +591,7 @@ describe("Abilities - Parental Bond", () => {
test( test(
"ability should not cause user to hit into Storm Drain more than once", "ability should not cause user to hit into Storm Drain more than once",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]); game.override.moveset([Moves.WATER_GUN]);
game.override.enemyAbility(Abilities.STORM_DRAIN); game.override.enemyAbility(Abilities.STORM_DRAIN);
await game.startBattle([Species.CHARIZARD]); await game.startBattle([Species.CHARIZARD]);
@ -614,7 +614,7 @@ describe("Abilities - Parental Bond", () => {
"ability should not apply to multi-target moves with Multi-Lens", "ability should not apply to multi-target moves with Multi-Lens",
async () => { async () => {
game.override.battleType("double"); game.override.battleType("double");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE, Moves.SPLASH]); game.override.moveset([Moves.EARTHQUAKE, Moves.SPLASH]);
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS", count: 1}]);
await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]); await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]);

View File

@ -30,7 +30,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.POWER_CONSTRUCT); game.override.ability(Abilities.POWER_CONSTRUCT);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { allMoves } from "#app/data/move.js"; import { allMoves } from "#app/data/move.js";
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js";
import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Power Spot", () => { describe("Abilities - Power Spot", () => {
@ -29,7 +28,7 @@ describe("Abilities - Power Spot", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("double"); game.override.battleType("double");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);

View File

@ -43,7 +43,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies and changes a pokemon's type", "ability applies and changes a pokemon's type",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -61,7 +61,7 @@ describe("Abilities - Protean", () => {
test.skip( test.skip(
"ability applies only once per switch in", "ability applies only once per switch in",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.AGILITY]); game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]); await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
@ -101,7 +101,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move has a variable type", "ability applies correctly even if the pokemon's move has a variable type",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WEATHER_BALL]); game.override.moveset([Moves.WEATHER_BALL]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -124,7 +124,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the type has changed by another ability", "ability applies correctly even if the type has changed by another ability",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.REFRIGERATE); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.REFRIGERATE);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -147,7 +147,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move calls another move", "ability applies correctly even if the pokemon's move calls another move",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.NATURE_POWER]); game.override.moveset([Moves.NATURE_POWER]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -166,7 +166,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move is delayed / charging", "ability applies correctly even if the pokemon's move is delayed / charging",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DIG]); game.override.moveset([Moves.DIG]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -184,7 +184,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move misses", "ability applies correctly even if the pokemon's move misses",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -207,7 +207,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move is protected against", "ability applies correctly even if the pokemon's move is protected against",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]); game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -226,7 +226,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's move fails because of type immunity", "ability applies correctly even if the pokemon's move fails because of type immunity",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemySpecies(Species.GASTLY); game.override.enemySpecies(Species.GASTLY);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -245,7 +245,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if pokemon's type is the same as the move's type", "ability is not applied if pokemon's type is the same as the move's type",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -264,7 +264,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if pokemon is terastallized", "ability is not applied if pokemon is terastallized",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -284,7 +284,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if pokemon uses struggle", "ability is not applied if pokemon uses struggle",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]); game.override.moveset([Moves.STRUGGLE]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -302,7 +302,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability is not applied if the pokemon's move fails", "ability is not applied if the pokemon's move fails",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]); game.override.moveset([Moves.BURN_UP]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -320,7 +320,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly even if the pokemon's Trick-or-Treat fails", "ability applies correctly even if the pokemon's Trick-or-Treat fails",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TRICK_OR_TREAT]); game.override.moveset([Moves.TRICK_OR_TREAT]);
game.override.enemySpecies(Species.GASTLY); game.override.enemySpecies(Species.GASTLY);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -339,7 +339,7 @@ describe("Abilities - Protean", () => {
test( test(
"ability applies correctly and the pokemon curses itself", "ability applies correctly and the pokemon curses itself",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]); game.override.moveset([Moves.CURSE]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);

View File

@ -29,7 +29,7 @@ describe("Abilities - Quick Draw", () => {
game.override.starterSpecies(Species.MAGIKARP); game.override.starterSpecies(Species.MAGIKARP);
game.override.ability(Abilities.QUICK_DRAW); game.override.ability(Abilities.QUICK_DRAW);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TAIL_WHIP]); game.override.moveset([Moves.TACKLE, Moves.TAIL_WHIP]);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);

View File

@ -29,7 +29,7 @@ describe("Abilities - Sand Veil", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
game.override.enemySpecies(Species.MEOWSCARADA); game.override.enemySpecies(Species.MEOWSCARADA);
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);
game.override.enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]); game.override.enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]);

View File

@ -38,7 +38,7 @@ describe("Abilities - Sap Sipper", () => {
const moveToUse = Moves.LEAFAGE; const moveToUse = Moves.LEAFAGE;
const enemyAbility = Abilities.SAP_SIPPER; const enemyAbility = Abilities.SAP_SIPPER;
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
game.override.enemySpecies(Species.DUSKULL); game.override.enemySpecies(Species.DUSKULL);
game.override.enemyAbility(enemyAbility); game.override.enemyAbility(enemyAbility);
@ -59,7 +59,7 @@ describe("Abilities - Sap Sipper", () => {
const moveToUse = Moves.SPORE; const moveToUse = Moves.SPORE;
const enemyAbility = Abilities.SAP_SIPPER; const enemyAbility = Abilities.SAP_SIPPER;
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.enemyAbility(enemyAbility); game.override.enemyAbility(enemyAbility);
@ -78,7 +78,7 @@ describe("Abilities - Sap Sipper", () => {
const moveToUse = Moves.GRASSY_TERRAIN; const moveToUse = Moves.GRASSY_TERRAIN;
const enemyAbility = Abilities.SAP_SIPPER; const enemyAbility = Abilities.SAP_SIPPER;
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.enemyAbility(enemyAbility); game.override.enemyAbility(enemyAbility);
@ -98,7 +98,7 @@ describe("Abilities - Sap Sipper", () => {
const moveToUse = Moves.BULLET_SEED; const moveToUse = Moves.BULLET_SEED;
const enemyAbility = Abilities.SAP_SIPPER; const enemyAbility = Abilities.SAP_SIPPER;
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.enemyAbility(enemyAbility); game.override.enemyAbility(enemyAbility);
@ -119,7 +119,7 @@ describe("Abilities - Sap Sipper", () => {
const moveToUse = Moves.SPIKY_SHIELD; const moveToUse = Moves.SPIKY_SHIELD;
const ability = Abilities.SAP_SIPPER; const ability = Abilities.SAP_SIPPER;
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.ability(ability); game.override.ability(ability);
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
@ -145,7 +145,7 @@ describe("Abilities - Sap Sipper", () => {
const moveToUse = Moves.METRONOME; const moveToUse = Moves.METRONOME;
const enemyAbility = Abilities.SAP_SIPPER; const enemyAbility = Abilities.SAP_SIPPER;
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.enemyAbility(enemyAbility); game.override.enemyAbility(enemyAbility);

View File

@ -30,7 +30,7 @@ describe("Abilities - SCHOOLING", () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.SCHOOLING); game.override.ability(Abilities.SCHOOLING);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });

View File

@ -1,13 +1,12 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { ArenaTagType } from "#app/enums/arena-tag-type.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { PostSummonPhase, TurnEndPhase, } from "#app/phases"; import { PostSummonPhase, TurnEndPhase, } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Screen Cleaner", () => { describe("Abilities - Screen Cleaner", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -31,7 +30,7 @@ describe("Abilities - Screen Cleaner", () => {
}); });
it("removes Aurora Veil", async () => { it("removes Aurora Veil", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HAIL]); game.override.moveset([Moves.HAIL]);
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]); game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]);

View File

@ -1,20 +1,19 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import {Abilities} from "#enums/abilities";
import { applyAbAttrs, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; import { applyAbAttrs, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability";
import {Species} from "#enums/species"; import { Stat } from "#app/data/pokemon-stat";
import { import {
CommandPhase, CommandPhase,
MoveEffectPhase, MoveEffectPhase,
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import GameManager from "#app/test/utils/gameManager";
import {Stat} from "#app/data/pokemon-stat";
import {Moves} from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import { Mode } from "#app/ui/ui";
import * as Utils from "#app/utils"; import * as Utils from "#app/utils";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Serene Grace", () => { describe("Abilities - Serene Grace", () => {
@ -37,7 +36,7 @@ describe("Abilities - Serene Grace", () => {
game.override.battleType("single"); game.override.battleType("single");
game.override.enemySpecies(Species.ONIX); game.override.enemySpecies(Species.ONIX);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(movesToUse); game.override.moveset(movesToUse);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -37,7 +37,7 @@ describe("Abilities - Sheer Force", () => {
game.override.battleType("single"); game.override.battleType("single");
game.override.enemySpecies(Species.ONIX); game.override.enemySpecies(Species.ONIX);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(movesToUse); game.override.moveset(movesToUse);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -1,20 +1,19 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Abilities } from "#enums/abilities";
import { applyAbAttrs, applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; import { applyAbAttrs, applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability";
import {Species} from "#enums/species"; import { Stat } from "#app/data/pokemon-stat";
import { import {
CommandPhase, CommandPhase,
MoveEffectPhase, MoveEffectPhase,
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import GameManager from "#app/test/utils/gameManager";
import {Stat} from "#app/data/pokemon-stat";
import {Moves} from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import { Mode } from "#app/ui/ui";
import * as Utils from "#app/utils"; import * as Utils from "#app/utils";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Shield Dust", () => { describe("Abilities - Shield Dust", () => {
@ -38,7 +37,7 @@ describe("Abilities - Shield Dust", () => {
game.override.enemySpecies(Species.ONIX); game.override.enemySpecies(Species.ONIX);
game.override.enemyAbility(Abilities.SHIELD_DUST); game.override.enemyAbility(Abilities.SHIELD_DUST);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(movesToUse); game.override.moveset(movesToUse);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -30,7 +30,7 @@ describe("Abilities - SHIELDS DOWN", () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.SHIELDS_DOWN); game.override.ability(Abilities.SHIELDS_DOWN);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });

View File

@ -1,14 +1,13 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { allMoves } from "#app/data/move.js";
import { allAbilities } from "#app/data/ability.js"; import { allAbilities } from "#app/data/ability.js";
import { allMoves } from "#app/data/move.js";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import { MoveEffectPhase, SelectTargetPhase } from "#app/phases.js"; import { MoveEffectPhase, SelectTargetPhase } from "#app/phases.js";
import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Steely Spirit", () => { describe("Abilities - Steely Spirit", () => {
@ -33,7 +32,7 @@ describe("Abilities - Steely Spirit", () => {
game.override.battleType("double"); game.override.battleType("double");
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.IRON_HEAD, Moves.SPLASH]); game.override.moveset([Moves.IRON_HEAD, Moves.SPLASH]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
vi.spyOn(allMoves[moveToCheck], "calculateBattlePower"); vi.spyOn(allMoves[moveToCheck], "calculateBattlePower");
}); });

View File

@ -34,7 +34,7 @@ describe("Abilities - Sturdy", () => {
game.override.starterSpecies(Species.LUCARIO); game.override.starterSpecies(Species.LUCARIO);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CLOSE_COMBAT, Moves.FISSURE]); game.override.moveset([Moves.CLOSE_COMBAT, Moves.FISSURE]);
game.override.enemySpecies(Species.ARON); game.override.enemySpecies(Species.ARON);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);

View File

@ -68,7 +68,7 @@ describe("Abilities - Unseen Fist", () => {
}); });
async function testUnseenFistHitResult(game: GameManager, attackMove: Moves, protectMove: Moves, shouldSucceed: boolean = true): Promise<void> { async function testUnseenFistHitResult(game: GameManager, attackMove: Moves, protectMove: Moves, shouldSucceed: boolean = true): Promise<void> {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([attackMove]); game.override.moveset([attackMove]);
game.override.enemyMoveset([protectMove, protectMove, protectMove, protectMove]); game.override.enemyMoveset([protectMove, protectMove, protectMove, protectMove]);
await game.startBattle(); await game.startBattle();

View File

@ -37,7 +37,7 @@ describe("Abilities - Volt Absorb", () => {
const moveToUse = Moves.CHARGE; const moveToUse = Moves.CHARGE;
const ability = Abilities.VOLT_ABSORB; const ability = Abilities.VOLT_ABSORB;
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.ability(ability); game.override.ability(ability);
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
game.override.enemySpecies(Species.DUSKULL); game.override.enemySpecies(Species.DUSKULL);

View File

@ -1,15 +1,14 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { BattlerTagType } from "#app/enums/battler-tag-type.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Wind Power", () => { describe("Abilities - Wind Power", () => {
@ -31,7 +30,7 @@ describe("Abilities - Wind Power", () => {
game.override.battleType("single"); game.override.battleType("single");
game.override.enemySpecies(Species.SHIFTRY); game.override.enemySpecies(Species.SHIFTRY);
game.override.enemyAbility(Abilities.WIND_POWER); game.override.enemyAbility(Abilities.WIND_POWER);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]); game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
}); });

View File

@ -1,15 +1,14 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { BattleStat } from "#app/data/battle-stat.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { BattleStat } from "#app/data/battle-stat.js"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Wind Rider", () => { describe("Abilities - Wind Rider", () => {
@ -31,7 +30,7 @@ describe("Abilities - Wind Rider", () => {
game.override.battleType("single"); game.override.battleType("single");
game.override.enemySpecies(Species.SHIFTRY); game.override.enemySpecies(Species.SHIFTRY);
game.override.enemyAbility(Abilities.WIND_RIDER); game.override.enemyAbility(Abilities.WIND_RIDER);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]); game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
}); });

View File

@ -1,14 +1,13 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { allAbilities } from "#app/data/ability.js";
import Phaser from "phaser"; import { allMoves } from "#app/data/move.js";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { MoveEffectPhase } from "#app/phases"; import { MoveEffectPhase } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { allMoves } from "#app/data/move.js"; import { Moves } from "#enums/moves";
import { allAbilities } from "#app/data/ability.js"; import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Wonder Skin", () => { describe("Abilities - Wonder Skin", () => {
@ -28,7 +27,7 @@ describe("Abilities - Wonder Skin", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.CHARM]); game.override.moveset([Moves.TACKLE, Moves.CHARM]);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.WONDER_SKIN); game.override.enemyAbility(Abilities.WONDER_SKIN);

View File

@ -48,7 +48,7 @@ describe("Abilities - ZEN MODE", () => {
game.override.enemyAbility(Abilities.HYDRATION); game.override.enemyAbility(Abilities.HYDRATION);
game.override.ability(Abilities.ZEN_MODE); game.override.ability(Abilities.ZEN_MODE);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });

View File

@ -30,7 +30,7 @@ describe("Abilities - ZERO TO HERO", () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.ZERO_TO_HERO); game.override.ability(Abilities.ZERO_TO_HERO);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });

View File

@ -1,11 +1,10 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import {MoneyAchv, Achv, AchvTier, RibbonAchv, DamageAchv, HealAchv, LevelAchv, ModifierAchv, achvs} from "#app/system/achv";
import BattleScene from "../../battle-scene";
import { IntegerHolder, NumberHolder } from "#app/utils.js";
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier.js"; import { TurnHeldItemTransferModifier } from "#app/modifier/modifier.js";
import Phaser from "phaser"; import { Achv, AchvTier, DamageAchv, HealAchv, LevelAchv, ModifierAchv, MoneyAchv, RibbonAchv, achvs } from "#app/system/achv";
import GameManager from "#app/test/utils/gameManager"; import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides"; import { IntegerHolder, NumberHolder } from "#app/utils.js";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import BattleScene from "../../battle-scene";
describe("check some Achievement related stuff", () => { describe("check some Achievement related stuff", () => {
it ("should check Achievement creation", () => { it ("should check Achievement creation", () => {
@ -103,8 +102,8 @@ describe("RibbonAchv", () => {
}); });
beforeEach(() => { beforeEach(() => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([]);
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.moveset([]);
game.override.startingLevel(0); game.override.startingLevel(0);
game.override.starterSpecies(0); game.override.starterSpecies(0);
game.override.enemyMoveset([]); game.override.enemyMoveset([]);

View File

@ -30,7 +30,7 @@ describe("Arena - Gravity", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.GRAVITY, Moves.FISSURE]); game.override.moveset([Moves.TACKLE, Moves.GRAVITY, Moves.FISSURE]);
game.override.ability(Abilities.UNNERVE); game.override.ability(Abilities.UNNERVE);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);

View File

@ -1,16 +1,15 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
MoveEffectPhase,
} from "#app/phases";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { allMoves } from "#app/data/move.js"; import { allMoves } from "#app/data/move.js";
import { WeatherType } from "#app/data/weather.js"; import { WeatherType } from "#app/data/weather.js";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import {
MoveEffectPhase,
} from "#app/phases";
import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Weather - Fog", () => { describe("Weather - Fog", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -31,7 +30,7 @@ describe("Weather - Fog", () => {
game.override game.override
.weather(WeatherType.FOG) .weather(WeatherType.FOG)
.battleType("single"); .battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);

View File

@ -1,15 +1,14 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { allMoves } from "#app/data/move.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { import {
TurnStartPhase, TurnStartPhase,
} from "#app/phases"; } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { allMoves } from "#app/data/move.js"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Weather - Strong Winds", () => { describe("Weather - Strong Winds", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -31,7 +30,7 @@ describe("Weather - Strong Winds", () => {
game.override.startingLevel(10); game.override.startingLevel(10);
game.override.enemySpecies(Species.TAILLOW); game.override.enemySpecies(Species.TAILLOW);
game.override.enemyAbility(Abilities.DELTA_STREAM); game.override.enemyAbility(Abilities.DELTA_STREAM);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.THUNDERBOLT, Moves.ICE_BEAM, Moves.ROCK_SLIDE]); game.override.moveset([Moves.THUNDERBOLT, Moves.ICE_BEAM, Moves.ROCK_SLIDE]);
}); });
it("electric type move is not very effective on Rayquaza", async () => { it("electric type move is not very effective on Rayquaza", async () => {

View File

@ -1,20 +1,19 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { Stat } from "#app/data/pokemon-stat";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { import {
CommandPhase, EnemyCommandPhase, SelectTargetPhase, CommandPhase, EnemyCommandPhase, SelectTargetPhase,
TurnStartPhase TurnStartPhase
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import {Stat} from "#app/data/pokemon-stat";
import TargetSelectUiHandler from "#app/ui/target-select-ui-handler"; import TargetSelectUiHandler from "#app/ui/target-select-ui-handler";
import { Mode } from "#app/ui/ui";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { Button } from "#enums/buttons";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import {Button} from "#enums/buttons"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Battle order", () => { describe("Battle order", () => {
@ -37,7 +36,7 @@ describe("Battle order", () => {
game.override.enemySpecies(Species.MEWTWO); game.override.enemySpecies(Species.MEWTWO);
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);
game.override.ability(Abilities.INSOMNIA); game.override.ability(Abilities.INSOMNIA);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
}); });
it("opponent faster than player 50 vs 150", async() => { it("opponent faster than player 50 vs 150", async() => {

View File

@ -1,9 +1,6 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { allSpecies } from "#app/data/pokemon-species";
import {generateStarter, getMovePosition,} from "#app/test/utils/gameManagerUtils";
import {Mode} from "#app/ui/ui";
import { GameModes } from "#app/game-mode"; import { GameModes } from "#app/game-mode";
import Overrides from "#app/overrides"; import { getGameMode } from "#app/game-mode.js";
import {Command} from "#app/ui/command-ui-handler";
import { import {
CommandPhase, DamagePhase, CommandPhase, DamagePhase,
EncounterPhase, EncounterPhase,
@ -17,13 +14,15 @@ import {
TurnInitPhase, VictoryPhase, TurnInitPhase, VictoryPhase,
} from "#app/phases"; } from "#app/phases";
import GameManager from "#app/test/utils/gameManager"; import GameManager from "#app/test/utils/gameManager";
import Phaser from "phaser"; import { generateStarter, getMovePosition, } from "#app/test/utils/gameManagerUtils";
import {allSpecies} from "#app/data/pokemon-species"; import { Command } from "#app/ui/command-ui-handler";
import { getGameMode } from "#app/game-mode.js"; import { Mode } from "#app/ui/ui";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { PlayerGender } from "#enums/player-gender"; import { PlayerGender } from "#enums/player-gender";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Test Battle Phase", () => { describe("Test Battle Phase", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -96,7 +95,7 @@ describe("Test Battle Phase", () => {
game.override game.override
.startingWave(3) .startingWave(3)
.battleType("single"); .battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyAbility(Abilities.HYDRATION); game.override.enemyAbility(Abilities.HYDRATION);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
await game.startBattle(); await game.startBattle();
@ -115,7 +114,7 @@ describe("Test Battle Phase", () => {
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.startingLevel(5); game.override.startingLevel(5);
game.override.startingWave(3); game.override.startingWave(3);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyAbility(Abilities.HYDRATION); game.override.enemyAbility(Abilities.HYDRATION);
game.override.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]); game.override.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]);
game.override.battleType("single"); game.override.battleType("single");
@ -268,7 +267,7 @@ describe("Test Battle Phase", () => {
game.override.ability(Abilities.ZEN_MODE); game.override.ability(Abilities.ZEN_MODE);
game.override.startingLevel(2000); game.override.startingLevel(2000);
game.override.startingWave(3); game.override.startingWave(3);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
await game.startBattle([ await game.startBattle([
Species.DARMANITAN, Species.DARMANITAN,
@ -297,7 +296,7 @@ describe("Test Battle Phase", () => {
game.override.ability(Abilities.ZEN_MODE); game.override.ability(Abilities.ZEN_MODE);
game.override.startingLevel(2000); game.override.startingLevel(2000);
game.override.startingWave(3); game.override.startingWave(3);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
await game.startBattle(); await game.startBattle();
const turn = game.scene.currentBattle.turn; const turn = game.scene.currentBattle.turn;
@ -315,7 +314,7 @@ describe("Test Battle Phase", () => {
game.override.ability(Abilities.ZEN_MODE); game.override.ability(Abilities.ZEN_MODE);
game.override.startingLevel(2000); game.override.startingLevel(2000);
game.override.startingWave(3); game.override.startingWave(3);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
await game.startBattle(); await game.startBattle();
const waveIndex = game.scene.currentBattle.waveIndex; const waveIndex = game.scene.currentBattle.waveIndex;

View File

@ -1,10 +1,9 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import GameManager from "#app/test/utils/gameManager"; import GameManager from "#app/test/utils/gameManager";
import Phaser from "phaser";
import Overrides from "#app/overrides";
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";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Test Battle Phase", () => { describe("Test Battle Phase", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -31,7 +30,7 @@ describe("Test Battle Phase", () => {
game.override.enemyAbility(Abilities.HYDRATION); game.override.enemyAbility(Abilities.HYDRATION);
game.override.ability(Abilities.ZEN_MODE); game.override.ability(Abilities.ZEN_MODE);
game.override.startingLevel(2000); game.override.startingLevel(2000);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -1,14 +1,13 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import {Mode} from "#app/ui/ui";
import Overrides from "#app/overrides";
import { import {
CommandPhase, CommandPhase,
} from "#app/phases"; } from "#app/phases";
import GameManager from "#app/test/utils/gameManager"; import GameManager from "#app/test/utils/gameManager";
import Phaser from "phaser"; import { Mode } from "#app/ui/ui";
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";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Test Battle Phase", () => { describe("Test Battle Phase", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -28,7 +27,7 @@ describe("Test Battle Phase", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.startingLevel(2000); game.override.startingLevel(2000);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyAbility(Abilities.HYDRATION); game.override.enemyAbility(Abilities.HYDRATION);
game.override.ability(Abilities.HYDRATION); game.override.ability(Abilities.HYDRATION);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);

View File

@ -31,7 +31,7 @@ describe("Items - Grip Claw", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("double"); game.override.battleType("double");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.POPULATION_BOMB, Moves.SPLASH ]); game.override.moveset([ Moves.POPULATION_BOMB, Moves.SPLASH ]);
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "GRIP_CLAW", count: 5}, {name: "MULTI_LENS", count: 3}]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "GRIP_CLAW", count: 5}, {name: "MULTI_LENS", count: 3}]);
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.ability(Abilities.KLUTZ); game.override.ability(Abilities.KLUTZ);

View File

@ -36,7 +36,7 @@ describe("Items - Leek", () => {
it("LEEK activates in battle correctly", async() => { it("LEEK activates in battle correctly", async() => {
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "LEEK" }]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "LEEK" }]);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.POUND ]); game.override.moveset([ Moves.POUND ]);
const consoleSpy = vi.spyOn(console, "log"); const consoleSpy = vi.spyOn(console, "log");
await game.startBattle([ await game.startBattle([
Species.FARFETCHD Species.FARFETCHD

View File

@ -28,7 +28,7 @@ describe("Items - Leftovers", () => {
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE);
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.UNNERVE); game.override.enemyAbility(Abilities.UNNERVE);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);

View File

@ -36,7 +36,7 @@ describe("Items - Scope Lens", () => {
it("SCOPE_LENS activates in battle correctly", async() => { it("SCOPE_LENS activates in battle correctly", async() => {
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SCOPE_LENS" }]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "SCOPE_LENS" }]);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.POUND ]); game.override.moveset([ Moves.POUND ]);
const consoleSpy = vi.spyOn(console, "log"); const consoleSpy = vi.spyOn(console, "log");
await game.startBattle([ await game.startBattle([
Species.GASTLY Species.GASTLY

View File

@ -41,7 +41,7 @@ describe("Items - Toxic orb", () => {
game.override.ability(Abilities.INSOMNIA); game.override.ability(Abilities.INSOMNIA);
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);
game.override.startingLevel(2000); game.override.startingLevel(2000);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([oppMoveToUse, oppMoveToUse, oppMoveToUse, oppMoveToUse]); game.override.enemyMoveset([oppMoveToUse, oppMoveToUse, oppMoveToUse, oppMoveToUse]);
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{
name: "TOXIC_ORB", name: "TOXIC_ORB",

View File

@ -29,7 +29,7 @@ describe("Moves - Astonish", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ASTONISH, Moves.SPLASH]); game.override.moveset([Moves.ASTONISH, Moves.SPLASH]);
game.override.enemySpecies(Species.BLASTOISE); game.override.enemySpecies(Species.BLASTOISE);
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);

View File

@ -37,7 +37,7 @@ describe("Moves - Aurora Veil", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.NONE); game.override.ability(Abilities.NONE);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]); game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]); game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);

View File

@ -38,7 +38,7 @@ describe("Moves - Ceaseless Edge", () => {
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.RUN_AWAY); vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.RUN_AWAY);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.CEASELESS_EDGE, Moves.SPLASH, Moves.ROAR ]); game.override.moveset([ Moves.CEASELESS_EDGE, Moves.SPLASH, Moves.ROAR ]);
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]); game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100);

View File

@ -28,7 +28,7 @@ describe("Moves - Double Team", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DOUBLE_TEAM]); game.override.moveset([Moves.DOUBLE_TEAM]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);

View File

@ -39,7 +39,7 @@ describe("Moves - Dragon Rage", () => {
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
game.override.starterSpecies(Species.SNORLAX); game.override.starterSpecies(Species.SNORLAX);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_RAGE]); game.override.moveset([Moves.DRAGON_RAGE]);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
game.override.startingLevel(100); game.override.startingLevel(100);

View File

@ -28,7 +28,7 @@ describe("Moves - Dynamax Cannon", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ dynamaxCannon.id ]); game.override.moveset([ dynamaxCannon.id ]);
game.override.startingLevel(200); game.override.startingLevel(200);
// Note that, for Waves 1-10, the level cap is 10 // Note that, for Waves 1-10, the level cap is 10

View File

@ -34,7 +34,7 @@ describe("Moves - Fissure", () => {
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
game.override.starterSpecies(Species.SNORLAX); game.override.starterSpecies(Species.SNORLAX);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FISSURE]); game.override.moveset([Moves.FISSURE]);
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
game.override.startingLevel(100); game.override.startingLevel(100);

View File

@ -34,7 +34,7 @@ describe("Moves - Flower Shield", () => {
game.override.ability(Abilities.NONE); game.override.ability(Abilities.NONE);
game.override.enemyAbility(Abilities.NONE); game.override.enemyAbility(Abilities.NONE);
game.override.battleType("single"); game.override.battleType("single");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLOWER_SHIELD, Moves.SPLASH]); game.override.moveset([Moves.FLOWER_SHIELD, Moves.SPLASH]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
}); });

View File

@ -37,7 +37,7 @@ describe("Moves - Follow Me", () => {
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]); game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });
@ -102,7 +102,7 @@ describe("Moves - Follow Me", () => {
"move effect should be bypassed by Stalwart", "move effect should be bypassed by Stalwart",
async () => { async () => {
game.override.ability(Abilities.STALWART); game.override.ability(Abilities.STALWART);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.QUICK_ATTACK ]); game.override.moveset([ Moves.QUICK_ATTACK ]);
game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]); game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]);
await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]); await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]);
@ -136,7 +136,7 @@ describe("Moves - Follow Me", () => {
test( test(
"move effect should be bypassed by Snipe Shot", "move effect should be bypassed by Snipe Shot",
async () => { async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SNIPE_SHOT ]); game.override.moveset([ Moves.SNIPE_SHOT ]);
game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]); game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]);
await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]); await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]);

View File

@ -34,7 +34,7 @@ describe("Moves - Gastro Acid", () => {
game.override.startingLevel(1); game.override.startingLevel(1);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
game.override.ability(Abilities.NONE); game.override.ability(Abilities.NONE);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]); game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
game.override.enemySpecies(Species.BIDOOF); game.override.enemySpecies(Species.BIDOOF);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
game.override.enemyAbility(Abilities.WATER_ABSORB); game.override.enemyAbility(Abilities.WATER_ABSORB);

View File

@ -34,7 +34,7 @@ describe("Moves - Glaive Rush", () => {
game.override.starterSpecies(Species.KLINK); game.override.starterSpecies(Species.KLINK);
game.override.ability(Abilities.UNNERVE); game.override.ability(Abilities.UNNERVE);
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FUR_COAT); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FUR_COAT);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]); game.override.moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]);
}); });
it("takes double damage from attacks", async() => { it("takes double damage from attacks", async() => {

View File

@ -1,20 +1,19 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { BattleStat } from "#app/data/battle-stat";
import Phaser from "phaser"; import { Stat } from "#app/data/pokemon-stat";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { import {
CommandPhase, CommandPhase,
EnemyCommandPhase, EnemyCommandPhase,
TurnInitPhase, TurnInitPhase,
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import GameManager from "#app/test/utils/gameManager";
import {Stat} from "#app/data/pokemon-stat";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import {BattleStat} from "#app/data/battle-stat"; import { Mode } from "#app/ui/ui";
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";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Growth", () => { describe("Moves - Growth", () => {
@ -39,7 +38,7 @@ describe("Moves - Growth", () => {
game.override.enemyAbility(Abilities.MOXIE); game.override.enemyAbility(Abilities.MOXIE);
game.override.ability(Abilities.INSOMNIA); game.override.ability(Abilities.INSOMNIA);
game.override.startingLevel(2000); game.override.startingLevel(2000);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -1,15 +1,14 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { allMoves } from "#app/data/move.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { import {
MoveEffectPhase MoveEffectPhase
} from "#app/phases"; } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { allMoves } from "#app/data/move.js"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Moves - Hard Press", () => { describe("Moves - Hard Press", () => {
@ -35,7 +34,7 @@ describe("Moves - Hard Press", () => {
game.override.enemySpecies(Species.MUNCHLAX); game.override.enemySpecies(Species.MUNCHLAX);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HARD_PRESS]); game.override.moveset([Moves.HARD_PRESS]);
vi.spyOn(moveToCheck, "calculateBattlePower"); vi.spyOn(moveToCheck, "calculateBattlePower");
}); });

View File

@ -35,7 +35,7 @@ describe("Moves - Hyper Beam", () => {
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH);
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HYPER_BEAM, Moves.TACKLE]); game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]);
vi.spyOn(allMoves[Moves.HYPER_BEAM], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[Moves.HYPER_BEAM], "accuracy", "get").mockReturnValue(100);
}); });

View File

@ -36,7 +36,7 @@ describe("Moves - Light Screen", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.NONE); game.override.ability(Abilities.NONE);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]); game.override.moveset([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]); game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]);

View File

@ -29,7 +29,7 @@ describe("Moves - Magnet Rise", () => {
game.override.enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]); game.override.enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(1);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]); game.override.moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]);
}); });
it("MAGNET RISE", async () => { it("MAGNET RISE", async () => {

View File

@ -33,7 +33,7 @@ describe("Moves - Make It Rain", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("double"); game.override.battleType("double");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MAKE_IT_RAIN, Moves.SPLASH]); game.override.moveset([Moves.MAKE_IT_RAIN, Moves.SPLASH]);
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);

View File

@ -166,7 +166,7 @@ function leaveOneEnemyPokemon(game: GameManager) {
function beforeTrial(phaserGame: Phaser.Game, single: boolean = false) { function beforeTrial(phaserGame: Phaser.Game, single: boolean = false) {
const game = new GameManager(phaserGame); const game = new GameManager(phaserGame);
game.override.battleType("double"); game.override.battleType("double");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE, Moves.HYPER_VOICE, Moves.SURF, Moves.SPLASH]); game.override.moveset([Moves.EARTHQUAKE, Moves.HYPER_VOICE, Moves.SURF, Moves.SPLASH]);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);

View File

@ -1,14 +1,13 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { CommandPhase, MoveEndPhase, TurnInitPhase } from "#app/phases";
import {getMovePosition} from "#app/test/utils/gameManagerUtils";
import { BattleStat } from "#app/data/battle-stat"; import { BattleStat } from "#app/data/battle-stat";
import { TrappedTag } from "#app/data/battler-tags.js";
import { CommandPhase, MoveEndPhase, TurnInitPhase } from "#app/phases";
import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
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";
import { TrappedTag } from "#app/data/battler-tags.js"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Moves - Octolock", () => { describe("Moves - Octolock", () => {
@ -36,7 +35,7 @@ describe("Moves - Octolock", () => {
game.override.enemyAbility(Abilities.NONE); game.override.enemyAbility(Abilities.NONE);
game.override.startingLevel(2000); game.override.startingLevel(2000);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.OCTOLOCK, Moves.SPLASH]); game.override.moveset([Moves.OCTOLOCK, Moves.SPLASH]);
game.override.ability(Abilities.NONE); game.override.ability(Abilities.NONE);
}); });

View File

@ -33,7 +33,7 @@ describe("Moves - Purify", () => {
game.override.starterSpecies(Species.PYUKUMUKU); game.override.starterSpecies(Species.PYUKUMUKU);
game.override.startingLevel(10); game.override.startingLevel(10);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.PURIFY, Moves.SIZZLY_SLIDE]); game.override.moveset([Moves.PURIFY, Moves.SIZZLY_SLIDE]);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(10); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(10);

View File

@ -36,7 +36,7 @@ describe("Moves - Rage Powder", () => {
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]); game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -36,7 +36,7 @@ describe("Moves - Reflect", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("single"); game.override.battleType("single");
game.override.ability(Abilities.NONE); game.override.ability(Abilities.NONE);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]); game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]); game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]);

View File

@ -38,7 +38,7 @@ describe("Moves - Rollout", () => {
}); });
it("should double it's dmg on sequential uses but reset after 5", async () => { it("should double it's dmg on sequential uses but reset after 5", async () => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ROLLOUT]); game.override.moveset([Moves.ROLLOUT]);
vi.spyOn(allMoves[Moves.ROLLOUT], "accuracy", "get").mockReturnValue(100); //always hit vi.spyOn(allMoves[Moves.ROLLOUT], "accuracy", "get").mockReturnValue(100); //always hit
const variance = 5; const variance = 5;

View File

@ -32,7 +32,7 @@ describe("Moves - Roost", () => {
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.STOMPING_TANTRUM ]); game.override.moveset([ Moves.STOMPING_TANTRUM ]);
game.override.enemyMoveset([Moves.ROOST,Moves.ROOST,Moves.ROOST,Moves.ROOST]); game.override.enemyMoveset([Moves.ROOST,Moves.ROOST,Moves.ROOST,Moves.ROOST]);
}); });

View File

@ -35,7 +35,7 @@ describe("Moves - Spikes", () => {
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
game.override.startingWave(3); game.override.startingWave(3);
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]); game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPIKES,Moves.SPLASH, Moves.ROAR]); game.override.moveset([Moves.SPIKES,Moves.SPLASH, Moves.ROAR]);
}); });
it("single - wild - stay on field - no damage", async() => { it("single - wild - stay on field - no damage", async() => {

View File

@ -35,7 +35,7 @@ describe("Moves - Spit Up", () => {
game.override.enemyAbility(Abilities.NONE); game.override.enemyAbility(Abilities.NONE);
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP]); game.override.moveset([Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP]);
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
}); });

View File

@ -36,7 +36,7 @@ describe("Moves - Spotlight", () => {
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]); game.override.moveset([ Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK ]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -35,7 +35,7 @@ describe("Moves - Stockpile", () => {
game.override.enemyAbility(Abilities.NONE); game.override.enemyAbility(Abilities.NONE);
vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STOCKPILE, Moves.SPLASH]); game.override.moveset([Moves.STOCKPILE, Moves.SPLASH]);
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
}); });

View File

@ -34,7 +34,7 @@ describe("Moves - Swallow", () => {
game.override.enemyAbility(Abilities.NONE); game.override.enemyAbility(Abilities.NONE);
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(2000);
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]); game.override.moveset([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]);
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
}); });

View File

@ -35,7 +35,7 @@ describe("Moves - Tackle", () => {
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.startingLevel(1); game.override.startingLevel(1);
game.override.startingWave(97); game.override.startingWave(97);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.GROWTH,Moves.GROWTH,Moves.GROWTH,Moves.GROWTH]); game.override.enemyMoveset([Moves.GROWTH,Moves.GROWTH,Moves.GROWTH,Moves.GROWTH]);
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
}); });

View File

@ -1,19 +1,18 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { BattleStat } from "#app/data/battle-stat";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { import {
CommandPhase, CommandPhase,
EnemyCommandPhase, EnemyCommandPhase,
TurnInitPhase, TurnInitPhase,
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import {BattleStat} from "#app/data/battle-stat"; import { Mode } from "#app/ui/ui";
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";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Tail whip", () => { describe("Moves - Tail whip", () => {
@ -38,7 +37,7 @@ describe("Moves - Tail whip", () => {
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA);
game.override.ability(Abilities.INSOMNIA); game.override.ability(Abilities.INSOMNIA);
game.override.startingLevel(2000); game.override.startingLevel(2000);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
}); });

View File

@ -1,16 +1,15 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { ArenaTagSide } from "#app/data/arena-tag.js";
import Phaser from "phaser"; import { Stat } from "#app/data/pokemon-stat.js";
import GameManager from "#app/test/utils/gameManager"; import { ArenaTagType } from "#app/enums/arena-tag-type.js";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { import {
TurnEndPhase, TurnEndPhase,
} from "#app/phases"; } from "#app/phases";
import { Moves } from "#enums/moves"; import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Stat } from "#app/data/pokemon-stat.js"; import { Moves } from "#enums/moves";
import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { Species } from "#enums/species";
import { ArenaTagSide } from "#app/data/arena-tag.js"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
describe("Abilities - Wind Rider", () => { describe("Abilities - Wind Rider", () => {
@ -30,7 +29,7 @@ describe("Abilities - Wind Rider", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleType("double"); game.override.battleType("double");
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]); game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
}); });

View File

@ -34,7 +34,7 @@ describe("Moves - Thousand Arrows", () => {
game.override.enemySpecies(Species.TOGETIC); game.override.enemySpecies(Species.TOGETIC);
game.override.startingLevel(100); game.override.startingLevel(100);
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.THOUSAND_ARROWS ]); game.override.moveset([ Moves.THOUSAND_ARROWS ]);
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]); game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
}); });

View File

@ -1,14 +1,13 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import { BattleStat } from "#app/data/battle-stat.js";
import Phaser from "phaser"; import { ArenaTagType } from "#app/enums/arena-tag-type.js";
import GameManager from "#app/test/utils/gameManager";
import Overrides from "#app/overrides";
import { MoveEndPhase, TurnEndPhase } from "#app/phases"; import { MoveEndPhase, TurnEndPhase } from "#app/phases";
import GameManager from "#app/test/utils/gameManager";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
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";
import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import Phaser from "phaser";
import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { BattleStat } from "#app/data/battle-stat.js";
import { SPLASH_ONLY } from "../utils/testUtils"; import { SPLASH_ONLY } from "../utils/testUtils";
@ -34,12 +33,12 @@ describe("Moves - Tidy Up", () => {
game.override.enemyMoveset(SPLASH_ONLY); game.override.enemyMoveset(SPLASH_ONLY);
game.override.starterSpecies(Species.FEEBAS); game.override.starterSpecies(Species.FEEBAS);
game.override.ability(Abilities.BALL_FETCH); game.override.ability(Abilities.BALL_FETCH);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TIDY_UP]); game.override.moveset([Moves.TIDY_UP]);
game.override.startingLevel(50); game.override.startingLevel(50);
}); });
it("spikes are cleared", async() => { it("spikes are cleared", async() => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPIKES, Moves.TIDY_UP]); game.override.moveset([Moves.SPIKES, Moves.TIDY_UP]);
game.override.enemyMoveset([Moves.SPIKES, Moves.SPIKES, Moves.SPIKES, Moves.SPIKES]); game.override.enemyMoveset([Moves.SPIKES, Moves.SPIKES, Moves.SPIKES, Moves.SPIKES]);
await game.startBattle(); await game.startBattle();
@ -52,7 +51,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it("stealth rocks are cleared", async() => { it("stealth rocks are cleared", async() => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STEALTH_ROCK, Moves.TIDY_UP]); game.override.moveset([Moves.STEALTH_ROCK, Moves.TIDY_UP]);
game.override.enemyMoveset([Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK]); game.override.enemyMoveset([Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK]);
await game.startBattle(); await game.startBattle();
@ -65,7 +64,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it("toxic spikes are cleared", async() => { it("toxic spikes are cleared", async() => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TOXIC_SPIKES, Moves.TIDY_UP]); game.override.moveset([Moves.TOXIC_SPIKES, Moves.TIDY_UP]);
game.override.enemyMoveset([Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES]); game.override.enemyMoveset([Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES]);
await game.startBattle(); await game.startBattle();
@ -78,7 +77,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it("sticky webs are cleared", async() => { it("sticky webs are cleared", async() => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STICKY_WEB, Moves.TIDY_UP]); game.override.moveset([Moves.STICKY_WEB, Moves.TIDY_UP]);
game.override.enemyMoveset([Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB]); game.override.enemyMoveset([Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB]);
await game.startBattle(); await game.startBattle();
@ -92,7 +91,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it.skip("substitutes are cleared", async() => { it.skip("substitutes are cleared", async() => {
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SUBSTITUTE, Moves.TIDY_UP]); game.override.moveset([Moves.SUBSTITUTE, Moves.TIDY_UP]);
game.override.enemyMoveset([Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE]); game.override.enemyMoveset([Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE]);
await game.startBattle(); await game.startBattle();

View File

@ -41,7 +41,7 @@ describe("UI - Transfer Items", () => {
{ name: "BERRY", count: 2, type: BerryType.APICOT }, { name: "BERRY", count: 2, type: BerryType.APICOT },
{ name: "BERRY", count: 2, type: BerryType.LUM }, { name: "BERRY", count: 2, type: BerryType.LUM },
]); ]);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_CLAW]); game.override.moveset([Moves.DRAGON_CLAW]);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyMoveset([Moves.SPLASH]); game.override.enemyMoveset([Moves.SPLASH]);