RedReign / FoundryVTT-BetterRolls5e

A module for modifying certain sheet functions on Foundry VTT Character sheets for D&D 5th Edition.
GNU General Public License v3.0
37 stars 67 forks source link

Damage types for applying damage with Chat Card Buttons #314

Open xanstin opened 3 years ago

xanstin commented 3 years ago

I noticed with Better Rolls enabled using the chat damage buttons it doesn't pass damage types for MidiQoL/DAE using resistances and immunities. Is that expected or is something else I have causing a problem?

cs96and commented 3 years ago

This would also be handy for the Damage Log module, which I am the author of.

Currently, I am monkey patching BetterRollsChatCard.prototype.applyDamage so that I can extract the damage type. If the damage type was somehow passed through to the preUpdateActor hook, I wouln't have to do this hackery :)

CarlosFdez commented 3 years ago

I noticed recently in 5e that there are messages when damage is applied. Are those messages applied by applying damage through some process? I think implementing them has a chance of making it easier to pass damage types downstream.

cs96and commented 3 years ago

There is nothing in core foundry or the dnd5e system that does this. My Damage Log module monitors for actors' HP changing via the preUpdateActor hook, and then pops a message into a separate tab in the chat log. The damage can be applied directly on the character sheet, via the token HUD, or via the better rolls damage buttons.

If Better Rolls could somehow supply thepreUpdateActor hook with the damage type, then it would avoid some hackery in the Damage Log codebase. Also I think MidiQoL looks for specific damage types so it can apply resistances etc, but I don't know where it looks for it (I don't use MidiQoL myself). But if you can make it work for Midi, then I can probably get to the damage type the same way. I suspect it's via some flags somewhere.