mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#7370
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/6891
Author: @kolacheee
Created: 9/30/2026
Status: ✅ Merged
Merged: 9/30/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-items-charges-over-time📝 Commits (4)
65c4f26feat(rulesets): charges regained on rests, and items that break when emptied (#6888)73d33d7Merge commit '60fb1aad7' into feat/ruleset-items-charges-over-time71bb8d5fix(rulesets): the Rest buttons wait for the Engine's answer, so a double click rests once (#6888)0d9e0feMerge remote-tracking branch 'origin/staging' into feat/ruleset-items-charges-over-time📊 Changes
37 files changed (+1437 additions, -63 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+30 -0)📝
docs/examples/rulesets/gravewatch.json(+6 -1)📝
docs/extending/ruleset.schema.json(+65 -0)📝
docs/extending/writing-rulesets.md(+9 -2)📝
docs/game/party-and-npcs.md(+1 -1)➕
e2e/game-ruleset-item-charges.e2e.ts(+111 -0)📝
e2e/game-ruleset-item-use.e2e.ts(+4 -1)📝
packages/client/src/components/game/GameCharacterSheet.tsx(+3 -0)📝
packages/client/src/components/game/GameRulesetSheet.tsx(+18 -2)📝
packages/client/src/components/game/GameSurface.tsx(+37 -1)📝
packages/client/src/components/game/RulesetItemPicker.tsx(+16 -0)📝
packages/client/src/lib/ruleset-combat-log.ts(+2 -0)📝
packages/client/src/localization/locales/en.json(+8 -1)📝
packages/server/src/routes/game-inventory.routes.ts(+24 -1)📝
packages/server/src/routes/generate.routes.ts(+47 -13)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+16 -0)📝
packages/server/src/services/game/game-item-use.service.ts(+143 -0)📝
packages/server/src/services/game/gm-prompts.ts(+10 -1)📝
packages/server/src/services/game/ruleset-sheet-turn.service.ts(+4 -2)...and 17 more files
📄 Description
Linked issue
Closes #6888
This builds on #6889 (using items outside a fight), now merged; staging is merged in, so the diff is this slice alone.
Why this change
What changed
charges.recharge(Capability API 1.61): which of the ruleset'srestsbring the charges back, and how many ("max", or an amount with the Engine's dice), never past the most. A rest refills the items its character carries (the player's own bag for the player's card), and a full count reads as full again.POST /api/game/inventory/rest): the rest on the character's sheet and the charges it brings back to their bag, in one transaction, after any sheet edit still waiting to be saved has landed. The screen takes the sheet from the answer the same way #6889's Use does, so an older answer never puts back a newer one. The line under the rest buttons says what came back ("Stand down from the vigil; Dawn bell 3/3 charges"). A game whose ruleset has no items rests on the sheet as before.[sheet: op="rest"], including a party rest) refills what each rested character carries when the reply is saved, from where the turn began, so a regenerated reply recharges once. Sheet commands now report each rest taken, per character.charges.breaksOn: when a use spends the last charge, the Engine rolls a ddie, and at or underatMostthe item breaks and is gone from the bag, in a fight and outside one. The fight log says so ("Dawn bell breaks (a 1 on its die)."), the Use button's report does, and the journal counts the item lost.rechargeandbreaksOnkeys and the capability list indocs/extending/writing-rulesets.md(whose line saying nothing refills charges yet is replaced), the Rest buttons indocs/game/party-and-npcs.md, the 1.61 record indocs/development/game-rulesets-and-sheets-implementation.md, the regenerated JSON schema and a CHANGELOG entry.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Local run on this branch (Fedora):
pnpm check,pnpm localization:checkand prettier: clean.pnpm regression: 475 of 476 on the full run. The one failure wastermux-sharp, whose offline install found two tarballs missing from this machine's pnpm store (@emnapi/runtime1.11.3,@img/sharp-wasm320.35.4). With them added to the store it passes; this PR changes nothing it covers.pnpm smoke:ui: 7 passed.Lanes:
game-ruleset-item-charges.regression.ts: every import refusal; the 1.61 gate (the example, a break alone, a catalog file); a bell cracking on its last charge in a fight (the event, the log line, the write-back and a "lost" journal line), holding on anything over the break, never rolling while charges remain, and never breaking withoutbreaksOn; the same outside a fight; recharging one bag for one rest (all, an amount, never past the most, another bag or rest untouched, a full item left alone); the Game Master's party rest counted per character and refilling the player's and a member's bag; the charges left in the Game Master's inventory line; the Rest route through Fastify (the sheet and the bag written together, a member's own bag, 404, 409 with its reason, 400); item facts and the Game Master's line.game-inventory-turn.regression.tsgains a real turn: the Game Master's rest refills the bell by one, a regenerated reply leaves it at one, and the next prompt says "1 of 3 charges left".e2e/game-ruleset-item-charges.e2e.ts: in Gravewatch, a bound dawn bell rung empty shows what refills and breaks it and "0 of 3 charges left", and standing Bram down from the vigil on his sheet says "Dawn bell 3/3 charges" and leaves the saved bell full.35 deliberate breaks, each caught by these lanes (two were missed on the first run, a spare charge rolling for a break outside a fight and the Rest route dropping a pool it left low, and each got its own case).
Local CodeRabbit on this slice raised two trivial findings, both declined with reasons: the Rest button's
onRestpromise never rejects (its only implementation catches every failure, toasts and resolves null), and a negative rolled recharge cannot take charges away (Math.max(before, ...)already keeps them).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,docs/game/party-and-npcs.mdanddocs/development/game-rulesets-and-sheets-implementation.md(all carried bydocs-i18n),CHANGELOG.md, the generateddocs/extending/ruleset.schema.jsonand the Gravewatch example. Translations: #6813 is the items arc's follow-up; this PR is added to it there.UI evidence (if applicable)
In a Gravewatch game, Bram's sheet after "Stand down from the vigil" says "Stand down from the vigil; Dawn bell 3/3 charges", and the bell's details read "Use (Act): Steel save of 7 negates it, Rattled, spends 1 of 3 charges, regains all on Stand down from the vigil, breaks on a 1 on a d20 when emptied" (captured by
e2e/game-ruleset-item-charges.e2e.tsasruleset-rest-recharge.png).Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.