-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentities.h
More file actions
155 lines (141 loc) · 3.97 KB
/
entities.h
File metadata and controls
155 lines (141 loc) · 3.97 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
*
*/
#include <unistd.h>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <fstream>
#include <cstring>
#include <utility>
using namespace std;
typedef unsigned char byte;
const int NUM_JOBS = 8;
const int SKILLS[] = {0, 3, 0, 0, 0, 0, 3, 3};
static const string EQUIPSLOTS[]={"weapon","head","torso","hands","legs","feet"};
static const string ATTNAMES[]={"Serendipity","Might","Intelligence","Grace","Heart","Tenacity"};
static const string RACES[]={"human","chosen"};
static const byte RACEATTS[][6] = {{10,10,10,10,10,10},{3,3,3,3,3,3}};
static const string JOBS[]={"fightard", "gambler", "prism wizard", "clay warrior", "dancer", "anime kid", "Illusionist", "Cardmaster"}; //note: some names not final
static const string DUNGEON_OPTIONS[] = {"Attack", "Defend", "Skill", "Item", "Info", "Move", "Quit"};
static const string DIRECTIONS[] = {"North", "South", "East", "West"};
static const string SKILL_LIST[][3] = {{"", "", ""},{"Coin Toss", "Multi-Slash", "Dice Bomb"},{"", "", ""},{"", "", ""},{"", "", ""},{"", "", ""},{"Nightmare", "Thou Art I", "Dream Reaper"},{"Draw", "Fireball", "Capture"}} ;
//ALL PRIVATIZATION HAS BEEN REMOVED. GOT FRUSTRATED ARGUING WITH THE COMPILER.
//IF WE WANT GOOD CODING PRACTICE, IT CAN BE TWEAKED LATER, BUT FOR NOW,
//EVERYTHING IS HELD IN PUBLIC TRUST. WHOO COMMUNISM.
class EquipItem {
public:
// private:
string name;
string type;
int attack;
int defence;
map<string, int> elemental; //stores either resistance or elemental attack
//under name "FIRE", "WATER", etc. Int is how much
};
class UseItem {
public:
// private:
string name;
string type;
int how_many; //how many character has
int effect_size; //says how much it heals, or whatever. No clue what the plan is here...
};
class Skill {
public:
Skill();
Skill(int);
//~Skill();
string name;
unsigned char maxlevel,currentlevel;
map<string, byte> prereqs;
//vector<pair<string,unsigned char> >* prereqs;
int effect_size; //for attack value, heal value, etc
int skill_type; //ie 1 for attack, 2 for heal, etc
int mp_cost;
int accuracy;
string element;
};
class Job {
public:
string name;
map<string, Skill> skills;
unsigned char addSkillPoint(string);
};
class Tile {
public:
Tile () {return;}
vector <pair <Tile*, string> > door;
vector <class Entity*> inRoom;
class Area* destination;
class Area* zone;
int capacity;
};
class Area {
public:
Area() {return;}
vector <Tile*> mapOfArea;
vector <class Entity*> inDungeon;
string name;
};
class Entity {
public:
Entity() {return;}
void setUpChar(string, byte, byte); //given name and job, initialize characters
void generateChar();
void setUpChar(string n, byte r); //given name and race, initialize character
void addEquipment(EquipItem);
void addUseable(UseItem);
void listAttributes(); //list all info on character in nice format
int tick(int);
bool operator< (const Entity& e) const {return grace > e.grace;}
//bool operator> (const Entity& e) const {return grace < e.grace;}
int getCooldown() {return cooldown;}
int getGrace() {return grace;}
void save();
void load(ifstream&);
void attack();
void defend();
void skill();
void item();
void info();
void move();
void levelUp();
void skillOne();
void skillTwo();
void skillThree();
vector <void (*)(Entity*)> skills;
// private:
string name;
Job job;
string species;
byte alignment;
int npc;
map<string, EquipItem> equipment; //mapped under type, ie "HAT", "TORSO", "WEAPON", etc.
map<string, UseItem> useables; //mapped under type, ie "POTION", etc.
int jobNum;
int cash;
int level;
int cooldown;
int grace;
byte *attributes;
int max_hp;
int cur_hp;
int max_mp;
int cur_mp;
int status;
Entity* illusion;
int defense;
int act();
Tile* room;
void npcAttack();
void makeIll(string);
vector <pair <int, int> > se;
};
void setUpParty(Entity* party[]);
bool comp (Entity*, Entity*);