diff --git a/spec/System/TestAbyssTimelessJewel_spec.lua b/spec/System/TestAbyssTimelessJewel_spec.lua index 1f64037c529..653936a8b8d 100644 --- a/spec/System/TestAbyssTimelessJewel_spec.lua +++ b/spec/System/TestAbyssTimelessJewel_spec.lua @@ -475,6 +475,23 @@ describe("Abyss timeless jewels", function() assert.is_true(hasComparison) end) + it("gives each line of a Zorath node its own roll when both stats share a range", function() + local spec = build.spec + spec:SelectClass(spec.tree.classNameMap.Templar) + assert.is_true(allocatePathToNode(spec, spec.nodes[26196])) + -- Local id 113 is abyss_special_small_attribute35, whose two stats both roll (2-3) + data.timelessJewelLUTs[11] = parseAbyssJewel(11, abyssHeader("ABYN", 11, 1984) .. uint16(1) .. uint16(10575) + .. abyssModification({ { type = 1, id = 113, rolls = { 3, 2 } } }) .. "ASCS" .. uint16(0)) + equipJewel(spec, 26196, newAbyssTimelessJewel("Reclaimed Malevolence", "Assembled Eye Jewel", + "Binding 1984 souls to phylacteries to sustain Zorath")) + spec:BuildAllDependsAndPaths() + + assert.are.same({ + "Minions have 3% increased Attack Speed", + "Minions have 2% increased Cast Speed", + }, spec.nodes[10575].sd) + end) + it("applies Zorath seed 4050 to the selected Chieftain notable", function() local spec = build.spec spec:SelectClass(spec.tree.classNameMap.Marauder) diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index 89dd9e754a1..30f47592d91 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -1282,8 +1282,12 @@ function PassiveSpecClass:BuildAllDependsAndPaths() if replacesNode then self:ReplaceNode(node, changedNode) end + -- Two stats can share a range, so with one line per stat each line takes only its own + -- stat's roll. A line holding several stats, like an added damage range, takes all of them. + local oneStatPerLine = #changedNode.sd == #changedNode.sortedStats for statIndex, statLine in ipairs(changedNode.sd) do - for statKey, statMod in pairs(changedNode.stats) do + for _, statKey in ipairs(oneStatPerLine and { changedNode.sortedStats[statIndex] } or changedNode.sortedStats) do + local statMod = changedNode.stats[statKey] statLine = replaceHelperFunc(statLine, statKey, statMod, component.rolls[statMod.index]) end self:NodeAdditionOrReplacementFromString(node, (replacesNode and "" or " \n") .. statLine, replacesNode and statIndex == 1)