Dynvar
Dynvar
Am I approaching character data updates incorrectly?
In my system I've constructed a core and modules directory where core handles all of the critical functions of the base system and the modules are additional systems that can be included or excluded at the whim of the GM (things such as psionics, magic, super powers, future technology, etc). To handle how these things interact, I've created a PcDataCalculator service to which modules may register their data calculation steps and dependencies ( in 5E terms, this would be like the Magic module registering the formula for determining a Wizard's number of prepared spells and indicating it's dependent on class-levels and intelligence. This whole process is intended to run as part of the actor's PrepareData function. The challenge I think I will run into is ActiveEffects. If active effects are run before this process, then an active effect impacting intelligence will cause prepared spells to be calculated correctly, but one that increases prepared spells by a value dependent on the subtotal value of prepared spells (such as 'double the number of prepared spells you can cast') would not work correctly. If run afterwards, I'd have the opposite problem. In my calculator process, I've got the ability to pass in a key for when a specific attribute is updated and calculate everything directly or indirectly dependent on that key, so if I could do the same with active effects and process them only as part of the relevant stats calculations instead of all at once, that would be great. Is there a better way to go about this?
3 replies