Fixed the shop spoiler when multiworld balancing
This commit is contained in:
27
Fill.py
27
Fill.py
@@ -496,6 +496,10 @@ def balance_multiworld_progression(world):
|
||||
new_location = replacement_locations.pop()
|
||||
|
||||
new_location.item, old_location.item = old_location.item, new_location.item
|
||||
if world.shopsanity[new_location.player]:
|
||||
check_shop_swap(new_location)
|
||||
if world.shopsanity[old_location.player]:
|
||||
check_shop_swap(old_location)
|
||||
new_location.event, old_location.event = True, False
|
||||
state.collect(new_location.item, True, new_location)
|
||||
replaced_items = True
|
||||
@@ -516,6 +520,18 @@ def balance_multiworld_progression(world):
|
||||
raise RuntimeError('Not all required items reachable. Something went terribly wrong here.')
|
||||
|
||||
|
||||
def check_shop_swap(l):
|
||||
if l.parent_region.name in shop_to_location_table:
|
||||
if l.name in shop_to_location_table[l.parent_region.name]:
|
||||
idx = shop_to_location_table[l.parent_region.name].index(l.name)
|
||||
inv_slot = l.parent_region.shop.inventory[idx]
|
||||
inv_slot['item'] = l.item.name
|
||||
elif l.parent_region in retro_shops:
|
||||
idx = retro_shops[l.parent_region.name].index(l.name)
|
||||
inv_slot = l.parent_region.shop.inventory[idx]
|
||||
inv_slot['item'] = l.item.name
|
||||
|
||||
|
||||
def balance_money_progression(world):
|
||||
logger = logging.getLogger('')
|
||||
state = CollectionState(world)
|
||||
@@ -583,17 +599,6 @@ def balance_money_progression(world):
|
||||
path = path[1]
|
||||
return False
|
||||
|
||||
def check_shop_swap(l):
|
||||
if l.parent_region.name in shop_to_location_table:
|
||||
if l.name in shop_to_location_table[l.parent_region.name]:
|
||||
idx = shop_to_location_table[l.parent_region.name].index(l.name)
|
||||
inv_slot = l.parent_region.shop.inventory[idx]
|
||||
inv_slot['item'] = l.item.name
|
||||
elif location.parent_region in retro_shops:
|
||||
idx = retro_shops[l.parent_region.name].index(l.name)
|
||||
inv_slot = l.parent_region.shop.inventory[idx]
|
||||
inv_slot['item'] = l.item.name
|
||||
|
||||
done = False
|
||||
while not done:
|
||||
sphere_costs = {player: 0 for player in range(1, world.players+1)}
|
||||
|
||||
Reference in New Issue
Block a user