mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6682] [MERGED] feat(game): sheet values that read play, list sums, caps and wider hide rules #7284
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6682
Author: @kolacheee
Created: 9/25/2026
Status: ✅ Merged
Merged: 9/25/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-sheet-reads📝 Commits (4)
a528fcafeat(game): sheet values that read play, list sums, caps and wider hide rules590331dfix(game): a scaled column cannot add itself up; say a live limit as a number6f7c093fix(game): a scaled column reads no list sum1996900fix(game): a notEquals or in value must fit its field's range and length📊 Changes
30 files changed (+3321 additions, -234 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+41 -0)📝
docs/examples/rulesets/ember-roads.json(+31 -13)📝
docs/examples/rulesets/gravewatch.json(+34 -2)📝
docs/extending/ruleset.schema.json(+2011 -135)📝
docs/extending/writing-rulesets.md(+12 -4)📝
docs/game/party-and-npcs.md(+2 -0)📝
packages/client/src/components/game/GameRulesetSheet.tsx(+3 -1)📝
packages/client/src/components/rulesets/RulesetSheetEditor.tsx(+6 -2)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+41 -0)📝
packages/server/src/services/game/gm-prompts.ts(+13 -0)📝
packages/server/src/services/game/skill-check-resolution.service.ts(+6 -4)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+4 -2)📝
packages/shared/src/features/rulesets/live-state.ts(+13 -0)📝
packages/shared/src/features/rulesets/sheet-math.ts(+121 -15)📝
packages/shared/src/features/rulesets/sheet-prompt.ts(+1 -1)📝
packages/shared/src/schemas/capability-package.schema.ts(+7 -1)📝
packages/shared/src/schemas/ruleset.schema.ts(+261 -31)📝
scripts/generate-ruleset-schema.mjs(+25 -0)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+4 -4)...and 10 more files
📄 Description
Linked issue
Closes #6653
Why this change
The author of Marinara-RPG-Extension wrote two of their shipped tabletop systems as
ruleset.jsonfiles. A sheet's calculated values could only read the build, so three kinds of everyday rule ended up as hand-typed fields that drift the moment play moves on:hideWhentook one value. A file with three or more kinds of character could not say "hide unless the kind is this one".This is slice 3 of the series in the plan doc (§ Gaps a ruleset author found). Slices 1 and 2 were #6663 and #6669.
What changed
Capability API 1.39 (file keys:
liveTrackwithread,livePoolandlistSumin any value reference,capon skills and saves, andnotEquals/inonhideWhen). None of it names one game's words.{ "liveTrack": "harm", "read": "remaining" }(value,filled,remaining, or on a wound trackpenalty), or what is left in a pool,{ "livePool": "resolve" }. A hidden one reads 0. They read the live state as it stands when a check is rolled, a fight begins or the Game Master's sheet block is written, and where there is none (the sheet editor, an import review) the state play starts in. Named differently from the issue on purpose: the issue proposed{ "track": … }and{ "pool": … }, but the combat block already uses exactly those shapes for its health and energy, so the install gate and every reader would have had to guess which was meant. "live" also says why a maximum cannot use one.cap, the most its check may come to. The sheet shows and every check rolls the capped number, and awith=swap is worked out on the number before the cap and capped again. A cap reads no skill or save, nor does any derived value up to the one it reads (the proficiency bonus's existing rule), so the sheet is still worked out in one pass.{ "listSum": { "list": "gear", "column": "bulk", "onlyWhen": "packed" } }adds a number column over the rows a boolean column marks. An empty cell is its column's default and a hidden list adds nothing. It reads only the build, so even a maximum may use it.hideWhentakes exactly one ofequals,notEqualsorin, each value checked against the field one at a time, and a layer cannot remove any value one of them compares with. A rule now reads the value the sheet editor shows: an unset field is the value a blank sheet starts with (an enum's first value, an unticked box), and an enum value the ruleset no longer offers is the field's default. This changes an edge case for existing files on purpose: before, an unset field without a default matched nothing, while the editor showed it holding its first value.evaluateRulesetSheet(definition, build, live?)takes the resolved live state, and the newevaluateRulesetSheetLive(definition, build, stored?)resolves it first. The check context, the Game Master's sheet block, the game's sheet screen, a fight's combatants and the sheet editor all use the live one. The evaluated sheet carries the live values it was worked out with, so a modifier off the sheet (adjust), a spend's limit and a fight's defense read the same snapshot.capis read only on skills and saves.docs/extending/writing-rulesets.md), player page (docs/game/party-and-npcs.md), the regenerated JSON Schema (with the one-comparison rule forhideWhenandreadkept besideliveTrack), the plan doc's slice 3 notes, CHANGELOG. Ember Roads' Burden is now the bulk of the gear a character has packed, with a step table turning it into the Brawn modifier slice 2 added (the typed-inburdenfield is gone). Gravewatch caps Soothe at the Resolve left, shows "Harm still to take" off the live track, and keeps lantern oil to the night watch withnotEquals.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on
a528fca04(this branch's one commit on staging54897c221), all exit 0:pnpm check,pnpm localization:check,pnpm regression:node(379/379),pnpm ruleset:schema(no diff after regeneration),pnpm smoke:ui(7/7), andpnpm regression:ui e2e/ruleset-wound-sheet.e2e.ts e2e/game-combat-director.e2e.ts --project=desktop-chromium --workers=1(6/6: the game sheet on Gravewatch in light and dark, and the ruleset fights on Ember Roads). Mobile projects were not run locally, since no layout changed. Local CodeRabbit, three passes: two findings, both fixed (the in-game sheet editor showed live values at their starting point instead of as they stand; a hide rule compared the raw stored value rather than the one the editor shows, whichnotEqualswould have made visible for an unset field), and the third pass found nothing.scripts/regressions/game-ruleset-sheet-reads.regression.tscovers every import refusal, every live read at its defaults and in play, caps with and without a swap, list sums, the three hide comparisons, the check context, a fight's combatant, the reminder and the 1.39 gate (a catalog file included). Forty deliberate breaks of the new code were each caught.Still to verify by hand (not done by the agent):
[skill_check: skill="Soothe" dc="1"]and confirm the dice card throws one die (plus any a 10 rolls again).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
docs/extending/writing-rulesets.md(not carried bydocs-i18n),docs/game/party-and-npcs.md(carried bydocs-i18n),docs/extending/ruleset.schema.json,docs/examples/rulesets/gravewatch.json,docs/examples/rulesets/ember-roads.json,docs/development/game-rulesets-and-sheets-implementation.md(internal plan),CHANGELOG.md. Translations are batched into one later pass by the maintainer's standing decision, so no per-PR[docs-i18n]issue is opened here.UI evidence (if applicable)
None captured. No component changed shape: the sheet screen and the sheet editor show the same values they always did, now worked out with the live state (or its starting point), and a hidden field disappears exactly as before. See the manual steps above.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.