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.
51 lines
1.2 KiB
51 lines
1.2 KiB
# 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 |