-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
cs and cf with default comparison. A way to add default values in the modifier class. #288
Conversation
…` and `cf` have defaults now.
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 really like this, thanks! A much better way of handling it than what I was doing. Thanks for this 😄
I've left a few minor comments. And another thing is just to make sure that the doc block descriptions describe the what the methods do, as they're used to auto-generate the API docs.
Small fixes for the default values handling code
@GreenImp Updated and added tests. Let me know, if you'll spot anything else. |
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.
Looks great! Thanks so much for working on this
@parnas this has just gone out in v5.5.0. Thanks for you help 😃
The docs have been updated, and the inbuilt roller should also be working without compare points for |
Modifier.js now calls the
ensureParameters
function duringrun
, which checks if there is adefaults
function in the current modifier. And processes it in the "variable name: variable value" loop.Additionally, in ComparisonModifier.js there is an additional simplification for the classes that extend it, and that only have default compare point definition (which is the only use case at the moment):
Additionally (or, rather, this is how it is started), I've added default values to Critical Success and Critical Failure modifiers. So now it is possible to do just
1d20cscf
(instead of1d20cs=20cf=1
).No tests yet, but, of course, I'll add them if the approach gets approved.