From e448f5b318f05cae1b40a949e11ef2d7fb613645 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 15 Apr 2024 11:39:52 -0400 Subject: Implemented panels mode door shuffle --- Archipelago/client.gd | 70 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 7 deletions(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index f15afe6..cafe2f9 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -21,7 +21,7 @@ const ap_version = {"major": 0, "minor": 4, "build": 5, "class": "Version"} const color_items = [ "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" ] -const progressive_items = { +const door_progressive_items = { "Progressive Orange Tower": [ {"item": "Orange Tower - Second Floor", "display": "Second Floor"}, @@ -65,6 +65,40 @@ const progressive_items = { {"item": "The Colorful - Gray Door", "display": "Gray"}, ] } +const panel_progressive_items = { + "Progressive Hallway Room": + [ + {"item": "Hallway Room - First Room Panels", "display": "First Door"}, + {"item": "Hallway Room - Second Room Panels", "display": "Second Door"}, + {"item": "Hallway Room - Third Room Panels", "display": "Third Door"}, + {"item": "Hallway Room - WHEEL", "display": "Fourth Door"}, + ], + "Progressive Colorful": + [ + {"item": "The Colorful - BEGIN (Panel)", "display": "White"}, + {"item": "The Colorful - FOUND (Panel)", "display": "Black"}, + {"item": "The Colorful - LOAF (Panel)", "display": "Red"}, + {"item": "The Colorful - CREAM (Panel)", "display": "Yellow"}, + {"item": "The Colorful - SUN (Panel)", "display": "Blue"}, + {"item": "The Colorful - SPOON (Panel)", "display": "Purple"}, + {"item": "The Colorful - LETTERS (Panel)", "display": "Orange"}, + {"item": "The Colorful - WALLS (Panel)", "display": "Green"}, + {"item": "The Colorful - IRON (Panel)", "display": "Brown"}, + {"item": "The Colorful - OBSTACLE (Panel)", "display": "Gray"}, + ], + "Progressive Number Hunt": + [ + {"item": "Two Panels", "display": "Two"}, + {"item": "Three Panels", "display": "Three"}, + {"item": "Four Panels", "display": "Four"}, + {"item": "Five Panels", "display": "Five"}, + {"item": "Six Panels", "display": "Six"}, + {"item": "Seven Panels", "display": "Seven"}, + {"item": "Eight Panels", "display": "Eight"}, + {"item": "Nine Panels", "display": "Nine"}, + {"item": "Outside The Undeterred - ZERO (Panel)", "display": "Zero"}, + ] +} const kTHE_END = 0 const kTHE_MASTER = 1 @@ -109,6 +143,7 @@ var _localdata_file = "" var _death_link = false var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 var _door_shuffle = false +var _panel_door_shuffle = false var _color_shuffle = false var _panel_shuffle = 0 # none, rearrange var _painting_shuffle = false @@ -278,7 +313,8 @@ func _on_data(): if _slot_data.has("shuffle_colors"): _color_shuffle = _slot_data["shuffle_colors"] if _slot_data.has("shuffle_doors"): - _door_shuffle = (_slot_data["shuffle_doors"] > 0) + _door_shuffle = (_slot_data["shuffle_doors"] == 2) + _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1) if _slot_data.has("shuffle_paintings"): _painting_shuffle = _slot_data["shuffle_paintings"] if _slot_data.has("shuffle_panels"): @@ -668,6 +704,12 @@ func processItem(item, index, from, flags): for door_id in gamedata.door_ids_by_item_id[int(item)]: doorsNode.get_node(door_id).openDoor() + if gamedata.panel_ids_by_item_id.has(int(item)): + var panelsNode = get_tree().get_root().get_node("Spatial/Panels") + for panel_id in gamedata.panel_ids_by_item_id[int(item)]: + panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false + emit_signal("evaluate_solvability") + if gamedata.painting_ids_by_item_id.has(int(item)): var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") @@ -683,12 +725,22 @@ func processItem(item, index, from, flags): painting_node.get_node("Script").movePainting() # Handle progressive items. - if item_name in progressive_items.keys(): + if _door_shuffle and item_name in door_progressive_items.keys(): + if not item_name in _progressive_progress: + _progressive_progress[item_name] = 0 + + if _progressive_progress[item_name] < door_progressive_items[item_name].size(): + var subitem_name = door_progressive_items[item_name][_progressive_progress[item_name]]["item"] + global._print(subitem_name) + processItem(_item_name_to_id[subitem_name], null, null, null) + _progressive_progress[item_name] += 1 + + if _panel_door_shuffle and item_name in panel_progressive_items.keys(): if not item_name in _progressive_progress: _progressive_progress[item_name] = 0 - if _progressive_progress[item_name] < progressive_items[item_name].size(): - var subitem_name = progressive_items[item_name][_progressive_progress[item_name]]["item"] + if _progressive_progress[item_name] < panel_progressive_items[item_name].size(): + var subitem_name = panel_progressive_items[item_name][_progressive_progress[item_name]]["item"] global._print(subitem_name) processItem(_item_name_to_id[subitem_name], null, null, null) _progressive_progress[item_name] += 1 @@ -704,8 +756,12 @@ func processItem(item, index, from, flags): _last_new_item = index saveLocaldata() - if item_name in progressive_items: - var subitem = progressive_items[item_name][_progressive_progress[item_name] - 1] + if _door_shuffle and item_name in door_progressive_items: + var subitem = door_progressive_items[item_name][_progressive_progress[item_name] - 1] + item_name += " (%s)" % subitem["display"] + + if _panel_door_shuffle and item_name in panel_progressive_items: + var subitem = panel_progressive_items[item_name][_progressive_progress[item_name] - 1] item_name += " (%s)" % subitem["display"] var player_name = "Unknown" -- cgit 1.4.1 From 49d7ff22aae922ef081bac1aa2a4b47b2b079166 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 15 Apr 2024 12:56:19 -0400 Subject: Backwards compatibility for games genned before panels mode options changes --- Archipelago/client.gd | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index cafe2f9..63c82f4 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -128,6 +128,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 @@ -265,6 +266,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(): @@ -313,8 +315,13 @@ func _on_data(): if _slot_data.has("shuffle_colors"): _color_shuffle = _slot_data["shuffle_colors"] if _slot_data.has("shuffle_doors"): - _door_shuffle = (_slot_data["shuffle_doors"] == 2) - _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1) + # TODO: This assumes that panels mode will be releaed in 0.4.6, which is untrue. + if wasGeneratedBeforeVersion({"major": 0, "minor": 4, "build": 6}): + _door_shuffle = (_slot_data["shuffle_doors"] > 0) + _panel_door_shuffle = false + else: + _door_shuffle = (_slot_data["shuffle_doors"] == 2) + _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1) if _slot_data.has("shuffle_paintings"): _painting_shuffle = _slot_data["shuffle_paintings"] if _slot_data.has("shuffle_panels"): @@ -831,3 +838,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(rhs): + return compareVersion(_gen_version, rhs) -- cgit 1.4.1 From 4302e550cde189d8bc1d111e81270ed7960ad77c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 16 Apr 2024 16:29:02 -0400 Subject: Better compatibility mode --- Archipelago/client.gd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 63c82f4..6fe2cab 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -315,13 +315,12 @@ func _on_data(): if _slot_data.has("shuffle_colors"): _color_shuffle = _slot_data["shuffle_colors"] if _slot_data.has("shuffle_doors"): - # TODO: This assumes that panels mode will be releaed in 0.4.6, which is untrue. - if wasGeneratedBeforeVersion({"major": 0, "minor": 4, "build": 6}): - _door_shuffle = (_slot_data["shuffle_doors"] > 0) - _panel_door_shuffle = false - else: + if _slot_data.has("group_doors"): _door_shuffle = (_slot_data["shuffle_doors"] == 2) _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1) + else: + _door_shuffle = (_slot_data["shuffle_doors"] > 0) + _panel_door_shuffle = false if _slot_data.has("shuffle_paintings"): _painting_shuffle = _slot_data["shuffle_paintings"] if _slot_data.has("shuffle_panels"): -- cgit 1.4.1 From 5c22b3c8d1268310553dd4ef78141dbf43d9da18 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 27 Apr 2024 12:15:48 -0400 Subject: Fixed panel progressive items --- Archipelago/client.gd | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 0944352..e5e930f 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -36,38 +36,11 @@ const door_progressive_items = { ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"] } const panel_progressive_items = { - "Progressive Hallway Room": - [ - {"item": "Hallway Room - First Room Panels", "display": "First Door"}, - {"item": "Hallway Room - Second Room Panels", "display": "Second Door"}, - {"item": "Hallway Room - Third Room Panels", "display": "Third Door"}, - {"item": "Hallway Room - WHEEL", "display": "Fourth Door"}, - ], + "Progressive Hallway Room": ["First Door", "Second Door", "Third Door", "Fourth Door"], "Progressive Colorful": - [ - {"item": "The Colorful - BEGIN (Panel)", "display": "White"}, - {"item": "The Colorful - FOUND (Panel)", "display": "Black"}, - {"item": "The Colorful - LOAF (Panel)", "display": "Red"}, - {"item": "The Colorful - CREAM (Panel)", "display": "Yellow"}, - {"item": "The Colorful - SUN (Panel)", "display": "Blue"}, - {"item": "The Colorful - SPOON (Panel)", "display": "Purple"}, - {"item": "The Colorful - LETTERS (Panel)", "display": "Orange"}, - {"item": "The Colorful - WALLS (Panel)", "display": "Green"}, - {"item": "The Colorful - IRON (Panel)", "display": "Brown"}, - {"item": "The Colorful - OBSTACLE (Panel)", "display": "Gray"}, - ], + ["White", "Black", "Red", "Yellow", "Blue", "Purple", "Orange", "Green", "Brown", "Gray"], "Progressive Number Hunt": - [ - {"item": "Two Panels", "display": "Two"}, - {"item": "Three Panels", "display": "Three"}, - {"item": "Four Panels", "display": "Four"}, - {"item": "Five Panels", "display": "Five"}, - {"item": "Six Panels", "display": "Six"}, - {"item": "Seven Panels", "display": "Seven"}, - {"item": "Eight Panels", "display": "Eight"}, - {"item": "Nine Panels", "display": "Nine"}, - {"item": "Outside The Undeterred - ZERO (Panel)", "display": "Zero"}, - ] + ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero"] } const kTHE_END = 0 -- cgit 1.4.1 From 60f8b6a0a1db6275453689a40d2432ec0f3ee0cb Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 27 Apr 2024 12:35:08 -0400 Subject: Fixed progressive item name display --- Archipelago/client.gd | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index e5e930f..c0b5366 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -722,16 +722,21 @@ func processItem(item, index, from, flags): var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id var progitems = null + var prognames = null if is_progressive_door and is_progressive_panel: if _door_shuffle: progitems = gamedata.door_items_by_progressive_id[int(item)] + prognames = door_progressive_items else: progitems = gamedata.panel_items_by_progressive_id[int(item)] + prognames = panel_progressive_items elif is_progressive_door: progitems = gamedata.door_items_by_progressive_id[int(item)] + prognames = door_progressive_items elif is_progressive_panel: progitems = gamedata.panel_items_by_progressive_id[int(item)] + prognames = panel_progressive_items if progitems != null: if not int(item) in _progressive_progress: @@ -741,6 +746,7 @@ func processItem(item, index, from, flags): var subitem_id = progitems[_progressive_progress[int(item)]] global._print("Subitem: %d" % subitem_id) processItem(subitem_id, null, null, null) + item_name += " (%s)" % prognames[item_name][_progressive_progress[int(item)]] _progressive_progress[int(item)] += 1 if _color_shuffle and color_items.has(_item_id_to_name[item]): @@ -754,14 +760,6 @@ func processItem(item, index, from, flags): _last_new_item = index saveLocaldata() - if _door_shuffle and item_name in door_progressive_items: - var subitem = door_progressive_items[item_name][_progressive_progress[int(item)] - 1] - item_name += " (%s)" % subitem["display"] - - if _panel_door_shuffle and item_name in panel_progressive_items: - var subitem = panel_progressive_items[item_name][_progressive_progress[int(item)] - 1] - item_name += " (%s)" % subitem["display"] - var player_name = "Unknown" if _player_name_by_slot.has(from): player_name = _player_name_by_slot[from] -- cgit 1.4.1 From fad5732724e672735062502d94300c36551148de Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 29 Apr 2024 10:25:20 -0400 Subject: Added new progressive panel doors --- Archipelago/client.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index c0b5366..0f1c651 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -40,7 +40,9 @@ const panel_progressive_items = { "Progressive Colorful": ["White", "Black", "Red", "Yellow", "Blue", "Purple", "Orange", "Green", "Brown", "Gray"], "Progressive Number Hunt": - ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero"] + ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero"], + "Progressive Symmetry Room": ["Near Far", "Warts Straw", "Leaf Feel"], + "Progressive Suits Area": ["Words Sword", "Lost", "Amen Name"] } const kTHE_END = 0 -- cgit 1.4.1 From 9ef676bab06b08f12e6fc8c8e2b56db70cea5ac3 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 16 Jul 2024 14:01:49 -0400 Subject: Set beta version --- Archipelago/client.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 325418f..a990fa2 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -18,7 +18,7 @@ var enable_multiplayer = false var track_player = false var connection_history = [] -const my_version = "4.0.2" +const my_version = "panels-beta6" const ap_version = {"major": 0, "minor": 5, "build": 0, "class": "Version"} const color_items = [ "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" -- cgit 1.4.1