[PR #7584] [MERGED] Rulesets: Game Master combat rules for 5e fights, part 1 #7815

Closed
opened 2026-10-24 04:07:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7584
Author: @kolacheee
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @kolacheee

Base: staging ← Head: feat/ruleset-gm-rules-1


📝 Commits (10+)

  • 4c1a993 Merge remote-tracking branch 'origin/feat/tactical-combat' into feat/combat-5e-rules
  • cf2eed9 feat(rulesets): spells and creature attacks carry what gets past a resistance (Capability API 1.96)
  • 142015d Merge remote-tracking branch 'origin/feat/ruleset-builder' into feat/combat-5e-rules
  • 6c846a8 Rulesets: creature attacks deal another amount two-handed or when hurt (Capability API 1.97)
  • 0025062 Rulesets: combatant sizes for grapples, and a hold's own escape DC (Capability API 1.98)
  • fb091cd Merge remote-tracking branch 'origin/feat/ruleset-builder' into feat/combat-5e-rules
  • 00f1f73 Rulesets: fly, swim, climb and burrow on the board (Capability API 1.108)
  • 0da58b6 Rulesets: name the proposed creature schema's type so the encounter blueprint stays writable
  • 801f8e6 Rulesets: fliers fly up and down on the board (Capability API 1.109)
  • ea0d319 Rulesets: exhaustion halves the health maximum and kills at its worst (Capability API 1.110)

📊 Changes

101 files changed (+44128 additions, -10456 deletions)

View changed files

📝 docs/extending/ruleset.schema.json (+17033 -9819)
📝 docs/extending/writing-rulesets.md (+662 -43)
📝 packages/client/src/components/game/DirectedCombatUI.tsx (+6 -1)
📝 packages/client/src/components/game/GameInventory.tsx (+40 -0)
📝 packages/client/src/components/game/GameRulesetSheet.tsx (+44 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+37 -0)
📝 packages/client/src/components/game/RulesetCombatBoard.tsx (+24 -5)
📝 packages/client/src/components/game/RulesetCombatMenu.tsx (+133 -37)
📝 packages/client/src/components/game/RulesetCombatStatus.tsx (+59 -2)
📝 packages/client/src/components/game/RulesetItemPicker.tsx (+152 -61)
📝 packages/client/src/lib/ruleset-catalog.ts (+155 -2)
📝 packages/client/src/lib/ruleset-combat-board.ts (+82 -2)
📝 packages/client/src/lib/ruleset-combat-log.ts (+125 -10)
📝 packages/client/src/lib/ruleset-combat-menu.ts (+35 -2)
📝 packages/client/src/localization/locales/en.json (+138 -0)
📝 packages/server/src/routes/combat-director.routes.ts (+5 -0)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+930 -0)
📝 packages/server/src/services/game/combat-boss.service.ts (+16 -1)
📝 packages/server/src/services/game/ruleset-combat-director.service.ts (+162 -12)
📝 packages/server/src/services/game/ruleset-package-file.ts (+17 -0)

...and 80 more files

📄 Description

Linked issue

Part of #7469

This follows #7579 (merged), the sheet builder. This branch is up to date with staging and holds the first part of the Game Master's ruleset combat rules: what 5e fights need beyond the core added in #7563. Its versions are Capability API 1.101-1.103, 1.113-1.134 and 1.165-1.181. 1.135-1.164 stay reserved for later rules work, so the supported version is 1.181. The rest of the GM rules, maps and the remaining work follow this one at a time.

Why this change

  • A ruleset fight could not express much of what a 5e encounter needs: creature sizes and other ways of moving, senses and darkness, areas that stay on the board, spell components, creatures that cast or heal, reactions to named spells, and conditions that end on harm or a fresh save.
  • Damage had no way to say what passes a resistance, to change with circumstances, or to be changed by conditions, levels and items, so resistances, immunities and exhaustion could not be modelled faithfully.
  • Items could not carry extra damage, a switch such as a flame tongue's flames, or a cure.

