-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskillset.hpp
110 lines (99 loc) · 1.94 KB
/
skillset.hpp
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef SKILLSET_HPP
#define SKILLSET_HPP
#include <iostream>
#include <string>
using namespace std;
class SkillSet
{
protected:
string name;
string description;
int health_cost;
public:
SkillSet(){};
virtual ~SkillSet(){};
virtual int unique_skill(int& battle_hp) = 0;
string get_name()
{
return name;
}
string get_description()
{
return description;
}
int get_health_cost()
{
return health_cost;
}
};
class ShieldBash : public SkillSet
{
public:
ShieldBash()
{
name = "ShieldBash";
description = "Attack goes first, 3 hp lost though";
health_cost = 3;
}
int unique_skill(int& battle_hp)
{
battle_hp-=3;
return 0;
}
};
class CleanSweep : public SkillSet
{
public:
CleanSweep()
{
name = "CleanSweep";
description = "attack is increased by 3 the next turn, but you lose 4 hp";
health_cost = 4;
}
int unique_skill(int& battle_hp)
{
battle_hp-=4;
return 3;
}
};
class Rebuild : public SkillSet
{
public:
Rebuild()
{
name = "Rebuild";
description = "Restore 8 hp";
health_cost = 0;
}
int unique_skill(int& battle_hp)
{
battle_hp+=8;
return 0;
}
};
class ComboSkill : public SkillSet
{
private:
SkillSet* Skill1;
SkillSet* Skill2;
public:
ComboSkill(SkillSet* first, SkillSet* second)
{
Skill1 = first;
Skill2 = second;
name = Skill1->get_name() + " + " + Skill2->get_name();
description = Skill1->get_description() + " + " + Skill2->get_description();
health_cost = Skill1->get_health_cost() + Skill2->get_health_cost();
}
int unique_skill(int& battle_hp)
{
int damage_dealt = Skill1->unique_skill(battle_hp) + Skill2->unique_skill(battle_hp);
return damage_dealt;
}
~ComboSkill()
{
delete Skill1;
delete Skill2;
}
};
#endif