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:
Paul Bailey
2026-11-04 01:19:41 +00:00
parent 2b1afc86ba
commit fc7eb3cfed
28 changed files with 1326 additions and 97 deletions

View File

@@ -6,6 +6,7 @@ extends SceneTree
## Run: godot --headless --path . --script res://tests/test_survival_core.gd
var _fails := 0
var _finished := false ## set at the very end; a script error aborts before it
var _actions: Node
var _db: Node
@@ -28,6 +29,7 @@ func _run() -> void:
for _i in range(5):
await physics_frame
await _test_world(world)
check(_finished, "test ran to the end (no script errors)")
print("RESULT: %s (%d failures)" % ["PASS" if _fails == 0 else "FAIL", _fails])
quit(1 if _fails > 0 else 0)
@@ -134,6 +136,7 @@ func _test_world(world: Node3D) -> void:
var moving: int = inv.get_slot(wood_slot).count
_actions.transfer(player, inv, wood_slot, chest.inventory, chest)
check(chest.inventory.count("wood") == moving, "shift-click stored %d wood in the chest" % moving)
_finished = true
func ItemDB_get(_p, id: String) -> Dictionary:
return _db.get_item(id)