-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpa8.ksy
320 lines (320 loc) · 6.1 KB
/
pa8.ksy
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
meta:
id: pa8
license: MIT
endian: le
seq:
- id: h
type: header
- id: a
type: blk_a
- id: b
type: blk_b
- id: c
type: blk_c
- id: d
type: blk_d
- id: bs
type: blk_bs
types:
header:
seq:
- id: encryption_constant
type: u4
- id: sanity
type: u2
- id: checksum
type: u2
blk_a:
seq:
- id: species
type: u2
- id: held_item
type: u2
- id: tidsid
type: u4
- id: exp
type: u4
- id: ability
type: u2
- id: multi_0
type: u1
- id: unused_0
size: 1
- id: mark_value
type: u2
- id: unused_1
size: 2
- id: pid
type: u4
- id: nature
type: u1
- id: stat_nature
type: u1
- id: multi_1
type: u1
- id: unused_3
size: 1
- id: form
type: u2
- id: evs
type: u1
repeat: expr
repeat-expr: 6
- id: cnts
type: u1
repeat: expr
repeat-expr: 6
- id: multi_2
type: u1
- id: unused_4
size: 1
- id: ribbons_0
size: 10
- id: alpha_move
type: u2
- id: ribbons_1
size: 8
- id: sociability
type: u4
- id: unused_5
size: 4
- id: height_scalar
type: u1
- id: weight_scalar
type: u1
- id: height_scalar_copy
type: u1
- id : unused_6
size: 1
- id: moves
type: u2
repeat: expr
repeat-expr: 4
- id: move_pps
type: u1
repeat: expr
repeat-expr: 4
blk_b:
seq:
- id: nickname
size: 36
- id: enc_chk_0
type: enc_chk
- id: move_ppups
type: u1
repeat: expr
repeat-expr: 4
- id: relearn_moves
type: u2
repeat: expr
repeat-expr: 4
- id: stat_hpcurrent
type: u2
- id: multi_0
type: u4
- id: gmax_level
type: u1
- id: unused_0
size: 3
- id: status_condition
type: u4
- id: unka0
type: u4
- id: gvs
type: u1
repeat: expr
repeat-expr: 6
- id: unused_1
size: 2
- id: height_absolute
size: 4
- id: weight_absolute
size: 4
- id: unused_2
size: 4
blk_c:
seq:
- id: ht
size: 24
- id: enc_chk_1
type: enc_chk
- id: ht_gender
type: u1
- id: ht_language
type: u1
- id: current_handler
type: u1
- id: unused_0
type: u1
- id: ht_trainer_id
type: u2
- id: ht_friendship
type: u1
- id: ht_intensity
type: u1
- id: ht_memory
type: u1
- id: ht_feeling
type: u1
- id: ht_textvar
type: u2
- id: unused_1
size: 14
- id: fullness
type: u1
- id: enjoyment
type: u1
- id: version
type: u1
- id: battle_version
type: u1
- id: region
type: u1
- id: console_region
type: u1
- id: language
type: u1
- id: unkf3
type: u1
- id: multi_0
type: u4
- id: affixed_ribbon
type: u1
- id: unused_2
size: 23
blk_d:
seq:
- id: ot
size: 26
- id: ot_friendship
type: u1
- id: ot_intensity
type: u1
- id: ot_memory
type: u1
- id: unused_0
size: 1
- id: ot_textvar
type: u2
- id: ot_feeling
type: u1
- id: egg_date
type: u1
repeat: expr
repeat-expr: 3
- id: met_date
type: u1
repeat: expr
repeat-expr: 3
- id: ball
type: u1
- id: egg_location
type: u2
- id: met_location
type: u2
- id: unused_1
size: 1
- id: multi_0
type: u1
- id: multi_1
type: u1
- id: unused_2
size: 41
blk_bs:
seq:
- id: stat_level
type: u1
- id: unused_0
size: 1
- id: stats
type: u2
repeat: expr
repeat-expr: 6
- id: unused_1
size-eos: true
enc_chk:
seq:
- id: enc_chk
size: 2
contents: [0, 0]
instances:
species:
value: a.species
ability:
value: a.ability
multi_a0:
value: a.multi_0
ability_num:
value: 'multi_a0 & 7'
fav:
value: '(multi_a0 & 8) != 0'
can_gmax:
value: '(multi_a0 & 16) != 0'
multi_a1:
value: a.multi_1
fateful_encounter:
value: '(multi_a1 & 1) == 1'
flag2:
value: '(multi_a1 & 2) == 2'
gender:
value: '(multi_a1 >> 2) & 0x3'
language:
value: c.language
tidsid:
value: a.tidsid
pid:
value: a.pid
shiny_xor:
value: '(tidsid >> 16) ^ (tidsid & 0xFFFF) ^ (pid >> 16) ^ (pid & 0xFFFF)'
is_shiny:
value: 'shiny_xor < 15'
shiny_type:
value: 'is_shiny ? shiny_xor == 0 ? "Square" : "Star" : ""'
ball:
value: d.ball
pkrs:
value: a.multi_2
pkrs_days:
value: 'pkrs & 0xF'
pkrs_strain:
value: 'pkrs >> 4'
ivs32:
value: b.multi_0
ivs:
value: '[ivs32 & 0x1F, (ivs32 >> 5) & 0x1F, (ivs32 >> 10) & 0x1F, (ivs32 >> 15) & 0x1F, (ivs32 >> 20) & 0x1F, (ivs32 >> 25) & 0x1F]'
is_egg:
value: '((ivs32 >> 30) & 1) == 1'
has_nickname:
value: '((ivs32 >> 31) & 1) == 1'
form:
value: a.form
form_arg:
value: c.multi_0
form_arg_remain:
value: form_arg
form_arg_elapsed:
value: 'form_arg >> 8'
form_arg_max:
value: 'form_arg >> 16'
multi_d0:
value: d.multi_0
met_lvl:
value: 'multi_d0 & ~0x80'
ot_gender:
value: 'multi_d0 >> 7'
ht_flags:
value: d.multi_1
hts:
value: '[((ht_flags >> 0) & 1) == 1, ((ht_flags >> 1) & 1) == 1, ((ht_flags >> 2) & 1) == 1, ((ht_flags >> 3) & 1) == 1, ((ht_flags >> 4) & 1) == 1, ((ht_flags >> 5) & 1) == 1]'
held_item:
value: a.held_item
nature:
value: a.nature
evs:
value: a.evs
moves:
value: a.moves
ot:
value: d.ot
ot_lang:
value: c.ht_language