-
Notifications
You must be signed in to change notification settings - Fork 0
/
balrog.cpp
40 lines (40 loc) · 1 KB
/
balrog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*************************
* Program: balrog.cpp
* Author: Kaitlin Hill
* Date: 5/12/17
* Description: creates balrog and does get damage
* Input: none
* Output: none
* **********************/
#include "./balrog.h"
/*************************
* Function: balrog
* Description: create balrog
* Parameters: none
* Pre-conditions: variables must have values
* Post-conditions: none
* Return: none
* ************************/
balrog::balrog():demon(){
payoff = ' ';
damage = 0;
strength = 60;
hit_points = 100;
cost = 80;
payoff = 0;
}
/*************************
* Function: get_damage
* Description: get the damage
* Parameters: none
* Pre-conditions: variables must have values
* Post-conditions: none
* Return: damage
* ************************/
int balrog::get_damage(){
damage = demon::get_damage();
damage_2 = (rand() % strength) + 1;
cout << "Balrog speed attack inflicts " << damage_2 << " additional damage points!" << endl;
damage = damage + damage_2;
return damage;
}