From 318b0a7f94417995e8177bc2205bdc9fefa7724e Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Thu, 26 Feb 2026 22:54:59 -0600 Subject: [PATCH 1/3] Add Desecrated mods to Custom modifiers dropdown --- src/Classes/ItemsTab.lua | 51 +++++++++++++++++++++++++++++++++++++++- src/Modules/Data.lua | 3 ++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 5a2b9aa8fa..4526f28020 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -2624,16 +2624,65 @@ function ItemsTabClass:AddCustomModifierToDisplayItem() return a.essence.tierLevel > b.essence.tierLevel end end) + elseif sourceId == "DESECRATED" then + for _, mod in pairs(self.displayItem.affixes) do -- Normal mods for the item can be desecrated as well. + if (mod.type == "Prefix" or mod.type == "Suffix") and self.displayItem:GetModSpawnWeight(mod) > 0 then + t_insert(modList, { + label = mod.affix .. " ^8[" .. table.concat(mod, "/") .. "]", + mod = mod, + type = "desecrated", + }) + end + end + for modId, mod in pairs(self.build.data.itemMods.Desecrated) do + for _, weightKey in pairs(mod.weightKey) do + local tag_name = weightKey:lower() + local item_type = self.displayItem.type:lower():gsub(" ", "_") + if tag_name == item_type then + t_insert(modList, { + label = mod.affix .. " " .. "^8[" .. table.concat(mod, "/") .. "]" .. " (" .. (mod.type or "Suffix") .. ") (Desecrated)", + mod = mod, + type = "desecrated", + desecratedSpecific = true, + }) + end + end + end + table.sort(modList, function(a, b) + local modA = a.mod + local modB = b.mod + + -- Desecrated specific mods always come first + if a.desecratedSpecific ~= b.desecratedSpecific then + return a.desecratedSpecific == true + end + + for i = 1, m_max(#modA.statOrder or 0, #modB.statOrder or 0) do + local statA = modA.statOrder and modA.statOrder[i] + local statB = modB.statOrder and modB.statOrder[i] + + if not statA then + return true + elseif not statB then + return false + elseif statA ~= statB then + return statA < statB + end + end + return (modA.level or 0) > (modB.level or 0) + end) end end if not self.displayItem.crafted then t_insert(sourceList, { label = "Prefix", sourceId = "PREFIX" }) t_insert(sourceList, { label = "Suffix", sourceId = "SUFFIX" }) end - buildMods("ESSENCE") -- This is technically a waste if there aren't any essence mods, + buildMods("DESECRATED") + buildMods("ESSENCE") -- This is technically a waste if there aren't any essence mods, -- but it makes it so we don't have to maintain a list of applicable essence-able base types if #modList > 0 then t_insert(sourceList, { label = "Essence", sourceId = "ESSENCE" }) + t_insert(sourceList, { label = "Desecrated", sourceId = "DESECRATED" }) end t_insert(sourceList, { label = "Custom", sourceId = "CUSTOM" }) buildMods(sourceList[1].sourceId) diff --git a/src/Modules/Data.lua b/src/Modules/Data.lua index a92579ce6e..340d528619 100644 --- a/src/Modules/Data.lua +++ b/src/Modules/Data.lua @@ -622,7 +622,8 @@ data.itemMods = { Jewel = LoadModule("Data/ModJewel"), Corruption = LoadModule("Data/ModCorrupted"), Runes = LoadModule("Data/ModRunes"), - Exclusive = LoadModule("Data/ModItemExclusive") + Exclusive = LoadModule("Data/ModItemExclusive"), + Desecrated = LoadModule("Data/ModVeiled") } -- update JewelRadius affixes for Time-Lost jewels From d378f4182eb277a21cb1dc195ec03f738ebdc6a9 Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Fri, 27 Feb 2026 00:53:02 -0600 Subject: [PATCH 2/3] Show the remove button for the desecrated custom mod --- src/Classes/ItemsTab.lua | 5 +++++ src/Modules/ItemTools.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 4526f28020..9208f70df8 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -2694,6 +2694,11 @@ function ItemsTabClass:AddCustomModifierToDisplayItem() if controls.custom.buf:match("%S") then t_insert(item.explicitModLines, { line = controls.custom.buf, custom = true }) end + elseif sourceId == "DESECRATED" then + local listMod = modList[controls.modSelect.selIndex] + for _, line in ipairs(listMod.mod) do + t_insert(item.explicitModLines, { line = line, modTags = listMod.mod.modTags, [listMod.type] = true, custom = true }) + end else local listMod = modList[controls.modSelect.selIndex] for _, line in ipairs(listMod.mod) do diff --git a/src/Modules/ItemTools.lua b/src/Modules/ItemTools.lua index a013bbd7ce..c607c16630 100644 --- a/src/Modules/ItemTools.lua +++ b/src/Modules/ItemTools.lua @@ -331,7 +331,7 @@ function itemLib.formatModLine(modLine, dbMode) line = line .. " ^1'" .. modLine.extra .. "'" end else - colorCode = (modLine.enchant and colorCodes.ENCHANTED) or (modLine.fractured and colorCodes.FRACTURED) or (modLine.mutated and colorCodes.MUTATED) or (modLine.custom and colorCodes.CUSTOM) or colorCodes.MAGIC + colorCode = (modLine.enchant and colorCodes.ENCHANTED) or (modLine.fractured and colorCodes.FRACTURED) or (modLine.mutated and colorCodes.MUTATED) or (modLine.custom and (not modLine.desecrated and colorCodes.CUSTOM)) or colorCodes.MAGIC end return colorCode..line end From c782fee1eafe8233d13d590c2128eb8972330803 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Wed, 27 May 2026 03:38:03 +1000 Subject: [PATCH 3/3] Fix desecrated specific mods not showing up for maces and other weapons Some of the desecrated only mods weren't correctly looking through the spawn tags Also now doesn't use the existance of an essence mod for the desecrated mod pool to show up --- src/Classes/ItemsTab.lua | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 6a8b15ff2b..10a6f179e9 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -2839,6 +2839,13 @@ function ItemsTabClass:AddCustomModifierToDisplayItem() end end) elseif sourceId == "DESECRATED" then + local function isDesecratedMod(mod) + for _, tag in ipairs(mod.modTags or { }) do + if tag == "ulaman_mod" or tag == "amanamu_mod" or tag == "kurgal_mod" then + return true + end + end + end for _, mod in pairs(self.displayItem.affixes) do -- Normal mods for the item can be desecrated as well. if (mod.type == "Prefix" or mod.type == "Suffix") and self.displayItem:GetModSpawnWeight(mod) > 0 then t_insert(modList, { @@ -2848,18 +2855,14 @@ function ItemsTabClass:AddCustomModifierToDisplayItem() }) end end - for modId, mod in pairs(self.build.data.itemMods.Desecrated) do - for _, weightKey in pairs(mod.weightKey) do - local tag_name = weightKey:lower() - local item_type = self.displayItem.type:lower():gsub(" ", "_") - if tag_name == item_type then - t_insert(modList, { - label = mod.affix .. " " .. "^8[" .. table.concat(mod, "/") .. "]" .. " (" .. (mod.type or "Suffix") .. ") (Desecrated)", - mod = mod, - type = "desecrated", - desecratedSpecific = true, - }) - end + for _, mod in pairs(self.build.data.itemMods.Desecrated) do + if isDesecratedMod(mod) and self.displayItem:GetModSpawnWeight(mod) > 0 then + t_insert(modList, { + label = mod.affix .. " " .. "^8[" .. table.concat(mod, "/") .. "]" .. " (" .. (mod.type or "Suffix") .. ") (Desecrated)", + mod = mod, + type = "desecrated", + desecratedSpecific = true, + }) end end table.sort(modList, function(a, b) @@ -2893,10 +2896,13 @@ function ItemsTabClass:AddCustomModifierToDisplayItem() t_insert(sourceList, { label = "Suffix", sourceId = "SUFFIX" }) end buildMods("DESECRATED") + local hasDesecratedMods = #modList > 0 buildMods("ESSENCE") -- This is technically a waste if there aren't any essence mods, -- but it makes it so we don't have to maintain a list of applicable essence-able base types if #modList > 0 then t_insert(sourceList, { label = "Essence", sourceId = "ESSENCE" }) + end + if hasDesecratedMods then t_insert(sourceList, { label = "Desecrated", sourceId = "DESECRATED" }) end t_insert(sourceList, { label = "Custom", sourceId = "CUSTOM" })