diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-01-15 15:13:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-15 21:13:29 +0100 |
| commit | a834180195305fe0be91bd0ced5b75de104b7520 (patch) | |
| tree | 6b4c1f8713e54dea7b75b9abe20c224178d02921 | |
| parent | 1c7fcd002eb59e8cda09997eb89ecd609aff7275 (diff) | |
| download | lingo-apworld-a834180195305fe0be91bd0ced5b75de104b7520.tar.gz lingo-apworld-a834180195305fe0be91bd0ced5b75de104b7520.tar.bz2 lingo-apworld-a834180195305fe0be91bd0ced5b75de104b7520.zip | |
Lingo: Add speed boost mode (#3989)
* Add speed boost mode * Update generated.dat * Modify the actual trap weights option when speed boost mode is on * EOF newline * Update generated.dat
| -rw-r--r-- | __init__.py | 12 | ||||
| -rw-r--r-- | data/generated.dat | bin | 149485 -> 149504 bytes | |||
| -rw-r--r-- | data/ids.yaml | 1 | ||||
| -rw-r--r-- | items.py | 1 | ||||
| -rw-r--r-- | options.py | 10 | ||||
| -rw-r--r-- | test/TestOptions.py | 9 | ||||
| -rw-r--r-- | utils/assign_ids.rb | 3 |
7 files changed, 32 insertions, 4 deletions
| diff --git a/__init__.py b/__init__.py index 2a61a71..141fca0 100644 --- a/__init__.py +++ b/__init__.py | |||
| @@ -128,6 +128,9 @@ class LingoWorld(World): | |||
| 128 | pool.append(self.create_item("Puzzle Skip")) | 128 | pool.append(self.create_item("Puzzle Skip")) |
| 129 | 129 | ||
| 130 | if traps: | 130 | if traps: |
| 131 | if self.options.speed_boost_mode: | ||
| 132 | self.options.trap_weights.value["Slowness Trap"] = 0 | ||
| 133 | |||
| 131 | total_weight = sum(self.options.trap_weights.values()) | 134 | total_weight = sum(self.options.trap_weights.values()) |
| 132 | 135 | ||
| 133 | if total_weight == 0: | 136 | if total_weight == 0: |
| @@ -171,7 +174,7 @@ class LingoWorld(World): | |||
| 171 | "death_link", "victory_condition", "shuffle_colors", "shuffle_doors", "shuffle_paintings", "shuffle_panels", | 174 | "death_link", "victory_condition", "shuffle_colors", "shuffle_doors", "shuffle_paintings", "shuffle_panels", |
| 172 | "enable_pilgrimage", "sunwarp_access", "mastery_achievements", "level_2_requirement", "location_checks", | 175 | "enable_pilgrimage", "sunwarp_access", "mastery_achievements", "level_2_requirement", "location_checks", |
| 173 | "early_color_hallways", "pilgrimage_allows_roof_access", "pilgrimage_allows_paintings", "shuffle_sunwarps", | 176 | "early_color_hallways", "pilgrimage_allows_roof_access", "pilgrimage_allows_paintings", "shuffle_sunwarps", |
| 174 | "group_doors" | 177 | "group_doors", "speed_boost_mode" |
| 175 | ] | 178 | ] |
| 176 | 179 | ||
| 177 | slot_data = { | 180 | slot_data = { |
| @@ -188,5 +191,8 @@ class LingoWorld(World): | |||
| 188 | return slot_data | 191 | return slot_data |
| 189 | 192 | ||
| 190 | def get_filler_item_name(self) -> str: | 193 | def get_filler_item_name(self) -> str: |
| 191 | filler_list = [":)", "The Feeling of Being Lost", "Wanderlust", "Empty White Hallways"] | 194 | if self.options.speed_boost_mode: |
| 192 | return self.random.choice(filler_list) | 195 | return "Speed Boost" |
| 196 | else: | ||
| 197 | filler_list = [":)", "The Feeling of Being Lost", "Wanderlust", "Empty White Hallways"] | ||
| 198 | return self.random.choice(filler_list) | ||
| diff --git a/data/generated.dat b/data/generated.dat index 8b159d4..646ce3b 100644 --- a/data/generated.dat +++ b/data/generated.dat | |||
| Binary files differ | |||
| diff --git a/data/ids.yaml b/data/ids.yaml index 13b7714..0a43592 100644 --- a/data/ids.yaml +++ b/data/ids.yaml | |||
| @@ -17,6 +17,7 @@ special_items: | |||
| 17 | Iceland Trap: 444411 | 17 | Iceland Trap: 444411 |
| 18 | Atbash Trap: 444412 | 18 | Atbash Trap: 444412 |
| 19 | Puzzle Skip: 444413 | 19 | Puzzle Skip: 444413 |
| 20 | Speed Boost: 444680 | ||
| 20 | panels: | 21 | panels: |
| 21 | Starting Room: | 22 | Starting Room: |
| 22 | HI: 444400 | 23 | HI: 444400 |
| diff --git a/items.py b/items.py index 78b288e..7e75cc7 100644 --- a/items.py +++ b/items.py | |||
| @@ -85,6 +85,7 @@ def load_item_data(): | |||
| 85 | "The Feeling of Being Lost": ItemClassification.filler, | 85 | "The Feeling of Being Lost": ItemClassification.filler, |
| 86 | "Wanderlust": ItemClassification.filler, | 86 | "Wanderlust": ItemClassification.filler, |
| 87 | "Empty White Hallways": ItemClassification.filler, | 87 | "Empty White Hallways": ItemClassification.filler, |
| 88 | "Speed Boost": ItemClassification.filler, | ||
| 88 | **{trap_name: ItemClassification.trap for trap_name in TRAP_ITEMS}, | 89 | **{trap_name: ItemClassification.trap for trap_name in TRAP_ITEMS}, |
| 89 | "Puzzle Skip": ItemClassification.useful, | 90 | "Puzzle Skip": ItemClassification.useful, |
| 90 | } | 91 | } |
| diff --git a/options.py b/options.py index 2d6e996..f9d04f6 100644 --- a/options.py +++ b/options.py | |||
| @@ -232,6 +232,14 @@ class TrapWeights(OptionDict): | |||
| 232 | default = {trap_name: 1 for trap_name in TRAP_ITEMS} | 232 | default = {trap_name: 1 for trap_name in TRAP_ITEMS} |
| 233 | 233 | ||
| 234 | 234 | ||
| 235 | class SpeedBoostMode(Toggle): | ||
| 236 | """ | ||
| 237 | If on, the player's default speed is halved, as if affected by a Slowness Trap. Speed Boosts are added to | ||
| 238 | the item pool, which temporarily return the player to normal speed. Slowness Traps are removed from the pool. | ||
| 239 | """ | ||
| 240 | display_name = "Speed Boost Mode" | ||
| 241 | |||
| 242 | |||
| 235 | class PuzzleSkipPercentage(Range): | 243 | class PuzzleSkipPercentage(Range): |
| 236 | """Replaces junk items with puzzle skips, at the specified rate.""" | 244 | """Replaces junk items with puzzle skips, at the specified rate.""" |
| 237 | display_name = "Puzzle Skip Percentage" | 245 | display_name = "Puzzle Skip Percentage" |
| @@ -260,6 +268,7 @@ lingo_option_groups = [ | |||
| 260 | Level2Requirement, | 268 | Level2Requirement, |
| 261 | TrapPercentage, | 269 | TrapPercentage, |
| 262 | TrapWeights, | 270 | TrapWeights, |
| 271 | SpeedBoostMode, | ||
| 263 | PuzzleSkipPercentage, | 272 | PuzzleSkipPercentage, |
| 264 | ]) | 273 | ]) |
| 265 | ] | 274 | ] |
| @@ -287,6 +296,7 @@ class LingoOptions(PerGameCommonOptions): | |||
| 287 | shuffle_postgame: ShufflePostgame | 296 | shuffle_postgame: ShufflePostgame |
| 288 | trap_percentage: TrapPercentage | 297 | trap_percentage: TrapPercentage |
| 289 | trap_weights: TrapWeights | 298 | trap_weights: TrapWeights |
| 299 | speed_boost_mode: SpeedBoostMode | ||
| 290 | puzzle_skip_percentage: PuzzleSkipPercentage | 300 | puzzle_skip_percentage: PuzzleSkipPercentage |
| 291 | death_link: DeathLink | 301 | death_link: DeathLink |
| 292 | start_inventory_from_pool: StartInventoryPool | 302 | start_inventory_from_pool: StartInventoryPool |
| diff --git a/test/TestOptions.py b/test/TestOptions.py index bd8ed81..224dbe0 100644 --- a/test/TestOptions.py +++ b/test/TestOptions.py | |||
| @@ -59,4 +59,11 @@ class TestShuffleSunwarpsAccess(LingoTestBase): | |||
| 59 | "victory_condition": "pilgrimage", | 59 | "victory_condition": "pilgrimage", |
| 60 | "shuffle_sunwarps": "true", | 60 | "shuffle_sunwarps": "true", |
| 61 | "sunwarp_access": "individual" | 61 | "sunwarp_access": "individual" |
| 62 | } \ No newline at end of file | 62 | } |
| 63 | |||
| 64 | |||
| 65 | class TestSpeedBoostMode(LingoTestBase): | ||
| 66 | options = { | ||
| 67 | "location_checks": "insanity", | ||
| 68 | "speed_boost_mode": "true", | ||
| 69 | } | ||
| diff --git a/utils/assign_ids.rb b/utils/assign_ids.rb index f7de3d0..bcb8018 100644 --- a/utils/assign_ids.rb +++ b/utils/assign_ids.rb | |||
| @@ -216,3 +216,6 @@ config.each do |room_name, room_data| | |||
| 216 | end | 216 | end |
| 217 | 217 | ||
| 218 | File.write(outputpath, old_generated.to_yaml) | 218 | File.write(outputpath, old_generated.to_yaml) |
| 219 | |||
| 220 | puts "Next item ID: #{next_item_id}" | ||
| 221 | puts "Next location ID: #{next_location_id}" | ||
