mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
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:
12
Options.py
12
Options.py
@@ -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
|
||||
|
Reference in New Issue
Block a user