diff --git a/spec/System/TestTriggers_spec.lua b/spec/System/TestTriggers_spec.lua index 12e9a3ec10..a1b2268a67 100644 --- a/spec/System/TestTriggers_spec.lua +++ b/spec/System/TestTriggers_spec.lua @@ -1504,6 +1504,23 @@ describe("TestTriggers", function() assert.is_falsy(build.calcsTab.mainEnv.player.mainSkill.skillFlags.weapon2Attack) end) + it("Use the equipped bow for Void Shot granted by Voidfletcher", function() + build.itemsTab:CreateDisplayItemFromRaw("Test Bow\nShort Bow") + build.itemsTab:AddDisplayItem() + runCallback("OnFrame") + + build.itemsTab:CreateDisplayItemFromRaw([[Voidfletcher + Ornate Quiver + Consumes a Void Charge to Trigger Level 20 Void Shot when you fire Arrows with a Non-Triggered Skill]]) + build.itemsTab:AddDisplayItem() + runCallback("OnFrame") + + local mainSkill = build.calcsTab.mainEnv.player.mainSkill + assert.are.equals("Void Shot", mainSkill.activeEffect.grantedEffect.name) + assert.is_true(mainSkill.skillFlags.weapon1Attack) + assert.is_falsy(mainSkill.skillFlags.weapon2Attack) + end) + it("Trigger Ghostly Artillery with a projectile attack", function() equipDreadCaptainsCutlass() build.skillsTab:PasteSocketGroup("Lancing Steel 20/0 1\n") diff --git a/src/Data/Skills/other.lua b/src/Data/Skills/other.lua index 2e4d7b41bc..8db20faab7 100644 --- a/src/Data/Skills/other.lua +++ b/src/Data/Skills/other.lua @@ -1925,6 +1925,7 @@ skills["FieryImpactHeistMaceImplicit"] = { attack = true, area = true, melee = true, + forceSourceWeapon = true, }, constantStats = { { "skill_physical_damage_%_to_convert_to_fire", 60 }, @@ -5953,6 +5954,7 @@ skills["GhostCannons"] = { attack = true, projectile = true, area = true, + forceSourceWeapon = true, }, constantStats = { { "skill_physical_damage_%_to_convert_to_fire", 50 }, diff --git a/src/Export/Skills/other.txt b/src/Export/Skills/other.txt index be8b414c1a..eb4bf4c3c5 100644 --- a/src/Export/Skills/other.txt +++ b/src/Export/Skills/other.txt @@ -533,7 +533,7 @@ local skills, mod, flag, skill = ... #mods #skill FieryImpactHeistMaceImplicit -#flags attack area melee +#flags attack area melee forceSourceWeapon fromItem = true, #mods @@ -1564,7 +1564,7 @@ local skills, mod, flag, skill = ... #mods #skill GhostCannons Ghostly Artillery -#flags attack projectile area +#flags attack projectile area forceSourceWeapon fromItem = true, #mods diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index 9b315a7b7b..0d5219d02f 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -278,8 +278,8 @@ function calcs.buildActiveSkillModList(env, activeSkill) activeSkill.weapon2Flags = 0 else -- Set weapon flags - if skillFlags.attack and activeSkill.socketGroup and activeSkill.socketGroup.sourceItem then - -- Item-granted attacks use the weapon that grants the skill + if skillFlags.forceSourceWeapon and activeSkill.socketGroup and activeSkill.socketGroup.sourceItem then + -- Some item-granted attacks must use the weapon that grants the skill local sourceSlot = activeSkill.socketGroup.slot or "" skillFlags.forceMainHand = sourceSlot:match("^Weapon 1") ~= nil skillFlags.forceOffHand = sourceSlot:match("^Weapon 2") ~= nil