From 4b01f3fb970b0d665de58d7c32d96e3e53c9acf2 Mon Sep 17 00:00:00 2001 From: "marvyn.meunier" Date: Wed, 13 Sep 2023 11:48:06 +0200 Subject: [PATCH] =?UTF-8?q?class=20personnage=20ajout=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jdr.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/jdr.py b/jdr.py index f88c1a3..591dc5e 100644 --- a/jdr.py +++ b/jdr.py @@ -1,6 +1,25 @@ class Personnage : - def __init__(self,nom,pdv,exp,cat,inventaire) + def __init__(self,nom,pdv,exp,cat,inventaire,coef) self.nom = nom - self.pdv = pdv - self.exp = exp - self.cat = cat \ No newline at end of file + self.pdv = 20 + self.exp = 1 + self.cat = cat + self.coef = 0 + self.inventaire = [] + if self.cat == "voleur" + self.inventaire = ["sac en toile" , "dague" ] + self.pdv = 25 + self.coef = 3 + if self.cat == "sorciere" + self.inventaire = ["pĂ´tion poison" , "baguette" ] + self.pdv = 30 + self.coef = 10 + if self.cat == "chasseur" + self.inventaire = ["epee" , "bouclie" , " fusarbalette "] + self.pdv = 40 + self.coef = 10 + if self.cat == "mage" + self.inventaire = ["potion de soin" , "baton" ] + self.pdv = 10 + self.coef = 5 + def jet_attaque(self): \ No newline at end of file