mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6723] [MERGED] feat(game): numbers a condition changes in ruleset combat, check effects, one-use endings and levels #7297
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#7297
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/6723
Author: @kolacheee
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-combat-conditions📝 Commits (3)
cbc5e06feat(game): numbers a condition changes, check effects, one-use endings and levelsb47dc6dMerge remote-tracking branch 'origin/staging' into feat/ruleset-combat-conditionsd420587docs(changelog): name the flat changes a condition makes to rolls and speed📊 Changes
27 files changed (+2214 additions, -107 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+37 -2)📝
docs/development/ruleset-5e-2014.example.json(+16 -4)📝
docs/examples/rulesets/ember-roads.json(+17 -0)📝
docs/extending/ruleset.schema.json(+439 -1)📝
docs/extending/writing-rulesets.md(+65 -14)📝
docs/game/combat.md(+1 -1)📝
packages/client/src/lib/ruleset-combat-log.ts(+57 -10)📝
packages/client/src/localization/locales/en.json(+5 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+45 -0)📝
packages/server/src/services/game/ruleset-combat-director.service.ts(+1 -1)📝
packages/shared/src/features/ruleset-combat/encounter.ts(+95 -6)📝
packages/shared/src/features/ruleset-combat/index.ts(+16 -7)📝
packages/shared/src/features/ruleset-combat/options.ts(+127 -19)📝
packages/shared/src/features/ruleset-combat/resolve.ts(+107 -13)📝
packages/shared/src/features/ruleset-combat/types.ts(+50 -4)📝
packages/shared/src/schemas/capability-package.schema.ts(+7 -1)📝
packages/shared/src/schemas/ruleset.schema.ts(+139 -13)📝
scripts/generate-ruleset-schema.mjs(+65 -0)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+4 -4)...and 7 more files
📄 Description
Linked issue
Closes #6719
Why this change
A ruleset's condition could only switch effects on from a closed list; it could not change a number. So Shield (+5 Armor Class), Bless and Bane (a d4 on attacks and saves), Slow and Haste (half or double speed) could not be written, and the 5e package keeps Shield off the menu for exactly that reason. Poisoned and Frightened make ability checks harder, and a fight now has checks (contests), but nothing reached them. A condition's clock only counted down at the end of its holder's turns, so "until the start of your next turn" lasted a turn too long, and "until its next attack" could not be said at all. And exhaustion, which the 5e sheet already counts on a track, did nothing in a fight. The author guide's Not yet section listed all of this. This is C5f of real ruleset combat (plan doc, § Real ruleset combat).
What changed
Capability API 1.45 (file keys:
modifierson a combat condition,levelsin the combat block, the effectsown-checks-advantageandown-checks-disadvantage, andduration.atandendsAfteron an applied condition). None of it names one game's words.combat.conditions[].modifiersnames what each one changes and by how much.defense: a flat number, added to what an attack against the holder must reach.attacks,saves,checks: a flat number, or dice rolled every time the roll is made (minustakes them away).saveson the condition narrows modifiers to saves as it already narrows the save effects.speed: a flat change in the ruleset's own distance unit, ortimes0.5 or 2, applied after the flat changes. Read only on a board, asspeed-zerois.own-checks-advantageandown-checks-disadvantageroll the holder's side of a contest twice and keep one, where the ruleset rolls twice at all. The chance to win counts them and any modifier to checks.duration: { rounds, at: "turn-start" }counts down as the holder's turns begin.endsAfter(own-attack,attacked,own-save) takes the condition off after the first of those, with its own log line. One that lasts an attack lasts the whole of it, its damage included, and a fresh one the same blow puts on stays. A turn's walk is read again after the clocks that run as it begins, so a condition that ends then no longer shortens that turn's walk (existing save-ends at turn start benefit too).combat.levels: each names a plain live track, the level it starts at, and the effects, modifiers and failed saves it adds. Every level the track has reached counts as one of the holder's conditions, so they add up. A level cannot have an effect that needs a source or ends by itself, a wound track cannot have levels, one level is given once, and a level above a track's fixed top is refused as never reached.docs/extending/writing-rulesets.md): the combat key list gains the new effects, "Numbers a condition changes" andlevels, and the applied-condition text gainsatandendsAfter. Not yet is updated: the stale bullets saying a condition cannot change a number, cannot touch checks and cannot come in levels are replaced by what is still missing (the moment after a hit, a damage bonus, a level that lowers a maximum or takes somebody out).docs/game/combat.md), the plan doc's C5f notes, the shared resolver's header comment (which still said a condition could not change a number) and the CHANGELOG.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on
cbc5e0651(this branch's one commit on staging14773492f), all exit 0:pnpm check,pnpm localization:check,pnpm version:check,pnpm regression:node(403/403),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), six passes: nine findings. Seven were fixed:The seventh fix changed behaviour: a one-attack condition was spent right after the attack roll, so a one-attack ward would not have covered that attack's damage. It now lasts the whole blow, and a fresh one the same blow puts on stays (a detail the suggested fix would have got wrong). Two were declined with reasons: the log reading a contest's kept dice back from its total (exact, and a new field would change every contest event C5d shipped), and the install gate also reading
whileSourceInSightfor the check effects (a gate list can only name effects the condition has, soeffectsalready covers every file that imports).New lane
scripts/regressions/game-ruleset-combat-conditions.regression.tscovers:saves;Forty-six deliberate breaks were each caught, among them every refusal, the level threshold, save narrowing, both speed changes, each forecast, each roll's total, the minus sign, each one-use ending and when it is spent, the turn-start clock and the walk read again, every half of the 1.45 gate and the log's names. One first slipped through (the shortcut that skips conditions when nothing changes a number ignored levels), and a case on the shipped reference now catches it.
Older lanes are adjusted:
levels, which are rungs of Heat rather than a character level.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/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. What is new on screen is log text; the manual steps above cover it.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.