mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6715] [MERGED] feat(game): counters in ruleset combat: a reaction that answers an entry being used #7296
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#7296
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/6715
Author: @kolacheee
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-moments📝 Commits (1)
a63fa18feat(game): a reaction that answers an entry being used, and what it answers📊 Changes
30 files changed (+823 additions, -84 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+28 -1)📝
docs/examples/rulesets/ember-roads.json(+28 -0)📝
docs/extending/ruleset.schema.json(+26 -2)📝
docs/extending/writing-rulesets.md(+37 -13)📝
docs/game/combat.md(+2 -0)📝
packages/client/src/components/game/RulesetCombatMenu.tsx(+1 -0)📝
packages/client/src/lib/ruleset-combat-log.ts(+1 -0)📝
packages/client/src/localization/locales/en.json(+2 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+19 -0)📝
packages/server/src/services/game/ruleset-combat-director.service.ts(+1 -1)📝
packages/shared/src/features/combat-director.ts(+1 -1)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+3 -0)📝
packages/shared/src/features/ruleset-combat/options.ts(+11 -2)📝
packages/shared/src/features/ruleset-combat/resolve.ts(+59 -22)📝
packages/shared/src/features/ruleset-combat/types.ts(+20 -6)📝
packages/shared/src/schemas/capability-package.schema.ts(+6 -1)📝
packages/shared/src/schemas/ruleset.schema.ts(+24 -6)📝
scripts/generate-ruleset-schema.mjs(+3 -2)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+4 -4)...and 10 more files
📄 Description
Linked issue
Closes #6712
Why this change
A ruleset could not write a counter. An entry could wait for two moments:
aimed(something is about to be done to its holder) andharmed(something just hurt its holder). Neither fits a counter. It answers somebody using something wherever it reaches, including a blast aimed at a friend, and it answers only some kinds of thing: a spell, not a sword swing. A counter written onaimedwould call off an axe aimed at its holder and could never protect a friend. That is why the 5e package ships Counterspell asreaction: true, which does nothing. This is C5e of real ruleset combat (plan doc, § Real ruleset combat).What changed
Capability API 1.44 (file keys:
on: "used"andagainstin a catalog entry'smechanics.reaction). None of it names one game's words.usedmoment. An entry whose reaction sayson: "used"answers somebody on the other side using something, whoever it is aimed at.range(or reach), with line of sight, even for a counter that points at nobody.cancelsis allowed on it, as onaimed. What the stopped action cost stays spent.against: { catalogs: [...] }on any moment: only an action built from an entry of one of those catalogs opens the moment for this entry. A weapon row or a creature's own action has no entry behind it, so it never matches. Catalog ids are checked at import.en.json.usedanswer that strikes back by what it does to whoever used the thing, the same as foraimedandharmed.usedoragainstneeds 1.44. Published schema: regenerated; the generator's hand patch now allowscancelsonused.{ "on": "used", "against": { "catalogs": ["spells"] }, "cancels": true }for Counterspell once 1.44 is on staging.docs/extending/writing-rulesets.md): the Windows section gains theusedmoment,against, the order and an example. Not yet is updated: it now lists three moments, drops "a spell being cast as such" from the missing ones, and says a counter cannot tell one entry from another or need a check against something bigger. A stale line saying no entry could name the moment it waits for is replaced.docs/game/combat.md), the plan doc's C5e notes and the CHANGELOG.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on
a63fa1834(this branch's one commit on staging77d4b0e57), all exit 0:pnpm check,pnpm localization:check,pnpm version:check,pnpm regression:node(402/402),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). The browser runs were on the same tree before the squash; the squash changed no file. Mobile projects were not run locally. Local CodeRabbit (CLI 0.8.1) completed one pass with zero findings; earlier attempts on CLI 0.7.6 lost their connection before finishing.New lane
scripts/regressions/game-ruleset-combat-moments.regression.tscovers:harmedreaction that cancels, an unknown catalog);usedwindow: who is asked (only the other side, whoever the use is aimed at), its event, its menu, a cancel and its price, and letting it go;against: an axe opens nothing for a counter that answers knacks, and opens it once the counter names no catalog;usedbeforeaimed, nothing aimed after a cancel, and no chain;Twenty deliberate breaks were each caught, among them: dropping the reach check, the catalog filter, the side filter, the used trigger's catalog, the
aimedwindow after an uncancelled use, and each half of the 1.44 gate. Writing the board case found a real bug before the PR: a counter that cancels ignored its own range. It is fixed here.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/examples/rulesets/ember-roads.jsondocs/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's menu and log line 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.