diff --git a/worlds/kh1/Client.py b/worlds/kh1/Client.py index 47c8d89db87b..2d7f088ac08a 100644 --- a/worlds/kh1/Client.py +++ b/worlds/kh1/Client.py @@ -117,7 +117,7 @@ def on_package(self, cmd: str, args: dict): item_id = str(f.readline()).replace("\n", "") location_id = str(f.readline()).replace("\n", "") player = str(f.readline()).replace("\n", "") - if str(item_id) == str(NetworkItem(*item).item) and str(location_id) == str(NetworkItem(*item).location) and str(player) == str(NetworkItem(*item).player): + if str(item_id) == str(NetworkItem(*item).item) and str(location_id) == str(NetworkItem(*item).location) and str(player) == str(NetworkItem(*item).player) and int(location_id) > 0: found = True if not found: filename = f"AP_{str(check_num+1)}.item" @@ -132,24 +132,25 @@ def on_package(self, cmd: str, args: dict): with open(os.path.join(self.game_communication_path, filename), 'w') as f: f.close() - if cmd in {"PrintJSON"} and args["type"] == "ItemSend": - item = args["item"] - networkItem = NetworkItem(*item) - recieverID = args["receiving"] - senderID = networkItem.player - locationID = networkItem.location - if recieverID != self.slot and senderID == self.slot: - itemName = self.item_names[networkItem.item] - itemCategory = networkItem.flags - recieverName = self.player_names[recieverID] - filename = "sent" - with open(os.path.join(self.game_communication_path, filename), 'w') as f: - f.write( - re.sub('[^A-Za-z0-9 ]+', '',str(itemName))[:15] + "\n" - + re.sub('[^A-Za-z0-9 ]+', '',str(recieverName))[:6] + "\n" - + str(itemCategory) + "\n" - + str(locationID)) - f.close() + if cmd in {"PrintJSON"} and "type" in args: + if args["type"] == "ItemSend": + item = args["item"] + networkItem = NetworkItem(*item) + recieverID = args["receiving"] + senderID = networkItem.player + locationID = networkItem.location + if recieverID != self.slot and senderID == self.slot: + itemName = self.item_names[networkItem.item] + itemCategory = networkItem.flags + recieverName = self.player_names[recieverID] + filename = "sent" + with open(os.path.join(self.game_communication_path, filename), 'w') as f: + f.write( + re.sub('[^A-Za-z0-9 ]+', '',str(itemName))[:15] + "\n" + + re.sub('[^A-Za-z0-9 ]+', '',str(recieverName))[:6] + "\n" + + str(itemCategory) + "\n" + + str(locationID)) + f.close() def on_deathlink(self, data: typing.Dict[str, typing.Any]): with open(os.path.join(self.game_communication_path, 'dlreceive'), 'w') as f: diff --git a/worlds/kh1/Locations.py b/worlds/kh1/Locations.py index 92bc46924136..6e84367cd9ee 100644 --- a/worlds/kh1/Locations.py +++ b/worlds/kh1/Locations.py @@ -47,8 +47,9 @@ def get_locations_by_category(category: str) -> Dict[str, KH1LocationData]: "Traverse Town Item Workshop Left Chest": KH1LocationData("Chests", 265_0893), "Traverse Town Secret Waterway Near Stairs Chest": KH1LocationData("Chests", 265_0894), "Wonderland Rabbit Hole Green Trinity Chest": KH1LocationData("Chests", 265_0931), - #"Wonderland Rabbit Hole Defeat Heartless After Trial Chest": KH1LocationData("Chests", 265_0933), missable - #"Wonderland Rabbit Hole Defeat Heartless After Hollow Bastion Chest": KH1LocationData("Chests", 265_0934), Go mode, just remove + "Wonderland Rabbit Hole Defeat Heartless 1 Chest": KH1LocationData("Chests", 265_0932), + "Wonderland Rabbit Hole Defeat Heartless 2 Chest": KH1LocationData("Chests", 265_0933), + "Wonderland Rabbit Hole Defeat Heartless 3 Chest": KH1LocationData("Chests", 265_0934), "Wonderland Bizarre Room Green Trinity Chest": KH1LocationData("Chests", 265_0971), "Wonderland Queen's Castle Hedge Left Red Chest": KH1LocationData("Chests", 265_1011), "Wonderland Queen's Castle Hedge Right Blue Chest": KH1LocationData("Chests", 265_1012), @@ -221,6 +222,7 @@ def get_locations_by_category(category: str) -> Dict[str, KH1LocationData]: "Hollow Bastion Grand Hall Oblivion Chest": KH1LocationData("Chests", 265_4491), "Hollow Bastion Grand Hall Left of Gate Chest": KH1LocationData("Chests", 265_4492), #"Hollow Bastion Entrance Hall Push the Statue Chest": KH1LocationData("Chests", 265_4493), + "Hollow Bastion Entrance Hall Left of Emblem Door Chest": KH1LocationData("Chests", 265_4212), "Hollow Bastion Rising Falls White Trinity Chest": KH1LocationData("Chests", 265_4494), #"End of the World Final Dimension 1st Chest": KH1LocationData("Chests", 265_4531), #"End of the World Final Dimension 2nd Chest": KH1LocationData("Chests", 265_4532), diff --git a/worlds/kh1/Regions.py b/worlds/kh1/Regions.py index 603975152b91..d49d8b92f927 100644 --- a/worlds/kh1/Regions.py +++ b/worlds/kh1/Regions.py @@ -56,8 +56,9 @@ def create_regions(multiworld: MultiWorld, player: int, goal: str, atlantica: bo regions["Traverse Town"].locations.append("Traverse Town Item Workshop Left Chest"), regions["Traverse Town"].locations.append("Traverse Town Secret Waterway Near Stairs Chest"), regions["Wonderland"].locations.append("Wonderland Rabbit Hole Green Trinity Chest"), - #regions["Wonderland"].locations.append("Wonderland Rabbit Hole Defeat Heartless After Trial Chest"), - #regions["Wonderland"].locations.append("Wonderland Rabbit Hole Defeat Heartless After Hollow Bastion Chest"), + regions["Wonderland"].locations.append("Wonderland Rabbit Hole Defeat Heartless 1 Chest"), + regions["Wonderland"].locations.append("Wonderland Rabbit Hole Defeat Heartless 2 Chest"), + regions["Wonderland"].locations.append("Wonderland Rabbit Hole Defeat Heartless 3 Chest"), regions["Wonderland"].locations.append("Wonderland Bizarre Room Green Trinity Chest"), regions["Wonderland"].locations.append("Wonderland Queen's Castle Hedge Left Red Chest"), regions["Wonderland"].locations.append("Wonderland Queen's Castle Hedge Right Blue Chest"), @@ -231,6 +232,7 @@ def create_regions(multiworld: MultiWorld, player: int, goal: str, atlantica: bo regions["Hollow Bastion"].locations.append("Hollow Bastion Grand Hall Oblivion Chest"), regions["Hollow Bastion"].locations.append("Hollow Bastion Grand Hall Left of Gate Chest"), #regions["Hollow Bastion"].locations.append("Hollow Bastion Entrance Hall Push the Statue Chest"), + regions["Hollow Bastion"].locations.append("Hollow Bastion Entrance Hall Left of Emblem Door Chest"), regions["Hollow Bastion"].locations.append("Hollow Bastion Rising Falls White Trinity Chest"), #regions["End of the World"].locations.append("End of the World Final Dimension 1st Chest"), #regions["End of the World"].locations.append("End of the World Final Dimension 2nd Chest"), diff --git a/worlds/kh1/Rules.py b/worlds/kh1/Rules.py index e9ac0bf7fc55..05b5b2d23ba2 100644 --- a/worlds/kh1/Rules.py +++ b/worlds/kh1/Rules.py @@ -73,8 +73,9 @@ def set_rules(multiworld: MultiWorld, player: int, goal: str, atlantica: bool): multiworld.get_location("Traverse Town Item Workshop Left Chest" , player).access_rule = lambda state: has_item(state, player, "Green Trinity") #multiworld.get_location("Traverse Town Secret Waterway Near Stairs Chest" , player).access_rule = lambda state: has_item(state, player, "Red Trinity") multiworld.get_location("Wonderland Rabbit Hole Green Trinity Chest" , player).access_rule = lambda state: has_item(state, player, "Green Trinity") - #multiworld.get_location("Wonderland Rabbit Hole Defeat Heartless After Trial Chest" , player).access_rule = lambda state: has_item(state, player, "") - #multiworld.get_location("Wonderland Rabbit Hole Defeat Heartless After Hollow Bastion Chest" , player).access_rule = lambda state: has_item(state, player, "Hollow Bastion") and has_x_worlds(state, player, 7) + #multiworld.get_location("Wonderland Rabbit Hole Defeat Heartless 1 Chest" , player).access_rule = lambda state: has_item(state, player, "") + #multiworld.get_location("Wonderland Rabbit Hole Defeat Heartless 2 Chest" , player).access_rule = lambda state: has_item(state, player, "") + #multiworld.get_location("Wonderland Rabbit Hole Defeat Heartless 3 Chest" , player).access_rule = lambda state: has_item(state, player, "") multiworld.get_location("Wonderland Bizarre Room Green Trinity Chest" , player).access_rule = lambda state: has_item(state, player, "Green Trinity") multiworld.get_location("Wonderland Queen's Castle Hedge Left Red Chest" , player).access_rule = lambda state: has_evidence(state, player) or has_item(state, player, "High Jump") or can_glide(state, player) multiworld.get_location("Wonderland Queen's Castle Hedge Right Blue Chest" , player).access_rule = lambda state: has_evidence(state, player) or has_item(state, player, "High Jump") or can_glide(state, player) @@ -248,6 +249,7 @@ def set_rules(multiworld: MultiWorld, player: int, goal: str, atlantica: bool): multiworld.get_location("Hollow Bastion Grand Hall Oblivion Chest" , player).access_rule = lambda state: has_emblems(state, player) multiworld.get_location("Hollow Bastion Grand Hall Left of Gate Chest" , player).access_rule = lambda state: has_emblems(state, player) #multiworld.get_location("Hollow Bastion Entrance Hall Push the Statue Chest" , player).access_rule = lambda state: has_item(state, player, "") + multiworld.get_location("Hollow Bastion Entrance Hall Left of Emblem Door Chest" , player).access_rule = lambda state: has_item(state, player, "High Jump") multiworld.get_location("Hollow Bastion Rising Falls White Trinity Chest" , player).access_rule = lambda state: has_item(state, player, "White Trinity") #multiworld.get_location("End of the World Final Dimension 1st Chest" , player).access_rule = lambda state: has_item(state, player, "") #multiworld.get_location("End of the World Final Dimension 2nd Chest" , player).access_rule = lambda state: has_item(state, player, "")