Fish per water type in data/fish.json; worldlets design

- data/fish.json: fish, weights, dawn/dusk odds, bite timing and minimum
  depth per water type; ItemDB.define_water() registers them
- world.water_at(x, z) answers lake / sea / dry land; the float uses it,
  so a worldlet with a sea only needs a "sea" entry
- Clear messages for shallow water and water with nothing to catch
- Lake fish: more of them, bigger, nearer the shore, jumping with splash rings
- docs/WORLDLETS_DESIGN.md: proposal for data-defined world types
This commit is contained in:
Paul Bailey
2026-11-04 11:41:04 +00:00
parent f174221268
commit 4630ea5d44
7 changed files with 294 additions and 19 deletions

View File

@@ -107,6 +107,19 @@ func _body(world: Node3D) -> void:
var inland := shore + Vector3(12, 0, 0)
inland.y = terrain.sample_height(inland.x, inland.z)
print("water and fish data")
var wl: Dictionary = world.water_at(lake.x, lake.y)
check(wl.get("type", "") == "lake" and wl.depth > 2.0, "the middle of the lake is deep lake water (%s)" % [wl])
check(world.water_at(shore.x + 3.0, shore.z).is_empty(), "the shore is dry land")
var sp: Vector2 = terrain.coast_point(terrain.sea_angle_deg, 40.0)
check(world.water_at(sp.x, sp.y).get("type", "") == "sea", "out past the cliffs is the sea")
var lt: Dictionary = DB.water_fishing("lake")
var ids := []
for f in lt.get("fish", []):
ids.append(f.id)
check(ids == ["perch", "trout"] and lt.min_depth == 0.5, "the lake's fish come from data/fish.json (%s)" % [ids])
check(DB.water_fishing("sea").is_empty(), "this island has no sea fish defined (the cliffs are in the way)")
print("casting")
sv.stamina = 100.0
check(_cast(world, player, out) and world.bobber != null, "cast the line")