+ # drinking health potion in inventory
+ elif event.key == ord ("h") or event.key == ord ("H"):
+ self.inventory_drink_health_potion ()
+ # quit the game
+ elif event.key == ord ("q") or event.key == ord ("Q"):
+ sys.exit (0)
+
+ # drink a health potion if it is in the player's inventory
+ def inventory_drink_health_potion (self):
+ # if health is maxed out then ignore
+ if self.butaba.health == butaba.Butaba.MAXHEALTH:
+ self.status_message = "You already have maximum health."
+ else:
+ # look for a health potion
+ for item in self.butaba.inventory:
+ if isinstance (item, gameobjects.HealthPotion) is True:
+ self.use_object (item)
+ break