//
// Generated By: dol2asm
// Translation Unit: d_a_tag_push
//

#include "rel/d/a/tag/d_a_tag_push/d_a_tag_push.h"
#include "d/d_procname.h"

/* 804902B8-80490418 000078 0160+00 2/1 0/0 0/0 .text            srchActor__12daTag_Push_cFPvPv */
void* daTag_Push_c::srchActor(void* param_0, void* param_1) {
    BOOL bVar1 = false;
    if (param_0 != NULL && fopAcM_IsActor(param_0)) {
        if (fopAcM_IsExecuting(fopAcM_GetID(param_0))) {
            switch (((daTag_Push_c*)param_1)->getId()) {
            case 1:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_TARO;
                break;
            case 2:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_JAGAR;
                break;
            case 3:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_LEN;
                break;
            case 4:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_TARO;
                break;
            case 5:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_MARO;
                break;
            case 6:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_BESU;
                break;
            case 7:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_BOU;
                break;
            case 8:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_GRS;
                break;
            case 9:
                bVar1 = ((daTag_Push_c*)param_0)->mBase.mProcName == PROC_NPC_GRO;
                break;
            }
        }
    }

    if (!bVar1) {
        param_0 = NULL;
    }
    return param_0;
}

/* 80490418-804904D4 0001D8 00BC+00 1/1 0/0 0/0 .text            create__12daTag_Push_cFv */
int daTag_Push_c::create() {
    fopAcM_SetupActor(this, daTag_Push_c);
    scale.x *= 100.0f;
    scale.y *= 100.0f;
    scale.z = scale.x;
    if (isDelete()) {
        return cPhs_ERROR_e;
    } else {
        return cPhs_COMPLEATE_e;
    }
}

/* 804904D4-804904DC 000294 0008+00 1/1 0/0 0/0 .text            Delete__12daTag_Push_cFv */
int daTag_Push_c::Delete() {
    return 1;
}

/* 804904DC-804906BC 00029C 01E0+00 1/1 0/0 0/0 .text            Execute__12daTag_Push_cFv */
int daTag_Push_c::Execute() {
    if (home.roomNo == dComIfGp_roomControl_getStayNo()) {
        fopAc_ac_c* actor = mActorMngr.getActorP();
        if (isDelete()) {
            if (actor != NULL && fopAcM_GetName(actor) != PROC_NPC_JAGAR &&
                fopAcM_GetName(actor) != PROC_NPC_GRS && fopAcM_GetName(actor) != PROC_NPC_GRO)
            {
                static_cast<daNpcT_c*>(actor)->setCommander(NULL);
            }
            fopAcM_delete(this);
            return 1;
        } else {
            if (!dComIfGp_event_runCheck()) {
                if (actor == NULL) {
                    actor = (fopAc_ac_c*)(fpcM_Search(srchActor, this));
                    if (actor != NULL) {
                        mActorMngr.entry(actor);
                    }
                }
                if (actor != NULL &&
                    daPy_getPlayerActorClass()->eventInfo.chkCondition(dEvtCnd_CANTALK_e) != false)
                {
                    if (chkPointInArea(cXyz(daPy_getPlayerActorClass()->current.pos))) {
                        if (fopAcM_GetName(actor) == PROC_NPC_GRS ||
                            fopAcM_GetName(actor) == PROC_NPC_GRO)
                        {
                            static_cast<daNpcF_c*>(actor)->setIntDemander(this);
                            static_cast<daNpcF_c*>(actor)->setIntFlowNodeNo(getFlowNodeNo());
                            static_cast<daNpcF_c*>(actor)->onInterrupt(getId());
                        } else {
                            static_cast<daNpcT_c*>(actor)->setCommander(this);
                        }
                    }
                }
            }
            attention_info.flags = 0;
            attention_info.position = current.pos;
            eyePos = attention_info.position;
            return 1;
        }
    }
    return 0;
}

