From 1013fbc53b2dab578fd053bf5a9557344c8465dd Mon Sep 17 00:00:00 2001 From: Mickael Cagnion Date: Sun, 8 Nov 2026 11:54:37 +0100 Subject: [PATCH] Count tree Defences in the Inc. from Tree stats Passive tree lines granting increased Defences raise Armour, Evasion, Energy Shield and Ward, but the Calcs "Inc. from Tree" rows and the sidebar "%Inc Armour/Evasion/ES from Tree" stats left them out, so those figures read below what the tree gives. --- spec/System/TestDefence_spec.lua | 39 ++++++++++++++++++++++++++++++++ src/Modules/CalcSections.lua | 8 +++---- src/Modules/Calcs.lua | 6 ++--- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/spec/System/TestDefence_spec.lua b/spec/System/TestDefence_spec.lua index 4fb37d87f8..e65a78f2d2 100644 --- a/spec/System/TestDefence_spec.lua +++ b/spec/System/TestDefence_spec.lua @@ -17,6 +17,45 @@ describe("TestDefence", function() return build.calcsTab.calcs.reducePoolsByDamage(nil, takenDamages, build.calcsTab.calcsEnv.player) end + it("counts tree Defences in the Inc. from Tree stats", function() + local node, value + for _, candidate in pairs(build.spec.nodes) do + local mod = candidate.modList and candidate.modList[1] + if mod and #candidate.modList == 1 and mod.name == "Defences" and mod.type == "INC" and #mod == 0 then + node, value = candidate, mod.value + break + end + end + assert.is_not_nil(node) + node.alloc = true + build.spec.allocNodes[node.id] = node + build.buildFlag = true + runCallback("OnFrame") + + local output = build.calcsTab.mainOutput + local actual = { + ["Spec:ArmourInc"] = output["Spec:ArmourInc"], + ["Spec:EvasionInc"] = output["Spec:EvasionInc"], + ["Spec:EnergyShieldInc"] = output["Spec:EnergyShieldInc"], + } + for _, section in ipairs(LoadModule("Modules/CalcSections")) do + for _, row in ipairs(section[5][1].data) do + if row.label == "Inc. from Tree" and section[2] ~= "Life" and section[2] ~= "Mana" then + actual[section[2]] = formatCalcStr(row[1].format, build.calcsTab.mainEnv.player, row[1]) + end + end + end + assert.are.same({ + ["Spec:ArmourInc"] = value, + ["Spec:EvasionInc"] = value, + ["Spec:EnergyShieldInc"] = value, + Armour = value.."%", + Evasion = value.."%", + EnergyShield = value.."%", + Ward = value.."%", + }, actual) + end) + it("attributes resistances inherited by minions to Bonemeld after loading a build", function() build.skillsTab:PasteSocketGroup("Raise Zombie 20/0 1") build.itemsTab:CreateDisplayItemFromRaw("Rarity: UNIQUE\nBonemeld\nMarble Amulet\nImplicits: 0\nMinions gain added Resistances equal to 50% of your Resistances") diff --git a/src/Modules/CalcSections.lua b/src/Modules/CalcSections.lua index 0f5b1c7f1c..c5ec4f3870 100644 --- a/src/Modules/CalcSections.lua +++ b/src/Modules/CalcSections.lua @@ -1578,7 +1578,7 @@ return { extra = "{0:output:EnergyShield}", { label = "Base from Armours", { format = "{0:output:Gear:EnergyShield}", { breakdown = "EnergyShield", gearOnly = true, skipSideBarIndex = true }, }, }, { label = "Global Base", { format = "{0:mod:1}", { modName = "EnergyShield", modType = "BASE" }, }, }, - { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = "EnergyShield", modType = "INC", modSource = "Tree" }, }, }, + { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "EnergyShield", "Defences" }, modType = "INC", modSource = "Tree" }, }, }, { label = "Total Increased", { format = "{0:mod:1}%", { modName = { "EnergyShield", "Defences" }, modType = "INC" }, }, }, { label = "Total More", { format = "{0:mod:1}%", { modName = { "EnergyShield", "Defences" }, modType = "MORE" }, }, }, { label = "Total", { format = "{0:output:EnergyShield}", { breakdown = "EnergyShield" }, }, }, @@ -1640,7 +1640,7 @@ return { extra = "{0:output:Ward}", { label = "Base from Armours", { format = "{0:output:Gear:Ward}", { breakdown = "Ward", gearOnly = true }, }, }, { label = "Global Base", { format = "{0:mod:1}", { modName = "Ward", modType = "BASE" }, }, }, - { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = "Ward", modType = "INC", modSource = "Tree" }, }, }, + { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Ward", "Defences" }, modType = "INC", modSource = "Tree" }, }, }, { label = "Total Increased", { format = "{0:mod:1}%", { modName = { "Ward", "Defences" }, modType = "INC" }, }, }, { label = "Total More", { format = "{0:mod:1}%", { modName = { "Ward", "Defences" }, modType = "MORE" }, }, }, { label = "Total", { format = "{0:output:Ward}", { breakdown = "Ward" }, }, }, @@ -1675,7 +1675,7 @@ return { extra = "{0:output:Armour}", { label = "Base from Armours", { format = "{0:output:Gear:Armour}", { breakdown = "Armour", gearOnly = true, skipSideBarIndex = true, }, }, }, { label = "Global Base", { format = "{0:mod:1}", { modName = { "Armour", "ArmourAndEvasion" }, modType = "BASE" }, }, }, - { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion" }, modType = "INC", modSource = "Tree", }, }, }, + { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion", "Defences" }, modType = "INC", modSource = "Tree", }, }, }, { label = "Total Increased", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion", "Defences" }, modType = "INC" }, }, }, { label = "Total More", { format = "{0:mod:1}%", { modName = { "Armour", "ArmourAndEvasion", "Defences" }, modType = "MORE" }, }, }, { label = "Total", { format = "{0:output:Armour}", { breakdown = "Armour" }, }, }, @@ -1706,7 +1706,7 @@ return { extra = "{0:output:Evasion}", { label = "Base from Armours", { format = "{0:output:Gear:Evasion}", { breakdown = "Evasion", gearOnly = true, skipSideBarIndex = true }, }, }, { label = "Global Base", { format = "{0:mod:1}", { modName = { "Evasion", "ArmourAndEvasion" }, modType = "BASE" }, }, }, - { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion" }, modType = "INC", modSource = "Tree" }, }, }, + { label = "Inc. from Tree", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion", "Defences" }, modType = "INC", modSource = "Tree" }, }, }, { label = "Total Increased", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion", "Defences" }, modType = "INC" }, }, }, { label = "Total More", { format = "{0:mod:1}%", { modName = { "Evasion", "ArmourAndEvasion", "Defences" }, modType = "MORE" }, }, }, { label = "Total", { format = "{0:output:Evasion}", { breakdown = "Evasion" }, }, }, diff --git a/src/Modules/Calcs.lua b/src/Modules/Calcs.lua index 9134e1080f..99d6f58603 100644 --- a/src/Modules/Calcs.lua +++ b/src/Modules/Calcs.lua @@ -460,9 +460,9 @@ function calcs.buildOutput(build, mode) } output["Spec:LifeInc"] = env.modDB:Sum("INC", specCfg, "Life") output["Spec:ManaInc"] = env.modDB:Sum("INC", specCfg, "Mana") - output["Spec:ArmourInc"] = env.modDB:Sum("INC", specCfg, "Armour", "ArmourAndEvasion") - output["Spec:EvasionInc"] = env.modDB:Sum("INC", specCfg, "Evasion", "ArmourAndEvasion") - output["Spec:EnergyShieldInc"] = env.modDB:Sum("INC", specCfg, "EnergyShield") + output["Spec:ArmourInc"] = env.modDB:Sum("INC", specCfg, "Armour", "ArmourAndEvasion", "Defences") + output["Spec:EvasionInc"] = env.modDB:Sum("INC", specCfg, "Evasion", "ArmourAndEvasion", "Defences") + output["Spec:EnergyShieldInc"] = env.modDB:Sum("INC", specCfg, "EnergyShield", "Defences") env.skillsUsed = { } for _, activeSkill in ipairs(env.player.activeSkillList) do