Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- #include <cstdlib>
- #include "demon.h"
- #include "creature.h"
- using namespace std;
- demon::demon()
- {
- }
- demon::demon(int inStrength, int inHitpoints) : creature(inStrength, inHitpoints)
- {
- }
- int demon::getDamage() const
- {
- int damage = creature::getDamage();
- cout << " attacks for " << damage << " points!" << endl;
- if (rand() % 100 < 25) {
- damage = damage + 50;
- cout << "Demonic attack inflicts 50 additional damage points!" << endl;
- }
- return damage;
- }
- string demon::getSpecies() const{
- return "demon";
- }
Advertisement
Add Comment
Please, Sign In to add comment