-
Notifications
You must be signed in to change notification settings - Fork 182
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
Revise item usage and consumption #2400
Revise item usage and consumption #2400
Conversation
fe4e036
to
dd0115d
Compare
…krbz999/dnd5e into item-usage-and-scale-non-spells
- factor out ability use warnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good changes here, thank you for taking on this refactor. I think you've managed to streamline the logic and make the pipeline a lot easier to follow (at least for me). I have some suggestions for your consideration that we can discuss.
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
using null and bools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I caught a couple more things on re-review, but otherwise this looks pretty much there. I will try for a faster turn around on any comments/changes here. Apologies for the delay.
fix erroneous upcasting not looking for spell slot
fix lingering variable
The function
Item5e#_getUsageConfig
returns an object of what an item is able to do:The function
Item5e#_getUsageConfigValues
returns an object that depends on_getUsageConfig
to determine what an item, by default, will do. This is the object that can be modified directly inItem5e#use
. This also includesslotLevel
, which is now always a string.Whether an item then needs configuration is determined by if any of the default values are
true
(they are by defaulttrue
if the item is able to fulfill their function).If none are true, a prompt will not be forced. Any boxes that are possible but overridden to be
false
by default will still appear in theAbilityUseDialog
, but unchecked; if the prompt is skipped (options.configureDialog
beingfalse
) the initial values are used (possibly partially overridden).Also added two properties in
item.system.uses
anditem.system.target
for #2463 which function withgetUsageConfigValues
.