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
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
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
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