#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_ki1_tbl[] = { 56, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 7, 7, 0, 7, 7, 7, 7, 0, 7, 0, 0 };

s16 cKF_kn_npc_1_wait_ki1_tbl[] = { 2, 9, 5, 2, 5, 4, 5, 9, 9, 2, 11, 2, 2, 7, 4, 5, 9, 9, 2, 11, 2, 2, 7, 4, 2, 5, 2,
                                    2, 6, 2, 5, 6, 5, 2, 4, 9, 2, 6,  2, 2, 4, 9, 2, 6, 2, 2, 2,  2, 2, 6, 6, 2, 2, 2 };

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

s16 cKF_ds_npc_1_wait_ki1_tbl[] = {
    1,  0,    0,     33, 0,    0,    1,  1000, 0,     5,  1100, 0,    9,  1000, 0,     13, 1100, 0,     17, 1000, 0,
    21, 1100, 0,     25, 1000, 0,    29, 1100, 0,     33, 1000, 0,    1,  0,    0,     9,  60,   0,     17, 40,   0,
    25, 60,   0,     33, 0,    0,    1,  0,    0,     33, 0,    0,    1,  20,   0,     8,  -20,  0,     17, 20,   0,
    25, -20,  0,     33, 20,   0,    1,  0,    495,   9,  100,  0,    25, -100, 0,     33, 0,    491,   1,  -175, 0,
    9,  -350, 0,     13, -300, 999,  17, -175, 0,     33, -175, 0,    1,  -80,  0,     5,  -180, -744,  9,  -230, 0,
    13, -180, 735,   17, -80,  0,    21, -30,  0,     25, -130, 0,    29, -30,  0,     33, -80,  0,     1,  30,   0,
    5,  70,   891,   9,  200,  0,    13, 155,  -858,  17, 30,   0,    21, 80,   0,     25, 140,  0,     29, 80,   0,
    33, 30,   0,     1,  0,    0,    33, 0,    0,     1,  205,  842,  5,  300,  0,     8,  50,   -1536, 10, 0,    0,
    12, 50,   1525,  15, 250,  0,    17, 205,  0,     21, 100,  0,    25, 350,  0,     29, 100,  0,     33, 205,  831,
    1,  0,    0,     33, 0,    0,    1,  0,    0,     33, 0,    0,    1,  -100, 0,     9,  150,  0,     17, -110, 0,
    21, 0,    0,     25, -230, 0,    29, 0,    0,     33, -100, 0,    1,  0,    0,     9,  -100, 0,     17, 0,    0,
    33, 0,    0,     1,  175,  0,    17, 175,  0,     25, 350,  0,    29, 300,  -993,  33, 175,  0,     1,  -80,  0,
    5,  -30,  0,     9,  -130, 0,    13, -30,  0,     17, -80,  0,    21, -180, -758,  25, -230, 0,     29, -180, 754,
    33, -80,  0,     1,  -30,  0,    5,  -80,  0,     9,  -140, 0,    13, -80,  0,     17, -30,  0,     21, -70,  -889,
    25, -200, 0,     29, -155, 862,  33, -30,  0,     1,  0,    0,    33, 0,    0,     1,  205,  0,     5,  100,  0,
    9,  350,  0,     13, 100,  0,    17, 205,  843,   21, 300,  0,    24, 50,   -1461, 26, 0,    0,     28, 50,   1499,
    31, 250,  0,     33, 205,  0,    1,  0,    0,     33, 0,    0,    1,  0,    0,     33, 0,    0,     1,  -100, 0,
    5,  0,    0,     9,  -230, 0,    13, 0,    0,     17, -110, 0,    25, 150,  0,     33, -100, 0,     1,  0,    0,
    17, 0,    0,     25, 100,  0,    33, 0,    0,     1,  0,    0,    33, 0,    0,     1,  80,   0,     9,  -80,  0,
    17, 80,   0,     25, -80,  0,    33, 80,   0,     1,  0,    0,    33, 0,    0,     1,  0,    0,     33, 0,    0,
    1,  125,  2301,  4,  250,  0,    11, -250, 0,     19, 250,  0,    27, -250, 0,     33, 125,  2301,  1,  0,    0,
    33, 0,    0,     1,  15,   -468, 2,  0,    -501,  10, -80,  0,    26, 80,   0,     33, 15,   -471,  1,  -115, -593,
    2,  -125, 0,     10, 125,  0,    18, -125, 0,     26, 125,  0,    33, -115, -592,  1,  15,   -485,  2,  0,    -545,
    10, -100, 0,     26, 100,  0,    33, 15,   -481,  1,  0,    0,    33, 0,    0,     1,  -40,  611,   12, 150,  0,
    28, -100, 0,     33, -40,  615,  1,  -600, 0,     5,  -500, 1462, 9,  -400, 0,     13, -500, -1486, 17, -600, 0,
    21, -500, 1515,  25, -400, 0,    29, -500, -1524, 33, -600, 0,    1,  0,    0,     33, 0,    0,     1,  -170, 1469,
    6,  0,    0,     14, -100, 0,    22, 0,    0,     30, -250, 0,    33, -170, 1469,  1,  0,    0,     33, 0,    0,
    1,  0,    0,     33, 0,    0,    1,  80,   -534,  12, -100, 0,    28, 150,  0,     33, 80,   -706,  1,  600,  0,
    5,  500,  -1488, 9,  400,  0,    13, 500,  1485,  17, 600,  0,    21, 500,  -1482, 25, 400,  0,     29, 500,  1491,
    33, 600,  0,     1,  0,    0,    33, 0,    0,     1,  -70,  504,  6,  0,    0,     14, -250, 0,     22, 0,    0,
    30, -100, 0,     33, -70,  504,  1,  0,    0,     33, 0,    0,    1,  0,    0,     33, 0,    0,     1,  0,    0,
    33, 0,    0,     1,  0,    0,    33, 0,    0,     1,  0,    0,    33, 0,    0,     1,  30,   886,   4,  80,   0,
    12, -80,  0,     20, 80,   0,    28, -80,  0,     33, 30,   907,  1,  15,   -193,  3,  0,    -273,  11, -30,  0,
    19, 0,    269,   27, 30,   0,    33, 15,   -192,  1,  0,    0,    33, 0,    0,     1,  0,    0,     33, 0,    0,
    1,  0,    0,     33, 0,    0
};

static u32 feel_eff_set[] = { 15 };

static aNPC_feel_effect_c feel_eff[] = { { mNpc_FEEL_HAPPY, 15, ARRAY_COUNT(feel_eff_set), feel_eff_set } };

aNPC_Animation_c cKF_ba_r_npc_1_wait_ki1 = {
    { cKF_ckcb_r_npc_1_wait_ki1_tbl, cKF_ds_npc_1_wait_ki1_tbl, cKF_kn_npc_1_wait_ki1_tbl, cKF_c_npc_1_wait_ki1_tbl, -1,
      33 },
    1.0f,
    33.0f,
    cKF_FRAMECONTROL_REPEAT,
    -5.0f,
    NULL,
    aNPC_EYE_TEX0,
    5,
    NULL,
    aNPC_MOUTH_TEX1,
    0,
    -1,
    eEC_EFFECT_KONPU,
    feel_eff,
    NULL,
};
