Skip to content
Open
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
30 changes: 30 additions & 0 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -965,4 +965,34 @@ describe("TestSkills", function()
assert.is_nil(build.calcsTab.mainEnv.player.modDB.multipliers["Cruelty"])
end
end)

it("Pact of Lycia uses one Empowerment per channel, not per channel stage (issue #10447)", function()
build.skillsTab:PasteSocketGroup("Lightning Tendrils 20/0 1")
runCallback("OnFrame")
local baseDPS = build.calcsTab.mainOutput.TotalDPS
build.skillsTab:PasteSocketGroup("Pact of Lycia 20/0 1")
runCallback("OnFrame")
local output = build.calcsTab.mainOutput
assert.are.equals(100, output.LyciaUpTimeRatio)
assert.are.near(baseDPS * 1.4, output.TotalDPS, baseDPS * 0.001)
assert.is_truthy(build.calcsTab.mainEnv.player.breakdown.LyciaUpTimeRatio[1]:match("without releasing"))

build.configTab.input.pactLyciaChannelDuration = 0.5
build.configTab:BuildModList()
runCallback("OnFrame")
output = build.calcsTab.mainOutput
local expected = output.LyciaEmpoweredCount * 0.5 / (output.PactOfLyciaCooldown + output.PactOfLyciaCastTime) * 100
assert.is_true(expected < 100)
assert.are.near(expected, output.LyciaUpTimeRatio, 0.0001)
end)

it("Pact of Lycia channel duration cannot be shorter than one channel stage (issue #10447)", function()
build.skillsTab:PasteSocketGroup("Lightning Tendrils 20/0 1\nPact of Lycia 20/0 1")
build.configTab.input.pactLyciaChannelDuration = 0.01
build.configTab:BuildModList()
runCallback("OnFrame")
local output = build.calcsTab.mainOutput
local expected = output.LyciaEmpoweredCount / output.Speed / (output.PactOfLyciaCooldown + output.PactOfLyciaCastTime) * 100
assert.are.near(expected, output.LyciaUpTimeRatio, 0.0001)
end)
end)
15 changes: 13 additions & 2 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2941,6 +2941,12 @@ function calcs.offence(env, actor, activeSkill)
local storedUses = value.skillData.storedUses + value.skillModList:Sum("BASE", value.skillCfg, "AdditionalCooldownUses")
-- Repeated spells retain the empowerment from the initial cast without consuming another use.
local empoweredUseRate = globalOutput.Speed / globalOutput.Repeats
if pactKey == "Lycia" then
-- A channelled spell stays Empowered until the channel ends, so each channel uses one Empowerment.
local channelDuration = skillModList:Sum("BASE", nil, "LyciaChannelDuration")
-- A channel cannot be shorter than one stage.
empoweredUseRate = channelDuration > 0 and m_min(1 / channelDuration, globalOutput.Speed) or 0
end
local uptime = empoweredUseRate == 0 and 100 or m_min((count / empoweredUseRate) / (cooldown + castTime), 1) * 100
uptime = m_min(100, uptime * storedUses)
local effect = skillModList:Flag(nil, "Condition:PactMaxHit") and 100 or uptime
Expand All @@ -2951,10 +2957,15 @@ function calcs.offence(env, actor, activeSkill)
globalOutput["PactOf"..pactKey.."CastTime"] = castTime
globalOutput[pactKey.."EmpoweredCount"] = count
globalOutput[pactKey.."UpTimeRatio"] = uptime
if globalBreakdown then
if globalBreakdown and pactKey == "Lycia" and empoweredUseRate == 0 then
globalBreakdown[pactKey.."UpTimeRatio"] = {
"Channelled without releasing ^8(no channel duration set)",
s_format("= %.2f%%", uptime),
}
elseif globalBreakdown then
globalBreakdown[pactKey.."UpTimeRatio"] = {
s_format("(%.2f ^8(number of Empowered)", count),
s_format("/ %.2f) ^8(non-repeated casts per second)", empoweredUseRate),
s_format("/ %.2f) ^8(%s per second)", empoweredUseRate, pactKey == "Lycia" and "channels" or "non-repeated casts"),
s_format("/ (%.2f ^8(pact cooldown)", cooldown),
s_format("+ %.2f) ^8(pact cast time)", castTime),
s_format("* %.2f ^8(stored uses)", storedUses),
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ return {
modList:NewMod("Condition:PactMaxHit", "FLAG", true, "Config")
end
end },
{ var = "pactLyciaChannelDuration", type = "float", label = "Pact of Lycia channel duration (seconds):", ifSkill = "Pact of Lycia", tooltip = "Seconds you channel each Empowered spell before releasing it.\nEach channel uses one Empowerment for its whole duration.\nFor skills released at the end of a channel, such as Flameblast or Divine Ire, enter their channel time.\nLeave blank to assume you channel without releasing.", apply = function(val, modList, enemyModList)
modList:NewMod("LyciaChannelDuration", "BASE", val, "Config")
end },
{ var = "EVBypass", type = "check", label = "Disable Emperor's Vigilance Bypass", ifCond = "EVBypass", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:EVBypass", "FLAG", true, "Config")
end },
Expand Down
Loading