|
@ -16,8 +16,8 @@ class StatsSet: |
|
|
class ClassType(Enum): |
|
|
class ClassType(Enum): |
|
|
GUERRIER = StatsSet(20, 10, 15, 5, 8) |
|
|
GUERRIER = StatsSet(20, 10, 15, 5, 8) |
|
|
MAGICIEN = StatsSet(15, 15, 6, 5, 7) |
|
|
MAGICIEN = StatsSet(15, 15, 6, 5, 7) |
|
|
VOLEUR = StatsSet(17, 22, 9, 7, 9) |
|
|
VOLEUR = StatsSet(9, 30, 9, 7, 9) |
|
|
ELFE = StatsSet(12, 30, 1, 5, 10) |
|
|
ELFE = StatsSet(13, 22, 1, 5, 10) |
|
|
|
|
|
|
|
|
class Personnage: |
|
|
class Personnage: |
|
|
def __init__(self, nom, class_type, place): |
|
|
def __init__(self, nom, class_type, place): |
|
@ -25,11 +25,12 @@ class Personnage: |
|
|
self.class_name = class_type.name |
|
|
self.class_name = class_type.name |
|
|
self.class_type = class_type.value |
|
|
self.class_type = class_type.value |
|
|
|
|
|
|
|
|
self.__hp = self.class_type.hp |
|
|
|
|
|
self.__xp = 1 |
|
|
self.__xp = 1 |
|
|
|
|
|
|
|
|
self.potions = [Item(Material.POTION, 10)] |
|
|
self.potions = [Item(Material.POTION, 10)] |
|
|
self.arme = Item(Material.EPEE, StatsSet(5, 5, 5, 5, 0)) |
|
|
self.arme = Item(*ClassItem[self.class_name].value) |
|
|
|
|
|
|
|
|
|
|
|
self.__hp = self.class_type.hp + self.arme.stats.hp |
|
|
|
|
|
|
|
|
Sprite(3, self.class_name, place) |
|
|
Sprite(3, self.class_name, place) |
|
|
|
|
|
|
|
@ -48,6 +49,8 @@ class Personnage: |
|
|
def change_hp(self, nb_hp): |
|
|
def change_hp(self, nb_hp): |
|
|
if self.__hp - nb_hp < 0: |
|
|
if self.__hp - nb_hp < 0: |
|
|
self.__hp = 0 |
|
|
self.__hp = 0 |
|
|
|
|
|
elif self.__hp - nb_hp > self.class_type.hp + self.arme.stats.hp: |
|
|
|
|
|
self.__hp = self.class_type.hp + self.arme.stats.hp |
|
|
else: |
|
|
else: |
|
|
self.__hp -= nb_hp |
|
|
self.__hp -= nb_hp |
|
|
|
|
|
|
|
@ -75,7 +78,7 @@ class Personnage: |
|
|
def reduced_stats(self): |
|
|
def reduced_stats(self): |
|
|
return(f"Ennemi: {self.nom}", |
|
|
return(f"Ennemi: {self.nom}", |
|
|
f"Type: {self.class_name}", |
|
|
f"Type: {self.class_name}", |
|
|
f"Vie: {self.__hp}", |
|
|
f"Vie: {self.__hp}" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -96,3 +99,10 @@ class Material(Enum): |
|
|
BATON = ItemMeta("Bâton", "TODO") |
|
|
BATON = ItemMeta("Bâton", "TODO") |
|
|
DAGUE = ItemMeta("Dague", "TODO") |
|
|
DAGUE = ItemMeta("Dague", "TODO") |
|
|
ARC = ItemMeta("Arc", "TODO") |
|
|
ARC = ItemMeta("Arc", "TODO") |
|
|
|
|
|
|
|
|
|
|
|
class ClassItem(Enum): |
|
|
|
|
|
#HP, ATK, DEF, INITIATIVE, XPCOEF |
|
|
|
|
|
GUERRIER = (Material.EPEE, StatsSet(3, 5, 2, 6, 0)) |
|
|
|
|
|
MAGICIEN = (Material.BATON, StatsSet(8, 1, 2, 3, 0)) |
|
|
|
|
|
VOLEUR = (Material.DAGUE, StatsSet(1, 9, 1, 1, 0)) |
|
|
|
|
|
ELFE = (Material.ARC, StatsSet(4, 2, 5, 3, 0)) |