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_npc.h"
5
14class daNpcThe_c : public daNpcF_c {
15public:
17 typedef BOOL (daNpcThe_c::*EventFn)(int);
18
19 enum Type {
20 /* 0 */ TYPE_BAR,
21 /* 1 */ TYPE_1,
23 };
24
25 enum Animation {
26 /* 0x00 */ ANM_NONE,
27 /* 0x01 */ ANM_F_TALK_A,
28 /* 0x02 */ ANM_F_SMILE,
29 /* 0x03 */ ANM_F_CHUCKLE,
30 /* 0x04 */ ANM_F_TALK_B,
31 /* 0x05 */ ANM_F_TALK_C,
32 /* 0x06 */ ANM_F_LAUGH,
33 /* 0x07 */ ANM_F_TALK_R,
34 /* 0x08 */ ANM_FH_SMILE,
35 /* 0x09 */ ANM_FH_CHUCKLE,
36 /* 0x0A */ ANM_FH_TALK_B,
37 /* 0x0B */ ANM_FH_TALK_C,
38 /* 0x0C */ ANM_FH_LAUGH,
39 /* 0x0D */ ANM_FH_TALK_R,
40 /* 0x0E */ ANM_WAIT_A,
41 /* 0x0F */ ANM_WAIT_LOOKING,
42 /* 0x10 */ ANM_TO_WAIT_B,
43 /* 0x11 */ ANM_WAIT_B,
44 /* 0x12 */ ANM_WAIT_LOOKUP,
45 /* 0x13 */ ANM_TALK_R,
46 /* 0x14 */ ANM_TALKING_R,
47 /* 0x15 */ ANM_LOOK_A,
48 /* 0x16 */ ANM_LOOK,
49 /* 0x17 */ ANM_KUNE_WAIT_A,
50 /* 0x18 */ ANM_KUNE_TALK,
51 /* 0x19 */ ANM_KUNE_WAIT_B,
52 /* 0x1A */ ANM_KUNE_SHISHI,
53 };
54
56 /* 0x0 */ EXPR_TALK_A,
57 /* 0x1 */ EXPR_SMILE,
58 /* 0x2 */ EXPR_CHUCKLE,
59 /* 0x3 */ EXPR_TALK_B,
60 /* 0x4 */ EXPR_TALK_C,
61 /* 0x5 */ EXPR_LAUGH,
62 /* 0x6 */ EXPR_TALK_R,
63 /* 0x7 */ EXPR_H_TALK_R,
64 /* 0x8 */ EXPR_H_SMILE,
65 /* 0x9 */ EXPR_H_CHUCKLE,
66 /* 0xA */ EXPR_H_TALK_B,
67 /* 0xB */ EXPR_H_TALK_C,
68 /* 0xC */ EXPR_H_LAUGH,
69 /* 0xD */ EXPR_NONE,
70 };
71
72 enum Motion {
73 /* 0x0 */ MOT_WAIT_A,
74 /* 0x1 */ MOT_LOOK_A,
75 /* 0x2 */ MOT_TO_WAIT_B,
76 /* 0x3 */ MOT_WAIT_LOOKUP,
77 /* 0x4 */ MOT_KUNE_TALK,
78 /* 0x5 */ MOT_KUNE_WAIT_A,
79 /* 0x6 */ MOT_KUNE_SHISHI,
80 /* 0x7 */ MOT_WAIT_B,
81 /* 0x8 */ MOT_KUNE_WAIT_B,
82 /* 0x9 */ MOT_TALK_R,
83 /* 0xA */ MOT_LOOK,
84 };
85
86 /* 80AF76CC */ daNpcThe_c();
87 /* 80AF78E0 */ ~daNpcThe_c();
88 /* inline */ inline BOOL CreateHeap();
89 /* 80AF7AE0 */ BOOL ctrlJoint(J3DJoint*, J3DModel*);
90 /* 80AF7CB0 */ static BOOL createHeapCallBack(fopAc_ac_c*);
91 /* 80AF8114 */ static BOOL ctrlJointCallBack(J3DJoint*, int);
92 /* 80AF8160 */ bool setExpressionAnm(int, bool);
93 /* 80AF841C */ bool setExpressionBtp(int);
94 /* 80AF8564 */ bool setMotionAnm(int, f32);
95 /* 80AF8744 */ BOOL wait(void*);
96 /* 80AF8B0C */ void setMotion(int, f32, int);
97 /* 80AF8B50 */ void setExpression(int, f32);
98 /* 80AF8B7C */ BOOL waitTW(void*);
99 /* 80AF8CC4 */ BOOL talk(void*);
100 /* 80AF912C */ BOOL test(void*);
101 /* 80AF923C */ BOOL EvCut_TwResistance(int);
102 /* 80AF9244 */ BOOL EvCut_Introduction(int);
103 /* 80AF9358 */ cPhs__Step create();
104 /* 80AF9748 */ void reset();
105 /* inline */ inline int Draw();
106 /* 80AF99F4 */ void setParam();
107 /* 80AF9CF0 */ BOOL main();
108 /* 80AF9F94 */ void playMotion();
109 /* 80AFA338 */ void playExpression();
110 /* inline */ inline void setExpressionTalkAfter();
111 /* 80AFA6CC */ BOOL doEvent();
112 /* 80AFADEC */ BOOL ctrlBtk();
113 /* 80AFAEC8 */ void setAttnPos();
114 /* 80AFB1C4 */ void lookat();
115 /* 80AFB488 */ BOOL drawDbgInfo();
116 /* 80AFBD9C */ void adjustShapeAngle();
117
119 switch (fopAcM_GetParam(this) & 0xff) {
120 case 0:
121 return TYPE_BAR;
122 case 1:
123 return TYPE_1;
124 case 2:
125 return TYPE_KAKARIKO;
126 default:
127 return TYPE_BAR;
128 }
129 }
130
131 bool isDelete() {
132 if (mType == TYPE_BAR || mType == TYPE_1 || mType == TYPE_KAKARIKO) {
133 return false;
134 } else {
135 return true;
136 }
137 }
138
140 if (i_lookMode >= 0 && i_lookMode < 6 && i_lookMode != mLookMode) {
142 }
143 }
144
145 bool isSneaking() {
147 && dComIfG_play_c::getLayerNo(0) == 2) {
148 return true;
149 }
150 return false;
151 }
152
154 return mpActionFn == action;
155 }
156
158 if (mpActionFn != NULL) {
159 mMode = 3;
160 (this->*mpActionFn)(NULL);
161 }
162 if (action != NULL) {
164 mMode = 0;
165 (this->*mpActionFn)(NULL);
166 }
167 return true;
168 }
169
171 mOrderEvtNo = 0;
172 if (mpNextActionFn != NULL) {
173 if (mpNextActionFn == mpActionFn) {
174 (this->*mpActionFn)(NULL);
175 } else {
177 setAction(action);
178 }
179 }
180 }
181
182private:
183 /* 0xB48 */ Z2Creature mSound;
187 /* 0xC90 */ u8 field_0xc90[4];
188 /* 0xC94 */ dCcD_Cyl mColCyl;
190 /* 0xDDC */ ActionFn mpActionFn;
192 /* 0xDF8 */ u8 field_0xdf8[8];
193 /* 0xE00 */ u32 mItemID;
194 /* 0xE04 */ u32 field_0xe04;
195 /* 0xE08 */ u32 field_0xe08;
196 /* 0xE0C */ u32 field_0xe0c;
197 /* 0xE10 */ u32 field_0xe10;
198 /* 0xE14 */ int mFlowID;
199 /* 0xE18 */ s16 mLookMode;
200 /* 0xE1A */ u16 mMode;
201 /* 0xE1C */ bool field_0xe1c;
202 /* 0xE1D */ bool field_0xe1d;
203 /* 0xE1E */ u8 mType;
204
205 static char* mEvtCutNameList[4];
206 static EventFn mEvtCutList[4];
207};
208
209STATIC_ASSERT(sizeof(daNpcThe_c) == 0xE20);
210
212public:
213 struct param {
214 /* 0x00 */ f32 mAttnOffsetY;
215 /* 0x04 */ f32 mGravity;
216 /* 0x08 */ f32 mScale;
217 /* 0x0C */ f32 mShadowDepth;
218 /* 0x10 */ f32 mCcWeight;
219 /* 0x14 */ f32 mCylH;
220 /* 0x18 */ f32 mWallH;
221 /* 0x1C */ f32 mWallR;
222 /* 0x20 */ f32 mBodyUpAngle;
223 /* 0x24 */ f32 mBodyDownAngle;
224 /* 0x28 */ f32 mBodyLeftAngle;
226 /* 0x30 */ f32 mHeadUpAngle;
227 /* 0x34 */ f32 mHeadDownAngle;
228 /* 0x38 */ f32 mHeadLeftAngle;
230 /* 0x40 */ f32 mNeckAngleScl;
231 /* 0x44 */ f32 mMorfFrames;
232 /* 0x48 */ s16 mSpeakDistIdx;
233 /* 0x4A */ s16 mSpeakAngleIdx;
234 /* 0x4C */ s16 mTalkDistIdx;
235 /* 0x4E */ s16 mTalkAngleIdx;
236 /* 0x50 */ f32 mAttnFovY;
237 /* 0x54 */ f32 mAttnRadius;
238 /* 0x58 */ f32 mAttnUpperY;
239 /* 0x5C */ f32 mAttnLowerY;
240 /* 0x60 */ s16 field_0x60;
241 /* 0x62 */ s16 mDamageTimer;
243 /* 0x66 */ s16 mTestMotion;
244 /* 0x68 */ s16 mTestLookMode;
245 /* 0x6A */ bool mTest;
246 };
247
248 /* 80AFBDA0 */ virtual ~daNpcThe_Param_c() {}
249
250 static daNpcThe_Param_c::param const m;
251};
252
254
255#endif /* D_A_NPC_THE_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
cPhs__Step
Definition c_phase.h:8
static int getLayerNo(int)
Definition d_com_inf_game.cpp:843
Definition d_a_npc.h:756
Definition d_a_npc.h:1099
Definition d_a_npc.h:1017
Definition d_a_npc.h:772
u16 mOrderEvtNo
Definition d_a_npc.h:844
Definition d_a_npc_the.h:211
static daNpcThe_Param_c::param const m
Definition d_a_npc_the.h:401
virtual ~daNpcThe_Param_c()
Definition d_a_npc_the.h:248
Telma.
Definition d_a_npc_the.h:14
BOOL EvCut_TwResistance(int)
Definition d_a_npc_the.cpp:1133
BOOL ctrlBtk()
Definition d_a_npc_the.cpp:1528
BOOL waitTW(void *)
Definition d_a_npc_the.cpp:973
void adjustShapeAngle()
BOOL drawDbgInfo()
Definition d_a_npc_the.cpp:1647
u32 field_0xe0c
Definition d_a_npc_the.h:196
static char * mEvtCutNameList[4]
Definition d_a_npc_the.h:363
void reset()
Definition d_a_npc_the.cpp:1256
u32 field_0xe04
Definition d_a_npc_the.h:194
BOOL test(void *)
Definition d_a_npc_the.cpp:1101
bool field_0xe1c
Definition d_a_npc_the.h:201
void playMotion()
Definition d_a_npc_the.cpp:809
bool setMotionAnm(int, f32)
Definition d_a_npc_the.cpp:682
daNpcF_MatAnm_c * mpMatAnm
Definition d_a_npc_the.h:184
void doNormalAction()
Definition d_a_npc_the.h:170
cPhs__Step create()
Definition d_a_npc_the.cpp:1174
bool chkAction(ActionFn action)
Definition d_a_npc_the.h:153
~daNpcThe_c()
Definition d_a_npc_the.cpp:391
BOOL CreateHeap()
Definition d_a_npc_the.cpp:436
static EventFn mEvtCutList[4]
Definition d_a_npc_the.h:370
u32 field_0xe10
Definition d_a_npc_the.h:197
Motion
Definition d_a_npc_the.h:72
@ MOT_KUNE_WAIT_A
Definition d_a_npc_the.h:78
@ MOT_TALK_R
Definition d_a_npc_the.h:82
@ MOT_WAIT_A
Definition d_a_npc_the.h:73
@ MOT_LOOK_A
Definition d_a_npc_the.h:74
@ MOT_LOOK
Definition d_a_npc_the.h:83
@ MOT_KUNE_WAIT_B
Definition d_a_npc_the.h:81
@ MOT_KUNE_SHISHI
Definition d_a_npc_the.h:79
@ MOT_TO_WAIT_B
Definition d_a_npc_the.h:75
@ MOT_WAIT_B
Definition d_a_npc_the.h:80
@ MOT_KUNE_TALK
Definition d_a_npc_the.h:77
@ MOT_WAIT_LOOKUP
Definition d_a_npc_the.h:76
int mFlowID
Definition d_a_npc_the.h:198
BOOL main()
Definition d_a_npc_the.cpp:1363
BOOL talk(void *)
Definition d_a_npc_the.cpp:1006
u8 field_0xdf8[8]
Definition d_a_npc_the.h:192
daNpcThe_c()
Definition d_a_npc_the.cpp:386
BOOL EvCut_Introduction(int)
Definition d_a_npc_the.cpp:1139
BOOL ctrlJoint(J3DJoint *, J3DModel *)
Definition d_a_npc_the.cpp:477
bool setExpressionAnm(int, bool)
Definition d_a_npc_the.cpp:532
static BOOL ctrlJointCallBack(J3DJoint *, int)
Definition d_a_npc_the.cpp:520
bool setExpressionBtp(int)
Definition d_a_npc_the.cpp:615
void setParam()
Definition d_a_npc_the.cpp:1308
daNpcF_ActorMngr_c mActorMngr[3]
Definition d_a_npc_the.h:186
BOOL(daNpcThe_c::* ActionFn)(void *)
Definition d_a_npc_the.h:16
BOOL(daNpcThe_c::* EventFn)(int)
Definition d_a_npc_the.h:17
u16 mMode
Definition d_a_npc_the.h:200
dCcD_Cyl mColCyl
Definition d_a_npc_the.h:188
bool isDelete()
Definition d_a_npc_the.h:131
daNpcF_Lookat_c mLookat
Definition d_a_npc_the.h:185
int Draw()
Definition d_a_npc_the.cpp:377
u8 field_0xc90[4]
Definition d_a_npc_the.h:187
u32 field_0xe08
Definition d_a_npc_the.h:195
void setAttnPos()
Definition d_a_npc_the.cpp:1547
bool field_0xe1d
Definition d_a_npc_the.h:202
u8 getTypeFromParam()
Definition d_a_npc_the.h:118
u8 mType
Definition d_a_npc_the.h:203
Animation
Definition d_a_npc_the.h:25
@ ANM_TALK_R
Definition d_a_npc_the.h:45
@ ANM_KUNE_SHISHI
Definition d_a_npc_the.h:52
@ ANM_WAIT_LOOKUP
Definition d_a_npc_the.h:44
@ ANM_KUNE_TALK
Definition d_a_npc_the.h:50
@ ANM_F_TALK_B
Definition d_a_npc_the.h:30
@ ANM_KUNE_WAIT_B
Definition d_a_npc_the.h:51
@ ANM_F_TALK_R
Definition d_a_npc_the.h:33
@ ANM_WAIT_B
Definition d_a_npc_the.h:43
@ ANM_WAIT_LOOKING
Definition d_a_npc_the.h:41
@ ANM_WAIT_A
Definition d_a_npc_the.h:40
@ ANM_F_TALK_A
Definition d_a_npc_the.h:27
@ ANM_FH_CHUCKLE
Definition d_a_npc_the.h:35
@ ANM_TALKING_R
Definition d_a_npc_the.h:46
@ ANM_FH_TALK_B
Definition d_a_npc_the.h:36
@ ANM_LOOK
Definition d_a_npc_the.h:48
@ ANM_TO_WAIT_B
Definition d_a_npc_the.h:42
@ ANM_FH_LAUGH
Definition d_a_npc_the.h:38
@ ANM_F_SMILE
Definition d_a_npc_the.h:28
@ ANM_LOOK_A
Definition d_a_npc_the.h:47
@ ANM_FH_SMILE
Definition d_a_npc_the.h:34
@ ANM_F_LAUGH
Definition d_a_npc_the.h:32
@ ANM_KUNE_WAIT_A
Definition d_a_npc_the.h:49
@ ANM_F_CHUCKLE
Definition d_a_npc_the.h:29
@ ANM_F_TALK_C
Definition d_a_npc_the.h:31
@ ANM_FH_TALK_C
Definition d_a_npc_the.h:37
@ ANM_NONE
Definition d_a_npc_the.h:26
@ ANM_FH_TALK_R
Definition d_a_npc_the.h:39
ActionFn mpActionFn
Definition d_a_npc_the.h:190
BOOL doEvent()
Definition d_a_npc_the.cpp:1429
BOOL wait(void *)
Definition d_a_npc_the.cpp:862
Expression
Definition d_a_npc_the.h:55
@ EXPR_TALK_C
Definition d_a_npc_the.h:60
@ EXPR_SMILE
Definition d_a_npc_the.h:57
@ EXPR_CHUCKLE
Definition d_a_npc_the.h:58
@ EXPR_TALK_A
Definition d_a_npc_the.h:56
@ EXPR_H_CHUCKLE
Definition d_a_npc_the.h:65
@ EXPR_TALK_B
Definition d_a_npc_the.h:59
@ EXPR_H_LAUGH
Definition d_a_npc_the.h:68
@ EXPR_H_TALK_C
Definition d_a_npc_the.h:67
@ EXPR_LAUGH
Definition d_a_npc_the.h:61
@ EXPR_NONE
Definition d_a_npc_the.h:69
@ EXPR_TALK_R
Definition d_a_npc_the.h:62
@ EXPR_H_TALK_B
Definition d_a_npc_the.h:66
@ EXPR_H_TALK_R
Definition d_a_npc_the.h:63
@ EXPR_H_SMILE
Definition d_a_npc_the.h:64
void setExpression(int, f32)
Definition d_a_npc_the.cpp:963
void lookat()
Definition d_a_npc_the.cpp:1589
ActionFn mpNextActionFn
Definition d_a_npc_the.h:189
void playExpression()
Definition d_a_npc_the.cpp:758
u32 mItemID
Definition d_a_npc_the.h:193
s16 mLookMode
Definition d_a_npc_the.h:199
void setExpressionTalkAfter()
Definition d_a_npc_the.cpp:1401
BOOL setAction(ActionFn action)
Definition d_a_npc_the.h:157
Z2Creature mSound
Definition d_a_npc_the.h:183
Type
Definition d_a_npc_the.h:19
@ TYPE_BAR
Definition d_a_npc_the.h:20
@ TYPE_1
Definition d_a_npc_the.h:21
@ TYPE_KAKARIKO
Definition d_a_npc_the.h:22
static BOOL createHeapCallBack(fopAc_ac_c *)
Definition d_a_npc_the.cpp:514
request_of_phase_process_class mPhase[2]
Definition d_a_npc_the.h:191
bool isSneaking()
Definition d_a_npc_the.h:145
void setMotion(int, f32, int)
Definition d_a_npc_the.cpp:950
void setLookMode(int i_lookMode)
Definition d_a_npc_the.h:139
static void action(b_bh_class *param_0)
Definition d_a_b_bh.cpp:886
STATIC_ASSERT(sizeof(daNpcThe_c)==0xE20)
s8 dComIfGp_getStartStageRoomNo()
Definition d_com_inf_game.h:2275
const char * dComIfGp_getStartStageName()
Definition d_com_inf_game.h:2267
u32 fopAcM_GetParam(const void *pActor)
Definition f_op_actor_mng.h:224
int strcmp(const char *str1, const char *str2)
Definition string.c:117
Definition d_a_hozelda.cpp:239
Definition d_a_ep.cpp:155
Definition d_a_hozelda.cpp:163
Definition d_a_npc_fguard.cpp:86
Definition d_a_npc_the.h:213
f32 mBodyDownAngle
Definition d_a_npc_the.h:223
f32 mAttnFovY
Definition d_a_npc_the.h:236
f32 mShadowDepth
Definition d_a_npc_the.h:217
f32 mHeadDownAngle
Definition d_a_npc_the.h:227
f32 mWallH
Definition d_a_npc_the.h:220
s16 mTalkDistIdx
Definition d_a_npc_the.h:234
f32 mBodyRightAngle
Definition d_a_npc_the.h:225
f32 mBodyLeftAngle
Definition d_a_npc_the.h:224
f32 mCylH
Definition d_a_npc_the.h:219
s16 mSpeakAngleIdx
Definition d_a_npc_the.h:233
f32 mHeadUpAngle
Definition d_a_npc_the.h:226
f32 mAttnLowerY
Definition d_a_npc_the.h:239
f32 mCcWeight
Definition d_a_npc_the.h:218
s16 mTestLookMode
Definition d_a_npc_the.h:244
f32 mMorfFrames
Definition d_a_npc_the.h:231
f32 mHeadLeftAngle
Definition d_a_npc_the.h:228
f32 mNeckAngleScl
Definition d_a_npc_the.h:230
s16 field_0x60
Definition d_a_npc_the.h:240
f32 mAttnOffsetY
Definition d_a_npc_the.h:214
bool mTest
Definition d_a_npc_the.h:245
s16 mTestExpression
Definition d_a_npc_the.h:242
f32 mAttnUpperY
Definition d_a_npc_the.h:238
s16 mSpeakDistIdx
Definition d_a_npc_the.h:232
f32 mAttnRadius
Definition d_a_npc_the.h:237
s16 mTalkAngleIdx
Definition d_a_npc_the.h:235
s16 mDamageTimer
Definition d_a_npc_the.h:241
f32 mHeadRightAngle
Definition d_a_npc_the.h:229
s16 mTestMotion
Definition d_a_npc_the.h:243
f32 mGravity
Definition d_a_npc_the.h:215
f32 mWallR
Definition d_a_npc_the.h:221
f32 mBodyUpAngle
Definition d_a_npc_the.h:222
f32 mScale
Definition d_a_npc_the.h:216
Definition d_a_ep.cpp:19
Definition d_a_hozelda.cpp:14
int BOOL
Definition types.h:27
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8