From bc1c267071be1a430c46a75c9c2eae268ba4ca48 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 14:25:31 -0700 Subject: [PATCH] use game.override.startingWave --- src/test/abilities/battle_bond.test.ts | 2 +- src/test/abilities/disguise.test.ts | 2 +- src/test/abilities/ice_face.test.ts | 2 +- src/test/abilities/intimidate.test.ts | 24 +++++++++++----------- src/test/abilities/power_construct.test.ts | 2 +- src/test/abilities/schooling.test.ts | 2 +- src/test/abilities/shields_down.test.ts | 2 +- src/test/abilities/zen_mode.test.ts | 2 +- src/test/abilities/zero_to_hero.test.ts | 2 +- src/test/achievements/achievement.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 | 18 ++++++++-------- src/test/moves/ceaseless_edge.test.ts | 2 +- src/test/moves/dynamax_cannon.test.ts | 2 +- src/test/moves/spikes.test.ts | 6 +++--- src/test/moves/tackle.test.ts | 2 +- src/test/ui/transfer-item.test.ts | 2 +- 18 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/test/abilities/battle_bond.test.ts b/src/test/abilities/battle_bond.test.ts index 1ebefb99f32..8166f9bfe66 100644 --- a/src/test/abilities/battle_bond.test.ts +++ b/src/test/abilities/battle_bond.test.ts @@ -39,7 +39,7 @@ describe("Abilities - BATTLE BOND", () => { async () => { const baseForm = 1, ashForm = 2; - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ [Species.GRENINJA]: ashForm, }); diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index 0a542780ebc..f0d10e4691d 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -39,7 +39,7 @@ describe("Abilities - DISGUISE", () => { async () => { const baseForm = 0, bustedForm = 1; - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ [Species.MIMIKYU]: bustedForm, }); diff --git a/src/test/abilities/ice_face.test.ts b/src/test/abilities/ice_face.test.ts index 1b00ef748eb..ccf8ddef3c6 100644 --- a/src/test/abilities/ice_face.test.ts +++ b/src/test/abilities/ice_face.test.ts @@ -202,7 +202,7 @@ describe("Abilities - Ice Face", () => { }); it("reverts to Ice Face on arena reset", async () => { - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(4); vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index 2ff909def2e..944af180af1 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Intimidate", () => { vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); }); @@ -68,7 +68,7 @@ describe("Abilities - Intimidate", () => { }, 20000); it("single - boss should only trigger once then switch", async () => { - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10); + game.override.startingWave(10); await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]); game.onNextPrompt( "CheckSwitchPhase", @@ -97,7 +97,7 @@ describe("Abilities - Intimidate", () => { }, 20000); it("single - trainer should only trigger once with switch", async () => { - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]); game.onNextPrompt( "CheckSwitchPhase", @@ -127,7 +127,7 @@ describe("Abilities - Intimidate", () => { it("double - trainer should only trigger once per pokemon", async () => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]); game.onNextPrompt( "CheckSwitchPhase", @@ -153,7 +153,7 @@ describe("Abilities - Intimidate", () => { it("double - wild: should only trigger once per pokemon", async () => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]); game.onNextPrompt( "CheckSwitchPhase", @@ -179,7 +179,7 @@ describe("Abilities - Intimidate", () => { it("double - boss: should only trigger once per pokemon", async () => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10); + game.override.startingWave(10); await game.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]); game.onNextPrompt( "CheckSwitchPhase", @@ -204,7 +204,7 @@ describe("Abilities - Intimidate", () => { }, 20000); it("single - wild next wave opp triger once, us: none", async () => { - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(2); + game.override.startingWave(2); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.AERIAL_ACE]); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; @@ -230,7 +230,7 @@ describe("Abilities - Intimidate", () => { }, 20000); it("single - wild next turn - no retrigger on next turn", async () => { - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(2); + game.override.startingWave(2); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; @@ -256,7 +256,7 @@ describe("Abilities - Intimidate", () => { it("single - trainer should only trigger once and each time he switch", async () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH, Moves.VOLT_SWITCH]); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); @@ -295,7 +295,7 @@ describe("Abilities - Intimidate", () => { it("single - trainer should only trigger once whatever turn we are", async () => { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); @@ -333,7 +333,7 @@ describe("Abilities - Intimidate", () => { it("double - wild vs only 1 on player side", async () => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{ name: "COIN_CASE" }]); await game.runToSummon([Species.MIGHTYENA]); // Get rid of any modifiers that may alter power @@ -351,7 +351,7 @@ describe("Abilities - Intimidate", () => { it("double - wild vs only 1 alive on player side", async () => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); await game.runToTitle(); game.onNextPrompt("TitlePhase", Mode.TITLE, () => { diff --git a/src/test/abilities/power_construct.test.ts b/src/test/abilities/power_construct.test.ts index 48c92c0e2d1..ce40bb49613 100644 --- a/src/test/abilities/power_construct.test.ts +++ b/src/test/abilities/power_construct.test.ts @@ -39,7 +39,7 @@ describe("Abilities - POWER CONSTRUCT", () => { async () => { const baseForm = 2, completeForm = 4; - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ [Species.ZYGARDE]: completeForm, }); diff --git a/src/test/abilities/schooling.test.ts b/src/test/abilities/schooling.test.ts index aac8a3e793f..df9c4e6f065 100644 --- a/src/test/abilities/schooling.test.ts +++ b/src/test/abilities/schooling.test.ts @@ -39,7 +39,7 @@ describe("Abilities - SCHOOLING", () => { async () => { const soloForm = 0, schoolForm = 1; - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ [Species.WISHIWASHI]: schoolForm, }); diff --git a/src/test/abilities/shields_down.test.ts b/src/test/abilities/shields_down.test.ts index 881a3f4911f..a310148f041 100644 --- a/src/test/abilities/shields_down.test.ts +++ b/src/test/abilities/shields_down.test.ts @@ -39,7 +39,7 @@ describe("Abilities - SHIELDS DOWN", () => { async () => { const meteorForm = 0, coreForm = 7; - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ [Species.MINIOR]: coreForm, }); diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index dae01b7aa89..7b8474170e9 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -153,7 +153,7 @@ describe("Abilities - ZEN MODE", () => { async () => { const baseForm = 0, zenForm = 1; - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ [Species.DARMANITAN]: zenForm, }); diff --git a/src/test/abilities/zero_to_hero.test.ts b/src/test/abilities/zero_to_hero.test.ts index 6e82f151f15..24187626f3d 100644 --- a/src/test/abilities/zero_to_hero.test.ts +++ b/src/test/abilities/zero_to_hero.test.ts @@ -39,7 +39,7 @@ describe("Abilities - ZERO TO HERO", () => { async () => { const baseForm = 0, heroForm = 1; - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(4); + game.override.startingWave(4); vi.spyOn(Overrides, "STARTER_FORM_OVERRIDES", "get").mockReturnValue({ [Species.PALAFIN]: heroForm, }); diff --git a/src/test/achievements/achievement.test.ts b/src/test/achievements/achievement.test.ts index f5a7416e809..207293d1973 100644 --- a/src/test/achievements/achievement.test.ts +++ b/src/test/achievements/achievement.test.ts @@ -106,10 +106,10 @@ describe("RibbonAchv", () => { vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(0); vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(0); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(0); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(0); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([]); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([]); game = new GameManager(phaserGame); + game.override.startingWave(0); scene = game.scene; }); diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index 436b3227791..a185844e599 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -93,7 +93,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MEWTWO); vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RATTATA); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); @@ -113,7 +113,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MEWTWO); vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RATTATA); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]); vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]); @@ -233,7 +233,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MIGHTYENA); vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -247,7 +247,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MIGHTYENA); vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -266,7 +266,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); await game.startBattle([ @@ -295,7 +295,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); await game.startBattle(); @@ -313,7 +313,7 @@ describe("Test Battle Phase", () => { vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); await game.startBattle(); diff --git a/src/test/battle/error-handling.test.ts b/src/test/battle/error-handling.test.ts index 063ac2b5210..e65a6867919 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", () => { vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION); vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(2000); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([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 cc1d2057b9b..0a2b5d4106a 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -36,7 +36,7 @@ describe("Test Battle Phase", () => { it("startBattle 2vs1 boss", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10); + game.override.startingWave(10); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -47,7 +47,7 @@ describe("Test Battle Phase", () => { it("startBattle 2vs2 boss", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10); + game.override.startingWave(10); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -58,7 +58,7 @@ describe("Test Battle Phase", () => { it("startBattle 2vs2 trainer", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -69,7 +69,7 @@ describe("Test Battle Phase", () => { it("startBattle 2vs1 trainer", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -80,7 +80,7 @@ describe("Test Battle Phase", () => { it("startBattle 2vs1 rival", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(8); + game.override.startingWave(8); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -91,7 +91,7 @@ describe("Test Battle Phase", () => { it("startBattle 2vs2 rival", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(8); + game.override.startingWave(8); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -102,7 +102,7 @@ describe("Test Battle Phase", () => { it("startBattle 1vs1 trainer", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([ Species.BLASTOISE, ]); @@ -112,7 +112,7 @@ describe("Test Battle Phase", () => { it("startBattle 2vs2 trainer", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, @@ -123,7 +123,7 @@ describe("Test Battle Phase", () => { it("startBattle 4vs2 trainer", async() => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("double"); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([ Species.BLASTOISE, Species.CHARIZARD, diff --git a/src/test/moves/ceaseless_edge.test.ts b/src/test/moves/ceaseless_edge.test.ts index a59d6e8f535..b92979c56ed 100644 --- a/src/test/moves/ceaseless_edge.test.ts +++ b/src/test/moves/ceaseless_edge.test.ts @@ -105,7 +105,7 @@ describe("Moves - Ceaseless Edge", () => { "trainer - move should hit twice, apply two layers of spikes, force switch opponent - opponent takes damage", async () => { vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "MULTI_LENS"}]); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); await game.startBattle([ Species.ILLUMISE ]); diff --git a/src/test/moves/dynamax_cannon.test.ts b/src/test/moves/dynamax_cannon.test.ts index aab1b210f68..94e45b045ee 100644 --- a/src/test/moves/dynamax_cannon.test.ts +++ b/src/test/moves/dynamax_cannon.test.ts @@ -32,7 +32,7 @@ describe("Moves - Dynamax Cannon", () => { vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(200); // Note that, for Waves 1-10, the level cap is 10 - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(1); + game.override.startingWave(1); vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index 44f365ea689..a4fc1a4baeb 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -33,7 +33,7 @@ describe("Moves - Spikes", () => { 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); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3); + game.override.startingWave(3); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPIKES,Moves.SPLASH, Moves.ROAR]); }); @@ -86,7 +86,7 @@ describe("Moves - Spikes", () => { }, 20000); it("trainer - wild - force switch opponent - should take damage", async() => { - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); // player set spikes on the field and do splash for 3 turns // opponent do splash for 4 turns // nobody should take damage @@ -104,7 +104,7 @@ describe("Moves - Spikes", () => { }, 20000); it("trainer - wild - force switch by himself opponent - should take damage", async() => { - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5); + game.override.startingWave(5); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(5000); vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(0); // turn 1: player set spikes, opponent do splash diff --git a/src/test/moves/tackle.test.ts b/src/test/moves/tackle.test.ts index f4b335d9576..e36713fd086 100644 --- a/src/test/moves/tackle.test.ts +++ b/src/test/moves/tackle.test.ts @@ -34,7 +34,7 @@ describe("Moves - Tackle", () => { vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(1); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(97); + game.override.startingWave(97); vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]); vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GROWTH,Moves.GROWTH,Moves.GROWTH,Moves.GROWTH]); vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); diff --git a/src/test/ui/transfer-item.test.ts b/src/test/ui/transfer-item.test.ts index c20fa51aff9..ba0dce8d8b5 100644 --- a/src/test/ui/transfer-item.test.ts +++ b/src/test/ui/transfer-item.test.ts @@ -35,7 +35,7 @@ describe("UI - Transfer Items", () => { game = new GameManager(phaserGame); vi.spyOn(Overrides, "BATTLE_TYPE_OVERRIDE", "get").mockReturnValue("single"); vi.spyOn(Overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); - vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(1); + game.override.startingWave(1); vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([ { name: "BERRY", count: 1, type: BerryType.SITRUS }, { name: "BERRY", count: 2, type: BerryType.APICOT },