feat: implement mechanical effects for hit dice and max HP modifications#8
Open
sjlevin wants to merge 2 commits intobitnook-cc:mainfrom
Open
feat: implement mechanical effects for hit dice and max HP modifications#8sjlevin wants to merge 2 commits intobitnook-cc:mainfrom
sjlevin wants to merge 2 commits intobitnook-cc:mainfrom
Conversation
Previously, features like Keeper of the Wild Heart's Impressive Form (+5 max HP, upgrade hit dice to d10) and Oozeling's Odd Constitution (increment hit dice one step) had no mechanical effect — they were description-only with empty traits arrays. Schema changes: - Add maxHpBonus, hitDieSizeOverride, hitDieSizeStep to stat bonus schema - Add signedFlexibleValueSchema for hitDiceBonus to support negative values - Add sizeOverride to hitDice schema for manual user overrides - Allow hitPoints.max below 1 to support overrides with feature bonuses Service layer: - Extend getHitDice() with override priority, feature overrides, and step logic - Add getMaxHp() computed method (min effective HP is always 1) - Update applyHealing, performSafeRest, performCatchBreath, performMakeCamp to use computed hit die size and max HP Data fixes: - Hunter Keeper of the Wild Heart: +5 max HP, hit die override to d10 - Oozeling/Construct Odd Constitution: hit die +1 step - Shadowmancer Fiendish Boon: -1 max hit dice UI updates: - All hit die size displays use computed value via getHitDice() - All max HP displays and caps use computed value via getMaxHp() - Hit dice edit form shows effective size with manual override support - Character config shows effective max HP with transparent base conversion - Add NumericInput component for commit-on-blur numeric field editing - Feature traits display shows new bonus types Includes 11 unit tests covering feature combinations, manual overrides, healing caps, and rest mechanics.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
|
@sjlevin is attempting to deploy a commit to the Martin's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug
Hunter Keeper of the Wild Heart's "Impressive Form" feature says "+5 max HP. Upgrade your Hit Dice to d10s." but had no mechanical effect — the traits array was empty. Same issue with Oozeling/Construct's "Odd Constitution" (hit dice +1 step) and Shadowmancer's "Fiendish Boon" (-1 max hit dice).
Changes
maxHpBonus,hitDieSizeOverride, andhitDieSizeStepto the stat bonus systemgetMaxHp()computed method following the existing pattern used bygetMaxWounds(),getArmorValue(), etc.getHitDice()to apply feature-based die size overrides and step incrementssizeOverridefield on hit dice for manual user overrides that take priority over all feature bonusesNumericInputcomponent to fix a UX issue where numeric config fields couldn't be cleared and retypedsignedFlexibleValueSchemaforhitDiceBonusto support negative values (Fiendish Boon's -1)How to test
Design notes
stat_bonuspattern with three new fields:hitDieSizeOverride(absolute, e.g. Wild Heart d10),hitDieSizeStep(relative, e.g. Oozeling +1 step), andmaxHpBonus(e.g. Wild Heart +5)sizeOverrideon the character that takes highest priority, bypassing all feature bonuseshitPoints.maxcan now be stored below 1 to support scenarios where a user manually sets effective max HP to 1 while feature bonuses exist (e.g. a curse).getMaxHp()enforces a floor of 1 on the effective value.Tests
11 unit tests covering: