#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_delivery1_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_delivery1_tbl[] = { 2, 10, 10, 2,  9,  13, 12, 18, 16, 3, 18, 3, 2,  16, 16, 2,  13, 13,
                                     2, 12, 2,  2,  19, 14, 2,  2,  2,  2, 2,  2, 11, 11, 11, 11, 11, 12,
                                     9, 12, 9,  11, 12, 13, 7,  15, 11, 2, 2,  2, 14, 13, 13, 2,  2,  2 };

s16 cKF_c_npc_1_delivery1_tbl[] = { 3600, 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_delivery1_tbl[] = {
    1,  0,    0,     98, 0,    0,    1,  1000, 0,    11, 1350, 0,    19, 1000, 0,     54, 1000, 0,     60, 1200, 0,
    68, 1200, 0,     76, 1000, 0,    82, 1000, 0,    88, 1200, 0,    98, 1000, 0,     1,  0,    0,     11, 1300, 0,
    21, 300,  0,     49, 300,  0,    61, 1100, 644,  67, 1100, -680, 76, 500,  0,     82, 800,  3993,  88, 1600, 0,
    98, 0,    0,     1,  0,    0,    98, 0,    0,    1,  0,    0,    11, -100, 0,     15, -85,  325,   21, 50,   0,
    66, 50,   0,     71, 0,    0,    76, 50,   0,    88, 50,   0,    98, 0,    0,     1,  0,    0,     11, 0,    0,
    21, 30,   94,    33, 50,   0,    37, 125,  0,    41, 50,   0,    45, 125,  0,     49, 50,   0,     56, 0,    0,
    66, 0,    0,     76, 30,   0,    88, 0,    0,    98, 0,    0,    1,  -175, 0,     11, -150, 0,     17, -160, -105,
    23, -190, 0,     49, -190, 0,    55, -170, 190,  60, -150, 0,    66, -150, 0,     76, -70,  0,     82, -70,  0,
    88, -130, -299,  98, -175, 0,    1,  -100, 0,    6,  -200, -678, 11, -250, 0,     17, -350, 0,     23, -80,  0,
    33, -80,  0,     37, 40,   0,    41, -80,  0,    45, 40,   0,    49, -80,  0,     55, -200, 0,     60, -80,  0,
    66, -80,  0,     76, -300, 0,    82, -250, 529,  88, -50,  0,    93, -250, 0,     98, -100, 0,     1,  25,   0,
    11, 0,    0,     17, 0,    0,    23, 15,   0,    33, 15,   0,    37, -115, 0,     41, 15,   0,     45, -115, 0,
    49, 15,   0,     55, 8,    -70,  60, 0,    0,    66, 0,    0,    76, 10,   0,     88, 0,    0,     93, 13,   140,
    98, 25,   0,     1,  0,    0,    76, 0,    0,    98, 0,    0,    1,  200,  0,     6,  400,  0,     11, 0,    0,
    17, -150, 0,     23, 280,  0,    33, 280,  0,    37, 0,    0,    41, 280,  0,     45, 0,    0,     49, 280,  0,
    55, 300,  0,     60, -150, 0,    66, -150, 0,    76, -100, 429,  82, 0,    0,     88, -150, 0,     93, -100, 740,
    98, 200,  0,     1,  0,    0,    76, 0,    0,    98, 0,    0,    1,  0,    0,     98, 0,    0,     1,  -100, 0,
    11, 200,  0,     17, 400,  0,    23, -140, 14,   33, -135, 17,   37, 15,   0,     41, -135, 0,     45, 15,   0,
    49, -135, 0,     55, 75,   1508, 60, 400,  0,    66, 400,  0,    76, 250,  0,     88, 400,  0,     93, 400,  0,
    98, -100, 0,     1,  0,    0,    11, 0,    0,    17, 0,    0,    23, 5,    0,     33, -10,  0,     37, 0,    0,
    41, -10,  0,     45, 0,    0,    49, -10,  0,    55, 75,   264,  60, 100,  0,     66, 100,  0,     76, -15,  0,
    88, 80,   133,   93, 100,  0,    98, 0,    0,    1,  175,  0,    98, 175,  0,     1,  -100, 0,     11, 350,  0,
    21, -150, 0,     33, -150, 0,    37, -200, 0,    41, -150, 0,    45, -200, 0,     49, -150, 687,   60, 400,  0,
    66, 400,  0,     76, 80,   0,    88, 400,  0,    98, -100, 0,    1,  -25,  0,     11, 0,    0,     21, -60,  0,
    33, -60,  0,     37, -150, 0,    41, -60,  0,    45, -150, 0,    49, -60,  494,   60, 0,    0,     66, 0,    0,
    76, -60,  0,     88, 0,    0,    98, -25,  0,    1,  0,    0,    98, 0,    0,     1,  200,  0,     11, 100,  0,
    21, 450,  0,     33, 450,  0,    37, 550,  0,    41, 450,  0,    45, 550,  0,     60, 100,  0,     66, 100,  0,
    73, 160,  256,   88, 200,  0,    98, 200,  0,    1,  0,    0,    98, 0,    0,     1,  0,    0,     98, 0,    0,
    1,  -100, 0,     7,  0,    1309, 11, 250,  0,    17, -300, 0,    21, -250, -18,   33, -255, -11,   37, -305, 0,
    41, -255, 0,     45, -305, 0,    49, -255, 0,    54, -300, 0,    60, 200,  0,     66, 200,  0,     71, -100, -1387,
    76, -200, -275,  82, -295, 0,    88, 30,   0,    93, -70,  -447, 98, -100, 0,     1,  0,    0,     11, 0,    0,
    33, -70,  0,     37, -60,  0,    41, -70,  0,    45, -60,  0,    49, -70,  0,     54, -40,  0,     60, -125, 0,
    66, -125, 0,     76, 30,   303,  82, 45,   0,    88, -80,  0,    98, 0,    0,     1,  0,    0,     98, 0,    0,
    1,  60,   0,     98, 60,   0,    1,  0,    0,    98, 0,    0,    1,  0,    0,     98, 0,    0,     1,  82,   0,
    98, 82,   0,     1,  0,    0,    98, 0,    0,    1,  0,    0,    11, 200,  0,     34, 500,  595,   38, 550,  0,
    42, 500,  0,     46, 550,  0,    50, 500,  -768, 55, 300,  0,    77, 300,  0,     88, 200,  -577,  98, 0,    0,
    1,  2,    0,     11, 100,  282,  23, 65,   -496, 34, 0,    0,    46, 0,    0,     55, 30,   0,     61, -30,  0,
    72, 40,   0,     79, 0,    0,    88, 50,   0,    98, 2,    0,    1,  0,    0,     11, -50,  -134,  34, -100, -49,
    38, -150, 0,     42, -100, 0,    46, -150, 0,    50, -100, 578,  55, 0,    0,     67, 0,    0,     88, -50,  0,
    98, 0,    0,     1,  0,    0,    13, -250, 194,  34, 0,    605,  38, 50,   0,     42, 0,    0,     46, 50,   0,
    50, 0,    0,     62, -150, 0,    76, -50,  0,    91, -30,  132,  98, 0,    0,     1,  58,   0,     7,  300,  1340,
    13, 400,  0,     19, 300,  0,    34, 450,  0,    38, 400,  0,    42, 450,  0,     46, 350,  0,     50, 450,  0,
    62, 350,  -250,  98, 58,   0,    1,  -564, 0,    13, -100, 0,    19, -200, -537,  34, -300, 0,     38, -250, 0,
    42, -300, 0,     46, -240, 0,    50, -300, 0,    62, -250, 0,    76, -400, 0,     91, -500, -463,  98, -564, 0,
    1,  0,    0,     13, 0,    0,    34, 150,  0,    38, 100,  0,    42, 150,  0,     46, 100,  0,     50, 150,  0,
    76, 0,    0,     98, 0,    0,    1,  -57,  0,    7,  -100, 0,    13, 0,    0,     34, -400, -545,  38, -450, 0,
    42, -400, 0,     46, -450, 0,    55, -300, 1001, 65, 50,   0,    73, -100, 0,     80, 0,    0,     98, -57,  0,
    1,  0,    0,     13, 100,  0,    34, -300, 0,    38, -250, 0,    42, -300, 0,     46, -240, 0,     50, -300, 390,
    76, 0,    0,     98, 0,    0,    1,  0,    0,    9,  550,  0,    11, 500,  -1060, 33, -250, -1027, 42, -500, 0,
    55, -60,  0,     61, -160, 0,    67, -50,  0,    77, -50,  0,    89, 600,  0,     98, 0,    0,     1,  58,   0,
    9,  -650, 0,     25, -350, 0,    37, -550, 0,    47, -550, 0,    55, -640, 0,     61, -600, 0,     67, -630, 0,
    72, -450, 2248,  77, -100, 0,    89, -545, 0,    98, 58,   0,    1,  564,  -272,  9,  -250, 0,     11, -200, 1026,
    25, 600,  1705,  37, 900,  0,    47, 900,  0,    55, 220,  0,    61, 350,  0,     67, 220,  0,     72, 400,  2275,
    77, 660,  0,     89, 0,    0,    98, 564,  0,    1,  0,    0,    11, 0,    0,     29, -300, -1322, 33, -450, 0,
    48, -450, 0,     58, 0,    0,    98, 0,    0,    1,  -57,  0,    11, 0,    0,     17, -180, -833,  23, -250, 0,
    29, -200, 0,     33, -350, 0,    48, -350, 0,    53, -255, 1353, 58, 0,    0,     64, 0,    0,     70, -60,  -875,
    74, -200, 0,     78, -150, 663,  90, 0,    0,    98, -57,  0,    1,  0,    0,     13, -150, 0,     33, 600,  0,
    48, 600,  0,     58, -100, 0,    64, 20,   0,    70, -50,  0,    74, 50,   741,   78, 100,  0,     90, -200, 0,
    98, 0,    0,     1,  0,    0,    98, 0,    0,    1,  0,    0,    98, 0,    0,     1,  0,    0,     98, 0,    0,
    1,  0,    0,     11, 220,  0,    23, 75,   0,    33, 300,  0,    37, 270,  0,     41, 300,  0,     45, 250,  -813,
    55, -200, -1138, 60, -300, 0,    69, -305, -55,  78, -330, 0,    84, -260, 309,   90, -200, 300,   98, 0,    0,
    1,  0,    0,     11, -120, -676, 33, -350, -101, 37, -380, 0,    41, -350, 0,     45, -380, 0,     57, -90,  0,
    63, -130, 0,     69, -110, 0,    78, -245, 0,    84, -50,  928,  90, 30,   0,     98, 0,    0,     1,  0,    -154,
    11, -80,  0,     23, -100, -149, 33, -150, 0,    37, -120, 0,    41, -150, 0,     52, 20,   328,   57, 50,   0,
    63, 80,   0,     69, 60,   0,    78, 140,  0,    84, 65,   -351, 98, 0,    -54,   1,  0,    0,     98, 0,    0,
    1,  0,    0,     98, 0,    0,    1,  0,    0,    98, 0,    0
};

static int lfoot_se_chk_pat[] = { 10, 62, 87, 97 };

static aNPC_se_data_c lfoot_se_dt[] = { { ARRAY_COUNT(lfoot_se_chk_pat), lfoot_se_chk_pat } };

static int rfoot_se_chk_pat[] = { 18, 75, 97 };

static aNPC_se_data_c rfoot_se_dt[] = { { ARRAY_COUNT(rfoot_se_chk_pat), rfoot_se_chk_pat } };

static aNPC_se_data_table_c se_dt_tbl[] = { { lfoot_se_dt, rfoot_se_dt, aNPC_OTHER_SE_TYPE_NONE, NULL } };

aNPC_Animation_c cKF_ba_r_npc_1_delivery1 = {
    { cKF_ckcb_r_npc_1_delivery1_tbl, cKF_ds_npc_1_delivery1_tbl, cKF_kn_npc_1_delivery1_tbl, cKF_c_npc_1_delivery1_tbl,
      -1, 98 },
    1.0f,
    98.0f,
    cKF_FRAMECONTROL_STOP,
    -5.0f,
    NULL,
    aNPC_EYE_TEX1,
    -1,
    NULL,
    aNPC_MOUTH_TEX0,
    0,
    -1,
    -1,
    NULL,
    se_dt_tbl,
};
