#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_nemu1_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_nemu1_tbl[] = { 2, 5, 2, 4, 5, 3, 2, 6, 5, 2, 5, 2, 2, 5, 2, 2, 6, 5, 2, 5, 2, 2, 5, 2, 2, 4, 2,
                                      2, 4, 2, 4, 4, 4, 2, 4, 4, 2, 3, 2, 2, 4, 4, 2, 3, 2, 2, 2, 2, 4, 5, 4, 2, 2, 2 };

s16 cKF_c_npc_1_wait_nemu1_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_nemu1_tbl[] = {
    1,  0,    0,   33, 0,    0,    1,  975,  0,   15, 1000, 0,   17, 1000, 0,   31, 975,  0,    33, 975,  0,
    1,  0,    0,   33, 0,    0,    1,  0,    18,  9,  3,    0,   25, -3,   0,   33, 0,    18,   1,  -50,  46,
    9,  -45,  0,   17, -50,  -47,  25, -55,  0,   33, -50,  48,  1,  3,    0,   17, -3,   0,    33, 3,    0,
    1,  -175, 0,   33, -175, 0,    1,  -190, 0,   15, -125, 0,   17, -125, 0,   24, -165, -222, 31, -190, 0,
    33, -190, 0,   1,  40,   0,    15, 25,   0,   17, 25,   0,   31, 40,   0,   33, 40,   0,    1,  0,    0,
    33, 0,    0,   1,  280,  0,    15, 135,  0,   17, 135,  0,   31, 280,  0,   33, 280,  0,    1,  0,    0,
    33, 0,    0,   1,  0,    0,    33, 0,    0,   1,  -140, 0,   15, -58,  0,   17, -58,  0,    31, -140, 0,
    33, -140, 0,   1,  0,    0,    33, 0,    0,   1,  175,  0,   33, 175,  0,   1,  -190, 0,    15, -125, 0,
    17, -125, 0,   24, -165, -222, 31, -190, 0,   33, -190, 0,   1,  -40,  0,   15, -23,  0,    17, -23,  0,
    31, -40,  0,   33, -40,  0,    1,  0,    0,   33, 0,    0,   1,  280,  0,   15, 135,  0,    17, 135,  0,
    31, 280,  0,   33, 280,  0,    1,  0,    0,   33, 0,    0,   1,  0,    0,   33, 0,    0,    1,  -140, 0,
    15, -58,  0,   17, -58,  0,    31, -140, 0,   33, -140, 0,   1,  0,    0,   33, 0,    0,    1,  0,    0,
    33, 0,    0,   1,  53,   193,  10, 100,  0,   26, 20,   0,   33, 53,   193, 1,  0,    0,    33, 0,    0,
    1,  0,    0,   33, 0,    0,    1,  98,   171, 12, 160,  0,   28, 80,   0,   33, 98,   171,  1,  0,    0,
    33, 0,    0,   1,  -1,   15,   10, 3,    0,   26, -3,   0,   33, -1,   15,  1,  -53,  76,   10, -35,  0,
    26, -65,  0,   33, -53,  76,   1,  2,    3,   2,  3,    0,   18, -3,   0,   33, 2,    3,    1,  0,    0,
    33, 0,    0,   1,  -70,  202,  11, -20,  0,   27, -100, 0,   33, -70,  202, 1,  -573, -104, 11, -600, 0,
    27, -560, 0,   33, -573, -104, 1,  0,    0,   33, 0,    0,   1,  -120, 0,   17, -20,  0,    33, -120, 0,
    1,  0,    0,   33, 0,    0,    1,  0,    0,   33, 0,    0,   1,  -70,  202, 11, -20,  0,    27, -100, 0,
    33, -70,  202, 1,  589,  -97,  11, 560,  0,   27, 600,  0,   33, 589,  -97, 1,  0,    0,    33, 0,    0,
    1,  -120, 0,   17, -20,  0,    33, -120, 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,  -1,   18,  11, 3,    0,    27, -3,   0,
    33, -1,   18,  1,  -55,  62,   11, -40,  0,   19, -50,  -75, 27, -60,  0,   33, -55,  62,   1,  -60,  7,
    3,  -60,  0,   19, -65,  0,    33, -60,  7,   1,  0,    0,   33, 0,    0,   1,  -100, 0,    33, -100, 0,
    1,  0,    0,   33, 0,    0
};

static u32 feel_eff_set[] = { 7, 14 };

static aNPC_feel_effect_c feel_eff[] = { { mNpc_FEEL_SLEEPY, 60, ARRAY_COUNT(feel_eff_set), feel_eff_set } };

aNPC_Animation_c cKF_ba_r_npc_1_wait_nemu1 = {
    { cKF_ckcb_r_npc_1_wait_nemu1_tbl, cKF_ds_npc_1_wait_nemu1_tbl, cKF_kn_npc_1_wait_nemu1_tbl,
      cKF_c_npc_1_wait_nemu1_tbl, -1, 33 },
    1.0f,
    33.0f,
    cKF_FRAMECONTROL_REPEAT,
    -5.0f,
    NULL,
    aNPC_EYE_TEX0,
    2,
    NULL,
    aNPC_MOUTH_TEX0,
    4,
    -1,
    eEC_EFFECT_NEBOKE_AWA,
    feel_eff,
    NULL,
};
