From 1907050747b0c1949bf2ee6472beadd3c18070e5 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Mon, 15 Jun 2026 19:12:20 +0200 Subject: [PATCH] Changed so that weapon effects are not just applied to attack/damage of the weapon itself --- module/data/action/baseAction.mjs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index c71f5ef9..b79942fa 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -343,13 +343,11 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel return Array.from(await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true })).filter( effect => { - /* Effects on weapons only ever apply for the weapon itself */ - if (effect.parent.type === 'weapon') { - /* Unless they're secondary - then they apply only to other primary weapons */ - if (effect.parent.system.secondary) { - if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) return false; - } else if (effectParent?.id !== effect.parent.id) return false; - } + /* Effects on secondary weapons only ever apply for the primary weapon */ + const isSecondaryWeaponEffect = effect.parent.type === 'weapon' && effect.parent.system.secondary; + const parentIsNotPrimaryWeapon = effectParent?.type !== 'weapon' || effectParent?.system.secondary; + if (isSecondaryWeaponEffect && parentIsNotPrimaryWeapon) + return false; return !effect.isSuppressed; }