feat: define action completion costs

This commit is contained in:
Rijad Zuzo
2026-07-10 10:36:08 +02:00
parent 39989002ca
commit 0f7b12080e
19 changed files with 213 additions and 45 deletions
+10 -1
View File
@@ -63,7 +63,8 @@ func _run() -> void:
SimulationIds.ACTION_GATHER_FOOD,
-1.0,
"Test shortage reason",
{SimulationIds.ACTION_GATHER_FOOD: 4.5}
{SimulationIds.ACTION_GATHER_FOOD: 4.5, SimulationIds.ACTION_PATROL: -1000000.0},
{SimulationIds.ACTION_PATROL: "Needs 1 Wood (0.5 available)"}
)
manager.latest_decisions[npc.id] = test_decision
manager.emit_signal("npc_decision_recorded", npc, test_decision)
@@ -75,6 +76,14 @@ func _run() -> void:
and npc.npc_name in inspector_label.text,
"NPC inspector should show the selected villager's real decision reason"
)
_check(
(
"Unavailable" in inspector_label.text
and "Patrol — Needs 1 Wood" in inspector_label.text
and "-1000000" not in inspector_label.text
),
"NPC inspector should explain rejected actions without sentinel utility scores"
)
var carried_food: MeshInstance3D = visual.get_node("CarriedFood")
_check(not carried_food.visible, "NPC should begin without a carried-food prop")
npc.add_inventory(SimulationIds.RESOURCE_FOOD, 1.0)