[PR #8233] [MERGED] feat(rulesets): players choose their own symbol spends in symbol-pool fights #8198

Closed
opened 2026-10-25 04:04:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

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


📝 Commits (9)

  • 7f51b9c feat(rulesets): players choose their own symbol spends in symbol-pool fights
  • 8bbbb07 fix(rulesets): a spend chooser handed to the Engine mid-throw gets the Engine's pick
  • cb69672 test(rulesets): the menu leads with a spend window's spends
  • 00d0204 fix(rulesets): carry the spend choice only into a fight that can take it
  • ca76eab Merge staging into claude/project-thread-o9hpq2
  • 25f1a40 fix(rulesets): keep a spend carry pending until it lands, and skip a fight that is over
  • 08736a8 Merge staging into claude/project-thread-o9hpq2
  • 9563d41 fix(rulesets): retry a lost spend carry, and hold a refused one to its revision
  • 17bd6bf fix(rulesets): resend a lost spend carry only from a fresh view, and count only losses

📊 Changes

22 files changed (+975 additions, -47 deletions)

View changed files

📝 docs/extending/writing-rulesets.md (+6 -2)
📝 packages/client/src/components/game/DirectedCombatUI.tsx (+36 -2)
📝 packages/client/src/components/game/GameCombatUI.tsx (+30 -16)
📝 packages/client/src/components/game/RulesetCombatMenu.tsx (+6 -2)
📝 packages/client/src/components/game/RulesetCombatScreen.tsx (+5 -0)
➕ packages/client/src/components/game/RulesetSpendToggle.tsx (+61 -0)
📝 packages/client/src/components/game/RulesetTurnOrder.tsx (+7 -0)
📝 packages/client/src/hooks/use-directed-combat.ts (+18 -5)
📝 packages/client/src/lib/ruleset-combat-log.ts (+4 -1)
📝 packages/client/src/lib/ruleset-combat-menu.ts (+79 -5)
📝 packages/client/src/localization/locales/en.json (+7 -0)
📝 packages/server/src/routes/combat-director.routes.ts (+1 -0)
📝 packages/server/src/services/game/ruleset-combat-director.service.ts (+43 -0)
📝 packages/shared/src/features/combat-director.ts (+7 -1)
📝 packages/shared/src/features/ruleset-combat/encounter.ts (+45 -1)
📝 packages/shared/src/features/ruleset-combat/index.ts (+3 -0)
📝 packages/shared/src/features/ruleset-combat/options.ts (+55 -0)
📝 packages/shared/src/features/ruleset-combat/resolve.ts (+157 -5)
📝 packages/shared/src/features/ruleset-combat/symbols.ts (+64 -1)
📝 packages/shared/src/features/ruleset-combat/types.ts (+43 -4)

...and 2 more files

📄 Description

Linked issue

Closes #8232

Why this change

In a symbol-pool fight (Capability API 1.382) the Engine picks what every throw's leftover symbols buy, for players as well as for the AI. That keeps fights cheap, but a player who wants to spend their own advantage, triumph or threat had no way to. This adds that choice without changing the default.

What changed

  • New "Choose my own symbol spends" checkbox on the fight screen (in the turn order on a board, beside the AI controls otherwise). It shows only in a symbol-pool fight, is off by default, and is remembered in the browser for later fights.
  • While it is on, a throw that leaves a party member the player plays something to buy holds the fight in a new spend window, before anything is spent. The window lists:
    • each spend they can still afford, one copy per pick, asked again while there is more to buy;
    • "Let the Engine choose", which takes the Engine's pick for whatever is left;
    • "Spend nothing more", which keeps what they chose so far.
  • The attacker's side is asked first, then the target's, the same order the spends are bought in. A player's choice is held to the same rules as the Engine's: cost, max, when, and whether the spend would land.
  • The Engine still picks for everybody else: opponents, companions on AI, and anyone handed to the AI while their window is open. The AI's forecasts are unchanged.
  • Server: new director command { type: "spends", choose }. The view carries spends.choose, and a spend window carries window.spend (by, hit). The fight's askSpends follows whoever the player plays.
  • A log line for the new window, six English strings, and a docs paragraph in the symbol-pool section of docs/extending/writing-rulesets.md.
  • Rulesets need nothing new, so there is no Capability API bump.

Defaults chosen (easy to change in review):

  • An attack made inside another window (an opportunity attack) is never held, so the Engine picks for it, the same way its hit is never held for answers.
  • The checkbox applies to every party member the player plays, not to each one separately.

Validation

  • pnpm check parts run locally: shared, server and client typecheck; client eslint on the changed files; format:check; localization:check; impeccable:check
  • 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

  • game-ruleset-combat-symbol-pool.regression.ts now covers these cases:
    • the held throw and its menu;
    • picking one spend at a time;
    • passing;
    • the Engine's pick for the rest;
    • the target's side;
    • who is never asked;
    • the director command, the view, following controller changes, the Engine answering for a member handed to the AI mid-window, and the refusal outside a symbol fight.
  • ruleset-combat-screen-client.regression.ts covers the menu order and the Engine-pick label.
  • The combat lane (188/188) and the ruleset lane (282/282) pass locally.
  • I didn't click through it in a browser.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation): tracked on #7512
  • Version/release files updated (only if this PR includes a version bump)

🔄 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/8233 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-o9hpq2` --- ### 📝 Commits (9) - [`7f51b9c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7f51b9cb86c08f3a3863ec501025254ade9d87ba) feat(rulesets): players choose their own symbol spends in symbol-pool fights - [`8bbbb07`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8bbbb07f792a34413952d4707cd6722dfe36f5b6) fix(rulesets): a spend chooser handed to the Engine mid-throw gets the Engine's pick - [`cb69672`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cb696723fc02d0d9e171cc92d052f888473fa78a) test(rulesets): the menu leads with a spend window's spends - [`00d0204`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00d0204aaf4fdd3dad3efb72a7bf681ed33635c9) fix(rulesets): carry the spend choice only into a fight that can take it - [`ca76eab`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ca76eabd50e09a07df8ca69dfac315dc3d0de411) Merge staging into claude/project-thread-o9hpq2 - [`25f1a40`](https://github.com/Pasta-Devs/Marinara-Engine/commit/25f1a4065656611ad03fbda1e090424a3cb48018) fix(rulesets): keep a spend carry pending until it lands, and skip a fight that is over - [`08736a8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/08736a81020987b74aa693307a3fe2df2766be27) Merge staging into claude/project-thread-o9hpq2 - [`9563d41`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9563d413af9a5c5c42daffd3c429225ee774575d) fix(rulesets): retry a lost spend carry, and hold a refused one to its revision - [`17bd6bf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/17bd6bf396bcf4369a229deed82700f932983584) fix(rulesets): resend a lost spend carry only from a fresh view, and count only losses ### 📊 Changes **22 files changed** (+975 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `docs/extending/writing-rulesets.md` (+6 -2) 📝 `packages/client/src/components/game/DirectedCombatUI.tsx` (+36 -2) 📝 `packages/client/src/components/game/GameCombatUI.tsx` (+30 -16) 📝 `packages/client/src/components/game/RulesetCombatMenu.tsx` (+6 -2) 📝 `packages/client/src/components/game/RulesetCombatScreen.tsx` (+5 -0) ➕ `packages/client/src/components/game/RulesetSpendToggle.tsx` (+61 -0) 📝 `packages/client/src/components/game/RulesetTurnOrder.tsx` (+7 -0) 📝 `packages/client/src/hooks/use-directed-combat.ts` (+18 -5) 📝 `packages/client/src/lib/ruleset-combat-log.ts` (+4 -1) 📝 `packages/client/src/lib/ruleset-combat-menu.ts` (+79 -5) 📝 `packages/client/src/localization/locales/en.json` (+7 -0) 📝 `packages/server/src/routes/combat-director.routes.ts` (+1 -0) 📝 `packages/server/src/services/game/ruleset-combat-director.service.ts` (+43 -0) 📝 `packages/shared/src/features/combat-director.ts` (+7 -1) 📝 `packages/shared/src/features/ruleset-combat/encounter.ts` (+45 -1) 📝 `packages/shared/src/features/ruleset-combat/index.ts` (+3 -0) 📝 `packages/shared/src/features/ruleset-combat/options.ts` (+55 -0) 📝 `packages/shared/src/features/ruleset-combat/resolve.ts` (+157 -5) 📝 `packages/shared/src/features/ruleset-combat/symbols.ts` (+64 -1) 📝 `packages/shared/src/features/ruleset-combat/types.ts` (+43 -4) _...and 2 more files_ </details> ### 📄 Description ## Linked issue Closes #8232 ## Why this change In a symbol-pool fight (Capability API 1.382) the Engine picks what every throw's leftover symbols buy, for players as well as for the AI. That keeps fights cheap, but a player who wants to spend their own advantage, triumph or threat had no way to. This adds that choice without changing the default. ## What changed - New "Choose my own symbol spends" checkbox on the fight screen (in the turn order on a board, beside the AI controls otherwise). It shows only in a symbol-pool fight, is off by default, and is remembered in the browser for later fights. - While it is on, a throw that leaves a party member the player plays something to buy holds the fight in a new `spend` window, before anything is spent. The window lists: - each spend they can still afford, one copy per pick, asked again while there is more to buy; - "Let the Engine choose", which takes the Engine's pick for whatever is left; - "Spend nothing more", which keeps what they chose so far. - The attacker's side is asked first, then the target's, the same order the spends are bought in. A player's choice is held to the same rules as the Engine's: cost, `max`, `when`, and whether the spend would land. - The Engine still picks for everybody else: opponents, companions on AI, and anyone handed to the AI while their window is open. The AI's forecasts are unchanged. - Server: new director command `{ type: "spends", choose }`. The view carries `spends.choose`, and a spend window carries `window.spend` (`by`, `hit`). The fight's `askSpends` follows whoever the player plays. - A log line for the new window, six English strings, and a docs paragraph in the symbol-pool section of `docs/extending/writing-rulesets.md`. - Rulesets need nothing new, so there is no Capability API bump. Defaults chosen (easy to change in review): - An attack made inside another window (an opportunity attack) is never held, so the Engine picks for it, the same way its hit is never held for answers. - The checkbox applies to every party member the player plays, not to each one separately. ## Validation - [x] `pnpm check` parts run locally: shared, server and client typecheck; client eslint on the changed files; `format:check`; `localization:check`; `impeccable:check` - [ ] 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 - `game-ruleset-combat-symbol-pool.regression.ts` now covers these cases: - the held throw and its menu; - picking one spend at a time; - passing; - the Engine's pick for the rest; - the target's side; - who is never asked; - the director command, the view, following controller changes, the Engine answering for a member handed to the AI mid-window, and the refusal outside a symbol fight. - `ruleset-combat-screen-client.regression.ts` covers the menu order and the Engine-pick label. - The combat lane (188/188) and the ruleset lane (282/282) pass locally. - I didn't click through it in a browser. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation): tracked on #7512 - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-25 04:04:39 +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#8198
No description provided.