#@Zhell if the above solution (moving the
1 messages · Page 1 of 1 (latest)
I lied - I was curious to see what it'd take so I went ahead and gave it a shot anyway. Making this into a thread so that I don't bog down the channel with a bunch of code, but figured I'd do another quasi-PR:
Only code changes would be in effect.mjs and dnd5e.mjs. The effect.mjs change is in init, first two lines become:
EffectTriggers.onCreateId = Hooks.on("createActiveEffect", EffectTriggers.onCreateDelete.bind("onCreate"));
EffectTriggers.onDeleteId = Hooks.on("deleteActiveEffect", EffectTriggers.onCreateDelete.bind("onDelete"));
``` so that `Hooks.off` can be called with bound functions (otherwise it becomes impossible to cleanly reference them).
Changes to `dnd5e.mjs` include the following at the end of `init`:
```js
Hooks.off("updateActiveEffect", EffectTriggers.onUpdate);
Hooks.off("preUpdateActiveEffect", EffectTriggers.preUpdate);
Hooks.off("createActiveEffect", EffectTriggers.onCreateId);
Hooks.off("deleteActiveEffect", EffectTriggers.onDeleteId);
Hooks.on("updateActiveEffects", SystemDND5E.onUpdate);
Hooks.on("preUpdateActiveEffect", SystemDND5E.preUpdate);
Hooks.on("createActiveEffect", SystemDND5E.onCreateDelete.bind("onCreate"));
Hooks.on("deleteActiveEffect", SystemDND5E.onCreateDelete.bind("onDelete"));
CombatTriggers._executeAppliedEffects = SystemDND5E._executeAppliedEffects;
``` And of course the addition of of the modified `onUpdate`, `preUpdate`, `onCreateDelete`, and `_executeAppliedEffects` functions further down.
Let me know your thoughts, @fair adder
(I'm not sure how I feel about directly overriding CombatTriggers._executeAppliedEffects but I don't think it would cause any problems)
Double checking whether you saw this. Fine if you don't want to go this direction. If so you can hit me with a good ol' fashioned "No" (ideally also an explanation, but just a no will do)
I do not have any plans to implement this.