From 297823d0748eec125ade366304c6b51770558007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?RAVET=20C=C3=A9lya?= Date: Mon, 14 Sep 2026 09:02:22 +0200 Subject: [PATCH] jet attaque fini --- projet_jdr.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/projet_jdr.py b/projet_jdr.py index b09a47c..29f49f9 100644 --- a/projet_jdr.py +++ b/projet_jdr.py @@ -15,9 +15,16 @@ class Personnage : elif self.cat == 'elfe': self.inventaire = ['arc','potion'] -# def jet_attaque (self): -# print (random.randint(1,20)) - - def affiche (self) : - print (" je m'appelle" , self.nom , "j'ai", self.pdv "pdv") + def jet_attaque (self): + lanceA = random.randint(1,20) + if self.cat =='guerrier' or self.cat =='magicien': + jet_att = lanceA + self.exp* 10 + elif self.cat =='voleur': + jet_att = lanceA + self.exp * 3 + elif self.cat =='elfe': + jet_att = lanceA + self.exp * 8 + + + +