mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6386] [MERGED] feat(game): a ruleset fight is played on screen, in the ruleset's own words (real combat C3b, client half) #7159
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#7159
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/6386
Author: @kolacheee
Created: 9/19/2026
Status: ✅ Merged
Merged: 9/19/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-screen📝 Commits (10+)
3baa009feat(game): a ruleset fight reports whether a member is stable, its own round, and an opponent's ruleset terms3233357feat(game): the Classic shell plays a fight the ruleset resolves, on its menu and its log15447d4feat(game): the fight speaks the ruleset's own words, and setup says what battles will do203c706test(game): the screen's log, menu, picking, decision and recap are pinned on both example rulesets7d72dabtest(game): the browser lane plays a ruleset fight on an imported Ember Roads5a6807bfeat(game): the kind's own moves are named on screen instead of printing their ids34b80eedocs(game): the guide, the authoring notes, the plan and the handoff say a ruleset fight is on screen71bccc1fix(game): a ruleset fight's menu, status and log leave the stage its room on a wide screen and on a phone, and the log leaves budget counts to the status panel812d21dfix(game): autoplay does not repeat a refused step, the blueprint's ruleset terms are one shared type, and three tidies from review983d99cfix(game): the fold follows the breakpoint, focus follows a new step rather than every pick, and the ruleset e2e cleans up after an early failure📊 Changes
32 files changed (+2593 additions, -106 deletions)
View changed files
📝
CHANGELOG.md(+4 -3)📝
docs/development/game-combat-rulesets-implementation.md(+5 -2)📝
docs/development/game-rulesets-and-sheets-implementation.md(+50 -0)📝
docs/development/optional-agent-packages.md(+6 -5)📝
docs/development/ruleset-5e-2014.example.json(+2 -2)📝
docs/examples/rulesets/ember-roads.json(+2 -2)📝
docs/extending/writing-rulesets.md(+20 -12)📝
docs/game/getting-started.md(+3 -1)📝
e2e/game-combat-director.e2e.ts(+217 -0)📝
packages/client/src/components/agents/RulesetImportReviewModal.tsx(+7 -3)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+15 -0)📝
packages/client/src/components/game/DirectedCombatUI.tsx(+66 -27)📝
packages/client/src/components/game/GameCombatUI.tsx(+38 -5)📝
packages/client/src/components/game/GameSetupRulesChooser.tsx(+21 -9)📝
packages/client/src/components/game/GameSurface.tsx(+64 -11)➕
packages/client/src/components/game/RulesetCombatMenu.tsx(+294 -0)➕
packages/client/src/components/game/RulesetCombatStatus.tsx(+223 -0)📝
packages/client/src/features/chat-settings/sections/CombatStyleSection.tsx(+15 -1)📝
packages/client/src/hooks/use-directed-combat.ts(+64 -14)📝
packages/client/src/lib/ruleset-combat-bridge.ts(+61 -0)...and 12 more files
📄 Description
Linked issue
Part of #6361 (real ruleset combat, slice C3b of the arc: the client half of the playable fight; it does not close the issue) and of #6314. Builds on #6382 (the director's
rulesetstyle, merged).Why this change
combatfights its battles by that ruleset, in its own words and with its own arithmetic on show.What changed
combat, and there is a combat anchor. Otherwise nothing changes. The player's Classic or Tactical preference is kept and not used for such a game, and the chat settings say so in one line. The battle bridge steps aside ONLY then (no seeding from the sheet at the start, no write-back at the end, because the server already wrote every accepted step); a ruleset withbattleand nocombat, or a game without the director, keeps the bridge exactly as it was.DirectedCombatUI, driven through an additivedirected.rulesetpart; every Classic path is unchanged when it is absent.continueat a time with a short pause, so the log reads turn by turn; a refusal is a localized toast per code and never repeats itself; therulesetLivethat rides on each answer goes straight into the game state store, so the in-game sheet is right the moment a blow lands, with no refetch and no second write.combat, elsebattle, else the preference), not from the self-declared flag. Both example rulesets declarecombat, so theircoverage.combatis now true.RulesetEncounterSummary.party[].stable,CombatSummary.ruleset, one sharedRulesetEncounterBlueprint(creature,tier,proposed) carried from the encounter blueprint to/start, and the director now reports the fight's own round.docs/game/getting-started.md, the authoring guide (an "On screen" section; "Not yet" shrinks to positions, reactions and signature windows),docs/development/optional-agent-packages.md, the plan, the combat handoff's status header,CHANGELOG.md(the earlier unreleased combat entries no longer say nothing is playable).ruleset-combat-screen-clientin the client regression lane (every log line on both rulesets through the real English catalog, menu grouping, target picking, the five "is this a ruleset fight" combinations, the bridge stepping aside only then, the recap from a real summary) and a third mode ine2e/game-combat-director.e2e.tsthat imports Ember Roads through the real route, plays a turn from the menu, asserts the log line with its arithmetic, plays the fight out and reads the sheet afterwards.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Commands run locally by the agent on the final tree:
pnpm check(exit 0), which includespnpm localization:check, lint with the client regression lane's typecheck, and the e2e typecheck; the full node regression lane (pnpm regression:node, 331 of 331); and the new client regression. Four complete local CodeRabbit sweeps were run before opening (5, 4, 2 and 0 findings). The real ones: autoplay re-sentcontinueevery pause after a refusal, which would have been a toast a second (it now remembers the refused revision until the fight moves); the turn order fold did not reopen when a window grew past the phone breakpoint; the menu pulled keyboard focus back to the first button on every target pick; the new e2e mode did not clean up its imported ruleset after an early failure; and the unreleased changelog, the authoring guide and the package notes still said nothing was playable.What the agent drove for real, on a scratch Engine (port 7820, fresh data folder, stopped afterwards): Ember Roads imported through the API, a game pinned to it, two sheets, a fight started with a bestiary creature and a tier-built one, and the fight played in the built-in browser at 1366x850 and at 375x812. Seen: the menu with its costs and forecasts, target picking offering only the two opponents, the opponents' turns arriving one at a time, a two-part sequence and a condition in the log with their arithmetic, a party member going down, the jackal killed from the menu, the defeat panel, and the recap message with "Juno: 0/13 Grit (down)" and the sheet row already holding Grit 0 for both. That pass found and fixed two things: the shell's bottom panel takes whatever height its content asks for, so the first menu (groups stacked) and a log that grew with the fight squeezed the stage until the two rows of portraits were drawn over each other, and on a phone left no stage at all (the menu now lays its groups side by side in a bounded box, the status sits beside the log on a wide screen, the log is its own scroll box pinned to the newest line, and on a phone the group names hide and the turn order folds away); and the log printed "X has 0 Action left." before every blow, which is the status panel's job.
Not verified: Playwright was not run locally (its browsers are not installed here), so the new e2e mode is typechecked and CI is what runs it; the upcast step and multi-target picking were never clicked (neither arose in the fights driven; both are pinned in the regression lane); a Game Master controlled boss on screen for a ruleset fight; light mode.
Still to verify by hand:
combatblock through the wizard and start a battle from play, with a real model writing the encounter, and confirm the opponents arrive from the bestiary or a tier.battleblock, behave exactly as before.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
CHANGELOG.md,docs/game/getting-started.md,docs/extending/writing-rulesets.md,docs/development/optional-agent-packages.md,docs/development/game-combat-rulesets-implementation.md, the plan and both example rulesets. The[docs-i18n]follow-up for the combat slices is batched into one issue at the end of the arc, as #6371 says.UI evidence (if applicable)
To be added by a human: the fight on a desktop and on a phone, the target picking step, and the defeat or victory panel. The agent's browser pass is described above; its pane cannot export screenshots into a PR.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.