Harvest defeated creatures into inventory (Phase 2) #133

Merged
nasandre merged 1 commit from feature/harvest-flow into main 2026-10-03 11:07:50 +00:00
Owner

Phase 2 of the crafting & harvesting plan (docs/crafting-harvesting-shop-plan.md): the encounter-end harvesting flow, consuming the per-creature tables from #132.

What ships

  • Harvest action on encounters (GM permission): opens a panel listing the encounter's defeated creatures; each one's harvesting table drives the rolls - skill shown (Arcana/Nature/Medicine/Investigation by creature type), harvester + modifier inputs, d20 vs the row's DC. Failures ruin the part; successes collect in a harvest basket with harvester attribution.
  • Meat: creatures with meat yields get a Butcher roll by size (Large = 10d20+100 lbs etc.), valued at 5 cp/lb, spoiling in 1 day.
  • Morea time rules displayed per creature (10 min per component per harvester; Huge+ takes 30 minutes, two harvesters halve it) - informational, not enforced.
  • Commit to inventory: the basket lands in a linked party's inventory or a player character's equipment. Perishable parts carry their expiry days and a needs-preservation flag; inventory rows show an amber "Needs preservation" badge whose tooltip lists the six Morea methods (chemical, magical, smoke, drying, curing, freezing).
  • Rules engine in shared/src/services/harvestService.ts (DC gate, dice expressions, payload builders, preservation logic, time text) so the shop/crafting phases reuse the same implementation.

Validation

  • Frontend 33 files / 374 tests (13 new: DC gate, dice parsing, payload provenance/expiry/preservation, meat pricing, time rules), backend 34 suites / 740 tests, tsc clean x3.
  • Deployed and healthy; harvested rows are plain party-inventory items so no backend changes were needed.

Known notes

  • Harvest rolls are GM-side (roll for the harvester with their skill bonus); auto-computing character skill bonuses is a later refinement.
  • Old encounters whose statblock snapshots predate #132 offer no harvesting table until refreshSnapshots re-resolves them (encounter edits trigger that).
  • Preservation is a flag + badge in v1 per the agreed plan - no decay timers.
Phase 2 of the crafting & harvesting plan (docs/crafting-harvesting-shop-plan.md): the encounter-end harvesting flow, consuming the per-creature tables from #132. ## What ships - **Harvest action on encounters** (GM permission): opens a panel listing the encounter's defeated creatures; each one's harvesting table drives the rolls - skill shown (Arcana/Nature/Medicine/Investigation by creature type), harvester + modifier inputs, d20 vs the row's DC. **Failures ruin the part**; successes collect in a harvest basket with harvester attribution. - **Meat:** creatures with meat yields get a Butcher roll by size (Large = 10d20+100 lbs etc.), valued at 5 cp/lb, spoiling in 1 day. - **Morea time rules** displayed per creature (10 min per component per harvester; Huge+ takes 30 minutes, two harvesters halve it) - informational, not enforced. - **Commit to inventory:** the basket lands in a linked party's inventory or a player character's equipment. Perishable parts carry their expiry days and a `needs-preservation` flag; inventory rows show an amber **"Needs preservation"** badge whose tooltip lists the six Morea methods (chemical, magical, smoke, drying, curing, freezing). - **Rules engine** in `shared/src/services/harvestService.ts` (DC gate, dice expressions, payload builders, preservation logic, time text) so the shop/crafting phases reuse the same implementation. ## Validation - Frontend 33 files / **374 tests** (13 new: DC gate, dice parsing, payload provenance/expiry/preservation, meat pricing, time rules), backend 34 suites / **740 tests**, `tsc` clean x3. - Deployed and healthy; harvested rows are plain party-inventory items so no backend changes were needed. ## Known notes - Harvest rolls are GM-side (roll for the harvester with their skill bonus); auto-computing character skill bonuses is a later refinement. - Old encounters whose statblock snapshots predate #132 offer no harvesting table until `refreshSnapshots` re-resolves them (encounter edits trigger that). - Preservation is a flag + badge in v1 per the agreed plan - no decay timers.
Adds the encounter-end harvesting flow on top of the enriched monster
catalog:

- Encounters view gains a Harvest action (GM permission) opening a
  harvesting panel per defeated creature: the statblock's harvesting
  table drives each roll - skill shown (Arcana/Nature/Medicine/
  Investigation by creature type), harvester + modifier inputs, d20 vs
  the row's DC. Failures ruin the part (thievesguild rule); successes
  land in a harvest basket.
- Meat: creatures with meat yield a Butcher roll by size (10d20+100 for
  Large etc.), worth 5 cp per pound, spoiling in a day.
- Time limits are shown per the Morea rules (10 min per component per
  harvester; Huge+ takes 30 minutes, halved with two harvesters) -
  informational, not enforced.
- The basket commits into party inventory (encounter-linked parties) or
  a player character's equipment. Perishable parts carry their expiry
  and a needs-preservation flag; the inventory row shows an amber
  "Needs preservation" badge with the six Morea methods (chemical,
  magical, smoke, drying, curing, freezing) as tooltip guidance.
- shared/src/services/harvestService.ts holds the rules so tests and
  future surfaces (shop sell-back, crafting consumption) share them:
  DC gate, dice expressions, payload builders, preservation logic.

13 new unit tests (DC gate, dice parsing incl. 10d20+100, payload
provenance/expiry/preservation, meat pricing, Morea time rules).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nasandre/dnd-character-generator!133
No description provided.