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#7374
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/6900
Author: @kolacheee
Created: 9/30/2026
Status: ✅ Merged
Merged: 9/30/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-items-loot📝 Commits (2)
ef57869feat(rulesets): loot on victory, ruleset loot tables and creature loot (#6894, #6758)1ff4725fix(game): a fight's recap reaches the chat it ended in, even when the player has left it (#6894)📊 Changes
42 files changed (+1991 additions, -167 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+40 -0)📝
docs/examples/rulesets/gravewatch.json(+16 -0)📝
docs/extending/ruleset.schema.json(+106 -0)📝
docs/extending/writing-rulesets.md(+31 -1)📝
docs/game/combat.md(+1 -1)➕
e2e/game-ruleset-loot.e2e.ts(+344 -0)📝
packages/client/src/components/game/GameSurface.tsx(+114 -74)📝
packages/client/src/components/game/game-narration-format.ts(+8 -0)📝
packages/client/src/localization/locales/en.json(+2 -0)📝
packages/server/src/db/seed-mari.ts(+1 -1)📝
packages/server/src/routes/combat-director.routes.ts(+33 -0)📝
packages/server/src/routes/game-inventory.routes.ts(+20 -0)📝
packages/server/src/routes/game.routes.ts(+0 -35)📝
packages/server/src/routes/generate.routes.ts(+14 -1)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+17 -0)📝
packages/server/src/services/game/combat-director.service.ts(+5 -0)➕
packages/server/src/services/game/game-loot.service.ts(+193 -0)📝
packages/server/src/services/game/gm-prompts.ts(+10 -0)📝
packages/server/src/services/game/loot.service.ts(+21 -13)...and 22 more files
📄 Description
Linked issue
Closes #6894
Closes #6758
Why this change
What changed
loot.service.ts, whose randomness is now injectable): more and rarer drops on a harder game, into the player's bag, as every weightless item goes.POST /api/game/inventory/lootwhen it ends, keyed by the message that started it and remembered beside the stacks, so a win reported twice drops once. A fight with no starting message asks for nothing, and the Game Master decides the reward as before. The unused/api/game/combat/lootand/api/game/loot/generateroutes are gone.items.lootTables(Capability API 1.63):rolls(a number or dice), and weighted lines that name an item of the ruleset's catalogs or afilterby rarity, category and tag, each with acount. A bestiary creature'slootnames its table. An item a layer takes out drops nothing. Unknown catalogs, items, words and tables are refused at import. The install gate asks for 1.63 in the ruleset file and in bestiary catalog files, last of all its checks, so a package declaring an older minor hears first about what that minor lacks.[loot: table="..." who="..."]rolls a table in the story, measured from where the turn began like its inventory tags, with its own seeded dice, so a regenerated reply drops once. Each item that drops is answered as a resolved inventory add, so the screen announces it and the next turn reads it back like any add. A table that drops nothing, or a refused tag, keeps its place. The tag is reserved, hidden from the narration, shown as a badge in the session log, and taught to the Game Master only where the ruleset has tables.lootTablesand creaturelootkeys and the capability list indocs/extending/writing-rulesets.md, the loot paragraph ofdocs/game/combat.md, the 1.63 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: 478 of 478.pnpm smoke:ui: 7 passed.Lanes:
game-ruleset-loot.regression.ts: every import refusal; the 1.63 gate (the ruleset file, tables alone, a creature's loot alone, a bestiary in its own file); rolling a table (picks, weights, counts adding up, a filter picking evenly, a filter by tag, an item a layer took out, a filter that finds none, no picks, no such table); the native tables' counts; what nobody can carry, left behind and said; the loot route through Fastify (the native drop into the player's bag, the same fight twice, the next fight, 404 and 400); a ruleset with tables dropping nothing for a fight without bestiary creatures, and planning its tables into the shared view; native items on and off without tables; a directed Ember fight won through the director's routes, whose moth's table drops into the bags and stays said on the next read; and the Game Master's[loot:](resolved adds,who=, every refusal, nothing dropped, the seeded roll, the narration strip and its instructions).game-inventory-turn.regression.tsgains a real turn: the Game Master's[loot:]drops what the saved reply says, and a regenerated reply holds only its own drop.e2e/game-ruleset-loot.e2e.ts: a Classic fight without a ruleset opens on its Victory, and Continue drops the native loot into the player's bag, shows "Loot: ...", and tells the Game Master; a directed ruleset fight won through the director shows Continue story, the recap names the moth's drop, and the screen never asks the loot route again.40 deliberate breaks, each caught by these lanes and the e2e. Five slipped past on the first run. Four got their own cases: creature loot alone in the ruleset file, a filter by tag, the native tables' random share of drops, and what nobody can carry. The fifth showed that an explicit strip for
[loot:]in the narration was dead code, since its catch-all already hides any[word:tag, so that line was deleted.Local CodeRabbit raised one finding, which was real: when a fight had no starting message, the screen made up a key from the clock, which would defeat the once-per-fight guard. Fixed: without that message the screen does not ask for loot, and the Game Master decides the reward as before. A rerun on the fix found nothing.
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/combat.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)
After a won Classic fight in a game without a ruleset, the notification reads "Loot: Steel Breastplate, Gemstone ×5" (captured by
e2e/game-ruleset-loot.e2e.tsasloot-native.png; the red wash in that capture is the fight's own end transition, which fades on its own).Summary by CodeRabbit
[loot:]during narration, and the results are added to inventory.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.