feat: surface player routes for village needs

This commit is contained in:
Rijad Zuzo
2026-07-16 12:36:50 +02:00
parent d6e6a63048
commit 4f88d15e12
15 changed files with 417 additions and 47 deletions
+22 -1
View File
@@ -291,13 +291,34 @@ func _build_opportunity_helper_display() -> String:
return ""
var helper: OpportunityHelperResult = simulation_manager.get_active_opportunity_helper()
if helper == null:
return "\nPossible helper: none informed, trusted, and able to supply"
var player_text := _build_opportunity_player_response_display()
return "\nPossible helper: none informed, trusted, and able to supply" + player_text
return (
"\nPossible helper: %s%s\n%s"
% [_get_npc_name(helper.helper_npc_id), _get_action_name(helper.action_id), helper.reason]
)
func _build_opportunity_player_response_display() -> String:
if not simulation_manager.has_method("get_active_opportunity_player_response"):
return ""
var response: OpportunityPlayerResponseResult = (
simulation_manager.get_active_opportunity_player_response()
)
if response == null:
return ""
var source_suffix := "" if response.available_source_count == 1 else "s"
return (
"\nPlayer route: %s%s · %d finite source%s"
% [
_get_action_name(response.action_id),
String(response.target_id).replace("_", " ").capitalize(),
response.available_source_count,
source_suffix,
]
)
func _build_npc_opportunity_display(npc: SimNPC) -> String:
if not simulation_manager.has_method("get_latest_opportunity_for_npc"):
return ""