Use directly equipped items outside the inventory
This commit is contained in:
@ -75,6 +75,17 @@ class Player(InventoryHolder, FightingEntity):
|
||||
self.current_xp += xp
|
||||
self.level_up()
|
||||
|
||||
def remove_from_inventory(self, obj: Item) -> None:
|
||||
"""
|
||||
Remove the given item from the inventory, even if the item is equipped.
|
||||
"""
|
||||
if obj == self.equipped_item:
|
||||
self.equipped_item = None
|
||||
elif obj == self.equipped_armor:
|
||||
self.equipped_armor = None
|
||||
else:
|
||||
return super().remove_from_inventory(obj)
|
||||
|
||||
# noinspection PyTypeChecker,PyUnresolvedReferences
|
||||
def check_move(self, y: int, x: int, move_if_possible: bool = False) \
|
||||
-> bool:
|
||||
|
Reference in New Issue
Block a user