From 9c6e33c7869d28b8fa1b3349c9a59a40aa8c1526 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 22 Mar 2024 15:28:41 -0500 Subject: Lingo: Add trap weights option (#2837) --- options.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'options.py') diff --git a/options.py b/options.py index ed14264..293992a 100644 --- a/options.py +++ b/options.py @@ -1,6 +1,9 @@ from dataclasses import dataclass -from Options import Toggle, Choice, DefaultOnToggle, Range, PerGameCommonOptions, StartInventoryPool +from schema import And, Schema + +from Options import Toggle, Choice, DefaultOnToggle, Range, PerGameCommonOptions, StartInventoryPool, OptionDict +from worlds.lingo.items import TRAP_ITEMS class ShuffleDoors(Choice): @@ -107,6 +110,14 @@ class TrapPercentage(Range): default = 20 +class TrapWeights(OptionDict): + """Specify the distribution of traps that should be placed into the pool. + If you don't want a specific type of trap, set the weight to zero.""" + display_name = "Trap Weights" + schema = Schema({trap_name: And(int, lambda n: n >= 0) for trap_name in TRAP_ITEMS}) + default = {trap_name: 1 for trap_name in TRAP_ITEMS} + + class PuzzleSkipPercentage(Range): """Replaces junk items with puzzle skips, at the specified rate.""" display_name = "Puzzle Skip Percentage" @@ -134,6 +145,7 @@ class LingoOptions(PerGameCommonOptions): level_2_requirement: Level2Requirement early_color_hallways: EarlyColorHallways trap_percentage: TrapPercentage + trap_weights: TrapWeights puzzle_skip_percentage: PuzzleSkipPercentage death_link: DeathLink start_inventory_from_pool: StartInventoryPool -- cgit 1.4.1