#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_mogaku1_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_mogaku1_tbl[] = { 9, 11, 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, 2,  2,  2,  9, 9, 9, 9, 9, 9,
                                   2, 17, 2, 5, 9, 9, 2, 17, 2, 14, 14, 14, 9, 9, 9, 6, 6, 6 };

s16 cKF_c_npc_1_mogaku1_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_mogaku1_tbl[] = {
    1,  0,    -504,  6,  -50,  0,     11, 0,    500,   16, 50,   0,     21, 0,    -506,  26, -50,  0,
    31, 0,    499,   36, 50,   0,     41, 0,    -504,  1,  -500, 0,     6,  -450, 0,     11, -500, 0,
    14, -475, 0,     16, -500, 0,     21, -450, 0,     26, -500, 0,     29, -475, 0,     31, -500, 0,
    36, -450, 0,     41, -500, 0,     1,  0,    0,     11, 100,  0,     21, 0,    0,     31, 100,  0,
    41, 0,    0,     1,  0,    0,     41, 0,    0,     1,  0,    0,     41, 0,    0,     1,  0,    0,
    41, 0,    0,     1,  -175, 0,     41, -175, 0,     1,  -100, 0,     41, -100, 0,     1,  25,   0,
    41, 25,   0,     1,  0,    0,     41, 0,    0,     1,  200,  0,     41, 200,  0,     1,  0,    0,
    41, 0,    0,     1,  0,    0,     41, 0,    0,     1,  -100, 0,     41, -100, 0,     1,  0,    0,
    41, 0,    0,     1,  175,  0,     41, 175,  0,     1,  -100, 0,     41, -100, 0,     1,  -25,  0,
    41, -25,  0,     1,  0,    0,     41, 0,    0,     1,  200,  0,     41, 200,  0,     1,  0,    0,
    41, 0,    0,     1,  0,    0,     41, 0,    0,     1,  -100, 0,     41, -100, 0,     1,  0,    0,
    41, 0,    0,     1,  0,    0,     41, 0,    0,     1,  900,  0,     41, 900,  0,     1,  0,    0,
    41, 0,    0,     1,  0,    0,     41, 0,    0,     1,  82,   0,     41, 82,   0,     1,  0,    0,
    41, 0,    0,     1,  0,    499,   6,  -25,  -501,  11, -50,  484,   16, -25,  -501,  21, 0,    499,
    26, 25,   -501,  31, 50,   484,   36, 25,   -501,  41, 0,    499,   1,  100,  778,   6,  200,  0,
    11, 125,  -725,  16, 50,   0,     21, 100,  519,   26, 150,  0,     31, 75,   -763,  36, 0,    0,
    41, 100,  778,   1,  0,    499,   6,  -25,  -501,  11, -50,  484,   16, -25,  -501,  21, 0,    499,
    26, 25,   -501,  31, 50,   484,   36, 25,   -501,  41, 0,    499,   1,  -400, 2156,  6,  -200, 0,
    11, -400, -2382, 16, -600, 0,     21, -450, 1464,  26, -300, 0,     31, -450, -1438, 36, -600, 0,
    41, -400, 2156,  1,  -200, -762,  6,  -400, 0,     11, -200, 2162,  16, 0,    0,     21, -400, -3056,
    26, -600, 0,     31, -400, 1860,  36, -200, 511,   41, -200, -762,  1,  200,  -1124, 6,  100,  0,
    11, 200,  1108,  16, 300,  0,     21, 250,  -740,  26, 150,  0,     31, 250,  1317,  36, 450,  0,
    41, 200,  -1124, 1,  0,    0,     41, 0,    0,     1,  -100, 1353,  4,  -55,  0,     6,  -100, -1304,
    9,  -150, 0,     11, -100, 1431,  14, -55,  0,     16, -100, -1248, 19, -150, 0,     21, -100, 1288,
    24, -55,  0,     26, -100, -1290, 29, -150, 0,     31, -100, 1247,  34, -55,  0,     36, -100, -1250,
    39, -150, 0,     41, -100, 1353,  1,  0,    0,     41, 0,    0,     1,  450,  1079,  6,  600,  0,
    16, 300,  0,     26, 600,  0,     41, 450,  1079,  1,  -400, 1167,  6,  -200, 0,     11, -400, -1869,
    16, -600, 0,     21, -200, 2894,  26, 0,    0,     31, -200, -1478, 36, -400, -992,  41, -400, 1167,
    1,  -250, 502,   6,  -150, 0,     11, -250, 0,     16, -50,  0,     21, -200, 0,     26, -100, 0,
    31, -200, -999,  36, -300, 0,     41, -250, 502,   1,  0,    0,     41, 0,    0,     1,  -100, 1161,
    4,  -55,  0,     6,  -100, -1171, 9,  -150, 0,     11, -100, 1097,  14, -55,  0,     16, -100, -1217,
    19, -150, 0,     21, -100, 1154,  24, -55,  0,     26, -100, -1160, 29, -150, 0,     31, -100, 1090,
    34, -55,  0,     36, -100, -1216, 39, -150, 0,     41, -100, 1161,  1,  0,    0,     41, 0,    0,
    1,  515,  -3886, 2,  387,  -3690, 6,  290,  1407,  9,  494,  1932,  12, 605,  156,   16, 522,  264,
    19, 568,  -524,  22, 375,  -2486, 26, 296,  1194,  29, 389,  177,   32, 458,  1402,  36, 676,  1422,
    39, 703,  -1365, 41, 515,  -3886, 1,  409,  -1220, 2,  360,  -1446, 6,  283,  1005,  9,  395,  483,
    12, 371,  -411,  16, 426,  595,   19, 363,  -1689, 22, 182,  -1841, 26, 114,  870,   29, 220,  748,
    32, 245,  67,    36, 348,  1042,  39, 422,  272,   41, 409,  -1220, 1,  111,  -2617, 2,  41,   -1937,
    6,  59,   950,   9,  168,  952,   12, 117,  -1765, 16, -28,  1315,  19, 158,  1058,  22, 175,  -593,
    26, 141,  494,   29, 137,  -586,  32, 76,   -344,  36, 209,  1439,  39, 242,  -1219, 41, 111,  -2617,
    1,  0,    366,   6,  25,   -194,  11, 50,   161,   16, 50,   -159,  21, 0,    -379,  26, -25,  192,
    31, -50,  -164,  36, -50,  157,   41, 0,    366,   1,  0,    504,   6,  50,   0,     11, 0,    -525,
    16, -50,  0,     21, 0,    482,   26, 50,   0,     31, 0,    -496,  36, -50,  0,     41, 0,    504,
    1,  0,    251,   6,  0,    -253,  11, 0,    246,   16, 0,    -247,  21, 0,    251,   26, 0,    -253,
    31, 0,    246,   36, 0,    -247,  41, 0,    251,   1,  0,    0,     6,  0,    0,     16, 0,    0,
    26, 0,    0,     36, 0,    0,     41, 0,    0,     1,  -225, 1105,  6,  -100, 0,     16, -350, 0,
    26, -100, 0,     36, -350, 0,     41, -225, 1111,  1,  0,    0,     6,  0,    0,     16, 0,    0,
    26, 0,    0,     36, 0,    0,     41, 0,    0
};

u8 npc_1_mogaku10_tex_index[] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
                                  5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 };

aNPC_Animation_c cKF_ba_r_npc_1_mogaku1 = {
    { cKF_ckcb_r_npc_1_mogaku1_tbl, cKF_ds_npc_1_mogaku1_tbl, cKF_kn_npc_1_mogaku1_tbl, cKF_c_npc_1_mogaku1_tbl, -1,
      41 },
    1.0f,
    41.0f,
    cKF_FRAMECONTROL_REPEAT,
    -5.0f,
    NULL,
    aNPC_EYE_TEX0,
    6,
    npc_1_mogaku10_tex_index,
    aNPC_MOUTH_TEX0,
    -1,
    -1,
    -1,
    NULL,
    NULL,
};
