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

#include "d/actor/d_a_npc4.h"

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

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

    static const daNpcShoe_HIOParam m;
};

STATIC_ASSERT(sizeof(daNpcShoe_Param_c::m) == 0x6C);

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

    void genMessage(JORMContext*);

    daNpcShoe_HIOParam m;
};

#define NPC_SHOE_HIO_CLASS daNpcShoe_HIO_c
#else
#define NPC_SHOE_HIO_CLASS daNpcShoe_Param_c
#endif

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

    enum Animation {
        /* 0x01 */ ANM_M_SITWAIT_A,
        /* 0x02 */ ANM_M_SITTALK_A,
        /* 0x03 */ ANM_M_SITTALK_A_B,
        /* 0x04 */ ANM_SHOE_TALK_A,
        /* 0x05 */ ANM_M_SIT_TO_WOLF_A
    };

    enum Motion {
        /* 0x01 */ MOT_SITWAIT_A,
        /* 0x02 */ MOT_SITTALK_A,
        /* 0x03 */ MOT_SITTALK_A_B,
        /* 0x04 */ MOT_SHOE_TALK_A,
        /* 0x05 */ MOT_SIT_TO_WOLF_A,
    };

    daNpcShoe_c();
    ~daNpcShoe_c();
    cPhs_Step Create();
    BOOL CreateHeap();
    int Delete();
    int Execute();
    int Draw();
    bool ctrlJoint(J3DJoint*, J3DModel*);
    static int createHeapCallBack(fopAc_ac_c*);
    static BOOL ctrlJointCallBack(J3DJoint*, int);
    void setMotion(int, f32, BOOL);
    void reset();
    inline int setAction(actionFunc);
    bool wait(void*);
    bool fear(void*);
    bool talk(void*);
    bool demo(void*);
    void setParam();
    BOOL main();
    void setAttnPos();
    inline void lookat();
    void setMotionAnm(int, f32);
    inline BOOL drawDbgInfo();
    inline void adjustShapeAngle() {}

    s16 getMessageNo() { return fopAcM_GetParam(this) >> 0x10; }

    int getTime() { return getTimeMinute() + getTimeHour() * 60; }
    int getTimeHour() {
        if (dKy_darkworld_check() != 0) {
            return dKy_getDarktime_hour();
        } else {
            return dKy_getdaytime_hour();
        }
    }
    int getTimeMinute() {
        if (dKy_darkworld_check() != 0) {
            return dKy_getDarktime_minute();
        } else {
            return dKy_getdaytime_minute();
        }
    }

    int getStartTime() { return fopAcM_GetParam(this) & 0xff; }
    int getEndTime() { return (fopAcM_GetParam(this) >> 8) & 0xff; }

    inline void setLookMode(int i_lookMode);
    inline bool chkFindPlayer();
    inline void playMotion();

    static EventFn mEvtSeqList[1];

private:
    /* 0xB48 */ J3DModel* mpModel1;
    /* 0xB4C */ J3DModel* mpModel2;
    /* 0xB50 */ Z2CreatureCitizen mCreature;
    /* 0xBF4 */ u8 field_0xbf4[0xbf8 - 0xbf4];
    /* 0xBF8 */ daNpcF_Lookat_c mLookat;
    /* 0xC94 */ daNpcF_ActorMngr_c mActorMngr[1];
    /* 0xC9C */ NPC_SHOE_HIO_CLASS* mpHIO;
    /* 0xCA0 */ dCcD_Cyl mCcCyl;
    /* 0xDDC */ actionFunc mpActionFn;
    /* 0xDE8 */ request_of_phase_process_class mPhases[3];
    /* 0xE00 */ u32 field_0xe00;
    /* 0xE04 */ u32 field_0xe04;
    /* 0xE08 */ u32 field_0xe08;
    /* 0xE0C */ u32 field_0xe0c;
    /* 0xE10 */ s16 mLookMode;
    /* 0xE12 */ u16 mStartTime;
    /* 0xE14 */ u16 mEndTime;
    /* 0xE16 */ u16 field_0xe16;
    /* 0xE18 */ u16 mMode;
    /* 0xE1A */ u8 field_0xe1a;
    /* 0xE1B */ u8 field_0xe1b;  // Probably isDaytime or isNighttime
};

STATIC_ASSERT(sizeof(daNpcShoe_c) == 0xe1c);

#endif /* D_A_NPC_SHOE_H */