What changed

  • Harm and damage: harm can name what carries it past a resistance's or immunity's except, such as a magical weapon (Capability API 1.101). A creature action's damage can have alternatives while something holds (1.102). Conditions, levels and sheet lists can keep typed harm and conditions off (1.132), modifiers can change damage dealt or taken on hits (1.133), and save modifiers can count only against conditions, damage types or magic (1.134). A level can say what exhaustion does at its worst, including halving the health maximum (1.115).
  • Size and movement: combatants have sizes (combat.sizes, 1.103). Creatures can fly, swim, climb and burrow (1.113), and fliers go up and down on boards with height (1.114). A reaction on falls can catch a fall, and a condition can let its holder land safely (1.124).
  • Reactions and answers: an answer that cancels can stop only what was paid no higher than itself (1.116), answer named entries (1.117), wait for a melee or ranged blow (1.118), and answer for nearby allies, at a turn's start, on a successful save or for several fallers (1.131).
  • Conditions: a condition's rounds can count on its source's turns (1.119), hold a caster's spell over to their next turn (1.120), end on damage, a repeated save or an ally's help (1.125), take away senses an effect needs (1.127), roll its ending save only when damaged (1.129), go on only while a value off the target's sheet allows (1.167), use the applier's save difficulty to escape (1.174), and end once its holder attacks or casts (1.180).
  • Creatures: creature actions can heal or target their own side (1.121), creatures can cast catalog spells without slots (1.123), and rulesets can declare creature types and tags (1.168).
  • Areas and zones: a line can have a width (1.128), an area can be a box (1.177), and an area can stay on the board as a zone (1.172) that its caster moves or that drifts (1.173), rams the first creature in its way (1.175), and wards against spells by base level (1.181). An attack can leave a summoned weapon that strikes on later turns (1.122).
  • Senses and components: combat.senses adds darkvision, blindsight and truesight, with light and darkness on the board (1.178), and combat.components says what using something needs, such as verbal or somatic (1.179).
  • Items and sheets: a weapon's attack can deal extra damage clauses (1.169), an item can carry a switch that a fight turns on and off (1.170), and a catalog entry or item use can cure named conditions (1.176). A live pool can pay for other groups' costs at its own level (1.171). An entry's mechanics can be usable in a fight only while a value off its holder's sheet allows (1.166). A rider can need an adjacent ally (1.126). A builder step's stamp can read the parent pick that offered the entry (1.130). A sheet list can have up to 24 columns (1.165).
  • docs/extending/writing-rulesets.md covers all of it, and docs/extending/ruleset.schema.json is regenerated.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md
  • Regression lanes run locally on this head: capability 19/19, package 7/7, creature 6/6, open-issues 1/1, avatar 14/14, professor-mari 18/18, game-ruleset 105/105, combat 64/64 (ruleset-combat-director needs about 104 s in a slow container, above its 90 s limit there).

Manual verification notes

  • Each feature has its own regression under scripts/regressions/game-ruleset-combat-*.regression.ts that drives a fight through the shared resolver, and checks the install gate at its version.
  • Not checked by a person yet: these rules in a live game with a full 5e ruleset.

Changed test expectations

No maintainer asked for these; each follows a change in this PR, and the check it replaces is kept:

  • Supported Capability API 1.112 to 1.181, the unsupported fixture 1.113 to 1.182, and the current-minor fixture 1.28 to 1.181 (capability-package-lifecycle): this PR's versions run to 1.181, and the current-minor check now uses the actual current minor.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)
  • docs/extending/writing-rulesets.md changed and docs/extending/ruleset.schema.json is regenerated. The translations are tracked on #7512.

UI evidence (if applicable)

No screenshots attached. The combat board, menu and status changes are covered by the regressions above.

