#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_get_eat1_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_get_eat1_tbl[] = { 2, 5,  2, 2, 11, 4, 4, 11, 5, 2, 6,  2, 2, 5,  6, 10, 11, 10,
                                    2, 10, 2, 2, 5,  5, 2, 13, 8, 2, 12, 2, 6, 13, 7, 5,  5,  5,
                                    3, 5,  3, 6, 6,  6, 2, 6,  2, 2, 2,  2, 6, 13, 7, 2,  10, 2 };

s16 cKF_c_npc_1_get_eat1_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_get_eat1_tbl[] = {
    1,  0,    0,    59, 0,    0,     1,  975,  0,    9,  950,  0,    27, 950,  0,    35, 1000, 0,   59, 1000, 0,
    1,  0,    0,    59, 0,    0,     1,  0,    0,    59, 0,    0,    1,  60,   0,    9,  45,   0,   12, 60,   0,
    15, 45,   0,    18, 60,   0,     21, 45,   0,    24, 60,   0,    27, 45,   0,    35, 30,   0,   47, -30,  0,
    59, 0,    0,    1,  90,   0,     27, 90,   0,    35, 0,    0,    59, 0,    0,    1,  -185, 0,   27, -185, 0,
    35, -175, 0,    59, -175, 0,     1,  40,   0,    9,  -83,  0,    12, -68,  0,    15, -83,  0,   18, -68,  0,
    21, -83,  0,    24, -68,  0,     27, -83,  0,    35, -70,  0,    47, -130, 0,    59, -100, 0,   1,  -85,  0,
    9,  -53,  0,    27, -53,  0,     35, 25,   0,    59, 25,   0,    1,  0,    0,    59, 0,    0,   1,  40,   0,
    9,  278,  0,    27, 278,  0,     35, 200,  0,    47, 200,  0,    59, 200,  0,    1,  0,    0,   59, 0,    0,
    1,  0,    0,    59, 0,    0,     1,  -15,  0,    9,  -140, 0,    27, -140, 0,    35, -100, 0,   59, -100, 0,
    1,  0,    0,    9,  3,    0,     27, 3,    0,    35, 0,    0,    47, 0,    0,    59, 0,    0,   1,  180,  0,
    9,  195,  0,    12, 190,  0,     15, 195,  0,    18, 190,  0,    21, 195,  0,    24, 190,  0,   27, 195,  0,
    35, 175,  0,    59, 175,  0,     1,  -260, 0,    9,  -308, 0,    12, -290, 0,    15, -308, 0,   18, -290, 0,
    21, -308, 0,    24, -290, 0,     27, -308, 0,    35, -70,  0,    47, -130, 0,    59, -100, 0,   1,  -145, 0,
    9,  -160, 0,    12, -158, 0,     15, -160, 0,    18, -158, 0,    21, -160, 0,    24, -158, 0,   27, -160, 0,
    35, -25,  0,    59, -25,  0,     1,  0,    0,    59, 0,    0,    1,  560,  0,    9,  630,  0,   12, 625,  0,
    15, 630,  0,    18, 625,  0,     21, 630,  0,    24, 625,  0,    27, 630,  0,    35, 200,  0,   59, 200,  0,
    1,  0,    0,    59, 0,    0,     1,  0,    0,    59, 0,    0,    1,  -240, 0,    9,  -275, 0,   27, -275, 0,
    35, -100, 0,    59, -100, 0,     1,  -40,  0,    9,  -45,  0,    27, -45,  0,    35, 0,    0,   59, 0,    0,
    1,  0,    0,    59, 0,    0,     1,  60,   0,    10, -250, 0,    13, -200, 0,    16, -250, 0,   19, -200, 0,
    22, -250, 0,    25, -200, 0,     28, -250, 0,    36, -50,  0,    42, -100, -652, 48, -250, 0,   53, -200, 663,
    59, 60,   0,    1,  0,    0,     10, -50,  0,    16, 50,   0,    22, -50,  0,    28, 50,   0,   36, 0,    0,
    48, 0,    0,    59, 0,    0,     1,  0,    0,    59, 0,    0,    1,  82,   0,    11, -50,  0,   14, 50,   0,
    17, -50,  0,    20, 50,   0,     23, -50,  0,    26, 50,   0,    29, -50,  0,    37, 50,   0,   43, 25,   -393,
    49, -100, 0,    59, 82,   0,     1,  0,    0,    59, 0,    0,    1,  0,    0,    10, -25,  0,   16, 25,   0,
    22, -25,  0,    28, 0,    0,     59, 0,    0,    1,  100,  0,    6,  70,   -665, 10, -50,  0,   13, 0,    0,
    16, -50,  0,    19, 0,    0,     22, -50,  0,    25, 0,    0,    28, -50,  0,    36, 0,    0,   48, -75,  0,
    53, -20,  280,  59, 2,    0,     1,  -50,  0,    10, -50,  0,    16, 0,    0,    22, -50,  0,   28, -100, 0,
    36, 0,    0,    59, 0,    0,     1,  -120, 0,    10, -120, 0,    28, -650, 0,    48, -150, 739, 59, 0,    0,
    1,  -700, 0,    10, -900, 0,     28, -850, 0,    48, -250, 1782, 59, 58,   0,    1,  -450, 0,   10, -450, 0,
    28, 200,  0,    48, -300, -717,  59, -564, 0,    1,  0,    0,    28, 0,    0,    59, 0,    0,   1,  -50,  0,
    10, -450, 0,    28, -600, 0,     48, -400, 475,  59, -57,  0,    1,  0,    0,    28, 0,    0,   59, 0,    0,
    1,  0,    0,    10, 0,    0,     19, 80,   773,  28, 650,  0,    48, 150,  -772, 59, 0,    0,   1,  50,   0,
    10, -250, 0,    19, -600, -1415, 28, -800, 0,    48, -250, 1785, 59, 58,   0,    1,  300,  0,   10, 300,  0,
    19, 200,  -989, 28, -200, 0,     48, 300,  653,  59, 564,  0,    1,  0,    0,    59, 0,    0,   1,  -57,  0,
    10, -350, 0,    19, -415, -463,  28, -600, 0,    48, -400, 529,  59, -57,  0,    1,  0,    0,   59, 0,    0,
    1,  0,    0,    59, 0,    0,     1,  0,    0,    59, 0,    0,    1,  0,    0,    59, 0,    0,   1,  0,    0,
    11, -10,  0,    17, 10,   0,     23, -10,  0,    29, 0,    0,    59, 0,    0,    1,  -200, 0,   6,  -210, -151,
    11, -250, 0,    14, -200, 0,     17, -250, 0,    20, -200, 0,    23, -250, 0,    26, -200, 0,   29, -250, 0,
    39, -70,  0,    50, -250, 0,     54, -200, 1034, 59, 0,    0,    1,  -10,  0,    11, 80,   0,   17, 110,  0,
    23, 80,   0,    29, 50,   0,     39, 0,    0,    59, 0,    0,    1,  0,    0,    59, 0,    0,   1,  0,    0,
    6,  -450, 0,    10, 0,    0,     13, -450, 0,    16, 0,    0,    19, -450, 0,    22, 0,    0,   25, -450, 0,
    28, 0,    0,    59, 0,    0,     1,  0,    0,    59, 0,    0
};

u8 npc_1_get_eat11_tex_index[] = { 0, 0, 0, 0, 0, 0, 0, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
                                   5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                   1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0 };

static int other_se_chk_pat[] = { 6, 13, 19, 25 };

static aNPC_other_se_data_c other_se_dt[] = { { { ARRAY_COUNT(other_se_chk_pat), other_se_chk_pat }, 275 } };

static aNPC_se_data_table_c se_dt_tbl[] = { { NULL, NULL, aNPC_OTHER_SE_TYPE1, other_se_dt } };

aNPC_Animation_c cKF_ba_r_npc_1_get_eat1 = {
    { cKF_ckcb_r_npc_1_get_eat1_tbl, cKF_ds_npc_1_get_eat1_tbl, cKF_kn_npc_1_get_eat1_tbl, cKF_c_npc_1_get_eat1_tbl, -1,
      59 },
    1.0f,
    59.0f,
    cKF_FRAMECONTROL_STOP,
    -5.0f,
    npc_1_get_eat11_tex_index,
    aNPC_EYE_TEX0,
    -1,
    NULL,
    aNPC_MOUTH_TEX0,
    0,
    9,
    eEC_EFFECT_TABERU,
    NULL,
    se_dt_tbl,
};
