-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat(advancement): add basic advancement #202
Conversation
These changes are complete but require a slight change to the templates so I'm leaving this as draft until #200 is merged |
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 start.
I like some of the clever array magic you've done and keeping track of the grants for each level probably gives us a bit more control I think, but part of me wonders if we only need to keep the relevant tiers in the advancement rule config? And a lot of the stats can be derived with math formula rather than loops.
My approach still wouldn't be easily resilient to the ability bonus issue I mention in my other comment mind
startLevel: number, | ||
endLevel: number, | ||
): (AdvancementRuleConfig & { level: number })[] { | ||
// Swap the levels if the end level is lower than the start level |
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 guess this is to allow for undo-ing/down-levelling type actions?
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.
Essentially, these utils came over from the full character builder prototype which needed to know what was lost if the level ever was lowered.
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.
Yeah, that's fair. I don't have an issue with it being here. might as well stay, as I think we'll definitely need that later.
Maybe add a comment for others for 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 second putting in a framework for undo-ing levels. When we get to more complete advancement later that auto-adds stuff like items and skills we definitely want a way to go back if a mistake is made (without manually tracking all the changes)
The reason I've gone for an array with each of the grants per level is that it allows for full configuration. I'd originally set it up to use formulas, however that locks advancement down on a system level which is awkward for homebrew and ultimately gives the same result. |
I can accept that. I'm not sure how many things will want to mess around with core advancement like this (outside of a very distant chance of some 3rd Party release for Plotweaver) but my main issue was the amount of manual maintenance it might need, however it's not an ungodly amount more than the minimum required and it's unlikely to change much from a system PoV, so if we can get a bit more flexibility out of it I'm for it. |
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 start, I would definitely look at the styling and templates post the #200 merge before considering merging this, we don't want anything to explode
{{#if isEditMode}} | ||
<input type="number" | ||
name="system.level", | ||
value="{{actor.system.level}}" | ||
min="1" | ||
step="1" | ||
> | ||
{{else}} | ||
<span class="value">{{actor.system.level}}</span> | ||
{{/if}} |
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've been using input elements with a readonly tag (only applied if not in edit mode) instead of swapping between an input and a span in the 0.3.0 sheet refactor. It allows for more consistent styling without needing to style 2 different things. Also do note this needs to follow the new "sheet-stack" block format I've been using to align properly. You can take a look at how it is setup once that is merged
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.
E.g. the document-name in the header:
<h1 class="document-name">
<input class="value" type="text" name="name" value="{{actor.name}}" {{#unless isEditMode}}readonly{{/unless}}>
</h1>
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've been using input elements with a readonly tag (only applied if not in edit mode) instead of swapping between an input and a span in the 0.3.0 sheet refactor. It allows for more consistent styling without needing to style 2 different things. Also do note this needs to follow the new "sheet-stack" block format I've been using to align properly. You can take a look at how it is setup once that is merged
The read-only approach is also more accessible for what it's worth
startLevel: number, | ||
endLevel: number, | ||
): (AdvancementRuleConfig & { level: number })[] { | ||
// Swap the levels if the end level is lower than the start level |
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 second putting in a framework for undo-ing levels. When we get to more complete advancement later that auto-adds stuff like items and skills we definitely want a way to go back if a mistake is made (without manually tracking all the changes)
Type
What type of pull request is this? (e.g., Bug fix, Feature, Refactor, etc.)
Description
This PR adds the basics of advancement: Level is editable through an input, health & max skill ranks are derived from level/advancement rules. Other than including the value in the character data model
maxSkillRanks
is currently unused.Related Issue
Partially addresses #70
How Has This Been Tested?
Screenshots (if applicable)
Checklist: