• Not possible to pass test of Healer

 

I resolved this task: https://py.checkio.org/ru/mission/the-healers/ But it stacks on the test:

army_1 = Army()
army_2 = Army()
army_1.add_units(Lancer, 7)
army_1.add_units(Vampire, 3)
army_1.add_units(Healer, 1)
army_1.add_units(Warrior, 4)
army_1.add_units(Healer, 1)
army_1.add_units(Defender, 2)

army_2.add_units(Warrior, 4)
army_2.add_units(Defender, 4)
army_2.add_units(Healer, 1)
army_2.add_units(Vampire, 6)
army_2.add_units(Lancer, 4)
battle = Battle()

print(battle.fight(army_1, army_2))

It stacks because Vampire has attack 4 and Defender (army_2) has defense 2 (attack of Vampire is 2), Healer behind Defender heal 2 points of health. So, each time Vampire attack Defender by 2, Healer heal back that 2 points.

And Defender has attack 3, Vampire has vampirism 50%, so he take back 1 point of his attack (it's 2 because Defender has defense = 2). Behind Vampire is Healer who gives him 2 points of health. So, Vampire take back that 3 points of health which Defender damage him with (his attack = 3).

None will die. :) So, what to do? :)

???