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
+7 -1
View File
@@ -222,11 +222,17 @@ func begin_pantry_restock() -> bool:
var interested := _get_npc(_interested_villager_id)
if helper == null or interested == null or simulation_manager.get_active_opportunity() == null:
return false
var opportunity_helper: OpportunityHelperResult = (
simulation_manager.get_active_opportunity_helper()
)
if opportunity_helper == null or opportunity_helper.helper_npc_id != helper.id:
return false
var selection: ActionSelectionResult = simulation_manager.action_selector.select_action(
helper,
simulation_manager.village,
simulation_manager.clock.time_of_day(),
simulation_manager.npcs
simulation_manager.npcs,
opportunity_helper
)
if (
selection == null