Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
1
#include <iostream>
2
#include "firePaca.h"
3
4
using namespace std;
5
6
//constructor
7
//firePaca::firePaca(unsigned int pow) : alpaca(pow){}
8
9
std::string
10
cwillis::firePaca::name()
11
{
12
return nickName;
13
}
14
15
void
16
cwillis::firePaca::act(Alpaca* opponent) {
17
18
if (getHp() == 100) smolder();
19
else fireball(opponent);
20
21
}
22
23
//moves
24
void
25
cwillis::firePaca::fireball(Alpaca* opponent) {
26
cout << name() << " flings a ball of flame." << endl;
27
attack(opponent,18);
28
}
29
30
void
31
cwillis::firePaca::smolder() {
32
cout << name() << " burns within." << endl;
33
increaseAttack(18);
34
}
35
36
void
37
cwillis::firePaca::flare(Alpaca* opponent) {
38
cout << name() << " produces a blinding flash." << endl;
39
stun(opponent, 16);
40
}
41
42
void
43
cwillis::firePaca::flamekick(Alpaca* opponent) {
44
cout << name() << " kicks with all four flaming hooves." << endl;
45
attack(opponent, 22);
46
}
47
48