mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-27 01:06:09 +00:00
add OverridesHelper.disableCrits()
This commit is contained in:
parent
a025e30200
commit
a87aec4f27
@ -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
|
* @returns this
|
||||||
* @param disable true
|
|
||||||
*/
|
*/
|
||||||
disableTrainerWaves(disable: boolean): this {
|
disableTrainerWaves(): this {
|
||||||
const realFn = getGameMode;
|
const realFn = getGameMode;
|
||||||
vi.spyOn(GameMode, "getGameMode").mockImplementation((gameMode: GameModes) => {
|
vi.spyOn(GameMode, "getGameMode").mockImplementation((gameMode: GameModes) => {
|
||||||
const mode = realFn(gameMode);
|
const mode = realFn(gameMode);
|
||||||
mode.hasTrainers = !disable;
|
mode.hasTrainers = false;
|
||||||
return mode;
|
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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user