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

s16 cKF_c_npc_1_umb_close1_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_umb_close1_tbl[] = {
    1,  0,    -179,  13, -50,   0,     21, -50,  0,     33, 0,     0,     1,  1000,  989,   7,  1100, 0,
    13, 1000, 0,     21, 975,   0,     33, 1000, 0,     1,  0,     -2981, 7,  -500,  -2005, 13, -700, 0,
    21, -700, 0,     33, 0,     0,     1,  0,    1550,  13, 400,   0,     21, 400,   0,     33, 0,    0,
    1,  0,    -275,  7,  -40,   0,     13, -15,  0,     21, 0,     0,     33, 0,     0,     1,  0,    -52,
    13, -15,  0,     21, 70,    0,     33, 0,    0,     1,  -175,  -1879, 7,  -380,  0,     10, -215, 918,
    13, -175, 0,     21, -173,  0,     24, -200, 0,     26, -145,  1084,  27, -125,  342,   30, -125, -386,
    33, -175, 0,     1,  -100,  1800,  7,  130,  0,     10, -13,   -1928, 13, -125,  75,    21, -45,  0,
    24, -15,  633,   26, 65,    2003,  27, 115,  0,     30, 30,    -1929, 33, -100,  0,     1,  25,   -194,
    7,  5,    0,     10, 25,    0,     13, 25,   0,     21, -35,   0,     24, 30,    1112,  26, 120,  1744,
    27, 160,  0,     30, 35,    -130,  33, 25,   0,     1,  0,     0,     33, 0,     0,     1,  200,  -1477,
    7,  0,    0,     10, 75,    1190,  13, 225,  0,     21, 185,   0,     24, 300,   1601,  26, 405,  1486,
    27, 430,  0,     33, 200,   0,     1,  0,    0,     33, 0,     0,     1,  0,     0,     33, 0,    0,
    1,  -100, 769,   7,  -25,   0,     10, -50,  -589,  13, -125,  0,     21, -95,   0,     24, -210, -1395,
    26, -310, -1457, 27, -340,  0,     30, -285, 1636,  33, -100,  0,     1,  0,     -737,  7,  -105, 0,
    10, -35,  680,   13, 0,     0,     21, 8,    0,     24, -55,   -907,  26, -115,  -900,  27, -135, 0,
    30, -40,  788,   33, 0,     0,     1,  175,  752,   4,  250,   727,   7,  275,   0,     13, 300,  0,
    21, 320,  0,     24, 450,   0,     27, 395,  -1044, 30, 245,   -1462, 33, 175,   0,     1,  -100, 0,
    4,  -150, -849,  7,  -245,  0,     13, -120, 0,     21, -150,  0,     24, -250,  0,     27, -200, 595,
    30, -140, 603,   33, -100,  0,     1,  -25,  939,   4,  10,    0,     7,  -90,   0,     13, -25,  0,
    21, -140, 0,     24, -300,  0,     27, -130, 1288,  30, -50,   487,   33, -25,   0,     1,  0,    0,
    33, 0,    0,     1,  200,   -1776, 4,  50,   -988,  7,  0,     0,     13, 220,   0,     21, 475,  0,
    24, 300,  -2947, 27, 145,   0,     30, 190,  311,   33, 200,   0,     1,  0,     0,     33, 0,    0,
    1,  0,    0,     33, 0,     0,     1,  -100, 1703,  4,  110,   2767,  7,  340,   0,     13, -120, 0,
    21, -265, 0,     24, 15,    1722,  27, 80,   0,     28, 20,    -1614, 30, -60,   -856,  33, -100, 0,
    1,  0,    -1512, 4,  -80,   0,     7,  -35,  148,   13, -25,   0,     21, -30,   0,     24, 10,   0,
    27, -55,  0,     30, -15,   429,   33, 0,    0,     1,  0,     0,     33, 0,     0,     1,  60,   0,
    33, 60,   0,     1,  0,     0,     33, 0,    0,     1,  0,     0,     33, 0,     0,     1,  82,   0,
    33, 82,   0,     1,  0,     0,     33, 0,    0,     1,  0,     1731,  7,  250,   0,     11, 150,  -752,
    13, 130,  0,     15, 140,   398,   21, 300,  0,     24, 270,   -689,  33, 0,     0,     1,  2,    78,
    7,  0,    -100,  13, -40,   0,     21, 2,    0,     33, 2,     0,     1,  0,     0,     33, 0,    0,
    1,  0,    0,     4,  150,   3104,  7,  500,  0,     15, 365,   0,     24, 370,   0,     33, 0,    0,
    1,  58,   -6799, 7,  -1150, 0,     15, -450, 0,     24, 200,   0,     33, 58,    0,     1,  -414, 1721,
    4,  -355, -457,  7,  -600,  0,     15, -400, 0,     24, -160,  0,     33, -414,  0,     1,  0,    0,
    15, 0,    0,     24, 600,   0,     33, 0,    0,     1,  -57,   -5194, 4,  -500,  0,     7,  -250, 0,
    15, -800, 0,     24, -900,  0,     33, -55,  0,     1,  0,     0,     33, 2,     0,     1,  -170, 6928,
    4,  300,  0,     7,  5,     -3811, 13, -300, 0,     19, -650,  -2669, 24, -1000, 0,     33, 0,    0,
    1,  -365, 3955,  4,  0,     0,     7,  -450, -3607, 13, -650,  0,     24, -600,  164,   33, 58,   0,
    1,  540,  -1567, 4,  400,   -489,  13, 400,  0,     24, 800,   0,     33, 414,   0,     1,  -200, 373,
    13, -100, 0,     21, 0,     0,     33, 0,    0,     1,  -1055, 0,     7,  -910,  1563,  13, -655, 0,
    21, -500, 0,     24, -500,  0,     33, -57,  0,     1,  420,   -2173, 13, 150,   0,     21, 0,    0,
    33, 0,    0,     1,  65,    5076,  4,  350,  -726,  7,  -98,   -3482, 13, -300,  0,     17, -50,  1568,
    21, 30,   0,     24, 30,    0,     33, 0,    0,     1,  -65,   2725,  4,  310,   4618,  7,  850,  6822,
    11, 1200, 0,     13, 1130,  -2282, 15, 900,  -4559, 21, 400,   0,     24, 400,   0,     33, 0,    0,
    1,  -625, 7029,  4,  -160,  0,     7,  -600, -2026, 13, -450,  0,     17, -250,  2781,  21, 100,  0,
    24, 100,  0,     33, 0,     0,     1,  0,    -2115, 7,  -300,  0,     13, -50,   1393,  21, 200,  0,
    24, 100,  -1022, 33, 0,     0,     1,  0,    706,   7,  100,   0,     13, -50,   -1189, 21, -300, 0,
    33, 0,    0,     1,  0,     -561,  7,  -80,  0,     13, -25,   0,     21, -75,   0,     24, -90,  0,
    33, 0,    0,     1,  0,     0,     33, 0,    0,     1,  0,     0,     33, 0,     0,     1,  0,    0,
    33, 0,    0
};

static int lfoot_se_chk_pat[] = { 8, 32 };

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

static int rfoot_se_chk_pat[] = { 12, 26 };

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_umb_close1 = {
    { cKF_ckcb_r_npc_1_umb_close1_tbl, cKF_ds_npc_1_umb_close1_tbl, cKF_kn_npc_1_umb_close1_tbl,
      cKF_c_npc_1_umb_close1_tbl, -1, 33 },
    1.0f,
    33.0f,
    cKF_FRAMECONTROL_STOP,
    -5.0f,
    NULL,
    aNPC_EYE_TEX0,
    0,
    NULL,
    aNPC_MOUTH_TEX0,
    0,
    -1,
    -1,
    NULL,
    se_dt_tbl,
};
