Skip to content
Closed
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
34 changes: 34 additions & 0 deletions spec/System/TestItemMods_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -552,4 +552,38 @@ describe("TetsItemMods", function()
assert.are_not.equals(baseColdAvg, round(build.calcsTab.mainOutput.ColdStoredCombinedAvg))
assert.equals(0, round(build.calcsTab.mainOutput.FireStoredCombinedAvg))
end)

it("does not grant attributes from disconnected radius-allocated attribute passives", function()
local function makeAttributeNode(connectedToStart)
local node = {
id = 1,
type = "Normal",
isAttribute = true,
connectedToStart = connectedToStart,
intuitiveLeapLikesAffecting = { { id = 100 } },
modList = new("ModList"),
allocMode = 0,
}
node.modList:NewMod("Int", "BASE", 5, "Tree:1")
return node
end

local disconnectedNode = makeAttributeNode(false)
local env = {
mode = "MAIN",
radiusJewelList = { },
allocNodes = {
[disconnectedNode.id] = disconnectedNode,
},
}

assert.are.equals(0, build.calcsTab.calcs.buildModListForNode(env, disconnectedNode, 0):Sum("BASE", nil, "Int"))

local connectedNode = makeAttributeNode(true)
env.allocNodes = {
[connectedNode.id] = connectedNode,
}

assert.are.equals(5, build.calcsTab.calcs.buildModListForNode(env, connectedNode, 0):Sum("BASE", nil, "Int"))
end)
end)
7 changes: 7 additions & 0 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ local function refreshJewelStatCache(env)
end
end

local function attributeNodeAllocatedByDisconnectedRadius(node)
return node.isAttribute and not node.connectedToStart and node.intuitiveLeapLikesAffecting and #node.intuitiveLeapLikesAffecting > 0
end

function calcs.buildModListForNode(env, node, incSmallPassiveSkill, includeKeystoneMods)
local localSmallIncEffect = 0
local localNotableIncEffect = 0
Expand All @@ -128,6 +132,9 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill, includeKeyst
if node.keystoneMod then
modList:AddMod(node.keystoneMod)
end
elseif attributeNodeAllocatedByDisconnectedRadius(node) then
-- PoE2 currently does not grant the Str/Dex/Int from attribute passives
-- allocated only through "can be Allocated without being connected" radius effects.
else
modList:AddList(node.modList)
end
Expand Down