diff options
Diffstat (limited to 'apworld')
| -rw-r--r-- | apworld/options.py | 11 | ||||
| -rw-r--r-- | apworld/player_logic.py | 24 |
2 files changed, 31 insertions, 4 deletions
| diff --git a/apworld/options.py b/apworld/options.py index 1323635..5661351 100644 --- a/apworld/options.py +++ b/apworld/options.py | |||
| @@ -124,9 +124,14 @@ class EnableGiftMaps(OptionSet): | |||
| 124 | class DaedalusOnly(Toggle): | 124 | class DaedalusOnly(Toggle): |
| 125 | """ | 125 | """ |
| 126 | If enabled, all maps besides Daedalus, The Gold, and The Tenacious will be disabled. This overrides any other | 126 | If enabled, all maps besides Daedalus, The Gold, and The Tenacious will be disabled. This overrides any other |
| 127 | map-based option, such as Enable Icarus. The player will start in Daedalus. The ending must be set to Orange or | 127 | map-based option, such as Enable Icarus. The player will start in Daedalus. The following options are restricted |
| 128 | Gold. Worldport shuffle must be enabled. Letter shuffle cannot be set to a vanilla value. Cyan Door Behavior cannot | 128 | with this setting: |
| 129 | be set to Collect H2. | 129 | |
| 130 | - The ending must be set to Orange or Gold. | ||
| 131 | - Worldport shuffle must be enabled. | ||
| 132 | - Letter shuffle must Unlocked. | ||
| 133 | - Cyan Door Behavior cannot be set to Collect H2. | ||
| 134 | - Control Center Color shuffle must be enabled. | ||
| 130 | """ | 135 | """ |
| 131 | display_name = "Daedalus Only" | 136 | display_name = "Daedalus Only" |
| 132 | 137 | ||
| diff --git a/apworld/player_logic.py b/apworld/player_logic.py index d498f0f..a8385ff 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py | |||
| @@ -1,10 +1,11 @@ | |||
| 1 | from enum import IntEnum, auto | 1 | from enum import IntEnum, auto |
| 2 | 2 | ||
| 3 | from Options import OptionError | ||
| 3 | from .generated import data_pb2 as data_pb2 | 4 | from .generated import data_pb2 as data_pb2 |
| 4 | from .items import SYMBOL_ITEMS | 5 | from .items import SYMBOL_ITEMS |
| 5 | from typing import TYPE_CHECKING, NamedTuple | 6 | from typing import TYPE_CHECKING, NamedTuple |
| 6 | 7 | ||
| 7 | from .options import ShuffleLetters, CyanDoorBehavior | 8 | from .options import ShuffleLetters, CyanDoorBehavior, VictoryCondition |
| 8 | 9 | ||
| 9 | if TYPE_CHECKING: | 10 | if TYPE_CHECKING: |
| 10 | from . import Lingo2World | 11 | from . import Lingo2World |
| @@ -261,6 +262,27 @@ class Lingo2PlayerLogic: | |||
| 261 | if should_shuffle_map(game_map)) | 262 | if should_shuffle_map(game_map)) |
| 262 | 263 | ||
| 263 | if world.options.daedalus_only: | 264 | if world.options.daedalus_only: |
| 265 | if world.options.victory_condition not in [VictoryCondition.option_orange_ending, | ||
| 266 | VictoryCondition.option_gold_ending]: | ||
| 267 | raise OptionError(f"When Daedalus Only mode is enabled, the victory condition must be Orange Ending or " | ||
| 268 | f"Gold Ending (Player {world.player}).") | ||
| 269 | |||
| 270 | if not world.options.shuffle_worldports: | ||
| 271 | raise OptionError(f"When Daedalus Only mode is enabled, worldport shuffle must also be enabled (Player " | ||
| 272 | f"{world.player}).") | ||
| 273 | |||
| 274 | if world.options.shuffle_letters != ShuffleLetters.option_unlocked: | ||
| 275 | raise OptionError(f"When Daedalus Only mode is enabled, letter shuffle must be set to Unlocked (Player " | ||
| 276 | f"{world.player}).") | ||
| 277 | |||
| 278 | if world.options.cyan_door_behavior == CyanDoorBehavior.option_collect_h2: | ||
| 279 | raise OptionError(f"When Daedalus Only mode is enabled, Cyan Door Behavior cannot be set to Collect H2 " | ||
| 280 | f"(Player {world.player}).") | ||
| 281 | |||
| 282 | if not world.options.shuffle_control_center_colors: | ||
| 283 | raise OptionError(f"When Daedalus Only mode is enabled, control center color shuffle must be enabled " | ||
| 284 | f"(Player {world.player}).") | ||
| 285 | |||
| 264 | for game_map in world.static_logic.objects.maps: | 286 | for game_map in world.static_logic.objects.maps: |
| 265 | if game_map.daedalus_only_mode == data_pb2.DaedalusOnlyMode.DAED_ONLY_PARTIAL: | 287 | if game_map.daedalus_only_mode == data_pb2.DaedalusOnlyMode.DAED_ONLY_PARTIAL: |
| 266 | self.shuffled_rooms.update(set(room.id for room in world.static_logic.objects.rooms | 288 | self.shuffled_rooms.update(set(room.id for room in world.static_logic.objects.rooms |
