#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_hatafuri1_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_hatafuri1_tbl[] = { 2, 2,  2, 5, 9,  5,  10, 11, 12, 2, 11, 2, 2, 15, 12, 14, 12, 9,
                                     2, 13, 2, 2, 14, 10, 2,  6,  6,  2, 6,  6, 7, 9,  5,  2,  9,  4,
                                     2, 13, 2, 2, 5,  4,  2,  3,  2,  6, 2,  5, 7, 5,  9,  2,  9,  2 };

s16 cKF_c_npc_1_hatafuri1_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_hatafuri1_tbl[] = {
    1,  0,    0,     57, 0,    0,     1,  850,  0,     57, 850,  0,     1,  0,    0,     57, 0,    0,
    1,  125,  564,   15, 450,  320,   29, 375,  -566,  43, 50,   -300,  57, 125,  566,   1,  150,  367,
    10, 100,  -753,  15, 0,    -369,  24, 50,   712,   29, 150,  369,   38, 100,  -772,  43, 0,    -378,
    52, 50,   721,   57, 150,  369,   1,  25,   -504,  15, -150, 0,     29, -25,  498,   43, 100,  0,
    57, 25,   -499,  1,  -295, 767,   8,  -156, 178,   13, -165, -68,   17, -156, 196,   24, -108, 153,
    29, -110, -191,  33, -180, -625,  41, -400, -600,  47, -458, 0,     57, -295, 861,   1,  5,    -565,
    8,  -270, -1481, 13, -479, -695,  17, -524, -84,   24, -443, 806,   31, -193, 1125,  38, -10,  162,
    43, -20,  -201,  52, 10,   296,   55, 25,   0,     57, 5,    -554,  1,  261,  840,   3,  309,  592,
    8,  371,  70,    13, 349,  -323,  19, 275,  -184,  24, 279,  214,   29, 294,  -60,   33, 269,  -322,
    41, 141,  -296,  47, 129,  61,    55, 215,  653,   57, 261,  806,   1,  0,    0,     57, 0,    0,
    1,  645,  866,   8,  800,  174,   13, 785,  -381,  17, 744,  -175,  22, 740,  103,   27, 776,  0,
    31, 746,  -468,  36, 639,  -885,  41, 516,  -452,  47, 491,  87,    57, 645,  815,   1,  0,    0,
    57, 0,    0,     1,  0,    0,     57, 0,    0,     1,  -376, -314,  5,  -410, -20,   8,  -401, 215,
    13, -341, 364,   17, -310, 185,   19, -303, 18,    24, -320, -168,  27, -350, -239,  31, -365, 0,
    36, -350, 207,   38, -330, 331,   43, -305, 60,    47, -305, -37,   55, -353, -281,  57, -376, -316,
    1,  -173, 0,     3,  -173, 0,     8,  -163, 112,   15, -123, 148,   17, -115, 47,    22, -120, -57,
    31, -140, -79,   41, -165, -63,   45, -170, 0,     50, -170, 0,     55, -173, 0,     57, -173, 0,
    1,  184,  524,   7,  345,  916,   10, 430,  757,   13, 493,  567,   16, 525,  186,   19, 530,  0,
    23, 505,  -327,  26, 461,  -546,  33, 288,  -791,  38, 186,  -316,  45, 170,  -49,   50, 155,  -150,
    54, 148,  35,    57, 184,  434,   1,  -208, 1079,  8,  -70,  5,     13, -125, -391,  17, -150, -55,
    23, -95,  521,   27, -26,  394,   29, -10,  0,     33, -68,  -846,  38, -265, -1481, 43, -440, -672,
    47, -471, 0,     57, -208, 1025,  1,  -208, 488,   8,  -110, 187,   16, -198, -372,  22, -204, 320,
    27, -159, 91,    31, -190, -462,  41, -314, -148,  47, -315, 109,   57, -208, 467,   1,  0,    0,
    57, 0,    0,     1,  645,  -659,  10, 460,  18,    13, 483,  350,   17, 525,  250,   19, 538,  0,
    22, 523,  -222,  29, 514,  370,   31, 555,  724,   38, 713,  469,   41, 735,  108,   47, 738,  -38,
    54, 694,  -409,  57, 645,  -677,  1,  0,    0,     57, 0,    0,     1,  0,    0,     57, 0,    0,
    1,  -230, 120,   5,  -209, 205,   8,  -195, 0,     10, -206, -243,  17, -265, -217,  19, -275, 0,
    22, -264, 151,   27, -238, 85,    29, -238, -75,   33, -260, -126,  38, -271, 0,     41, -260, 148,
    50, -240, 20,    57, -230, 124,   1,  100,  0,     5,  109,  136,   15, 170,  185,   19, 183,  0,
    22, 178,  -123,  32, 139,  -102,  45, 105,  -55,   50, 100,  -6,    52, 100,  0,     57, 100,  0,
    1,  0,    0,     57, 0,    0,     1,  -5,   136,   3,  0,    0,     17, -100, 0,     31, 0,    0,
    45, -100, 0,     57, -5,   136,   1,  -400, 0,     3,  -400, 0,     17, 250,  1004,  31, 400,  0,
    45, -250, -1039, 57, -400, 0,     1,  0,    0,     57, 0,    0,     1,  -30,  289,   6,  0,    0,
    20, -100, 0,     34, 0,    0,     48, -100, 0,     57, -30,  289,   1,  -395, -72,   6,  -400, 0,
    20, 250,  1004,  34, 400,  0,     48, -250, -1039, 57, -395, -72,   1,  -200, 386,   10, 150,  2036,
    15, 450,  752,   29, 500,  -386,  38, 150,  -2084, 43, -150, -754,  57, -200, 394,   1,  -250, -1153,
    6,  -350, 0,     10, -250, 1636,  20, 100,  0,     29, -250, -1195, 34, -350, 0,     38, -250, 1601,
    48, 100,  0,     57, -250, -1199, 1,  0,    381,   15, 100,  0,     29, 0,    -384,  43, -100, 0,
    57, 0,    380,   1,  0,    0,     57, 0,    0,     1,  -450, -1262, 8,  -475, 619,   15, -350, 314,
    22, -350, -292,  29, -470, -655,  36, -475, 1136,  43, -100, 508,   50, -175, -1131, 57, -450, -1163,
    1,  -100, 638,   15, 100,  0,     43, -250, 0,     57, -100, 605,   1,  0,    0,     57, 0,    0,
    1,  -300, -456,  5,  -325, 0,     10, -225, 1478,  15, -25,  476,   19, 0,    0,     24, -75,  -1062,
    29, -300, -459,  33, -325, 0,     38, -225, 1414,  43, -25,  469,   47, 0,    0,     52, -75,  -1097,
    57, -300, 0,     1,  0,    0,     57, 0,    0,     1,  0,    0,     57, 0,    0,     1,  0,    -1043,
    15, -750, -1146, 29, -800, 1012,  43, -50,  1136,  57, 0,    -1018, 1,  50,   803,   15, 300,  0,
    43, -150, 0,     57, 50,   764,   1,  0,    0,     57, 0,    0,     1,  0,    0,     29, -450, 0,
    57, 0,    0,     1,  0,    0,     57, 0,    0,     1,  1175, 565,   8,  1250, 0,     22, 800,  -1041,
    36, 550,  0,     50, 1000, 997,   57, 1175, 575,   1,  0,    0,     57, 0,    0,     1,  600,  0,
    15, 450,  0,     29, 600,  0,     43, 450,  0,     57, 600,  0,     1,  0,    466,   8,  50,   0,
    15, 0,    -478,  29, -300, -481,  36, -350, 0,     43, -300, 468,   57, 0,    501,   1,  100,  242,
    15, 200,  0,     29, 150,  -233,  43, 50,   0,     57, 100,  244,   1,  150,  0,     10, 100,  -504,
    15, 0,    -286,  24, 50,   674,   29, 150,  0,     38, 100,  -523,  43, 0,    -284,  52, 50,   692,
    57, 150,  0,     1,  0,    0,     57, 0,    0,     1,  0,    0,     8,  0,    0,     15, -350, 0,
    22, -263, 942,   29, 0,    0,     36, 0,    0,     43, -350, 0,     50, -263, 957,   57, 0,    0,
    1,  0,    0,     57, 0,    0
};

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

aNPC_Animation_c cKF_ba_r_npc_1_hatafuri1 = {
    { cKF_ckcb_r_npc_1_hatafuri1_tbl, cKF_ds_npc_1_hatafuri1_tbl, cKF_kn_npc_1_hatafuri1_tbl, cKF_c_npc_1_hatafuri1_tbl,
      -1, 57 },
    1.0f,
    57.0f,
    cKF_FRAMECONTROL_REPEAT,
    -5.0f,
    NULL,
    aNPC_EYE_TEX0,
    5,
    npc_1_hatafuri10_tex_index,
    aNPC_MOUTH_TEX0,
    0,
    -1,
    -1,
    NULL,
    NULL,
};
