LttP: implement new dungeon_items handling

LttP: move glitch_boots to new options system
WebHost: options.yaml no longer lists aliases
General: remove region.can_fill, it was only used as a hack to make dungeon-specific items to work
This commit is contained in:
Fabian Dill
2021-08-30 16:31:56 +02:00
parent a124a7a82a
commit 5daadcb2d5
15 changed files with 235 additions and 192 deletions

View File

@@ -9,7 +9,7 @@ class AssembleOptions(type):
name_lookup = attrs["name_lookup"] = {}
# merge parent class options
for base in bases:
if hasattr(base, "options"):
if getattr(base, "options", None):
options.update(base.options)
name_lookup.update(base.name_lookup)
new_options = {name[7:].lower(): option_id for name, option_id in attrs.items() if
@@ -147,6 +147,16 @@ class Choice(Option):
return cls(data)
return cls.from_text(str(data))
def __eq__(self, other):
if type(other) == str:
return other == self.current_key
elif type(other) == int:
return other == self.value
elif type(other) == bool:
return other == bool(self.value)
else:
raise TypeError(f"Can't compare {self.__class__.__name__} with {other.__class__.__name__}")
class Range(Option, int):
range_start = 0