Browse Source

3eme commit

master
manon 2 months ago
parent
commit
370d0ae4c4
  1. 32
      Mini projet nb1.py

32
Mini projet nb1.py

@ -7,7 +7,37 @@ class Personnage:
self.pdv = pdv self.pdv = pdv
self.exp = exp self.exp = exp
self.cat = cat self.cat = cat
self.inventaire = []
if self.cat == "guerrier"
self.inventaire = ["épée","potion"]
self.coef_at = 10
self.coef_def = 8
elif self.cat == "magicien"
self.inventaire = ["baton","potion"]
self.coef_at = 10
self.coef_def = 7
elif self.cat == "voleur"
self.inventaire = ["dague","potion"]
self.coef_at = 3
self.coef_def = 9
elif self.cat == "elfe"
self.inventaire = ["arc","potion"]
self.coef_at = 8
self.coef_def = 10
def jet_attaque (self): def jet_attaque (self):
lancer_dés = random [1,20]
attaque = lancer_dés + self.coef_at * self.exp
return attaque
def jet_defence (self):
lancer_dés = random [1,20]
defence = lancer_dés + self.esp * self.coef_def
return defence
def change_pdv (self):
nb_pdv
Loading…
Cancel
Save