From f561884f2c95ca8b446bc2d72da7ecec6f03fd7c Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Thu, 31 Jul 2025 02:27:38 -0700 Subject: [PATCH] feat: worldState.baroTennoConRelay config (#2574) Closes #2531 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2574 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/inventoryController.ts | 11 ++++ src/services/configService.ts | 1 + src/services/worldStateService.ts | 64 ++++++++++++++++------ static/webui/index.html | 4 ++ static/webui/translations/de.js | 1 + static/webui/translations/en.js | 1 + static/webui/translations/es.js | 1 + static/webui/translations/fr.js | 1 + static/webui/translations/ru.js | 1 + static/webui/translations/zh.js | 1 + 10 files changed, 69 insertions(+), 17 deletions(-) diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 357c34cb..53c82da5 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -335,6 +335,17 @@ export const getInventoryResponse = async ( for (const uniqueName in ExportFlavour) { inventoryResponse.FlavourItems.push({ ItemType: uniqueName }); } + } else if (config.worldState?.baroTennoConRelay) { + [ + "/Lotus/Types/Items/Events/TennoConRelay2022EarlyAccess", + "/Lotus/Types/Items/Events/TennoConRelay2023EarlyAccess", + "/Lotus/Types/Items/Events/TennoConRelay2024EarlyAccess", + "/Lotus/Types/Items/Events/TennoConRelay2025EarlyAccess" + ].forEach(uniqueName => { + if (!inventoryResponse.FlavourItems.some(x => x.ItemType == uniqueName)) { + inventoryResponse.FlavourItems.push({ ItemType: uniqueName }); + } + }); } if (config.unlockAllSkins) { diff --git a/src/services/configService.ts b/src/services/configService.ts index f92fe010..f46c747b 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -82,6 +82,7 @@ export interface IConfig { affinityBoost?: boolean; resourceBoost?: boolean; tennoLiveRelay?: boolean; + baroTennoConRelay?: boolean; galleonOfGhouls?: number; starDaysOverride?: boolean; eidolonOverride?: string; diff --git a/src/services/worldStateService.ts b/src/services/worldStateService.ts index fc757768..804be155 100644 --- a/src/services/worldStateService.ts +++ b/src/services/worldStateService.ts @@ -1157,6 +1157,25 @@ const getIdealTimeSatsifyingConstraints = (constraints: ITimeConstraint[]): numb return timeSecs; }; +const fullyStockBaro = (vt: IVoidTrader): void => { + for (const armorSet of baro.armorSets) { + if (Array.isArray(armorSet[0])) { + for (const set of armorSet as IVoidTraderOffer[][]) { + for (const item of set) { + vt.Manifest.push(item); + } + } + } else { + for (const item of armorSet as IVoidTraderOffer[]) { + vt.Manifest.push(item); + } + } + } + for (const item of baro.rest) { + vt.Manifest.push(item); + } +}; + const getVarziaRotation = (week: number): string => { const seed = new SRng(week).randomInt(0, 100_000); const rng = new SRng(seed); @@ -1402,6 +1421,33 @@ export const getWorldState = (buildLabel?: string): IWorldState => { Node: "TennoConBHUB6" }); } + if (config.worldState?.baroTennoConRelay) { + worldState.Goals.push({ + _id: { $oid: "687bb2f00000000000000000" }, + Activation: { $date: { $numberLong: "1752937200000" } }, + Expiry: { $date: { $numberLong: "2000000000000" } }, + Count: 0, + Goal: 0, + Success: 0, + Personal: true, + //"Faction": "FC_GRINEER", + Desc: "/Lotus/Language/Locations/RelayStationTennoCon", + ToolTip: "/Lotus/Language/Locations/RelayStationTennoConDesc", + Icon: "/Lotus/Interface/Icons/Categories/IconTennoConSigil.png", + Tag: "TennoConRelay", + Node: "TennoConHUB2" + }); + const vt: IVoidTrader = { + _id: { $oid: "687809030379266d790495c6" }, + Activation: { $date: { $numberLong: "1752937200000" } }, + Expiry: { $date: { $numberLong: "2000000000000" } }, + Character: "Baro'Ki Teel", + Node: "TennoConHUB2", + Manifest: [] + }; + worldState.VoidTraders.push(vt); + fullyStockBaro(vt); + } const isFebruary = date.getUTCMonth() == 1; if (config.worldState?.starDaysOverride ?? isFebruary) { worldState.Goals.push({ @@ -1633,24 +1679,8 @@ export const getWorldState = (buildLabel?: string): IWorldState => { }; worldState.VoidTraders.push(vt); if (isBeforeNextExpectedWorldStateRefresh(timeMs, baroActualStart)) { - vt.Manifest = []; if (config.baroFullyStocked) { - for (const armorSet of baro.armorSets) { - if (Array.isArray(armorSet[0])) { - for (const set of armorSet as IVoidTraderOffer[][]) { - for (const item of set) { - vt.Manifest.push(item); - } - } - } else { - for (const item of armorSet as IVoidTraderOffer[]) { - vt.Manifest.push(item); - } - } - } - for (const item of baro.rest) { - vt.Manifest.push(item); - } + fullyStockBaro(vt); } else { const rng = new SRng(new SRng(baroIndex).randomInt(0, 100_000)); // TOVERIFY: Constraint for upgrades amount? diff --git a/static/webui/index.html b/static/webui/index.html index 398c1661..0c0bd3c6 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -929,6 +929,10 @@ +