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
40 changes: 40 additions & 0 deletions spec/System/TestTriggers_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1639,4 +1639,44 @@ describe("TestTriggers", function()
assert.is_falsy(build.calcsTab.mainEnv.player.mainSkill.skillFlags.weapon1Attack)
assert.is_true(build.calcsTab.mainEnv.player.mainSkill.skillFlags.weapon2Attack)
end)

it("Avenging Flame uses the totem limit of the Flamewood-supported skill", function()
build.configTab.input.customMods = "+4 to maximum number of Summoned Searing Bond Totems\nSkills used by Totems have 10% more Area of Effect per maximum number of Summoned Totems"
build.configTab:BuildModList()
build.skillsTab:PasteSocketGroup("Searing Bond 20/0 1\nFlamewood 20/0 1\n")
runCallback("OnFrame")

local sourceLimit = build.calcsTab.mainOutput.ActiveTotemLimit

local mainSocketGroup = build.skillsTab.socketGroupList[build.mainSocketGroup]
mainSocketGroup.mainActiveSkill = 2
build.modFlag = true
build.buildFlag = true
runCallback("OnFrame")

assert.are.equals("Avenging Flame", build.calcsTab.mainEnv.player.mainSkill.activeEffect.grantedEffect.name)
assert.True(sourceLimit >= 5)
assert.are.equals(sourceLimit, build.calcsTab.mainOutput.ActiveTotemLimit)
assert.are.equals(sourceLimit, build.calcsTab.mainOutput.TotemsSummoned)
assert.are.equals(round(1 + 0.1 * sourceLimit, 2), round(build.calcsTab.mainOutput.AreaOfEffectMod, 2))
end)

it("per Summoned Totem defences do not change when Avenging Flame is the main skill", function()
build.configTab.input.customMods = "+4 to maximum number of Summoned Searing Bond Totems\n+300 Armour per Summoned Totem"
build.configTab:BuildModList()
build.skillsTab:PasteSocketGroup("Searing Bond 20/0 1\nFlamewood 20/0 1\n")
runCallback("OnFrame")

local sourceArmour = build.calcsTab.mainOutput.Armour

local mainSocketGroup = build.skillsTab.socketGroupList[build.mainSocketGroup]
mainSocketGroup.mainActiveSkill = 2
build.modFlag = true
build.buildFlag = true
runCallback("OnFrame")

assert.are.equals("Avenging Flame", build.calcsTab.mainEnv.player.mainSkill.activeEffect.grantedEffect.name)
assert.True(sourceArmour >= 300 * 5)
assert.are.equals(sourceArmour, build.calcsTab.mainOutput.Armour)
end)
end)
10 changes: 9 additions & 1 deletion src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,14 @@ function calcs.offence(env, actor, activeSkill)
end
if skillFlags.totem then
output.ActiveTotemLimit = skillModList:Sum("BASE", skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit")
-- Skills granted by a support and triggered by totems (e.g. Flamewood's Avenging Flame) are cast by the supported skill's totems
if activeSkill.skillTypes[SkillType.SkillGrantedBySupport] and skillData.triggerSourceUUID then
local sourceCache = GlobalCache.cachedData[env.mode][skillData.triggerSourceUUID]
local sourceLimit = sourceCache and sourceCache.Env.player.output.ActiveTotemLimit
if sourceLimit then
output.ActiveTotemLimit = sourceLimit
end
end
end
if skillFlags.area or skillData.radius or (skillFlags.mine and activeSkill.skillTypes[SkillType.Aura]) then
calcAreaOfEffect(skillModList, skillCfg, skillData, skillFlags, output, breakdown)
Expand Down Expand Up @@ -4478,7 +4486,7 @@ function calcs.offence(env, actor, activeSkill)
--assume skills with no cast, attack, or cooldown time are single cast
bleedStacks = bleedStacks * globalOutput.BleedDuration * (globalOutput.HitSpeed or globalOutput.Speed)
end
local activeTotems = env.modDB:Override(nil, "TotemsSummoned") or skillModList:Sum("BASE", skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit")
local activeTotems = env.modDB:Override(nil, "TotemsSummoned") or output.ActiveTotemLimit or skillModList:Sum("BASE", skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit")
if skillFlags.totem then
bleedStacks = bleedStacks * activeTotems
end
Expand Down
7 changes: 6 additions & 1 deletion src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,12 @@ function calcs.perform(env, skipEHP)
enemyDB.multipliers["BrandsAttached"] = m_max(attached, enemyDB.multipliers["BrandsAttached"] or 0)
end
if activeSkill.skillFlags.totem then
local limit = env.player.mainSkill.skillModList:Sum("BASE", env.player.mainSkill.skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit" )
local limitSkill = env.player.mainSkill
-- A support-granted totem skill (e.g. Flamewood's Avenging Flame) is cast by the totems of the skill it supports
if limitSkill.skillTypes[SkillType.SkillGrantedBySupport] and activeSkill ~= limitSkill and activeSkill.socketGroup == limitSkill.socketGroup then
limitSkill = activeSkill
end
local limit = limitSkill.skillModList:Sum("BASE", limitSkill.skillCfg, "ActiveTotemLimit", "ActiveBallistaLimit" )
output.ActiveTotemLimit = m_max(limit, output.ActiveTotemLimit or 0)
output.TotemsSummoned = modDB:Override(nil, "TotemsSummoned") or output.ActiveTotemLimit
enemyDB.multipliers["TotemsSummoned"] = m_max(output.TotemsSummoned or 0, enemyDB.multipliers["TotemsSummoned"] or 0)
Expand Down