mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6729] [MERGED] feat(game): a moment after an attack hits in ruleset combat, and creatures that react #7303
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#7303
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/6729
Author: @kolacheee
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-hit📝 Commits (1)
bd2dd20feat(game): a moment after an attack hits, and creatures that react📊 Changes
29 files changed (+1525 additions, -98 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+40 -1)📝
docs/development/ruleset-5e-2014.example.json(+18 -1)📝
docs/extending/ruleset.schema.json(+177 -1)📝
docs/extending/writing-rulesets.md(+63 -15)📝
docs/game/combat.md(+1 -1)📝
packages/client/src/components/game/DirectedCombatUI.tsx(+5 -0)📝
packages/client/src/components/game/GameCombatUI.tsx(+3 -0)📝
packages/client/src/components/game/RulesetCombatBoard.tsx(+4 -0)📝
packages/client/src/components/game/RulesetCombatMenu.tsx(+12 -0)📝
packages/client/src/lib/ruleset-combat-log.ts(+29 -1)📝
packages/client/src/localization/locales/en.json(+4 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+21 -0)📝
packages/server/src/services/game/ruleset-combat-director.service.ts(+20 -1)📝
packages/shared/src/features/combat-director.ts(+4 -1)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+25 -12)📝
packages/shared/src/features/ruleset-combat/index.ts(+5 -4)📝
packages/shared/src/features/ruleset-combat/options.ts(+31 -1)📝
packages/shared/src/features/ruleset-combat/resolve.ts(+139 -25)📝
packages/shared/src/features/ruleset-combat/types.ts(+65 -3)...and 9 more files
📄 Description
Linked issue
Closes #6728
Why this change
Shield, a Parry and Uncanny Dodge are all taken after an attack has hit and before its damage lands, and a ruleset fight had no such moment. An answer taken when an attack is aimed has to be spent before anyone knows whether it will hit, so a Shield written that way is wasted on every attack that would have missed. And a creature written in plain numbers could not hold a reaction at all, so the 5e package keeps every printed Parry as a trait. The conditions slice (#6719) gave conditions the numbers these answers need; this is the moment to take them in. This is C5g of real ruleset combat (plan doc, § Real ruleset combat).
What changed
Capability API 1.46 (file keys:
on: "hit"in a reaction, andreactionandselfon a creature's action). None of it names one game's words.hitis offered to the one an attack roll has just hit, before its damage, when they hold one. What they take counts for that attack: the roll is not made again but checked again against their defense as it now stands, so a guard can turn the hit into a miss, and a natural face that always hits still hits. A one-attack condition put on as the answer covers that attack's damage too and is spent by it, which is how "halve that attack's damage" is said. It cannot cancel.reactionobject a catalog entry does, andself: truefor one that lands on the creature itself. A sequence may not carry either or make a reaction, and a reaction is not also a signature action.en.json.selftakes no other target, a reaction is not a signature action).docs/extending/writing-rulesets.md): Windows gains the moment and "The moment after a hit", and the creature keys gainreactionandself. Not yet is updated: the stale bullet saying a number can only change before the roll is replaced by what is still missing (being hit without an attack roll, damage reduced by an amount, telling a swing from a shot).docs/game/combat.md), the plan doc's C5g notes, the shared resolver's comments (two still said a creature could not react and that there was no moment after a hit) and the CHANGELOG.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on
bd2dd2068(this branch's one commit on stagingc7bfc9e71), all exit 0:pnpm check,pnpm localization:check,pnpm version:check,pnpm regression:node(406/406),pnpm ruleset:schema(no diff after regeneration),pnpm smoke:ui(7/7), andpnpm regression:ui e2e/game-combat-director.e2e.ts e2e/ruleset-wound-sheet.e2e.ts e2e/ruleset-live-states.e2e.ts --project=desktop-chromium --workers=1(9/9, including both ruleset fights). Mobile projects were not run locally. Local CodeRabbit (CLI 0.8.1), two passes on this slice's changes: two findings, both fixed (the held hit's menu prompt now names the defense as the log does, and the set of catalog ids is built once per creature), then clean.New lane
scripts/regressions/game-ruleset-combat-hit.regression.tscovers:Twenty-six deliberate breaks were each caught, among them: never holding, holding inside a window, re-checking against the old defense, ignoring the natural face, losing the rest of the targets, losing the part of an action made of others, starting a held action's concentration again, forgetting who was already hurt, not spending the guard, the picker spending a guard that cannot turn the hit, and each half of the 1.46 gate. Two first slipped through (a natural 20 whose total also beat the raised defense, and no held attack that starts concentration), and both tests were tightened until they caught them.
scripts/regressions/ruleset-combat-director.regression.tsplays forty seeded fights with a Shield holder the Engine plays: hits are held, Shield is raised only when the recheck then misses, and blows it could not stop are let through. Writing this case found a real bug before the PR: a guard aimed at its own holder was scored as help for a friend and taken even when it could not turn the hit.Older lanes are adjusted:
Still to verify by hand (not done by the agent):
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
docs/extending/writing-rulesets.md(not carried bydocs-i18n)docs/game/combat.md(carried bydocs-i18n)docs/extending/ruleset.schema.jsondocs/development/ruleset-5e-2014.example.jsonanddocs/development/game-rulesets-and-sheets-implementation.md(internal)CHANGELOG.mdTranslations are batched into one
[docs-i18n]issue after the last ruleset slice, by the maintainer's standing decision, so no per-PR issue is opened here.UI evidence (if applicable)
None attached. The window prompt and log lines reuse the existing reaction window; the manual steps above cover what is new on screen.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.