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
12 changes: 12 additions & 0 deletions spec/System/TestDefence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
Loading