feat: add physical animal care delivery

This commit is contained in:
Rijad Zuzo
2026-07-31 00:19:41 +02:00
parent 7d410d8193
commit ead75fca68
25 changed files with 1469 additions and 191 deletions
+24 -7
View File
@@ -16,12 +16,22 @@ ResourceStateRecord (berry bush)
Food is conserved across source, carried inventory, and pantry. It leaves the
world only when consumed.
Animal care extends the same ownership chain without a parallel counter:
```text
village_pantry
-> feed_animal pickup moves one food into exact caretaker inventory
-> existing carried-food prop derives from that inventory
-> delivery consumes caretaker inventory into exact named animal
```
## Authority
- `StorageStateRecord` owns pantry and woodpile contents and capacity.
- `SimNPC.inventory` owns carried item amounts.
- `VillageEconomy` performs deposit, withdrawal, consumption, and
definition-backed completion-cost transactions.
definition-backed completion-cost transactions, including exact
all-or-nothing animal-care pickup and inventory removal.
- `SimulationManager` coordinates action lifecycle and exposes the transaction
results to presentation.
- `village.food` and `village.wood` are synchronized aggregate views used by
@@ -40,6 +50,8 @@ Successful extraction, deposit, withdrawal, and consumption also append
structured economic facts. See [the economic event stream](ECONOMIC_EVENTS.md).
Active NPCs display a small food sack while their authoritative inventory
contains food; this is presentation derived from state, not a second inventory.
NPC animal care therefore uses the same visible prop between pantry pickup and
the claimed goat.
## Failure behavior
@@ -50,23 +62,28 @@ Transactions apply the amount actually available:
- player extraction is limited to storage capacity until player inventory
exists, so overflow remains at the source;
- withdrawal cannot exceed pantry contents;
- animal-care pickup succeeds only when the complete missing cost is available;
- eating succeeds only when the NPC carries one food.
If another NPC empties the pantry first, withdrawal returns zero and the NPC
replans on its next idle tick.
If another caretaker empties the pantry first, animal-care pickup records the
definition-backed shortfall, transfers nothing, releases only the losing
caretaker's exact animal claim, and replans. A caretaker that already carries
the unit never consults pantry stock again before delivery.
## Deliberate limits
This slice contains one authored pantry and one carried item type. It does not
yet add:
The current bounded economy has one authored pantry and one woodpile with
simple food/wood stacks. It does not yet add:
- player inventory;
- storage reservations or access capacity;
- multiple households or ownership;
- spoilage, item quality, weight, or stack definitions.
Economic transfer events exist, but event retention, denial/depletion facts,
witnesses, and social interpretation are deliberately deferred.
Objective event history, depletion and blocked-task facts, bounded per-NPC
knowledge, proximity witnesses, and the first social consequences now exist.
Long-run event archival, generalized denial facts, wider witness models, and
broader social interpretation remain deferred.
Those should extend the transaction boundary rather than mutate counters
directly.