From 9dbb0fe4bf2b0ffa66c91aee08bd53d59d0a296c Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 29 Dec 2024 06:37:40 +0100 Subject: [PATCH] improve: for "make rank 30", also make respective exalted items rank 30 (#648) --- .../custom/getItemListsController.ts | 3 ++- static/webui/script.js | 20 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index e3fa95a1..24b8c0ae 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -89,7 +89,8 @@ const getItemListsController: RequestHandler = (req, res) => { .map(([uniqueName, warframe]) => { return { uniqueName, - name: getString(warframe.name, lang) + name: getString(warframe.name, lang), + exalted: warframe.exalted }; }), weapons, diff --git a/static/webui/script.js b/static/webui/script.js index 56736c38..e5a6e03e 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -203,6 +203,22 @@ function updateInventory() { a.onclick = function (event) { event.preventDefault(); addGearExp("Suits", item.ItemId.$oid, 1_600_000 - item.XP); + if ("exalted" in itemMap[item.ItemType]) { + for (const exaltedType of itemMap[item.ItemType].exalted) { + const exaltedItem = data.SpecialItems.find(x => x.ItemType == exaltedType); + if (exaltedItem) { + const exaltedCap = + itemMap[exaltedType]?.type == "weapons" ? 800_000 : 1_600_000; + if (exaltedItem.XP < exaltedCap) { + addGearExp( + "SpecialItems", + exaltedItem.ItemId.$oid, + exaltedCap - exaltedItem.XP + ); + } + } + } + } }; a.title = "Make Rank 30"; a.innerHTML = ``; @@ -562,7 +578,9 @@ function addGearExp(category, oid, xp) { contentType: "text/plain", data: JSON.stringify(data) }).done(function () { - updateInventory(); + if (category != "SpecialItems") { + updateInventory(); + } }); }); }