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
3 changes: 3 additions & 0 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,9 @@ function buildMode:AddDisplayStatList(statList, actor)
InsertIfNew(self.controls.warnings.lines, line)
end
end
if actor.output.EternalLifeWarning then
InsertIfNew(self.controls.warnings.lines, "You cannot pay Life costs of skills while You have Energy Shield and have Eternal Life allocated")
end
if actor.output.VixensTooMuchCastSpeedWarn then
InsertIfNew(self.controls.warnings.lines, "You may have too much cast speed or too little cooldown reduction to effectively use Vixen's Curse replacement")
end
Expand Down
51 changes: 34 additions & 17 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,14 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
local lifeHitPool = calcLifeHitPoolWithLossPrevention(life, output.Life, output.preventedLifeLoss, lifeLossBelowHalfPrevented)
local MoMEffect = m_min(output.sharedMindOverMatter + output[damageType.."MindOverMatter"], 100) / 100
local MoMPool = MoMEffect < 1 and m_min(lifeHitPool / (1 - MoMEffect) - lifeHitPool, mana) or mana
if energyShield > 0 and esBypass < 1 then
if energyShield > 0 and modDB:Flag(nil, "EternalLife") then
local tempDamage = m_min(damageRemainder, energyShield / (1 - esBypass) / esDamageTypeMultiplier)
energyShield = energyShield - tempDamage * (1 - esBypass) * esDamageTypeMultiplier
esPoolRemaining = m_min(esPoolRemaining, energyShield)
damageRemainder = damageRemainder - tempDamage
resourcesLostToTypeDamage[damageType].energyShield = tempDamage >= 1 and tempDamage * (1 - esBypass) * esDamageTypeMultiplier or nil
resourcesLostToTypeDamage[damageType].eternalLifePrevented = tempDamage >= 1 and tempDamage * esBypass * esDamageTypeMultiplier or nil
elseif energyShield > 0 and esBypass < 1 then
local MoMEBPool = esBypass > 0 and m_min((MoMPool + lifeHitPool) / esBypass * esDamageTypeMultiplier - (MoMPool + lifeHitPool), energyShield) or energyShield
local tempDamage = m_min(damageRemainder * (1 - esBypass), MoMEBPool / esDamageTypeMultiplier)
esPoolRemaining = m_min(esPoolRemaining, MoMEBPool - tempDamage * esDamageTypeMultiplier)
Expand Down Expand Up @@ -663,7 +670,9 @@ local function incomingDamageBreakdown(breakdownTable, poolsRemaining, output)
if output.sharedAegis and output.sharedAegis > 0 then
t_insert(breakdownTable, s_format("\t%d "..colorCodes.GEM.."Shared Aegis charge ^7(%d remaining)", output.sharedAegis - poolsRemaining.Aegis.shared, poolsRemaining.Aegis.shared))
end
local eternalLifePrevented = 0
for _, damageType in ipairs(dmgTypeList) do
eternalLifePrevented = eternalLifePrevented + (poolsRemaining.resourcesLostToTypeDamage[damageType].eternalLifePrevented or 0)
if poolsRemaining.resourcesLostToTypeDamage[damageType].guard then
t_insert(breakdownTable, s_format("\n\t%d "..colorCodes.SCOURGE.."%s Guard charge ^7(%d remaining)", poolsRemaining.resourcesLostToTypeDamage[damageType].guard, damageType, poolsRemaining.Guard[damageType]))
end
Expand All @@ -677,6 +686,9 @@ local function incomingDamageBreakdown(breakdownTable, poolsRemaining, output)
if output.EnergyShieldRecoveryCap ~= poolsRemaining.EnergyShield and output.EnergyShieldRecoveryCap and output.EnergyShieldRecoveryCap > 0 then
t_insert(breakdownTable, s_format("\t%d "..colorCodes.ES.."Energy Shield ^7(%d remaining)", output.EnergyShieldRecoveryCap - poolsRemaining.EnergyShield, poolsRemaining.EnergyShield))
end
if eternalLifePrevented > 0 then
t_insert(breakdownTable, s_format("\t%d "..colorCodes.POSITIVE.."Life change prevented by Eternal Life", eternalLifePrevented))
end
if output.ManaUnreserved ~= poolsRemaining.Mana and output.ManaUnreserved and output.ManaUnreserved > 0 then
t_insert(breakdownTable, s_format("\t%d "..colorCodes.MANA.."Mana ^7(%d remaining)", output.ManaUnreserved - poolsRemaining.Mana, poolsRemaining.Mana))
end
Expand Down Expand Up @@ -2783,33 +2795,35 @@ function calcs.buildDefenceEstimations(env, actor)
for _, damageType in ipairs(dmgTypeList) do
output[damageType.."TotalPool"] = output[damageType.."ManaEffectiveLife"]
output[damageType.."TotalHitPool"] = output[damageType.."MoMHitPool"]
local manatext = "Mana"
if output[damageType.."EnergyShieldBypass"] < 100 then
if modDB:Flag(nil, "EnergyShieldProtectsMana") then
manatext = manatext.." and non-bypassed Energy Shield"
local esBypass = output[damageType.."EnergyShieldBypass"] / 100
local chaosESMultiplier = damageType == "Chaos" and 2 or 1
if modDB:Flag(nil, "EternalLife") then
output[damageType.."TotalPool"] = output[damageType.."TotalPool"] + output.EnergyShieldRecoveryCap / (1 - esBypass) / chaosESMultiplier
output[damageType.."TotalHitPool"] = output[damageType.."TotalHitPool"] + output.EnergyShieldRecoveryCap / (1 - esBypass) / chaosESMultiplier
elseif esBypass < 1 then
if esBypass > 0 then
local poolProtected = output.EnergyShieldRecoveryCap / (1 - esBypass) * esBypass / chaosESMultiplier
output[damageType.."TotalPool"] = m_max(output[damageType.."TotalPool"] - poolProtected, 0) + m_min(output[damageType.."TotalPool"], poolProtected) / esBypass
output[damageType.."TotalHitPool"] = m_max(output[damageType.."TotalHitPool"] - poolProtected, 0) + m_min(output[damageType.."TotalHitPool"], poolProtected) / esBypass
else
local chaosESMultiplier = damageType == "Chaos" and 2 or 1
if output[damageType.."EnergyShieldBypass"] > 0 then
local poolProtected = output.EnergyShieldRecoveryCap / (1 - output[damageType.."EnergyShieldBypass"] / 100) * (output[damageType.."EnergyShieldBypass"] / 100 / chaosESMultiplier)
output[damageType.."TotalPool"] = m_max(output[damageType.."TotalPool"] - poolProtected, 0) + m_min(output[damageType.."TotalPool"], poolProtected) / (output[damageType.."EnergyShieldBypass"] / 100)
output[damageType.."TotalHitPool"] = m_max(output[damageType.."TotalHitPool"] - poolProtected, 0) + m_min(output[damageType.."TotalHitPool"], poolProtected) / (output[damageType.."EnergyShieldBypass"] / 100)
else
output[damageType.."TotalPool"] = output[damageType.."TotalPool"] + output.EnergyShieldRecoveryCap / chaosESMultiplier
output[damageType.."TotalHitPool"] = output[damageType.."TotalHitPool"] + output.EnergyShieldRecoveryCap / chaosESMultiplier
end
output[damageType.."TotalPool"] = output[damageType.."TotalPool"] + output.EnergyShieldRecoveryCap / chaosESMultiplier
output[damageType.."TotalHitPool"] = output[damageType.."TotalHitPool"] + output.EnergyShieldRecoveryCap / chaosESMultiplier
end
end
if breakdown then
breakdown[damageType.."TotalPool"] = {
s_format("Life: %d", output.LifeRecoverable)
}
if output[damageType.."ManaEffectiveLife"] ~= output.LifeRecoverable then
t_insert(breakdown[damageType.."TotalPool"], s_format("%s through MoM: %d", manatext, output[damageType.."ManaEffectiveLife"] - output.LifeRecoverable))
t_insert(breakdown[damageType.."TotalPool"], s_format("Mana through MoM: %d", output[damageType.."ManaEffectiveLife"] - output.LifeRecoverable))
end
if (not modDB:Flag(nil, "EnergyShieldProtectsMana")) and output[damageType.."EnergyShieldBypass"] < 100 then
if modDB:Flag(nil, "EternalLife") then
t_insert(breakdown[damageType.."TotalPool"], s_format("Energy Shield: %d%s", output.EnergyShieldRecoveryCap / chaosESMultiplier, damageType == "Chaos" and "^8 (ES takes double damage from chaos)" or ""))
t_insert(breakdown[damageType.."TotalPool"], s_format("Life change prevented by Eternal Life: %d", output[damageType.."TotalPool"] - output[damageType.."ManaEffectiveLife"] - output.EnergyShieldRecoveryCap / chaosESMultiplier))
elseif esBypass < 1 then
t_insert(breakdown[damageType.."TotalPool"], s_format("Non-bypassed Energy Shield: %d", output[damageType.."TotalPool"] - output[damageType.."ManaEffectiveLife"]))
end
t_insert(breakdown[damageType.."TotalPool"], s_format("TotalPool: %d", output[damageType.."TotalPool"]))
t_insert(breakdown[damageType.."TotalPool"], s_format("Total Pool: %d", output[damageType.."TotalPool"]))
end
end

