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.
24 lines
851 B
24 lines
851 B
from random import randint
|
|
|
|
class Personnage:
|
|
def __init__(self,nom : str,cat : int) -> None:
|
|
self.nom = nom
|
|
self.pdv = 20
|
|
self.exp = 1
|
|
self.cat = cat - 1
|
|
|
|
if self.cat == "0": #0 = guerrier
|
|
self.inventaire = ["épée","potion"]
|
|
elif self.cat == "1":#1 = magicien
|
|
self.inventaire = ["bâton","potion"]
|
|
elif self.cat == "2":#2 = voleur
|
|
self.inventaire = ["dague","potion"]
|
|
elif self.cat == "3":#3 = elfe
|
|
self.inventaire = ["arc","potion"]
|
|
|
|
def jet_attaque(self) -> int:
|
|
degatsAttaque = [10,10,3,8] #guerrier,magicien,voleur,elfe
|
|
return randint(1,20) + self.exp*degatsAttaque[self.cat]
|
|
def jet_defense(self) -> int:
|
|
degatsDefense = [8,7,9,10]
|
|
return randint(1,20) + self.exp*degatsDefense[self.cat]
|