M1b: survival stats, day/night, fire fuel, cooking, foraging, torches, death + grave
- 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
This commit is contained in:
23
scripts/building/grave.gd
Normal file
23
scripts/building/grave.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user