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: 13 additions & 3 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,8 @@ function calcs.defence(env, actor)
output.EnergyShieldOnBlock = modDB:Sum("BASE", nil, "EnergyShieldOnBlock")
output.EnergyShieldOnSpellBlock = modDB:Sum("BASE", nil, "EnergyShieldOnSpellBlock")

output.EnergyShieldOnSuppress = modDB:Sum("BASE", nil, "EnergyShieldOnSuppress")

-- damage avoidances
for _, damageType in ipairs(dmgTypeList) do
output["Avoid"..damageType.."DamageChance"] = m_min(modDB:Sum("BASE", nil, "Avoid"..damageType.."DamageChance"), data.misc.AvoidChanceCap)
Expand Down Expand Up @@ -1640,7 +1642,8 @@ function calcs.defence(env, actor)
if damageCategoryConfig == "Spell" or damageCategoryConfig == "SpellProjectile" or damageCategoryConfig == "Average" then
suppressChance = output.SpellSuppressionChance / 100
end
if suppressChance < 1 then -- We include suppresion in damage reduction if it is 100% otherwise we handle it here.
-- We include suppresion in damage reduction if it is 100% otherwise we handle it here.
if suppressChance < 1 then
-- unlucky config to lower the value of block, dodge, evade etc for ehp
if worstOf > 1 then
suppressChance = suppressChance * suppressChance
Expand All @@ -1651,19 +1654,26 @@ function calcs.defence(env, actor)
if damageCategoryConfig == "Average" then
suppressChance = suppressChance / 2
end
DamageIn.EnergyShieldWhenHit = (DamageIn.EnergyShieldWhenHit or 0) + output.EnergyShieldOnSuppress * suppressChance
suppressionEffect = 1 - suppressChance * output.SpellSuppressionEffect / 100
else
DamageIn.EnergyShieldWhenHit = (DamageIn.EnergyShieldWhenHit or 0) + output.EnergyShieldOnSuppress * ( damageCategoryConfig == "Average" and 0.5 or 1 )
end
-- extra avoid chance
if damageCategoryConfig == "Projectile" or damageCategoryConfig == "SpellProjectile" then
ExtraAvoidChance = ExtraAvoidChance + output.AvoidProjectilesChance
elseif damageCategoryConfig == "Average" then
ExtraAvoidChance = ExtraAvoidChance + output.AvoidProjectilesChance / 2
end
-- gain when hit (currently just gain on block)
-- gain when hit (currently just gain on block/suppress)
if not env.configInput.DisableEHPGainOnBlock then
if DamageIn.LifeWhenHit ~= 0 or DamageIn.ManaWhenHit ~= 0 or DamageIn.EnergyShieldWhenHit ~= 0 then
if (DamageIn.LifeWhenHit or 0) ~= 0 or (DamageIn.ManaWhenHit or 0) ~= 0 or DamageIn.EnergyShieldWhenHit ~= 0 then
DamageIn.GainWhenHit = true
end
else
DamageIn.LifeWhenHit = 0
DamageIn.ManaWhenHit = 0
DamageIn.EnergyShieldWhenHit = 0
end
for _, damageType in ipairs(dmgTypeList) do
-- Emperor's Vigilance (this needs to fail with divine flesh as it can't override it, hence the check for high bypass)
Expand Down
1 change: 1 addition & 0 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@ return {
extra = "{0:output:SpellSuppressionChance}%",
{ label = "Suppression Ch.", { format = "{0:output:SpellSuppressionChance}% (+{0:output:SpellSuppressionChanceOverCap}%)", { modName = "SpellSuppressionChance" }, }, },
{ label = "Suppression Effect", { format = "{0:output:SpellSuppressionEffect}%", { modName = "SpellSuppressionEffect" }, }, },
{ label = "ES on Suppression", haveOutput = "EnergyShieldOnSuppress", { format = "{0:output:EnergyShieldOnSuppress}", { modName = "EnergyShieldOnSuppress" }, }, },
} },
} },
{ 3, "DamageTaken", 1, colorCodes.DEFENCE, {{ defaultCollapsed = false, label = "Damage Taken", data = {
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2877,6 +2877,7 @@ local specialModList = {
["damage from unblocked hits always bypasses energy shield"] = { flag("UnblockedDamageDoesBypassES", { type = "Condition", var = "EVBypass", neg = true }) },
["recover (%d+) life when you block"] = function(num) return { mod("LifeOnBlock", "BASE", num) } end,
["recover (%d+) energy shield when you block spell damage"] = function(num) return { mod("EnergyShieldOnSpellBlock", "BASE", num) } end,
["recover (%d+) energy shield when you suppress spell damage"] = function(num) return { mod("EnergyShieldOnSuppress", "BASE", num) } end,
["recover (%d+)%% of life when you block"] = function(num) return { mod("LifeOnBlock", "BASE", 1, { type = "PerStat", stat = "Life", div = 100 / num }) } end,
["recover (%d+)%% of life when you block attack damage while wielding a staff"] = function(num) return { mod("LifeOnBlock", "BASE", 1, { type = "PerStat", stat = "Life", div = 100 / num }, { type = "Condition", var = "UsingStaff" }) } end,
["recover (%d+)%% of your maximum mana when you block"] = function(num) return { mod("ManaOnBlock", "BASE", 1, { type = "PerStat", stat = "Mana", div = 100 / num }) } end,
Expand Down