mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Completed functionality
This commit is contained in:
parent
5e608dea99
commit
f6aa3dc750
8 changed files with 68 additions and 14 deletions
|
|
@ -112,6 +112,9 @@ export default class BaseEffect extends foundry.data.ActiveEffectTypeDataModel {
|
|||
initial: CONFIG.DH.GENERAL.range.veryClose.id,
|
||||
label: 'DAGGERHEART.ACTIVEEFFECT.Config.area.size'
|
||||
}),
|
||||
targetDispositions: new fields.SetField(new fields.NumberField({
|
||||
|
||||
})),
|
||||
}, { nullable: true, initial: null })
|
||||
};
|
||||
}
|
||||
|
|
|
|||
1
module/data/regionBehavior/_module.mjs
Normal file
1
module/data/regionBehavior/_module.mjs
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { default as applyActiveEffect } from './applyActiveEffect.mjs';
|
||||
14
module/data/regionBehavior/applyActiveEffect.mjs
Normal file
14
module/data/regionBehavior/applyActiveEffect.mjs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
export default class DhApplyActiveEffect extends CONFIG.RegionBehavior.dataModels.applyActiveEffect {
|
||||
static #tokenDispositionChecker = (eventFunction) => (event) => {
|
||||
const { token } = event.data;
|
||||
if (token.disposition === -1) {
|
||||
eventFunction.bind(this)(event);
|
||||
}
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static events = Object.entries(super.events).reduce((acc, [key, func]) => {
|
||||
acc[key] = DhApplyActiveEffect.#tokenDispositionChecker(func);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue