forked from myst6re/hyne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Data.h
284 lines (255 loc) · 5.82 KB
/
Data.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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
/****************************************************************************
** Hyne Final Fantasy VIII Save Editor
** Copyright (C) 2009-2013 Arzel Jérôme <[email protected]>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef DEF_DATA
#define DEF_DATA
#define SQUALL 0
#define ZELL 1
#define IRVINE 2
#define QUISTIS 3
#define RINOA 4
#define SELPHIE 5
#define SEIFER 6
#define EDEA 7
#define LAGUNA 8
#define KIROS 9
#define WARD 10
#define GRIEVER 12
#define BOKO 14
#define ANGELO 15
#define MAP_COUNT 982
#include <QtCore>
typedef struct CoupleInt {
CoupleInt() : one(0), two(0) {}
CoupleInt(int one, int two) : one(one), two(two) {}
int one, two;
} cInt;
class DataList
{
public:
DataList() {}
const QStringList &list() {
if (_list.isEmpty()) fillList();
return _list;
}
const QString &at(int id) {
if (_list.isEmpty()) fillList();
return _list.at(id);
}
QString value(int id, const QString &defaultValue=QString()) {
if (_list.isEmpty()) fillList();
return _list.value(id, defaultValue);
}
int size() {
if (_list.isEmpty()) fillList();
return _list.size();
}
inline void clear() {
_list.clear();
}
protected:
virtual void fillList()=0;
QStringList _list;
};
class Abilities : public DataList
{
public:
Abilities() {}
protected:
virtual void fillList();
};
class Magics : public DataList
{
public:
Magics() {}
protected:
virtual void fillList();
};
class Items : public DataList
{
public:
Items() {}
protected:
virtual void fillList();
};
class Locations : public DataList
{
public:
Locations() {}
protected:
virtual void fillList();
};
class Cities : public DataList
{
public:
enum City {
Balamb,
Deling,
ShumiVillage,
Winhill,
Dollet,
Horizon,
LunarGate,
Esthar,
Timber,
BGU,
GGU,
TGU,
CentraRuins,
Orphanage,
SaltLake,
ChocoboBeginner,
ChocoboBasics,
ChocoboRoaming,
ChocoboSanctuary,
ChocoboEnclosed,
ChocoboFun,
ChocoboSolitude,
RescuePod
};
Cities() {}
protected:
virtual void fillList();
};
class Weapons : public DataList
{
public:
Weapons() {}
protected:
virtual void fillList();
};
class Names : public DataList
{
public:
Names() {}
protected:
virtual void fillList();
};
class GfNames : public DataList
{
public:
GfNames() {}
protected:
virtual void fillList();
};
class Cards : public DataList
{
public:
Cards() {}
protected:
virtual void fillList();
};
class ZellLBs : public DataList
{
public:
ZellLBs() {}
protected:
virtual void fillList();
};
class IrvineLBs : public DataList
{
public:
IrvineLBs() {}
protected:
virtual void fillList();
};
class QuistisLBs : public DataList
{
public:
QuistisLBs() {}
protected:
virtual void fillList();
};
class RinoaLBs : public DataList
{
public:
RinoaLBs() {}
protected:
virtual void fillList();
};
class Ennemies : public DataList
{
public:
Ennemies() {}
void setNames(Names *names) {
_names = names;
}
protected:
virtual void fillList();
private:
Names *_names;
};
struct Point {
inline Point(qint16 x, qint16 y, qint16 z, qint16 dir, Cities::City city) {
this->x = x;
this->y = y;
this->z = z;
this->dir = dir;
this->city = quint8(city);
}
qint16 x, y, z, dir;
quint8 city;
};
#define P(x, y, z, dir, city) \
Point(x, y, z, dir, city)
class Data
{
public:
static const quint8 apsTab[116];
static const quint8 innateAbilities[16][22];
static QString getCardsLocation(int i);
static const cInt momentLocation[403];
static const int drawPoints[256];
static const int drawPointsLoc[256];
static const Point wmLocation[21];
static void reload();
static inline Abilities &abilities() { return _abilities; }
static inline Magics &magics() { return _magic; }
static inline Items &items() { return _items; }
static inline Locations &locations() { return _locations; }
static inline Cities &cities() { return _cities; }
static inline Weapons &weapons() { return _weapons; }
static inline Names &names() { return _names; }
static inline GfNames &gfnames() { return _gfnames; }
static inline Cards &cards() { return _cards; }
static inline ZellLBs &zellLBs() { return _zellLB; }
static inline IrvineLBs &irvineLBs() { return _irvineLB; }
static inline QuistisLBs &quistisLBs() { return _quistisLB; }
static inline RinoaLBs &rinoaLBs() { return _rinoaLB; }
static inline Ennemies &ennemies() { _ennemies.setNames(&_names); return _ennemies; }
static qint8 abilityType(quint8 abilityID);
static quint8 itemType(quint8 itemID);
static QStringList maplist();
private:
static Abilities _abilities;
static Magics _magic;
static Items _items;
static Locations _locations;
static Cities _cities;
static Weapons _weapons;
static Names _names;
static GfNames _gfnames;
static Cards _cards;
static ZellLBs _zellLB;
static IrvineLBs _irvineLB;
static QuistisLBs _quistisLB;
static RinoaLBs _rinoaLB;
static Ennemies _ennemies;
static const char *_maplist[MAP_COUNT];
static const int cardsLocation[256];
};
#endif