mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6741] [MERGED] feat(game): initiative as a number attacks move, for pool fights #7307
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#7307
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/6741
Author: @kolacheee
Created: 9/27/2026
Status: ✅ Merged
Merged: 9/27/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-initiative-resource📝 Commits (7)
ab20230feat(game): initiative as a number attacks move, for pool fights7e736abfix(game): an attack keeps the style and the number it was made with89b1abafix(game): every fight end lifts crashes, and a moving number opens as a pool2f964b8Merge remote-tracking branch 'origin/staging' into feat/ruleset-combat-initiative-resource276f68fdocs(game): a combatant crashes at the ruleset's crash line, not at zero13261a7docs(game): a spending attack resets on a hit and costs the ruleset's loss on a miss9acda4aMerge remote-tracking branch 'origin/staging' into feat/ruleset-combat-initiative-resource📊 Changes
30 files changed (+2663 additions, -146 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+55 -2)📝
docs/extending/ruleset.schema.json(+299 -3)📝
docs/extending/writing-rulesets.md(+68 -6)📝
docs/game/combat.md(+1 -1)📝
e2e/game-combat-director.e2e.ts(+188 -0)📝
packages/client/src/components/game/DirectedCombatUI.tsx(+2 -0)📝
packages/client/src/components/game/RulesetCombatBoard.tsx(+4 -3)📝
packages/client/src/components/game/RulesetCombatMenu.tsx(+55 -10)📝
packages/client/src/components/game/RulesetCombatStatus.tsx(+7 -0)📝
packages/client/src/lib/ruleset-combat-log.ts(+76 -32)📝
packages/client/src/lib/ruleset-combat-menu.ts(+25 -2)📝
packages/client/src/localization/locales/en.json(+12 -0)📝
packages/server/src/routes/combat-director.routes.ts(+1 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+15 -0)📝
packages/server/src/services/game/ruleset-combat-director.service.ts(+120 -38)📝
packages/shared/src/features/combat-director.ts(+3 -0)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+88 -13)📝
packages/shared/src/features/ruleset-combat/index.ts(+1 -0)📝
packages/shared/src/features/ruleset-combat/options.ts(+39 -0)...and 10 more files
📄 Description
Linked issue
Closes #6740
Why this change
#6739 gave pool rulesets a fight of their own, with initiative as an order. The other half of the ruleset gap report's Storyteller item (W10) is initiative as a number that attacks move: a pool thrown at the start sets it, one way of attacking takes it from the target, another spends it as damage, and whoever runs out crashes. A ruleset could not describe any of that. This is the second and last Storyteller slice.
What changed
Capability API 1.48 (file keys:
initiative.pool,initiative.plusandinitiative.resource, all fordice-poolfights). None of it names one game's words.dicewithmodifier, orpoolwithplus: exactly one. A pool is thrown through the check roller, and its successes plusplusare the number. A creature'sinitiativeModifieris its pool.each: "round"with a pool throws the pool again.initiative.resource). The number is kept, never thrown again, and the order is sorted by it as each round begins.styles(one to four, at least one that takes) are the ways any attack may be made. Each attack is offered once per style, and a player picks the style before the target. The style is chosen beside the option (choice.style), so nothing that finds an action by its id changes.gain.base, or a miss costs whatonMiss(a step table) says.crash: the line, a condition of the ruleset's own, a bonus for whoever crashed somebody, and how many of their own turns before they recover tobase. A crash lifts when the number rises above the line, when the count runs out, and when the fight ends however it ends. Somebody who opens at the line starts crashed.rulesetcommand carrystyle. An unknown one is refused asunknown-style.en.jsononly.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on
7e736ab11(this branch's two commits on stagingc481ce37d), all exit 0:pnpm check(localization included),pnpm regression:node(408/408, the published schema's staleness check included),pnpm smoke:ui(7/7) andpnpm regression:ui e2e/game-combat-director.e2e.ts e2e/ruleset-wound-sheet.e2e.ts e2e/ruleset-live-states.e2e.ts --project=desktop-chromium --workers=1(10/10). The client build's warning that GameSurface is over 512 kB is staging's: that chunk is 514.66 kB on staging too.scripts/regressions/game-ruleset-combat-moving-initiative.regression.ts, on a Gravewatch variant with scripted dice, covers:scripts/regressions/ruleset-combat-director.regression.tsgains:e2e/game-combat-director.e2e.tsimports the variant, clicks Spade, picks Press in the style step, picks the target, and checks that the command carries the style and that the log line names it.Local CodeRabbit (
coderabbit review --agent --committed), two passes: 1 and 0 findings.Fixed one: the resolver read an attack's style again from its maker's number as the blow landed. So a held spending blow whose maker was crashed by an answer became a taking one, and the number it threw was read late. The style is now fixed when the attack is made and carried on the resume with that number. An action made of several only takes, and a ruleset needs at least one taking style.
Still to verify by hand (not done by the agent):
docs/examples/rulesets/gravewatch.jsonwith the "Initiative that attacks move" block from the author guide in itscombat.initiative(and areelinglive condition).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(carried bydocs-i18n)docs/game/combat.md(carried bydocs-i18n)docs/extending/ruleset.schema.json, regenerateddocs/development/game-rulesets-and-sheets-implementation.md(carried bydocs-i18n)CHANGELOG.mdTranslations for the ruleset arc are batched in #6742, which lists this PR's three translated pages with the earlier slices'.
UI evidence (if applicable)
The browser test saves a screenshot of the fight after a Press: the status panel with each combatant's initiative, and the log lines for the blow, the damage dice and both numbers.
Summary by CodeRabbit
New Features
Compatibility
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.