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..4c6a52c0 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("/addMissingHelminthBlueprintsController", addMissingHelminthBlueprintsController); customRouter.post("/createAccount", createAccountController); customRouter.post("/createMessage", createMessageController); diff --git a/static/webui/index.html b/static/webui/index.html index 3d706ee9..f284382c 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -442,6 +442,7 @@ +
diff --git a/static/webui/script.js b/static/webui/script.js index c6c6727b..190a10de 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -1449,6 +1449,12 @@ function addMissingEquipment(categories) { } } +async function addMissingHelminthRecipes() { + await revalidateAuthz(); + await fetch("/custom/addMissingHelminthBlueprintsController?" + window.authz); + updateInventory(); +} + 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..12a5d2ee 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -93,6 +93,7 @@ dict = { inventory_bulkAddSentinels: `Fehlende Wächter hinzufügen`, inventory_bulkAddSentinelWeapons: `Fehlende Wächter-Waffen hinzufügen`, inventory_bulkAddEvolutionProgress: `Fehlende Incarnon-Entwicklungsfortschritte hinzufügen`, + inventory_bulkAddMissingHelminthRecipes: `[UNTRANSLATED] Add Missing Helminth Recipes`, inventory_bulkRankUpSuits: `Alle Warframes auf Max. Rang`, inventory_bulkRankUpWeapons: `Alle Waffen auf Max. Rang`, inventory_bulkRankUpSpaceSuits: `Alle Archwings auf Max. Rang`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index a97ee549..41ac29a4 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -92,6 +92,7 @@ dict = { inventory_bulkAddSentinels: `Add Missing Sentinels`, inventory_bulkAddSentinelWeapons: `Add Missing Sentinel Weapons`, inventory_bulkAddEvolutionProgress: `Add Missing Incarnon Evolution Progress`, + inventory_bulkAddMissingHelminthRecipes: `Add Missing Helminth Recipes`, inventory_bulkRankUpSuits: `Max Rank All Warframes`, inventory_bulkRankUpWeapons: `Max Rank All Weapons`, inventory_bulkRankUpSpaceSuits: `Max Rank All Archwings`, diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index a4e798d7..e32e07d8 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -93,6 +93,7 @@ dict = { inventory_bulkAddSentinels: `Agregar centinelas faltantes`, inventory_bulkAddSentinelWeapons: `Agregar armas de centinela faltantes`, inventory_bulkAddEvolutionProgress: `Completar el progreso de evolución Incarnon faltante`, + inventory_bulkAddMissingHelminthRecipes: `[UNTRANSLATED] Add Missing Helminth Recipes`, inventory_bulkRankUpSuits: `Maximizar rango de todos los Warframes`, inventory_bulkRankUpWeapons: `Maximizar rango de todas las armas`, inventory_bulkRankUpSpaceSuits: `Maximizar rango de todos los Archwings`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index 26ead631..df340d17 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -93,6 +93,7 @@ dict = { inventory_bulkAddSentinels: `Ajouter les Sentinelles manquantes`, inventory_bulkAddSentinelWeapons: `Ajouter les armes de Sentinelles manquantes`, inventory_bulkAddEvolutionProgress: `Ajouter les évolutions Incarnon manquantes`, + inventory_bulkAddMissingHelminthRecipes: `[UNTRANSLATED] Add Missing Helminth Recipes`, inventory_bulkRankUpSuits: `Toutes les Warframes au rang max`, inventory_bulkRankUpWeapons: `Toutes les armes au rang max`, inventory_bulkRankUpSpaceSuits: `Tous les Archwings au rang max`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index 5b353690..1a3457cb 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -93,6 +93,7 @@ dict = { inventory_bulkAddSentinels: `Добавить отсутствующих стражей`, inventory_bulkAddSentinelWeapons: `Добавить отсутствующее оружие стражей`, inventory_bulkAddEvolutionProgress: `Добавить отсуствующий прогресс эволюции Инкарнонов`, + inventory_bulkAddMissingHelminthRecipes: `Добавить отсутствующее рецепты Гельминта`, inventory_bulkRankUpSuits: `Максимальный ранг всех варфреймов`, inventory_bulkRankUpWeapons: `Максимальный ранг всего оружия`, inventory_bulkRankUpSpaceSuits: `Максимальный ранг всех арчвингов`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 04463ace..617e7085 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -93,6 +93,7 @@ dict = { inventory_bulkAddSentinels: `添加缺失守护`, inventory_bulkAddSentinelWeapons: `添加缺失守护武器`, inventory_bulkAddEvolutionProgress: `添加缺失的灵化之源`, + inventory_bulkAddMissingHelminthRecipes: `[UNTRANSLATED] Add Missing Helminth Recipes`, inventory_bulkRankUpSuits: `所有战甲升满级`, inventory_bulkRankUpWeapons: `所有武器升满级`, inventory_bulkRankUpSpaceSuits: `所有Archwing升满级`,