@@ -141,6 +141,9 @@ def create_regions(multiworld: MultiWorld, player: int, locations: Tuple[Locatio
141
141
# lambda state: state.has('Beat Gates of Hell', player) and (
142
142
# state.has('Beat Shatter the Sky', player) or state.has('Beat Belly of the Beast', player)))
143
143
144
+ # Final location should be near the end of the cache
145
+ set_final_location (location_cache , 'The Reckoning: Victory' )
146
+
144
147
return vanilla_mission_req_table , 20 , 'The Reckoning: Victory'
145
148
146
149
else :
@@ -325,13 +328,7 @@ def build_connection_rule(mission_names: List[str], missions_req: int) -> Callab
325
328
326
329
# Changing the completion condition for alternate final missions into an event
327
330
final_location = final_mission + ': Victory'
328
- # Final location should be near the end of the cache
329
- for i in range (len (location_cache ) - 1 , - 1 , - 1 ):
330
- if location_cache [i ].name == final_location :
331
- location_cache [i ].locked = True
332
- location_cache [i ].event = True
333
- location_cache [i ].address = None
334
- break
331
+ set_final_location (location_cache , final_location )
335
332
336
333
return mission_req_table , final_mission_id , final_location
337
334
@@ -389,3 +386,13 @@ def get_locations_per_region(locations: Tuple[LocationData, ...]) -> Dict[str, L
389
386
per_region .setdefault (location .region , []).append (location )
390
387
391
388
return per_region
389
+
390
+
391
+ def set_final_location (location_cache : List [Location ], final_location : str ):
392
+ # Final location should be near the end of the cache
393
+ for i in range (len (location_cache ) - 1 , - 1 , - 1 ):
394
+ if location_cache [i ].name == final_location :
395
+ location_cache [i ].locked = True
396
+ location_cache [i ].event = True
397
+ location_cache [i ].address = None
398
+ return
0 commit comments