From a29205b547abcdd2c12cc8a7b26727777a06ba29 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:59:08 +0100 Subject: [PATCH] Core: Add Item.excludable helper function (#4080) Some worlds might want to check for "Item is junk", i.e. an excludable item. Because this is both `filler` and `trap`, and because `filler` is `0`, there are many "wrong ways" to do this. So I think we should provide a helper function for it. --- BaseClasses.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BaseClasses.py b/BaseClasses.py index 53b69d30..46edeb5e 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1264,6 +1264,10 @@ class Item: def trap(self) -> bool: return ItemClassification.trap in self.classification + @property + def excludable(self) -> bool: + return not (self.advancement or self.useful) + @property def flags(self) -> int: return self.classification.as_flag()