Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
1
#include "zenPaca.h"
2
#include <cstdlib>
3
#include <iostream>
4
5
using namespace std;
6
7
8
//override virtual functions
9
std::string
10
zenPaca::name() {
11
return "ZenPaca";
12
}
13
14
void
15
zenPaca::act(Alpaca *opponent) {
16
17
static int stunCount = 0;
18
19
if(getPower() <= 6) {
20
reflect();
21
} else {
22
if (stunCount%4 == 0 and getPower() >= 18) {
23
inceptionate(opponent);
24
} else {
25
zenTap(opponent);
26
}
27
stunCount++;
28
}
29
}
30
31
void
32
zenPaca::transcend() {
33
cout << name() << " transcends the limits of its body!" << endl;
34
increaseAttack(9);
35
}
36
37
void
38
zenPaca::mindread(Alpaca *opponent) {
39
cout << name() << " better understands his opponent!" << endl;
40
decreaseDefense(opponent, 5);
41
}
42
43
void
44
zenPaca::zenKick(Alpaca *opponent) {
45
cout << name() << " centers its chakra in its hoof for a devastating kick!!" << endl
46
<< " ... It's super effective!" << endl;
47
attack(opponent, 10);
48
}
49
50
void
51
zenPaca::zenTap(Alpaca *opponent) {
52
cout << name() << " disrupts the chakra of its opponent!" << endl
53
<< " ... It's super effective!" << endl;
54
attack(opponent, 6);
55
}
56
57
void
58
zenPaca::inceptionate(Alpaca *opponent) {
59
cout << name() << " places its opponent in a psychic coma!" << endl;
60
stun(opponent, 6);
61
}
62
63
void
64
zenPaca::zenergy() {
65
cout << name() << " repairs its disrupted zenergy!" << endl;
66
increaseHp(8);
67
}
68
69
void
70
zenPaca::reflect() {
71
cout << name() << " reflects about its life as it treasures its last bit of power" << endl;
72
}
73
74