Correct promotion of map and compass to advancement to add that logic

This commit is contained in:
aerinon
2021-08-26 15:36:12 -06:00
parent 4e8a8d2840
commit 23352c3bf7

View File

@@ -1,6 +1,6 @@
from collections import defaultdict
from Dungeons import dungeon_prize
from Dungeons import dungeon_table
class ItemPoolConfig(object):
@@ -9,12 +9,17 @@ class ItemPoolConfig(object):
def create_item_pool_config(world):
config = ItemPoolConfig()
if world.algorithm in ['balanced']:
for player in range(1, world.players+1):
if world.restrict_boss_items[player]:
for dungeon in dungeon_prize:
if dungeon.startswith('Thieves'):
dungeon = "Thieves' Town"
config.reserved_locations[player].add(f'{dungeon} - Boss')
world.item_pool_config = config
world.item_pool_config = config = ItemPoolConfig()
player_set = set()
for player in range(1, world.players+1):
if world.restrict_boss_items[player] != 'none':
player_set.add(player)
if world.restrict_boss_items[player] == 'dungeon':
for dungeon, info in dungeon_table.items():
if info.prize:
d_name = "Thieves' Town" if dungeon.startswith('Thieves') else dungeon
config.reserved_locations[player].add(f'{d_name} - Boss')
for dungeon in world.dungeons:
for item in dungeon.all_items:
if item.map or item.compass:
item.advancement = True