#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_deru2_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_deru2_tbl[] = { 3, 6, 5, 2, 7, 2, 7, 6, 7, 2, 7, 2, 2, 7, 2, 7, 7, 8, 2,  8,  2,  2, 9, 2, 2, 5, 2,
                                 2, 5, 2, 2, 7, 2, 7, 7, 6, 2, 6, 2, 7, 7, 7, 4, 6, 4, 10, 12, 12, 2, 8, 2, 2, 7, 2 };

s16 cKF_c_npc_1_deru2_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_deru2_tbl[] = {
    1,  0,     0,      5,  0,     0,      57, 0,     0,      1,  -500,  0,     3,  500,  15952, 21, 4000,  0,
    37, 1000,  -11179, 39, 750,   0,      57, 1000,  0,      1,  0,     0,     9,  -250, 0,     21, 500,   0,
    37, 0,     0,      57, 0,     0,      1,  0,     0,      57, 0,     0,     1,  0,    0,     5,  -100,  -782,
    35, -3450, -1878,  37, -3600, -1872,  38, -3640, 0,      39, -100,  0,     57, 0,    0,     1,  0,     0,
    57, 0,     0,      1,  -175,  0,      9,  -25,   0,      33, -50,   0,     37, -138, -1348, 39, -275,  0,
    55, -178,  47,     57, -175,  0,      1,  -100,  0,      9,  -250,  -566,  33, -550, 0,     41, -505,  257,
    55, -135,  834,    57, -100,  0,      1,  25,    0,      9,  -50,   0,     33, 50,   0,     37, 100,   1236,
    39, 185,   0,      55, 35,    -174,   57, 25,    0,      1,  0,     0,     57, 0,    0,     1,  200,   0,
    9,  0,     0,      21, 1000,  0,      33, 450,   -1880,  39, 928,   0,     55, 270,  -1727, 57, 200,   0,
    1,  0,     0,      57, 0,     0,      1,  0,     0,      57, 0,     0,     1,  -100, 0,     9,  300,   0,
    21, -300,  0,      33, 0,     0,      39, -486,  0,      55, -135,  990,   57, -100, 0,     1,  0,     0,
    57, 0,     0,      1,  175,   0,      9,  25,    0,      33, 50,    0,     37, 175,  1688,  39, 275,   0,
    41, 269,   -219,   57, 175,   0,      1,  -100,  0,      9,  200,   375,   33, 0,    -755,  37, -100,  -754,
    39, -515,  0,      55, -135,  834,    57, -100,  0,      1,  -25,   0,     9,  50,   0,     33, -50,   0,
    37, -25,   0,      39, -185,  0,      41, -175,  190,    55, -35,   175,   57, -25,  0,     1,  0,     0,
    57, 0,     0,      1,  200,   0,      9,  0,     0,      21, 200,   1264,  33, 450,  -1880, 37, 200,   -1942,
    39, 928,   0,      55, 270,   -1727,  57, 200,   0,      1,  0,     0,     57, 0,    0,     1,  0,     0,
    57, 0,     0,      1,  -100,  0,      9,  300,   0,      21, 150,   0,     33, 300,  0,     35, 225,   -2569,
    37, -100,  -6485,  39, -486,  0,      55, -135,  972,    57, -100,  0,     1,  0,    0,     57, 0,     0,
    1,  0,     0,      57, 0,     0,      1,  60,    3670,   5,  500,   0,     29, 450,  0,     45, -200,  0,
    57, 60,    0,      1,  0,     0,      57, 0,     0,      1,  0,     0,     57, 0,    0,     1,  82,    3419,
    7,  500,   0,      33, 450,   0,      49, -200,  0,      57, 82,    0,     1,  0,    0,     57, 0,     0,
    1,  0,     0,      57, 0,     0,      1,  100,   0,      5,  -350,  -2893, 9,  -500, 0,     17, -500,  0,
    35, 0,     0,      45, -100,  0,      57, 2,     0,      1,  0,     0,     57, 0,    0,     1,  -400,  0,
    3,  -500,  0,      7,  -450,  746,    21, 0,     0,      29, -550,  0,     45, -50,  375,   57, 0,     0,
    1,  -200,  0,      3,  -500,  -1902,  7,  -700,  0,      21, -250,  0,     29, -400, 0,     45, -100,  747,
    57, 58,    0,      1,  200,   0,      3,  250,   0,      7,  250,   0,     29, 73,   -720,  45, -400,  -753,
    57, -564,  0,      1,  0,     0,      57, 0,     0,      1,  -100,  0,     3,  -300, 0,     7,  -100,  499,
    27, 0,     0,      41, -450,  0,      57, -57,   0,      1,  0,     0,     57, 0,    0,     1,  450,   0,
    3,  500,   0,      7,  450,   -752,   21, 0,     0,      29, 550,   0,     35, 400,  -1522, 57, -170,  0,
    1,  -400,  0,      3,  -500,  -1261,  7,  -700,  0,      21, -250,  0,     29, -400, 0,     35, -190,  0,
    57, -365,  0,      1,  -250,  0,      3,  -250,  0,      27, -120,  487,   29, -75,  1019,  35, 350,   2008,
    41, 540,   0,      57, 540,   0,      1,  0,     0,      27, 0,     0,     35, -100, -483,  57, -200,  0,
    1,  -100,  0,      3,  -300,  0,      7,  -100,  501,    27, 0,     0,     35, -550, -2595, 57, -1060, 0,
    1,  0,     0,      27, 0,     0,      35, 250,   764,    57, 420,   0,     1,  515,  0,     5,  649,   1742,
    11, 1087,  2305,   15, 1211,  -1927,  17, 801,   -15356, 19, 181,   -1764, 25, 310,  582,   27, 313,   -81,
    31, 340,   -171,   57, -8,    0,      1,  409,   0,      3,  607,   -1441, 7,  245,  -2429, 11, -16,   20,
    13, 88,    3569,   17, 698,   776,    21, 295,   -2609,  25, 145,   -195,  33, -134, -1490, 41, -400,  0,
    47, -289,  937,    57, -50,   0,      1,  111,   0,      3,  -71,   -4763, 5,  -287, -2174, 9,  -477,  -2023,
    15, -1125, -3333,  17, -1688, -16909, 19, -2439, -4362,  20, -2554, -2424, 21, 980,  -1317, 25, 730,   -2160,
    31, 194,   -1849,  57, -350,  0,      1,  0,     0,      57, 0,     0,     1,  0,    0,     5,  400,   0,
    15, -400,  -1494,  21, -500,  0,      29, -228,  2609,   37, 50,    0,     45, -75,  0,     57, 0,     0,
    1,  0,     0,      57, 0,     0,      1,  0,     0,      57, 0,     0,     1,  -225, 0,     7,  0,     0,
    19, 0,     0,      29, -200,  0,      39, -200,  0,      49, 0,     0,     57, 0,    0,     1,  0,     0,
    57, 0,     0
};

u8 npc_1_deru20_tex_index[] = { 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5,
                                5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3 };

u8 npc_1_deru21_tex_index[] = { 6, 6, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0 };

aNPC_Animation_c cKF_ba_r_npc_1_deru2 = {
    { cKF_ckcb_r_npc_1_deru2_tbl, cKF_ds_npc_1_deru2_tbl, cKF_kn_npc_1_deru2_tbl, cKF_c_npc_1_deru2_tbl, -1, 57 },
    1.0f,
    57.0f,
    cKF_FRAMECONTROL_STOP,
    -10.0f,
    npc_1_deru21_tex_index,
    aNPC_EYE_TEX0,
    -1,
    npc_1_deru20_tex_index,
    aNPC_MOUTH_TEX0,
    -1,
    -1,
    -1,
    NULL,
    NULL,
};
