Skip to content

Add support for Now and Again #483

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

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2936,7 +2936,7 @@ c["Skills gain a Base Life Cost equal to 50% of Base Mana Cost"]={{[1]={flags=0,
c["Skills gain a Base Life Cost equal to Base Mana Cost"]={{[1]={flags=0,keywordFlags=0,name="ManaCostAsLifeCost",type="BASE",value=100}},nil}
c["Skills have +1 to Limit"]={{}," Limit "}
c["Skills have -2 seconds to Cooldown"]={{}," seconds to Cooldown "}
c["Skills have 33% chance to not consume a Cooldown when used"]={{}," to not consume a Cooldown when used "}
c["Skills have 33% chance to not consume a Cooldown when used"]={{[1]={[1]={skillType=101,type="SkillType"},flags=0,keywordFlags=0,name="CooldownChanceNotConsume",type="BASE",value=0.33}},nil}
c["Skills have a 125% longer Perfect Timing window"]={{[1]={flags=0,keywordFlags=0,name="PerfectTiming",type="INC",value=125}},nil}
c["Skills have a 150% longer Perfect Timing window"]={{[1]={flags=0,keywordFlags=0,name="PerfectTiming",type="INC",value=150}},nil}
c["Skills reserve 50% less Spirit"]={nil,"Skills reserve 50% less Spirit "}
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Skills/act_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16578,9 +16578,19 @@ skills["TemporalChainsPlayer"] = {
baseEffectiveness = 0,
incrementalEffectiveness = 0.092720001935959,
statDescriptionScope = "temporal_chains",
statMap = {
["temporal_chains_base_action_speed_+%_final_to_apply"] = {
mod("TemporalChainsActionSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }),
},
["buff_time_passed_+%_other_than_temporal_chains"] = {
mod("BuffExpireFaster", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }),
}
},
baseFlags = {
spell = true,
area = true,
duration = true,
curse = true,
},
constantStats = {
{ "curse_delay_duration_ms", 1000 },
Expand Down
10 changes: 9 additions & 1 deletion src/Export/Skills/act_int.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,15 @@ statMap = {
#skill TemporalChainsPlayer
#startSets
#set TemporalChainsPlayer
#flags area duration
#flags spell area duration curse
statMap = {
["temporal_chains_base_action_speed_+%_final_to_apply"] = {
mod("TemporalChainsActionSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }),
},
["buff_time_passed_+%_other_than_temporal_chains"] = {
mod("BuffExpireFaster", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }),
}
},
#mods
#skillEnd

Expand Down
24 changes: 21 additions & 3 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,16 @@ end
function calcSkillCooldown(skillModList, skillCfg, skillData)
local cooldownOverride = skillModList:Override(skillCfg, "CooldownRecovery")
local addedCooldown = skillModList:Sum("BASE", skillCfg, "CooldownRecovery")
local noCooldownChance = skillModList:Sum("BASE", skillCfg, "CooldownChanceNotConsume")
local cooldown = cooldownOverride or ((skillData.cooldown or 0) + addedCooldown) / m_max(0, calcLib.mod(skillModList, skillCfg, "CooldownRecovery"))
-- If a skill can store extra uses and has a cooldown, it doesn't round the cooldown value to server ticks
local rounded = false
if (skillData.storedUses and skillData.storedUses > 1) or (skillData.VaalStoredUses and skillData.VaalStoredUses > 1) or skillModList:Sum("BASE", skillCfg, "AdditionalCooldownUses") > 0 then
return cooldown, rounded
return cooldown, rounded, nil, noCooldownChance
else
cooldown = m_ceil(cooldown * data.misc.ServerTickRate) / data.misc.ServerTickRate
rounded = true
return cooldown, rounded, addedCooldown
return cooldown, rounded, addedCooldown, noCooldownChance
end
end

Expand Down Expand Up @@ -1255,13 +1256,30 @@ function calcs.offence(env, actor, activeSkill)
breakdown.TrapTriggerRadius = breakdown.area(data.misc.TrapTriggerRadiusBase, areaMod, output.TrapTriggerRadius, incAreaBreakpoint, moreAreaBreakpoint, redAreaBreakpoint, lessAreaBreakpoint)
end
elseif skillData.cooldown or skillModList:Sum("BASE", skillCfg, "CooldownRecovery") ~= 0 then
local cooldown, rounded, addedCooldown = calcSkillCooldown(skillModList, skillCfg, skillData)
local cooldownMode = env.configInput.cooldownMode or "BASE"
local cooldown, rounded, addedCooldown, noCooldownChance = calcSkillCooldown(skillModList, skillCfg, skillData)
local effectiveCooldownMultiplier = 1 - noCooldownChance
local effectiveCooldown = cooldown * effectiveCooldownMultiplier
Comment on lines +1261 to +1262
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: ‏maybe calcSkillDown should be responsible to return this values.


output.Cooldown = cooldown
output.EffectiveCooldown = cooldown

if breakdown then
breakdown.Cooldown = {
s_format("%.2fs ^8(base)", skillData.cooldown or 0 + addedCooldown),
s_format("/ %.2f ^8(increased/reduced cooldown recovery)", 1 + skillModList:Sum("INC", skillCfg, "CooldownRecovery") / 100),
}

if cooldownMode == "AVERAGE" and noCooldownChance > 0 then
output.EffectiveCooldown = effectiveCooldown
breakdown.EffectiveCooldown = {
s_format("Effective Cooldown:"),
unpack(breakdown.Cooldown),
}
t_insert(breakdown.EffectiveCooldown, s_format("* %.2f ^8(effect of %d%% chance to not consume cooldown)", effectiveCooldownMultiplier, noCooldownChance * 100))
t_insert(breakdown.EffectiveCooldown, s_format("= %.3fs", output.EffectiveCooldown))
end

if rounded then
t_insert(breakdown.Cooldown, s_format("rounded up to nearest server tick"))
end
Expand Down
5 changes: 3 additions & 2 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,10 @@ return {
{ breakdown = "QuantityMultiplier" },
{ modName = { "QuantityMultiplier" }, cfg = "skill" },
}, },
{ label = "Skill Cooldown", haveOutput = "Cooldown", { format = "{3:output:Cooldown}s",
{ label = "Skill Cooldown", haveOutput = "Cooldown", { format = "{3:output:EffectiveCooldown}s",
{ breakdown = "Cooldown" },
{ modName = "CooldownRecovery", cfg = "skill" },
{ breakdown = "EffectiveCooldown" },
{ modName = {"CooldownRecovery", "CooldownChanceNotConsume"}, cfg = "skill" },
}, },
{ label = "Stored Uses", haveOutput = "StoredUses", { format = "{output:StoredUses}",
{ breakdown = "StoredUses" },
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ local configSettings = {
modList:NewMod("Condition:MinionsCreatedRecently", "FLAG", true, "Config")
end },
{ var = "ailmentMode", type = "list", label = "Ailment calculation mode:", tooltip = "Controls how the base damage for applying Ailments is calculated:\n\tAverage: damage is based on the average application, including both crits and non-crits\n\tCrits Only: damage is based solely on Ailments inflicted with crits", list = {{val="AVERAGE",label="Average"},{val="CRIT",label="Crits Only"}} },
{ var = "cooldownMode", type = "list", label = "Cooldown calculation mode:", tooltip = "Controls how the cooldown for skills is calculated:\n\tBase: The cooldown is calculated with normal behavior.\n\tAverage: The cooldown is adjusted to reflect the average time between uses, factoring in effects such as a chance to not consume a cooldown.", list = {{val="BASE",label="Base"},{val="AVERAGE",label="Average"}} },
{ var = "physMode", type = "list", label = "Random element mode:", ifFlag = "randomPhys", tooltip = "Controls how modifiers which choose a random element will function.\n\tAverage: Modifiers will grant one third of their value to ^xB97123Fire^7, ^x3F6DB3Cold^7, and ^xADAA47Lightning ^7simultaneously\n\t^xB97123Fire ^7/ ^x3F6DB3Cold ^7/ ^xADAA47Lightning^7: Modifiers will grant their full value as the specified element\nIf a modifier chooses between just two elements, the full value can only be given as those two elements.", list = {{val="AVERAGE",label="Average"},{val="FIRE",label="^xB97123Fire"},{val="COLD",label="^x3F6DB3Cold"},{val="LIGHTNING",label="^xADAA47Lightning"}} },
{ var = "lifeRegenMode", type = "list", label = "^xE05030Life ^7regen calculation mode:", ifCond = { "LifeRegenBurstAvg", "LifeRegenBurstFull" }, tooltip = "Controls how ^xE05030life ^7regeneration is calculated:\n\tMinimum: does not include burst regen\n\tAverage: includes burst regen, averaged based on uptime\n\tBurst: includes full burst regen", list = {{val="MIN",label="Minimum"},{val="AVERAGE",label="Average"},{val="FULL",label="Burst"}}, apply = function(val, modList, enemyModList)
if val == "AVERAGE" then
Expand Down
4 changes: 4 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,10 @@ local specialModList = {
["effect and duration of flames of chayula on you is doubled"] = function() return {
mod("Multiplier:FlameEffect", "BASE", 1),
} end,
-- Chronomancer
["skills have (%d+)%% chance to not consume a cooldown when used"] = function(num) return {
mod("CooldownChanceNotConsume", "BASE", num / 100, { type = "SkillType", skillType = SkillType.Cooldown })
} end,
-- Item local modifiers
["has no sockets"] = { flag("NoSockets") },
["reflects your other ring"] = {
Expand Down
Loading