Add Location to area data to multidata

This commit is contained in:
CaitSith2 2020-10-29 15:18:21 -07:00
parent 58765a18d3
commit 008e84c9a0
1 changed files with 29 additions and 0 deletions

29
Main.py
View File

@ -297,6 +297,34 @@ def main(args, seed=None):
if lookup_vanilla_location_to_entrance[location.address] != main_entrance.name:
er_hint_data[region.player][location.address] = main_entrance.name
ordered_areas = ('Light World', 'Dark World', 'Hyrule Castle', 'Agahnims Tower', 'Eastern Palace', 'Desert Palace',
'Tower of Hera', 'Palace of Darkness', 'Swamp Palace', 'Skull Woods', 'Thieves Town', 'Ice Palace',
'Misery Mire', 'Turtle Rock', 'Ganons Tower', "Total")
checks_in_area = {player: {area: list() for area in ordered_areas}
for player in range(1, world.players + 1)}
for player in range(1, world.players + 1):
checks_in_area[player]["Total"] = 0
for location in [loc for loc in world.get_filled_locations() if type(loc.address) is int]:
main_entrance = get_entrance_to_region(location.parent_region, [])
if location.parent_region.dungeon:
checks_in_area[location.player][location.parent_region.dungeon.name].append(location.address)
elif main_entrance.parent_region.type == RegionType.LightWorld:
checks_in_area[location.player]["Light World"].append(location.address)
elif main_entrance.parent_region.type == RegionType.DarkWorld:
checks_in_area[location.player]["Dark World"].append(location.address)
checks_in_area[location.player]["Total"] += 1
for player in range(1, world.players + 1):
for area in ordered_areas:
if area != "Total":
logging.info(f'{player}: {area} :: {len(checks_in_area[player][area])}')
else:
logging.info(f'{player}: {area} :: {checks_in_area[player][area]}')
precollected_items = [[] for player in range(world.players)]
for item in world.precollected_items:
precollected_items[item.player - 1].append(item.code)
@ -323,6 +351,7 @@ def main(args, seed=None):
(location.item.code, location.item.player))
for location in world.get_filled_locations() if
type(location.address) is int],
"checks_in_area": checks_in_area,
"server_options": get_options()["server_options"],
"er_hint_data": er_hint_data,
"precollected_items": precollected_items,