Skip to content

Improve MoM+EB(+ES bypass) calculations #8590

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
184 changes: 184 additions & 0 deletions spec/System/TestDefence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -807,4 +807,188 @@ describe("TestDefence", function()
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
end)

it("MoM + EB", function()
build.configTab.input.enemyIsBoss = "None"
-- enough mana and es, 0% and 100% bypass
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
+40 to maximum life
+1960 to mana
+2000 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(200, build.calcsTab.calcsOutput.FireMaximumHitTaken)
assert.are.equals(200, build.calcsTab.calcsOutput.ChaosMaximumHitTaken)
local poolsRemaining = poolsRemainingAfterTypeMaxHit("Chaos")
assert.are.equals(2000, round(poolsRemaining.EnergyShield))
assert.are.equals(1900, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(1900, round(poolsRemaining.EnergyShield))
assert.are.equals(2000, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))

-- enough mana and es, 50% bypass
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
50% of non-chaos damage taken bypasses energy shield
+40 to maximum life
+1960 to mana
+2000 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(200, build.calcsTab.calcsOutput.FireMaximumHitTaken)
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(1950, round(poolsRemaining.EnergyShield))
assert.are.equals(1950, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))

-- es bottleneck, 0% and 100% bypass
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
+40 to maximum life
+1960 to mana
+50 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(200, build.calcsTab.calcsOutput.FireMaximumHitTaken)
assert.are.equals(200, build.calcsTab.calcsOutput.ChaosMaximumHitTaken)
poolsRemaining = poolsRemainingAfterTypeMaxHit("Chaos")
assert.are.equals(50, round(poolsRemaining.EnergyShield))
assert.are.equals(1900, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(0, round(poolsRemaining.EnergyShield))
assert.are.equals(1950, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))

-- es bottleneck, 50% bypass
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
50% of non-chaos damage taken bypasses energy shield
+40 to maximum life
+1960 to mana
+40 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(200, build.calcsTab.calcsOutput.FireMaximumHitTaken)
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(0, round(poolsRemaining.EnergyShield))
assert.are.equals(1940, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))

-- mana bottleneck, 0% and 100% bypass
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
+40 to maximum life
+2000 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(200, build.calcsTab.calcsOutput.FireMaximumHitTaken)
assert.are.equals(140, build.calcsTab.calcsOutput.ChaosMaximumHitTaken)
poolsRemaining = poolsRemainingAfterTypeMaxHit("Chaos")
assert.are.equals(2000, round(poolsRemaining.EnergyShield))
assert.are.equals(0, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(1900, round(poolsRemaining.EnergyShield))
assert.are.equals(40, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))

-- mana bottleneck, 50% bypass
-- taking 160 damage in this scenario:
-- 160 damage is split to 80 damage straight to life, 80 damage to MoM pools
-- 50% of the 80 MoM pool damage is taken by ES and 50% bypasses
-- pool of 20 mana takes 40 damage, gets depleted and the remaining damage continues on to life, for a total of 100 damage to life
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
50% of non-chaos damage taken bypasses energy shield
+40 to maximum life
-20 to mana
+2000 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(160, build.calcsTab.calcsOutput.FireMaximumHitTaken)
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(1960, round(poolsRemaining.EnergyShield))
assert.are.equals(0, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))

-- mana+es bottleneck, 0% and 100% bypass
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
+940 to maximum life
+50 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(1090, build.calcsTab.calcsOutput.FireMaximumHitTaken)
assert.are.equals(1040, build.calcsTab.calcsOutput.ChaosMaximumHitTaken)
poolsRemaining = poolsRemainingAfterTypeMaxHit("Chaos")
assert.are.equals(50, round(poolsRemaining.EnergyShield))
assert.are.equals(0, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(0, round(poolsRemaining.EnergyShield))
assert.are.equals(0, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))

-- mana+es bottleneck, 50% bypass
build.configTab.input.customMods = [[
50% of damage is taken from mana before life
energy shield protects mana instead of life
50% of non-chaos damage taken bypasses energy shield
+940 to maximum life
+50 to energy shield
You have no intelligence
+60% to all resistances
]]
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(1090, build.calcsTab.calcsOutput.FireMaximumHitTaken)
poolsRemaining = poolsRemainingAfterTypeMaxHit("Fire")
assert.are.equals(0, round(poolsRemaining.EnergyShield))
assert.are.equals(0, round(poolsRemaining.Mana))
assert.are.equals(0, floor(poolsRemaining.Life))
assert.are.equals(0, floor(poolsRemaining.OverkillDamage))
end)
end)
Loading