diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index fc71a228..14bdc021 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -4,6 +4,7 @@ import { ExportArcanes, ExportAvionics, ExportGear, + ExportMisc, ExportRecipes, ExportResources, ExportSentinels, @@ -163,6 +164,7 @@ const getItemListsController: RequestHandler = (req, response) => { response.json({ badItems, archonCrystalUpgrades, + uniqueLevelCaps: ExportMisc.uniqueLevelCaps, ...res }); }; diff --git a/static/webui/script.js b/static/webui/script.js index cc679c21..d06db732 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -126,6 +126,7 @@ function setLanguage(lang) { updateInventory(); } +let uniqueLevelCaps = {}; function fetchItemList() { window.itemListPromise = new Promise(resolve => { const req = $.get("/custom/getItemLists?lang=" + window.lang); @@ -167,6 +168,8 @@ function fetchItemList() { option.value = name; document.getElementById("datalist-" + type).appendChild(option); }); + } else if (type == "uniqueLevelCaps") { + uniqueLevelCaps = items; } else if (type != "badItems") { items.forEach(item => { if (item.uniqueName in data.badItems) { @@ -235,14 +238,17 @@ function updateInventory() { { const td = document.createElement("td"); td.classList = "text-end text-nowrap"; - const maxXP = - category == "Suits" || - category == "SpaceSuits" || - category == "Sentinels" || - category == "Hoverboards" || - category == "MechSuits" - ? 1_600_000 - : 800_000; + let maxXP = Math.pow(uniqueLevelCaps[item.ItemType] ?? 30, 2) * 1000; + if ( + category != "Suits" && + category != "SpaceSuits" && + category != "Sentinels" && + category != "Hoverboards" && + category != "MechSuits" + ) + { + maxXP /= 2; + } if ( item.XP < maxXP &&