From c1ffc2c464df33c5effbb4a62e4bd57605d409b4 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 26 Feb 2024 21:22:15 -0500 Subject: Added pilgrimage goal --- Archipelago/load.gd | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Archipelago/load.gd') diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 2d5f7c6..d9b37da 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -334,6 +334,8 @@ func _load(): victory_condition = "the master" elif apclient._victory_condition == apclient.kLEVEL_2: victory_condition = "level 2" + elif apclient._victory_condition == apclient.kPILGRIMAGE: + victory_condition = "pilgrimage" set_static_panel("Entry Room/Panel_this_this", victory_condition) set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") @@ -538,6 +540,11 @@ func _load(): level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( "answer_correct", apclient, "completedGoal" ) + elif apclient._victory_condition == apclient.kPILGRIMAGE: + var pilgrim_panel = self.get_node("Panels/Lingo Room/Panel_pilgrim") + pilgrim_panel.get_node("Viewport/GUI/Panel/TextEdit").connect( + "answer_correct", apclient, "completedGoal" + ) else: var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( -- cgit 1.4.1 From 4d2da5afe6a3ffad50ca5560c1dcceaddde2b9b0 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 28 Feb 2024 12:35:45 -0500 Subject: Add pilgrimage allows roof access / paintings --- Archipelago/client.gd | 9 ++++++++- Archipelago/load.gd | 16 ++++++++++++++++ Archipelago/mypainting.gd | 14 +++++++------- Archipelago/painting.gd | 10 ++++++++++ Archipelago/painting_eye.gd | 16 +++++++++++++++- Archipelago/painting_scenery.gd | 10 ++++++++++ Archipelago/panel.gd | 4 ---- Archipelago/pilgrimage_terminator.gd | 11 +++++++++++ Archipelago/settings_screen.gd | 4 ++++ Archipelago/teleport.gd | 15 +++++++++++---- 10 files changed, 92 insertions(+), 17 deletions(-) create mode 100644 Archipelago/painting.gd create mode 100644 Archipelago/pilgrimage_terminator.gd (limited to 'Archipelago/load.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 7cf1d01..964c642 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -7,6 +7,7 @@ var SCRIPT_multiplayer var SCRIPT_mypainting var SCRIPT_notifier var SCRIPT_panel +var SCRIPT_pilgrimage_terminator var SCRIPT_uuid var ap_server = "" @@ -133,6 +134,8 @@ var _level_2_requirement = 223 var _location_classification_bit = 0 var _early_color_hallways = false var _pilgrimage_enabled = false +var _pilgrimage_allows_roof_access = false +var _pilgrimage_allows_paintings = false var _slot_seed = 0 var _map_loaded = false @@ -315,6 +318,10 @@ func _on_data(): _early_color_hallways = _slot_data["early_color_hallways"] if _slot_data.has("enable_pilgrimage"): _pilgrimage_enabled = _slot_data["enable_pilgrimage"] + if _slot_data.has("pilgrimage_allows_roof_access"): + _pilgrimage_allows_roof_access = _slot_data["pilgrimage_allows_roof_access"] + if _slot_data.has("pilgrimage_allows_paintings"): + _pilgrimage_allows_paintings = _slot_data["pilgrimage_allows_paintings"] _puzzle_skips = 0 @@ -654,7 +661,7 @@ func processItem(item, index, from, flags): painting_node = fake_parent_node.get_node_or_null(painting_id) if painting_node != null: painting_node.get_node("Script").movePainting() - + if gamedata.warp_ids_by_item_id.has(int(item)): var warpsNode = get_tree().get_root().get_node("Spatial/Warps") for warp_id in gamedata.warp_ids_by_item_id[int(item)]: diff --git a/Archipelago/load.gd b/Archipelago/load.gd index d9b37da..bca0742 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -550,6 +550,22 @@ func _load(): the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( "answer_correct", apclient, "completedGoal" ) + + # If pilgrimage does not allow roof access, add a node on the Crossroads + # Roof Access stairs that disables it. + if !apclient._pilgrimage_allows_roof_access: + var terminator = apclient.SCRIPT_pilgrimage_terminator.new() + terminator.name = "RoofAccessPilgrimageTerminator" + terminator.translation.x = -36 + terminator.translation.y = 3 + terminator.translation.z = -35 + + var terminator_shape = CollisionShape.new() + terminator_shape.shape = BoxShape.new() + terminator_shape.shape.extents.x = 0.1 + + terminator.add_child(terminator_shape) + get_node("Decorations").add_child(terminator) # Create the effects node. var effects_script = apclient.SCRIPT_effects diff --git a/Archipelago/mypainting.gd b/Archipelago/mypainting.gd index 1420c03..999b122 100644 --- a/Archipelago/mypainting.gd +++ b/Archipelago/mypainting.gd @@ -20,13 +20,8 @@ func _ready(): func _answer_correct(): var apclient = global.get_node("Archipelago") - if self.get_parent().name == "pilgrim_painting2": - # When pilgrimage is enabled, the HOT CRUST panel should actually move the sun painting. - if apclient._pilgrimage_enabled: - movePainting() - else: - if not apclient._door_shuffle or apclient.paintingIsVanilla(self.get_parent().name): - movePainting() + if not apclient._door_shuffle or apclient.paintingIsVanilla(self.get_parent().name): + movePainting() func movePainting(): @@ -91,6 +86,11 @@ func _looked_at(body, painting): body.rotate_y(3 * PI / 2) body.velocity = body.velocity.rotated(Vector3(0, 1, 0), 3 * PI / 2) + var apclient = global.get_node("Archipelago") + if !apclient._pilgrimage_allows_paintings: + global.sunwarp = 1 + body.get_node("pivot/camera/sunwarp_background").visible = false + func _dir_to_int(dir): if dir == "north": diff --git a/Archipelago/painting.gd b/Archipelago/painting.gd new file mode 100644 index 0000000..adc8337 --- /dev/null +++ b/Archipelago/painting.gd @@ -0,0 +1,10 @@ +extends "res://scripts/painting.gd" + +func _looked_at(var body, var painting): + ._looked_at(body, painting) + + if body.is_in_group("player") && (painting.get_name() == self.get_name()): + var apclient = global.get_node("Archipelago") + if !apclient._pilgrimage_allows_paintings: + global.sunwarp = 1 + body.get_node("pivot/camera/sunwarp_background").visible = false diff --git a/Archipelago/painting_eye.gd b/Archipelago/painting_eye.gd index 53d42b5..c6994b1 100644 --- a/Archipelago/painting_eye.gd +++ b/Archipelago/painting_eye.gd @@ -3,9 +3,23 @@ extends "res://scripts/painting_eye.gd" func _answer_correct(): var apclient = global.get_node("Archipelago") - if not apclient._door_shuffle or apclient.paintingIsVanilla(self.name): + if get_name() == "pilgrim_painting2": + # When pilgrimage is enabled, the HOT CRUST panel should actually move the sun painting. + if apclient._pilgrimage_enabled: + movePainting() + elif not apclient._door_shuffle or apclient.paintingIsVanilla(self.name): ._answer_correct() func movePainting(): ._answer_correct() + + +func _looked_at(var body, var painting): + ._looked_at(body, painting) + + if body.is_in_group("player") && (painting.get_name() == self.get_name()): + var apclient = global.get_node("Archipelago") + if !apclient._pilgrimage_allows_paintings: + global.sunwarp = 1 + body.get_node("pivot/camera/sunwarp_background").visible = false diff --git a/Archipelago/painting_scenery.gd b/Archipelago/painting_scenery.gd index f49d602..1186e2f 100644 --- a/Archipelago/painting_scenery.gd +++ b/Archipelago/painting_scenery.gd @@ -9,3 +9,13 @@ func _answer_correct(): func movePainting(): ._answer_correct() + + +func _looked_at(var body, var painting): + ._looked_at(body, painting) + + if body.is_in_group("player") && (painting.get_name() == self.get_name()): + var apclient = global.get_node("Archipelago") + if !apclient._pilgrimage_allows_paintings: + global.sunwarp = 1 + body.get_node("pivot/camera/sunwarp_background").visible = false diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index da5b572..ce5a642 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd @@ -22,10 +22,6 @@ func _ready(): else: atbash_text += old_char - self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").connect( - "answer_correct", self, "answer_correct" - ) - func answer_correct(): var effects = get_tree().get_root().get_node("Spatial/AP_Effects") diff --git a/Archipelago/pilgrimage_terminator.gd b/Archipelago/pilgrimage_terminator.gd new file mode 100644 index 0000000..29db2ee --- /dev/null +++ b/Archipelago/pilgrimage_terminator.gd @@ -0,0 +1,11 @@ +extends Area + + +func _ready(): + var _connected = self.connect("body_entered", self, "_body_entered") + + +func _body_entered(body): + if body.is_in_group("player"): + global.sunwarp = 1 + body.get_node("pivot/camera/sunwarp_background").visible = false diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 0ae218e..1a1f5cc 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd @@ -24,6 +24,9 @@ func _ready(): apclient_instance.SCRIPT_mypainting = load("user://maps/Archipelago/mypainting.gd") apclient_instance.SCRIPT_notifier = load("user://maps/Archipelago/notifier.gd") apclient_instance.SCRIPT_panel = load("user://maps/Archipelago/panel.gd") + apclient_instance.SCRIPT_pilgrimage_terminator = load( + "user://maps/Archipelago/pilgrimage_terminator.gd" + ) apclient_instance.SCRIPT_uuid = load("user://maps/Archipelago/vendor/uuid.gd") var apdata = ResourceLoader.load("user://maps/Archipelago/gamedata.gd") @@ -39,6 +42,7 @@ func _ready(): # Let's also inject any scripts we need to inject now. installScriptExtension(apclient_instance.SCRIPT_doorControl) installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd")) + installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting.gd")) installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd")) installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd")) installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd")) diff --git a/Archipelago/teleport.gd b/Archipelago/teleport.gd index 66e26dd..532f081 100644 --- a/Archipelago/teleport.gd +++ b/Archipelago/teleport.gd @@ -5,16 +5,23 @@ var _unlocked = true func _ready(): var apclient = global.get_node("Archipelago") - if (apclient._sunwarp_access != apclient.kSUNWARP_ACCESS_NORMAL and self.get_parent().name == "Teleporter Warps") or (apclient._door_shuffle and !apclient.warpIsVanilla(self.get_parent().name + "/" + self.name)): + if self.get_parent().name == "Teleporter Warps": + if apclient._sunwarp_access != apclient.kSUNWARP_ACCESS_NORMAL: + _unlocked = false + elif apclient._door_shuffle and !apclient.warpIsVanilla(self.get_parent().name + "/" + self.name): _unlocked = false - - ._ready() -func _body_entered(var body): +func _body_entered(body): if _unlocked: ._body_entered(body) + if body.is_in_group("player"): + var apclient = global.get_node("Archipelago") + if !apclient._pilgrimage_enabled: + global.sunwarp = 1 + body.get_node("pivot/camera/sunwarp_background").visible = false + func unlock_warp(): _unlocked = true -- cgit 1.4.1 From c45ca7725a9d77f29e8675182c3aff7b661b5c40 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 2 Mar 2024 13:18:33 -0500 Subject: Added sunwarp shuffling --- Archipelago/client.gd | 6 +++++ Archipelago/load.gd | 64 +++++++++++++++++++++++++++++++++++++++++++++++ util/generate_gamedata.rb | 17 ++++++++++++- 3 files changed, 86 insertions(+), 1 deletion(-) (limited to 'Archipelago/load.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 964c642..b3668d7 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -136,6 +136,8 @@ var _early_color_hallways = false var _pilgrimage_enabled = false var _pilgrimage_allows_roof_access = false var _pilgrimage_allows_paintings = false +var _sunwarp_shuffle = false +var _sunwarp_mapping = [] var _slot_seed = 0 var _map_loaded = false @@ -322,6 +324,10 @@ func _on_data(): _pilgrimage_allows_roof_access = _slot_data["pilgrimage_allows_roof_access"] if _slot_data.has("pilgrimage_allows_paintings"): _pilgrimage_allows_paintings = _slot_data["pilgrimage_allows_paintings"] + if _slot_data.has("shuffle_sunwarps"): + _sunwarp_shuffle = _slot_data["shuffle_sunwarps"] + if _slot_data.has("sunwarp_permutation"): + _sunwarp_mapping = _slot_data["sunwarp_permutation"] _puzzle_skips = 0 diff --git a/Archipelago/load.gd b/Archipelago/load.gd index bca0742..0750247 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -566,6 +566,58 @@ func _load(): terminator.add_child(terminator_shape) get_node("Decorations").add_child(terminator) + + if apclient._sunwarp_shuffle: + # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. + get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 + + get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 + get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 + get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 + get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 + get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 + + # Change the sunwarps in accordance with the mapping. + var sw_orig_translations = [] + var sw_text_translations = [] + var sw_text_rotations = [] + for i in range(1,7): + sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) + sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) + sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) + for i in range(1,7): + sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) + sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) + sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) + + var sw_enter_indicators = [4, 5, 6, 12, 7, 10] + for i in range(1,7): + get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]] + get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]] + + get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]] + get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]] + + get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]] + get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]] + + var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90 + var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90 + var final_rot = enter_rot - exit_rot + if final_rot < 0: + final_rot += 360 + get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) + + var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"] + var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1]) + sw_enter_indicator.translation.x = sw_enter_indicator_pos[0] + sw_enter_indicator.translation.y = sw_enter_indicator_pos[1] + sw_enter_indicator.translation.z = sw_enter_indicator_pos[2] + sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180 # Create the effects node. var effects_script = apclient.SCRIPT_effects @@ -666,3 +718,15 @@ func set_small_gridmap_tile(x, y, z, tile): func archipelago_disconnected(reason): messages.showMessage(reason) + + +func _dir_to_int(dir): + if dir == "north": + return 0 + elif dir == "west": + return 1 + elif dir == "south": + return 2 + elif dir == "east": + return 3 + return 4 diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index 4c530f1..7674277 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb @@ -19,6 +19,7 @@ painting_ids_by_item_id = {} warp_ids_by_item_id = {} panel_ids_by_location_id = {} classification_by_location_id = {} +sunwarps = Array.new(12) {Hash.new} mentioned_doors = Set[] mentioned_paintings = Set[] mentioned_warps = Set[] @@ -91,6 +92,16 @@ config.each do |room_name, room_data| painting_output[painting["id"]] = painting end end + + if room_data.include? "sunwarps" + room_data["sunwarps"].each do |sunwarp| + index = sunwarp["dots"] - 1 + if sunwarp["direction"] == "exit" then + index += 6 + end + sunwarps[index] = sunwarp + end + end end config.each do |room_name, room_data| @@ -238,5 +249,9 @@ File.open(outputpath, "w") do |f| f.write(classification_by_location_id.map do |location_id, classification| "#{location_id}:#{classification}" end.join(",")) - f.write "}" + f.write "}\nvar sunwarps = [" + f.write(sunwarps.map do |sunwarp| + "{\"orientation\":\"#{sunwarp["orientation"]}\",\"entrance_indicator_pos\":#{sunwarp["entrance_indicator_pos"].to_s}}" + end.join(",")) + f.write "]" end -- 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