diff options
Diffstat (limited to 'apworld/player_logic.py')
| -rw-r--r-- | apworld/player_logic.py | 13 |
1 files changed, 11 insertions, 2 deletions
| diff --git a/apworld/player_logic.py b/apworld/player_logic.py index a02856e..7bfd49f 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py | |||
| @@ -192,6 +192,7 @@ class AccessRequirements: | |||
| 192 | class PlayerLocation(NamedTuple): | 192 | class PlayerLocation(NamedTuple): |
| 193 | code: int | None | 193 | code: int | None |
| 194 | reqs: AccessRequirements | 194 | reqs: AccessRequirements |
| 195 | is_letter: bool = False | ||
| 195 | 196 | ||
| 196 | 197 | ||
| 197 | class LetterBehavior(IntEnum): | 198 | class LetterBehavior(IntEnum): |
| @@ -295,6 +296,12 @@ class Lingo2PlayerLogic: | |||
| 295 | self.shuffled_doors.update(set(door.id for door in world.static_logic.objects.doors | 296 | self.shuffled_doors.update(set(door.id for door in world.static_logic.objects.doors |
| 296 | if door.map_id == game_map.id and door.daedalus_only_allow)) | 297 | if door.map_id == game_map.id and door.daedalus_only_allow)) |
| 297 | 298 | ||
| 299 | if (world.options.restrict_letter_placements | ||
| 300 | and world.options.shuffle_letters == ShuffleLetters.option_progressive | ||
| 301 | and (world.options.shuffle_doors or world.options.shuffle_symbols)): | ||
| 302 | raise OptionError(f"When Restrict Letter Placements is enabled and Shuffle Letters is set to Progressive, " | ||
| 303 | f"both Shuffle Doors and Shuffle Symbols must be disabled (Player {world.player}).") | ||
| 304 | |||
| 298 | maximum_masteries = 13 + len(world.options.enable_gift_maps.value) | 305 | maximum_masteries = 13 + len(world.options.enable_gift_maps.value) |
| 299 | if world.options.enable_icarus: | 306 | if world.options.enable_icarus: |
| 300 | maximum_masteries += 1 | 307 | maximum_masteries += 1 |
| @@ -406,9 +413,11 @@ class Lingo2PlayerLogic: | |||
| 406 | if not self.should_shuffle_room(letter.room_id): | 413 | if not self.should_shuffle_room(letter.room_id): |
| 407 | continue | 414 | continue |
| 408 | 415 | ||
| 409 | self.locations_by_room.setdefault(letter.room_id, []).append(PlayerLocation(letter.ap_id, | ||
| 410 | AccessRequirements())) | ||
| 411 | behavior = self.get_letter_behavior(letter.key, letter.level2) | 416 | behavior = self.get_letter_behavior(letter.key, letter.level2) |
| 417 | |||
| 418 | self.locations_by_room.setdefault(letter.room_id, []).append( | ||
| 419 | PlayerLocation(letter.ap_id, AccessRequirements(), behavior == LetterBehavior.ITEM)) | ||
| 420 | |||
| 412 | if behavior == LetterBehavior.VANILLA: | 421 | if behavior == LetterBehavior.VANILLA: |
| 413 | if not world.for_tracker: | 422 | if not world.for_tracker: |
| 414 | letter_name = f"{letter.key.upper()}{'2' if letter.level2 else '1'}" | 423 | letter_name = f"{letter.key.upper()}{'2' if letter.level2 else '1'}" |
