[PR #7588] [MERGED] Rulesets: Game Master combat rules for 5e fights, part 2b #7817

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/7588
Author: @kolacheee
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @kolacheee

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


📝 Commits (9)

  • 7941168 Bump the PR 10 lines the PR 11 merge kept at their old Capability API numbers
  • 8b714dc Bump the moved PR 10 lines still at their old Capability API numbers
  • e7a34ad Gate each GM rules feature at its own Capability API number again
  • 1f3b82b Record PR 11a's take-out of the 1.271-1.314 half as merged; PR 11b keeps it
  • a21ff53 Record PR 11a's gate fixes as merged; PR 11b has its own for the full range
  • 5fdfc2a Merge staging (PR 10 merged) into PR 11b
  • 5a18b50 Merge PR 11a's CodeRabbit fixes into PR 11b
  • d13b6a9 Merge staging (PR 11a merged) into PR 11b
  • c3b1e68 Answer CodeRabbit on PR 11b: install scans skip a ruleset's own id-keyed maps, a turned item's stack, curses, repeats, tests and copy

📊 Changes

91 files changed (+45906 additions, -12618 deletions)

View changed files

📝 docs/extending/ruleset.schema.json (+21472 -12186)
📝 docs/extending/writing-rulesets.md (+97 -8)
📝 packages/client/src/components/game/DirectedCombatUI.tsx (+1 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+2 -0)
📝 packages/client/src/components/game/RulesetCombatBoard.tsx (+12 -1)
📝 packages/client/src/components/game/RulesetCombatMenu.tsx (+84 -13)
📝 packages/client/src/components/game/RulesetCombatStatus.tsx (+15 -13)
📝 packages/client/src/components/game/RulesetItemPicker.tsx (+5 -0)
📝 packages/client/src/lib/ruleset-combat-board.ts (+21 -9)
📝 packages/client/src/lib/ruleset-combat-bridge.ts (+6 -0)
📝 packages/client/src/lib/ruleset-combat-log.ts (+153 -13)
📝 packages/client/src/lib/ruleset-combat-menu.ts (+33 -0)
📝 packages/client/src/localization/locales/en.json (+59 -0)
📝 packages/server/src/routes/combat-director.routes.ts (+7 -1)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+931 -2)
📝 packages/server/src/services/game/ruleset-combat-director.service.ts (+348 -43)
📝 packages/server/src/services/game/ruleset-package-file.ts (+8 -1)
📝 packages/server/src/services/storage/game-rulesets.storage.ts (+8 -1)
📝 packages/shared/src/features/combat-director.ts (+4 -0)
📝 packages/shared/src/features/ruleset-combat/ammo.ts (+68 -8)

...and 71 more files

📄 Description

Linked issue

Part of #7469

This follows #7587 (merged), the first half of the second part of the Game Master's ruleset combat rules. This branch is up to date with staging and holds the second half: Capability API 1.271-1.314, so the supported version is 1.314. Maps and the remaining work follow this one at a time.

Why this change

  • 5e fights had no real hiding, searching, readying, light or darkness: being hidden was only a condition, and every fight was fought in the same light.
  • Spells, items and creatures could not teleport, and legendary creatures had no legendary moves or casts.
  • Charged items, concentration and conditions still lacked parts 5e's spells and magic items rely on.

