mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6706] [MERGED] feat(game): live states and the numbers that follow them; the combat picker walks round a wall #7294
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#7294
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/6706
Author: @kolacheee
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-live-states📝 Commits (1)
3854dd4feat(game): live states and the numbers that follow them; the combat picker walks round a wall📊 Changes
33 files changed (+1722 additions, -47 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+49 -4)📝
docs/examples/rulesets/ember-roads.json(+25 -2)📝
docs/examples/rulesets/gravewatch.json(+32 -2)📝
docs/extending/ruleset.schema.json(+339 -1)📝
docs/extending/writing-rulesets.md(+50 -5)📝
docs/game/party-and-npcs.md(+3 -2)➕
e2e/ruleset-live-states.e2e.ts(+97 -0)📝
packages/client/src/components/game/GameRulesetSheet.tsx(+25 -0)📝
packages/client/src/localization/locales/en.json(+3 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+22 -0)📝
packages/server/src/services/game/gm-prompts.ts(+14 -0)📝
packages/server/src/services/game/ruleset-combat-director.service.ts(+7 -4)📝
packages/shared/src/features/ruleset-combat/grid.ts(+50 -0)📝
packages/shared/src/features/ruleset-combat/index.ts(+1 -0)📝
packages/shared/src/features/rulesets/live-state.ts(+81 -1)📝
packages/shared/src/features/rulesets/sheet-math.ts(+18 -5)📝
packages/shared/src/features/rulesets/sheet-prompt.ts(+4 -0)📝
packages/shared/src/schemas/capability-package.schema.ts(+6 -1)📝
packages/shared/src/schemas/ruleset.schema.ts(+130 -6)...and 13 more files
📄 Description
Linked issue
Closes #6656
Closes #6678
Why this change
#6656. The author of Marinara-RPG-Extension wrote two of their shipped tabletop systems as
ruleset.jsonfiles. An enum field is chosen when a character is made and no sheet command changes it, and a condition is only on or off. So a shapeshifter's form, a frenzy, a stance or how lit a lantern is could not be said: each is one value out of a closed set that changes in play, and numbers hang off it (one form adds to Strength). This is slice 6, the last of the series in the plan doc (§ Gaps a ruleset author found). Slices 1 to 5 were #6663, #6669, #6682, #6689 and #6704.#6678, folded in on the maintainer's request. The browser case for a positioned Ember Roads fight sometimes ended without an outcome after 80 AI turns, on staging and on unrelated PRs. Replaying that fight in node across 2000 seeds showed it was a stall rather than a long fight. About one seed in seventy-five froze for good: the two fighters stood two squares apart with mountains and water between them. The AI's closing move only walked to a square that was closer in a straight line, and every such square was impassable, so neither ever moved, although a route round existed.
What changed
Capability API 1.42 (file keys:
statesin the live section, theenumTablederived op, and a rest step'sstate). None of it names one game's words.sheet.live.states: up to twelve, each with two to fortyvalues, optionalvalueLabels, adefault(else the first value) andhideWhen. Values follow the rule every label follows and never hold a double quote, because the command quotes them. Stored sparse (only when away from the default); a stored value the state no longer offers reads as the default; a hidden state is not on the sheet.[sheet: who="Name" op="state" state="Form" value="Crinos"], naming the state by id or label and the value by itself or its label, refused with the new reasonsunknown-stateandunknown-value. The tag'sstate=names the state on this op and still means on or off on a condition. The Game Master's sheet block always says each state's value, its default included, because a form is a fact the narration needs every turn. The reminder adds the command and aStates:line listing every value, only when the ruleset has a state. The game's sheet screen shows a picker per state. New strings are localized inen.json.enumTablegives a number for each value of an enum field or a live state, with adefaultfor the rest. Differs from the issue on purpose: the issue keyed it{ "state": … }; it is{ "liveState": … }, because every read of the live state is namedlive(liveTrack,livePool), which is how an author and the import tell what a maximum cannot use. A field's table is build-only and may feed a maximum. A state's table is a live read, refused wherever a live read is, directly or through another derived value. It reaches the dice through slice 2'sadjust, limited to an ability. A layer may remove a field value a table has a row for; the row is just never read while the layer is on.state, withtoset to"default"or one of its values.toon any other step is still"max","min"or a number.tobelongs only to a state.rulesetWalkingDistancesin the shared grid module, using the same steps, terrain costs and corner rule a walk pays. Reach and range stay straight-line, and on open ground the choice is the same as before. Across the same 2000 seeds every fight now ends, the longest in seven turns.docs/extending/writing-rulesets.md, a new "Live states" section plus the sheet, modifiers, rests and Game Master text parts), player page (docs/game/party-and-npcs.md), the regenerated JSON Schema, the plan doc's slice 6 notes (and a correction to slice 5's, which still described the settled-ask guard as living inisEngineRollableSkillCheckTag), CHANGELOG. Ember Roads gains a Stance (Guarded, Steady, Reckless) that adds -1 or +2 to Brawn rolls and that making camp settles. Gravewatch gains a Light (Lit, Shuttered, Out) that costs one or two Nerve dice and that standing down from the vigil relights, plus a table on itswatchfield that gives a dawn warden one more Resolve. Both defaults read 0, so no existing number moves.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on
3854dd48e(this branch's one commit on stagingd427f4a67), all exit 0:pnpm check,pnpm localization:check,pnpm version:check,pnpm regression:node(400/400),pnpm ruleset:schema(no diff after regeneration),pnpm smoke:ui(7/7), andpnpm regression:ui e2e/ruleset-live-states.e2e.ts e2e/ruleset-sheet-sections.e2e.ts e2e/ruleset-wound-sheet.e2e.ts e2e/game-combat-director.e2e.ts --project=desktop-chromium --workers=1(11/11: the new state picker case in light and dark, the sections and wound sheets, and the ruleset fights, including the positioned Ember Roads case #6678 was about). Mobile projects were not run locally. Local CodeRabbit, two completed passes: two findings, both fixed (the published schema now says an enum table's one source and row count, and that a word in a rest step'stobelongs only to a state); the second pass was clean.New lane
scripts/regressions/game-ruleset-live-states.regression.tscovers:adjustreaching a real check;Thirty-one deliberate breaks were each caught.
scripts/regressions/ruleset-combat-director.regression.tsgains a hand-drawn ridge between two fighters, with a route round to the south. It checks that no straight-line-closer square is reachable, then plays the fight to the end. Without the fix it still stands after 200 rounds.New browser case
e2e/ruleset-live-states.e2e.tspicks Reckless on the game's sheet in light and dark mode. It checks that exactly{ states: { stance: "reckless" } }is stored, then that Make camp puts it back to Steady with nothing stored.game-ruleset-json-schemapins the two new schema rules. Older-gate lanes strip the 1.42 keys, and the lifecycle lane follows the new version.Not executed: validating the examples against the published JSON Schema with a real validator, because none is installed here. I checked by hand that every rest step and table in both examples satisfies the two new rules.
Still to verify by hand (not done by the agent):
[sheet: op="state" state="Stance" value="Guarded"]: confirm the Stance picker follows. Then have it writevalue="Frantic"and confirm the refusal notice says that state has no such value.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.jsondocs/examples/rulesets/gravewatch.jsondocs/examples/rulesets/ember-roads.jsondocs/development/game-rulesets-and-sheets-implementation.md(internal plan)CHANGELOG.mdTranslations are batched into one
[docs-i18n]issue after the last ruleset slice, by the maintainer's standing decision, so no per-PR issue is opened here.UI evidence (if applicable)
None attached. The new browser case saves a full-page screenshot of the sheet with the Stance picker set to Reckless, in each theme. The manual steps above cover mobile width.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.