From 63a400542a369a5de27d48efe15af322219abc72 Mon Sep 17 00:00:00 2001 From: Peechey <92683202+Peechey@users.noreply.github.com> Date: Mon, 17 Nov 2025 02:17:03 -0600 Subject: [PATCH] Fix Sacred Wisps applying to non-Wand Attacks (#9272) * update CalcTools to handle differing weaponTypes * update for Varunastra * update for supports having more weaponTypes than Active Skill * better var name * Handle edge case of Varunustra with shield skills Handles the edge case of using Varunustra with a shield skill and wisps Varunustra was not being restricted to the melee skills when checking for the active skill type --------- Co-authored-by: LocalIdentity --- src/Modules/CalcTools.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/Modules/CalcTools.lua b/src/Modules/CalcTools.lua index 9a733a1a..cbd85a48 100644 --- a/src/Modules/CalcTools.lua +++ b/src/Modules/CalcTools.lua @@ -106,6 +106,41 @@ function calcLib.canGrantedEffectSupportActiveSkill(grantedEffect, activeSkill) if grantedEffect.isTrigger and activeSkill.actor.enemy.player ~= activeSkill.actor then return false end + -- Special case for Sacred Wisps, i.e. Wisps Support has a weaponType of Wand so it should only match with Active Skills that at least have Wand as a weaponType. + -- Super special case for Varunastra, e.g. allow Nightblade to support Smite. + local actorHasAllOneHand = (activeSkill.actor.weaponData1 and activeSkill.actor.weaponData1.countsAsAll1H) or (activeSkill.actor.weaponData2 and activeSkill.actor.weaponData2.countsAsAll1H) + if grantedEffect.weaponTypes then + -- Build a lookup of the active skill's weapon types + local activeTypeLookup = { } + if activeSkill.activeEffect.grantedEffect.weaponTypes then + for activeType in pairs(activeSkill.activeEffect.grantedEffect.weaponTypes) do + activeTypeLookup[activeType] = 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 + return false + end + -- Varunastra counts as every one-handed melee weapon type, but notably not Wand or Shield. + if actorHasAllOneHand then + activeTypeLookup["Claw"] = true + activeTypeLookup["Dagger"] = true + activeTypeLookup["One Handed Axe"] = true + activeTypeLookup["One Handed Mace"] = true + activeTypeLookup["One Handed Sword"] = true + end + local typeMatch = false + for grantedType in pairs(grantedEffect.weaponTypes) do + if activeTypeLookup[grantedType] then + typeMatch = true + break + end + end + -- No match, does not support the active skill + if not typeMatch then + return false + end + end return not grantedEffect.requireSkillTypes[1] or calcLib.doesTypeExpressionMatch(grantedEffect.requireSkillTypes, effectiveSkillTypes, effectiveMinionTypes) end