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
2 changes: 2 additions & 0 deletions src/Modules/CalcBreakdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ function breakdown.effMult(damageType, resist, pen, taken, mult, takenMore, sour
if not useRes then
t_insert(out, s_format("x %d%% ^8(resistance ignored)", 0))
t_insert(out, s_format("= %d%%", (0)))
elseif resist <= 0 then
t_insert(out, s_format("= %d%% ^8(negative resistance unaffected by penetration)", resist))
elseif (resist - pen) < 0 then
t_insert(out, s_format("= %d%% ^8(penetration cannot bring resistances below 0)", 0))
else
Expand Down
8 changes: 6 additions & 2 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,7 @@ function calcs.buildDefenceEstimations(env, actor)
local impaleArmourReduct = 0
local percentOfArmourApplies = m_min((not modDB:Flag(nil, "ArmourDoesNotApplyTo"..damageType.."DamageTaken") and modDB:Sum("BASE", nil, "ArmourAppliesTo"..damageType.."DamageTaken") or 0), 100)
local effectiveAppliedArmour = (output.Armour * percentOfArmourApplies / 100) * (1 + output.ArmourDefense)
local resMult = 1 - (resist - enemyPen) / 100
local resMult = 1 - (resist > 0 and m_max(resist - enemyPen, 0) or resist) / 100
local reductMult = 1
local takenFlat = modDB:Sum("BASE", nil, "DamageTaken", damageType.."DamageTaken", "DamageTakenWhenHit", damageType.."DamageTakenWhenHit")
if damageCategoryConfig == "Melee" or damageCategoryConfig == "Projectile" then
Expand Down Expand Up @@ -2068,7 +2068,11 @@ function calcs.buildDefenceEstimations(env, actor)
if enemyPen ~= 0 then
t_insert(breakdown[damageType.."TakenHitMult"], s_format("+ Enemy Pen: %.2f", enemyPen / 100))
end
if resist ~= 0 and enemyPen ~= 0 then
if resist <= 0 and enemyPen ~=0 then
t_insert(breakdown[damageType.."TakenHitMult"], s_format("= %.2f ^8(Negative resistance unaffected by penetration)", resMult))
elseif (resist - enemyPen) < 0 then
t_insert(breakdown[damageType.."TakenHitMult"], s_format("= %.2f ^8(Penetration cannot bring resistances below 0)", resMult))
elseif resist ~= 0 then
t_insert(breakdown[damageType.."TakenHitMult"], s_format("= %.2f", resMult))
end
if resMult ~= 1 and reductMult ~= 1 then
Expand Down
6 changes: 3 additions & 3 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3183,7 +3183,7 @@ function calcs.offence(env, actor, activeSkill)
resist = resist > 0 and resist * (1 - (skillModList:Sum("BASE", nil, "PartialIgnoreEnemyPhysicalDamageReduction") / 100 + ChanceToIgnoreEnemyPhysicalDamageReduction / 100)) or resist
end
else
resist = calcResistForType(damageType, dotCfg)
resist = calcResistForType(damageType, cfg)
if ((skillModList:Flag(cfg, "ChaosDamageUsesLowestResistance") or skillModList:Flag(cfg, "ChaosDamageUsesHighestResistance")) and damageType == "Chaos") or
(skillModList:Flag(cfg, "ElementalDamageUsesLowestResistance") and isElemental[damageType]) then
-- Default to using the current damage type
Expand All @@ -3194,7 +3194,7 @@ function calcs.offence(env, actor, activeSkill)
-- Find the lowest resist of all the elements and use that if it's lower
for _, eleDamageType in ipairs(dmgTypeList) do
if isElemental[eleDamageType] and useThisResist(eleDamageType) and damageType ~= eleDamageType then
local currentElementResist = calcResistForType(eleDamageType, dotCfg)
local currentElementResist = calcResistForType(eleDamageType, cfg)
-- If it's explicitly lower, then use the resist and update which element we're using to account for penetration
if skillModList:Flag(cfg, "ChaosDamageUsesHighestResistance") then
if resist < currentElementResist then
Expand Down Expand Up @@ -3244,7 +3244,7 @@ function calcs.offence(env, actor, activeSkill)
if skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then
effMult = effMult * (1 - resist / 100)
elseif useRes then
effMult = effMult * (1 - (m_max(resist - pen, 0)) / 100)
effMult = effMult * (1 - (resist > 0 and m_max(resist - pen, 0) or resist) / 100)
end
damageTypeHitMin = damageTypeHitMin * effMult
damageTypeHitMax = damageTypeHitMax * effMult
Expand Down
Loading