Skip to content

Commit 44b53f4

Browse files
authored
Add support for adding essence modifiers to items (#1239)
* Export Misc data for 0.3.0 * Temp save spec changes * Mod export * Begin work on exporting new essence mods * Update essence spec, fix league name * Restore weight keys * Support crafting essence mods
1 parent 59fd6a8 commit 44b53f4

17 files changed

Lines changed: 7795 additions & 6994 deletions

File tree

src/Classes/ItemsTab.lua

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ function ItemsTabClass:AddModComparisonTooltip(tooltip, mod)
18041804
local newItem = new("Item", self.displayItem:BuildRaw())
18051805

18061806
for _, subMod in ipairs(mod) do
1807-
t_insert(newItem.explicitModLines, { line = checkLineForAllocates(subMod, self.build.spec.nodes), modTags = mod.modTags, [mod.type] = true })
1807+
t_insert(newItem.explicitModLines, { line = checkLineForAllocates(subMod, self.build.spec.nodes), modTags = mod.modTags, [mod.type or "Suffix"] = true })
18081808
end
18091809

18101810
newItem:BuildAndParseRaw()
@@ -2511,12 +2511,35 @@ function ItemsTabClass:AddCustomModifierToDisplayItem()
25112511
end
25122512
return modA.level > modB.level
25132513
end)
2514+
elseif sourceId == "ESSENCE" then
2515+
for _, essence in pairs(self.build.data.essences) do
2516+
local modId = essence.mods[self.displayItem.type]
2517+
if modId then
2518+
local mod = self.displayItem.affixes[modId] or data.itemMods.Exclusive[modId]
2519+
t_insert(modList, {
2520+
label = essence.name .. " " .. "^8[" .. table.concat(mod, "/") .. "]" .. " (" .. (mod.type or "Suffix") .. ")",
2521+
mod = mod,
2522+
type = "custom",
2523+
essence = essence,
2524+
})
2525+
end
2526+
end
2527+
table.sort(modList, function(a, b)
2528+
if a.essence.type ~= b.essence.type then
2529+
return a.essence.type > b.essence.type
2530+
else
2531+
return a.essence.tierLevel > b.essence.tierLevel
2532+
end
2533+
end)
25142534
end
25152535
end
25162536
if not self.displayItem.crafted then
25172537
t_insert(sourceList, { label = "Prefix", sourceId = "PREFIX" })
25182538
t_insert(sourceList, { label = "Suffix", sourceId = "SUFFIX" })
25192539
end
2540+
if self.displayItem.type ~= "Jewel" and self.displayItem.type ~= "Flask" then
2541+
t_insert(sourceList, { label = "Essence", sourceId = "ESSENCE" })
2542+
end
25202543
t_insert(sourceList, { label = "Custom", sourceId = "CUSTOM" })
25212544
buildMods(sourceList[1].sourceId)
25222545
local function addModifier()

src/Data/Essence.lua

Lines changed: 86 additions & 0 deletions
Large diffs are not rendered by default.

src/Data/ModCharm.lua

Lines changed: 30 additions & 30 deletions
Large diffs are not rendered by default.

src/Data/ModCorrupted.lua

Lines changed: 123 additions & 123 deletions
Large diffs are not rendered by default.

src/Data/ModFlask.lua

Lines changed: 57 additions & 57 deletions
Large diffs are not rendered by default.

src/Data/ModItem.lua

Lines changed: 1651 additions & 1569 deletions
Large diffs are not rendered by default.

src/Data/ModItemExclusive.lua

Lines changed: 4237 additions & 4126 deletions
Large diffs are not rendered by default.

src/Data/ModJewel.lua

Lines changed: 339 additions & 339 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)