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

s16 cKF_c_npc_1_walk1_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_walk1_tbl[] = {
    1,  0,    0,     17, 0,    0,     1,  1000, 0,    5,  1125, 0,     9,  1000, 0,     13, 1125, 0,     17, 1000, 0,
    1,  0,    0,     17, 0,    0,     1,  0,    968,  5,  80,   0,     13, -80,  0,     17, 0,    968,   1,  0,    0,
    17, 0,    0,     1,  0,    0,     17, 0,    0,    1,  -103, 618,   5,  -50,  0,     13, -150, 0,     17, -103, 618,
    1,  77,   3250,  4,  300,  0,     12, -400, 0,    17, 77,   3250,  1,  50,   -557,  5,  0,    0,     13, 100,  0,
    17, 50,   -557,  1,  0,    0,     17, 0,    0,    1,  0,    0,     3,  0,    0,     8,  700,  0,     16, 0,    0,
    17, 0,    0,     1,  0,    0,     17, 0,    0,    1,  0,    0,     17, 0,    0,     1,  -22,  1669,  6,  150,  0,
    14, -100, 0,     17, -22,  1669,  1,  0,    0,    17, 0,    0,     1,  103,  531,   5,  150,  0,     13, 50,   0,
    17, 103,  531,   1,  -178, -3135, 4,  -400, 0,    12, 300,  0,     17, -178, -3135, 1,  -50,  -706,  5,  -100, 0,
    13, 0,    0,     17, -50,  -706,  1,  0,    0,    17, 0,    0,     1,  700,  0,     8,  -1,   0,     9,  0,    0,
    11, 0,    0,     16, 700,  0,     17, 700,  0,    1,  0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,
    1,  70,   -1529, 6,  -100, 0,     14, 150,  0,    17, 70,   -1529, 1,  0,    0,     17, 0,    0,     1,  0,    0,
    17, 0,    0,     1,  17,   1735,  2,  50,   0,    6,  -160, 0,     10, 50,   0,     14, -160, 0,     17, 17,   1735,
    1,  0,    0,     17, 0,    0,     1,  0,    0,    17, 0,    0,     1,  -50,  3194,  3,  100,  0,     7,  -200, 0,
    11, 100,  0,     15, -200, 0,     17, -50,  3194, 1,  0,    0,     17, 0,    0,     1,  0,    -1632, 5,  -150, 0,
    13, 150,  0,     17, 0,    -1632, 1,  6,    0,    4,  50,   0,     9,  6,    0,     12, 50,   0,     17, 6,    0,
    1,  0,    0,     17, 0,    0,     1,  0,    0,    17, 0,    0,     1,  -3,   -1706, 4,  -115, 0,     12, 230,  0,
    17, -3,   -1706, 1,  -564, 240,   17, -564, 240,  1,  0,    0,     17, 0,    0,     1,  0,    0,     2,  0,    0,
    6,  -250, 0,     12, 0,    0,     17, 0,    0,    1,  0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,
    1,  118,  1854,  4,  230,  0,     12, -115, 0,    17, 118,  1854,  1,  564,  -272,  17, 564,  -272,  1,  0,    0,
    17, 0,    0,     1,  -125, 1984,  4,  0,    0,    10, 0,    0,     14, -250, 0,     17, -125, 1984,  1,  0,    0,
    17, 0,    0,     1,  0,    0,     17, 0,    0,    1,  0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,
    1,  0,    595,   5,  50,   0,     13, -50,  0,    17, 0,    595,   1,  -21,  -500,  2,  -30,  0,     6,  30,   0,
    10, -30,  0,     14, 30,   0,     17, -21,  -500, 1,  0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,
    1,  0,    0,     17, 0,    0,     1,  0,    0,    17, 0,    0
};

static int lfoot_se_chk_pat[] = { 1 };

static aNPC_se_data_c lfoot_se_dt[] = { { ARRAY_COUNT(lfoot_se_chk_pat), lfoot_se_chk_pat } };

static int rfoot_se_chk_pat[] = { 9 };

static aNPC_se_data_c rfoot_se_dt[] = { { ARRAY_COUNT(rfoot_se_chk_pat), rfoot_se_chk_pat } };

static aNPC_se_data_table_c se_dt_tbl[] = { { lfoot_se_dt, rfoot_se_dt, aNPC_OTHER_SE_TYPE_NONE, NULL } };

aNPC_Animation_c cKF_ba_r_npc_1_walk1 = {
    { cKF_ckcb_r_npc_1_walk1_tbl, cKF_ds_npc_1_walk1_tbl, cKF_kn_npc_1_walk1_tbl, cKF_c_npc_1_walk1_tbl, -1, 17 },
    1.0f,
    17.0f,
    cKF_FRAMECONTROL_REPEAT,
    -5.0f,
    NULL,
    aNPC_EYE_TEX1,
    -1,
    NULL,
    aNPC_MOUTH_TEX0,
    0,
    -1,
    -1,
    NULL,
    se_dt_tbl,
};
