#include "ac_hanami_npc1.h"

#include "m_common_data.h"

enum {
    aHM1_ACT_TURN,
    aHM1_ACT_WALK,

    aHM1_ACT_NUM
};

static void aHM1_actor_ct(ACTOR* actorx, GAME* game);
static void aHM1_actor_dt(ACTOR* actorx, GAME* game);
static void aHM1_actor_move(ACTOR* actorx, GAME* game);
static void aHM1_actor_draw(ACTOR* actorx, GAME* game);
static void aHM1_actor_save(ACTOR* actorx, GAME* game);
static void aHM1_actor_init(ACTOR* actorx, GAME* game);

// clang-format off
ACTOR_PROFILE Hanami_Npc1_Profile = {
    mAc_PROFILE_HANAMI_NPC1,
    ACTOR_PART_NPC,
    ACTOR_STATE_NONE,
    EMPTY_NO,
    ACTOR_OBJ_BANK_KEEP,
    sizeof(HANAMI_NPC1_ACTOR),
    aHM1_actor_ct,
    aHM1_actor_dt,
    aHM1_actor_init,
    mActor_NONE_PROC1,
    aHM1_actor_save,
};
// clang-format on

static void aHM1_talk_request(ACTOR* actorx, GAME* game);
static int aHM1_talk_init(ACTOR* actorx, GAME* game);
static int aHM1_talk_end_chk(ACTOR* actorx, GAME* game);

static void aHM1_schedule_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int type);

static void aHM1_setupAction(HANAMI_NPC1_ACTOR* actor, int action);

static void aHM1_actor_ct(ACTOR* actorx, GAME* game) {
    static aNPC_ct_data_c ct_data = {
        aHM1_actor_move,
        aHM1_actor_draw,
        aNPC_CT_SCHED_TYPE_SPECIAL,
        aHM1_talk_request,
        aHM1_talk_init,
        aHM1_talk_end_chk,
        0,
    };

    if (NPC_CLIP->birth_check_proc(actorx, game) == TRUE) {
        HANAMI_NPC1_ACTOR* actor = (HANAMI_NPC1_ACTOR*)actorx;

        actor->npc_class.schedule.schedule_proc = aHM1_schedule_proc;
        NPC_CLIP->ct_proc(actorx, game, &ct_data);
    }
}

static void aHM1_actor_save(ACTOR* actorx, GAME* game) {
    NPC_CLIP->save_proc(actorx, game);
}

static void aHM1_actor_dt(ACTOR* actorx, GAME* game) {
    NPC_CLIP->dt_proc(actorx, game);
}

static void aHM1_actor_init(ACTOR* actorx, GAME* game) {
    NPC_CLIP->init_proc(actorx, game);
}

static void aHM1_actor_move(ACTOR* actorx, GAME* game) {
    NPC_CLIP->move_proc(actorx, game);
}

static void aHM1_actor_draw(ACTOR* actorx, GAME* game) {
    NPC_CLIP->draw_proc(actorx, game);
}

#include "../src/actor/npc/ac_hanami_npc1_anime.c_inc"
#include "../src/actor/npc/ac_hanami_npc1_talk.c_inc"
