From c7a3ae24ac5397aca97e01d23ed19cef81009591 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 15:35:20 -0700 Subject: [PATCH] apply game.override.ability --- src/test/abilities/ability_timing.test.ts | 2 +- src/test/abilities/aura_break.test.ts | 4 ++-- src/test/abilities/battle_bond.test.ts | 2 +- src/test/abilities/costar.test.ts | 2 +- src/test/abilities/disguise.test.ts | 2 +- src/test/abilities/dry_skin.test.ts | 2 +- src/test/abilities/ice_face.test.ts | 2 +- src/test/abilities/intimidate.test.ts | 2 +- src/test/abilities/intrepid_sword.test.ts | 15 +++++++-------- src/test/abilities/libero.test.ts | 2 +- src/test/abilities/moxie.test.ts | 2 +- src/test/abilities/parental_bond.test.ts | 2 +- src/test/abilities/power_construct.test.ts | 2 +- src/test/abilities/protean.test.ts | 2 +- src/test/abilities/quick_draw.test.ts | 2 +- src/test/abilities/sap_sipper.test.ts | 2 +- src/test/abilities/schooling.test.ts | 2 +- src/test/abilities/screen_cleaner.test.ts | 2 +- src/test/abilities/serene_grace.test.ts | 2 +- src/test/abilities/sheer_force.test.ts | 8 ++++---- src/test/abilities/shields_down.test.ts | 2 +- src/test/abilities/sturdy.test.ts | 2 +- src/test/abilities/volt_absorb.test.ts | 2 +- src/test/abilities/wind_power.test.ts | 4 ++-- src/test/abilities/wind_rider.test.ts | 4 ++-- src/test/abilities/wonder_skin.test.ts | 4 ++-- src/test/abilities/zen_mode.test.ts | 2 +- src/test/abilities/zero_to_hero.test.ts | 2 +- src/test/arena/arena_gravity.test.ts | 2 +- src/test/arena/weather_fog.test.ts | 2 +- src/test/battle/battle-order.test.ts | 2 +- src/test/battle/battle.test.ts | 14 +++++++------- src/test/battle/error-handling.test.ts | 2 +- src/test/battle/special_battle.test.ts | 2 +- src/test/items/exp_booster.test.ts | 2 +- src/test/items/grip_claw.test.ts | 2 +- src/test/items/toxic_orb.test.ts | 2 +- src/test/moves/aurora_veil.test.ts | 2 +- src/test/moves/double_team.test.ts | 2 +- src/test/moves/dragon_rage.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 | 2 +- src/test/moves/gastro_acid.test.ts | 2 +- src/test/moves/glaive_rush.test.ts | 2 +- src/test/moves/growth.test.ts | 2 +- src/test/moves/hard_press.test.ts | 2 +- src/test/moves/light_screen.test.ts | 2 +- src/test/moves/multi_target.test.ts | 2 +- src/test/moves/octolock.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/spikes.test.ts | 2 +- src/test/moves/tail_whip.test.ts | 2 +- src/test/moves/tidy_up.test.ts | 2 +- 56 files changed, 75 insertions(+), 76 deletions(-) diff --git a/src/test/abilities/ability_timing.test.ts b/src/test/abilities/ability_timing.test.ts index fb075594677..b3f6c37b15c 100644 --- a/src/test/abilities/ability_timing.test.ts +++ b/src/test/abilities/ability_timing.test.ts @@ -33,7 +33,7 @@ describe("Ability Timing", () => { game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyMoveset(SPLASH_ONLY); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.ICE_BEAM]); }); diff --git a/src/test/abilities/aura_break.test.ts b/src/test/abilities/aura_break.test.ts index ab4aa462bb4..20c15f679e8 100644 --- a/src/test/abilities/aura_break.test.ts +++ b/src/test/abilities/aura_break.test.ts @@ -39,7 +39,7 @@ describe("Abilities - Aura Break", () => { const moveToCheck = allMoves[Moves.MOONBLAST]; const basePower = moveToCheck.power; - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FAIRY_AURA); + game.override.ability(Abilities.FAIRY_AURA); vi.spyOn(moveToCheck, "calculateBattlePower"); await game.startBattle([Species.PIKACHU]); @@ -53,7 +53,7 @@ describe("Abilities - Aura Break", () => { const moveToCheck = allMoves[Moves.DARK_PULSE]; const basePower = moveToCheck.power; - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.DARK_AURA); + game.override.ability(Abilities.DARK_AURA); vi.spyOn(moveToCheck, "calculateBattlePower"); await game.startBattle([Species.PIKACHU]); diff --git a/src/test/abilities/battle_bond.test.ts b/src/test/abilities/battle_bond.test.ts index 4dad547f8c4..094bdc9dd53 100644 --- a/src/test/abilities/battle_bond.test.ts +++ b/src/test/abilities/battle_bond.test.ts @@ -29,7 +29,7 @@ describe("Abilities - BATTLE BOND", () => { game = new GameManager(phaserGame); const moveToUse = Moves.SPLASH; game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BATTLE_BOND); + game.override.ability(Abilities.BATTLE_BOND); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 63f4e634800..566f982fc08 100644 --- a/src/test/abilities/costar.test.ts +++ b/src/test/abilities/costar.test.ts @@ -29,7 +29,7 @@ describe("Abilities - COSTAR", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("double"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.COSTAR); + game.override.ability(Abilities.COSTAR); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 04071e20538..fd486f89c69 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -29,7 +29,7 @@ describe("Abilities - DISGUISE", () => { game = new GameManager(phaserGame); const moveToUse = Moves.SPLASH; game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.DISGUISE); + game.override.ability(Abilities.DISGUISE); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 dfe358d6628..9cb92710285 100644 --- a/src/test/abilities/dry_skin.test.ts +++ b/src/test/abilities/dry_skin.test.ts @@ -30,7 +30,7 @@ describe("Abilities - Dry Skin", () => { game.override.enemyAbility(Abilities.DRY_SKIN); game.override.enemyMoveset(SPLASH_ONLY); game.override.enemySpecies(Species.CHARMANDER); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); + game.override.ability(Abilities.UNNERVE); game.override.starterSpecies(Species.CHANDELURE); }); diff --git a/src/test/abilities/ice_face.test.ts b/src/test/abilities/ice_face.test.ts index a5a2ff1f1ad..c0f91e8dff8 100644 --- a/src/test/abilities/ice_face.test.ts +++ b/src/test/abilities/ice_face.test.ts @@ -259,7 +259,7 @@ describe("Abilities - Ice Face", () => { }); it("cannot be copied", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.TRACE); + game.override.ability(Abilities.TRACE); await game.startBattle([Species.MAGIKARP]); diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index 28ed00e30a5..5bba42bd6d8 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -33,7 +33,7 @@ describe("Abilities - Intimidate", () => { game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.INTIMIDATE); vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); + game.override.ability(Abilities.INTIMIDATE); game.override.startingWave(3); game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); }); diff --git a/src/test/abilities/intrepid_sword.test.ts b/src/test/abilities/intrepid_sword.test.ts index fa988fcab39..5292bcd7c82 100644 --- a/src/test/abilities/intrepid_sword.test.ts +++ b/src/test/abilities/intrepid_sword.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 {Abilities} from "#enums/abilities"; -import {Species} from "#enums/species"; +import { BattleStat } from "#app/data/battle-stat"; import { CommandPhase, } from "#app/phases"; -import {BattleStat} from "#app/data/battle-stat"; +import GameManager from "#app/test/utils/gameManager"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Abilities - Intrepid Sword", () => { @@ -29,7 +28,7 @@ describe("Abilities - Intrepid Sword", () => { game.override.battleType("single"); game.override.enemySpecies(Species.ZACIAN); game.override.enemyAbility(Abilities.INTREPID_SWORD); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTREPID_SWORD); + game.override.ability(Abilities.INTREPID_SWORD); }); it("INTREPID SWORD on player", async() => { diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index c7866f1ca3c..ce65614d0aa 100644 --- a/src/test/abilities/libero.test.ts +++ b/src/test/abilities/libero.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Protean", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.LIBERO); + game.override.ability(Abilities.LIBERO); game.override.startingLevel(100); game.override.enemySpecies(Species.RATTATA); game.override.enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]); diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index 038657475f7..0ad48bbaad9 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -37,7 +37,7 @@ describe("Abilities - Moxie", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.MOXIE); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MOXIE); + game.override.ability(Abilities.MOXIE); game.override.startingLevel(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 7f96403e81c..c6de23432e6 100644 --- a/src/test/abilities/parental_bond.test.ts +++ b/src/test/abilities/parental_bond.test.ts @@ -33,7 +33,7 @@ describe("Abilities - Parental Bond", () => { game = new GameManager(phaserGame); game.override.battleType("single"); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.PARENTAL_BOND); + game.override.ability(Abilities.PARENTAL_BOND); game.override.enemySpecies(Species.SNORLAX); game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyMoveset(SPLASH_ONLY); diff --git a/src/test/abilities/power_construct.test.ts b/src/test/abilities/power_construct.test.ts index 6c775fdec1d..803be7e8147 100644 --- a/src/test/abilities/power_construct.test.ts +++ b/src/test/abilities/power_construct.test.ts @@ -29,7 +29,7 @@ describe("Abilities - POWER CONSTRUCT", () => { game = new GameManager(phaserGame); const moveToUse = Moves.SPLASH; game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.POWER_CONSTRUCT); + game.override.ability(Abilities.POWER_CONSTRUCT); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); }); diff --git a/src/test/abilities/protean.test.ts b/src/test/abilities/protean.test.ts index d6afd665930..4889bc99b5c 100644 --- a/src/test/abilities/protean.test.ts +++ b/src/test/abilities/protean.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Protean", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.PROTEAN); + game.override.ability(Abilities.PROTEAN); game.override.startingLevel(100); game.override.enemySpecies(Species.RATTATA); game.override.enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]); diff --git a/src/test/abilities/quick_draw.test.ts b/src/test/abilities/quick_draw.test.ts index 44e5b12e21b..f94a8c55a6c 100644 --- a/src/test/abilities/quick_draw.test.ts +++ b/src/test/abilities/quick_draw.test.ts @@ -28,7 +28,7 @@ describe("Abilities - Quick Draw", () => { game.override.battleType("single"); game.override.starterSpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.QUICK_DRAW); + game.override.ability(Abilities.QUICK_DRAW); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TAIL_WHIP]); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); diff --git a/src/test/abilities/sap_sipper.test.ts b/src/test/abilities/sap_sipper.test.ts index 970d830bf6d..4ffab7792d1 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -120,7 +120,7 @@ describe("Abilities - Sap Sipper", () => { const ability = Abilities.SAP_SIPPER; vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability); + game.override.ability(ability); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.NONE); diff --git a/src/test/abilities/schooling.test.ts b/src/test/abilities/schooling.test.ts index 0e341687f80..f3e95d987f2 100644 --- a/src/test/abilities/schooling.test.ts +++ b/src/test/abilities/schooling.test.ts @@ -29,7 +29,7 @@ describe("Abilities - SCHOOLING", () => { game = new GameManager(phaserGame); const moveToUse = Moves.SPLASH; game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SCHOOLING); + game.override.ability(Abilities.SCHOOLING); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 22114b737a9..04fc2e47f14 100644 --- a/src/test/abilities/screen_cleaner.test.ts +++ b/src/test/abilities/screen_cleaner.test.ts @@ -26,7 +26,7 @@ describe("Abilities - Screen Cleaner", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SCREEN_CLEANER); + game.override.ability(Abilities.SCREEN_CLEANER); game.override.enemySpecies(Species.SHUCKLE); }); diff --git a/src/test/abilities/serene_grace.test.ts b/src/test/abilities/serene_grace.test.ts index 77a5629a7c5..f46e1bbff62 100644 --- a/src/test/abilities/serene_grace.test.ts +++ b/src/test/abilities/serene_grace.test.ts @@ -76,7 +76,7 @@ describe("Abilities - Serene Grace", () => { it("Move chance with Serene Grace", async() => { const moveToUse = Moves.AIR_SLASH; - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SERENE_GRACE); + game.override.ability(Abilities.SERENE_GRACE); await game.startBattle([ Species.TOGEKISS ]); diff --git a/src/test/abilities/sheer_force.test.ts b/src/test/abilities/sheer_force.test.ts index 815f9bbf37c..e4df5920a04 100644 --- a/src/test/abilities/sheer_force.test.ts +++ b/src/test/abilities/sheer_force.test.ts @@ -43,7 +43,7 @@ describe("Abilities - Sheer Force", () => { it("Sheer Force", async() => { const moveToUse = Moves.AIR_SLASH; - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE); + game.override.ability(Abilities.SHEER_FORCE); await game.startBattle([ Species.PIDGEOT ]); @@ -82,7 +82,7 @@ describe("Abilities - Sheer Force", () => { it("Sheer Force with exceptions including binding moves", async() => { const moveToUse = Moves.BIND; - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE); + game.override.ability(Abilities.SHEER_FORCE); await game.startBattle([ Species.PIDGEOT ]); @@ -121,7 +121,7 @@ describe("Abilities - Sheer Force", () => { it("Sheer Force with moves with no secondary effect", async() => { const moveToUse = Moves.TACKLE; - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE); + game.override.ability(Abilities.SHEER_FORCE); await game.startBattle([ Species.PIDGEOT ]); @@ -162,7 +162,7 @@ describe("Abilities - Sheer Force", () => { const moveToUse = Moves.CRUSH_CLAW; game.override.enemyAbility(Abilities.COLOR_CHANGE); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "KINGS_ROCK", count: 1}]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE); + game.override.ability(Abilities.SHEER_FORCE); await game.startBattle([ Species.PIDGEOT ]); diff --git a/src/test/abilities/shields_down.test.ts b/src/test/abilities/shields_down.test.ts index a0790501096..4b3b49d0ff0 100644 --- a/src/test/abilities/shields_down.test.ts +++ b/src/test/abilities/shields_down.test.ts @@ -29,7 +29,7 @@ describe("Abilities - SHIELDS DOWN", () => { game = new GameManager(phaserGame); const moveToUse = Moves.SPLASH; game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHIELDS_DOWN); + game.override.ability(Abilities.SHIELDS_DOWN); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); }); diff --git a/src/test/abilities/sturdy.test.ts b/src/test/abilities/sturdy.test.ts index 18bf7d0e36a..34f7c16d542 100644 --- a/src/test/abilities/sturdy.test.ts +++ b/src/test/abilities/sturdy.test.ts @@ -85,7 +85,7 @@ describe("Abilities - Sturdy", () => { test( "Sturdy is ignored by pokemon with `Abilities.MOLD_BREAKER`", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MOLD_BREAKER); + game.override.ability(Abilities.MOLD_BREAKER); await game.startBattle(); game.doAttack(getMovePosition(game.scene, 0, Moves.CLOSE_COMBAT)); diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index 51ce6b8d2e1..32e96c91fd0 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -38,7 +38,7 @@ describe("Abilities - Volt Absorb", () => { const ability = Abilities.VOLT_ABSORB; vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability); + game.override.ability(ability); game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.DUSKULL); game.override.enemyAbility(Abilities.BALL_FETCH); diff --git a/src/test/abilities/wind_power.test.ts b/src/test/abilities/wind_power.test.ts index 7c7e2af72df..36109f81c33 100644 --- a/src/test/abilities/wind_power.test.ts +++ b/src/test/abilities/wind_power.test.ts @@ -48,7 +48,7 @@ describe("Abilities - Wind Power", () => { }); it("it becomes charged when Tailwind takes effect on its side", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_POWER); + game.override.ability(Abilities.WIND_POWER); game.override.enemySpecies(Species.MAGIKARP); await game.startBattle([Species.SHIFTRY]); @@ -64,7 +64,7 @@ describe("Abilities - Wind Power", () => { it("does not become charged when Tailwind takes effect on opposing side", async () => { game.override.enemySpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_POWER); + game.override.ability(Abilities.WIND_POWER); await game.startBattle([Species.SHIFTRY]); const magikarp = game.scene.getEnemyPokemon(); diff --git a/src/test/abilities/wind_rider.test.ts b/src/test/abilities/wind_rider.test.ts index 8be74c50f1c..a3d1ae44d44 100644 --- a/src/test/abilities/wind_rider.test.ts +++ b/src/test/abilities/wind_rider.test.ts @@ -50,7 +50,7 @@ describe("Abilities - Wind Rider", () => { }); it("Attack is increased by one stage when Tailwind is present on its side", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_RIDER); + game.override.ability(Abilities.WIND_RIDER); game.override.enemySpecies(Species.MAGIKARP); await game.startBattle([Species.SHIFTRY]); @@ -66,7 +66,7 @@ describe("Abilities - Wind Rider", () => { }); it("does not increase Attack when Tailwind is present on opposing side", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_RIDER); + game.override.ability(Abilities.WIND_RIDER); game.override.enemySpecies(Species.MAGIKARP); await game.startBattle([Species.SHIFTRY]); diff --git a/src/test/abilities/wonder_skin.test.ts b/src/test/abilities/wonder_skin.test.ts index 89f8088ab59..c62a4eaed66 100644 --- a/src/test/abilities/wonder_skin.test.ts +++ b/src/test/abilities/wonder_skin.test.ts @@ -29,7 +29,7 @@ describe("Abilities - Wonder Skin", () => { game = new GameManager(phaserGame); game.override.battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.CHARM]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.WONDER_SKIN); game.override.enemyMoveset(SPLASH_ONLY); @@ -65,7 +65,7 @@ describe("Abilities - Wonder Skin", () => { it(`does not affect pokemon with ${allAbilities[ability].name}`, async () => { const moveToCheck = allMoves[Moves.CHARM]; - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability); + game.override.ability(ability); vi.spyOn(moveToCheck, "calculateBattleAccuracy"); await game.startBattle([Species.PIKACHU]); diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index d7eab759de1..b620431d288 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -46,7 +46,7 @@ describe("Abilities - ZEN MODE", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); + game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(100); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 a55d56543e2..cb930382592 100644 --- a/src/test/abilities/zero_to_hero.test.ts +++ b/src/test/abilities/zero_to_hero.test.ts @@ -29,7 +29,7 @@ describe("Abilities - ZERO TO HERO", () => { game = new GameManager(phaserGame); const moveToUse = Moves.SPLASH; game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZERO_TO_HERO); + game.override.ability(Abilities.ZERO_TO_HERO); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); }); diff --git a/src/test/arena/arena_gravity.test.ts b/src/test/arena/arena_gravity.test.ts index 8e171388b06..916a4542924 100644 --- a/src/test/arena/arena_gravity.test.ts +++ b/src/test/arena/arena_gravity.test.ts @@ -31,7 +31,7 @@ describe("Arena - Gravity", () => { game = new GameManager(phaserGame); game.override.battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.GRAVITY, Moves.FISSURE]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); + game.override.ability(Abilities.UNNERVE); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH)); diff --git a/src/test/arena/weather_fog.test.ts b/src/test/arena/weather_fog.test.ts index ec6cbba3d32..e0dcf8450d1 100644 --- a/src/test/arena/weather_fog.test.ts +++ b/src/test/arena/weather_fog.test.ts @@ -32,7 +32,7 @@ describe("Weather - Fog", () => { .weather(WeatherType.FOG) .battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemySpecies(Species.MAGIKARP); game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH)); diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 7ffb363de9b..77368d74d32 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -36,7 +36,7 @@ describe("Battle order", () => { game.override.battleType("single"); game.override.enemySpecies(Species.MEWTWO); game.override.enemyAbility(Abilities.INSOMNIA); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.ability(Abilities.INSOMNIA); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); }); diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index 130e2c338f2..2eba8f3d93e 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -208,7 +208,7 @@ describe("Test Battle Phase", () => { game.override.battleType("single"); game.override.enemySpecies(Species.MIGHTYENA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.ability(Abilities.HYDRATION); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -221,7 +221,7 @@ describe("Test Battle Phase", () => { game.override.battleType("single"); game.override.enemySpecies(Species.MIGHTYENA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.ability(Abilities.HYDRATION); await game.startBattle([ Species.BLASTOISE, ]); @@ -233,7 +233,7 @@ describe("Test Battle Phase", () => { game.override.battleType("double"); game.override.enemySpecies(Species.MIGHTYENA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.ability(Abilities.HYDRATION); game.override.startingWave(3); await game.startBattle([ Species.BLASTOISE, @@ -247,7 +247,7 @@ describe("Test Battle Phase", () => { game.override.battleType("double"); game.override.enemySpecies(Species.MIGHTYENA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.ability(Abilities.HYDRATION); game.override.startingWave(3); await game.startBattle([ Species.BLASTOISE, @@ -265,7 +265,7 @@ describe("Test Battle Phase", () => { game.override.starterSpecies(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); + game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(2000); game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); @@ -294,7 +294,7 @@ describe("Test Battle Phase", () => { game.override.starterSpecies(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); + game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(2000); game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); @@ -312,7 +312,7 @@ describe("Test Battle Phase", () => { game.override.starterSpecies(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); + game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(2000); game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); diff --git a/src/test/battle/error-handling.test.ts b/src/test/battle/error-handling.test.ts index 4af376117f2..6998972cd35 100644 --- a/src/test/battle/error-handling.test.ts +++ b/src/test/battle/error-handling.test.ts @@ -29,7 +29,7 @@ describe("Test Battle Phase", () => { game.override.starterSpecies(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); + game.override.ability(Abilities.ZEN_MODE); game.override.startingLevel(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 28b59cd86b7..1d6ce09e70c 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -30,7 +30,7 @@ describe("Test Battle Phase", () => { game.override.startingLevel(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); game.override.enemyAbility(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.ability(Abilities.HYDRATION); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); }); diff --git a/src/test/items/exp_booster.test.ts b/src/test/items/exp_booster.test.ts index 3f0f2fd3424..8e61d8decda 100644 --- a/src/test/items/exp_booster.test.ts +++ b/src/test/items/exp_booster.test.ts @@ -24,7 +24,7 @@ describe("EXP Modifier Items", () => { game = new GameManager(phaserGame); game.override.enemyAbility(Abilities.BALL_FETCH); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); game.override.battleType("single"); }); diff --git a/src/test/items/grip_claw.test.ts b/src/test/items/grip_claw.test.ts index 6f975c242f7..951e34fae2c 100644 --- a/src/test/items/grip_claw.test.ts +++ b/src/test/items/grip_claw.test.ts @@ -34,7 +34,7 @@ describe("Items - Grip Claw", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ 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); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.KLUTZ); + game.override.ability(Abilities.KLUTZ); game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]); vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([ {name: "BERRY", type: BerryType.SITRUS, count: 2}, diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index 67d121f8855..f5ef6a62c60 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -38,7 +38,7 @@ describe("Items - Toxic orb", () => { const oppMoveToUse = Moves.TACKLE; game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.ability(Abilities.INSOMNIA); game.override.enemyAbility(Abilities.INSOMNIA); game.override.startingLevel(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); diff --git a/src/test/moves/aurora_veil.test.ts b/src/test/moves/aurora_veil.test.ts index 4d4d48994e8..5ca56c4d243 100644 --- a/src/test/moves/aurora_veil.test.ts +++ b/src/test/moves/aurora_veil.test.ts @@ -36,7 +36,7 @@ describe("Moves - Aurora Veil", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); game.override.enemySpecies(Species.MAGIKARP); diff --git a/src/test/moves/double_team.test.ts b/src/test/moves/double_team.test.ts index 886f6d58085..637f0f39fc6 100644 --- a/src/test/moves/double_team.test.ts +++ b/src/test/moves/double_team.test.ts @@ -30,7 +30,7 @@ describe("Moves - Double Team", () => { game.override.battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DOUBLE_TEAM]); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); diff --git a/src/test/moves/dragon_rage.test.ts b/src/test/moves/dragon_rage.test.ts index f6b24510db0..a1e8a18540e 100644 --- a/src/test/moves/dragon_rage.test.ts +++ b/src/test/moves/dragon_rage.test.ts @@ -40,7 +40,7 @@ describe("Moves - Dragon Rage", () => { game.override.starterSpecies(Species.SNORLAX); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_RAGE]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + 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/fissure.test.ts b/src/test/moves/fissure.test.ts index fc91c3aa80d..f67b275a8ba 100644 --- a/src/test/moves/fissure.test.ts +++ b/src/test/moves/fissure.test.ts @@ -54,7 +54,7 @@ describe("Moves - Fissure", () => { }); it("ignores damage modification from abilities such as fur coat", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NO_GUARD); + game.override.ability(Abilities.NO_GUARD); game.override.enemyAbility(Abilities.FUR_COAT); game.doAttack(getMovePosition(game.scene, 0, Moves.FISSURE)); diff --git a/src/test/moves/flower_shield.test.ts b/src/test/moves/flower_shield.test.ts index b27cdbbcf60..95a2736aa32 100644 --- a/src/test/moves/flower_shield.test.ts +++ b/src/test/moves/flower_shield.test.ts @@ -31,7 +31,7 @@ describe("Moves - Flower Shield", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + 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]); diff --git a/src/test/moves/follow_me.test.ts b/src/test/moves/follow_me.test.ts index 44bede6ee76..bdc09605c0c 100644 --- a/src/test/moves/follow_me.test.ts +++ b/src/test/moves/follow_me.test.ts @@ -101,7 +101,7 @@ describe("Moves - Follow Me", () => { test( "move effect should be bypassed by Stalwart", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.STALWART); + game.override.ability(Abilities.STALWART); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.QUICK_ATTACK ]); game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]); diff --git a/src/test/moves/gastro_acid.test.ts b/src/test/moves/gastro_acid.test.ts index 901904538c4..161eab37183 100644 --- a/src/test/moves/gastro_acid.test.ts +++ b/src/test/moves/gastro_acid.test.ts @@ -33,7 +33,7 @@ describe("Moves - Gastro Acid", () => { game.override.battleType("double"); game.override.startingLevel(1); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]); game.override.enemySpecies(Species.BIDOOF); game.override.enemyMoveset(SPLASH_ONLY); diff --git a/src/test/moves/glaive_rush.test.ts b/src/test/moves/glaive_rush.test.ts index a16a7ae0eec..15e81b489d6 100644 --- a/src/test/moves/glaive_rush.test.ts +++ b/src/test/moves/glaive_rush.test.ts @@ -32,7 +32,7 @@ describe("Moves - Glaive Rush", () => { game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH)); game.override.starterSpecies(Species.KLINK); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); + 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]); }); diff --git a/src/test/moves/growth.test.ts b/src/test/moves/growth.test.ts index 2a3b863c0f1..6b9abd8da59 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -37,7 +37,7 @@ describe("Moves - Growth", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.MOXIE); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.ability(Abilities.INSOMNIA); game.override.startingLevel(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 8e6ebb5d404..27c4af71004 100644 --- a/src/test/moves/hard_press.test.ts +++ b/src/test/moves/hard_press.test.ts @@ -31,7 +31,7 @@ describe("Moves - Hard Press", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.MUNCHLAX); game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyMoveset(SPLASH_ONLY); diff --git a/src/test/moves/light_screen.test.ts b/src/test/moves/light_screen.test.ts index e35a9a95c71..c8543c2faed 100644 --- a/src/test/moves/light_screen.test.ts +++ b/src/test/moves/light_screen.test.ts @@ -35,7 +35,7 @@ describe("Moves - Light Screen", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); game.override.enemySpecies(Species.MAGIKARP); diff --git a/src/test/moves/multi_target.test.ts b/src/test/moves/multi_target.test.ts index 1627109559c..f60429909db 100644 --- a/src/test/moves/multi_target.test.ts +++ b/src/test/moves/multi_target.test.ts @@ -167,7 +167,7 @@ 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]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); game.override.enemyMoveset(SPLASH_ONLY); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.startingLevel(50); diff --git a/src/test/moves/octolock.test.ts b/src/test/moves/octolock.test.ts index 6884aeabc2e..061aaff5d48 100644 --- a/src/test/moves/octolock.test.ts +++ b/src/test/moves/octolock.test.ts @@ -37,7 +37,7 @@ describe("Moves - Octolock", () => { game.override.startingLevel(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.OCTOLOCK, Moves.SPLASH]); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); }); it("Reduces DEf and SPDEF by 1 each turn", { timeout: 10000 }, async () => { diff --git a/src/test/moves/rage_powder.test.ts b/src/test/moves/rage_powder.test.ts index bd28a65db33..768d3580026 100644 --- a/src/test/moves/rage_powder.test.ts +++ b/src/test/moves/rage_powder.test.ts @@ -76,7 +76,7 @@ describe("Moves - Rage Powder", () => { test( "move effect should be bypassed by Overcoat", async () => { - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.OVERCOAT); + game.override.ability(Abilities.OVERCOAT); game.override.enemyMoveset([ Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER ]); // Test with two non-Grass type player Pokemon diff --git a/src/test/moves/reflect.test.ts b/src/test/moves/reflect.test.ts index fb279fa7689..35f9599c5f7 100644 --- a/src/test/moves/reflect.test.ts +++ b/src/test/moves/reflect.test.ts @@ -35,7 +35,7 @@ describe("Moves - Reflect", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("single"); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); game.override.enemySpecies(Species.MAGIKARP); diff --git a/src/test/moves/rollout.test.ts b/src/test/moves/rollout.test.ts index c3da6b9c79d..90a3fe065d8 100644 --- a/src/test/moves/rollout.test.ts +++ b/src/test/moves/rollout.test.ts @@ -29,7 +29,7 @@ describe("Moves - Rollout", () => { vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.battleType("single"); game.override.starterSpecies(Species.RATTATA); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.ability(Abilities.NONE); game.override.enemySpecies(Species.BIDOOF); game.override.enemyAbility(Abilities.NONE); game.override.startingLevel(100); diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index b1104d7d7be..4240c06d10a 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -31,7 +31,7 @@ describe("Moves - Spikes", () => { game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.ability(Abilities.HYDRATION); 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]); diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index 7bac64d282f..be1e8614c86 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -36,7 +36,7 @@ describe("Moves - Tail whip", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.INSOMNIA); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.ability(Abilities.INSOMNIA); game.override.startingLevel(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); diff --git a/src/test/moves/tidy_up.test.ts b/src/test/moves/tidy_up.test.ts index ece454c2988..0fd17baac60 100644 --- a/src/test/moves/tidy_up.test.ts +++ b/src/test/moves/tidy_up.test.ts @@ -33,7 +33,7 @@ describe("Moves - Tidy Up", () => { game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyMoveset(SPLASH_ONLY); game.override.starterSpecies(Species.FEEBAS); - vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.ability(Abilities.BALL_FETCH); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TIDY_UP]); game.override.startingLevel(50); });