diff options
Diffstat (limited to 'rules.py')
| -rw-r--r-- | rules.py | 10 |
1 files changed, 8 insertions, 2 deletions
| diff --git a/rules.py b/rules.py index ed84c56..e0bb08f 100644 --- a/rules.py +++ b/rules.py | |||
| @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING | |||
| 3 | from BaseClasses import CollectionState | 3 | from BaseClasses import CollectionState |
| 4 | from .datatypes import RoomAndDoor | 4 | from .datatypes import RoomAndDoor |
| 5 | from .player_logic import AccessRequirements, PlayerLocation | 5 | from .player_logic import AccessRequirements, PlayerLocation |
| 6 | from .static_logic import PROGRESSION_BY_ROOM, PROGRESSIVE_ITEMS | 6 | from .static_logic import PROGRESSIVE_DOORS_BY_ROOM, PROGRESSIVE_ITEMS |
| 7 | 7 | ||
| 8 | if TYPE_CHECKING: | 8 | if TYPE_CHECKING: |
| 9 | from . import LingoWorld | 9 | from . import LingoWorld |
| @@ -59,6 +59,12 @@ def _lingo_can_satisfy_requirements(state: CollectionState, access: AccessRequir | |||
| 59 | if not state.has(color.capitalize(), world.player): | 59 | if not state.has(color.capitalize(), world.player): |
| 60 | return False | 60 | return False |
| 61 | 61 | ||
| 62 | if not all(state.has(item, world.player) for item in access.items): | ||
| 63 | return False | ||
| 64 | |||
| 65 | if not all(state.has(item, world.player, index) for item, index in access.progression.items()): | ||
| 66 | return False | ||
| 67 | |||
| 62 | if access.the_master and not lingo_can_use_mastery_location(state, world): | 68 | if access.the_master and not lingo_can_use_mastery_location(state, world): |
| 63 | return False | 69 | return False |
| 64 | 70 | ||
| @@ -77,7 +83,7 @@ def _lingo_can_open_door(state: CollectionState, room: str, door: str, world: "L | |||
| 77 | 83 | ||
| 78 | item_name = world.player_logic.item_by_door[room][door] | 84 | item_name = world.player_logic.item_by_door[room][door] |
| 79 | if item_name in PROGRESSIVE_ITEMS: | 85 | if item_name in PROGRESSIVE_ITEMS: |
| 80 | progression = PROGRESSION_BY_ROOM[room][door] | 86 | progression = PROGRESSIVE_DOORS_BY_ROOM[room][door] |
| 81 | return state.has(item_name, world.player, progression.index) | 87 | return state.has(item_name, world.player, progression.index) |
| 82 | 88 | ||
| 83 | return state.has(item_name, world.player) | 89 | return state.has(item_name, world.player) |
