mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Specific conditions for handling heart of stones and sleigh room key for preventing vanilla items sent
This commit is contained in:
@@ -193,6 +193,15 @@ class GrinchClient(BizHawkClient):
|
||||
async def constant_address_update(self, ctx: "BizHawkClientContext"):
|
||||
list_recv_itemids: list[int] = [netItem.item for netItem in ctx.items_received]
|
||||
items_to_check: dict[str, GrinchItemData] = {**SLEIGH_PARTS_TABLE, **MISSION_ITEMS_TABLE, **GADGETS_TABLE, **KEYS_TABLE}
|
||||
heart_count = len(list(item_id for item_id in list_recv_itemids if item_id == 42570))
|
||||
heart_item_data = ALL_ITEMS_TABLE["Heart of Stone"]
|
||||
await self.update_and_validate_address(ctx, heart_item_data.update_ram_addr[0].ram_address, min(heart_count, 4), 1)
|
||||
|
||||
has_sleigh_key = any(list(item_id for item_id in list_recv_itemids if item_id == 42479))
|
||||
if not has_sleigh_key:
|
||||
sleigh_key_item_data = ALL_ITEMS_TABLE["Sleigh Room Key"]
|
||||
# TODO Game sets value to 3 at some point. If this breaks at some point, go back into this.
|
||||
await self.update_and_validate_address(ctx, sleigh_key_item_data.update_ram_addr[0].ram_address, 0, 1)
|
||||
|
||||
for (item_name, item_data) in items_to_check.items():
|
||||
# If item is an event or already been received, ignore.
|
||||
|
Reference in New Issue
Block a user