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
8 changes: 5 additions & 3 deletions src/Modules/BuildDisplayStats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ local displayStats = {
{ },
{ stat = "Evasion", label = "Evasion rating", fmt = "d", color = colorCodes.EVASION, compPercent = true },
{ stat = "Spec:EvasionInc", label = "%Inc Evasion from Tree", color = colorCodes.EVASION, fmt = "d%%" },
{ stat = "MeleeEvadeChance", label = "Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.MeleeEvadeChance == o.ProjectileEvadeChance end },
{ stat = "MeleeEvadeChance", label = "Melee Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.MeleeEvadeChance ~= o.ProjectileEvadeChance end },
{ stat = "ProjectileEvadeChance", label = "Projectile Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.MeleeEvadeChance ~= o.ProjectileEvadeChance end },
{ stat = "EvadeChance", label = "Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.noSplitEvade end },
{ stat = "MeleeEvadeChance", label = "Melee Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.splitEvade end },
{ stat = "ProjectileEvadeChance", label = "Projectile Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.splitEvade end },
{ stat = "SpellEvadeChance", label = "Spell Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.splitEvade end },
{ stat = "SpellProjectileEvadeChance", label = "Spell Proj. Evade Chance", fmt = "d%%", color = colorCodes.EVASION, condFunc = function(v,o) return v > 0 and o.splitEvade end },
{ },
{ stat = "Armour", label = "Armour", fmt = "d", compPercent = true },
{ stat = "Spec:ArmourInc", label = "%Inc Armour from Tree", fmt = "d%%" },
Expand Down
35 changes: 29 additions & 6 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,8 @@ function calcs.defence(env, actor)
output.Evasion = m_max(round(output.Evasion), 0)
output.MeleeEvasion = m_max(round(output.Evasion * calcLib.mod(modDB, nil, "MeleeEvasion")), 0)
output.ProjectileEvasion = m_max(round(output.Evasion * calcLib.mod(modDB, nil, "ProjectileEvasion")), 0)
output.SpellEvasion = m_max(round(output.Evasion * calcLib.mod(modDB, nil, "SpellEvasion")), 0)
output.SpellProjectileEvasion = m_max(round(output.Evasion * calcLib.mod(modDB, nil, "SpellProjectileEvasion")), 0)
output.LowestOfArmourAndEvasion = m_min(output.Armour, output.Evasion)
output.Ward = m_max(m_floor(ward), 0)
output["Gear:Ward"] = gearWard
Expand All @@ -1355,10 +1357,14 @@ function calcs.defence(env, actor)
output.EvadeChance = 0
output.MeleeEvadeChance = 0
output.ProjectileEvadeChance = 0
output.SpellEvadeChance = 0
output.SpellProjectileEvadeChance = 0
elseif modDB:Flag(nil, "AlwaysEvade") then
output.EvadeChance = 100
output.MeleeEvadeChance = 100
output.ProjectileEvadeChance = 100
output.SpellEvadeChance = 100
output.SpellProjectileEvadeChance = 100
else
local enemyAccuracy = round(calcLib.val(enemyDB, "Accuracy"))
if modDB:Flag(nil, "EnemyAccuracyDistancePenalty") then
Expand All @@ -1372,8 +1378,10 @@ function calcs.defence(env, actor)
output.EvadeChance = 100 - (calcs.hitChance(output.Evasion, enemyAccuracy) - evadeChance) * hitChance
output.MeleeEvadeChance = m_max(0, m_min(evadeMax, (100 - (calcs.hitChance(output.MeleeEvasion, enemyAccuracy) - evadeChance) * hitChance) * calcLib.mod(modDB, nil, "EvadeChance", "MeleeEvadeChance")))
output.ProjectileEvadeChance = m_max(0, m_min(evadeMax, (100 - (calcs.hitChance(output.ProjectileEvasion, enemyAccuracy) - evadeChance) * hitChance) * calcLib.mod(modDB, nil, "EvadeChance", "ProjectileEvadeChance")))
output.SpellEvadeChance = m_max(0, m_min(evadeMax, (100 - (calcs.hitChance(output.SpellEvasion, enemyAccuracy) - evadeChance) * hitChance) * calcLib.mod(modDB, nil, "EvadeChance", "SpellEvadeChance")))
output.SpellProjectileEvadeChance = m_max(0, m_min(evadeMax, (100 - (calcs.hitChance(output.SpellProjectileEvasion, enemyAccuracy) - evadeChance) * hitChance) * calcLib.mod(modDB, nil, "EvadeChance", "ProjectileEvadeChance", "SpellProjectileEvadeChance")))
-- Condition for displaying evade chance only if melee or projectile evade chance have the same values
if output.MeleeEvadeChance ~= output.ProjectileEvadeChance then
if output.MeleeEvadeChance ~= output.ProjectileEvadeChance and output.MeleeEvadeChance ~= output.SpellEvadeChance and output.MeleeEvadeChance ~= output.SpellProjectileEvadeChance then
output.splitEvade = true
else
output.EvadeChance = output.MeleeEvadeChance
Expand All @@ -1398,6 +1406,18 @@ function calcs.defence(env, actor)
s_format("Effective Evasion: %d", output.ProjectileEvasion),
s_format("Approximate projectile evade chance: %d%%", output.ProjectileEvadeChance),
}
breakdown.SpellEvadeChance = {
s_format("Enemy level: %d ^8(%s the Configuration tab)", env.enemyLevel, env.configInput.enemyLevel and "overridden from" or "can be overridden in"),
s_format("Average enemy accuracy: %d", enemyAccuracy),
s_format("Effective Evasion: %d", output.SpellEvasion),
s_format("Approximate spell evade chance: %d%%", output.SpellEvadeChance),
}
breakdown.SpellProjectileEvadeChance = {
s_format("Enemy level: %d ^8(%s the Configuration tab)", env.enemyLevel, env.configInput.enemyLevel and "overridden from" or "can be overridden in"),
s_format("Average enemy accuracy: %d", enemyAccuracy),
s_format("Effective Evasion: %d", output.SpellProjectileEvasion),
s_format("Approximate spell projectile evade chance: %d%%", output.SpellProjectileEvadeChance),
}
end
end
end
Expand Down Expand Up @@ -1922,11 +1942,11 @@ function calcs.buildDefenceEstimations(env, actor)
local worstOf = env.configInput.EHPUnluckyWorstOf or 1
output.MeleeNotHitChance = 100 - (1 - output.MeleeEvadeChance / 100) * (1 - output.EffectiveAttackDodgeChance / 100) * (1 - output.AvoidAllDamageFromHitsChance / 100) * 100
output.ProjectileNotHitChance = 100 - (1 - output.ProjectileEvadeChance / 100) * (1 - output.EffectiveAttackDodgeChance / 100) * (1 - output.AvoidAllDamageFromHitsChance / 100) * (1 - (output.specificTypeAvoidance and 0 or output.AvoidProjectilesChance) / 100) * 100
output.SpellNotHitChance = 100 - (1 - output.EffectiveSpellDodgeChance / 100) * (1 - output.AvoidAllDamageFromHitsChance / 100) * 100
output.SpellProjectileNotHitChance = 100 - (1 - output.EffectiveSpellDodgeChance / 100) * (1 - output.AvoidAllDamageFromHitsChance / 100) * (1 - (output.specificTypeAvoidance and 0 or output.AvoidProjectilesChance) / 100) * 100
output.SpellNotHitChance = 100 - (1 - output.SpellEvadeChance / 100) * (1 - output.EffectiveSpellDodgeChance / 100) * (1 - output.AvoidAllDamageFromHitsChance / 100) * 100
output.SpellProjectileNotHitChance = 100 - (1 - output.SpellProjectileEvadeChance / 100) * (1 - output.EffectiveSpellDodgeChance / 100) * (1 - output.AvoidAllDamageFromHitsChance / 100) * (1 - (output.specificTypeAvoidance and 0 or output.AvoidProjectilesChance) / 100) * 100
output.UntypedNotHitChance = 100 - (1 - output.AvoidAllDamageFromHitsChance / 100) * 100
output.AverageNotHitChance = (output.MeleeNotHitChance + output.ProjectileNotHitChance + output.SpellNotHitChance + output.SpellProjectileNotHitChance) / 4
output.AverageEvadeChance = (output.MeleeEvadeChance + output.ProjectileEvadeChance) / 4
output.AverageEvadeChance = (output.MeleeEvadeChance + output.ProjectileEvadeChance + output.SpellNotHitChance + output.SpellProjectileNotHitChance) / 4
output.ConfiguredNotHitChance = output[damageCategoryConfig.."NotHitChance"]
output.ConfiguredEvadeChance = output[damageCategoryConfig.."EvadeChance"] or 0
-- unlucky config to lower the value of block, dodge, evade etc for ehp
Expand Down Expand Up @@ -3147,15 +3167,18 @@ function calcs.buildDefenceEstimations(env, actor)
t_insert(breakdown["ConfiguredNotHitChance"], s_format("x %.2f ^8(chance for avoidance to fail)", 1 - output.AvoidProjectilesChance / 100))
end
elseif damageCategoryConfig == "Spell" or damageCategoryConfig == "SpellProjectile" then
if output[damageCategoryConfig.."EvadeChance"] > 0 then
t_insert(breakdown["ConfiguredNotHitChance"], s_format("%.2f ^8(chance for evasion to fail)", 1 - output[damageCategoryConfig.."EvadeChance"] / 100))
end
if output.SpellDodgeChance > 0 then
t_insert(breakdown["ConfiguredNotHitChance"], s_format("%.2f ^8(chance for dodge to fail)", 1 - output.SpellDodgeChance / 100))
end
if damageCategoryConfig == "SpellProjectile" and not output.specificTypeAvoidance and output.AvoidProjectilesChance > 0 then
t_insert(breakdown["ConfiguredNotHitChance"], s_format("x %.2f ^8(chance for avoidance to fail)", 1 - output.AvoidProjectilesChance / 100))
end
elseif damageCategoryConfig == "Average" then
if output.MeleeEvadeChance > 0 or output.ProjectileEvadeChance > 0 then
t_insert(breakdown["ConfiguredNotHitChance"], s_format("%.2f ^8(chance for evasion to fail, only applies to the attack portion)", 1 - (output.MeleeEvadeChance + output.ProjectileEvadeChance) / 2 / 100))
if output.MeleeEvadeChance > 0 or output.ProjectileEvadeChance > 0 or output.SpellNotHitChance > 0 or output.SpellProjectileNotHitChance > 0 then
t_insert(breakdown["ConfiguredNotHitChance"], s_format("%.2f ^8(chance for evasion to fail)", 1 - (output.MeleeEvadeChance + output.ProjectileEvadeChance + output.SpellNotHitChance + output.SpellProjectileNotHitChance) / 4 / 100))
end
if output.AttackDodgeChance > 0 or output.SpellDodgeChance > 0 then
t_insert(breakdown["ConfiguredNotHitChance"], s_format("x%.2f ^8(chance for dodge to fail)", 1 - (output.AttackDodgeChance + output.SpellDodgeChance) / 2 / 100))
Expand Down
12 changes: 11 additions & 1 deletion src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ return {
{ label = "Total", { format = "{0:output:Evasion}", { breakdown = "Evasion" }, }, },
{ label = "Evade Chance", haveOutput = "noSplitEvade", { format = "{0:output:EvadeChance}%",
{ breakdown = "EvadeChance" },
{ label = "Player modifiers", modName = { "CannotEvade", "EvadeChance", "MeleeEvadeChance", "ProjectileEvadeChance" } },
{ label = "Player modifiers", modName = { "CannotEvade", "EvadeChance", "MeleeEvadeChance", "ProjectileEvadeChance", "SpellEvadeChance", "SpellProjectileEvadeChance" } },
{ label = "Enemy modifiers", modName = { "Accuracy", "HitChance" }, enemy = true },
}, },
{ label = "Melee Evade Ch.", haveOutput = "splitEvade", { format = "{0:output:MeleeEvadeChance}%",
Expand All @@ -1647,6 +1647,16 @@ return {
{ label = "Player modifiers", modName = { "CannotEvade", "EvadeChance", "ProjectileEvadeChance" } },
{ label = "Enemy modifiers", modName = { "Accuracy", "HitChance" }, enemy = true },
}, },
{ label = "Spell Evade Ch.", haveOutput = "splitEvade", { format = "{0:output:SpellEvadeChance}%",
{ breakdown = "SpellEvadeChance" },
{ label = "Player modifiers", modName = { "CannotEvade", "EvadeChance", "SpellEvadeChance" } },
{ label = "Enemy modifiers", modName = { "Accuracy", "HitChance" }, enemy = true },
}, },
{ label = "Spell Proj. Evade Ch.", haveOutput = "splitEvade", { format = "{0:output:SpellProjectileEvadeChance}%",
{ breakdown = "SpellProjectileEvadeChance" },
{ label = "Player modifiers", modName = { "CannotEvade", "EvadeChance", "ProjectileEvadeChance", "SpellProjectileEvadeChance" } },
{ label = "Enemy modifiers", modName = { "Accuracy", "HitChance" }, enemy = true },
}, },
{ label = "Effect of Blind", haveOutput = "BlindEffectMod", { format = "{0:output:BlindEffectMod}%", { breakdown = "BlindEffectMod" }, { modName = { "BlindEffect", "BuffEffectOnSelf" }, }, } },
} }
} },
Expand Down
2 changes: 2 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ local modNameList = {
["chance to evade attacks"] = "EvadeChance",
["chance to evade attack hits"] = "EvadeChance",
["chance to evade projectile attacks"] = "ProjectileEvadeChance",
["chance to evade spells"] = "SpellEvadeChance",
["chance to evade spell hits"] = "SpellEvadeChance",
["chance to evade melee attacks"] = "MeleeEvadeChance",
["evasion rating against melee attacks"] = "MeleeEvasion",
["evasion rating against projectile attacks"] = "ProjectileEvasion",
Expand Down