feat: introduce identity-backed goat

This commit is contained in:
Rijad Zuzo
2026-07-26 22:26:00 +02:00
parent 1f09ebe6b6
commit f79c2bb630
47 changed files with 1903 additions and 96 deletions
+10 -1
View File
@@ -23,7 +23,8 @@ func select_action(
time_of_day: float = 0.5,
all_npcs: Array = [],
opportunity_helper: OpportunityHelperResult = null,
population_view: SimulationPopulationView = null
population_view: SimulationPopulationView = null,
animal_feed_name: String = ""
) -> ActionSelectionResult:
if npc.is_dead:
return null
@@ -126,6 +127,14 @@ func select_action(
return ActionSelectionResult.new(
SimulationIds.ACTION_REST, -1.0, "Energy is below the rest threshold"
)
if not animal_feed_name.is_empty():
var feed_definition := SimulationDefinitions.get_action(SimulationIds.ACTION_FEED_ANIMAL)
if _get_cost_rejection(feed_definition, village).is_empty():
return ActionSelectionResult.new(
SimulationIds.ACTION_FEED_ANIMAL,
-1.0,
"%s is hungry; pantry food is available" % animal_feed_name
)
if village.food <= RELATIONSHIP_AID_PANTRY_THRESHOLD and relationship_system != null:
var trusted_starving_npc: SimNPC = relationship_system.get_trusted_starving_subject(
npc.id, all_npcs, population_view