Skip to content

Commit 7e06b18

Browse files
authored
d_a_npc_bou Equivalent (#2411)
* Initial d_a_npc_bou work * d_a_npc_bou 34% done * d_a_npc_bou 56% matching * DONE d_a_npc_bou cutWildGoat * d_a_npc_bou 76% matching * d_a_npc_bou equivalent * Mark d_a_npc_bou as Equivalent in configure(dot)py
1 parent 657ea58 commit 7e06b18

File tree

7 files changed

+1578
-1500
lines changed

7 files changed

+1578
-1500
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ def MatchingFor(*versions) -> bool:
17511751
ActorRel(NonMatching, "d_a_npc_ashB"),
17521752
ActorRel(NonMatching, "d_a_npc_bans"),
17531753
ActorRel(NonMatching, "d_a_npc_blue_ns"),
1754-
ActorRel(NonMatching, "d_a_npc_bou"),
1754+
ActorRel(Equivalent, "d_a_npc_bou"),
17551755
ActorRel(NonMatching, "d_a_npc_bouS"),
17561756
ActorRel(NonMatching, "d_a_npc_cdn3"),
17571757
ActorRel(NonMatching, "d_a_npc_chat"),

include/d/actor/d_a_horse.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ class daHorse_c : public fopAc_ac_c {
262262
bool checkCutTurnCancel() const { return checkEndResetStateFlg0(ERFLG0_CUT_TURN_CANCEL); }
263263
bool checkTurnCancelKeep() const { return checkStateFlg0(FLG0_TURN_CANCEL_KEEP); }
264264
BOOL checkRodeoLeft() const { return checkStateFlg0(FLG0_RODEO_LEFT); }
265+
BOOL checkHorseCallWait() const { return checkStateFlg0(FLG0_NO_DRAW_WAIT); }
265266
BOOL checkTurn() const { return m_procID == PROC_TURN_e && field_0x1720 == 0; }
266267
BOOL checkStop() const { return m_procID == PROC_STOP_e; }
267268
bool checkJump() const { return m_procID == PROC_JUMP_e; }

include/d/actor/d_a_npc_bou.h

Lines changed: 86 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class daNpc_Bou_Param_c {
1515
public:
16-
/* 809727F4 */ ~daNpc_Bou_Param_c();
16+
/* 809727F4 */ virtual ~daNpc_Bou_Param_c() {}
1717

1818
struct Data {
1919
/* 0x00 */ f32 field_0x00; // 255.0f
@@ -65,6 +65,8 @@
6565

6666
class daNpc_Bou_c : public daNpcT_c {
6767
public:
68+
typedef int (daNpc_Bou_c::*cutFunc)(int);
69+
typedef int (daNpc_Bou_c::*actionFunc)(void*);
6870

6971
enum Type {
7072
TYPE_0,
@@ -76,37 +78,39 @@ class daNpc_Bou_c : public daNpcT_c {
7678
};
7779

7880
/* 8096CF8C */ ~daNpc_Bou_c();
79-
/* 8096D0D8 */ void create();
80-
/* 8096D38C */ void CreateHeap();
81-
/* 8096D7B8 */ void Delete();
82-
/* 8096D7EC */ void Execute();
83-
/* 8096D80C */ void Draw();
84-
/* 8096D8A0 */ void createHeapCallBack(fopAc_ac_c*);
85-
/* 8096D8C0 */ void ctrlJointCallBack(J3DJoint*, int);
86-
/* 8096D918 */ void srchCow(void*, void*);
87-
/* 8096D9B4 */ void getCowP();
81+
/* 8096D0D8 */ int create();
82+
/* 8096D38C */ int CreateHeap();
83+
/* 8096D7B8 */ int Delete();
84+
/* 8096D7EC */ int Execute();
85+
/* 8096D80C */ int Draw();
86+
/* 8096D8A0 */ static int createHeapCallBack(fopAc_ac_c*);
87+
/* 8096D8C0 */ static int ctrlJointCallBack(J3DJoint*, int);
88+
/* 8096D918 */ static void* srchCow(void*, void*);
89+
/* 8096D9B4 */ fopAc_ac_c* getCowP();
8890
/* 8096DA78 */ u8 getType();
89-
/* 8096DADC */ void isDelete();
91+
/* 8096DADC */ int isDelete();
9092
/* 8096DBBC */ void reset();
9193
/* 8096E18C */ void srchActors();
92-
/* 8096ECC0 */ void selectAction();
93-
/* 8096ED3C */ void chkAction(int (daNpc_Bou_c::*)(void*));
94-
/* 8096ED68 */ void setAction(int (daNpc_Bou_c::*)(void*));
95-
/* 8096EE10 */ void cutWildGoat(int);
96-
/* 8096F2E4 */ void cutWildGoatSuccess(int);
97-
/* 8096F510 */ void cutWildGoatFailure(int);
98-
/* 8096F758 */ void cutSpeakTo(int);
99-
/* 8096F9A4 */ void cutConversationWithBou(int);
100-
/* 8096FB78 */ void cutConfidentialConversation(int);
101-
/* 8096FE40 */ void cutFindWolf(int);
102-
/* 80970278 */ void cutMeetingAgain(int);
103-
/* 809709EC */ void wait(void*);
104-
/* 80970DFC */ void talkwithJagar(void*);
105-
/* 80970F9C */ void talk(void*);
106-
/* 809726D4 */ daNpc_Bou_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
107-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
108-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
109-
daNpcT_evtData_c const*, char**);
94+
/* 8096ECC0 */ int selectAction();
95+
/* 8096ED3C */ int chkAction(int (daNpc_Bou_c::*)(void*));
96+
/* 8096ED68 */ int setAction(int (daNpc_Bou_c::*)(void*));
97+
/* 8096EE10 */ int cutWildGoat(int);
98+
/* 8096F2E4 */ int cutWildGoatSuccess(int);
99+
/* 8096F510 */ int cutWildGoatFailure(int);
100+
/* 8096F758 */ int cutSpeakTo(int);
101+
/* 8096F9A4 */ int cutConversationWithBou(int);
102+
/* 8096FB78 */ int cutConfidentialConversation(int);
103+
/* 8096FE40 */ int cutFindWolf(int);
104+
/* 80970278 */ int cutMeetingAgain(int);
105+
/* 809709EC */ int wait(void*);
106+
/* 80970DFC */ int talkwithJagar(void*);
107+
/* 80970F9C */ int talk(void*);
108+
/* 809726D4 */ daNpc_Bou_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
109+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
110+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
111+
daNpcT_evtData_c const* param_7, char** param_8) :
112+
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8)
113+
{}
110114

111115
/* 809727D4 */ virtual int checkChangeJoint(int);
112116
/* 809727E4 */ virtual int checkRemoveJoint(int);
@@ -128,8 +132,16 @@ class daNpc_Bou_c : public daNpcT_c {
128132
/* 8096EC6C */ virtual int drawDbgInfo();
129133
/* 8096EC74 */ virtual void changeAnm(int*, int*);
130134

131-
static void* mCutNameList[9];
132-
static u8 mCutList[108];
135+
static char* mCutNameList[9];
136+
static cutFunc mCutList[9];
137+
138+
int getFlowNodeNo() {
139+
u16 nodeNo = home.angle.x;
140+
if (nodeNo == 0xffff) {
141+
return -1;
142+
}
143+
return nodeNo;
144+
}
133145

134146
BOOL chkFindWolf() {
135147
int iVar1 = daNpcT_getDistTableIdx(field_0xfe0, field_0xfe4);
@@ -157,7 +169,7 @@ class daNpc_Bou_c : public daNpcT_c {
157169
}
158170

159171
BOOL speakTo() {
160-
if (field_0xf80 == 4) {
172+
if (mType == 4) {
161173
if (current.pos.absXZ(daPy_getPlayerActorClass()->current.pos) < 1100.0f && strlen(mpEvtData[5].eventName) != 0) {
162174
u32 len = strlen(mpArcNames[mpEvtData[5].num]);
163175
if (len != 0) {
@@ -176,18 +188,55 @@ class daNpc_Bou_c : public daNpcT_c {
176188

177189
private:
178190
/* 0xE40 */ int field_0xe40;
179-
/* 0xE44 */ dCcD_Cyl field_0xe44;
180-
/* 0xF80 */ u8 field_0xf80;
181-
/* 0xF84 */ daNpcT_ActorMngr_c field_0xf84[3];
191+
/* 0xE44 */ dCcD_Cyl mCyl1;
192+
/* 0xF80 */ u8 mType;
193+
/* 0xF84 */ daNpcT_ActorMngr_c mActorMngr[3];
182194
/* 0xF9C */ daNpcT_Path_c field_0xf9c;
183-
/* 0xFC4 */ u8 field_0xfc4[0xFDC - 0xFC4];
195+
/* 0xFC4 */ actionFunc field_0xfc4;
196+
/* 0xFD0 */ actionFunc field_0xfd0;
184197
/* 0xFDC */ int field_0xfdc;
185198
/* 0xFE0 */ int field_0xfe0;
186199
/* 0xFE4 */ int field_0xfe4;
187-
/* 0xFE8 */ u8 field_0xfe8[0xFFC - 0xFE8];
200+
/* 0xFE8 */ u8 field_0xfe8[0xFF4 - 0xFE8];
201+
/* 0xFF4 */ u8 field_0xff4;
202+
/* 0xFF5 */ u8 field_0xff5[0xFF8 - 0xFF5];
203+
/* 0xFF8 */ u8 field_0xff8;
188204
};
189205

190206
STATIC_ASSERT(sizeof(daNpc_Bou_c) == 0xffc);
191207

208+
/* 809727B4-809727BC 005914 0008+00 1/0 0/0 0/0 .text getEyeballMaterialNo__11daNpc_Bou_cFv */
209+
s32 daNpc_Bou_c::getEyeballMaterialNo() {
210+
return 1;
211+
}
212+
213+
/* 809727BC-809727C4 00591C 0008+00 1/0 0/0 0/0 .text getHeadJointNo__11daNpc_Bou_cFv */
214+
s32 daNpc_Bou_c::getHeadJointNo() {
215+
return 4;
216+
}
217+
218+
/* 809727C4-809727CC 005924 0008+00 1/0 0/0 0/0 .text getNeckJointNo__11daNpc_Bou_cFv */
219+
s32 daNpc_Bou_c::getNeckJointNo() {
220+
return 3;
221+
}
222+
223+
/* 809727CC-809727D4 00592C 0008+00 1/0 0/0 0/0 .text getBackboneJointNo__11daNpc_Bou_cFv
224+
*/
225+
s32 daNpc_Bou_c::getBackboneJointNo() {
226+
return 1;
227+
}
228+
229+
/* 809727D4-809727E4 005934 0010+00 1/0 0/0 0/0 .text checkChangeJoint__11daNpc_Bou_cFi
230+
*/
231+
int daNpc_Bou_c::checkChangeJoint(int param_0) {
232+
return param_0 == 4;
233+
}
234+
235+
/* 809727E4-809727F4 005944 0010+00 1/0 0/0 0/0 .text checkRemoveJoint__11daNpc_Bou_cFi
236+
*/
237+
int daNpc_Bou_c::checkRemoveJoint(int param_0) {
238+
return param_0 == 8;
239+
}
240+
192241

193242
#endif /* D_A_NPC_BOU_H */

include/d/actor/d_a_npc_jagar.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,24 @@ class daNpc_Jagar_c : public daNpcT_c {
166166
return false;
167167
}
168168

169+
void setSurpriseMotion() {
170+
mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0);
171+
mMotionSeqMngr.setNo(7, -1.0f, 0, 0);
172+
field_0xff8 = 0;
173+
}
174+
175+
void setListenMotion(f32 arg) {
176+
mFaceMotionSeqMngr.setNo(8, -1.0f, 0, 0);
177+
if (0.0f < arg + (cM_rnd() - 0.5f)) {
178+
mMotionSeqMngr.setNo(8, -1.0f, 0, 0);
179+
} else {
180+
mMotionSeqMngr.setNo(5, -1.0f, 0, 0);
181+
}
182+
}
183+
184+
void onListen() { mListen = 1; }
185+
void offListen() { mListen = 0; }
186+
169187
u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; }
170188

171189
static char* mCutNameList[7];
@@ -188,7 +206,7 @@ class daNpc_Jagar_c : public daNpcT_c {
188206
/* 0x1002 */ u8 field_0x1002;
189207
/* 0x1003 */ u8 field_0x1003;
190208
/* 0x1004 */ u8 field_0x1004;
191-
/* 0x1005 */ u8 field_0x1005;
209+
/* 0x1005 */ u8 mListen;
192210
/* 0x1008 */ int field_0x1008;
193211
};
194212

include/d/actor/d_a_player.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ class daPy_py_c : public fopAc_ac_c {
899899
bool getGrabUpStart() const { return checkResetFlg0(RFLG0_UNK_8000); }
900900
bool checkCanoeSlider() const { return mSpecialMode == 0x2D; }
901901
bool checkGoatStopGame() const { return mSpecialMode == 0x2A; }
902+
bool onGoatStopGame() { return mSpecialMode = 0x2A; }
902903
u8 getCutType() const { return mCutType; }
903904
u16 getSwordAtUpTime() const { return mSwordUpTimer; }
904905
s16 getDamageWaitTimer() const { return mDamageTimer; }

0 commit comments

Comments
 (0)