diff --git a/monstre.py b/monstre.py new file mode 100644 index 0000000..516047b --- /dev/null +++ b/monstre.py @@ -0,0 +1,51 @@ +# Importation +import random as rd +# Déclaration des CONSTANTES + +# Déclaration Classes +class Monstre : + + def __init__(self, nom, dsc, img=None, obj=None) -> None: + self.nom = nom + self.dsc = dsc + self.img = img + self.obj = obj + self.habilite = rd.randint(1,10) + self.endurance = 5 + self.force = 2 + self.courage = rd.randint(1,10) + + if "Squelette" in self.nom: + self.habilite = rd.randint(1,10) + self.endurance = rd.randint(1,10) + self.force = rd.randint(1,2) + self.courage = rd.randint(1,10) + + + def get_description(self:'Monstre') -> str: + return self.dsc + + def get_carac(self:'Montres') -> str: + return f"{self.nom} H{self.habilite} E{self.endurance} F{self.force} C{self.courage}" + + def est_hs(self:'Monstre') -> bool: + if self.endurance <= 0: + return True + else: + return False + + + + + + + + + + + + +# Déclaration de Fonctions + + +# Le corps du module en lui-même \ No newline at end of file