|
@ -13,14 +13,12 @@ class StatsSet: |
|
|
self.initiative = initiative |
|
|
self.initiative = initiative |
|
|
self.xpcoef = xpcoef |
|
|
self.xpcoef = xpcoef |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(17, 22, 9, 7, 9) |
|
|
ELFE = StatsSet(12, 30, 1, 5, 10) |
|
|
ELFE = StatsSet(12, 30, 1, 5, 10) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Personnage: |
|
|
class Personnage: |
|
|
def __init__(self, nom, class_type, place): |
|
|
def __init__(self, nom, class_type, place): |
|
|
self.nom = nom |
|
|
self.nom = nom |
|
@ -28,21 +26,22 @@ class Personnage: |
|
|
self.class_type = class_type.value |
|
|
self.class_type = class_type.value |
|
|
|
|
|
|
|
|
self.__hp = self.class_type.hp |
|
|
self.__hp = self.class_type.hp |
|
|
self.stats = StatsSet(0, 0, 0, 0, 0) |
|
|
|
|
|
self.__xp = 1 |
|
|
self.__xp = 1 |
|
|
|
|
|
|
|
|
|
|
|
self.potions = [Item(Material.POTION, 10)] |
|
|
|
|
|
self.arme = Item(Material.EPEE, StatsSet(5, 5, 5, 5, 0)) |
|
|
|
|
|
|
|
|
Sprite(3, self.class_name, place) |
|
|
Sprite(3, self.class_name, place) |
|
|
#self.inventaire = |
|
|
|
|
|
|
|
|
|
|
|
def jet_attaque(self): |
|
|
def jet_attaque(self): |
|
|
damage = randint(1, 20) |
|
|
damage = randint(1, 20) |
|
|
self.change_exp(self.class_type.xpcoef * self.__xp) |
|
|
self.change_exp(self.class_type.xpcoef * self.__xp) |
|
|
return damage + self.class_type.initiative + self.stats.initiative |
|
|
return damage + self.class_type.initiative + self.arme.stats.initiative |
|
|
|
|
|
|
|
|
def jet_defense(self): |
|
|
def jet_defense(self): |
|
|
damage = randint(1, 20) |
|
|
damage = randint(1, 20) |
|
|
self.change_exp(self.class_type.xpcoef * self.__xp) |
|
|
self.change_exp(self.class_type.xpcoef * self.__xp) |
|
|
return damage + self.class_type.initiative + self.stats.initiative |
|
|
return damage + self.class_type.initiative + self.arme.stats.initiative |
|
|
|
|
|
|
|
|
def get_hp(self): |
|
|
def get_hp(self): |
|
|
return self.__hp |
|
|
return self.__hp |
|
@ -66,15 +65,34 @@ class Personnage: |
|
|
f"Vie: {self.__hp}", |
|
|
f"Vie: {self.__hp}", |
|
|
f"Expérience: {self.__xp}", |
|
|
f"Expérience: {self.__xp}", |
|
|
"Stats (classe + inventaire):", |
|
|
"Stats (classe + inventaire):", |
|
|
f"- HP: {self.class_type.hp} + {self.stats.hp}", |
|
|
f"- HP: {self.class_type.hp} + {self.arme.stats.hp}", |
|
|
f"- ATK%: {self.class_type.atkP} + {self.stats.atkP}", |
|
|
f"- ATK%: {self.class_type.atkP} + {self.arme.stats.atkP}", |
|
|
f"- DEF%: {self.class_type.defP} + {self.stats.defP}", |
|
|
f"- DEF%: {self.class_type.defP} + {self.arme.stats.defP}", |
|
|
f"- INITIATIVE: {self.class_type.initiative} + {self.stats.initiative}", |
|
|
f"- INITIATIVE: {self.class_type.initiative} + {self.arme.stats.initiative}", |
|
|
f"- XPCOEF: {self.class_type.xpcoef} + {self.stats.xpcoef}" |
|
|
f"- XPCOEF: {self.class_type.xpcoef} + {self.arme.stats.xpcoef}" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
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}", |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Item(): |
|
|
|
|
|
def __init__(self, material, stats: int | StatsSet, meta=None): |
|
|
|
|
|
self.material = material |
|
|
|
|
|
self.meta = material.value if meta == None else meta |
|
|
|
|
|
self.stats = stats |
|
|
|
|
|
|
|
|
|
|
|
class ItemMeta: |
|
|
|
|
|
def __init__(self, name, description): |
|
|
|
|
|
self.name = name |
|
|
|
|
|
self.description = description |
|
|
|
|
|
|
|
|
|
|
|
class Material(Enum): |
|
|
|
|
|
POTION = ItemMeta("Potion", "TODO") |
|
|
|
|
|
EPEE = ItemMeta("Épée", "TODO") |
|
|
|
|
|
BATON = ItemMeta("Bâton", "TODO") |
|
|
|
|
|
DAGUE = ItemMeta("Dague", "TODO") |
|
|
|
|
|
ARC = ItemMeta("Arc", "TODO") |
|
|