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

s16 cKF_c_npc_1_appear1_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_appear1_tbl[] = {
    1,  0,    0,     29, 0,    0,     1,  -4500, 22896, 5,  -1750, 18387, 14, 250,   0,     23, -100, 0,
    26, 0,    0,     29, 0,    0,     1,  0,     0,     2,  -1500, 0,     5,  -1200, 6935,  8,  -500, 6990,
    14, 250,  0,     23, 0,    0,     29, 0,     0,     1,  200,   0,     5,  50,    -740,  11, 0,    0,
    17, 0,    0,     23, 0,    0,     29, 0,     0,     1,  -250,  742,   5,  -150,  753,   11, 0,    490,
    17, 50,   0,     23, 0,    0,     26, 50,    0,     29, 50,    0,     1,  100,   0,     11, 25,   -484,
    14, 0,    0,     23, 0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  0,     0,     29, 0,     0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     29, 0,     0,     1,  300,   0,     9,  155,   -2385, 13, -100, 0,
    19, 75,   0,     25, 0,    0,     29, 0,     0,     1,  -900,  0,     9,  -450,  4776,  16, 250,  0,
    25, -100, 0,     28, -50,  0,     29, -50,   0,     1,  -300,  0,     5,  -200,  2999,  9,  75,   0,
    13, -100, 0,     19, 75,   0,     25, 0,     0,     29, 0,     0,     1,  -150,  0,     7,  -150, 0,
    11, 150,  0,     16, 0,    -1014, 24, -103,  0,     27, 0,     0,     29, 0,     0,     1,  -650, 0,
    7,  -650, 0,     11, -100, 1984,  16, 0,     0,     24, -53,   0,     29, -53,   0,     1,  -795, 0,
    11, -650, 2451,  16, 50,   0,     24, -300,  0,     27, -270,  0,     29, -270,  0,     1,  0,    0,
    26, 140,  0,     29, 140,  0,     1,  0,     0,     5,  0,     0,     11, 100,   0,     14, -100, -3046,
    26, -693, 0,     29, -693, 0,     1,  0,     0,     15, -300,  0,     26, -115,  0,     29, -115, 0,
    1,  -225, 0,     5,  -225, 0,     10, -125,  1249,  24, 400,   0,     29, 403,   0,     1,  -850, 0,
    5,  -850, 0,     10, -625, 3369,  15, -325,  550,   18, -325,  -554,  24, -548,  0,     29, -548, 0,
    1,  500,  0,     5,  500,  0,     10, 245,   -4440, 15, -350,  -1131, 18, -350,  1120,  24, 100,  0,
    29, 98,   0,     1,  0,    0,     29, 0,     0,     1,  -450,  0,     5,  -450,  0,     10, -300, 2445,
    15, 0,    0,     18, 0,    0,     24, -850,  0,     27, -793,  0,     29, -793,  0,     1,  0,    0,
    29, 0,    0,     1,  0,    0,     9,  -150,  -3491, 11, -900,  0,     12, -450,  21208, 16, 550,  0,
    19, 340,  -5125, 24, -548, 0,     29, -545,  0,     1,  0,     0,     9,  500,   0,     11, 50,   -15451,
    13, -500, 3071,  16, -200, 3036,  24, 293,   0,     29, 293,   0,     1,  0,     0,     9,  1100, 0,
    10, 1000, -6103, 19, -250, -2621, 24, -500,  0,     29, -500,  0,     1,  400,   0,     5,  250,  -2975,
    14, -150, 0,     20, 100,  0,     26, -10,   0,     29, -10,   0,     1,  -700,  0,     9,  -275, 4318,
    17, 300,  0,     26, -100, 0,     29, -51,   0,     1,  -400,  0,     5,  -250,  3090,  9,  100,  0,
    14, -150, 0,     20, 100,  0,     26, 0,     0,     29, 0,     0,     1,  0,     0,     29, 0,    0,
    1,  0,    0,     29, 0,    0,     1,  0,     0,     29, 0,     0
};

u8 npc_1_appear10_tex_index[] = {
    3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 1, 3, 3, 3, 3, 3
};

u8 npc_1_appear11_tex_index[] = {
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 0, 2, 0, 0, 0, 0, 0
};

static int other_se_chk_pat[] = { 10 };

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

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_appear1 = {
    { cKF_ckcb_r_npc_1_appear1_tbl, cKF_ds_npc_1_appear1_tbl, cKF_kn_npc_1_appear1_tbl, cKF_c_npc_1_appear1_tbl, -1,
      29 },
    1.0f,
    29.0f,
    cKF_FRAMECONTROL_STOP,
    0.0f,
    npc_1_appear11_tex_index,
    aNPC_EYE_TEX0,
    -1,
    npc_1_appear10_tex_index,
    aNPC_MOUTH_TEX0,
    -1,
    -1,
    -1,
    NULL,
    se_dt_tbl,
};
