W3: the Cove (bay, pond, pier for sea fishing), mackerel and cod (cod only in deep water), non-start worldlets offered for testing when run from source

This commit is contained in:
Paul Bailey
2026-11-06 17:08:42 +00:00
parent 9b88a10609
commit 793b214786
21 changed files with 527 additions and 14 deletions

View File

@@ -40,7 +40,7 @@ func _body(S: Node, Net: Node) -> void:
var TS: Script = load("res://scripts/ui/title_screen.gd")
print("the worldlets to start in")
var starts: Array = T.starting_worldlets()
check(starts.size() == 1 and String(starts[0].id) == "valley", "only the Valley (%s)" % [starts.map(func(w): return w.id)])
check(starts.size() == 1 and String(starts[0].id) == "valley", "only the Valley (%s; the Cove is reached on the journey)" % [starts.map(func(w): return w.id)])
check(T.worldlets().all(func(w): return w.has("start")), "every worldlet says whether it's a start")
check(T.worldlet_name("valley") == "Valley", "the Valley's name, for the menus")
check(T.worldlet_name("nowhere") == "nowhere", "(an unknown one: its id)")
@@ -51,9 +51,14 @@ func _body(S: Node, Net: Node) -> void:
root.add_child(title)
for _i in range(3):
await process_frame
var release: Array = TS.offered_worldlets(false)
check(release.size() == 1 and String(release[0].id) == "valley", "a release build offers only the Valley")
var dev: Array = TS.offered_worldlets(true)
check(String(dev[0].id) == "valley" and dev.any(func(w): return w.id == "cove" and String(w.name) == "Cove (testing)"),
"running from the source, the Cove too, marked for testing (%s)" % [dev.map(func(w): return w.name)])
var pick: OptionButton = title._worldlet_pick
check(pick != null and pick.item_count == 1 and pick.get_item_text(0) == "Valley", "a \"Where\" picker with the Valley in it")
check(pick.disabled, "which sits still with only one choice")
check(pick != null and pick.item_count == dev.size() and pick.get_item_text(0) == "Valley", "a \"Where\" picker, on the Valley first")
check(not pick.disabled, "(with more than one to choose from)")
check(TS.picked_worldlet(pick) == "valley", "and gives the Valley")
var id: String = S.create_world("Pick test", 4242, {"worldlet": TS.picked_worldlet(pick)})
var meta: Dictionary = S.list_worlds().filter(func(w): return w.id == id)[0] if not id.is_empty() else {}
@@ -69,7 +74,7 @@ func _body(S: Node, Net: Node) -> void:
check(hp != null and hp.get_item_text(hp.selected) == "Valley", "a \"Where\" picker too, on the Valley")
title._show("host")
await process_frame
check(hp.disabled and TS.picked_worldlet(hp) == "valley", "a new island: the Valley (the only start)")
check(not hp.disabled and TS.picked_worldlet(hp) == "valley", "a new island: the Valley to start with, free to change")
# Once the island exists it keeps its worldlet: the picker shows that one.
DirAccess.make_dir_recursive_absolute(DIR + "/server/worlds/server-world")
var f := FileAccess.open(DIR + "/server/worlds/server-world/meta.json", FileAccess.WRITE)