diff --git a/src/controllers/custom/addMissingHelminthBlueprintsController.ts b/src/controllers/custom/addMissingHelminthBlueprintsController.ts new file mode 100644 index 00000000..4de501fe --- /dev/null +++ b/src/controllers/custom/addMissingHelminthBlueprintsController.ts @@ -0,0 +1,24 @@ +import { getAccountIdForRequest } from "@/src/services/loginService"; +import { getInventory, addRecipes } from "@/src/services/inventoryService"; +import { RequestHandler } from "express"; +import { ExportRecipes } from "warframe-public-export-plus"; + +export const addMissingHelminthBlueprintsController: RequestHandler = async (req, res) => { + const accountId = await getAccountIdForRequest(req); + const inventory = await getInventory(accountId, "Recipes"); + const allHelminthRecipes = Object.keys(ExportRecipes).filter( + key => ExportRecipes[key].secretIngredientAction === "SIA_WARFRAME_ABILITY" + ); + const inventoryHelminthRecipes = inventory.Recipes.filter(recipe => + recipe.ItemType.startsWith("/Lotus/Types/Recipes/AbilityOverrides/") + ).map(recipe => recipe.ItemType); + + const missingHelminthRecipes = allHelminthRecipes + .filter(key => !inventoryHelminthRecipes.includes(key)) + .map(ItemType => ({ ItemType, ItemCount: 1 })); + + addRecipes(inventory, missingHelminthRecipes); + + await inventory.save(); + res.end(); +}; diff --git a/src/routes/custom.ts b/src/routes/custom.ts index 35d89d4d..5ed4906e 100644 --- a/src/routes/custom.ts +++ b/src/routes/custom.ts @@ -13,6 +13,7 @@ import { unlockAllIntrinsicsController } from "@/src/controllers/custom/unlockAl import { addMissingMaxRankModsController } from "@/src/controllers/custom/addMissingMaxRankModsController"; import { webuiFileChangeDetectedController } from "@/src/controllers/custom/webuiFileChangeDetectedController"; import { completeAllMissionsController } from "@/src/controllers/custom/completeAllMissionsController"; +import { addMissingHelminthBlueprintsController } from "@/src/controllers/custom/addMissingHelminthBlueprintsController"; import { createAccountController } from "@/src/controllers/custom/createAccountController"; import { createMessageController } from "@/src/controllers/custom/createMessageController"; @@ -42,6 +43,7 @@ customRouter.get("/unlockAllIntrinsics", unlockAllIntrinsicsController); customRouter.get("/addMissingMaxRankMods", addMissingMaxRankModsController); customRouter.get("/webuiFileChangeDetected", webuiFileChangeDetectedController); customRouter.get("/completeAllMissions", completeAllMissionsController); +customRouter.get("/addMissingHelminthBlueprints", addMissingHelminthBlueprintsController); customRouter.post("/createAccount", createAccountController); customRouter.post("/createMessage", createMessageController); diff --git a/static/webui/index.html b/static/webui/index.html index 3d706ee9..caf7be01 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -794,6 +794,7 @@ + diff --git a/static/webui/script.js b/static/webui/script.js index c6c6727b..209d727e 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -1449,6 +1449,11 @@ function addMissingEquipment(categories) { } } +async function addMissingHelminthRecipes() { + await revalidateAuthz(); + await fetch("/custom/addMissingHelminthBlueprints?" + window.authz); +} + function addMissingEvolutionProgress() { const requests = []; document.querySelectorAll("#datalist-EvolutionProgress option").forEach(elm => { diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index 08b02c78..a56103b6 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -181,6 +181,7 @@ dict = { cheats_account: `Account`, cheats_unlockAllFocusSchools: `Alle Fokus-Schulen freischalten`, cheats_helminthUnlockAll: `Helminth vollständig aufleveln`, + cheats_addMissingSubsumedAbilities: `[UNTRANSLATED] Add Missing Subsumed Abilities`, cheats_intrinsicsUnlockAll: `Alle Inhärenzen auf Max. Rang`, cheats_changeSupportedSyndicate: `Unterstütztes Syndikat`, cheats_changeButton: `Ändern`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index a97ee549..36d38301 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -180,6 +180,7 @@ dict = { cheats_account: `Account`, cheats_unlockAllFocusSchools: `Unlock All Focus Schools`, cheats_helminthUnlockAll: `Fully Level Up Helminth`, + cheats_addMissingSubsumedAbilities: `Add Missing Subsumed Abilities`, cheats_intrinsicsUnlockAll: `Max Rank All Intrinsics`, cheats_changeSupportedSyndicate: `Supported syndicate`, cheats_changeButton: `Change`, diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index a4e798d7..3fbb7bf1 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -181,6 +181,7 @@ dict = { cheats_account: `Cuenta`, cheats_unlockAllFocusSchools: `Desbloquear todas las escuelas de enfoque`, cheats_helminthUnlockAll: `Subir al máximo el Helminto`, + cheats_addMissingSubsumedAbilities: `[UNTRANSLATED] Add Missing Subsumed Abilities`, cheats_intrinsicsUnlockAll: `Maximizar todos los intrínsecos`, cheats_changeSupportedSyndicate: `Sindicatos disponibles`, cheats_changeButton: `Cambiar`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index c3986cc7..a52f5bef 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -181,6 +181,7 @@ dict = { cheats_account: `Compte`, cheats_unlockAllFocusSchools: `Débloquer toutes les écoles de focus`, cheats_helminthUnlockAll: `Helminth niveau max`, + cheats_addMissingSubsumedAbilities: `[UNTRANSLATED] Add Missing Subsumed Abilities`, cheats_intrinsicsUnlockAll: `Inhérences niveau max`, cheats_changeSupportedSyndicate: `Allégeance`, cheats_changeButton: `Changer`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index 5b353690..26fef974 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -181,6 +181,7 @@ dict = { cheats_account: `Аккаунт`, cheats_unlockAllFocusSchools: `Разблокировать все школы фокуса`, cheats_helminthUnlockAll: `Полностью улучшить Гельминта`, + cheats_addMissingSubsumedAbilities: `Добавить отсутствующие поглощённые способности`, cheats_intrinsicsUnlockAll: `Полностью улучшить Модуляры`, cheats_changeSupportedSyndicate: `Поддерживаемый синдикат`, cheats_changeButton: `Изменить`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 04463ace..e0ba1ff1 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -181,6 +181,7 @@ dict = { cheats_account: `账户`, cheats_unlockAllFocusSchools: `解锁所有专精学派`, cheats_helminthUnlockAll: `完全升级Helminth`, + cheats_addMissingSubsumedAbilities: `[UNTRANSLATED] Add Missing Subsumed Abilities`, cheats_intrinsicsUnlockAll: `所有内源之力最大等级`, cheats_changeSupportedSyndicate: `支持的集团`, cheats_changeButton: `更改`,