返回提交历史
Modified
src/services/worldStateService.ts
+34
-28
XFEstudio/XFESpaceNinjaServer
fix: provide upcoming nightwave daily challenge if rollover is imminent (#1667)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1667 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
deb652ab
代码差异
1 个文件
+34
-28
@@ -374,34 +374,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
374
374
Season: 14,
375
375
Phase: 0,
376
376
Params: "",
377
ActiveChallenges: [
378
getSeasonDailyChallenge(day - 2),
379
getSeasonDailyChallenge(day - 1),
380
getSeasonDailyChallenge(day - 0),
381
getSeasonWeeklyChallenge(week, 0),
382
getSeasonWeeklyChallenge(week, 1),
383
getSeasonWeeklyHardChallenge(week, 2),
384
getSeasonWeeklyHardChallenge(week, 3),
385
{
386
_id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 0).toString().padStart(8, "0") },
387
Activation: { $date: { $numberLong: weekStart.toString() } },
388
Expiry: { $date: { $numberLong: weekEnd.toString() } },
389
Challenge:
390
"/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentCompleteMissions" + (week - 12)
391
},
392
{
393
_id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 1).toString().padStart(8, "0") },
394
Activation: { $date: { $numberLong: weekStart.toString() } },
395
Expiry: { $date: { $numberLong: weekEnd.toString() } },
396
Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEximus" + (week - 12)
397
},
398
{
399
_id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 2).toString().padStart(8, "0") },
400
Activation: { $date: { $numberLong: weekStart.toString() } },
401
Expiry: { $date: { $numberLong: weekEnd.toString() } },
402
Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEnemies" + (week - 12)
403
}
404
]
377
ActiveChallenges: []
405
378
},
406
379
...staticWorldState,
407
380
SyndicateMissions: [...staticWorldState.SyndicateMissions]
@@ -424,6 +397,37 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
424
397
});
425
398
}
426
399
400
// Nightwave Challenges
401
worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 2));
402
worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 1));
403
worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 0));
404
if (isBeforeNextExpectedWorldStateRefresh(EPOCH + (day + 1) * 86400000)) {
405
worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day + 1));
406
}
407
worldState.SeasonInfo.ActiveChallenges.push(getSeasonWeeklyChallenge(week, 0));
408
worldState.SeasonInfo.ActiveChallenges.push(getSeasonWeeklyChallenge(week, 1));
409
worldState.SeasonInfo.ActiveChallenges.push(getSeasonWeeklyHardChallenge(week, 2));
410
worldState.SeasonInfo.ActiveChallenges.push(getSeasonWeeklyHardChallenge(week, 3));
411
worldState.SeasonInfo.ActiveChallenges.push({
412
_id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 0).toString().padStart(8, "0") },
413
Activation: { $date: { $numberLong: weekStart.toString() } },
414
Expiry: { $date: { $numberLong: weekEnd.toString() } },
415
Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentCompleteMissions" + (week - 12)
416
});
417
worldState.SeasonInfo.ActiveChallenges.push({
418
_id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 1).toString().padStart(8, "0") },
419
Activation: { $date: { $numberLong: weekStart.toString() } },
420
Expiry: { $date: { $numberLong: weekEnd.toString() } },
421
Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEximus" + (week - 12)
422
});
423
worldState.SeasonInfo.ActiveChallenges.push({
424
_id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 2).toString().padStart(8, "0") },
425
Activation: { $date: { $numberLong: weekStart.toString() } },
426
Expiry: { $date: { $numberLong: weekEnd.toString() } },
427
Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEnemies" + (week - 12)
428
});
429
// TODO: Provide upcoming weekly acts if rollover is imminent
430
427
431
// Elite Sanctuary Onslaught cycling every week
428
432
worldState.NodeOverrides.find(x => x.Node == "SolNode802")!.Seed = week; // unfaithful
429
433
@@ -737,6 +741,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
737
741
pushSortieIfRelevant(worldState.Sorties, day);
738
742
739
743
// Archon Hunt cycling every week
744
// TODO: Handle imminent rollover
740
745
{
741
746
const boss = ["SORTIE_BOSS_AMAR", "SORTIE_BOSS_NIRA", "SORTIE_BOSS_BOREAL"][week % 3];
742
747
const showdownNode = ["SolNode99", "SolNode53", "SolNode24"][week % 3];
@@ -829,6 +834,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
829
834
});
830
835
831
836
// 1999 Calendar Season cycling every week + YearIteration every 4 weeks
837
// TODO: Handle imminent rollover
832
838
worldState.KnownCalendarSeasons[0].Activation = { $date: { $numberLong: weekStart.toString() } };
833
839
worldState.KnownCalendarSeasons[0].Expiry = { $date: { $numberLong: weekEnd.toString() } };
834
840
worldState.KnownCalendarSeasons[0].Season = ["CST_WINTER", "CST_SPRING", "CST_SUMMER", "CST_FALL"][week % 4];