@@ -224,21 +224,23 @@ def create_regions(self):
224
224
max_difficulty = 1 if self .multiworld .difficulty [self .player ] == Difficulty .option_easy else 256
225
225
226
226
# TODO: generate *some* regions from locations' requirements?
227
- r = Region ('Menu' , self .player , self .multiworld )
228
- r .exits = [Entrance (self .player , 'New Game' , r )]
229
- self .multiworld .regions += [r ]
227
+ menu = Region ('Menu' , self .player , self .multiworld )
228
+ self .multiworld .regions += [menu ]
230
229
231
230
def get_sphere_index (evermizer_loc ):
232
231
"""Returns 0, 1 or 2 for locations in spheres 1, 2, 3+"""
233
232
if len (evermizer_loc .requires ) == 1 and evermizer_loc .requires [0 ][1 ] != pyevermizer .P_WEAPON :
234
233
return 2
235
234
return min (2 , len (evermizer_loc .requires ))
236
235
236
+ # create ingame region
237
+ ingame = Region ('Ingame' , self .player , self .multiworld )
238
+
237
239
# group locations into spheres (1, 2, 3+ at index 0, 1, 2)
238
240
spheres : typing .Dict [int , typing .Dict [int , typing .List [SoELocation ]]] = {}
239
241
for loc in _locations :
240
242
spheres .setdefault (get_sphere_index (loc ), {}).setdefault (loc .type , []).append (
241
- SoELocation (self .player , loc .name , self .location_name_to_id [loc .name ], r ,
243
+ SoELocation (self .player , loc .name , self .location_name_to_id [loc .name ], ingame ,
242
244
loc .difficulty > max_difficulty ))
243
245
244
246
# location balancing data
@@ -280,18 +282,16 @@ def sphere1_blocked_items_rule(item):
280
282
late_locations = self .multiworld .random .sample (late_bosses , late_count )
281
283
282
284
# add locations to the world
283
- r = Region ('Ingame' , self .player , self .multiworld )
284
285
for sphere in spheres .values ():
285
286
for locations in sphere .values ():
286
287
for location in locations :
287
- r .locations .append (location )
288
+ ingame .locations .append (location )
288
289
if location .name in late_locations :
289
290
location .progress_type = LocationProgressType .PRIORITY
290
291
291
- r .locations .append (SoELocation (self .player , 'Done' , None , r ))
292
- self .multiworld .regions += [r ]
293
-
294
- self .multiworld .get_entrance ('New Game' , self .player ).connect (self .multiworld .get_region ('Ingame' , self .player ))
292
+ ingame .locations .append (SoELocation (self .player , 'Done' , None , ingame ))
293
+ menu .connect (ingame , "New Game" )
294
+ self .multiworld .regions += [ingame ]
295
295
296
296
def create_items (self ):
297
297
# add regular items to the pool
0 commit comments