#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_gyafun2_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_gyafun2_tbl[] = { 2, 6, 5, 2, 4, 2, 8, 8, 8, 2, 8, 2, 2, 8, 8, 8, 8, 8, 2, 8, 8, 2, 8, 8, 4, 4, 4,
                                   3, 4, 2, 4, 5, 4, 5, 5, 5, 2, 5, 2, 5, 5, 5, 2, 5, 2, 2, 2, 2, 3, 7, 3, 2, 2, 2 };

s16 cKF_c_npc_1_gyafun2_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_gyafun2_tbl[] = {
    1,  0,    0,   28, 0,    0,     1,  1000, 0,     3,  1100, 0,     5,  528,  0,    6,  628,  0,
    13, 628,  0,   28, 1000, 0,     1,  0,    0,     3,  -200, 0,     5,  -150, 492,  11, -100, 0,
    28, 0,    0,   1,  0,    0,     28, 0,    0,     1,  0,    1503,  5,  200,  0,    13, 200,  0,
    28, 0,    0,   1,  0,    0,     28, 0,    0,     1,  -175, 0,     3,  -166, 0,    4,  -205, -2940,
    5,  -305, 0,   6,  -235, 0,     13, -225, 112,   21, -198, 167,   28, -175, 0,    1,  -100, 0,
    3,  25,   0,   4,  -205, -8347, 5,  -376, 0,     6,  -270, 0,     13, -251, 118,  21, -204, 407,
    28, -100, 0,   1,  25,   0,     3,  -5,   0,     4,  80,   4941,  5,  205,  0,    6,  133,  0,
    13, 130,  -56, 21, 84,   -441,  28, 25,   0,     1,  0,    0,     28, 0,    0,    1,  200,  0,
    3,  0,    0,   4,  533,  24342, 5,  975,  0,     6,  789,  0,     13, 808,  0,    21, 585,  -2008,
    28, 200,  0,   1,  0,    0,     28, 0,    0,     1,  0,    0,     28, 0,    0,    1,  -100, 0,
    3,  -100, 0,   4,  -145, -4389, 5,  -370, 0,     6,  -311, 0,     13, -345, 0,    21, -278, 741,
    28, -100, 0,   1,  0,    0,     3,  -25,  0,     4,  56,   2298,  5,  85,   0,    6,  60,   0,
    13, 50,   -74, 21, 25,   -180,  28, 0,    0,     1,  175,  0,     3,  166,  0,    4,  205,  2041,
    5,  305,  0,   6,  235,  0,     13, 225,  -112,  21, 198,  -163,  28, 175,  0,    1,  -100, 0,
    3,  25,   0,   4,  -205, -9618, 5,  -376, 0,     6,  -270, 0,     13, -251, 118,  21, -204, 407,
    28, -100, 0,   1,  -25,  0,     3,  5,    0,     4,  -80,  -4332, 5,  -205, 0,    6,  -133, 0,
    13, -130, 58,  21, -84,  441,   28, -25,  0,     1,  0,    0,     28, 0,    0,    1,  200,  0,
    3,  0,    0,   4,  533,  25814, 5,  975,  0,     6,  789,  0,     13, 808,  0,    21, 585,  -2008,
    28, 200,  0,   1,  0,    0,     3,  0,    0,     4,  0,    0,     5,  0,    0,    6,  0,    0,
    13, 0,    0,   21, 0,    0,     28, 0,    0,     1,  0,    0,     28, 0,    0,    1,  -100, 0,
    3,  -100, 0,   4,  -145, -3293, 5,  -370, 0,     6,  -311, 0,     13, -345, 0,    21, -278, 741,
    28, -100, 0,   1,  0,    0,     3,  25,   0,     4,  -56,  -1671, 5,  -85,  0,    6,  -60,  0,
    13, -50,  72,  21, -25,  179,   28, 0,    0,     1,  0,    0,     6,  0,    0,    22, 0,    0,
    28, 0,    0,   1,  60,   0,     5,  -90,  -2108, 7,  -355, 196,   28, 60,   0,    1,  0,    0,
    6,  0,    0,   22, 0,    0,     28, 0,    0,     1,  0,    0,     22, 0,    0,    28, 0,    0,
    1,  82,   0,   6,  50,   -590,  10, -95,  43,    28, 82,   0,     1,  0,    0,    28, 0,    0,
    1,  0,    811, 3,  0,    -806,  5,  0,    0,     28, 0,    0,     1,  2,    0,    3,  -25,  -1129,
    5,  -369, 0,   13, -319, 0,     28, 2,    0,     1,  0,    807,   3,  0,    -815, 5,  0,    0,
    28, 0,    0,   1,  0,    0,     4,  245,  3056,  6,  375,  0,     13, 250,  0,    28, 0,    0,
    1,  58,   0,   3,  0,    0,     4,  240,  0,     13, 200,  0,     28, 58,   0,    1,  -414, 0,
    3,  -450, 0,   4,  -200, 2509,  13, -100, 0,     28, -414, 0,     1,  0,    0,    28, 0,    0,
    1,  -57,  0,   3,  -150, -3776, 5,  -700, -2090, 13, -750, 0,     28, -57,  0,    1,  0,    0,
    28, 0,    0,   1,  0,    0,     4,  -245, -3061, 6,  -375, 0,     13, -250, 0,    28, 0,    0,
    1,  58,   0,   3,  0,    0,     4,  240,  0,     13, 200,  0,     28, 58,   0,    1,  414,  0,
    3,  450,  0,   4,  200,  -2495, 13, 100,  0,     28, 414,  0,     1,  0,    0,    28, 0,    0,
    1,  -57,  0,   3,  -150, -3785, 5,  -700, -2107, 13, -750, 0,     28, -57,  0,    1,  0,    0,
    28, 0,    0,   1,  0,    0,     28, 0,    0,     1,  0,    0,     28, 0,    0,    1,  0,    0,
    28, 0,    0,   1,  0,    0,     7,  0,    0,     28, 0,    0,     1,  0,    0,    4,  -30,  -784,
    6,  -256, 0,   7,  -197, 921,   9,  -170, 28,    15, -130, 393,   28, 0,    0,    1,  0,    0,
    13, 0,    0,   28, 0,    0,     1,  0,    0,     28, 0,    0,     1,  0,    0,    28, 0,    0,
    1,  0,    0,   28, 0,    0
};

u8 npc_1_gyafun20_tex_index[] = { 0, 0, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };

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

aNPC_Animation_c cKF_ba_r_npc_1_gyafun2 = {
    { cKF_ckcb_r_npc_1_gyafun2_tbl, cKF_ds_npc_1_gyafun2_tbl, cKF_kn_npc_1_gyafun2_tbl, cKF_c_npc_1_gyafun2_tbl, -1,
      28 },
    1.0f,
    28.0f,
    cKF_FRAMECONTROL_STOP,
    -5.0f,
    npc_1_gyafun21_tex_index,
    aNPC_EYE_TEX0,
    -1,
    npc_1_gyafun20_tex_index,
    aNPC_MOUTH_TEX0,
    -1,
    -1,
    -1,
    NULL,
    NULL,
};
