From 370d0ae4c4e6cf3f709636b467f6458113b06e37 Mon Sep 17 00:00:00 2001 From: manon Date: Tue, 10 Sep 2024 21:06:51 +0200 Subject: [PATCH] 3eme commit --- Mini projet nb1.py | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Mini projet nb1.py b/Mini projet nb1.py index b0b9982..6bafb67 100644 --- a/Mini projet nb1.py +++ b/Mini projet nb1.py @@ -7,7 +7,37 @@ class Personnage: self.pdv = pdv self.exp = exp 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): + 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 \ No newline at end of file