From 2a355d43088ae83806ef0faefbe2b53b866c2963 Mon Sep 17 00:00:00 2001 From: Jayensee <118075978+Jayensee@users.noreply.github.com> Date: Thu, 19 Nov 2026 09:24:33 +0000 Subject: [PATCH 1/7] Fix Manifested Dancing Dervishes not fully disabling weapons The Dancing Dervish's mods were never separated from the player's as the special handling checked for a skill id that no longer exists, so its global accuracy and movement speed always applied. Weapons disabled by Manifest Dancing Dervishes were also only handled late in CalcPerform, after weapon flags, conditions, Hollow Palm Technique's off hand and Hide of the Vendigo had been set up using the sword. Determine it in CalcSetup before the weapon data is built so both weapon slots count as empty. Battlemage and Spellblade no longer use the disabled weapon, and the Dervish minions keep using the sword. Co-Authored-By: Claude Opus 5.5 --- spec/System/TestDancingDervish_spec.lua | 200 ++++++++++++++++++++++++ src/Modules/CalcActiveSkill.lua | 3 + src/Modules/CalcOffence.lua | 4 +- src/Modules/CalcPerform.lua | 19 +-- src/Modules/CalcSetup.lua | 86 +++++++--- 5 files changed, 278 insertions(+), 34 deletions(-) create mode 100644 spec/System/TestDancingDervish_spec.lua diff --git a/spec/System/TestDancingDervish_spec.lua b/spec/System/TestDancingDervish_spec.lua new file mode 100644 index 00000000000..06399c7e8d7 --- /dev/null +++ b/spec/System/TestDancingDervish_spec.lua @@ -0,0 +1,200 @@ +describe("TestDancingDervish", function() + local dancingDervish = [[ + Rarity: UNIQUE + The Dancing Dervish + Reaver Sword + Implicits: 1 + 60% increased Global Accuracy Rating + 150% increased Physical Damage + 25% increased Attack Speed + 5% increased Movement Speed + Triggers Level 15 Manifest Dancing Dervishes on Rampage + Manifested Dancing Dervishes disables both weapon slots + Manifested Dancing Dervishes die when Rampage ends + Melee Hits count as Rampage Kills + Rampage + ]] + + before_each(function() + newBuild() + end) + + teardown(function() + -- newBuild() takes care of resetting everything in setup() + end) + + local function rebuild() + build.buildFlag = true + runCallback("OnFrame") + build.calcsTab:BuildOutput() + runCallback("OnFrame") + end + + local function equip(raw) + build.itemsTab:CreateDisplayItemFromRaw(raw) + build.itemsTab:AddDisplayItem() + runCallback("OnFrame") + end + + local function setCustomMods(mods) + build.configTab.input.customMods = mods + build.configTab:BuildModList() + rebuild() + end + + -- Equips The Dancing Dervish and uses the given skill as the main skill + -- Returns the socket group of the granted Manifest Dancing Dervishes skill + local function setup(skill) + build.skillsTab:PasteSocketGroup(skill) + runCallback("OnFrame") + equip(dancingDervish) + build.mainSocketGroup = 1 + rebuild() + for _, group in ipairs(build.skillsTab.socketGroupList) do + if group.source then + return group + end + end + end + + local function setManifested(dervishGroup, manifested) + dervishGroup.enabled = manifested + rebuild() + end + + local function player() + return build.calcsTab.mainEnv.player + end + + it("does not apply the weapon's modifiers while the Dancing Dervishes are manifested", function() + local dervishGroup = setup("Cyclone 20/0 1") + assert.is_true(player().weaponsDisabled) + assert.are.equals(0, player().modDB:Sum("INC", nil, "Accuracy")) + -- Only Onslaught's Movement Speed applies + assert.are.equals(20, player().modDB:Sum("INC", nil, "MovementSpeed")) + + setManifested(dervishGroup, false) + assert.is_false(player().weaponsDisabled) + assert.are.equals(60, player().modDB:Sum("INC", nil, "Accuracy")) + assert.are.equals(5, player().modDB:Sum("INC", nil, "MovementSpeed")) + end) + + it("lets the Dancing Dervishes use the weapon while it's disabled for the player", function() + local dervishGroup = setup("Cyclone 20/0 1") + for index, group in ipairs(build.skillsTab.socketGroupList) do + if group == dervishGroup then + build.mainSocketGroup = index + end + end + rebuild() + local env = build.calcsTab.mainEnv + assert.is_true(player().weaponsDisabled) + assert.are.equals("None", player().weaponData1.type) + assert.are.equals(player().itemList["Weapon 1"].weaponData[1], env.minion.weaponData1) + assert.are.equals("Two Handed Sword", env.minion.weaponData1.type) + assert.is_true(build.calcsTab.mainOutput.Minion.TotalDPS > 0) + end) + + it("keeps Rampage while the Dancing Dervishes are manifested", function() + setup("Cyclone 20/0 1") + assert.is_true(player().weaponsDisabled) + assert.is_true(player().modDB:Flag(nil, "Condition:Rampage")) + end) + + it("makes attacks unarmed while the Dancing Dervishes are manifested", function() + local dervishGroup = setup("Cyclone 20/0 1") + local mainSkill = player().mainSkill + local conditions = player().modDB.conditions + assert.are.equals("None", player().weaponData1.type) + assert.is_true(bit.band(mainSkill.weapon1Flags, ModFlag.Unarmed) > 0) + assert.are.equals(0, bit.band(mainSkill.weapon1Flags, bit.bor(ModFlag.Sword, ModFlag.Weapon))) + assert.is_true(conditions["Unarmed"]) + assert.is_true(conditions["Unencumbered"]) + assert.is_nil(conditions["UsingSword"]) + assert.is_nil(conditions["UsingTwoHandedWeapon"]) + assert.is_nil(conditions["UsingMeleeWeapon"]) + + setManifested(dervishGroup, false) + mainSkill = player().mainSkill + conditions = player().modDB.conditions + assert.are.equals("Two Handed Sword", player().weaponData1.type) + assert.are.equals(0, bit.band(mainSkill.weapon1Flags, ModFlag.Unarmed)) + assert.is_true(bit.band(mainSkill.weapon1Flags, ModFlag.Sword) > 0) + assert.is_nil(conditions["Unarmed"]) + assert.is_true(conditions["UsingSword"]) + assert.is_true(conditions["UsingTwoHandedWeapon"]) + end) + + it("dual wields unarmed with Hollow Palm Technique while the Dancing Dervishes are manifested", function() + local dervishGroup = setup("Cyclone 20/0 1") + setCustomMods("Hollow Palm Technique") + assert.are.equals("None", player().weaponData2.type) + assert.is_true(player().modDB.conditions["DualWielding"]) + assert.is_true(bit.band(player().mainSkill.weapon2Flags, ModFlag.Unarmed) > 0) + assert.is_not_nil(build.calcsTab.mainOutput.OffHand) + + setManifested(dervishGroup, false) + assert.is_nil(player().weaponData2.type) + assert.is_nil(player().modDB.conditions["DualWielding"]) + end) + + it("only applies main hand modifiers to the main hand with Hollow Palm Technique", function() + setup("Cyclone 20/0 1") + setCustomMods("Hollow Palm Technique") + local mainHandHit = build.calcsTab.mainOutput.MainHand.AverageHit + local offHandHit = build.calcsTab.mainOutput.OffHand.AverageHit + + -- Ambidexterity + setCustomMods("Hollow Palm Technique\n60% increased Attack Damage with Main Hand while Dual Wielding") + assert.is_true(build.calcsTab.mainOutput.MainHand.AverageHit > mainHandHit) + assert.are.equals(offHandHit, build.calcsTab.mainOutput.OffHand.AverageHit) + end) + + it("lets Hide of the Vendigo attack as though using a Claw while the Dancing Dervishes are manifested", function() + -- Frost Blades requires a Claw, Dagger or One Handed Sword + local dervishGroup = setup("Frost Blades 20/0 1") + assert.is_true(player().mainSkill.skillFlags.disable) + + equip([[ + Rarity: UNIQUE + Test Subject + Exquisite Leather + Can Attack as though using a Claw while main hand is empty + ]]) + rebuild() + assert.is_true(player().weaponData1.asThoughUsing["Claw"]) + assert.is_falsy(player().mainSkill.skillFlags.disable) + assert.is_true(bit.band(player().mainSkill.weapon1Flags, ModFlag.Unarmed) > 0) + + -- The main hand isn't empty while the Dancing Dervishes aren't manifested + setManifested(dervishGroup, false) + assert.is_nil(player().weaponData1.asThoughUsing) + assert.is_true(bit.band(player().mainSkill.weapon1Flags, ModFlag.Sword) > 0) + end) + + it("does not let Battlemage use the disabled weapon's damage", function() + build.skillsTab:PasteSocketGroup("Fireball 20/0 1") + runCallback("OnFrame") + setCustomMods("Battlemage") + local unarmedHit = build.calcsTab.mainOutput.AverageHit + + equip(dancingDervish) + build.mainSocketGroup = 1 + rebuild() + assert.is_true(player().weaponsDisabled) + assert.are.equals(unarmedHit, build.calcsTab.mainOutput.AverageHit) + end) + + it("does not let Spellblade use the disabled weapon's damage", function() + build.skillsTab:PasteSocketGroup("Fireball 20/0 1\nSpellblade 20/0 1") + runCallback("OnFrame") + rebuild() + local unarmedHit = build.calcsTab.mainOutput.AverageHit + + equip(dancingDervish) + build.mainSocketGroup = 1 + rebuild() + assert.is_true(player().weaponsDisabled) + assert.are.equals(unarmedHit, build.calcsTab.mainOutput.AverageHit) + end) +end) diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index aa843854871..311be69fa31 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -789,6 +789,9 @@ function calcs.buildActiveSkillModList(env, activeSkill) if item and item.weaponData then minion.weaponData1 = item.weaponData[1] end + elseif env.player.weaponsDisabled and env.player.itemList["Weapon 1"] and env.player.itemList["Weapon 1"].weaponData then + -- The player's weapon slots are disabled while the weapon is a minion (e.g. Manifested Dancing Dervishes) + minion.weaponData1 = env.player.itemList["Weapon 1"].weaponData[1] else minion.weaponData1 = env.player.weaponData1 end diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index bea7d97e17e..441eb186854 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -588,7 +588,7 @@ function calcs.offence(env, actor, activeSkill) -- account for Battlemage -- Note: we check conditions of Main Hand weapon using actor.itemList as actor.weaponData1 is populated with unarmed values when no weapon slotted. - if skillModList:Flag(nil, "Battlemage") and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] then + if skillModList:Flag(nil, "Battlemage") and not actor.weaponsDisabled and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] then local multiplier = (skillModList:Max(skillCfg, "MainHandWeaponDamageAppliesToSpells") or 100) / 100 for _, damageType in ipairs(dmgTypeList) do @@ -601,7 +601,7 @@ function calcs.offence(env, actor, activeSkill) -- -- account for Spellblade -- Note: we check conditions of Main Hand weapon using actor.itemList as actor.weaponData1 is populated with unarmed values when no weapon slotted. local spellbladeMulti = skillModList:Max(skillCfg, "OneHandWeaponDamageAppliesToSpells") - if spellbladeMulti and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] and weapon1info.melee and weapon1info.oneHand then + if spellbladeMulti and not actor.weaponsDisabled and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] and weapon1info.melee and weapon1info.oneHand then local multiplier = spellbladeMulti / 100 * (weapon2info and 0.6 or 1) for _, damageType in ipairs(dmgTypeList) do skillModList:NewMod(damageType.."Min", "BASE", m_floor((actor.weaponData1[damageType.."Min"] or 0) * multiplier), "Spellblade Main Hand", ModFlag.Spell) diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index 9fe45271561..d5ba7b24c49 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -259,14 +259,16 @@ local function doActorAttribsConditions(env, actor) local condList = modDB.conditions -- Set conditions - if (actor.itemList["Weapon 2"] and actor.itemList["Weapon 2"].type == "Shield") or (actor == env.player and env.aegisModList) then + -- Weapon slots disabled by Manifested Dancing Dervishes count as empty + local weapon2 = not actor.weaponsDisabled and actor.itemList["Weapon 2"] + if (weapon2 and weapon2.type == "Shield") or (actor == env.player and env.aegisModList) then condList["UsingShield"] = true - elseif not actor.itemList["Weapon 2"] then + elseif not weapon2 then condList["OffHandIsEmpty"] = true end if actor.weaponData1.type == "None" then condList["Unarmed"] = true - if not actor.itemList["Weapon 2"] and not actor.itemList["Gloves"] then + if not weapon2 and not actor.itemList["Gloves"] then condList["Unencumbered"] = true end else @@ -3524,17 +3526,6 @@ function calcs.perform(env, skipEHP) -- Merge keystones again to catch any that were added by buffs modLib.mergeKeystones(env, env.modDB) - -- Special handling for Dancing Dervish - if modDB:Flag(nil, "DisableWeapons") then - env.player.weaponData1 = copyTable(env.data.unarmedWeaponData[env.classId]) - modDB.conditions["Unarmed"] = true - if not env.player.Gloves or env.player.Gloves == "None" then - modDB.conditions["Unencumbered"] = true - end - elseif env.weaponModList1 then - modDB:AddList(env.weaponModList1) - end - -- Process prerequisites for conditionals calcs.defenceForConditionals(env, env.player) if env.minion then diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index aebfb4756d7..ba7972edfc6 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -394,6 +394,44 @@ function wipeEnv(env, accelerate) end end +local function itemGrantsSkill(item, skillId) + for _, grantedSkill in ipairs(item.grantedSkills or { }) do + if grantedSkill.skillId == skillId then + return true + end + end + return false +end + +-- Check if an active socket group has a skill whose buff disables the weapon slots (e.g. Manifest Dancing Dervishes) +-- This mirrors the checks used when creating the active skills, as the weapon data is needed before then +local function socketGroupsDisableWeapons(env, build) + if not env.mode_buffs then + return false + end + for index, group in ipairs(build.skillsTab.socketGroupList) do + local slot = group.slot and build.itemsTab.slots[group.slot] + local slotEnabled = not slot or not slot.weaponSet or slot.weaponSet == (build.itemsTab.activeItemSet.useSecondWeaponSet and 2 or 1) + if index == env.mainSocketGroup or (group.enabled and slotEnabled) then + for _, gemInstance in ipairs(group.gemList) do + if gemInstance.enabled then + local grantedEffectList = gemInstance.gemData and gemInstance.gemData.grantedEffectList or { gemInstance.grantedEffect } + for effectIndex, grantedEffect in ipairs(grantedEffectList) do + if not grantedEffect.support and not grantedEffect.unsupported and (not grantedEffect.hasGlobalEffect or gemInstance["enableGlobal"..effectIndex]) then + for _, mod in ipairs(grantedEffect.baseMods or { }) do + if mod.name == "DisableWeapons" then + return true + end + end + end + end + end + end + end + end + return false +end + local function applyGemMods(effect, modList) for _, mod in ipairs(modList) do local match = true @@ -1201,12 +1239,14 @@ function calcs.initEnv(build, mode, override, specEnv) -- Add all the stats to player as well env.itemModDB:ScaleAddMod(mod, scale) end - elseif slotName == "Weapon 1" and item.grantedSkills[1] and item.grantedSkills[1].skillId == "UniqueAnimateWeapon" then + elseif slotName == "Weapon 1" and itemGrantsSkill(item, "ManifestDancingDervishes") then -- Special handling for The Dancing Dervish + -- Its modifiers are kept separate as they don't apply while Manifested Dancing Dervishes disable the weapon slots env.weaponModList1 = new("ModList"):ModList() for _, mod in ipairs(srcList) do -- Filter out mods that apply to socketed gems, or which add supports - local add = true + -- Rampage is kept as the Dancing Dervishes die when it ends + local add = mod.name ~= "Condition:Rampage" for _, tag in ipairs(mod) do if tag.type == "SocketedIn" then add = false @@ -1619,17 +1659,32 @@ function calcs.initEnv(build, mode, override, specEnv) end end + -- Determine main skill group + if env.mode == "CALCS" then + env.calcsInput.skill_number = m_min(m_max(#build.skillsTab.socketGroupList, 1), env.calcsInput.skill_number or 1) + env.mainSocketGroup = env.calcsInput.skill_number + else + build.mainSocketGroup = m_min(m_max(#build.skillsTab.socketGroupList, 1), build.mainSocketGroup or 1) + env.mainSocketGroup = build.mainSocketGroup + end + + -- Manifested Dancing Dervishes disable both weapon slots while their buff is active + env.player.weaponsDisabled = socketGroupsDisableWeapons(env, build) + -- Get the weapon data tables for the equipped weapons - env.player.weaponData1 = env.player.itemList["Weapon 1"] and env.player.itemList["Weapon 1"].weaponData and env.player.itemList["Weapon 1"].weaponData[1] or copyTable(env.data.unarmedWeaponData[env.classId]) + local weapon1 = not env.player.weaponsDisabled and env.player.itemList["Weapon 1"] + local weapon2 = not env.player.weaponsDisabled and env.player.itemList["Weapon 2"] + env.player.weaponData1 = weapon1 and weapon1.weaponData and weapon1.weaponData[1] or copyTable(env.data.unarmedWeaponData[env.classId]) -- Hide of the Vendigo: Can Attack as though using a Claw while main hand is empty - if not env.player.itemList["Weapon 1"] and env.modDB:Flag(nil, "CanAttackAsClawUnarmed") then + if not weapon1 and env.modDB:Flag(nil, "CanAttackAsClawUnarmed") then env.player.weaponData1.asThoughUsing = { Claw = true } end if env.player.weaponData1.countsAsDualWielding then - env.player.weaponData2 = env.player.itemList["Weapon 1"].weaponData[2] - elseif not env.player.itemList["Weapon 2"] then + env.player.weaponData2 = weapon1.weaponData[2] + elseif not weapon2 then + env.player.weaponData2 = { } -- Hollow Palm Technique - if (not env.player.itemList["Weapon 1"]) and (not env.player.itemList["Gloves"]) and env.modDB.mods.Keystone then + if not weapon1 and not env.player.itemList["Gloves"] and env.modDB.mods.Keystone then for _, keystone in ipairs(env.modDB.mods.Keystone) do if keystone.value == "Hollow Palm Technique" then env.player.weaponData2 = copyTable(env.data.unarmedWeaponData[env.classId]) @@ -1637,18 +1692,8 @@ function calcs.initEnv(build, mode, override, specEnv) end end end - env.player.weaponData2 = env.player.weaponData2 or { } - else - env.player.weaponData2 = env.player.itemList["Weapon 2"].weaponData and env.player.itemList["Weapon 2"].weaponData[2] or { } - end - - -- Determine main skill group - if env.mode == "CALCS" then - env.calcsInput.skill_number = m_min(m_max(#build.skillsTab.socketGroupList, 1), env.calcsInput.skill_number or 1) - env.mainSocketGroup = env.calcsInput.skill_number else - build.mainSocketGroup = m_min(m_max(#build.skillsTab.socketGroupList, 1), build.mainSocketGroup or 1) - env.mainSocketGroup = build.mainSocketGroup + env.player.weaponData2 = weapon2.weaponData and weapon2.weaponData[2] or { } end -- Process supports and put them into the correct buckets @@ -2045,6 +2090,11 @@ function calcs.initEnv(build, mode, override, specEnv) end end + -- The Dancing Dervish's modifiers only apply while its weapon slot isn't disabled by Manifested Dancing Dervishes + if env.weaponModList1 and not env.player.weaponsDisabled then + env.modDB:AddList(env.weaponModList1) + end + -- Merge Requirements Tables env.requirementsTable = tableConcat(env.requirementsTableItems, env.requirementsTableGems) From d6c40f37579c572a969c4fbacfc6e3787f249d39 Mon Sep 17 00:00:00 2001 From: Jayensee <118075978+Jayensee@users.noreply.github.com> Date: Thu, 19 Nov 2026 16:04:53 +0000 Subject: [PATCH 2/7] Disable skills socketed in disabled weapons and fix Vendigo skill usability Skills socketed in the weapons disabled by Manifested Dancing Dervishes (e.g. auras) can no longer be used. Supports socketed in them still support the Manifest Dancing Dervishes skill. Hide of the Vendigo makes you count as using a Claw for which skills can be used, so skills that can be used Unarmed but not with a Claw (Smite) are disabled. With Hollow Palm Technique, Claw skills (Cobra Lash) are no longer disabled by the unarmed off hand; they only attack with the main hand. Co-Authored-By: Claude Opus 5.5 --- spec/System/TestAttacks_spec.lua | 46 +++++++++++++++++++++++++ spec/System/TestDancingDervish_spec.lua | 28 +++++++++++++++ src/Modules/CalcActiveSkill.lua | 26 +++++++++++--- 3 files changed, 96 insertions(+), 4 deletions(-) diff --git a/spec/System/TestAttacks_spec.lua b/spec/System/TestAttacks_spec.lua index d7671bb0090..04a4178615b 100644 --- a/spec/System/TestAttacks_spec.lua +++ b/spec/System/TestAttacks_spec.lua @@ -150,6 +150,52 @@ describe("TestAttacks", function() assert.is_nil(player.weaponData2.asThoughUsing) end) + local function useSkill(skill, hollowPalm) + build.skillsTab:PasteSocketGroup(skill) + build.mainSocketGroup = 1 + if hollowPalm then + build.configTab.input.customMods = "Hollow Palm Technique" + build.configTab:BuildModList() + end + runCallback("OnFrame") + build.calcsTab:BuildOutput() + runCallback("OnFrame") + return build.calcsTab.mainEnv.player.mainSkill + end + + it("prevents using skills that can be used Unarmed but not with a Claw", function() + -- Smite can be used Unarmed, but not with a Claw + local mainSkill = useSkill("Smite 20/0 1") + assert.is_falsy(mainSkill.skillFlags.disable) + + newBuild() + equipHide() + mainSkill = useSkill("Smite 20/0 1") + assert.is_true(mainSkill.skillFlags.disable) + end) + + it("only attacks with the main hand using Claw skills with Hollow Palm Technique", function() + equipHide() + local mainSkill = useSkill("Cobra Lash 20/0 1", true) + assert.is_falsy(mainSkill.skillFlags.disable) + assert.is_true(mainSkill.skillFlags.weapon1Attack) + assert.is_nil(mainSkill.skillFlags.weapon2Attack) + assert.is_falsy(mainSkill.skillFlags.bothWeaponAttack) + end) + + it("still attacks with both hands using skills that can be used Unarmed with Hollow Palm Technique", function() + equipHide() + local mainSkill = useSkill("Cyclone 20/0 1", true) + assert.is_falsy(mainSkill.skillFlags.disable) + assert.is_true(mainSkill.skillFlags.bothWeaponAttack) + end) + + it("does not allow dual wield only skills with Hollow Palm Technique", function() + equipHide() + local mainSkill = useSkill("Dual Strike 20/0 1", true) + assert.is_true(mainSkill.skillFlags.disable) + end) + it("gains attack speed if you've used a movement skill recently", function() equipHide("20% increased Attack Speed if you've used an Attack Movement Skill Recently") useFrostBlades() diff --git a/spec/System/TestDancingDervish_spec.lua b/spec/System/TestDancingDervish_spec.lua index 06399c7e8d7..2af2f1c0cae 100644 --- a/spec/System/TestDancingDervish_spec.lua +++ b/spec/System/TestDancingDervish_spec.lua @@ -95,6 +95,34 @@ describe("TestDancingDervish", function() assert.is_true(build.calcsTab.mainOutput.Minion.TotalDPS > 0) end) + it("disables skills socketed in the weapon while the Dancing Dervishes are manifested, but not its supports", function() + local dervishGroup = setup("Cyclone 20/0 1") + build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nHatred 20/0 1\nMinion Damage 20/0 1") + rebuild() + assert.is_true(player().mainSkill.activeEffect.grantedEffect.name == "Cyclone") + local hatred, dervishes + for _, activeSkill in ipairs(player().activeSkillList) do + if activeSkill.activeEffect.grantedEffect.name == "Hatred" then + hatred = activeSkill + elseif activeSkill.activeEffect.grantedEffect.id == "ManifestDancingDervishes" then + dervishes = activeSkill + end + end + assert.is_true(hatred.skillFlags.disable) + assert.is_nil(player().modDB.conditions["AffectedByHatred"]) + assert.is_falsy(dervishes.skillFlags.disable) + local supportedByMinionDamage = false + for _, effect in ipairs(dervishes.effectList) do + if effect.grantedEffect.name == "Minion Damage" then + supportedByMinionDamage = true + end + end + assert.is_true(supportedByMinionDamage) + + setManifested(dervishGroup, false) + assert.is_true(player().modDB.conditions["AffectedByHatred"]) + end) + it("keeps Rampage while the Dancing Dervishes are manifested", function() setup("Cyclone 20/0 1") assert.is_true(player().weaponsDisabled) diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index 311be69fa31..395ede04c5e 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -216,9 +216,14 @@ 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 + if weaponData.asThoughUsing then + -- Only the weapon types it attacks as though using determine which skills can be used + -- e.g. Hide of the Vendigo allows Claw skills, but not skills that can only be used Unarmed + 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 @@ -299,6 +304,17 @@ function calcs.buildActiveSkillModList(env, activeSkill) activeSkill.disableReason = "This skill requires a Staff" end + local socketGroup = activeSkill.socketGroup + if activeSkill.actor.weaponsDisabled and socketGroup and socketGroup.slot and socketGroup.slotEnabled and not socketGroup.source then + local slotName = socketGroup.slot:gsub(" Swap", "") + if slotName == "Weapon 1" or slotName == "Weapon 2" then + -- Skills socketed in weapons disabled by Manifested Dancing Dervishes can't be used + -- Supports socketed in them still support the skills granted by the weapon + skillFlags.disable = true + activeSkill.disableReason = "This skill is socketed in a disabled weapon" + end + end + if skillFlags.shieldAttack then -- Special handling for Spectral Shield Throw skillFlags.weapon2Attack = true @@ -351,7 +367,9 @@ function calcs.buildActiveSkillModList(env, activeSkill) activeSkill.weapon2Flags = weapon2Flags skillFlags.weapon2Attack = true end - elseif (skillTypes[SkillType.DualWieldOnly] or weapon2Info) and not activeSkill.summonSkill then + -- While attacking as though using a Claw in the main hand (Hide of the Vendigo), an incompatible unarmed + -- off hand (Hollow Palm Technique) doesn't disable the skill, it just doesn't attack + elseif (skillTypes[SkillType.DualWieldOnly] or (weapon2Info and not activeSkill.actor.weaponData1.asThoughUsing)) and not activeSkill.summonSkill then -- Skill requires a compatible off hand weapon skillFlags.disable = true activeSkill.disableReason = activeSkill.disableReason or "Off Hand weapon is not usable with this skill" From 204cd0870bc89d3bb116afd9cb65d4eac11b533e Mon Sep 17 00:00:00 2001 From: Jayensee <118075978+Jayensee@users.noreply.github.com> Date: Thu, 19 Nov 2026 16:27:35 +0000 Subject: [PATCH 3/7] Dual wield Hide of the Vendigo Claw skills with Hollow Palm Technique Hide of the Vendigo only decides which skills can be used, based on the main hand. Once a skill can be used, the unarmed off hand from Hollow Palm Technique attacks with it as well, unless the skill is dual wield only. Co-Authored-By: Claude Opus 5.5 --- spec/System/TestAttacks_spec.lua | 8 ++++---- src/Modules/CalcActiveSkill.lua | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/spec/System/TestAttacks_spec.lua b/spec/System/TestAttacks_spec.lua index 04a4178615b..48609eb4927 100644 --- a/spec/System/TestAttacks_spec.lua +++ b/spec/System/TestAttacks_spec.lua @@ -174,13 +174,13 @@ describe("TestAttacks", function() assert.is_true(mainSkill.skillFlags.disable) end) - it("only attacks with the main hand using Claw skills with Hollow Palm Technique", function() + it("dual wields Claw skills with Hollow Palm Technique", function() equipHide() local mainSkill = useSkill("Cobra Lash 20/0 1", true) assert.is_falsy(mainSkill.skillFlags.disable) - assert.is_true(mainSkill.skillFlags.weapon1Attack) - assert.is_nil(mainSkill.skillFlags.weapon2Attack) - assert.is_falsy(mainSkill.skillFlags.bothWeaponAttack) + assert.is_true(mainSkill.skillFlags.bothWeaponAttack) + assert.is_true(bit.band(mainSkill.weapon2Flags, ModFlag.Unarmed) > 0) + assert.is_true(build.calcsTab.mainOutput.OffHand.AverageHit > 0) end) it("still attacks with both hands using skills that can be used Unarmed with Hollow Palm Technique", function() diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index 395ede04c5e..e86769744c4 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -358,6 +358,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 affects which skills can be used, which depends on the main hand alone + -- Once a skill can be used, the unarmed off hand from Hollow Palm Technique attacks with it as well + 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 @@ -367,9 +372,7 @@ function calcs.buildActiveSkillModList(env, activeSkill) activeSkill.weapon2Flags = weapon2Flags skillFlags.weapon2Attack = true end - -- While attacking as though using a Claw in the main hand (Hide of the Vendigo), an incompatible unarmed - -- off hand (Hollow Palm Technique) doesn't disable the skill, it just doesn't attack - elseif (skillTypes[SkillType.DualWieldOnly] or (weapon2Info and not activeSkill.actor.weaponData1.asThoughUsing)) and not activeSkill.summonSkill then + elseif (skillTypes[SkillType.DualWieldOnly] or weapon2Info) and not activeSkill.summonSkill then -- Skill requires a compatible off hand weapon skillFlags.disable = true activeSkill.disableReason = activeSkill.disableReason or "Off Hand weapon is not usable with this skill" From 7caeaaba6e0160773b44609aaab121f20a9a9e61 Mon Sep 17 00:00:00 2001 From: Jayensee <118075978+Jayensee@users.noreply.github.com> Date: Thu, 19 Nov 2026 21:35:11 +0000 Subject: [PATCH 4/7] Keep disable reason for skills socketed in disabled weapons The weapon checks overwrote the reason with "No usable weapon equipped", so the check now runs after them. Co-Authored-By: Claude Opus 5.5 --- spec/System/TestDancingDervish_spec.lua | 9 ++++++++- src/Modules/CalcActiveSkill.lua | 23 ++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/spec/System/TestDancingDervish_spec.lua b/spec/System/TestDancingDervish_spec.lua index 2af2f1c0cae..279b5452ef4 100644 --- a/spec/System/TestDancingDervish_spec.lua +++ b/spec/System/TestDancingDervish_spec.lua @@ -98,17 +98,24 @@ describe("TestDancingDervish", function() it("disables skills socketed in the weapon while the Dancing Dervishes are manifested, but not its supports", function() local dervishGroup = setup("Cyclone 20/0 1") build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nHatred 20/0 1\nMinion Damage 20/0 1") + -- Frost Blades can't be used unarmed, so the weapon checks would disable it as well + build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nFrost Blades 20/0 1") rebuild() assert.is_true(player().mainSkill.activeEffect.grantedEffect.name == "Cyclone") - local hatred, dervishes + local hatred, frostBlades, dervishes for _, activeSkill in ipairs(player().activeSkillList) do if activeSkill.activeEffect.grantedEffect.name == "Hatred" then hatred = activeSkill + elseif activeSkill.activeEffect.grantedEffect.name == "Frost Blades" then + frostBlades = activeSkill elseif activeSkill.activeEffect.grantedEffect.id == "ManifestDancingDervishes" then dervishes = activeSkill end end assert.is_true(hatred.skillFlags.disable) + assert.are.equals("This skill is socketed in a disabled weapon", hatred.disableReason) + assert.is_true(frostBlades.skillFlags.disable) + assert.are.equals("This skill is socketed in a disabled weapon", frostBlades.disableReason) assert.is_nil(player().modDB.conditions["AffectedByHatred"]) assert.is_falsy(dervishes.skillFlags.disable) local supportedByMinionDamage = false diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index e86769744c4..f65bc48331d 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -304,17 +304,6 @@ function calcs.buildActiveSkillModList(env, activeSkill) activeSkill.disableReason = "This skill requires a Staff" end - local socketGroup = activeSkill.socketGroup - if activeSkill.actor.weaponsDisabled and socketGroup and socketGroup.slot and socketGroup.slotEnabled and not socketGroup.source then - local slotName = socketGroup.slot:gsub(" Swap", "") - if slotName == "Weapon 1" or slotName == "Weapon 2" then - -- Skills socketed in weapons disabled by Manifested Dancing Dervishes can't be used - -- Supports socketed in them still support the skills granted by the weapon - skillFlags.disable = true - activeSkill.disableReason = "This skill is socketed in a disabled weapon" - end - end - if skillFlags.shieldAttack then -- Special handling for Spectral Shield Throw skillFlags.weapon2Attack = true @@ -386,6 +375,18 @@ function calcs.buildActiveSkillModList(env, activeSkill) end end + -- Checked after the weapon flags so the reason isn't overwritten by the weapon checks + local socketGroup = activeSkill.socketGroup + if activeSkill.actor.weaponsDisabled and socketGroup and socketGroup.slot and socketGroup.slotEnabled and not socketGroup.source then + local slotName = socketGroup.slot:gsub(" Swap", "") + if slotName == "Weapon 1" or slotName == "Weapon 2" then + -- Skills socketed in weapons disabled by Manifested Dancing Dervishes can't be used + -- Supports socketed in them still support the skills granted by the weapon + skillFlags.disable = true + activeSkill.disableReason = "This skill is socketed in a disabled weapon" + end + end + -- Apply stat-map flagged skill flags. for stat, statValue in pairs(calcLib.buildSkillInstanceStats(activeEffect, activeGrantedEffect)) do local map = activeGrantedEffect.statMap[stat] From 20586357a7006715466fd55baf91bcd077e6ef35 Mon Sep 17 00:00:00 2001 From: Jayensee <118075978+Jayensee@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:00:10 +0000 Subject: [PATCH 5/7] Fully disable weapon slots while Dancing Dervishes are manifested Work out whether the weapon slots are disabled before the items are processed, and leave the disabled weapons out of the equipped item list (keeping them in disabledItemList for their requirements and for minions that use them). Everything that reads the equipped items then sees empty weapon slots, so the Dancing Dervish specific workarounds for its modifiers, Battlemage, Spellblade and the off hand conditions are no longer needed. Rampage from the Dancing Dervish still applies. Item-granted skill groups are only created after the items are processed, so the calculation is redone if that changes whether the weapons are disabled, e.g. right after equipping The Dancing Dervish. Skills granted by an item being replaced when comparing items no longer disable the weapon slots. Only the skill that disables the weapons is exempt from being disabled when it comes from a weapon slot. Co-Authored-By: Claude Opus 5.5 --- spec/System/TestDancingDervish_spec.lua | 97 +++++++++++++++-- src/Modules/CalcActiveSkill.lua | 14 +-- src/Modules/CalcOffence.lua | 4 +- src/Modules/CalcPerform.lua | 13 ++- src/Modules/CalcSetup.lua | 133 ++++++++++++++---------- 5 files changed, 182 insertions(+), 79 deletions(-) diff --git a/spec/System/TestDancingDervish_spec.lua b/spec/System/TestDancingDervish_spec.lua index 279b5452ef4..afc1e1ca543 100644 --- a/spec/System/TestDancingDervish_spec.lua +++ b/spec/System/TestDancingDervish_spec.lua @@ -30,9 +30,14 @@ describe("TestDancingDervish", function() runCallback("OnFrame") end - local function equip(raw) + local function equip(raw, slotName) build.itemsTab:CreateDisplayItemFromRaw(raw) + local item = build.itemsTab.displayItem build.itemsTab:AddDisplayItem() + if slotName then + build.itemsTab.slots[slotName]:SetSelItemId(item.id) + build.buildFlag = true + end runCallback("OnFrame") end @@ -42,6 +47,14 @@ describe("TestDancingDervish", function() rebuild() end + local function findManifestGroup() + for _, group in ipairs(build.skillsTab.socketGroupList) do + if group.source and group.gemList[1] and group.gemList[1].skillId == "ManifestDancingDervishes" then + return group + end + end + end + -- Equips The Dancing Dervish and uses the given skill as the main skill -- Returns the socket group of the granted Manifest Dancing Dervishes skill local function setup(skill) @@ -50,11 +63,7 @@ describe("TestDancingDervish", function() equip(dancingDervish) build.mainSocketGroup = 1 rebuild() - for _, group in ipairs(build.skillsTab.socketGroupList) do - if group.source then - return group - end - end + return findManifestGroup() end local function setManifested(dervishGroup, manifested) @@ -90,7 +99,8 @@ describe("TestDancingDervish", function() local env = build.calcsTab.mainEnv assert.is_true(player().weaponsDisabled) assert.are.equals("None", player().weaponData1.type) - assert.are.equals(player().itemList["Weapon 1"].weaponData[1], env.minion.weaponData1) + assert.is_nil(player().itemList["Weapon 1"]) + assert.are.equals(player().disabledItemList["Weapon 1"].weaponData[1], env.minion.weaponData1) assert.are.equals("Two Handed Sword", env.minion.weaponData1.type) assert.is_true(build.calcsTab.mainOutput.Minion.TotalDPS > 0) end) @@ -232,4 +242,77 @@ describe("TestDancingDervish", function() assert.is_true(player().weaponsDisabled) assert.are.equals(unarmedHit, build.calcsTab.mainOutput.AverageHit) end) + + it("disables the weapon slots as soon as The Dancing Dervish is equipped", function() + build.skillsTab:PasteSocketGroup("Cyclone 20/0 1") + runCallback("OnFrame") + -- The socket group of the granted skill doesn't exist yet when the items are processed + equip(dancingDervish) + assert.is_true(player().weaponsDisabled) + assert.is_nil(player().itemList["Weapon 1"]) + assert.are.equals("None", player().weaponData1.type) + end) + + it("does not disable a weapon that's compared against The Dancing Dervish", function() + setup("Cyclone 20/0 1") + local sword = new("Item"):Item("Rarity: RARE\nTest Sword\nRusted Sword\nImplicits: 0\n10% increased Fire Damage") + local env = build.calcsTab.calcs.initEnv(build, "CALCULATOR", { repSlotName = "Weapon 1", repItem = sword }) + assert.is_false(env.player.weaponsDisabled) + assert.are.equals(sword, env.player.itemList["Weapon 1"]) + assert.are.equals(10, env.modDB:Sum("INC", nil, "FireDamage")) + end) + + it("keeps the requirements of the disabled weapon", function() + setup("Cyclone 20/0 1") + assert.is_true(player().weaponsDisabled) + local weaponRequirement + for _, requirement in ipairs(build.calcsTab.mainEnv.requirementsTable) do + if requirement.sourceSlot == "Weapon 1" then + weaponRequirement = requirement + end + end + assert.are.equals(player().disabledItemList["Weapon 1"], weaponRequirement.sourceItem) + assert.is_true(weaponRequirement.Str > 0) + end) + + it("does not let Energy Blade replace the disabled weapons", function() + local dervishGroup = setup("Cyclone 20/0 1") + build.skillsTab:PasteSocketGroup("Energy Blade 20/0 1") + rebuild() + assert.is_true(player().weaponsDisabled) + assert.is_nil(player().itemList["Weapon 1"]) + assert.are.equals("None", player().weaponData1.type) + assert.is_true(bit.band(player().mainSkill.weapon1Flags, ModFlag.Unarmed) > 0) + + setManifested(dervishGroup, false) + assert.are.equals("Energy Blade Two Handed", player().itemList["Weapon 1"].baseName) + assert.are.equals(0, bit.band(player().mainSkill.weapon1Flags, ModFlag.Unarmed)) + end) + + it("only disables the weapon slots while The Dancing Dervish is in the active weapon set", function() + build.skillsTab:PasteSocketGroup("Cyclone 20/0 1") + runCallback("OnFrame") + equip([[ + Rarity: RARE + Test Sword + Rusted Sword + Implicits: 0 + 10% increased Fire Damage + ]], "Weapon 1") + equip(dancingDervish, "Weapon 1 Swap") + build.mainSocketGroup = 1 + rebuild() + assert.is_false(player().weaponsDisabled) + assert.are.equals("Test Sword", player().itemList["Weapon 1"].title) + assert.are.equals(10, player().modDB:Sum("INC", nil, "FireDamage")) + assert.are.equals(0, player().modDB:Sum("INC", nil, "Accuracy")) + + build.itemsTab.activeItemSet.useSecondWeaponSet = true + rebuild() + assert.is_true(player().weaponsDisabled) + assert.is_nil(player().itemList["Weapon 1"]) + assert.are.equals("The Dancing Dervish", player().disabledItemList["Weapon 1"].title) + assert.are.equals(0, player().modDB:Sum("INC", nil, "FireDamage")) + assert.are.equals(0, player().modDB:Sum("INC", nil, "Accuracy")) + end) end) diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index f65bc48331d..85842569302 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -377,13 +377,13 @@ function calcs.buildActiveSkillModList(env, activeSkill) -- Checked after the weapon flags so the reason isn't overwritten by the weapon checks local socketGroup = activeSkill.socketGroup - if activeSkill.actor.weaponsDisabled and socketGroup and socketGroup.slot and socketGroup.slotEnabled and not socketGroup.source then + if activeSkill.actor.weaponsDisabled and socketGroup and socketGroup.slot and socketGroup.slotEnabled and not calcs.grantedEffectDisablesWeapons(activeGrantedEffect) then local slotName = socketGroup.slot:gsub(" Swap", "") if slotName == "Weapon 1" or slotName == "Weapon 2" then - -- Skills socketed in weapons disabled by Manifested Dancing Dervishes can't be used - -- Supports socketed in them still support the skills granted by the weapon + -- Skills socketed in or granted by weapons disabled by Manifested Dancing Dervishes can't be used + -- Supports socketed in them still support the skill that disables them skillFlags.disable = true - activeSkill.disableReason = "This skill is socketed in a disabled weapon" + activeSkill.disableReason = socketGroup.source and "This skill is granted by a disabled weapon" or "This skill is socketed in a disabled weapon" end end @@ -811,9 +811,9 @@ function calcs.buildActiveSkillModList(env, activeSkill) if item and item.weaponData then minion.weaponData1 = item.weaponData[1] end - elseif env.player.weaponsDisabled and env.player.itemList["Weapon 1"] and env.player.itemList["Weapon 1"].weaponData then + elseif env.player.disabledItemList["Weapon 1"] and env.player.disabledItemList["Weapon 1"].weaponData then -- The player's weapon slots are disabled while the weapon is a minion (e.g. Manifested Dancing Dervishes) - minion.weaponData1 = env.player.itemList["Weapon 1"].weaponData[1] + minion.weaponData1 = env.player.disabledItemList["Weapon 1"].weaponData[1] else minion.weaponData1 = env.player.weaponData1 end @@ -824,6 +824,8 @@ function calcs.buildActiveSkillModList(env, activeSkill) if item and item.weaponData then minion.weaponData2 = item.weaponData[2] end + elseif env.player.disabledItemList["Weapon 2"] and env.player.disabledItemList["Weapon 2"].weaponData then + minion.weaponData2 = env.player.disabledItemList["Weapon 2"].weaponData[2] else minion.weaponData2 = env.player.weaponData2 end diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index 441eb186854..bea7d97e17e 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -588,7 +588,7 @@ function calcs.offence(env, actor, activeSkill) -- account for Battlemage -- Note: we check conditions of Main Hand weapon using actor.itemList as actor.weaponData1 is populated with unarmed values when no weapon slotted. - if skillModList:Flag(nil, "Battlemage") and not actor.weaponsDisabled and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] then + if skillModList:Flag(nil, "Battlemage") and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] then local multiplier = (skillModList:Max(skillCfg, "MainHandWeaponDamageAppliesToSpells") or 100) / 100 for _, damageType in ipairs(dmgTypeList) do @@ -601,7 +601,7 @@ function calcs.offence(env, actor, activeSkill) -- -- account for Spellblade -- Note: we check conditions of Main Hand weapon using actor.itemList as actor.weaponData1 is populated with unarmed values when no weapon slotted. local spellbladeMulti = skillModList:Max(skillCfg, "OneHandWeaponDamageAppliesToSpells") - if spellbladeMulti and not actor.weaponsDisabled and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] and weapon1info.melee and weapon1info.oneHand then + if spellbladeMulti and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] and weapon1info.melee and weapon1info.oneHand then local multiplier = spellbladeMulti / 100 * (weapon2info and 0.6 or 1) for _, damageType in ipairs(dmgTypeList) do skillModList:NewMod(damageType.."Min", "BASE", m_floor((actor.weaponData1[damageType.."Min"] or 0) * multiplier), "Spellblade Main Hand", ModFlag.Spell) diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index d5ba7b24c49..5a937acc597 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -259,16 +259,14 @@ local function doActorAttribsConditions(env, actor) local condList = modDB.conditions -- Set conditions - -- Weapon slots disabled by Manifested Dancing Dervishes count as empty - local weapon2 = not actor.weaponsDisabled and actor.itemList["Weapon 2"] - if (weapon2 and weapon2.type == "Shield") or (actor == env.player and env.aegisModList) then + if (actor.itemList["Weapon 2"] and actor.itemList["Weapon 2"].type == "Shield") or (actor == env.player and env.aegisModList) then condList["UsingShield"] = true - elseif not weapon2 then + elseif not actor.itemList["Weapon 2"] then condList["OffHandIsEmpty"] = true end if actor.weaponData1.type == "None" then condList["Unarmed"] = true - if not weapon2 and not actor.itemList["Gloves"] then + if not actor.itemList["Weapon 2"] and not actor.itemList["Gloves"] then condList["Unencumbered"] = true end else @@ -1232,7 +1230,7 @@ local function initMinionModDB(env, activeSkill, output) minion.modDB:AddList(env.player.itemList["Gloves"].modList) end end - if activeSkill.skillData.minionUseMainHandWeapon then + if activeSkill.skillData.minionUseMainHandWeapon and env.player.itemList["Weapon 1"] then minion.modDB:AddList(env.player.itemList["Weapon 1"].slotModList[1]) end if minion.itemSet or minion.uses then @@ -1245,7 +1243,8 @@ local function initMinionModDB(env, activeSkill, output) end item = env.build.itemsTab.items[minion.itemSet[slotName].selItemId] else - item = env.player.itemList[slotName] + -- Minions can still use weapons disabled by Manifested Dancing Dervishes + item = env.player.itemList[slotName] or env.player.disabledItemList[slotName] end if item then minion.itemList[slotName] = item diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index ba7972edfc6..00abdc21bd2 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -17,7 +17,8 @@ local tempTable1 = { } local gemSocketColours = { "R", "G", "B" } local function getMatchingSocketQuality(env, groupCfg, gemInstance, socketIndex) - local item = groupCfg.slotName and env.player.itemList[groupCfg.slotName] + -- Supports socketed in weapons disabled by Manifested Dancing Dervishes still support the skill that disables them + local item = groupCfg.slotName and (env.player.itemList[groupCfg.slotName] or env.player.disabledItemList[groupCfg.slotName]) local sockets = item and item.sockets if not sockets then return 0 @@ -371,9 +372,8 @@ function wipeEnv(env, accelerate) if env.theIronMass then wipeTable(env.theIronMass) end - if env.weaponModList1 then - wipeTable(env.weaponModList1) - end + -- Weapons disabled by Manifested Dancing Dervishes + wipeTable(env.player.disabledItemList) -- Requirements from Items (Str, Dex, Int) wipeTable(env.requirementsTableItems) @@ -403,26 +403,44 @@ local function itemGrantsSkill(item, skillId) return false end --- Check if an active socket group has a skill whose buff disables the weapon slots (e.g. Manifest Dancing Dervishes) --- This mirrors the checks used when creating the active skills, as the weapon data is needed before then -local function socketGroupsDisableWeapons(env, build) +-- Check if a skill's buff disables the weapon slots (e.g. Manifest Dancing Dervishes) +function calcs.grantedEffectDisablesWeapons(grantedEffect) + for _, mod in ipairs(grantedEffect.baseMods or { }) do + if mod.name == "DisableWeapons" then + return true + end + end + return false +end + +local function setMainSocketGroup(env, build) + if env.mode == "CALCS" then + env.calcsInput.skill_number = m_min(m_max(#build.skillsTab.socketGroupList, 1), env.calcsInput.skill_number or 1) + env.mainSocketGroup = env.calcsInput.skill_number + else + build.mainSocketGroup = m_min(m_max(#build.skillsTab.socketGroupList, 1), build.mainSocketGroup or 1) + env.mainSocketGroup = build.mainSocketGroup + end +end + +-- Check if an active socket group has a skill whose buff disables the weapon slots +-- This mirrors the checks used when creating the active skills, as it's needed before the items are processed +local function socketGroupsDisableWeapons(env, build, override) if not env.mode_buffs then return false end for index, group in ipairs(build.skillsTab.socketGroupList) do local slot = group.slot and build.itemsTab.slots[group.slot] local slotEnabled = not slot or not slot.weaponSet or slot.weaponSet == (build.itemsTab.activeItemSet.useSecondWeaponSet and 2 or 1) - if index == env.mainSocketGroup or (group.enabled and slotEnabled) then + -- Ignore skills granted by an item that's being replaced, e.g. when comparing weapons with The Dancing Dervish equipped + local sourceReplaced = group.sourceItem and group.slot == override.repSlotName and group.sourceItem ~= override.repItem + if not sourceReplaced and (index == env.mainSocketGroup or (group.enabled and slotEnabled)) then for _, gemInstance in ipairs(group.gemList) do if gemInstance.enabled then local grantedEffectList = gemInstance.gemData and gemInstance.gemData.grantedEffectList or { gemInstance.grantedEffect } for effectIndex, grantedEffect in ipairs(grantedEffectList) do - if not grantedEffect.support and not grantedEffect.unsupported and (not grantedEffect.hasGlobalEffect or gemInstance["enableGlobal"..effectIndex]) then - for _, mod in ipairs(grantedEffect.baseMods or { }) do - if mod.name == "DisableWeapons" then - return true - end - end + if not grantedEffect.support and not grantedEffect.unsupported and (not grantedEffect.hasGlobalEffect or gemInstance["enableGlobal"..effectIndex]) and calcs.grantedEffectDisablesWeapons(grantedEffect) then + return true end end end @@ -584,6 +602,7 @@ function calcs.initEnv(build, mode, override, specEnv) env.radiusJewelList = wipeTable(env.radiusJewelList) env.extraRadiusNodeList = wipeTable(env.extraRadiusNodeList) env.player.itemList = { } + env.player.disabledItemList = { } env.grantedSkills = { } env.grantedSkillsNodes = { } env.grantedSkillsItems = { } @@ -848,6 +867,11 @@ function calcs.initEnv(build, mode, override, specEnv) -- Build and merge item modifiers, and create list of radius jewels if not accelerate.requirementsItems then + -- Manifested Dancing Dervishes disable both weapon slots while their buff is active + -- This is checked before the items are processed, so the disabled weapons can be left out + setMainSocketGroup(env, build) + env.player.weaponsDisabled = socketGroupsDisableWeapons(env, build, override) + local items = {} local jewelLimits = {} for _, slot in ipairs(build.itemsTab.orderedSlots) do @@ -1119,6 +1143,29 @@ function calcs.initEnv(build, mode, override, specEnv) end item = nil end + if item and env.player.weaponsDisabled and (slotName == "Weapon 1" or slotName == "Weapon 2") then + -- Weapons disabled by Manifested Dancing Dervishes count as unequipped, but their requirements still need to be met + env.player.disabledItemList[slotName] = item + if item.requirements then + t_insert(env.requirementsTableItems, { + source = "Item", + sourceItem = item, + sourceSlot = slotName, + Str = item.requirements.strMod, + Dex = item.requirements.dexMod, + Int = item.requirements.intMod, + }) + end + if itemGrantsSkill(item, "ManifestDancingDervishes") then + -- Rampage is kept as the Dancing Dervishes die when it ends + for _, mod in ipairs(item.modList or (item.slotModList and item.slotModList[slot.slotNum]) or { }) do + if mod.name == "Condition:Rampage" then + env.itemModDB:AddMod(mod) + end + end + end + item = nil + end local scale = 1 if item and item.type == "Jewel" and item.base.subType == "Abyss" and slot.parentSlot then -- Check if the item in the parent slot has enough Abyssal Sockets @@ -1239,26 +1286,6 @@ function calcs.initEnv(build, mode, override, specEnv) -- Add all the stats to player as well env.itemModDB:ScaleAddMod(mod, scale) end - elseif slotName == "Weapon 1" and itemGrantsSkill(item, "ManifestDancingDervishes") then - -- Special handling for The Dancing Dervish - -- Its modifiers are kept separate as they don't apply while Manifested Dancing Dervishes disable the weapon slots - env.weaponModList1 = new("ModList"):ModList() - for _, mod in ipairs(srcList) do - -- Filter out mods that apply to socketed gems, or which add supports - -- Rampage is kept as the Dancing Dervishes die when it ends - local add = mod.name ~= "Condition:Rampage" - for _, tag in ipairs(mod) do - if tag.type == "SocketedIn" then - add = false - break - end - end - if add then - env.weaponModList1:ScaleAddMod(mod, scale) - else - env.itemModDB:ScaleAddMod(mod, scale) - end - end elseif item.name:match("Kalandra's Touch") then local otherRing = items[(slotName == "Ring 1" and "Ring 2") or (slotName == "Ring 2" and "Ring 1")] if otherRing and not otherRing.name:match("Kalandra's Touch") then @@ -1660,31 +1687,27 @@ function calcs.initEnv(build, mode, override, specEnv) end -- Determine main skill group - if env.mode == "CALCS" then - env.calcsInput.skill_number = m_min(m_max(#build.skillsTab.socketGroupList, 1), env.calcsInput.skill_number or 1) - env.mainSocketGroup = env.calcsInput.skill_number - else - build.mainSocketGroup = m_min(m_max(#build.skillsTab.socketGroupList, 1), build.mainSocketGroup or 1) - env.mainSocketGroup = build.mainSocketGroup - end + setMainSocketGroup(env, build) - -- Manifested Dancing Dervishes disable both weapon slots while their buff is active - env.player.weaponsDisabled = socketGroupsDisableWeapons(env, build) + -- The weapon slots were handled before the item-granted skill groups above were updated + -- Recalculate if that changed whether they're disabled, e.g. when The Dancing Dervish was just equipped + if not accelerate.requirementsItems and not override.weaponsDisabledRechecked and socketGroupsDisableWeapons(env, build, override) ~= env.player.weaponsDisabled then + override = copyTable(override, true) + override.weaponsDisabledRechecked = true + return calcs.initEnv(build, mode, override, specEnv) + end -- Get the weapon data tables for the equipped weapons - local weapon1 = not env.player.weaponsDisabled and env.player.itemList["Weapon 1"] - local weapon2 = not env.player.weaponsDisabled and env.player.itemList["Weapon 2"] - env.player.weaponData1 = weapon1 and weapon1.weaponData and weapon1.weaponData[1] or copyTable(env.data.unarmedWeaponData[env.classId]) + env.player.weaponData1 = env.player.itemList["Weapon 1"] and env.player.itemList["Weapon 1"].weaponData and env.player.itemList["Weapon 1"].weaponData[1] or copyTable(env.data.unarmedWeaponData[env.classId]) -- Hide of the Vendigo: Can Attack as though using a Claw while main hand is empty - if not weapon1 and env.modDB:Flag(nil, "CanAttackAsClawUnarmed") then + if not env.player.itemList["Weapon 1"] and env.modDB:Flag(nil, "CanAttackAsClawUnarmed") then env.player.weaponData1.asThoughUsing = { Claw = true } end if env.player.weaponData1.countsAsDualWielding then - env.player.weaponData2 = weapon1.weaponData[2] - elseif not weapon2 then - env.player.weaponData2 = { } + env.player.weaponData2 = env.player.itemList["Weapon 1"].weaponData[2] + elseif not env.player.itemList["Weapon 2"] then -- Hollow Palm Technique - if not weapon1 and not env.player.itemList["Gloves"] and env.modDB.mods.Keystone then + if (not env.player.itemList["Weapon 1"]) and (not env.player.itemList["Gloves"]) and env.modDB.mods.Keystone then for _, keystone in ipairs(env.modDB.mods.Keystone) do if keystone.value == "Hollow Palm Technique" then env.player.weaponData2 = copyTable(env.data.unarmedWeaponData[env.classId]) @@ -1692,8 +1715,9 @@ function calcs.initEnv(build, mode, override, specEnv) end end end + env.player.weaponData2 = env.player.weaponData2 or { } else - env.player.weaponData2 = weapon2.weaponData and weapon2.weaponData[2] or { } + env.player.weaponData2 = env.player.itemList["Weapon 2"].weaponData and env.player.itemList["Weapon 2"].weaponData[2] or { } end -- Process supports and put them into the correct buckets @@ -2090,11 +2114,6 @@ function calcs.initEnv(build, mode, override, specEnv) end end - -- The Dancing Dervish's modifiers only apply while its weapon slot isn't disabled by Manifested Dancing Dervishes - if env.weaponModList1 and not env.player.weaponsDisabled then - env.modDB:AddList(env.weaponModList1) - end - -- Merge Requirements Tables env.requirementsTable = tableConcat(env.requirementsTableItems, env.requirementsTableGems) From 7d8bcf113db5443bf0b509cca7022088cf155d43 Mon Sep 17 00:00:00 2001 From: Jayensee <118075978+Jayensee@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:52:27 +0000 Subject: [PATCH 6/7] Check the Hollow Palm off hand hits in the main-hand-only modifier test Without an off hand hit the test compared nil with nil and passed on dev. Co-Authored-By: Claude Opus 5.5 --- spec/System/TestDancingDervish_spec.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/System/TestDancingDervish_spec.lua b/spec/System/TestDancingDervish_spec.lua index afc1e1ca543..2538b8e03d4 100644 --- a/spec/System/TestDancingDervish_spec.lua +++ b/spec/System/TestDancingDervish_spec.lua @@ -188,6 +188,7 @@ describe("TestDancingDervish", function() setCustomMods("Hollow Palm Technique") local mainHandHit = build.calcsTab.mainOutput.MainHand.AverageHit local offHandHit = build.calcsTab.mainOutput.OffHand.AverageHit + assert.is_true(offHandHit > 0) -- Ambidexterity setCustomMods("Hollow Palm Technique\n60% increased Attack Damage with Main Hand while Dual Wielding") From 4c813110997d9c53e2c953d878e00735f1ca23b9 Mon Sep 17 00:00:00 2001 From: Jayensee <118075978+Jayensee@users.noreply.github.com> Date: Thu, 19 Nov 2026 23:08:59 +0000 Subject: [PATCH 7/7] Test dual wielding Spectral Throw with Hide of the Vendigo and Hollow Palm Regression test for #10516. Co-Authored-By: Claude Opus 5.5 --- spec/System/TestAttacks_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/System/TestAttacks_spec.lua b/spec/System/TestAttacks_spec.lua index 48609eb4927..4009d2616f0 100644 --- a/spec/System/TestAttacks_spec.lua +++ b/spec/System/TestAttacks_spec.lua @@ -183,6 +183,15 @@ describe("TestAttacks", function() assert.is_true(build.calcsTab.mainOutput.OffHand.AverageHit > 0) end) + it("dual wields Spectral Throw with Hollow Palm Technique", function() + -- Spectral Throw can be used with a Claw, but not Unarmed (#10516) + equipHide() + local mainSkill = useSkill("Spectral Throw 20/0 1", true) + assert.is_falsy(mainSkill.skillFlags.disable) + assert.is_true(mainSkill.skillFlags.bothWeaponAttack) + assert.is_true(build.calcsTab.mainOutput.OffHand.AverageHit > 0) + end) + it("still attacks with both hands using skills that can be used Unarmed with Hollow Palm Technique", function() equipHide() local mainSkill = useSkill("Cyclone 20/0 1", true)