diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-22 15:28:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-22 21:28:41 +0100 |
| commit | 9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526 (patch) | |
| tree | 2476ec2b334184139bb536337d1d9bd7a7b3591c /options.py | |
| parent | f17c4acbe9364178787888a91a6e40f8216363e8 (diff) | |
| download | lingo-apworld-9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526.tar.gz lingo-apworld-9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526.tar.bz2 lingo-apworld-9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526.zip | |
Lingo: Add trap weights option (#2837)
Diffstat (limited to 'options.py')
| -rw-r--r-- | options.py | 14 |
1 files changed, 13 insertions, 1 deletions
| diff --git a/options.py b/options.py index ed14264..293992a 100644 --- a/options.py +++ b/options.py | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | from dataclasses import dataclass | 1 | from dataclasses import dataclass |
| 2 | 2 | ||
| 3 | from Options import Toggle, Choice, DefaultOnToggle, Range, PerGameCommonOptions, StartInventoryPool | 3 | from schema import And, Schema |
| 4 | |||
| 5 | from Options import Toggle, Choice, DefaultOnToggle, Range, PerGameCommonOptions, StartInventoryPool, OptionDict | ||
| 6 | from worlds.lingo.items import TRAP_ITEMS | ||
| 4 | 7 | ||
| 5 | 8 | ||
| 6 | class ShuffleDoors(Choice): | 9 | class ShuffleDoors(Choice): |
| @@ -107,6 +110,14 @@ class TrapPercentage(Range): | |||
| 107 | default = 20 | 110 | default = 20 |
| 108 | 111 | ||
| 109 | 112 | ||
| 113 | class TrapWeights(OptionDict): | ||
| 114 | """Specify the distribution of traps that should be placed into the pool. | ||
| 115 | If you don't want a specific type of trap, set the weight to zero.""" | ||
| 116 | display_name = "Trap Weights" | ||
| 117 | schema = Schema({trap_name: And(int, lambda n: n >= 0) for trap_name in TRAP_ITEMS}) | ||
| 118 | default = {trap_name: 1 for trap_name in TRAP_ITEMS} | ||
| 119 | |||
| 120 | |||
| 110 | class PuzzleSkipPercentage(Range): | 121 | class PuzzleSkipPercentage(Range): |
| 111 | """Replaces junk items with puzzle skips, at the specified rate.""" | 122 | """Replaces junk items with puzzle skips, at the specified rate.""" |
| 112 | display_name = "Puzzle Skip Percentage" | 123 | display_name = "Puzzle Skip Percentage" |
| @@ -134,6 +145,7 @@ class LingoOptions(PerGameCommonOptions): | |||
| 134 | level_2_requirement: Level2Requirement | 145 | level_2_requirement: Level2Requirement |
| 135 | early_color_hallways: EarlyColorHallways | 146 | early_color_hallways: EarlyColorHallways |
| 136 | trap_percentage: TrapPercentage | 147 | trap_percentage: TrapPercentage |
| 148 | trap_weights: TrapWeights | ||
| 137 | puzzle_skip_percentage: PuzzleSkipPercentage | 149 | puzzle_skip_percentage: PuzzleSkipPercentage |
| 138 | death_link: DeathLink | 150 | death_link: DeathLink |
| 139 | start_inventory_from_pool: StartInventoryPool | 151 | start_inventory_from_pool: StartInventoryPool |
