Browse Source

annotation a ajouter

master
RAVET Célya 4 weeks ago
parent
commit
97ea12d03c
  1. 22
      projet_jdr.py

22
projet_jdr.py

@ -27,20 +27,26 @@ class Personnage :
def jet_defense (self):
lanceD = random.randint(1,20)
if self.cat == 'guerrier':
return lanceD + self.exp* 8
return lanceD + self.exp * 8
elif self.cat == 'magicien':
return lanceD + self.exp* 7
return lanceD + self.exp * 7
elif self.cat == 'voleur':
return lanceD + self.exp* 9
elif self.cat == 'elf':
return lanceD + self.exp* 10
return lanceD + self.exp * 9
elif self.cat == 'elfe':
return lanceD + self.exp * 10
def change_pdv (self, nb_pdv):
self.pdv = self.pdv + nb_pdv
def change_exp (self, nb_exp):
self.exp = self.exp + nb_exp
def affiche_caracteristique (self):
print("je m'appelle",self.nom,"je suis un",
self.cat ,"j'ai",self.pdv, "point de vie et j'ai",
self.exp,
"niveau d'experience")
def affiche_inventaire (self):
print(" dans mon inventaire j'ai", self.inventaire)
Loading…
Cancel
Save