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.
79 lines
2.0 KiB
79 lines
2.0 KiB
2 months ago
|
import random
|
||
|
|
||
|
class Personne:
|
||
|
def __init__(self, nom, cat):
|
||
|
self.__nom = nom
|
||
|
self.__xp = 1
|
||
|
self.__cat = cat
|
||
|
if self.__cat == 'guerrier':
|
||
|
self.__hp = 30
|
||
|
elif self.__cat == 'mage':
|
||
|
self.__hp =20
|
||
|
elif self.__cat == 'voleur':
|
||
|
self.__hp = 26
|
||
|
elif self.__cat == 'elfe':
|
||
|
self.__hp = 24
|
||
|
if cat == 'guerrier':
|
||
|
self.__inv = ['epee', 'potion']
|
||
|
elif cat == 'mage':
|
||
|
self.__inv = ['baton', 'potion']
|
||
|
elif cat == 'voleur':
|
||
|
self.__inv = ['dague', 'potion']
|
||
|
elif cat == 'elfe':
|
||
|
self.__inv = ['arc', 'potion']
|
||
|
if self.get_cat() == 'guerrier' or self.get_cat() == 'mage':
|
||
|
self.__coefAtq = 10
|
||
|
elif self.get_cat() == 'voleur':
|
||
|
self.__coefAtq = 3
|
||
|
elif self.get_cat() == 'elfe':
|
||
|
self.__coefAtq = 8
|
||
|
if self.get_cat() == 'guerrier':
|
||
|
self.__coefAtq = 8
|
||
|
if self.get_cat() == 'mage':
|
||
|
self.__coefDef = 7
|
||
|
elif self.get_cat() == 'voleur':
|
||
|
self.__coefDef = 9
|
||
|
elif self.get_cat() == 'elfe':
|
||
|
self.__coefDef = 10
|
||
|
|
||
|
def get_nom(self):
|
||
|
return self.__nom
|
||
|
|
||
|
def get_hp(self):
|
||
|
return self.__hp
|
||
|
|
||
|
def get_xp(self):
|
||
|
return self.__xp
|
||
|
|
||
|
def get_cat(self):
|
||
|
return self.__cat
|
||
|
|
||
|
def get_inv(self):
|
||
|
return self.__inv
|
||
|
|
||
|
def get_coef_atq(self):
|
||
|
return self.__coefAtq
|
||
|
|
||
|
def get_coef_def(self):
|
||
|
return self.__coefDef
|
||
|
|
||
|
def set_nom(self):
|
||
|
self.__nom = nom
|
||
|
|
||
|
def jet_attaque(self):
|
||
|
return random.randint(1, 20) + (self.get_xp()*self.get_coef_atq())
|
||
|
|
||
|
def jet_defense(self):
|
||
|
return random.randint(1, 20) + (self.get_xp()*self.get_coef_def())
|
||
|
|
||
|
def change_pdv():
|
||
|
pass
|
||
|
|
||
|
def change_exp():
|
||
|
pass
|
||
|
|
||
|
def affiche_caracteristiques():
|
||
|
pass
|
||
|
|
||
|
def affiche_inventaire():
|
||
|
pass
|