mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6669] [MERGED] feat(game): re-throws, spend limits off the sheet, and sheet modifiers on checks #7280
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#7280
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/6669
Author: @kolacheee
Created: 9/25/2026
Status: ✅ Merged
Merged: 9/25/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-rerolls-spends📝 Commits (4)
3dc8ffcfeat(game): re-throws, spend limits off the sheet, and sheet modifiers on checks268d4c2fix(game): read a saved check's re-throw back into its resultdc4b2a6Merge remote-tracking branch 'origin/staging' into feat/ruleset-rerolls-spends3d28541Merge remote-tracking branch 'origin/staging' into feat/ruleset-rerolls-spends📊 Changes
37 files changed (+1435 additions, -52 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+36 -0)📝
docs/examples/rulesets/ember-roads.json(+19 -0)📝
docs/examples/rulesets/gravewatch.json(+2 -1)📝
docs/extending/ruleset.schema.json(+257 -4)📝
docs/extending/writing-rulesets.md(+26 -6)📝
docs/game/dice-and-skill-checks.md(+3 -1)📝
packages/client/src/components/dice/AnimatedSkillCheckResult.tsx(+14 -0)📝
packages/client/src/components/game/GameSurface.tsx(+1 -0)📝
packages/client/src/hooks/use-game.ts(+1 -0)📝
packages/client/src/lib/ruleset-resolution.ts(+8 -0)📝
packages/client/src/localization/locales/en.json(+4 -0)📝
packages/server/src/routes/game.routes.ts(+3 -1)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+15 -0)📝
packages/server/src/services/game/gm-prompts.ts(+45 -1)📝
packages/server/src/services/game/one-request-dice.ts(+1 -0)📝
packages/server/src/services/game/skill-check-resolution.service.ts(+105 -7)📝
packages/shared/src/features/rulesets/sheet-math.ts(+30 -0)📝
packages/shared/src/schemas/capability-package.schema.ts(+8 -1)📝
packages/shared/src/schemas/ruleset.schema.ts(+73 -9)...and 17 more files
📄 Description
Linked issue
Closes #6652
Why this change
The author of Marinara-RPG-Extension wrote two of their shipped tabletop systems as
ruleset.jsonfiles. Three everyday rules about what a check may buy still had to be left to the Game Master, who forgets them or gets the numbers wrong:bonus=on every check.This is slice 2 of the series in the plan doc (§ Gaps a ruleset author found). Slice 1 was #6663.
What changed
Capability API 1.38 (file keys:
resolution.reroll,resolution.adjust, a spend'sreroll, aperCheckthat is a value reference or"pool", and up to four spends). None of it names one game's words.resolution.rerolllists up to six, each{ id, upTo, mode }on a pool ruleset. The Game Master names one withreroll="id"(matched without case; an unknown name is ignored), and none is thrown unasked.upTois held below the die's sides, anduntilstops at the Engine's existing hundred re-throws per check. The record saysreroll="id"only when that re-throw was the one thrown and it threw something.untilbeatsoncewhere they reach the same. The issue did not say what happens when two apply. Throwing the same dice again twice over is not a rule the format needs, and the wider one is never worse for the player.perCheckmay be a number, a value reference, or"pool": the check's own dice, meaning the sheet's number for it before a wound, bonus dice or a modifier. So a hurt character may still buy as many as their rating gives. It is worked out for whoever rolls, rounded down and held between 0 and 100, and a limit of nothing buys and pays nothing. Up to four spends, still one per pool.resolution.adjust(up to eight, both kinds) adds a value off the sheet to every check that rolls with one of itsabilities, or to every check when it names none: a skill or save through its own ability orwith=, an ability check, or a pair that includes it. It goes where the wound penalty goes (dice on a pool under the same floor, a flat number inside a sum's modifier). The record writesadjust="-2"and reads it back, the dice card has a line for it, and a summed record the Game Master wrote itself is only kept when its modifier includes it. A stranger gets none, the same way they get no modifier.reroll=is offered, with each id and its faces, only where the ruleset has one. A spend's line says a re-throw it buys and where its limit comes from ("as many times per check as the check has dice", "as the sheet's Nerve"). Differs from the issue on purpose: the issue asked for the resolved cap, but one reminder serves every character a check may name withwho=, and each has their own number, so the line says where it comes from instead.reroll=: the generated-turn resolver, the sparse rewrite of an ask it could not roll, the sighted pool's bound request, the one-request branch arm, the skill-check endpoint and the client fallback that calls it.skill-check-roll-metastyle) and a rules-summary line per standing re-throw in the import review and sheet screens. New strings are localized inen.json.docs/extending/writing-rulesets.md, including its out-of-scope paragraph, which said a spend could never buy a re-roll), player page (docs/game/dice-and-skill-checks.md), the regenerated JSON Schema (its spend refinement now accepts a re-throw), the plan doc's slice 2 notes, CHANGELOG. Gravewatch ships acarefulre-throw (six or less, once); Ember Roads ships aburdenfield, turned negative by a derived value and taken off every Brawn roll.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on the branch (based on current
staging), all exit 0:pnpm check,pnpm localization:check,pnpm regression:node(378/378),pnpm ruleset:schema(no diff after regeneration). Local CodeRabbit, two passes: the first found two, both fixed (the reminder fell back to "a number on the sheet" for a limit read through a field that names an ability; the standing re-throw repeated the bought one's shape instead of reusing it), and the second pass on the full branch found nothing.scripts/regressions/game-ruleset-rerolls-spends.regression.tscovers the report's own numbers through the roller (1, 1, 9, 3 with sevens and under thrown again), every rule through the resolver, the sparse rewrite, the sighted pool, the branch arm and the real/api/game/skill-checkroute, the reminder, every import refusal and the 1.38 gate. Twenty-seven deliberate breaks of the new code were each caught; one more (dropping the "a limit of nothing buys nothing" guard) is equivalent, because the sheet op already refuses a spend of zero.Still to verify by hand (not done by the agent):
[skill_check: skill="Ward" dc="2" reroll="careful"]: confirm the dice card and the saved check showrerolled=andreroll="careful"when a die was thrown again, and neither when none was.carefulre-throw.reroll="id": careful (dice showing 6 or less, once)."spend": [{ "pool": "...", "amount": 1, "successes": 1, "perCheck": "pool" }]and spend more than the check has dice: confirm only as many successes as dice are bought and paid for.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/dice-and-skill-checks.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. The client changes are one optional line on the dice card, reusing the wound-penalty line's existing style, and new lines in the rules summary; see the manual steps above.
Summary by CodeRabbit
New Features
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.