From 498330e88d814237f0122fce07ab15fbe67962a9 Mon Sep 17 00:00:00 2001 From: Peechey <92683202+Peechey@users.noreply.github.com> Date: Sat, 28 Feb 2026 11:59:33 -0600 Subject: [PATCH 1/3] add support for anointing Cord Belts, slight refactor of persistent anoint logic for ammy and new belt --- src/Classes/ItemsTab.lua | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 9a8162b911..21794e8264 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -438,7 +438,12 @@ holding Shift will put it in the second.]]) self.controls.displayItemAddSocket.shown = function() return #self.displayItem.sockets < self.displayItem.selectableSocketCount + self.displayItem.abyssalSocketCount end - + + local function isAnointable() + return (self.displayItem.canBeAnointed or + self.displayItem.base.type == "Amulet" or + self.displayItem.baseName:match("Cord Belt")) + end -- Section: Enchant / Anoint / Corrupt self.controls.displayItemSectionEnchant = new("Control", {"TOPLEFT",self.controls.displayItemSectionSockets,"BOTTOMLEFT"}, {0, 0, 0, function() return (self.controls.displayItemEnchant:IsShown() or self.controls.displayItemEnchant2:IsShown() or self.controls.displayItemAnoint:IsShown() or self.controls.displayItemAnoint2:IsShown() or self.controls.displayItemCorrupt:IsShown() ) and 28 or 0 @@ -459,14 +464,14 @@ holding Shift will put it in the second.]]) self:AnointDisplayItem(1) end) self.controls.displayItemAnoint.shown = function() - return self.displayItem and (self.displayItem.base.type == "Amulet" or self.displayItem.canBeAnointed) + return self.displayItem and isAnointable() end self.controls.displayItemAnoint2 = new("ButtonControl", {"TOPLEFT",self.controls.displayItemAnoint,"TOPRIGHT",true}, {8, 0, 100, 20}, "Anoint 2...", function() self:AnointDisplayItem(2) end) self.controls.displayItemAnoint2.shown = function() return self.displayItem and - (self.displayItem.base.type == "Amulet" or self.displayItem.canBeAnointed) and + isAnointable() and self.displayItem.canHaveTwoEnchants and #self.displayItem.enchantModLines > 0 end @@ -475,7 +480,7 @@ holding Shift will put it in the second.]]) end) self.controls.displayItemAnoint3.shown = function() return self.displayItem and - (self.displayItem.base.type == "Amulet" or self.displayItem.canBeAnointed) and + isAnointable() and self.displayItem.canHaveThreeEnchants and #self.displayItem.enchantModLines > 1 end @@ -484,7 +489,7 @@ holding Shift will put it in the second.]]) end) self.controls.displayItemAnoint4.shown = function() return self.displayItem and - (self.displayItem.base.type == "Amulet" or self.displayItem.canBeAnointed) and + isAnointable() and self.displayItem.canHaveFourEnchants and #self.displayItem.enchantModLines > 2 end @@ -1582,9 +1587,11 @@ end function ItemsTabClass:CreateDisplayItemFromRaw(itemRaw, normalise) local newItem = new("Item", itemRaw) if newItem.base then - -- if the new item is an amulet and does not have an anoint and your current amulet does, apply that anoint to the new item - if newItem.base.type == "Amulet" and #newItem.enchantModLines == 0 and self.activeItemSet["Amulet"].selItemId > 0 then - local currentAnoint = self.items[self.activeItemSet["Amulet"].selItemId].enchantModLines + local itemType = newItem.base.type + -- 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 (itemType == "Amulet" or (itemType == "Belt" and newItem.baseName:match("Cord Belt"))) + and #newItem.enchantModLines == 0 and self.activeItemSet[itemType].selItemId > 0 then + local currentAnoint = self.items[self.activeItemSet[itemType].selItemId].enchantModLines if currentAnoint and #currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp newItem.enchantModLines = currentAnoint newItem:BuildAndParseRaw() From 812d87b6673cf9af113d2c9f8a484726c29b7bc4 Mon Sep 17 00:00:00 2001 From: Peechey <92683202+Peechey@users.noreply.github.com> Date: Sat, 28 Feb 2026 15:41:47 -0600 Subject: [PATCH 2/3] reuse canBeAnointed for Cord Belts and refactor isAnointed function for checks and persistence logic --- src/Classes/Item.lua | 2 +- src/Classes/ItemsTab.lua | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index e9f7cbc75c..ae3c0acd93 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -756,7 +756,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) self.prefixes.limit = (self.prefixes.limit or 0) + (tonumber(lineLower:match("%+(%d+) prefix modifiers? allowed")) or 0) - (tonumber(lineLower:match("%-(%d+) prefix modifiers? allowed")) or 0) elseif lineLower:match(" suffix modifiers? allowed") then self.suffixes.limit = (self.suffixes.limit or 0) + (tonumber(lineLower:match("%+(%d+) suffix modifiers? allowed")) or 0) - (tonumber(lineLower:match("%-(%d+) suffix modifiers? allowed")) or 0) - elseif lineLower == "this item can be anointed by cassia" then + elseif lineLower:find("can be anointed") then -- blight uniques and Cord Belt self.canBeAnointed = true elseif lineLower == "can have a second enchantment modifier" then self.canHaveTwoEnchants = true diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 21794e8264..bc0ecfbd6a 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -56,6 +56,9 @@ for _, entry in pairs(data.flavourText) do end end +local function isAnointable(item) + return (item.canBeAnointed or item.base.type == "Amulet") +end local ItemsTabClass = newClass("ItemsTab", "UndoHandler", "ControlHost", "Control", function(self, build) self.UndoHandler() @@ -439,11 +442,6 @@ holding Shift will put it in the second.]]) return #self.displayItem.sockets < self.displayItem.selectableSocketCount + self.displayItem.abyssalSocketCount end - local function isAnointable() - return (self.displayItem.canBeAnointed or - self.displayItem.base.type == "Amulet" or - self.displayItem.baseName:match("Cord Belt")) - end -- Section: Enchant / Anoint / Corrupt self.controls.displayItemSectionEnchant = new("Control", {"TOPLEFT",self.controls.displayItemSectionSockets,"BOTTOMLEFT"}, {0, 0, 0, function() return (self.controls.displayItemEnchant:IsShown() or self.controls.displayItemEnchant2:IsShown() or self.controls.displayItemAnoint:IsShown() or self.controls.displayItemAnoint2:IsShown() or self.controls.displayItemCorrupt:IsShown() ) and 28 or 0 @@ -464,14 +462,14 @@ holding Shift will put it in the second.]]) self:AnointDisplayItem(1) end) self.controls.displayItemAnoint.shown = function() - return self.displayItem and isAnointable() + return self.displayItem and isAnointable(self.displayItem) end self.controls.displayItemAnoint2 = new("ButtonControl", {"TOPLEFT",self.controls.displayItemAnoint,"TOPRIGHT",true}, {8, 0, 100, 20}, "Anoint 2...", function() self:AnointDisplayItem(2) end) self.controls.displayItemAnoint2.shown = function() return self.displayItem and - isAnointable() and + isAnointable(self.displayItem) and self.displayItem.canHaveTwoEnchants and #self.displayItem.enchantModLines > 0 end @@ -480,7 +478,7 @@ holding Shift will put it in the second.]]) end) self.controls.displayItemAnoint3.shown = function() return self.displayItem and - isAnointable() and + isAnointable(self.displayItem) and self.displayItem.canHaveThreeEnchants and #self.displayItem.enchantModLines > 1 end @@ -489,7 +487,7 @@ holding Shift will put it in the second.]]) end) self.controls.displayItemAnoint4.shown = function() return self.displayItem and - isAnointable() and + isAnointable(self.displayItem) and self.displayItem.canHaveFourEnchants and #self.displayItem.enchantModLines > 2 end @@ -1589,8 +1587,7 @@ function ItemsTabClass:CreateDisplayItemFromRaw(itemRaw, normalise) if newItem.base then local itemType = newItem.base.type -- 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 (itemType == "Amulet" or (itemType == "Belt" and newItem.baseName:match("Cord Belt"))) - and #newItem.enchantModLines == 0 and self.activeItemSet[itemType].selItemId > 0 then + if isAnointable(newItem) and #newItem.enchantModLines == 0 and self.activeItemSet[itemType].selItemId > 0 then local currentAnoint = self.items[self.activeItemSet[itemType].selItemId].enchantModLines if currentAnoint and #currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp newItem.enchantModLines = currentAnoint From ff6fca98f55f05f2fa8ed235715fc1c959692996 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Fri, 6 Mar 2026 06:16:34 +1100 Subject: [PATCH 3/3] Dummy parse cord belt mod --- src/Modules/ModParser.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index fd91130b3e..23175f8b5e 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -5504,6 +5504,7 @@ local specialModList = { ["can have a second enchantment modifier"] = { }, ["can have (%d+) additional enchantment modifiers"] = { }, ["this item can be anointed by cassia"] = { }, + ["can be anointed"] = { }, ["implicit modifiers cannot be changed"] = { }, ["has a crucible passive skill tree"] = { }, ["has elder, shaper and all conqueror influences"] = { },