summaryrefslogtreecommitdiff
path: root/include/d/actor/d_a_obj_fallobj.h
blob: 0c4efed3f3662834201d39f62f5b835f8e12c094 (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
#ifndef D_A_OBJ_FALLOBJ_H
#define D_A_OBJ_FALLOBJ_H

#include "d/d_bg_s_movebg_actor.h"
#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor_mng.h"

/**
 * @ingroup actors-objects
 * @class daObjFallObj_c
 * @brief Fall Object?
 *
 * @details
 *
 */
class daObjFallObj_c : public dBgS_MoveBgActor {
public:
    enum Action {
        ACTION_WAIT,
        ACTION_COUNTDOWN,
        ACTION_FALL,
        ACTION_FALL_START,
        ACTION_END,
        ACTION_FOLLOW_FALL,
    };

    void initBaseMtx();
    void setBaseMtx();
    int Create();
    s16 getFallTime();
    f32 getFallHeight();
    int CreateHeap();
    int create1st();
    int Execute(Mtx**);
    void action();
    bool action_wait(bool);
    bool action_fallStart();
    void action_countdown();
    void action_fall();
    void action_end();
    void action_follow_fall();
    bool checkHang();
    bool checkHang2();
    int Draw();
    int Delete();

    u8 getTime() { return fopAcM_GetParamBit(this, 8, 8); }
    u8 getPos() { return fopAcM_GetParamBit(this, 0x14, 8); }
    bool checkFallStart() {
        return this->speed.y != 0.0f;
    };

private:
    /* 0x5A0 */ request_of_phase_process_class mPhaseReq;
    /* 0x5A8 */ Mtx mMtx;
    /* 0x5D8 */ u8 field_0x5d8;
    /* 0x5D9 */ u8 mTimer;
    /* 0x5DA */ s16 mFallTime;
    /* 0x5DC */ s16 field_0x5dc;
    /* 0x5DE */ s16 field_0x5de;
    /* 0x5E0 */ int field_0x5e0;
    /* 0x5E4 */ bool field_0x5e4;
    /* 0x5E5 */ bool field_0x5e5;
    /* 0x5E8 */ J3DModel* mpModel;
    /* 0x5EC */ fpc_ProcID mChildId;
    /* 0x5F0 */ u8 mAction;
    /* 0x5F1 */ bool mVibrationOn;
    /* 0x5F4 */ Z2SoundObjSimple mSoundObj;
};

STATIC_ASSERT(sizeof(daObjFallObj_c) == 0x614);

#if DEBUG
class daObjFallObj_HIO_c : public mDoHIO_entry_c {
public:
    daObjFallObj_HIO_c();
    void genMessage(JORMContext* ctx);

    /* 0x6 */ s8 mId;
    /* 0x8 */ s16 mMovementShake;
    /* 0xA */ s16 mStaticShake;
    /* 0xC */ u8 mNoFall;
    /* 0xD */ u8 mCheckDisplay;
};
#endif


#endif /* D_A_OBJ_FALLOBJ_H */