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