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
1 change: 1 addition & 0 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild)
{ stat = "CritChance", label = "Effective Crit Chance", fmt = ".2f%%", condFunc = function(v,o) return v ~= o.PreEffectiveCritChance end },
{ stat = "CritMultiplier", label = "Crit Multiplier", fmt = "d%%", pc = true, condFunc = function(v,o) return (o.CritChance or 0) > 0 end },
{ stat = "HitChance", label = "Hit Chance", fmt = ".0f%%", flag = "attack" },
{ stat = "HitChance", label = "Hit Chance", fmt = ".0f%%", condFunc = function(v,o) return o.enemyHasSpellBlock end },
{ stat = "TotalDPS", label = "Hit DPS", fmt = ".1f", compPercent = true, flag = "notAverage" },
{ stat = "PvpTotalDPS", label = "PvP Hit DPS", fmt = ".1f", compPercent = true, flag = "notAveragePvP" },
{ stat = "TotalDPS", label = "Hit DPS", fmt = ".1f", compPercent = true, flag = "showAverage", condFunc = function(v,o) return (o.TriggerTime or 0) ~= 0 end },
Expand Down
35 changes: 28 additions & 7 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1548,14 +1548,34 @@ function calcs.offence(env, actor, activeSkill)
end
end
if not isAttack or skillModList:Flag(cfg, "CannotBeEvaded") or skillData.cannotBeEvaded or (env.mode_effective and enemyDB:Flag(nil, "CannotEvade")) then
output.HitChance = 100
output.AccuracyHitChance = 100
else
local enemyEvasion = m_max(round(calcLib.val(enemyDB, "Evasion")), 0)
output.HitChance = calcs.hitChance(enemyEvasion, output.Accuracy) * calcLib.mod(skillModList, cfg, "HitChance")
output.AccuracyHitChance = calcs.hitChance(enemyEvasion, output.Accuracy) * calcLib.mod(skillModList, cfg, "HitChance")
if breakdown then
breakdown.HitChance = {
breakdown.AccuracyHitChance = {
"Enemy level: "..env.enemyLevel..(env.configInput.enemyLevel and " ^8(overridden from the Configuration tab" or " ^8(can be overridden in the Configuration tab)"),
"Average enemy evasion: "..enemyEvasion,
"Approximate hit chance: "..output.AccuracyHitChance.."%",
}
end
end
--enemy block chance
output.enemyBlockChance = m_min(m_max((enemyDB:Sum("BASE", cfg, "BlockChance") or 0), 0), 100)
output.HitChance = output.AccuracyHitChance * (1 - output.enemyBlockChance / 100)
if output.enemyBlockChance > 0 and not isAttack then
globalOutput.enemyHasSpellBlock = true
end
if breakdown and output.enemyBlockChance > 0 then
if output.AccuracyHitChance < 100 then
breakdown.HitChance = {
"Accuracy Hit Chance: "..output.AccuracyHitChance.."%",
"Enemy Block Chance: "..output.enemyBlockChance.."%",
"Approximate hit chance: "..output.HitChance.."%",
}
else
breakdown.HitChance = {
"Enemy Block Chance: "..output.enemyBlockChance.."%",
"Approximate hit chance: "..output.HitChance.."%",
}
end
Expand Down Expand Up @@ -1799,6 +1819,7 @@ function calcs.offence(env, actor, activeSkill)

if isAttack then
-- Combine hit chance and attack speed
combineStat("AccuracyHitChance", "AVERAGE")
combineStat("HitChance", "AVERAGE")
combineStat("Speed", "AVERAGE")
combineStat("HitSpeed", "OR")
Expand Down Expand Up @@ -2216,7 +2237,7 @@ function calcs.offence(env, actor, activeSkill)
end
local preHitCheckCritChance = output.CritChance
if env.mode_effective then
output.CritChance = output.CritChance * output.HitChance / 100
output.CritChance = output.CritChance * output.AccuracyHitChance / 100
end
if breakdown and output.CritChance ~= baseCrit then
breakdown.CritChance = { }
Expand All @@ -2241,10 +2262,10 @@ function calcs.offence(env, actor, activeSkill)
t_insert(breakdown.CritChance, s_format("1 - (1 - %.4f) x (1 - %.4f)", preLuckyCritChance / 100, preLuckyCritChance / 100))
t_insert(breakdown.CritChance, s_format("= %.2f%%", preHitCheckCritChance))
end
if env.mode_effective and output.HitChance < 100 then
if env.mode_effective and output.AccuracyHitChance < 100 then
t_insert(breakdown.CritChance, "Crit confirmation roll:")
t_insert(breakdown.CritChance, s_format("%.2f%%", preHitCheckCritChance))
t_insert(breakdown.CritChance, s_format("x %.2f ^8(chance to hit)", output.HitChance / 100))
t_insert(breakdown.CritChance, s_format("x %.2f ^8(chance to hit)", output.AccuracyHitChance / 100))
t_insert(breakdown.CritChance, s_format("= %.2f%%", output.CritChance))
end
end
Expand Down Expand Up @@ -2711,7 +2732,7 @@ function calcs.offence(env, actor, activeSkill)
t_insert(breakdown.AverageHit, s_format("+ %.1f x %.4f ^8(damage from crits)", totalCritAvg, output.CritChance / 100))
t_insert(breakdown.AverageHit, s_format("= %.1f", output.AverageHit))
end
if isAttack then
if output.HitChance < 100 then
breakdown.AverageDamage = { }
t_insert(breakdown.AverageDamage, s_format("%s:", pass.label))
t_insert(breakdown.AverageDamage, s_format("%.1f ^8(average hit)", output.AverageHit))
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ function calcs.perform(env, avoidCache)
trigRate = calcActualTriggerRate(env, source, sourceAPS, spellCount, output, breakdown, dualWield)

-- Account for chance to hit/crit
local sourceHitChance = GlobalCache.cachedData["CACHE"][uuid].HitChance
local sourceHitChance = GlobalCache.cachedData["CACHE"][uuid].AccuracyHitChance
trigRate = trigRate * sourceHitChance / 100
if breakdown then
breakdown.Speed = {
Expand Down Expand Up @@ -3013,7 +3013,7 @@ function calcs.perform(env, avoidCache)
trigRate = calcActualTriggerRate(env, source, sourceAPS, spellCount, env.minion.output, env.minion.breakdown, false, true)

-- Account for chance to hit
local sourceHitChance = GlobalCache.cachedData["CACHE"][uuid].HitChance
local sourceHitChance = GlobalCache.cachedData["CACHE"][uuid].AccuracyHitChance
trigRate = trigRate * sourceHitChance / 100
if env.minion.breakdown then
env.minion.breakdown.Speed = {
Expand Down
23 changes: 21 additions & 2 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ return {
{ breakdown = "OffHand.AverageDamage" },
{ breakdown = "AverageDamage" },
}, },
{ label = "Chance to Hit", haveOutput = "enemyHasSpellBlock", { format = "{0:output:HitChance}%",
{ breakdown = "HitChance" },
{ label = "Enemy Block", modName = { "BlockChance" }, enemy = true },
}, },
{ label = "Average Damage", haveOutput = "enemyHasSpellBlock", { format = "{1:output:AverageDamage}",
{ breakdown = "AverageDamage" },
}, },
{ label = "PvP Average Dmg", flag = "attackPvP", { format = "{1:output:PvpAverageDamage}",
{ breakdown = "MainHand.PvpAverageDamage" },
{ breakdown = "OffHand.PvpAverageDamage" },
Expand Down Expand Up @@ -756,18 +763,30 @@ return {
{ breakdown = "MainHand.Accuracy" },
{ modName = "Accuracy", cfg = "weapon1" },
}, },
{ label = "MH Chance to Hit", bgCol = colorCodes.MAINHANDBG, flag = "weapon1Attack", { format = "{0:output:MainHand.HitChance}%",
{ label = "MH Chance to Hit", bgCol = colorCodes.MAINHANDBG, flag = "weapon1Attack", { format = "{0:output:MainHand.AccuracyHitChance}%",
{ breakdown = "MainHand.AccuracyHitChance" },
{ label = "Enemy Evasion modifiers", modName = { "Evasion", "CannotEvade" }, enemy = true },
{ label = "Player modifiers", modName = { "HitChance", "CannotBeEvaded", "IgnoreBlindHitChance" } },
}, },
{ label = "MH Chance to Hit", haveOutput = "MainHand.enemyBlockChance", bgCol = colorCodes.MAINHANDBG, flag = "weapon1Attack", { format = "{0:output:MainHand.HitChance}%",
{ breakdown = "MainHand.HitChance" },
{ label = "Enemy Evasion modifiers", modName = { "Evasion", "CannotEvade" }, enemy = true },
{ label = "Enemy Block", modName = { "BlockChance" }, enemy = true },
{ label = "Player modifiers", modName = { "HitChance", "CannotBeEvaded", "IgnoreBlindHitChance" } },
}, },
{ label = "OH Accuracy", bgCol = colorCodes.OFFHANDBG, flag = "weapon2Attack", { format = "{0:output:OffHand.Accuracy}",
{ breakdown = "OffHand.Accuracy" },
{ modName = "Accuracy", cfg = "weapon2" },
}, },
{ label = "OH Chance to Hit", bgCol = colorCodes.OFFHANDBG, flag = "weapon2Attack", { format = "{0:output:OffHand.HitChance}%",
{ label = "OH Chance to Hit", bgCol = colorCodes.OFFHANDBG, flag = "weapon2Attack", { format = "{0:output:OffHand.AccuracyHitChance}%",
{ breakdown = "OffHand.AccuracyHitChance" },
{ label = "Enemy Evasion modifiers", modName = { "Evasion", "CannotEvade" }, enemy = true },
{ label = "Player modifiers", modName = { "HitChance", "CannotBeEvaded", "IgnoreBlindHitChance" } },
}, },
{ label = "OH Chance to Hit", haveOutput = "OffHand.enemyBlockChance", bgCol = colorCodes.OFFHANDBG, flag = "weapon2Attack", { format = "{0:output:OffHand.HitChance}%",
{ breakdown = "OffHand.HitChance" },
{ label = "Enemy Evasion modifiers", modName = { "Evasion", "CannotEvade" }, enemy = true },
{ label = "Enemy Block", modName = { "BlockChance" }, enemy = true },
{ label = "Player modifiers", modName = { "HitChance", "CannotBeEvaded", "IgnoreBlindHitChance" } },
}, },
{ label = "Effect of Blind", haveOutput = "BlindEffectMod", { format = "{0:output:BlindEffectMod}%", { breakdown = "BlindEffectMod" }, { modName = { "BlindEffect", "BuffEffectOnSelf" }, }, } },
Expand Down
1 change: 1 addition & 0 deletions src/Modules/Common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ function cacheData(uuid, env)
Speed = env.player.output.Speed,
ManaCost = env.player.output.ManaCost,
HitChance = env.player.output.HitChance,
AccuracyHitChance = env.player.output.AccuracyHitChance,
PreEffectiveCritChance = env.player.output.PreEffectiveCritChance,
CritChance = env.player.output.CritChance,
TotalDPS = env.player.output.TotalDPS,
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,9 @@ Uber Pinnacle Boss adds the following modifiers:
{ var = "enemyChaosResist", type = "integer", label = "Enemy ^xD02090Chaos Resistance:", apply = function(val, modList, enemyModList)
enemyModList:NewMod("ChaosResist", "BASE", val, "Config")
end },
{ var = "enemyBlockChance", type = "integer", label = "Enemy Block Chance:", apply = function(val, modList, enemyModList)
enemyModList:NewMod("BlockChance", "BASE", val, "Config")
end },
{ var = "presetBossSkills", type = "list", label = "Boss Skill Preset", tooltip = [[
Used to fill in defaults for specific boss skills if the boss config is not set

Expand Down