Repository navigation
Add 4d6 drop lowest and maximum first-level hit points as house rules - #346
Merged
Merged
Conversation
…e rules
The new names are stubs with defaults and their final docstrings: `Ruleset.ability_score_method`
("3d6" or "4d6_drop_lowest") and `Ruleset.max_hp_at_first_level`, the `method` keyword of
`roll_ability_scores`, `AbilityScoreRolls.dropped`, and `HitPointRoll.maximized` (#341). The
`Ruleset` docstrings and the ruleset options guide name house rules as a third kind of flag, which
the SRD doesn't print and `Ruleset()` leaves off.
examples/rulesets/creation_house_rules.json is a ruleset document with both house rules on and
every other field written out at its default, with a README beside it, and the guide includes the
file through pymdownx.snippets.
tests/test_creation_house_rules.py marks the behaviour tests xfail until the creation-house-rules
chunk lands. Its unmarked tests pin that the 3d6 method and the default options draw and give what
osrlib 2.8.0 did, and that a save and a creation result that 2.8.0 wrote, kept under tests/saves/,
still load. The roll_hit_points example's output comments show the new field. No golden file
changes.
Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
…leset asks roll_ability_scores takes its method keyword: "3d6" rolls as before, and "4d6_drop_lowest" throws four d6 per ability, drops the first of the lowest, and records that die in AbilityScoreRolls.dropped. It refuses an unknown method before its first draw. create_character passes Ruleset.ability_score_method as the method. roll_hit_points throws the same dice whatever max_hp_at_first_level says, and with the flag on counts the hit die's size instead of the last die and sets HitPointRoll.maximized, so the starting gold roll after it is unchanged. With both house rules at their defaults every draw and result is what 2.8.0 gave. No golden file changes. The changelog bullet for #341 goes under Unreleased, Added. Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
…ations register The adaptations register gains house rules as a third kind of entry and a House rules section with one entry for ability_score_method and one for max_hp_at_first_level, each citing the tests that lock it. The spec's Ruleset flag list and its rules-scope lines for ability scores and first-level hit points name the two flags, and the RNG streams page says the ability scores take 18 creation draws with 3d6 and 24 with 4d6 drop lowest (#341). Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
The acceptance tests of the character creation house rules now run as ordinary tests. The review flagged an em dash and an en dash on two spec lines this branch rewrote, and an ambiguous sentence in the ruleset guide. Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
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.
Closes #341.
Adds two house rules for first-level character creation. Both are off by default, so
Ruleset()is still the SRD as written.Ruleset.ability_score_methodis"3d6"(the default) or"4d6_drop_lowest".roll_ability_scorestakes the same choice as itsmethodkeyword. On a 4d6 roll,AbilityScoreRolls.rollsstays the three dice that count, in the order thrown, and the newAbilityScoreRolls.droppedgives the die left out for each ability.Ruleset.max_hp_at_first_levelcounts the first-level hit die as its maximum.roll_hit_pointsthrows the same dice as with it off, so the starting gold roll that follows doesn't change, and the newHitPointRoll.maximizedsays the maximum was taken.examples/rulesets/creation_house_rules.jsonis an example ruleset with both rules on and everyRulesetfield written out, for a front end to copy. The ruleset options guide includes the file itself, anddocs/adaptations.mdrecords both rules as house rules that the SRD doesn't print.NPC adventurers keep 3d6 whatever the ruleset says, and
level_upis unchanged. Every new field has a default, so a 2.8.0 save, ruleset, and roll result still parse, andSCHEMA_VERSIONstays 4.How it was checked
The acceptance tests in
tests/test_creation_house_rules.pywere written before the implementation by a different agent. An independent review compared the branch with osrlib 2.8.0 over 4,200 cases (7 classes, 300 seeds, both reroll settings): with the defaults the results are byte-identical, and with the maximum on every draw is identical. Ten mutations of the rolling code were all caught by the tests.https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3