From 8f15788b39930906d1c451a51c5731cec10d5f2f Mon Sep 17 00:00:00 2001 From: Jimmybald1 <122436263+Jimmybald1@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:43:38 +0100 Subject: [PATCH] [Misc] Added a Daily Run Seed Override to the overrides. Only works locally. (#5330) * [Misc] Added a Daily Run Seed Override to the overrides. Only works locally. * [Misc] Changed Daily Run Seed Override to string | null Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --------- Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: damocleas --- src/overrides.ts | 1 + src/phases/title-phase.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/overrides.ts b/src/overrides.ts index e53d3b766c4..d15370259fc 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -47,6 +47,7 @@ class DefaultOverrides { // ----------------- /** a specific seed (default: a random string of 24 characters) */ readonly SEED_OVERRIDE: string = ""; + readonly DAILY_RUN_SEED_OVERRIDE: string | null = null; readonly WEATHER_OVERRIDE: WeatherType = WeatherType.NONE; /** * If `null`, ignore this override. diff --git a/src/phases/title-phase.ts b/src/phases/title-phase.ts index 0d486da1998..a560897037e 100644 --- a/src/phases/title-phase.ts +++ b/src/phases/title-phase.ts @@ -21,6 +21,7 @@ import { SelectChallengePhase } from "./select-challenge-phase"; import { SelectStarterPhase } from "./select-starter-phase"; import { SummonPhase } from "./summon-phase"; import { globalScene } from "#app/global-scene"; +import Overrides from "#app/overrides"; export class TitlePhase extends Phase { @@ -256,7 +257,11 @@ export class TitlePhase extends Phase { console.error("Failed to load daily run:\n", err); }); } else { - generateDaily(btoa(new Date().toISOString().substring(0, 10))); + let seed: string = btoa(new Date().toISOString().substring(0, 10)); + if (!Utils.isNullOrUndefined(Overrides.DAILY_RUN_SEED_OVERRIDE)) { + seed = Overrides.DAILY_RUN_SEED_OVERRIDE; + } + generateDaily(seed); } }); }