patch de l'invetaire

This commit is contained in:
barraux.a
2022-09-21 11:23:28 +02:00
parent ff01ebff66
commit 1649aaffb0
+6 -5
View File
@@ -245,7 +245,7 @@ class App:
gui.draw('Eau de vie', 30*x+10, 17*y+2, color=color_fill) gui.draw('Eau de vie', 30*x+10, 17*y+2, color=color_fill)
for i in range(len(self.potion_shape)): for i in range(len(self.potion_shape)):
gui.draw(self.potion_shape[i], 30*x+6, 17*y+3+i, color=color_fill) gui.draw(self.potion_shape[i], 30*x+6, 17*y+3+i, color=color_fill)
gui.display() gui.display()
def combat(self, ennemi): def combat(self, ennemi):
"""Simule l'attaque des joeurs""" """Simule l'attaque des joeurs"""
@@ -345,10 +345,11 @@ class App:
if position[0] > 0: if position[0] > 0:
position[0] -= 1 position[0] -= 1
elif key == getkey.keys.ENTER: elif key == getkey.keys.ENTER:
self.character.pdv += round((self.character.max_pdv - self.character.pdv) * 0.5) if self.character.inv.count('potion') > 0:
if self.character.pdv > self.character.max_pdv: self.character.pdv += round((self.character.max_pdv - self.character.pdv) * 0.5)
self.character.pdv = self.character.max_pdv if self.character.pdv > self.character.max_pdv:
self.character.inv.remove('potion') self.character.pdv = self.character.max_pdv
self.character.inv.remove('potion')
elif key == getkey.keys.ESCAPE: elif key == getkey.keys.ESCAPE:
break break
if choice == 2: if choice == 2: