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
23 changes: 23 additions & 0 deletions spec/System/TestRadiusJewelStatDiff_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,29 @@ describe("TestRadiusJewelStatDiff", function()
assert.is_truthy(calcFunc(override), "calcFunc with removeNodes should return output")
end)

it("custom Impossible Escape without a radius or with an unknown keystone does nothing", function()
local spec, socketNode = setupAllocatedSocket()
local function customJewel(keystoneName, radiusLine)
return new("Item"):Item("Rarity: RARE\n" ..
"Custom Escape\n" ..
"Cobalt Jewel\n" ..
(radiusLine or "") ..
"Implicits: 0\n" ..
"Passive Skills in radius of " .. keystoneName .. " can be allocated without being connected to your tree\n")
end

for _, item in ipairs({
customJewel("Iron Reflexes"),
customJewel("Not A Keystone", "Radius: Small\n"),
}) do
assert.is_truthy(item.jewelData.impossibleEscapeKeystone)
equipJewelInSocket(item, socketNode)
spec:BuildAllDependsAndPaths()
runCallback("OnFrame")
assert.are.same({ }, spec:NodesInIntuitiveLeapLikeRadius(spec.nodes[socketNode.id]))
end
end)

it("AddItemTooltip emits a remove-comparison block for an equipped Timeless jewel", function()
local spec, socketNode = setupAllocatedSocket()

Expand Down
9 changes: 6 additions & 3 deletions src/Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1097,9 +1097,12 @@ function PassiveSpecClass:NodesInIntuitiveLeapLikeRadius(node)
end

if item.jewelData and item.jewelData.impossibleEscapeKeystone then
for keyName, keyNode in pairs(item.jewelData.impossibleEscapeKeystones) do
if self.tree.keystoneMap[keyName] and self.tree.keystoneMap[keyName].nodesInRadius then
for affectedNodeId in pairs(self.tree.keystoneMap[keyName].nodesInRadius[radiusIndex]) do
for keyName in pairs(item.jewelData.impossibleEscapeKeystones) do
local keyNode = self.tree.keystoneMap[keyName]
-- A custom jewel can lack a radius, and a keystone missing from the tree has no radius data
local inRadius = keyNode and keyNode.nodesInRadius and keyNode.nodesInRadius[radiusIndex]
if inRadius then
for affectedNodeId in pairs(inRadius) do
if self.nodes[affectedNodeId].alloc then
t_insert(result, self.nodes[affectedNodeId])
end
Expand Down