From 3242a084f1f77902df11c9b480c8bdb2ff5053e0 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 15:51:05 -0700 Subject: [PATCH] apply game.override.moveset --- src/test/abilities/ability_timing.test.ts | 11 +++-- src/test/abilities/aura_break.test.ts | 15 ++++--- src/test/abilities/battery.test.ts | 15 ++++--- src/test/abilities/battle_bond.test.ts | 2 +- src/test/abilities/costar.test.ts | 13 +++--- src/test/abilities/disguise.test.ts | 2 +- src/test/abilities/dry_skin.test.ts | 12 +++--- src/test/abilities/hustle.test.ts | 2 +- src/test/abilities/ice_face.test.ts | 12 +++--- src/test/abilities/intimidate.test.ts | 8 ++-- src/test/abilities/libero.test.ts | 30 +++++++------- src/test/abilities/moxie.test.ts | 19 ++++----- src/test/abilities/parental_bond.test.ts | 46 ++++++++++----------- src/test/abilities/power_construct.test.ts | 2 +- src/test/abilities/power_spot.test.ts | 17 ++++---- src/test/abilities/protean.test.ts | 30 +++++++------- src/test/abilities/quick_draw.test.ts | 2 +- src/test/abilities/sand_veil.test.ts | 2 +- src/test/abilities/sap_sipper.test.ts | 12 +++--- src/test/abilities/schooling.test.ts | 2 +- src/test/abilities/screen_cleaner.test.ts | 15 ++++--- src/test/abilities/serene_grace.test.ts | 25 ++++++----- src/test/abilities/sheer_force.test.ts | 2 +- src/test/abilities/shield_dust.test.ts | 25 ++++++----- src/test/abilities/shields_down.test.ts | 2 +- src/test/abilities/steely_spirit.test.ts | 17 ++++---- src/test/abilities/sturdy.test.ts | 2 +- src/test/abilities/unseen_fist.test.ts | 2 +- src/test/abilities/volt_absorb.test.ts | 2 +- src/test/abilities/wind_power.test.ts | 15 ++++--- src/test/abilities/wind_rider.test.ts | 15 ++++--- src/test/abilities/wonder_skin.test.ts | 17 ++++---- src/test/abilities/zen_mode.test.ts | 2 +- src/test/abilities/zero_to_hero.test.ts | 2 +- src/test/achievements/achievement.test.ts | 13 +++--- src/test/arena/arena_gravity.test.ts | 2 +- src/test/arena/weather_fog.test.ts | 21 +++++----- src/test/arena/weather_strong_winds.test.ts | 15 ++++--- src/test/battle/battle-order.test.ts | 19 ++++----- src/test/battle/battle.test.ts | 27 ++++++------ src/test/battle/error-handling.test.ts | 7 ++-- src/test/battle/special_battle.test.ts | 9 ++-- src/test/items/grip_claw.test.ts | 2 +- src/test/items/leek.test.ts | 2 +- src/test/items/leftovers.test.ts | 2 +- src/test/items/scope_lens.test.ts | 2 +- src/test/items/toxic_orb.test.ts | 2 +- src/test/moves/astonish.test.ts | 2 +- src/test/moves/aurora_veil.test.ts | 2 +- src/test/moves/ceaseless_edge.test.ts | 2 +- src/test/moves/double_team.test.ts | 2 +- src/test/moves/dragon_rage.test.ts | 2 +- src/test/moves/dynamax_cannon.test.ts | 2 +- src/test/moves/fissure.test.ts | 2 +- src/test/moves/flower_shield.test.ts | 2 +- src/test/moves/follow_me.test.ts | 6 +-- src/test/moves/gastro_acid.test.ts | 2 +- src/test/moves/glaive_rush.test.ts | 2 +- src/test/moves/growth.test.ts | 19 ++++----- src/test/moves/hard_press.test.ts | 15 ++++--- src/test/moves/hyper_beam.test.ts | 2 +- src/test/moves/light_screen.test.ts | 2 +- src/test/moves/magnet_rise.test.ts | 2 +- src/test/moves/make_it_rain.test.ts | 2 +- src/test/moves/multi_target.test.ts | 2 +- src/test/moves/octolock.test.ts | 15 ++++--- src/test/moves/purify.test.ts | 2 +- src/test/moves/rage_powder.test.ts | 2 +- src/test/moves/reflect.test.ts | 2 +- src/test/moves/rollout.test.ts | 2 +- src/test/moves/roost.test.ts | 2 +- src/test/moves/spikes.test.ts | 2 +- src/test/moves/spit_up.test.ts | 2 +- src/test/moves/spotlight.test.ts | 2 +- src/test/moves/stockpile.test.ts | 2 +- src/test/moves/swallow.test.ts | 2 +- src/test/moves/tackle.test.ts | 2 +- src/test/moves/tail_whip.test.ts | 17 ++++---- src/test/moves/tailwind.test.ts | 19 ++++----- src/test/moves/thousand_arrows.test.ts | 2 +- src/test/moves/tidy_up.test.ts | 25 ++++++----- src/test/ui/transfer-item.test.ts | 2 +- 82 files changed, 333 insertions(+), 359 deletions(-) diff --git a/src/test/abilities/ability_timing.test.ts b/src/test/abilities/ability_timing.test.ts index b3f6c37b15c..0004479ed8c 100644 --- a/src/test/abilities/ability_timing.test.ts +++ b/src/test/abilities/ability_timing.test.ts @@ -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 i18next, { initI18n } from "#app/plugins/i18n"; +import GameManager from "#app/test/utils/gameManager"; import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; 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"; @@ -34,7 +33,7 @@ describe("Ability Timing", () => { game.override.enemyMoveset(SPLASH_ONLY); 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() => { diff --git a/src/test/abilities/aura_break.test.ts b/src/test/abilities/aura_break.test.ts index 20c15f679e8..918905fc00a 100644 --- a/src/test/abilities/aura_break.test.ts +++ b/src/test/abilities/aura_break.test.ts @@ -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 { allMoves } from "#app/data/move.js"; 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 { 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"; describe("Abilities - Aura Break", () => { @@ -29,7 +28,7 @@ describe("Abilities - Aura Break", () => { beforeEach(() => { game = new GameManager(phaserGame); 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.enemyAbility(Abilities.AURA_BREAK); game.override.enemySpecies(Species.SHUCKLE); diff --git a/src/test/abilities/battery.test.ts b/src/test/abilities/battery.test.ts index be13bceff4d..9c3248f39c0 100644 --- a/src/test/abilities/battery.test.ts +++ b/src/test/abilities/battery.test.ts @@ -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 { 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"; describe("Abilities - Battery", () => { @@ -31,7 +30,7 @@ describe("Abilities - Battery", () => { game.override.battleType("double"); game.override.enemySpecies(Species.SHUCKLE); 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); }); diff --git a/src/test/abilities/battle_bond.test.ts b/src/test/abilities/battle_bond.test.ts index 094bdc9dd53..2129bcd24e4 100644 --- a/src/test/abilities/battle_bond.test.ts +++ b/src/test/abilities/battle_bond.test.ts @@ -30,7 +30,7 @@ describe("Abilities - BATTLE BOND", () => { const moveToUse = Moves.SPLASH; game.override.battleType("single"); 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]); }); diff --git a/src/test/abilities/costar.test.ts b/src/test/abilities/costar.test.ts index 566f982fc08..1d58d899565 100644 --- a/src/test/abilities/costar.test.ts +++ b/src/test/abilities/costar.test.ts @@ -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 { CommandPhase, MessagePhase } from "#app/phases.js"; -import { getMovePosition } from "../utils/gameManagerUtils"; import { Abilities } from "#app/enums/abilities.js"; import { Moves } from "#app/enums/moves.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"; const TIMEOUT = 20 * 1000; @@ -30,7 +29,7 @@ describe("Abilities - COSTAR", () => { game = new GameManager(phaserGame); game.override.battleType("double"); 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); }); diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index fd486f89c69..cdc5852e8c7 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -30,7 +30,7 @@ describe("Abilities - DISGUISE", () => { const moveToUse = Moves.SPLASH; game.override.battleType("single"); 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]); }); diff --git a/src/test/abilities/dry_skin.test.ts b/src/test/abilities/dry_skin.test.ts index 9cb92710285..135acbf88f7 100644 --- a/src/test/abilities/dry_skin.test.ts +++ b/src/test/abilities/dry_skin.test.ts @@ -35,7 +35,7 @@ describe("Abilities - Dry Skin", () => { }); 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(); @@ -56,7 +56,7 @@ describe("Abilities - Dry Skin", () => { }); 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(); @@ -79,7 +79,7 @@ describe("Abilities - Dry Skin", () => { }); 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(); @@ -106,7 +106,7 @@ describe("Abilities - Dry Skin", () => { }); 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(); @@ -121,7 +121,7 @@ describe("Abilities - Dry Skin", () => { }); 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(); @@ -137,7 +137,7 @@ describe("Abilities - Dry Skin", () => { }); 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(); diff --git a/src/test/abilities/hustle.test.ts b/src/test/abilities/hustle.test.ts index b2033f7ef5e..165169bb66e 100644 --- a/src/test/abilities/hustle.test.ts +++ b/src/test/abilities/hustle.test.ts @@ -28,7 +28,7 @@ describe("Abilities - Hustle", () => { beforeEach(() => { game = new GameManager(phaserGame); 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, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5); diff --git a/src/test/abilities/ice_face.test.ts b/src/test/abilities/ice_face.test.ts index c0f91e8dff8..65d9fe1e489 100644 --- a/src/test/abilities/ice_face.test.ts +++ b/src/test/abilities/ice_face.test.ts @@ -36,7 +36,7 @@ describe("Abilities - Ice Face", () => { game.override.battleType("single"); game.override.enemySpecies(Species.EISCUE); 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 () => { @@ -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 () => { - 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); await game.startBattle([Species.HITMONLEE]); @@ -109,7 +109,7 @@ describe("Abilities - Ice Face", () => { }); 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]); 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 () => { 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]); @@ -227,7 +227,7 @@ describe("Abilities - Ice Face", () => { }); 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]); @@ -243,7 +243,7 @@ describe("Abilities - Ice Face", () => { }); 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]); diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index 5bba42bd6d8..c42af129227 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -205,7 +205,7 @@ describe("Abilities - Intimidate", () => { it("single - wild next wave opp triger once, us: none", async () => { 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]); let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); @@ -231,7 +231,7 @@ describe("Abilities - Intimidate", () => { it("single - wild next turn - no retrigger on next turn", async () => { 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]); let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); @@ -254,7 +254,7 @@ describe("Abilities - Intimidate", () => { }, 20000); 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.startingWave(5); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); @@ -293,7 +293,7 @@ describe("Abilities - Intimidate", () => { }, 200000); 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.startingWave(5); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index ce65614d0aa..cc69334b805 100644 --- a/src/test/abilities/libero.test.ts +++ b/src/test/abilities/libero.test.ts @@ -43,7 +43,7 @@ describe("Abilities - Protean", () => { test( "ability applies and changes a pokemon's type", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); + game.override.moveset([Moves.SPLASH]); await game.startBattle([Species.MAGIKARP]); @@ -61,7 +61,7 @@ describe("Abilities - Protean", () => { test.skip( "ability applies only once per switch in", 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]); @@ -101,7 +101,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move has a variable type", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WEATHER_BALL]); + game.override.moveset([Moves.WEATHER_BALL]); await game.startBattle([Species.MAGIKARP]); @@ -124,7 +124,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the type has changed by another ability", 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); await game.startBattle([Species.MAGIKARP]); @@ -147,7 +147,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move calls another move", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.NATURE_POWER]); + game.override.moveset([Moves.NATURE_POWER]); await game.startBattle([Species.MAGIKARP]); @@ -166,7 +166,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move is delayed / charging", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DIG]); + game.override.moveset([Moves.DIG]); await game.startBattle([Species.MAGIKARP]); @@ -184,7 +184,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move misses", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); + game.override.moveset([Moves.TACKLE]); game.override.enemyMoveset(SPLASH_ONLY); await game.startBattle([Species.MAGIKARP]); @@ -207,7 +207,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move is protected against", 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]); await game.startBattle([Species.MAGIKARP]); @@ -226,7 +226,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move fails because of type immunity", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); + game.override.moveset([Moves.TACKLE]); game.override.enemySpecies(Species.GASTLY); await game.startBattle([Species.MAGIKARP]); @@ -245,7 +245,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if pokemon's type is the same as the move's type", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); + game.override.moveset([Moves.SPLASH]); await game.startBattle([Species.MAGIKARP]); @@ -264,7 +264,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if pokemon is terastallized", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); + game.override.moveset([Moves.SPLASH]); await game.startBattle([Species.MAGIKARP]); @@ -284,7 +284,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if pokemon uses struggle", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]); + game.override.moveset([Moves.STRUGGLE]); await game.startBattle([Species.MAGIKARP]); @@ -302,7 +302,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if the pokemon's move fails", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]); + game.override.moveset([Moves.BURN_UP]); await game.startBattle([Species.MAGIKARP]); @@ -320,7 +320,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TRICK_OR_TREAT]); + game.override.moveset([Moves.TRICK_OR_TREAT]); game.override.enemySpecies(Species.GASTLY); await game.startBattle([Species.MAGIKARP]); @@ -339,7 +339,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly and the pokemon curses itself", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]); + game.override.moveset([Moves.CURSE]); await game.startBattle([Species.MAGIKARP]); diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index 0ad48bbaad9..469a4e2947f 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -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 { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#app/data/pokemon-stat"; import { CommandPhase, EnemyCommandPhase, VictoryPhase } from "#app/phases"; -import {Mode} from "#app/ui/ui"; -import {Stat} from "#app/data/pokemon-stat"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {Command} from "#app/ui/command-ui-handler"; -import {BattleStat} from "#app/data/battle-stat"; +import GameManager from "#app/test/utils/gameManager"; +import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { Command } from "#app/ui/command-ui-handler"; +import { Mode } from "#app/ui/ui"; 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 - Moxie", () => { @@ -39,7 +38,7 @@ describe("Abilities - Moxie", () => { game.override.enemyAbility(Abilities.MOXIE); game.override.ability(Abilities.MOXIE); 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]); }); diff --git a/src/test/abilities/parental_bond.test.ts b/src/test/abilities/parental_bond.test.ts index c6de23432e6..334ab12d46e 100644 --- a/src/test/abilities/parental_bond.test.ts +++ b/src/test/abilities/parental_bond.test.ts @@ -44,7 +44,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should add second strike to attack move", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); + game.override.moveset([Moves.TACKLE]); await game.startBattle([Species.CHARIZARD]); @@ -76,7 +76,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should apply secondary effects to both strikes", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.POWER_UP_PUNCH]); + game.override.moveset([Moves.POWER_UP_PUNCH]); game.override.enemySpecies(Species.AMOONGUSS); await game.startBattle([Species.CHARIZARD]); @@ -99,7 +99,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not apply to Status moves", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BABY_DOLL_EYES]); + game.override.moveset([Moves.BABY_DOLL_EYES]); await game.startBattle([Species.CHARIZARD]); @@ -119,7 +119,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not apply to multi-hit moves", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DOUBLE_HIT]); + game.override.moveset([Moves.DOUBLE_HIT]); await game.startBattle([Species.CHARIZARD]); @@ -144,7 +144,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not apply to self-sacrifice moves", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SELF_DESTRUCT]); + game.override.moveset([Moves.SELF_DESTRUCT]); await game.startBattle([Species.CHARIZARD]); @@ -165,7 +165,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not apply to Rollout", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ROLLOUT]); + game.override.moveset([Moves.ROLLOUT]); await game.startBattle([Species.CHARIZARD]); @@ -189,7 +189,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not apply multiplier to fixed-damage moves", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_RAGE]); + game.override.moveset([Moves.DRAGON_RAGE]); await game.startBattle([Species.CHARIZARD]); @@ -211,7 +211,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not apply multiplier to counter moves", 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]); await game.startBattle([Species.CHARIZARD]); @@ -240,7 +240,7 @@ describe("Abilities - Parental Bond", () => { "ability should not apply to multi-target moves", async () => { 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]); @@ -265,7 +265,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should apply to multi-target moves when hitting only one target", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE]); + game.override.moveset([Moves.EARTHQUAKE]); await game.startBattle([Species.CHARIZARD]); @@ -285,7 +285,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should only trigger post-target move effects once", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MIND_BLOWN]); + game.override.moveset([Moves.MIND_BLOWN]); await game.startBattle([Species.PIDGEOT]); @@ -311,7 +311,7 @@ describe("Abilities - Parental Bond", () => { test( "Burn Up only removes type after second strike with this ability", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]); + game.override.moveset([Moves.BURN_UP]); await game.startBattle([Species.CHARIZARD]); @@ -338,7 +338,7 @@ describe("Abilities - Parental Bond", () => { test( "Moves boosted by this ability and Multi-Lens should strike 4 times", 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}]); await game.startBattle([Species.CHARIZARD]); @@ -360,7 +360,7 @@ describe("Abilities - Parental Bond", () => { test( "Super Fang boosted by this ability and Multi-Lens should strike twice", 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}]); await game.startBattle([Species.CHARIZARD]); @@ -391,7 +391,7 @@ describe("Abilities - Parental Bond", () => { test( "Seismic Toss boosted by this ability and Multi-Lens should strike twice", 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}]); await game.startBattle([Species.CHARIZARD]); @@ -422,7 +422,7 @@ describe("Abilities - Parental Bond", () => { test( "Hyper Beam boosted by this ability should strike twice, then recharge", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HYPER_BEAM]); + game.override.moveset([Moves.HYPER_BEAM]); await game.startBattle([Species.CHARIZARD]); @@ -452,7 +452,7 @@ describe("Abilities - Parental Bond", () => { test( "Anchor Shot boosted by this ability should only trap the target after the second hit", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ANCHOR_SHOT]); + game.override.moveset([Moves.ANCHOR_SHOT]); await game.startBattle([Species.CHARIZARD]); @@ -484,7 +484,7 @@ describe("Abilities - Parental Bond", () => { test( "Smack Down boosted by this ability should only ground the target after the second hit", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SMACK_DOWN]); + game.override.moveset([Moves.SMACK_DOWN]); await game.startBattle([Species.CHARIZARD]); @@ -513,7 +513,7 @@ describe("Abilities - Parental Bond", () => { test( "U-turn boosted by this ability should strike twice before forcing a switch", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.U_TURN]); + game.override.moveset([Moves.U_TURN]); await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); @@ -539,7 +539,7 @@ describe("Abilities - Parental Bond", () => { test( "Wake-Up Slap boosted by this ability should only wake up the target after the second hit", 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); await game.startBattle([Species.CHARIZARD]); @@ -569,7 +569,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not cause user to hit into King's Shield more than once", 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]); await game.startBattle([Species.CHARIZARD]); @@ -591,7 +591,7 @@ describe("Abilities - Parental Bond", () => { test( "ability should not cause user to hit into Storm Drain more than once", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]); + game.override.moveset([Moves.WATER_GUN]); game.override.enemyAbility(Abilities.STORM_DRAIN); await game.startBattle([Species.CHARIZARD]); @@ -614,7 +614,7 @@ describe("Abilities - Parental Bond", () => { "ability should not apply to multi-target moves with Multi-Lens", async () => { 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}]); await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]); diff --git a/src/test/abilities/power_construct.test.ts b/src/test/abilities/power_construct.test.ts index 803be7e8147..4128cf7b5d2 100644 --- a/src/test/abilities/power_construct.test.ts +++ b/src/test/abilities/power_construct.test.ts @@ -30,7 +30,7 @@ describe("Abilities - POWER CONSTRUCT", () => { const moveToUse = Moves.SPLASH; game.override.battleType("single"); 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]); }); diff --git a/src/test/abilities/power_spot.test.ts b/src/test/abilities/power_spot.test.ts index f47f977046e..018002fe541 100644 --- a/src/test/abilities/power_spot.test.ts +++ b/src/test/abilities/power_spot.test.ts @@ -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 { MoveEffectPhase, TurnEndPhase } from "#app/phases.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"; describe("Abilities - Power Spot", () => { @@ -29,7 +28,7 @@ describe("Abilities - Power Spot", () => { beforeEach(() => { game = new GameManager(phaserGame); 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.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.BALL_FETCH); diff --git a/src/test/abilities/protean.test.ts b/src/test/abilities/protean.test.ts index 4889bc99b5c..65858ec947d 100644 --- a/src/test/abilities/protean.test.ts +++ b/src/test/abilities/protean.test.ts @@ -43,7 +43,7 @@ describe("Abilities - Protean", () => { test( "ability applies and changes a pokemon's type", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); + game.override.moveset([Moves.SPLASH]); await game.startBattle([Species.MAGIKARP]); @@ -61,7 +61,7 @@ describe("Abilities - Protean", () => { test.skip( "ability applies only once per switch in", 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]); @@ -101,7 +101,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move has a variable type", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WEATHER_BALL]); + game.override.moveset([Moves.WEATHER_BALL]); await game.startBattle([Species.MAGIKARP]); @@ -124,7 +124,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the type has changed by another ability", 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); await game.startBattle([Species.MAGIKARP]); @@ -147,7 +147,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move calls another move", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.NATURE_POWER]); + game.override.moveset([Moves.NATURE_POWER]); await game.startBattle([Species.MAGIKARP]); @@ -166,7 +166,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move is delayed / charging", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DIG]); + game.override.moveset([Moves.DIG]); await game.startBattle([Species.MAGIKARP]); @@ -184,7 +184,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move misses", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); + game.override.moveset([Moves.TACKLE]); game.override.enemyMoveset(SPLASH_ONLY); await game.startBattle([Species.MAGIKARP]); @@ -207,7 +207,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move is protected against", 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]); await game.startBattle([Species.MAGIKARP]); @@ -226,7 +226,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's move fails because of type immunity", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); + game.override.moveset([Moves.TACKLE]); game.override.enemySpecies(Species.GASTLY); await game.startBattle([Species.MAGIKARP]); @@ -245,7 +245,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if pokemon's type is the same as the move's type", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); + game.override.moveset([Moves.SPLASH]); await game.startBattle([Species.MAGIKARP]); @@ -264,7 +264,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if pokemon is terastallized", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); + game.override.moveset([Moves.SPLASH]); await game.startBattle([Species.MAGIKARP]); @@ -284,7 +284,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if pokemon uses struggle", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.STRUGGLE]); + game.override.moveset([Moves.STRUGGLE]); await game.startBattle([Species.MAGIKARP]); @@ -302,7 +302,7 @@ describe("Abilities - Protean", () => { test( "ability is not applied if the pokemon's move fails", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.BURN_UP]); + game.override.moveset([Moves.BURN_UP]); await game.startBattle([Species.MAGIKARP]); @@ -320,7 +320,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TRICK_OR_TREAT]); + game.override.moveset([Moves.TRICK_OR_TREAT]); game.override.enemySpecies(Species.GASTLY); await game.startBattle([Species.MAGIKARP]); @@ -339,7 +339,7 @@ describe("Abilities - Protean", () => { test( "ability applies correctly and the pokemon curses itself", async () => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.CURSE]); + game.override.moveset([Moves.CURSE]); await game.startBattle([Species.MAGIKARP]); diff --git a/src/test/abilities/quick_draw.test.ts b/src/test/abilities/quick_draw.test.ts index f94a8c55a6c..444b6bb2470 100644 --- a/src/test/abilities/quick_draw.test.ts +++ b/src/test/abilities/quick_draw.test.ts @@ -29,7 +29,7 @@ describe("Abilities - Quick Draw", () => { game.override.starterSpecies(Species.MAGIKARP); 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); game.override.enemySpecies(Species.MAGIKARP); diff --git a/src/test/abilities/sand_veil.test.ts b/src/test/abilities/sand_veil.test.ts index e87398e05c2..a43c554dfdd 100644 --- a/src/test/abilities/sand_veil.test.ts +++ b/src/test/abilities/sand_veil.test.ts @@ -29,7 +29,7 @@ describe("Abilities - Sand Veil", () => { beforeEach(() => { 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.enemyAbility(Abilities.INSOMNIA); game.override.enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]); diff --git a/src/test/abilities/sap_sipper.test.ts b/src/test/abilities/sap_sipper.test.ts index 4ffab7792d1..57848de61a7 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -38,7 +38,7 @@ describe("Abilities - Sap Sipper", () => { const moveToUse = Moves.LEAFAGE; 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.enemySpecies(Species.DUSKULL); game.override.enemyAbility(enemyAbility); @@ -59,7 +59,7 @@ describe("Abilities - Sap Sipper", () => { const moveToUse = Moves.SPORE; 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.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); @@ -78,7 +78,7 @@ describe("Abilities - Sap Sipper", () => { const moveToUse = Moves.GRASSY_TERRAIN; 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.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); @@ -98,7 +98,7 @@ describe("Abilities - Sap Sipper", () => { const moveToUse = Moves.BULLET_SEED; 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.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); @@ -119,7 +119,7 @@ describe("Abilities - Sap Sipper", () => { const moveToUse = Moves.SPIKY_SHIELD; const ability = Abilities.SAP_SIPPER; - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); + game.override.moveset([moveToUse]); game.override.ability(ability); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.RATTATA); @@ -145,7 +145,7 @@ describe("Abilities - Sap Sipper", () => { const moveToUse = Moves.METRONOME; 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.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); diff --git a/src/test/abilities/schooling.test.ts b/src/test/abilities/schooling.test.ts index f3e95d987f2..38d8cfd74f2 100644 --- a/src/test/abilities/schooling.test.ts +++ b/src/test/abilities/schooling.test.ts @@ -30,7 +30,7 @@ describe("Abilities - SCHOOLING", () => { const moveToUse = Moves.SPLASH; game.override.battleType("single"); 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]); }); diff --git a/src/test/abilities/screen_cleaner.test.ts b/src/test/abilities/screen_cleaner.test.ts index 04fc2e47f14..2d2dc70b907 100644 --- a/src/test/abilities/screen_cleaner.test.ts +++ b/src/test/abilities/screen_cleaner.test.ts @@ -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 { ArenaTagType } from "#app/enums/arena-tag-type.js"; 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 { 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", () => { let phaserGame: Phaser.Game; @@ -31,7 +30,7 @@ describe("Abilities - Screen Cleaner", () => { }); 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]); await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]); diff --git a/src/test/abilities/serene_grace.test.ts b/src/test/abilities/serene_grace.test.ts index f46e1bbff62..13da444454e 100644 --- a/src/test/abilities/serene_grace.test.ts +++ b/src/test/abilities/serene_grace.test.ts @@ -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 {Species} from "#enums/species"; +import { applyAbAttrs, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; +import { Stat } from "#app/data/pokemon-stat"; import { CommandPhase, MoveEffectPhase, } from "#app/phases"; -import {Mode} from "#app/ui/ui"; -import {Stat} from "#app/data/pokemon-stat"; -import {Moves} from "#enums/moves"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {Command} from "#app/ui/command-ui-handler"; +import GameManager from "#app/test/utils/gameManager"; +import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { Command } from "#app/ui/command-ui-handler"; +import { Mode } from "#app/ui/ui"; 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", () => { @@ -37,7 +36,7 @@ describe("Abilities - Serene Grace", () => { game.override.battleType("single"); game.override.enemySpecies(Species.ONIX); 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]); }); diff --git a/src/test/abilities/sheer_force.test.ts b/src/test/abilities/sheer_force.test.ts index e4df5920a04..850a2d97c9f 100644 --- a/src/test/abilities/sheer_force.test.ts +++ b/src/test/abilities/sheer_force.test.ts @@ -37,7 +37,7 @@ describe("Abilities - Sheer Force", () => { game.override.battleType("single"); game.override.enemySpecies(Species.ONIX); 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]); }); diff --git a/src/test/abilities/shield_dust.test.ts b/src/test/abilities/shield_dust.test.ts index a9d5dbe3209..35e4015e8bc 100644 --- a/src/test/abilities/shield_dust.test.ts +++ b/src/test/abilities/shield_dust.test.ts @@ -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 {Species} from "#enums/species"; +import { applyAbAttrs, applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; +import { Stat } from "#app/data/pokemon-stat"; import { CommandPhase, MoveEffectPhase, } from "#app/phases"; -import {Mode} from "#app/ui/ui"; -import {Stat} from "#app/data/pokemon-stat"; -import {Moves} from "#enums/moves"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {Command} from "#app/ui/command-ui-handler"; +import GameManager from "#app/test/utils/gameManager"; +import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { Command } from "#app/ui/command-ui-handler"; +import { Mode } from "#app/ui/ui"; 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", () => { @@ -38,7 +37,7 @@ describe("Abilities - Shield Dust", () => { game.override.enemySpecies(Species.ONIX); game.override.enemyAbility(Abilities.SHIELD_DUST); 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]); }); diff --git a/src/test/abilities/shields_down.test.ts b/src/test/abilities/shields_down.test.ts index 4b3b49d0ff0..1b5582d44a7 100644 --- a/src/test/abilities/shields_down.test.ts +++ b/src/test/abilities/shields_down.test.ts @@ -30,7 +30,7 @@ describe("Abilities - SHIELDS DOWN", () => { const moveToUse = Moves.SPLASH; game.override.battleType("single"); 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]); }); diff --git a/src/test/abilities/steely_spirit.test.ts b/src/test/abilities/steely_spirit.test.ts index 3b276b6ad4a..7ac78eb11fa 100644 --- a/src/test/abilities/steely_spirit.test.ts +++ b/src/test/abilities/steely_spirit.test.ts @@ -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 { allMoves } from "#app/data/move.js"; import { Abilities } from "#app/enums/abilities.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"; describe("Abilities - Steely Spirit", () => { @@ -33,7 +32,7 @@ describe("Abilities - Steely Spirit", () => { game.override.battleType("double"); game.override.enemySpecies(Species.SHUCKLE); 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); vi.spyOn(allMoves[moveToCheck], "calculateBattlePower"); }); diff --git a/src/test/abilities/sturdy.test.ts b/src/test/abilities/sturdy.test.ts index 34f7c16d542..33c3de2fb28 100644 --- a/src/test/abilities/sturdy.test.ts +++ b/src/test/abilities/sturdy.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Sturdy", () => { game.override.starterSpecies(Species.LUCARIO); 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); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5); diff --git a/src/test/abilities/unseen_fist.test.ts b/src/test/abilities/unseen_fist.test.ts index f955f7c4ed4..715236025be 100644 --- a/src/test/abilities/unseen_fist.test.ts +++ b/src/test/abilities/unseen_fist.test.ts @@ -68,7 +68,7 @@ describe("Abilities - Unseen Fist", () => { }); async function testUnseenFistHitResult(game: GameManager, attackMove: Moves, protectMove: Moves, shouldSucceed: boolean = true): Promise { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([attackMove]); + game.override.moveset([attackMove]); game.override.enemyMoveset([protectMove, protectMove, protectMove, protectMove]); await game.startBattle(); diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index 32e96c91fd0..b1bf638fc77 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -37,7 +37,7 @@ describe("Abilities - Volt Absorb", () => { const moveToUse = Moves.CHARGE; const ability = Abilities.VOLT_ABSORB; - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); + game.override.moveset([moveToUse]); game.override.ability(ability); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.DUSKULL); diff --git a/src/test/abilities/wind_power.test.ts b/src/test/abilities/wind_power.test.ts index 36109f81c33..cfdb2e745fe 100644 --- a/src/test/abilities/wind_power.test.ts +++ b/src/test/abilities/wind_power.test.ts @@ -1,15 +1,14 @@ -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 { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { TurnEndPhase, } from "#app/phases"; -import { Moves } from "#enums/moves"; +import GameManager from "#app/test/utils/gameManager"; import { getMovePosition } from "#app/test/utils/gameManagerUtils"; 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"; describe("Abilities - Wind Power", () => { @@ -31,7 +30,7 @@ describe("Abilities - Wind Power", () => { game.override.battleType("single"); game.override.enemySpecies(Species.SHIFTRY); 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); }); diff --git a/src/test/abilities/wind_rider.test.ts b/src/test/abilities/wind_rider.test.ts index a3d1ae44d44..88da929fbf1 100644 --- a/src/test/abilities/wind_rider.test.ts +++ b/src/test/abilities/wind_rider.test.ts @@ -1,15 +1,14 @@ -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 { BattleStat } from "#app/data/battle-stat.js"; import { TurnEndPhase, } from "#app/phases"; -import { Moves } from "#enums/moves"; +import GameManager from "#app/test/utils/gameManager"; import { getMovePosition } from "#app/test/utils/gameManagerUtils"; 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"; describe("Abilities - Wind Rider", () => { @@ -31,7 +30,7 @@ describe("Abilities - Wind Rider", () => { game.override.battleType("single"); game.override.enemySpecies(Species.SHIFTRY); 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); }); diff --git a/src/test/abilities/wonder_skin.test.ts b/src/test/abilities/wonder_skin.test.ts index c62a4eaed66..bc964134e45 100644 --- a/src/test/abilities/wonder_skin.test.ts +++ b/src/test/abilities/wonder_skin.test.ts @@ -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 { allAbilities } from "#app/data/ability.js"; +import { allMoves } from "#app/data/move.js"; 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 { Abilities } from "#enums/abilities"; -import { allMoves } from "#app/data/move.js"; -import { allAbilities } from "#app/data/ability.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"; describe("Abilities - Wonder Skin", () => { @@ -28,7 +27,7 @@ describe("Abilities - Wonder Skin", () => { beforeEach(() => { game = new GameManager(phaserGame); 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.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.WONDER_SKIN); diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index b620431d288..dfb96c7d336 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -48,7 +48,7 @@ describe("Abilities - ZEN MODE", () => { game.override.enemyAbility(Abilities.HYDRATION); game.override.ability(Abilities.ZEN_MODE); 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]); }); diff --git a/src/test/abilities/zero_to_hero.test.ts b/src/test/abilities/zero_to_hero.test.ts index cb930382592..29e07078dfc 100644 --- a/src/test/abilities/zero_to_hero.test.ts +++ b/src/test/abilities/zero_to_hero.test.ts @@ -30,7 +30,7 @@ describe("Abilities - ZERO TO HERO", () => { const moveToUse = Moves.SPLASH; game.override.battleType("single"); 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]); }); diff --git a/src/test/achievements/achievement.test.ts b/src/test/achievements/achievement.test.ts index 57c18c43708..83d24d1f0ee 100644 --- a/src/test/achievements/achievement.test.ts +++ b/src/test/achievements/achievement.test.ts @@ -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 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 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", () => { it ("should check Achievement creation", () => { @@ -103,8 +102,8 @@ describe("RibbonAchv", () => { }); beforeEach(() => { - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([]); game = new GameManager(phaserGame); + game.override.moveset([]); game.override.startingLevel(0); game.override.starterSpecies(0); game.override.enemyMoveset([]); diff --git a/src/test/arena/arena_gravity.test.ts b/src/test/arena/arena_gravity.test.ts index 916a4542924..b96b3940245 100644 --- a/src/test/arena/arena_gravity.test.ts +++ b/src/test/arena/arena_gravity.test.ts @@ -30,7 +30,7 @@ describe("Arena - Gravity", () => { beforeEach(() => { game = new GameManager(phaserGame); 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.enemyAbility(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); diff --git a/src/test/arena/weather_fog.test.ts b/src/test/arena/weather_fog.test.ts index e0dcf8450d1..9b0630f5c2b 100644 --- a/src/test/arena/weather_fog.test.ts +++ b/src/test/arena/weather_fog.test.ts @@ -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 { WeatherType } from "#app/data/weather.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", () => { let phaserGame: Phaser.Game; @@ -31,7 +30,7 @@ describe("Weather - Fog", () => { game.override .weather(WeatherType.FOG) .battleType("single"); - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); + game.override.moveset([Moves.TACKLE]); game.override.ability(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemySpecies(Species.MAGIKARP); diff --git a/src/test/arena/weather_strong_winds.test.ts b/src/test/arena/weather_strong_winds.test.ts index cc85d7a0866..6c977401f20 100644 --- a/src/test/arena/weather_strong_winds.test.ts +++ b/src/test/arena/weather_strong_winds.test.ts @@ -1,15 +1,14 @@ -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 { allMoves } from "#app/data/move.js"; import { TurnStartPhase, } from "#app/phases"; -import { Moves } from "#enums/moves"; +import GameManager from "#app/test/utils/gameManager"; import { getMovePosition } from "#app/test/utils/gameManagerUtils"; 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", () => { let phaserGame: Phaser.Game; @@ -31,7 +30,7 @@ describe("Weather - Strong Winds", () => { game.override.startingLevel(10); game.override.enemySpecies(Species.TAILLOW); 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 () => { diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 77368d74d32..14ff1bcec0d 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -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 { Stat } from "#app/data/pokemon-stat"; import { CommandPhase, EnemyCommandPhase, SelectTargetPhase, TurnStartPhase } from "#app/phases"; -import {Mode} from "#app/ui/ui"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {Command} from "#app/ui/command-ui-handler"; -import {Stat} from "#app/data/pokemon-stat"; +import GameManager from "#app/test/utils/gameManager"; +import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { Command } from "#app/ui/command-ui-handler"; import TargetSelectUiHandler from "#app/ui/target-select-ui-handler"; +import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; +import { Button } from "#enums/buttons"; import { Moves } from "#enums/moves"; 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", () => { @@ -37,7 +36,7 @@ describe("Battle order", () => { game.override.enemySpecies(Species.MEWTWO); game.override.enemyAbility(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() => { diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index 2eba8f3d93e..a91cd1e8352 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -1,9 +1,6 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; -import {generateStarter, getMovePosition,} from "#app/test/utils/gameManagerUtils"; -import {Mode} from "#app/ui/ui"; -import {GameModes} from "#app/game-mode"; -import Overrides from "#app/overrides"; -import {Command} from "#app/ui/command-ui-handler"; +import { allSpecies } from "#app/data/pokemon-species"; +import { GameModes } from "#app/game-mode"; +import { getGameMode } from "#app/game-mode.js"; import { CommandPhase, DamagePhase, EncounterPhase, @@ -17,13 +14,15 @@ import { TurnInitPhase, VictoryPhase, } from "#app/phases"; import GameManager from "#app/test/utils/gameManager"; -import Phaser from "phaser"; -import {allSpecies} from "#app/data/pokemon-species"; -import { getGameMode } from "#app/game-mode.js"; +import { generateStarter, getMovePosition, } from "#app/test/utils/gameManagerUtils"; +import { Command } from "#app/ui/command-ui-handler"; +import { Mode } from "#app/ui/ui"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { PlayerGender } from "#enums/player-gender"; import { Species } from "#enums/species"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; @@ -96,7 +95,7 @@ describe("Test Battle Phase", () => { game.override .startingWave(3) .battleType("single"); - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); + game.override.moveset([Moves.TACKLE]); game.override.enemyAbility(Abilities.HYDRATION); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); await game.startBattle(); @@ -115,7 +114,7 @@ describe("Test Battle Phase", () => { game.override.enemySpecies(Species.RATTATA); game.override.startingLevel(5); 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.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]); game.override.battleType("single"); @@ -268,7 +267,7 @@ describe("Test Battle Phase", () => { game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(2000); 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]); await game.startBattle([ Species.DARMANITAN, @@ -297,7 +296,7 @@ describe("Test Battle Phase", () => { game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(2000); 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]); await game.startBattle(); const turn = game.scene.currentBattle.turn; @@ -315,7 +314,7 @@ describe("Test Battle Phase", () => { game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(2000); 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]); await game.startBattle(); const waveIndex = game.scene.currentBattle.waveIndex; diff --git a/src/test/battle/error-handling.test.ts b/src/test/battle/error-handling.test.ts index 6998972cd35..a823887b4f8 100644 --- a/src/test/battle/error-handling.test.ts +++ b/src/test/battle/error-handling.test.ts @@ -1,10 +1,9 @@ -import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import GameManager from "#app/test/utils/gameManager"; -import Phaser from "phaser"; -import Overrides from "#app/overrides"; 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("Test Battle Phase", () => { let phaserGame: Phaser.Game; @@ -31,7 +30,7 @@ describe("Test Battle Phase", () => { game.override.enemyAbility(Abilities.HYDRATION); game.override.ability(Abilities.ZEN_MODE); 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]); }); diff --git a/src/test/battle/special_battle.test.ts b/src/test/battle/special_battle.test.ts index 1d6ce09e70c..e4243ea1418 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -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 { CommandPhase, } from "#app/phases"; import GameManager from "#app/test/utils/gameManager"; -import Phaser from "phaser"; +import { Mode } from "#app/ui/ui"; 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("Test Battle Phase", () => { let phaserGame: Phaser.Game; @@ -28,7 +27,7 @@ describe("Test Battle Phase", () => { game = new GameManager(phaserGame); game.override.enemySpecies(Species.RATTATA); 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.ability(Abilities.HYDRATION); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); diff --git a/src/test/items/grip_claw.test.ts b/src/test/items/grip_claw.test.ts index 951e34fae2c..edd9c34655c 100644 --- a/src/test/items/grip_claw.test.ts +++ b/src/test/items/grip_claw.test.ts @@ -31,7 +31,7 @@ describe("Items - Grip Claw", () => { game = new GameManager(phaserGame); 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}]); game.override.enemySpecies(Species.SNORLAX); game.override.ability(Abilities.KLUTZ); diff --git a/src/test/items/leek.test.ts b/src/test/items/leek.test.ts index e03caec36d9..5dfd75d6cb5 100644 --- a/src/test/items/leek.test.ts +++ b/src/test/items/leek.test.ts @@ -36,7 +36,7 @@ describe("Items - Leek", () => { it("LEEK activates in battle correctly", async() => { 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"); await game.startBattle([ Species.FARFETCHD diff --git a/src/test/items/leftovers.test.ts b/src/test/items/leftovers.test.ts index ee2ead08234..7c89e1e299d 100644 --- a/src/test/items/leftovers.test.ts +++ b/src/test/items/leftovers.test.ts @@ -28,7 +28,7 @@ describe("Items - Leftovers", () => { game.override.battleType("single"); vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); 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.enemyAbility(Abilities.UNNERVE); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); diff --git a/src/test/items/scope_lens.test.ts b/src/test/items/scope_lens.test.ts index 4ddb4177cd9..d0e556fab79 100644 --- a/src/test/items/scope_lens.test.ts +++ b/src/test/items/scope_lens.test.ts @@ -36,7 +36,7 @@ describe("Items - Scope Lens", () => { it("SCOPE_LENS activates in battle correctly", async() => { 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"); await game.startBattle([ Species.GASTLY diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index f5ef6a62c60..bdef05fec2f 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -41,7 +41,7 @@ describe("Items - Toxic orb", () => { game.override.ability(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(2000); - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); + game.override.moveset([moveToUse]); game.override.enemyMoveset([oppMoveToUse, oppMoveToUse, oppMoveToUse, oppMoveToUse]); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "TOXIC_ORB", diff --git a/src/test/moves/astonish.test.ts b/src/test/moves/astonish.test.ts index ac5ef3fde76..66bed1e5333 100644 --- a/src/test/moves/astonish.test.ts +++ b/src/test/moves/astonish.test.ts @@ -29,7 +29,7 @@ describe("Moves - Astonish", () => { beforeEach(() => { game = new GameManager(phaserGame); 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.enemyAbility(Abilities.INSOMNIA); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); diff --git a/src/test/moves/aurora_veil.test.ts b/src/test/moves/aurora_veil.test.ts index 5ca56c4d243..4f5022db4ae 100644 --- a/src/test/moves/aurora_veil.test.ts +++ b/src/test/moves/aurora_veil.test.ts @@ -37,7 +37,7 @@ describe("Moves - Aurora Veil", () => { game = new GameManager(phaserGame); game.override.battleType("single"); 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); game.override.enemySpecies(Species.MAGIKARP); game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]); diff --git a/src/test/moves/ceaseless_edge.test.ts b/src/test/moves/ceaseless_edge.test.ts index dafa1be3049..5998f67549c 100644 --- a/src/test/moves/ceaseless_edge.test.ts +++ b/src/test/moves/ceaseless_edge.test.ts @@ -38,7 +38,7 @@ describe("Moves - Ceaseless Edge", () => { vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.RUN_AWAY); game.override.startingLevel(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]); vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100); diff --git a/src/test/moves/double_team.test.ts b/src/test/moves/double_team.test.ts index 637f0f39fc6..2c42e1651ba 100644 --- a/src/test/moves/double_team.test.ts +++ b/src/test/moves/double_team.test.ts @@ -28,7 +28,7 @@ describe("Moves - Double Team", () => { beforeEach(() => { game = new GameManager(phaserGame); 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); game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); diff --git a/src/test/moves/dragon_rage.test.ts b/src/test/moves/dragon_rage.test.ts index a1e8a18540e..330b8ab22a4 100644 --- a/src/test/moves/dragon_rage.test.ts +++ b/src/test/moves/dragon_rage.test.ts @@ -39,7 +39,7 @@ describe("Moves - Dragon Rage", () => { vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); 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); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); game.override.startingLevel(100); diff --git a/src/test/moves/dynamax_cannon.test.ts b/src/test/moves/dynamax_cannon.test.ts index 88251b74115..3e1ba2f609e 100644 --- a/src/test/moves/dynamax_cannon.test.ts +++ b/src/test/moves/dynamax_cannon.test.ts @@ -28,7 +28,7 @@ describe("Moves - Dynamax Cannon", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ dynamaxCannon.id ]); + game.override.moveset([ dynamaxCannon.id ]); game.override.startingLevel(200); // Note that, for Waves 1-10, the level cap is 10 diff --git a/src/test/moves/fissure.test.ts b/src/test/moves/fissure.test.ts index f67b275a8ba..cfc5c2b76f7 100644 --- a/src/test/moves/fissure.test.ts +++ b/src/test/moves/fissure.test.ts @@ -34,7 +34,7 @@ describe("Moves - Fissure", () => { vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); 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); game.override.startingLevel(100); diff --git a/src/test/moves/flower_shield.test.ts b/src/test/moves/flower_shield.test.ts index 95a2736aa32..fb6708726e5 100644 --- a/src/test/moves/flower_shield.test.ts +++ b/src/test/moves/flower_shield.test.ts @@ -34,7 +34,7 @@ describe("Moves - Flower Shield", () => { game.override.ability(Abilities.NONE); game.override.enemyAbility(Abilities.NONE); 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); }); diff --git a/src/test/moves/follow_me.test.ts b/src/test/moves/follow_me.test.ts index bdc09605c0c..5ee4ee02ba2 100644 --- a/src/test/moves/follow_me.test.ts +++ b/src/test/moves/follow_me.test.ts @@ -37,7 +37,7 @@ describe("Moves - Follow Me", () => { game.override.enemySpecies(Species.SNORLAX); game.override.startingLevel(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]); }); @@ -102,7 +102,7 @@ describe("Moves - Follow Me", () => { "move effect should be bypassed by Stalwart", async () => { 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 ]); await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]); @@ -136,7 +136,7 @@ describe("Moves - Follow Me", () => { test( "move effect should be bypassed by Snipe Shot", 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 ]); await game.startBattle([ Species.AMOONGUSS, Species.CHARIZARD ]); diff --git a/src/test/moves/gastro_acid.test.ts b/src/test/moves/gastro_acid.test.ts index 161eab37183..35bb345c756 100644 --- a/src/test/moves/gastro_acid.test.ts +++ b/src/test/moves/gastro_acid.test.ts @@ -34,7 +34,7 @@ describe("Moves - Gastro Acid", () => { game.override.startingLevel(1); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); 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.enemyMoveset(SPLASH_ONLY); game.override.enemyAbility(Abilities.WATER_ABSORB); diff --git a/src/test/moves/glaive_rush.test.ts b/src/test/moves/glaive_rush.test.ts index 15e81b489d6..42265568cc6 100644 --- a/src/test/moves/glaive_rush.test.ts +++ b/src/test/moves/glaive_rush.test.ts @@ -34,7 +34,7 @@ describe("Moves - Glaive Rush", () => { game.override.starterSpecies(Species.KLINK); game.override.ability(Abilities.UNNERVE); 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() => { diff --git a/src/test/moves/growth.test.ts b/src/test/moves/growth.test.ts index 6b9abd8da59..3d4a37fda73 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -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 { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#app/data/pokemon-stat"; import { CommandPhase, EnemyCommandPhase, TurnInitPhase, } from "#app/phases"; -import {Mode} from "#app/ui/ui"; -import {Stat} from "#app/data/pokemon-stat"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {Command} from "#app/ui/command-ui-handler"; -import {BattleStat} from "#app/data/battle-stat"; +import GameManager from "#app/test/utils/gameManager"; +import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { Command } from "#app/ui/command-ui-handler"; +import { Mode } from "#app/ui/ui"; 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("Moves - Growth", () => { @@ -39,7 +38,7 @@ describe("Moves - Growth", () => { game.override.enemyAbility(Abilities.MOXIE); game.override.ability(Abilities.INSOMNIA); 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]); }); diff --git a/src/test/moves/hard_press.test.ts b/src/test/moves/hard_press.test.ts index 27c4af71004..89f8e14169f 100644 --- a/src/test/moves/hard_press.test.ts +++ b/src/test/moves/hard_press.test.ts @@ -1,15 +1,14 @@ -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 { allMoves } from "#app/data/move.js"; 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 { 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"; describe("Moves - Hard Press", () => { @@ -35,7 +34,7 @@ describe("Moves - Hard Press", () => { game.override.enemySpecies(Species.MUNCHLAX); game.override.enemyAbility(Abilities.BALL_FETCH); 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"); }); diff --git a/src/test/moves/hyper_beam.test.ts b/src/test/moves/hyper_beam.test.ts index b6c6c08f089..4cd9d0600a8 100644 --- a/src/test/moves/hyper_beam.test.ts +++ b/src/test/moves/hyper_beam.test.ts @@ -35,7 +35,7 @@ describe("Moves - Hyper Beam", () => { game.override.enemyAbility(Abilities.BALL_FETCH); 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); }); diff --git a/src/test/moves/light_screen.test.ts b/src/test/moves/light_screen.test.ts index c8543c2faed..d06e0b7804f 100644 --- a/src/test/moves/light_screen.test.ts +++ b/src/test/moves/light_screen.test.ts @@ -36,7 +36,7 @@ describe("Moves - Light Screen", () => { game = new GameManager(phaserGame); game.override.battleType("single"); 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); game.override.enemySpecies(Species.MAGIKARP); game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]); diff --git a/src/test/moves/magnet_rise.test.ts b/src/test/moves/magnet_rise.test.ts index a321499d11f..de87ae81a79 100644 --- a/src/test/moves/magnet_rise.test.ts +++ b/src/test/moves/magnet_rise.test.ts @@ -29,7 +29,7 @@ describe("Moves - Magnet Rise", () => { 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, "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 () => { diff --git a/src/test/moves/make_it_rain.test.ts b/src/test/moves/make_it_rain.test.ts index ca207a63c3f..7d431b60a27 100644 --- a/src/test/moves/make_it_rain.test.ts +++ b/src/test/moves/make_it_rain.test.ts @@ -33,7 +33,7 @@ describe("Moves - Make It Rain", () => { beforeEach(() => { game = new GameManager(phaserGame); 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.enemyAbility(Abilities.INSOMNIA); game.override.enemyMoveset(SPLASH_ONLY); diff --git a/src/test/moves/multi_target.test.ts b/src/test/moves/multi_target.test.ts index f60429909db..229732fe0ac 100644 --- a/src/test/moves/multi_target.test.ts +++ b/src/test/moves/multi_target.test.ts @@ -166,7 +166,7 @@ function leaveOneEnemyPokemon(game: GameManager) { function beforeTrial(phaserGame: Phaser.Game, single: boolean = false) { const game = new GameManager(phaserGame); 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.enemyMoveset(SPLASH_ONLY); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); diff --git a/src/test/moves/octolock.test.ts b/src/test/moves/octolock.test.ts index 061aaff5d48..6d5f404d2f4 100644 --- a/src/test/moves/octolock.test.ts +++ b/src/test/moves/octolock.test.ts @@ -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 { BattleStat } from "#app/data/battle-stat"; +import { TrappedTag } from "#app/data/battler-tags.js"; import { CommandPhase, MoveEndPhase, TurnInitPhase } from "#app/phases"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {BattleStat} from "#app/data/battle-stat"; +import GameManager from "#app/test/utils/gameManager"; +import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; 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"; describe("Moves - Octolock", () => { @@ -36,7 +35,7 @@ describe("Moves - Octolock", () => { game.override.enemyAbility(Abilities.NONE); 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); }); diff --git a/src/test/moves/purify.test.ts b/src/test/moves/purify.test.ts index 0a5419f7288..513f3f891ee 100644 --- a/src/test/moves/purify.test.ts +++ b/src/test/moves/purify.test.ts @@ -33,7 +33,7 @@ describe("Moves - Purify", () => { game.override.starterSpecies(Species.PYUKUMUKU); 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); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(10); diff --git a/src/test/moves/rage_powder.test.ts b/src/test/moves/rage_powder.test.ts index 768d3580026..60c0897c102 100644 --- a/src/test/moves/rage_powder.test.ts +++ b/src/test/moves/rage_powder.test.ts @@ -36,7 +36,7 @@ describe("Moves - Rage Powder", () => { game.override.enemySpecies(Species.SNORLAX); game.override.startingLevel(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]); }); diff --git a/src/test/moves/reflect.test.ts b/src/test/moves/reflect.test.ts index 35f9599c5f7..3ee78d3d6d1 100644 --- a/src/test/moves/reflect.test.ts +++ b/src/test/moves/reflect.test.ts @@ -36,7 +36,7 @@ describe("Moves - Reflect", () => { game = new GameManager(phaserGame); game.override.battleType("single"); 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); game.override.enemySpecies(Species.MAGIKARP); game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]); diff --git a/src/test/moves/rollout.test.ts b/src/test/moves/rollout.test.ts index 90a3fe065d8..d2520c91180 100644 --- a/src/test/moves/rollout.test.ts +++ b/src/test/moves/rollout.test.ts @@ -38,7 +38,7 @@ describe("Moves - Rollout", () => { }); 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 const variance = 5; diff --git a/src/test/moves/roost.test.ts b/src/test/moves/roost.test.ts index e29056ff443..3802cdbb6ee 100644 --- a/src/test/moves/roost.test.ts +++ b/src/test/moves/roost.test.ts @@ -32,7 +32,7 @@ describe("Moves - Roost", () => { game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(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]); }); diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index 4240c06d10a..b2f711d406a 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -35,7 +35,7 @@ describe("Moves - Spikes", () => { vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); game.override.startingWave(3); 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() => { diff --git a/src/test/moves/spit_up.test.ts b/src/test/moves/spit_up.test.ts index 4b58e9f73a0..9eb114847d2 100644 --- a/src/test/moves/spit_up.test.ts +++ b/src/test/moves/spit_up.test.ts @@ -35,7 +35,7 @@ describe("Moves - Spit Up", () => { game.override.enemyAbility(Abilities.NONE); 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); }); diff --git a/src/test/moves/spotlight.test.ts b/src/test/moves/spotlight.test.ts index 5790214ceb1..63b66008235 100644 --- a/src/test/moves/spotlight.test.ts +++ b/src/test/moves/spotlight.test.ts @@ -36,7 +36,7 @@ describe("Moves - Spotlight", () => { game.override.enemySpecies(Species.SNORLAX); game.override.startingLevel(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]); }); diff --git a/src/test/moves/stockpile.test.ts b/src/test/moves/stockpile.test.ts index 760bbdf7381..30e2bb9d642 100644 --- a/src/test/moves/stockpile.test.ts +++ b/src/test/moves/stockpile.test.ts @@ -35,7 +35,7 @@ describe("Moves - Stockpile", () => { game.override.enemyAbility(Abilities.NONE); 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); }); diff --git a/src/test/moves/swallow.test.ts b/src/test/moves/swallow.test.ts index 70826c02c5d..05ea6678d05 100644 --- a/src/test/moves/swallow.test.ts +++ b/src/test/moves/swallow.test.ts @@ -34,7 +34,7 @@ describe("Moves - Swallow", () => { game.override.enemyAbility(Abilities.NONE); 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); }); diff --git a/src/test/moves/tackle.test.ts b/src/test/moves/tackle.test.ts index 7f58aa8e23b..e58b5d48c8f 100644 --- a/src/test/moves/tackle.test.ts +++ b/src/test/moves/tackle.test.ts @@ -35,7 +35,7 @@ describe("Moves - Tackle", () => { game.override.enemySpecies(Species.MAGIKARP); game.override.startingLevel(1); 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]); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); }); diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index be1e8614c86..539829f4003 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -1,19 +1,18 @@ -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 { BattleStat } from "#app/data/battle-stat"; import { CommandPhase, EnemyCommandPhase, TurnInitPhase, } from "#app/phases"; -import {Mode} from "#app/ui/ui"; -import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {Command} from "#app/ui/command-ui-handler"; -import {BattleStat} from "#app/data/battle-stat"; +import GameManager from "#app/test/utils/gameManager"; +import { getMovePosition } from "#app/test/utils/gameManagerUtils"; +import { Command } from "#app/ui/command-ui-handler"; +import { Mode } from "#app/ui/ui"; 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("Moves - Tail whip", () => { @@ -38,7 +37,7 @@ describe("Moves - Tail whip", () => { game.override.enemyAbility(Abilities.INSOMNIA); game.override.ability(Abilities.INSOMNIA); 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]); }); diff --git a/src/test/moves/tailwind.test.ts b/src/test/moves/tailwind.test.ts index 02924d429f3..d2a90dd2ed5 100644 --- a/src/test/moves/tailwind.test.ts +++ b/src/test/moves/tailwind.test.ts @@ -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 { ArenaTagSide } from "#app/data/arena-tag.js"; +import { Stat } from "#app/data/pokemon-stat.js"; +import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { TurnEndPhase, } from "#app/phases"; -import { Moves } from "#enums/moves"; +import GameManager from "#app/test/utils/gameManager"; import { getMovePosition } from "#app/test/utils/gameManagerUtils"; -import { Stat } from "#app/data/pokemon-stat.js"; -import { ArenaTagType } from "#app/enums/arena-tag-type.js"; -import { ArenaTagSide } from "#app/data/arena-tag.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"; describe("Abilities - Wind Rider", () => { @@ -30,7 +29,7 @@ describe("Abilities - Wind Rider", () => { beforeEach(() => { game = new GameManager(phaserGame); 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); }); diff --git a/src/test/moves/thousand_arrows.test.ts b/src/test/moves/thousand_arrows.test.ts index e0121c6ece2..f4a9db08b8e 100644 --- a/src/test/moves/thousand_arrows.test.ts +++ b/src/test/moves/thousand_arrows.test.ts @@ -34,7 +34,7 @@ describe("Moves - Thousand Arrows", () => { game.override.enemySpecies(Species.TOGETIC); game.override.startingLevel(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]); }); diff --git a/src/test/moves/tidy_up.test.ts b/src/test/moves/tidy_up.test.ts index 0fd17baac60..b1292de0d27 100644 --- a/src/test/moves/tidy_up.test.ts +++ b/src/test/moves/tidy_up.test.ts @@ -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 { BattleStat } from "#app/data/battle-stat.js"; +import { ArenaTagType } from "#app/enums/arena-tag-type.js"; 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 { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { getMovePosition } from "#app/test/utils/gameManagerUtils"; -import { ArenaTagType } from "#app/enums/arena-tag-type.js"; -import { BattleStat } from "#app/data/battle-stat.js"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { SPLASH_ONLY } from "../utils/testUtils"; @@ -34,12 +33,12 @@ describe("Moves - Tidy Up", () => { game.override.enemyMoveset(SPLASH_ONLY); game.override.starterSpecies(Species.FEEBAS); 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); }); 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]); await game.startBattle(); @@ -52,7 +51,7 @@ describe("Moves - Tidy Up", () => { }, 20000); 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]); await game.startBattle(); @@ -65,7 +64,7 @@ describe("Moves - Tidy Up", () => { }, 20000); 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]); await game.startBattle(); @@ -78,7 +77,7 @@ describe("Moves - Tidy Up", () => { }, 20000); 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]); await game.startBattle(); @@ -92,7 +91,7 @@ describe("Moves - Tidy Up", () => { }, 20000); 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]); await game.startBattle(); diff --git a/src/test/ui/transfer-item.test.ts b/src/test/ui/transfer-item.test.ts index 9007b1dabe2..3a787fa462d 100644 --- a/src/test/ui/transfer-item.test.ts +++ b/src/test/ui/transfer-item.test.ts @@ -41,7 +41,7 @@ describe("UI - Transfer Items", () => { { name: "BERRY", count: 2, type: BerryType.APICOT }, { 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.enemyMoveset([Moves.SPLASH]);