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
+16 -11
View File
@@ -18,10 +18,12 @@ simulation tick, actor ID, source ID, destination ID, item ID, and transferred
amount, plus the authoritative world position captured when the fact is
recorded. NPC events preserve their authoritative interaction target (or NPC
position when no target applies); player extraction/depletion events preserve
the ResourceNode interaction position. `animal_fed` records one food moving
from `village_pantry` to a stable animal ID at the animal's authoritative
position. Actor `-1` identifies a player-triggered extraction or feeding until
persistent player identity is introduced.
the ResourceNode interaction position. NPC animal care records a
`storage_withdrawn` move from `village_pantry` to the matching caretaker
inventory at pickup, then an `animal_fed` move from that inventory to the
stable animal ID at delivery. Player `animal_fed` remains a direct
pantry-to-animal fact; actor `-1` identifies that player-triggered feeding or
extraction until persistent player identity is introduced.
Events are immutable facts about completed transfers. They do not perform the
transaction and are not replayed to reconstruct current state. Resource,
@@ -31,9 +33,9 @@ inventory, and storage records remain authoritative.
history/rate queries, including exact lookup through `get_by_id()`.
`VillageEconomy` performs inventory and storage transactions and requests event
records only after state changes succeed. `AnimalCareSystem` composes the
pantry withdrawal with animal hunger relief and requests `animal_fed` only
after both succeed. `SimulationManager` remains the scene-tree signal boundary
used by presentation.
exact carried-inventory removal with animal hunger relief and requests
`animal_fed` only after both succeed. `SimulationManager` remains the
scene-tree signal boundary used by presentation.
An action whose definition-backed completion cost becomes unavailable records
a zero-amount `task_blocked` narrative fact with stable action, source storage,
@@ -56,10 +58,13 @@ references, impossible communicator sources, relationship causes the observer
does not know, and next IDs that could collide with restored history.
Animal-feed facts receive an additional cross-record check: actor is either an
existing NPC or the player sentinel, source is the real pantry, destination is
an existing animal, item and definition cost are exactly one food, event tick
is not in the future, and the animal's `last_fed_tick` agrees with its latest
feed fact.
existing NPC or the player sentinel, destination is an existing animal, item
and definition cost are exactly one food, event tick is not in the future, and
the animal's `last_fed_tick` agrees with its latest feed fact. New NPC facts
emitted at runtime name that actor's matching inventory; player facts name the
pantry. Pantry-sourced NPC facts remain accepted as legacy-compatible v11
history rather than being silently rewritten into an invented carried
transfer.
Positive food deposits, positive NPC food withdrawals from `village_pantry`
into that actor's matching inventory, and definition-backed patrol/study