Skip to content

Commit 209da64

Browse files
QuickStick123LocalIdentity
andauthored
Uptime of skills with duration and cooldown (#4914)
* add uptime * disable vaal skills Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 2f555f2 commit 209da64

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

src/Data/SkillStatMap.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ return {
463463
["warcry_speed_+%"] = {
464464
mod("WarcrySpeed", "INC", nil, 0, KeywordFlag.Warcry),
465465
},
466+
["display_this_skill_cooldown_does_not_recover_during_buff"] = {
467+
flag("NoCooldownRecoveryInDuration"),
468+
},
466469
-- AoE
467470
["base_skill_area_of_effect_+%"] = {
468471
mod("AreaOfEffect", "INC", nil),

src/Modules/CalcOffence.lua

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,39 @@ function calcs.offence(env, actor, activeSkill)
12011201
end
12021202
end
12031203

1204+
-- Skill uptime
1205+
do
1206+
if not activeSkill.skillTypes[SkillType.Vaal] then -- exclude vaal skills as we currently don't support soul generation or gain prevention.
1207+
local cooldown = output.Cooldown or 0
1208+
for _, durationType in pairs({ "Duration", "DurationSecondary", "AuraDuration", "reserveDuration" }) do
1209+
local duration = output[durationType] or 0
1210+
if (duration ~= 0 and cooldown ~= 0) then
1211+
local uptime = 1
1212+
if skillModList:Flag(skillCfg, "NoCooldownRecoveryInDuration") then
1213+
uptime = duration / (cooldown + duration)
1214+
else
1215+
uptime = duration / (cooldown)
1216+
end
1217+
uptime = m_min(uptime, 1)
1218+
output[durationType.."Uptime"] = uptime * 100
1219+
if breakdown then
1220+
if skillModList:Flag(skillCfg, "NoCooldownRecoveryInDuration") then
1221+
breakdown[durationType.."Uptime"] = {
1222+
s_format("%.2fs / (%.2fs + %.2fs)", duration, cooldown, duration),
1223+
s_format("= %d%%", output[durationType.."Uptime"])
1224+
}
1225+
else
1226+
breakdown[durationType.."Uptime"] = {
1227+
s_format("%.2fs / %.2fs", duration, cooldown),
1228+
s_format("= %d%%", output[durationType.."Uptime"])
1229+
}
1230+
end
1231+
end
1232+
end
1233+
end
1234+
end
1235+
end
1236+
12041237
-- Calculate costs (may be slightly off due to rounding differences)
12051238
local costs = {
12061239
["Mana"] = { type = "Mana", upfront = true, percent = false, text = "mana", baseCost = 0, totalCost = 0, baseCostNoMult = 0 },

src/Modules/CalcSections.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,10 @@ return {
609609
{ label = "Secondary Duration", flag = "duration", haveOutput = "DurationSecondary", { format = "{3:output:DurationSecondary}s", { breakdown = "DurationSecondary" }, }, },
610610
{ label = "Aura Duration", haveOutput = "AuraDuration", { format = "{3:output:AuraDuration}s", { breakdown = "AuraDuration" }, }, },
611611
{ label = "Reserve Duration", haveOutput = "ReserveDuration", { format = "{3:output:ReserveDuration}s", { breakdown = "ReserveDuration" }, }, },
612+
{ label = "Uptime", haveOutput = "DurationUptime", { format = "{2:output:DurationUptime}%", { breakdown = "DurationUptime" }, }, },
613+
{ label = "Secondary Uptime", haveOutput = "DurationSecondaryUptime", { format = "{2:output:DurationSecondaryUptime}%", { breakdown = "DurationSecondaryUptime" }, }, },
614+
{ label = "Aura Uptime", haveOutput = "AuraDurationUptime", { format = "{2:output:AuraDurationUptime}%", { breakdown = "AuraDurationUptime" }, }, },
615+
{ label = "Reserve Uptime", haveOutput = "ReserveDurationUptime", { format = "{2:output:ReserveDurationUptime}%", { breakdown = "ReserveDurationUptime" }, }, },
612616
{ label = "Sustainable Trauma", haveOutput = "SustainableTrauma", { format = "{0:output:SustainableTrauma}", { breakdown = "SustainableTrauma" }, { modName = { "SpeedPerTrauma", "ExtraTrauma", "RepeatCount", "Duration", "PrimaryDuration", "SecondaryDuration", "SkillAndDamagingAilmentDuration"}, cfg = "skill" }, }, },
613617
{ label = "Projectile Count", flag = "projectile", { format = "{output:ProjectileCount}", { modName = { "NoAdditionalProjectiles" , "ProjectileCount" }, cfg = "skill" }, }, },
614618
{ label = "Pierce Count", haveOutput = "PierceCount", { format = "{output:PierceCountString}", { modName = { "CannotPierce", "PierceCount", "PierceAllTargets" }, cfg = "skill" }, }, },

0 commit comments

Comments
 (0)