What changed

  • Items and charges: an item's first use can be named, an item use can add a value off its holder's sheet, more charges can push farther, and a last charge's die can give charges back (Capability API 1.271). An item can become another when its last charge is spent (1.272), and a weapon can spend charges on its hits (1.273). Item uses can grow their targets with the sheet or take the same target twice (1.308), and put conditions on their reader (1.311). An item can be bound only with others worn (1.313).
  • Conditions: a condition can be put on with a value off its applier, give temporary points each turn, and be saved against off its source (1.274). Conditions can hold while their source is near, hold others off (1.275), keep their holder off a whole side, and end on an attack, on harm from a catalog or on a friend harmed in sight (1.278). They can end when their holder moves or acts (1.303, 1.311), on a named action (1.307), at a distance from whoever put them on (1.310), or by a check (1.313), and can shut their holder away from everybody else (1.314). An entry can put on more than four conditions (1.277).
  • Teleports: spells, items and creatures can teleport (1.276), leave the fight, take along only those their user sees, leave smoke behind (1.279), and strike before or after (1.280). A creature sent away can still take turns (1.313).
  • Legendary creatures: legendary moves (1.283), casts (1.284), and moves after an action or on one speed (1.285). A blow's maker can regain the damage it dealt (1.281), and a burst can be centred on its user (1.282).
  • Hiding and readying: hiding for real, searching and creatures that detect (1.287), readying for real (1.288), passive Perception that reads advantage (1.290), a creature's own modes on checks and printed passive Perception (1.291), and somebody's own ways of hiding or of finding the hidden (1.292). Hiding can need camouflage or a wall, and surprise can come from a hidden start (1.309).
  • Fog, wind, light and darkness: a lightly obscuring fog and a wind that blows it away (1.286), slowly (1.289). Fights can be kept dark, and things can shed light (1.294), switched off and on (1.295, 1.296). Zones can shed light or end magical darkness, and light can show the invisible (1.297). Sunlight, and lights that go out under a condition (1.298); darkness that puts out spell light (1.299). Uses can need some light (1.303).
  • Entries and costs: what a higher cost adds can come every so many steps (1.300). Zones can be carried with somebody and copies set down apart (1.301). Entries can change another entry each time it is used (1.302), be used once a creature until a rest (1.304), grow their targets with the sheet (1.305), put weapons in hand (1.306), and be made again while their user concentrates (1.310). A casting's choices can be made again, and an ability add can be capped (1.313). An entry can be aimed only at creatures up to a size (1.314).
  • Creatures: attacks rolled twice where a creature stands (1.293), creature actions held by concentration (1.307), creature actions that slay the dying (1.311), and a weapon mode whose hit claps around the one it hit (1.312). Standard actions can be taken with a use (1.313).
  • 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 9/9, game-ruleset 204/204, inventory 4/4, avatar 14/14.

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.270 to 1.314, and the unsupported fixture 1.271 to 1.315 (capability-package-lifecycle): this PR's versions run to 1.314.
  • A condition's endsWhen takes up to 4 values, not 2, and its schema enum adds attacked and ally-harmed-in-sight (1.278): the refusal now checks 5 values against "at most 4", and the enum check lists all four.
  • An item's use may carry amountAdd since 1.271 (a Staff of Healing's), so game-ruleset-crit-multiply-amount now accepts it on the warming tonic and checks that it is still refused without an amount beside it.
  • A staff's chargeStep with nothing to add is still refused; the message now names the push as well (1.271).

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, status and log changes are covered by the regressions above.

Summary by CodeRabbit

  • New Features

    • Expanded tactical combat with teleportation and carried companions, fleeing, hiding and searching, lighting, ready actions, legendary movement and casting, repeatable targeting, and new area effects.
    • Added item support for charge recovery, item transformations, charge-powered attacks, sheet-based healing bonuses, and worn-item binding requirements.
    • Improved combat menus, battlefield indicators, status labels, and logs to reflect new actions and outcomes.
    • Updated ruleset guidance and compatibility checks for newly supported capabilities.
  • Bug Fixes

    • Inventory bindings now release when required worn items are no longer available.
    • Combat summaries and outcomes now reflect combatants who flee or leave the fight.

🔄 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/7588 **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-3` --- ### 📝 Commits (9) - [`7941168`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7941168b6e894c006229ab641b72279285c012fc) Bump the PR 10 lines the PR 11 merge kept at their old Capability API numbers - [`8b714dc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8b714dc2e7cb3812197d72a14746c359a6ed523b) Bump the moved PR 10 lines still at their old Capability API numbers - [`e7a34ad`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e7a34ad4b82dfac984016243247b79e8501239f8) Gate each GM rules feature at its own Capability API number again - [`1f3b82b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1f3b82bd45dfd798fc76f98912840a54f176fac7) Record PR 11a's take-out of the 1.271-1.314 half as merged; PR 11b keeps it - [`a21ff53`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a21ff5310a77279a998daa2875e9d85b31ed2cec) Record PR 11a's gate fixes as merged; PR 11b has its own for the full range - [`5fdfc2a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5fdfc2a53e4ee0057278167c49dc94b7b2db95e6) Merge staging (PR 10 merged) into PR 11b - [`5a18b50`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5a18b50e517a0baee591505251e7b70f8d8dd517) Merge PR 11a's CodeRabbit fixes into PR 11b - [`d13b6a9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d13b6a9f9f43032ce661c7845eabb804f0dd6500) Merge staging (PR 11a merged) into PR 11b - [`c3b1e68`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c3b1e68a912e13edd6ca35b20c2e24796ffaf27f) Answer CodeRabbit on PR 11b: install scans skip a ruleset's own id-keyed maps, a turned item's stack, curses, repeats, tests and copy ### 📊 Changes **91 files changed** (+45906 additions, -12618 deletions) <details> <summary>View changed files</summary> 📝 `docs/extending/ruleset.schema.json` (+21472 -12186) 📝 `docs/extending/writing-rulesets.md` (+97 -8) 📝 `packages/client/src/components/game/DirectedCombatUI.tsx` (+1 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+2 -0) 📝 `packages/client/src/components/game/RulesetCombatBoard.tsx` (+12 -1) 📝 `packages/client/src/components/game/RulesetCombatMenu.tsx` (+84 -13) 📝 `packages/client/src/components/game/RulesetCombatStatus.tsx` (+15 -13) 📝 `packages/client/src/components/game/RulesetItemPicker.tsx` (+5 -0) 📝 `packages/client/src/lib/ruleset-combat-board.ts` (+21 -9) 📝 `packages/client/src/lib/ruleset-combat-bridge.ts` (+6 -0) 📝 `packages/client/src/lib/ruleset-combat-log.ts` (+153 -13) 📝 `packages/client/src/lib/ruleset-combat-menu.ts` (+33 -0) 📝 `packages/client/src/localization/locales/en.json` (+59 -0) 📝 `packages/server/src/routes/combat-director.routes.ts` (+7 -1) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+931 -2) 📝 `packages/server/src/services/game/ruleset-combat-director.service.ts` (+348 -43) 📝 `packages/server/src/services/game/ruleset-package-file.ts` (+8 -1) 📝 `packages/server/src/services/storage/game-rulesets.storage.ts` (+8 -1) 📝 `packages/shared/src/features/combat-director.ts` (+4 -0) 📝 `packages/shared/src/features/ruleset-combat/ammo.ts` (+68 -8) _...and 71 more files_ </details> ### 📄 Description ## Linked issue Part of #7469 This follows #7587 (merged), the first half of the second part of the Game Master's ruleset combat rules. This branch is up to date with staging and holds the second half: Capability API 1.271-1.314, so the supported version is 1.314. Maps and the remaining work follow this one at a time. ## Why this change - 5e fights had no real hiding, searching, readying, light or darkness: being hidden was only a condition, and every fight was fought in the same light. - Spells, items and creatures could not teleport, and legendary creatures had no legendary moves or casts. - Charged items, concentration and conditions still lacked parts 5e's spells and magic items rely on. ## What changed - **Items and charges:** an item's first use can be named, an item use can add a value off its holder's sheet, more charges can push farther, and a last charge's die can give charges back (Capability API 1.271). An item can become another when its last charge is spent (1.272), and a weapon can spend charges on its hits (1.273). Item uses can grow their targets with the sheet or take the same target twice (1.308), and put conditions on their reader (1.311). An item can be bound only with others worn (1.313). - **Conditions:** a condition can be put on with a value off its applier, give temporary points each turn, and be saved against off its source (1.274). Conditions can hold while their source is near, hold others off (1.275), keep their holder off a whole side, and end on an attack, on harm from a catalog or on a friend harmed in sight (1.278). They can end when their holder moves or acts (1.303, 1.311), on a named action (1.307), at a distance from whoever put them on (1.310), or by a check (1.313), and can shut their holder away from everybody else (1.314). An entry can put on more than four conditions (1.277). - **Teleports:** spells, items and creatures can teleport (1.276), leave the fight, take along only those their user sees, leave smoke behind (1.279), and strike before or after (1.280). A creature sent away can still take turns (1.313). - **Legendary creatures:** legendary moves (1.283), casts (1.284), and moves after an action or on one speed (1.285). A blow's maker can regain the damage it dealt (1.281), and a burst can be centred on its user (1.282). - **Hiding and readying:** hiding for real, searching and creatures that detect (1.287), readying for real (1.288), passive Perception that reads advantage (1.290), a creature's own modes on checks and printed passive Perception (1.291), and somebody's own ways of hiding or of finding the hidden (1.292). Hiding can need camouflage or a wall, and surprise can come from a hidden start (1.309). - **Fog, wind, light and darkness:** a lightly obscuring fog and a wind that blows it away (1.286), slowly (1.289). Fights can be kept dark, and things can shed light (1.294), switched off and on (1.295, 1.296). Zones can shed light or end magical darkness, and light can show the invisible (1.297). Sunlight, and lights that go out under a condition (1.298); darkness that puts out spell light (1.299). Uses can need some light (1.303). - **Entries and costs:** what a higher cost adds can come every so many steps (1.300). Zones can be carried with somebody and copies set down apart (1.301). Entries can change another entry each time it is used (1.302), be used once a creature until a rest (1.304), grow their targets with the sheet (1.305), put weapons in hand (1.306), and be made again while their user concentrates (1.310). A casting's choices can be made again, and an ability add can be capped (1.313). An entry can be aimed only at creatures up to a size (1.314). - **Creatures:** attacks rolled twice where a creature stands (1.293), creature actions held by concentration (1.307), creature actions that slay the dying (1.311), and a weapon mode whose hit claps around the one it hit (1.312). Standard actions can be taken with a use (1.313). - `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 9/9, game-ruleset 204/204, inventory 4/4, avatar 14/14. ### 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.270 to 1.314, and the unsupported fixture 1.271 to 1.315 (`capability-package-lifecycle`): this PR's versions run to 1.314. - A condition's `endsWhen` takes up to 4 values, not 2, and its schema enum adds `attacked` and `ally-harmed-in-sight` (1.278): the refusal now checks 5 values against "at most 4", and the enum check lists all four. - An item's use may carry `amountAdd` since 1.271 (a Staff of Healing's), so `game-ruleset-crit-multiply-amount` now accepts it on the warming tonic and checks that it is still refused without an amount beside it. - A staff's `chargeStep` with nothing to add is still refused; the message now names the push as well (1.271). ## 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, status and log changes are covered by the regressions above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded tactical combat with teleportation and carried companions, fleeing, hiding and searching, lighting, ready actions, legendary movement and casting, repeatable targeting, and new area effects. * Added item support for charge recovery, item transformations, charge-powered attacks, sheet-based healing bonuses, and worn-item binding requirements. * Improved combat menus, battlefield indicators, status labels, and logs to reflect new actions and outcomes. * Updated ruleset guidance and compatibility checks for newly supported capabilities. * **Bug Fixes** * Inventory bindings now release when required worn items are no longer available. * Combat summaries and outcomes now reflect combatants who flee or leave the fight. <!-- 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#7817
No description provided.