Skip to content

Commit

Permalink
Improve EHP overkill approximation, especially for MoM (#7568)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjc authored Oct 20, 2024
1 parent 22d8b27 commit 8cfe305
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2420,12 +2420,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 @@ -2486,7 +2488,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

0 comments on commit 8cfe305

Please sign in to comment.