From 46280f772defd53d1c78b756be9c68e5c3ba0b75 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 23 Mar 2024 17:33:23 -0400 Subject: Replace the roof of The Artistic in painting shuffle --- Archipelago/load.gd | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Archipelago/load.gd') diff --git a/Archipelago/load.gd b/Archipelago/load.gd index a277817..66c9b8a 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -437,6 +437,26 @@ func _load(): var chosen_painting = remaining[rng.randi_range(0, remaining.size() - 1)] instantiate_painting(painting, chosen_painting) + + # Replace the roof of The Artistic. + var artistic_paintings = [ + ["smile_painting_9", -49.5, 44.5], + ["cherry_painting3", -38.5, 44.5], + ["boxes_painting2", -38.5, 55.5], + ["panda_painting_3", -49.5, 55.5] + ] + for painting in artistic_paintings: + var painting_node = get_node("AP_Paintings").get_node(painting[0]).get_node("GridMap") + var small_mesh_library = painting_node.mesh_library + + for x in range(0,10): + for y in range(0,10): + var cellitem = painting_node.get_cell_item(-5 + x, 1+y, 0) + var meshitem = small_mesh_library.get_item_name(cellitem) + if meshitem.begins_with("Tiny"): + meshitem = meshitem.substr(4) + set_gridmap_tile(painting[1]+9-y, 8.5, painting[2]+x, meshitem) + # We need to make some changes to the Art Gallery. The player should always # have access to the backroom, but they shouldn't have access to ORDER until @@ -640,8 +660,10 @@ func set_gridmap_tile(x, y, z, tile): var gridmap = self.get_node("GridMap") var mesh_library = gridmap.mesh_library var mapvec = gridmap.world_to_map(gridmap.to_local(Vector3(x, y, z))) + var cellitem = mesh_library.find_item_by_name(tile) - gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, mesh_library.find_item_by_name(tile)) + if cellitem != GridMap.INVALID_CELL_ITEM: + gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, cellitem) func clear_gridmap_tile(x, y, z): -- cgit 1.4.1 From 37be40c8129ccaa3cd26629c383f1d9d03523366 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 24 Mar 2024 09:57:05 -0400 Subject: Geronimo gets you a puzzle skip --- Archipelago/client.gd | 20 ++++++++++++++++++-- Archipelago/load.gd | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'Archipelago/load.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 06fb3a6..05294d5 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -115,6 +115,7 @@ var _puzzle_skips = 0 var _cached_slowness = 0 var _cached_iceland = 0 var _cached_atbash = 0 +var _geronimo_skip = false signal could_not_connect signal connect_status @@ -300,7 +301,7 @@ func _on_data(): if localdata.size() > 1: _puzzle_skips = localdata[1] - + if localdata.size() > 2: _cached_slowness = localdata[2] else: @@ -316,6 +317,11 @@ func _on_data(): else: _cached_atbash = 0 + if localdata.size() > 5: + _geronimo_skip = localdata[5] + else: + _geronimo_skip = false + requestSync() emit_signal("client_connected") @@ -475,7 +481,8 @@ func saveLocaldata(): _puzzle_skips, effects_node.slowness_remaining, effects_node.iceland_remaining, - effects_node.atbash_remaining + effects_node.atbash_remaining, + _geronimo_skip ] file.store_var(data, true) file.close() @@ -720,6 +727,15 @@ func usePuzzleSkip(): saveLocaldata() +func geronimo(): + if !_geronimo_skip: + messages.showMessage("Geronimo! You found a puzzle skip.") + + _puzzle_skips += 1 + _geronimo_skip = true + saveLocaldata() + + func colorForItemType(flags): var int_flags = int(flags) if int_flags & 1: # progression diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 66c9b8a..207550b 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -577,6 +577,9 @@ func _load(): var multiplayer_node = apclient.SCRIPT_multiplayer.new() multiplayer_node.ghost_mode = true add_child(multiplayer_node) + + # Hook up Geronimo handler. + $player.connect("player_jumped", apclient, "geronimo") # Hook up the scene to be able to handle connection failures. apclient.connect("could_not_connect", self, "archipelago_disconnected") -- cgit 1.4.1 From 13271d4b8f66488a55be256e44a118ff8fff1ec1 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 25 Mar 2024 20:54:03 -0400 Subject: Fix Wanderer entrance door on reload Turns out when you instantiate scripts with exported reference fields, you have to create new values for those fields because otherwise they use a shared value like idk man it's weird. --- Archipelago/load.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Archipelago/load.gd') diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 207550b..3e11b8b 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -64,7 +64,7 @@ func _load(): wanderer_entrance.rotation = Vector3(0, -PI / 2, 0) wanderer_entrance.scale = Vector3(1, 1.5, 1) wanderer_entrance.set_script(door_script) - wanderer_entrance.panels.append("../../../Panels/Tower Room/Panel_wanderlust_1234567890") + wanderer_entrance.panels = ["../../../Panels/Tower Room/Panel_wanderlust_1234567890"] get_node("Doors/Tower Room Area Doors").add_child(wanderer_entrance) var wanderer_achieve = get_node("Panels/Tower Room/Panel_1234567890_wanderlust") -- cgit 1.4.1 From 138ab8e0b86e1737cd4656769a14de07b78c3c30 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 29 Mar 2024 00:11:18 -0400 Subject: AFD notnerb --- Archipelago/load.gd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Archipelago/load.gd') diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 3e11b8b..dc4049e 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -25,6 +25,11 @@ func _load(): var apclient = global.get_node("Archipelago") var panels_parent = self.get_node("Panels") + var date = Time.get_date_dict_from_system() + var april_fools = false + if date["month"] == 4 && date["day"] == 1: + april_fools = true + # Add a wall-blocked raycast to the player. var wallcast = RayCast.new() wallcast.name = "wallcast" @@ -406,6 +411,8 @@ func _load(): if not classes.has(painting): var i = rng.randi_range(0, all_paintings.size() - 1) var chosen = all_paintings[i] + if april_fools: + chosen = "bg_notnerb" classes[painting] = chosen all_paintings.remove(i) @@ -430,6 +437,9 @@ func _load(): var j = rng.randi_range(0, all_paintings.size() - 1) remaining.append(all_paintings[j]) all_paintings.remove(j) + + if april_fools: + remaining = ["bg_notnerb"] for painting in gamedata.paintings.keys(): if randomized.has(painting): @@ -581,6 +591,14 @@ func _load(): # Hook up Geronimo handler. $player.connect("player_jumped", apclient, "geronimo") + if april_fools: + # Change the appearance of every painting. + var notnerb_painting = load("res://nodes/paintings/bg_notnerb.tscn").instance() + for child in $Decorations/Paintings.get_children(): + if child.get_node_or_null("GridMap") != null: + child.get_node("GridMap").queue_free() + child.add_child(notnerb_painting.get_node("GridMap").duplicate(true)) + # Hook up the scene to be able to handle connection failures. apclient.connect("could_not_connect", self, "archipelago_disconnected") -- cgit 1.4.1 From 750ebbf9aa25f0209d7f1c7186718fa07377881d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 17 Apr 2024 12:50:34 -0400 Subject: Prevent colorful cdp if genned before 0.4.5 --- Archipelago/client.gd | 16 ++++++++++++++++ Archipelago/load.gd | 23 ++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'Archipelago/load.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 489fdb9..2f66c1b 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -95,6 +95,7 @@ var _item_name_to_id = {} # LINGO only var _location_name_to_id = {} # LINGO only var _remote_version = {"major": 0, "minor": 0, "build": 0} +var _gen_version = {"major": 0, "minor": 0, "build": 0} # TODO: caching per MW/slot, reset between connections var _authenticated = false @@ -233,6 +234,7 @@ func _on_data(): if cmd == "RoomInfo": _seed = message["seed_name"] _remote_version = message["version"] + _gen_version = message["generator_version"] var needed_games = [] for game in message["datapackage_checksums"].keys(): @@ -779,3 +781,17 @@ func colorForItemType(flags): return "#d63a22" else: # filler return "#14de9e" + + +func compareVersion(lhs, rhs): + if lhs["major"] == rhs["major"]: + if lhs["minor"] == rhs["minor"]: + return lhs["build"] < rhs["build"] + else: + return lhs["minor"] < rhs["minor"] + else: + return lhs["major"] < rhs["major"] + + +func wasGeneratedBeforeVersion(major, minor, build): + return compareVersion(_gen_version, {"major": major, "minor": minor, "build": build}) diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 566ee39..27e70b7 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -96,18 +96,19 @@ func _load(): wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map - # Turn THE COLORFUL into a cdp. - var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") - var colorful_cdp = cdp_auto_scene.instance() - colorful_cdp.name = "CountdownPanel_colorful" - colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" - colorful_cdp.panels = "../../Panels/Doorways Room" - colorful_cdp.translation = real_colorful.translation - colorful_cdp.rotation = real_colorful.rotation - get_node("CountdownPanels").add_child(colorful_cdp) - real_colorful.translation = Vector3(-51, -35, 35) # way under the map - get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() + if !apclient.wasGeneratedBeforeVersion(0, 4, 5): + # Turn THE COLORFUL into a cdp. + var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") + var colorful_cdp = cdp_auto_scene.instance() + colorful_cdp.name = "CountdownPanel_colorful" + colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" + colorful_cdp.panels = "../../Panels/Doorways Room" + colorful_cdp.translation = real_colorful.translation + colorful_cdp.rotation = real_colorful.rotation + get_node("CountdownPanels").add_child(colorful_cdp) + real_colorful.translation = Vector3(-51, -35, 35) # way under the map + get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() # Set up The Master to be variable. var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") -- cgit 1.4.1