|
@ -5,15 +5,49 @@ class Personnage: |
|
|
self.pdv = 20 |
|
|
self.pdv = 20 |
|
|
self.exp = 1 |
|
|
self.exp = 1 |
|
|
self.cat = cat |
|
|
self.cat = cat |
|
|
if self.cat == "guerrier": |
|
|
|
|
|
self.inventaire = ["epee"] |
|
|
self.switcher_obj = { |
|
|
if self.cat == "magicien": |
|
|
"guerrier" : "épée", |
|
|
self.inventaire = ["baton"] |
|
|
"magicien" : "bâton", |
|
|
if self.cat == "voleur": |
|
|
"voleur" : "dague", |
|
|
self.inventaire = ["dague"] |
|
|
"elfe" : "arc", |
|
|
if self.cat == "elfe": |
|
|
} |
|
|
self.inventaire = ["arc"] |
|
|
self.inventaire = [self.switcher_obj.get(self.cat)] |
|
|
self.inventaire.append("potion") |
|
|
self.inventaire.append("potion") |
|
|
|
|
|
|
|
|
def jet_attaque(self): |
|
|
def jet_attaque(self): |
|
|
"""renvoie le jet d'atttaque""" |
|
|
"""renvoie le jet d'attaque""" |
|
|
|
|
|
dé = randint(1,20) |
|
|
|
|
|
self.switcher_classe = { |
|
|
|
|
|
"guerrier" : 10, |
|
|
|
|
|
"magicien" : 10, |
|
|
|
|
|
"voleur" : 3, |
|
|
|
|
|
"elfe" : 8, |
|
|
|
|
|
} |
|
|
|
|
|
self.classe = self.switcher_classe.get(self.cat) |
|
|
|
|
|
return dé + self.exp * self.classe |
|
|
|
|
|
|
|
|
|
|
|
def jet_defense(self): |
|
|
|
|
|
"""renvoie le jet de défense""" |
|
|
|
|
|
dé = randint(1,20) |
|
|
|
|
|
self.switcher_classe = { |
|
|
|
|
|
"guerrier" : 8, |
|
|
|
|
|
"magicien" : 7, |
|
|
|
|
|
"voleur" : 3, |
|
|
|
|
|
"elfe" : 8, |
|
|
|
|
|
} |
|
|
|
|
|
self.classe = self.switcher_classe.get(self.cat) |
|
|
|
|
|
return dé + self.exp * self.classe |
|
|
|
|
|
|
|
|
|
|
|
def change_pdv(self, nb_pdv): |
|
|
|
|
|
self.pdv += nb_pdv |
|
|
|
|
|
|
|
|
|
|
|
def change_exp(self, nb_exp): |
|
|
|
|
|
self.exp += nb_exp |
|
|
|
|
|
|
|
|
|
|
|
def affiche_caracteristiques(self): |
|
|
|
|
|
"""affiche les caractéristiques du personnage""" |
|
|
|
|
|
pass |
|
|
|
|
|
def affiche_inventaire(self): |
|
|
|
|
|
"""affiche l'inventaire du personnage""" |
|
|
pass |
|
|
pass |
|
|