返回提交历史
Modified
src/controllers/dynamic/worldStateController.ts
+78
-0
Modified
static/fixed_responses/worldState/worldState.json
+0
-15
XFEstudio/XFESpaceNinjaServer
feat: archon hunt rotation (#1220)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1220
f7861698
代码差异
2 个文件
+78
-15
@@ -8,6 +8,8 @@ import { buildConfig } from "@/src/services/buildConfigService";
8
8
import { IMongoDate, IOid } from "@/src/types/commonTypes";
9
9
import { unixTimesInMs } from "@/src/constants/timeConstants";
10
10
import { config } from "@/src/services/configService";
11
import { CRng } from "@/src/services/rngService";
12
import { ExportRegions } from "warframe-public-export-plus";
11
13
12
14
export const worldStateController: RequestHandler = (req, res) => {
13
15
const worldState: IWorldState = {
@@ -18,6 +20,7 @@ export const worldStateController: RequestHandler = (req, res) => {
18
20
Time: Math.round(Date.now() / 1000),
19
21
Goals: [],
20
22
GlobalUpgrades: [],
23
LiteSorties: [],
21
24
EndlessXpChoices: [],
22
25
...staticWorldState
23
26
};
@@ -114,6 +117,67 @@ export const worldStateController: RequestHandler = (req, res) => {
114
117
});
115
118
}
116
119
120
// Archon Hunt cycling every week
121
{
122
const boss = ["SORTIE_BOSS_AMAR", "SORTIE_BOSS_NIRA", "SORTIE_BOSS_BOREAL"][week % 3];
123
const showdownNode = ["SolNode99", "SolNode53", "SolNode24"][week % 3];
124
const systemIndex = [3, 4, 2][week % 3]; // Mars, Jupiter, Earth
125
126
const nodes: string[] = [];
127
for (const [key, value] of Object.entries(ExportRegions)) {
128
if (
129
value.systemIndex === systemIndex &&
130
value.factionIndex !== undefined &&
131
value.factionIndex < 2 &&
132
value.name.indexOf("Archwing") == -1 &&
133
value.missionIndex != 0 // Exclude MT_ASSASSINATION
134
) {
135
nodes.push(key);
136
}
137
}
138
139
const rng = new CRng(week);
140
const firstNodeIndex = rng.randomInt(0, nodes.length - 1);
141
const firstNode = nodes[firstNodeIndex];
142
nodes.splice(firstNodeIndex, 1);
143
worldState.LiteSorties.push({
144
_id: {
145
$oid: Math.trunc(weekStart / 1000).toString(16) + "5e23a244740a190c"
146
},
147
Activation: { $date: { $numberLong: weekStart.toString() } },
148
Expiry: { $date: { $numberLong: weekEnd.toString() } },
149
Reward: "/Lotus/Types/Game/MissionDecks/ArchonSortieRewards",
150
Seed: week,
151
Boss: boss,
152
Missions: [
153
{
154
missionType: rng.randomElement([
155
"MT_INTEL",
156
"MT_MOBILE_DEFENSE",
157
"MT_EXTERMINATION",
158
"MT_SABOTAGE",
159
"MT_RESCUE"
160
]),
161
node: firstNode
162
},
163
{
164
missionType: rng.randomElement([
165
"MT_DEFENSE",
166
"MT_TERRITORY",
167
"MT_ARTIFACT",
168
"MT_EXCAVATE",
169
"MT_SURVIVAL"
170
]),
171
node: rng.randomElement(nodes)
172
},
173
{
174
missionType: "MT_ASSASSINATION",
175
node: showdownNode
176
}
177
]
178
});
179
}
180
117
181
// Circuit choices cycling every week
118
182
worldState.EndlessXpChoices.push({
119
183
Category: "EXC_NORMAL",
@@ -197,6 +261,7 @@ interface IWorldState {
197
261
Goals: IGoal[];
198
262
SyndicateMissions: ISyndicateMission[];
199
263
GlobalUpgrades: IGlobalUpgrade[];
264
LiteSorties: ILiteSortie[];
200
265
NodeOverrides: INodeOverride[];
201
266
EndlessXpChoices: IEndlessXpChoice[];
202
267
KnownCalendarSeasons: ICalendarSeason[];
@@ -250,6 +315,19 @@ interface INodeOverride {
250
315
CustomNpcEncounters?: string;
251
316
}
252
317
318
interface ILiteSortie {
319
_id: IOid;
320
Activation: IMongoDate;
321
Expiry: IMongoDate;
322
Reward: "/Lotus/Types/Game/MissionDecks/ArchonSortieRewards";
323
Seed: number;
324
Boss: string; // "SORTIE_BOSS_AMAR" | "SORTIE_BOSS_NIRA" | "SORTIE_BOSS_BOREAL"
325
Missions: {
326
missionType: string;
327
node: string;
328
}[];
329
}
330
253
331
interface IEndlessXpChoice {
254
332
Category: string;
255
333
Choices: string[];
@@ -79,21 +79,6 @@
79
79
"Twitter": true
80
80
}
81
81
],
82
"LiteSorties": [
83
{
84
"_id": { "$oid": "663819fd1cec9ebe9d83a06e" },
85
"Activation": { "$date": { "$numberLong": "1714953600000" } },
86
"Expiry": { "$date": { "$numberLong": "2000000000000" } },
87
"Reward": "/Lotus/Types/Game/MissionDecks/ArchonSortieRewards",
88
"Seed": 58034,
89
"Boss": "SORTIE_BOSS_NIRA",
90
"Missions": [
91
{ "missionType": "MT_MOBILE_DEFENSE", "node": "SolNode125" },
92
{ "missionType": "MT_SURVIVAL", "node": "SolNode74" },
93
{ "missionType": "MT_ASSASSINATION", "node": "SolNode53" }
94
]
95
}
96
],
97
82
"SyndicateMissions": [
98
83
{
99
84
"_id": { "$oid": "663a4fc5ba6f84724fa48049" },