[PR #8622] [MERGED] Keep each party member's temperament for the whole game #8709

Closed
opened 2026-11-07 17:39:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: claude/project-thread-3xt87u


📝 Commits (3)

  • 8831000 Keep each party member's temperament for the whole game
  • 2413faa Find a fighter's game card by a variant of their name too
  • b51bbf7 Leave card-less fighters to their own draw, guide regenerated sheets

📊 Changes

10 files changed (+571 additions, -170 deletions)

View changed files

📝 packages/client/src/components/game/GameSurface.tsx (+11 -0)
📝 packages/client/src/lib/game-character-name-match.ts (+1 -134)
📝 packages/server/src/routes/encounter.routes.ts (+27 -1)
📝 packages/server/src/routes/game.routes.ts (+54 -33)
📝 packages/server/src/services/game/gm-prompts.ts (+24 -2)
➕ packages/server/src/services/game/party-temperament.service.ts (+95 -0)
📝 packages/shared/src/features/combat-ai.ts (+72 -0)
📝 packages/shared/src/index.ts (+1 -0)
➕ packages/shared/src/utils/game-character-name-match.ts (+137 -0)
➕ scripts/regressions/party-temperament.regression.ts (+149 -0)

📄 Description

Requested by Alyssa · project thread

Linked issue

None open. This is design groundwork for the Classic Marinara class overhaul, where a character's secondary class tree will come from their starting temperament.

Why this change

A player character's or companion's combat temperament was drawn again at the start of every fight (assignCombatTactics with a fresh seed, for the party as well as foes). Even a temperament the fight setup named won only about 40 to 46% of draws, so the same companion could fight Supportive in one battle and Reckless in the next. Party temperaments should stay the same across fights and change only for story reasons.

What changed

  • Kept on the game card. Each game card can carry temperament (the one they fight with) and temperamentInitial (the one they started the game with, which never changes and which the secondary class tree will read).
  • Read from the Description. The game setup prompt and the recruit card prompt now ask for temperament, read from the character's Description and personality, not from the class or the scene.
  • Used outright in every fight. A new aiHints.kept flag makes assignCombatTactics use the temperament as is, with no weighted draw. /encounter/init applies the card's temperament to every party member over the setup's hint. A card with none yet (older games, fallback cards) takes the hint this fight's setup read for them, or else one drawn once per game from the chat id and name (never cowardly, supportive or a named-only one), and writes it onto the card. The Classic [combat:] tag path does the same client-side. Enemies still roll each fight.
  • Story changes only. The session-end card review (both prompts) may change temperament only when the session clearly changed how the character fights. A card written back without one keeps its old one, an invalid one is ignored, and temperamentInitial is never rewritten. Regenerating a malformed sheet keeps the existing temperament.
  • Party temperaments. New COMBAT_PARTY_TEMPERAMENTS: the ten ordinary temperaments plus arrogant, cruel and honourable. Fanatical, territorial and hungry stay for foes.

Validation

  • pnpm check passes locally (I ran the server and shared lint, i.e. their typechecks, client tsc --noEmit, eslint on GameSurface.tsx, and prettier on the changed files, not the full pnpm 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

  • New scripts/regressions/party-temperament.regression.ts passes. It checks that a kept temperament wins over 400 seeds, that an enemy's hint still only leans, the allowed party set, that the fallback is stable, that session-end changes keep the initial temperament, and that a fight keeps card temperaments and writes new ones.
  • The 22 related regressions pass, including combat-ai, encounter-setup-json, prompt, game-ruleset-setup, ruleset-combat-director-route and game-ruleset-room-fight-players.
  • Not yet playtested in the app.

Docs and release impact

  • No docs changes needed

Generated by Claude Code


🔄 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/8622 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-3xt87u` --- ### 📝 Commits (3) - [`8831000`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8831000c8918eeabe61d21aa23b143398224ca4b) Keep each party member's temperament for the whole game - [`2413faa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2413faa9e37d3b970ad48e2bae2dc7f8470a3b66) Find a fighter's game card by a variant of their name too - [`b51bbf7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b51bbf7504ca7494ee288fb9291d6def0d30da43) Leave card-less fighters to their own draw, guide regenerated sheets ### 📊 Changes **10 files changed** (+571 additions, -170 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameSurface.tsx` (+11 -0) 📝 `packages/client/src/lib/game-character-name-match.ts` (+1 -134) 📝 `packages/server/src/routes/encounter.routes.ts` (+27 -1) 📝 `packages/server/src/routes/game.routes.ts` (+54 -33) 📝 `packages/server/src/services/game/gm-prompts.ts` (+24 -2) ➕ `packages/server/src/services/game/party-temperament.service.ts` (+95 -0) 📝 `packages/shared/src/features/combat-ai.ts` (+72 -0) 📝 `packages/shared/src/index.ts` (+1 -0) ➕ `packages/shared/src/utils/game-character-name-match.ts` (+137 -0) ➕ `scripts/regressions/party-temperament.regression.ts` (+149 -0) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"kolacheee"} --> _Requested by **Alyssa** · [project thread](https://claude.ai/code/project/chan_01EL1ysiLvjMZWconWVBEYwo?thread=cmsg_01EL1ysiLvjMZWconWVBEYwoG4UseZpUtRtxCe5xw2kwx5)_ ## Linked issue None open. This is design groundwork for the Classic Marinara class overhaul, where a character's secondary class tree will come from their starting temperament. ## Why this change A player character's or companion's combat temperament was drawn again at the start of every fight (`assignCombatTactics` with a fresh seed, for the party as well as foes). Even a temperament the fight setup named won only about 40 to 46% of draws, so the same companion could fight Supportive in one battle and Reckless in the next. Party temperaments should stay the same across fights and change only for story reasons. ## What changed - **Kept on the game card.** Each game card can carry `temperament` (the one they fight with) and `temperamentInitial` (the one they started the game with, which never changes and which the secondary class tree will read). - **Read from the Description.** The game setup prompt and the recruit card prompt now ask for `temperament`, read from the character's Description and personality, not from the class or the scene. - **Used outright in every fight.** A new `aiHints.kept` flag makes `assignCombatTactics` use the temperament as is, with no weighted draw. `/encounter/init` applies the card's temperament to every party member over the setup's hint. A card with none yet (older games, fallback cards) takes the hint this fight's setup read for them, or else one drawn once per game from the chat id and name (never cowardly, supportive or a named-only one), and writes it onto the card. The Classic `[combat:]` tag path does the same client-side. Enemies still roll each fight. - **Story changes only.** The session-end card review (both prompts) may change `temperament` only when the session clearly changed how the character fights. A card written back without one keeps its old one, an invalid one is ignored, and `temperamentInitial` is never rewritten. Regenerating a malformed sheet keeps the existing temperament. - **Party temperaments.** New `COMBAT_PARTY_TEMPERAMENTS`: the ten ordinary temperaments plus arrogant, cruel and honourable. Fanatical, territorial and hungry stay for foes. ## Validation - [ ] `pnpm check` passes locally (I ran the server and shared lint, i.e. their typechecks, client `tsc --noEmit`, eslint on `GameSurface.tsx`, and prettier on the changed files, not the full `pnpm 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 - New `scripts/regressions/party-temperament.regression.ts` passes. It checks that a kept temperament wins over 400 seeds, that an enemy's hint still only leans, the allowed party set, that the fallback is stable, that session-end changes keep the initial temperament, and that a fight keeps card temperaments and writes new ones. - The 22 related regressions pass, including combat-ai, encounter-setup-json, prompt, game-ruleset-setup, ruleset-combat-director-route and game-ruleset-room-fight-players. - Not yet playtested in the app. ## Docs and release impact - [x] No docs changes needed --- _Generated by [Claude Code](https://claude.ai/code/session_01F2Yga6iEvX7jtUs9vvFx3p)_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:07 +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#8709
No description provided.