Summary by CodeRabbit

  • New Features

    • Expanded ruleset combat with flight and other movement modes, visibility and senses, typed defenses, summons, persistent zones, and reaction windows for falls and turn starts.
    • Added placement controls for walls, rings, and multiple area effects, with clearer previews and combat event descriptions.
    • Added controls to switch eligible single items on or off, with switch state preserved in inventory.
    • Combat and item details now show additional defenses, modifiers, effects, and targeting information.
    • Expanded payment options to support cross-pool payments and additional targets when upcasting.
    • Raised the supported capability API version, with compatibility checks for packages using newer ruleset features.
  • Documentation

    • Expanded the ruleset guide with new capabilities, constraints, examples, and compatibility requirements.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7584 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/ruleset-gm-rules-1` --- ### 📝 Commits (10+) - [`4c1a993`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4c1a9933d33958de8e225f6f574a33a473bbccdb) Merge remote-tracking branch 'origin/feat/tactical-combat' into feat/combat-5e-rules - [`cf2eed9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf2eed99bb11092df60173e112a6aafe94bde9dc) feat(rulesets): spells and creature attacks carry what gets past a resistance (Capability API 1.96) - [`142015d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/142015d98d06a75fe50fb246f1ba352a03350e91) Merge remote-tracking branch 'origin/feat/ruleset-builder' into feat/combat-5e-rules - [`6c846a8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6c846a88943b420537e7951558db437bad960c17) Rulesets: creature attacks deal another amount two-handed or when hurt (Capability API 1.97) - [`0025062`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0025062e695222046eb090147b93f930fca1b54e) Rulesets: combatant sizes for grapples, and a hold's own escape DC (Capability API 1.98) - [`fb091cd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fb091cd41e2e5323412ec0cf8a96ea48b759d3a7) Merge remote-tracking branch 'origin/feat/ruleset-builder' into feat/combat-5e-rules - [`00f1f73`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00f1f73d244d88d09a431f2175bbec2233f2b101) Rulesets: fly, swim, climb and burrow on the board (Capability API 1.108) - [`0da58b6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0da58b684ccb6018e4c10cd01dfda5dfa97814d2) Rulesets: name the proposed creature schema's type so the encounter blueprint stays writable - [`801f8e6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/801f8e62ce6b01a3cab529a6125564503586cfb8) Rulesets: fliers fly up and down on the board (Capability API 1.109) - [`ea0d319`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ea0d31965b21e394cb96414fa968602cb1767929) Rulesets: exhaustion halves the health maximum and kills at its worst (Capability API 1.110) ### 📊 Changes **101 files changed** (+44128 additions, -10456 deletions) <details> <summary>View changed files</summary> 📝 `docs/extending/ruleset.schema.json` (+17033 -9819) 📝 `docs/extending/writing-rulesets.md` (+662 -43) 📝 `packages/client/src/components/game/DirectedCombatUI.tsx` (+6 -1) 📝 `packages/client/src/components/game/GameInventory.tsx` (+40 -0) 📝 `packages/client/src/components/game/GameRulesetSheet.tsx` (+44 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+37 -0) 📝 `packages/client/src/components/game/RulesetCombatBoard.tsx` (+24 -5) 📝 `packages/client/src/components/game/RulesetCombatMenu.tsx` (+133 -37) 📝 `packages/client/src/components/game/RulesetCombatStatus.tsx` (+59 -2) 📝 `packages/client/src/components/game/RulesetItemPicker.tsx` (+152 -61) 📝 `packages/client/src/lib/ruleset-catalog.ts` (+155 -2) 📝 `packages/client/src/lib/ruleset-combat-board.ts` (+82 -2) 📝 `packages/client/src/lib/ruleset-combat-log.ts` (+125 -10) 📝 `packages/client/src/lib/ruleset-combat-menu.ts` (+35 -2) 📝 `packages/client/src/localization/locales/en.json` (+138 -0) 📝 `packages/server/src/routes/combat-director.routes.ts` (+5 -0) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+930 -0) 📝 `packages/server/src/services/game/combat-boss.service.ts` (+16 -1) 📝 `packages/server/src/services/game/ruleset-combat-director.service.ts` (+162 -12) 📝 `packages/server/src/services/game/ruleset-package-file.ts` (+17 -0) _...and 80 more files_ </details> ### 📄 Description ## Linked issue Part of #7469 This follows #7579 (merged), the sheet builder. This branch is up to date with staging and holds the first part of the Game Master's ruleset combat rules: what 5e fights need beyond the core added in #7563. Its versions are Capability API 1.101-1.103, 1.113-1.134 and 1.165-1.181. 1.135-1.164 stay reserved for later rules work, so the supported version is 1.181. The rest of the GM rules, maps and the remaining work follow this one at a time. ## Why this change - A ruleset fight could not express much of what a 5e encounter needs: creature sizes and other ways of moving, senses and darkness, areas that stay on the board, spell components, creatures that cast or heal, reactions to named spells, and conditions that end on harm or a fresh save. - Damage had no way to say what passes a resistance, to change with circumstances, or to be changed by conditions, levels and items, so resistances, immunities and exhaustion could not be modelled faithfully. - Items could not carry extra damage, a switch such as a flame tongue's flames, or a cure. ## What changed - **Harm and damage:** harm can name what carries it past a resistance's or immunity's `except`, such as a magical weapon (Capability API 1.101). A creature action's damage can have `alternatives` while something holds (1.102). Conditions, levels and sheet lists can keep typed harm and conditions off (1.132), modifiers can change damage dealt or taken on hits (1.133), and save modifiers can count only against conditions, damage types or magic (1.134). A level can say what exhaustion does at its worst, including halving the health maximum (1.115). - **Size and movement:** combatants have sizes (`combat.sizes`, 1.103). Creatures can fly, swim, climb and burrow (1.113), and fliers go up and down on boards with height (1.114). A reaction on `falls` can catch a fall, and a condition can let its holder land safely (1.124). - **Reactions and answers:** an answer that cancels can stop only what was paid no higher than itself (1.116), answer named entries (1.117), wait for a melee or ranged blow (1.118), and answer for nearby allies, at a turn's start, on a successful save or for several fallers (1.131). - **Conditions:** a condition's rounds can count on its source's turns (1.119), hold a caster's spell over to their next turn (1.120), end on damage, a repeated save or an ally's help (1.125), take away senses an effect needs (1.127), roll its ending save only when damaged (1.129), go on only while a value off the target's sheet allows (1.167), use the applier's save difficulty to escape (1.174), and end once its holder attacks or casts (1.180). - **Creatures:** creature actions can heal or target their own side (1.121), creatures can cast catalog spells without slots (1.123), and rulesets can declare creature types and tags (1.168). - **Areas and zones:** a line can have a width (1.128), an area can be a box (1.177), and an area can stay on the board as a zone (1.172) that its caster moves or that drifts (1.173), rams the first creature in its way (1.175), and wards against spells by base level (1.181). An attack can leave a summoned weapon that strikes on later turns (1.122). - **Senses and components:** `combat.senses` adds darkvision, blindsight and truesight, with light and darkness on the board (1.178), and `combat.components` says what using something needs, such as verbal or somatic (1.179). - **Items and sheets:** a weapon's attack can deal extra damage clauses (1.169), an item can carry a switch that a fight turns on and off (1.170), and a catalog entry or item use can cure named conditions (1.176). A live pool can pay for other groups' costs at its own level (1.171). An entry's mechanics can be usable in a fight only while a value off its holder's sheet allows (1.166). A rider can need an adjacent ally (1.126). A builder step's stamp can read the parent pick that offered the entry (1.130). A sheet list can have up to 24 columns (1.165). - `docs/extending/writing-rulesets.md` covers all of it, and `docs/extending/ruleset.schema.json` is regenerated. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` - Regression lanes run locally on this head: capability 19/19, package 7/7, creature 6/6, open-issues 1/1, avatar 14/14, professor-mari 18/18, game-ruleset 105/105, combat 64/64 (ruleset-combat-director needs about 104 s in a slow container, above its 90 s limit there). ### Manual verification notes - Each feature has its own regression under `scripts/regressions/game-ruleset-combat-*.regression.ts` that drives a fight through the shared resolver, and checks the install gate at its version. - Not checked by a person yet: these rules in a live game with a full 5e ruleset. ### Changed test expectations No maintainer asked for these; each follows a change in this PR, and the check it replaces is kept: - Supported Capability API 1.112 to 1.181, the unsupported fixture 1.113 to 1.182, and the current-minor fixture 1.28 to 1.181 (`capability-package-lifecycle`): this PR's versions run to 1.181, and the current-minor check now uses the actual current minor. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) - `docs/extending/writing-rulesets.md` changed and `docs/extending/ruleset.schema.json` is regenerated. The translations are tracked on #7512. ## UI evidence (if applicable) No screenshots attached. The combat board, menu and status changes are covered by the regressions above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded ruleset combat with flight and other movement modes, visibility and senses, typed defenses, summons, persistent zones, and reaction windows for falls and turn starts. * Added placement controls for walls, rings, and multiple area effects, with clearer previews and combat event descriptions. * Added controls to switch eligible single items on or off, with switch state preserved in inventory. * Combat and item details now show additional defenses, modifiers, effects, and targeting information. * Expanded payment options to support cross-pool payments and additional targets when upcasting. * Raised the supported capability API version, with compatibility checks for packages using newer ruleset features. * **Documentation** * Expanded the ruleset guide with new capabilities, constraints, examples, and compatibility requirements. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:46 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7815
No description provided.