Skip to content
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
23 changes: 23 additions & 0 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@ describe("TestSkills", function()

assert.True(build.calcsTab.mainOutput.MirageDPS ~= nil)
end)

it("checks equipped weapon types for support-granted attacks", function()
build.itemsTab:CreateDisplayItemFromRaw("Test Claw\nImperial Claw")
build.itemsTab:AddDisplayItem()
build.skillsTab:PasteSocketGroup("Cobra Lash 20/0 1\nWindburst 20/0 1\nNightblade 20/0 1\nSacred Wisps 20/0 1\n")
runCallback("OnFrame")

local windburst
for _, activeSkill in ipairs(build.calcsTab.mainEnv.player.activeSkillList) do
if activeSkill.activeEffect.grantedEffect.id == "TriggeredSupportWindburst" then
windburst = activeSkill
break
end
end
assert.is_not_nil(windburst)

local supports = { }
for _, effect in ipairs(windburst.effectList) do
supports[effect.grantedEffect.id] = true
end
assert.is_true(supports.SupportNightblade)
assert.is_nil(supports.SupportSacredWisps)
end)

it("Test Scorching ray applying exposure at max stages", function()
build.skillsTab:PasteSocketGroup("Scorching Ray 20/0 1\n")
Expand Down
8 changes: 8 additions & 0 deletions src/Modules/CalcTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill,
for activeType in pairs(activeSkill.activeEffect.grantedEffect.weaponTypes) do
activeTypeLookup[activeType] = true
end
elseif effectiveSkillTypes[SkillType.SkillGrantedBySupport] then
-- Skills granted by supports do not have their own weaponTypes, so check the equipped weapons instead.
if activeSkill.actor.weaponData1.type then
activeTypeLookup[activeSkill.actor.weaponData1.type] = true
end
if activeSkill.actor.weaponData2.type then
activeTypeLookup[activeSkill.actor.weaponData2.type] = true
end
end
-- If the support expects a weapon type but the active skill doesn't have any (e.g. shield skills), it's not a match.
if not next(activeTypeLookup) then
Expand Down
Loading