diff options
Diffstat (limited to 'apworld/options.py')
| -rw-r--r-- | apworld/options.py | 273 |
1 files changed, 270 insertions, 3 deletions
| diff --git a/apworld/options.py b/apworld/options.py index d984beb..c1eab33 100644 --- a/apworld/options.py +++ b/apworld/options.py | |||
| @@ -1,15 +1,226 @@ | |||
| 1 | from dataclasses import dataclass | 1 | from dataclasses import dataclass |
| 2 | 2 | ||
| 3 | from Options import PerGameCommonOptions, Toggle, Choice | 3 | from Options import PerGameCommonOptions, Toggle, Choice, DefaultOnToggle, Range, OptionSet, FreeText |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | class ShuffleDoors(Toggle): | 6 | class ShuffleDoors(DefaultOnToggle): |
| 7 | """If enabled, most doors will open from receiving an item rather than fulfilling the in-game requirements.""" | 7 | """If enabled, most doors will open from receiving an item rather than fulfilling the in-game requirements.""" |
| 8 | display_name = "Shuffle Doors" | 8 | display_name = "Shuffle Doors" |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | class ShuffleControlCenterColors(Toggle): | ||
| 12 | """ | ||
| 13 | Some doors open after solving the COLOR panel in the Control Center. If this option is enabled, these doors will | ||
| 14 | instead open upon receiving an item. | ||
| 15 | """ | ||
| 16 | display_name = "Shuffle Control Center Colors" | ||
| 17 | |||
| 18 | |||
| 19 | class ShuffleGalleryPaintings(Toggle): | ||
| 20 | """If enabled, gallery paintings will appear from receiving an item rather than by triggering them normally.""" | ||
| 21 | display_name = "Shuffle Gallery Paintings" | ||
| 22 | |||
| 23 | |||
| 24 | class ShuffleLetters(Choice): | ||
| 25 | """ | ||
| 26 | Controls how letter unlocks are handled. Note that H1, I1, N1, and T1 will always be present at their vanilla | ||
| 27 | locations in the starting room, even if letters are shuffled remotely. | ||
| 28 | |||
| 29 | - **Vanilla**: All letters will be present at their vanilla locations. | ||
| 30 | - **Unlocked**: Players will start with their keyboards fully unlocked. | ||
| 31 | - **Progressive**: Two items will be added to the pool for every letter (one for H, I, N, and T). Receiving the | ||
| 32 | first item gives you the corresponding level 1 letter, and the second item gives you the corresponding level 2 | ||
| 33 | letter. | ||
| 34 | - **Vanilla Cyan**: Players will start with all level 1 (purple) letters unlocked. Level 2 (cyan) letters will be | ||
| 35 | present at their vanilla locations. | ||
| 36 | - **Item Cyan**: Players will start with all level 1 (purple) letters unlocked. One item will be added to the pool | ||
| 37 | for every level 2 (cyan) letter. | ||
| 38 | """ | ||
| 39 | display_name = "Shuffle Letters" | ||
| 40 | option_vanilla = 0 | ||
| 41 | option_unlocked = 1 | ||
| 42 | option_progressive = 2 | ||
| 43 | option_vanilla_cyan = 3 | ||
| 44 | option_item_cyan = 4 | ||
| 45 | |||
| 46 | |||
| 47 | class RestrictLetterPlacements(Toggle): | ||
| 48 | """ | ||
| 49 | If enabled, letter items will be shuffled among letter locations in your local world. Shuffle Letters must be set to | ||
| 50 | Progressive or Item Cyan for this to be useful. | ||
| 51 | |||
| 52 | WARNING: This option may slow down generation. Additionally, it is only reliable with Shuffle Letters set to Item | ||
| 53 | Cyan. When set to Progressive, Shuffle Doors and Shuffle Symbols must be turned off. | ||
| 54 | """ | ||
| 55 | display_name = "Restrict Letter Placements" | ||
| 56 | |||
| 57 | |||
| 58 | class ShuffleSymbols(Toggle): | ||
| 59 | """ | ||
| 60 | If enabled, 19 items will be added to the pool, representing the different symbols that can appear on a panel. | ||
| 61 | Players will be prevented from solving puzzles with symbols on them until all of the required symbols are unlocked. | ||
| 62 | """ | ||
| 63 | display_name = "Shuffle Symbols" | ||
| 64 | |||
| 65 | |||
| 66 | class ShuffleWorldports(Toggle): | ||
| 67 | """ | ||
| 68 | Randomizes the connections between maps. This affects worldports only, which are the loading zones you walk into in | ||
| 69 | order to change maps. This does not affect paintings, panels that teleport you, or certain other special connections | ||
| 70 | like the one between The Shop and Control Center. | ||
| 71 | """ | ||
| 72 | display_name = "Shuffle Worldports" | ||
| 73 | |||
| 74 | |||
| 75 | class KeyholderSanity(Toggle): | ||
| 76 | """ | ||
| 77 | If enabled, 26 locations will be created for placing each key into its respective Green Ending keyholder. | ||
| 78 | |||
| 79 | NOTE: This does not apply to the two disappearing keyholders in The Congruent, as they are not part of Green Ending. | ||
| 80 | """ | ||
| 81 | display_name = "Keyholder Sanity" | ||
| 82 | |||
| 83 | |||
| 84 | class CyanDoorBehavior(Choice): | ||
| 85 | """ | ||
| 86 | Cyan-colored doors usually only open upon unlocking double letters. Some panels also only appear upon unlocking | ||
| 87 | double letters. This option determines how these unlocks should behave. | ||
| 88 | |||
| 89 | - **Collect H2**: In the base game, H2 is the first double letter you are intended to collect, so cyan doors only | ||
| 90 | open when you collect the H2 pickup in The Repetitive. Collecting the actual pickup is still required even with | ||
| 91 | remote letter shuffle enabled. | ||
| 92 | - **Any Double Letter**: Cyan doors will open when you have unlocked any cyan letter on your keyboard. In letter | ||
| 93 | shuffle, this means receiving a cyan letter, not picking up a cyan letter collectable. | ||
| 94 | - **Item**: Cyan doors will be grouped together in a single item. | ||
| 95 | |||
| 96 | Note that some cyan doors are impacted by door shuffle (e.g. the entrance to The Tower). When door shuffle is | ||
| 97 | enabled, these doors won't be affected by the value of this option. | ||
| 98 | """ | ||
| 99 | display_name = "Cyan Door Behavior" | ||
| 100 | option_collect_h2 = 0 | ||
| 101 | option_any_double_letter = 1 | ||
| 102 | option_item = 2 | ||
| 103 | |||
| 104 | |||
| 105 | class ShuffleFastTravel(Toggle): | ||
| 106 | """If enabled, the list of maps you can fast travel to is randomized, except for The Entry, which is always | ||
| 107 | accessible.""" | ||
| 108 | display_name = "Shuffle Fast Travel" | ||
| 109 | |||
| 110 | |||
| 111 | class FastTravelAccess(Choice): | ||
| 112 | """ | ||
| 113 | Controls how the fast travel buttons on the pause menu work. | ||
| 114 | |||
| 115 | - **Vanilla**: You can only fast travel to maps once you have been to them and stepped foot in the general area that | ||
| 116 | the warp would place you. This option means that fast travel has no impact on logic. | ||
| 117 | - **Unlocked**: All five fast travel maps will be available from the start. | ||
| 118 | - **Items**: Only The Entry is available from the start. The other fast travel buttons are locked behind items. | ||
| 119 | """ | ||
| 120 | display_name = "Fast Travel Access" | ||
| 121 | option_vanilla = 0 | ||
| 122 | option_unlocked = 1 | ||
| 123 | option_items = 2 | ||
| 124 | |||
| 125 | |||
| 126 | class EnableIcarus(Toggle): | ||
| 127 | """ | ||
| 128 | Controls whether Icarus is randomized. If disabled, which is the default, no locations or items will be created for | ||
| 129 | it, and its worldport will not be shuffled when worldport shuffle is on. | ||
| 130 | """ | ||
| 131 | display_name = "Enable Icarus" | ||
| 132 | |||
| 133 | |||
| 134 | class EnableGiftMaps(OptionSet): | ||
| 135 | """ | ||
| 136 | Controls whether the beta tester gift maps are randomized. By default, these are not accessible at all from within | ||
| 137 | the randomizer. This option allows you to enter the maps, and creates items and locations for them. If worldport | ||
| 138 | shuffle is on, their worldports will be included in the randomization. | ||
| 139 | |||
| 140 | The gift maps are accessed via a panel in The Entry's Starting Room, which only appears if at least one gift map is | ||
| 141 | enabled. It is also treated like a cyan door, and will not appear until the condition specified in the Cyan Door | ||
| 142 | Behavior option is satisfied. Solving this panel with the name of one of the beta testers will teleport you to their | ||
| 143 | corresponding gift map. | ||
| 144 | |||
| 145 | In the base game, nothing happens once you complete a gift map. Masteries have been added to the gift maps in the | ||
| 146 | randomizer so that the player can be rewarded for completing them. | ||
| 147 | |||
| 148 | Note that the gift maps were originally only intended to be played by specific people, and as a result may be | ||
| 149 | frustrating or require knowledge of inside jokes. The Crystalline is particularly difficult as it requires | ||
| 150 | completing a parkour course. | ||
| 151 | """ | ||
| 152 | display_name = "Enable Gift Maps" | ||
| 153 | valid_keys = ["The Advanced", "The Charismatic", "The Crystalline", "The Fuzzy", "The Stellar"] | ||
| 154 | |||
| 155 | |||
| 156 | class DaedalusOnly(Toggle): | ||
| 157 | """ | ||
| 158 | If enabled, all maps besides Daedalus, The Gold, and The Tenacious will be disabled. This overrides any other | ||
| 159 | map-based option, such as Enable Icarus. The player will start in Daedalus. The following options are restricted | ||
| 160 | with this setting: | ||
| 161 | |||
| 162 | - The ending must be set to Orange or Gold. | ||
| 163 | - Worldport shuffle must be enabled. | ||
| 164 | - Letter shuffle must Unlocked. | ||
| 165 | - Cyan Door Behavior cannot be set to Collect H2. | ||
| 166 | - Control Center Color shuffle must be enabled. | ||
| 167 | """ | ||
| 168 | display_name = "Daedalus Only" | ||
| 169 | |||
| 170 | |||
| 171 | class DaedalusRoofAccess(Toggle): | ||
| 172 | """ | ||
| 173 | If enabled, the player will be logically expected to be able to go from the castle entrance to any part of Daedalus | ||
| 174 | that is open to the air. If disabled, the player will only be expected to be able to enter the castle, the moat, | ||
| 175 | Icarus, and the area at the bottom of the stairs. Invisible walls that become opaque as you approach them are added | ||
| 176 | to the level to prevent the player from accidentally breaking logic. | ||
| 177 | """ | ||
| 178 | display_name = "Allow Daedalus Roof Access" | ||
| 179 | |||
| 180 | |||
| 181 | class CustomMintEnding(FreeText): | ||
| 182 | """ | ||
| 183 | If not blank, this will add a new panel that must be solved before collecting Mint Ending (EXIT in the Control | ||
| 184 | Center). The panel will only require typing the text provided for this option, which means the choice of letters | ||
| 185 | here has an impact on logic. | ||
| 186 | """ | ||
| 187 | display_name = "Custom Mint Ending" | ||
| 188 | |||
| 189 | |||
| 190 | class StrictPurpleEnding(DefaultOnToggle): | ||
| 191 | """ | ||
| 192 | If enabled, the player will be required to have all purple (level 1) letters in order to get Purple Ending. | ||
| 193 | Otherwise, some of the letters may be skippable depending on the other options. | ||
| 194 | """ | ||
| 195 | display_name = "Strict Purple Ending" | ||
| 196 | |||
| 197 | |||
| 198 | class StrictCyanEnding(DefaultOnToggle): | ||
| 199 | """ | ||
| 200 | If enabled, the player will be required to have all cyan (level 2) letters in order to get Cyan Ending. Otherwise, | ||
| 201 | at least J2, Q2, and V2 are skippable. Others may also be skippable depending on the options chosen. | ||
| 202 | """ | ||
| 203 | display_name = "Strict Cyan Ending" | ||
| 204 | |||
| 205 | |||
| 11 | class VictoryCondition(Choice): | 206 | class VictoryCondition(Choice): |
| 12 | """Victory condition.""" | 207 | """ |
| 208 | This option determines what your goal is. | ||
| 209 | |||
| 210 | - **Gray Ending** (The Colorful) | ||
| 211 | - **Purple Ending** (The Sun Temple). This ordinarily requires all level 1 (purple) letters. | ||
| 212 | - **Mint Ending** (typing EXIT into the keyholders in Control Center) | ||
| 213 | - **Black Ending** (The Graveyard) | ||
| 214 | - **Blue Ending** (The Words) | ||
| 215 | - **Cyan Ending** (The Parthenon). This ordinarily requires almost all level 2 (cyan) letters. | ||
| 216 | - **Red Ending** (The Tower) | ||
| 217 | - **Plum Ending** (The Wondrous / The Door) | ||
| 218 | - **Orange Ending** (the castle in Daedalus) | ||
| 219 | - **Gold Ending** (The Gold). This involves going through the color rooms in Daedalus. | ||
| 220 | - **Yellow Ending** (The Gallery). This requires unlocking all gallery paintings. | ||
| 221 | - **Green Ending** (The Ancient). This requires filling all keyholders with specific letters. | ||
| 222 | - **White Ending** (Control Center). This combines every other ending. | ||
| 223 | """ | ||
| 13 | display_name = "Victory Condition" | 224 | display_name = "Victory Condition" |
| 14 | option_gray_ending = 0 | 225 | option_gray_ending = 0 |
| 15 | option_purple_ending = 1 | 226 | option_purple_ending = 1 |
| @@ -26,7 +237,63 @@ class VictoryCondition(Choice): | |||
| 26 | option_white_ending = 12 | 237 | option_white_ending = 12 |
| 27 | 238 | ||
| 28 | 239 | ||
| 240 | class EndingsRequirement(Range): | ||
| 241 | """The number of endings required to unlock White Ending.""" | ||
| 242 | display_name = "Endings Requirement" | ||
| 243 | range_start = 0 | ||
| 244 | range_end = 12 | ||
| 245 | default = 12 | ||
| 246 | |||
| 247 | |||
| 248 | class MasteriesRequirement(Range): | ||
| 249 | """The number of masteries required to unlock White Ending. | ||
| 250 | |||
| 251 | There are only 13 masteries in the base game, but some of the other slot options may add more masteries to the | ||
| 252 | world. If the chosen number of masteries is higher than the total in your world, it will be automatically lowered to | ||
| 253 | the maximum.""" | ||
| 254 | display_name = "Masteries Requirement" | ||
| 255 | range_start = 0 | ||
| 256 | range_end = 19 | ||
| 257 | default = 0 | ||
| 258 | |||
| 259 | |||
| 260 | class TrapPercentage(Range): | ||
| 261 | """Replaces junk items with traps, at the specified rate.""" | ||
| 262 | display_name = "Trap Percentage" | ||
| 263 | range_start = 0 | ||
| 264 | range_end = 100 | ||
| 265 | default = 0 | ||
| 266 | |||
| 267 | |||
| 268 | class ShuffleMusic(Toggle): | ||
| 269 | """ | ||
| 270 | If enabled, every map will be assigned a random music track. | ||
| 271 | """ | ||
| 272 | display_name = "Shuffle Music" | ||
| 273 | |||
| 274 | |||
| 29 | @dataclass | 275 | @dataclass |
| 30 | class Lingo2Options(PerGameCommonOptions): | 276 | class Lingo2Options(PerGameCommonOptions): |
| 31 | shuffle_doors: ShuffleDoors | 277 | shuffle_doors: ShuffleDoors |
| 278 | shuffle_control_center_colors: ShuffleControlCenterColors | ||
| 279 | shuffle_gallery_paintings: ShuffleGalleryPaintings | ||
| 280 | shuffle_letters: ShuffleLetters | ||
| 281 | restrict_letter_placements: RestrictLetterPlacements | ||
| 282 | shuffle_symbols: ShuffleSymbols | ||
| 283 | shuffle_worldports: ShuffleWorldports | ||
| 284 | keyholder_sanity: KeyholderSanity | ||
| 285 | cyan_door_behavior: CyanDoorBehavior | ||
| 286 | shuffle_fast_travel: ShuffleFastTravel | ||
| 287 | fast_travel_access: FastTravelAccess | ||
| 288 | enable_icarus: EnableIcarus | ||
| 289 | enable_gift_maps: EnableGiftMaps | ||
| 290 | daedalus_only: DaedalusOnly | ||
| 291 | daedalus_roof_access: DaedalusRoofAccess | ||
| 292 | custom_mint_ending: CustomMintEnding | ||
| 293 | strict_purple_ending: StrictPurpleEnding | ||
| 294 | strict_cyan_ending: StrictCyanEnding | ||
| 32 | victory_condition: VictoryCondition | 295 | victory_condition: VictoryCondition |
| 296 | endings_requirement: EndingsRequirement | ||
| 297 | masteries_requirement: MasteriesRequirement | ||
| 298 | trap_percentage: TrapPercentage | ||
| 299 | shuffle_music: ShuffleMusic | ||
