|
|
@ -6,15 +6,18 @@ class Personnage: |
|
|
self.nom = nom |
|
|
self.nom = nom |
|
|
self.pdv = 20 |
|
|
self.pdv = 20 |
|
|
self.exp = 1 |
|
|
self.exp = 1 |
|
|
self.cat = cat |
|
|
|
|
|
|
|
|
|
|
|
if self.cat == 0: #0 = guerrier |
|
|
if cat.lower == "guerrier": |
|
|
|
|
|
self.cat = 0 |
|
|
self.inventaire = ["épée","potion"] |
|
|
self.inventaire = ["épée","potion"] |
|
|
elif self.cat == 1:#1 = magicien |
|
|
elif cat.lower == "magicien": |
|
|
|
|
|
self.cat = 1 |
|
|
self.inventaire = ["bâton","potion"] |
|
|
self.inventaire = ["bâton","potion"] |
|
|
elif self.cat == 2:#2 = voleur |
|
|
elif cat == "voleur": |
|
|
|
|
|
self.cat = 2 |
|
|
self.inventaire = ["dague","potion"] |
|
|
self.inventaire = ["dague","potion"] |
|
|
elif self.cat == 3:#3 = elfe |
|
|
elif cat == "elfe": |
|
|
|
|
|
self.cat = 3 |
|
|
self.inventaire = ["arc","potion"] |
|
|
self.inventaire = ["arc","potion"] |
|
|
|
|
|
|
|
|
def jet_attaque(self) -> int: |
|
|
def jet_attaque(self) -> int: |
|
|
@ -42,9 +45,9 @@ class Personnage: |
|
|
|
|
|
|
|
|
def main() -> None: |
|
|
def main() -> None: |
|
|
perso1 = Personnage(input("Comment s'appelle le personnage 1 ? "), |
|
|
perso1 = Personnage(input("Comment s'appelle le personnage 1 ? "), |
|
|
int(input("Dans quelle categorie est ce personnage ? "))) # rendre explicietetetttetetetetette |
|
|
int(input("Dans quelle categorie est ce personnage ? (guerrier,magicien,voleur,elfe)"))) |
|
|
perso2 = Personnage(input("Comment s'appelle le personnage 2 ? "), |
|
|
perso2 = Personnage(input("Comment s'appelle le personnage 2 ? "), |
|
|
int(input("Dans quelle categorie est ce personnage ? "))) # rendre explicietetetttetetetetette aussi (UI serait pratiaue) |
|
|
int(input("Dans quelle categorie est ce personnage ? (guerrier,magicien,voleur,elfe)"))) |
|
|
print() |
|
|
print() |
|
|
while perso1.pdv > 0 and perso2.pdv > 0: |
|
|
while perso1.pdv > 0 and perso2.pdv > 0: |
|
|
jetAttaque1 = perso1.jet_attaque() # tout ća pourrait etre une fonction quoi mais bon /shrug |
|
|
jetAttaque1 = perso1.jet_attaque() # tout ća pourrait etre une fonction quoi mais bon /shrug |
|
|
|