def _create_knight(self, knight_level=None): """ Создание рыцаря. """ # Если уровень рыцаря не указан, то идет стандартная проверка на появление. if knight_level is None and random.choice(range(1, 5 + (self.dragon.reputation.level + 1), 1)) in \ range(self.dragon.reputation.level + 1): knight_level = Knight.start_level(self.dragon.reputation.level) if knight_level > 0: self.knight = Knight(level=knight_level, game_ref=self) else: self.knight = None
def _create_knight(self, knight_level=None): """ Create knight. """ # If knight's level is not specified, then it is a standart test on knight appearance. if knight_level is None and random.choice(range(1, 5 + (self.dragon.reputation.level + 1), 1)) in \ range(self.dragon.reputation.level + 1): knight_level = Knight.start_level(self.dragon.reputation.level) if knight_level > 0: self.knight = Knight(level=knight_level, game_ref=self) else: self.knight = None