mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
14 lines
No EOL
519 B
JavaScript
14 lines
No EOL
519 B
JavaScript
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;
|
|
}, {});
|
|
}
|