diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index f0b2ecbed8..5e315763c1 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -1995,6 +1995,13 @@ function ItemClass:BuildModList() }) end end + + self.grantedPassiveSockets = nil + for _, socketNodeAlias in ipairs(baseList:List(nil, "GrantedPassiveSocket")) do + self.grantedPassiveSockets = self.grantedPassiveSockets or {} + self.grantedPassiveSockets[socketNodeAlias] = true + end + --Sekhema's Resolve if baseList:Flag(nil, "JewelSocketRestriction") then self.canSocketJewelBase = { } diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index f490b94b80..1789851db2 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -3808,7 +3808,20 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode, maxWidth) local function getReplacedItemAndOutput(compareSlot) local selItem = self.items[compareSlot.selItemId] - local output = calcFunc({ repSlotName = compareSlot.slotName, repItem = item ~= selItem and item or nil }) + local replaceInfo = { repSlotName = compareSlot.slotName, repItem = item ~= selItem and item or nil } + if selItem and not replaceInfo.repItem and selItem.grantedPassiveSockets then + replaceInfo.removeSlotsByNodeID = {} + for slotName, slot in pairs(self.slots) do + if not slot.inactive + and slot.nodeId + and self.build.spec.nodes[slot.nodeId] + and self.build.spec.nodes[slot.nodeId].aliasPassiveSocket + and selItem.grantedPassiveSockets[self.build.spec.nodes[slot.nodeId].aliasPassiveSocket] then + replaceInfo.removeSlotsByNodeID[slot.nodeId] = true + end + end + end + local output = calcFunc(replaceInfo) return selItem, output end local function addCompareForSlot(compareSlot, selItem, output) diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index 3b2d0ce207..7f360669a4 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -1331,6 +1331,15 @@ function PassiveSpecClass:BuildAllDependsAndPaths() end end + -- Sinister Jowel Socket support + -- the main idea is to validate if grantedPassive was enable for the node Id with socket type and alloc + -- the dealloc will be the process later + if self:IsPassiveJewelSocketEnabled(node) then + node.alloc = true + self.allocNodes[node.id] = node + end + + -- set attribute nodes if self.hashOverrides[node.id] then self:ReplaceNode(node, self.hashOverrides[node.id]) @@ -1728,6 +1737,12 @@ function PassiveSpecClass:BuildAllDependsAndPaths() end end end + + -- sinister jewel, we need to keep only if the grantedSkill is enable + if self:IsPassiveJewelSocketEnabled(depNode) then + prune = false + end + if prune then self:DeallocSingleNode(depNode) end @@ -2476,3 +2491,17 @@ function PassiveSpecClass:SwitchAttributeNode(nodeId, attributeIndex) self.hashOverrides[nodeId] = newNode end end + +function PassiveSpecClass:IsPassiveJewelSocketEnabled(node) + if node.type == "Socket" and node.aliasPassiveSocket then + for nodeId, itemId in pairs(self.jewels) do + local jewel = self:GetJewel(itemId) + + if jewel and jewel.grantedPassiveSockets and jewel.grantedPassiveSockets[node.aliasPassiveSocket] then + return true + end + end + end + + return false +end \ No newline at end of file diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index 7d5f215b9f..46f7264dce 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -829,6 +829,8 @@ function calcs.initEnv(build, mode, override, specEnv) or (override.repItem.base.type == "Bow" and item and item.base.type ~= "Quiver") ) then goto continue + elseif slot.nodeId and override.removeSlotsByNodeID and override.removeSlotsByNodeID[slot.nodeId] then + item = nil elseif slot.nodeId and override.spec then item = build.itemsTab.items[env.spec.jewels[slot.nodeId]] else diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 1fb4002d0a..bd1572d3b5 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -5766,6 +5766,14 @@ local specialModList = { mod("CritChanceCap", "OVERRIDE", num), } end, ["allocates (.+) if you have the matching modifiers? on forbidden (.+)"] = function(_, ascendancy, side) return { mod("GrantedAscendancyNode", "LIST", { side = side, name = ascendancy }) } end, + ["allocates (%d+) sinister jewel sockets"] = function(num) + local mods = {} + local clamped = math.max(2, math.min(num,5)) + for n =1 , clamped do + table.insert(mods, mod("GrantedPassiveSocket", "LIST", "voices_jewel_slot" .. (n ~= 3 and n or "3__"))) + end + return mods + end, ["allocates (.+)"] = function(_, passive) return { mod("GrantedPassive", "LIST", passive) } end, ["battlemage"] = { flag("Battlemage"), mod("MainHandWeaponDamageAppliesToSpells", "MAX", 100) }, ["transfiguration of body"] = { flag("TransfigurationOfBody") },