Skip to content

Commit b114629

Browse files
committed
Merge remote-tracking branch 'salzkorn/sc2hots' into sc2wol-extended-units
2 parents cf2fb65 + 8c62aa9 commit b114629

10 files changed

+14
-7
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

worlds/sc2hots/Regions.py

+14-7
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ def create_regions(multiworld: MultiWorld, player: int, locations: Tuple[Locatio
141141
# lambda state: state.has('Beat Gates of Hell', player) and (
142142
# state.has('Beat Shatter the Sky', player) or state.has('Beat Belly of the Beast', player)))
143143

144+
# Final location should be near the end of the cache
145+
set_final_location(location_cache, 'The Reckoning: Victory')
146+
144147
return vanilla_mission_req_table, 20, 'The Reckoning: Victory'
145148

146149
else:
@@ -325,13 +328,7 @@ def build_connection_rule(mission_names: List[str], missions_req: int) -> Callab
325328

326329
# Changing the completion condition for alternate final missions into an event
327330
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)
335332

336333
return mission_req_table, final_mission_id, final_location
337334

@@ -389,3 +386,13 @@ def get_locations_per_region(locations: Tuple[LocationData, ...]) -> Dict[str, L
389386
per_region.setdefault(location.region, []).append(location)
390387

391388
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

Comments
 (0)