![The Vampires](https://d17mnqrx9pmt3e.cloudfront.net/media/logos/task/middle/4_disabled.png)
The Vampires
![](https://d17mnqrx9pmt3e.cloudfront.net/media/missions/media/e698caf5f3e74bc499d4c1d8df4a7186/convert/grey/title.png)
"If this goes on, we’ll simply kill each other, and there will be no winners - we’ll all lose." - reflected Sir Ronald, watching a bleak picture in front of him.
"I have to make an important decision. I know what it’ll cost, but now that’s the only thing that can save us all..."
A long time ago, when he was often in search of trouble and adventure, he went to hunt a witch who had a huge bounty on her head. The bloody creature was able to save her life by persuading the knight to take a gift from her - a vial of vampire blood. This blood poured into the dying man’s mouth could bring him back to life in vampire form.
Is it really the day when he has to use it?..
It seemed to be the only way to win this battle.
Sir Ronald began to lean over the barely living bodies of his knights, who were lying beside him. To each of them he said:
- "Drink. You’ll be given a new life..."
So we have 3 types of units: the Warrior, Knight and Defender. Let's make the battles even more epic and add another type - the Vampire!
Vampire should be the subclass of the Warrior class and have the additional vampirism parameter, which helps him to heal himself. When the Vampire hits the other unit, he restores his health by +50% of the dealt damage (enemy defense makes the dealt damage value lower).
The basic parameters of the Vampire:
health = 40
attack = 4
vampirism = 50%
You should store vampirism attribute as an integer (50 for 50%). It will be needed to make this solution evolutes to fit one of the next challenges of this saga.
Example:
chuck = Warrior() bruce = Warrior() carl = Knight() dave = Warrior() mark = Warrior() bob = Defender() mike = Knight() rog = Warrior() lancelot = Defender() eric = Vampire() adam = Vampire() richard = Defender() ogre = Warrior() assert fight(chuck, bruce) == True assert fight(dave, carl) == False assert...
CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.
In order to install CheckiO client you'll need installed Python (version at least 3.8)
Install CheckiO Client first:
pip3 install checkio_client
Configure your tool
checkio --domain=py config --key=
Sync solutions into your local folder
checkio sync
(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)
checkio serv -d
Alternatevly, you can install Chrome extension or FF addon
checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium
Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.
Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!
You are trying to join a pair programming session that has not started yet.
Please wait for the session creator to join.
It looks like the creator of the pair programming session closed the editor window.
It might happen accidentally, so that you can wait for reconnection.