#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_change1_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_change1_tbl[] = { 7, 7, 2, 9, 11, 12, 8, 8, 9,  2,  9, 2,  2,  9,  8,  8, 8,  10,
                                       2, 8, 2, 2, 8,  7,  2, 6, 10, 2,  6, 10, 10, 11, 10, 7, 10, 7,
                                       2, 8, 2, 8, 8,  9,  2, 7, 2,  10, 9, 10, 9,  11, 6,  2, 7,  2 };

s16 cKF_c_npc_1_get_change1_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_change1_tbl[] = {
    1,   0,    0,     19,  -50,   0,     35,  -50,   0,     57,  0,    0,     73,  -200, 0,     93,  -200, 0,
    113, 0,    0,     1,   975,   0,     19,  1000,  0,     25,  1200, 1309,  47,  1150, -1191, 57,  875,  0,
    93,  875,  0,     113, 1000,  0,     1,   0,     0,     113, 0,    0,     1,   0,    0,     13,  140,  222,
    25,  50,   -1176, 57,  -3500, -744,  58,  -3510, -81,   59,  70,   -720,  71,  -100, 0,     93,  -100, 0,
    113, 0,    0,     1,   60,    0,     13,  -70,   -278,  23,  -85,  231,   29,  0,    250,   35,  25,   0,
    43,  0,    -161,  53,  -20,   0,     59,  -85,   0,     71,  -50,  0,     93,  -50,  0,     113, 0,    0,
    1,   90,   0,     13,  -50,   -325,  19,  -80,   0,     23,  -65,  226,   29,  0,    0,     41,  0,    0,
    59,  -55,  0,     65,  -50,   0,     71,  -100,  0,     79,  -80,  0,     93,  -80,  0,     113, 0,    0,
    1,   -185, 0,     19,  -180,  0,     39,  50,    0,     57,  -150, 0,     71,  100,  1279,  77,  100,  0,
    93,  100,  0,     113, -175,  0,     1,   40,    0,     19,  -350, 0,     29,  60,   0,     57,  -300, 0,
    71,  250,  2481,  77,  250,   0,     93,  250,   0,     113, -100, 0,     1,   -85,  0,     19,  100,  182,
    29,  100,  -253,  39,  0,     0,     57,  250,   0,     71,  420,  746,   77,  420,  0,     93,  420,  0,
    113, 25,   0,     1,   0,     0,     113, 0,     0,     1,   40,   0,     19,  450,  0,     29,  0,    0,
    35,  0,    0,     57,  750,   0,     71,  250,   -2324, 77,  250,  0,     93,  250,  0,     113, 200,  0,
    1,   0,    0,     113, 0,     0,     1,   0,     0,     113, 0,    0,     1,   -15,  0,     19,  -210, 0,
    35,  450,  0,     47,  0,     -1985, 57,  -475,  0,     71,  -350, 742,   77,  -350, 0,     93,  -350, 0,
    113, -100, 0,     1,   0,     0,     19,  25,    0,     35,  0,    -183,  57,  -240, 0,     71,  -300, -246,
    77,  -300, 0,     93,  -300,  0,     113, 0,     0,     1,   180,  0,     19,  -80,  0,     35,  0,    0,
    57,  -50,  0,     71,  360,   1936,  77,  360,   0,     93,  360,  0,     113, 175,  0,     1,   -260, 0,
    19,  200,  0,     35,  150,   -249,  57,  -250,  0,     71,  -300, -240,  77,  -300, 0,     93,  -300, 0,
    113, -100, 0,     1,   -145,  0,     19,  -50,   0,     27,  0,    495,   35,  150,  0,     45,  -100, -633,
    57,  -200, 0,     71,  -90,   521,   77,  -90,   0,     93,  -90,  0,     113, -25,  0,     1,   0,    0,
    113, 0,    0,     1,   560,   0,     19,  450,   0,     35,  0,    0,     57,  480,  0,     71,  620,  714,
    77,  620,  0,     93,  620,   0,     113, 200,   0,     1,   0,    0,     113, 0,    0,     1,   0,    0,
    113, 0,    0,     1,   -240,  0,     19,  -215,  0,     35,  450,  0,     47,  0,    -1194, 57,  -310, 0,
    71,  -300, 0,     93,  -300,  0,     113, -100,  0,     1,   -40,  0,     35,  0,    0,     47,  50,   408,
    57,  290,  0,     71,  0,     -1361, 77,  0,     0,     113, 0,    0,     1,   0,    0,     113, 0,    0,
    1,   60,   0,     13,  -50,   -370,  31,  -150,  0,     63,  100,  0,     81,  -150, 0,     113, 60,   0,
    1,   0,    0,     13,  -150,  0,     21,  0,     1124,  31,  450,  379,   43,  500,  0,     51,  450,  -398,
    63,  -200, -759,  71,  -200,  490,   77,  100,   0,     113, 0,    0,     1,   0,    0,     113, 0,    0,
    1,   82,   0,     19,  -50,   -382,  37,  -150,  0,     69,  100,  0,     87,  -150, 0,     113, 82,   0,
    1,   0,    0,     19,  -200,  0,     27,  -50,   1100,  37,  450,  373,   49,  500,  0,     59,  450,  -386,
    69,  -300, -756,  75,  -300,  378,   83,  100,   0,     113, 0,    0,     1,   0,    0,     17,  300,  0,
    23,  250,  -564,  35,  -100,  0,     43,  150,   1091,  55,  400,  0,     71,  10,   -1969, 73,  -20,  0,
    77,  0,    0,     113, 0,     0,     1,   100,   0,     13,  -20,  -667,  21,  -150, 0,     29,  100,  305,
    43,  0,    -359,  59,  -140,  0,     71,  110,   1590,  73,  170,  0,     77,  150,  0,     93,  150,  0,
    113, 2,    0,     1,   -90,   0,     13,  -150,  -251,  19,  -150, 188,   43,  0,    0,     55,  -100, 0,
    71,  100,  1023,  73,  120,   0,     77,  100,   0,     93,  100,  0,     113, 0,    0,     1,   0,    0,
    15,  150,  0,     25,  0,     0,     35,  200,   989,   53,  450,  0,     65,  0,    0,     113, 0,    0,
    1,   -300, 0,     15,  450,   0,     25,  100,   -2349, 35,  -900, 0,     53,  -900, 0,     73,  100,  2515,
    75,  170,  0,     79,  150,   0,     93,  150,   0,     113, 58,   0,     1,   -500, 0,     15,  0,    0,
    35,  -300, 0,     53,  -300,  0,     65,  -200,  0,     93,  -200, 0,     113, -564, 0,     1,   0,    0,
    113, 0,    0,     1,   -600,  0,     19,  0,     0,     35,  -900, 0,     47,  -450, 0,     63,  -750, 0,
    75,  0,    0,     93,  0,     0,     113, -57,   0,     1,   0,    0,     113, 0,    0,     1,   0,    0,
    15,  -270, 0,     31,  150,   0,     43,  -100,  0,     57,  200,  985,   75,  450,  0,     93,  450,  0,
    113, 0,    0,     1,   -300,  0,     15,  -750,  0,     31,  -50,  0,     43,  -400, -997,  63,  -450, 573,
    75,  -260, 0,     93,  -260,  0,     113, 58,    0,     1,   500,  0,     15,  450,  -146,  25,  250,  -1612,
    31,  -50,  0,     43,  150,   0,     57,  -50,   -753,  75,  -360, 0,     93,  -360, 0,     113, 564,  0,
    1,   0,    0,     113, 0,     0,     1,   -600,  0,     19,  -300, -951,  31,  -900, 0,     57,  -200, 740,
    73,  0,    0,     93,  0,     0,     113, -57,   0,     1,   0,    0,     113, 0,    0,     1,   0,    0,
    21,  800,  0,     33,  880,   -142,  47,  700,   0,     57,  750,  0,     67,  700,  -373,  73,  295,  0,
    77,  293,  0,     93,  297,   0,     113, 65,    0,     1,   0,    0,     21,  -50,  0,     27,  0,    752,
    47,  1050, 2516,  57,  1735,  0,     73,  535,   0,     77,  563,  0,     93,  555,  0,     113, -65,  0,
    1,   0,    0,     21,  -475,  0,     27,  250,   0,     33,  170,  -1197, 47,  -440, -310,  67,  0,    1500,
    73,  -70,  -438,  77,  -88,   0,     93,  -80,   0,     113, -625, 0,     1,   0,    0,     15,  0,    0,
    23,  -50,  -371,  51,  -250,  0,     65,  -130,  680,   73,  120,  0,     77,  110,  0,     93,  110,  0,
    113, 0,    0,     1,   -200,  0,     19,  -200,  0,     29,  0,    435,   35,  40,   0,     43,  0,    -379,
    57,  -150, -61,   67,  -110,  326,   75,  -20,   0,     79,  -30,  0,     93,  -30,  0,     113, 0,    0,
    1,   -10,  0,     47,  0,     0,     75,  -40,   -104,  79,  -50,  0,     93,  -50,  0,     113, 0,    0,
    1,   0,    0,     113, 0,     0,     1,   0,     0,     67,  0,    0,     73,  -350, 0,     87,  -350, 0,
    93,  -250, 551,   103, 0,     0,     113, 0,     0,     1,   0,    0,     113, 0,    0
};

u8 npc_1_get_change10_tex_index[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2,
                                      2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

u8 npc_1_get_change11_tex_index[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2,
                                      2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

aNPC_Animation_c cKF_ba_r_npc_1_get_change1 = {
    { cKF_ckcb_r_npc_1_get_change1_tbl, cKF_ds_npc_1_get_change1_tbl, cKF_kn_npc_1_get_change1_tbl,
      cKF_c_npc_1_get_change1_tbl, -1, 113 },
    1.0f,
    113.0f,
    cKF_FRAMECONTROL_STOP,
    -10.0f,
    npc_1_get_change11_tex_index,
    aNPC_EYE_TEX0,
    -1,
    npc_1_get_change10_tex_index,
    aNPC_MOUTH_TEX0,
    -1,
    16,
    eEC_EFFECT_KIGAE,
    NULL,
    NULL,
};
