diff --git a/spec/System/TestClusterJewelGraphs_spec.lua b/spec/System/TestClusterJewelGraphs_spec.lua index 304d17b4be9..cb0849b8c1e 100644 --- a/spec/System/TestClusterJewelGraphs_spec.lua +++ b/spec/System/TestClusterJewelGraphs_spec.lua @@ -112,4 +112,42 @@ Added Small Passive Skills grant: 12% increased Chaos Damage]]) spec:DeallocNode(nestedSocket) assert.are.equal(1, countSubgraphs(spec)) end) + + it("shows increased effect on added small passive skill stats", function() + local spec = build.spec + local outerSocket = getOuterSocket(spec) + spec:AllocNode(outerSocket) + + local largeCluster = addItem([[Rarity: RARE +New Item +Large Cluster Jewel +Implicits: 3 +Adds 8 Passive Skills +2 Added Passive Skills are Jewel Sockets +Added Small Passive Skills grant: 12% increased Fire Damage +Added Small Passive Skills also grant: +5% to Chaos Resistance +Added Small Passive Skills also grant: +7% to Fire Resistance +Added Small Passive Skills also grant: +10 to Maximum Life +Added Small Passive Skills have 35% increased Effect]]) + spec.jewels[outerSocket.id] = largeCluster.id + spec:BuildClusterJewelGraphs() + + local smallNode + for _, subgraph in pairs(spec.subGraphs) do + for _, node in ipairs(subgraph.nodes) do + if node.type == "Normal" and node.expansionSkill then + smallNode = node + break + end + end + end + + assert.is_truthy(smallNode) + assert.are.same({ + "16% increased Fire Damage", + "+6% to Chaos Resistance", + "+9% to Fire Resistance", + "+13 to Maximum Life", + }, smallNode.sd) + end) end) diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index 3e645124071..334f4ffa0f4 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -2316,6 +2316,12 @@ function PassiveSpecClass:BuildSubgraph(jewel, parentSocket, id, upSize, importe self.tree:ProcessNode(node) if node.modList and jewelData.clusterJewelIncEffect and node.type == "Normal" then node.modList:NewMod("PassiveSkillEffect", "INC", jewelData.clusterJewelIncEffect) + -- ProcessNode must parse the base values before the tooltip text is scaled, + -- otherwise PassiveSkillEffect would apply to the scaled values a second time. + local effectScalar = 1 + jewelData.clusterJewelIncEffect / 100 + for index, line in ipairs(node.sd) do + node.sd[index] = itemLib.applyRange(line, 1, effectScalar) + end end end