From 12079f5d9b5b62511caa27f5fc820e27fd934cb8 Mon Sep 17 00:00:00 2001 From: figment123 <234728018+figment123@users.noreply.github.com> Date: Mon, 6 Oct 2025 10:54:42 -0300 Subject: [PATCH] tried another way --- config-vanilla.json | 1 + src/services/configService.ts | 3 +- src/services/missionInventoryUpdateService.ts | 92 +++++---- src/services/worldStateService.ts | 184 +++++++++--------- src/types/requestTypes.ts | 1 + src/types/worldStateTypes.ts | 26 ++- static/webui/index.html | 20 +- 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 | 21 +- static/webui/translations/uk.js | 21 +- static/webui/translations/zh.js | 1 + 14 files changed, 202 insertions(+), 172 deletions(-) diff --git a/config-vanilla.json b/config-vanilla.json index b8810686..a0e8674f 100644 --- a/config-vanilla.json +++ b/config-vanilla.json @@ -31,6 +31,7 @@ "baroAlwaysAvailable": false, "baroFullyStocked": false, "varziaFullyStocked": false, + "voidCorruption": false, "wolfHunt": false, "orphixVenom": false, "longShadow": false, diff --git a/src/services/configService.ts b/src/services/configService.ts index d4704c5a..39df1756 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -41,13 +41,12 @@ export interface IConfig { baroAlwaysAvailable?: boolean; baroFullyStocked?: boolean; varziaFullyStocked?: boolean; + voidCorruption?: boolean; wolfHunt?: boolean; orphixVenom?: boolean; longShadow?: boolean; hallowedFlame?: boolean; anniversary?: number; - voidCorruptionAlerts?: boolean; - voidCorruptionAlertsOverride?: number; hallowedNightmares?: boolean; hallowedNightmaresRewardsOverride?: number; naberusNightsOverride?: boolean; diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index dfb6c815..70ade363 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -1154,6 +1154,28 @@ export const addMissionRewards = async ( let ConquestCompletedMissionsCount; let missionCompletionCredits = 0; + + if (rewardInfo.alertId) { + const alert = getWorldState().Alerts.find(x => x._id.$oid == rewardInfo.alertId); + if (!alert) { + logger.warn(`mission completed unknown alert`, { alertId: rewardInfo.alertId }); + } else { + inventory.CompletedAlerts ??= []; + if (inventory.CompletedAlerts.includes(alert._id.$oid)) { + logger.debug(`alert ${alert._id.$oid} already completed, skipping alert reward`); + } else { + inventory.CompletedAlerts.push(alert._id.$oid); + if (alert.MissionInfo.missionReward) { + missionCompletionCredits += addFixedLevelRewards( + alert.MissionInfo.missionReward, + MissionRewards, + rewardInfo + ); + } + } + } + } + //inventory change is what the client has not rewarded itself, also the client needs to know the credit changes for display if (rewardInfo.goalId) { @@ -2483,95 +2505,95 @@ const goalMessagesByKey: Record, SORTIE_BOSS_VOR: "SolNode108" }; +const voidCorruptionAlerts = [ + { + _id: { $oid: "677d452e2f324ee7b90f8ccf" }, + Activation: { $date: { $numberLong: "1736524800000" } }, + Expiry: { $date: { $numberLong: "1736784000000" } }, + MissionInfo: { + location: "SolNode61", + missionType: "MT_SABOTAGE", + faction: "FC_CORPUS", + difficulty: 1, + missionReward: { + credits: 30000, + items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedFireRateDamagePistol"] + }, + levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipCoreSabotage", + enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipSquadA", + extraEnemySpec: "/Lotus/Types/Game/EnemySpecs/GamemodeExtraEnemySpecs/CorpusSabotageTiersA", + minEnemyLevel: 10, + maxEnemyLevel: 15 + } + }, + { + _id: { $oid: "677d45811daeae9de40e8c0f" }, + Activation: { $date: { $numberLong: "1737129600000" } }, + Expiry: { $date: { $numberLong: "2000000000000" } }, + MissionInfo: { + location: "SettlementNode11", + missionType: "MT_DEFENSE", + faction: "FC_CORPUS", + difficulty: 1, + missionReward: { + credits: 30000, + items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedCritChanceFireRatePistol"] + }, + levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipDefense", + enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipSquadDefenseB", + minEnemyLevel: 20, + maxEnemyLevel: 25, + maxWaveNum: 10 + } + }, + { + _id: { $oid: "677d45a494ad716c90006b9a" }, + Activation: { $date: { $numberLong: "1737734400000" } }, + Expiry: { $date: { $numberLong: "2000000000000" } }, + MissionInfo: { + location: "SolNode118", + missionType: "MT_ARTIFACT", + faction: "FC_CORPUS", + difficulty: 1, + missionReward: { + credits: 30000, + items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedCritDamagePistol"] + }, + levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipDisruption", + enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipSurvivalA", + extraEnemySpec: "/Lotus/Types/Game/EnemySpecs/SpecialMissionSpecs/DisruptionCorpusShip", + customAdvancedSpawners: ["/Lotus/Types/Enemies/AdvancedSpawners/ErrantSpecterInvasion"], + minEnemyLevel: 30, + maxEnemyLevel: 35 + } + }, + { + _id: { $oid: "677d4700682d173abb0e19fe" }, + Activation: { $date: { $numberLong: "1738339200000" } }, + Expiry: { $date: { $numberLong: "2000000000000" } }, + MissionInfo: { + location: "SolNode4", + missionType: "MT_EXTERMINATION", + faction: "FC_CORPUS", + difficulty: 1, + missionReward: { + credits: 30000, + items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedDamageRecoilPistol"] + }, + levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipExterminate", + enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipExterminateMixed", + minEnemyLevel: 40, + maxEnemyLevel: 45 + } + } +] satisfies readonly IAlert[]; + const eidolonJobs: readonly string[] = [ "/Lotus/Types/Gameplay/Eidolon/Jobs/AssassinateBountyAss", "/Lotus/Types/Gameplay/Eidolon/Jobs/AssassinateBountyCap", @@ -1481,6 +1565,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => { worldState.VoidTraders.push(vt); fullyStockBaro(vt); } + if (config.worldState?.voidCorruption) { + worldState.Alerts.push(...voidCorruptionAlerts.map(alert => structuredClone(alert))); + } const isFebruary = date.getUTCMonth() == 1; if (config.worldState?.starDaysOverride ?? isFebruary) { worldState.Goals.push({ @@ -2161,103 +2248,6 @@ export const getWorldState = (buildLabel?: string): IWorldState => { }); } - if (config.worldState?.voidCorruptionAlerts) { - const year = config.worldState.voidCorruptionAlertsOverride ?? 0; - - const alertsByYear = [ - //2025 - [ - { - _id: { $oid: "677d452e2f324ee7b90f8ccf" }, - Activation: { $date: { $numberLong: "1736524800000" } }, - Expiry: { $date: { $numberLong: "2000000000000" } }, - MissionInfo: { - location: "SolNode61", - missionType: "MT_SABOTAGE", - faction: "FC_CORPUS", - difficulty: 1, - missionReward: { - credits: 30000, - items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedFireRateDamagePistol"] - }, - levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipCoreSabotage", - enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipSquadA", - extraEnemySpec: "/Lotus/Types/Game/EnemySpecs/GamemodeExtraEnemySpecs/CorpusSabotageTiersA", - minEnemyLevel: 10, - maxEnemyLevel: 15 - } - }, - { - _id: { $oid: "677d45811daeae9de40e8c0f" }, - Activation: { $date: { $numberLong: "1737129600000" } }, - Expiry: { $date: { $numberLong: "2000000000000" } }, - MissionInfo: { - location: "SettlementNode11", - missionType: "MT_DEFENSE", - faction: "FC_CORPUS", - difficulty: 1, - missionReward: { - credits: 30000, - items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedCritChanceFireRatePistol"] - }, - levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipDefense", - enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipSquadDefenseB", - minEnemyLevel: 20, - maxEnemyLevel: 25, - maxWaveNum: 10 - } - }, - { - _id: { $oid: "677d45a494ad716c90006b9a" }, - Activation: { $date: { $numberLong: "1737734400000" } }, - Expiry: { $date: { $numberLong: "2000000000000" } }, - MissionInfo: { - location: "SolNode118", - missionType: "MT_ARTIFACT", - faction: "FC_CORPUS", - difficulty: 1, - missionReward: { - credits: 30000, - items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedCritDamagePistol"] - }, - levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipDisruption", - enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipSurvivalA", - extraEnemySpec: "/Lotus/Types/Game/EnemySpecs/SpecialMissionSpecs/DisruptionCorpusShip", - customAdvancedSpawners: ["/Lotus/Types/Enemies/AdvancedSpawners/ErrantSpecterInvasion"], - minEnemyLevel: 30, - maxEnemyLevel: 35 - } - }, - { - _id: { $oid: "677d4700682d173abb0e19fe" }, - Activation: { $date: { $numberLong: "1738339200000" } }, - Expiry: { $date: { $numberLong: "2000000000000" } }, - MissionInfo: { - location: "SolNode4", - missionType: "MT_EXTERMINATION", - faction: "FC_CORPUS", - difficulty: 1, - missionReward: { - credits: 30000, - items: ["/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/CorruptedDamageRecoilPistol"] - }, - levelOverride: "/Lotus/Levels/Proc/Corpus/CorpusShipExterminate", - enemySpec: "/Lotus/Types/Game/EnemySpecs/CorpusShipEnemySpecs/CorpusShipExterminateMixed", - minEnemyLevel: 40, - maxEnemyLevel: 45 - } - } - ], - - //2024 - [] - ]; - - for (const a of alertsByYear[year]) { - worldState.Alerts.push(a); - } - } - if (config.worldState?.wolfHunt) { worldState.Goals.push({ _id: { diff --git a/src/types/requestTypes.ts b/src/types/requestTypes.ts index 0dac8d75..d762edd8 100644 --- a/src/types/requestTypes.ts +++ b/src/types/requestTypes.ts @@ -178,6 +178,7 @@ export interface IRewardInfo { goalManifest?: string; invasionId?: string; invasionAllyFaction?: "FC_GRINEER" | "FC_CORPUS"; + alertId?: string; sortieId?: string; sortieTag?: "Mission1" | "Mission2" | "Final"; sortiePrereqs?: string[]; diff --git a/src/types/worldStateTypes.ts b/src/types/worldStateTypes.ts index f39c4bf7..723e8875 100644 --- a/src/types/worldStateTypes.ts +++ b/src/types/worldStateTypes.ts @@ -1,4 +1,4 @@ -import type { IMissionReward } from "warframe-public-export-plus"; +import type { IMissionReward, TFaction } from "warframe-public-export-plus"; import type { IMongoDate, IOid } from "./commonTypes.ts"; export interface IWorldState { @@ -7,7 +7,7 @@ export interface IWorldState { Time: number; InGameMarket: IInGameMarket; Goals: IGoal[]; - Alerts: []; + Alerts: IAlert[]; Sorties: ISortie[]; LiteSorties: ILiteSortie[]; SyndicateMissions: ISyndicateMissionInfo[]; @@ -35,6 +35,28 @@ export interface IWorldState { Tmp?: string; } +export interface IAlert { + _id: IOid; + Activation: IMongoDate; + Expiry: IMongoDate; + MissionInfo: IAlertMissionInfo; +} + +export interface IAlertMissionInfo { + location: string; + missionType: string; + faction: TFaction; + difficulty: number; + missionReward?: IMissionReward; + levelOverride?: string; + enemySpec?: string; + extraEnemySpec?: string; + customAdvancedSpawners?: string[]; + minEnemyLevel?: number; + maxEnemyLevel?: number; + maxWaveNum?: number; +} + export interface IGoal { _id: IOid; Activation: IMongoDate; diff --git a/static/webui/index.html b/static/webui/index.html index 25615131..4f830ccf 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -1169,6 +1169,10 @@ +
+ + +
@@ -1257,22 +1261,6 @@
-
-
- - -
-
- - -
-