Customize certain potions refills.

This commit is contained in:
aerinon
2023-03-13 14:26:25 -06:00
parent c48c89f65b
commit b44caa76a7
2 changed files with 5 additions and 4 deletions

View File

@@ -661,9 +661,10 @@ def sell_potions(world, player):
for potion in ['Green Potion', 'Blue Potion', 'Red Potion']: for potion in ['Green Potion', 'Blue Potion', 'Red Potion']:
location = random.choice(filter_locations(ItemFactory(potion, player), locations, world, potion=True)) location = random.choice(filter_locations(ItemFactory(potion, player), locations, world, potion=True))
locations.remove(location) locations.remove(location)
p_item = next(item for item in world.itempool if item.name == potion and item.player == player) p_item = next((item for item in world.itempool if item.name == potion and item.player == player), None)
world.push_item(location, p_item, collect=False) if p_item:
world.itempool.remove(p_item) world.push_item(location, p_item, collect=False)
world.itempool.remove(p_item)
def sell_keys(world, player): def sell_keys(world, player):

View File

@@ -250,6 +250,7 @@ def main(args, seed=None, fish=None):
set_rules(world, player) set_rules(world, player)
district_item_pool_config(world) district_item_pool_config(world)
fill_specific_items(world)
for player in range(1, world.players + 1): for player in range(1, world.players + 1):
if world.shopsanity[player]: if world.shopsanity[player]:
sell_potions(world, player) sell_potions(world, player)
@@ -262,7 +263,6 @@ def main(args, seed=None, fish=None):
if args.print_custom_yaml: if args.print_custom_yaml:
world.settings.record_item_pool(world) world.settings.record_item_pool(world)
dungeon_tracking(world) dungeon_tracking(world)
fill_specific_items(world)
logger.info(world.fish.translate("cli", "cli", "placing.dungeon.prizes")) logger.info(world.fish.translate("cli", "cli", "placing.dungeon.prizes"))
fill_prizes(world) fill_prizes(world)