mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6608] [MERGED] feat(game): let a ruleset reaction name the moment it waits for #7253
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#7253
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/6608
Author: @kolacheee
Created: 9/24/2026
Status: ✅ Merged
Merged: 9/24/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-triggers📝 Commits (2)
d2d0ed1feat(game): a reaction says which moment it waits for5fe475ddocs(game): say who can really pay out of a bigger pool📊 Changes
27 files changed (+1467 additions, -97 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
docs/development/game-combat-rulesets-implementation.md(+6 -2)📝
docs/development/game-rulesets-and-sheets-implementation.md(+60 -0)📝
docs/development/optional-agent-packages.md(+25 -0)📝
docs/extending/ruleset.schema.json(+54 -1)📝
docs/extending/writing-rulesets.md(+48 -7)📝
packages/client/src/components/game/RulesetCombatMenu.tsx(+14 -3)📝
packages/client/src/lib/ruleset-combat-log.ts(+18 -2)📝
packages/client/src/localization/locales/en.json(+5 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+18 -0)📝
packages/server/src/services/game/ruleset-combat-director.service.ts(+139 -29)📝
packages/shared/src/features/combat-director.ts(+6 -0)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+22 -6)📝
packages/shared/src/features/ruleset-combat/index.ts(+15 -3)📝
packages/shared/src/features/ruleset-combat/options.ts(+83 -21)📝
packages/shared/src/features/ruleset-combat/resolve.ts(+239 -13)📝
packages/shared/src/features/ruleset-combat/types.ts(+47 -3)📝
packages/shared/src/schemas/capability-package.schema.ts(+9 -1)📝
packages/shared/src/schemas/ruleset.schema.ts(+37 -1)📝
scripts/generate-ruleset-schema.mjs(+15 -0)...and 7 more files
📄 Description
Linked issue
Closes #6607
Closes #6528
Why this change
A catalog entry marked
reaction: truesaid only that it is not taken on a turn. It never said what it waits for, so the Engine had nowhere to offer it, and every entry marked that way sat on no menu. The 5e package ships Counterspell, Hellish Rebuke, Shield and Feather Fall as reactions, and none of them could ever be cast.#6525 built the window a reaction is answered in. This lets an entry say which window it belongs in.
It also folds in #6528, because it is the same seam: a player could pay an ability out of a higher pool than it names, but the Engine's own picker only ever saw the base cost, so a party member handed to the Engine never cast a spell that grows any bigger, on a turn or in a window. Opponents are not part of it: a stat block's actions cost nothing off any pool, so an opponent, and so a Game Master's boss, has nothing to climb. (#6528 said otherwise; that premise was wrong, and the issue has a comment saying so.)
What changed
mechanics.reactionmay name the moment. An object instead oftrue:onisaimed(before something lands on the holder) orharmed(after something has hurt them);atissource(whoever caused the moment, filled in) orchosen(the entry's own targets, the holder picks);cancelsstops what the window was holding. Onlyaimedmay cancel.trueandfalsebehave exactly as before.aimedholds the action before it resolves, and asks everybody on the other side it is pointed at who holds something waiting for that moment. What it cost is already spent, so cancelling stops it from happening rather than from having been bought. A friend's action, such as a heal, opens no window.harmedopens after the action resolves, read off the damage the action itself wrote, so the resolver knows nothing about windows. One blow that hurts three people opens one window listing all three.freereaction needs no budget; a pool the window did not offer is refused asbad-pool; autilityentry that cancels counts as doing something; a fight saved mid-walk by #6525, whose resume carries nokind, is finished as the walk it can only be.docs/extending/ruleset.schema.jsoncarries the "only aimed may cancel" rule, which the generator patches in by shape because it cannot see a refinement.optional-agent-packages.mdgains a Capability API 1.33 section.Still not expressible, and said so in the docs: a chain of windows (a counter cannot itself be countered), a reaction that changes a number on what it answers rather than stopping it, and any refund of what a cancelled action cost.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdFor the reviewer's information rather than in place of the boxes:
pnpm checkexits 0 and the fullpnpm regressionlane passes 369/369, on this branch rebased ontostagingatd1c5fee55. Local CodeRabbit sweeps were run until three consecutive rounds came back with no findings. Every finding before that was fixed except two, declined with reasons: aponytail:marker CodeRabbit read as stray is this repository's convention for a named ceiling, and extending the upcast coverage to a Game Master's boss is impossible because a stat block action carries no pool cost. Among the fixes: a backward-compatibility break (reaction: falsehas been legal since the key existed and would have been refused), a reaction that could be aimed at a source already taken out, a friend's heal that an ally played by the Engine could have cancelled, and a fight saved mid-walk that would have been left standing.Each behaviour above has a regression, and each regression was mutation-tested: the fix was switched off, with the replaced text asserted to exist first, and the test was seen to fail.
Manual verification notes
Needs a real fight in a browser with a ruleset whose catalog names a moment. The shipped 5e package does not yet; it will once its next release adopts 1.33. Until then, an edited catalog entry is enough.
"reaction": { "on": "aimed", "cancels": true }is not on its holder's turn menu."on": "harmed".harmedreaction pointed at the source shows no target picker and lands on whoever dealt the damage.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/extending/writing-rulesets.mdanddocs/development/optional-agent-packages.mdchanged, so both belong in the batched[docs-i18n]follow-up rather than an issue of their own.UI evidence (if applicable)
None yet. The only new UI is two wordings of the existing window prompt and one new log line, and both want a real fight rather than a screenshot of a fixture.
Summary by CodeRabbit
New Features
Compatibility
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.