You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Accounting for mods that enable "Chance to hit with Attacks can exceed 100%"
2290
+
localexceedsHitChance=skillModList:Flag(nil,"Condition:HitChanceCanExceed100") andcalcs.hitChance(enemyEvasion, (m_floor(accuracyVsEnemyBase*accuracyPenalties["accuracyPenalty" ..distances[1] .."m"])) *hitChanceMod) -- Check for flag and at least 100% hit chance at minimum distance
2291
+
output.AccuracyHitChanceUncapped=exceedsHitChanceandm_max(calcs.hitChance(enemyEvasion, accuracyVsEnemy, true) *calcLib.mod(skillModList, cfg, "HitChance"), output.AccuracyHitChance) -- keep higher chance in case of "CannotBeEvaded"
"Enemy level: " ..env.enemyLevel.. (env.configInput.enemyLeveland" ^8(overridden from the Configuration tab" or" ^8(can be overridden in the Configuration tab)"),
2295
2299
"Enemy evasion: " ..enemyEvasion,
2296
2300
"",
2297
2301
"Approximate hit chance at:",
2302
+
}
2303
+
-- Calculating individual hit chances at different distances
2304
+
localhitChances= {}
2305
+
hitChances[1] = {distance=enemyDistance}
2306
+
localbuffers= {
2307
+
dist= {"", "", "", ""}, -- these define the number of required spaces based on string length to have the numbers aligned (it's not a simple length * x due to linting that happens later)
2308
+
chance= {"", "", ""}
2298
2309
}
2299
-
fori=1, #distancesdo
2300
-
locallower=distances[i]
2301
-
localupper=distances[i+1] orlower
2302
-
ifenemyDistance~=lowerthen-- This ugly formatting keeps the text aligned in the display
entry.adjustedAccuracy= ((entry.distance==enemyDistance) andaccuracyVsEnemy) orm_floor(accuracyVsEnemyBase* ((noAccuracyDistancePenaltyand1) oraccuracyPenalties["accuracyPenalty" ..entry.distance.."m"])) -- checking here for noAccuracyDistancePenalty again because it's otherwise only used to calculate accuracyVsEnemy, which uses the config distance value
2319
+
entry.capped= ((entry.distance==enemyDistance) andoutput.AccuracyHitChance) or (cannotBeEvadedand100) orm_max(calcs.hitChance(enemyEvasion, entry.adjustedAccuracy) *hitChanceMod)
2320
+
entry.uncapped=exceedsHitChanceandm_max(calcs.hitChance(enemyEvasion, entry.adjustedAccuracy, true) *hitChanceMod, entry.capped) -- compare to capped to account for cannotBeEvaded
output.AccuracyHitChanceUncapped=m_max(calcs.hitChance(enemyEvasion, accuracyVsEnemy, true) *calcLib.mod(skillModList, cfg, "HitChance"), output.AccuracyHitChance) -- keep higher chance in case of "CannotBeEvaded"
2315
-
ifbreakdownandbreakdown.AccuracyHitChancethen
2316
-
t_insert(breakdown.AccuracyHitChance, "Uncapped hit chance: " ..output.AccuracyHitChanceUncapped.."%")
2317
-
elseifbreakdownthen
2318
-
breakdown.AccuracyHitChance= {
2319
-
"Enemy level: "..env.enemyLevel..(env.configInput.enemyLeveland" ^8(overridden from the Configuration tab" or" ^8(can be overridden in the Configuration tab)"),
2320
-
"Enemy evasion: "..enemyEvasion,
2321
-
"Approximate hit chance: "..output.AccuracyHitChance.."%",
2322
-
"Uncapped hit chance: " ..output.AccuracyHitChanceUncapped.."%"
0 commit comments