Expand Down Expand Up @@ -4062,6 +4076,9 @@ function calcs.buildDefenceEstimations(env, actor)
resourcesLostSum = resourcesLostSum + resourcesLost.energyShield
t_insert(breakdownTable, s_format("\t%d "..colorCodes.ES.."Energy Shield%s", resourcesLost.energyShield, damageType == "Chaos" and "^8 (ES takes double damage from chaos)" or ""))
end
if resourcesLost.eternalLifePrevented then
t_insert(breakdownTable, s_format("\t%d "..colorCodes.POSITIVE.."Life change prevented by Eternal Life", resourcesLost.eternalLifePrevented))
end
if resourcesLost.mana then
resourcesLostSum = resourcesLostSum + resourcesLost.mana
t_insert(breakdownTable, s_format("\t%d "..colorCodes.MANA.."Mana", resourcesLost.mana))
Expand Down
1 change: 1 addition & 0 deletions src/Modules/Calcs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ function calcs.buildOutput(build, mode)
t_insert(output[costResource.."Warning"], skill.activeEffect.grantedEffect.name)
end
end
output.EternalLifeWarning = output.EternalLifeWarning or env.modDB:Flag(nil, "EternalLife") and costResource == "LifeCost" and cachedCost > 0 and output.EnergyShieldRecoveryCap > 0
end
end
for pool, costResource in pairs({["LifeUnreservedPercent"] = "LifePercentCost", ["ManaUnreservedPercent"] = "ManaPercentCost"}) do
Expand Down
11 changes: 6 additions & 5 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2271,11 +2271,11 @@ local specialModList = {
mod("PhysicalEnergyShieldBypass", "BASE", 100),
},
["(%d+)%% of damage taken bypasses energy shield"] = function(num) return {
mod("PhysicalEnergyShieldBypass", "OVERRIDE", num),
mod("LightningEnergyShieldBypass", "OVERRIDE", num),
mod("ColdEnergyShieldBypass", "OVERRIDE", num),
mod("FireEnergyShieldBypass", "OVERRIDE", num),
mod("ChaosEnergyShieldBypass", "OVERRIDE", num),
mod("PhysicalEnergyShieldBypass", "BASE", num),
mod("LightningEnergyShieldBypass", "BASE", num),
mod("ColdEnergyShieldBypass", "BASE", num),
mod("FireEnergyShieldBypass", "BASE", num),
mod("ChaosEnergyShieldBypass", "BASE", num),
} end,
["auras from your skills do not affect allies"] = { flag("SelfAuraSkillsCannotAffectAllies") },
["auras from your skills have (%d+)%% more effect on you"] = function(num) return { mod("SkillAuraEffectOnSelf", "MORE", num) } end,
Expand Down Expand Up @@ -2819,6 +2819,7 @@ local specialModList = {
["gain accuracy rating equal to your strength"] = { mod("Accuracy", "BASE", 1, { type = "PerStat", stat = "Str" }) },
["gain accuracy rating equal to twice your strength"] = { mod("Accuracy", "BASE", 2, { type = "PerStat", stat = "Str" }) },
-- Lich
["your life cannot change while you have energy shield"] = { flag("EternalLife") },
["while you are not on low mana, you and allies in your presence have unholy might"] = { mod("ExtraAura", "LIST", { mod = flag("Condition:UnholyMight")}, { type = "Condition", var = "LowMana", neg = true }) },
["(%d+)%% increased magnitude of unholy might buffs you grant per (%d+) maximum mana"] = function(num, _, num2) return { mod("ExtraAura", "LIST", { mod = mod("Multiplier:UnholyMightMagnitude", "BASE", num, { type = "PerStat", stat = "Mana", div = tonumber(num2), actor = "parent"}), { type = "GlobalEffect", effectName = "BlackenedHeart", effectType = "Aura", unscaleable = true}}) } end,
["non%-channelling spells cost an additional (%d+)%% of maximum energy shield"] = function(num) return { mod("ESCostBase", "BASE", 1, nil, 0, KeywordFlag.Spell, { type = "PercentStat", percent = num, stat = "EnergyShield" }, { type = "SkillType", skillType = SkillType.Channel, neg = true } )} end,
Expand Down
Loading