mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6377] [MERGED] feat(game): ruleset bestiaries, creature actions and the threat clamp (real combat C2) #7155
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#7155
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/6377
Author: @kolacheee
Created: 9/19/2026
Status: ✅ Merged
Merged: 9/19/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-creatures📝 Commits (10+)
2cd8b2dfeat(rulesets): a catalog may hold creatures instead of rows6ff0ccefeat(game): a fight reads a bestiary, sequences, uses, recharge and signature pointsf04d92dfeat(packages): capability api 1.27 for ruleset bestiariesbc14668feat(rulesets): a bestiary in both example rulesets35c8114test(game): pin bestiaries, sequences, uses, recharge, points and the clamp8d798a3docs(rulesets): bestiary catalogs, the creature format and the threat clampe885508fix(game): the use command is offered for catalogs of rows, not for a bestiarye299945refactor(game): drop a redundant guard in the threat clampf36188atest(game): a bestiary is never fetched for a character sheetfa03b77fix(game): the clamp shrinks a die along real dice, and the client regressions read the optional feeds and rows📊 Changes
34 files changed (+3946 additions, -192 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+50 -2)📝
docs/development/optional-agent-packages.md(+28 -0)📝
docs/development/ruleset-5e-2014.example.json(+216 -0)📝
docs/examples/rulesets/ember-roads.json(+168 -1)📝
docs/extending/ruleset.schema.json(+515 -9)📝
docs/extending/writing-rulesets.md(+120 -9)📝
packages/client/src/components/rulesets/RulesetCatalogPicker.tsx(+1 -1)📝
packages/client/src/components/rulesets/RulesetSheetEditor.tsx(+3 -2)📝
packages/client/src/lib/ruleset-catalog.ts(+2 -2)📝
packages/client/src/lib/ruleset-combat-bridge.ts(+1 -1)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+20 -1)📝
packages/server/src/services/game/gm-prompts.ts(+4 -3)➕
packages/shared/src/features/ruleset-combat/creatures.ts(+437 -0)➕
packages/shared/src/features/ruleset-combat/dice.ts(+65 -0)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+68 -60)📝
packages/shared/src/features/ruleset-combat/index.ts(+17 -7)📝
packages/shared/src/features/ruleset-combat/options.ts(+128 -19)📝
packages/shared/src/features/ruleset-combat/resolve.ts(+186 -24)📝
packages/shared/src/features/ruleset-combat/types.ts(+84 -6)...and 14 more files
📄 Description
Linked issue
Part of #6361 (real ruleset combat, slice C2 of 5; it does not close the issue) and of #6314. Builds on #6372 (combat core, merged).
Why this change
combatblock and a resolver, but a fight's opponents were stat blocks somebody had to hand in. A real system comes with its own creatures, and they do things C1 could not say: strike several times in one action, breathe fire and wait for it to come back, use something a few times a day, act between other turns.What changed
"holds": "creatures"(default"rows"), and each of its entries carries acreaturestat block instead ofrows: never both, never neither, never mixed in one catalog. A bestiary needs nofeeds(and may not declare one, which is what keeps it out of the sheet editor's picker by construction), keepsfilters, and may live in an asset file under the same 1 MB and 2000 entry caps. It is only legal in a ruleset that has acombatblock.health(a number, or dice rolled when the fight is built, with the average used for forecasts),defense,speed,initiativeModifier,abilitiesandsaveskeyed by the sheet's own ids,resist/vulnerable/immune,conditionImmunities, atierfrom the ruleset's threat table,traits(short name and text pairs the Game Master is shown, never resolved),signaturePoints, and up to 12actions.uses(per encounter or per day),recharge(the creature rolls at the start of its turn and the action comes back onfromor higher; it starts available),sequence(other actions of the same block, each a number of times, for ONE budget: this is how a creature that attacks several times in one action is written, and a sequence may not name a sequence), andsignature(bought from a per-round pool that refills at the start of the creature's own turn and is never spendable on its own turn).createRulesetEncountertakes an enemy as{ creature: { catalogId, entryId } }from handed-in catalogs as well as an inline block, and rolls health dice with the encounter's roller. Sequences are one option on the menu (forecast: the sum of its parts) and resolve each strike with its own roll and its own target.usesandrechargeare tracked on the combatant and emit events carrying the dice.rulesetSignatureOptionslists and prices signature actions andapplyRulesetCombatChoiceresolves one for points instead of a budget; the WINDOW that offers them is slice C5.findRulesetCreaturefinds what a Game Master named: the exactcatalog/entry, then a label or id ignoring case and punctuation, then nothing, never fuzzier.clampRulesetStatBlockpulls a proposed block into a tier: health into the band, defense, to-hit and save difficulties to at most the tier's number plus 2, damage scaled down (dice count, then the flat part, then a strike off a sequence, then the die size along real dice) until the best round fits, unknown names dropped, at most 6 actions, and every change returned in plain words for a log line. Shipped bestiaries are never clamped.[sheet: op="use"]line is offered only when the ruleset has a catalog of rows, so a bestiary-only ruleset does not advertise a command that always refuses.docs/development/optional-agent-packages.md, the generated schema (which learns the rows-or-creature rule).game-ruleset-combat-creatures: schema refusals, health dice, lookup, a sequence spending one budget, uses running out, recharge on the right face and not below it, signature pricing and refusals, the clamp on each tier and on a block already in scale, the LISTED form of a ruleset, the 1.27 gate, and the sheet editor's catalog list ignoring a bestiary.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, 328 of 328), and the new regression. One complete local CodeRabbit sweep over all 33 changed files was run before opening and came back with no findings. The agent's own review before that changed one thing: when the clamp has to shrink a damage die it steps along dice a table owns (d12, d10, d8 ...) instead of answering with a d7, and the regression pins it.There is no UI and no route in this slice, so there is nothing to click and no e2e surface. The four client files it touches only gain a
?.becausefeedsbecame optional in the type.Still to verify by hand:
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, the plan,docs/development/optional-agent-packages.md, both example rulesets and the generated schema. 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)
None: this slice has no UI.
Summary by CodeRabbit
New Features
Compatibility
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.