Jeu de rôle mini projet;
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.

37 lines
1.0 KiB

3 weeks ago
from random import randint
class Personnage:
def __init__ (self, nom, cat):
3 weeks ago
self.nom = nom
self.pdv = 20
self.exp = 1
3 weeks ago
self.cat = cat
self.inventaire = str()
if self.cat == "guerrier":
self.inventaire = str("épée et potion")
self.coefatk = 10
self.coefdef = 8
elif self.cat == "magicien":
self.inventaire = str("bâton et potion")
self.coefatk = 10
self.coefdef = 7
elif self.cat == "voleur":
self.inventaire = str("dague et potion")
self.coefatk = 3
self.coefdef = 9
elif self.cat == "elfe":
self.inventaire = str("arc et potion")
self.coefatk = 8
self.coefdef = 10
else:
raise ValueError ("La classe selectionné n'est pas disponible.")
3 weeks ago
def jet_attaque(self):
atkdé = randint(1, 20)
return self.exp * self.coefatk + atkdé
3 weeks ago
#