From e6564c7c50646975bd1a6857448ea5d97bdb0373 Mon Sep 17 00:00:00 2001 From: "Dorian.D" Date: Thu, 16 Nov 2023 16:02:08 +0100 Subject: [PATCH] Upload files to 'parties' --- parties/personnage + modifier_endurance.py | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 parties/personnage + modifier_endurance.py diff --git a/parties/personnage + modifier_endurance.py b/parties/personnage + modifier_endurance.py new file mode 100644 index 0000000..40d8174 --- /dev/null +++ b/parties/personnage + modifier_endurance.py @@ -0,0 +1,43 @@ +import random as rd + +class Personnage: + + def __init__(self, nom='Aucun'): + + self.nom = nom + + self.habilite = 5 + rd.randint(1,4) + self.endurance_max = 7 + rd.randint(1,8) + self.endurance = self.endurance_max + self.force = 2 + self.charisme = rd.randint(1,10) + self.vigilance = rd.randint(1,10) + self.discretion = False + self.lieu = None + self.lieu_precedents = [] + self.objet = None + + def modifier_endurance(self:'Personnage', modificateur): + endurance_modifie = self.endurance + modificateur + if endurance_modifie < 0: + self.endurance = 0 + elif endurance_modifie > self.endurance_max: + self.endurance = self.endurance_max + else: + self.endurance = endurance_modifie + + def subir_degats(self:'Personnage', degats:int) -> None: + if degats > 0: + self.modifier_endurance(-degats) + + def est_hs(self:'Personnage') -> bool : + if self.endurance == 0: + return False + else: + return True + + def get_carac(self:'Personnage') -> str: + + + +h = Personnage("Alice") \ No newline at end of file