diff --git a/game.py b/game.py index 1f2c116..f05e1cb 100644 --- a/game.py +++ b/game.py @@ -24,6 +24,13 @@ class Unit(ABC): class Monster(Unit): + def __init__(self, strength, dexterity, constitution, wisdom, intelligence, charisma): + super().__init__(strength, dexterity, constitution, wisdom, intelligence, charisma) + self.max_health = self.calculate_max_health() + self.defense = self.calculate_max_health() + self.damage = self.calculate_damage() + + @override def calculate_damage(self): return self.strength * 2 + self.constitution / 5 @@ -37,6 +44,13 @@ class Monster(Unit): return self.constitution * 1.2 + self.strength / 5 class Character(Unit): + def __init__(self, strength, dexterity, constitution, wisdom, intelligence, charisma): + super().__init__(strength, dexterity, constitution, wisdom, intelligence, charisma) + # self.character_class = char_class + self.max_health = self.calculate_max_health() + self.defense = self.calculate_max_health() + self.damage = self.calculate_damage() + @override def calculate_max_health(self): return self.constitution * 10 + self.strength / 2