|
@ -7,29 +7,47 @@ class Personnage: |
|
|
self.exp = 1 |
|
|
self.exp = 1 |
|
|
self.cat = cat |
|
|
self.cat = cat |
|
|
if self.cat == "guerrier": |
|
|
if self.cat == "guerrier": |
|
|
inv = ["épée", "potion"] |
|
|
inv = ["epee", "potion"] |
|
|
elif self.cat == "magicien": |
|
|
elif self.cat == "magicien": |
|
|
inv = ["bâton", "potion"] |
|
|
inv = ["baton", "potion"] |
|
|
elif self.cat == "voleur": |
|
|
elif self.cat == "voleur": |
|
|
inv = ["dague", "potion"] |
|
|
inv = ["dague", "potion"] |
|
|
elif self.cat == "elfe": |
|
|
elif self.cat == "elfe": |
|
|
inv = ["arc", "potion"] |
|
|
inv = ["arc", "potion"] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def jet_attaque(self): |
|
|
def jet_attaque(self): |
|
|
attaque = randint (1,20) |
|
|
attaque = randint(1,20) |
|
|
|
|
|
if self.cat == "guerrier": |
|
|
|
|
|
attaque = attaque + self.exp*10 |
|
|
|
|
|
elif self.cat == "mage": |
|
|
|
|
|
attaque = attaque + self.exp*10 |
|
|
|
|
|
elif self.cat == "voleur": |
|
|
|
|
|
attaque = attaque + self.exp*3 |
|
|
|
|
|
elif self.cat == "elfe": |
|
|
|
|
|
attaque = attaque + self.exp*8 |
|
|
|
|
|
|
|
|
def jet_defense(self): |
|
|
def jet_defense(self): |
|
|
defense = randint (1,20) |
|
|
defense = randint(1,20) |
|
|
|
|
|
if self.cat == "guerrier": |
|
|
|
|
|
defense = defense + self.exp*10 |
|
|
|
|
|
elif self.cat == "mage": |
|
|
|
|
|
defense = defense + self.exp*10 |
|
|
|
|
|
elif self.cat == "voleur": |
|
|
|
|
|
defense = defense + self.exp*3 |
|
|
|
|
|
elif self.cat == "elfe": |
|
|
|
|
|
defense = defense + self.exp*8 |
|
|
|
|
|
|
|
|
def change_pdv(self, nb_pdv): |
|
|
def change_pdv(self, nb_pdv): |
|
|
pdv += nb_pdv |
|
|
pdv += nb_pdv |
|
|
|
|
|
|
|
|
def change_exp(self, nb_exp): |
|
|
def change_exp(self, nb_exp): |
|
|
exp += nb_exp |
|
|
exp += nb_exp |
|
|
def affiche_caracteristiques(self): |
|
|
|
|
|
|
|
|
def affiche_caracteristiques(self): #Permet d'afficher les caracteristiques de votre personnage |
|
|
print("Le nom de votre personnage est:", self.nom,".") |
|
|
print("Le nom de votre personnage est:", self.nom,".") |
|
|
print("Votre personnage est un(e):", self.cat,".") |
|
|
print("Votre personnage est un(e):", self.cat,".") |
|
|
print("Votre personnage possède", self.pdv, "points de vie.") |
|
|
print("Votre personnage possède", self.pdv, "points de vie.") |
|
|
print("Votre personnage possède", self.exp, "d'expérience.") |
|
|
print("Votre personnage possède", self.exp, "d'experience.") |
|
|
def affiche_inventaire(self): |
|
|
|
|
|
print("Inventaire de votre personnage:", self.inv) |
|
|
def affiche_inventaire(self): #Permet d'afficher l'inventaire du personnage |
|
|
|
|
|
print("Inventaire de votre personnage:", self.inv) |