Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HitSpeed as source rate if avilable #6678

Merged
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
12 changes: 6 additions & 6 deletions src/Modules/CalcTriggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ end
-- Identify the trigger action skill for trigger conditions, take highest Attack Per Second
local function findTriggerSkill(env, skill, source, triggerRate, comparer)
local comparer = comparer or function(uuid, source, triggerRate)
local cachedSpeed = GlobalCache.cachedData["CACHE"][uuid].Speed
local cachedSpeed = GlobalCache.cachedData["CACHE"][uuid].HitSpeed or GlobalCache.cachedData["CACHE"][uuid].Speed
return (not source and cachedSpeed) or (cachedSpeed and cachedSpeed > (triggerRate or 0))
end

Expand All @@ -77,7 +77,7 @@ local function findTriggerSkill(env, skill, source, triggerRate, comparer)
end

if GlobalCache.cachedData["CACHE"][uuid] and comparer(uuid, source, triggerRate) and (skill.skillFlags and not skill.skillFlags.disable) and (skill.skillCfg and not skill.skillCfg.skillCond["usedByMirage"]) and not skill.skillTypes[SkillType.OtherThingUsesSkill] then
return skill, GlobalCache.cachedData["CACHE"][uuid].Speed, uuid
return skill, GlobalCache.cachedData["CACHE"][uuid].HitSpeed or GlobalCache.cachedData["CACHE"][uuid].Speed, uuid
end
return source, triggerRate, source and cacheSkillUUID(source, env)
end
Expand Down Expand Up @@ -515,18 +515,18 @@ local function defaultTriggerHandler(env, config)
local manaSpentThreshold = triggeredManaCost * actor.mainSkill.skillData.ManaForgedArrowsPercentThreshold
local sourceManaCost = GlobalCache.cachedData["CACHE"][uuid].Env.player.output.ManaCost or 0
if sourceManaCost > 0 then
trigRate = (trigRate * sourceManaCost) / manaSpentThreshold
if breakdown then
t_insert(breakdown.EffectiveSourceRate, s_format("* %.2f ^8(Mana cost of trigger source)", sourceManaCost))
t_insert(breakdown.EffectiveSourceRate, s_format("= %.2f ^8(Mana spent per second)", (GlobalCache.cachedData["CACHE"][uuid].Env.player.output.Speed * sourceManaCost)))
t_insert(breakdown.EffectiveSourceRate, s_format("= %.2f ^8(Mana spent per second)", (trigRate * sourceManaCost)))
t_insert(breakdown.EffectiveSourceRate, s_format(""))
t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(Mana Cost of triggered)", triggeredManaCost))
t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(Manaforged threshold multiplier)", actor.mainSkill.skillData.ManaForgedArrowsPercentThreshold))
t_insert(breakdown.EffectiveSourceRate, s_format("= %.2f ^8(Manaforged trigger threshold)", manaSpentThreshold))
t_insert(breakdown.EffectiveSourceRate, s_format(""))
t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(Mana spent per second)", (GlobalCache.cachedData["CACHE"][uuid].Env.player.output.Speed * sourceManaCost)))
t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(Mana spent per second)", (trigRate * sourceManaCost)))
t_insert(breakdown.EffectiveSourceRate, s_format("/ %.2f ^8(Manaforged trigger threshold)", manaSpentThreshold))
end
trigRate = (trigRate * sourceManaCost) / manaSpentThreshold
else
trigRate = 0
end
Expand Down Expand Up @@ -1053,7 +1053,7 @@ local configTable = {
return {triggerChance = env.player.modDB:Sum("BASE", nil, "KitavaTriggerChance"),
triggerName = "Kitava's Thirst",
comparer = function(uuid, source, triggerRate)
local cachedSpeed = GlobalCache.cachedData["CACHE"][uuid].Speed
local cachedSpeed = GlobalCache.cachedData["CACHE"][uuid].HitSpeed or GlobalCache.cachedData["CACHE"][uuid].Speed
local cachedManaCost = GlobalCache.cachedData["CACHE"][uuid].ManaCost
return ( (not source and cachedSpeed) or (cachedSpeed and cachedSpeed > (triggerRate or 0)) ) and ( (cachedManaCost or 0) > requiredManaCost )
end,
Expand Down
1 change: 1 addition & 0 deletions src/Modules/Common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ function cacheData(uuid, env)
GlobalCache.cachedData[mode][uuid] = {
Name = env.player.mainSkill.activeEffect.grantedEffect.name,
Speed = env.player.output.Speed,
HitSpeed = env.player.output.HitSpeed,
ManaCost = env.player.output.ManaCost,
LifeCost = env.player.output.LifeCost,
ESCost = env.player.output.ESCost,
Expand Down