-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a method to roll the hit die for a specific class, rather than a specific hit die denomination #1033
Comments
Originally in GitLab by @aaclayton I agree it makes sense to make more flexible. I can think of at least 3 modes of "I want to roll a hit die" that we should probably support:
|
I think the following signature would probably be a good approach: /**
* Roll a hit die of the appropriate type, gaining hit points equal to the die roll plus your CON modifier
*
* `options.classId` and `options.denomination` are mutually exclusive. If `options.classId` is defined, `options.denomination` will be ignored.
* If neither `options.classId` nor `options.denomination` are provided, this method selects the highest available hit dice denomination.
* @param {object} options
* @param {string} [options.classId] The id of the class item to draw hit dice from.
* @param {string} [options.denomination] The denomination of hit dice to roll.
* @param {boolean} [options.dialog] Show a dialog prompt for configuring the hit die roll?
* @returns {Promise<void>}
*/
async rollHitDie({ classId, denomination, dialog=true }) { |
Originally in GitLab by @aaclayton Looks good to me |
Originally in GitLab by @akrigline Assigning to %"D&D5E 1.3.0 - Level-up Experience" for now as it relates closely to !200 and #936 |
Should we try to gracefully deprecate this by determining if the first parameter is a string, and if so, showing a warning message and recovering? |
Originally in GitLab by @akrigline IMO we should make a new method |
Originally in GitLab by @zeel01 I'm having a hard time coming up with a situation where the class the hit die came from would be relevant. The size yes, we must be able to select the size, but if you have d10 from multiple classes, I'm not aware of any rule that would make which of the d10 relevant. In fact, I don't think there really is a distinction at all, it's just a pool. Similar to spell slots (except Warlock). Would it not be better for the UI to be simplified, and hide this concept of which class the die comes from from the user? It's understandable that the values are being tracked on the classes, but the user doesn't need to know/interface with this. |
Originally in GitLab by @aaclayton Given that we just made improvements to hit dice rolling and short rest dialog already in 1.3.0, should we just scrap this issue until we are clear that further changes are actually required? |
Originally in GitLab by @aaclayton Closing this issue as unnecessary. If anyone strongly disagrees please re-open. |
In working on #936 I've run into a counter-intuitive little bit of UX, which is that if an actor has two classes with the same hit die denomination and a user tries to use the "roll" button for the second class in the new configure hit dice window, it will deduct hit dice from the first class if that class has any hit dice available.
Steps to reproduce (requires the
936-edit-hit-dice
branch):Expected result: clicking the roll button for the Paladin class should deduct hit dice from the Paladin class item.
This isn't a huge deal since the actor still has the correct number of each denomination of hit dice, but it might result in an unexpected user experience.
Currently the configure hit dice window uses the
Actor5e#rollHitDie
method. I would propose an optional parameter to this method to specify theid
of the class item from which to deduct the hit die.The text was updated successfully, but these errors were encountered: