feat: add weak-villager and damaged-roof village needs
This commit is contained in:
+84
-23
@@ -268,15 +268,41 @@ func _build_active_opportunity_display() -> String:
|
||||
var resource_name := String(opportunity.get_resource_id()).capitalize()
|
||||
var current_amount := _get_opportunity_current_amount(opportunity)
|
||||
var helper_text := _build_opportunity_helper_display()
|
||||
if opportunity.get_opportunity_type() == SimulationIds.OPPORTUNITY_SUPPLY_MISSING_WOOD:
|
||||
var action_name := _get_opportunity_action_name(opportunity)
|
||||
return (
|
||||
"\n\nVillage need\n"
|
||||
+ "◆ Supply wood for blocked work\n"
|
||||
+ "%s could not finish %s\n" % [interested_name, action_name]
|
||||
+ "%s %.0f / %.0f" % [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
+ helper_text
|
||||
)
|
||||
match opportunity.get_opportunity_type():
|
||||
SimulationIds.OPPORTUNITY_SUPPLY_MISSING_WOOD:
|
||||
var action_name := _get_opportunity_action_name(opportunity)
|
||||
return (
|
||||
"\n\nVillage need\n"
|
||||
+ "◆ Supply wood for blocked work\n"
|
||||
+ "%s could not finish %s\n" % [interested_name, action_name]
|
||||
+ (
|
||||
"%s %.0f / %.0f"
|
||||
% [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
)
|
||||
+ helper_text
|
||||
)
|
||||
SimulationIds.OPPORTUNITY_FEED_WEAK_VILLAGER:
|
||||
return (
|
||||
"\n\nVillage need\n"
|
||||
+ "◆ Bring food to %s\n" % interested_name
|
||||
+ "%s is too weak to gather\n" % interested_name
|
||||
+ (
|
||||
"%s %.0f / %.0f"
|
||||
% [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
)
|
||||
+ helper_text
|
||||
)
|
||||
SimulationIds.OPPORTUNITY_REPAIR_HOME_ROOF:
|
||||
return (
|
||||
"\n\nVillage need\n"
|
||||
+ "◆ Repair %s's roof\n" % interested_name
|
||||
+ "%s is worried about their damaged home\n" % interested_name
|
||||
+ (
|
||||
"%s %.0f / %.0f"
|
||||
% [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
)
|
||||
+ helper_text
|
||||
)
|
||||
return (
|
||||
"\n\nVillage need\n"
|
||||
+ "◆ Restock the empty pantry\n"
|
||||
@@ -328,15 +354,34 @@ func _build_npc_opportunity_display(npc: SimNPC) -> String:
|
||||
var resource_name := String(opportunity.get_resource_id()).capitalize()
|
||||
if opportunity.get_status() == OpportunityStateRecord.STATUS_OPEN:
|
||||
var current_amount := _get_opportunity_current_amount(opportunity)
|
||||
if opportunity.get_opportunity_type() == SimulationIds.OPPORTUNITY_SUPPLY_MISSING_WOOD:
|
||||
return (
|
||||
"Open village need\n"
|
||||
+ "◆ Find wood for %s\n" % _get_opportunity_action_name(opportunity)
|
||||
+ (
|
||||
"%s %.0f / %.0f\n\n"
|
||||
% [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
match opportunity.get_opportunity_type():
|
||||
SimulationIds.OPPORTUNITY_SUPPLY_MISSING_WOOD:
|
||||
return (
|
||||
"Open village need\n"
|
||||
+ "◆ Find wood for %s\n" % _get_opportunity_action_name(opportunity)
|
||||
+ (
|
||||
"%s %.0f / %.0f\n\n"
|
||||
% [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
)
|
||||
)
|
||||
SimulationIds.OPPORTUNITY_FEED_WEAK_VILLAGER:
|
||||
return (
|
||||
"Open village need\n"
|
||||
+ "◆ %s is too weak to gather\n" % npc.npc_name
|
||||
+ (
|
||||
"%s %.0f / %.0f\n\n"
|
||||
% [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
)
|
||||
)
|
||||
SimulationIds.OPPORTUNITY_REPAIR_HOME_ROOF:
|
||||
return (
|
||||
"Open village need\n"
|
||||
+ "◆ %s's roof needs wood\n" % npc.npc_name
|
||||
+ (
|
||||
"%s %.0f / %.0f\n\n"
|
||||
% [resource_name, current_amount, opportunity.get_target_amount()]
|
||||
)
|
||||
)
|
||||
)
|
||||
return (
|
||||
"Open village need\n"
|
||||
+ "◆ Restock the empty pantry\n"
|
||||
@@ -364,12 +409,28 @@ func _build_npc_opportunity_display(npc: SimNPC) -> String:
|
||||
if resolution_event != null:
|
||||
var actor_id := int(resolution_event.data["actor_id"])
|
||||
actor_name = "Player" if actor_id < 0 else _get_npc_name(actor_id)
|
||||
if opportunity.get_opportunity_type() == SimulationIds.OPPORTUNITY_SUPPLY_MISSING_WOOD:
|
||||
return (
|
||||
"Resolved village need\n"
|
||||
+ "◆ %s supplied the woodpile\n" % actor_name
|
||||
+ "%s target %.0f\n\n" % [resource_name, opportunity.get_target_amount()]
|
||||
)
|
||||
match opportunity.get_opportunity_type():
|
||||
SimulationIds.OPPORTUNITY_SUPPLY_MISSING_WOOD:
|
||||
return (
|
||||
"Resolved village need\n"
|
||||
+ "◆ %s supplied the woodpile\n" % actor_name
|
||||
+ "%s target %.0f\n\n" % [resource_name, opportunity.get_target_amount()]
|
||||
)
|
||||
SimulationIds.OPPORTUNITY_FEED_WEAK_VILLAGER:
|
||||
return (
|
||||
"Resolved village need\n"
|
||||
+ (
|
||||
"◆ %s ate the supplied food\n"
|
||||
% _get_npc_name(opportunity.get_interested_npc_id())
|
||||
)
|
||||
+ "%s target %.0f\n\n" % [resource_name, opportunity.get_target_amount()]
|
||||
)
|
||||
SimulationIds.OPPORTUNITY_REPAIR_HOME_ROOF:
|
||||
return (
|
||||
"Resolved village need\n"
|
||||
+ "◆ %s repaired the roof\n" % actor_name
|
||||
+ "%s target %.0f\n\n" % [resource_name, opportunity.get_target_amount()]
|
||||
)
|
||||
return (
|
||||
"Resolved village need\n"
|
||||
+ "◆ %s restocked the pantry\n" % actor_name
|
||||
|
||||
Reference in New Issue
Block a user