mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Merge branch 'main' into multishop
This commit is contained in:
12
Fill.py
12
Fill.py
@@ -262,6 +262,11 @@ def balance_multiworld_progression(world):
|
||||
|
||||
reachable_locations_count = {player: 0 for player in range(1, world.players + 1)}
|
||||
|
||||
def event_key(location):
|
||||
return location.event and (
|
||||
world.keyshuffle[location.item.player] or not location.item.smallkey) and (
|
||||
world.bigkeyshuffle[location.item.player] or not location.item.bigkey)
|
||||
|
||||
def get_sphere_locations(sphere_state, locations):
|
||||
sphere_state.sweep_for_events(key_only=True, locations=locations)
|
||||
return [loc for loc in locations if sphere_state.can_reach(loc)]
|
||||
@@ -284,9 +289,7 @@ def balance_multiworld_progression(world):
|
||||
candidate_items = []
|
||||
while True:
|
||||
for location in balancing_sphere:
|
||||
if location.event and (
|
||||
world.keyshuffle[location.item.player] or not location.item.smallkey) and (
|
||||
world.bigkeyshuffle[location.item.player] or not location.item.bigkey):
|
||||
if event_key(location):
|
||||
balancing_state.collect(location.item, True, location)
|
||||
if location.item.player in balancing_players and not location.locked:
|
||||
candidate_items.append(location)
|
||||
@@ -348,8 +351,7 @@ def balance_multiworld_progression(world):
|
||||
sphere_locations.append(location)
|
||||
|
||||
for location in sphere_locations:
|
||||
if location.event and (world.keyshuffle[location.item.player] or not location.item.smallkey) and (
|
||||
world.bigkeyshuffle[location.item.player] or not location.item.bigkey):
|
||||
if event_key(location):
|
||||
state.collect(location.item, True, location)
|
||||
checked_locations.extend(sphere_locations)
|
||||
|
||||
|
Reference in New Issue
Block a user