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/BuildDisplayStats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local displayStats = {
{ 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 = "AccuracyHitChanceUncapped", label = "Uncap. Hit Chance", fmt = ".0f%%", flag = "attack", condFunc = function(v,o) if o.AccuracyHitChanceUncapped then return o.AccuracyHitChanceUncapped > 100 end 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
8 changes: 8 additions & 0 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ function calcs.hitChance(evasion, accuracy)
return m_max(m_min(round(rawChance), 100), 5)
end

-- Calculate uncapped hit chance for mods that enable "Chance to hit with Attacks can exceed 100%"
function calcs.hitChanceUncapped(evasion, accuracy)
if accuracy < 0 then
return 5
end
local rawChance = ( accuracy * 1.5 ) / ( accuracy + evasion ) * 100
return m_max(round(rawChance), 5)
end
-- Calculate damage reduction from armour, float
function calcs.armourReductionF(armour, raw)
if armour == 0 and raw == 0 then
Expand Down
21 changes: 21 additions & 0 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2194,6 +2194,26 @@ function calcs.offence(env, actor, activeSkill)
}
end
end
-- Accounting for mods that enable "Chance to hit with Attacks can exceed 100%"
if skillModList:Flag(nil,"Condition:HitChanceCanExceed100") and output.AccuracyHitChance == 100 then
local enemyEvasion = m_max(round(calcLib.val(enemyDB, "Evasion")), 0)
output.AccuracyHitChanceUncapped = m_max(calcs.hitChanceUncapped(enemyEvasion, accuracyVsEnemy) * calcLib.mod(skillModList, cfg, "HitChance"), output.AccuracyHitChance) -- keep higher chance in case of "CannotBeEvaded"
if breakdown and breakdown.AccuracyHitChance then
t_insert(breakdown.AccuracyHitChance, "Uncapped hit chance: " .. output.AccuracyHitChanceUncapped .. "%")
elseif breakdown then
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)"),
"Enemy evasion: "..enemyEvasion,
"Approximate hit chance: "..output.AccuracyHitChance.."%",
"Uncapped hit chance: " .. output.AccuracyHitChanceUncapped .. "%"
}
end
local handCondition = (pass.label == "Off Hand") and "OffHandAttack" or "MainHandAttack"
if output.AccuracyHitChanceUncapped - 100 > 0 then
skillModList:NewMod("Multiplier:ExcessHitChance", "BASE", round(output.AccuracyHitChanceUncapped - 100, 2), "HitChanceCanExceed100", { type = "Condition", var = handCondition})
end

end
--enemy block chance
output.enemyBlockChance = m_max(m_min((enemyDB:Sum("BASE", cfg, "BlockChance") or 0), 100) - skillModList:Sum("BASE", cfg, "reduceEnemyBlock"), 0)
if enemyDB:Flag(nil, "CannotBlockAttacks") and isAttack then
Expand Down Expand Up @@ -2451,6 +2471,7 @@ function calcs.offence(env, actor, activeSkill)
-- Combine hit chance and attack speed
combineStat("AccuracyHitChance", "AVERAGE")
combineStat("HitChance", "AVERAGE")
combineStat("AccuracyHitChanceUncapped", "AVERAGE")
combineStat("Speed", "AVERAGE")
combineStat("HitSpeed", "OR")
combineStat("HitTime", "OR")
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2369,6 +2369,9 @@ local specialModList = {
["leeche?s? ([%d%.]+)%% of (%a+) attack damage as life"] = function(num, _, dmgType) return {
mod(firstToUpper(dmgType) .. "DamageLifeLeech", "BASE", num, nil, ModFlag.Attack, 0),
} end,
-- Amazon
["chance to hit with attacks can exceed 100%%"] = {flag("Condition:HitChanceCanExceed100", { type = "Skilltype", skillType = SkillType.Attack})},
["gain additional critical hit chance equal to (%d+)%% of excess chance to hit with attacks"] = function(num) return { mod("CritChance", "BASE", 0.01 * num, { type = "Multiplier", var = "ExcessHitChance" }, { type = "SkillType", skillType = SkillType.Attack})} end,
-- Ascendant
["grants (%d+) passive skill points?"] = function(num) return { mod("ExtraPoints", "BASE", num) } end,
["can allocate passives from the %a+'s starting point"] = { },
Expand Down
Loading