From a5dd3bde5755e28a8bccdb0aa8e4ac900d72bf36 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 17 Mar 2025 14:33:49 +0100 Subject: [PATCH] feat: archon hunt rotation --- .../dynamic/worldStateController.ts | 75 +++++++++++++++++++ .../worldState/worldState.json | 15 ---- 2 files changed, 75 insertions(+), 15 deletions(-) diff --git a/src/controllers/dynamic/worldStateController.ts b/src/controllers/dynamic/worldStateController.ts index 4772751b..4560abec 100644 --- a/src/controllers/dynamic/worldStateController.ts +++ b/src/controllers/dynamic/worldStateController.ts @@ -8,6 +8,8 @@ import { buildConfig } from "@/src/services/buildConfigService"; import { IMongoDate, IOid } from "@/src/types/commonTypes"; import { unixTimesInMs } from "@/src/constants/timeConstants"; import { config } from "@/src/services/configService"; +import { CRng } from "@/src/services/rngService"; +import { ExportRegions } from "warframe-public-export-plus"; export const worldStateController: RequestHandler = (req, res) => { const worldState: IWorldState = { @@ -18,6 +20,7 @@ export const worldStateController: RequestHandler = (req, res) => { Time: Math.round(Date.now() / 1000), Goals: [], GlobalUpgrades: [], + LiteSorties: [], EndlessXpChoices: [], ...staticWorldState }; @@ -114,6 +117,64 @@ export const worldStateController: RequestHandler = (req, res) => { }); } + // Archon Hunt cycling every week + { + const boss = ["SORTIE_BOSS_AMAR", "SORTIE_BOSS_NIRA", "SORTIE_BOSS_BOREAL"][week % 3]; + const showdownNode = ["SolNode99", "SolNode53", "SolNode24"][week % 3]; + const systemIndex = [3, 4, 2][week % 3]; // Mars, Jupiter, Earth + + const nodes: string[] = []; + for (const [key, value] of Object.entries(ExportRegions)) { + if ( + value.systemIndex === systemIndex && + value.factionIndex !== undefined && + value.factionIndex < 2 && + value.name.indexOf("Archwing") == -1 && + value.missionIndex != 0 // Exclude MT_ASSASSINATION + ) { + nodes.push(key); + } + } + + const rng = new CRng(week); + worldState.LiteSorties.push({ + _id: { + $oid: Math.trunc(weekStart / 1000).toString(16) + "5e23a244740a190c" + }, + Activation: { $date: { $numberLong: weekStart.toString() } }, + Expiry: { $date: { $numberLong: weekEnd.toString() } }, + Reward: "/Lotus/Types/Game/MissionDecks/ArchonSortieRewards", + Seed: week, + Boss: boss, + Missions: [ + { + missionType: rng.randomElement([ + "MT_INTEL", + "MT_MOBILE_DEFENSE", + "MT_EXTERMINATION", + "MT_SABOTAGE", + "MT_RESCUE" + ]), + node: rng.randomElement(nodes) + }, + { + missionType: rng.randomElement([ + "MT_DEFENSE", + "MT_TERRITORY", + "MT_ARTIFACT", + "MT_EXCAVATE", + "MT_SURVIVAL" + ]), + node: rng.randomElement(nodes) + }, + { + missionType: "MT_ASSASSINATION", + node: showdownNode + } + ] + }); + } + // Circuit choices cycling every week worldState.EndlessXpChoices.push({ Category: "EXC_NORMAL", @@ -197,6 +258,7 @@ interface IWorldState { Goals: IGoal[]; SyndicateMissions: ISyndicateMission[]; GlobalUpgrades: IGlobalUpgrade[]; + LiteSorties: ILiteSortie[]; NodeOverrides: INodeOverride[]; EndlessXpChoices: IEndlessXpChoice[]; KnownCalendarSeasons: ICalendarSeason[]; @@ -250,6 +312,19 @@ interface INodeOverride { CustomNpcEncounters?: string; } +interface ILiteSortie { + _id: IOid; + Activation: IMongoDate; + Expiry: IMongoDate; + Reward: "/Lotus/Types/Game/MissionDecks/ArchonSortieRewards"; + Seed: number; + Boss: string; // "SORTIE_BOSS_AMAR" | "SORTIE_BOSS_NIRA" | "SORTIE_BOSS_BOREAL" + Missions: { + missionType: string; + node: string; + }[]; +} + interface IEndlessXpChoice { Category: string; Choices: string[]; diff --git a/static/fixed_responses/worldState/worldState.json b/static/fixed_responses/worldState/worldState.json index 047dfd86..9a93bcb8 100644 --- a/static/fixed_responses/worldState/worldState.json +++ b/static/fixed_responses/worldState/worldState.json @@ -79,21 +79,6 @@ "Twitter": true } ], - "LiteSorties": [ - { - "_id": { "$oid": "663819fd1cec9ebe9d83a06e" }, - "Activation": { "$date": { "$numberLong": "1714953600000" } }, - "Expiry": { "$date": { "$numberLong": "2000000000000" } }, - "Reward": "/Lotus/Types/Game/MissionDecks/ArchonSortieRewards", - "Seed": 58034, - "Boss": "SORTIE_BOSS_NIRA", - "Missions": [ - { "missionType": "MT_MOBILE_DEFENSE", "node": "SolNode125" }, - { "missionType": "MT_SURVIVAL", "node": "SolNode74" }, - { "missionType": "MT_ASSASSINATION", "node": "SolNode53" } - ] - } - ], "SyndicateMissions": [ { "_id": { "$oid": "663a4fc5ba6f84724fa48049" },