#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_cracker_fire1_tbl[] = { 56, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 7, 7,
                                            7,  0, 7, 7, 0, 7, 7, 7, 7, 0, 0, 0, 0 };

s16 cKF_kn_npc_1_cracker_fire1_tbl[] = { 2, 6, 4, 4, 4, 2, 9, 8, 7, 2, 9, 2, 2, 8, 9, 6, 6, 6, 7, 6, 2, 2, 6, 6, 2, 5,
                                         2, 2, 6, 2, 4, 6, 5, 4, 4, 4, 2, 4, 2, 5, 5, 4, 2, 3, 2, 2, 5, 5, 5, 6, 5 };

s16 cKF_c_npc_1_cracker_fire1_tbl[] = { 0, 0, 900, 0, 0,    1800, 0, 0,    1800, 0, 900, 0, 0, 0, -900,
                                        0, 0, 900, 0, -900, 0,    0, -212, 0,    0, 0,   0, 0, 0, -900 };

s16 cKF_ds_npc_1_cracker_fire1_tbl[] = {
    1,  0,     0,     31, 0,    0,    1,  875,  0,    2,  850,  0,     8,  850,  0,     14, 850,   0,
    22, 906,   441,   31, 875,  0,    1,  -75,  0,    2,  -100, 0,     8,  -200, 0,     31, -75,   0,
    1,  55,    0,     2,  75,   0,    8,  100,  0,    31, 55,   0,     1,  125,  0,     2,  150,   0,
    8,  200,   0,     31, 125,  0,    1,  0,    0,    31, 0,    0,     1,  -153, 0,     2,  -141,  0,
    4,  -141,  0,     5,  -135, 357,  14, 31,   190,  15, 30,   -250,  18, 5,    -225,  22, -25,   -232,
    31, -153,  0,     1,  -264, 0,    2,  -300, -50,  5,  -305, -52,   8,  -325, 0,     14, -155,  75,
    18, -125,  249,   22, -110, 75,   31, -264, 0,    1,  63,   0,     4,  63,   -57,   5,  56,    0,
    14, 84,    0,     18, 86,   38,   22, 95,   0,    31, 63,   0,     1,  0,    0,     31, 0,     0,
    1,  653,   0,     2,  715,  0,    4,  700,  -502, 8,  665,  0,     14, 736,  0,     16, 714,   -442,
    18, 675,   -563,  22, 630,  -225, 31, 653,  0,    1,  0,    0,     31, 0,    0,     1,  0,     0,
    31, 0,     0,     1,  -263, 0,    5,  -205, 943,  8,  -175, 0,     14, -420, -278,  17, -436,  -138,
    18, -439,  0,     22, -350, 1012, 31, -263, 0,    1,  51,   0,     4,  75,   236,   5,  77,    0,
    14, -95,   -447,  15, -103, -76,  17, -105, -29,  18, -105, 0,     22, -90,  281,   31, 51,    0,
    1,  256,   0,     2,  284,  0,    8,  319,  0,    18, 279,  -302,  22, 228,  -390,  31, 256,   0,
    1,  -205,  0,     2,  -218, 0,    8,  -209, 0,    18, -263, -73,   22, -250, 341,   31, -205,  0,
    1,  -105,  0,     2,  -125, 0,    8,  -131, -47,  18, -123, 169,   22, -86,  306,   31, -105,  0,
    1,  0,     0,     2,  0,    0,    8,  0,    0,    14, 0,    0,     18, 0,    0,     22, 0,     0,
    31, 0,     0,     1,  640,  0,    2,  703,  0,    8,  646,  0,     18, 675,  -246,  22, 584,   -1234,
    31, 640,   0,     1,  0,    0,    31, 0,    0,    1,  0,    0,     31, 0,    0,     1,  -293,  0,
    2,  -310,  0,     8,  -211, 0,    18, -285, -150, 22, -270, 455,   31, -293, 0,     1,  -35,   0,
    2,  -44,   0,     8,  -64,  0,    18, -55,  121,  22, -34,  177,   31, -35,  0,     1,  0,     0,
    31, 0,     0,     1,  213,  870,  2,  250,  0,    3,  150,  -4441, 8,  -400, 0,     31, 213,   870,
    1,  0,     0,     31, 0,    0,    1,  0,    0,    31, 0,    0,     1,  -850, 0,     2,  -1000, 0,
    3,  -798,  6244,  8,  0,    0,    14, -100, 0,    31, -850, 0,     1,  0,    0,     31, 0,     0,
    1,  258,   0,     2,  300,  505,  9,  350,  0,    31, 258,  0,     1,  -335, -225,  2,  -350,  0,
    3,  -250,  3041,  9,  50,   481,  17, 75,   -180, 31, -335, -225,  1,  -178, 0,     2,  -200,  525,
    9,  -75,   558,   17, 0,    0,    31, -178, 0,    1,  973,  0,     2,  1050, 0,     9,  900,   -898,
    31, 973,   0,     1,  -743, 0,    2,  -750, 0,    9,  -550, 1292,  31, -743, 0,     1,  -970,  0,
    2,  -1000, 0,     9,  -900, 682,  31, -970, 0,    1,  0,    0,     31, 0,    0,     1,  -550,  0,
    2,  -550,  0,     9,  -350, 985,  31, -550, 0,    1,  0,    0,     31, 0,    0,     1,  -290,  0,
    2,  -350,  0,     3,  -290, 2350, 9,  -50,  370,  31, -290, 0,     1,  -688, 0,     2,  -650,  0,
    3,  -575,  2312,  9,  -250, 1144, 31, -688, 0,    1,  405,  0,     2,  450,  0,     9,  450,   0,
    31, 405,   0,     1,  0,    0,    31, 0,    0,    1,  -30,  0,     2,  0,    0,     31, -30,   0,
    1,  0,     0,     31, 0,    0,    1,  0,    0,    31, 0,    0,     1,  1010, 0,     2,  1025,  0,
    3,  950,   -3020, 9,  700,  0,    31, 1010, 0,    1,  -778, 0,     2,  -800, 0,     3,  -775,  1332,
    9,  -525,  0,     31, -778, 0,    1,  -188, 0,    2,  -200, 0,     3,  -250, -2282, 9,  -475,  0,
    31, -188,  0,     1,  119,  197,  2,  100,  0,    3,  25,   -3035, 9,  -250, -374,  17, -175,  771,
    31, 119,   197,   1,  175,  0,    2,  225,  0,    9,  200,  -189,  17, 100,  -503,  31, 175,   0
};

u8 npc_1_cracker_fire10_tex_index[] = { 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
                                        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0 };

u8 npc_1_cracker_fire11_tex_index[] = { 0, 1, 7, 7, 7, 1, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6,
                                        6, 6, 6, 6, 6, 6, 6, 6, 1, 2, 2, 2, 0, 0, 0 };

static int other_se_chk_pat[] = { 2 };

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

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_cracker_fire1 = {
    { cKF_ckcb_r_npc_1_cracker_fire1_tbl, cKF_ds_npc_1_cracker_fire1_tbl, cKF_kn_npc_1_cracker_fire1_tbl,
      cKF_c_npc_1_cracker_fire1_tbl, -1, 31 },
    1.0f,
    31.0f,
    cKF_FRAMECONTROL_REPEAT,
    -2.0f,
    npc_1_cracker_fire11_tex_index,
    aNPC_EYE_TEX0,
    -1,
    npc_1_cracker_fire10_tex_index,
    aNPC_MOUTH_TEX0,
    -1,
    -1,
    -1,
    NULL,
    se_dt_tbl,
};
