Ejemplo n.º 1
0
    def pick_up(self):
        #add to the player's inventory and remove from the map
        if len(GameGlobals.inventory) >= 26:
            GameGlobals.messageBox.print('Your inventory is full, cannot pick up ' + self.owner.name + '.')
        else:
            GameGlobals.inventory.append(self.owner)
            GameGlobals.levelobjects.remove(self.owner)
            GameGlobals.messageBox.print('You picked up a ' + self.owner.name + '!')

            #special case: automatically equip, if the corresponding equipment slot is unused
            equipment = self.owner.equipment
            if equipment and Equipment.get_equipped_in_slot(equipment.slot) is None:
                equipment.equip()