From afde644b3870223d229eacf263d6250403869bb8 Mon Sep 17 00:00:00 2001 From: magical Date: Sat, 3 Feb 2024 01:07:16 -0800 Subject: [PATCH] untangle find_available_areas --- Randomizer.py | 326 +++++++++++++++++++++++++------------------------- 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/Randomizer.py b/Randomizer.py index 54985f5..d117cea 100644 --- a/Randomizer.py +++ b/Randomizer.py @@ -1629,177 +1629,177 @@ def find_available_areas(graph): path = graph.get_path(check, StartLocation) if path != None: AreaOpen[0] = check + if AreaOpen[1] == None: + check = 'S1-00' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[1] = check + if ScrewAttack: if AreaOpen[1] == None: - check = 'S1-00' + check = 'S1-6B' path = graph.get_path(StartLocation, check) if path != None: path = graph.get_path(check, StartLocation) if path != None: AreaOpen[1] = check - if ScrewAttack: - if AreaOpen[1] == None: - check = 'S1-6B' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[1] = check - if AreaOpen[1] == None: - check = 'S1-68' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[1] = check - if AreaOpen[2] == None: - check = 'S2-00' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[2] = check - if ScrewAttack: - if AreaOpen[2] == None: - check = 'S2-7F' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[2] = check - if AreaOpen[2] == None: - check = 'S2-82' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[2] = check - if AreaOpen[3] == None: - check = 'S3-00' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[3] = check - if ScrewAttack: - if AreaOpen[3] == None: - check = 'S3-56' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[3] = check - if AreaOpen[3] == None: - check = 'S3-59' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[3] = check - if AreaOpen[4] == None: - check = 'S4-00' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[4] = check - if ScrewAttack: - if AreaOpen[4] == None: - check = 'S4-6A' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[4] = check - if AreaOpen[4] == None: - check = 'S4-6C' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[4] = check - if AreaOpen[5] == None: - check = 'S5-00' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[5] = check - if ScrewAttack: - if AreaOpen[5] == None: - check = 'S5-53' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[5] = check - if AreaOpen[6] == None: - check = 'S6-00' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[6] = check - if ScrewAttack: - if AreaOpen[6] == None: - check = 'S6-51' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[6] = check - if AreaOpen[6] == None: - check = 'S6-54' - path = graph.get_path(StartLocation, check) - if path != None: - path = graph.get_path(check, StartLocation) - if path != None: - AreaOpen[6] = check - if BlueDoors == False: - path = graph.get_path(StartLocation, 'Security-Level-1', depth=250) - if path != None: - enable_item(graph, 'BlueDoors') - path = graph.get_path('Security-Level-1', StartLocation, depth=250) - if path == None: - disable_item(graph, 'BlueDoors') - if GreenDoors == False: - path = graph.get_path(StartLocation, 'Security-Level-2', depth=250) - if path != None: - enable_item(graph, 'GreenDoors') - path = graph.get_path('Security-Level-2', StartLocation, depth=250) - if path == None: - disable_item(graph, 'GreenDoors') - elif SeedSettings['SplitSecurity'] == False: - enable_item(graph, 'BlueDoors') - if YellowDoors == False: - path = graph.get_path(StartLocation, 'Security-Level-3', depth=250) - if path != None: - enable_item(graph, 'YellowDoors') - path = graph.get_path('Security-Level-3', StartLocation, depth=250) - if path == None: - disable_item(graph, 'YellowDoors') - elif SeedSettings['SplitSecurity'] == False: - enable_item(graph, 'GreenDoors') - enable_item(graph, 'BlueDoors') - if RedDoors == False: - path = graph.get_path(StartLocation, 'Security-Level-4', depth=250) - if path != None: - enable_item(graph, 'RedDoors') - path = graph.get_path('Security-Level-4', StartLocation, depth=250) - if path == None: - disable_item(graph, 'RedDoors') - elif SeedSettings['SplitSecurity'] == False: - enable_item(graph, 'YellowDoors') - enable_item(graph, 'GreenDoors') - enable_item(graph, 'BlueDoors') - if WaterLowered == False: - path = graph.get_path(StartLocation, 'S4-00') + if AreaOpen[1] == None: + check = 'S1-68' + path = graph.get_path(StartLocation, check) if path != None: - path = graph.get_path('S4-00', 'Water Pump', True) + path = graph.get_path(check, StartLocation) if path != None: - enable_item(graph, 'WaterLowered') - path = graph.get_path('Water Pump', 'S4-00', True) - if path == None: - disable_item(graph, 'WaterLowered') + AreaOpen[1] = check + if AreaOpen[2] == None: + check = 'S2-00' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[2] = check + if ScrewAttack: + if AreaOpen[2] == None: + check = 'S2-7F' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[2] = check + if AreaOpen[2] == None: + check = 'S2-82' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[2] = check + if AreaOpen[3] == None: + check = 'S3-00' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[3] = check + if ScrewAttack: + if AreaOpen[3] == None: + check = 'S3-56' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[3] = check + if AreaOpen[3] == None: + check = 'S3-59' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[3] = check + if AreaOpen[4] == None: + check = 'S4-00' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[4] = check + if ScrewAttack: + if AreaOpen[4] == None: + check = 'S4-6A' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[4] = check + if AreaOpen[4] == None: + check = 'S4-6C' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[4] = check + if AreaOpen[5] == None: + check = 'S5-00' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[5] = check + if ScrewAttack: + if AreaOpen[5] == None: + check = 'S5-53' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[5] = check + if AreaOpen[6] == None: + check = 'S6-00' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[6] = check + if ScrewAttack: + if AreaOpen[6] == None: + check = 'S6-51' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[6] = check + if AreaOpen[6] == None: + check = 'S6-54' + path = graph.get_path(StartLocation, check) + if path != None: + path = graph.get_path(check, StartLocation) + if path != None: + AreaOpen[6] = check + if BlueDoors == False: + path = graph.get_path(StartLocation, 'Security-Level-1', depth=250) + if path != None: + enable_item(graph, 'BlueDoors') + path = graph.get_path('Security-Level-1', StartLocation, depth=250) + if path == None: + disable_item(graph, 'BlueDoors') + if GreenDoors == False: + path = graph.get_path(StartLocation, 'Security-Level-2', depth=250) + if path != None: + enable_item(graph, 'GreenDoors') + path = graph.get_path('Security-Level-2', StartLocation, depth=250) + if path == None: + disable_item(graph, 'GreenDoors') + elif SeedSettings['SplitSecurity'] == False: + enable_item(graph, 'BlueDoors') + if YellowDoors == False: + path = graph.get_path(StartLocation, 'Security-Level-3', depth=250) + if path != None: + enable_item(graph, 'YellowDoors') + path = graph.get_path('Security-Level-3', StartLocation, depth=250) + if path == None: + disable_item(graph, 'YellowDoors') + elif SeedSettings['SplitSecurity'] == False: + enable_item(graph, 'GreenDoors') + enable_item(graph, 'BlueDoors') + if RedDoors == False: + path = graph.get_path(StartLocation, 'Security-Level-4', depth=250) + if path != None: + enable_item(graph, 'RedDoors') + path = graph.get_path('Security-Level-4', StartLocation, depth=250) + if path == None: + disable_item(graph, 'RedDoors') + elif SeedSettings['SplitSecurity'] == False: + enable_item(graph, 'YellowDoors') + enable_item(graph, 'GreenDoors') + enable_item(graph, 'BlueDoors') + if WaterLowered == False: + path = graph.get_path(StartLocation, 'S4-00') + if path != None: + path = graph.get_path('S4-00', 'Water Pump', True) + if path != None: + enable_item(graph, 'WaterLowered') + path = graph.get_path('Water Pump', 'S4-00', True) + if path == None: + disable_item(graph, 'WaterLowered') def randomize_game(graph):