- Health, stamina, hunger, warmth and wet with HUD bars, status tags and clock - 20-minute day/night cycle with moon, stars and lit clouds - Campfire fuel (2 min start, 15 min max), heat radius, cooking needs a lit fire - Berry bushes (regrow 10 min), mushrooms, roasted mushroom, torch - Stamina costs for sprint, jump and harvest hits - Death respawns at island start and leaves a grave bag - Saves include stats, time of day, fire fuel, regrowth timers and graves - New test_survival_stats suite; tests fail if a script error aborts them
24 lines
596 B
GDScript
24 lines
596 B
GDScript
extends "res://scripts/building/piece.gd"
|
|
## Grave: left where you died, holding everything you carried. Open it with E
|
|
## to take your things back; it crumbles once empty.
|
|
|
|
var inventory := Inventory.new(40)
|
|
|
|
func _build() -> void:
|
|
inventory.changed.connect(_on_changed)
|
|
|
|
func display_name() -> String:
|
|
return "Your grave"
|
|
|
|
func interact_prompt(_player: Node) -> String:
|
|
return "Your grave [E] Recover belongings"
|
|
|
|
func interact(player: Node) -> void:
|
|
player.open_inventory(self)
|
|
|
|
func _on_changed() -> void:
|
|
for s in inventory.slots:
|
|
if s != null:
|
|
return
|
|
queue_free.call_deferred()
|