From cb83f8d340ee13746ce2c63c7cd1b247244eb65a Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 21 Mar 2024 10:46:53 -0500 Subject: Lingo: Add item/location groups (#2789) --- items.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'items.py') diff --git a/items.py b/items.py index 623cd79..b9c4eb7 100644 --- a/items.py +++ b/items.py @@ -42,14 +42,16 @@ class LingoItem(Item): ALL_ITEM_TABLE: Dict[str, ItemData] = {} +ITEMS_BY_GROUP: Dict[str, List[str]] = {} def load_item_data(): - global ALL_ITEM_TABLE + global ALL_ITEM_TABLE, ITEMS_BY_GROUP for color in ["Black", "Red", "Blue", "Yellow", "Green", "Orange", "Gray", "Brown", "Purple"]: ALL_ITEM_TABLE[color] = ItemData(get_special_item_id(color), ItemClassification.progression, "colors", [], []) + ITEMS_BY_GROUP.setdefault("Colors", []).append(color) door_groups: Dict[str, List[str]] = {} for room_name, doors in DOORS_BY_ROOM.items(): @@ -57,11 +59,11 @@ def load_item_data(): if door.skip_item is True or door.event is True: continue - if door.group is None: + if door.door_group is None: door_mode = "doors" else: door_mode = "complex door" - door_groups.setdefault(door.group, []) + door_groups.setdefault(door.door_group, []) if room_name in PROGRESSION_BY_ROOM and door_name in PROGRESSION_BY_ROOM[room_name]: door_mode = "special" @@ -70,10 +72,15 @@ def load_item_data(): ItemData(get_door_item_id(room_name, door_name), ItemClassification.filler if door.junk_item else ItemClassification.progression, door_mode, door.has_doors, door.painting_ids) + ITEMS_BY_GROUP.setdefault("Doors", []).append(door.item_name) + + if door.item_group is not None: + ITEMS_BY_GROUP.setdefault(door.item_group, []).append(door.item_name) for group, group_door_ids in door_groups.items(): ALL_ITEM_TABLE[group] = ItemData(get_door_group_item_id(group), ItemClassification.progression, "door group", True, []) + ITEMS_BY_GROUP.setdefault("Doors", []).append(group) special_items: Dict[str, ItemClassification] = { ":)": ItemClassification.filler, @@ -90,6 +97,11 @@ def load_item_data(): ALL_ITEM_TABLE[item_name] = ItemData(get_special_item_id(item_name), classification, "special", False, []) + if classification == ItemClassification.filler: + ITEMS_BY_GROUP.setdefault("Junk", []).append(item_name) + elif classification == ItemClassification.trap: + ITEMS_BY_GROUP.setdefault("Traps", []).append(item_name) + for item_name in PROGRESSIVE_ITEMS: ALL_ITEM_TABLE[item_name] = ItemData(get_progressive_item_id(item_name), ItemClassification.progression, "special", False, []) -- cgit 1.4.1