From 6ab2caf37bffb68dd1c19aadf586f5bff04f2914 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sun, 10 Jan 2021 17:42:58 -0800 Subject: [PATCH] Take Any cave locations now known by MultiClient. --- MultiClient.py | 2 +- Regions.py | 5 +++++ Rom.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index 82d5992e..988b5fe0 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -1152,7 +1152,7 @@ async def track_locations(ctx : Context, roomid, roomdata): try: if roomid in location_shop_ids: - misc_data = await snes_read(ctx, SHOP_ADDR, len(location_shop_order)*3) + misc_data = await snes_read(ctx, SHOP_ADDR, (len(location_shop_order)*3)+5) for cnt, b in enumerate(misc_data): my_check = Regions.shop_table_by_location_id[Regions.SHOP_ID_START + cnt] if int(b) > 0 and my_check not in ctx.locations_checked: diff --git a/Regions.py b/Regions.py index 6f239244..be9ddc6a 100644 --- a/Regions.py +++ b/Regions.py @@ -448,6 +448,11 @@ SHOP_ID_START = 0x400000 shop_table_by_location_id = {SHOP_ID_START + cnt: s for cnt, s in enumerate( [item for sublist in [["{} Slot {}".format(name, num + 1) for num in range(3)] for name in shop_table] for item in sublist])} +shop_table_by_location_id[(SHOP_ID_START + len(shop_table)*3)] = "Old Man Sword Cave" +shop_table_by_location_id[(SHOP_ID_START + len(shop_table)*3 + 1)] = "Take-Any #1" +shop_table_by_location_id[(SHOP_ID_START + len(shop_table)*3 + 2)] = "Take-Any #2" +shop_table_by_location_id[(SHOP_ID_START + len(shop_table)*3 + 3)] = "Take-Any #3" +shop_table_by_location_id[(SHOP_ID_START + len(shop_table)*3 + 4)] = "Take-Any #4" shop_table_by_location = {y: x for x, y in shop_table_by_location_id.items()} shop_generation_types = { diff --git a/Rom.py b/Rom.py index ae42dbd1..5a7fe9e8 100644 --- a/Rom.py +++ b/Rom.py @@ -1565,7 +1565,7 @@ def write_custom_shops(rom, world, player): if shop.type == ShopType.TakeAny: sram_offset += 1 else: - sram_offset += shop.item_count + sram_offset += 3 shop_data.extend(bytes) # [id][item][price-low][price-high][max][repl_id][repl_price-low][repl_price-high][player] for item in shop.inventory: