mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6419] [MERGED] feat(game): what one turn of a ruleset fight can do: several strikes, a second damage clause, abilities that change the economy, riders (real combat C5a) #7173
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#7173
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/6419
Author: @kolacheee
Created: 9/20/2026
Status: ✅ Merged
Merged: 9/20/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/ruleset-combat-economy📝 Commits (10+)
ab0ddedfeat(game): a ruleset blow may carry a second damage clause5798bcbfeat(game): several strikes for one budget, and abilities that change the turn's economy5b4fc46feat(game): riders, the extra damage a qualifying hit carries on its own4cbf8ecfeat(game): save rolls, resistance to everything and source-bound conditionsa0aca22feat(game): capability API 1.29, and both examples using what it addsf220d90test(game): pin what one turn of a ruleset fight can dobdc5ad9docs(game): what one turn of a ruleset fight can do1282c8ffix(client): the catalog line names the rider kindd11c85etest(game): an action's save covers the clauses that asked for none, and a walk between strikes5f00454feat(game): a ruleset can say which saves a dodge helps, and an entry's own damage type is held to the names its clauses are📊 Changes
39 files changed (+5238 additions, -370 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
docs/development/game-combat-rulesets-implementation.md(+7 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+45 -1)📝
docs/development/optional-agent-packages.md(+36 -0)📝
docs/development/ruleset-5e-2014.example.json(+565 -88)📝
docs/examples/rulesets/ember-roads.json(+605 -108)📝
docs/extending/ruleset.schema.json(+538 -3)📝
docs/extending/writing-rulesets.md(+138 -10)📝
docs/game/combat.md(+2 -0)📝
e2e/atlas-cloud-options.e2e.ts(+16 -6)📝
packages/client/src/lib/ruleset-catalog.ts(+67 -1)📝
packages/client/src/lib/ruleset-combat-log.ts(+21 -0)📝
packages/client/src/lib/ruleset-combat-menu.ts(+6 -0)📝
packages/client/src/localization/locales/en.json(+17 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+91 -0)📝
packages/server/src/services/game/ruleset-combat-director.service.ts(+2 -2)📝
packages/shared/src/features/ruleset-combat/creatures.ts(+148 -11)📝
packages/shared/src/features/ruleset-combat/dice.ts(+19 -0)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+263 -36)📝
packages/shared/src/features/ruleset-combat/grid.ts(+18 -2)...and 19 more files
📄 Description
Linked issue
Part of #6361 (real ruleset combat: what one turn can do) and of #6314, the two arc issues a maintainer sweep already closed while the work continued; this slice neither reopens nor closes them. Builds on #6397 and #6406, both merged.
Why this change
What changed
Capability API 1.29, everything additive and optional.
mechanics.plus[]on a catalog entry anddamage.plus[]on a creature action, at most three, each{ dice?, flat?, type?, save? }. Each clause rolls and is typed on its own, so resistance and immunity apply per clause; a critical doubles every clause's dice by the ruleset's own rule; a clause may ask the target for its own saving throw, and the action's save-for-half covers the clauses that ask for none. One concentration check for the whole blow with the summed damage, and one check for going down. Forecasts, the threat clamp and the measured damage per round all count the clauses.combat.attacks[].strikes, a value reference, so a constant and a sheet number both work. The first strike spends the budget and puts the rest in hand; while any are in hand every row of that list is offered free and says how many are left. Different weapons, different targets and a walk between strikes fall out of the menu with no special case, and the rest are dropped at the end of the turn that bought them.mechanics.free(costs no budget),mechanics.gives[](hands budgets back now, capped so nothing banks) andmechanics.standard { actions, budget }(its holder may take those standard actions for that budget, offered beside the ordinary ones asstandard:<id>@<budget>).rider, andriders[]on a creature block: passive, never on the menu, adding one more clause to the first qualifying hit of a turn or a round, with its own event. It can be narrowed to named attack lists, to a column on the row, and to the roll having had advantage or an ally standing beside the target.own-saves-advantageandown-saves-disadvantage, narrowed by a newsaveslist;resist-all;cannot-target-sourceandcannot-approach-source; pluswhileSourceInSightandendsWhenSourceDownon the condition itself.combat.standardEffects.dodge.savesnames the saves a dodger rolls twice, keeping the better, for as long as the dodge lasts. It is its own block rather than a change tocombat.standard, which every shipped ruleset already writes as a list of names.strikes, an ability that hands an action back, one that buys standard actions with the bonus budget, a rider, creatures with clauses, the completed conditions and the dodge saves. Ember Roads gains a knack that gives a second act and a hound whose bite carries a second clause, which is all a small system needs to prove none of it is required.docs/development/optional-agent-packages.md(1.29), the plan, the generated JSON Schema,CHANGELOG.md.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Commands run locally by the agent:
pnpm check(exit 0), which includespnpm localization:check, lint and the client regression lane's typecheck; the full node regression lane (pnpm regression:node), which passed 333 of 333 twice on this branch; on the last run, with three jobs sharing this machine,image-dimension-limit.regression.tstimed out at 30s and the lane read 332 of 333. It passes on its own in under a second, it is untouched by this branch, and CI has passed it on every slice of this arc; andpnpm ruleset:schemaregenerated through the package script after a shared rebuild.CodeRabbit was run locally against this branch's base thirteen times as it was built, each pass over the whole branch rather than the last commit. Every finding it raised was fixed here but one. The last passes found, in order: a menu that offered a granted standard action under an ability the resolution then refused to take it through; a condition forbidding somebody from getting nearer that was checked only where a walk would END, so a route could dip past them and come out the far side, and the board DREW that route; the stat-block clamp holding an action's damage type and each of its clauses to the ruleset's declared names but not a rider's; the catalog picker showing nothing at all for four of the keys this slice adds; and then that picker line dropping a damage clause's OWN saving throw, which is a different throw from the action's and the only thing between the target and that part of the blow. The thirteenth returned nothing over all 38 files. Each is a case in the suite, and each was proven by reverting the fix alone and watching that case fail.
One finding was declined, and the reason is here rather than only in a thread: it asked for
"hide"to be dropped from the 5e example's Quick Hands as a standard action with no implemented effect. It has one, atpackages/shared/src/features/ruleset-combat/resolve.ts, where taking it sets the actor's hidden flag that the new sight gate reads; the example declareshidein its owncombat.standardlist; and SRD 5.1 Cunning Action grants Dash, Disengage and Hide, so removing it would have made the example wrong about the rule it is quoting.A fight that declares none of this behaves exactly as it did, and that is proven twice rather than asserted. In-suite, the same scripted fight is played on the shipped 5e example and on a copy stripped of every new key and compared event for event and cursor for cursor. And against the OLD code: the shared package and the example were extracted from the commit this branch started at, both builds were imported into one process, and the same fight played on each gave 19 identical events at the same cursor. Every case that uses a new key fails against that old code by construction, because the old schema is strict and refuses the document outright.
Not verified: none of it on screen. The menu's new cost lines ("Free, 2 strikes left"), the new log lines and the picker's new summary words are proven by the client regression lane, its drift guard (which asks for a line per event) and the picker regression, but no browser was opened. The Game Master's own picker reads the menu generically and its regressions pass, so it plays a three-strike turn legally, but whether it plays one WELL is unmeasured.
Still to verify by hand:
whenlist and a clause's own save are enough for the thing you had in mind.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/extending/writing-rulesets.md,docs/development/optional-agent-packages.md,docs/development/game-combat-rulesets-implementation.md,docs/development/game-rulesets-and-sheets-implementation.md, both examples and the generated schema. The[docs-i18n]follow-up for this arc is #6401, which already lists every page this slice touches.UI evidence (if applicable)
None: this slice adds no new screen. The menu gains a cost line, the log gains three event lines and the catalog picker's existing summary line gains words for the new keys, all through the existing components.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.