From 665655e24094e81efe6a4ad761b16ca91ad8a37a Mon Sep 17 00:00:00 2001 From: qwint Date: Fri, 7 Jun 2024 12:12:10 -0500 Subject: [PATCH] HK: adds schema to validate plando charm costs (#3471) --- worlds/hk/Options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worlds/hk/Options.py b/worlds/hk/Options.py index 0ad1acff5df3..38be2cd794a1 100644 --- a/worlds/hk/Options.py +++ b/worlds/hk/Options.py @@ -2,6 +2,7 @@ import re from .ExtractedData import logic_options, starts, pool_options from .Rules import cost_terms +from schema import And, Schema, Optional from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict, NamedRange, DeathLink from .Charms import vanilla_costs, names as charm_names @@ -296,6 +297,9 @@ class PlandoCharmCosts(OptionDict): This is set after any random Charm Notch costs, if applicable.""" display_name = "Charm Notch Cost Plando" valid_keys = frozenset(charm_names) + schema = Schema({ + Optional(name): And(int, lambda n: 6 >= n >= 0) for name in charm_names + }) def get_costs(self, charm_costs: typing.List[int]) -> typing.List[int]: for name, cost in self.value.items():