diff --git a/miniprojet.py b/miniprojet.py index 34a0fc0..cb13861 100644 --- a/miniprojet.py +++ b/miniprojet.py @@ -1,12 +1,37 @@ from random import randint class Personnage: - def __init__ (self, nom, pdv, exp, cat): + def __init__ (self, nom, cat): self.nom = nom - self.pdv = pdv - self.exp = exp + self.pdv = 20 + self.exp = 1 self.cat = cat - self.inventaire = + self.inventaire = str() + + if self.cat == "guerrier": + self.inventaire = str("épée et potion") + self.coefatk = 10 + self.coefdef = 8 + + elif self.cat == "magicien": + self.inventaire = str("bâton et potion") + self.coefatk = 10 + self.coefdef = 7 + + elif self.cat == "voleur": + self.inventaire = str("dague et potion") + self.coefatk = 3 + self.coefdef = 9 + + elif self.cat == "elfe": + self.inventaire = str("arc et potion") + self.coefatk = 8 + self.coefdef = 10 + + else: + raise ValueError ("La classe selectionné n'est pas disponible.") def jet_attaque(self): + atkdé = randint(1, 20) + return self.exp * self.coefatk + atkdé - \ No newline at end of file +# \ No newline at end of file