summaryrefslogtreecommitdiff
path: root/include/d/actor/d_a_npc_ash.h
blob: 084569a66ed7a9535dedc4b278d3da88230f98d6 (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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#ifndef D_A_NPC_ASH_H
#define D_A_NPC_ASH_H

#include "d/actor/d_a_npc4.h"

struct daNpcAsh_HIOParam {
    /* 0x00 */ daNpcF_HIOParam common;
};

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

    static const daNpcAsh_HIOParam m;
};

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

    void genMessage(JORMContext*);

    daNpcAsh_HIOParam m;
};

#define NPC_ASH_HIO_CLASS daNpcAsh_HIO_c
#else
#define NPC_ASH_HIO_CLASS daNpcAsh_Param_c
#endif

/**
 * @ingroup actors-npcs
 * @class daNpcAsh_c
 * @brief Ashei
 *
 * @details
 *
 */
class daNpcAsh_c : public daNpcF_c {
public:
    typedef bool (daNpcAsh_c::*ActionFn)(void*);
    typedef BOOL (daNpcAsh_c::*EventFn)(int);

    enum Type {
        /* 0 */ TYPE_BAR,
        /* 1 */ TYPE_CASTLE,
    };

    enum Animation {
        /* 0x00 */ ANM_NONE,
        /* 0x01 */ ANM_F_TALK_A,
        /* 0x02 */ ANM_F_TALK_B,
        /* 0x03 */ ANM_F_SILENT,
        /* 0x04 */ ANM_F_COOL,
        /* 0x05 */ ANM_F_ASK,
        /* 0x06 */ ANM_F_EXPLAIN_A,
        /* 0x07 */ ANM_F_EXPLAIN_B,
        /* 0x08 */ ANM_WAIT_A,
        /* 0x09 */ ANM_WAIT_B,
        /* 0x0A */ ANM_WAIT_C,
        /* 0x0B */ ANM_STEP,
        /* 0x0C */ ANM_COOL,
        /* 0x0D */ ANM_ASK,
        /* 0x0E */ ANM_EXPLAIN_A,
        /* 0x0F */ ANM_EXPLAIN_B,
        /* 0x10 */ ANM_BOWWAIT,
        /* 0x11 */ ANM_BOWRUN,
    };

    enum Expression {
        /* 0x0 */ EXPR_TALK_A,
        /* 0x1 */ EXPR_TALK_B,
        /* 0x2 */ EXPR_SILENT,
        /* 0x3 */ EXPR_COOL,
        /* 0x4 */ EXPR_ASK,
        /* 0x5 */ EXPR_EXPLAIN_A,
        /* 0x6 */ EXPR_EXPLAIN_B,
        /* 0x7 */ EXPR_NONE,
    };

    enum Motion {
        /* 0x0 */ MOT_WAIT_A,
        /* 0x1 */ MOT_WAIT_B,
        /* 0x2 */ MOT_WAIT_C,
        /* 0x3 */ MOT_COOL,
        /* 0x4 */ MOT_ASK,
        /* 0x5 */ MOT_EXPLAIN_A,
        /* 0x6 */ MOT_EXPLAIN_B,
        /* 0x7 */ MOT_BOWWAIT,
        /* 0x8 */ MOT_BOWRUN,
        /* 0x9 */ MOT_STEP,
    };

public:
    daNpcAsh_c();
    ~daNpcAsh_c();
    cPhs_Step Create();
    BOOL CreateHeap();
    int Delete();
    int Execute();
    int Draw();
    bool ctrlJoint(J3DJoint*, J3DModel*);
    static BOOL createHeapCallBack(fopAc_ac_c*);
    static BOOL ctrlJointCallBack(J3DJoint*, int);
    bool setExpressionAnm(int, bool);
    bool setExpressionBtp(int);
    void setMotionAnm(int i_idx, f32 i_morf);
    void reset();
    inline bool setAction(ActionFn);
    inline bool isSneaking();
    bool wait_type0(void*);
    void setMotion(int, f32, int);
    void setExpression(int, f32);
    bool wait_type1(void*);
    bool talk(void*);
    bool demo(void*);
    bool leave(void*);
    BOOL EvCut_Introduction(int);
    BOOL EvCut_Meeting(int);
    BOOL EvCut_WiretapSponsor(int);
    BOOL EvCut_WiretapEntrant(int);
    inline void setParam();
    inline BOOL main();
    inline void playMotion();
    inline BOOL ctrlBtk();
    inline void setAttnPos();
    inline void lookat();
    inline BOOL drawDbgInfo();

    s16 getMessageNo() { return shape_angle.x; }
    /* dSv_event_flag_c::F_0268 - City in the Sky - City in the Sky clear */
    bool isMap() {
        return !(daNpcF_chkEvtBit(0x10c)
                 /* dSv_event_flag_c::F_0264 - Cutscene - Get master sword */
                 || !daNpcF_chkEvtBit(0x108));
    }
    inline void setExpressionTalkAfter() { setExpression(7, -1.0f); }
    inline void setLookMode(int i_lookMode, fopAc_ac_c* i_talkPartner);
    inline void searchActors();
    inline BOOL chkFindPlayer();
    inline bool step(s16, bool);
    inline void playExpression();

    static EventFn mEvtSeqList[6];

private:
    /* 0xB48 */ Z2Creature mCreatureSound;
    /* 0xBD8 */ J3DModel* mModelBow;
    /* 0xBDC */ J3DModel* mModelQuiver;
    /* 0xBE0 */ daNpcF_MatAnm_c* mpMatAnm;
    /* 0xBE4 */ daNpcF_Lookat_c mLookat;
    /* 0xC80 */ daNpcF_ActorMngr_c mActorMngr[6];
    /* 0xCB0 */ fopAc_ac_c* mTalkPartner;
    /* 0xCB4 */ NPC_ASH_HIO_CLASS* mpHIO;
    /* 0xCB8 */ dCcD_Cyl mCcCyl[2];
    /* 0xF30 */ ActionFn mpActionFn;
    /* 0xF3C */ request_of_phase_process_class mPhase[2];
    /* 0xF4C */ u32 mItemPartnerId;
    /* 0xF50 */ u32 field_0xf50;  // unused
    /* 0xF54 */ u32 field_0xf54;
    /* 0xF58 */ s16 mFlowID;
    /* 0xF5A */ s16 mLookMode;
    /* 0xF5C */ u16 mMode;
    /* 0xF5E */ u8 mMapToolId;
    /* 0xF5F */ u8 field_0xf5f;
    /* 0xF60 */ u8 mType;
};

//STATIC_ASSERT(sizeof(daNpcAsh_c) == 0xF64);

#endif /* D_A_NPC_ASH_H */