[PR #6733] [MERGED] fix(game): a bestiary creature keeps its reaction and what it does to itself #7302

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

📋 Pull Request Information

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

Base: staging ← Head: fix/bestiary-creature-reactions


📝 Commits (1)

  • bd6464e fix(game): a bestiary creature keeps its reaction and what it does to itself

📊 Changes

3 files changed (+47 additions, -0 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/shared/src/features/ruleset-combat/creatures.ts (+9 -0)
📝 scripts/regressions/game-ruleset-combat-hit.regression.ts (+36 -0)

📄 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 #6731

Why this change

#6729 let a creature's own action be a reaction that lands on itself, which is how a Parry is written. That works for a stat block written by hand, but a creature a fight takes from a bestiary catalog is copied into a stat block key by key, and that copy had no line for reaction or self. So every bestiary Parry was lost: no window opened when a blow hit the creature, and on its own turn the Parry was offered as an ordinary action aimed at an enemy. The #6729 lane only built its parrying creature by hand, so it never went through the copy.

The 5e package release (https://github.com/Pasta-Devs/Marinara-Agents/issues/1092) ships six SRD monsters with a Parry and needs this to play them. Proving that package against staging is what found it.

What changed

  • creatureAction in packages/shared/src/features/ruleset-combat/creatures.ts carries reaction (with its own copy of against) and self into the stat block, the same way it already carries signature, sequence and the rest.
  • The game-ruleset-combat-hit lane names the 5e reference's Toll Sergeant from its bestiary, the way a Game Master names one, and checks that:
    • its Parry is a reaction on the hit moment that lands on itself;
    • a hit it may parry opens the window, and parrying turns it into a miss;
    • the Parry is not on its own turn's menu.
  • CHANGELOG entry.

No format, schema, capability or docs change: the keys and their rules are #6729's.

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 bd6464e61 (this branch's one commit on staging de567b213), all exit 0: pnpm check and node scripts/run-regressions.mjs --filter ruleset (42/42). The new lane case fails on staging without the fix (the Parry comes back with no reaction) and passes with it. Local CodeRabbit (coderabbit review --agent --committed --base staging): 0 findings.

The 5e package 0.9.0 was also played against this branch through the shared combat code: the knight's Parry turns a longsword hit of 19 against its 18 into a miss once it adds 2, and its one-attack guard is spent by that blow.

Still to verify by hand (not done by the agent):

  • In a Game Mode game on a ruleset with a bestiary creature that parries (the 5e reference's Toll Sergeant, or the 5e package's knight once its 0.9.0 is installed), start a ruleset fight against it. Hit it with an attack that beats its Armor Class by 1 or 2 and confirm the fight asks it to parry and the blow then misses. On its turn, confirm Parry is not offered as an action.

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)

Only CHANGELOG.md changes. No user docs under docs/ are touched, so there is nothing for docs-i18n.

UI evidence (if applicable)

None: nothing on screen changes beyond the existing window now opening for a bestiary creature.

Summary by CodeRabbit

  • Bug Fixes
    • Creatures imported from the bestiary now retain their reaction and self-targeting behavior. The Toll Sergeant’s Parry is offered when it is hit, can turn the hit into a miss, and no longer appears among its normal turn actions.
  • Tests
    • Added coverage confirming the imported Toll Sergeant’s Parry behaves as a reaction to a hit and is unavailable as a normal turn action.

🔄 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/6733 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/26/2026 **Status:** ✅ Merged **Merged:** 9/26/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/bestiary-creature-reactions` --- ### 📝 Commits (1) - [`bd6464e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bd6464e61f03ad7d7743f2986f1371d0280c7c85) fix(game): a bestiary creature keeps its reaction and what it does to itself ### 📊 Changes **3 files changed** (+47 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/shared/src/features/ruleset-combat/creatures.ts` (+9 -0) 📝 `scripts/regressions/game-ruleset-combat-hit.regression.ts` (+36 -0) </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 #6731 ## Why this change #6729 let a creature's own action be a reaction that lands on itself, which is how a Parry is written. That works for a stat block written by hand, but a creature a fight takes from a bestiary catalog is copied into a stat block key by key, and that copy had no line for `reaction` or `self`. So every bestiary Parry was lost: no window opened when a blow hit the creature, and on its own turn the Parry was offered as an ordinary action aimed at an enemy. The #6729 lane only built its parrying creature by hand, so it never went through the copy. The 5e package release (https://github.com/Pasta-Devs/Marinara-Agents/issues/1092) ships six SRD monsters with a Parry and needs this to play them. Proving that package against staging is what found it. ## What changed - `creatureAction` in `packages/shared/src/features/ruleset-combat/creatures.ts` carries `reaction` (with its own copy of `against`) and `self` into the stat block, the same way it already carries `signature`, `sequence` and the rest. - The `game-ruleset-combat-hit` lane names the 5e reference's Toll Sergeant from its bestiary, the way a Game Master names one, and checks that: - its Parry is a reaction on the hit moment that lands on itself; - a hit it may parry opens the window, and parrying turns it into a miss; - the Parry is not on its own turn's menu. - CHANGELOG entry. No format, schema, capability or docs change: the keys and their rules are #6729's. ## 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 bd6464e61 (this branch's one commit on staging de567b213), all exit 0: `pnpm check` and `node scripts/run-regressions.mjs --filter ruleset` (42/42). The new lane case fails on staging without the fix (the Parry comes back with no `reaction`) and passes with it. Local CodeRabbit (`coderabbit review --agent --committed --base staging`): 0 findings. The 5e package 0.9.0 was also played against this branch through the shared combat code: the knight's Parry turns a longsword hit of 19 against its 18 into a miss once it adds 2, and its one-attack guard is spent by that blow. Still to verify by hand (not done by the agent): - In a Game Mode game on a ruleset with a bestiary creature that parries (the 5e reference's Toll Sergeant, or the 5e package's knight once its 0.9.0 is installed), start a ruleset fight against it. Hit it with an attack that beats its Armor Class by 1 or 2 and confirm the fight asks it to parry and the blow then misses. On its turn, confirm Parry is not offered as an action. ## 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) Only `CHANGELOG.md` changes. No user docs under `docs/` are touched, so there is nothing for `docs-i18n`. ## UI evidence (if applicable) None: nothing on screen changes beyond the existing window now opening for a bestiary creature. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Creatures imported from the bestiary now retain their reaction and self-targeting behavior. The Toll Sergeant’s Parry is offered when it is hit, can turn the hit into a miss, and no longer appears among its normal turn actions. * **Tests** * Added coverage confirming the imported Toll Sergeant’s Parry behaves as a reaction to a hit and is unavailable as a normal turn action. <!-- 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:18:26 +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#7302
No description provided.