@@ -65,22 +65,38 @@ def generate_early(self) -> None:
65
65
creature_pool , self .options .creature_scans .value )
66
66
67
67
def create_regions (self ):
68
- self .multiworld .regions += [
69
- self .create_region ("Menu" , None , ["Lifepod 5" ]),
70
- self .create_region ("Planet 4546B" ,
71
- locations .events +
72
- [location ["name" ] for location in locations .location_table .values ()] +
73
- [creature + creatures .suffix for creature in self .creatures_to_scan ])
74
- ]
68
+ # Create Regions
69
+ menu_region = Region ("Menu" , self .player , self .multiworld )
70
+ planet_region = Region ("Planet 4546B" , self .player , self .multiworld )
71
+
72
+ # Link regions together
73
+ menu_region .connect (planet_region , "Lifepod 5" )
74
+
75
+ # Create regular locations
76
+ location_names = itertools .chain ((location ["name" ] for location in locations .location_table .values ()),
77
+ (creature + creatures .suffix for creature in self .creatures_to_scan ))
78
+ for location_name in location_names :
79
+ loc_id = self .location_name_to_id [location_name ]
80
+ location = SubnauticaLocation (self .player , location_name , loc_id , planet_region )
81
+ planet_region .locations .append (location )
75
82
76
- # Link regions
77
- self . multiworld . get_entrance ( "Lifepod 5" , self .player ). connect ( self . multiworld . get_region ( "Planet 4546B" , self . player ) )
83
+ # Create events
84
+ goal_event_name = self .options . goal . get_event_name ( )
78
85
79
86
for event in locations .events :
80
- self .multiworld .get_location (event , self .player ).place_locked_item (
87
+ location = SubnauticaLocation (self .player , event , None , planet_region )
88
+ planet_region .locations .append (location )
89
+ location .place_locked_item (
81
90
SubnauticaItem (event , ItemClassification .progression , None , player = self .player ))
82
- # make the goal event the victory "item"
83
- self .multiworld .get_location (self .options .goal .get_event_name (), self .player ).item .name = "Victory"
91
+ if event == goal_event_name :
92
+ # make the goal event the victory "item"
93
+ location .item .name = "Victory"
94
+
95
+ # Register regions to multiworld
96
+ self .multiworld .regions += [
97
+ menu_region ,
98
+ planet_region
99
+ ]
84
100
85
101
# refer to Rules.py
86
102
set_rules = set_rules
0 commit comments