From 87f5c36a346f99d6245af00b6c1e7d90b8f406f8 Mon Sep 17 00:00:00 2001 From: jamesbrq Date: Wed, 17 Jul 2024 23:05:20 -0400 Subject: [PATCH] v1.3.0 --- worlds/gl/GauntletLegendsClient.py | 17 ++++++++--------- worlds/gl/Locations.py | 20 ++++++++++---------- worlds/gl/Rom.py | 5 +++-- worlds/gl/Rules.py | 7 +------ 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/worlds/gl/GauntletLegendsClient.py b/worlds/gl/GauntletLegendsClient.py index 8531985236f0..0d5790e04a6e 100644 --- a/worlds/gl/GauntletLegendsClient.py +++ b/worlds/gl/GauntletLegendsClient.py @@ -270,7 +270,7 @@ async def obj_read(self, mode=0): await self.socket.read( message_format( READ, - f"0x{format(obj_address + (self.offset * 0x3C), 'x')} {(len(self.item_locations) + 10) * 0x3C}", + f"0x{format(obj_address + (self.offset * 0x3C), 'x')} {(len(self.item_locations) + 2) * 0x3C}", ), ), ) @@ -282,28 +282,27 @@ async def obj_read(self, mode=0): self.extra_items = count else: spawner_count = len([spawner for spawner in spawners[(self.current_level[1] << 4) + (self.current_level[0] if self.current_level[1] != 1 else castle_id.index(self.current_level[0]) + 1)] if self.difficulty >= spawner]) - for i in range((spawner_count // 101) + 1): + count = 0 + for i in range((spawner_count + 99) // 100): b = RamChunk( await self.socket.read( message_format( READ, - f"0x{format(obj_address + ((self.offset + len(self.item_locations) + self.extra_items + (i * 100)) * 0x3C), 'x')} {min(spawner_count, 100) * 0x3C}", + f"0x{format(obj_address + ((self.offset + len(self.item_locations) + self.extra_items + (i * 100)) * 0x3C), 'x')} {min((spawner_count - (100 * i)), 100) * 0x3C}", ), ), ) b.iterate(0x3C) - count = 0 for obj in b.split: if obj[0] == 0xFF and obj[1] == 0xFF: count += 1 - self.extra_items += count - spawner_count -= 100 + self.extra_items += count b = RamChunk( await self.socket.read( message_format( READ, - f"0x{format(obj_address + ((self.offset + len(self.item_locations) + self.extra_items + len([spawner for spawner in spawners[(self.current_level[1] << 4) + (self.current_level[0] if self.current_level[1] != 1 else castle_id.index(self.current_level[0]) + 1)] if self.difficulty >= spawner])) * 0x3C), 'x')} {(len(self.chest_locations) + 10) * 0x3C}", + f"0x{format(obj_address + ((self.offset + len(self.item_locations) + self.extra_items + spawner_count) * 0x3C), 'x')} {(len(self.chest_locations) + 2) * 0x3C}", ), ), ) @@ -312,9 +311,9 @@ async def obj_read(self, mode=0): _obj += [ObjectEntry(arr)] _obj = [obj for obj in _obj if obj.raw[0] != 0xFF and obj.raw[1] != 0xFF] if mode == 1: - self.chest_objects = _obj[: len(self.chest_locations)] + self.chest_objects = _obj[:len(self.chest_locations)] else: - self.item_objects = _obj[: len(self.item_locations)] + self.item_objects = _obj[:len(self.item_locations)] # Update item count of an item. # If the item is new, add it to your inventory diff --git a/worlds/gl/Locations.py b/worlds/gl/Locations.py index de9de5977b04..20e742e2b075 100644 --- a/worlds/gl/Locations.py +++ b/worlds/gl/Locations.py @@ -1285,25 +1285,25 @@ class GLLocation(Location): LocationData("Frozen Camp Chest - Fruit 1 (Dif. 2)", 88871752, 2), LocationData("Frozen Camp Barrel - Scroll 3", 88871753, 1), LocationData("Frozen Camp Barrel - Key 20", 88871754, 1), - LocationData("Frozen Camp Chest - Potion 1 (Dif. 3)", 88871755, 3), - LocationData("Frozen Camp Chest - Gold 9 (Dif. 4)", 88871756, 4), + LocationData("Frozen Camp Barrel - Potion 2 (Dif. 3)", 88871755, 3), + LocationData("Frozen Camp Barrel - Gold 2 (Dif. 4)", 88871756, 4), LocationData("Frozen Camp Barrel - Key 21 (Dif. 3)", 88871757, 3), LocationData("Frozen Camp Barrel - Reflective Shield 1", 88871758, 1), LocationData("Frozen Camp Chest - Thunder Hammer 1 (Dif. 2)", 88871759, 2), LocationData("Frozen Camp Chest - Lightning Amulet 1", 88871760, 1), LocationData("Frozen Camp Chest - Meat 3 (Dif. 2)", 88871761, 2), - LocationData("Frozen Camp Barrel - Potion 2 (Dif. 2)", 88871762, 2), + LocationData("Frozen Camp Barrel - Potion 3 (Dif. 2)", 88871762, 2), LocationData("Frozen Camp Barrel - Scroll 4", 88871763, 1), LocationData("Frozen Camp Barrel - Key 22 (Dif. 2)", 88871764, 2), LocationData("Frozen Camp Chest - Gold 10 (Dif. 4)", 88871765, 4), LocationData("Frozen Camp Barrel - Nothing 6", 88871766, 1), LocationData("Frozen Camp Barrel - Fruit 3 (Dif. 3)", 88871767, 3), LocationData("Frozen Camp Chest - Acid Amulet 1", 88871768, 1), - LocationData("Frozen Camp Barrel - Gold 2 (Dif. 3)", 88871769, 3), + LocationData("Frozen Camp Barrel - Gold 3 (Dif. 3)", 88871769, 3), LocationData("Frozen Camp Barrel - Key 23", 88871770, 1), LocationData("Frozen Camp Chest - Gold 11 (Dif. 2)", 88871771, 2), LocationData("Frozen Camp Chest - Meat 4", 88871772, 1), - LocationData("Frozen Camp Chest - Potion 2 (Dif. 3)", 88871773, 3), + LocationData("Frozen Camp Chest - Potion 1 (Dif. 3)", 88871773, 3), LocationData("Frozen Camp Chest - Gold 12", 88871774, 1), LocationData("Frozen Camp Chest - Speed Boots 1 (Dif. 3)", 88871775, 3), LocationData("Frozen Camp Chest - Invulnerability 1", 88871776, 1), @@ -1388,12 +1388,12 @@ class GLLocation(Location): LocationData("Crystal Mine Barrel - Fire Amulet 1", 88871860, 1), LocationData("Crystal Mine Barrel - Key 16", 88871861, 1), LocationData("Crystal Mine Chest - Scroll 3", 88871862, 1), - LocationData("Crystal Mine Chest - Gold 9 (Dif. 3)", 88871863, 3), - LocationData("Crystal Mine Chest - Death 1 (Dif. 2)", 88871864, 2), + LocationData("Crystal Mine Barrel - Gold 6 (Dif. 3)", 88871863, 3), + LocationData("Crystal Mine Barrel - Death 2 (Dif. 2)", 88871864, 2), LocationData("Crystal Mine Barrel - Key 17", 88871865, 1), - LocationData("Crystal Mine Chest - Potion 2", 88871866, 1), - LocationData("Crystal Mine Chest - Fruit 4 (Dif. 4)", 88871867, 4), - LocationData("Crystal Mine Chest - Gold 10 (Dif. 2)", 88871868, 2), + LocationData("Crystal Mine Barrel - Potion 5", 88871866, 1), + LocationData("Crystal Mine Barrel - Fruit 3 (Dif. 4)", 88871867, 4), + LocationData("Crystal Mine Barrel - Gold 7 (Dif. 2)", 88871868, 2), ] erupting_fissure: typing.List[LocationData] = [ diff --git a/worlds/gl/Rom.py b/worlds/gl/Rom.py index 7ac7b18e5c24..9f201a8a85ca 100644 --- a/worlds/gl/Rom.py +++ b/worlds/gl/Rom.py @@ -87,6 +87,9 @@ def patch_counts(caller: APProcedurePatch, rom: bytes) -> bytes: data.write(bytes([0xFF])) data.seek(0x212, 0) data.write(bytes([0xFF, 0xFF])) + for i in range(25): + data.seek(0x1A, 1) + data.write(bytes([0xFF, 0xFF])) data.seek(0x53E, 0) data.write(bytes([0xFF, 0xFF])) data.seek(0x55A, 0) @@ -97,8 +100,6 @@ def patch_counts(caller: APProcedurePatch, rom: bytes) -> bytes: data.write(bytes([0xFF, 0xFF])) data.seek(0x522, 0) data.write(bytes([0xFF, 0xFF])) - data.seek(0x96C, 0) - data.write(bytes([0x4, 0x3])) stream.seek(0x67E7E0, 0) stream.write(zenc(data.getvalue())) return stream.getvalue() diff --git a/worlds/gl/Rules.py b/worlds/gl/Rules.py index 8172454567d3..988b9235b073 100644 --- a/worlds/gl/Rules.py +++ b/worlds/gl/Rules.py @@ -23,11 +23,6 @@ def set_rules(world: "GauntletLegendsWorld"): obelisks = [item.item_name for item in item_list if "Obelisk" in item.item_name] mirror_shards = [item.item_name for item in item_list if "Mirror" in item.item_name] - for location in [location for location in all_locations if ("Barrel" in location.name and "Barrel of Gold" not in location.name)]: - for item in mirror_shards: - if location.name not in world.disabled_locations: - forbid_item(world.get_location(location.name), item, world.player) - for location in [ location for location in all_locations @@ -45,7 +40,7 @@ def set_rules(world: "GauntletLegendsWorld"): for location in [ location for location in all_locations if "Barrel" in location.name and "Barrel of Gold" not in location.name ]: - for item in runestones: + for item in runestones + mirror_shards: if location.name not in world.disabled_locations: forbid_item(world.get_location(location.name), item, world.player)