From 008e84c9a07032b6f47b441c172a8092672194f4 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Thu, 29 Oct 2020 15:18:21 -0700 Subject: [PATCH] Add Location to area data to multidata --- Main.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Main.py b/Main.py index e96b4bbc..947d1473 100644 --- a/Main.py +++ b/Main.py @@ -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,