-
Notifications
You must be signed in to change notification settings - Fork 1
/
pokemon.h
294 lines (264 loc) · 5.26 KB
/
pokemon.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
285
286
287
288
289
290
291
292
293
294
#ifndef POKEMON_H_
#define POKEMON_H_
#include <vector>
#include "effects.h"
#include "moves.h"
#include <string>
#define ITEM_NONE 0
#define ITEM_SITRUS_BERRY 1
#define ITEM_ORAN_BERRY 2
#define ITEM_PECHA_BERRY 3
#define ITEM_CHERI_BERRY 4
#define ITEM_PERSIM_BERRY 5
#define ITEM_BOOST_DARK 6
#define ITEM_SUPER_POTION 7
#define ITEM_NATURE_BERRY 8 // they're all the same anyway, and we won't ever get confused by one using memory mail
#define ITEM_BOOST_WATER 9
#define ITEM_ASPEAR_BERRY 10
#define ITEM_RAWST_BERRY 11
#define ITEM_HYPER_POTION 12
#define ITEM_FULL_RESTORE 13
#define ITEM_STICKY_BARB 14
#define ITEM_POWER_HERB 15
#define ITEM_BOOST_ELECTRIC 16
#define ITEM_BOOST_GROUND 17
#define ITEM_POTION 18
// int calcDamage(Pokemon attacker, Pokemon defender, Move move, int crit = 1, int randomRoll = 100);
struct Nature {
int val[5];
};
enum AbilityId {
NO_ABILITY,
BLAZE,
STENCH,
AFTERMATH,
IMMUNITY,
MAGIC_GUARD,
LEAF_GUARD,
POISON_HEAL,
HYDRATION,
MOLD_BREAKER,
VOLT_ABSORB,
WATER_ABSORB, // not implemented yet
MOTOR_DRIVE,
FLASH_FIRE,
WONDER_GUARD,
LEVITATE,
SOUNDPROOF,
CLEAR_BODY,
WHITE_SMOKE,
NO_GUARD,
KEEN_EYE,
INNER_FOCUS,
INTIMIDATE,
SIMPLE,
RUN_AWAY,
HYPER_CUTTER,
OWN_TEMPO, // niy
ADAPTABILITY, // niy
SAND_STREAM,
HUSTLE, // niy
SERENCE_GRACE, // niy
ANTICIPATION, // niy
DRY_SKIN, // niy
STATIC, //niy
RIVALRY, //niy
NATURAL_CURE, //niy
POISON_POINT, // niy
STEADFAST, //niy
LIMBER, //niy
TRUANT, // niy
SPEED_BOOST, //niy
SWARM, // niy
PRESSURE, // niy
BATTLE_ARMOR, // niy
OBLIVIOUS, // niy
ROCK_HEAD, // niy
LIGHTNING_ROD, // niy
EARLY_BIRD, //niy
FLAME_BODY, // niy
SYNCHRONIZE, //niy
MARVEL_SCALE, //niy
SAND_VEIL, //niy
TINTED_LENS, // niy
TECHNICIAN, // niy
SNIPER, //niy
GUTS, // niy
STURDY, // niy
SOLID_ROCK, // niy
FILTER, // niy
HEATPROOF, // niy
FLOWER_GIFT, // niy
SOLAR_POWER, // niy
WATER_VEIL, // niy
SWIFT_SWIM, // niy
};
// note that we really only care what stat nature is reducing
// since we can just extrapolate that our bonus stat is whatever
// is least helpful at the moment
enum NatureId {
HARDY,
LONELY,
BRAVE,
ADAMANT,
NAUGHTY,
BOLD,
DOCILE,
RELAXED,
IMPISH,
LAX,
TIMID,
HASTY,
SERIOUS,
JOLLY,
NAIVE,
MODEST,
MILD,
QUIET,
BASHFUL,
RASH,
CALM,
GENTLE,
SASSY,
CAREFUL,
QUIRKY
};
enum Mons {
CHIMCHAR,
MONFERNO,
ROSELIA,
FLOATZEL,
GYARADOS,
QUAGSIRE,
ONIX,
GEODUDE,
CRANIDOS,
SKUNTANK,
ZUBAT,
STARAVIA,
PACHIRISU,
STARLY,
MISMAGIUS,
EEVEE,
HIPPOPOTAS,
TOGETIC,
VAPOREON,
GOLBAT,
TOXICROAK,
HIPPOWDON,
JOLTEON,
ELECTIVIRE,
RAICHU,
LUXRAY,
TOGEKISS,
ROSERADE,
HAUNTER,
RIOLU,
INFERNAPE,
YANMEGA,
SCIZOR,
DRAPION,
HERACROSS,
VESPIQUEN,
WHISCASH,
GLISCOR,
GOLEM,
RHYPERIOR,
HOUNDOOM,
FLAREON,
RAPIDASH,
MAGMORTAR,
MR_MIME,
ESPEON,
ALAKAZAM,
GALLADE,
BRONZONG,
SPIRITOMB,
MILOTIC,
LUCARIO,
GARCHOMP,
AZELF,
};
struct BattleVal {
int condition;
int testStatus;
int volConditions;
int moveEffectsMask;
int item;
int substituteHp;
bool substituteWasHit;
int bHp;
int atkStg;
int defStg;
int spAtkStg;
int spDefStg;
int spdStg;
int accStg;
int evaStg;
int critStg;
int turnsTaunted;
int turnsEncored;
bool isCharging; // currently charging a move like solarbeam
int turnsProtected;
bool isProtected;
bool abilityKnownToAi;
Move moveHit;
Move movePrevByBattler;
Move encoredMove;
};
class PokeInfo{
public:
std::string name;
int hp;
int atk;
int def;
int spDef;
int spAtk;
int spd;
Type primaryType;
Type secondaryType;
AbilityId ability;
AbilityId ability2;
PokeInfo(std::string _name, int _hp, int _atk, int _def, int _spAtk, int _spDef, int _spd, Type _primaryType, Type _secondaryType, AbilityId _ability, AbilityId _ability2);
};
class Pokemon{
public:
int level;
PokeInfo info;
int cHp;
int cAtk;
int cDef;
int cSpDef;
int cSpAtk;
int cSpd;
AbilityId cAbility;
int hpIv;
int atkIv;
int defIv;
int spAtkIv;
int spDefIv;
int spdIv;
int hpEv;
int atkEv;
int defEv;
int spAtkEv;
int spDefEv;
int spdEv;
Nature nature;
BattleVal bVal;
Move moveset[4];
Pokemon();
Pokemon(int _lvl, Nature _nature, int _ivs, Mons _id, Move _moveset[4], int _ability);
void calcStats();
void sendOut();
void setEvs(int hp, int atk, int def, int spAtk, int spDef, int spd);
void setBHp(int hp);
};
class Ability{
public:
AbilityId aid;
};
// fight setup
BattleContext setupJupiterFight(unsigned long startingSeed);
BattleContext setupVarFight(unsigned long startingSeed);
#endif /* POKEMON_H_ */