Files
Emberwild/scripts/building/chest.gd
Paul Bailey fed96ef118 M1c: weather, snap building, shelter, beds and regrowth
- Seeded weather (clear/cloudy/rain/storm, snow and blizzards on cold days
  and above the snowline), lightning, synthesised rain/wind/thunder sound
- Rain/snow particles stopped by roofs; wet ground, settled snow and wind
  via global shader uniforms
- Snap-together wood floor, wall, door, roof and gable with structural
  support, collapse and X to dismantle
- Shelter detection: dry under a roof, warmer and Rested inside with a fire;
  rain burns an uncovered campfire faster
- Bed sets the spawn point and lets you sleep through the night
- Trees, boulders and ground pickups regrow; timers saved
- Grass cleared under floors; shorter HUD hint
- New test_weather_building suite (62 checks) and tests/run_all.sh, which
  also fails on script errors
2026-11-04 10:16:41 +00:00

22 lines
538 B
GDScript

extends "res://scripts/building/piece.gd"
## Wooden chest: 16 slots of storage. E opens it next to your inventory.
const SLOTS := 16
var inventory := Inventory.new(SLOTS)
func dismantle_block_reason() -> String:
for s in inventory.slots:
if s != null:
return "Empty the chest first"
return ""
func interact_prompt(_player: Node) -> String:
var used := 0
for s in inventory.slots:
if s != null:
used += 1
return "Chest (%d/%d) [E] Open" % [used, SLOTS]
func interact(player: Node) -> void:
player.open_inventory(self)