Browse Source

commit

master
enora 2 months ago
parent
commit
7b5639b95e
  1. 17
      personnageEnora.py

17
personnageEnora.py

@ -1,4 +1,5 @@
from random import randint from random import randint
class Personnage: class Personnage:
def __init__(self, nom, cat): def __init__(self, nom, cat):
self.nom = nom self.nom = nom
@ -87,6 +88,21 @@ def combat(j1, j2):
j1.affiche_caracteristiques() j1.affiche_caracteristiques()
j2.affiche_caracteristiques() j2.affiche_caracteristiques()
if defenseur.pdv - attaquant.pdv > 10 and attaquant.inventaire != []:
attaquant.affiche_inventaire()
print("Veux-tu utiliser quelque chose de ton inventaire? oui (1) non(2)")
bonus = int(input())
if bonus == 1:
print("Utiliser arme (1) ou potion (2)")
objet = int(input())
if objet == 1 :
defenseur.change_pdv(-7)
attaquant.inventaire.pop(0)
elif objet == 2:
attaquant.change_pdv(7)
attaquant.inventaire.pop()
x = 1 x = 1
while x == 1: while x == 1:
while j1.pdv > 0 and j2.pdv > 0: while j1.pdv > 0 and j2.pdv > 0:
@ -102,3 +118,4 @@ while x == 1:
defenseur.pdv = 20 defenseur.pdv = 20
print("rejouer? oui(1)/ non(0)") print("rejouer? oui(1)/ non(0)")
x = int(input()) x = int(input())
Loading…
Cancel
Save