feat: let opportunity helpers act autonomously

This commit is contained in:
Rijad Zuzo
2026-07-16 10:58:48 +02:00
parent eaa15c076c
commit 0332c57a89
14 changed files with 253 additions and 30 deletions
+2 -2
View File
@@ -156,7 +156,6 @@ func simulate_tick() -> void:
tick_count += 1
if debug_logs:
print("--- Tick ", tick_count, " ---")
var village_was_changed := false
for npc in npcs:
village_was_changed = _simulate_npc_tick(npc) or village_was_changed
@@ -207,7 +206,8 @@ func _select_action_if_idle(npc: SimNPC, previous_state: StringName) -> void:
return
if npc.task_state not in [SimNPC.TASK_STATE_IDLE, SimNPC.TASK_STATE_COMPLETE]:
return
var selection := action_selector.select_action(npc, village, clock.time_of_day(), npcs)
var helper := get_active_opportunity_helper()
var selection := action_selector.select_action(npc, village, clock.time_of_day(), npcs, helper)
if selection == null:
return
latest_decisions[npc.id] = selection