Initial Shopsanity

Retro work
This commit is contained in:
aerinon
2020-12-03 16:25:51 -07:00
parent ba3bd4b648
commit e834fd85a1
16 changed files with 471 additions and 236 deletions

17
Fill.py
View File

@@ -2,6 +2,7 @@ import random
import logging
from BaseClasses import CollectionState
from Regions import shop_to_location_table
class FillError(RuntimeError):
@@ -374,6 +375,22 @@ def flood_items(world):
itempool.remove(item_to_place)
break
def sell_keys(world, player):
choices = []
shop_map = {}
for shop in world.shops[player]:
if shop.region.name in shop_to_location_table:
choices.append(shop.region.name)
shop_map[shop.region.name] = shop
key_seller = random.choice(choices)
location = random.choice(shop_to_location_table[key_seller])
universal_key = next(item for item in world.itempool if item.name == 'Small Key (Universal)' and item.player == player)
world.push_item(world.get_location(location, player), universal_key, collect=False)
shop_map[key_seller].add_inventory(0, 'Small Key (Universal)', 100) # will be fixed later in customize shops
world.itempool.remove(universal_key)
def balance_multiworld_progression(world):
state = CollectionState(world)
checked_locations = []