feat: add physical animal care delivery
This commit is contained in:
@@ -18,6 +18,7 @@ func _run() -> void:
|
||||
|
||||
var goat := main_scene.get_node("JajceWorld/WorldObjects/Animals/Dunja") as AnimalNode
|
||||
var player := main_scene.get_node("Player") as Node3D
|
||||
var pantry_node := StorageNode.get_by_id(SimulationIds.STORAGE_VILLAGE_PANTRY) as StorageNode
|
||||
var pantry: StorageStateRecord = manager.get_pantry()
|
||||
var state: AnimalStateRecord = manager.animal_care.get_state(SimulationIds.ANIMAL_DUNJA)
|
||||
_check(goat != null, "Jajce should load Dunja's named presentation")
|
||||
@@ -81,9 +82,23 @@ func _run() -> void:
|
||||
(
|
||||
caretaker.target_id == SimulationIds.ANIMAL_DUNJA
|
||||
and state.get_reserved_by() == caretaker.id
|
||||
and pantry_node != null
|
||||
and caretaker.travel_target_position.is_equal_approx(
|
||||
pantry_node.get_interaction_position()
|
||||
)
|
||||
),
|
||||
"Animal target resolution should retain Dunja's exact claim while routing to the pantry"
|
||||
)
|
||||
manager.notify_npc_arrived(caretaker.id)
|
||||
_check(
|
||||
(
|
||||
is_equal_approx(caretaker.get_inventory_amount(SimulationIds.RESOURCE_FOOD), 1.0)
|
||||
and caretaker.target_id == SimulationIds.ANIMAL_DUNJA
|
||||
and state.get_reserved_by() == caretaker.id
|
||||
and caretaker.task_state == SimNPC.TASK_STATE_TRAVELING
|
||||
and caretaker.travel_target_position.is_equal_approx(goat.get_interaction_position())
|
||||
),
|
||||
"Animal target resolution should claim Dunja's loaded interaction point by stable ID"
|
||||
"Pantry arrival should carry one real food toward the same reserved Dunja",
|
||||
)
|
||||
manager.notify_npc_arrived(caretaker.id)
|
||||
manager.simulate_tick()
|
||||
@@ -115,14 +130,15 @@ func _run() -> void:
|
||||
npc_feed_event != null
|
||||
and int(npc_feed_event.data["actor_id"]) == caretaker.id
|
||||
and (
|
||||
StringName(npc_feed_event.data["source_id"]) == SimulationIds.STORAGE_VILLAGE_PANTRY
|
||||
StringName(npc_feed_event.data["source_id"])
|
||||
== SimulationIds.npc_inventory_id(caretaker.id)
|
||||
)
|
||||
and (StringName(npc_feed_event.data["destination_id"]) == SimulationIds.ANIMAL_DUNJA)
|
||||
and StringName(npc_feed_event.data["item_id"]) == SimulationIds.RESOURCE_FOOD
|
||||
and is_equal_approx(float(npc_feed_event.data["amount"]), 1.0)
|
||||
and npc_feed_event.get_world_position().is_equal_approx(state.get_position())
|
||||
),
|
||||
"NPC feeding should record one exact pantry-to-animal transfer fact"
|
||||
"NPC feeding should record one exact carried-inventory-to-animal transfer fact"
|
||||
)
|
||||
_check(
|
||||
(
|
||||
@@ -172,7 +188,7 @@ func _run() -> void:
|
||||
and int(player_feed_event.data["actor_id"]) == -1
|
||||
and (StringName(player_feed_event.data["destination_id"]) == SimulationIds.ANIMAL_DUNJA)
|
||||
),
|
||||
"The player should use the same one-food feed operation and event contract"
|
||||
"The player should use the same exact one-food animal mutation"
|
||||
)
|
||||
var player_feed_json: String = manager.serialize_state()
|
||||
_check(
|
||||
|
||||
Reference in New Issue
Block a user