-
Notifications
You must be signed in to change notification settings - Fork 0
/
creature.h
98 lines (73 loc) · 2.12 KB
/
creature.h
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
#pragma once
#include <list>
#include <string>
#include <map>
class Skill; //Forward declaration
class Buff; //Forward declaration
//Used by Skills, Buffs, and Creatures so it needs to be here
enum skillDamageType {
DMGTYPE_NONE, //Used mostly if it doesn't do damage, or special cases
DMGTYPE_PHYSICAL,
DMGTYPE_MAGICAL
};
typedef std::map<std::string,int> Stats;
Stats allStats(int s);
struct Points {
int HP;
int SP;
int MP;
};
struct CreaturePoints {
int maxHP;
int maxSP;
int maxMP;
int HP;
int SP;
int MP;
};
//Modifiers applied by (de)buffs on a given turn
//Default values are 1, no effect
struct BuffTurnMultipliers {
float allDamageOutput = 1;
float physicalDamageOutput = 1;
float magicalDamageOutput = 1;
float allDamageTaken = 1;
float physicalDamageTaken = 1;
float magicalDamageTaken = 1;
};
class Creature {
private:
//Stats add to these
Points basePoints;// HP,SP,MP
Stats stats;
CreaturePoints pointValues;
std::string name = "";
void rawDamage(Points dmg); //Raw damage, no modifiers
public:
std::list<Skill*> skillPtrs;
std::list<Buff*> buffs;
BuffTurnMultipliers turnBuffEffects;
Stats getStats();
void setStats(Stats);
void increaseStat(std::string stat, int amount);
CreaturePoints getPointValues();
void setPointValues(CreaturePoints);
void setName(std::string);
std::string getName();
const char * getName_c();
Points runDamageMultipliers (Points dmg, skillDamageType damageType);
void calcAttributes();
void healAll();
void damage(Points dmg, skillDamageType damageType);
void heal(Points healing);
//Like damage() but for skill costs, ignores amp/reduction etc
void takeCost(Points cost);
void mergeBuffTurnMultipliers (BuffTurnMultipliers changes);
void clearBuffTurnMultipliers();
bool isDead();
Creature();
//Creature(Stats startingStats);
//Creature(CreaturePoints points);
Creature(Points basePoints, Stats startingStats, std::string cName);
};
//Merge two sets of BuffTurnMultipliers