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
2 changes: 1 addition & 1 deletion src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 12 additions & 8 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -438,7 +441,7 @@ holding Shift will put it in the second.]])
self.controls.displayItemAddSocket.shown = function()
return #self.displayItem.sockets < self.displayItem.selectableSocketCount + self.displayItem.abyssalSocketCount
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
Expand All @@ -459,14 +462,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(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
(self.displayItem.base.type == "Amulet" or self.displayItem.canBeAnointed) and
isAnointable(self.displayItem) and
self.displayItem.canHaveTwoEnchants and
#self.displayItem.enchantModLines > 0
end
Expand All @@ -475,7 +478,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(self.displayItem) and
self.displayItem.canHaveThreeEnchants and
#self.displayItem.enchantModLines > 1
end
Expand All @@ -484,7 +487,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(self.displayItem) and
self.displayItem.canHaveFourEnchants and
#self.displayItem.enchantModLines > 2
end
Expand Down Expand Up @@ -1582,9 +1585,10 @@ 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 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
newItem:BuildAndParseRaw()
Expand Down