#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_open_d1_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_open_d1_tbl[] = { 6, 6,  5, 8, 5, 2, 10, 14, 14, 2, 15, 2, 2,  2,  2, 8, 14, 14,
                                   2, 15, 2, 2, 2, 2, 6,  10, 9,  2, 9,  9, 9,  10, 2, 2, 8,  10,
                                   2, 2,  2, 2, 6, 9, 2,  2,  2,  2, 2,  2, 10, 12, 2, 2, 2,  2 };

s16 cKF_c_npc_1_open_d1_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_open_d1_tbl[] = {
    1,   0,     0,     17,  -400,  0,     24,  -250,  1872, 32,  200,   0,    65,  0,     0,    131, 0,    0,
    1,   1000,  0,     7,   1150,  0,     13,  1000,  0,    19,  1150,  0,    25,  1000,  0,    131, 1000, 0,
    1,   -8200, 5114,  24,  -5000, 0,     55,  -1500, 3484, 82,  0,     0,    131, 0,     0,    1,   0,    0,
    15,  0,     0,     22,  -50,   0,     41,  850,   2079, 65,  2300,  754,  87,  3450,  896,  104, 3600, 0,
    131, 3600,  0,     1,   0,     0,     116, 0,     0,    119, -30,   0,    122, 0,     0,    131, 0,    0,
    1,   0,     0,     131, 0,     0,     1,   -175,  0,    22,  -175,  0,    31,  -175,  187,  34,  -160, 0,
    41,  -350,  0,     54,  -200,  0,     68,  -360,  0,    74,  -260,  476,  90,  -175,  0,    131, -175, 0,
    1,   -100,  0,     22,  -100,  0,     31,  -60,   399,  34,  0,     398,  41,  50,    387,  48,  200,  0,
    61,  -200,  0,     68,  100,   619,   71,  125,   -235, 90,  -100,  0,    115, -100,  0,    119, -160, 0,
    123, -100,  0,     131, -100,  0,     1,   25,    0,    22,  25,    0,    31,  -25,   0,    41,  250,  0,
    48,  -40,   0,     54,  60,    0,     61,  0,     0,    68,  60,    0,    74,  -20,   0,    90,  25,   0,
    115, 25,    0,     119, 30,    0,     123, 25,    0,    131, 25,    0,    1,   0,     0,    131, 0,    0,
    1,   200,   0,     22,  200,   0,     31,  150,   0,    34,  180,   0,    41,  0,     0,    48,  320,  0,
    54,  0,     0,     68,  220,   0,     74,  160,   0,    80,  180,   110,  90,  200,   0,    115, 200,  0,
    119, 260,   0,     123, 200,   0,     131, 200,   0,    1,   0,     0,    131, 0,     0,    1,   0,    0,
    131, 0,     0,     1,   -100,  0,     131, -100,  0,    1,   0,     0,    131, 0,     0,    1,   175,  0,
    31,  175,   0,     38,  200,   0,     51,  -100,  0,    64,  70,    0,    78,  -75,   0,    88,  175,  0,
    131, 175,   0,     1,   -100,  0,     22,  -100,  0,    31,  -150,  -469, 38,  -350,  0,    41,  -300, 560,
    51,  -200,  419,   58,  70,    0,     64,  -60,   -508, 71,  -50,   -3,   78,  -100,  0,    115, -100, 0,
    119, -160,  0,     123, -100,  0,     131, -100,  0,    1,   -25,   0,    31,  -25,   0,    38,  -200, 0,
    44,  180,   0,     51,  75,    -896,  58,  0,     -248, 64,  -110,  -573, 71,  -100,  507,  78,  50,   0,
    88,  -25,   0,     115, -25,   0,     119, -30,   0,    123, -25,   0,    131, -25,   0,    1,   0,    0,
    131, 0,     0,     1,   200,   0,     22,  0,     0,    33,  0,     0,    41,  400,   0,    44,  350,  -1405,
    51,  0,     0,     58,  200,   0,     64,  100,   0,    71,  200,   0,    78,  0,     0,    88,  200,  0,
    115, 200,   0,     119, 260,   0,     123, 200,   0,    131, 200,   0,    1,   0,     0,    131, 0,    0,
    1,   0,     0,     131, 0,     0,     1,   -100,  0,    131, -100,  0,    1,   0,     0,    131, 0,    0,
    1,   0,     0,     21,  100,   0,     36,  -100,  -924, 56,  -300,  0,    86,  250,   0,    131, 250,  0,
    1,   60,    0,     11,  100,   0,     29,  -200,  0,    39,  0,     1269, 48,  200,   0,    60,  -100, -955,
    68,  -200,  0,     81,  -50,   623,   88,  100,   0,    131, 100,   0,    1,   0,     0,    21,  100,  0,
    40,  -400,  0,     57,  0,     0,     68,  -200,  0,    96,  250,   0,    111, 160,   -456, 121, 0,    0,
    131, 0,     0,     1,   0,     0,     131, 0,     0,    1,   82,    0,    14,  120,   0,    32,  -250, 0,
    52,  250,   0,     63,  -170,  -1116, 72,  -310,  -6,   86,  -150,  848,  92,  0,     0,    131, 0,    0,
    1,   0,     0,     24,  100,   0,     43,  -400,  0,    60,  -50,   0,    78,  -460,  0,    101, 300,  0,
    111, 220,   -529,  121, 0,     0,     131, 0,     0,    1,   0,     0,    22,  -100,  0,    35,  100,  0,
    47,  -100,  0,     84,  100,   0,     110, -45,   -79,  117, -50,   0,    123, 0,     0,    131, 0,    0,
    1,   2,     0,     22,  100,   0,     65,  100,   0,    78,  30,    -154, 91,  0,     0,    117, 0,    0,
    120, -50,   0,     123, 50,    568,   127, 50,    0,    131, 50,    0,    1,   0,     0,    131, 0,    0,
    1,   0,     0,     131, 0,     0,     1,   58,    0,    22,  -1050, 0,    28,  -1050, 0,    41,  -750, 1297,
    54,  60,    718,   65,  150,   0,     78,  60,    0,    131, 60,    0,    1,   -564,  240,  22,  0,    0,
    41,  0,     0,     54,  -570,  0,     65,  -450,  0,    78,  -570,  0,    115, -570,  0,    119, -600, 0,
    123, -500,  769,   131, -500,  0,     1,   0,     0,    131, 0,     0,    1,   -57,   468,  131, -57,  0,
    1,   0,     0,     131, 0,     0,     1,   0,     0,    131, 0,     0,    1,   58,    0,    35,  58,   0,
    47,  -750,  -1489, 65,  -1050, 0,     78,  60,    0,    131, 60,    0,    1,   564,   0,    35,  564,  0,
    47,  0,     0,     65,  0,     0,     78,  570,   0,    115, 570,   0,    119, 600,   0,    123, 500,  -621,
    131, 500,   0,     1,   0,     0,     131, 0,     0,    1,   -57,   468,  131, -57,   0,    1,   0,    0,
    131, 0,     0,     1,   0,     0,     131, 0,     0,    1,   0,     0,    131, 0,     0,    1,   0,    0,
    131, 0,     0,     1,   0,     0,     22,  -50,   -263, 35,  -300,  0,    47,  -100,  408,  65,  50,   334,
    78,  300,   0,     95,  200,   -472,  115, -150,  0,    124, -100,  0,    131, -100,  0,    1,   0,    0,
    18,  -50,   0,     35,  0,     0,     50,  -50,   0,    65,  0,     0,    78,  -50,   0,    95,  100,  176,
    118, 110,   -52,   121, -50,   0,     124, 50,    964,  128, 50,    0,    131, 50,    0,    1,   0,    0,
    131, 0,     0,     1,   0,     0,     131, 0,     0,    1,   0,     0,    131, 0,     0,    1,   0,    0,
    131, 0,     0
};

u8 npc_1_open_d10_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, 1, 2, 2, 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, 2, 2, 0, 0, 0, 0, 0,
                                  1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0,
                                  0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

u8 npc_1_open_d11_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, 0, 0, 0, 0, 0, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };

aNPC_Animation_c cKF_ba_r_npc_1_open_d1 = {
    { cKF_ckcb_r_npc_1_open_d1_tbl, cKF_ds_npc_1_open_d1_tbl, cKF_kn_npc_1_open_d1_tbl, cKF_c_npc_1_open_d1_tbl, -1,
      131 },
    1.0f,
    131.0f,
    cKF_FRAMECONTROL_STOP,
    0.0f,
    npc_1_open_d10_tex_index,
    aNPC_EYE_TEX0,
    -1,
    npc_1_open_d11_tex_index,
    aNPC_MOUTH_TEX0,
    -1,
    -1,
    -1,
    NULL,
    NULL,
};
