Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbrq committed Jul 18, 2024
1 parent 848a908 commit 87f5c36
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 27 deletions.
17 changes: 8 additions & 9 deletions worlds/gl/GauntletLegendsClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
),
),
)
Expand All @@ -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}",
),
),
)
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions worlds/gl/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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] = [
Expand Down
5 changes: 3 additions & 2 deletions worlds/gl/Rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
7 changes: 1 addition & 6 deletions worlds/gl/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 87f5c36

Please sign in to comment.