From afdcde88ae6335eff437c13862299a20c5b81eef Mon Sep 17 00:00:00 2001 From: CookieCat Date: Mon, 23 Oct 2023 14:33:46 -0400 Subject: [PATCH] 1.3.3 --- AHITClient.py | 11 +++-- worlds/ahit/Regions.py | 94 ++++++++++++++++++++--------------------- worlds/ahit/Rules.py | 3 ++ worlds/ahit/__init__.py | 8 +--- 4 files changed, 56 insertions(+), 60 deletions(-) diff --git a/AHITClient.py b/AHITClient.py index 64d1e998bd..884f3ee5c7 100644 --- a/AHITClient.py +++ b/AHITClient.py @@ -3,11 +3,10 @@ import Utils import websockets import functools from copy import deepcopy -from typing import List, Any, Iterable, Dict +from typing import List, Any, Iterable from NetUtils import decode, encode, JSONtoTextParser, JSONMessagePart, NetworkItem from MultiServer import Endpoint -from CommonClient import CommonContext, gui_enabled, ClientCommandProcessor, logger, \ - get_base_parser +from CommonClient import CommonContext, gui_enabled, ClientCommandProcessor, logger, get_base_parser DEBUG = False @@ -148,6 +147,9 @@ async def proxy(websocket, path: str = "/", ctx: AHITContext = None): if ctx.is_proxy_connected(): async for data in websocket: + if DEBUG: + logger.info(f"Incoming message: {data}") + for msg in decode(data): if msg["cmd"] == "Connect": # Proxy is connecting, make sure it is valid @@ -175,9 +177,6 @@ async def proxy(websocket, path: str = "/", ctx: AHITContext = None): if not ctx.is_proxy_connected(): break - if DEBUG: - logger.info(f"Incoming message: {msg}") - await ctx.send_msgs([msg]) except Exception as e: diff --git a/worlds/ahit/Regions.py b/worlds/ahit/Regions.py index b1d2293961..0322f08e72 100644 --- a/worlds/ahit/Regions.py +++ b/worlds/ahit/Regions.py @@ -157,61 +157,61 @@ rift_access_regions = { "Time Rift - Rumbi Factory": ["Nyakuza Free Roam"], } -# Hat_ChapterActInfo, from the game files to be used in act shuffle +# Time piece identifiers to be used in act shuffle chapter_act_info = { - "Time Rift - Gallery": "hatintime_chapterinfo.spaceship.Spaceship_WaterRift_Gallery", - "Time Rift - The Lab": "hatintime_chapterinfo.spaceship.Spaceship_WaterRift_MailRoom", + "Time Rift - Gallery": "Spaceship_WaterRift_Gallery", + "Time Rift - The Lab": "Spaceship_WaterRift_MailRoom", - "Welcome to Mafia Town": "hatintime_chapterinfo.MafiaTown.MafiaTown_Welcome", - "Barrel Battle": "hatintime_chapterinfo.MafiaTown.MafiaTown_BarrelBattle", - "She Came from Outer Space": "hatintime_chapterinfo.MafiaTown.MafiaTown_AlienChase", - "Down with the Mafia!": "hatintime_chapterinfo.MafiaTown.MafiaTown_MafiaBoss", - "Cheating the Race": "hatintime_chapterinfo.MafiaTown.MafiaTown_Race", - "Heating Up Mafia Town": "hatintime_chapterinfo.MafiaTown.MafiaTown_Lava", - "The Golden Vault": "hatintime_chapterinfo.MafiaTown.MafiaTown_GoldenVault", - "Time Rift - Mafia of Cooks": "hatintime_chapterinfo.MafiaTown.MafiaTown_CaveRift_Mafia", - "Time Rift - Sewers": "hatintime_chapterinfo.MafiaTown.MafiaTown_WaterRift_Easy", - "Time Rift - Bazaar": "hatintime_chapterinfo.MafiaTown.MafiaTown_WaterRift_Hard", + "Welcome to Mafia Town": "chapter1_tutorial", + "Barrel Battle": "chapter1_barrelboss", + "She Came from Outer Space": "chapter1_cannon_repair", + "Down with the Mafia!": "chapter1_boss", + "Cheating the Race": "harbor_impossible_race", + "Heating Up Mafia Town": "mafiatown_lava", + "The Golden Vault": "mafiatown_goldenvault", + "Time Rift - Mafia of Cooks": "TimeRift_Cave_Mafia", + "Time Rift - Sewers": "TimeRift_Water_Mafia_Easy", + "Time Rift - Bazaar": "TimeRift_Water_Mafia_Hard", - "Dead Bird Studio": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_DeadBirdStudio", - "Murder on the Owl Express": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_Murder", - "Picture Perfect": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_PicturePerfect", - "Train Rush": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_TrainRush", - "The Big Parade": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_Parade", - "Award Ceremony": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_AwardCeremony", - "Dead Bird Studio Basement": "DeadBirdBasement", # Dead Bird Studio Basement has no ChapterActInfo - "Time Rift - Dead Bird Studio": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_CaveRift_Basement", - "Time Rift - The Owl Express": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_WaterRift_Panels", - "Time Rift - The Moon": "hatintime_chapterinfo.BattleOfTheBirds.BattleOfTheBirds_WaterRift_Parade", + "Dead Bird Studio": "DeadBirdStudio", + "Murder on the Owl Express": "chapter3_murder", + "Picture Perfect": "moon_camerasnap", + "Train Rush": "trainwreck_selfdestruct", + "The Big Parade": "moon_parade", + "Award Ceremony": "award_ceremony", + "Dead Bird Studio Basement": "chapter3_secret_finale", + "Time Rift - Dead Bird Studio": "TimeRift_Cave_BirdBasement", + "Time Rift - The Owl Express": "TimeRift_Water_TWreck_Panels", + "Time Rift - The Moon": "TimeRift_Water_TWreck_Parade", - "Contractual Obligations": "hatintime_chapterinfo.subconforest.SubconForest_IceWall", - "The Subcon Well": "hatintime_chapterinfo.subconforest.SubconForest_Cave", - "Toilet of Doom": "hatintime_chapterinfo.subconforest.SubconForest_Toilet", - "Queen Vanessa's Manor": "hatintime_chapterinfo.subconforest.SubconForest_Manor", - "Mail Delivery Service": "hatintime_chapterinfo.subconforest.SubconForest_MailDelivery", - "Your Contract has Expired": "hatintime_chapterinfo.subconforest.SubconForest_SnatcherBoss", - "Time Rift - Sleepy Subcon": "hatintime_chapterinfo.subconforest.SubconForest_CaveRift_Raccoon", - "Time Rift - Pipe": "hatintime_chapterinfo.subconforest.SubconForest_WaterRift_Hookshot", - "Time Rift - Village": "hatintime_chapterinfo.subconforest.SubconForest_WaterRift_Dwellers", + "Contractual Obligations": "subcon_village_icewall", + "The Subcon Well": "subcon_cave", + "Toilet of Doom": "chapter2_toiletboss", + "Queen Vanessa's Manor": "vanessa_manor_attic", + "Mail Delivery Service": "subcon_maildelivery", + "Your Contract has Expired": "snatcher_boss", + "Time Rift - Sleepy Subcon": "TimeRift_Cave_Raccoon", + "Time Rift - Pipe": "TimeRift_Water_Subcon_Hookshot", + "Time Rift - Village": "TimeRift_Water_Subcon_Dwellers", - "Alpine Free Roam": "hatintime_chapterinfo.AlpineSkyline.AlpineSkyline_IntroMountain", - "The Illness has Spread": "hatintime_chapterinfo.AlpineSkyline.AlpineSkyline_Finale", - "Time Rift - Alpine Skyline": "hatintime_chapterinfo.AlpineSkyline.AlpineSkyline_CaveRift_Alpine", - "Time Rift - The Twilight Bell": "hatintime_chapterinfo.AlpineSkyline.AlpineSkyline_WaterRift_Goats", - "Time Rift - Curly Tail Trail": "hatintime_chapterinfo.AlpineSkyline.AlpineSkyline_WaterRift_Cats", + "Alpine Free Roam": "AlpineFreeRoam", # not an actual Time Piece + "The Illness has Spread": "AlpineSkyline_Finale", + "Time Rift - Alpine Skyline": "TimeRift_Cave_Alps", + "Time Rift - The Twilight Bell": "TimeRift_Water_Alp_Goats", + "Time Rift - Curly Tail Trail": "TimeRift_Water_AlpineSkyline_Cats", - "The Finale": "hatintime_chapterinfo.TheFinale.TheFinale_FinalBoss", - "Time Rift - Tour": "hatintime_chapterinfo_dlc1.spaceship.CaveRift_Tour", + "The Finale": "TheFinale_FinalBoss", + "Time Rift - Tour": "TimeRift_Cave_Tour", - "Bon Voyage!": "hatintime_chapterinfo_dlc1.Cruise.Cruise_Boarding", - "Ship Shape": "hatintime_chapterinfo_dlc1.Cruise.Cruise_Working", - "Rock the Boat": "hatintime_chapterinfo_dlc1.Cruise.Cruise_Sinking", - "Time Rift - Balcony": "hatintime_chapterinfo_dlc1.Cruise.Cruise_WaterRift_Slide", - "Time Rift - Deep Sea": "hatintime_chapterinfo_dlc1.Cruise.Cruise_CaveRift", + "Bon Voyage!": "Cruise_Boarding", + "Ship Shape": "Cruise_Working", + "Rock the Boat": "Cruise_Sinking", + "Time Rift - Balcony": "Cruise_WaterRift_Slide", + "Time Rift - Deep Sea": "Cruise_CaveRift_Aquarium", - "Nyakuza Free Roam": "hatintime_chapterinfo_dlc2.metro.Metro_FreeRoam", - "Rush Hour": "hatintime_chapterinfo_dlc2.metro.Metro_Escape", - "Time Rift - Rumbi Factory": "hatintime_chapterinfo_dlc2.metro.Metro_RumbiFactory" + "Nyakuza Free Roam": "MetroFreeRoam", # not an actual Time Piece + "Rush Hour": "Metro_Escape", + "Time Rift - Rumbi Factory": "Metro_CaveRift_RumbiFactory" } # Guarantee that the first level a player can access is a location dense area beatable with no items diff --git a/worlds/ahit/Rules.py b/worlds/ahit/Rules.py index 3e7700ccf0..ae7aa21243 100644 --- a/worlds/ahit/Rules.py +++ b/worlds/ahit/Rules.py @@ -466,6 +466,9 @@ def set_moderate_rules(world: World): and can_use_hat(state, world, HatType.ICE) and can_use_hat(state, world, HatType.BREWING)) + # Moderate: Bluefin Tunnel without tickets + set_rule(world.multiworld.get_entrance("-> Bluefin Tunnel", world.player), lambda state: True) + def set_hard_rules(world: World): # Hard: clear Time Rift - The Twilight Bell with Sprint+Scooter only diff --git a/worlds/ahit/__init__.py b/worlds/ahit/__init__.py index 88904d8939..1d3ca28cfd 100644 --- a/worlds/ahit/__init__.py +++ b/worlds/ahit/__init__.py @@ -26,12 +26,6 @@ components.append(Component("A Hat in Time Client", "AHITClient", icon='yatta')) icon_paths['yatta'] = local_path('data', 'yatta.png') -def run_client(): - from AHITClient import main - p = Process(target=main) - p.start() - - class AWebInTime(WebWorld): theme = "partyTime" tutorials = [Tutorial( @@ -106,7 +100,7 @@ class HatInTimeWorld(World): or "Camera Tourist" not in self.get_excluded_dws(): create_enemy_events(self) - # place default contract locations if contract shuffle is off so logic can still utilize them + # place vanilla contract locations if contract shuffle is off if self.multiworld.ShuffleActContracts[self.player].value == 0: for name in contract_locations.keys(): self.multiworld.get_location(name, self.player).place_locked_item(create_item(self, name))