League-of-Fabulous-Developers / FoundryVTT-Fabula-Ultima

Enter Project FU: an unofficial foundry system for Fabula Ultima, channeling the essence of the book while delivering the immersive experience of playing a JRPG in tabletop format.
MIT License
33 stars 18 forks source link

feat: damage hooks #156

Closed KSops closed 2 weeks ago

KSops commented 3 weeks ago

Adds two hooks to the damage pipeline. 'projectfu.damage.beforeApply' => altering overall values just before any meaningful calculations start 'projectfu.damage.applyTarget' => altering data per-target just before application The hooks can modify the provided data structure and the changes will be picked up and propagated to the logic.

Refactors out duplicate code

Repairs and adds some JSDoc typedefs

Centralizes some hook constants for ease of lookup, enumeration, and hopefully documentation

spyrella commented 3 weeks ago

Looking pretty good, i'll be trying it out later tonight.

KSops commented 3 weeks ago

I forgot the exports are referenced elsewhere like inline damage, and since the method signature changed it's broken. I'll need to patch that up