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