#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_walk_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_walk_ki1_tbl[] = { 2, 10, 7, 7, 9,  2, 5, 7, 6, 2, 7, 2, 2, 6, 2, 5, 7, 6, 2, 7, 2, 2, 6, 2, 2, 6, 2,
                                    2, 6,  2, 6, 10, 2, 2, 5, 5, 2, 5, 2, 2, 5, 5, 2, 5, 2, 2, 4, 2, 4, 9, 2, 2, 2, 2 };

s16 cKF_c_npc_1_walk_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_walk_ki1_tbl[] = {
    1,  0,    0,     17, 0,    0,     1,  1000, 0,     2,  1000, 0,     4,  1200, 1526,  5,  1200, -2036,
    7,  1000, 0,     10, 1000, 0,     12, 1200, 1516,  13, 1200, -2009, 15, 1000, 0,     17, 1000, 0,
    1,  0,    1645,  5,  150,  -1513, 8,  -50,  0,     9,  0,    1632,  13, 150,  -1499, 16, -50,  0,
    17, 0,    3052,  1,  0,    1817,  3,  85,   489,   7,  85,   -491,  9,  0,    -1806, 11, -85,  -492,
    15, -85,  493,   17, 0,    1839,  1,  -20,  0,     3,  35,   1047,  6,  70,   0,     7,  40,   -1634,
    9,  -20,  0,     11, 35,   1056,  14, 70,   0,     15, 40,   -1674, 17, -20,  0,     1,  0,    0,
    17, 0,    0,     1,  -100, 2244,  5,  100,  0,     9,  -100, -2257, 13, -350, 0,     17, -100, 2268,
    1,  -100, 12119, 4,  455,  409,   7,  215,  -6268, 9,  -300, -7536, 11, -700, -1508, 15, -675, 1513,
    17, -100, 12001, 1,  0,    0,     5,  50,   0,     9,  50,   0,     13, 350,  0,     15, 240,  -3404,
    17, 0,    0,     1,  0,    0,     17, 0,    0,     1,  50,   -2246, 3,  70,   2513,  7,  650,  2253,
    9,  800,  2258,  12, 950,  -218,  15, 750,  -5274, 17, 50,   -2232, 1,  0,    0,     17, 0,    0,
    1,  0,    0,     17, 0,    0,     1,  50,   2237,  5,  200,  0,     8,  100,  -2238, 9,  0,    -2981,
    14, -250, 0,     17, 0,    3001,  1,  0,    0,     17, 0,    0,     1,  100,  2233,  5,  350,  0,
    9,  100,  -2231, 13, -100, 0,     17, 100,  2233,  1,  -300, -7405, 3,  -700, -1471, 7,  -675, 1466,
    9,  -100, 12136, 12, 450,  365,   15, 200,  -5946, 17, -300, -7473, 1,  -50,  -1138, 5,  -350, 0,
    7,  -240, 3390,  9,  0,    0,     13, -50,  0,     17, -50,  0,     1,  0,    0,     17, 0,    0,
    1,  800,  2214,  4,  950,  -214,  7,  750,  -5266, 9,  50,   -2266, 11, 70,   2544,  15, 650,  2263,
    17, 800,  2264,  1,  0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,     1,  50,   -2248,
    6,  -250, 0,     9,  0,    3008,  13, 200,  0,     16, 100,  -2250, 17, 0,    -2977, 1,  0,    0,
    17, 0,    0,     1,  0,    0,     17, 0,    0,     1,  35,   1970,  2,  70,   0,     6,  -180, 0,
    10, 70,   0,     14, -180, 0,     17, 30,   2101,  1,  0,    0,     17, 0,    0,     1,  0,    0,
    17, 0,    0,     1,  -50,  4517,  3,  150,  0,     7,  -250, 0,     11, 150,  0,     15, -250, 0,
    17, -50,  4376,  1,  0,    0,     17, 0,    0,     1,  65,   -1729, 2,  0,    -2247, 6,  -150, 0,
    10, 0,    2233,  14, 150,  0,     17, 65,   -1728, 1,  30,   -1454, 2,  -10,  -602,  3,  -10,  597,
    5,  40,   596,   8,  60,   0,     10, -10,  -610,  11, -10,  610,   13, 40,   594,   16, 60,   0,
    17, 30,   -1425, 1,  0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,     1,  -3,   -4428,
    5,  -350, 0,     9,  0,    5959,  13, 350,  0,     17, -3,   -6025, 1,  -550, 0,     5,  -350, 0,
    9,  -550, 0,     13, -350, 0,     17, -550, 0,     1,  0,    0,     17, 0,    0,     1,  0,    0,
    5,  -250, 0,     9,  -130, 2389,  12, 0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,
    1,  0,    0,     17, 0,    0,     1,  0,    5955,  5,  350,  0,     9,  0,    -5968, 13, -350, 0,
    17, 0,    5929,  1,  550,  0,     5,  350,  0,     9,  550,  0,     13, 350,  0,     17, 550,  0,
    1,  0,    0,     17, 0,    0,     1,  -125, 2341,  4,  0,    0,     9,  0,    0,     13, -250, 0,
    17, -130, 2398,  1,  0,    0,     17, 0,    0,     1,  0,    0,     17, 0,    0,     1,  40,   -1105,
    5,  0,    377,   13, 150,  0,     17, 40,   -1104, 1,  0,    0,     17, 0,    0,     1,  0,    595,
    5,  50,   0,     13, -50,  0,     17, 0,    595,   1,  0,    0,     2,  -15,  -746,  4,  -45,  0,
    6,  -10,  302,   9,  0,    0,     10, -15,  -730,  12, -45,  0,     14, -10,  302,   17, 0,    0,
    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_walk_ki1 = {
    { cKF_ckcb_r_npc_1_walk_ki1_tbl, cKF_ds_npc_1_walk_ki1_tbl, cKF_kn_npc_1_walk_ki1_tbl, cKF_c_npc_1_walk_ki1_tbl, -1,
      17 },
    1.0f,
    17.0f,
    cKF_FRAMECONTROL_REPEAT,
    -5.0f,
    NULL,
    aNPC_EYE_TEX0,
    5,
    NULL,
    aNPC_MOUTH_TEX0,
    0,
    -1,
    -1,
    NULL,
    se_dt_tbl,
};
