1111region_names = ["Sawmill" , "Cul-De-Sac" , "Construction" , "Downtown" ]
1212
1313def create_regions (world : "SneakKingWorld" ):
14- # Create menu region (always included)
1514 menu_region = Region ("Menu" , world .player , world .multiworld )
1615 world .multiworld .regions .append (menu_region )
1716
18- # Create other regions from dictionary, excluding any in disabled_regions
1917 regions_dict = get_regions_dict ()
2018 for name , locations in regions_dict .items ():
2119 if name not in world .disabled_regions :
@@ -35,13 +33,10 @@ def connect_regions(world: "SneakKingWorld"):
3533 connections_dict = get_region_connections_dict (world )
3634 names : typing .Dict [str , int ] = {}
3735
38- # Connect regions based on the connections dictionary, excluding any with excluded regions
3936 for (source , target ), rule in connections_dict .items ():
40- # Skip connections where either the source or target is in excluded_regions
4137 if source in world .disabled_regions or target in world .disabled_regions :
4238 continue
4339
44- # Verify that both regions exist before trying to connect them
4540 try :
4641 world .multiworld .get_region (source , world .player )
4742 world .multiworld .get_region (target , world .player )
@@ -74,16 +69,13 @@ def get_level_order(world: "SneakKingWorld") -> list[str]:
7469def get_region_connections_dict (world : "SneakKingWorld" ):
7570 level_order = world .level_order
7671 connections = {
77- ("Menu" , level_order [0 ]): None , # Starting region is always accessible
72+ ("Menu" , level_order [0 ]): None ,
7873 }
7974
8075 if world .options .level_unlock_method == LevelUnlockMethod .option_unlock_item :
81- # All non-starting regions connect from Menu with their unlock item
8276 for region in level_order [1 :]:
8377 connections [("Menu" , region )] = Has (f"{ region } Unlock" )
8478 else :
85- # x_missions: linear chain where completing X missions in region N unlocks region N+1
86- # Mission 1 is always available (no unlock needed), so we need X-1 unlock items
8779 required_unlocks = world .options .level_unlock_range .value - 1
8880 for i in range (1 , len (level_order )):
8981 prev_region = level_order [i - 1 ]
0 commit comments