feat: add initial starvation consequence

This commit is contained in:
Rijad Zuzo
2026-06-20 18:18:00 +02:00
parent d185dcacf3
commit 852d10f7ae
4 changed files with 29 additions and 5 deletions
+10
View File
@@ -11,6 +11,8 @@ var intelligence: float
var current_task: String = "idle"
var position: Vector3
var is_starving := false
func _init(
_id: int,
_npc_name: String,
@@ -47,6 +49,14 @@ func simulate_tick(village: SimVillage) -> void:
current_task = "rest"
energy += 20.0
return
is_starving = hunger >= 90.0
if is_starving:
energy -= 8.0
hunger = clamp(hunger, 0.0, 100.0)
energy = clamp(energy, 0.0, 100.0)
if village.food < 15.0:
current_task = "gather_food"