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
7 changes: 7 additions & 0 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { }
Expand Down
15 changes: 14 additions & 1 deletion src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
29 changes: 29 additions & 0 deletions src/Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,15 @@
end
end

-- Sinister Jowel Socket support

Check warning on line 1334 in src/Classes/PassiveSpec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Jowel)
-- 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])
Expand Down Expand Up @@ -1728,6 +1737,12 @@
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
Expand Down Expand Up @@ -2476,3 +2491,17 @@
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
2 changes: 2 additions & 0 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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") },
Expand Down
Loading