summaryrefslogtreecommitdiff
path: root/include/d/actor/d_a_npc_impal.h
blob: 7b8234717a16ace87969e6686fa573028286feba (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndef D_A_NPC_IMPAL_H
#define D_A_NPC_IMPAL_H

#include "d/actor/d_a_npc4.h"

struct daNpcImpal_HIOParam {
    /* 0x00 */ daNpcF_HIOParam common;
    /* 0x6C */ f32 demo_start_dist;
};

class daNpcImpal_Param_c {
public:
    virtual ~daNpcImpal_Param_c() {}

    static const daNpcImpal_HIOParam m;
};

#if DEBUG
class daNpcImpal_HIO_c : public mDoHIO_entry_c {
public:
    daNpcImpal_HIO_c();

    void genMessage(JORMContext*);

    daNpcImpal_HIOParam m;
};

#define NPC_IMPAL_HIO_CLASS daNpcImpal_HIO_c
#else
#define NPC_IMPAL_HIO_CLASS daNpcImpal_Param_c
#endif

/**
 * @ingroup actors-npcs
 * @class daNpcImpal_c
 * @brief Impaz
 *
 * @details
 *
 */
class daNpcImpal_c : public daNpcF_c {
public:
    typedef int (daNpcImpal_c::*cutFunc)(int);
    typedef bool (daNpcImpal_c::*actionFunc)(void*);
    typedef BOOL (daNpcImpal_c::*EventFn)(int);

    enum Animation {
        /* 0x00 */ ANM_0,
        /* 0x01 */ ANM_1,
        /* 0x02 */ ANM_2,
        /* 0x03 */ ANM_3,
        /* 0x04 */ ANM_4,
        /* 0x05 */ ANM_5,
        /* 0x06 */ ANM_6,
        /* 0x07 */ ANM_7,
        /* 0x08 */ ANM_8,
        /* 0x09 */ ANM_9,
        /* 0x10 */ ANM_10,
        /* 0x11 */ ANM_11,
        /* 0x12 */ ANM_12,
    };

    enum Expression {
        /* 0x0 */ EXPR_0,
        /* 0x1 */ EXPR_1,
        /* 0x2 */ EXPR_2,
        /* 0x3 */ EXPR_3,
        /* 0x4 */ EXPR_4,
        /* 0x5 */ EXPR_5,
        /* 0x6 */ EXPR_6,
        /* 0x7 */ EXPR_7,
    };

    enum Motion {
        /* 0x00 */ MOT_0,
        /* 0x01 */ MOT_1,
        /* 0x02 */ MOT_2,
        /* 0x03 */ MOT_3,
        /* 0x04 */ MOT_4,
        /* 0x05 */ MOT_5,
        /* 0x06 */ MOT_6,
    };

    daNpcImpal_c();
    ~daNpcImpal_c();
    int Create();
    BOOL CreateHeap();
    int Delete();
    int Execute();
    int Draw();
    bool ctrlJoint(J3DJoint*, J3DModel*);
    static int createHeapCallBack(fopAc_ac_c*);
    static int ctrlJointCallBack(J3DJoint*, int);
    inline bool setExpressionAnm(int, bool);
    inline bool setExpressionBtp(int);
    void setMotionAnm(int, f32);
    inline void reset();
    inline bool setAction(daNpcImpal_c::actionFunc);
    bool wait(void*);
    void setMotion(int, f32, BOOL);
    void setExpression(int, f32);
    bool talk(void*);
    bool demo(void*);
    BOOL EvCut_ImpalAppear1(int);
    BOOL EvCut_ImpalAppear2(int);
    BOOL EvCut_CopyRod(int);
    inline void setParam();
    inline BOOL main();
    inline BOOL ctrlBtk();
    inline void setAttnPos();
    inline void lookat();
    inline BOOL drawDbgInfo();

    s16 getMessageNo() { return s16(shape_angle.x); }
    int getSwitchNo() { return (fopAcM_GetParam(this) >> 8) & 0xFF; }
    inline void playExpression();
    inline void playMotion();
    inline int step(s16, int);
    inline void setExpressionTalkAfter();
    inline BOOL chkFindPlayer();
    inline void setLookMode(int i_lookMode);
    inline void deleteObstacle();

    static EventFn mEvtSeqList[4];

private:
    /* 0xB48 */ Z2Creature mCreatureSound;
    /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm;
    /* 0xBDC */ daNpcF_Lookat_c mLookat;
    /* 0xC78 */ daNpcF_ActorMngr_c mActorMngr[1];
    /* 0xC80 */ NPC_IMPAL_HIO_CLASS* mpHIO;
    /* 0xC84 */ dCcD_Cyl mCyl;
    /* 0xDC0 */ actionFunc mpActionFn;
    /* 0xDCC */ request_of_phase_process_class mPhase[1];
    /* 0xDD4 */ u32 mItemPartnerId;
    /* 0xDD8 */ u32 field_0xdd8;
    /* 0xDDC */ u32 field_0xddc;
    /* 0xDE0 */ s16 mFlowID;
    /* 0xDE2 */ s16 field_de2;
    /* 0xDE4 */ s16 mLookMode;
    /* 0xDE6 */ u16 mMode;
    /* 0xDE8 */ bool field_0xde8;
    /* 0xDE9 */ bool field_0xde9;
};

STATIC_ASSERT(sizeof(daNpcImpal_c) == 0xdec);

#endif /* D_A_NPC_IMPAL_H */