-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlueM.cpp
More file actions
65 lines (49 loc) · 1.58 KB
/
Copy pathBlueM.cpp
File metadata and controls
65 lines (49 loc) · 1.58 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "BlueM.h"
#include "Creature.h"
#include<iostream>
#include<string>
/****************************************************************************
* void BlueM::getType()
*
* Purpose: Returns name of creature
* Entry: None
* Exit: None
* ***********************************************************************/
std::string BlueM::getType(){
return "Blue Men";}
/****************************************************************************
* void BlueM::indAttack()
*
* Purpose: Returns unique attack
* Entry: None
* Exit: None
* ***********************************************************************/
void BlueM::indAttack(){
std::cout << "Blue men swarm over their opponent. Itty bitty biting creatures...";}
/****************************************************************************
* int BlueM::attack()
*
* Purpose: Overrides attack function for unique attack
* Entry: None
* Exit: Returns attack value
* ***********************************************************************/
int BlueM::attack(){
total = 0;
blueDice.setSides(10);
for(int i = 0; i < getRoll(); i++){
indAttack();
std::cout << "\nRolls: ";
roll = blueDice.rollDice();
std::cout << roll << std::endl;
total = total + roll;}
setAttVal(total);
return total;}
/****************************************************************************
* int BlueM::getDefRoll()
*
* Purpose: Returns amount of times Blue Men can roll defensively
* Entry: None
* Exit: Returns 3 rolls
* ***********************************************************************/
int BlueM::getDefRoll(){
return 3;}