From 68f90571fd7423cad94c820c39bdf163cc3258f7 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:39:37 +0200 Subject: [PATCH] Core: Add Item.excludable helper function 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 0d4f34e514..157bb55ccc 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()