schlosrat / token-health

FoundryVTT module
5 stars 10 forks source link

Add a way for systems/players to hook damage calculation for more complex damage mitigation/calculation #46

Open whitespine opened 3 years ago

whitespine commented 3 years ago

As it stands, mitigation is somewhat limited in what sorts of resistances it can express - for instance, it can't really represent something like a creature having a maximum damage taken from a single hit, or conditional resistance based on status effects etc.

Adding in arbitrary foundry hooking that would have something like

onApplyDamage(amount: number, to: token[], type: string)

as it's interface would allow users/developers to support whatever damage systems they desired.

schlosrat commented 2 years ago

This is a positively fascinating request. I can imagine how this might be useful for various game systems and I like the idea of putting that part of the implementation on the end user with perhaps some templates to to help guide them. That way end users don't have to wait for me to figure out how applying Fire damage to a Water creature might work, etc.

I think the hurdle here is that I'm a fairly weak javascript coder and so it's not clear to me how this can be done. If you have ideas about how this could be done I'll be very happy to take a shot and implementing it on this end to free up folks like yourself who would like to use it this way.