From 87c283d353e434344810a5b7c8327e6e07673c97 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Fri, 20 Jun 2025 05:13:52 +0200 Subject: [PATCH] feat: missionsCanGiveAllRelics cheat --- config.json.example | 1 + src/services/configService.ts | 1 + src/services/missionInventoryUpdateService.ts | 18 ++++++++++++++++++ static/webui/index.html | 4 ++++ 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 | 1 + static/webui/translations/zh.js | 1 + 10 files changed, 30 insertions(+) diff --git a/config.json.example b/config.json.example index 8dfdfd31..1601ea51 100644 --- a/config.json.example +++ b/config.json.example @@ -53,6 +53,7 @@ "noDojoResearchCosts": false, "noDojoResearchTime": false, "fastClanAscension": false, + "missionsCanGiveAllRelics": false, "spoofMasteryRank": -1, "nightwaveStandingMultiplier": 1, "worldState": { diff --git a/src/services/configService.ts b/src/services/configService.ts index b14ffb67..ec788253 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -59,6 +59,7 @@ export interface IConfig { noDojoResearchCosts?: boolean; noDojoResearchTime?: boolean; fastClanAscension?: boolean; + missionsCanGiveAllRelics?: boolean; spoofMasteryRank?: number; nightwaveStandingMultiplier?: number; worldState?: { diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 3d1763a2..a2434583 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -2,6 +2,7 @@ import { ExportEnemies, ExportFusionBundles, ExportRegions, + ExportRelics, ExportRewards, IMissionReward as IMissionRewardExternal, IRegion, @@ -1801,6 +1802,23 @@ function getRandomMissionDrops( drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount }); } } + + if (config.missionsCanGiveAllRelics) { + for (const drop of drops) { + const itemType = fromStoreItem(drop.StoreItem); + if (itemType in ExportRelics) { + const relic = ExportRelics[itemType]; + const replacement = getRandomElement( + Object.entries(ExportRelics).filter( + arr => arr[1].era == relic.era && arr[1].quality == relic.quality + ) + )!; + logger.debug(`replacing ${relic.era} ${relic.category} with ${replacement[1].category}`); + drop.StoreItem = toStoreItem(replacement[0]); + } + } + } + return drops; } diff --git a/static/webui/index.html b/static/webui/index.html index b6d87db4..eef1dcdf 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -748,6 +748,10 @@ +
+ + +
diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index 6672d726..ff130ef4 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -169,6 +169,7 @@ dict = { cheats_noDojoResearchCosts: `Keine Dojo-Forschungskosten`, cheats_noDojoResearchTime: `Keine Dojo-Forschungszeit`, cheats_fastClanAscension: `Schneller Clan-Aufstieg`, + cheats_missionsCanGiveAllRelics: `[UNTRANSLATED] Missions Can Give All Relics`, cheats_spoofMasteryRank: `Gefälschter Meisterschaftsrang (-1 zum deaktivieren)`, cheats_nightwaveStandingMultiplier: `[UNTRANSLATED] Nightwave Standing Multiplier`, cheats_save: `[UNTRANSLATED] Save`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index f7869ac2..096f37ed 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -168,6 +168,7 @@ dict = { cheats_noDojoResearchCosts: `No Dojo Research Costs`, cheats_noDojoResearchTime: `No Dojo Research Time`, cheats_fastClanAscension: `Fast Clan Ascension`, + cheats_missionsCanGiveAllRelics: `Missions Can Give All Relics`, cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`, cheats_nightwaveStandingMultiplier: `Nightwave Standing Multiplier`, cheats_save: `Save`, diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index 79aedacd..e23d0693 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -169,6 +169,7 @@ dict = { cheats_noDojoResearchCosts: `Sin costo de investigación del dojo`, cheats_noDojoResearchTime: `Sin tiempo de investigación del dojo`, cheats_fastClanAscension: `Ascenso rápido del clan`, + cheats_missionsCanGiveAllRelics: `[UNTRANSLATED] Missions Can Give All Relics`, cheats_spoofMasteryRank: `Rango de maestría simulado (-1 para desactivar)`, cheats_nightwaveStandingMultiplier: `Multiplicador de Reputación de Onda Nocturna`, cheats_save: `Guardar`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index c605fce8..6baca55d 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -169,6 +169,7 @@ dict = { cheats_noDojoResearchCosts: `Aucun coût de recherche (Dojo)`, cheats_noDojoResearchTime: `Aucun temps de recherche (Dojo)`, cheats_fastClanAscension: `Ascension de clan rapide`, + cheats_missionsCanGiveAllRelics: `[UNTRANSLATED] Missions Can Give All Relics`, cheats_spoofMasteryRank: `Rang de maîtrise personnalisé (-1 pour désactiver)`, cheats_nightwaveStandingMultiplier: `[UNTRANSLATED] Nightwave Standing Multiplier`, cheats_save: `[UNTRANSLATED] Save`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index cb89fa7d..3861686e 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -169,6 +169,7 @@ dict = { cheats_noDojoResearchCosts: `Бесплатные Исследование Додзё`, cheats_noDojoResearchTime: `Мгновенные Исследование Додзё`, cheats_fastClanAscension: `Мгновенное Вознесение Клана`, + cheats_missionsCanGiveAllRelics: `[UNTRANSLATED] Missions Can Give All Relics`, cheats_spoofMasteryRank: `Подделанный ранг мастерства (-1 для отключения)`, cheats_nightwaveStandingMultiplier: `[UNTRANSLATED] Nightwave Standing Multiplier`, cheats_save: `[UNTRANSLATED] Save`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 06b2ece9..09cab438 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -169,6 +169,7 @@ dict = { cheats_noDojoResearchCosts: `无视道场研究消耗`, cheats_noDojoResearchTime: `无视道场研究时间`, cheats_fastClanAscension: `快速升级氏族`, + cheats_missionsCanGiveAllRelics: `[UNTRANSLATED] Missions Can Give All Relics`, cheats_spoofMasteryRank: `伪造精通段位(-1为禁用)`, cheats_nightwaveStandingMultiplier: `午夜电波声望倍率`, cheats_save: `[UNTRANSLATED] Save`, -- 2.47.2