/* 804906BC-804906C4 00047C 0008+00 1/1 0/0 0/0 .text            Draw__12daTag_Push_cFv */
int daTag_Push_c::Draw() {
    return 1;
}

/* 804906C4-80490724 000484 0060+00 2/2 0/0 0/0 .text            isDelete__12daTag_Push_cFv */
int daTag_Push_c::isDelete() {
    bool retVal = false;
    if (getBitSW2() != 0xFF) {
        if (dComIfGs_isSwitch(getBitSW2(), fopAcM_GetRoomNo(this))) {
            retVal = true;
        }
    }
    return retVal;
}

/* 80490724-804907FC 0004E4 00D8+00 1/1 0/0 0/0 .text chkPointInArea__12daTag_Push_cF4cXyz */
int daTag_Push_c::chkPointInArea(cXyz param_0) {
    if ((getBitSW() != 0xFF && dComIfGs_isSwitch(getBitSW(), fopAcM_GetRoomNo(this))) ||
        getBitSW() == 0xFF)
    {
        return daNpcT_chkPointInArea(param_0, current.pos, scale, shape_angle.y, 1);
    } else {
        return 0;
    }
}

/* 804907FC-8049081C 0005BC 0020+00 1/0 0/0 0/0 .text            daTag_Push_Create__FPv */
static int daTag_Push_Create(void* i_this) {
    return static_cast<daTag_Push_c*>(i_this)->create();
}

/* 8049081C-8049083C 0005DC 0020+00 1/0 0/0 0/0 .text            daTag_Push_Delete__FPv */
static int daTag_Push_Delete(void* i_this) {
    return static_cast<daTag_Push_c*>(i_this)->Delete();
}

/* 8049083C-8049085C 0005FC 0020+00 1/0 0/0 0/0 .text            daTag_Push_Execute__FPv */
static int daTag_Push_Execute(void* i_this) {
    return static_cast<daTag_Push_c*>(i_this)->Execute();
}

/* 8049085C-8049087C 00061C 0020+00 1/0 0/0 0/0 .text            daTag_Push_Draw__FPv */
static int daTag_Push_Draw(void* i_this) {
    return static_cast<daTag_Push_c*>(i_this)->Draw();
}

/* 8049087C-80490884 00063C 0008+00 1/0 0/0 0/0 .text            daTag_Push_IsDelete__FPv */
static int daTag_Push_IsDelete(void* i_this) {
    return 1;
}

/* 804908CC-80490944 00068C 0078+00 1/0 0/0 0/0 .text            __dt__12daTag_Push_cFv */
inline daTag_Push_c::~daTag_Push_c() {}

/* 80490884-804908CC 000644 0048+00 1/0 0/0 0/0 .text            __dt__18daNpcT_ActorMngr_cFv */
inline daNpcT_ActorMngr_c::~daNpcT_ActorMngr_c() {}

/* ############################################################################################## */
/* 80490978-80490998 -00001 0020+00 1/0 0/0 0/0 .data            daTag_Push_MethodTable */
static actor_method_class daTag_Push_MethodTable = {
    (process_method_func)daTag_Push_Create,  (process_method_func)daTag_Push_Delete,
    (process_method_func)daTag_Push_Execute, (process_method_func)daTag_Push_IsDelete,
    (process_method_func)daTag_Push_Draw,
};

/* 80490998-804909C8 -00001 0030+00 0/0 0/0 1/0 .data            g_profile_TAG_PUSH */
extern actor_process_profile_definition g_profile_TAG_PUSH = {
    fpcLy_CURRENT_e,
    8,
    fpcLy_CURRENT_e,
    PROC_TAG_PUSH,
    &g_fpcLf_Method.mBase,
    sizeof(daTag_Push_c),
    0,
    0,
    &g_fopAc_Method.base,
    0x123,
    &daTag_Push_MethodTable,
    0x44000,
    0,
    fopAc_CULLBOX_CUSTOM_e,
};
