diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-22 15:28:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-22 21:28:41 +0100 |
| commit | 9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526 (patch) | |
| tree | 2476ec2b334184139bb536337d1d9bd7a7b3591c /items.py | |
| parent | f17c4acbe9364178787888a91a6e40f8216363e8 (diff) | |
| download | lingo-apworld-9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526.tar.gz lingo-apworld-9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526.tar.bz2 lingo-apworld-9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526.zip | |
Lingo: Add trap weights option (#2837)
Diffstat (limited to 'items.py')
| -rw-r--r-- | items.py | 24 |
1 files changed, 3 insertions, 21 deletions
| diff --git a/items.py b/items.py index b9c4eb7..7c7928c 100644 --- a/items.py +++ b/items.py | |||
| @@ -1,13 +1,9 @@ | |||
| 1 | from typing import Dict, List, NamedTuple, Optional, TYPE_CHECKING | 1 | from typing import Dict, List, NamedTuple, Optional, TYPE_CHECKING |
| 2 | 2 | ||
| 3 | from BaseClasses import Item, ItemClassification | 3 | from BaseClasses import Item, ItemClassification |
| 4 | from .options import ShuffleDoors | ||
| 5 | from .static_logic import DOORS_BY_ROOM, PROGRESSION_BY_ROOM, PROGRESSIVE_ITEMS, get_door_group_item_id, \ | 4 | from .static_logic import DOORS_BY_ROOM, PROGRESSION_BY_ROOM, PROGRESSIVE_ITEMS, get_door_group_item_id, \ |
| 6 | get_door_item_id, get_progressive_item_id, get_special_item_id | 5 | get_door_item_id, get_progressive_item_id, get_special_item_id |
| 7 | 6 | ||
| 8 | if TYPE_CHECKING: | ||
| 9 | from . import LingoWorld | ||
| 10 | |||
| 11 | 7 | ||
| 12 | class ItemData(NamedTuple): | 8 | class ItemData(NamedTuple): |
| 13 | """ | 9 | """ |
| @@ -19,20 +15,6 @@ class ItemData(NamedTuple): | |||
| 19 | has_doors: bool | 15 | has_doors: bool |
| 20 | painting_ids: List[str] | 16 | painting_ids: List[str] |
| 21 | 17 | ||
| 22 | def should_include(self, world: "LingoWorld") -> bool: | ||
| 23 | if self.mode == "colors": | ||
| 24 | return world.options.shuffle_colors > 0 | ||
| 25 | elif self.mode == "doors": | ||
| 26 | return world.options.shuffle_doors != ShuffleDoors.option_none | ||
| 27 | elif self.mode == "complex door": | ||
| 28 | return world.options.shuffle_doors == ShuffleDoors.option_complex | ||
| 29 | elif self.mode == "door group": | ||
| 30 | return world.options.shuffle_doors == ShuffleDoors.option_simple | ||
| 31 | elif self.mode == "special": | ||
| 32 | return False | ||
| 33 | else: | ||
| 34 | return True | ||
| 35 | |||
| 36 | 18 | ||
| 37 | class LingoItem(Item): | 19 | class LingoItem(Item): |
| 38 | """ | 20 | """ |
| @@ -44,6 +26,8 @@ class LingoItem(Item): | |||
| 44 | ALL_ITEM_TABLE: Dict[str, ItemData] = {} | 26 | ALL_ITEM_TABLE: Dict[str, ItemData] = {} |
| 45 | ITEMS_BY_GROUP: Dict[str, List[str]] = {} | 27 | ITEMS_BY_GROUP: Dict[str, List[str]] = {} |
| 46 | 28 | ||
| 29 | TRAP_ITEMS: List[str] = ["Slowness Trap", "Iceland Trap", "Atbash Trap"] | ||
| 30 | |||
| 47 | 31 | ||
| 48 | def load_item_data(): | 32 | def load_item_data(): |
| 49 | global ALL_ITEM_TABLE, ITEMS_BY_GROUP | 33 | global ALL_ITEM_TABLE, ITEMS_BY_GROUP |
| @@ -87,9 +71,7 @@ def load_item_data(): | |||
| 87 | "The Feeling of Being Lost": ItemClassification.filler, | 71 | "The Feeling of Being Lost": ItemClassification.filler, |
| 88 | "Wanderlust": ItemClassification.filler, | 72 | "Wanderlust": ItemClassification.filler, |
| 89 | "Empty White Hallways": ItemClassification.filler, | 73 | "Empty White Hallways": ItemClassification.filler, |
| 90 | "Slowness Trap": ItemClassification.trap, | 74 | **{trap_name: ItemClassification.trap for trap_name in TRAP_ITEMS}, |
| 91 | "Iceland Trap": ItemClassification.trap, | ||
| 92 | "Atbash Trap": ItemClassification.trap, | ||
| 93 | "Puzzle Skip": ItemClassification.useful, | 75 | "Puzzle Skip": ItemClassification.useful, |
| 94 | } | 76 | } |
| 95 | 77 | ||
