-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspecial_moves.cpp
More file actions
40 lines (32 loc) · 953 Bytes
/
special_moves.cpp
File metadata and controls
40 lines (32 loc) · 953 Bytes
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
#include "special_moves.h"
SpecialMove::SpecialMove(std::string n, int s, int d, int m) : name(n), statusEffect(s), damage(d), manaCost(m), canUse(false) {}
int SpecialMove::getDamage() const {
return damage;
}
int SpecialMove::getManaCost() const {
return manaCost;
}
void SpecialMove::setCanUse(bool b) {
canUse = b;
}
bool SpecialMove::getCanUse() const {
return canUse;
}
int SpecialMove::getStatusEffect() const {
return statusEffect;
}
std::string SpecialMove::getMoveName() const {
return name;
}
std::ostream& operator << (std::ostream& out, const SpecialMove& s) {
std::string name = s.name + ": " + s.description;
std::string damage = "Damage: " + std::to_string(s.damage), mana = "| Mana Cost: " + std::to_string(s.manaCost);
out << std::setw(55) << name << std::setw(13) << damage << mana;
if (s.canUse) {
out << "\tUNLOCKED!";
}
else {
out << "\t[LOCKED...]";
}
return out;
}