Skip to content

Commit c178c73

Browse files
hatkirbyJames McIntosh
authored andcommitted
Lingo: Use OptionCounter for trap_weights (ArchipelagoMW#4920)
1 parent 33b966a commit c178c73

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

worlds/lingo/options.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from schema import And, Schema
44

5-
from Options import Toggle, Choice, DefaultOnToggle, Range, PerGameCommonOptions, StartInventoryPool, OptionDict, \
5+
from Options import Toggle, Choice, DefaultOnToggle, Range, PerGameCommonOptions, StartInventoryPool, OptionCounter, \
66
OptionGroup
77
from .items import TRAP_ITEMS
88

@@ -222,13 +222,14 @@ class TrapPercentage(Range):
222222
default = 20
223223

224224

225-
class TrapWeights(OptionDict):
225+
class TrapWeights(OptionCounter):
226226
"""Specify the distribution of traps that should be placed into the pool.
227227
228228
If you don't want a specific type of trap, set the weight to zero.
229229
"""
230230
display_name = "Trap Weights"
231-
schema = Schema({trap_name: And(int, lambda n: n >= 0) for trap_name in TRAP_ITEMS})
231+
valid_keys = TRAP_ITEMS
232+
min = 0
232233
default = {trap_name: 1 for trap_name in TRAP_ITEMS}
233234

234235

0 commit comments

Comments
 (0)