Esempio n. 1
0
def regular_fight(hero: Hero, enemy: Enemy):
    while True:
        enemy.take_damage(hero.attack())
        print_entity_name_and_health('Enemy', enemy.health)

        if not enemy.is_alive():
            print_has_been_slain('Enemy')
            break

        hero.take_damage(enemy.attack())
        print_hero_takes_damage(hero, enemy)
        print_entity_name_and_health(hero.name, hero.health)

        if not hero.is_alive():
            print_has_been_slain(hero.known_as())
            break
 def test_if_know_as_works_as_expected(self):
     h = Hero()
     exp = 'Hero the No title'
     self.assertEqual(h.known_as(), exp)