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.
50 lines
1.4 KiB
50 lines
1.4 KiB
class Personnage:
|
|
def __init__(self):
|
|
self.__nom = input("entrez votre nom")
|
|
self.pdv = 20
|
|
self.exp = 1
|
|
self.cat = choisir_categorie
|
|
self.inventaire = []
|
|
|
|
|
|
def choisir_categorie(self):
|
|
print("\nChoisissez une catégorie de personnage:")
|
|
print("1. Guerrier")
|
|
print("2. Mage")
|
|
print("3. Voleur")
|
|
print("4. Elfe")
|
|
|
|
choix = input("Entrez le numéro de votre choix: ")
|
|
|
|
if choix == "1":
|
|
self.cat = "Guerrier"
|
|
self.inventaire.append("Épée")
|
|
self.inventaire.append("Potion")
|
|
elif choix == "2":
|
|
self.cat = "Mage"
|
|
self.inventaire.append("Bâton")
|
|
self.inventaire.append("Potion")
|
|
elif choix == "3":
|
|
self.cat = "Voleur"
|
|
self.inventaire.append("Dague")
|
|
self.inventaire.append("Potion")
|
|
elif choix == "4":
|
|
self.cat = "Elfe"
|
|
self.inventaire.append("Arc")
|
|
self.inventaire.append("Potion")
|
|
|
|
else:
|
|
print("Choix invalide, réessayez.")
|
|
return self.choisir_categorie()
|
|
|
|
|
|
|
|
|
|
|
|
### def jet_attaque(self):
|
|
|
|
# def jet_defense(self):
|
|
# def change_pdv(self):
|
|
# def change_exp(self):
|
|
# def affiche_caracteristiques(self):
|
|
#def affiche_inventaire(self):
|