From 397e0415e8286f4c0ff38b81bca10bb6d4f1753c Mon Sep 17 00:00:00 2001 From: Lucas Karsten Date: Tue, 24 Nov 2026 22:17:28 -0300 Subject: [PATCH] Show totem physical damage reduction "Totems have X% additional Physical Damage Reduction" (Ancestral Preservation, Ironwood, Scourge) was parsed as a player PhysicalDamageReduction mod with the Totem keyword flag, which nothing reads. It is now a TotemPhysicalDamageReduction mod shown in Calcs next to Totem Armour, capped at the monster maximum (75%), which totems inherit from Monster.ot. --- spec/System/TestDefence_spec.lua | 12 ++++++++++++ src/Data/ModCache.lua | 10 +++++----- src/Modules/CalcOffence.lua | 1 + src/Modules/CalcSections.lua | 3 +++ src/Modules/ModParser.lua | 1 + 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/spec/System/TestDefence_spec.lua b/spec/System/TestDefence_spec.lua index 4aa38717d16..87ac38ee2b1 100644 --- a/spec/System/TestDefence_spec.lua +++ b/spec/System/TestDefence_spec.lua @@ -7,6 +7,18 @@ describe("TestDefence", function() -- newBuild() takes care of resetting everything in setup() end) + it("shows totem physical damage reduction without giving it to the player", function() + build.skillsTab:PasteSocketGroup("Holy Flame Totem 20/0 1") + for _, case in ipairs({ { mods = "Totems have 15% additional Physical Damage Reduction", expected = 15 }, { mods = "Totems have 60% additional Physical Damage Reduction\nTotems have 40% additional Physical Damage Reduction", expected = 75 } }) do + build.configTab.input.customMods = case.mods + build.configTab:BuildModList() + runCallback("OnFrame") + local output = build.calcsTab.mainOutput + assert.are.equals(case.expected, output.TotemPhysicalDamageReduction) + assert.are.equals(0, output.PhysicalDamageReduction) + end + end) + it("converts physical damage over time independently of hit damage", function() build.configTab.input.enemyDamageType = "DamageOverTime" for _, damageType in ipairs({ "Physical", "Lightning", "Cold", "Fire", "Chaos" }) do diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 94ce6007e71..8688ea60b74 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -22192,11 +22192,11 @@ c["Totems gain +5% to all Elemental Resistances"]={{[1]={flags=0,keywordFlags=0, c["Totems gain +8% to all Elemental Resistances"]={{[1]={flags=0,keywordFlags=0,name="TotemElementalResist",type="BASE",value=8}},nil} c["Totems gain -10% to all Elemental Resistances per Summoned Totem"]={nil,"Totems gain -10% to all Elemental Resistances per Summoned Totem "} c["Totems have 100% increased Movement Speed"]={{[1]={flags=0,keywordFlags=16384,name="MovementSpeed",type="INC",value=100}},nil} -c["Totems have 13% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=16384,name="PhysicalDamageReduction",type="BASE",value=13}},nil} -c["Totems have 15% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=16384,name="PhysicalDamageReduction",type="BASE",value=15}},nil} -c["Totems have 18% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=16384,name="PhysicalDamageReduction",type="BASE",value=18}},nil} -c["Totems have 23% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=16384,name="PhysicalDamageReduction",type="BASE",value=23}},nil} -c["Totems have 40% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=16384,name="PhysicalDamageReduction",type="BASE",value=40}},nil} +c["Totems have 13% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=0,name="TotemPhysicalDamageReduction",type="BASE",value=13}},nil} +c["Totems have 15% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=0,name="TotemPhysicalDamageReduction",type="BASE",value=15}},nil} +c["Totems have 18% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=0,name="TotemPhysicalDamageReduction",type="BASE",value=18}},nil} +c["Totems have 23% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=0,name="TotemPhysicalDamageReduction",type="BASE",value=23}},nil} +c["Totems have 40% additional Physical Damage Reduction"]={{[1]={flags=0,keywordFlags=0,name="TotemPhysicalDamageReduction",type="BASE",value=40}},nil} c["Totems have 5% increased Attack Speed per Summoned Totem"]={{[1]={[1]={stat="TotemsSummoned",type="PerStat"},flags=1,keywordFlags=16384,name="Speed",type="INC",value=5}},nil} c["Totems have 5% increased Cast Speed per Summoned Totem"]={{[1]={[1]={stat="TotemsSummoned",type="PerStat"},flags=16,keywordFlags=16384,name="Speed",type="INC",value=5}},nil} c["Totems have 5% more Life per maximum number of Summoned Totems"]={{[1]={[1]={stat="ActiveTotemLimit",type="PerStat"},flags=0,keywordFlags=0,name="TotemLife",type="MORE",value=5}},nil} diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index 01d89dcc133..19cc2d8723f 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -1447,6 +1447,7 @@ function calcs.offence(env, actor, activeSkill) output.TotemEnergyShield = skillModList:Sum("BASE", skillCfg, "TotemEnergyShield") output.TotemBlockChance = skillModList:Sum("BASE", skillCfg, "TotemBlockChance") output.TotemArmour = skillModList:Sum("BASE", skillCfg, "TotemArmour") + output.TotemPhysicalDamageReduction = m_min(skillModList:Sum("BASE", skillCfg, "TotemPhysicalDamageReduction"), data.misc.EnemyPhysicalDamageReductionCap) if breakdown then breakdown.TotemLifeMod = breakdown.mod(skillModList, skillCfg, "TotemLife") breakdown.TotemLife = { diff --git a/src/Modules/CalcSections.lua b/src/Modules/CalcSections.lua index b103db1be51..a090bd4a35c 100644 --- a/src/Modules/CalcSections.lua +++ b/src/Modules/CalcSections.lua @@ -908,6 +908,9 @@ return { { breakdown = "TotemArmour" }, { modName = "TotemArmour", cfg = "skill" }, }, }, + { label = "Totem Phys. Dmg. Red.", haveOutput = "TotemPhysicalDamageReduction", { format = "{0:output:TotemPhysicalDamageReduction}%", + { modName = "TotemPhysicalDamageReduction", cfg = "skill" }, + }, }, { label = "Active Brand Limit", haveOutput = "ActiveBrandLimit", { format = "{0:output:ActiveBrandLimit}", { modName = "ActiveBrandLimit", cfg = "skill" }, }, }, { label = "Totem Fire Res", flag = "totem", notFlag = "triggered",{ format = "{0:output:TotemFireResist}% (+{0:output:TotemFireResistOverCap}%)", { breakdown = "TotemFireResist" }, diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index a7f29d28835..1aedfe525fa 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -4510,6 +4510,7 @@ local specialModList = { ["each totem applies (%d+)%% increased damage taken to enemies near it"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("DamageTaken", "INC", num, { type = "Multiplier", var = "TotemsSummoned" }) }) } end, ["totems gain %+(%d+)%% to (%w+) resistance"] = function(num, _, resistance) return { mod("Totem"..firstToUpper(resistance).."Resist", "BASE", num) } end, ["totems gain %+(%d+)%% to all elemental resistances"] = function(num) return { mod("TotemElementalResist", "BASE", num) } end, + ["totems have (%d+)%% additional physical damage reduction"] = function(num) return { mod("TotemPhysicalDamageReduction", "BASE", num) } end, ["rejuvenation totem also grants mana regeneration equal to 15%% of its life regeneration"] = { flag("Condition:RejuvenationTotemManaRegen") }, -- Minions ["your strength is added to your minions"] = { mod("StrengthAddedToMinions", "BASE", 100) },