feat: add location-based food storage loop
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user