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(
|
return Array.from(await actor.allApplicableEffects({ noTransferArmor: true, noSelfArmor: true })).filter(
|
||||||
effect => {
|
effect => {
|
||||||
/* Effects on weapons only ever apply for the weapon itself */
|
/* Effects on secondary weapons only ever apply for the primary weapon */
|
||||||
if (effect.parent.type === 'weapon') {
|
const isSecondaryWeaponEffect = effect.parent.type === 'weapon' && effect.parent.system.secondary;
|
||||||
/* Unless they're secondary - then they apply only to other primary weapons */
|
const parentIsNotPrimaryWeapon = effectParent?.type !== 'weapon' || effectParent?.system.secondary;
|
||||||
if (effect.parent.system.secondary) {
|
if (isSecondaryWeaponEffect && parentIsNotPrimaryWeapon)
|
||||||
if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) return false;
|
return false;
|
||||||
} else if (effectParent?.id !== effect.parent.id) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return !effect.isSuppressed;
|
return !effect.isSuppressed;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue