#include "libforest/gbi_extensions.h"
#include "PR/gbi.h"
#include "evw_anime.h"
#include "c_keyframe.h"
#include "ac_npc.h"
#include "ef_effect_control.h"

u8 cKF_ckcb_r_npc_1_wait_do1_tbl[] = { 56, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 7, 2, 0, 7, 2, 7, 7, 0, 7, 0, 0 };

s16 cKF_kn_npc_1_wait_do1_tbl[] = { 6,  9,  2,  4, 4, 6,  8,  10, 14, 2, 12, 2,  2, 10, 10, 8, 10,
                                    14, 2,  12, 2, 2, 10, 10, 2,  10, 2, 2,  10, 2, 6,  4,  6, 4,
                                    6,  10, 9,  4, 6, 10, 9,  2,  2,  2, 7,  4,  7, 2,  2,  2 };

s16 cKF_c_npc_1_wait_do1_tbl[] = { 0, 0, 900, 0,   0, 1800, 0, 0,    1800, 0, 900, 0, 0, 0, -900, 0,
                                   0, 0, 0,   900, 0, 0,    0, -900, 0,    0, 0,   0, 0, 0, -900 };

s16 cKF_ds_npc_1_wait_do1_tbl[] = {
    1,  0,    -547,  5,  -50,  0,     13, 50,   0,      21, -50,  0,      29, 50,   0,     33, 0,    -581,
    1,  1100, 0,     5,  1000, 0,     9,  1100, 0,      13, 1000, 0,      17, 1100, 0,     21, 1000, 0,
    25, 1100, 0,     29, 1000, 0,     33, 1100, 0,      1,  0,    0,      33, 0,    0,     1,  0,    299,
    9,  50,   0,     25, -50,  0,     33, 0,    297,    1,  35,   -228,   13, -50,  0,     29, 50,   0,
    33, 35,   -230,  1,  0,    1208,  5,  100,  0,      13, -100, 0,      21, 100,  0,     29, -100, 0,
    33, 0,    1208,  1,  -240, -2517, 5,  -490, 0,      11, -150, 0,      15, -150, 0,     21, -500, 0,
    27, -150, 0,     31, -150, 0,     33, -240, -2517,  1,  -58,  -5276,  5,  -600, 0,     11, 25,   0,
    13, -150, 0,     15, 25,   0,     21, -600, 0,      27, 125,  0,      29, -50,  0,     31, 125,  0,
    33, -58,  -5276, 1,  113,  1311,  2,  190,  2941,   5,  400,  0,      8,  190,  -2924, 11, 70,   0,
    13, 130,  0,     15, 70,   0,     18, 190,  3013,   21, 400,  0,      24, 190,  -3081, 27, 70,   0,
    29, 120,  0,     31, 70,   0,     33, 113,  1311,   1,  0,    0,      33, 0,    0,     1,  415,  10901,
    3,  900,  1476,  7,  900,  -1518, 11, 0,    0,      13, 400,  0,      15, 0,    0,     19, 900,  1517,
    23, 900,  -1491, 27, 0,    0,     29, 400,  0,      31, 0,    0,      33, 415,  10901, 1,  0,    0,
    33, 0,    0,     1,  0,    0,     33, 0,    0,      1,  -100, -754,   5,  -200, 0,     11, -65,  0,
    13, -300, 0,     15, -65,  0,     21, -200, 0,      27, -65,  0,      29, -300, 0,     31, -65,  0,
    33, -100, -754,  1,  -15,  263,   5,  15,   0,      11, -25,  0,      13, 10,   0,     15, -25,  0,
    21, 15,   0,     27, -25,  0,     29, 10,   0,      31, -25,  0,      33, -15,  263,   1,  240,  -2511,
    3,  150,  0,     7,  150,  0,     13, 500,  0,      19, 150,  0,      23, 150,  0,     29, 500,  0,
    33, 240,  -2511, 1,  -100, 4170,  3,  75,   0,      5,  -100, 0,      7,  75,   0,     13, -600, 0,
    19, 75,   0,     21, -100, 0,     23, 75,   0,      29, -600, 0,      33, -100, 4170,  1,  -108, 1397,
    3,  -70,  0,     5,  -120, 0,     7,  -70,  0,      10, -180, -3015,  13, -400, 0,     16, -180, 2960,
    19, -70,  0,     21, -120, 0,     23, -70,  0,      26, -180, -2960,  29, -400, 0,     32, -180, 2970,
    33, -108, 1397,  1,  0,    0,     33, 0,    0,      1,  418,  -10442, 3,  0,    0,     5,  410,  0,
    7,  0,    0,     11, 900,  1497,  15, 900,  -1517,  19, 0,    0,      21, 410,  0,     23, 0,    0,
    27, 900,  1506,  31, 900,  -1497, 33, 418,  -10442, 1,  0,    0,      33, 0,    0,     1,  0,    0,
    33, 0,    0,     1,  -100, 743,   3,  -65,  0,      5,  -300, 0,      7,  -65,  0,     13, -200, 0,
    19, -65,  0,     21, -300, 0,     23, -65,  0,      29, -200, 0,      33, -100, 743,   1,  15,   208,
    3,  25,   0,     5,  -10,  0,     7,  25,   0,      13, -15,  0,      19, 25,   0,     21, -10,  0,
    23, 25,   0,     29, -15,  0,     33, 15,   208,    1,  0,    0,      33, 0,    0,     1,  -50,  2054,
    3,  50,   0,     7,  -150, 0,     11, 50,   0,      15, -150, 0,      19, 50,   0,     23, -150, 0,
    27, 50,   0,     31, -150, 0,     33, -50,  2112,   1,  0,    0,      33, 0,    0,     1,  0,    0,
    33, 0,    0,     1,  -67,  2692,  4,  100,  0,      8,  -100, 0,      12, 100,  0,     16, -100, 0,
    20, 100,  0,     24, -100, 0,     28, 100,  0,      32, -100, 0,      33, -67,  2699,  1,  0,    0,
    33, 0,    0,     1,  50,   -1354, 6,  -150, 0,      14, 150,  0,      22, -150, 0,     30, 150,  0,
    33, 50,   -1354, 1,  143,  -195,  14, 50,   0,      30, 150,  0,      33, 143,  -195,  1,  18,   -504,
    6,  -50,  0,     14, 50,   0,     22, -50,  0,      30, 50,   0,      33, 18,   -504,  1,  570,  -714,
    6,  500,  0,     22, 800,  0,     33, 570,  -714,   1,  0,    1513,   5,  150,  0,     13, -150, 0,
    21, 150,  0,     29, -150, 0,     33, 0,    1513,   1,  -388, -2574,  2,  -450, 0,     6,  -50,  0,
    10, -450, 0,     14, -50,  0,     18, -450, 0,      22, -50,  0,      26, -450, 0,     30, -50,  0,
    33, -388, -2574, 1,  -450, 0,     5,  -650, 0,      9,  -450, 0,      13, -650, 0,     17, -450, 0,
    21, -650, 0,     25, -450, 0,     29, -650, 0,      33, -450, 0,      1,  -570, 693,   6,  -500, 0,
    22, -800, 0,     33, -570, 693,   1,  0,    -1506,  5,  -150, 0,      13, 150,  0,     21, -150, 0,
    29, 150,  0,     33, 0,    -1506, 1,  388,  3311,   2,  450,  0,      6,  50,   0,     10, 450,  0,
    14, 50,   0,     18, 450,  0,     22, 50,   0,      26, 450,  0,      30, 50,   0,     33, 388,  3311,
    1,  -450, 0,     5,  -650, 0,     9,  -450, 0,      13, -650, 0,      17, -450, 0,     21, -650, 0,
    25, -450, 0,     29, -650, 0,     33, -450, 0,      1,  1800, 0,      33, 1800, 0,     1,  150,  0,
    33, 150,  0,     1,  0,    0,     33, 0,    0,      1,  -35,  397,    3,  0,    534,   7,  50,   0,
    15, -50,  0,     23, 50,   0,     31, -50,  0,      33, -35,  397,    1,  -8,   75,    15, 50,   0,
    31, -10,  0,     33, -8,   75,    1,  18,   -174,   3,  0,    -293,   7,  -25,  0,     15, 25,   0,
    23, -25,  0,     31, 25,   0,     33, 18,   -174,   1,  0,    0,      33, 0,    0,     1,  0,    0,
    33, 0,    0,     1,  0,    0,     33, 0,    0
};

static u32 feel_eff_set[] = { 20 };

static aNPC_feel_effect_c feel_eff[] = { { mNpc_FEEL_ANGRY, 20, ARRAY_COUNT(feel_eff_set), feel_eff_set } };

aNPC_Animation_c cKF_ba_r_npc_1_wait_do1 = {
    { cKF_ckcb_r_npc_1_wait_do1_tbl, cKF_ds_npc_1_wait_do1_tbl, cKF_kn_npc_1_wait_do1_tbl, cKF_c_npc_1_wait_do1_tbl, -1,
      33 },
    1.0f,
    33.0f,
    cKF_FRAMECONTROL_REPEAT,
    -5.0f,
    NULL,
    aNPC_EYE_TEX0,
    3,
    NULL,
    aNPC_MOUTH_TEX2,
    3,
    -1,
    eEC_EFFECT_PUN_YUGE,
    feel_eff,
    NULL,
};
