From b4fb763fecbcc14c24481336c57cd7673a3e2632 Mon Sep 17 00:00:00 2001 From: CookieCat Date: Wed, 25 Oct 2023 14:29:40 -0400 Subject: [PATCH] Formatting improvements --- worlds/ahit/Locations.py | 107 ++++++++++++++++++++++++++++++--------- worlds/ahit/Regions.py | 26 ++++------ worlds/ahit/Rules.py | 2 +- worlds/ahit/__init__.py | 3 +- 4 files changed, 94 insertions(+), 44 deletions(-) diff --git a/worlds/ahit/Locations.py b/worlds/ahit/Locations.py index 0a43bc1367..00ec578624 100644 --- a/worlds/ahit/Locations.py +++ b/worlds/ahit/Locations.py @@ -166,10 +166,17 @@ ahit_locations = { "Dead Bird Studio - Red Building Top": LocData(2000305024, "Dead Bird Studio - Elevator Area"), "Dead Bird Studio - Behind Water Tower": LocData(2000305248, "Dead Bird Studio - Elevator Area"), "Dead Bird Studio - Side of House": LocData(2000305247, "Dead Bird Studio - Elevator Area"), - "Dead Bird Studio - DJ Grooves Sign Chest": LocData(2000303901, "Dead Bird Studio - Post Elevator Area", hit_requirement=1), - "Dead Bird Studio - Tightrope Chest": LocData(2000303898, "Dead Bird Studio - Post Elevator Area", hit_requirement=1), + + "Dead Bird Studio - DJ Grooves Sign Chest": LocData(2000303901, "Dead Bird Studio - Post Elevator Area", + hit_requirement=1), + + "Dead Bird Studio - Tightrope Chest": LocData(2000303898, "Dead Bird Studio - Post Elevator Area", + hit_requirement=1), + "Dead Bird Studio - Tepee Chest": LocData(2000303899, "Dead Bird Studio - Post Elevator Area", hit_requirement=1), - "Dead Bird Studio - Conductor Chest": LocData(2000303900, "Dead Bird Studio - Post Elevator Area", hit_requirement=1), + + "Dead Bird Studio - Conductor Chest": LocData(2000303900, "Dead Bird Studio - Post Elevator Area", + hit_requirement=1), "Murder on the Owl Express - Cafeteria": LocData(2000305313, "Murder on the Owl Express"), "Murder on the Owl Express - Luggage Room Top": LocData(2000305090, "Murder on the Owl Express"), @@ -267,7 +274,10 @@ ahit_locations = { "Subcon Well - Mushroom": LocData(2000325318, "The Subcon Well", hit_requirement=1, paintings=1), "Queen Vanessa's Manor - Cellar": LocData(2000324841, "Queen Vanessa's Manor", hit_requirement=2, paintings=1), - "Queen Vanessa's Manor - Bedroom Chest": LocData(2000323808, "Queen Vanessa's Manor", hit_requirement=2, paintings=1), + + "Queen Vanessa's Manor - Bedroom Chest": LocData(2000323808, "Queen Vanessa's Manor", hit_requirement=2, + paintings=1), + "Queen Vanessa's Manor - Hall Chest": LocData(2000323896, "Queen Vanessa's Manor", hit_requirement=2, paintings=1), "Queen Vanessa's Manor - Chandelier": LocData(2000325546, "Queen Vanessa's Manor", hit_requirement=2, paintings=1), @@ -276,7 +286,10 @@ ahit_locations = { "Alpine Skyline - Goat Village: Hidden Branch": LocData(2000334855, "Alpine Skyline Area (TIHS)"), "Alpine Skyline - Goat Refinery": LocData(2000333635, "Alpine Skyline Area"), "Alpine Skyline - Bird Pass Fork": LocData(2000335911, "Alpine Skyline Area (TIHS)"), - "Alpine Skyline - Yellow Band Hills": LocData(2000335756, "Alpine Skyline Area (TIHS)", required_hats=[HatType.BREWING]), + + "Alpine Skyline - Yellow Band Hills": LocData(2000335756, "Alpine Skyline Area (TIHS)", + required_hats=[HatType.BREWING]), + "Alpine Skyline - The Purrloined Village: Horned Stone": LocData(2000335561, "Alpine Skyline Area"), "Alpine Skyline - The Purrloined Village: Chest Reward": LocData(2000334831, "Alpine Skyline Area"), "Alpine Skyline - The Birdhouse: Triple Crow Chest": LocData(2000334758, "The Birdhouse"), @@ -373,10 +386,18 @@ act_completions = { "Act Completion (Time Rift - Dead Bird Studio)": LocData(2000312577, "Time Rift - Dead Bird Studio"), "Act Completion (Contractual Obligations)": LocData(2000312317, "Contractual Obligations", paintings=1), - "Act Completion (The Subcon Well)": LocData(2000311160, "The Subcon Well", hookshot=True, umbrella=True, paintings=1), - "Act Completion (Toilet of Doom)": LocData(2000311984, "Toilet of Doom", hit_requirement=1, hookshot=True, paintings=1), + + "Act Completion (The Subcon Well)": LocData(2000311160, "The Subcon Well", hookshot=True, hit_requirement=1, + paintings=1), + + "Act Completion (Toilet of Doom)": LocData(2000311984, "Toilet of Doom", hit_requirement=1, hookshot=True, + paintings=1), + "Act Completion (Queen Vanessa's Manor)": LocData(2000312017, "Queen Vanessa's Manor", umbrella=True, paintings=1), - "Act Completion (Mail Delivery Service)": LocData(2000312032, "Mail Delivery Service", required_hats=[HatType.SPRINT]), + + "Act Completion (Mail Delivery Service)": LocData(2000312032, "Mail Delivery Service", + required_hats=[HatType.SPRINT]), + "Act Completion (Your Contract has Expired)": LocData(2000311390, "Your Contract has Expired", umbrella=True), "Act Completion (Time Rift - Pipe)": LocData(2000313069, "Time Rift - Pipe", hookshot=True), "Act Completion (Time Rift - Village)": LocData(2000313056, "Time Rift - Village"), @@ -401,8 +422,13 @@ act_completions = { "Act Completion (Bon Voyage!)": LocData(2000311520, "Bon Voyage!", dlc_flags=HatDLC.dlc1, hookshot=True), "Act Completion (Ship Shape)": LocData(2000311451, "Ship Shape", dlc_flags=HatDLC.dlc1), - "Act Completion (Rock the Boat)": LocData(2000311437, "Rock the Boat", dlc_flags=HatDLC.dlc1, required_hats=[HatType.ICE]), - "Act Completion (Time Rift - Balcony)": LocData(2000312226, "Time Rift - Balcony", dlc_flags=HatDLC.dlc1, hookshot=True), + + "Act Completion (Rock the Boat)": LocData(2000311437, "Rock the Boat", dlc_flags=HatDLC.dlc1, + required_hats=[HatType.ICE]), + + "Act Completion (Time Rift - Balcony)": LocData(2000312226, "Time Rift - Balcony", dlc_flags=HatDLC.dlc1, + hookshot=True), + "Act Completion (Time Rift - Deep Sea)": LocData(2000312434, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, hookshot=True, required_hats=[HatType.DWELLER, HatType.ICE]), @@ -438,7 +464,8 @@ act_completions = { hookshot=True, required_hats=[HatType.ICE, HatType.BREWING]), - "Act Completion (Time Rift - Rumbi Factory)": LocData(2000312736, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), + "Act Completion (Time Rift - Rumbi Factory)": LocData(2000312736, "Time Rift - Rumbi Factory", + dlc_flags=HatDLC.dlc2), } storybook_pages = { @@ -477,12 +504,24 @@ storybook_pages = { "Deep Sea - Page: Starfish": LocData(2000346454, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1), "Deep Sea - Page: Mini Castle": LocData(2000346452, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1), "Deep Sea - Page: Urchins": LocData(2000346449, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1), - "Deep Sea - Page: Big Castle": LocData(2000346450, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, hookshot=True), - "Deep Sea - Page: Castle Top Chest": LocData(2000304850, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, hookshot=True), - "Deep Sea - Page: Urchin Ledge": LocData(2000346451, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, hookshot=True), - "Deep Sea - Page: Hidden Castle Chest": LocData(2000304849, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, hookshot=True), - "Deep Sea - Page: Falling Platform": LocData(2000346456, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, hookshot=True), - "Deep Sea - Page: Lava Starfish": LocData(2000346453, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, hookshot=True), + + "Deep Sea - Page: Big Castle": LocData(2000346450, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, + hookshot=True), + + "Deep Sea - Page: Castle Top Chest": LocData(2000304850, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, + hookshot=True), + + "Deep Sea - Page: Urchin Ledge": LocData(2000346451, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, + hookshot=True), + + "Deep Sea - Page: Hidden Castle Chest": LocData(2000304849, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, + hookshot=True), + + "Deep Sea - Page: Falling Platform": LocData(2000346456, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, + hookshot=True), + + "Deep Sea - Page: Lava Starfish": LocData(2000346453, "Time Rift - Deep Sea", dlc_flags=HatDLC.dlc1, + hookshot=True), "Tour - Page: Mafia Town - Ledge": LocData(2000345038, "Time Rift - Tour", dlc_flags=HatDLC.dlc1), "Tour - Page: Mafia Town - Beach": LocData(2000345039, "Time Rift - Tour", dlc_flags=HatDLC.dlc1), @@ -496,9 +535,15 @@ storybook_pages = { "Rumbi Factory - Page: Manhole": LocData(2000345891, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), "Rumbi Factory - Page: Shutter Doors": LocData(2000345888, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), - "Rumbi Factory - Page: Toxic Waste Dispenser": LocData(2000345892, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), + + "Rumbi Factory - Page: Toxic Waste Dispenser": LocData(2000345892, "Time Rift - Rumbi Factory", + dlc_flags=HatDLC.dlc2), + "Rumbi Factory - Page: 3rd Area Ledge": LocData(2000345889, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), - "Rumbi Factory - Page: Green Box Assembly Line": LocData(2000345884, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), + + "Rumbi Factory - Page: Green Box Assembly Line": LocData(2000345884, "Time Rift - Rumbi Factory", + dlc_flags=HatDLC.dlc2), + "Rumbi Factory - Page: Broken Window": LocData(2000345885, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), "Rumbi Factory - Page: Money Vault": LocData(2000345890, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), "Rumbi Factory - Page: Warehouse Boxes": LocData(2000345887, "Time Rift - Rumbi Factory", dlc_flags=HatDLC.dlc2), @@ -519,9 +564,12 @@ shop_locations = { "Badge Seller - Item 10": LocData(2000301012, "Badge Seller"), "Mafia Boss Shop Item": LocData(2000301013, "Spaceship"), - "Yellow Overpass Station - Yellow Ticket Booth": LocData(2000301014, "Yellow Overpass Station", dlc_flags=HatDLC.dlc2), + "Yellow Overpass Station - Yellow Ticket Booth": LocData(2000301014, "Yellow Overpass Station", + dlc_flags=HatDLC.dlc2), + "Green Clean Station - Green Ticket Booth": LocData(2000301015, "Green Clean Station", dlc_flags=HatDLC.dlc2), "Bluefin Tunnel - Blue Ticket Booth": LocData(2000301016, "Bluefin Tunnel", dlc_flags=HatDLC.dlc2), + "Pink Paw Station - Pink Ticket Booth": LocData(2000301017, "Pink Paw Station", dlc_flags=HatDLC.dlc2, hookshot=True, required_hats=[HatType.DWELLER]), @@ -722,7 +770,9 @@ zero_jumps_expert = { misc_required=["No Bonk Badge"], dlc_flags=HatDLC.death_wish), - "Sleepy Subcon (Zero Jumps)": LocData(0, "Time Rift - Sleepy Subcon", required_hats=[HatType.ICE], dlc_flags=HatDLC.death_wish), + "Sleepy Subcon (Zero Jumps)": LocData(0, "Time Rift - Sleepy Subcon", required_hats=[HatType.ICE], + dlc_flags=HatDLC.death_wish), + "Ship Shape (Zero Jumps)": LocData(0, "Ship Shape", required_hats=[HatType.ICE], dlc_flags=HatDLC.dlc1_dw), } @@ -798,7 +848,6 @@ zero_jumps = { dlc_flags=HatDLC.dlc2_dw), } -# please just ignore all the duplicate key warnings, thanks snatcher_coins = { "Snatcher Coin - Top of HQ": LocData(0, "Down with the Mafia!", dlc_flags=HatDLC.death_wish), "Snatcher Coin - Top of HQ": LocData(0, "Cheating the Race", dlc_flags=HatDLC.death_wish), @@ -818,12 +867,20 @@ snatcher_coins = { "Snatcher Coin - Top of Red House": LocData(0, "Dead Bird Studio - Elevator Area", dlc_flags=HatDLC.death_wish), "Snatcher Coin - Top of Red House": LocData(0, "Security Breach", dlc_flags=HatDLC.death_wish), "Snatcher Coin - Train Rush": LocData(0, "Train Rush", hookshot=True, dlc_flags=HatDLC.death_wish), - "Snatcher Coin - Train Rush": LocData(0, "10 Seconds until Self-Destruct", hookshot=True, dlc_flags=HatDLC.death_wish), + + "Snatcher Coin - Train Rush": LocData(0, "10 Seconds until Self-Destruct", hookshot=True, + dlc_flags=HatDLC.death_wish), + "Snatcher Coin - Picture Perfect": LocData(0, "Picture Perfect", dlc_flags=HatDLC.death_wish), - "Snatcher Coin - Swamp Tree": LocData(0, "Subcon Forest Area", hookshot=True, paintings=1, dlc_flags=HatDLC.death_wish), + "Snatcher Coin - Swamp Tree": LocData(0, "Subcon Forest Area", hookshot=True, paintings=1, + dlc_flags=HatDLC.death_wish), + "Snatcher Coin - Swamp Tree": LocData(0, "Speedrun Well", hookshot=True, dlc_flags=HatDLC.death_wish), - "Snatcher Coin - Manor Roof": LocData(0, "Subcon Forest Area", hit_requirement=2, paintings=1, dlc_flags=HatDLC.death_wish), + + "Snatcher Coin - Manor Roof": LocData(0, "Subcon Forest Area", hit_requirement=2, paintings=1, + dlc_flags=HatDLC.death_wish), + "Snatcher Coin - Giant Time Piece": LocData(0, "Subcon Forest Area", paintings=3, dlc_flags=HatDLC.death_wish), "Snatcher Coin - Goat Village Top": LocData(0, "Alpine Skyline Area (TIHS)", dlc_flags=HatDLC.death_wish), diff --git a/worlds/ahit/Regions.py b/worlds/ahit/Regions.py index 8534a38ec1..59186d68ff 100644 --- a/worlds/ahit/Regions.py +++ b/worlds/ahit/Regions.py @@ -298,11 +298,11 @@ def create_regions(world: World): botb = create_region_and_connect(w, "Battle of the Birds", "Telescope -> Battle of the Birds", spaceship) dbs = create_region_and_connect(w, "Dead Bird Studio", "Battle of the Birds - Act 1", botb) create_region_and_connect(w, "Murder on the Owl Express", "Battle of the Birds - Act 2", botb) - create_region_and_connect(w, "Picture Perfect", "Battle of the Birds - Act 3", botb) - create_region_and_connect(w, "Train Rush", "Battle of the Birds - Act 4", botb) + pp = create_region_and_connect(w, "Picture Perfect", "Battle of the Birds - Act 3", botb) + tr = create_region_and_connect(w, "Train Rush", "Battle of the Birds - Act 4", botb) create_region_and_connect(w, "The Big Parade", "Battle of the Birds - Act 5", botb) create_region_and_connect(w, "Award Ceremony", "Battle of the Birds - Finale A", botb) - create_region_and_connect(w, "Dead Bird Studio Basement", "Battle of the Birds - Finale B", botb) + basement = create_region_and_connect(w, "Dead Bird Studio Basement", "Battle of the Birds - Finale B", botb) create_rift_connections(w, create_region(w, "Time Rift - Dead Bird Studio")) create_rift_connections(w, create_region(w, "Time Rift - The Owl Express")) create_rift_connections(w, create_region(w, "Time Rift - The Moon")) @@ -310,7 +310,6 @@ def create_regions(world: World): # Items near the Dead Bird Studio elevator can be reached from the basement act, and beyond in Expert ev_area = create_region_and_connect(w, "Dead Bird Studio - Elevator Area", "DBS -> Elevator Area", dbs) post_ev_area = create_region_and_connect(w, "Dead Bird Studio - Post Elevator Area", "DBS -> Post Elevator Area", dbs) - basement = mw.get_region("Dead Bird Studio Basement", p) connect_regions(basement, ev_area, "DBS Basement -> Elevator Area", p) if world.multiworld.LogicDifficulty[world.player].value >= int(Difficulty.EXPERT): connect_regions(basement, post_ev_area, "DBS Basement -> Post Elevator Area", p) @@ -330,7 +329,8 @@ def create_regions(world: World): alpine_area = create_region_and_connect(w, "Alpine Skyline Area", "AFR -> Alpine Skyline Area", alpine_freeroam) # Needs to be separate because there are a lot of locations in Alpine that can't be accessed from Illness - alpine_area_tihs = create_region_and_connect(w, "Alpine Skyline Area (TIHS)", "-> Alpine Skyline Area (TIHS)", alpine_area) + alpine_area_tihs = create_region_and_connect(w, "Alpine Skyline Area (TIHS)", "-> Alpine Skyline Area (TIHS)", + alpine_area) create_region_and_connect(w, "The Birdhouse", "-> The Birdhouse", alpine_area) create_region_and_connect(w, "The Lava Cake", "-> The Lava Cake", alpine_area) @@ -374,10 +374,10 @@ def create_regions(world: World): connect_regions(mt_area, badge_seller, "MT Area -> Badge Seller", p) connect_regions(mt_area_humt, badge_seller, "MT Area (HUMT) -> Badge Seller", p) connect_regions(sf_area, badge_seller, "SF Area -> Badge Seller", p) - connect_regions(mw.get_region("Dead Bird Studio", p), badge_seller, "DBS -> Badge Seller", p) - connect_regions(mw.get_region("Picture Perfect", p), badge_seller, "PP -> Badge Seller", p) - connect_regions(mw.get_region("Train Rush", p), badge_seller, "TR -> Badge Seller", p) - connect_regions(mw.get_region("Alpine Skyline Area (TIHS)", p), badge_seller, "ASA -> Badge Seller", p) + connect_regions(dbs, badge_seller, "DBS -> Badge Seller", p) + connect_regions(pp, badge_seller, "PP -> Badge Seller", p) + connect_regions(tr, badge_seller, "TR -> Badge Seller", p) + connect_regions(alpine_area_tihs, badge_seller, "ASA -> Badge Seller", p) times_end = create_region_and_connect(w, "Time's End", "Telescope -> Time's End", spaceship) create_region_and_connect(w, "The Finale", "Time's End - Act 1", times_end) @@ -403,10 +403,7 @@ def create_regions(world: World): if mw.Tasksanity[p].value > 0: create_tasksanity_locations(w) - # force recache - mw.get_region("Time Rift - Deep Sea", p) - - connect_regions(mw.get_region("Cruise Ship", p), badge_seller, "CS -> Badge Seller", p) + connect_regions(cruise_ship, badge_seller, "CS -> Badge Seller", p) if w.is_dlc2(): nyakuza_metro = create_region_and_connect(w, "Nyakuza Metro", "Telescope -> Nyakuza Metro", spaceship) @@ -425,9 +422,6 @@ def create_regions(world: World): create_rift_connections(w, create_region(w, "Time Rift - Rumbi Factory")) create_thug_shops(w) - # force recache - mw.get_region("Time Rift - Sewers", p) - def create_rift_connections(world: World, region: Region): i = 1 diff --git a/worlds/ahit/Rules.py b/worlds/ahit/Rules.py index 42bf818114..7eb09bedfc 100644 --- a/worlds/ahit/Rules.py +++ b/worlds/ahit/Rules.py @@ -62,7 +62,7 @@ def get_difficulty(world: World) -> Difficulty: return Difficulty(world.multiworld.LogicDifficulty[world.player].value) -def has_paintings(state: CollectionState, world: World, count: int, allow_skip: bool=True) -> bool: +def has_paintings(state: CollectionState, world: World, count: int, allow_skip: bool = True) -> bool: if not painting_logic(world): return True diff --git a/worlds/ahit/__init__.py b/worlds/ahit/__init__.py index 1d3ca28cfd..64b3febc3e 100644 --- a/worlds/ahit/__init__.py +++ b/worlds/ahit/__init__.py @@ -10,7 +10,6 @@ from .DeathWishRules import set_dw_rules, create_enemy_events from worlds.AutoWorld import World, WebWorld from typing import List, Dict, TextIO from worlds.LauncherComponents import Component, components, icon_paths -from multiprocessing import Process from Utils import local_path hat_craft_order: Dict[int, List[HatType]] = {} @@ -158,7 +157,7 @@ class HatInTimeWorld(World): set_rules(self) - if self.multiworld.EnableDeathWish[self.player].value > 0: + if self.is_dw(): set_dw_rules(self) def create_item(self, name: str) -> Item: