|
|
@ -1,6 +1,6 @@ |
|
|
|
from random import randint |
|
|
|
class Presonnage: |
|
|
|
def __init__(self,nom,cat) |
|
|
|
def __init__ (self,nom,cat): |
|
|
|
self.nom = nom |
|
|
|
self.pdv = 20 |
|
|
|
self.exp = 1 |
|
|
@ -16,21 +16,34 @@ class Presonnage: |
|
|
|
|
|
|
|
def jet_attaque (self): |
|
|
|
if self.cat == "guerrier": |
|
|
|
return = randint(1,20) + self.exp*10 |
|
|
|
return randint (1,20) + self.exp* 10 |
|
|
|
if self.cat == "magicien": |
|
|
|
return = randint(1,20) + self.exp*10 |
|
|
|
return randint (1,20) + self.exp* 10 |
|
|
|
if self.cat == "voleur": |
|
|
|
return = randint(1,20) + self.exp*3 |
|
|
|
return randint (1,20) + self.exp* 3 |
|
|
|
if self.cat == "elfe": |
|
|
|
return = randint(1,20) + self.exp*8 |
|
|
|
return randint (1,20) + self.exp* 8 |
|
|
|
|
|
|
|
def jet_defense (self): |
|
|
|
if self.cat == "guerrier": |
|
|
|
return = randint(1,20) + self.exp*8 |
|
|
|
return randint(1,20) + self.exp* 8 |
|
|
|
if self.cat == "magicien": |
|
|
|
return = randint(1,20) + self.exp*7 |
|
|
|
return randint(1,20) + self.exp* 7 |
|
|
|
if self.cat == "voleur": |
|
|
|
return = randint(1,20) + self.exp*9 |
|
|
|
return randint(1,20) + self.exp* 9 |
|
|
|
if self.cat == "elfe": |
|
|
|
return = randint(1,20) + self.exp*10 |
|
|
|
return randint(1,20) + self.exp* 10 |
|
|
|
|
|
|
|
def change_pdv (self,nb_pdv): |
|
|
|
return nb_pdv + self.pdv |
|
|
|
|
|
|
|
def change_exp (self,nb_exp): |
|
|
|
return nb_pdv + self.pdv |
|
|
|
|
|
|
|
def affiche_caracteristiques (self): |
|
|
|
print ("ton nom es",self.nom,"tu es un(e)",self.cat,"tu as",self.pdv,"pv","et",self.exp,"exp") |
|
|
|
|
|
|
|
def affiche_inventaire (self): |
|
|
|
print (self.inventaire) |
|
|
|
|
|
|
|
|