X-Git-Url: https://plomlompom.com/repos/?p=plomrogue2-experiments;a=blobdiff_plain;f=new%2Fplomrogue%2Fthings.py;h=20ce4867c2211882b506de309d8881eb16842379;hp=a631b174f9292dde5ab047b98836bd2820939137;hb=729e72408fa1c3180275ad3c0e6689143a0f2f38;hpb=65e83c99b95a619afc79e8984e6f5027bc7aac1b diff --git a/new/plomrogue/things.py b/new/plomrogue/things.py index a631b17..20ce486 100644 --- a/new/plomrogue/things.py +++ b/new/plomrogue/things.py @@ -149,6 +149,16 @@ class ThingAnimate(Thing): visible_things += [thing] return visible_things + def get_pickable_items(self): + pickable_ids = [] + for t in [t for t in self.get_visible_things() if + isinstance(t, ThingItem) and + (t.position == self.position or + t.position in + self.world.map_.get_neighbors(self.position).values())]: + pickable_ids += [t.id_] + return pickable_ids + class ThingHuman(ThingAnimate):