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.
|
|
|
from random import randint
|
|
|
|
class Personnage:
|
|
|
|
def __init__(self, nom, pdv, exp, cat):
|
|
|
|
pdv = 20
|
|
|
|
exp = 1
|
|
|
|
self.nom = nom
|
|
|
|
self.pdv = pdv
|
|
|
|
self.exp = exp
|
|
|
|
self.cat = cat
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
def jet_attaque (self):
|
|
|
|
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
|
|
|
|
|