mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6372] [MERGED] feat(game): a combat block for rulesets and the pure resolver behind it (real ruleset combat, slice 1) #7154
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#7154
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/6372
Author: @kolacheee
Created: 9/19/2026
Status: ✅ Merged
Merged: 9/19/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-core📝 Commits (10+)
b3b0c8ffeat(rulesets): a combat block and the mechanics a fight reads9626ae7feat(game): a pure resolver for ruleset combat9174902feat(rulesets): a combat block in both example rulesets2a6d8d7feat(packages): capability api 1.26 for ruleset combat188a99dtest(game): pin ruleset combat on the 5e examplef49ccfbtest(game): pin ruleset combat on the 2d6 example tooacd8b38test(packages): pin the 1.26 install gate for ruleset combat3ea5840docs(rulesets): record real ruleset combat and its first slice8ee90b1test(game): drop an unused helper from the combat regressionf7daafadocs(game): measure the 5e example's threat tiers from the SRD creatures📊 Changes
22 files changed (+5996 additions, -84 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/development/game-combat-rulesets-implementation.md(+40 -28)📝
docs/development/game-rulesets-and-sheets-implementation.md(+90 -1)📝
docs/development/optional-agent-packages.md(+27 -0)📝
docs/development/ruleset-5e-2014.example.json(+212 -0)📝
docs/examples/rulesets/ember-roads.json(+53 -5)📝
docs/extending/ruleset.schema.json(+1116 -0)📝
docs/extending/writing-rulesets.md(+175 -5)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+24 -0)➕
packages/shared/src/features/ruleset-combat/encounter.ts(+605 -0)➕
packages/shared/src/features/ruleset-combat/index.ts(+51 -0)➕
packages/shared/src/features/ruleset-combat/options.ts(+259 -0)➕
packages/shared/src/features/ruleset-combat/resolve.ts(+914 -0)➕
packages/shared/src/features/ruleset-combat/types.ts(+350 -0)📝
packages/shared/src/index.ts(+1 -0)📝
packages/shared/src/schemas/capability-package.schema.ts(+9 -1)📝
packages/shared/src/schemas/ruleset.schema.ts(+480 -28)📝
scripts/generate-ruleset-schema.mjs(+13 -0)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+5 -5)📝
scripts/regressions/game-ruleset-catalogs.regression.ts(+21 -8)...and 2 more files
📄 Description
Linked issue
Part of #6361 (real ruleset combat, slice C1 of 5; it does not close the issue) and of #6314. Builds on #6370 (layers, merged).
Why this change
What changed
combatblock inruleset.json, kindattack-vs-defense: the health pool, a defense value reference, initiative, the attack roll (dice, advantage, what the extreme faces do, how a critical hit grows), the action economy (named budgets that refill on the holder's own turn or each round, and a movement reference), which sheet lists are attacks and which are abilities, the standard actions, the sheet's own conditions mapped onto a closed list of effects, concentration, dying, damage types, and a threat tier table for later slices. Everything is cross-checked against the sheet it names.mechanicsgrows, additively:targetCount,autoHit,applies(conditions with a duration and an optional save to end them),temporary,scales(an amount that grows with a sheet value) andbudget. An entry that asks for a save in a list whose abilities source declares no save difficulty is refused, because a save against nothing always succeeds.packages/shared/src/features/ruleset-combat/:createRulesetEncounter,rulesetCombatOptions(the legal menu for whoever's turn it is, with costs checked against the live sheet and a forecast),applyRulesetCombatChoice,advanceRulesetTurn,rulesetEncounterOutcome,rulesetEncounterSummary. It never throws, takes an injected seeded roller, and its state is plain JSON. A party member reads their numbers off the sheet and writes throughapplyRulesetSheetOp, so a fight can never do to a sheet what the sheet's own rules would refuse. Every event carries the dice as they fell, the modifier, the total and what it was compared with.ac,speed, the derivedinitiative,spell_attackandspell_save_dc, the death save tracks, the concentration text), with a threat table measured from the SRD creatures in the Open5e data (CC-BY-4.0) rather than copied from any table. Ember Roads gets a 2d6 block, so the non-d20 case is real.docs/development/optional-agent-packages.md, the generated schema.game-ruleset-combat-core: scripted dice on the 5e example and on Ember Roads, asserting the events' numbers, plus a JSON round trip mid-fight.Not in this slice, and said in the guide: positions, ranges, movement, reactions, multiattack and recharge, enemy AI, anything a player can click.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Commands run locally by the agent:
pnpm check(exit 0),pnpm localization:check, the full node regression lane (pnpm regression:node, 327 of 327), and the new regression. Six complete local CodeRabbit sweeps were run before opening (1, 1, 1, 3, 2 and 0 findings), and every finding was fixed; several were real rules: natural results for the dying roll need a single die, becoming stable clears both counts and a blow while stable opens a new one, a save always has something to be rolled against, a reaction comes back on the holder's own turn, and the blow that takes somebody down ends their concentration without a roll. There is no UI and no route in this slice, so there is nothing to click and no e2e surface; no existing battle path is touched.Still to verify by hand:
combatblock against the SRD: the condition effects it maps, the dying rule, concentration, and the threat table (measured from the SRD creatures of each challenge rating; the comment in the file says how).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/game-combat-rulesets-implementation.md, the plan,docs/development/optional-agent-packages.md, both example rulesets and the generated schema. The[docs-i18n]follow-up is batched for the ruleset series.UI evidence (if applicable)
None: this slice has no UI.
Summary by CodeRabbit
New Features
Documentation
Compatibility
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.