summaryrefslogtreecommitdiff
path: root/include/d/actor/d_a_npc_seira2.h
blob: 9743a2b7a3ade615bd18ac7abda88350b4df1f7f (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
#ifndef D_A_NPC_SEIRA2_H
#define D_A_NPC_SEIRA2_H

#include "d/actor/d_a_npc.h"
#include "d/d_shop_system.h"

struct daNpc_Seira2_HIOParam {
    /* 0x00 */ daNpcT_HIOParam common;
};

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

    static const daNpc_Seira2_HIOParam m;
};

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

    void listenPropertyEvent(const JORPropertyEvent*);

    void genMessage(JORMContext*);

    daNpc_Seira2_HIOParam m;
};

#define NPC_SEIRA2_HIO_CLASS daNpc_Seira2_HIO_c
#else
#define NPC_SEIRA2_HIO_CLASS daNpc_Seira2_Param_c
#endif

/**
 * @ingroup actors-npcs
 * @class daNpc_Seira2_c
 * @brief Sera (Shopkeeper)
 *
 * @details
 *
 */
class daNpc_Seira2_c : public dShopSystem_c {
public:
    typedef int (daNpc_Seira2_c::*cutFunc)(int);
    typedef int (daNpc_Seira2_c::*actionFunc)(void*);

    ~daNpc_Seira2_c();
    int create();
    int CreateHeap();
    int Delete();
    int Execute();
    int Draw();
    static int createHeapCallBack(fopAc_ac_c*);
    static int ctrlJointCallBack(J3DJoint*, int);
    u8 getType();
    int getFlowNodeNo();
    u8 getMaxNumItem();
    u8 checkBottle();
    int isDelete();
    void reset();
    void afterJntAnm(int);
    void setParam();
    void setAfterTalkMotion();
    void srchActors();
    BOOL evtTalk();
    BOOL evtCutProc();
    void action();
    void beforeMove();
    void setAttnPos();
    void setCollision();
    BOOL drawDbgInfo();
    void drawOtherMdl();
    bool setBottleAnm(int, int, f32, bool);
    bool afterSetMotionAnm(int, int, f32, int);
    int selectAction();
    int chkAction(actionFunc);
    int setAction(actionFunc);
    BOOL checkStageIsSeira2sShop();
    int wait(void*);
    int sit(void*);
    int happy(void*);
    int worry(void*);
    int sad(void*);
    int lookaround(void*);
    int smile(void*);
    int talk(void*);
    int shop(void*);
    daNpc_Seira2_c(
        daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
        daNpcT_motionAnmData_c const* i_motionAnmData,
        daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
        int i_faceMotionStepNum,
        daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
        daNpcT_evtData_c const* i_evtData, char** i_arcNames)
        : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
                   i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
                   i_arcNames) {
        // "|%06d:%x|daNpc_Seira2_c -> Construct\n"
        OS_REPORT("|%06d:%x|daNpc_Seira2_c -> コンストラクト\n", g_Counter.mCounter0, this);
    }
    u16 getEyeballMaterialNo() { return 2; }
    s32 getHeadJointNo() { return 4; }
    s32 getNeckJointNo() { return 3; }
    s32 getBackboneJointNo() { return true; }
    BOOL checkChangeJoint(int val) { return val == 4; }
    BOOL checkRemoveJoint(int val) { return val == 8; }

    static char* mCutNameList[1];
    static cutFunc mCutList[1];

private:
    /* 0x0F7C */ mDoExt_McaMorfSO* mpSeiraMorf;
    /* 0x0F80 */ NPC_SEIRA2_HIO_CLASS* mpHIO;
    /* 0x0F84 */ dCcD_Cyl mCyl1;
    /* 0x10C0 */ u8 mChkBottle;
    /* 0x10C1 */ u8 mType;
    /* 0x10C4 */ daNpcT_ActorMngr_c mActorMngr[1];
    /* 0x10CC */ actionFunc mNextAction;
    /* 0x10D8 */ actionFunc mActFunc_0;
    /* 0x10D4 */ int mEventTimer;
    /* 0x10E8 */ int mShopProcess;
    /* 0x10EC */ u8 field_0x10EC;
    /* 0x10ED */ u8 field_0x10ED;
    /* 0x10EE */ u8 mEvtBit;
    /* 0x10EF */ u8 field_0x10EF[0x10F0 - 0x10EF];
    /* 0x10F0 */ u8 field_0x10F0;
};

STATIC_ASSERT(sizeof(daNpc_Seira2_c) == 0x10F4);

#endif /* D_A_NPC_SEIRA2_H */