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
This commit is contained in:
@@ -147,7 +147,25 @@ func _process(_d: float) -> void:
|
||||
_status.text = " ".join(s.statuses)
|
||||
var dn = player.get_parent().day_night
|
||||
if dn != null:
|
||||
_clock.text = dn.clock_text()
|
||||
var wx = player.get_parent().weather
|
||||
_clock.text = dn.clock_text() + (" " + wx.label() if wx != null else "")
|
||||
|
||||
## Fades to black, runs `mid` (e.g. skipping the night), and fades back in.
|
||||
func fade(mid: Callable) -> void:
|
||||
var black := ColorRect.new()
|
||||
black.color = Color(0, 0, 0, 0)
|
||||
black.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
black.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
add_child(black)
|
||||
player.ui_open = true
|
||||
var tw := black.create_tween()
|
||||
tw.tween_property(black, "color:a", 1.0, 0.8)
|
||||
tw.tween_callback(mid)
|
||||
tw.tween_interval(0.7)
|
||||
tw.tween_property(black, "color:a", 0.0, 1.0)
|
||||
tw.tween_callback(func():
|
||||
player.ui_open = false
|
||||
black.queue_free())
|
||||
|
||||
## Closes the inventory / menu (e.g. on death).
|
||||
func close_screens() -> void:
|
||||
|
||||
Reference in New Issue
Block a user