From d14799f37afb67466067de74c1be79bbb590f189 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 15:05:32 -0700 Subject: [PATCH] apply game.override.enemyAbility --- src/test/abilities/ability_timing.test.ts | 2 +- src/test/abilities/aura_break.test.ts | 2 +- src/test/abilities/battery.test.ts | 2 +- src/test/abilities/costar.test.ts | 4 ++-- src/test/abilities/dry_skin.test.ts | 4 ++-- src/test/abilities/hustle.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 | 2 +- src/test/abilities/moxie.test.ts | 2 +- src/test/abilities/parental_bond.test.ts | 4 ++-- src/test/abilities/power_spot.test.ts | 2 +- 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/sheer_force.test.ts | 2 +- src/test/abilities/shield_dust.test.ts | 2 +- src/test/abilities/steely_spirit.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 | 2 +- src/test/abilities/wind_rider.test.ts | 2 +- src/test/abilities/wonder_skin.test.ts | 2 +- src/test/abilities/zen_mode.test.ts | 2 +- src/test/arena/arena_gravity.test.ts | 2 +- src/test/arena/weather_fog.test.ts | 2 +- src/test/arena/weather_strong_winds.test.ts | 2 +- src/test/battle/battle-order.test.ts | 2 +- src/test/battle/battle.test.ts | 18 +++++++++--------- src/test/battle/error-handling.test.ts | 2 +- src/test/battle/special_battle.test.ts | 2 +- src/test/evolution.test.ts | 2 +- src/test/items/exp_booster.test.ts | 2 +- src/test/items/leftovers.test.ts | 2 +- src/test/items/toxic_orb.test.ts | 2 +- src/test/moves/astonish.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 | 4 ++-- src/test/moves/fissure.test.ts | 2 +- src/test/moves/flower_shield.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/hyper_beam.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 | 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/stockpile.test.ts | 2 +- src/test/moves/swallow.test.ts | 2 +- src/test/moves/tail_whip.test.ts | 2 +- src/test/moves/thousand_arrows.test.ts | 2 +- src/test/moves/tidy_up.test.ts | 2 +- 58 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/test/abilities/ability_timing.test.ts b/src/test/abilities/ability_timing.test.ts index 894bb7c7e6b..ebc3f4d9bce 100644 --- a/src/test/abilities/ability_timing.test.ts +++ b/src/test/abilities/ability_timing.test.ts @@ -29,7 +29,7 @@ describe("Ability Timing", () => { game.override.battleType("single"); game.override.enemySpecies(Species.PIDGEY); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); + game.override.enemyAbility(Abilities.INTIMIDATE); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.SPLASH)); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); diff --git a/src/test/abilities/aura_break.test.ts b/src/test/abilities/aura_break.test.ts index 2b3ebc5d6fb..2de8a86309d 100644 --- a/src/test/abilities/aura_break.test.ts +++ b/src/test/abilities/aura_break.test.ts @@ -30,7 +30,7 @@ describe("Abilities - Aura Break", () => { game.override.battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.AURA_BREAK); + 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 9347ba754e5..90dc8b62986 100644 --- a/src/test/abilities/battery.test.ts +++ b/src/test/abilities/battery.test.ts @@ -29,7 +29,7 @@ describe("Abilities - Battery", () => { game = new GameManager(phaserGame); game.override.battleType("double"); game.override.enemySpecies(Species.SHUCKLE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); }); diff --git a/src/test/abilities/costar.test.ts b/src/test/abilities/costar.test.ts index 7c791c3e140..282fda866ea 100644 --- a/src/test/abilities/costar.test.ts +++ b/src/test/abilities/costar.test.ts @@ -37,7 +37,7 @@ describe("Abilities - COSTAR", () => { test( "ability copies positive stat changes", async () => { - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]); @@ -68,7 +68,7 @@ describe("Abilities - COSTAR", () => { test( "ability copies negative stat changes", async () => { - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); + game.override.enemyAbility(Abilities.INTIMIDATE); await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]); diff --git a/src/test/abilities/dry_skin.test.ts b/src/test/abilities/dry_skin.test.ts index 4d3502567d9..25069e35604 100644 --- a/src/test/abilities/dry_skin.test.ts +++ b/src/test/abilities/dry_skin.test.ts @@ -26,7 +26,7 @@ describe("Abilities - Dry Skin", () => { game = new GameManager(phaserGame); game.override.battleType("single"); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.DRY_SKIN); + game.override.enemyAbility(Abilities.DRY_SKIN); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); game.override.enemySpecies(Species.CHARMANDER); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); @@ -94,7 +94,7 @@ describe("Abilities - Dry Skin", () => { expect(enemy.hp > 0); enemy.hp = initialHP; - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.enemyAbility(Abilities.NONE); // second turn game.doAttack(getMovePosition(game.scene, 0, Moves.FLAMETHROWER)); diff --git a/src/test/abilities/hustle.test.ts b/src/test/abilities/hustle.test.ts index 2de86b54973..cea0bc10799 100644 --- a/src/test/abilities/hustle.test.ts +++ b/src/test/abilities/hustle.test.ts @@ -33,7 +33,7 @@ describe("Abilities - Hustle", () => { vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5); vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); game.override.enemySpecies(Species.SHUCKLE); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); }); it("increases the user's Attack stat by 50%", async () => { diff --git a/src/test/abilities/ice_face.test.ts b/src/test/abilities/ice_face.test.ts index f696d9943dc..6930c0d1db8 100644 --- a/src/test/abilities/ice_face.test.ts +++ b/src/test/abilities/ice_face.test.ts @@ -35,7 +35,7 @@ describe("Abilities - Ice Face", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.EISCUE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ICE_FACE); + game.override.enemyAbility(Abilities.ICE_FACE); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]); }); diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index fbcd858415a..b3edc0d0206 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -31,7 +31,7 @@ describe("Abilities - Intimidate", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); + 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.startingWave(3); diff --git a/src/test/abilities/intrepid_sword.test.ts b/src/test/abilities/intrepid_sword.test.ts index 878c5dbb0dc..fa988fcab39 100644 --- a/src/test/abilities/intrepid_sword.test.ts +++ b/src/test/abilities/intrepid_sword.test.ts @@ -28,7 +28,7 @@ describe("Abilities - Intrepid Sword", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.ZACIAN); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTREPID_SWORD); + game.override.enemyAbility(Abilities.INTREPID_SWORD); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTREPID_SWORD); }); diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index 50c0b58b900..a2a50f15488 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -36,7 +36,7 @@ describe("Abilities - Moxie", () => { const moveToUse = Moves.AERIAL_ACE; game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MOXIE); + game.override.enemyAbility(Abilities.MOXIE); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MOXIE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); diff --git a/src/test/abilities/parental_bond.test.ts b/src/test/abilities/parental_bond.test.ts index c6e7cc4c95a..991ccefd265 100644 --- a/src/test/abilities/parental_bond.test.ts +++ b/src/test/abilities/parental_bond.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Parental Bond", () => { vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.PARENTAL_BOND); game.override.enemySpecies(Species.SNORLAX); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); @@ -591,7 +591,7 @@ describe("Abilities - Parental Bond", () => { "ability should not cause user to hit into Storm Drain more than once", async () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.WATER_GUN]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.STORM_DRAIN); + game.override.enemyAbility(Abilities.STORM_DRAIN); await game.startBattle([Species.CHARIZARD]); diff --git a/src/test/abilities/power_spot.test.ts b/src/test/abilities/power_spot.test.ts index a9db0c3bea1..b63ad8522e4 100644 --- a/src/test/abilities/power_spot.test.ts +++ b/src/test/abilities/power_spot.test.ts @@ -31,7 +31,7 @@ describe("Abilities - Power Spot", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); game.override.enemySpecies(Species.SHUCKLE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); }); it("raises the power of allies' special moves by 30%", async () => { diff --git a/src/test/abilities/quick_draw.test.ts b/src/test/abilities/quick_draw.test.ts index d6a4ef8038f..922725b6ea0 100644 --- a/src/test/abilities/quick_draw.test.ts +++ b/src/test/abilities/quick_draw.test.ts @@ -33,7 +33,7 @@ describe("Abilities - Quick Draw", () => { vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); game.override.enemySpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.TACKLE)); vi.spyOn(allAbilities[Abilities.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue(100); diff --git a/src/test/abilities/sand_veil.test.ts b/src/test/abilities/sand_veil.test.ts index dbdc9699600..4077dca2b31 100644 --- a/src/test/abilities/sand_veil.test.ts +++ b/src/test/abilities/sand_veil.test.ts @@ -31,7 +31,7 @@ describe("Abilities - Sand Veil", () => { game = new GameManager(phaserGame); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.enemySpecies(Species.MEOWSCARADA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); 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 bc19531e46f..ce961f107dd 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -41,7 +41,7 @@ describe("Abilities - Sap Sipper", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.DUSKULL); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(enemyAbility); + game.override.enemyAbility(enemyAbility); await game.startBattle(); @@ -62,7 +62,7 @@ describe("Abilities - Sap Sipper", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(enemyAbility); + game.override.enemyAbility(enemyAbility); await game.startBattle(); @@ -81,7 +81,7 @@ describe("Abilities - Sap Sipper", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(enemyAbility); + game.override.enemyAbility(enemyAbility); await game.startBattle(); @@ -101,7 +101,7 @@ describe("Abilities - Sap Sipper", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(enemyAbility); + game.override.enemyAbility(enemyAbility); await game.startBattle(); @@ -123,7 +123,7 @@ describe("Abilities - Sap Sipper", () => { vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.enemyAbility(Abilities.NONE); await game.startBattle(); @@ -148,7 +148,7 @@ describe("Abilities - Sap Sipper", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(enemyAbility); + game.override.enemyAbility(enemyAbility); await game.startBattle(); diff --git a/src/test/abilities/sheer_force.test.ts b/src/test/abilities/sheer_force.test.ts index f6477783f6c..5e7eb11a3c3 100644 --- a/src/test/abilities/sheer_force.test.ts +++ b/src/test/abilities/sheer_force.test.ts @@ -160,7 +160,7 @@ describe("Abilities - Sheer Force", () => { it("Sheer Force Disabling Specific Abilities", async() => { const moveToUse = Moves.CRUSH_CLAW; - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.COLOR_CHANGE); + 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); await game.startBattle([ diff --git a/src/test/abilities/shield_dust.test.ts b/src/test/abilities/shield_dust.test.ts index 186c5c3c6ad..c34ac94a6ed 100644 --- a/src/test/abilities/shield_dust.test.ts +++ b/src/test/abilities/shield_dust.test.ts @@ -36,7 +36,7 @@ describe("Abilities - Shield Dust", () => { const movesToUse = [Moves.AIR_SLASH]; game.override.battleType("single"); game.override.enemySpecies(Species.ONIX); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHIELD_DUST); + game.override.enemyAbility(Abilities.SHIELD_DUST); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(movesToUse); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([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 374aef0ce2f..f4b24d2c21e 100644 --- a/src/test/abilities/steely_spirit.test.ts +++ b/src/test/abilities/steely_spirit.test.ts @@ -31,7 +31,7 @@ describe("Abilities - Steely Spirit", () => { game = new GameManager(phaserGame); game.override.battleType("double"); game.override.enemySpecies(Species.SHUCKLE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.IRON_HEAD, Moves.SPLASH]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); vi.spyOn(allMoves[moveToCheck], "calculateBattlePower"); diff --git a/src/test/abilities/sturdy.test.ts b/src/test/abilities/sturdy.test.ts index d4c4ee66761..87a998e560d 100644 --- a/src/test/abilities/sturdy.test.ts +++ b/src/test/abilities/sturdy.test.ts @@ -38,7 +38,7 @@ describe("Abilities - Sturdy", () => { game.override.enemySpecies(Species.ARON); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.STURDY); + game.override.enemyAbility(Abilities.STURDY); }); test( diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index 881d745eed6..3a586df897a 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -41,7 +41,7 @@ describe("Abilities - Volt Absorb", () => { vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); game.override.enemySpecies(Species.DUSKULL); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); await game.startBattle(); diff --git a/src/test/abilities/wind_power.test.ts b/src/test/abilities/wind_power.test.ts index b7539f0188b..5eaf87f182f 100644 --- a/src/test/abilities/wind_power.test.ts +++ b/src/test/abilities/wind_power.test.ts @@ -29,7 +29,7 @@ describe("Abilities - Wind Power", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.SHIFTRY); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_POWER); + game.override.enemyAbility(Abilities.WIND_POWER); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); }); diff --git a/src/test/abilities/wind_rider.test.ts b/src/test/abilities/wind_rider.test.ts index ec09b39c539..084317f6e09 100644 --- a/src/test/abilities/wind_rider.test.ts +++ b/src/test/abilities/wind_rider.test.ts @@ -29,7 +29,7 @@ describe("Abilities - Wind Rider", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.SHIFTRY); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_RIDER); + game.override.enemyAbility(Abilities.WIND_RIDER); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); }); diff --git a/src/test/abilities/wonder_skin.test.ts b/src/test/abilities/wonder_skin.test.ts index a38ec41fa2d..5528b879bdf 100644 --- a/src/test/abilities/wonder_skin.test.ts +++ b/src/test/abilities/wonder_skin.test.ts @@ -30,7 +30,7 @@ describe("Abilities - Wonder Skin", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.CHARM]); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WONDER_SKIN); + game.override.enemyAbility(Abilities.WONDER_SKIN); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); }); diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index 1119b4cdb90..7b6f3e66aa1 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -45,7 +45,7 @@ describe("Abilities - ZEN MODE", () => { const moveToUse = Moves.SPLASH; game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); diff --git a/src/test/arena/arena_gravity.test.ts b/src/test/arena/arena_gravity.test.ts index 0e5b7b992a7..5058f8701b7 100644 --- a/src/test/arena/arena_gravity.test.ts +++ b/src/test/arena/arena_gravity.test.ts @@ -32,7 +32,7 @@ describe("Arena - Gravity", () => { 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); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(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 b11d3728f10..273e5c88b19 100644 --- a/src/test/arena/weather_fog.test.ts +++ b/src/test/arena/weather_fog.test.ts @@ -33,7 +33,7 @@ describe("Weather - Fog", () => { .battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemySpecies(Species.MAGIKARP); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(new Array(4).fill(Moves.SPLASH)); }); diff --git a/src/test/arena/weather_strong_winds.test.ts b/src/test/arena/weather_strong_winds.test.ts index 245b1bcf74a..f25be43c426 100644 --- a/src/test/arena/weather_strong_winds.test.ts +++ b/src/test/arena/weather_strong_winds.test.ts @@ -30,7 +30,7 @@ describe("Weather - Strong Winds", () => { game.override.battleType("single"); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(10); game.override.enemySpecies(Species.TAILLOW); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.DELTA_STREAM); + game.override.enemyAbility(Abilities.DELTA_STREAM); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.THUNDERBOLT, Moves.ICE_BEAM, Moves.ROCK_SLIDE]); }); diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 55753951881..7ffb363de9b 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -35,7 +35,7 @@ describe("Battle order", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.MEWTWO); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(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 f2dc328ac47..a8f17543cc4 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -97,7 +97,7 @@ describe("Test Battle Phase", () => { .startingWave(3) .battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); await game.startBattle(); game.onNextPrompt("CommandPhase", Mode.COMMAND, () => { @@ -116,7 +116,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5); game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]); game.override.battleType("single"); await game.startBattle(); @@ -207,7 +207,7 @@ describe("Test Battle Phase", () => { it("2vs1", async() => { game.override.battleType("single"); game.override.enemySpecies(Species.MIGHTYENA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); await game.startBattle([ Species.BLASTOISE, @@ -220,7 +220,7 @@ describe("Test Battle Phase", () => { it("1vs1", async() => { game.override.battleType("single"); game.override.enemySpecies(Species.MIGHTYENA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); await game.startBattle([ Species.BLASTOISE, @@ -232,7 +232,7 @@ describe("Test Battle Phase", () => { it("2vs2", async() => { game.override.battleType("double"); game.override.enemySpecies(Species.MIGHTYENA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); game.override.startingWave(3); await game.startBattle([ @@ -246,7 +246,7 @@ describe("Test Battle Phase", () => { it("4vs2", async() => { game.override.battleType("double"); game.override.enemySpecies(Species.MIGHTYENA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); game.override.startingWave(3); await game.startBattle([ @@ -264,7 +264,7 @@ describe("Test Battle Phase", () => { game.override.battleType("single"); vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); game.override.startingWave(3); @@ -293,7 +293,7 @@ describe("Test Battle Phase", () => { game.override.battleType("single"); vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); game.override.startingWave(3); @@ -311,7 +311,7 @@ describe("Test Battle Phase", () => { game.override.battleType("single"); vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); game.override.startingWave(3); diff --git a/src/test/battle/error-handling.test.ts b/src/test/battle/error-handling.test.ts index c7bb45e8180..75aad9a4ee3 100644 --- a/src/test/battle/error-handling.test.ts +++ b/src/test/battle/error-handling.test.ts @@ -28,7 +28,7 @@ describe("Test Battle Phase", () => { .startingWave(3); vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MEWTWO); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); diff --git a/src/test/battle/special_battle.test.ts b/src/test/battle/special_battle.test.ts index 34bdac1f306..7b6330a9fe8 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -29,7 +29,7 @@ describe("Test Battle Phase", () => { game.override.enemySpecies(Species.RATTATA); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + game.override.enemyAbility(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); }); diff --git a/src/test/evolution.test.ts b/src/test/evolution.test.ts index 60e3392b281..f2cf1023457 100644 --- a/src/test/evolution.test.ts +++ b/src/test/evolution.test.ts @@ -27,7 +27,7 @@ describe("Evolution", () => { game.override.battleType("single"); game.override.enemySpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(60); }); diff --git a/src/test/items/exp_booster.test.ts b/src/test/items/exp_booster.test.ts index 75e0892efc6..3f0f2fd3424 100644 --- a/src/test/items/exp_booster.test.ts +++ b/src/test/items/exp_booster.test.ts @@ -23,7 +23,7 @@ describe("EXP Modifier Items", () => { beforeEach(() => { game = new GameManager(phaserGame); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); game.override.battleType("single"); }); diff --git a/src/test/items/leftovers.test.ts b/src/test/items/leftovers.test.ts index 5cea7be42ba..d3d6a8860b2 100644 --- a/src/test/items/leftovers.test.ts +++ b/src/test/items/leftovers.test.ts @@ -30,7 +30,7 @@ describe("Items - Leftovers", () => { vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); game.override.enemySpecies(Species.SHUCKLE); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); + game.override.enemyAbility(Abilities.UNNERVE); vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); vi.spyOn(overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "LEFTOVERS", count: 1}]); }); diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index 132d939be9f..50bf108a008 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -39,7 +39,7 @@ describe("Items - Toxic orb", () => { game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([oppMoveToUse, oppMoveToUse, oppMoveToUse, oppMoveToUse]); diff --git a/src/test/moves/astonish.test.ts b/src/test/moves/astonish.test.ts index 9a6d2df5e0b..9f6ea21ae93 100644 --- a/src/test/moves/astonish.test.ts +++ b/src/test/moves/astonish.test.ts @@ -31,7 +31,7 @@ describe("Moves - Astonish", () => { game.override.battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ASTONISH, Moves.SPLASH]); game.override.enemySpecies(Species.BLASTOISE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); diff --git a/src/test/moves/ceaseless_edge.test.ts b/src/test/moves/ceaseless_edge.test.ts index f6766ee2441..3cd043cc390 100644 --- a/src/test/moves/ceaseless_edge.test.ts +++ b/src/test/moves/ceaseless_edge.test.ts @@ -34,7 +34,7 @@ describe("Moves - Ceaseless Edge", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.RUN_AWAY); + game.override.enemyAbility(Abilities.RUN_AWAY); vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.RUN_AWAY); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); diff --git a/src/test/moves/double_team.test.ts b/src/test/moves/double_team.test.ts index da623b7ba92..13f8087d165 100644 --- a/src/test/moves/double_team.test.ts +++ b/src/test/moves/double_team.test.ts @@ -32,7 +32,7 @@ describe("Moves - Double Team", () => { vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SHUCKLE); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([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 ae6768e6688..419fca98771 100644 --- a/src/test/moves/dragon_rage.test.ts +++ b/src/test/moves/dragon_rage.test.ts @@ -45,7 +45,7 @@ describe("Moves - Dragon Rage", () => { game.override.enemySpecies(Species.SNORLAX); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); @@ -111,7 +111,7 @@ describe("Moves - Dragon Rage", () => { }); it("ignores damage modification from abilities such as ice scales", async () => { - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ICE_SCALES); + game.override.enemyAbility(Abilities.ICE_SCALES); game.doAttack(getMovePosition(game.scene, 0, Moves.DRAGON_RAGE)); await game.phaseInterceptor.to(TurnEndPhase); diff --git a/src/test/moves/fissure.test.ts b/src/test/moves/fissure.test.ts index b6bb37363e7..f5c1218af74 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); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FUR_COAT); + game.override.enemyAbility(Abilities.FUR_COAT); game.doAttack(getMovePosition(game.scene, 0, Moves.FISSURE)); await game.phaseInterceptor.to(DamagePhase, true); diff --git a/src/test/moves/flower_shield.test.ts b/src/test/moves/flower_shield.test.ts index 7eb495672ae..b51651aaf76 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); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.enemyAbility(Abilities.NONE); game.override.battleType("single"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLOWER_SHIELD, Moves.SPLASH]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); diff --git a/src/test/moves/gastro_acid.test.ts b/src/test/moves/gastro_acid.test.ts index 1c4028a351f..4275ee64fdf 100644 --- a/src/test/moves/gastro_acid.test.ts +++ b/src/test/moves/gastro_acid.test.ts @@ -36,7 +36,7 @@ describe("Moves - Gastro Acid", () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]); game.override.enemySpecies(Species.BIDOOF); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WATER_ABSORB); + game.override.enemyAbility(Abilities.WATER_ABSORB); }); it("suppresses effect of ability", async () => { diff --git a/src/test/moves/glaive_rush.test.ts b/src/test/moves/glaive_rush.test.ts index 4ed85fa74e8..ea0e6032709 100644 --- a/src/test/moves/glaive_rush.test.ts +++ b/src/test/moves/glaive_rush.test.ts @@ -29,7 +29,7 @@ describe("Moves - Glaive Rush", () => { game.override.battleType("single"); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); game.override.enemySpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.GLAIVE_RUSH)); vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.KLINK); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE); diff --git a/src/test/moves/growth.test.ts b/src/test/moves/growth.test.ts index 9a057fbc03b..56f62ae60a1 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -36,7 +36,7 @@ describe("Moves - Growth", () => { const moveToUse = Moves.GROWTH; game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MOXIE); + game.override.enemyAbility(Abilities.MOXIE); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); diff --git a/src/test/moves/hard_press.test.ts b/src/test/moves/hard_press.test.ts index 1e607bc20fb..959b90cdde8 100644 --- a/src/test/moves/hard_press.test.ts +++ b/src/test/moves/hard_press.test.ts @@ -32,7 +32,7 @@ describe("Moves - Hard Press", () => { game.override.battleType("single"); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); game.override.enemySpecies(Species.MUNCHLAX); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([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 480522ace4d..54789b68fbf 100644 --- a/src/test/moves/hyper_beam.test.ts +++ b/src/test/moves/hyper_beam.test.ts @@ -32,7 +32,7 @@ describe("Moves - Hyper Beam", () => { game.override.battleType("single"); vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SNORLAX); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.SPLASH)); vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.HYPER_BEAM, Moves.TACKLE]); diff --git a/src/test/moves/make_it_rain.test.ts b/src/test/moves/make_it_rain.test.ts index d44fd252ba1..ee4aef3e343 100644 --- a/src/test/moves/make_it_rain.test.ts +++ b/src/test/moves/make_it_rain.test.ts @@ -34,7 +34,7 @@ describe("Moves - Make It Rain", () => { game.override.battleType("double"); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.MAKE_IT_RAIN, Moves.SPLASH]); game.override.enemySpecies(Species.SNORLAX); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); diff --git a/src/test/moves/multi_target.test.ts b/src/test/moves/multi_target.test.ts index 268d582156b..40eb2e7daa6 100644 --- a/src/test/moves/multi_target.test.ts +++ b/src/test/moves/multi_target.test.ts @@ -69,7 +69,7 @@ describe("Moves - Multi target", () => { async function checkTargetMultiplier(game: GameManager, attackMove: Moves, killAlly: boolean, killSecondEnemy: boolean, shouldMultiplied: boolean, oppAbility?: Abilities) { // play an attack and check target count - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(oppAbility ? oppAbility : Abilities.BALL_FETCH); + game.override.enemyAbility(oppAbility ? oppAbility : Abilities.BALL_FETCH); await game.startBattle(); const playerPokemonRepr = game.scene.getPlayerField(); diff --git a/src/test/moves/octolock.test.ts b/src/test/moves/octolock.test.ts index ada806fd4d0..8881170a9a3 100644 --- a/src/test/moves/octolock.test.ts +++ b/src/test/moves/octolock.test.ts @@ -32,7 +32,7 @@ describe("Moves - Octolock", () => { game.override.enemySpecies(Species.RATTATA); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.enemyAbility(Abilities.NONE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.OCTOLOCK, Moves.SPLASH]); diff --git a/src/test/moves/rollout.test.ts b/src/test/moves/rollout.test.ts index a6a083ef92b..93b07ce84fc 100644 --- a/src/test/moves/rollout.test.ts +++ b/src/test/moves/rollout.test.ts @@ -31,7 +31,7 @@ describe("Moves - Rollout", () => { vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RATTATA); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); game.override.enemySpecies(Species.BIDOOF); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + game.override.enemyAbility(Abilities.NONE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(SPLASH_ONLY); diff --git a/src/test/moves/roost.test.ts b/src/test/moves/roost.test.ts index b9255032cd4..284937bd7db 100644 --- a/src/test/moves/roost.test.ts +++ b/src/test/moves/roost.test.ts @@ -29,7 +29,7 @@ describe("Moves - Roost", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.STARAPTOR); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.STOMPING_TANTRUM ]); diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index c198e347134..62ecfbc6312 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -29,7 +29,7 @@ describe("Moves - Spikes", () => { game.scene.battleStyle = 1; game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); + 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); vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); diff --git a/src/test/moves/spit_up.test.ts b/src/test/moves/spit_up.test.ts index fc83b0d4357..cb40a3a1177 100644 --- a/src/test/moves/spit_up.test.ts +++ b/src/test/moves/spit_up.test.ts @@ -31,7 +31,7 @@ describe("Moves - Spit Up", () => { game.override.enemySpecies(Species.RATTATA); vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + 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]); diff --git a/src/test/moves/stockpile.test.ts b/src/test/moves/stockpile.test.ts index 18e9cc366c4..adc70aa99b2 100644 --- a/src/test/moves/stockpile.test.ts +++ b/src/test/moves/stockpile.test.ts @@ -31,7 +31,7 @@ describe("Moves - Stockpile", () => { game.override.enemySpecies(Species.RATTATA); vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + 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]); diff --git a/src/test/moves/swallow.test.ts b/src/test/moves/swallow.test.ts index 37ce68527a2..c6a6f485d11 100644 --- a/src/test/moves/swallow.test.ts +++ b/src/test/moves/swallow.test.ts @@ -30,7 +30,7 @@ describe("Moves - Swallow", () => { game.override.enemySpecies(Species.RATTATA); vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE); + 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]); diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index 6122badeba1..af5597d62ed 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -35,7 +35,7 @@ describe("Moves - Tail whip", () => { const moveToUse = Moves.TAIL_WHIP; game.override.battleType("single"); game.override.enemySpecies(Species.RATTATA); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.INSOMNIA); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); diff --git a/src/test/moves/thousand_arrows.test.ts b/src/test/moves/thousand_arrows.test.ts index fb49195c2bd..ca8609c7100 100644 --- a/src/test/moves/thousand_arrows.test.ts +++ b/src/test/moves/thousand_arrows.test.ts @@ -62,7 +62,7 @@ describe("Moves - Thousand Arrows", () => { "move should hit and ground targets with Levitate", async () => { game.override.enemySpecies(Species.SNORLAX); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.LEVITATE); + game.override.enemyAbility(Abilities.LEVITATE); await game.startBattle([ Species.ILLUMISE ]); diff --git a/src/test/moves/tidy_up.test.ts b/src/test/moves/tidy_up.test.ts index c9e76ae5078..3d55c0a42a2 100644 --- a/src/test/moves/tidy_up.test.ts +++ b/src/test/moves/tidy_up.test.ts @@ -29,7 +29,7 @@ describe("Moves - Tidy Up", () => { game = new GameManager(phaserGame); game.override.battleType("single"); game.override.enemySpecies(Species.MAGIKARP); - vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH); + game.override.enemyAbility(Abilities.BALL_FETCH); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.FEEBAS); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);