Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve EHP overkill approximation, especially for MoM #7568

Merged
Merged
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
4 changes: 3 additions & 1 deletion src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2346,12 +2346,14 @@ function calcs.buildDefenceEstimations(env, actor)

local iterationMultiplier = 1
local damageTotal = 0
local lastPositiveLife = poolTable.Life
local maxDamage = data.misc.ehpCalcMaxDamage
local maxIterations = data.misc.ehpCalcMaxIterationsToCalc
while poolTable.Life > 0 and DamageIn["iterations"] < maxIterations do
DamageIn["iterations"] = DamageIn["iterations"] + 1
local Damage = { }
damageTotal = 0
lastPositiveLife = poolTable.Life
local VaalArcticArmourMultiplier = VaalArcticArmourHitsLeft > 0 and (( 1 - output["VaalArcticArmourMitigation"] * m_min(VaalArcticArmourHitsLeft / iterationMultiplier, 1))) or 1
VaalArcticArmourHitsLeft = VaalArcticArmourHitsLeft - iterationMultiplier
for _, damageType in ipairs(dmgTypeList) do
Expand Down Expand Up @@ -2412,7 +2414,7 @@ function calcs.buildDefenceEstimations(env, actor)
end

if poolTable.Life < 0 and DamageIn["cycles"] == 1 then -- Don't count overkill damage and only on final pass as to not break speedup.
numHits = numHits + poolTable.Life / damageTotal
numHits = numHits + poolTable.Life / (lastPositiveLife - poolTable.Life)
poolTable.Life = 0
end
-- Recalculate total hit damage
Expand Down