Skip to content

Commit

Permalink
FIX: hit chance applying twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak committed Oct 2, 2023
1 parent ca328a5 commit 31fc1cc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Modules/CalcTriggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,17 @@ local function defaultTriggerHandler(env, config)

--Accuracy and crit chance
if source and (source.skillTypes[SkillType.Melee] or source.skillTypes[SkillType.Attack]) and GlobalCache.cachedData["CACHE"][uuid] and not config.triggerOnUse then
local sourceHitChance = GlobalCache.cachedData["CACHE"][uuid].HitChance
trigRate = trigRate * (sourceHitChance or 0) / 100
if breakdown then
t_insert(breakdown.EffectiveSourceRate, s_format("x %.0f%% ^8(%s hit chance)", sourceHitChance, source.activeEffect.grantedEffect.name))
end
if (actor.mainSkill.skillData.triggeredByCospris or actor.mainSkill.skillData.triggeredByCoC or config.triggerName == "Law of the Wilds") and GlobalCache.cachedData["CACHE"][uuid] then
local sourceCritChance = GlobalCache.cachedData["CACHE"][uuid].CritChance
trigRate = trigRate * (sourceCritChance or 0) / 100
if breakdown then
t_insert(breakdown.EffectiveSourceRate, s_format("x %.2f%% ^8(%s effective crit chance)", sourceCritChance, source.activeEffect.grantedEffect.name))
t_insert(breakdown.EffectiveSourceRate, s_format("x %.2f%% ^8(%s effective crit chance. Includes hit chance)", sourceCritChance, source.activeEffect.grantedEffect.name))
end
else
local sourceHitChance = GlobalCache.cachedData["CACHE"][uuid].HitChance
trigRate = trigRate * (sourceHitChance or 0) / 100
if breakdown then
t_insert(breakdown.EffectiveSourceRate, s_format("x %.0f%% ^8(%s hit chance)", sourceHitChance, source.activeEffect.grantedEffect.name))
end
end
end
Expand Down

0 comments on commit 31fc1cc

Please sign in to comment.