Skip to content
Merged
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
16 changes: 8 additions & 8 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,6 @@ function calcs.defence(env, actor)
end
end

-- Damage Reduction
output.DamageReductionMax = modDB:Override(nil, "DamageReductionMax") or data.misc.DamageReductionCap
modDB:NewMod("ArmourAppliesToPhysicalDamageTaken", "BASE", 100)
for _, damageType in ipairs(dmgTypeList) do
output["Base"..damageType.."DamageReduction"] = m_min(m_max(0, modDB:Sum("BASE", nil, damageType.."DamageReduction")), output.DamageReductionMax)
output["Base"..damageType.."DamageReductionWhenHit"] = m_min(m_max(0, output["Base"..damageType.."DamageReduction"] + modDB:Sum("BASE", nil, damageType.."DamageReductionWhenHit")), output.DamageReductionMax)
end

-- Block
output.BlockChanceMax = modDB:Sum("BASE", nil, "BlockChanceMax")
output.BlockChanceOverCap = 0
Expand Down Expand Up @@ -1147,6 +1139,14 @@ function calcs.defence(env, actor)
end
end

-- Damage Reduction
output.DamageReductionMax = modDB:Override(nil, "DamageReductionMax") or data.misc.DamageReductionCap
modDB:NewMod("ArmourAppliesToPhysicalDamageTaken", "BASE", 100)
for _, damageType in ipairs(dmgTypeList) do
output["Base"..damageType.."DamageReduction"] = m_min(m_max(0, modDB:Sum("BASE", nil, damageType.."DamageReduction")), output.DamageReductionMax)
output["Base"..damageType.."DamageReductionWhenHit"] = m_min(m_max(0, output["Base"..damageType.."DamageReduction"] + modDB:Sum("BASE", nil, damageType.."DamageReductionWhenHit")), output.DamageReductionMax)
end

-- Miscellaneous: move speed, avoidance
output.MovementSpeedMod = modDB:Override(nil, "MovementSpeed") or calcLib.mod(modDB, nil, "MovementSpeed")
if modDB:Flag(nil, "MovementSpeedCannotBeBelowBase") then
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ local specialModList = {
return { mod("DamageTaken", "MORE", -num, { type = "PerStat", stat = "MaxLifeLeechRatePercent", div = tonumber(div) }) }
end,
["(%d+)%% additional physical damage reduction for every (%d+)%% life recovery per second from leech"] = function(num, _, div)
return { mod("PhysicalDamageReduction", "BASE", -num, { type = "PerStat", stat = "MaxLifeLeechRatePercent", div = tonumber(div) }) }
return { mod("PhysicalDamageReduction", "BASE", num, { type = "PerStat", stat = "MaxLifeLeechRatePercent", div = tonumber(div) }) }
end,
["modifiers to chance to suppress spell damage instead apply to chance to dodge spell hits at 50%% of their value"] = {
flag("ConvertSpellSuppressionToSpellDodge"),
Expand Down