mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Changed so that weapon effects are not just applied to attack/damage of the weapon itself
This commit is contained in:
parent
96f090bef5
commit
1907050747
1 changed files with 5 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue