[PR #6876] [MERGED] Game Mode: fire modes, off-hand attacks, a damage floor and conditions on a hit for ruleset weapons #7365

Closed
opened 2026-10-23 04:19:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6876
Author: @kolacheee
Created: 9/29/2026
Status: ✅ Merged
Merged: 9/30/2026
Merged by: @kolacheee

Base: staging ← Head: feat/ruleset-items-fire-modes


📝 Commits (3)

  • 9a1ceae feat(rulesets): fire modes, off-hand attacks, a damage floor and conditions on a hit (#6875)
  • 68169ac fix(rulesets): conditions on a hit land after the blow, the picker forecasts a mode in each style, and clearer floor and on-hit words (#6875)
  • d724312 Merge remote-tracking branch 'origin/staging' into feat/ruleset-items-fire-modes

📊 Changes

36 files changed (+1982 additions, -231 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 docs/development/game-rulesets-and-sheets-implementation.md (+48 -0)
📝 docs/examples/rulesets/ember-roads.json (+11 -1)
📝 docs/examples/rulesets/gravewatch.json (+16 -2)
📝 docs/extending/ruleset.schema.json (+128 -0)
📝 docs/extending/writing-rulesets.md (+29 -5)
📝 e2e/game-ruleset-ammo.e2e.ts (+6 -154)
➕ e2e/game-ruleset-fight-fixture.ts (+160 -0)
➕ e2e/game-ruleset-weapon-modes.e2e.ts (+168 -0)
📝 packages/client/src/components/game/DirectedCombatUI.tsx (+2 -0)
📝 packages/client/src/components/game/RulesetCombatBoard.tsx (+4 -3)
📝 packages/client/src/components/game/RulesetCombatMenu.tsx (+72 -14)
📝 packages/client/src/components/game/RulesetItemPicker.tsx (+32 -1)
📝 packages/client/src/lib/ruleset-combat-log.ts (+1 -0)
📝 packages/client/src/lib/ruleset-combat-menu.ts (+17 -2)
📝 packages/client/src/localization/locales/en.json (+16 -0)
📝 packages/server/src/routes/combat-director.routes.ts (+2 -0)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+17 -0)
📝 packages/server/src/services/game/ruleset-combat-director.service.ts (+40 -4)
📝 packages/shared/src/features/combat-director.ts (+3 -0)

...and 16 more files

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6875

Why this change

  • A ruleset's weapons fight as items (#6855) and use up what they shoot (#6871), but each still had exactly one way to attack. A bow could not loose two arrows at two targets, a gun could not fire a burst that trades accuracy for dice, a character with a knife in each hand got no second strike, a weapon that always does some harm (Exalted's overwhelming) could not say so, and neither could one that leaves a condition when it hits hard enough (a stake in V20). This is slice I5-4 of the ruleset items plan, the rest of its weapon keys.

What changed

  • Modes (Capability API 1.58): a weapon's attack.modes (up to six) are other ways to make the attack, each with a label and what it changes: ammo (one attack's shots, so the weapon shoots something, and no more than a written clip holds), toHit (dice in a pool fight), target (a pool fight's per-die target moved, where it can move) and targets (how many it may be aimed at, each its own roll). The fight menu asks "How is Hunting bow used?" once the attack is picked (after its initiative style, where there are styles), with "As it is" and each mode its holder has the shots for, and what each is expected to do. The attack is named for its mode ("Hunting bow (Volley)"), a held attack picks up in the same mode, and a mode the option does not offer is refused. A party member the Engine plays weighs every mode aimed at one target like any other way to attack.
  • Off hand: the combat block's offHand names the budget a second attack spends, and whether its damage keeps a positive ability (penalty-only, as 5e's two-weapon fighting). A weapon marked offHand, once its holder has attacked this turn with another such weapon, offers a second attack on that budget, "Silver coffin nail, off hand" on the menu: one blow, and never a strike at somebody walking away.
  • Floor: floor, the least a hit deals: a pool fight's harm after soak, or a summed fight's damage, before a save or a resistance halves it, and the log says so ("Raised to the weapon's floor of 1."). A spending blow is never raised.
  • On a hit: onHit puts a condition of the ruleset's on the target when the harm the blow dealt reached atLeast, for some rounds or until something takes it off; immunity counts.
  • Checked at import: a mode listed twice, a mode's ammo on a weapon that shoots nothing or beyond its clip, a mode's target where the pool's cannot move, an off-hand weapon without the combat block's offHand, its budget, a floor read off a stat that is no number, and an unknown condition. The install gate asks for 1.58 in the ruleset file and in catalog files.
  • Seen and said: item facts and details say "Modes: Volley (2 shots, -2 to hit, up to 2 targets)", "Off hand (Quick), Marked for 2 rounds when a hit deals 2 or more" and "At least 1 on a hit, before resistance", and the Game Master's inventory line ends with modes Volley (2 shots, -2 to hit, up to 2 targets), off hand (Quick), at least 1 on a hit before resistance or Marked for 2 rounds when a hit deals 2 or more.
  • Examples: Ember Roads' hunting bow can loose a volley. Gravewatch's combat block declares its quick budget for the off hand, its silver coffin nail is an off-hand weapon that marks what it harms twice or more for two rounds, and its grave spade never deals less than one on a hit.
  • Docs: a "Modes, a second weapon, a floor and conditions on a hit" part of the weapons section, the item keys and the capability list in docs/extending/writing-rulesets.md (whose line saying these come later is removed, and whose note on spending blows now says a floor does not raise them), the 1.58 record in docs/development/game-rulesets-and-sheets-implementation.md, the regenerated JSON schema and a CHANGELOG entry.

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

Manual verification notes

Run by the agent on this branch at 9a1ceae07 (one commit on staging c4a695eb6):

  • pnpm check exits 0, pnpm localization:check exits 0, pnpm regression passes 467/467, and pnpm smoke:ui passes 7/7.
  • On --project=desktop-chromium, the ruleset, inventory, game dice and combat director specs (e2e/game-ruleset-*.e2e.ts, e2e/ruleset-*.e2e.ts, e2e/game-inventory-*.e2e.ts, e2e/game-native-dice.e2e.ts, e2e/game-one-request-dice.e2e.ts, e2e/game-combat-director.e2e.ts) pass 31/31, and the game ruleset specs pass 12/12 on --project=mobile-chromium.

Lanes:

  • New game-ruleset-weapon-modes.regression.ts: every import refusal; the 1.58 gate (each new key on its own, the combat block's offHand alone, and a catalog file); a volley at two targets and at one (two arrows either way, two less to hit, each its own roll), refused at three, an unknown mode refused and a mode not offered without its shots; a volley held by a hit window picking up as a volley; a pool mode moving the per-die target and taking a die; the off hand only after another off-hand weapon's attack (not after a spade, not alone, not the next turn), on the quick budget, one blow whatever the main attack's strikes, never in passing, with full and penalty-only; a floor in a pool fight under soak and a summed fight under a resistance; conditions on a hit at the number and not one short, for rounds or lasting, and refused by an immune creature; the director's command naming a mode (and refusing an unknown one) and the Engine's picker choosing a mode that is far likelier to land; item facts, the Game Master's line, the menu's words and the log.
  • Lanes that pin the 1.57 gate, the supported API, the examples' items or the Game Master's lines were brought up to date, and e2e/game-ruleset-ammo.e2e.ts now takes its fight helpers from a shared fixture and leaves its bow's volley out.
  • e2e/game-ruleset-weapon-modes.e2e.ts: in Ember Roads, the bow's details show its modes, the fight menu asks how it is used, a volley at the moth is confirmed and logged, and the saved inventory holds two fewer arrows; in Gravewatch, a nail's details say it is for the off hand and what it marks, no off-hand option appears before the first nail strikes, and "Silver coffin nail, off hand" then spends Quick.

Sixty deliberate breaks, across the import checks, the gate, building the actions, the moded attack, the menu, resolution (a held attack's mode included), the off hand, the floor, conditions on a hit, the director's command and picker, the facts and the client's words, were each caught: 58 by the lanes, and dropping the mode from the client's command or skipping its mode step by e2e/game-ruleset-weapon-modes.e2e.ts.

Local CodeRabbit (coderabbit review --agent --base staging, with the new files included): one finding, declined. It asked for the Game Master's answer to a fight window to carry a chosen style and mode as the turn's answer does; a window's menu never offers either (both are left out of an option taken at its moment), so no window answer can hold one.

GitHub CodeRabbit, first review: fixed in 68169ac46, conditions on a hit now land after the blow ends what it ends (so one that ends on damage stays on), the Engine's picker expands modes before initiative styles (so a mode in a taking style forecasts no harm), and the floor and on-hit wording says "before resistance" and "when a hit deals"; each with a lane case, and the two reorders caught as deliberate breaks. Declined: coordinating the e2e import-policy toggle across workers (the same sequence nine specs already use, only moved into the fixture). After that commit, pnpm check exits 0, pnpm regression passes 467/467 and both weapon e2e specs pass.

No Game Master turn was run on a local model for this slice: what the model sees differently is the weapon's inventory line, and the Engine's own picker (not the model) chooses modes for the party members it plays, which a lane covers.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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 touched: docs/extending/writing-rulesets.md and docs/development/game-rulesets-and-sheets-implementation.md (both carried by docs-i18n), CHANGELOG.md, the generated docs/extending/ruleset.schema.json and the two example rulesets. Translations: #6813 is the items arc's follow-up; this PR is added to it there.

UI evidence (if applicable)

In an Ember Roads fight, picking Juno's hunting bow asks "How is Hunting bow used?" with "As it is · 100% to hit, about 8 damage" and "Volley · 92% to hit, about 8 damage · up to 2 targets"; in a Gravewatch fight, once Ada's first nail has struck, "Silver coffin nail, off hand · Spends Quick" appears (captured by e2e/game-ruleset-weapon-modes.e2e.ts as ruleset-modes-step.png, ruleset-modes-volley.png, ruleset-offhand-menu.png and ruleset-offhand-struck.png).

Summary by CodeRabbit

  • New Features
    • Added selectable weapon modes that can adjust ammunition use, attack modifiers, and target limits.
    • Added paired off-hand attacks with configurable budgets, damage floors, and conditions triggered when hits meet a damage threshold.
    • Updated combat menus, item descriptions, and combat logs to show weapon options and effects.
    • Added example rulesets demonstrating weapon modes and off-hand attacks.
  • Compatibility
    • Rulesets using these features require Capability API 1.58.

🔄 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/6876 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/29/2026 **Status:** ✅ Merged **Merged:** 9/30/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/ruleset-items-fire-modes` --- ### 📝 Commits (3) - [`9a1ceae`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9a1ceae070c44651de1d75146f76d781fb9ae4bd) feat(rulesets): fire modes, off-hand attacks, a damage floor and conditions on a hit (#6875) - [`68169ac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/68169ac4669b3effd0c1549f9351017633da2626) fix(rulesets): conditions on a hit land after the blow, the picker forecasts a mode in each style, and clearer floor and on-hit words (#6875) - [`d724312`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7243129c7415d5de9a7371156ae372a6bafb213) Merge remote-tracking branch 'origin/staging' into feat/ruleset-items-fire-modes ### 📊 Changes **36 files changed** (+1982 additions, -231 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `docs/development/game-rulesets-and-sheets-implementation.md` (+48 -0) 📝 `docs/examples/rulesets/ember-roads.json` (+11 -1) 📝 `docs/examples/rulesets/gravewatch.json` (+16 -2) 📝 `docs/extending/ruleset.schema.json` (+128 -0) 📝 `docs/extending/writing-rulesets.md` (+29 -5) 📝 `e2e/game-ruleset-ammo.e2e.ts` (+6 -154) ➕ `e2e/game-ruleset-fight-fixture.ts` (+160 -0) ➕ `e2e/game-ruleset-weapon-modes.e2e.ts` (+168 -0) 📝 `packages/client/src/components/game/DirectedCombatUI.tsx` (+2 -0) 📝 `packages/client/src/components/game/RulesetCombatBoard.tsx` (+4 -3) 📝 `packages/client/src/components/game/RulesetCombatMenu.tsx` (+72 -14) 📝 `packages/client/src/components/game/RulesetItemPicker.tsx` (+32 -1) 📝 `packages/client/src/lib/ruleset-combat-log.ts` (+1 -0) 📝 `packages/client/src/lib/ruleset-combat-menu.ts` (+17 -2) 📝 `packages/client/src/localization/locales/en.json` (+16 -0) 📝 `packages/server/src/routes/combat-director.routes.ts` (+2 -0) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+17 -0) 📝 `packages/server/src/services/game/ruleset-combat-director.service.ts` (+40 -4) 📝 `packages/shared/src/features/combat-director.ts` (+3 -0) _...and 16 more files_ </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #6875 ## Why this change - A ruleset's weapons fight as items (#6855) and use up what they shoot (#6871), but each still had exactly one way to attack. A bow could not loose two arrows at two targets, a gun could not fire a burst that trades accuracy for dice, a character with a knife in each hand got no second strike, a weapon that always does some harm (Exalted's overwhelming) could not say so, and neither could one that leaves a condition when it hits hard enough (a stake in V20). This is slice I5-4 of the ruleset items plan, the rest of its weapon keys. ## What changed - **Modes** (Capability API 1.58): a weapon's `attack.modes` (up to six) are other ways to make the attack, each with a `label` and what it changes: `ammo` (one attack's shots, so the weapon shoots something, and no more than a written clip holds), `toHit` (dice in a pool fight), `target` (a pool fight's per-die target moved, where it can move) and `targets` (how many it may be aimed at, each its own roll). The fight menu asks "How is Hunting bow used?" once the attack is picked (after its initiative style, where there are styles), with "As it is" and each mode its holder has the shots for, and what each is expected to do. The attack is named for its mode ("Hunting bow (Volley)"), a held attack picks up in the same mode, and a mode the option does not offer is refused. A party member the Engine plays weighs every mode aimed at one target like any other way to attack. - **Off hand**: the combat block's `offHand` names the budget a second attack spends, and whether its damage keeps a positive ability (`penalty-only`, as 5e's two-weapon fighting). A weapon marked `offHand`, once its holder has attacked this turn with another such weapon, offers a second attack on that budget, "Silver coffin nail, off hand" on the menu: one blow, and never a strike at somebody walking away. - **Floor**: `floor`, the least a hit deals: a pool fight's harm after soak, or a summed fight's damage, before a save or a resistance halves it, and the log says so ("Raised to the weapon's floor of 1."). A spending blow is never raised. - **On a hit**: `onHit` puts a condition of the ruleset's on the target when the harm the blow dealt reached `atLeast`, for some `rounds` or until something takes it off; immunity counts. - **Checked at import**: a mode listed twice, a mode's ammo on a weapon that shoots nothing or beyond its clip, a mode's target where the pool's cannot move, an off-hand weapon without the combat block's `offHand`, its budget, a floor read off a stat that is no number, and an unknown condition. The install gate asks for 1.58 in the ruleset file and in catalog files. - **Seen and said**: item facts and details say "Modes: Volley (2 shots, -2 to hit, up to 2 targets)", "Off hand (Quick), Marked for 2 rounds when a hit deals 2 or more" and "At least 1 on a hit, before resistance", and the Game Master's inventory line ends with `modes Volley (2 shots, -2 to hit, up to 2 targets)`, `off hand (Quick)`, `at least 1 on a hit before resistance` or `Marked for 2 rounds when a hit deals 2 or more`. - **Examples**: Ember Roads' hunting bow can loose a volley. Gravewatch's combat block declares its quick budget for the off hand, its silver coffin nail is an off-hand weapon that marks what it harms twice or more for two rounds, and its grave spade never deals less than one on a hit. - **Docs**: a "Modes, a second weapon, a floor and conditions on a hit" part of the weapons section, the item keys and the capability list in `docs/extending/writing-rulesets.md` (whose line saying these come later is removed, and whose note on spending blows now says a floor does not raise them), the 1.58 record in `docs/development/game-rulesets-and-sheets-implementation.md`, the regenerated JSON schema and a CHANGELOG entry. ## 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` ### Manual verification notes Run by the agent on this branch at 9a1ceae07 (one commit on staging c4a695eb6): - `pnpm check` exits 0, `pnpm localization:check` exits 0, `pnpm regression` passes 467/467, and `pnpm smoke:ui` passes 7/7. - On `--project=desktop-chromium`, the ruleset, inventory, game dice and combat director specs (`e2e/game-ruleset-*.e2e.ts`, `e2e/ruleset-*.e2e.ts`, `e2e/game-inventory-*.e2e.ts`, `e2e/game-native-dice.e2e.ts`, `e2e/game-one-request-dice.e2e.ts`, `e2e/game-combat-director.e2e.ts`) pass 31/31, and the game ruleset specs pass 12/12 on `--project=mobile-chromium`. Lanes: - New `game-ruleset-weapon-modes.regression.ts`: every import refusal; the 1.58 gate (each new key on its own, the combat block's `offHand` alone, and a catalog file); a volley at two targets and at one (two arrows either way, two less to hit, each its own roll), refused at three, an unknown mode refused and a mode not offered without its shots; a volley held by a hit window picking up as a volley; a pool mode moving the per-die target and taking a die; the off hand only after another off-hand weapon's attack (not after a spade, not alone, not the next turn), on the quick budget, one blow whatever the main attack's strikes, never in passing, with `full` and `penalty-only`; a floor in a pool fight under soak and a summed fight under a resistance; conditions on a hit at the number and not one short, for rounds or lasting, and refused by an immune creature; the director's command naming a mode (and refusing an unknown one) and the Engine's picker choosing a mode that is far likelier to land; item facts, the Game Master's line, the menu's words and the log. - Lanes that pin the 1.57 gate, the supported API, the examples' items or the Game Master's lines were brought up to date, and `e2e/game-ruleset-ammo.e2e.ts` now takes its fight helpers from a shared fixture and leaves its bow's volley out. - `e2e/game-ruleset-weapon-modes.e2e.ts`: in Ember Roads, the bow's details show its modes, the fight menu asks how it is used, a volley at the moth is confirmed and logged, and the saved inventory holds two fewer arrows; in Gravewatch, a nail's details say it is for the off hand and what it marks, no off-hand option appears before the first nail strikes, and "Silver coffin nail, off hand" then spends Quick. Sixty deliberate breaks, across the import checks, the gate, building the actions, the moded attack, the menu, resolution (a held attack's mode included), the off hand, the floor, conditions on a hit, the director's command and picker, the facts and the client's words, were each caught: 58 by the lanes, and dropping the mode from the client's command or skipping its mode step by `e2e/game-ruleset-weapon-modes.e2e.ts`. Local CodeRabbit (`coderabbit review --agent --base staging`, with the new files included): one finding, declined. It asked for the Game Master's answer to a fight window to carry a chosen style and mode as the turn's answer does; a window's menu never offers either (both are left out of an option taken at its moment), so no window answer can hold one. GitHub CodeRabbit, first review: fixed in 68169ac46, conditions on a hit now land after the blow ends what it ends (so one that ends on damage stays on), the Engine's picker expands modes before initiative styles (so a mode in a taking style forecasts no harm), and the floor and on-hit wording says "before resistance" and "when a hit deals"; each with a lane case, and the two reorders caught as deliberate breaks. Declined: coordinating the e2e import-policy toggle across workers (the same sequence nine specs already use, only moved into the fixture). After that commit, `pnpm check` exits 0, `pnpm regression` passes 467/467 and both weapon e2e specs pass. No Game Master turn was run on a local model for this slice: what the model sees differently is the weapon's inventory line, and the Engine's own picker (not the model) chooses modes for the party members it plays, which a lane covers. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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 touched: `docs/extending/writing-rulesets.md` and `docs/development/game-rulesets-and-sheets-implementation.md` (both carried by `docs-i18n`), `CHANGELOG.md`, the generated `docs/extending/ruleset.schema.json` and the two example rulesets. Translations: #6813 is the items arc's follow-up; this PR is added to it there. ## UI evidence (if applicable) In an Ember Roads fight, picking Juno's hunting bow asks "How is Hunting bow used?" with "As it is · 100% to hit, about 8 damage" and "Volley · 92% to hit, about 8 damage · up to 2 targets"; in a Gravewatch fight, once Ada's first nail has struck, "Silver coffin nail, off hand · Spends Quick" appears (captured by `e2e/game-ruleset-weapon-modes.e2e.ts` as `ruleset-modes-step.png`, `ruleset-modes-volley.png`, `ruleset-offhand-menu.png` and `ruleset-offhand-struck.png`). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added selectable weapon modes that can adjust ammunition use, attack modifiers, and target limits. * Added paired off-hand attacks with configurable budgets, damage floors, and conditions triggered when hits meet a damage threshold. * Updated combat menus, item descriptions, and combat logs to show weapon options and effects. * Added example rulesets demonstrating weapon modes and off-hand attacks. * **Compatibility** * Rulesets using these features require Capability API 1.58. <!-- 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-23 04:19:02 +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#7365
No description provided.