Skip to content

Commit 15938b9

Browse files
committed
Add emotion mods to jewel craft item
1 parent 63edc04 commit 15938b9

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

src/Classes/ItemsTab.lua

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3035,10 +3035,46 @@ function ItemsTabClass:AddCustomModifierToDisplayItem()
30353035
return a.essence.tierLevel > b.essence.tierLevel
30363036
end
30373037
end)
3038+
elseif sourceId == "EMOTION" then
3039+
local radiusJewel = not not (self.displayItem.type and self.displayItem.base.subType and
3040+
self.displayItem.base.subType:match("Radius"))
3041+
local baseColour
3042+
for _, itemName in ipairs({ "Ruby", "Emerald", "Sapphire", "Diamond" }) do
3043+
if self.displayItem.baseName:match(itemName) then
3044+
baseColour = itemName
3045+
break
3046+
end
3047+
end
3048+
if not baseColour then
3049+
error("Base is a gem but has no colour. Base name: ", self.displayItem.baseName)
3050+
end
3051+
for _, emotion in pairs(data.emotions) do
3052+
if emotion.radiusJewel == radiusJewel then
3053+
for modType, modId in pairs(emotion.mods[baseColour] or {}) do
3054+
local mod = data.itemMods.Jewel[modId]
3055+
if mod then
3056+
t_insert(modList, {
3057+
label = string.format("%s ^8[%s] (%s)", emotion.name, table.concat(mod, "/"),
3058+
mod.type or ""),
3059+
mod = mod,
3060+
type = "custom",
3061+
emotion = emotion,
3062+
})
3063+
end
3064+
end
3065+
end
3066+
end
3067+
table.sort(modList, function(a, b)
3068+
if a.emotion.tierLevel ~= b.emotion.tierLevel then
3069+
return a.emotion.tierLevel > b.emotion.tierLevel
3070+
else
3071+
return a.emotion.name > b.emotion.name
3072+
end
3073+
end)
30383074
elseif sourceId == "DESECRATED" then
30393075
local function isDesecratedMod(mod)
30403076
for _, tag in ipairs(mod.modTags or { }) do
3041-
if tag == "ulaman_mod" or tag == "amanamu_mod" or tag == "kurgal_mod" then
3077+
if tag == "ulaman_mod" or tag == "amanamu_mod" or tag == "kurgal_mod" or tag == "unveiled_mod" then
30423078
return true
30433079
end
30443080
end
@@ -3102,6 +3138,10 @@ function ItemsTabClass:AddCustomModifierToDisplayItem()
31023138
if hasDesecratedMods then
31033139
t_insert(sourceList, { label = "Desecrated", sourceId = "DESECRATED" })
31043140
end
3141+
if self.displayItem.base.type == "Jewel" then
3142+
buildMods("EMOTION")
3143+
t_insert(sourceList, { label = "Emotion", sourceId = "EMOTION" })
3144+
end
31053145
t_insert(sourceList, { label = "Custom", sourceId = "CUSTOM" })
31063146
buildMods(sourceList[1].sourceId)
31073147
local function addModifier()

src/Modules/Data.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ do
642642
end
643643

644644
data.essences = LoadModule("Data/Essence")
645+
data.emotions = LoadModule("Data/LiquidEmotions")
645646
data.costs = LoadModule("Data/Costs")
646647
do
647648
local map = { }

0 commit comments

Comments
 (0)