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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
|
@ Add a positive/negative value to the score of the move being evaluated.
.macro score score
.byte 0x00
.byte \score
.endm
@ turn (AKA "Appeal No.")
.macro get_turn
.byte 0x01
.endm
.macro if_turn_less_than param, addr
.byte 0x02
.byte \param
.4byte \addr
.endm
.macro if_turn_more_than param, addr
.byte 0x03
.byte \param
.4byte \addr
.endm
.macro if_turn_eq param, addr
.byte 0x04
.byte \param
.4byte \addr
.endm
.macro if_turn_not_eq param, addr
.byte 0x05
.byte \param
.4byte \addr
.endm
@ audience excitement
.macro get_excitement
.byte 0x06
.endm
.macro if_excitement_less_than param, addr
.byte 0x07
.byte \param
.4byte \addr
.endm
.macro if_excitement_more_than param, addr
.byte 0x08
.byte \param
.4byte \addr
.endm
.macro if_excitement_eq param, addr
.byte 0x09
.byte \param
.4byte \addr
.endm
.macro if_excitement_not_eq param, addr
.byte 0x0A
.byte \param
.4byte \addr
.endm
@ the order that the user goes in the current turn
.macro get_user_order
.byte 0x0B
.endm
.macro if_user_order_less_than param addr
.byte 0x0C
.byte \param
.4byte \addr
.endm
.macro if_user_order_more_than param addr
.byte 0x0D
.byte \param
.4byte \addr
.endm
.macro if_user_order_eq param addr
.byte 0x0E
.byte \param
.4byte \addr
.endm
.macro if_user_order_not_eq param addr
.byte 0x0F
.byte \param
.4byte \addr
.endm
@ user condition
.macro get_user_condition
.byte 0x10
.endm
.macro if_user_condition_less_than param, addr
.byte 0x11
.byte \param
.4byte \addr
.endm
.macro if_user_condition_more_than param, addr
.byte 0x12
.byte \param
.4byte \addr
.endm
.macro if_user_condition_eq param, addr
.byte 0x13
.byte \param
.4byte \addr
.endm
.macro if_user_condition_not_eq param, addr
.byte 0x14
.byte \param
.4byte \addr
.endm
@ 15
@ 16
@ 17
@ 18
@ 19
@ 1A
@ 1B
@ 1C
@ 1D
@ 1E
@ contest type
.macro get_contest_type
.byte 0x1F
.endm
.macro if_contest_type_eq param, addr
.byte 0x20
.byte \param
.4byte \addr
.endm
.macro if_contest_type_not_eq param, addr
.byte 0x21
.byte \param
.4byte \addr
.endm
@ move excitement (change in excitement due to move)
.macro get_move_excitement
.byte 0x22
.endm
.macro if_move_excitement_less_than param, addr
.byte 0x23
.byte \param
.4byte \addr
.endm
.macro if_move_excitement_more_than param, addr
.byte 0x24
.byte \param
.4byte \addr
.endm
.macro if_move_excitement_eq param, addr
.byte 0x25
.byte \param
.4byte \addr
.endm
.macro if_move_excitement_not_eq param, addr
.byte 0x26
.byte \param
.4byte \addr
.endm
@ move effect
.macro get_effect
.byte 0x27
.endm
.macro if_effect_eq param, addr
.byte 0x28
.byte \param
.4byte \addr
.endm
.macro if_effect_not_eq param, addr
.byte 0x29
.byte \param
.4byte \addr
.endm
@ move effect type
.macro get_effect_type
.byte 0x2A
.endm
.macro if_effect_type_eq param, addr
.byte 0x2B
.byte \param
.4byte \addr
.endm
.macro if_effect_type_not_eq param, addr
.byte 0x2C
.byte \param
.4byte \addr
.endm
@ whether the current move is the most appealing in the user's moveset
.macro check_most_appealing_move
.byte 0x2D
.endm
.macro if_most_appealing_move addr
.byte 0x2E
.4byte \addr
.endm
@ 2F
@ 30
@ 31
@ 32
@ 33
@ 34
@ 35
@ 36
@ 37
@ 38
@ 39
@ 3A
@ number of times current move has been used
.macro get_move_used_count
.byte 0x3B
.endm
.macro if_move_used_count_less_than param, addr
.byte 0x3C
.byte \param
.4byte \addr
.endm
.macro if_move_used_count_more_than param, addr
.byte 0x3D
.byte \param
.4byte \addr
.endm
.macro if_move_used_count_eq param, addr
.byte 0x3E
.byte \param
.4byte \addr
.endm
.macro if_move_used_count_not_eq param, addr
.byte 0x3F
.byte \param
.4byte \addr
.endm
@ whether the current move is a combo starter (with another move in the moveset)
.macro check_combo_starter
.byte 0x40
.endm
.macro if_combo_starter addr
.byte 0x41
.4byte \addr
.endm
.macro if_not_combo_starter addr
.byte 0x42
.4byte \addr
.endm
@ whether the current move is a combo finisher (with another move in the moveset)
.macro check_combo_finisher
.byte 0x43
.endm
.macro if_combo_finisher addr
.byte 0x44
.4byte \addr
.endm
.macro if_not_combo_finisher addr
.byte 0x45
.4byte \addr
.endm
@ whether the current move would finish a combo
.macro check_would_finish_combo
.byte 0x46
.endm
.macro if_would_finish_combo addr
.byte 0x47
.4byte \addr
.endm
.macro if_would_not_finish_combo addr
.byte 0x48
.4byte \addr
.endm
@ condition of mon (indexed by order)
.macro get_condition mon
.byte 0x49
.byte \mon
.endm
.macro if_condition_less_than mon, value, addr
.byte 0x4A
.byte \mon
.byte \value
.4byte \addr
.endm
.macro if_condition_more_than mon, value, addr
.byte 0x4B
.byte \mon
.byte \value
.4byte \addr
.endm
.macro if_condition_eq mon, value, addr
.byte 0x4C
.byte \mon
.byte \value
.4byte \addr
.endm
.macro if_condition_not_eq mon, value, addr
.byte 0x4D
.byte \mon
.byte \value
.4byte \addr
.endm
@ whether the mon used a combo starter move
@ Even though this value is always 1 or 0 (i.e. TRUE/FALSE),
@ there are less-than and greater-than comparison operations for some reason.
.macro get_used_combo_starter mon
.byte 0x4E
.byte \mon
.endm
.macro if_used_combo_starter_less_than mon, value, addr
.byte 0x4F
.byte \mon
.byte \value
.4byte \addr
.endm
.macro if_used_combo_starter_more_than mon, value, addr
.byte 0x50
.byte \mon
.byte \value
.4byte \addr
.endm
.macro if_used_combo_starter_eq mon, value, addr
.byte 0x51
.byte \mon
.byte \value
.4byte \addr
.endm
.macro if_used_combo_starter_not_eq mon, value, addr
.byte 0x52
.byte \mon
.byte \value
.4byte \addr
.endm
@ whether the mon can make an appeal
.macro check_can_participate mon
.byte 0x53
.byte \mon
.endm
.macro if_can_participate mon, addr
.byte 0x54
.byte \mon
.4byte \addr
.endm
.macro if_cannot_participate mon, addr
.byte 0x55
.byte \mon
.4byte \addr
.endm
@ 56
@ 57
.macro contest_58 param addr
.byte 0x58
.byte \param
.4byte \addr
.endm
@ 59
@ 5A
@ 5B
@ 5C
@ 5D
@ 5E
@ 5F
@ 60
@ 61
@ 62
@ 63
@ 64
@ 65
@ 66
@ 67
@ 68
@ 69
@ 6A
@ 6B
@ 6C
@ 6D
@ 6E
@ 6F
@ 70
@ 71
@ 72
@ 73
@ 74
@ 75
@ 76
@ 77
@ 78
@ 79
@ 7A
@ 7B
@ 7C
.macro if_random param addr
.byte 0x7D
.byte \param
.4byte \addr
.endm
@ 7E
.macro jump addr
.byte 0x7F
.4byte \addr
.endm
.macro call addr
.byte 0x80
.4byte \addr
.endm
.macro end
.byte 0x81
.endm
.macro check_user_has_exciting_move
.byte 0x82
.endm
.macro if_user_has_exciting_move addr
.byte 0x83
.4byte \addr
.endm
.macro if_user_doesnt_have_exciting_move addr
.byte 0x84
.4byte \addr
.endm
@ 85
@ 86
.macro if_effect_in_user_moveset param addr
.byte 0x87
.2byte \param
.4byte \addr
.endm
|