From 4d1191b058a6fb91acc02bd2e07f37d63e80cf8e Mon Sep 17 00:00:00 2001 From: vaisest <4550061+vaisest@users.noreply.github.com> Date: Sun, 9 Aug 2026 11:02:46 +0300 Subject: [PATCH 1/3] Improve talisman enchant handling and add amulet eldritch implicits --- spec/System/testItemsTab_spec.lua | 41 +++++++++++++++++++++++++++++++ src/Classes/ItemsTab.lua | 20 ++++++++------- src/Modules/Data.lua | 6 +++++ 3 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 spec/System/testItemsTab_spec.lua diff --git a/spec/System/testItemsTab_spec.lua b/spec/System/testItemsTab_spec.lua new file mode 100644 index 0000000000..8e17e7d586 --- /dev/null +++ b/spec/System/testItemsTab_spec.lua @@ -0,0 +1,41 @@ +describe("TestItemsTab", function () + describe("CopyAnointsAndEldritchImplicits", function () + before_each(function() + newBuild() + end) + + local function equip(item) + build.itemsTab:AddItem(item) + build.itemsTab:EquipItemInSet(item, build.itemsTab.activeItemSetId) + end + it("does not copy an anoint onto a talisman", function() + local amulet = new("Item", "Rarity: Rare\nAnointed\nOnyx Amulet\n+8 to Strength (enchant)") + assert.are.equals(1, #amulet.enchantModLines) + equip(amulet) + + local talisman = new("Item", "Rarity: Rare\nCharm\nBlack Maw Talisman") + local originalCount = #talisman.enchantModLines + + build.itemsTab:CopyAnointsAndEldritchImplicits(talisman, false, false) + + assert.are.equals(originalCount, #talisman.enchantModLines) + for _, modLine in ipairs(talisman.enchantModLines) do + assert.are_not.equals("+8 to Strength", modLine.line) + end + end) + + it("does not copy an anoint from a talisman", function() + local talisman = new("Item", "Rarity: Rare\nCharm\nBlack Maw Talisman\n+8 to Strength (enchant)") + assert.are.equals(1, #talisman.enchantModLines) + equip(talisman) + + -- new amulet must not inherit the talisman's enchant as an anoint + local amulet = new("Item", "Rarity: Rare\nPlain\nOnyx Amulet") + assert.are.equals(0, #amulet.enchantModLines) + + build.itemsTab:CopyAnointsAndEldritchImplicits(amulet, false, false) + + assert.are.equals(0, #amulet.enchantModLines) + end) + end) +end) \ No newline at end of file diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 1380881c02..4de13a75a9 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -1821,7 +1821,7 @@ function ItemsTabClass:CopyAnointsAndEldritchImplicits(newItem, copyEldritchImpl -- if you don't have an equipped item that matches the type of the newItem, no need to do anything if currentItem then -- if the new item is anointable and does not have an anoint and your current respective item does, apply that anoint to the new item - if isAnointable(newItem) and (#newItem.enchantModLines == 0 or overwrite) and self.activeItemSet[newItemType].selItemId > 0 then + if isAnointable(currentItem) and isAnointable(newItem) and (#newItem.enchantModLines == 0 or overwrite) and self.activeItemSet[newItemType].selItemId > 0 then local currentAnoint = currentItem.enchantModLines if currentAnoint and #currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp newItem.enchantModLines = currentAnoint @@ -1829,8 +1829,6 @@ function ItemsTabClass:CopyAnointsAndEldritchImplicits(newItem, copyEldritchImpl end -- if the new item is a non-corrupted Normal, Magic, or Rare Helmet, Body Armour, Gloves, or Boots and does not have any influence -- and your current respective item is Eater and/or Exarch, apply those implicits and influence to the new item - local eldritchBaseTypes = { "Helmet", "Body Armour", "Gloves", "Boots" } - local eldritchRarities = { "NORMAL", "MAGIC", "RARE" } for _, influence in ipairs(itemLib.influenceInfo.default) do if newItem[influence.key] then return @@ -1838,8 +1836,13 @@ function ItemsTabClass:CopyAnointsAndEldritchImplicits(newItem, copyEldritchImpl end local modifiableItem = not (newItem.corrupted or newItem.mirrored) - if copyEldritchImplicits and isValueInTable(eldritchBaseTypes, newItem.base.type) and isValueInTable(eldritchRarities, newItem.rarity) - and (#newItem.implicitModLines == 0 or overwrite) and modifiableItem and (currentItem.cleansing or currentItem.tangle) and currentItem.implicitModLines then + local fullType = string.format("%s: %s", newItem.base.type, newItem.base.subType or "") + if copyEldritchImplicits and + (isValueInArray(data.eldritch.baseTypes, newItem.base.type) or isValueInArray(data.eldritch.baseTypes, fullType)) + and isValueInArray(data.eldritch.rarities, newItem.rarity) + and (#newItem.implicitModLines == 0 or overwrite) + and modifiableItem and (currentItem.cleansing or currentItem.tangle) + and currentItem.implicitModLines then newItem.implicitModLines = currentItem.implicitModLines newItem.tangle = currentItem.tangle newItem.cleansing = currentItem.cleansing @@ -1990,7 +1993,7 @@ function ItemsTabClass:SetDisplayItem(item) local influence1 = 1 local influence2 = 1 local influenceDisplayList = { "Influence" } - for i, curInfluenceInfo in ipairs((item.canHaveEldritchInfluence or item.type == "Helmet" or item.type == "Body Armour" or item.type == "Gloves" or item.type == "Boots") and itemLib.influenceInfo.all or itemLib.influenceInfo.default) do + for i, curInfluenceInfo in ipairs((item.canHaveEldritchInfluence or (isValueInArray(data.eldritch.baseTypes, item.type))) and itemLib.influenceInfo.all or itemLib.influenceInfo.default) do influenceDisplayList[i + 1] = curInfluenceInfo.display end self.controls.displayItemInfluence.list = influenceDisplayList @@ -3769,7 +3772,6 @@ function ItemsTabClass:AddCrucibleModifierToDisplayItem() end) main:OpenPopup(710, 185, "Add Crucible Modifier to Item", controls, "save") end - -- Opens the custom Implicit popup function ItemsTabClass:AddImplicitToDisplayItem() local controls = { } @@ -3798,7 +3800,7 @@ function ItemsTabClass:AddImplicitToDisplayItem() local groupIndexes = {} if sourceId == "EXARCH" or sourceId == "EATER" then for i, mod in pairs(self.displayItem.affixes) do - if self.displayItem:GetModSpawnWeight(mod) > 0 and sourceId:lower() == mod.type:lower() then + if self.displayItem:GetModSpawnWeight(mod) > 0 and (sourceId:lower() == (mod.type and mod.type:lower() or nil)) then local modLabel = table.concat(mod, "/") local group = mod.group:gsub("PinnaclePresence", ""):gsub("UniquePresence", "") if not groupIndexes[group] then @@ -3917,7 +3919,7 @@ function ItemsTabClass:AddImplicitToDisplayItem() end setDefaultSortOrder() end - if (self.displayItem.rarity ~= "UNIQUE" and self.displayItem.rarity ~= "RELIC") and (self.displayItem.type == "Helmet" or self.displayItem.type == "Body Armour" or self.displayItem.type == "Gloves" or self.displayItem.type == "Boots") then + if (self.displayItem.rarity ~= "UNIQUE" and self.displayItem.rarity ~= "RELIC") and (isValueInArray(data.eldritch.baseTypes, self.displayItem.base.type)) then if self.displayItem.cleansing then t_insert(sourceList, { label = "Searing Exarch", sourceId = "EXARCH" }) end diff --git a/src/Modules/Data.lua b/src/Modules/Data.lua index fd4fa2e137..983af159b9 100644 --- a/src/Modules/Data.lua +++ b/src/Modules/Data.lua @@ -636,6 +636,12 @@ data.enchantmentSource = { { name = "NORMAL", label = "Normal Labyrinth" }, } +-- a list of base types which can contain eldritch implicits +data.eldritch = {} +data.eldritch.baseTypes = { "Helmet", "Body Armour", "Gloves", "Boots", "Amulet" } +-- a list of rarities which can containe eldritch implicits +data.eldritch.rarities = { "NORMAL", "MAGIC", "RARE" } + -- Misc data tables LoadModule("Data/Misc", data) From 127d3b1b8cb71f24d2d783b42cf08cc429cc3045 Mon Sep 17 00:00:00 2001 From: vaisest <4550061+vaisest@users.noreply.github.com> Date: Sun, 9 Aug 2026 11:09:36 +0300 Subject: [PATCH 2/3] Fix useless check --- src/Classes/ItemsTab.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 4de13a75a9..4400da0327 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -1836,9 +1836,8 @@ function ItemsTabClass:CopyAnointsAndEldritchImplicits(newItem, copyEldritchImpl end local modifiableItem = not (newItem.corrupted or newItem.mirrored) - local fullType = string.format("%s: %s", newItem.base.type, newItem.base.subType or "") if copyEldritchImplicits and - (isValueInArray(data.eldritch.baseTypes, newItem.base.type) or isValueInArray(data.eldritch.baseTypes, fullType)) + isValueInArray(data.eldritch.baseTypes, newItem.base.type) and isValueInArray(data.eldritch.rarities, newItem.rarity) and (#newItem.implicitModLines == 0 or overwrite) and modifiableItem and (currentItem.cleansing or currentItem.tangle) From 97561c83a6cdbbf8a2e7efe68870d8dd58aaf160 Mon Sep 17 00:00:00 2001 From: vaisest <4550061+vaisest@users.noreply.github.com> Date: Sun, 9 Aug 2026 11:11:55 +0300 Subject: [PATCH 3/3] Fix typos --- spec/System/testItemsTab_spec.lua | 2 +- src/Modules/Data.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/System/testItemsTab_spec.lua b/spec/System/testItemsTab_spec.lua index 8e17e7d586..75819b0632 100644 --- a/spec/System/testItemsTab_spec.lua +++ b/spec/System/testItemsTab_spec.lua @@ -38,4 +38,4 @@ describe("TestItemsTab", function () assert.are.equals(0, #amulet.enchantModLines) end) end) -end) \ No newline at end of file +end) diff --git a/src/Modules/Data.lua b/src/Modules/Data.lua index 983af159b9..35e52214ef 100644 --- a/src/Modules/Data.lua +++ b/src/Modules/Data.lua @@ -639,7 +639,7 @@ data.enchantmentSource = { -- a list of base types which can contain eldritch implicits data.eldritch = {} data.eldritch.baseTypes = { "Helmet", "Body Armour", "Gloves", "Boots", "Amulet" } --- a list of rarities which can containe eldritch implicits +-- a list of rarities which can contain eldritch implicits data.eldritch.rarities = { "NORMAL", "MAGIC", "RARE" } -- Misc data tables