-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
pokemon_animation.c
5544 lines (4897 loc) · 153 KB
/
pokemon_animation.c
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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "global.h"
#include "battle.h"
#include "palette.h"
#include "pokemon.h"
#include "pokemon_animation.h"
#include "sprite.h"
#include "task.h"
#include "trig.h"
#include "util.h"
#include "data.h"
#include "constants/battle_anim.h"
#include "constants/rgb.h"
/*
This file handles the movements of the Pokémon intro animations.
Each animation type is identified by an ANIM_* constant that
refers to a sprite callback to start the animation. These functions
are named Anim_<name> or Anim_<name>_<variant>. Many of these
functions share additional movement functions to do a variation of the
same movement (e.g. a faster or larger movement).
Vertical and Horizontal are frequently shortened to V and H.
Every front animation uses 1 of these ANIMs, and every back animation
uses a BACK_ANIM_* that refers to a set of 3 ANIM functions. Which of the
3 that gets used depends on the Pokémon's nature (see sBackAnimationIds).
The table linking species to a BACK_ANIM is in this file (sSpeciesToBackAnimSet)
while the table linking species to an ANIM for their front animation is in
pokemon.c (sMonFrontAnimIdsTable).
These are the functions that will start an animation:
- LaunchAnimationTaskForFrontSprite
- LaunchAnimationTaskForBackSprite
- StartMonSummaryAnimation
*/
#define sDontFlip data[1] // TRUE if a normal animation, FALSE if Summary Screen animation
struct PokemonAnimData
{
u16 delay;
s16 speed; // Only used by 2 sets of animations
s16 runs; // Number of times to do the animation
s16 rotation;
s16 data; // General use
};
struct YellowFlashData
{
bool8 isYellow;
u8 time;
};
static void Anim_VerticalSquishBounce(struct Sprite *sprite);
static void Anim_CircularStretchTwice(struct Sprite *sprite);
static void Anim_HorizontalVibrate(struct Sprite *sprite);
static void Anim_HorizontalSlide(struct Sprite *sprite);
static void Anim_VerticalSlide(struct Sprite *sprite);
static void Anim_BounceRotateToSides(struct Sprite *sprite);
static void Anim_VerticalJumpsHorizontalJumps(struct Sprite *sprite);
static void Anim_RotateToSides(struct Sprite *sprite);
static void Anim_RotateToSides_Twice(struct Sprite *sprite);
static void Anim_GrowVibrate(struct Sprite *sprite);
static void Anim_ZigzagFast(struct Sprite *sprite);
static void Anim_SwingConcave(struct Sprite *sprite);
static void Anim_SwingConcave_Fast(struct Sprite *sprite);
static void Anim_SwingConvex(struct Sprite *sprite);
static void Anim_SwingConvex_Fast(struct Sprite *sprite);
static void Anim_HorizontalShake(struct Sprite *sprite);
static void Anim_VerticalShake(struct Sprite *sprite);
static void Anim_CircularVibrate(struct Sprite *sprite);
static void Anim_Twist(struct Sprite *sprite);
static void Anim_ShrinkGrow(struct Sprite *sprite);
static void Anim_CircleCounterclockwise(struct Sprite *sprite);
static void Anim_GlowBlack(struct Sprite *sprite);
static void Anim_HorizontalStretch(struct Sprite *sprite);
static void Anim_VerticalStretch(struct Sprite *sprite);
static void Anim_RisingWobble(struct Sprite *sprite);
static void Anim_VerticalShakeTwice(struct Sprite *sprite);
static void Anim_TipMoveForward(struct Sprite *sprite);
static void Anim_HorizontalPivot(struct Sprite *sprite);
static void Anim_VerticalSlideWobble(struct Sprite *sprite);
static void Anim_HorizontalSlideWobble(struct Sprite *sprite);
static void Anim_VerticalJumps_Big(struct Sprite *sprite);
static void Anim_Spin_Long(struct Sprite *sprite);
static void Anim_GlowOrange(struct Sprite *sprite);
static void Anim_GlowRed(struct Sprite *sprite);
static void Anim_GlowBlue(struct Sprite *sprite);
static void Anim_GlowYellow(struct Sprite *sprite);
static void Anim_GlowPurple(struct Sprite *sprite);
static void Anim_BackAndLunge(struct Sprite *sprite);
static void Anim_BackFlip(struct Sprite *sprite);
static void Anim_Flicker(struct Sprite *sprite);
static void Anim_BackFlipBig(struct Sprite *sprite);
static void Anim_FrontFlip(struct Sprite *sprite);
static void Anim_TumblingFrontFlip(struct Sprite *sprite);
static void Anim_Figure8(struct Sprite *sprite);
static void Anim_FlashYellow(struct Sprite *sprite);
static void Anim_SwingConcave_FastShort(struct Sprite *sprite);
static void Anim_SwingConvex_FastShort(struct Sprite *sprite);
static void Anim_RotateUpSlamDown(struct Sprite *sprite);
static void Anim_DeepVerticalSquishBounce(struct Sprite *sprite);
static void Anim_HorizontalJumps(struct Sprite *sprite);
static void Anim_HorizontalJumpsVerticalStretch(struct Sprite *sprite);
static void Anim_RotateToSides_Fast(struct Sprite *sprite);
static void Anim_RotateUpToSides(struct Sprite *sprite);
static void Anim_FlickerIncreasing(struct Sprite *sprite);
static void Anim_TipHopForward(struct Sprite *sprite);
static void Anim_PivotShake(struct Sprite *sprite);
static void Anim_TipAndShake(struct Sprite *sprite);
static void Anim_VibrateToCorners(struct Sprite *sprite);
static void Anim_GrowInStages(struct Sprite *sprite);
static void Anim_VerticalSpring(struct Sprite *sprite);
static void Anim_VerticalRepeatedSpring(struct Sprite *sprite);
static void Anim_SpringRising(struct Sprite *sprite);
static void Anim_HorizontalSpring(struct Sprite *sprite);
static void Anim_HorizontalRepeatedSpring_Slow(struct Sprite *sprite);
static void Anim_HorizontalSlideShrink(struct Sprite *sprite);
static void Anim_LungeGrow(struct Sprite *sprite);
static void Anim_CircleIntoBackground(struct Sprite *sprite);
static void Anim_RapidHorizontalHops(struct Sprite *sprite);
static void Anim_FourPetal(struct Sprite *sprite);
static void Anim_VerticalSquishBounce_Slow(struct Sprite *sprite);
static void Anim_HorizontalSlide_Slow(struct Sprite *sprite);
static void Anim_VerticalSlide_Slow(struct Sprite *sprite);
static void Anim_BounceRotateToSides_Small(struct Sprite *sprite);
static void Anim_BounceRotateToSides_Slow(struct Sprite *sprite);
static void Anim_BounceRotateToSides_SmallSlow(struct Sprite *sprite);
static void Anim_ZigzagSlow(struct Sprite *sprite);
static void Anim_HorizontalShake_Slow(struct Sprite *sprite);
static void Anim_VertialShake_Slow(struct Sprite *sprite);
static void Anim_Twist_Twice(struct Sprite *sprite);
static void Anim_CircleCounterclockwise_Slow(struct Sprite *sprite);
static void Anim_VerticalShakeTwice_Slow(struct Sprite *sprite);
static void Anim_VerticalSlideWobble_Small(struct Sprite *sprite);
static void Anim_VerticalJumps_Small(struct Sprite *sprite);
static void Anim_Spin(struct Sprite *sprite);
static void Anim_TumblingFrontFlip_Twice(struct Sprite *sprite);
static void Anim_DeepVerticalSquishBounce_Twice(struct Sprite *sprite);
static void Anim_HorizontalJumpsVerticalStretch_Twice(struct Sprite *sprite);
static void Anim_VerticalShakeBack(struct Sprite *sprite);
static void Anim_VerticalShakeBack_Slow(struct Sprite *sprite);
static void Anim_VerticalShakeHorizontalSlide_Slow(struct Sprite *sprite);
static void Anim_VerticalStretchBothEnds_Slow(struct Sprite *sprite);
static void Anim_HorizontalStretchFar_Slow(struct Sprite *sprite);
static void Anim_VerticalShakeLowTwice(struct Sprite *sprite);
static void Anim_HorizontalShake_Fast(struct Sprite *sprite);
static void Anim_HorizontalSlide_Fast(struct Sprite *sprite);
static void Anim_HorizontalVibrate_Fast(struct Sprite *sprite);
static void Anim_HorizontalVibrate_Fastest(struct Sprite *sprite);
static void Anim_VerticalShakeBack_Fast(struct Sprite *sprite);
static void Anim_VerticalShakeLowTwice_Slow(struct Sprite *sprite);
static void Anim_VerticalShakeLowTwice_Fast(struct Sprite *sprite);
static void Anim_CircleCounterclockwise_Long(struct Sprite *sprite);
static void Anim_GrowStutter_Slow(struct Sprite *sprite);
static void Anim_VerticalShakeHorizontalSlide(struct Sprite *sprite);
static void Anim_VerticalShakeHorizontalSlide_Fast(struct Sprite *sprite);
static void Anim_TriangleDown_Slow(struct Sprite *sprite);
static void Anim_TriangleDown(struct Sprite *sprite);
static void Anim_TriangleDown_Fast(struct Sprite *sprite);
static void Anim_Grow(struct Sprite *sprite);
static void Anim_Grow_Twice(struct Sprite *sprite);
static void Anim_HorizontalSpring_Fast(struct Sprite *sprite);
static void Anim_HorizontalSpring_Slow(struct Sprite *sprite);
static void Anim_HorizontalRepeatedSpring_Fast(struct Sprite *sprite);
static void Anim_HorizontalRepeatedSpring(struct Sprite *sprite);
static void Anim_ShrinkGrow_Fast(struct Sprite *sprite);
static void Anim_ShrinkGrow_Slow(struct Sprite *sprite);
static void Anim_VerticalStretchBothEnds(struct Sprite *sprite);
static void Anim_VerticalStretchBothEnds_Twice(struct Sprite *sprite);
static void Anim_HorizontalStretchFar_Twice(struct Sprite *sprite);
static void Anim_HorizontalStretchFar(struct Sprite *sprite);
static void Anim_GrowStutter_Twice(struct Sprite *sprite);
static void Anim_GrowStutter(struct Sprite *sprite);
static void Anim_ConcaveArcLarge_Slow(struct Sprite *sprite);
static void Anim_ConcaveArcLarge(struct Sprite *sprite);
static void Anim_ConcaveArcLarge_Twice(struct Sprite *sprite);
static void Anim_ConvexDoubleArc_Slow(struct Sprite *sprite);
static void Anim_ConvexDoubleArc(struct Sprite *sprite);
static void Anim_ConvexDoubleArc_Twice(struct Sprite *sprite);
static void Anim_ConcaveArcSmall_Slow(struct Sprite *sprite);
static void Anim_ConcaveArcSmall(struct Sprite *sprite);
static void Anim_ConcaveArcSmall_Twice(struct Sprite *sprite);
static void Anim_HorizontalDip(struct Sprite *sprite);
static void Anim_HorizontalDip_Fast(struct Sprite *sprite);
static void Anim_HorizontalDip_Twice(struct Sprite *sprite);
static void Anim_ShrinkGrowVibrate_Fast(struct Sprite *sprite);
static void Anim_ShrinkGrowVibrate(struct Sprite *sprite);
static void Anim_ShrinkGrowVibrate_Slow(struct Sprite *sprite);
static void Anim_JoltRight_Fast(struct Sprite *sprite);
static void Anim_JoltRight(struct Sprite *sprite);
static void Anim_JoltRight_Slow(struct Sprite *sprite);
static void Anim_ShakeFlashYellow_Fast(struct Sprite *sprite);
static void Anim_ShakeFlashYellow(struct Sprite *sprite);
static void Anim_ShakeFlashYellow_Slow(struct Sprite *sprite);
static void Anim_ShakeGlowRed_Fast(struct Sprite *sprite);
static void Anim_ShakeGlowRed(struct Sprite *sprite);
static void Anim_ShakeGlowRed_Slow(struct Sprite *sprite);
static void Anim_ShakeGlowGreen_Fast(struct Sprite *sprite);
static void Anim_ShakeGlowGreen(struct Sprite *sprite);
static void Anim_ShakeGlowGreen_Slow(struct Sprite *sprite);
static void Anim_ShakeGlowBlue_Fast(struct Sprite *sprite);
static void Anim_ShakeGlowBlue(struct Sprite *sprite);
static void Anim_ShakeGlowBlue_Slow(struct Sprite *sprite);
static void WaitAnimEnd(struct Sprite *sprite);
static struct PokemonAnimData sAnims[MAX_BATTLERS_COUNT];
static u8 sAnimIdx;
static bool32 sIsSummaryAnim;
static const u8 sSpeciesToBackAnimSet[] =
{
[SPECIES_BULBASAUR] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_IVYSAUR] = BACK_ANIM_H_SLIDE,
[SPECIES_VENUSAUR] = BACK_ANIM_H_SHAKE,
[SPECIES_CHARMANDER] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_CHARMELEON] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_CHARIZARD] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_SQUIRTLE] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_WARTORTLE] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_BLASTOISE] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_CATERPIE] = BACK_ANIM_H_SLIDE,
[SPECIES_METAPOD] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_BUTTERFREE] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_WEEDLE] = BACK_ANIM_H_SLIDE,
[SPECIES_KAKUNA] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_BEEDRILL] = BACK_ANIM_H_VIBRATE,
[SPECIES_PIDGEY] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_PIDGEOTTO] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_PIDGEOT] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_RATTATA] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_RATICATE] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_SPEAROW] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_FEAROW] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_EKANS] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_ARBOK] = BACK_ANIM_V_SHAKE,
[SPECIES_PIKACHU] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_RAICHU] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_SANDSHREW] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_SANDSLASH] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_NIDORAN_F] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_NIDORINA] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_NIDOQUEEN] = BACK_ANIM_V_SHAKE,
[SPECIES_NIDORAN_M] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_NIDORINO] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_NIDOKING] = BACK_ANIM_V_SHAKE,
[SPECIES_CLEFAIRY] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_CLEFABLE] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_VULPIX] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_NINETALES] = BACK_ANIM_H_VIBRATE,
[SPECIES_JIGGLYPUFF] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_WIGGLYTUFF] = BACK_ANIM_GROW,
[SPECIES_ZUBAT] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_GOLBAT] = BACK_ANIM_V_SHAKE,
[SPECIES_ODDISH] = BACK_ANIM_H_SLIDE,
[SPECIES_GLOOM] = BACK_ANIM_H_SLIDE,
[SPECIES_VILEPLUME] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_PARAS] = BACK_ANIM_H_SLIDE,
[SPECIES_PARASECT] = BACK_ANIM_H_SHAKE,
[SPECIES_VENONAT] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_VENOMOTH] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_DIGLETT] = BACK_ANIM_V_SHAKE,
[SPECIES_DUGTRIO] = BACK_ANIM_V_SHAKE,
[SPECIES_MEOWTH] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_PERSIAN] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_PSYDUCK] = BACK_ANIM_H_SLIDE,
[SPECIES_GOLDUCK] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_MANKEY] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_PRIMEAPE] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_GROWLITHE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_ARCANINE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_POLIWAG] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_POLIWHIRL] = BACK_ANIM_V_SHAKE,
[SPECIES_POLIWRATH] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_ABRA] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_KADABRA] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_ALAKAZAM] = BACK_ANIM_GROW_STUTTER,
[SPECIES_MACHOP] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_MACHOKE] = BACK_ANIM_V_SHAKE,
[SPECIES_MACHAMP] = BACK_ANIM_V_SHAKE,
[SPECIES_BELLSPROUT] = BACK_ANIM_V_STRETCH,
[SPECIES_WEEPINBELL] = BACK_ANIM_V_STRETCH,
[SPECIES_VICTREEBEL] = BACK_ANIM_V_STRETCH,
[SPECIES_TENTACOOL] = BACK_ANIM_H_SLIDE,
[SPECIES_TENTACRUEL] = BACK_ANIM_H_SLIDE,
[SPECIES_GEODUDE] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_GRAVELER] = BACK_ANIM_H_SHAKE,
[SPECIES_GOLEM] = BACK_ANIM_H_SHAKE,
[SPECIES_PONYTA] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_RAPIDASH] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SLOWPOKE] = BACK_ANIM_H_SLIDE,
[SPECIES_SLOWBRO] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_MAGNEMITE] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_MAGNETON] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_FARFETCHD] = BACK_ANIM_H_SLIDE,
[SPECIES_DODUO] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_DODRIO] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SEEL] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_DEWGONG] = BACK_ANIM_H_SLIDE,
[SPECIES_GRIMER] = BACK_ANIM_V_STRETCH,
[SPECIES_MUK] = BACK_ANIM_H_STRETCH,
[SPECIES_SHELLDER] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_CLOYSTER] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_GASTLY] = BACK_ANIM_H_VIBRATE,
[SPECIES_HAUNTER] = BACK_ANIM_H_VIBRATE,
[SPECIES_GENGAR] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_ONIX] = BACK_ANIM_V_SHAKE,
[SPECIES_DROWZEE] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_HYPNO] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_KRABBY] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_KINGLER] = BACK_ANIM_V_SHAKE,
[SPECIES_VOLTORB] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_ELECTRODE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_EXEGGCUTE] = BACK_ANIM_H_SLIDE,
[SPECIES_EXEGGUTOR] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_CUBONE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_MAROWAK] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_HITMONLEE] = BACK_ANIM_H_SLIDE,
[SPECIES_HITMONCHAN] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_LICKITUNG] = BACK_ANIM_H_SLIDE,
[SPECIES_KOFFING] = BACK_ANIM_GROW,
[SPECIES_WEEZING] = BACK_ANIM_GROW,
[SPECIES_RHYHORN] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_RHYDON] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_CHANSEY] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_TANGELA] = BACK_ANIM_V_STRETCH,
[SPECIES_KANGASKHAN] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_HORSEA] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_SEADRA] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_GOLDEEN] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_SEAKING] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_STARYU] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_STARMIE] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_MR_MIME] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_SCYTHER] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_JYNX] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_ELECTABUZZ] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_MAGMAR] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_PINSIR] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_TAUROS] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_MAGIKARP] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_GYARADOS] = BACK_ANIM_V_SHAKE,
[SPECIES_LAPRAS] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_DITTO] = BACK_ANIM_SHRINK_GROW,
[SPECIES_EEVEE] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_VAPOREON] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_JOLTEON] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_FLAREON] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_PORYGON] = BACK_ANIM_H_VIBRATE,
[SPECIES_OMANYTE] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_OMASTAR] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_KABUTO] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_KABUTOPS] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_AERODACTYL] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SNORLAX] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_ARTICUNO] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_ZAPDOS] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_MOLTRES] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_DRATINI] = BACK_ANIM_H_SLIDE,
[SPECIES_DRAGONAIR] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_DRAGONITE] = BACK_ANIM_V_SHAKE,
[SPECIES_MEWTWO] = BACK_ANIM_GROW_STUTTER,
[SPECIES_MEW] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_CHIKORITA] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_BAYLEEF] = BACK_ANIM_H_SLIDE,
[SPECIES_MEGANIUM] = BACK_ANIM_V_SHAKE,
[SPECIES_CYNDAQUIL] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_QUILAVA] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_TYPHLOSION] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_TOTODILE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_CROCONAW] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_FERALIGATR] = BACK_ANIM_V_SHAKE,
[SPECIES_SENTRET] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_FURRET] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_HOOTHOOT] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_NOCTOWL] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_LEDYBA] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_LEDIAN] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_SPINARAK] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_ARIADOS] = BACK_ANIM_H_SLIDE,
[SPECIES_CROBAT] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_CHINCHOU] = BACK_ANIM_V_STRETCH,
[SPECIES_LANTURN] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_PICHU] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_CLEFFA] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_IGGLYBUFF] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_TOGEPI] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_TOGETIC] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_NATU] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_XATU] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_MAREEP] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_FLAAFFY] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_AMPHAROS] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_BELLOSSOM] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_MARILL] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_AZUMARILL] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_SUDOWOODO] = BACK_ANIM_H_SLIDE,
[SPECIES_POLITOED] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_HOPPIP] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_SKIPLOOM] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_JUMPLUFF] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_AIPOM] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_SUNKERN] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_SUNFLORA] = BACK_ANIM_H_SLIDE,
[SPECIES_YANMA] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_WOOPER] = BACK_ANIM_V_STRETCH,
[SPECIES_QUAGSIRE] = BACK_ANIM_H_SLIDE,
[SPECIES_ESPEON] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UMBREON] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_MURKROW] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_SLOWKING] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_MISDREAVUS] = BACK_ANIM_H_VIBRATE,
[SPECIES_UNOWN] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_WOBBUFFET] = BACK_ANIM_V_STRETCH,
[SPECIES_GIRAFARIG] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_PINECO] = BACK_ANIM_H_SHAKE,
[SPECIES_FORRETRESS] = BACK_ANIM_V_SHAKE,
[SPECIES_DUNSPARCE] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_GLIGAR] = BACK_ANIM_SHRINK_GROW,
[SPECIES_STEELIX] = BACK_ANIM_V_SHAKE,
[SPECIES_SNUBBULL] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_GRANBULL] = BACK_ANIM_V_SHAKE,
[SPECIES_QWILFISH] = BACK_ANIM_GROW_STUTTER,
[SPECIES_SCIZOR] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SHUCKLE] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_HERACROSS] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SNEASEL] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_TEDDIURSA] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_URSARING] = BACK_ANIM_V_SHAKE,
[SPECIES_SLUGMA] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_MAGCARGO] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_SWINUB] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_PILOSWINE] = BACK_ANIM_H_SHAKE,
[SPECIES_CORSOLA] = BACK_ANIM_H_SLIDE,
[SPECIES_REMORAID] = BACK_ANIM_H_SLIDE,
[SPECIES_OCTILLERY] = BACK_ANIM_SHRINK_GROW,
[SPECIES_DELIBIRD] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_MANTINE] = BACK_ANIM_H_SLIDE,
[SPECIES_SKARMORY] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_HOUNDOUR] = BACK_ANIM_V_SHAKE,
[SPECIES_HOUNDOOM] = BACK_ANIM_V_SHAKE,
[SPECIES_KINGDRA] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_PHANPY] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_DONPHAN] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_PORYGON2] = BACK_ANIM_H_VIBRATE,
[SPECIES_STANTLER] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_SMEARGLE] = BACK_ANIM_H_SLIDE,
[SPECIES_TYROGUE] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_HITMONTOP] = BACK_ANIM_CIRCLE_COUNTERCLOCKWISE,
[SPECIES_SMOOCHUM] = BACK_ANIM_H_SLIDE,
[SPECIES_ELEKID] = BACK_ANIM_H_SHAKE,
[SPECIES_MAGBY] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_MILTANK] = BACK_ANIM_H_SLIDE,
[SPECIES_BLISSEY] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_RAIKOU] = BACK_ANIM_SHAKE_FLASH_YELLOW,
[SPECIES_ENTEI] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_SUICUNE] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_LARVITAR] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_PUPITAR] = BACK_ANIM_V_SHAKE,
[SPECIES_TYRANITAR] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_LUGIA] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_HO_OH] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_CELEBI] = BACK_ANIM_SHAKE_GLOW_GREEN,
[SPECIES_TREECKO] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_GROVYLE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SCEPTILE] = BACK_ANIM_V_SHAKE,
[SPECIES_TORCHIC] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_COMBUSKEN] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_BLAZIKEN] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_MUDKIP] = BACK_ANIM_H_SLIDE,
[SPECIES_MARSHTOMP] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_SWAMPERT] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_POOCHYENA] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_MIGHTYENA] = BACK_ANIM_H_SHAKE,
[SPECIES_ZIGZAGOON] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_LINOONE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_WURMPLE] = BACK_ANIM_V_STRETCH,
[SPECIES_SILCOON] = BACK_ANIM_H_SHAKE,
[SPECIES_BEAUTIFLY] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_CASCOON] = BACK_ANIM_H_SHAKE,
[SPECIES_DUSTOX] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_LOTAD] = BACK_ANIM_H_SLIDE,
[SPECIES_LOMBRE] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_LUDICOLO] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_SEEDOT] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_NUZLEAF] = BACK_ANIM_V_SHAKE,
[SPECIES_SHIFTRY] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_NINCADA] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_NINJASK] = BACK_ANIM_H_VIBRATE,
[SPECIES_SHEDINJA] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_TAILLOW] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_SWELLOW] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SHROOMISH] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_BRELOOM] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_SPINDA] = BACK_ANIM_CIRCLE_COUNTERCLOCKWISE,
[SPECIES_WINGULL] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_PELIPPER] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_SURSKIT] = BACK_ANIM_H_SPRING,
[SPECIES_MASQUERAIN] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_WAILMER] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_WAILORD] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_SKITTY] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_DELCATTY] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_KECLEON] = BACK_ANIM_H_VIBRATE,
[SPECIES_BALTOY] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_CLAYDOL] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_NOSEPASS] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_TORKOAL] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_SABLEYE] = BACK_ANIM_H_VIBRATE,
[SPECIES_BARBOACH] = BACK_ANIM_V_STRETCH,
[SPECIES_WHISCASH] = BACK_ANIM_V_SHAKE,
[SPECIES_LUVDISC] = BACK_ANIM_H_SPRING_REPEATED,
[SPECIES_CORPHISH] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_CRAWDAUNT] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_FEEBAS] = BACK_ANIM_H_SPRING,
[SPECIES_MILOTIC] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_CARVANHA] = BACK_ANIM_H_SPRING_REPEATED,
[SPECIES_SHARPEDO] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_TRAPINCH] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_VIBRAVA] = BACK_ANIM_H_VIBRATE,
[SPECIES_FLYGON] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_MAKUHITA] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_HARIYAMA] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_ELECTRIKE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_MANECTRIC] = BACK_ANIM_V_SHAKE,
[SPECIES_NUMEL] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_CAMERUPT] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_SPHEAL] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_SEALEO] = BACK_ANIM_V_SHAKE,
[SPECIES_WALREIN] = BACK_ANIM_V_SHAKE,
[SPECIES_CACNEA] = BACK_ANIM_V_SHAKE_H_SLIDE,
[SPECIES_CACTURNE] = BACK_ANIM_H_SHAKE,
[SPECIES_SNORUNT] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_GLALIE] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_LUNATONE] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_SOLROCK] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_AZURILL] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_SPOINK] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_GRUMPIG] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_PLUSLE] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_MINUN] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_MAWILE] = BACK_ANIM_V_SHAKE,
[SPECIES_MEDITITE] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_MEDICHAM] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_SWABLU] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_ALTARIA] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_WYNAUT] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_DUSKULL] = BACK_ANIM_H_VIBRATE,
[SPECIES_DUSCLOPS] = BACK_ANIM_H_VIBRATE,
[SPECIES_ROSELIA] = BACK_ANIM_SHAKE_GLOW_GREEN,
[SPECIES_SLAKOTH] = BACK_ANIM_H_SLIDE,
[SPECIES_VIGOROTH] = BACK_ANIM_CONCAVE_ARC_LARGE,
[SPECIES_SLAKING] = BACK_ANIM_H_SHAKE,
[SPECIES_GULPIN] = BACK_ANIM_V_STRETCH,
[SPECIES_SWALOT] = BACK_ANIM_V_STRETCH,
[SPECIES_TROPIUS] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_WHISMUR] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_LOUDRED] = BACK_ANIM_V_SHAKE,
[SPECIES_EXPLOUD] = BACK_ANIM_GROW_STUTTER,
[SPECIES_CLAMPERL] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_HUNTAIL] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_GOREBYSS] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_ABSOL] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_SHUPPET] = BACK_ANIM_H_VIBRATE,
[SPECIES_BANETTE] = BACK_ANIM_H_VIBRATE,
[SPECIES_SEVIPER] = BACK_ANIM_V_STRETCH,
[SPECIES_ZANGOOSE] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_RELICANTH] = BACK_ANIM_H_SLIDE,
[SPECIES_ARON] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_LAIRON] = BACK_ANIM_V_SHAKE,
[SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_CASTFORM] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_VOLBEAT] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_ILLUMISE] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_LILEEP] = BACK_ANIM_H_STRETCH,
[SPECIES_CRADILY] = BACK_ANIM_V_STRETCH,
[SPECIES_ANORITH] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_ARMALDO] = BACK_ANIM_V_SHAKE,
[SPECIES_RALTS] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_KIRLIA] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_GARDEVOIR] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_BAGON] = BACK_ANIM_V_SHAKE,
[SPECIES_SHELGON] = BACK_ANIM_V_SHAKE,
[SPECIES_SALAMENCE] = BACK_ANIM_H_SHAKE,
[SPECIES_BELDUM] = BACK_ANIM_TRIANGLE_DOWN,
[SPECIES_METANG] = BACK_ANIM_JOLT_RIGHT,
[SPECIES_METAGROSS] = BACK_ANIM_V_SHAKE,
[SPECIES_REGIROCK] = BACK_ANIM_V_SHAKE,
[SPECIES_REGICE] = BACK_ANIM_V_SHAKE,
[SPECIES_REGISTEEL] = BACK_ANIM_V_SHAKE,
[SPECIES_KYOGRE] = BACK_ANIM_SHAKE_GLOW_BLUE,
[SPECIES_GROUDON] = BACK_ANIM_SHAKE_GLOW_RED,
[SPECIES_RAYQUAZA] = BACK_ANIM_GROW_STUTTER,
[SPECIES_LATIAS] = BACK_ANIM_H_VIBRATE,
[SPECIES_LATIOS] = BACK_ANIM_H_VIBRATE,
[SPECIES_JIRACHI] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_DEOXYS] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_CHIMECHO] = BACK_ANIM_CONVEX_DOUBLE_ARC,
};
// Equivalent to struct YellowFlashData, but doesn't match as a struct
static const u8 sYellowFlashData[][2] =
{
{FALSE, 5},
{ TRUE, 1},
{FALSE, 15},
{ TRUE, 4},
{FALSE, 2},
{ TRUE, 2},
{FALSE, 2},
{ TRUE, 2},
{FALSE, 2},
{ TRUE, 2},
{FALSE, 2},
{ TRUE, 2},
{FALSE, 2},
{FALSE, -1}
};
static const u8 sVerticalShakeData[][2] =
{
{ 6, 30},
{-2, 15},
{ 6, 30},
{-1, 0}
};
static void (* const sMonAnimFunctions[])(struct Sprite *sprite) =
{
[ANIM_V_SQUISH_AND_BOUNCE] = Anim_VerticalSquishBounce,
[ANIM_CIRCULAR_STRETCH_TWICE] = Anim_CircularStretchTwice,
[ANIM_H_VIBRATE] = Anim_HorizontalVibrate,
[ANIM_H_SLIDE] = Anim_HorizontalSlide,
[ANIM_V_SLIDE] = Anim_VerticalSlide,
[ANIM_BOUNCE_ROTATE_TO_SIDES] = Anim_BounceRotateToSides,
[ANIM_V_JUMPS_H_JUMPS] = Anim_VerticalJumpsHorizontalJumps,
[ANIM_ROTATE_TO_SIDES] = Anim_RotateToSides, // Unused
[ANIM_ROTATE_TO_SIDES_TWICE] = Anim_RotateToSides_Twice,
[ANIM_GROW_VIBRATE] = Anim_GrowVibrate,
[ANIM_ZIGZAG_FAST] = Anim_ZigzagFast,
[ANIM_SWING_CONCAVE] = Anim_SwingConcave,
[ANIM_SWING_CONCAVE_FAST] = Anim_SwingConcave_Fast,
[ANIM_SWING_CONVEX] = Anim_SwingConvex,
[ANIM_SWING_CONVEX_FAST] = Anim_SwingConvex_Fast,
[ANIM_H_SHAKE] = Anim_HorizontalShake,
[ANIM_V_SHAKE] = Anim_VerticalShake,
[ANIM_CIRCULAR_VIBRATE] = Anim_CircularVibrate,
[ANIM_TWIST] = Anim_Twist,
[ANIM_SHRINK_GROW] = Anim_ShrinkGrow,
[ANIM_CIRCLE_C_CLOCKWISE] = Anim_CircleCounterclockwise,
[ANIM_GLOW_BLACK] = Anim_GlowBlack,
[ANIM_H_STRETCH] = Anim_HorizontalStretch,
[ANIM_V_STRETCH] = Anim_VerticalStretch,
[ANIM_RISING_WOBBLE] = Anim_RisingWobble,
[ANIM_V_SHAKE_TWICE] = Anim_VerticalShakeTwice,
[ANIM_TIP_MOVE_FORWARD] = Anim_TipMoveForward,
[ANIM_H_PIVOT] = Anim_HorizontalPivot,
[ANIM_V_SLIDE_WOBBLE] = Anim_VerticalSlideWobble,
[ANIM_H_SLIDE_WOBBLE] = Anim_HorizontalSlideWobble,
[ANIM_V_JUMPS_BIG] = Anim_VerticalJumps_Big,
[ANIM_SPIN_LONG] = Anim_Spin_Long, // Unused
[ANIM_GLOW_ORANGE] = Anim_GlowOrange,
[ANIM_GLOW_RED] = Anim_GlowRed, // Unused
[ANIM_GLOW_BLUE] = Anim_GlowBlue,
[ANIM_GLOW_YELLOW] = Anim_GlowYellow, // Unused
[ANIM_GLOW_PURPLE] = Anim_GlowPurple, // Unused
[ANIM_BACK_AND_LUNGE] = Anim_BackAndLunge,
[ANIM_BACK_FLIP] = Anim_BackFlip, // Unused
[ANIM_FLICKER] = Anim_Flicker, // Unused
[ANIM_BACK_FLIP_BIG] = Anim_BackFlipBig, // Unused
[ANIM_FRONT_FLIP] = Anim_FrontFlip,
[ANIM_TUMBLING_FRONT_FLIP] = Anim_TumblingFrontFlip, // Unused
[ANIM_FIGURE_8] = Anim_Figure8,
[ANIM_FLASH_YELLOW] = Anim_FlashYellow,
[ANIM_SWING_CONCAVE_FAST_SHORT] = Anim_SwingConcave_FastShort,
[ANIM_SWING_CONVEX_FAST_SHORT] = Anim_SwingConvex_FastShort, // Unused
[ANIM_ROTATE_UP_SLAM_DOWN] = Anim_RotateUpSlamDown,
[ANIM_DEEP_V_SQUISH_AND_BOUNCE] = Anim_DeepVerticalSquishBounce,
[ANIM_H_JUMPS] = Anim_HorizontalJumps,
[ANIM_H_JUMPS_V_STRETCH] = Anim_HorizontalJumpsVerticalStretch,
[ANIM_ROTATE_TO_SIDES_FAST] = Anim_RotateToSides_Fast, // Unused
[ANIM_ROTATE_UP_TO_SIDES] = Anim_RotateUpToSides,
[ANIM_FLICKER_INCREASING] = Anim_FlickerIncreasing,
[ANIM_TIP_HOP_FORWARD] = Anim_TipHopForward, // Unused
[ANIM_PIVOT_SHAKE] = Anim_PivotShake, // Unused
[ANIM_TIP_AND_SHAKE] = Anim_TipAndShake, // Unused
[ANIM_VIBRATE_TO_CORNERS] = Anim_VibrateToCorners, // Unused
[ANIM_GROW_IN_STAGES] = Anim_GrowInStages,
[ANIM_V_SPRING] = Anim_VerticalSpring, // Unused
[ANIM_V_REPEATED_SPRING] = Anim_VerticalRepeatedSpring, // Unused
[ANIM_SPRING_RISING] = Anim_SpringRising, // Unused
[ANIM_H_SPRING] = Anim_HorizontalSpring,
[ANIM_H_REPEATED_SPRING_SLOW] = Anim_HorizontalRepeatedSpring_Slow,
[ANIM_H_SLIDE_SHRINK] = Anim_HorizontalSlideShrink, // Unused
[ANIM_LUNGE_GROW] = Anim_LungeGrow,
[ANIM_CIRCLE_INTO_BG] = Anim_CircleIntoBackground,
[ANIM_RAPID_H_HOPS] = Anim_RapidHorizontalHops,
[ANIM_FOUR_PETAL] = Anim_FourPetal,
[ANIM_V_SQUISH_AND_BOUNCE_SLOW] = Anim_VerticalSquishBounce_Slow,
[ANIM_H_SLIDE_SLOW] = Anim_HorizontalSlide_Slow,
[ANIM_V_SLIDE_SLOW] = Anim_VerticalSlide_Slow,
[ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL] = Anim_BounceRotateToSides_Small,
[ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW] = Anim_BounceRotateToSides_Slow,
[ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW] = Anim_BounceRotateToSides_SmallSlow,
[ANIM_ZIGZAG_SLOW] = Anim_ZigzagSlow,
[ANIM_H_SHAKE_SLOW] = Anim_HorizontalShake_Slow,
[ANIM_V_SHAKE_SLOW] = Anim_VertialShake_Slow, // Unused
[ANIM_TWIST_TWICE] = Anim_Twist_Twice,
[ANIM_CIRCLE_C_CLOCKWISE_SLOW] = Anim_CircleCounterclockwise_Slow,
[ANIM_V_SHAKE_TWICE_SLOW] = Anim_VerticalShakeTwice_Slow, // Unused
[ANIM_V_SLIDE_WOBBLE_SMALL] = Anim_VerticalSlideWobble_Small,
[ANIM_V_JUMPS_SMALL] = Anim_VerticalJumps_Small,
[ANIM_SPIN] = Anim_Spin,
[ANIM_TUMBLING_FRONT_FLIP_TWICE] = Anim_TumblingFrontFlip_Twice,
[ANIM_DEEP_V_SQUISH_AND_BOUNCE_TWICE] = Anim_DeepVerticalSquishBounce_Twice, // Unused
[ANIM_H_JUMPS_V_STRETCH_TWICE] = Anim_HorizontalJumpsVerticalStretch_Twice,
[ANIM_V_SHAKE_BACK] = Anim_VerticalShakeBack,
[ANIM_V_SHAKE_BACK_SLOW] = Anim_VerticalShakeBack_Slow,
[ANIM_V_SHAKE_H_SLIDE_SLOW] = Anim_VerticalShakeHorizontalSlide_Slow,
[ANIM_V_STRETCH_BOTH_ENDS_SLOW] = Anim_VerticalStretchBothEnds_Slow,
[ANIM_H_STRETCH_FAR_SLOW] = Anim_HorizontalStretchFar_Slow,
[ANIM_V_SHAKE_LOW_TWICE] = Anim_VerticalShakeLowTwice,
[ANIM_H_SHAKE_FAST] = Anim_HorizontalShake_Fast,
[ANIM_H_SLIDE_FAST] = Anim_HorizontalSlide_Fast,
[ANIM_H_VIBRATE_FAST] = Anim_HorizontalVibrate_Fast,
[ANIM_H_VIBRATE_FASTEST] = Anim_HorizontalVibrate_Fastest,
[ANIM_V_SHAKE_BACK_FAST] = Anim_VerticalShakeBack_Fast,
[ANIM_V_SHAKE_LOW_TWICE_SLOW] = Anim_VerticalShakeLowTwice_Slow,
[ANIM_V_SHAKE_LOW_TWICE_FAST] = Anim_VerticalShakeLowTwice_Fast,
[ANIM_CIRCLE_C_CLOCKWISE_LONG] = Anim_CircleCounterclockwise_Long,
[ANIM_GROW_STUTTER_SLOW] = Anim_GrowStutter_Slow,
[ANIM_V_SHAKE_H_SLIDE] = Anim_VerticalShakeHorizontalSlide,
[ANIM_V_SHAKE_H_SLIDE_FAST] = Anim_VerticalShakeHorizontalSlide_Fast,
[ANIM_TRIANGLE_DOWN_SLOW] = Anim_TriangleDown_Slow,
[ANIM_TRIANGLE_DOWN] = Anim_TriangleDown,
[ANIM_TRIANGLE_DOWN_TWICE] = Anim_TriangleDown_Fast,
[ANIM_GROW] = Anim_Grow,
[ANIM_GROW_TWICE] = Anim_Grow_Twice,
[ANIM_H_SPRING_FAST] = Anim_HorizontalSpring_Fast,
[ANIM_H_SPRING_SLOW] = Anim_HorizontalSpring_Slow,
[ANIM_H_REPEATED_SPRING_FAST] = Anim_HorizontalRepeatedSpring_Fast,
[ANIM_H_REPEATED_SPRING] = Anim_HorizontalRepeatedSpring,
[ANIM_SHRINK_GROW_FAST] = Anim_ShrinkGrow_Fast,
[ANIM_SHRINK_GROW_SLOW] = Anim_ShrinkGrow_Slow,
[ANIM_V_STRETCH_BOTH_ENDS] = Anim_VerticalStretchBothEnds,
[ANIM_V_STRETCH_BOTH_ENDS_TWICE] = Anim_VerticalStretchBothEnds_Twice,
[ANIM_H_STRETCH_FAR_TWICE] = Anim_HorizontalStretchFar_Twice,
[ANIM_H_STRETCH_FAR] = Anim_HorizontalStretchFar,
[ANIM_GROW_STUTTER_TWICE] = Anim_GrowStutter_Twice,
[ANIM_GROW_STUTTER] = Anim_GrowStutter,
[ANIM_CONCAVE_ARC_LARGE_SLOW] = Anim_ConcaveArcLarge_Slow,
[ANIM_CONCAVE_ARC_LARGE] = Anim_ConcaveArcLarge,
[ANIM_CONCAVE_ARC_LARGE_TWICE] = Anim_ConcaveArcLarge_Twice,
[ANIM_CONVEX_DOUBLE_ARC_SLOW] = Anim_ConvexDoubleArc_Slow,
[ANIM_CONVEX_DOUBLE_ARC] = Anim_ConvexDoubleArc,
[ANIM_CONVEX_DOUBLE_ARC_TWICE] = Anim_ConvexDoubleArc_Twice,
[ANIM_CONCAVE_ARC_SMALL_SLOW] = Anim_ConcaveArcSmall_Slow,
[ANIM_CONCAVE_ARC_SMALL] = Anim_ConcaveArcSmall,
[ANIM_CONCAVE_ARC_SMALL_TWICE] = Anim_ConcaveArcSmall_Twice,
[ANIM_H_DIP] = Anim_HorizontalDip,
[ANIM_H_DIP_FAST] = Anim_HorizontalDip_Fast,
[ANIM_H_DIP_TWICE] = Anim_HorizontalDip_Twice,
[ANIM_SHRINK_GROW_VIBRATE_FAST] = Anim_ShrinkGrowVibrate_Fast,
[ANIM_SHRINK_GROW_VIBRATE] = Anim_ShrinkGrowVibrate,
[ANIM_SHRINK_GROW_VIBRATE_SLOW] = Anim_ShrinkGrowVibrate_Slow,
[ANIM_JOLT_RIGHT_FAST] = Anim_JoltRight_Fast,
[ANIM_JOLT_RIGHT] = Anim_JoltRight,
[ANIM_JOLT_RIGHT_SLOW] = Anim_JoltRight_Slow,
[ANIM_SHAKE_FLASH_YELLOW_FAST] = Anim_ShakeFlashYellow_Fast,
[ANIM_SHAKE_FLASH_YELLOW] = Anim_ShakeFlashYellow,
[ANIM_SHAKE_FLASH_YELLOW_SLOW] = Anim_ShakeFlashYellow_Slow,
[ANIM_SHAKE_GLOW_RED_FAST] = Anim_ShakeGlowRed_Fast,
[ANIM_SHAKE_GLOW_RED] = Anim_ShakeGlowRed,
[ANIM_SHAKE_GLOW_RED_SLOW] = Anim_ShakeGlowRed_Slow,
[ANIM_SHAKE_GLOW_GREEN_FAST] = Anim_ShakeGlowGreen_Fast,
[ANIM_SHAKE_GLOW_GREEN] = Anim_ShakeGlowGreen,
[ANIM_SHAKE_GLOW_GREEN_SLOW] = Anim_ShakeGlowGreen_Slow,
[ANIM_SHAKE_GLOW_BLUE_FAST] = Anim_ShakeGlowBlue_Fast,
[ANIM_SHAKE_GLOW_BLUE] = Anim_ShakeGlowBlue,
[ANIM_SHAKE_GLOW_BLUE_SLOW] = Anim_ShakeGlowBlue_Slow
};
// Each back anim set has 3 possible animations depending on nature
// Each of the 3 animations is a slight variation of the others
// BACK_ANIM_NONE is skipped below. GetSpeciesBackAnimSet subtracts 1 from the back anim id
static const u8 sBackAnimationIds[] =
{
[(BACK_ANIM_H_VIBRATE - 1) * 3] = ANIM_H_VIBRATE_FASTEST, ANIM_H_VIBRATE_FAST, ANIM_H_VIBRATE,
[(BACK_ANIM_H_SLIDE - 1) * 3] = ANIM_H_SLIDE_FAST, ANIM_H_SLIDE, ANIM_H_SLIDE_SLOW,
[(BACK_ANIM_H_SPRING - 1) * 3] = ANIM_H_SPRING_FAST, ANIM_H_SPRING, ANIM_H_SPRING_SLOW,
[(BACK_ANIM_H_SPRING_REPEATED - 1) * 3] = ANIM_H_REPEATED_SPRING_FAST, ANIM_H_REPEATED_SPRING, ANIM_H_REPEATED_SPRING_SLOW,
[(BACK_ANIM_SHRINK_GROW - 1) * 3] = ANIM_SHRINK_GROW_FAST, ANIM_SHRINK_GROW, ANIM_SHRINK_GROW_SLOW,
[(BACK_ANIM_GROW - 1) * 3] = ANIM_GROW_TWICE, ANIM_GROW, ANIM_GROW_IN_STAGES,
[(BACK_ANIM_CIRCLE_COUNTERCLOCKWISE - 1) * 3] = ANIM_CIRCLE_C_CLOCKWISE_LONG, ANIM_CIRCLE_C_CLOCKWISE, ANIM_CIRCLE_C_CLOCKWISE_SLOW,
[(BACK_ANIM_H_SHAKE - 1) * 3] = ANIM_H_SHAKE_FAST, ANIM_H_SHAKE, ANIM_H_SHAKE_SLOW,
[(BACK_ANIM_V_SHAKE - 1) * 3] = ANIM_V_SHAKE_BACK_FAST, ANIM_V_SHAKE_BACK, ANIM_V_SHAKE_BACK_SLOW,
[(BACK_ANIM_V_SHAKE_H_SLIDE - 1) * 3] = ANIM_V_SHAKE_H_SLIDE_FAST, ANIM_V_SHAKE_H_SLIDE, ANIM_V_SHAKE_H_SLIDE_SLOW,
[(BACK_ANIM_V_STRETCH - 1) * 3] = ANIM_V_STRETCH_BOTH_ENDS_TWICE, ANIM_V_STRETCH_BOTH_ENDS, ANIM_V_STRETCH_BOTH_ENDS_SLOW,
[(BACK_ANIM_H_STRETCH - 1) * 3] = ANIM_H_STRETCH_FAR_TWICE, ANIM_H_STRETCH_FAR, ANIM_H_STRETCH_FAR_SLOW,
[(BACK_ANIM_GROW_STUTTER - 1) * 3] = ANIM_GROW_STUTTER_TWICE, ANIM_GROW_STUTTER, ANIM_GROW_STUTTER_SLOW,
[(BACK_ANIM_V_SHAKE_LOW - 1) * 3] = ANIM_V_SHAKE_LOW_TWICE_FAST, ANIM_V_SHAKE_LOW_TWICE, ANIM_V_SHAKE_LOW_TWICE_SLOW,
[(BACK_ANIM_TRIANGLE_DOWN - 1) * 3] = ANIM_TRIANGLE_DOWN_TWICE, ANIM_TRIANGLE_DOWN, ANIM_TRIANGLE_DOWN_SLOW,
[(BACK_ANIM_CONCAVE_ARC_LARGE - 1) * 3] = ANIM_CONCAVE_ARC_LARGE_TWICE, ANIM_CONCAVE_ARC_LARGE, ANIM_CONCAVE_ARC_LARGE_SLOW,
[(BACK_ANIM_CONVEX_DOUBLE_ARC - 1) * 3] = ANIM_CONVEX_DOUBLE_ARC_TWICE, ANIM_CONVEX_DOUBLE_ARC, ANIM_CONVEX_DOUBLE_ARC_SLOW,
[(BACK_ANIM_CONCAVE_ARC_SMALL - 1) * 3] = ANIM_CONCAVE_ARC_SMALL_TWICE, ANIM_CONCAVE_ARC_SMALL, ANIM_CONCAVE_ARC_SMALL_SLOW,
[(BACK_ANIM_DIP_RIGHT_SIDE - 1) * 3] = ANIM_H_DIP_TWICE, ANIM_H_DIP, ANIM_H_DIP_FAST,
[(BACK_ANIM_SHRINK_GROW_VIBRATE - 1) * 3] = ANIM_SHRINK_GROW_VIBRATE_FAST, ANIM_SHRINK_GROW_VIBRATE, ANIM_SHRINK_GROW_VIBRATE_SLOW,
[(BACK_ANIM_JOLT_RIGHT - 1) * 3] = ANIM_JOLT_RIGHT_FAST, ANIM_JOLT_RIGHT, ANIM_JOLT_RIGHT_SLOW,
[(BACK_ANIM_SHAKE_FLASH_YELLOW - 1) * 3] = ANIM_SHAKE_FLASH_YELLOW_FAST, ANIM_SHAKE_FLASH_YELLOW, ANIM_SHAKE_FLASH_YELLOW_SLOW,
[(BACK_ANIM_SHAKE_GLOW_RED - 1) * 3] = ANIM_SHAKE_GLOW_RED_FAST, ANIM_SHAKE_GLOW_RED, ANIM_SHAKE_GLOW_RED_SLOW,
[(BACK_ANIM_SHAKE_GLOW_GREEN - 1) * 3] = ANIM_SHAKE_GLOW_GREEN_FAST, ANIM_SHAKE_GLOW_GREEN, ANIM_SHAKE_GLOW_GREEN_SLOW,
[(BACK_ANIM_SHAKE_GLOW_BLUE - 1) * 3] = ANIM_SHAKE_GLOW_BLUE_FAST, ANIM_SHAKE_GLOW_BLUE, ANIM_SHAKE_GLOW_BLUE_SLOW,
};
static const u8 sBackAnimNatureModTable[NUM_NATURES] =
{
[NATURE_HARDY] = 0,
[NATURE_LONELY] = 2,
[NATURE_BRAVE] = 0,
[NATURE_ADAMANT] = 0,
[NATURE_NAUGHTY] = 0,
[NATURE_BOLD] = 1,
[NATURE_DOCILE] = 1,
[NATURE_RELAXED] = 1,
[NATURE_IMPISH] = 0,
[NATURE_LAX] = 1,
[NATURE_TIMID] = 2,
[NATURE_HASTY] = 0,
[NATURE_SERIOUS] = 1,
[NATURE_JOLLY] = 0,
[NATURE_NAIVE] = 0,
[NATURE_MODEST] = 2,
[NATURE_MILD] = 2,
[NATURE_QUIET] = 2,
[NATURE_BASHFUL] = 2,
[NATURE_RASH] = 1,
[NATURE_CALM] = 1,
[NATURE_GENTLE] = 2,
[NATURE_SASSY] = 1,
[NATURE_CAREFUL] = 2,
[NATURE_QUIRKY] = 1,
};
static const union AffineAnimCmd sMonAffineAnim_0[] =
{
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
{AFFINEANIMCMDTYPE_END}
};
static const union AffineAnimCmd sMonAffineAnim_1[] =
{
AFFINEANIMCMD_FRAME(-256, 256, 0, 0),
{AFFINEANIMCMDTYPE_END}
};
static const union AffineAnimCmd *const sMonAffineAnims[] =
{
sMonAffineAnim_0,
sMonAffineAnim_1
};
static void MonAnimDummySpriteCallback(struct Sprite *sprite)
{
}
static void SetPosForRotation(struct Sprite *sprite, u16 index, s16 amplitudeX, s16 amplitudeY)
{
s16 xAdder, yAdder;
amplitudeX *= -1;
amplitudeY *= -1;
xAdder = Cos(index, amplitudeX) - Sin(index, amplitudeY);
yAdder = Cos(index, amplitudeY) + Sin(index, amplitudeX);
amplitudeX *= -1;
amplitudeY *= -1;
sprite->x2 = xAdder + amplitudeX;
sprite->y2 = yAdder + amplitudeY;
}
u8 GetSpeciesBackAnimSet(u16 species)
{
if (sSpeciesToBackAnimSet[species] != BACK_ANIM_NONE)
return sSpeciesToBackAnimSet[species] - 1;
else
return 0;
}
#define tState data[0]
#define tPtrHi data[1]
#define tPtrLo data[2]
#define tAnimId data[3]
#define tBattlerId data[4]
#define tSpeciesId data[5]
// BUG: In vanilla, tPtrLo is read as an s16, so if bit 15 of the
// address were to be set it would cause the pointer to be read
// as 0xFFFFXXXX instead of the desired 0x02YYXXXX.
// By dumb luck, this is not an issue in vanilla. However,
// changing the link order revealed this bug.
#if MODERN || defined(BUGFIX)
#define ANIM_SPRITE(taskId) ((struct Sprite *)((gTasks[taskId].tPtrHi << 16) | ((u16)gTasks[taskId].tPtrLo)))
#else
#define ANIM_SPRITE(taskId) ((struct Sprite *)((gTasks[taskId].tPtrHi << 16) | (gTasks[taskId].tPtrLo)))
#endif //MODERN || BUGFIX
static void Task_HandleMonAnimation(u8 taskId)
{
u32 i;
struct Sprite *sprite = ANIM_SPRITE(taskId);
if (gTasks[taskId].tState == 0)
{
gTasks[taskId].tBattlerId = sprite->data[0];
gTasks[taskId].tSpeciesId = sprite->data[2];
sprite->sDontFlip = TRUE;
sprite->data[0] = 0;
for (i = 2; i < ARRAY_COUNT(sprite->data); i++)
sprite->data[i] = 0;
sprite->callback = sMonAnimFunctions[gTasks[taskId].tAnimId];
sIsSummaryAnim = FALSE;
gTasks[taskId].tState++;
}
if (sprite->callback == SpriteCallbackDummy)
{
sprite->data[0] = gTasks[taskId].tBattlerId;
sprite->data[2] = gTasks[taskId].tSpeciesId;
sprite->data[1] = 0;
DestroyTask(taskId);
}
}
void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId)
{
u8 taskId = CreateTask(Task_HandleMonAnimation, 128);
gTasks[taskId].tPtrHi = (u32)(sprite) >> 16;
gTasks[taskId].tPtrLo = (u32)(sprite);
gTasks[taskId].tAnimId = frontAnimId;
}
void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId)
{
// sDontFlip is expected to still be FALSE here, not explicitly cleared
sIsSummaryAnim = TRUE;
sprite->callback = sMonAnimFunctions[frontAnimId];
}
void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet)
{
u8 nature, taskId, animId, battlerId;
taskId = CreateTask(Task_HandleMonAnimation, 128);
gTasks[taskId].tPtrHi = (u32)(sprite) >> 16;
gTasks[taskId].tPtrLo = (u32)(sprite);
battlerId = sprite->data[0];
nature = GetNature(&gPlayerParty[gBattlerPartyIndexes[battlerId]]);
// * 3 below because each back anim has 3 variants depending on nature
animId = 3 * backAnimSet + sBackAnimNatureModTable[nature];
gTasks[taskId].tAnimId = sBackAnimationIds[animId];
}
#undef tState
#undef tPtrHi
#undef tPtrLo
#undef tAnimId
#undef tBattlerId
#undef tSpeciesId
void SetSpriteCB_MonAnimDummy(struct Sprite *sprite)
{
sprite->callback = MonAnimDummySpriteCallback;
}
static void SetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rotation)
{
u8 matrixNum;
struct ObjAffineSrcData affineSrcData;
struct OamMatrix dest;
affineSrcData.xScale = xScale;
affineSrcData.yScale = yScale;
affineSrcData.rotation = rotation;
matrixNum = sprite->oam.matrixNum;
ObjAffineSet(&affineSrcData, &dest, 1, 2);
gOamMatrices[matrixNum].a = dest.a;
gOamMatrices[matrixNum].b = dest.b;
gOamMatrices[matrixNum].c = dest.c;
gOamMatrices[matrixNum].d = dest.d;