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
+11 -4
View File
@@ -192,9 +192,13 @@ func _run() -> void:
var dunja_hunger_before := dunja_state.get_hunger()
var dunja_fed_tick_before := dunja_state.get_last_fed_tick()
var dunja_reservation_before := dunja_state.get_reserved_by()
_check(
manager.animal_care.collect_feed_supply(zora_caretaker),
"The restored caretaker should collect one real pantry food for Zora",
)
_check(
manager.feed_animal(SimulationIds.ANIMAL_ZORA, zora_caretaker_id),
"The restored exact Zora claim should complete one real feed operation",
"The restored exact Zora claim should deliver its carried food",
)
_check(
(
@@ -212,20 +216,23 @@ func _run() -> void:
)
_check(
is_equal_approx(pantry.get_amount(SimulationIds.RESOURCE_FOOD), pantry_food_before - 1.0),
"Feeding exactly one goat should consume exactly one pantry food",
"Collecting for exactly one goat should withdraw exactly one pantry food",
)
var feed_event := _latest_feed_event(manager)
_check(
(
feed_event != null
and int(feed_event.data["actor_id"]) == zora_caretaker_id
and StringName(feed_event.data["source_id"]) == SimulationIds.STORAGE_VILLAGE_PANTRY
and (
StringName(feed_event.data["source_id"])
== SimulationIds.npc_inventory_id(zora_caretaker_id)
)
and StringName(feed_event.data["destination_id"]) == SimulationIds.ANIMAL_ZORA
and StringName(feed_event.data["item_id"]) == SimulationIds.RESOURCE_FOOD
and is_equal_approx(float(feed_event.data["amount"]), 1.0)
and feed_event.get_world_position().is_equal_approx(zora_state.get_position())
),
"The feed event should record the exact caretaker, pantry, Zora destination, and amount",
"The feed event should record the exact caretaker inventory, Zora, and amount",
)
_finish()