Refactor shop code to only patch changed custom shops

This commit is contained in:
cassidoxa
2020-02-07 12:17:31 -05:00
parent 8cac03f4a3
commit 1f09357138
2 changed files with 12 additions and 10 deletions

View File

@@ -397,8 +397,10 @@ def set_up_shops(world, player):
if world.retro[player]:
rss = world.get_region('Red Shield Shop', player).shop
if not rss.locked:
rss.custom = True
rss.add_inventory(2, 'Single Arrow', 80)
for shop in random.sample([s for s in world.shops if s.custom and not s.locked and s.region.player == player], 5):
for shop in random.sample([s for s in world.shops if not s.locked and s.region.player == player], 5):
shop.custom = True
shop.locked = True
shop.add_inventory(0, 'Single Arrow', 80)
shop.add_inventory(1, 'Small Key (Universal)', 100)