diff options
Diffstat (limited to 'player_logic.py')
| -rw-r--r-- | player_logic.py | 32 |
1 files changed, 24 insertions, 8 deletions
| diff --git a/player_logic.py b/player_logic.py index 19583bc..b6941f3 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 Options import OptionError | 4 | from Options import OptionError |
| 5 | from .datatypes import Door, DoorType, RoomAndDoor, RoomAndPanel | 5 | from .datatypes import Door, DoorType, Painting, RoomAndDoor, RoomAndPanel |
| 6 | from .items import ALL_ITEM_TABLE, ItemType | 6 | from .items import ALL_ITEM_TABLE, ItemType |
| 7 | from .locations import ALL_LOCATION_TABLE, LocationClassification | 7 | from .locations import ALL_LOCATION_TABLE, LocationClassification |
| 8 | from .options import LocationChecks, ShuffleDoors, SunwarpAccess, VictoryCondition | 8 | from .options import LocationChecks, ShuffleDoors, SunwarpAccess, VictoryCondition |
| @@ -361,13 +361,29 @@ class LingoPlayerLogic: | |||
| 361 | if door_shuffle == ShuffleDoors.option_none: | 361 | if door_shuffle == ShuffleDoors.option_none: |
| 362 | required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS | 362 | required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS |
| 363 | req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors] | 363 | req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors] |
| 364 | req_enterable = [painting_id for painting_id, painting in PAINTINGS.items() | 364 | |
| 365 | if not painting.exit_only and not painting.disable and not painting.req_blocked and | 365 | def is_req_enterable(painting_id: str, painting: Painting) -> bool: |
| 366 | not painting.req_blocked_when_no_doors and painting.room not in required_painting_rooms] | 366 | if painting.exit_only or painting.disable or painting.req_blocked\ |
| 367 | else: | 367 | or painting.room in required_painting_rooms: |
| 368 | req_enterable = [painting_id for painting_id, painting in PAINTINGS.items() | 368 | return False |
| 369 | if not painting.exit_only and not painting.disable and not painting.req_blocked and | 369 | |
| 370 | painting.room not in required_painting_rooms] | 370 | if world.options.shuffle_doors == ShuffleDoors.option_none: |
| 371 | if painting.req_blocked_when_no_doors: | ||
| 372 | return False | ||
| 373 | |||
| 374 | # Special case for the paintings in Color Hunt and Champion's Rest. These are req blocked when not on | ||
| 375 | # doors mode, and when sunwarps are disabled or sunwarp shuffle is on and the Color Hunt sunwarp is not | ||
| 376 | # an exit. This is because these two rooms would then be inaccessible without roof access, and we can't | ||
| 377 | # hide the Owl Hallway entrance behind roof access. | ||
| 378 | if painting.room in ["Color Hunt", "Champion's Rest"]: | ||
| 379 | if world.options.sunwarp_access == SunwarpAccess.option_disabled\ | ||
| 380 | or (world.options.shuffle_sunwarps and "Color Hunt" not in self.sunwarp_exits): | ||
| 381 | return False | ||
| 382 | |||
| 383 | return True | ||
| 384 | |||
| 385 | req_enterable = [painting_id for painting_id, painting in PAINTINGS.items() | ||
| 386 | if is_req_enterable(painting_id, painting)] | ||
| 371 | req_exits += [painting_id for painting_id, painting in PAINTINGS.items() | 387 | req_exits += [painting_id for painting_id, painting in PAINTINGS.items() |
| 372 | if painting.exit_only and painting.required] | 388 | if painting.exit_only and painting.required] |
| 373 | req_entrances = world.random.sample(req_enterable, len(req_exits)) | 389 | req_entrances = world.random.sample(req_enterable, len(req_exits)) |
