Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I wanted to implement the dnd5e Lucky feat for one of my players. I'm doing this using world scripts, and for midi-qol, it was relatively smooth sailing when I started to understand how both midi & foundry's APIs works.
For your module I had a harder time, since MTB provides no hook before commiting the roll to the request. Also, I need the hook to be async-based as I'm displaying a dialog box for the player to choose to use a lucky charge or not and another to choose the final roll.
This PR is the result of what I had to modify (tested only on the 1.0.68 version) to make it works. You'll see that I had to grab an helper method from midi-qol repository. I'm not sure what's the stance regarding this in the foundry community. It might be frown upon, but I don't know how to implement it any other way (or at all for that matter!). If you know any common method that's made to be used in every module let me know. Otherwise I'll open a ticket on midi-qol's repository asking for permission to use this snippet in this PR.
Also, please let me know if you want another name for the new hook.