diff --git a/spec/System/TestAttacks_spec.lua b/spec/System/TestAttacks_spec.lua index d7671bb0090..fe02e9b25f3 100644 --- a/spec/System/TestAttacks_spec.lua +++ b/spec/System/TestAttacks_spec.lua @@ -107,6 +107,16 @@ describe("TestAttacks", function() assert.are.equals(0, bit.band(mainSkill.weapon1Flags, ModFlag.Claw)) end) + it("prevents using unarmed skills that can't be used with a Claw", function() + equipHide() + build.skillsTab:PasteSocketGroup("Smite 20/0 1") + build.mainSocketGroup = 1 + runCallback("OnFrame") + build.calcsTab:BuildOutput() + runCallback("OnFrame") + assert.is_true(build.calcsTab.mainEnv.player.mainSkill.skillFlags.disable) + end) + it("does not bypass weapon restrictions of supports", function() equipHide() -- Close Combat only allows Axes and Swords @@ -138,16 +148,32 @@ describe("TestAttacks", function() assert.is_true(build.calcsTab.mainOutput.MainHand.AverageHit > baseHit) end) - it("only applies to the main hand with Hollow Palm Technique", function() + it("works with Hollow Palm Technique", function() equipHide() build.configTab.input.customMods = "Hollow Palm Technique" build.configTab:BuildModList() runCallback("OnFrame") + local mainSkill = useFrostBlades() local player = build.calcsTab.mainEnv.player - -- Hollow Palm makes the off hand unarmed as well, but the Claw only applies to the main hand + -- Only the main hand attacks as though using a Claw, but the unarmed off hand still attacks with the skill assert.are.equals("None", player.weaponData2.type) assert.is_true(player.weaponData1.asThoughUsing["Claw"]) assert.is_nil(player.weaponData2.asThoughUsing) + assert.is_falsy(mainSkill.skillFlags.disable) + assert.is_true(mainSkill.skillFlags.bothWeaponAttack) + assert.is_true(bit.band(mainSkill.weapon2Flags, ModFlag.Unarmed) > 0) + end) + + it("does not allow dual wield only skills with Hollow Palm Technique", function() + equipHide() + build.configTab.input.customMods = "Hollow Palm Technique" + build.configTab:BuildModList() + build.skillsTab:PasteSocketGroup("Dual Strike 20/0 1") + build.mainSocketGroup = 1 + runCallback("OnFrame") + build.calcsTab:BuildOutput() + runCallback("OnFrame") + assert.is_true(build.calcsTab.mainEnv.player.mainSkill.skillFlags.disable) end) it("gains attack speed if you've used a movement skill recently", function() diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index aa843854871..a91a30dc112 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -216,9 +216,13 @@ local function getWeaponFlags(env, weaponData, weaponTypes) end if weaponTypes then for _, types in ipairs(weaponTypes) do - if not types[weaponData.type] and - (not weaponData.countsAsAll1H or not (types["Claw"] or types["Dagger"] or types["One Handed Axe"] or types["One Handed Mace"] or types["One Handed Sword"])) - and not checkAsThoughWeaponTypes(weaponData, types) then + -- Hide of the Vendigo replaces the weapon type when checking which skills can be used + if weaponData.asThoughUsing then + if not checkAsThoughWeaponTypes(weaponData, types) then + return nil, info + end + elseif not types[weaponData.type] and + (not weaponData.countsAsAll1H or not (types["Claw"] or types["Dagger"] or types["One Handed Axe"] or types["One Handed Mace"] or types["One Handed Sword"])) then return nil, info end end @@ -342,6 +346,11 @@ function calcs.buildActiveSkillModList(env, activeSkill) end if not skillFlags.forceMainHand then local weapon2Flags, weapon2Info = getWeaponFlags(env, activeSkill.actor.weaponData2, weaponTypes) + if not weapon2Flags and weapon1Flags and activeSkill.actor.weaponData1.asThoughUsing and activeSkill.actor.weaponData2.type == "None" and not skillTypes[SkillType.DualWieldOnly] then + -- Hide of the Vendigo only decides which skills can be used, based on the main hand + -- The unarmed off hand from Hollow Palm Technique still attacks with skills the main hand can use + weapon2Flags, weapon2Info = getWeaponFlags(env, activeSkill.actor.weaponData2) + end if weapon2Flags then if skillTypes[SkillType.DualWieldRequiresDifferentTypes] and (activeSkill.actor.weaponData1.type == activeSkill.actor.weaponData2.type) and not (activeSkill.actor.weaponData2.countsAsAll1H or activeSkill.actor.weaponData1.countsAsAll1H) then -- Skill requires a different compatible off hand weapon to main hand weapon