Advertisement
Guest User

Untitled

a guest
Oct 11th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. #include <cstdlib>
  4.  
  5. #include "balrog.h"
  6. #include "demon.h"
  7.  
  8. using namespace std;
  9.  
  10. balrog::balrog()
  11. {
  12.  
  13. }
  14.  
  15. balrog::balrog(int inStrength, int inHitpoints) : demon(inStrength, inHitpoints) {
  16. }
  17.  
  18.  
  19. int balrog::getDamage() const{
  20. cout << "The balrog ";
  21. int damage = demon::getDamage();
  22. int damage2 = (rand() % getStrength()) + 1;
  23. cout << "Balrog speed attack inflicts " << damage2 << " additional damage points!" << endl;
  24. return damage + damage2;
  25. }
  26.  
  27. string balrog::getSpecies() const{
  28. return "balrog";
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement