feat: add simulation action definitions

This commit is contained in:
2026-07-05 13:35:33 +02:00
parent 12f9ba616f
commit f816f3976a
32 changed files with 608 additions and 113 deletions
+7 -7
View File
@@ -101,15 +101,15 @@ func apply_npc_task(npc: SimNPC) -> void:
productivity = 0.5
match npc.current_task:
"gather_food":
SimulationIds.ACTION_GATHER_FOOD:
food += 2.0 * productivity
"gather_wood":
SimulationIds.ACTION_GATHER_WOOD:
wood += 2.0 * productivity
"patrol":
SimulationIds.ACTION_PATROL:
safety += 1.0 * productivity
"study":
SimulationIds.ACTION_STUDY:
knowledge += 1.0 * productivity
"eat":
SimulationIds.ACTION_EAT:
if food > 0:
food -= 1.0
npc.hunger = max(npc.hunger - 55.0, 0.0)
@@ -118,14 +118,14 @@ func apply_npc_task(npc: SimNPC) -> void:
else:
npc.hunger = min(npc.hunger + 5.0, 100.0)
npc.is_starving = npc.hunger >= 90.0
"rest":
SimulationIds.ACTION_REST:
if npc.is_starving:
npc.energy = min(npc.energy + 2.0, 100.0)
elif npc.hunger > 75.0:
npc.energy = min(npc.energy + 12.0, 100.0)
else:
npc.energy = min(npc.energy + 35.0, 100.0)
"wander":
SimulationIds.ACTION_WANDER:
safety -= 0.2
food = max(food, 0.0)