diff options
Diffstat (limited to 'player_logic.py')
| -rw-r--r-- | player_logic.py | 19 |
1 files changed, 17 insertions, 2 deletions
| diff --git a/player_logic.py b/player_logic.py index b3cefa5..966f5a1 100644 --- a/player_logic.py +++ b/player_logic.py | |||
| @@ -2,7 +2,7 @@ from enum import Enum | |||
| 2 | from typing import Dict, List, NamedTuple, Optional, Set, Tuple, TYPE_CHECKING | 2 | from typing import Dict, List, NamedTuple, Optional, Set, Tuple, TYPE_CHECKING |
| 3 | 3 | ||
| 4 | from .datatypes import Door, RoomAndDoor, RoomAndPanel | 4 | from .datatypes import Door, RoomAndDoor, RoomAndPanel |
| 5 | from .items import ALL_ITEM_TABLE | 5 | from .items import ALL_ITEM_TABLE, ItemData |
| 6 | from .locations import ALL_LOCATION_TABLE, LocationClassification | 6 | from .locations import ALL_LOCATION_TABLE, LocationClassification |
| 7 | from .options import LocationChecks, ShuffleDoors, VictoryCondition | 7 | from .options import LocationChecks, ShuffleDoors, VictoryCondition |
| 8 | from .static_logic import DOORS_BY_ROOM, PAINTINGS, PAINTING_ENTRANCES, PAINTING_EXITS, \ | 8 | from .static_logic import DOORS_BY_ROOM, PAINTINGS, PAINTING_ENTRANCES, PAINTING_EXITS, \ |
| @@ -58,6 +58,21 @@ def should_split_progression(progression_name: str, world: "LingoWorld") -> Prog | |||
| 58 | return ProgressiveItemBehavior.PROGRESSIVE | 58 | return ProgressiveItemBehavior.PROGRESSIVE |
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | def should_include_item(item: ItemData, world: "LingoWorld") -> bool: | ||
| 62 | if item.mode == "colors": | ||
| 63 | return world.options.shuffle_colors > 0 | ||
| 64 | elif item.mode == "doors": | ||
| 65 | return world.options.shuffle_doors != ShuffleDoors.option_none | ||
| 66 | elif item.mode == "complex door": | ||
| 67 | return world.options.shuffle_doors == ShuffleDoors.option_complex | ||
| 68 | elif item.mode == "door group": | ||
| 69 | return world.options.shuffle_doors == ShuffleDoors.option_simple | ||
| 70 | elif item.mode == "special": | ||
| 71 | return False | ||
| 72 | else: | ||
| 73 | return True | ||
| 74 | |||
| 75 | |||
| 61 | class LingoPlayerLogic: | 76 | class LingoPlayerLogic: |
| 62 | """ | 77 | """ |
| 63 | Defines logic after a player's options have been applied | 78 | Defines logic after a player's options have been applied |
| @@ -212,7 +227,7 @@ class LingoPlayerLogic: | |||
| 212 | 227 | ||
| 213 | # Instantiate all real items. | 228 | # Instantiate all real items. |
| 214 | for name, item in ALL_ITEM_TABLE.items(): | 229 | for name, item in ALL_ITEM_TABLE.items(): |
| 215 | if item.should_include(world): | 230 | if should_include_item(item, world): |
| 216 | self.real_items.append(name) | 231 | self.real_items.append(name) |
| 217 | 232 | ||
| 218 | # Calculate the requirements for the fake pilgrimage. | 233 | # Calculate the requirements for the fake pilgrimage. |
