tposney / midi-qol

Other
5 stars 0 forks source link

[Feature Suggestion] distiguish flags.midi-qol.optional.Name.damage between magic/non-magic #679

Open tposney opened 2 years ago

tposney commented 2 years ago

In GitLab by @tesira on Feb 4, 2022, 22:00

It would be nice, if I could add flags.midi-qol.optional.bardicinspiration.damage only for magic damage/healing. There is a trait for bards called "Magic Inspiration" which lets you add the dice to that as well, but only for magic stuff. Text is like this:

"If a creature has a Bardic Inspiration die from you and casts a spell that restores hit points or deals damage, the creature can roll that die and choose a target affected by the spell. Add the number rolled as a bonus to the hit points regained or the damage dealt. The Bardic Inspiration die is then lost."

I managed to add it in general and that works fine for now, but it would be nice to remove that option from trigger happy warriors. :-)

Not sure if this is even possible and the system can distinguish between magic and non magic damage/healing in a programmatical way.

tposney commented 2 years ago

You can now do flags.midi-qol.optional.Name.damage.rsak
flags.midi-qol.optional.Name.damage.msak So you can do damage bonus on spell attacks. It won't trigger on other/utility spells but it's a start.

tposney commented 2 years ago

In GitLab by @tesira on Feb 15, 2022, 22:39

works nicely, thanks for that! So I am waiting patiently that you put it into DamageOnlyWorkflow as well, because that is where I need it. An I just testing that "healing" doesn't seem to be in the .rsak column, so I better go with .all for now.

Thanks for doing it in any case!

tposney commented 2 years ago

It should be working for damageOnlyWorkflow now. I confess I've not tested it, but it should be calling the bonus check if an actor is passed to the workflow.

tposney commented 2 years ago

In GitLab by @tesira on Feb 16, 2022, 04:04

.all works in DamageOnly, .rsak does not. Looks a bit funny though, but works. image

tposney commented 2 years ago

The test for .rsak etc is based on the item's action type.

So if the action type is healing it won't get processed. I supposed I could add another action type healing.

The second, .rsak not working for Damage only workflow is working as written. Damage only workflows don't have a action type (no item required) - they are damage only workflows.

So I wonder what the right behaviour is in case that the workflow does not have an associated action type

  1. match every possible damage.all/rsak
  2. only match .all since rsak !== undefined (current behaviour)
  3. Inherit the action type from the passed item if there is one (via the itemData optional argument) otherwise 2.

I'm inclined to the third option

tposney commented 2 years ago

In GitLab by @tesira on Feb 16, 2022, 20:02

Option 3 sounds good to me as well and should work for my case. Also having a new flags.midi-qol.optional.Name.healing sounds as the right choice as well.

tposney commented 2 years ago

The healing type (for actionType) is implemented in 0.9.14. It's flags.midi-qol.optional.NAME.damage.heal I had a look at the code and I think option 3 is already implemented in 0.9.14. Can you post the json of the item (and macros that cause the damageOnlyWorkflow) and I'll have a look.

tposney commented 2 years ago

Option 3 should already be working provided you include the item data when calling DamageOnlyWorkflow