Skip to content

feat: the 5e character sheet, as a ruleset module (slice 27) - #28

Merged
dannyclarkdev merged 3 commits into
mainfrom
feat/character-sheet-slice-27
Sep 13, 2026
Merged

dannyclarkdev merged 3 commits into
mainfrom
feat/character-sheet-slice-27

Conversation

@dannyclarkdev

Copy link
Copy Markdown
Owner

What

Slice 27 of the P3 queue, the last of the four: the full 5e character sheet as a ruleset module.

  • Ruleset::hasCharacterSheet() is the seam, beside hasCompendium(). Characters\Sheet aborts without it, the character page does not mount the card, and the API sets the relation only on such a campaign.
  • character_sheets: one row per character in its own table. Six ability scores, saving throw and skill proficiencies with expertise, hit points with temporary, hit die and dice spent, spell slots per level, spellcasting ability, armour class and speed. The three lists and the slots are JSON on the row.
  • Support\Sheets\FifthEdition: the maths, pure and unit-tested. Modifiers, the proficiency bonus from the level, save and skill bonuses, passive Perception, initiative, and the long rest's hit dice. Nothing derived is ever stored.
  • The card: reading, one form for every field validated against the bounds, damage that comes off temporary hit points first, healing that stops at the maximum, and "Long rest". Written by a GM or the character's player through EntityPolicy::update(); read by whoever may read the character. The party's pack from the ledger and the compendium's attribution sit under it.
  • The round trip: nested under the character as sheet, the reader refusing a score outside the bounds, the vault page printing the numbers, and sheet on the API show route with the derived numbers beside the stored ones.
  • The demo world has Wren's rogue and Halder's cleric, the cleric with slots half spent.

Checks

  • 34 new tests, 24 of them unit tests on the maths. Full suite: 1476 tests, 1475 passing, 1 skipped. Larastan and Pint clean.
  • Browser pass from both seats, recorded in docs/plans/2026-09-13-feat-character-sheet-plan.md.

character_sheets is one row per character in its own table, behind
Ruleset::hasCharacterSheet(), so one ruleset's shape never reaches the core
entities table and a system-agnostic campaign never sees the card. Only what
a player decides is stored: the six scores, saving throw and skill
proficiencies with expertise, hit points, the hit die and how many are
spent, spell slots, armour class and speed. Every modifier, the proficiency
bonus, every save and skill bonus, passive Perception and initiative are
computed from the scores and the character's level on every read, in
Support\Sheets\FifthEdition, which is pure and unit-tested.

The card on the character's page reads for whoever may read the character
and writes for whoever may edit it, EntityPolicy::update()'s rule: one form
for every field, damage that comes off temporary hit points first, healing
that stops at the maximum, and a long rest as the SRD states it. The party's
pack from the ledger sits under it, and the compendium's attribution too,
because the ability and skill names are SRD terms.

The sheet travels nested under its character in the export, the reader
refuses a score outside the bounds, the vault page prints the numbers, and
the API show route carries it. The demo world has a rogue and a cleric.
@dannyclarkdev
dannyclarkdev merged commit 1784cee into main Sep 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant