Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
d_a_npc_the.h
Go to the documentation of this file.
1#ifndef D_A_NPC_THE_H
2#define D_A_NPC_THE_H
3
4#include "d/actor/d_a_npc4.h"
5#include <cstring>
6
9};
10
12public:
13 virtual ~daNpcThe_Param_c() {}
14
15 static const daNpcThe_HIOParam m;
16};
17
19
20#if DEBUG
22public:
24
25 void listenPropertyEvent(const JORPropertyEvent*);
26 void genMessage(JORMContext*);
27
29};
30
31#define NPC_THE_HIO_CLASS daNpcThe_HIO_c
32#else
33#define NPC_THE_HIO_CLASS daNpcThe_Param_c
34#endif
35
44class daNpcThe_c : public daNpcF_c {
45public:
46 typedef BOOL (daNpcThe_c::*ActionFn)(void*);
47 typedef BOOL (daNpcThe_c::*EventFn)(int);
48
49 enum Type {
50 /* 0 */ TYPE_BAR,
51 /* 1 */ TYPE_1,
53 };
54
55 enum Animation {
56 /* 0x00 */ ANM_NONE,
57 /* 0x01 */ ANM_F_TALK_A,
58 /* 0x02 */ ANM_F_SMILE,
59 /* 0x03 */ ANM_F_CHUCKLE,
60 /* 0x04 */ ANM_F_TALK_B,
61 /* 0x05 */ ANM_F_TALK_C,
62 /* 0x06 */ ANM_F_LAUGH,
63 /* 0x07 */ ANM_F_TALK_R,
64 /* 0x08 */ ANM_FH_SMILE,
65 /* 0x09 */ ANM_FH_CHUCKLE,
66 /* 0x0A */ ANM_FH_TALK_B,
67 /* 0x0B */ ANM_FH_TALK_C,
68 /* 0x0C */ ANM_FH_LAUGH,
69 /* 0x0D */ ANM_FH_TALK_R,
70 /* 0x0E */ ANM_WAIT_A,
71 /* 0x0F */ ANM_WAIT_LOOKING,
72 /* 0x10 */ ANM_TO_WAIT_B,
73 /* 0x11 */ ANM_WAIT_B,
74 /* 0x12 */ ANM_WAIT_LOOKUP,
75 /* 0x13 */ ANM_TALK_R,
76 /* 0x14 */ ANM_TALKING_R,
77 /* 0x15 */ ANM_LOOK_A,
78 /* 0x16 */ ANM_LOOK,
79 /* 0x17 */ ANM_KUNE_WAIT_A,
80 /* 0x18 */ ANM_KUNE_TALK,
81 /* 0x19 */ ANM_KUNE_WAIT_B,
82 /* 0x1A */ ANM_KUNE_SHISHI,
83 };
84
86 /* 0x0 */ EXPR_TALK_A,
87 /* 0x1 */ EXPR_SMILE,
88 /* 0x2 */ EXPR_CHUCKLE,
89 /* 0x3 */ EXPR_TALK_B,
90 /* 0x4 */ EXPR_TALK_C,
91 /* 0x5 */ EXPR_LAUGH,
92 /* 0x6 */ EXPR_TALK_R,
93 /* 0x7 */ EXPR_H_TALK_R,
94 /* 0x8 */ EXPR_H_SMILE,
95 /* 0x9 */ EXPR_H_CHUCKLE,
96 /* 0xA */ EXPR_H_TALK_B,
97 /* 0xB */ EXPR_H_TALK_C,
98 /* 0xC */ EXPR_H_LAUGH,
99 /* 0xD */ EXPR_NONE,
100 };
101
102 enum Motion {
103 /* 0x0 */ MOT_WAIT_A,
104 /* 0x1 */ MOT_LOOK_A,
105 /* 0x2 */ MOT_TO_WAIT_B,
107 /* 0x4 */ MOT_KUNE_TALK,
110 /* 0x7 */ MOT_WAIT_B,
112 /* 0x9 */ MOT_TALK_R,
113 /* 0xA */ MOT_LOOK,
114 };
115
116 daNpcThe_c();
117 ~daNpcThe_c();
118 /* inline */ inline BOOL CreateHeap();
119 BOOL ctrlJoint(J3DJoint*, J3DModel*);
120 static BOOL createHeapCallBack(fopAc_ac_c*);
121 static BOOL ctrlJointCallBack(J3DJoint*, int);
122 bool setExpressionAnm(int, bool);
123 bool setExpressionBtp(int);
124 void setMotionAnm(int, f32);
125 BOOL wait(void*);
126 void setMotion(int, f32, int);
127 void setExpression(int, f32);
128 BOOL waitTW(void*);
129 BOOL talk(void*);
130 BOOL test(void*);
131 BOOL EvCut_TwResistance(int);
132 BOOL EvCut_Introduction(int);
134 void reset();
135 /* inline */ inline int Draw();
136 inline void setParam();
137 inline BOOL main();
138 inline void playMotion();
139 inline void playExpression();
140 /* inline */ inline void setExpressionTalkAfter();
141 inline BOOL doEvent();
142 inline BOOL ctrlBtk();
143 inline void setAttnPos();
144 inline void lookat();
145 inline BOOL drawDbgInfo();
147
149 switch (fopAcM_GetParam(this) & 0xff) {
150 case 0:
151 return TYPE_BAR;
152 case 1:
153 return TYPE_1;
154 case 2:
155 return TYPE_KAKARIKO;
156 default:
157 return TYPE_BAR;
159 }
160
161 bool isDelete() {
162 if (mType == TYPE_BAR || mType == TYPE_1 || mType == TYPE_KAKARIKO) {
163 return false;
164 } else {
165 return true;
166 }
167 }
168
169 void setLookMode(int i_lookMode) {
170 if (i_lookMode >= 0 && i_lookMode < 6 && i_lookMode != mLookMode) {
171 mLookMode = i_lookMode;
172 }
173 }
174
175 bool isSneaking() {
176 if (!strcmp(dComIfGp_getStartStageName(), "R_SP116") &&
178 {
179 return true;
180 }
181 return false;
182 }
183
185
187 if (mpActionFn != NULL) {
188 mMode = 3;
189 (this->*mpActionFn)(NULL);
190 }
191 if (action != NULL) {
193 mMode = 0;
194 (this->*mpActionFn)(NULL);
195 }
196 return true;
197 }
198
199 void doNormalAction(int) {
200 mOrderEvtNo = 0;
201 if (mpNextActionFn != NULL) {
202 if (mpNextActionFn == mpActionFn) {
203 (this->*mpActionFn)(NULL);
204 } else {
207 }
208 }
209 }
210
211private:
212 /* 0xB48 */ Z2Creature mSound;
216 /* 0xC90 */ NPC_THE_HIO_CLASS* mpHIO;
217 /* 0xC94 */ dCcD_Cyl mColCyl;
219 /* 0xDDC */ ActionFn mpActionFn;
221 /* 0xDF8 */ u8 field_0xdf8[8];
222 /* 0xE00 */ u32 mItemID;
223 /* 0xE04 */ u32 field_0xe04;
224 /* 0xE08 */ u32 field_0xe08;
225 /* 0xE0C */ u32 field_0xe0c;
226 /* 0xE10 */ u32 field_0xe10;
227 /* 0xE14 */ int mFlowID;
228 /* 0xE18 */ s16 mLookMode;
229 /* 0xE1A */ u16 mMode;
230 /* 0xE1C */ bool field_0xe1c;
231 /* 0xE1D */ bool field_0xe1d;
232 /* 0xE1E */ u8 mType;
233
234 static char* mEvtCutNameList[4];
235 static EventFn mEvtCutList[4];
236};
237
238STATIC_ASSERT(sizeof(daNpcThe_c) == 0xE20);
239
240#endif /* D_A_NPC_THE_H */
int cPhs_Step
Definition c_phase.h:8
Definition Z2Creature.h:7
Definition d_cc_d.h:472
static int getLayerNo(int)
Definition d_com_inf_game.cpp:882
Definition d_a_npc4.h:14
Definition d_a_npc4.h:140
Definition d_a_npc4.h:121
Definition d_a_npc4.h:170
u16 mOrderEvtNo
Definition d_a_npc4.h:242
Definition d_a_npc_the.h:21
daNpcThe_HIOParam m
Definition d_a_npc_the.h:28
void genMessage(JORMContext *)
Definition d_a_npc_the.cpp:60
void listenPropertyEvent(const JORPropertyEvent *)
Definition d_a_npc_the.cpp:56
daNpcThe_HIO_c()
Definition d_a_npc_the.cpp:52
Definition d_a_npc_the.h:11
static const daNpcThe_HIOParam m
Definition d_a_npc_the.h:15
virtual ~daNpcThe_Param_c()
Definition d_a_npc_the.h:13
Telma.
Definition d_a_npc_the.h:44
BOOL EvCut_TwResistance(int)
Definition d_a_npc_the.cpp:895
BOOL ctrlBtk()
Definition d_a_npc_the.cpp:1278
BOOL waitTW(void *)
Definition d_a_npc_the.cpp:739
void adjustShapeAngle()
Definition d_a_npc_the.h:146
BOOL drawDbgInfo()
Definition d_a_npc_the.cpp:1335
u32 field_0xe0c
Definition d_a_npc_the.h:225
static char * mEvtCutNameList[4]
Definition d_a_npc_the.h:158
void doNormalAction(int)
Definition d_a_npc_the.h:199
void reset()
Definition d_a_npc_the.cpp:1017
u32 field_0xe04
Definition d_a_npc_the.h:223
BOOL test(void *)
Definition d_a_npc_the.cpp:865
bool field_0xe1c
Definition d_a_npc_the.h:230
void playMotion()
Definition d_a_npc_the.cpp:538
daNpcF_MatAnm_c * mpMatAnm
Definition d_a_npc_the.h:213
NPC_THE_HIO_CLASS * mpHIO
Definition d_a_npc_the.h:216
bool chkAction(ActionFn action)
Definition d_a_npc_the.h:184
~daNpcThe_c()
Definition d_a_npc_the.cpp:181
void setMotionAnm(int, f32)
Definition d_a_npc_the.cpp:425
BOOL CreateHeap()
Definition d_a_npc_the.cpp:190
static EventFn mEvtCutList[4]
Definition d_a_npc_the.h:165
u32 field_0xe10
Definition d_a_npc_the.h:226
Motion
Definition d_a_npc_the.h:102
@ MOT_KUNE_WAIT_A
Definition d_a_npc_the.h:108
@ MOT_TALK_R
Definition d_a_npc_the.h:112
@ MOT_WAIT_A
Definition d_a_npc_the.h:103
@ MOT_LOOK_A
Definition d_a_npc_the.h:104
@ MOT_LOOK
Definition d_a_npc_the.h:113
@ MOT_KUNE_WAIT_B
Definition d_a_npc_the.h:111
@ MOT_KUNE_SHISHI
Definition d_a_npc_the.h:109
@ MOT_TO_WAIT_B
Definition d_a_npc_the.h:105
@ MOT_WAIT_B
Definition d_a_npc_the.h:110
@ MOT_KUNE_TALK
Definition d_a_npc_the.h:107
@ MOT_WAIT_LOOKUP
Definition d_a_npc_the.h:106
BOOL(daNpcThe_c::*) ActionFn(void *)
Definition d_a_npc_the.h:46
int mFlowID
Definition d_a_npc_the.h:227
BOOL main()
Definition d_a_npc_the.cpp:1115
BOOL talk(void *)
Definition d_a_npc_the.cpp:771
u8 field_0xdf8[8]
Definition d_a_npc_the.h:221
daNpcThe_c()
Definition d_a_npc_the.cpp:179
BOOL EvCut_Introduction(int)
Definition d_a_npc_the.cpp:899
BOOL ctrlJoint(J3DJoint *, J3DModel *)
Definition d_a_npc_the.cpp:228
bool setExpressionAnm(int, bool)
Definition d_a_npc_the.cpp:277
static BOOL ctrlJointCallBack(J3DJoint *, int)
Definition d_a_npc_the.cpp:267
bool setExpressionBtp(int)
Definition d_a_npc_the.cpp:359
void setParam()
Definition d_a_npc_the.cpp:1063
daNpcF_ActorMngr_c mActorMngr[3]
Definition d_a_npc_the.h:215
u16 mMode
Definition d_a_npc_the.h:229
dCcD_Cyl mColCyl
Definition d_a_npc_the.h:217
bool isDelete()
Definition d_a_npc_the.h:161
daNpcF_Lookat_c mLookat
Definition d_a_npc_the.h:214
int Draw()
Definition d_a_npc_the.cpp:172
u32 field_0xe08
Definition d_a_npc_the.h:224
void setAttnPos()
Definition d_a_npc_the.cpp:1296
bool field_0xe1d
Definition d_a_npc_the.h:231
u8 getTypeFromParam()
Definition d_a_npc_the.h:148
u8 mType
Definition d_a_npc_the.h:232
Animation
Definition d_a_npc_the.h:55
@ ANM_TALK_R
Definition d_a_npc_the.h:75
@ ANM_KUNE_SHISHI
Definition d_a_npc_the.h:82
@ ANM_WAIT_LOOKUP
Definition d_a_npc_the.h:74
@ ANM_KUNE_TALK
Definition d_a_npc_the.h:80
@ ANM_F_TALK_B
Definition d_a_npc_the.h:60
@ ANM_KUNE_WAIT_B
Definition d_a_npc_the.h:81
@ ANM_F_TALK_R
Definition d_a_npc_the.h:63
@ ANM_WAIT_B
Definition d_a_npc_the.h:73
@ ANM_WAIT_LOOKING
Definition d_a_npc_the.h:71
@ ANM_WAIT_A
Definition d_a_npc_the.h:70
@ ANM_F_TALK_A
Definition d_a_npc_the.h:57
@ ANM_FH_CHUCKLE
Definition d_a_npc_the.h:65
@ ANM_TALKING_R
Definition d_a_npc_the.h:76
@ ANM_FH_TALK_B
Definition d_a_npc_the.h:66
@ ANM_LOOK
Definition d_a_npc_the.h:78
@ ANM_TO_WAIT_B
Definition d_a_npc_the.h:72
@ ANM_FH_LAUGH
Definition d_a_npc_the.h:68
@ ANM_F_SMILE
Definition d_a_npc_the.h:58
@ ANM_LOOK_A
Definition d_a_npc_the.h:77
@ ANM_FH_SMILE
Definition d_a_npc_the.h:64
@ ANM_F_LAUGH
Definition d_a_npc_the.h:62
@ ANM_KUNE_WAIT_A
Definition d_a_npc_the.h:79
@ ANM_F_CHUCKLE
Definition d_a_npc_the.h:59
@ ANM_F_TALK_C
Definition d_a_npc_the.h:61
@ ANM_FH_TALK_C
Definition d_a_npc_the.h:67
@ ANM_NONE
Definition d_a_npc_the.h:56
@ ANM_FH_TALK_R
Definition d_a_npc_the.h:69
ActionFn mpActionFn
Definition d_a_npc_the.h:219
BOOL doEvent()
Definition d_a_npc_the.cpp:1178
BOOL wait(void *)
Definition d_a_npc_the.cpp:632
Expression
Definition d_a_npc_the.h:85
@ EXPR_TALK_C
Definition d_a_npc_the.h:90
@ EXPR_SMILE
Definition d_a_npc_the.h:87
@ EXPR_CHUCKLE
Definition d_a_npc_the.h:88
@ EXPR_TALK_A
Definition d_a_npc_the.h:86
@ EXPR_H_CHUCKLE
Definition d_a_npc_the.h:95
@ EXPR_TALK_B
Definition d_a_npc_the.h:89
@ EXPR_H_LAUGH
Definition d_a_npc_the.h:98
@ EXPR_H_TALK_C
Definition d_a_npc_the.h:97
@ EXPR_LAUGH
Definition d_a_npc_the.h:91
@ EXPR_NONE
Definition d_a_npc_the.h:99
@ EXPR_TALK_R
Definition d_a_npc_the.h:92
@ EXPR_H_TALK_B
Definition d_a_npc_the.h:96
@ EXPR_H_TALK_R
Definition d_a_npc_the.h:93
@ EXPR_H_SMILE
Definition d_a_npc_the.h:94
void setExpression(int, f32)
Definition d_a_npc_the.cpp:730
void lookat()
Definition d_a_npc_the.cpp:575
ActionFn mpNextActionFn
Definition d_a_npc_the.h:218
void playExpression()
Definition d_a_npc_the.cpp:500
u32 mItemID
Definition d_a_npc_the.h:222
BOOL(daNpcThe_c::*) EventFn(int)
Definition d_a_npc_the.h:47
s16 mLookMode
Definition d_a_npc_the.h:228
void setExpressionTalkAfter()
Definition d_a_npc_the.cpp:1152
BOOL setAction(ActionFn action)
Definition d_a_npc_the.h:186
Z2Creature mSound
Definition d_a_npc_the.h:212
Type
Definition d_a_npc_the.h:49
@ TYPE_BAR
Definition d_a_npc_the.h:50
@ TYPE_1
Definition d_a_npc_the.h:51
@ TYPE_KAKARIKO
Definition d_a_npc_the.h:52
static BOOL createHeapCallBack(fopAc_ac_c *)
Definition d_a_npc_the.cpp:263
request_of_phase_process_class mPhase[2]
Definition d_a_npc_the.h:220
bool isSneaking()
Definition d_a_npc_the.h:175
void setMotion(int, f32, int)
Definition d_a_npc_the.cpp:718
cPhs_Step create()
Definition d_a_npc_the.cpp:932
void setLookMode(int i_lookMode)
Definition d_a_npc_the.h:169
Definition f_op_actor.h:271
Definition m_Do_hostIO.h:26
static void action(b_bh_class *i_this)
Definition d_a_b_bh.cpp:1016
STATIC_ASSERT(sizeof(daNpcThe_Param_c::m)==0x6C)
s8 dComIfGp_getStartStageRoomNo()
Definition d_com_inf_game.h:2362
const char * dComIfGp_getStartStageName()
Definition d_com_inf_game.h:2354
u32 fopAcM_GetParam(const void *i_actor)
Definition f_op_actor_mng.h:172
Definition d_a_npc4.h:430
Definition d_a_npc_the.h:7
daNpcF_HIOParam common
Definition d_a_npc_the.h:8
Definition c_phase.h:19