From a87aec4f279fa0b181aeda00e46a568d44f5864e Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 25 Jul 2024 16:15:06 -0700 Subject: [PATCH] add OverridesHelper.disableCrits() --- src/test/utils/overridesHelper.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/test/utils/overridesHelper.ts b/src/test/utils/overridesHelper.ts index 42600318a0f..caaef1a2c0e 100644 --- a/src/test/utils/overridesHelper.ts +++ b/src/test/utils/overridesHelper.ts @@ -101,18 +101,27 @@ export class OverridesHelper { } /** - * Override each wave to have or not have standard trainer battles + * Override each wave to not have standard trainer battles * @returns this - * @param disable true */ - disableTrainerWaves(disable: boolean): this { + disableTrainerWaves(): this { const realFn = getGameMode; vi.spyOn(GameMode, "getGameMode").mockImplementation((gameMode: GameModes) => { const mode = realFn(gameMode); - mode.hasTrainers = !disable; + mode.hasTrainers = false; return mode; }); - this.log(`Standard trainer waves are ${disable ? "disabled" : "enabled"}!`); + this.log("Standard trainer waves are disabled!"); + return this; + } + + /** + * Override each wave to not have critical hits + * @returns this + */ + disableCrits() { + vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true); + this.log("Critical hits are disabled!"); return this; }