From 0ef9d820818c6768060eca0a692c87d29bea8f95 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 28 Apr 2023 11:21:08 -0400 Subject: Progressive Art Gallery and Hallway Room Also, Art Gallery is now changed a little in doors mode. The backroom is always available so that you have access to the previous floors at all times. The paintings in the backroom do not appear until you have the floor unlocked. ORDER is also blocked off until you get the fifth floor. --- Archipelago/client.gd | 60 ++++++++++++++++++++++++++++++----------- Archipelago/load.gd | 27 +++++++++++++++++++ Archipelago/painting_scenery.gd | 11 ++++++++ Archipelago/settings_screen.gd | 1 + 4 files changed, 84 insertions(+), 15 deletions(-) create mode 100644 Archipelago/painting_scenery.gd (limited to 'Archipelago') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 46b9ff0..be65eb2 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -6,10 +6,35 @@ var ap_pass = "" const my_version = "0.2.3" const ap_version = {"major": 0, "minor": 4, "build": 0, "class": "Version"} -const orange_tower = ["Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh"] const color_items = [ "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" ] +const progressive_items = { + "Progressive Orange Tower": + [ + {"item": "Orange Tower - Second Floor", "display": "Second Floor"}, + {"item": "Orange Tower - Third Floor", "display": "Third Floor"}, + {"item": "Orange Tower - Fourth Floor", "display": "Fourth Floor"}, + {"item": "Orange Tower - Fifth Floor", "display": "Fifth Floor"}, + {"item": "Orange Tower - Sixth Floor", "display": "Sixth Floor"}, + {"item": "Orange Tower - Seventh Floor", "display": "Seventh Floor"}, + ], + "Progressive Art Gallery": + [ + {"item": "Art Gallery - Second Floor", "display": "Second Floor"}, + {"item": "Art Gallery - Third Floor", "display": "Third Floor"}, + {"item": "Art Gallery - Fourth Floor", "display": "Fourth Floor"}, + {"item": "Art Gallery - Fifth Floor", "display": "Fifth Floor"}, + {"item": "Art Gallery - Exit", "display": "Exit"}, + ], + "Progressive Hallway Room": + [ + {"item": "Outside The Agreeable - Hallway Door", "display": "First Door"}, + {"item": "Hallway Room (2) - Exit", "display": "Second Door"}, + {"item": "Hallway Room (3) - Exit", "display": "Third Door"}, + {"item": "Hallway Room (4) - Exit", "display": "Fourth Door"}, + ] +} const kTHE_END = 0 const kTHE_MASTER = 1 @@ -61,7 +86,7 @@ var _map_loaded = false var _held_items = [] var _held_locations = [] var _last_new_item = -1 -var _tower_floors = 0 +var _progressive_progress = {} var _has_colors = ["white"] signal could_not_connect @@ -287,7 +312,7 @@ func _on_data(): if message["index"] == 0: # We are being sent all of our items, so lets reset any progress # on progressive items. - _tower_floors = 0 + _progressive_progress.clear() _held_items = [] var i = 0 @@ -526,12 +551,20 @@ func processItem(item, index, from, flags): if painting_node != null: painting_node.get_node("Script").movePainting() - # Handle progressively opening up the tower. - if _item_name_to_id["Progressive Orange Tower"] == item and _tower_floors < orange_tower.size(): - var subitem_name = "Orange Tower - %s Floor" % orange_tower[_tower_floors] - global._print(subitem_name) - processItem(_item_name_to_id[subitem_name], null, null, null) - _tower_floors += 1 + # Handle progressive items. + var item_name = "Unknown" + if _item_id_to_name.has(item): + item_name = _item_id_to_name[item] + + if item_name in 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"] + global._print(subitem_name) + processItem(_item_name_to_id[subitem_name], null, null, null) + _progressive_progress[item_name] += 1 if _color_shuffle and color_items.has(_item_id_to_name[item]): var lcol = _item_id_to_name[item].to_lower() @@ -544,12 +577,9 @@ func processItem(item, index, from, flags): _last_new_item = index saveLocaldata() - var item_name = "Unknown" - if _item_id_to_name.has(item): - item_name = _item_id_to_name[item] - - if item_name == "Progressive Orange Tower": - item_name = "Progressive Orange Tower (%s Floor)" % orange_tower[_tower_floors - 1] + if item_name in progressive_items: + var subitem = progressive_items[item_name][_progressive_progress[item_name] - 1] + item_name += " (%s)" % subitem["display"] var player_name = "Unknown" if _player_name_by_slot.has(from): diff --git a/Archipelago/load.gd b/Archipelago/load.gd index e3ae24e..76015e9 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -175,6 +175,33 @@ func _load(): var chosen_painting = remaining[rng.randi_range(0, remaining.size() - 1)] instantiate_painting(painting, chosen_painting) + # If door shuffle is on, 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 getting the fifth floor, so will move the + # backroom door. Also, the paintings in the backroom should only show up as + # the player gets the progressive art gallery items. + if apclient._door_shuffle: + var backroom_door = get_node("Doors/Tower Room Area Doors/Door_painting_backroom") + backroom_door.translation.x = 97 + backroom_door.translation.y = 0 + backroom_door.translation.z = 39 + backroom_door.scale.x = 2 + backroom_door.scale.y = 2.5 + backroom_door.scale.z = 1 + + for i in range(2, 6): + var painting_path = "Decorations/Paintings/scenery_painting_%db" % i + var painting_node = get_node(painting_path) + var rotate = painting_node.rotate + var target = painting_node.target + painting_node.set_script(load("res://scripts/painting_eye.gd")) + painting_node.rotate = rotate + painting_node.target = target + painting_node.move_to_x = painting_node.translation.x + painting_node.move_to_z = painting_node.translation.z + painting_node.translation.x = 88 + painting_node.translation.z = 39 + # Attach a script to every panel so that we can do things like conditionally # disable them. var panel_script = ResourceLoader.load("user://maps/Archipelago/panel.gd") diff --git a/Archipelago/painting_scenery.gd b/Archipelago/painting_scenery.gd new file mode 100644 index 0000000..f49d602 --- /dev/null +++ b/Archipelago/painting_scenery.gd @@ -0,0 +1,11 @@ +extends "res://scripts/painting_scenery.gd" + + +func _answer_correct(): + var apclient = global.get_node("Archipelago") + if not apclient._door_shuffle or apclient.paintingIsVanilla(self.name): + ._answer_correct() + + +func movePainting(): + ._answer_correct() diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index e8f88e7..890afaa 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd @@ -22,6 +22,7 @@ func _ready(): installScriptExtension("user://maps/Archipelago/doorControl.gd") installScriptExtension("user://maps/Archipelago/load.gd") installScriptExtension("user://maps/Archipelago/painting_eye.gd") + installScriptExtension("user://maps/Archipelago/painting_scenery.gd") installScriptExtension("user://maps/Archipelago/panelLevelSwitch.gd") installScriptExtension("user://maps/Archipelago/panelEnd.gd") installScriptExtension("user://maps/Archipelago/pause_menu.gd") -- cgit 1.4.1