summaryrefslogtreecommitdiff
path: root/src/d/actor/d_a_hitobj.cpp
blob: ad75ef968d8a96b985e9b8218a513e9cf2ca1bbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//
// Generated by dtk
// Translation Unit: d_a_hitobj.cpp
//

#include "d/actor/d_a_hitobj.h"
#include "dolphin/types.h"
#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor.h"
#include "f_op/f_op_kankyo_mng.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_procname.h"

static dCcD_SrcSph m_co_sph_src = {
    // dCcD_SrcGObjInf
    {
        /* Flags             */ 0,
        /* SrcObjAt  Type    */ AT_TYPE_WATER,
        /* SrcObjAt  Atp     */ 0,
        /* SrcObjAt  SPrm    */ AT_SPRM_SET | AT_SPRM_VS_ENEMY | AT_SPRM_VS_OTHER,
        /* SrcObjTg  Type    */ 0,
        /* SrcObjTg  SPrm    */ TG_SPRM_SET | TG_SPRM_IS_ENEMY,
        /* SrcObjCo  SPrm    */ 0,
        /* SrcGObjAt Se      */ 0,
        /* SrcGObjAt HitMark */ 0,
        /* SrcGObjAt Spl     */ 0,
        /* SrcGObjAt Mtrl    */ 0,
        /* SrcGObjAt SPrm    */ 0,
        /* SrcGObjTg Se      */ 0,
        /* SrcGObjTg HitMark */ 0,
        /* SrcGObjTg Spl     */ 0,
        /* SrcGObjTg Mtrl    */ 0,
        /* SrcGObjTg SPrm    */ 0,
        /* SrcGObjCo SPrm    */ 0,
    },
    // cM3dGSphS
    {
        /* Center */ 0.0f, 0.0f, 0.0f,
        /* Radius */ 100.0f,
    },
};

/* 00000078-00000080       .text daHitobj_Draw__FP12hitobj_class */
static BOOL daHitobj_Draw(hitobj_class* i_this) {
    return TRUE;
}

/* 00000080-000000E8       .text daHitobj_Execute__FP12hitobj_class */
static BOOL daHitobj_Execute(hitobj_class* i_this) {
    if (i_this->mTimer != 0) {
        i_this->mTimer--;
        
        i_this->mSph.SetC(i_this->current.pos);
        
        dComIfG_Ccsp()->Set(&i_this->mSph);
    } else {
        fopKyM_Delete(i_this);
    }

    return TRUE;
}

/* 000000E8-000000F0       .text daHitobj_IsDelete__FP12hitobj_class */
static BOOL daHitobj_IsDelete(hitobj_class* i_this) {
    return TRUE;
}

/* 000000F0-00000120       .text daHitobj_Delete__FP12hitobj_class */
static BOOL daHitobj_Delete(hitobj_class* i_this) {
    dComIfG_resDelete(&i_this->mPhs, "Hitobj");
    return TRUE;
}

/* 00000120-0000025C       .text daHitobj_Create__FP10fopAc_ac_c */
static s32 daHitobj_Create(fopAc_ac_c* pActor) {
    hitobj_class* i_this = (hitobj_class*)pActor;
    fopAcM_SetupActor(i_this, hitobj_class);

    int res = dComIfG_resLoad(&(i_this->mPhs), "Hitobj");
    if (res == cPhs_COMPLEATE_e) {
        i_this->mUnusedParam = fopAcM_GetParam(i_this) & 0xFF; 

        i_this->mStts.Init(0xFF, 0xFF, i_this);
        i_this->mSph.Set(m_co_sph_src);
        i_this->mSph.SetStts(&i_this->mStts);

        i_this->mTimer = 3;
    }
    return res;
}

static actor_method_class l_daHitobj_Method = {
    (process_method_func)daHitobj_Create,
    (process_method_func)daHitobj_Delete,
    (process_method_func)daHitobj_Execute,
    (process_method_func)daHitobj_IsDelete,
    (process_method_func)daHitobj_Draw,
};

actor_process_profile_definition g_profile_HITOBJ = {
    fpcLy_CURRENT_e,
    7,
    fpcPi_CURRENT_e,
    PROC_HITOBJ,
    &g_fpcLf_Method.mBase,
    sizeof(hitobj_class),
    0,
    0,
    &g_fopAc_Method.base,
    0x00AB,
    &l_daHitobj_Method,
    fopAcStts_UNK40000_e,
    fopAc_ACTOR_e,
    fopAc_CULLBOX_0_e,
};