예제 #1
0
 def attack(self):
     """Словарь с атаками бойца
     :rtype : dict
     :return: Словарик, ключами которого являются типы атаки(лед, огонь, яд...),
     а значениями кортежи вида (атака, верная атака)
     """
     result = {}
     for attack_type in data.attack_types:
         result[attack_type] = tuples_sum(
             [data.get_modifier(mod).attack[1]
              for mod in self.modifiers()
              if data.get_modifier(mod).attack[0] == attack_type]
         )
     return result
예제 #2
0
 def protection(self):
     """
     :rtype : dict
     :return: Словарь, ключами которого являются типы защиты,
     а значениями - кортежи вида (защита, верная защита).
     """
     result = dict()
     for protect_type in data.protection_types:
         result[protect_type] = tuples_sum(
             [data.get_modifier(mod).protection[1]
              for mod in self.modifiers()
              if data.get_modifier(mod).protection[0] == protect_type]
         )
     return result
예제 #3
0
 def attack(self):
     """Словарь с атаками бойца
     :rtype : dict
     :return: Словарик, ключами которого являются типы атаки(лед, огонь, яд...),
     а значениями кортежи вида (атака, верная атака)
     """
     result = {}
     for attack_type in data.attack_types:
         result[attack_type] = tuples_sum(
             [
                 data.get_modifier(mod).attack[1]
                 for mod in self.modifiers()
                 if data.get_modifier(mod).attack[0] == attack_type
             ]
         )
     return result
예제 #4
0
 def protection(self):
     """
     :rtype : dict
     :return: Словарь, ключами которого являются типы защиты,
     а значениями - кортежи вида (защита, верная защита).
     """
     result = dict()
     for protect_type in data.protection_types:
         result[protect_type] = tuples_sum(
             [
                 data.get_modifier(mod).protection[1]
                 for mod in self.modifiers()
                 if data.get_modifier(mod).protection[0] == protect_type
             ]
         )
     return result
예제 #5
0
 def fear(self):
     """
     :return: Значение чудовищности(целое число)
     """
     return sum([get_modifier(mod).fear for mod in self.modifiers()])
예제 #6
0
 def magic(self):
     """
     :return: Магическая сила(целое число)
     """
     return sum([get_modifier(mod).magic for mod in self.modifiers()])
예제 #7
0
 def max_energy(self):
     """
     :return: Максимальная энергия(целое число)
     """
     return self._base_energy + sum(
         [get_modifier(mod).max_energy for mod in self.modifiers()])
예제 #8
0
 def fear(self):
     """
     :return: Значение чудовищности(целое число)
     """
     return sum([get_modifier(mod).fear for mod in self.modifiers()])
예제 #9
0
 def magic(self):
     """
     :return: Магическая сила(целое число)
     """
     return sum([get_modifier(mod).magic for mod in self.modifiers()])
예제 #10
0
 def max_energy(self):
     """
     :return: Максимальная энергия(целое число)
     """
     return self._base_energy + sum([get_modifier(mod).max_energy for mod in self.modifiers()])