Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -2645,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
Expand Down
3 changes: 2 additions & 1 deletion src/Modules/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/ItemTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading