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.

63 lines
1.6 KiB

from random import randint
class Personnage :
def __init__(self, nom, cat) :
self.nom = nom
self.pdv = 20
self.exp = 1
self.cat = cat
if self.cat == "guerrier":
self.inventaire = ["épée","potion"]
if self.cat == "magicien":
self.inventaire = ["bâton","potion"]
if self.cat == "voleur":
self.inventaire = ["dague","potion"]
if self.cat == "elfe":
self.inventaire = ["arc","potion"]
def jet_attaque(self):
"""revoie le jet d'attaque"""
lance = randit(1, 20)
if self.cat == "guerrier":
return lance + self.exp * 10
if self.cat == "magicien":
return lance + self.exp * 10
if self.cat == "voleur":
return lance + self.exp * 3
if self.cat == "elfe":
return lance + self.exp * 8
def jet_defence(self):
"""revoie le jet de défence"""
lance = randit(1, 20)
if self.cat == "guerrier":
return lance + self.exp * 8
if self.cat == "magicien":
return lance + self.exp * 7
if self.cat == "voleur":
return lance + self.exp * 9
if self.cat == "elfe":
return lance + self.exp * 10
def change_pdv(self):
pass
def change_exp(self):
pass
def affiche_carracteristiques(self):
print("nom perso , catégorie perso, points de vie perso, expérience perso")
def affiche_inventaire(self):
print
pass
def maf(x):
"""fait qqch"""
pass