Browse Source

quelques modifs

master
julien 4 weeks ago
parent
commit
b571085ec1
  1. 13
      projet poo.py

13
projet poo.py

@ -64,7 +64,7 @@ def combat() :
elif degats > defense : elif degats > defense :
perte_pv = randint(-8,-1) perte_pv = randint(-8,-1)
perso2.change_pv(perte_pv) perso2.change_pv(perte_pv)
print(f"{perso1.nom} inflige {abs(perte_pv)} dégâts à {perso2.nom}") print(f"{perso1.nom} inflige {abs(perte_pv)} dégâts d'attaque à {perso2.nom}")
print() print()
elif degats < defense : elif degats < defense :
perte_pv = randint(-4,-1) perte_pv = randint(-4,-1)
@ -78,7 +78,7 @@ def combat() :
elif degats > defense : elif degats > defense :
perte_pv = randint(-8,-1) perte_pv = randint(-8,-1)
perso1.change_pv(perte_pv) perso1.change_pv(perte_pv)
print(f"{perso2.nom} inflige {abs(perte_pv)} dégâts à {perso1.nom}") print(f"{perso2.nom} inflige {abs(perte_pv)} dégâts d'attaque à {perso1.nom}")
print() print()
elif degats < defense : elif degats < defense :
perte_pv = randint(-4,-1) perte_pv = randint(-4,-1)
@ -89,6 +89,15 @@ def combat() :
print() print()
perso2.affiche_caracteristiques() perso2.affiche_caracteristiques()
print() print()
if perso1.pv == 0 :
print("le combat est terminé")
print(f"{perso2.nom} a triomphé de {perso1.nom}")
perso2.change_exp(1)
elif perso2.pv == 0 :
print("le combat est terminé")
print(f"{perso1.nom} a triomphé de {perso2.nom}")
perso1.change_exp(1)
else :
print("appuyer sur entrer pour continuer") print("appuyer sur entrer pour continuer")
input() input()

Loading…
Cancel
Save