-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNPCdef.h
92 lines (83 loc) · 2.15 KB
/
NPCdef.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
#pragma once
#include "Dice.h"
#include <vector>
#include <curses.h>
#define NPC_SMART 0x00000001
#define NPC_TELEPATH 0x00000002
#define NPC_TUNNEL 0x00000004
#define NPC_PASS 0x00000008
#define NPC_BIT5 0x00000010
#define NPC_BIT6 0x00000020
#define NPC_BIT7 0x00000040
#define NPC_BIT8 0x00000080
#define NPC_BIT9 0x00000100
#define NPC_BIT10 0x00000200
#define NPC_BIT11 0x00000400
#define NPC_BIT12 0x00000800
#define NPC_BIT13 0x00001000
#define NPC_BIT14 0x00002000
#define NPC_BIT15 0x00004000
#define NPC_BIT16 0x00008000
#define NPC_BIT17 0x00010000
#define NPC_BIT18 0x00020000
#define NPC_BIT19 0x00040000
#define NPC_BIT20 0x00080000
#define NPC_BIT21 0x00100000
#define NPC_BIT22 0x00200000
#define NPC_BIT23 0x00400000
#define NPC_BIT24 0x00800000
#define NPC_BIT25 0x01000000
#define NPC_BIT26 0x02000000
#define NPC_BIT27 0x04000000
#define NPC_BIT28 0x08000000
#define NPC_BIT29 0x10000000
#define NPC_BIT30 0x20000000
#define NPC_BIT31 0x40000000
#define NPC_BIT32 0x80000000
class NPCdef
{
private:
static std::vector<NPCdef*> definitions;
char symbol;
bool symbolSet;
std::string name;
bool nameSet;
std::string description;
bool descriptionSet;
short color;
bool colorSet;
unsigned int abilities;
bool abilitiesSet;
Dice speed;
Dice damage;
Dice HP;
public:
char getSymbol();
std::string getName();
std::string getDescription();
short getColor();
unsigned int getAbilities();
Dice getSpeed();
Dice getDamage();
Dice getHP();
void setSymbol(const char c);
void setName(const std::string &str);
void setDescription(const std::string &str);
void setColor(const std::string &str);
void setAbilities(const std::string &str);
void setSpeed(const Dice &d);
void setDamage(const Dice &d);
void setHP(const Dice &d);
static int parseDefs();
const static std::vector<NPCdef*> &getDefs();
static NPCdef *getRandom();
inline bool isFinished()
{
return symbolSet && nameSet && descriptionSet && colorSet && abilitiesSet
&& speed.isAssigned() && damage.isAssigned() && HP.isAssigned();
}
NPCdef();
~NPCdef();
static void deleteDefs();
friend std::ostream &operator<<(std::ostream &o, const NPCdef &npc);
};