[PR #8503] [MERGED] Throw a symbol-pool ruleset's dice by name in the composer and roll_dice (part 4 of #8489) #8639

Closed
opened 2026-11-07 16:46:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8503
Author: @kolacheee
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @kolacheee

Base: staging ← Head: claude/project-thread-mhcusi


📝 Commits (2)

  • 481b2e3 Throw a symbol-pool ruleset's dice by name in the composer and roll_dice
  • f4b983f Tell the GM when symbol dice ignore its modifier or DC

📊 Changes

13 files changed (+546 additions, -58 deletions)

View changed files

📝 docs/extending/writing-rulesets.md (+1 -0)
📝 docs/game/dice-and-skill-checks.md (+6 -0)
📝 packages/client/src/components/dice/AnimatedDiceRoll.tsx (+88 -50)
📝 packages/client/src/components/game/GameInput.tsx (+11 -1)
📝 packages/client/src/lib/dice-roll-result.ts (+2 -0)
📝 packages/server/src/routes/game.routes.ts (+14 -5)
📝 packages/server/src/services/game/dice.service.ts (+31 -0)
📝 packages/server/src/services/tools/tool-executor.ts (+44 -1)
📝 packages/shared/src/features/function-calls/tools/roll-dice/manifest.ts (+2 -1)
➕ packages/shared/src/features/rulesets/symbol-dice-notation.ts (+163 -0)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/types/game.ts (+7 -0)
➕ scripts/regressions/ruleset-symbol-dice-notation.regression.ts (+176 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Part of #8489 (named dice in the plain rollers, item 2 of the plan in the issue comments). The issue stays open for the last step, ruleset combat on the shared roller.

Why this change

  • A game pinned to a symbol-pool ruleset (Capability API 1.141, Genesys-style dice) could only throw its dice through a skill check. The composer dice field and the GM's roll_dice tool still only took NdM, so a player or the GM could not just roll "2 ability 1 proficiency vs 2 difficulty" and see the symbols.

What changed

  • New shared parseSymbolDiceNotation / rollSymbolDiceNotation (packages/shared/src/features/rulesets/symbol-dice-notation.ts). It reads the ruleset's own dice by id or label in any case, with an optional plural "s", and separators of spaces, commas, +, vs and against. It counts and cancels symbols the same way as rollSymbolPoolCheck, and reports net successes and success against the ruleset's success.needed. sheet-math.ts is untouched, and a regression proves both give the same result for the same faces.
  • POST /game/dice/roll: plain NdM notation still goes through rollDice. Otherwise, in a game chat whose ruleset is symbol-pool, the notation is read as named dice and thrown with the shared secure roller. Anything else is still a 400.
  • roll_dice tool: the same fallback, reading the ruleset from the chat's metadata, with a short symbol summary in the tool text. The tool description now mentions named dice.
  • DiceRollResult gains optional thrown, symbolFaces, symbols and symbolLabels. isDiceRollResult and parseRollDiceToolResult accept them only when all four are present and well formed.
  • AnimatedDiceRoll shows a chip per die with its symbols and a footer with the net symbols and success or failure, reusing existing locale keys. The composer writes [dice: notation = symbols; success|failure] into the message.
  • No ruleset schema change and no new Capability API version: rulesets already declare their dice.
  • /roll is not part of this: slash commands only run in conversation and roleplay chats, which have no game ruleset.

Validation

  • pnpm check passes locally (server and client tsc, Prettier on the changed files, and the regressions below)
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Not run in a browser yet. Regressions run: new ruleset-symbol-dice-notation, plus dice-notation, game-ruleset-symbol-pool, game-dice-commands, game-mode-dice-tool, dice-display, extension-dice-formats and roleplay-commands.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed: docs/game/dice-and-skill-checks.md (new "Symbol dice by name" subsection) and docs/extending/writing-rulesets.md (one bullet in the symbol-pool section)
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened: added to #8499
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Not captured yet.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8503 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-mhcusi` --- ### 📝 Commits (2) - [`481b2e3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/481b2e33539c0bf9ae6f13c073cfffc07d956bd5) Throw a symbol-pool ruleset's dice by name in the composer and roll_dice - [`f4b983f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f4b983fbc89badd358e808e433cdf82203c7b5c8) Tell the GM when symbol dice ignore its modifier or DC ### 📊 Changes **13 files changed** (+546 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `docs/extending/writing-rulesets.md` (+1 -0) 📝 `docs/game/dice-and-skill-checks.md` (+6 -0) 📝 `packages/client/src/components/dice/AnimatedDiceRoll.tsx` (+88 -50) 📝 `packages/client/src/components/game/GameInput.tsx` (+11 -1) 📝 `packages/client/src/lib/dice-roll-result.ts` (+2 -0) 📝 `packages/server/src/routes/game.routes.ts` (+14 -5) 📝 `packages/server/src/services/game/dice.service.ts` (+31 -0) 📝 `packages/server/src/services/tools/tool-executor.ts` (+44 -1) 📝 `packages/shared/src/features/function-calls/tools/roll-dice/manifest.ts` (+2 -1) ➕ `packages/shared/src/features/rulesets/symbol-dice-notation.ts` (+163 -0) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/types/game.ts` (+7 -0) ➕ `scripts/regressions/ruleset-symbol-dice-notation.regression.ts` (+176 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Part of #8489 (named dice in the plain rollers, item 2 of the plan in the issue comments). The issue stays open for the last step, ruleset combat on the shared roller. ## Why this change - A game pinned to a symbol-pool ruleset (Capability API 1.141, Genesys-style dice) could only throw its dice through a skill check. The composer dice field and the GM's `roll_dice` tool still only took `NdM`, so a player or the GM could not just roll "2 ability 1 proficiency vs 2 difficulty" and see the symbols. ## What changed - New shared `parseSymbolDiceNotation` / `rollSymbolDiceNotation` (`packages/shared/src/features/rulesets/symbol-dice-notation.ts`). It reads the ruleset's own dice by id or label in any case, with an optional plural "s", and separators of spaces, commas, `+`, `vs` and `against`. It counts and cancels symbols the same way as `rollSymbolPoolCheck`, and reports net successes and success against the ruleset's `success.needed`. `sheet-math.ts` is untouched, and a regression proves both give the same result for the same faces. - `POST /game/dice/roll`: plain `NdM` notation still goes through `rollDice`. Otherwise, in a game chat whose ruleset is symbol-pool, the notation is read as named dice and thrown with the shared secure roller. Anything else is still a 400. - `roll_dice` tool: the same fallback, reading the ruleset from the chat's metadata, with a short symbol summary in the tool text. The tool description now mentions named dice. - `DiceRollResult` gains optional `thrown`, `symbolFaces`, `symbols` and `symbolLabels`. `isDiceRollResult` and `parseRollDiceToolResult` accept them only when all four are present and well formed. - `AnimatedDiceRoll` shows a chip per die with its symbols and a footer with the net symbols and success or failure, reusing existing locale keys. The composer writes `[dice: notation = symbols; success|failure]` into the message. - No ruleset schema change and no new Capability API version: rulesets already declare their dice. - `/roll` is not part of this: slash commands only run in conversation and roleplay chats, which have no game ruleset. ## Validation - [x] `pnpm check` passes locally (server and client `tsc`, Prettier on the changed files, and the regressions below) - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Not run in a browser yet. Regressions run: new `ruleset-symbol-dice-notation`, plus `dice-notation`, `game-ruleset-symbol-pool`, `game-dice-commands`, `game-mode-dice-tool`, `dice-display`, `extension-dice-formats` and `roleplay-commands`. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed: `docs/game/dice-and-skill-checks.md` (new "Symbol dice by name" subsection) and `docs/extending/writing-rulesets.md` (one bullet in the symbol-pool section) - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened: added to #8499 - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Not captured yet. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:46:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8639
No description provided.