Skip to content

Commit

Permalink
FIX: Best Snipe logic using wrong calc mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak committed Mar 17, 2024
1 parent 103646b commit fcc147d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Modules/CalcTriggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1192,9 +1192,6 @@ local configTable = {
local snipeHitMulti = env.player.mainSkill.skillModList:Sum("BASE", env.player.mainSkill.skillCfg, "snipeHitMulti")
local snipeAilmentMulti = env.player.mainSkill.skillModList:Sum("BASE", env.player.mainSkill.skillCfg, "snipeAilmentMulti")
local triggeredSkills = {}
local source
local trigRate
local uuid
local currentSkillSnipeIndex

for _, skill in ipairs(env.player.activeSkillList) do
Expand Down Expand Up @@ -1229,16 +1226,26 @@ local configTable = {
env.player.mainSkill.skillData.baseMultiplier = 0
end
else
local source
local trigRate
local mode = env.mode == "CALCS" and "CALCS" or "MAIN"
-- Does snipe have enough stages to trigger this skill?
if currentSkillSnipeIndex and currentSkillSnipeIndex <= snipeStages then
env.player.mainSkill.skillModList:NewMod("Damage", "MORE", snipeHitMulti * snipeStages , "Snipe", ModFlag.Hit, 0)
env.player.mainSkill.skillModList:NewMod("Damage", "MORE", snipeAilmentMulti * snipeStages , "Snipe", ModFlag.Ailment, 0)
for _, skill in ipairs(env.player.activeSkillList) do
if skill.activeEffect.grantedEffect.name == "Snipe" and skill.socketGroup and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot then
skill.skillData.hitTimeMultiplier = snipeStages - 0.5
source, _, uuid = findTriggerSkill(env, skill, source)
trigRate = GlobalCache.cachedData["CACHE"][uuid].Env.player.output.HitSpeed
env.player.output.ChannelTimeToTrigger = GlobalCache.cachedData["CACHE"][uuid].Env.player.output.HitTime
local uuid = cacheSkillUUID(skill, env)
if not GlobalCache.cachedData[mode][uuid] or GlobalCache.noCache then
calcs.buildActiveSkill(env, mode, skill)
end
local cachedSpeed = GlobalCache.cachedData[mode][uuid].Env.player.output.HitSpeed
if (skill.skillFlags and not skill.skillFlags.disable) and (skill.skillCfg and not skill.skillCfg.skillCond["usedByMirage"]) and not skill.skillTypes[SkillType.OtherThingUsesSkill] and ((not source and cachedSpeed) or (cachedSpeed and cachedSpeed > (trigRate or 0))) then
trigRate = cachedSpeed
env.player.output.ChannelTimeToTrigger = GlobalCache.cachedData[mode][uuid].Env.player.output.HitTime
source = skill
end
end
end

Expand Down

0 comments on commit fcc147d

Please sign in to comment.