Skip to content

Commit b053fee

Browse files
authored
HK: adds schema to validate plando charm costs (#3471)
1 parent 8c61486 commit b053fee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

worlds/hk/Options.py

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import re
33
from .ExtractedData import logic_options, starts, pool_options
44
from .Rules import cost_terms
5+
from schema import And, Schema, Optional
56

67
from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict, NamedRange, DeathLink
78
from .Charms import vanilla_costs, names as charm_names
@@ -296,6 +297,9 @@ class PlandoCharmCosts(OptionDict):
296297
This is set after any random Charm Notch costs, if applicable."""
297298
display_name = "Charm Notch Cost Plando"
298299
valid_keys = frozenset(charm_names)
300+
schema = Schema({
301+
Optional(name): And(int, lambda n: 6 >= n >= 0) for name in charm_names
302+
})
299303

300304
def get_costs(self, charm_costs: typing.List[int]) -> typing.List[int]:
301305
for name, cost in self.value.items():

0 commit comments

Comments
 (0)