diff --git a/config-vanilla.json b/config-vanilla.json index 05e7905f..3943d3de 100644 --- a/config-vanilla.json +++ b/config-vanilla.json @@ -82,8 +82,8 @@ "darvoStockMultiplier": 1, "varziaOverride": "", "varziaFullyStocked": false, - "plagueStar": false, - "ghoulEmergence": false + "plagueStar": null, + "ghoulEmergence": null }, "dev": { "keepVendorsExpired": false diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 8b056956..4d8c9439 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -1259,7 +1259,7 @@ export const addMissionRewards = async ( } } - if (!AffiliationMods) AffiliationMods ??= []; + AffiliationMods ??= []; if (rewardInfo.JobStage != undefined && rewardInfo.jobId) { // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/src/services/worldStateService.ts b/src/services/worldStateService.ts index 2de08f46..46784866 100644 --- a/src/services/worldStateService.ts +++ b/src/services/worldStateService.ts @@ -1563,17 +1563,24 @@ export const getWorldState = (buildLabel?: string): IWorldState => { }); } - if (config.worldState?.plagueStar) { + const firstNovemberWeekday = new Date(Date.UTC(date.getUTCFullYear(), 10, 1)).getUTCDay(); + const firstNovemberMondayOffset = (8 - firstNovemberWeekday) % 7; + + const plagueStarStart = Date.UTC(date.getUTCFullYear(), 10, firstNovemberMondayOffset + 1, 16); + const plagueStarEnd = Date.UTC(date.getUTCFullYear(), 10, firstNovemberMondayOffset + 15, 16); + + const isPlagueStarActive = timeMs >= plagueStarStart && timeMs < plagueStarEnd; + if (config.worldState?.plagueStar ?? isPlagueStarActive) { worldState.Goals.push({ _id: { $oid: "654a5058c757487cdb11824f" }, Activation: { $date: { - $numberLong: "1699372800000" + $numberLong: config.worldState?.plagueStar ? "1699372800000" : plagueStarStart.toString() } }, Expiry: { $date: { - $numberLong: "2000000000000" + $numberLong: config.worldState?.plagueStar ? "2000000000000" : plagueStarEnd.toString() } }, Tag: "InfestedPlains", @@ -1692,7 +1699,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => { pushClassicBounties(worldState.SyndicateMissions, bountyCycle); } while (isBeforeNextExpectedWorldStateRefresh(timeMs, bountyCycleEnd) && ++bountyCycle); - if (config.worldState?.ghoulEmergence) { + const ghoulsCycleDay = day % 21; + const isGhoulEmergenceActive = ghoulsCycleDay >= 17 && ghoulsCycleDay <= 20; // 4 days for event and 17 days for break + if (config.worldState?.ghoulEmergence ?? isGhoulEmergenceActive) { const ghoulPool = [...eidolonGhoulJobs]; const pastGhoulPool = [...eidolonGhoulJobs]; @@ -1702,11 +1711,38 @@ export const getWorldState = (buildLabel?: string): IWorldState => { const rng = new SRng(seed); const pastRng = new SRng(pastSeed); + const activeStartDay = day - ghoulsCycleDay + 17; + const activeEndDay = activeStartDay + 5; + const dayWithFraction = (timeMs - EPOCH) / 86400000; + + const progress = (dayWithFraction - activeStartDay) / (activeEndDay - activeStartDay); + const healthPct = 1 - Math.min(Math.max(progress, 0), 1); + worldState.Goals.push({ _id: { $oid: "687ebbe6d1d17841c9c59f38" }, - Activation: { $date: { $numberLong: "1753204900185" } }, - Expiry: { $date: { $numberLong: "2000000000000" } }, - HealthPct: 1, + Activation: { + $date: { + $numberLong: config.worldState?.ghoulEmergence + ? "1753204900185" + : Date.UTC( + date.getUTCFullYear(), + date.getUTCMonth(), + date.getUTCDate() + (day - ghoulsCycleDay + 17) + ).toString() + } + }, + Expiry: { + $date: { + $numberLong: config.worldState?.ghoulEmergence + ? "2000000000000" + : Date.UTC( + date.getUTCFullYear(), + date.getUTCMonth(), + date.getUTCDate() + (day - ghoulsCycleDay + 21) + ).toString() + } + }, + HealthPct: config.worldState?.ghoulEmergence ? 1 : healthPct, VictimNode: "SolNode228", Regions: [2], Success: 0, @@ -1737,7 +1773,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => { } ], JobPreviousVersion: { - $oid: (((bountyCycle - 9000) / 1000) & 0xffffffff).toString(16).padStart(8, "0") + "0000000000000008" + $oid: (((bountyCycle - 1) * 9000) & 0xffffffff).toString(16).padStart(8, "0") + "0000000000000008" }, PreviousJobs: [ { diff --git a/static/webui/index.html b/static/webui/index.html index 10434d23..2c52560f 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -937,14 +937,6 @@ -
- - -
-
- - -
+
+ + +
+
+ + +