add separate can_exclude property, so non-progression items can be marked non-excluded

This commit is contained in:
espeon65536
2021-07-15 08:46:07 -05:00
committed by Fabian Dill
parent 39a5921522
commit 0eee1f2d01
5 changed files with 16 additions and 6 deletions

View File

@@ -1104,6 +1104,7 @@ class Item():
world: Optional[MultiWorld] = None
game: str = "Generic"
type: str = None
can_be_excluded: bool = True # change manually if you want some non-advancement item to not be excluded
pedestal_credit_text: str = "and the Unknown Item"
sickkid_credit_text: Optional[str] = None
magicshop_credit_text: Optional[str] = None
@@ -1117,6 +1118,8 @@ class Item():
self.player = player
self.code = code
self.can_be_excluded = not advancement
@property
def hint_text(self):
return getattr(self, "_hint_text", self.name.replace("_", " ").replace("-", " "))
@@ -1136,6 +1139,10 @@ class Item():
def __hash__(self):
return hash((self.name, self.player))
@property
def can_exclude(self) -> bool:
return not (self.advancement or self.smallkey or self.bigkey) and self.can_be_excluded
@property
def crystal(self) -> bool:
return self.type == 'Crystal'