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: 11 additions & 5 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1631,18 +1631,24 @@ function calcs.buildDefenceEstimations(env, actor)
end
local StunThresholdMod = (1 + modDB:Sum("INC", nil, "StunThreshold") / 100)
output.StunThreshold = stunThresholdBase * StunThresholdMod

local notAvoidChance = modDB:Flag(nil, "StunImmune") and 0 or 100 - m_min(modDB:Sum("BASE", nil, "AvoidStun"), 100)
if output.EnergyShield > output["totalTakenHit"] and not env.modDB:Flag(nil, "EnergyShieldProtectsMana") then
notAvoidChance = notAvoidChance * 0.5
end
output.StunAvoidChance = 100 - notAvoidChance

if breakdown then
breakdown.StunThreshold = { s_format("%d ^8(base from %s)", stunThresholdBase, stunThresholdSource) }
if StunThresholdMod ~= 1 then
t_insert(breakdown.StunThreshold, s_format("* %.2f ^8(increased threshold)", StunThresholdMod))
t_insert(breakdown.StunThreshold, s_format("= %d", output.StunThreshold))
end
breakdown.StunAvoidChance = {
colorCodes.CUSTOM.."NOTE: Having any energy shield when the hit occurs grants 50% chance to avoid stun.",
colorCodes.CUSTOM.."POB only applies this modifier when ES > Total incoming damage.",
}
end
local notAvoidChance = modDB:Flag(nil, "StunImmune") and 0 or 100 - m_min(modDB:Sum("BASE", nil, "AvoidStun"), 100)
if output.EnergyShield > output["totalTakenHit"] then
notAvoidChance = notAvoidChance * 0.5
end
output.StunAvoidChance = 100 - notAvoidChance
if output.StunAvoidChance >= 100 then
output.StunDuration = 0
output.BlockDuration = 0
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ return {
{ label = "Exposure Effect", { format = "{1:output:ExposureEffectOnSelf}%", { modName = "ExposureEffectOnSelf" }, }, },
{ label = "Debuff Dur. Mult.", haveOutput = "showDebuffExpirationModifier", { format = "{1:output:DebuffExpirationModifier}%", { modName = "SelfDebuffExpirationRate" }, }, },
} }, { defaultCollapsed = false, label = "Stun Duration", data = {
{ label = "Stun Avoid Chance", haveOutput = "StunAvoidChance", { format = "{0:output:StunAvoidChance}%", { modName = "AvoidStun" }, }, },
{ label = "Stun Avoid Chance", haveOutput = "StunAvoidChance", { format = "{0:output:StunAvoidChance}%", { breakdown = "StunAvoidChance" }, { modName = "AvoidStun" }, }, },
{ label = "Stun Threshold", { format = "{0:output:StunThreshold}", { breakdown = "StunThreshold" }, { modName = { "StunThreshold", "StunThresholdManaPercent", "StunThresholdEnergyShieldPercent" } }, }, },
{ label = "Stun Chance", { format = "{0:output:SelfStunChance}%", { breakdown = "SelfStunChance" }, }, },
{ label = "Interrupt Avoid Ch.", haveOutput = "InterruptStunAvoidChance", { format = "{0:output:InterruptStunAvoidChance}%", { modName = "AvoidInterruptStun" }, }, },
Expand Down