diff --git a/spec/System/TestSkills_spec.lua b/spec/System/TestSkills_spec.lua index 92e2a3a868..12f9edbc57 100644 --- a/spec/System/TestSkills_spec.lua +++ b/spec/System/TestSkills_spec.lua @@ -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") diff --git a/src/Modules/CalcTools.lua b/src/Modules/CalcTools.lua index 3c17791bc5..aafc74e523 100644 --- a/src/Modules/CalcTools.lua +++ b/src/Modules/CalcTools.lua @@ -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