diff --git a/src/services/conquestService.ts b/src/services/conquestService.ts index f950b20a..16f20041 100644 --- a/src/services/conquestService.ts +++ b/src/services/conquestService.ts @@ -423,3 +423,20 @@ export const getConquest = ( RandomSeed: rng.randomInt(0, 1_000_000) }; }; + +export const getMissionTypeForLegacyOverride = (missionType: TMissionType, conquestType: TConquestType): string => { + if (missionType == "MT_ENDLESS_CAPTURE") { + return "EndlessCapture"; + } + let str = missionType.substring(3, 4).toUpperCase() + missionType.substring(4).toLowerCase(); + if (str == "Extermination") { + str = "Exterminate"; + } + if (str == "Artifact") { + str = "Disruption"; + } + if (str == "Defense" && conquestType == "CT_LAB") { + str = "DualDefense"; + } + return str; +}; diff --git a/src/services/worldStateService.ts b/src/services/worldStateService.ts index 9ba454fb..fb6cbea5 100644 --- a/src/services/worldStateService.ts +++ b/src/services/worldStateService.ts @@ -41,7 +41,7 @@ import type { import { toMongoDate, toOid, version_compare } from "../helpers/inventoryHelpers.ts"; import { logger } from "../utils/logger.ts"; import { DailyDeal, Fissure } from "../models/worldStateModel.ts"; -import { getConquest } from "./conquestService.ts"; +import { getConquest, getMissionTypeForLegacyOverride } from "./conquestService.ts"; const sortieBosses = [ "SORTIE_BOSS_HYENA", @@ -3562,13 +3562,11 @@ export const getWorldState = (buildLabel?: string): IWorldState => { worldState.KnownCalendarSeasons.push(getCalendarSeason(week + 1)); } + const season = (["CST_WINTER", "CST_SPRING", "CST_SUMMER", "CST_FALL"] as const)[week % 4]; + const labConquest = getConquest("CT_LAB", week, null); + const hexConquest = getConquest("CT_HEX", week, season); if (!buildLabel || version_compare(buildLabel, "2025.10.14.16.10") >= 0) { - worldState.Conquests = []; - { - const season = (["CST_WINTER", "CST_SPRING", "CST_SUMMER", "CST_FALL"] as const)[week % 4]; - worldState.Conquests.push(getConquest("CT_LAB", week, null)); - worldState.Conquests.push(getConquest("CT_HEX", week, season)); - } + worldState.Conquests = [labConquest, hexConquest]; if (isBeforeNextExpectedWorldStateRefresh(timeMs, weekEnd)) { const season = (["CST_WINTER", "CST_SPRING", "CST_SUMMER", "CST_FALL"] as const)[(week + 1) % 4]; worldState.Conquests.push(getConquest("CT_LAB", week, null)); @@ -3621,6 +3619,18 @@ export const getWorldState = (buildLabel?: string): IWorldState => { e: cheeseEnd, n: cheeseNext }, + lqo: { + mt: labConquest.Missions.map(x => getMissionTypeForLegacyOverride(x.missionType, "CT_LAB")), + mv: labConquest.Missions.map(x => x.difficulties[1].deviation), + c: labConquest.Missions.map(x => x.difficulties[1].risks), + fv: labConquest.Variables + }, + hqo: { + mt: hexConquest.Missions.map(x => getMissionTypeForLegacyOverride(x.missionType, "CT_HEX")), + mv: hexConquest.Missions.map(x => x.difficulties[1].deviation), + c: hexConquest.Missions.map(x => x.difficulties[1].risks), + fv: hexConquest.Variables + }, sfn: [550, 553, 554, 555][halfHour % 4] }; if (Array.isArray(config.worldState?.circuitGameModes)) { diff --git a/src/types/worldStateTypes.ts b/src/types/worldStateTypes.ts index 799e261d..c323fa0f 100644 --- a/src/types/worldStateTypes.ts +++ b/src/types/worldStateTypes.ts @@ -485,9 +485,9 @@ interface IFbst { // < 40.0.0 interface IConquestOverride { - mt?: string[]; // mission types but "Exterminate" instead of "MT_EXTERMINATION", etc. and "DualDefense" instead of "Defense" for hex conquest + mt?: string[]; mv?: string[]; - mf?: number[]; // hex conquest only + mf?: number[]; // hex conquest only. unknown purpose. c?: [string, string][]; fv?: string[]; }