feat: add location-based food storage loop

This commit is contained in:
2026-07-05 17:57:24 +02:00
parent 3ea8f02d55
commit 6dbb395bd6
22 changed files with 469 additions and 72 deletions
-13
View File
@@ -101,23 +101,10 @@ func apply_npc_task(npc: SimNPC) -> void:
productivity = 0.5
match npc.current_task:
SimulationIds.ACTION_GATHER_FOOD:
food += 2.0 * productivity
SimulationIds.ACTION_GATHER_WOOD:
wood += 2.0 * productivity
SimulationIds.ACTION_PATROL:
safety += 1.0 * productivity
SimulationIds.ACTION_STUDY:
knowledge += 1.0 * productivity
SimulationIds.ACTION_EAT:
if food > 0:
food -= 1.0
npc.hunger = max(npc.hunger - 55.0, 0.0)
npc.starvation_ticks = 0
npc.is_starving = npc.hunger >= 90.0
else:
npc.hunger = min(npc.hunger + 5.0, 100.0)
npc.is_starving = npc.hunger >= 90.0
SimulationIds.ACTION_REST:
if npc.is_starving:
npc.energy = min(npc.energy + 2.0, 100.0)