The Cove's stream: a stream block whose water only runs downhill (spring to the bay), its own water ribbon, trout, on the map; scenery and landmarks keep clear

This commit is contained in:
Paul Bailey
2026-11-06 21:35:04 +00:00
parent 0209c6149a
commit ad47cd53da
12 changed files with 227 additions and 14 deletions

View File

@@ -62,6 +62,30 @@ func _body() -> void:
check(world.den != null and world.barrow != null and world.stones != null, "the den, the barrow and the stones found places")
check(t.get_node_or_null("Water") == null, "one water surface (the bay is the sea)")
print("the stream")
check(t.stream_path.size() >= 2 and t.get_node_or_null("Stream") != null, "a stream, with water in it")
var downhill := true
for i in range(1, t._stream_profile.size()):
downhill = downhill and t._stream_profile[i] <= t._stream_profile[i - 1] + 0.0001
check(downhill and t._stream_profile[0] > t.water_level + 1.5, "running downhill all the way from its spring (%.1f m) to the sea" % t._stream_profile[0])
var mid: Vector2 = t._stream_point(t._stream_end * 0.3)
var sw: Dictionary = world.water_at(mid.x, mid.y)
check(sw.get("type", "") == "stream" and float(sw.depth) > 0.3 and float(sw.depth) < 1.0,
"stream water, wading deep (%.1f m)" % float(sw.get("depth", 0.0)))
var side: Vector2 = mid + Vector2(t.stream_width * 1.2, 0.0)
check(world.water_at(side.x, side.y).is_empty() and t.sample_height(side.x, side.y) > float(sw.surface),
"its banks are dry, and above the water")
check(DB.water_fishing("stream").get("fish", []).any(func(f): return f.id == "trout"), "trout in the stream")
var away := true
for p in [world.den.global_position, world.barrow.global_position, world.stones.global_position, world._spawn]:
away = away and not t.near_stream(p.x, p.z, 3.0)
check(away, "the den, the barrow, the stones and the start are all clear of it")
var in_bed := 0
for n in world.props.resource_nodes.values():
if is_instance_valid(n) and t.near_stream(n.global_position.x, n.global_position.z, 0.0):
in_bed += 1
check(in_bed == 0, "no trees or boulders standing in it")
print("the pier")
var pier: Node3D = world.pier
check(pier != null and pier.is_in_group("pier"), "a pier")