|
@@ -1,344 +1,387 @@
|
1
|
|
-#ifndef BATTLE_STRUCT_H_
|
2
|
|
-#define BATTLE_STRUCT_H_
|
3
|
|
-
|
4
|
|
-#include <types.h>
|
5
|
|
-
|
6
|
|
-struct side_affecting_hword{
|
7
|
|
- u16 reflect_on : 1;
|
8
|
|
- u16 light_screen_on : 1;
|
9
|
|
- u16 unkown1 : 2;
|
10
|
|
- u16 spikes_on : 1;
|
11
|
|
- u16 safeguard_on : 1;
|
12
|
|
- u16 unkown2 : 2;
|
13
|
|
- u16 mist_on : 1;
|
14
|
|
- u16 spikes_damage_done : 1;
|
15
|
|
-};
|
16
|
|
-
|
17
|
|
-extern struct side_affecting_hword side_affecting_halfword[2];
|
18
|
|
-
|
19
|
|
-struct status_main{
|
20
|
|
- u32 sleep : 3;
|
21
|
|
- u32 poison : 1;
|
22
|
|
- u32 burn : 1;
|
23
|
|
- u32 freeze : 1;
|
24
|
|
- u32 paralysis: 1;
|
25
|
|
- u32 toxic_poison : 1;
|
26
|
|
- u32 poison_counter : 4;
|
27
|
|
-};
|
28
|
|
-
|
29
|
|
-union main_status{
|
30
|
|
- u32 int_status;
|
31
|
|
- struct status_main flags;
|
32
|
|
-};
|
33
|
|
-
|
34
|
|
-struct protect_struct{
|
35
|
|
- u8 flag0_protect : 1;
|
36
|
|
- u8 flag0_endure : 1;
|
37
|
|
- u8 flag0_onlystruggle : 1;
|
38
|
|
- u8 flag0_helpinghand : 1;
|
39
|
|
- u8 flag0_bouncemove : 1;
|
40
|
|
- u8 flag0_stealmove : 1;
|
41
|
|
- u8 flag0_unknown: 1;
|
42
|
|
- u8 flag0_prlz_immobility: 1;
|
43
|
|
- u8 flag1_confusion_self_damage: 1;
|
44
|
|
- u8 flag1_noteffective: 1;
|
45
|
|
- u8 flag1_chargingturn: 1; //dive, dig etc.
|
46
|
|
- u8 flag1_smokeballflee: 1;
|
47
|
|
- u8 flag1_runaway_flee: 1;
|
48
|
|
- u8 flag1_used_imprisoned_move: 1;
|
49
|
|
- u8 flag1_love_immobility: 1;
|
50
|
|
- u8 flag1_used_disabled_move: 1;
|
51
|
|
- u8 flag2_used_taunted_move: 1;
|
52
|
|
- u8 flag2_unknown: 1;
|
53
|
|
- u8 flag2_flinch_immobility : 1;
|
54
|
|
- u8 flag2_notfirststrike : 1;
|
55
|
|
- u8 flag2_free: 4;
|
56
|
|
- u8 field3;
|
57
|
|
- u32 physical_damage;
|
58
|
|
- u32 special_damage;
|
59
|
|
- u8 counter_target;
|
60
|
|
- u8 mirrorcoat_target;
|
61
|
|
- u16 fieldE;
|
62
|
|
-};
|
63
|
|
-
|
64
|
|
-extern struct protect_struct battle_protect[4];
|
65
|
|
-
|
66
|
|
-#define STATUS_SLEEP 0x7
|
67
|
|
-#define STATUS_POISON 0x8
|
68
|
|
-#define STATUS_BURN 0x10
|
69
|
|
-#define STATUS_FREEZE 0x20
|
70
|
|
-#define STATUS_PARALYSIS 0x40
|
71
|
|
-#define STATUS_TOXIC_POISON 0x80
|
72
|
|
-
|
73
|
|
-struct flags2{
|
74
|
|
- u32 confusion : 3;
|
75
|
|
- u32 flinched : 1;
|
76
|
|
- u32 uproar : 3;
|
77
|
|
- u32 flag_x80 : 1;
|
78
|
|
- u32 bide : 2;
|
79
|
|
- u32 locked_and_confuse : 2;
|
80
|
|
- u32 multiple_turn_move : 1;
|
81
|
|
- u32 trapped_in_wrap : 3;
|
82
|
|
- u32 in_love : 4;
|
83
|
|
- u32 focus_energy : 1;
|
84
|
|
- u32 transformed : 1;
|
85
|
|
- u32 recharge : 1;
|
86
|
|
- u32 raged : 1;
|
87
|
|
- u32 substitute : 1;
|
88
|
|
- u32 destinny_bond : 1;
|
89
|
|
- u32 cant_escape : 1;
|
90
|
|
- u32 nightmare : 1;
|
91
|
|
- u32 cursed : 1;
|
92
|
|
- u32 foresight : 1;
|
93
|
|
- u32 defense_curled : 1;
|
94
|
|
- u32 tormented : 1;
|
95
|
|
-};
|
96
|
|
-
|
97
|
|
-struct iv_set
|
98
|
|
-{
|
99
|
|
- u32 iv_hp: 5;
|
100
|
|
- u32 iv_atk: 5;
|
101
|
|
- u32 iv_def: 5;
|
102
|
|
- u32 iv_spd: 5;
|
103
|
|
- u32 iv_sp_atk: 5;
|
104
|
|
- u32 iv_sp_def: 5;
|
105
|
|
-};
|
106
|
|
-
|
107
|
|
-struct pokemon{
|
108
|
|
- u32 PID;
|
109
|
|
- u32 OTID;
|
110
|
|
- char name[10];
|
111
|
|
- u16 language;
|
112
|
|
- u8 OT_name[7];
|
113
|
|
- u8 markings;
|
114
|
|
- u16 checksum;
|
115
|
|
- u16 padding_maybe;
|
116
|
|
- u8 data[48];
|
117
|
|
- u32 ailment;
|
118
|
|
- u8 level;
|
119
|
|
- u8 pokerus;
|
120
|
|
- u16 current_hp;
|
121
|
|
- u16 total_hp;
|
122
|
|
- u16 attack;
|
123
|
|
- u16 defense;
|
124
|
|
- u16 speed;
|
125
|
|
- u16 sp_attack;
|
126
|
|
- u16 sp_defense;
|
127
|
|
-};
|
128
|
|
-
|
129
|
|
-extern struct pokemon party_opponent[6];
|
130
|
|
-extern struct pokemon party_player[6];
|
131
|
|
-
|
132
|
|
-struct battle_participant {
|
133
|
|
- u16 poke_species;
|
134
|
|
- u16 atk;
|
135
|
|
- u16 def;
|
136
|
|
- u16 spd;
|
137
|
|
- u16 sp_atk;
|
138
|
|
- u16 sp_def;
|
139
|
|
- u16 moves[4];
|
140
|
|
- struct iv_set ivs;
|
141
|
|
- u8 hp_buff;
|
142
|
|
- u8 atk_buff;
|
143
|
|
- u8 def_buff;
|
144
|
|
- u8 spd_buff;
|
145
|
|
- u8 sp_atk_buff;
|
146
|
|
- u8 sp_def_buff;
|
147
|
|
- u8 acc_buff;
|
148
|
|
- u8 evasion_buff;
|
149
|
|
- u8 ability_id;
|
150
|
|
- u8 type1;
|
151
|
|
- u8 type2;
|
152
|
|
- u8 padd;
|
153
|
|
- u8 current_pp[4];
|
154
|
|
- u16 current_hp;
|
155
|
|
- u8 level;
|
156
|
|
- u8 happiness;
|
157
|
|
- u16 max_hp;
|
158
|
|
- u16 held_item;
|
159
|
|
- u8 poke_name[12];
|
160
|
|
- u8 trainer_name[8];
|
161
|
|
- u32 padd2;
|
162
|
|
- u32 pid;
|
163
|
|
- union main_status status;
|
164
|
|
- struct flags2 status2;
|
165
|
|
- u32 otid;
|
166
|
|
-};
|
167
|
|
-
|
168
|
|
-extern struct battle_participant battle_participants[4];
|
169
|
|
-
|
170
|
|
-struct side_timer{
|
171
|
|
- u8 reflect_timer;
|
172
|
|
- u8 reflect_bank;
|
173
|
|
- u8 lightscreen_timer;
|
174
|
|
- u8 lightscreen_bank;
|
175
|
|
- u8 mist_timer;
|
176
|
|
- u8 mist_bank;
|
177
|
|
- u8 safeguard_timer;
|
178
|
|
- u8 safeguard_bank;
|
179
|
|
- u8 followme_timer;
|
180
|
|
- u8 followme_target;
|
181
|
|
- u8 spikes_amount;
|
182
|
|
- u8 fieldB;
|
183
|
|
-};
|
184
|
|
-
|
185
|
|
-extern struct side_timer battle_side_timers[2];
|
186
|
|
-
|
187
|
|
-struct in_battle_weather{
|
188
|
|
- u32 rain : 1;
|
189
|
|
- u32 downpour : 1;
|
190
|
|
- u32 permament_rain : 1;
|
191
|
|
- u32 sandstorm : 1;
|
192
|
|
- u32 permament_sandstorm : 1;
|
193
|
|
- u32 sun : 1;
|
194
|
|
- u32 permament_sun : 1;
|
195
|
|
- u32 hail : 1;
|
196
|
|
- //custom flags
|
197
|
|
- u32 permament_hail : 1;
|
198
|
|
- u32 fog : 1;
|
199
|
|
- u32 permament_fog : 1;
|
200
|
|
- u32 harsh_sun : 1;
|
201
|
|
- u32 heavy_rain : 1;
|
202
|
|
- u32 air_current : 1;
|
203
|
|
-};
|
204
|
|
-
|
205
|
|
-struct status_3{
|
206
|
|
- u32 leech_seed_hp_receiver : 2; // 2 bits
|
207
|
|
- u32 leech_seed : 1; //4
|
208
|
|
- u32 always_hits : 2; //x8 | x10
|
209
|
|
- u32 perish_song : 1; //x20
|
210
|
|
- u32 on_air : 1; //x40
|
211
|
|
- u32 underground : 1;//80
|
212
|
|
- u32 minimized : 1; //x100
|
213
|
|
- u32 charged_up : 1; //x200
|
214
|
|
- u32 rooted : 1; //x400
|
215
|
|
- u32 yawn : 2; //x800 || x1000
|
216
|
|
- u32 imprision : 1; //x2000
|
217
|
|
- u32 grudge : 1; //x4000
|
218
|
|
- u32 unkown_no_crit : 1; //x8000
|
219
|
|
- u32 mud_sport : 1; //x10 000
|
220
|
|
- u32 watersport : 1; //x20 000
|
221
|
|
- u32 underwater : 1; //x40 000
|
222
|
|
- u32 switchinlock : 1; //x80 000
|
223
|
|
- u32 unburden : 1; //x100 000 (previously trace)
|
224
|
|
- u32 phantomforce : 1; //x200 000
|
225
|
|
-};
|
226
|
|
-
|
227
|
|
-extern struct status_3 battle_status_3[4];
|
228
|
|
-
|
229
|
|
-union battle_weather{
|
230
|
|
- u32 int_bw;
|
231
|
|
- struct in_battle_weather flags;
|
232
|
|
-};
|
233
|
|
-
|
234
|
|
-extern union battle_weather battle_weather;
|
235
|
|
-
|
236
|
|
-struct mirror_move_set_per_bank
|
237
|
|
-{
|
238
|
|
- u16 moves_per_target[4];
|
239
|
|
-};
|
240
|
|
-
|
241
|
|
-struct battle_stuff{
|
242
|
|
- u8 end_turn_statetracker1; //0x0
|
243
|
|
- u8 end_turn_checked_bank; //0x1
|
244
|
|
- u8 field_2; //0x2
|
245
|
|
- u8 end_turn_statetracker2; //0x3
|
246
|
|
- u16 trapped_move[4]; //0x4 - 0xB
|
247
|
|
- u8 move_target[4]; //0xC - 0xF
|
248
|
|
- u8 field_10; //0x10
|
249
|
|
- u8 field_11; //0x11
|
250
|
|
- u8 field_12; //0x12
|
251
|
|
- u8 dynamic_move_type; //0x13
|
252
|
|
- u8 trapper[4];//0x14-0x17
|
253
|
|
- u8 field_18[48]; //0x18-0x47
|
254
|
|
- u8 pre_attacks_bank_counter; //0x48
|
255
|
|
- u8 field_49; //0x49
|
256
|
|
- u8 money_multiplier; //0x4A
|
257
|
|
- u8 field_4B; //0x4B
|
258
|
|
- u8 switch_in_ability_bank_counter; //0x4C
|
259
|
|
- u8 field_4D[7]; //0x4D-0x53
|
260
|
|
- u8 field_54; //0x54
|
261
|
|
- u8 field_55; //0x55
|
262
|
|
- u8 field_56; //0x56
|
263
|
|
- u8 field_57; //0x57
|
264
|
|
- u8 field_58[4];
|
265
|
|
- u8 field_5C[35];
|
266
|
|
- u8 castform_switch_form; //0x7F
|
267
|
|
- u8 chosen_move_position[4]; //0x80
|
268
|
|
- u8 field_84[13]; //0x84-0x90
|
269
|
|
- u8 absent_bank_flags_prev_turn; //0x91
|
270
|
|
- u8 field_92[6]; //0x92-0x97
|
271
|
|
- u16 mirror_moves_pbs[4]; //0x98-0x9F
|
272
|
|
- u8 field_A0[18]; //0xA0-0xB1
|
273
|
|
- u8 synchronize_effect_chooser; //0xB2
|
274
|
|
- u8 field_B3[5];
|
275
|
|
- u16 used_held_items[4]; //0xB8-0xBF
|
276
|
|
- u8 field_C0[8]; //0xC0-0xC7
|
277
|
|
- u16 choiced_move[4]; //0xC8-0xCF (checked in cmd49)
|
278
|
|
- u16 changed_held_items[4]; //0xD0-0xD8 (later written to battlestruct in cmd49)
|
279
|
|
- u8 intimidate_user; //0xD8
|
280
|
|
- u8 switch_in_item_bank_counter; //0xD9
|
281
|
|
- u8 field_DA; //0xDA
|
282
|
|
- u8 field_DB; //0xDB
|
283
|
|
- u8 field_DC; //0xDC
|
284
|
|
- u8 field_DD; //0xDD
|
285
|
|
- u8 field_DE; //0xDE
|
286
|
|
- u8 field_DF; //0xDF
|
287
|
|
- struct mirror_move_set_per_bank mirror_move_set_pbs[4]; //0xE0-0xFF
|
288
|
|
- u8 field_100[162]; //0x100-0x1A1
|
289
|
|
- u8 battle_load_weather_from_map_flag; //0x1A2
|
290
|
|
- u8 atk_canceller_state_tracker; //0x1A3
|
291
|
|
- u8 field_1A4[240]; //0x1A4-0x293
|
292
|
|
- u8 switchout_index[4]; //0x294-0x297
|
293
|
|
- u8 field_298[11];
|
294
|
|
- u8 field_2A3;
|
295
|
|
-};
|
296
|
|
-
|
297
|
|
-struct battle_stuff_struct{
|
298
|
|
- struct battle_stuff *ptr;
|
299
|
|
-};
|
300
|
|
-
|
301
|
|
-extern struct battle_stuff_struct battle_stuff_ptr;
|
302
|
|
-
|
303
|
|
-struct prop_flags{
|
304
|
|
- u8 makes_contact : 1;//1
|
305
|
|
- u8 affected_by_protect : 1;//2
|
306
|
|
- u8 affected_by_magic_coat : 1;//4
|
307
|
|
- u8 affected_by_snatch : 1;//8
|
308
|
|
- u8 affected_by_mirrormove :1;//x10
|
309
|
|
- u8 affected_by_kingsrock :1;//x20
|
310
|
|
- u8 raised_crit_ratio :1;//x40
|
311
|
|
- u8 unused_bit : 1;//x80
|
312
|
|
-};
|
313
|
|
-
|
314
|
|
-union move_flags{
|
315
|
|
- u8 int_flag;
|
316
|
|
- struct prop_flags flags;
|
317
|
|
-};
|
318
|
|
-
|
319
|
|
-struct move_info{
|
320
|
|
- u8 script_id;
|
321
|
|
- u8 base_power;
|
322
|
|
- u8 type;
|
323
|
|
- u8 accuracy;
|
324
|
|
- u8 pp;
|
325
|
|
- u8 effect_chance;
|
326
|
|
- u8 target;
|
327
|
|
- s8 priority;
|
328
|
|
- union move_flags move_flags;
|
329
|
|
- u8 arg1;
|
330
|
|
- u8 split;
|
331
|
|
- u8 arg2;
|
332
|
|
-};
|
333
|
|
-
|
334
|
|
-struct b_enigma_berry{
|
335
|
|
- u8 field0[7];
|
336
|
|
- u8 battle_effect_x12;
|
337
|
|
- u8 field8[18];
|
338
|
|
- u8 quality;
|
339
|
|
- u8 field1B;
|
340
|
|
-};
|
341
|
|
-
|
342
|
|
-extern struct b_enigma_berry battle_enigma_berry[4];
|
343
|
|
-
|
344
|
|
-#endif
|
|
1
|
+#ifndef BATTLE_STRUCT_H_
|
|
2
|
+#define BATTLE_STRUCT_H_
|
|
3
|
+
|
|
4
|
+#include <types.h>
|
|
5
|
+
|
|
6
|
+struct side_affecting_hword{
|
|
7
|
+ u16 reflect_on : 1;
|
|
8
|
+ u16 light_screen_on : 1;
|
|
9
|
+ u16 unkown1 : 2;
|
|
10
|
+ u16 spikes_on : 1;
|
|
11
|
+ u16 safeguard_on : 1;
|
|
12
|
+ u16 unkown2 : 2;
|
|
13
|
+ u16 mist_on : 1;
|
|
14
|
+ u16 spikes_damage_done : 1;
|
|
15
|
+};
|
|
16
|
+
|
|
17
|
+extern struct side_affecting_hword side_affecting_halfword[2];
|
|
18
|
+
|
|
19
|
+struct status_main{
|
|
20
|
+ u32 sleep : 3;
|
|
21
|
+ u32 poison : 1;
|
|
22
|
+ u32 burn : 1;
|
|
23
|
+ u32 freeze : 1;
|
|
24
|
+ u32 paralysis: 1;
|
|
25
|
+ u32 toxic_poison : 1;
|
|
26
|
+ u32 poison_counter : 4;
|
|
27
|
+};
|
|
28
|
+
|
|
29
|
+union main_status{
|
|
30
|
+ u32 int_status;
|
|
31
|
+ struct status_main flags;
|
|
32
|
+};
|
|
33
|
+
|
|
34
|
+struct protect_struct{
|
|
35
|
+ u8 flag0_protect : 1;
|
|
36
|
+ u8 flag0_endure : 1;
|
|
37
|
+ u8 flag0_onlystruggle : 1;
|
|
38
|
+ u8 flag0_helpinghand : 1;
|
|
39
|
+ u8 flag0_bouncemove : 1;
|
|
40
|
+ u8 flag0_stealmove : 1;
|
|
41
|
+ u8 flag0_unknown: 1;
|
|
42
|
+ u8 flag0_prlz_immobility: 1;
|
|
43
|
+ u8 flag1_confusion_self_damage: 1;
|
|
44
|
+ u8 flag1_noteffective: 1;
|
|
45
|
+ u8 flag1_chargingturn: 1; //dive, dig etc.
|
|
46
|
+ u8 flag1_smokeballflee: 1;
|
|
47
|
+ u8 flag1_runaway_flee: 1;
|
|
48
|
+ u8 flag1_used_imprisoned_move: 1;
|
|
49
|
+ u8 flag1_love_immobility: 1;
|
|
50
|
+ u8 flag1_used_disabled_move: 1;
|
|
51
|
+ u8 flag2_used_taunted_move: 1;
|
|
52
|
+ u8 flag2_unknown: 1;
|
|
53
|
+ u8 flag2_flinch_immobility : 1;
|
|
54
|
+ u8 flag2_notfirststrike : 1;
|
|
55
|
+ u8 flag2_free: 4;
|
|
56
|
+ u8 field3;
|
|
57
|
+ u32 physical_damage;
|
|
58
|
+ u32 special_damage;
|
|
59
|
+ u8 counter_target;
|
|
60
|
+ u8 mirrorcoat_target;
|
|
61
|
+ u16 fieldE;
|
|
62
|
+};
|
|
63
|
+
|
|
64
|
+extern struct protect_struct battle_protect[4];
|
|
65
|
+
|
|
66
|
+#define STATUS_SLEEP 0x7
|
|
67
|
+#define STATUS_POISON 0x8
|
|
68
|
+#define STATUS_BURN 0x10
|
|
69
|
+#define STATUS_FREEZE 0x20
|
|
70
|
+#define STATUS_PARALYSIS 0x40
|
|
71
|
+#define STATUS_TOXIC_POISON 0x80
|
|
72
|
+
|
|
73
|
+struct flags2{
|
|
74
|
+ u32 confusion : 3;
|
|
75
|
+ u32 flinched : 1;
|
|
76
|
+ u32 uproar : 3;
|
|
77
|
+ u32 flag_x80 : 1;
|
|
78
|
+ u32 bide : 2;
|
|
79
|
+ u32 locked_and_confuse : 2;
|
|
80
|
+ u32 multiple_turn_move : 1;
|
|
81
|
+ u32 trapped_in_wrap : 3;
|
|
82
|
+ u32 in_love : 4;
|
|
83
|
+ u32 focus_energy : 1;
|
|
84
|
+ u32 transformed : 1;
|
|
85
|
+ u32 recharge : 1;
|
|
86
|
+ u32 raged : 1;
|
|
87
|
+ u32 substitute : 1;
|
|
88
|
+ u32 destinny_bond : 1;
|
|
89
|
+ u32 cant_escape : 1;
|
|
90
|
+ u32 nightmare : 1;
|
|
91
|
+ u32 cursed : 1;
|
|
92
|
+ u32 foresight : 1;
|
|
93
|
+ u32 defense_curled : 1;
|
|
94
|
+ u32 tormented : 1;
|
|
95
|
+};
|
|
96
|
+
|
|
97
|
+struct iv_set
|
|
98
|
+{
|
|
99
|
+ u32 iv_hp: 5;
|
|
100
|
+ u32 iv_atk: 5;
|
|
101
|
+ u32 iv_def: 5;
|
|
102
|
+ u32 iv_spd: 5;
|
|
103
|
+ u32 iv_sp_atk: 5;
|
|
104
|
+ u32 iv_sp_def: 5;
|
|
105
|
+};
|
|
106
|
+
|
|
107
|
+struct pokemon{
|
|
108
|
+ u32 PID;
|
|
109
|
+ u32 OTID;
|
|
110
|
+ char name[10];
|
|
111
|
+ u16 language;
|
|
112
|
+ u8 OT_name[7];
|
|
113
|
+ u8 markings;
|
|
114
|
+ u16 checksum;
|
|
115
|
+ u16 padding_maybe;
|
|
116
|
+ u8 data[48];
|
|
117
|
+ u32 ailment;
|
|
118
|
+ u8 level;
|
|
119
|
+ u8 pokerus;
|
|
120
|
+ u16 current_hp;
|
|
121
|
+ u16 total_hp;
|
|
122
|
+ u16 attack;
|
|
123
|
+ u16 defense;
|
|
124
|
+ u16 speed;
|
|
125
|
+ u16 sp_attack;
|
|
126
|
+ u16 sp_defense;
|
|
127
|
+};
|
|
128
|
+
|
|
129
|
+extern struct pokemon party_opponent[6];
|
|
130
|
+extern struct pokemon party_player[6];
|
|
131
|
+
|
|
132
|
+struct battle_participant {
|
|
133
|
+ u16 poke_species;
|
|
134
|
+ u16 atk;
|
|
135
|
+ u16 def;
|
|
136
|
+ u16 spd;
|
|
137
|
+ u16 sp_atk;
|
|
138
|
+ u16 sp_def;
|
|
139
|
+ u16 moves[4];
|
|
140
|
+ struct iv_set ivs;
|
|
141
|
+ u8 hp_buff;
|
|
142
|
+ u8 atk_buff;
|
|
143
|
+ u8 def_buff;
|
|
144
|
+ u8 spd_buff;
|
|
145
|
+ u8 sp_atk_buff;
|
|
146
|
+ u8 sp_def_buff;
|
|
147
|
+ u8 acc_buff;
|
|
148
|
+ u8 evasion_buff;
|
|
149
|
+ u8 ability_id;
|
|
150
|
+ u8 type1;
|
|
151
|
+ u8 type2;
|
|
152
|
+ u8 padd;
|
|
153
|
+ u8 current_pp[4];
|
|
154
|
+ u16 current_hp;
|
|
155
|
+ u8 level;
|
|
156
|
+ u8 happiness;
|
|
157
|
+ u16 max_hp;
|
|
158
|
+ u16 held_item;
|
|
159
|
+ u8 poke_name[12];
|
|
160
|
+ u8 trainer_name[8];
|
|
161
|
+ u32 padd2;
|
|
162
|
+ u32 pid;
|
|
163
|
+ union main_status status;
|
|
164
|
+ struct flags2 status2;
|
|
165
|
+ u32 otid;
|
|
166
|
+};
|
|
167
|
+
|
|
168
|
+extern struct battle_participant battle_participants[4];
|
|
169
|
+
|
|
170
|
+struct side_timer{
|
|
171
|
+ u8 reflect_timer;
|
|
172
|
+ u8 reflect_bank;
|
|
173
|
+ u8 lightscreen_timer;
|
|
174
|
+ u8 lightscreen_bank;
|
|
175
|
+ u8 mist_timer;
|
|
176
|
+ u8 mist_bank;
|
|
177
|
+ u8 safeguard_timer;
|
|
178
|
+ u8 safeguard_bank;
|
|
179
|
+ u8 followme_timer;
|
|
180
|
+ u8 followme_target;
|
|
181
|
+ u8 spikes_amount;
|
|
182
|
+ u8 fieldB;
|
|
183
|
+};
|
|
184
|
+
|
|
185
|
+extern struct side_timer battle_side_timers[2];
|
|
186
|
+
|
|
187
|
+struct in_battle_weather{
|
|
188
|
+ u32 rain : 1;
|
|
189
|
+ u32 downpour : 1;
|
|
190
|
+ u32 permament_rain : 1;
|
|
191
|
+ u32 sandstorm : 1;
|
|
192
|
+ u32 permament_sandstorm : 1;
|
|
193
|
+ u32 sun : 1;
|
|
194
|
+ u32 permament_sun : 1;
|
|
195
|
+ u32 hail : 1;
|
|
196
|
+ //custom flags
|
|
197
|
+ u32 permament_hail : 1;
|
|
198
|
+ u32 fog : 1;
|
|
199
|
+ u32 permament_fog : 1;
|
|
200
|
+ u32 harsh_sun : 1;
|
|
201
|
+ u32 heavy_rain : 1;
|
|
202
|
+ u32 air_current : 1;
|
|
203
|
+};
|
|
204
|
+
|
|
205
|
+struct status_3{
|
|
206
|
+ u32 leech_seed_hp_receiver : 2; // 2 bits
|
|
207
|
+ u32 leech_seed : 1; //4
|
|
208
|
+ u32 always_hits : 2; //x8 | x10
|
|
209
|
+ u32 perish_song : 1; //x20
|
|
210
|
+ u32 on_air : 1; //x40
|
|
211
|
+ u32 underground : 1;//80
|
|
212
|
+ u32 minimized : 1; //x100
|
|
213
|
+ u32 charged_up : 1; //x200
|
|
214
|
+ u32 rooted : 1; //x400
|
|
215
|
+ u32 yawn : 2; //x800 || x1000
|
|
216
|
+ u32 imprision : 1; //x2000
|
|
217
|
+ u32 grudge : 1; //x4000
|
|
218
|
+ u32 unkown_no_crit : 1; //x8000
|
|
219
|
+ u32 mud_sport : 1; //x10 000
|
|
220
|
+ u32 watersport : 1; //x20 000
|
|
221
|
+ u32 underwater : 1; //x40 000
|
|
222
|
+ u32 switchinlock : 1; //x80 000
|
|
223
|
+ u32 unburden : 1; //x100 000 (previously trace)
|
|
224
|
+ u32 phantomforce : 1; //x200 000
|
|
225
|
+};
|
|
226
|
+
|
|
227
|
+extern struct status_3 battle_status_3[4];
|
|
228
|
+
|
|
229
|
+union battle_weather{
|
|
230
|
+ u32 int_bw;
|
|
231
|
+ struct in_battle_weather flags;
|
|
232
|
+};
|
|
233
|
+
|
|
234
|
+extern union battle_weather battle_weather;
|
|
235
|
+
|
|
236
|
+struct mirror_move_set_per_bank
|
|
237
|
+{
|
|
238
|
+ u16 moves_per_target[4];
|
|
239
|
+};
|
|
240
|
+
|
|
241
|
+struct battle_stuff{
|
|
242
|
+ u8 end_turn_statetracker1; //0x0
|
|
243
|
+ u8 end_turn_checked_bank; //0x1
|
|
244
|
+ u8 field_2; //0x2
|
|
245
|
+ u8 end_turn_statetracker2; //0x3
|
|
246
|
+ u16 trapped_move[4]; //0x4 - 0xB
|
|
247
|
+ u8 move_target[4]; //0xC - 0xF
|
|
248
|
+ u8 field_10; //0x10
|
|
249
|
+ u8 field_11; //0x11
|
|
250
|
+ u8 field_12; //0x12
|
|
251
|
+ u8 dynamic_move_type; //0x13
|
|
252
|
+ u8 trapper[4];//0x14-0x17
|
|
253
|
+ u8 field_18[48]; //0x18-0x47
|
|
254
|
+ u8 pre_attacks_bank_counter; //0x48
|
|
255
|
+ u8 field_49; //0x49
|
|
256
|
+ u8 money_multiplier; //0x4A
|
|
257
|
+ u8 field_4B; //0x4B
|
|
258
|
+ u8 switch_in_ability_bank_counter; //0x4C
|
|
259
|
+ u8 field_4D[7]; //0x4D-0x53
|
|
260
|
+ u8 field_54; //0x54
|
|
261
|
+ u8 field_55; //0x55
|
|
262
|
+ u8 field_56; //0x56
|
|
263
|
+ u8 field_57; //0x57
|
|
264
|
+ u8 field_58[4];
|
|
265
|
+ u8 field_5C[35];
|
|
266
|
+ u8 castform_switch_form; //0x7F
|
|
267
|
+ u8 chosen_move_position[4]; //0x80
|
|
268
|
+ u8 field_84[13]; //0x84-0x90
|
|
269
|
+ u8 absent_bank_flags_prev_turn; //0x91
|
|
270
|
+ u8 field_92[6]; //0x92-0x97
|
|
271
|
+ u16 mirror_moves_pbs[4]; //0x98-0x9F
|
|
272
|
+ u8 field_A0[18]; //0xA0-0xB1
|
|
273
|
+ u8 synchronize_effect_chooser; //0xB2
|
|
274
|
+ u8 field_B3[5];
|
|
275
|
+ u16 used_held_items[4]; //0xB8-0xBF
|
|
276
|
+ u8 field_C0[8]; //0xC0-0xC7
|
|
277
|
+ u16 choiced_move[4]; //0xC8-0xCF (checked in cmd49)
|
|
278
|
+ u16 changed_held_items[4]; //0xD0-0xD8 (later written to battlestruct in cmd49)
|
|
279
|
+ u8 intimidate_user; //0xD8
|
|
280
|
+ u8 switch_in_item_bank_counter; //0xD9
|
|
281
|
+ u8 field_DA; //0xDA
|
|
282
|
+ u8 field_DB; //0xDB
|
|
283
|
+ u8 field_DC; //0xDC
|
|
284
|
+ u8 field_DD; //0xDD
|
|
285
|
+ u8 field_DE; //0xDE
|
|
286
|
+ u8 field_DF; //0xDF
|
|
287
|
+ struct mirror_move_set_per_bank mirror_move_set_pbs[4]; //0xE0-0xFF
|
|
288
|
+ u8 field_100[162]; //0x100-0x1A1
|
|
289
|
+ u8 battle_load_weather_from_map_flag; //0x1A2
|
|
290
|
+ u8 atk_canceller_state_tracker; //0x1A3
|
|
291
|
+ u8 field_1A4[240]; //0x1A4-0x293
|
|
292
|
+ u8 switchout_index[4]; //0x294-0x297
|
|
293
|
+ u8 field_298[11];
|
|
294
|
+ u8 field_2A3;
|
|
295
|
+};
|
|
296
|
+
|
|
297
|
+struct battle_stuff_struct{
|
|
298
|
+ struct battle_stuff *ptr;
|
|
299
|
+};
|
|
300
|
+
|
|
301
|
+extern struct battle_stuff_struct battle_stuff_ptr;
|
|
302
|
+
|
|
303
|
+struct prop_flags{
|
|
304
|
+ u8 makes_contact : 1;//1
|
|
305
|
+ u8 affected_by_protect : 1;//2
|
|
306
|
+ u8 affected_by_magic_coat : 1;//4
|
|
307
|
+ u8 affected_by_snatch : 1;//8
|
|
308
|
+ u8 affected_by_mirrormove :1;//x10
|
|
309
|
+ u8 affected_by_kingsrock :1;//x20
|
|
310
|
+ u8 raised_crit_ratio :1;//x40
|
|
311
|
+ u8 unused_bit : 1;//x80
|
|
312
|
+};
|
|
313
|
+
|
|
314
|
+union move_flags{
|
|
315
|
+ u8 int_flag;
|
|
316
|
+ struct prop_flags flags;
|
|
317
|
+};
|
|
318
|
+
|
|
319
|
+struct move_info{
|
|
320
|
+ u8 script_id;
|
|
321
|
+ u8 base_power;
|
|
322
|
+ u8 type;
|
|
323
|
+ u8 accuracy;
|
|
324
|
+ u8 pp;
|
|
325
|
+ u8 effect_chance;
|
|
326
|
+ u8 target;
|
|
327
|
+ s8 priority;
|
|
328
|
+ union move_flags move_flags;
|
|
329
|
+ u8 arg1;
|
|
330
|
+ u8 split;
|
|
331
|
+ u8 arg2;
|
|
332
|
+};
|
|
333
|
+
|
|
334
|
+struct b_enigma_berry{
|
|
335
|
+ u8 field0[7];
|
|
336
|
+ u8 battle_effect_x12;
|
|
337
|
+ u8 field8[18];
|
|
338
|
+ u8 quality;
|
|
339
|
+ u8 field1B;
|
|
340
|
+};
|
|
341
|
+
|
|
342
|
+extern struct b_enigma_berry battle_enigma_berry[4];
|
|
343
|
+
|
|
344
|
+// trainerbattle stuff
|
|
345
|
+
|
|
346
|
+extern u16 trainerbattle_flag_id;
|
|
347
|
+
|
|
348
|
+extern struct {
|
|
349
|
+ u8 battle_double : 1; // 1
|
|
350
|
+ u8 battle_link : 1; // 2
|
|
351
|
+ u8 battle_wild : 1; // 4
|
|
352
|
+ u8 battle_trainer : 1; // 8
|
|
353
|
+ u8 battle_oak_comments : 1; //0x10
|
|
354
|
+ u8 _battle_unk_1 : 1; //0x20
|
|
355
|
+ u8 battle_double_2 : 1; //0x40
|
|
356
|
+ u8 battle_safari : 1; //0x80
|
|
357
|
+ u8 battle_trainer_tower : 1;//0x100
|
|
358
|
+ u8 _battle_unk_2 : 1; //0x200
|
|
359
|
+ u8 battle_old_man : 1; //0x400
|
|
360
|
+ u8 battle_trainer_tower_2 : 1;//0x800
|
|
361
|
+ u8 _battle_unk_3 : 1; //0x1000
|
|
362
|
+ u8 _battle_unk_4 : 1; //0x2000
|
|
363
|
+ u8 _battle_unk_5 : 1; //0x4000
|
|
364
|
+ u8 battle_ghost : 1; //0x8000
|
|
365
|
+ u8 battle_poke_dude : 1; //0x10000
|
|
366
|
+ u8 _battle_unk_6 : 1; //0x20000
|
|
367
|
+ u8 battle_secret_base : 1; //0x40000
|
|
368
|
+} battle_type_flags;
|
|
369
|
+
|
|
370
|
+_Static_assert(sizeof(battle_type_flags) <= 4, "Invalid struct size for battle_type_flags");
|
|
371
|
+
|
|
372
|
+struct trainer_table_entry {
|
|
373
|
+ u8 _unk_1;
|
|
374
|
+ u8 trainer_class;
|
|
375
|
+ u8 encounter_music;
|
|
376
|
+ u8 _unk_2;
|
|
377
|
+ u8 _unk_3[16];
|
|
378
|
+ u8 _unk_4[16];
|
|
379
|
+ u32 _unk; // probably pokemon data
|
|
380
|
+};
|
|
381
|
+
|
|
382
|
+_Static_assert(sizeof(struct trainer_table_entry) == 0x28, "Invalid struct size for trainer_table_entry");
|
|
383
|
+
|
|
384
|
+extern struct trainer_table_entry trainer_data[];
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+#endif
|