You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

3 weeks ago
from random import randint
class Personnage:
3 weeks ago
def __init__(self, nom, pdv, exp, cat):
pdv = 20
exp = 1
self.nom = nom
self.pdv = pdv
self.exp = exp
self.cat = cat
3 weeks ago
if self.cat == "guerrier"
self.inventaire = ["épée","potion"]
self.coef_at = 10
self.coef_def = 8
elif self.cat == "magicien"
self.inventaire = ["baton","potion"]
self.coef_at = 10
self.coef_def = 7
elif self.cat == "voleur"
self.inventaire = ["dague","potion"]
self.coef_at = 3
self.coef_def = 9
elif self.cat == "elfe"
self.inventaire = ["arc","potion"]
self.coef_at = 8
self.coef_def = 10
3 weeks ago
def jet_attaque (self):
3 weeks ago
lancer_dés = random [1,20]
attaque = lancer_dés + self.coef_at * self.exp
return attaque
def jet_defence (self):
lancer_dés = random [1,20]
defence = lancer_dés + self.esp * self.coef_def
return defence
def change_pdv (self):
nb_pdv
3 weeks ago