From 6f546469ec2cb7b83537f14eb7153b6fb0fc9d84 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:28:10 -0400 Subject: [PATCH 01/21] Tiny start on d_a_obj_gra2 --- include/d/actor/d_a_obj_gra2.h | 12 +++++++----- src/d/actor/d_a_obj_gra2.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 4c21dfd1d62..c424fc823cc 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -22,14 +22,14 @@ class daObj_GrA_c : public fopAc_ac_c { /* 80BFFF58 */ void rideCallBack(dBgW*, fopAc_ac_c*, fopAc_ac_c*); /* 80BFFF70 */ daObj_GrA_c(); /* 80C0011C */ ~daObj_GrA_c(); - /* 80C003CC */ void create(); + /* 80C003CC */ cPhs__Step create(); /* 80C00614 */ void CreateHeap(); /* 80C00790 */ void Delete(); /* 80C00804 */ void Execute(f32 (**)[3][4]); /* 80C00A44 */ void Draw(); /* 80C00ACC */ void jointCtrl(J3DJoint*, J3DModel*); /* 80C00D5C */ void getResName(); - /* 80C00D74 */ void getMode(); + /* 80C00D74 */ u8 getMode(); /* 80C00DF8 */ void getPathNo(); /* 80C00E04 */ void getTagNo(); /* 80C00E10 */ void getJumpType(); @@ -148,7 +148,7 @@ class daObj_GrA_c : public fopAc_ac_c { /* 80C0F7EC */ void getAttentionPos(fopAc_ac_c*); /* 80C0F860 */ void standWaitJump(void*); - bool checkNpcObjGra() { return field_0xa7e == 1; } + bool checkNpcObjGra() { return mMode == 1; } void setCrazyDash() { field_0xa48 |= 4; } void setCrazyCatch() { field_0xa48 |= 2; } void setCrazyThrowLeft() { field_0xa48 |= 8; } @@ -158,10 +158,12 @@ class daObj_GrA_c : public fopAc_ac_c { static u8 mFaceMotionList[168]; private: - /* 0x0568 */ u8 field_0x568[0xA48 - 0x568]; + /* 0x0568 */ u8 field_0x568[0x74c - 0x568]; + /* 0x074C */ request_of_phase_process_class mPhase; + /* 0x0754 */ u8 field_0x754[0xA48 - 0x754]; /* 0x0A48 */ u16 field_0xa48; /* 0x0A4A */ u8 field_0xa4a[0xA7E - 0xA4A]; - /* 0x0A7E */ u8 field_0xa7e; + /* 0x0A7E */ u8 mMode; /* 0x0A7F */ u8 field_0xa7f[0x20a4 - 0xA7F]; }; diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index 5c72216101e..4276a023538 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -4,6 +4,7 @@ */ #include "d/actor/d_a_obj_gra2.h" +#include "d/d_com_inf_game.h" #include "dol2asm.h" #include "d/d_camera.h" @@ -1614,8 +1615,12 @@ SECTION_DEAD static char const* const stringBase_80C0FE46 = "grA_stone_col.dzb"; #pragma pop /* 80C003CC-80C00614 0005AC 0248+00 1/1 0/0 0/0 .text create__11daObj_GrA_cFv */ -void daObj_GrA_c::create() { +cPhs__Step daObj_GrA_c::create() { // NONMATCHING + fopAcM_SetupActor(this, daObj_GrA_c); + + mMode = getMode(); + // cPhs__Step phase = dComIfG_resLoad(&mPhase, ) } /* ############################################################################################## */ @@ -1735,7 +1740,7 @@ SECTION_DEAD static char const* const stringBase_80C0FE58 = "Obj_grA"; #pragma pop /* 80C00D74-80C00DF8 000F54 0084+00 1/1 0/0 0/0 .text getMode__11daObj_GrA_cFv */ -void daObj_GrA_c::getMode() { +u8 daObj_GrA_c::getMode() { // NONMATCHING } From 0116627c006f006bf11e2b91f92cb843807df4d5 Mon Sep 17 00:00:00 2001 From: carter-ktb21 <144170194+carter-ktb21@users.noreply.github.com> Date: Sat, 7 Jun 2025 21:24:02 -0400 Subject: [PATCH 02/21] Initial work --- include/d/actor/d_a_npc.h | 11 +- include/d/actor/d_a_obj_gra2.h | 192 +++++- src/d/actor/d_a_obj_gra2.cpp | 1006 ++++++++++++++++---------------- 3 files changed, 663 insertions(+), 546 deletions(-) diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index faa906644a3..6595637ba80 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -843,9 +843,11 @@ class daBaseNpc_c : public fopAc_ac_c { static dCcD_SrcCyl mCcDCyl; static dCcD_SrcSph mCcDSph; -private: +public: /* 0x56C */ dBgS_ObjAcch mAcch; - /* 0x744 */ u8 field_0x744[0x754 - 0x744]; + /* 0x744 */ char field_0x744; + /* 0x745 */ u8 field_0x745[0x74c - 0x745]; + /* 0x74C */ request_of_phase_process_class mPhase; /* 0x754 */ mDoExt_McaMorfSO* mpModelMorf; /* 0x758 */ Z2Creature mSound; /* 0x7E8 */ u32 mShadowId; @@ -856,7 +858,8 @@ class daBaseNpc_c : public fopAc_ac_c { /* 0x83C */ u16* field_0x83c; /* 0x840 */ u16 field_0x840; /* 0x842 */ u16 field_0x842; - /* 0x844 */ u8 field_0x844[0x848 - 0x844]; + /* 0x844 */ bool field_0x844; + /* 0x845 */ u8 field_0x845[0x848 - 0x845]; /* 0x848 */ s32 field_0x848; /* 0x84C */ dMsgFlow_c mMsgFlow; /* 0x898 */ u8 field_0x898[0x89A - 0x898]; @@ -898,7 +901,7 @@ class daBaseNpc_moveBgActor_c : public daBaseNpc_c { static int m_dzb_id; static MoveBGActor_SetFunc m_set_func; -private: +public: /* 0xA14 */ dBgW* mpBgw; /* 0xA18 */ Mtx mBgMtx; }; diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index c424fc823cc..9142dab4bcb 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -1,6 +1,7 @@ #ifndef D_A_OBJ_GRA2_H #define D_A_OBJ_GRA2_H +#include "d/actor/d_a_npc.h" #include "f_op/f_op_actor_mng.h" /** @@ -11,29 +12,100 @@ * @details * */ -class daObj_GrA_c : public fopAc_ac_c { + +class daObj_GrA_Param_c { +public: + /* 80C04B1C */ ~daObj_GrA_Param_c(); + + struct Data { + /* 0x00 */ f32 field_0x00; + /* 0x04 */ f32 field_0x04; + /* 0x08 */ f32 field_0x08; + /* 0x0C */ f32 field_0x0c; + /* 0x10 */ s16 field_0x10; + /* 0x12 */ s16 field_0x12; + /* 0x14 */ f32 field_0x14; + /* 0x18 */ f32 field_0x18; + /* 0x1C */ f32 field_0x1c; + /* 0x20 */ f32 field_0x20; + /* 0x24 */ f32 field_0x24; + /* 0x28 */ f32 field_0x28; + /* 0x2C */ f32 field_0x2c; + /* 0x30 */ f32 field_0x30; + /* 0x34 */ f32 field_0x34; + /* 0x38 */ f32 field_0x38; + /* 0x3C */ f32 field_0x3c; + /* 0x40 */ f32 field_0x40; + /* 0x44 */ f32 field_0x44; + /* 0x48 */ f32 field_0x48; + /* 0x4C */ f32 field_0x4c; + /* 0x50 */ f32 field_0x50; + /* 0x54 */ s16 field_0x54; + /* 0x56 */ s16 field_0x56; + /* 0x58 */ s16 field_0x58; + /* 0x5A */ s16 field_0x5a; + /* 0x5C */ s16 field_0x5c; + /* 0x5E */ s16 field_0x5e; + /* 0x60 */ f32 field_0x60; + /* 0x64 */ f32 field_0x64; + /* 0x68 */ s16 field_0x68; + /* 0x6A */ s16 field_0x6a; + /* 0x6C */ f32 field_0x6c; + /* 0x70 */ f32 field_0x70; + /* 0x74 */ f32 field_0x74; + /* 0x78 */ f32 field_0x78; + /* 0x7C */ f32 field_0x7c; + /* 0x80 */ f32 field_0x80; + /* 0x84 */ f32 field_0x84; + /* 0x88 */ s16 field_0x88; + /* 0x8A */ s16 field_0x8a; + /* 0x8C */ f32 field_0x8c; + /* 0x90 */ f32 field_0x90; + /* 0x94 */ f32 field_0x94; + /* 0x98 */ s16 field_0x98; + /* 0x9A */ s16 field_0x9a; + /* 0x9C */ f32 field_0x9c; + /* 0xA0 */ f32 field_0xa0; + /* 0xA4 */ s16 field_0xa4; + /* 0xA6 */ s16 field_0xa6; + /* 0xA8 */ f32 field_0xa8; + /* 0xAC */ s16 field_0xac; + /* 0xAE */ s16 field_0xae; + /* 0xB0 */ s16 field_0xb0; + /* 0xB2 */ s16 field_0xb2; + /* 0xB4 */ s16 field_0xb4; + /* 0xB6 */ s16 field_0xb6; + /* 0xB8 */ f32 field_0xb8; + /* 0xBC */ f32 field_0xbc; + }; + static const Data m; +}; + + class daObj_GrA_c : public daBaseNpc_moveBgActor_c { public: class daObj_GrA_prtclMngr_c { public: /* 80C04E14 */ ~daObj_GrA_prtclMngr_c(); /* 80C04E50 */ daObj_GrA_prtclMngr_c(); + + /* 0x00 */ u8 field_0x0[0x5c - 0x0]; }; - /* 80BFFF58 */ void rideCallBack(dBgW*, fopAc_ac_c*, fopAc_ac_c*); + /* 80BFFF58 */ static void rideCallBack(dBgW*, fopAc_ac_c*, fopAc_ac_c*); /* 80BFFF70 */ daObj_GrA_c(); /* 80C0011C */ ~daObj_GrA_c(); /* 80C003CC */ cPhs__Step create(); - /* 80C00614 */ void CreateHeap(); - /* 80C00790 */ void Delete(); - /* 80C00804 */ void Execute(f32 (**)[3][4]); - /* 80C00A44 */ void Draw(); - /* 80C00ACC */ void jointCtrl(J3DJoint*, J3DModel*); - /* 80C00D5C */ void getResName(); + /* 80C00614 */ int CreateHeap(); + /* 80C00790 */ int Delete(); + /* 80C00804 */ int Execute(Mtx**); + /* 80C00A44 */ int Draw(); + /* 80C00ACC */ int jointCtrl(J3DJoint*, J3DModel*); + /* 80C00D5C */ const char* getResName(); /* 80C00D74 */ u8 getMode(); - /* 80C00DF8 */ void getPathNo(); - /* 80C00E04 */ void getTagNo(); - /* 80C00E10 */ void getJumpType(); - /* 80C00E1C */ void isDelete(); + /* 80C00DF8 */ u32 getPathNo(); + /* 80C00E04 */ u32 getTagNo(); + /* 80C00E10 */ u32 getJumpType(); + /* 80C00E1C */ BOOL isDelete(); /* 80C00EFC */ void restart(); /* 80C010D4 */ void init(); /* 80C013B0 */ void setBaseAnm(int, f32); @@ -43,7 +115,7 @@ class daObj_GrA_c : public fopAc_ac_c { /* 80C017AC */ void setFaceMotion(int, f32); /* 80C017F0 */ void calcMotion(); /* 80C018C0 */ void checkProcess(int (daObj_GrA_c::*)(void*)); - /* 80C018F4 */ void setProcess(int (daObj_GrA_c::*)(void*)); + /* 80C018F4 */ int setProcess(int (daObj_GrA_c::*)(void*)); /* 80C019B8 */ void setParam(); /* 80C01C18 */ void checkEvent(); /* 80C01D7C */ void mainProc(); @@ -57,7 +129,7 @@ class daObj_GrA_c : public fopAc_ac_c { /* 80C02AD4 */ void setLookMode(int); /* 80C02AE8 */ void lookat(); /* 80C0308C */ void hitChk(); - /* 80C031E4 */ void wait(void*); + /* 80C031E4 */ int wait(void*); /* 80C0335C */ void talk(void*); /* 80C035B8 */ void ctrlMsgAnm(int&, int&, fopAc_ac_c*); /* 80C03720 */ void checkTagGraSub(fopAc_ac_c*); @@ -157,23 +229,91 @@ class daObj_GrA_c : public fopAc_ac_c { static u8 mBaseMotionList[264]; static u8 mFaceMotionList[168]; + bool isFirstGra() { return field_0x1fe8 == 0; } + private: - /* 0x0568 */ u8 field_0x568[0x74c - 0x568]; - /* 0x074C */ request_of_phase_process_class mPhase; - /* 0x0754 */ u8 field_0x754[0xA48 - 0x754]; /* 0x0A48 */ u16 field_0xa48; - /* 0x0A4A */ u8 field_0xa4a[0xA7E - 0xA4A]; + /* 0x0A4A */ u8 field_0xa4a[0xa4c - 0xa4a]; + /* 0x0A4C */ daObj_GrA_Param_c* field_0xa4c; + /* 0x0A50 */ u8 field_0xa50[0xa5c - 0xa50]; + /* 0x0A5C */ request_of_phase_process_class* field_0xa5c[8]; + /* 0x0A7C */ u8 field_0xa7c[0xa7e - 0xa7c]; /* 0x0A7E */ u8 mMode; - /* 0x0A7F */ u8 field_0xa7f[0x20a4 - 0xA7F]; + /* 0x0A7F */ u8 field_0xa7f; + /* 0x0A80 */ u8 field_0xa80[0xa8c - 0xa80]; + /* 0x0A8C */ u8 field_0xa8c; + /* 0x0A8D */ u8 field_0xa8d[0xa94 - 0xa8d]; + /* 0x0A94 */ f32 field_0xa94; + /* 0x0A98 */ f32 field_0xa98; + /* 0x0A9C */ int field_0xa9c; + /* 0x0AA0 */ int field_0xaa0; + /* 0x0AA4 */ u8 field_0xaa4[0xaac - 0xaa4]; + /* 0x0AAC */ int field_0xaac; + /* 0x0AB0 */ daBaseNpc_acMngr_c field_0xab0; + /* 0x0AB8 */ daObj_GrA_prtclMngr_c field_0xab8[6]; + /* 0x0CE0 */ dCcD_Sph field_0xce0[2]; + /* 0x0F50 */ dCcD_Cyl field_0xf50; + /* 0x108C */ u8 field_0x108c[0x109c - 0x108c]; + /* 0x109C */ int field_0x109c; + /* 0x10A0 */ u8 field_0x10a0[0x10c4 - 0x10a0]; + /* 0x10C4 */ int field_0x10c4; + /* 0x10C8 */ cBgS_GndChk field_0x10c8[5]; + /* 0x11F4 */ dBgS_LinkLinChk field_0x11f4[5]; + /* 0x1424 */ cXyz field_0x1424[5]; + /* 0x1460 */ cXyz field_0x1460[5]; + /* 0x149C */ u8 field_0x149c[0x14b4 - 0x149c]; + /* 0x14B4 */ cXyz field_0x14b4[5]; + /* 0x14F0 */ u8 field_0x14f0[0x14f8 - 0x14f0]; + /* 0x14F8 */ daBaseNpc_acMngr_c field_0x1f48; + /* 0x1500 */ u8 field_0x1500[0x1520 - 0x1500]; + /* 0x1520 */ int field_0x1520; + /* 0x1524 */ u8 field_0x1524[0x1528 - 0x1524]; + /* 0x1528 */ daBaseNpc_path_c field_0x1528; + /* 0x1F4C */ dBgS_LinkLinChk field_0x1f4c; + /* 0x1FBC */ int field_0x1fbc; + /* 0x1FC0 */ u8 field_0x1fc0[0x1fc4 - 0x1fc0]; + /* 0x1FC4 */ u8 field_0x1fc4; + /* 0x1FC5 */ u8 field_0x1fc5[0x1fd8 - 0x1fc5]; + /* 0x1FD8 */ s16 field_0x1fd8; + /* 0x1FDA */ u8 field_0x1fda[0x1fdc - 0x1fda]; + /* 0x1FDC */ int field_0x1fdc; + /* 0x1FE0 */ u8 field_0x1fe0[0x1fe4 - 0x1fe0]; + /* 0x1FE4 */ int field_0x1fe4; + /* 0x1FE8 */ u8 field_0x1fe8; + /* 0x1FE9 */ u8 field_0x1fe9; + /* 0x1FEA */ u8 field_0x1fea[0x1fec - 0x1fea]; + /* 0x1FEC */ int field_0x1fec; + /* 0x1FF0 */ int field_0x1ff0; + /* 0x1FF4 */ u8 field_0x1ff4; + /* 0x1FF5 */ u8 field_0x1ff5[0x2000 - 0x1ff5]; + /* 0x2000 */ int field_0x2000; + /* 0x2004 */ u8 field_0x2004; + /* 0x2005 */ u8 field_0x2005; + /* 0x2006 */ u8 field_0x2006[0x2008 - 0x2006]; + /* 0x2008 */ f32 field_0x2008; + /* 0x200C */ u16 field_0x200c; + /* 0x200E */ u8 field_0x200e[0x2014 - 0x200e]; + /* 0x2014 */ u8 field_0x2014; + /* 0x2015 */ u8 field_0x2015[0x201c - 0x2015]; + /* 0x201C */ u8 field_0x201c; + /* 0x201D */ u8 field_0x201d; + /* 0x201E */ u8 field_0x201e[0x2020 - 0x201e]; + /* 0x2020 */ int field_0x2020[3]; + /* 0x202C */ u8 field_0x202c[0x2030 - 0x202c]; + /* 0x2030 */ u8 field_0x2030; + /* 0x2031 */ u8 field_0x2031; + /* 0x2032 */ u8 field_0x2032; + /* 0x2033 */ u8 field_0x2033[0x2048 - 0x2033]; + /* 0x2048 */ s16 field_0x2048; + /* 0x204A */ u8 field_0x204a[0x204c - 0x204a]; + /* 0x204C */ daBaseNpc_acMngr_c field_0x204c; + /* 0x2054 */ s16 field_0x2054; + /* 0x2056 */ s16 field_0x2056; + /* 0x2058 */ u8 field_0x2058[0x209c - 0x2058]; + /* 0x209C */ int field_0x209c; + /* 0x20A0 */ u8 field_0x20a0[0x20a4 - 0x20a0]; }; STATIC_ASSERT(sizeof(daObj_GrA_c) == 0x20a4); -class daObj_GrA_Param_c { -public: - /* 80C04B1C */ ~daObj_GrA_Param_c(); - - static u8 const m[192]; -}; - #endif /* D_A_OBJ_GRA2_H */ diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index 4276a023538..c3133b70519 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -4,8 +4,11 @@ */ #include "d/actor/d_a_obj_gra2.h" +#include "Z2AudioLib/Z2Instances.h" +#include "d/d_bg_w.h" #include "d/d_com_inf_game.h" #include "dol2asm.h" +// #include "d_resorce.h" #include "d/d_camera.h" // @@ -384,180 +387,118 @@ extern "C" extern void* __vt__12cCcD_SphAttr[25]; extern "C" extern void* __vt__12cCcD_CylAttr[25]; extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; extern "C" u8 mCurrentMtx__6J3DSys[48]; extern "C" u8 sincosTable___5JMath[65536]; extern "C" extern u8 g_dComIfGoat_gameInfo[4 + 4 /* padding */]; extern "C" void __register_global_object(); -// -// Declarations: -// - /* 80BFFF0C-80BFFF58 0000EC 004C+00 2/2 0/0 0/0 .text jointCtrlCallBack__FP8J3DJointi */ -static void jointCtrlCallBack(J3DJoint* param_0, int param_1) { +static int jointCtrlCallBack(J3DJoint* i_joint, int param_2) { // NONMATCHING } -/* 80BFFF58-80BFFF70 000138 0018+00 1/1 0/0 0/0 .text - * rideCallBack__11daObj_GrA_cFP4dBgWP10fopAc_ac_cP10fopAc_ac_c */ -void daObj_GrA_c::rideCallBack(dBgW* param_0, fopAc_ac_c* param_1, fopAc_ac_c* param_2) { - // NONMATCHING +/* 80BFFF58-80BFFF70 000138 0018+00 1/1 0/0 0/0 .text rideCallBack__11daObj_GrA_cFP4dBgWP10fopAc_ac_cP10fopAc_ac_c */ +void daObj_GrA_c::rideCallBack(dBgW* param_1, fopAc_ac_c* aActor_p, fopAc_ac_c* param_3) { + ((daObj_GrA_c*)aActor_p)->field_0x10c4 = fopAcM_GetProfName(param_3) == PROC_ALINK; } -/* ############################################################################################## */ -/* 80C0FE14-80C0FE14 000398 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C0FE14 = "grA"; -SECTION_DEAD static char const* const stringBase_80C0FE18 = "grA_base"; -SECTION_DEAD static char const* const stringBase_80C0FE21 = "grA_mdl"; -SECTION_DEAD static char const* const stringBase_80C0FE29 = "grA_demo"; -SECTION_DEAD static char const* const stringBase_80C0FE32 = "grA_Look"; -SECTION_DEAD static char const* const stringBase_80C0FE3B = "GRA_THROWN"; -#pragma pop - -/* 80C0FE68-80C0FE74 000000 000C+00 9/9 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80C0FE74-80C0FE88 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ -#pragma push -#pragma force_active on -SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { - 0x02000201, - /* padding */ - 0x40080000, - 0x00000000, - 0x3FE00000, - 0x00000000, -}; -#pragma pop +UNK_REL_DATA; /* 80C0FE88-80C0FE98 -00001 0010+00 1/1 0/0 0/0 .data l_resFileNameList */ -SECTION_DATA static void* l_resFileNameList[4] = { - (void*)&d_a_obj_gra2__stringBase0, - (void*)&d_a_obj_gra2__stringBase0, - (void*)&d_a_obj_gra2__stringBase0, - (void*)&d_a_obj_gra2__stringBase0, +static char* l_resFileNameList[4] = { + "grA", + "grA", + "grA", + "grA", }; /* 80C0FE98-80C0FEA8 000030 0010+00 1/0 0/0 0/0 .data l_exLoadRes_GRAa */ -SECTION_DATA static u8 l_exLoadRes_GRAa[16] = { - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +static int l_exLoadRes_GRAa[4] = { + 1, 2, -1, -1, }; /* 80C0FEA8-80C0FEB8 000040 0010+00 1/0 0/0 0/0 .data l_exLoadRes_GRA_jump */ -SECTION_DATA static u8 l_exLoadRes_GRA_jump[16] = { - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, +static int l_exLoadRes_GRA_jump[4] = { + 1, 2, 4, -1, }; /* 80C0FEB8-80C0FEC8 000050 0010+00 1/0 0/0 0/0 .data l_exLoadRes_GRA_demo */ -SECTION_DATA static u8 l_exLoadRes_GRA_demo[16] = { - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, +static int l_exLoadRes_GRA_demo[4] = { + 1, 2, 3, -1, }; /* 80C0FEC8-80C0FED8 -00001 0010+00 2/2 0/0 0/0 .data l_exloadRes_list */ -SECTION_DATA static void* l_exloadRes_list[4] = { - (void*)&l_exLoadRes_GRAa, - (void*)&l_exLoadRes_GRA_jump, - (void*)&l_exLoadRes_GRAa, - (void*)&l_exLoadRes_GRA_demo, +static int* l_exloadRes_list[4] = { + l_exLoadRes_GRAa, + l_exLoadRes_GRA_jump, + l_exLoadRes_GRAa, + l_exLoadRes_GRA_demo, }; /* 80C0FED8-80C0FEEC -00001 0014+00 5/6 0/0 0/0 .data l_resNames */ -SECTION_DATA static void* l_resNames[5] = { - (void*)&d_a_obj_gra2__stringBase0, - (void*)(((char*)&d_a_obj_gra2__stringBase0) + 0x4), - (void*)(((char*)&d_a_obj_gra2__stringBase0) + 0xD), - (void*)(((char*)&d_a_obj_gra2__stringBase0) + 0x15), - (void*)(((char*)&d_a_obj_gra2__stringBase0) + 0x1E), +static char* l_resNames[5] = { + "grA", + "grA_base", + "grA_mdl", + "grA_demo", + "grA_Look", }; /* 80C0FEEC-80C0FEF4 000084 0008+00 0/1 0/0 0/0 .data l_bmdGetParamList */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 l_bmdGetParamList[8] = { - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, +static int l_bmdGetParamList[2] = { + 3, 2, }; -#pragma pop /* 80C0FEF4-80C1000C 00008C 0118+00 2/2 0/0 0/0 .data l_bckGetParamList */ -SECTION_DATA static u8 l_bckGetParamList[280] = { - 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, +static int l_bckGetParamList[70] = { + 21, 1, 18, 0, + 22, 1, 11, 0, + 18, 1, 19, 1, + 16, 0, -1, 0, + 15, 1, 16, 1, + 6, 0, 12, 0, + 13, 0, 14, 0, + 17, 0, 3, 3, + 5, 3, 15, 0, + 6, 3, 17, 1, + 20, 1, 3, 4, + 14, 1, 10, 0, + 9, 1, 7, 1, + 8, 0, 12, 1, + 13, 1, 10, 1, + 8, 1, 11, 1, + 6, 0, 4, 3, + 9, 0, }; /* 80C1000C-80C1002C 0001A4 0020+00 1/1 0/0 0/0 .data l_btpGetParamList */ -SECTION_DATA static u8 l_btpGetParamList[32] = { - 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, +static int l_btpGetParamList[8] = { + 28, 1, 32, 1, + 31, 1, 21, 0, }; /* 80C1002C-80C10044 0001C4 0016+02 1/2 0/0 0/0 .data l_eventMotionChangeTable */ -SECTION_DATA static u8 l_eventMotionChangeTable[22 + 2 /* padding */] = { - 0x00, - 0x00, - 0x00, - 0x01, - 0x00, - 0x00, - 0x00, - 0x02, - 0x00, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, +static s16 l_eventMotionChangeTable[11] = { + 0, 1, 0, 2, + 3, 0, 0, 0, + 0, 0, 0, }; /* 80C10044-80C1004C 0001DC 0008+00 1/2 0/0 0/0 .data l_eventFaceChangeTable */ -SECTION_DATA static u8 l_eventFaceChangeTable[8] = { - 0x00, 0x01, 0x00, 0x02, 0x00, 0x06, 0x00, 0x07, +static s16 l_eventFaceChangeTable[4] = { + 1, 2, 6, 7, }; /* 80C1004C-80C10054 -00001 0008+00 1/1 0/0 0/0 .data l_evtNameList */ -SECTION_DATA static void* l_evtNameList[2] = { - (void*)NULL, - (void*)(((char*)&d_a_obj_gra2__stringBase0) + 0x27), +static char* l_evtNameList[2] = { + NULL, + "GRA_THROWN", }; /* 80C10054-80C1005C 0001EC 0008+00 0/1 0/0 0/0 .data l_entryJntNoList */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 l_entryJntNoList[8] = { - 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0xFF, 0xFF, +static u16 l_entryJntNoList[4] = { + 5, 6, 7, -1, }; -#pragma pop /* 80C1005C-80C10068 -00001 000C+00 1/1 0/0 0/0 .data @4591 */ SECTION_DATA static void* lit_4591[3] = { @@ -1477,33 +1418,6 @@ SECTION_DATA u8 daObj_GrA_c::mFaceMotionList[168] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -/* 80C10734-80C10754 -00001 0020+00 1/0 0/0 0/0 .data daObj_GrA_MethodTable */ -static actor_method_class daObj_GrA_MethodTable = { - (process_method_func)daObj_GrA_Create__FPv, - (process_method_func)daObj_GrA_Delete__FPv, - (process_method_func)daObj_GrA_Execute__FPv, - (process_method_func)daObj_GrA_IsDelete__FPv, - (process_method_func)daObj_GrA_Draw__FPv, -}; - -/* 80C10754-80C10784 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_GRA */ -extern actor_process_profile_definition g_profile_OBJ_GRA = { - fpcLy_CURRENT_e, // mLayerID - 3, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_OBJ_GRA, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(daObj_GrA_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 19, // mPriority - &daObj_GrA_MethodTable, // sub_method - 0x00040100, // mStatus - fopAc_NPC_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - /* 80C10784-80C107E8 00091C 0064+00 2/2 0/0 0/0 .data __vt__11daObj_GrA_c */ SECTION_DATA extern void* __vt__11daObj_GrA_c[25] = { (void*)NULL /* RTTI */, @@ -1605,14 +1519,21 @@ daObj_GrA_c::daObj_GrA_c() { /* 80C0011C-80C003CC 0002FC 02B0+00 1/0 0/0 0/0 .text __dt__11daObj_GrA_cFv */ daObj_GrA_c::~daObj_GrA_c() { // NONMATCHING -} + dComIfG_resDelete(&mPhase, getResName()); + for (int i = 0; *l_exloadRes_list[mMode + i] >= 0; i++) { + dComIfG_resDelete(field_0xa5c[i], l_resNames[*l_exloadRes_list[mMode + i]]); + } -/* ############################################################################################## */ -/* 80C0FE14-80C0FE14 000398 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C0FE46 = "grA_stone_col.dzb"; -#pragma pop + if (heap != NULL) { + mpModelMorf->stopZelAnime(); + } + + if (mpBgw != NULL && mpBgw->ChkUsed()) { + if (dComIfG_Bgsp().Release(mpBgw)) { + OS_REPORT("Release Error\n"); + } + } +} /* 80C003CC-80C00614 0005AC 0248+00 1/1 0/0 0/0 .text create__11daObj_GrA_cFv */ cPhs__Step daObj_GrA_c::create() { @@ -1620,26 +1541,122 @@ cPhs__Step daObj_GrA_c::create() { fopAcM_SetupActor(this, daObj_GrA_c); mMode = getMode(); - // cPhs__Step phase = dComIfG_resLoad(&mPhase, ) + cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, getResName()); + if (phase == cPhs_ERROR_e || phase == cPhs_UNK3_e) { + return cPhs_ERROR_e; + } + + int uVar1; + if (phase == cPhs_COMPLEATE_e) { + uVar1 = 1; + } + + int i = 0; + for (; *l_exloadRes_list[mMode] >= 0; i++) { + phase = (cPhs__Step)dComIfG_resLoad(field_0xa5c[i], l_resNames[*l_exloadRes_list[mMode]]); + if (phase == cPhs_ERROR_e || phase == cPhs_UNK3_e) { + return cPhs_ERROR_e; + } + + if (phase == cPhs_COMPLEATE_e) { + uVar1++; + } + } + + int iVar1; + if ((int)home.angle.x == 0xFFFF) { + iVar1 = -1; + } else { + iVar1 = home.angle.x; + } + field_0x848 = iVar1; + + field_0x1fe8 = fopAcM_GetParam(this) >> 30; + field_0x200c = (home.angle.z >> 8) & 0x7F; + field_0x2030 = (home.angle.z >> 15) & 1; + + if (uVar1 == (i + 1) && (uVar1 == 3 || uVar1 == 4)) { + if (MoveBGCreate(getResName(), + dComIfG_getObjctResName2Index(getResName(), "grA_stone_col.dzb"), NULL, 0x3B10) == 5) { + return cPhs_ERROR_e; + } + + mpBgw->SetRideCallback(rideCallBack); + if (isDelete()) { + return cPhs_ERROR_e; + } else { + init(); + } + } else { + return cPhs_INIT_e; + } + + return phase; } /* ############################################################################################## */ /* 80C0FA7C-80C0FB3C 000000 00C0+00 54/54 0/0 0/0 .rodata m__17daObj_GrA_Param_c */ -SECTION_RODATA u8 const daObj_GrA_Param_c::m[192] = { - 0x42, 0xAA, 0x00, 0x00, 0xC0, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x41, 0x40, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x43, 0x8C, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00, 0x42, 0xC8, 0x00, 0x00, - 0x43, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xA0, 0x00, 0x00, - 0xC1, 0xA0, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00, - 0xC2, 0x20, 0x00, 0x00, 0x3E, 0xCC, 0xCC, 0xCD, 0x42, 0xAA, 0x00, 0x00, 0x42, 0xAA, 0x00, 0x00, - 0x42, 0x48, 0x00, 0x00, 0x00, 0x03, 0x00, 0x10, 0x00, 0x3C, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, - 0x43, 0x0C, 0x00, 0x00, 0x43, 0x16, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x42, 0xC8, 0x00, 0x00, - 0x41, 0x70, 0x00, 0x00, 0x41, 0xA0, 0x00, 0x00, 0x44, 0x7A, 0x00, 0x00, 0x45, 0x3B, 0x80, 0x00, - 0x41, 0x70, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x42, 0x34, 0x00, 0x00, - 0x41, 0x20, 0x00, 0x00, 0x43, 0x66, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x41, 0xC8, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x0A, - 0x00, 0x1E, 0x00, 0x28, 0x00, 0x14, 0x00, 0x00, 0x42, 0x70, 0x00, 0x00, 0x41, 0xF0, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FA7C, &daObj_GrA_Param_c::m); +daObj_GrA_Param_c::Data const daObj_GrA_Param_c::m = { + 85.0f, + -4.0f, + 1.0f, + 12.0f, + 1, + 0, + 280.0f, + 40.0f, + 100.0f, + 255.0f, + 0.0f, + 0.0f, + 20.0f, + -20.0f, + 40.0f, + 0.0f, + 40.0f, + -40.0f, + 0.4f, + 85.0f, + 85.0f, + 50.0f, + 3, + 16, + 60, + 4, + 30, + 0, + 140.0f, + 150.0f, + 100, + 0, + 100.0f, + 15.0f, + 20.0f, + 1000.0f, + 3000.0f, + 15.0f, + 40.0f, + 2048, + 0, + 45.0f, + 10.0f, + 230.0f, + 60, + 1, + 0.0f, + 25.0f, + 100, + 0, + 0.5f, + 10, + 10, + 30, + 40, + 20, + 0, + 60.0f, + 30.0f, +}; /* 80C0FB3C-80C0FB8C 0000C0 0050+00 0/0 0/0 0/0 .rodata l_bgcParam */ #pragma push @@ -1663,210 +1680,305 @@ SECTION_RODATA static u8 const l_dirToAngleTBL[8] = { COMPILER_STRIP_GATE(0x80C0FB8C, &l_dirToAngleTBL); #pragma pop -/* 80C0FB94-80C0FB98 000118 0004+00 4/18 0/0 0/0 .rodata @4332 */ -SECTION_RODATA static f32 const lit_4332 = 1.0f; -COMPILER_STRIP_GATE(0x80C0FB94, &lit_4332); - -/* 80C0FB98-80C0FB9C 00011C 0004+00 13/45 0/0 0/0 .rodata @4333 */ -SECTION_RODATA static u8 const lit_4333[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FB98, &lit_4333); - /* 80C00614-80C00790 0007F4 017C+00 1/0 0/0 0/0 .text CreateHeap__11daObj_GrA_cFv */ -void daObj_GrA_c::CreateHeap() { - // NONMATCHING +int daObj_GrA_c::CreateHeap() { + field_0x844 = dKy_darkworld_check(); + + J3DModelData* aMdlData_p = (J3DModelData*)dComIfG_getObjectRes(l_resNames[l_bmdGetParamList[1]], l_bmdGetParamList[0]); + JUT_ASSERT(854, 0 != aMdlData_p); + mpModelMorf = new mDoExt_McaMorfSO(aMdlData_p, NULL, NULL, NULL, -1, 1.0f, 0, -1, &mSound, 0x80000, 0x11020284); + if (mpModelMorf != NULL && mpModelMorf->getModel() == NULL) { + mpModelMorf->stopZelAnime(); + mpModelMorf = NULL; + } + + if (mpModelMorf == NULL) { + return 0; + } + + J3DModel* aMdl_p = mpModelMorf->getModel(); + for (u16 i = 0; i < aMdlData_p->getJointNum(); i++) { + aMdlData_p->getJointNodePointer(i)->setCallBack(jointCtrlCallBack); + } + aMdl_p->setUserArea((u32)this); + + field_0x83c = l_entryJntNoList; + setFaceAnm(22, false, 0.0f); + setBaseAnm(17, 0.0f); + + return 1; } /* 80C00790-80C00804 000970 0074+00 1/0 0/0 0/0 .text Delete__11daObj_GrA_cFv */ -void daObj_GrA_c::Delete() { - // NONMATCHING +int daObj_GrA_c::Delete() { + if (dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StopQuake(31); + } + this->~daObj_GrA_c(); + return 1; } -/* ############################################################################################## */ -/* 80C0FB9C-80C0FBA0 000120 0004+00 2/2 0/0 0/0 .rodata @4399 */ -SECTION_RODATA static f32 const lit_4399 = -1000000000.0f; -COMPILER_STRIP_GATE(0x80C0FB9C, &lit_4399); - /* 80C00804-80C00A44 0009E4 0240+00 1/0 0/0 0/0 .text Execute__11daObj_GrA_cFPPA3_A4_f */ -void daObj_GrA_c::Execute(f32 (**param_0)[3][4]) { - // NONMATCHING +int daObj_GrA_c::Execute(Mtx** param_1) { + int rv = 1; + *param_1 = &mBgMtx; + setParam(); + mainProc(); + + if (field_0x109c == 0) { + fopAcM_posMoveF(this, mCcStts.GetCCMoveP()); + mAcch.CrrPos(dComIfG_Bgsp()); + field_0x9d4 = mAcch.m_gnd; + mGroundY = mAcch.GetGroundH(); + + if (mMode == 0 && !mAcch.ChkGroundHit()) { + current.pos = old.pos; + } + } + + if (mGroundY != -1000000000.0f) { + setEnvTevColor(); + setRoomNo(); + } + + allAnmPlay(); + adjustShapeAngle(); + setMtx(0); + setCollisions(); + setAttnPos(); + setPrtcl(); + + if (mpBgw != NULL && field_0x1fbc != field_0x109c) { + field_0x1fbc = field_0x109c; + if (field_0x1fbc != 0) { + if (dComIfG_Bgsp().Regist(mpBgw, this)) { + rv = 0; + } + } else if (dComIfG_Bgsp().Release(mpBgw)) { + rv = 0; + } + } + + return rv; } -/* ############################################################################################## */ -/* 80C0FBA0-80C0FBA4 000124 0004+00 1/2 0/0 0/0 .rodata @4409 */ -SECTION_RODATA static f32 const lit_4409 = 800.0f; -COMPILER_STRIP_GATE(0x80C0FBA0, &lit_4409); - -/* 80C0FBA4-80C0FBAC 000128 0004+04 1/1 0/0 0/0 .rodata @4410 */ -SECTION_RODATA static f32 const lit_4410[1 + 1 /* padding */] = { - 900.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x80C0FBA4, &lit_4410); - /* 80C00A44-80C00ACC 000C24 0088+00 1/0 0/0 0/0 .text Draw__11daObj_GrA_cFv */ -void daObj_GrA_c::Draw() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80C0FBAC-80C0FBB4 000130 0008+00 5/14 0/0 0/0 .rodata @4501 */ -SECTION_RODATA static u8 const lit_4501[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FBAC, &lit_4501); - -/* 80C00ACC-80C00D5C 000CAC 0290+00 1/1 0/0 0/0 .text - * jointCtrl__11daObj_GrA_cFP8J3DJointP8J3DModel */ -void daObj_GrA_c::jointCtrl(J3DJoint* param_0, J3DModel* param_1) { - // NONMATCHING +int daObj_GrA_c::Draw() { + f32 fVar1 = 800.0f; + if (mMode == 3) { + fVar1 = 900.0f; + } + + if (field_0x844 == 0 || dComIfGs_wolfeye_effect_check()) { + draw(fVar1); + } + + return 1; +} + +/* 80C00ACC-80C00D5C 000CAC 0290+00 1/1 0/0 0/0 .text jointCtrl__11daObj_GrA_cFP8J3DJointP8J3DModel */ +int daObj_GrA_c::jointCtrl(J3DJoint* i_joint, J3DModel* param_2) { + // NONMATCHING + Mtx MStack_78, MStack_a8; + int jointNo = i_joint->getJntNo(); + cXyz spb4; + MtxP anmMtx = param_2->getAnmMtx(jointNo); + mDoMtx_stack_c::copy(anmMtx); + + if (jointNo != 2) { + switch (jointNo) { + case 1: + case 3: + case 4: + anmMtx = mDoMtx_stack_c::get(); + cMtx_copy(anmMtx, MStack_78); + spb4.set(MStack_78[0][3], MStack_78[1][3], MStack_78[2][3]); + MStack_78[2][3] = 0.0f; + MStack_78[1][3] = 0.0f; + MStack_78[0][3] = 0.0f; + mDoMtx_stack_c::ZXYrotS(shape_angle); + field_0x9c2.x = field_0x9c8.x * daObj_GrA_Param_c::m.field_0x44; + field_0x9c2.y = field_0x9c8.y * daObj_GrA_Param_c::m.field_0x44; + field_0x9c2.z = field_0x9c8.z * daObj_GrA_Param_c::m.field_0x44; + + switch (jointNo) { + case 1: + break; + + case 3: + mDoMtx_stack_c::ZXYrotM(field_0x9bc); + break; + + case 4: + mDoMtx_stack_c::ZXYrotM(field_0x9c2); + } + + mDoMtx_stack_c::inverse(); + cMtx_copy(mDoMtx_stack_c::get(), MStack_a8); + mDoMtx_stack_c::transS(spb4); + mDoMtx_stack_c::ZXYrotM(field_0x91a); + + switch (jointNo) { + case 1: + mDoMtx_stack_c::ZXYrotM(field_0x9bc); + break; + + case 3: + mDoMtx_stack_c::ZXYrotM(field_0x9c2); + break; + + case 4: + mDoMtx_stack_c::ZXYrotM(field_0x9c8); + break; + } + + mDoMtx_stack_c::concat(MStack_a8); + mDoMtx_stack_c::concat(MStack_78); + } + } + + param_2->setAnmMtx(jointNo, mDoMtx_stack_c::get()); + cMtx_copy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx); + if ((jointNo == 4 || jointNo == 7) && cLib_checkBit(field_0x840, 0x20)) { + J3DAnmTransform* anm = mBck.getBckAnm(); + mBck.changeBckOnly(mpModelMorf->getAnm()); + mpModelMorf->changeAnm(anm); + } + + return 1; } /* 80C00D5C-80C00D74 000F3C 0018+00 1/0 0/0 0/0 .text getResName__11daObj_GrA_cFv */ -void daObj_GrA_c::getResName() { - // NONMATCHING +const char* daObj_GrA_c::getResName() { + return l_resFileNameList[mMode]; } -/* ############################################################################################## */ -/* 80C0FE14-80C0FE14 000398 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C0FE58 = "Obj_grA"; -#pragma pop - /* 80C00D74-80C00DF8 000F54 0084+00 1/1 0/0 0/0 .text getMode__11daObj_GrA_cFv */ u8 daObj_GrA_c::getMode() { - // NONMATCHING + u32 uVar1 = fopAcM_GetParam(this) >> 28 & 3; + strcpy(&field_0x744, "Obj_grA"); + + switch (uVar1) { + case 1: + return 1; + + case 2: + return 2; + + case 3: + return 3; + + case 0: + default: + return 0; + } } /* 80C00DF8-80C00E04 000FD8 000C+00 1/1 0/0 0/0 .text getPathNo__11daObj_GrA_cFv */ -void daObj_GrA_c::getPathNo() { - // NONMATCHING +u32 daObj_GrA_c::getPathNo() { + return fopAcM_GetParam(this) >> 20 & 0xFF; } /* 80C00E04-80C00E10 000FE4 000C+00 4/4 0/0 0/0 .text getTagNo__11daObj_GrA_cFv */ -void daObj_GrA_c::getTagNo() { - // NONMATCHING +u32 daObj_GrA_c::getTagNo() { + return fopAcM_GetParam(this) >> 7 & 0x7F; } /* 80C00E10-80C00E1C 000FF0 000C+00 1/1 0/0 0/0 .text getJumpType__11daObj_GrA_cFv */ -void daObj_GrA_c::getJumpType() { - // NONMATCHING +u32 daObj_GrA_c::getJumpType() { + return fopAcM_GetParam(this) >> 7 & 0x7F; } /* 80C00E1C-80C00EFC 000FFC 00E0+00 1/1 0/0 0/0 .text isDelete__11daObj_GrA_cFv */ -void daObj_GrA_c::isDelete() { - // NONMATCHING +BOOL daObj_GrA_c::isDelete() { + // NONMATCHING + if (mMode == 3) { + if (!dComIfGs_isSwitch(field_0xa7f, fopAcM_GetRoomNo(this))) { + return FALSE; + } + } else if (mMode == 2) { + if (!isFirstGra() || !daNpcF_chkEvtBit(0x52)) { + if (daPy_getPlayerActorClass() != NULL) { + if (daPy_getPlayerActorClass()->current.pos.y < current.pos.y) { + return FALSE; + } + } else { + return FALSE; + } + } + } else { + if (mMode == 1) { + if (daNpcF_chkEvtBit(0x40)) { + return FALSE; + } + } else { + return FALSE; + } + } + + return TRUE; } -/* ############################################################################################## */ -/* 80C0FBB4-80C0FBB8 000138 0004+00 8/19 0/0 0/0 .rodata @4618 */ -SECTION_RODATA static f32 const lit_4618 = -1.0f; -COMPILER_STRIP_GATE(0x80C0FBB4, &lit_4618); - /* 80C00EFC-80C010D4 0010DC 01D8+00 1/1 0/0 0/0 .text restart__11daObj_GrA_cFv */ void daObj_GrA_c::restart() { // NONMATCHING -} - -/* ############################################################################################## */ -/* 80C108A0-80C108A4 000008 0001+03 4/4 0/0 0/0 .bss @1109 */ -static u8 lit_1109[1 + 3 /* padding */]; - -/* 80C108A4-80C108A8 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ -#pragma push -#pragma force_active on -static u8 lit_1107[1 + 3 /* padding */]; -#pragma pop - -/* 80C108A8-80C108AC 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ -#pragma push -#pragma force_active on -static u8 lit_1105[1 + 3 /* padding */]; -#pragma pop - -/* 80C108AC-80C108B0 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ -#pragma push -#pragma force_active on -static u8 lit_1104[1 + 3 /* padding */]; -#pragma pop - -/* 80C108B0-80C108B4 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ -#pragma push -#pragma force_active on -static u8 lit_1099[1 + 3 /* padding */]; -#pragma pop - -/* 80C108B4-80C108B8 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ -#pragma push -#pragma force_active on -static u8 lit_1097[1 + 3 /* padding */]; -#pragma pop - -/* 80C108B8-80C108BC 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ -#pragma push -#pragma force_active on -static u8 lit_1095[1 + 3 /* padding */]; -#pragma pop - -/* 80C108BC-80C108C0 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ -#pragma push -#pragma force_active on -static u8 lit_1094[1 + 3 /* padding */]; -#pragma pop - -/* 80C108C0-80C108C4 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ -#pragma push -#pragma force_active on -static u8 lit_1057[1 + 3 /* padding */]; -#pragma pop - -/* 80C108C4-80C108C8 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ -#pragma push -#pragma force_active on -static u8 lit_1055[1 + 3 /* padding */]; -#pragma pop - -/* 80C108C8-80C108CC 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ -#pragma push -#pragma force_active on -static u8 lit_1053[1 + 3 /* padding */]; -#pragma pop - -/* 80C108CC-80C108D0 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ -#pragma push -#pragma force_active on -static u8 lit_1052[1 + 3 /* padding */]; -#pragma pop - -/* 80C108D0-80C108D4 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ -#pragma push -#pragma force_active on -static u8 lit_1014[1 + 3 /* padding */]; -#pragma pop - -/* 80C108D4-80C108D8 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ -#pragma push -#pragma force_active on -static u8 lit_1012[1 + 3 /* padding */]; -#pragma pop - -/* 80C108D8-80C108DC 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ -#pragma push -#pragma force_active on -static u8 lit_1010[1 + 3 /* padding */]; -#pragma pop - -/* 80C108DC-80C108E0 000044 0001+03 0/0 0/0 0/0 .bss @1009 */ -#pragma push -#pragma force_active on -static u8 lit_1009[1 + 3 /* padding */]; -#pragma pop + current.angle.set(0, home.angle.y, 0); + shape_angle = current.angle; + field_0x91a = current.angle; + speedF = 0.0f; + speed.set(0.0f, 0.0f, 0.0f); + mEvtIdx = -1; + field_0xa9c = -1; + field_0xaa0 = 0; + field_0xa8c = 1; + + if (field_0x844) { + setLookMode(0); + } else { + setLookMode(1); + } + + setProcess(&daObj_GrA_c::wait); + field_0xa94 = 0.0f; + field_0xa98 = 0.0f; + health = daObj_GrA_Param_c::m.field_0x10; + ppMoveInit(); + field_0x1fbc = ~field_0x109c; + field_0xaac = 0; + field_0x1fe9 = 0; + field_0x1fec = 0; + field_0x1fe4 = -1; + field_0x1ff0 = 0; + field_0x1ff4 = 0; + field_0x2000 = -1; + field_0x2054 = 0; + field_0x2056 = 0; + field_0x2004 = 0; + field_0x2005 = 0; + field_0x2008 = 0.0f; + field_0x1fc4 = 0; + field_0x1fd8 = 0; + field_0x2031 = 0; + field_0x1520 = 0; + + for (int i = 0; i < 3; i++) { + field_0x2020[i] = -1; + } + + field_0x201d = 0; + field_0x201c = 0; + field_0x2014 = 0; + field_0x1fdc = 0; + field_0x2032 = 0; + field_0x2048 = 0; + + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(0, -1.0f); + field_0x204c.entry(NULL); + field_0x209c = 0; +} + +UNK_REL_BSS; /* 80C108E0-80C108EC 000048 000C+00 0/1 0/0 0/0 .bss @4026 */ #pragma push @@ -1887,11 +1999,15 @@ static u8 lit_4027[12]; #pragma pop /* 80C10904-80C10908 00006C 0004+00 1/2 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[4]; +static daObj_GrA_Param_c l_HIO; /* 80C010D4-80C013B0 0012B4 02DC+00 1/1 0/0 0/0 .text init__11daObj_GrA_cFv */ void daObj_GrA_c::init() { // NONMATCHING + fopAcM_SetMtx(this, mpModelMorf->getModel()->getBaseTRMtx()); + mSound.init(¤t.pos, &eyePos, 3, 1); + eventInfo.setArchiveName((char*)getResName()); + field_0xa4c = &l_HIO; } /* 80C013B0-80C014F4 001590 0144+00 24/23 0/0 0/0 .text setBaseAnm__11daObj_GrA_cFif */ @@ -1934,7 +2050,7 @@ void daObj_GrA_c::checkProcess(int (daObj_GrA_c::*param_0)(void*)) { /* 80C018F4-80C019A4 001AD4 00B0+00 22/22 0/0 0/0 .text * setProcess__11daObj_GrA_cFM11daObj_GrA_cFPCvPvPv_i */ -void daObj_GrA_c::setProcess(int (daObj_GrA_c::*param_0)(void*)) { +int daObj_GrA_c::setProcess(int (daObj_GrA_c::*param_0)(void*)) { // NONMATCHING } @@ -2572,7 +2688,7 @@ void daObj_GrA_c::hitChk() { } /* 80C031E4-80C0335C 0033C4 0178+00 12/0 0/0 0/0 .text wait__11daObj_GrA_cFPv */ -void daObj_GrA_c::wait(void* param_0) { +int daObj_GrA_c::wait(void* param_0) { // NONMATCHING } @@ -3822,175 +3938,33 @@ static u8 lit_5653[12]; static u8 aVec[48]; #pragma pop -/* 80C10B10-80C10B14 000278 0004+00 0/0 0/0 0/0 .bss - * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ -#pragma push -#pragma force_active on -static u8 data_80C10B10[4]; -#pragma pop - -/* 80C10B14-80C10B18 00027C 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14JASAudioThread> */ -#pragma push -#pragma force_active on -static u8 data_80C10B14[4]; -#pragma pop - -/* 80C10B18-80C10B1C 000280 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ -#pragma push -#pragma force_active on -static u8 data_80C10B18[4]; -#pragma pop - -/* 80C10B1C-80C10B20 000284 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80C10B1C[4]; -#pragma pop - -/* 80C10B20-80C10B24 000288 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B20[4]; -#pragma pop - -/* 80C10B24-80C10B28 00028C 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B24[4]; -#pragma pop - -/* 80C10B28-80C10B2C 000290 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B28[4]; -#pragma pop - -/* 80C10B2C-80C10B30 000294 0004+00 0/0 0/0 0/0 .bss - * sInstance__36JASGlobalInstance<15JAISoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80C10B2C[4]; -#pragma pop - -/* 80C10B30-80C10B34 000298 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80C10B30[4]; -#pragma pop - -/* 80C10B34-80C10B38 00029C 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ -#pragma push -#pragma force_active on -static u8 data_80C10B34[4]; -#pragma pop - -/* 80C10B38-80C10B3C 0002A0 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ -#pragma push -#pragma force_active on -static u8 data_80C10B38[4]; -#pragma pop - -/* 80C10B3C-80C10B40 0002A4 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80C10B3C[4]; -#pragma pop - -/* 80C10B40-80C10B44 0002A8 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ -#pragma push -#pragma force_active on -static u8 data_80C10B40[4]; -#pragma pop - -/* 80C10B44-80C10B48 0002AC 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B44[4]; -#pragma pop - -/* 80C10B48-80C10B4C 0002B0 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAISoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_80C10B48[4]; -#pragma pop - -/* 80C10B4C-80C10B50 0002B4 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13JAUSoundTable> */ -#pragma push -#pragma force_active on -static u8 data_80C10B4C[4]; -#pragma pop - -/* 80C10B50-80C10B54 0002B8 0004+00 0/0 0/0 0/0 .bss - * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ -#pragma push -#pragma force_active on -static u8 data_80C10B50[4]; -#pragma pop - -/* 80C10B54-80C10B58 0002BC 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_80C10B54[4]; -#pragma pop - -/* 80C10B58-80C10B5C 0002C0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B58[4]; -#pragma pop - -/* 80C10B5C-80C10B60 0002C4 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ -#pragma push -#pragma force_active on -static u8 data_80C10B5C[4]; -#pragma pop - -/* 80C10B60-80C10B64 0002C8 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B60[4]; -#pragma pop +AUDIO_INSTANCES; -/* 80C10B64-80C10B68 0002CC 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B64[4]; -#pragma pop - -/* 80C10B68-80C10B6C 0002D0 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B68[4]; -#pragma pop - -/* 80C10B6C-80C10B70 0002D4 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80C10B6C[4]; -#pragma pop +/* 80C0FE14-80C0FE14 000398 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -/* 80C10B70-80C10B74 0002D8 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ -#pragma push -#pragma force_active on -static u8 data_80C10B70[4]; -#pragma pop +/* 80C10734-80C10754 -00001 0020+00 1/0 0/0 0/0 .data daObj_GrA_MethodTable */ +static actor_method_class daObj_GrA_MethodTable = { + (process_method_func)daObj_GrA_Create, + (process_method_func)daObj_GrA_Delete, + (process_method_func)daObj_GrA_Execute, + (process_method_func)daObj_GrA_IsDelete, + (process_method_func)daObj_GrA_Draw, +}; -/* 80C0FE14-80C0FE14 000398 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 80C10754-80C10784 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_GRA */ +extern actor_process_profile_definition g_profile_OBJ_GRA = { + fpcLy_CURRENT_e, // mLayerID + 3, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_OBJ_GRA, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(daObj_GrA_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 19, // mPriority + &daObj_GrA_MethodTable, // sub_method + 0x00040100, // mStatus + fopAc_NPC_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; From 6a81c94427f4544c5889cbbe8aa0486350963ed0 Mon Sep 17 00:00:00 2001 From: carter-ktb21 <144170194+carter-ktb21@users.noreply.github.com> Date: Sun, 8 Jun 2025 13:52:04 -0400 Subject: [PATCH 03/21] Solid work done --- include/d/actor/d_a_npc.h | 10 +- include/d/actor/d_a_obj_gra2.h | 173 ++-- src/d/actor/d_a_npc2.cpp | 8 +- src/d/actor/d_a_obj_gra2.cpp | 1417 +++++++++++++++++--------------- 4 files changed, 878 insertions(+), 730 deletions(-) diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index 6595637ba80..97760db9bc6 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -778,7 +778,7 @@ class daBaseNpc_path_c { static const int MAXNUMCONTROLPNT_e = 64; -private: +public: /* 0x004 */ dPath* mPathInfo; /* 0x008 */ f32 field_0x8; /* 0x00C */ dPnt mCurvePnts[160]; @@ -786,7 +786,9 @@ class daBaseNpc_path_c { /* 0xA0E */ u16 mCurvePntNum; /* 0xA10 */ u16 mIdx; /* 0xA12 */ s8 mDirection; - /* 0xA13 */ u8 field_0xa13[17]; + /* 0xA13 */ u8 field_0xa13[5]; + /* 0xA18 */ int field_0xa18; + /* 0xA1C */ u8 field_0xa1c[8]; }; class daBaseNpc_lookat_c { @@ -814,9 +816,9 @@ class daBaseNpc_c : public fopAc_ac_c { /* 8014E6C8 */ daBaseNpc_c(); /* 8014EE44 */ J3DAnmTransform* getTrnsfrmKeyAnmP(char*, int); /* 8014EE80 */ int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int); - /* 8014EEE4 */ void setBckAnm(J3DAnmTransform*, f32, int, int, int, bool); + /* 8014EEE4 */ int setBckAnm(J3DAnmTransform*, f32, int, int, int, bool); /* 8014EF28 */ J3DAnmTransform* getTexPtrnAnmP(char*, int); - /* 8014EF64 */ void setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int); + /* 8014EF64 */ int setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int); /* 8014EFF4 */ void orderEvent(int, char*); /* 8014F0A0 */ void setEnvTevColor(); /* 8014F0FC */ void setRoomNo(); diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 9142dab4bcb..a146b3564ae 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -19,15 +19,15 @@ class daObj_GrA_Param_c { struct Data { /* 0x00 */ f32 field_0x00; - /* 0x04 */ f32 field_0x04; + /* 0x04 */ f32 mGravity; /* 0x08 */ f32 field_0x08; /* 0x0C */ f32 field_0x0c; /* 0x10 */ s16 field_0x10; /* 0x12 */ s16 field_0x12; /* 0x14 */ f32 field_0x14; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ f32 field_0x1c; - /* 0x20 */ f32 field_0x20; + /* 0x18 */ f32 mWallR; + /* 0x1C */ f32 mWallH; + /* 0x20 */ f32 mWeight; /* 0x24 */ f32 field_0x24; /* 0x28 */ f32 field_0x28; /* 0x2C */ f32 field_0x2c; @@ -81,14 +81,19 @@ class daObj_GrA_Param_c { static const Data m; }; - class daObj_GrA_c : public daBaseNpc_moveBgActor_c { +class daObj_GrA_c : public daBaseNpc_moveBgActor_c { public: + typedef int (daObj_GrA_c::*MotionFunc)(int); + typedef int (daObj_GrA_c::*Process)(void*); + class daObj_GrA_prtclMngr_c { public: /* 80C04E14 */ ~daObj_GrA_prtclMngr_c(); /* 80C04E50 */ daObj_GrA_prtclMngr_c(); - /* 0x00 */ u8 field_0x0[0x5c - 0x0]; + /* 0x00 */ u8 field_0x0[0x24 - 0x0]; + /* 0x24 */ dPaPo_c* field_0x24[6]; + /* 0x3C */ u8 field_0x3c[0x5c - 0x3c]; }; /* 80BFFF58 */ static void rideCallBack(dBgW*, fopAc_ac_c*, fopAc_ac_c*); @@ -102,22 +107,22 @@ class daObj_GrA_Param_c { /* 80C00ACC */ int jointCtrl(J3DJoint*, J3DModel*); /* 80C00D5C */ const char* getResName(); /* 80C00D74 */ u8 getMode(); - /* 80C00DF8 */ u32 getPathNo(); + /* 80C00DF8 */ u8 getPathNo(); /* 80C00E04 */ u32 getTagNo(); /* 80C00E10 */ u32 getJumpType(); /* 80C00E1C */ BOOL isDelete(); /* 80C00EFC */ void restart(); - /* 80C010D4 */ void init(); + /* 80C010D4 */ int init(); /* 80C013B0 */ void setBaseAnm(int, f32); /* 80C014F4 */ void setFaceAnm(int, bool, f32); /* 80C01698 */ void setFaceBtp(int); /* 80C0178C */ void setBaseMotion(int, f32); /* 80C017AC */ void setFaceMotion(int, f32); /* 80C017F0 */ void calcMotion(); - /* 80C018C0 */ void checkProcess(int (daObj_GrA_c::*)(void*)); + /* 80C018C0 */ BOOL checkProcess(int (daObj_GrA_c::*)(void*)); /* 80C018F4 */ int setProcess(int (daObj_GrA_c::*)(void*)); /* 80C019B8 */ void setParam(); - /* 80C01C18 */ void checkEvent(); + /* 80C01C18 */ BOOL checkEvent(); /* 80C01D7C */ void mainProc(); /* 80C01FE4 */ void adjustShapeAngle(); /* 80C01FE8 */ void setMtx(int); @@ -125,67 +130,67 @@ class daObj_GrA_Param_c { /* 80C02970 */ void setAttnPos(); /* 80C02A5C */ void drawOtherMdls(); /* 80C02A60 */ bool dbgDraw(); - /* 80C02A68 */ void ppMoveInit(); - /* 80C02AD4 */ void setLookMode(int); - /* 80C02AE8 */ void lookat(); - /* 80C0308C */ void hitChk(); + /* 80C02A68 */ int ppMoveInit(); + /* 80C02AD4 */ int setLookMode(int); + /* 80C02AE8 */ int lookat(); + /* 80C0308C */ int hitChk(); /* 80C031E4 */ int wait(void*); - /* 80C0335C */ void talk(void*); + /* 80C0335C */ int talk(void*); /* 80C035B8 */ void ctrlMsgAnm(int&, int&, fopAc_ac_c*); /* 80C03720 */ void checkTagGraSub(fopAc_ac_c*); /* 80C03764 */ void fallAbyssCheck(); /* 80C03830 */ void setPrtcl(); - /* 80C03B14 */ void base000(int); - /* 80C03B48 */ void base001(int); - /* 80C03B7C */ void base003(int); - /* 80C03C1C */ void base004(int); - /* 80C03CBC */ void base005(int); - /* 80C03D54 */ void base006(int); - /* 80C03D88 */ void base007(int); - /* 80C03DF0 */ void base008(int); - /* 80C03E74 */ void base009(int); - /* 80C03F14 */ void base010(int); - /* 80C03FC0 */ void base013(int); - /* 80C04118 */ void base016(int); - /* 80C04180 */ void base017(int); - /* 80C041E8 */ void base018(int); - /* 80C04260 */ void base019(int); - /* 80C042D4 */ void base020(int); - /* 80C04308 */ void base021(int); - /* 80C0433C */ void base022(int); - /* 80C04370 */ void base023(int); - /* 80C043A4 */ void base024(int); - /* 80C043D8 */ void base025(int); - /* 80C0440C */ void base026(int); - /* 80C04440 */ void face000(int); - /* 80C04478 */ void face003(int); - /* 80C04518 */ void face004(int); - /* 80C045B8 */ void face005(int); - /* 80C045F0 */ void face006(int); - /* 80C04628 */ void face007(int); - /* 80C04660 */ void face008(int); - /* 80C04700 */ void face009(int); - /* 80C047A0 */ void face010(int); - /* 80C047D8 */ void face011(int); - /* 80C04810 */ void face012(int); - /* 80C04848 */ void face016(int); - /* 80C04880 */ void face017(int); - /* 80C048B8 */ void face999(int); + /* 80C03B14 */ int base000(int); + /* 80C03B48 */ int base001(int); + /* 80C03B7C */ int base003(int); + /* 80C03C1C */ int base004(int); + /* 80C03CBC */ int base005(int); + /* 80C03D54 */ int base006(int); + /* 80C03D88 */ int base007(int); + /* 80C03DF0 */ int base008(int); + /* 80C03E74 */ int base009(int); + /* 80C03F14 */ int base010(int); + /* 80C03FC0 */ int base013(int); + /* 80C04118 */ int base016(int); + /* 80C04180 */ int base017(int); + /* 80C041E8 */ int base018(int); + /* 80C04260 */ int base019(int); + /* 80C042D4 */ int base020(int); + /* 80C04308 */ int base021(int); + /* 80C0433C */ int base022(int); + /* 80C04370 */ int base023(int); + /* 80C043A4 */ int base024(int); + /* 80C043D8 */ int base025(int); + /* 80C0440C */ int base026(int); + /* 80C04440 */ int face000(int); + /* 80C04478 */ int face003(int); + /* 80C04518 */ int face004(int); + /* 80C045B8 */ int face005(int); + /* 80C045F0 */ int face006(int); + /* 80C04628 */ int face007(int); + /* 80C04660 */ int face008(int); + /* 80C04700 */ int face009(int); + /* 80C047A0 */ int face010(int); + /* 80C047D8 */ int face011(int); + /* 80C04810 */ int face012(int); + /* 80C04848 */ int face016(int); + /* 80C04880 */ int face017(int); + /* 80C048B8 */ int face999(int); /* 80C048F8 */ void evtcutTalk(int, int); /* 80C04A0C */ void setFaceTalkAfter(); - /* 80C0536C */ void getSrchCircleR(); - /* 80C053C4 */ void standWait(void*); + /* 80C0536C */ f32 getSrchCircleR(); + /* 80C053C4 */ int standWait(void*); /* 80C05920 */ void walk(void*); - /* 80C05F64 */ void defence(void*); - /* 80C061F4 */ void toStone(void*); - /* 80C067D8 */ void step(void*); - /* 80C06CDC */ void rollReturn(void*); + /* 80C05F64 */ int defence(void*); + /* 80C061F4 */ int toStone(void*); + /* 80C067D8 */ int step(void*); + /* 80C06CDC */ int rollReturn(void*); /* 80C0780C */ void soldierDemoSkip(); /* 80C078A8 */ void soldierDemo(void*); /* 80C07C40 */ void getSrchLinkR(); /* 80C07C98 */ void getSrchGraR(); /* 80C07CF0 */ void getSpeed(); - /* 80C07D38 */ void standRoll(void*); + /* 80C07D38 */ int standRoll(void*); /* 80C083F0 */ void rollDemo(void*); /* 80C08804 */ void rollAttack(void*); /* 80C09298 */ void rollAttacked(void*); @@ -208,17 +213,17 @@ class daObj_GrA_Param_c { /* 80C0CA64 */ void executeCrazyJumping(); /* 80C0CDBC */ void modeChangeCheck(); /* 80C0CF98 */ void checkGraSub(fopAc_ac_c*); - /* 80C0D000 */ void waitDemo(void*); + /* 80C0D000 */ int waitDemo(void*); /* 80C0D2FC */ void skipDemoGra(); /* 80C0D3E0 */ void startDemo(void*); /* 80C0EFC4 */ void turn(s16, f32, int); - /* 80C0F17C */ void turn_step(s16, int, int, int); + /* 80C0F17C */ BOOL turn_step(s16, int, int, int); /* 80C0F330 */ void chkFindPlayer2(int, s16); /* 80C0F668 */ void chkPointInArea(cXyz, cXyz, cXyz, s16); /* 80C0F5A4 */ void chkPointInArea(cXyz, cXyz, f32, f32, f32, s16); /* 80C0F6E0 */ void chkActorInSight2(fopAc_ac_c*, f32, s16); /* 80C0F7EC */ void getAttentionPos(fopAc_ac_c*); - /* 80C0F860 */ void standWaitJump(void*); + /* 80C0F860 */ int standWaitJump(void*); bool checkNpcObjGra() { return mMode == 1; } void setCrazyDash() { field_0xa48 |= 4; } @@ -226,8 +231,8 @@ class daObj_GrA_Param_c { void setCrazyThrowLeft() { field_0xa48 |= 8; } void setCrazyThrowRight() { field_0xa48 |= 0x10; } - static u8 mBaseMotionList[264]; - static u8 mFaceMotionList[168]; + static MotionFunc mBaseMotionList[22]; + static MotionFunc mFaceMotionList[14]; bool isFirstGra() { return field_0x1fe8 == 0; } @@ -235,19 +240,25 @@ class daObj_GrA_Param_c { /* 0x0A48 */ u16 field_0xa48; /* 0x0A4A */ u8 field_0xa4a[0xa4c - 0xa4a]; /* 0x0A4C */ daObj_GrA_Param_c* field_0xa4c; - /* 0x0A50 */ u8 field_0xa50[0xa5c - 0xa50]; + /* 0x0A50 */ Process field_0xa50; /* 0x0A5C */ request_of_phase_process_class* field_0xa5c[8]; - /* 0x0A7C */ u8 field_0xa7c[0xa7e - 0xa7c]; + /* 0x0A7C */ s16 field_0xa7c; /* 0x0A7E */ u8 mMode; /* 0x0A7F */ u8 field_0xa7f; - /* 0x0A80 */ u8 field_0xa80[0xa8c - 0xa80]; + /* 0x0A80 */ u8 field_0xa80[0xa88 - 0xa80]; + /* 0x0A88 */ int field_0xa88; /* 0x0A8C */ u8 field_0xa8c; - /* 0x0A8D */ u8 field_0xa8d[0xa94 - 0xa8d]; + /* 0x0A8D */ u8 field_0xa8d; + /* 0x0A8E */ u8 field_0xa8e; + /* 0x0A8F */ u8 field_0xa8f; + /* 0x0A90 */ u16 field_0xa90; + /* 0x0A92 */ u16 field_0xa92; /* 0x0A94 */ f32 field_0xa94; /* 0x0A98 */ f32 field_0xa98; /* 0x0A9C */ int field_0xa9c; /* 0x0AA0 */ int field_0xaa0; - /* 0x0AA4 */ u8 field_0xaa4[0xaac - 0xaa4]; + /* 0x0AA4 */ int field_0xaa4; + /* 0x0AA8 */ u8 field_0xaa8[0xaac - 0xaa8]; /* 0x0AAC */ int field_0xaac; /* 0x0AB0 */ daBaseNpc_acMngr_c field_0xab0; /* 0x0AB8 */ daObj_GrA_prtclMngr_c field_0xab8[6]; @@ -255,17 +266,29 @@ class daObj_GrA_Param_c { /* 0x0F50 */ dCcD_Cyl field_0xf50; /* 0x108C */ u8 field_0x108c[0x109c - 0x108c]; /* 0x109C */ int field_0x109c; - /* 0x10A0 */ u8 field_0x10a0[0x10c4 - 0x10a0]; + /* 0x10A0 */ int field_0x10a0; + /* 0x10A4 */ int field_0x10a4; + /* 0x10A8 */ int field_0x10a8; + /* 0x10AC */ u8 field_0x10ac; + /* 0x10AD */ u8 field_0x10ad[0x10bc - 0x10ad]; + /* 0x10BC */ int field_0x10bc; + /* 0x10C0 */ u8 field_0x10c0[0x10c4 - 0x10c0]; /* 0x10C4 */ int field_0x10c4; /* 0x10C8 */ cBgS_GndChk field_0x10c8[5]; /* 0x11F4 */ dBgS_LinkLinChk field_0x11f4[5]; /* 0x1424 */ cXyz field_0x1424[5]; /* 0x1460 */ cXyz field_0x1460[5]; - /* 0x149C */ u8 field_0x149c[0x14b4 - 0x149c]; + /* 0x149C */ u8 field_0x149c[0x14b0 - 0x149c]; + /* 0x14B0 */ int field_0x14b0; /* 0x14B4 */ cXyz field_0x14b4[5]; - /* 0x14F0 */ u8 field_0x14f0[0x14f8 - 0x14f0]; - /* 0x14F8 */ daBaseNpc_acMngr_c field_0x1f48; - /* 0x1500 */ u8 field_0x1500[0x1520 - 0x1500]; + /* 0x14F0 */ f32 field_0x14f0; + /* 0x14F4 */ int field_0x14f4; + /* 0x14F8 */ daBaseNpc_acMngr_c field_0x14f8; + /* 0x1500 */ u8 field_0x1500; + /* 0x1504 */ int mLookMode; + /* 0x1508 */ int field_0x1508; + /* 0x150C */ int field_0x150c; + /* 0x1510 */ u8 field_0x1510[0x1520 - 0x1510]; /* 0x1520 */ int field_0x1520; /* 0x1524 */ u8 field_0x1524[0x1528 - 0x1524]; /* 0x1528 */ daBaseNpc_path_c field_0x1528; @@ -273,7 +296,9 @@ class daObj_GrA_Param_c { /* 0x1FBC */ int field_0x1fbc; /* 0x1FC0 */ u8 field_0x1fc0[0x1fc4 - 0x1fc0]; /* 0x1FC4 */ u8 field_0x1fc4; - /* 0x1FC5 */ u8 field_0x1fc5[0x1fd8 - 0x1fc5]; + /* 0x1FC5 */ u8 field_0x1fc5[0x1fcc - 0x1fc5]; + /* 0x1FCC */ int field_0x1fcc; + /* 0x1FD0 */ u8 field_0x1fd0[0x1fd8 - 0x1fd0]; /* 0x1FD8 */ s16 field_0x1fd8; /* 0x1FDA */ u8 field_0x1fda[0x1fdc - 0x1fda]; /* 0x1FDC */ int field_0x1fdc; diff --git a/src/d/actor/d_a_npc2.cpp b/src/d/actor/d_a_npc2.cpp index 556625e862d..52cab601d31 100644 --- a/src/d/actor/d_a_npc2.cpp +++ b/src/d/actor/d_a_npc2.cpp @@ -475,9 +475,9 @@ int daBaseNpc_c::setMcaMorfAnm(J3DAnmTransformKey* i_anm, f32 i_speed, f32 i_mor /* 8014EEE4-8014EF28 149824 0044+00 0/0 0/0 1/1 .text * setBckAnm__11daBaseNpc_cFP15J3DAnmTransformfiiib */ -void daBaseNpc_c::setBckAnm(J3DAnmTransform* i_anm, f32 i_speed, int i_mode, int i_start, +int daBaseNpc_c::setBckAnm(J3DAnmTransform* i_anm, f32 i_speed, int i_mode, int i_start, int i_end, bool i_modify) { - mBck.init(i_anm, TRUE, i_mode, i_speed, i_start, i_end, i_modify); + return mBck.init(i_anm, TRUE, i_mode, i_speed, i_start, i_end, i_modify); } /* 8014EF28-8014EF64 149868 003C+00 0/0 0/0 1/1 .text getTexPtrnAnmP__11daBaseNpc_cFPci @@ -488,9 +488,9 @@ J3DAnmTransform* daBaseNpc_c::getTexPtrnAnmP(char* i_arcName, int i_resIdx) { /* 8014EF64-8014EFA4 1498A4 0040+00 0/0 0/0 1/1 .text * setBtpAnm__11daBaseNpc_cFP16J3DAnmTexPatternP12J3DModelDatafi */ -void daBaseNpc_c::setBtpAnm(J3DAnmTexPattern* i_anm, J3DModelData* i_modelData, f32 i_speed, +int daBaseNpc_c::setBtpAnm(J3DAnmTexPattern* i_anm, J3DModelData* i_modelData, f32 i_speed, int i_mode) { - mBtp.init(i_modelData, i_anm, TRUE, i_mode, i_speed, 0, -1); + return mBtp.init(i_modelData, i_anm, TRUE, i_mode, i_speed, 0, -1); } /* 8014EFA4-8014EFF0 1498E4 004C+00 2/0 0/0 2/0 .text attnSttsOn__11daBaseNpc_cFii */ diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index c3133b70519..8e95b44476e 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -6,9 +6,9 @@ #include "d/actor/d_a_obj_gra2.h" #include "Z2AudioLib/Z2Instances.h" #include "d/d_bg_w.h" +#include "d/d_cc_uty.h" #include "d/d_com_inf_game.h" #include "dol2asm.h" -// #include "d_resorce.h" #include "d/d_camera.h" // @@ -1243,24 +1243,29 @@ SECTION_DATA static void* lit_10587[3] = { #pragma pop /* 80C104DC-80C105E4 000674 0108+00 1/2 0/0 0/0 .data mBaseMotionList__11daObj_GrA_c */ -SECTION_DATA u8 daObj_GrA_c::mBaseMotionList[264] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +daObj_GrA_c::MotionFunc daObj_GrA_c::mBaseMotionList[22] = { + &daObj_GrA_c::base000, + &daObj_GrA_c::base001, + &daObj_GrA_c::base003, + &daObj_GrA_c::base004, + &daObj_GrA_c::base005, + &daObj_GrA_c::base006, + &daObj_GrA_c::base007, + &daObj_GrA_c::base008, + &daObj_GrA_c::base009, + &daObj_GrA_c::base010, + &daObj_GrA_c::base013, + &daObj_GrA_c::base016, + &daObj_GrA_c::base017, + &daObj_GrA_c::base018, + &daObj_GrA_c::base019, + &daObj_GrA_c::base020, + &daObj_GrA_c::base021, + &daObj_GrA_c::base022, + &daObj_GrA_c::base023, + &daObj_GrA_c::base024, + &daObj_GrA_c::base025, + &daObj_GrA_c::base026, }; /* 80C105E4-80C105F0 -00001 000C+00 0/1 0/0 0/0 .data @10849 */ @@ -1404,18 +1409,21 @@ SECTION_DATA static void* lit_10862[3] = { #pragma pop /* 80C1068C-80C10734 000824 00A8+00 1/2 0/0 0/0 .data mFaceMotionList__11daObj_GrA_c */ -SECTION_DATA u8 daObj_GrA_c::mFaceMotionList[168] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +daObj_GrA_c::MotionFunc daObj_GrA_c::mFaceMotionList[14] = { + &daObj_GrA_c::face000, + &daObj_GrA_c::face003, + &daObj_GrA_c::face004, + &daObj_GrA_c::face005, + &daObj_GrA_c::face006, + &daObj_GrA_c::face007, + &daObj_GrA_c::face008, + &daObj_GrA_c::face009, + &daObj_GrA_c::face010, + &daObj_GrA_c::face011, + &daObj_GrA_c::face012, + &daObj_GrA_c::face016, + &daObj_GrA_c::face017, + &daObj_GrA_c::face999, }; /* 80C10784-80C107E8 00091C 0064+00 2/2 0/0 0/0 .data __vt__11daObj_GrA_c */ @@ -1875,7 +1883,7 @@ u8 daObj_GrA_c::getMode() { } /* 80C00DF8-80C00E04 000FD8 000C+00 1/1 0/0 0/0 .text getPathNo__11daObj_GrA_cFv */ -u32 daObj_GrA_c::getPathNo() { +u8 daObj_GrA_c::getPathNo() { return fopAcM_GetParam(this) >> 20 & 0xFF; } @@ -1987,10 +1995,7 @@ static u8 lit_4026[12]; #pragma pop /* 80C108EC-80C108F8 000054 000C+00 0/2 0/0 0/0 .bss l_centerOfst */ -#pragma push -#pragma force_active on -static u8 l_centerOfst[12]; -#pragma pop +static cXyz l_centerOfst; /* 80C108F8-80C10904 000060 000C+00 0/1 0/0 0/0 .bss @4027 */ #pragma push @@ -2002,609 +2007,573 @@ static u8 lit_4027[12]; static daObj_GrA_Param_c l_HIO; /* 80C010D4-80C013B0 0012B4 02DC+00 1/1 0/0 0/0 .text init__11daObj_GrA_cFv */ -void daObj_GrA_c::init() { +int daObj_GrA_c::init() { // NONMATCHING fopAcM_SetMtx(this, mpModelMorf->getModel()->getBaseTRMtx()); mSound.init(¤t.pos, &eyePos, 3, 1); eventInfo.setArchiveName((char*)getResName()); field_0xa4c = &l_HIO; -} + attention_info.distances[4] = 40; + attention_info.distances[2] = 22; + mAcchCir.SetWall(daObj_GrA_Param_c::m.mWallH, daObj_GrA_Param_c::m.mWallR); + mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, + fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this), fopAcM_GetShapeAngle_p(this)); + mCcStts.Init(daObj_GrA_Param_c::m.mWeight, 0, this); + field_0xf50.Set(mCcDCyl); + field_0xf50.SetStts(&mCcStts); + field_0xce0[0].Set(mCcDSph); + field_0xce0[0].SetStts(&mCcStts); + field_0xce0[0].SetAtSe(11); + field_0xce0[0].SetAtSpl((dCcG_At_Spl)1); + field_0xce0[0].SetAtType(AT_TYPE_800); + field_0xce0[0].OnAtSPrmBit(12); + field_0xce0[0].SetAtAtp(1); + field_0xce0[0].OffTgNoConHit(); + field_0xce0[0].OffCoSetBit(); + + field_0xce0[1].Set(mCcDSph); + field_0xce0[1].SetStts(&mCcStts); + field_0xce0[1].SetAtSe(11); + field_0xce0[1].SetAtSpl((dCcG_At_Spl)1); + field_0xce0[1].SetAtType(AT_TYPE_800); + field_0xce0[1].OnAtSPrmBit(12); + field_0xce0[1].SetAtAtp(1); + field_0xce0[1].OffTgNoConHit(); + field_0xce0[1].OffCoSetBit(); + + mAcch.CrrPos(dComIfG_Bgsp()); + field_0x9d4 = mAcch.m_gnd; + mGroundY = mAcch.GetGroundH(); + + for (int i = 0; i < 6; i++) { + field_0xab8[0].field_0x24[i]->init(&mAcch, 0.0f, 0.0f); + } -/* 80C013B0-80C014F4 001590 0144+00 24/23 0/0 0/0 .text setBaseAnm__11daObj_GrA_cFif */ -void daObj_GrA_c::setBaseAnm(int param_0, f32 param_1) { - // NONMATCHING -} + setEnvTevColor(); + setRoomNo(); -/* 80C014F4-80C01698 0016D4 01A4+00 15/14 0/0 0/0 .text setFaceAnm__11daObj_GrA_cFibf */ -void daObj_GrA_c::setFaceAnm(int param_0, bool param_1, f32 param_2) { - // NONMATCHING -} + if (mMode == 2) { + fopAcM_OffStatus(this, 0x4000); + } -/* 80C01698-80C0178C 001878 00F4+00 2/2 0/0 0/0 .text setFaceBtp__11daObj_GrA_cFi */ -void daObj_GrA_c::setFaceBtp(int param_0) { - // NONMATCHING + field_0x1528.setPathInfo(getPathNo(), fopAcM_GetRoomNo(this), 1); + restart(); + return MoveBGExecute(); } -/* 80C0178C-80C017AC 00196C 0020+00 22/22 0/0 0/0 .text setBaseMotion__11daObj_GrA_cFif - */ -void daObj_GrA_c::setBaseMotion(int param_0, f32 param_1) { +/* 80C013B0-80C014F4 001590 0144+00 24/23 0/0 0/0 .text setBaseAnm__11daObj_GrA_cFif */ +void daObj_GrA_c::setBaseAnm(int param_1, f32 i_morf) { // NONMATCHING -} + J3DAnmTransformKey* transformKey = NULL; + int i_mode = 3; -/* 80C017AC-80C017F0 00198C 0044+00 25/25 0/0 0/0 .text setFaceMotion__11daObj_GrA_cFif - */ -void daObj_GrA_c::setFaceMotion(int param_0, f32 param_1) { - // NONMATCHING -} + if (l_bckGetParamList[param_1] >= 0) { + transformKey = (J3DAnmTransformKey*)getTrnsfrmKeyAnmP(l_resNames[l_bckGetParamList[param_1 + 1]], l_bckGetParamList[param_1]); + } -/* 80C017F0-80C018C0 0019D0 00D0+00 7/7 0/0 0/0 .text calcMotion__11daObj_GrA_cFv */ -void daObj_GrA_c::calcMotion() { - // NONMATCHING -} + cLib_offBit(field_0x840, 0x11); -/* 80C018C0-80C018F4 001AA0 0034+00 4/4 0/0 0/0 .text - * checkProcess__11daObj_GrA_cFM11daObj_GrA_cFPCvPvPv_i */ -void daObj_GrA_c::checkProcess(int (daObj_GrA_c::*param_0)(void*)) { - // NONMATCHING -} + switch (param_1) { + case 0: + case 1: + case 2: + case 7: + case 9: + case 18: + case 19: + case 21: + break; -/* 80C018F4-80C019A4 001AD4 00B0+00 22/22 0/0 0/0 .text - * setProcess__11daObj_GrA_cFM11daObj_GrA_cFPCvPvPv_i */ -int daObj_GrA_c::setProcess(int (daObj_GrA_c::*param_0)(void*)) { - // NONMATCHING -} + case 3: + i_mode = 0; + break; + + case 4: + case 5: + i_mode = 0; + break; + + case 6: + case 14: + case 20: + i_mode = 0; + break; + + case 8: + i_mode = 0; + break; + + case 10: + case 11: + case 12: + case 13: + i_mode = 0; + break; + + case 15: + i_mode = 0; + break; + + case 16: + case 17: + i_mode = 0; + break; -/* 80C019A4-80C019B8 001B84 0014+00 2/2 0/0 0/0 .text getDistTableIdx__Fii */ -static void getDistTableIdx(int param_0, int param_1) { - // NONMATCHING -} + default: + transformKey = NULL; + } -/* 80C019B8-80C01C18 001B98 0260+00 1/0 0/0 0/0 .text setParam__11daObj_GrA_cFv */ -void daObj_GrA_c::setParam() { - // NONMATCHING + if (transformKey != NULL && setMcaMorfAnm(transformKey, 1.0f, i_morf, i_mode, 0, -1) != 0) { + field_0x842 = 0; + cLib_onBit(field_0x840, 0x11); + mpModelMorf->setMorf(i_morf); + } } -/* 80C01C18-80C01D7C 001DF8 0164+00 1/1 0/0 0/0 .text checkEvent__11daObj_GrA_cFv */ -void daObj_GrA_c::checkEvent() { +/* 80C014F4-80C01698 0016D4 01A4+00 15/14 0/0 0/0 .text setFaceAnm__11daObj_GrA_cFibf */ +void daObj_GrA_c::setFaceAnm(int param_1, bool i_modify, f32 i_morf) { // NONMATCHING -} - -/* ############################################################################################## */ -/* 80C0FBB8-80C0FBBC 00013C 0004+00 0/1 0/0 0/0 .rodata @5022 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5022 = -160.0f; -COMPILER_STRIP_GATE(0x80C0FBB8, &lit_5022); -#pragma pop - -/* 80C0FBBC-80C0FBC0 000140 0004+00 0/1 0/0 0/0 .rodata @5023 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5023 = -100.0f; -COMPILER_STRIP_GATE(0x80C0FBBC, &lit_5023); -#pragma pop - -/* 80C0FBC0-80C0FBC4 000144 0004+00 0/1 0/0 0/0 .rodata @5024 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5024 = 160.0f; -COMPILER_STRIP_GATE(0x80C0FBC0, &lit_5024); -#pragma pop - -/* 80C0FBC4-80C0FBCC 000148 0004+04 0/1 0/0 0/0 .rodata @5025 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5025[1 + 1 /* padding */] = { - 240.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x80C0FBC4, &lit_5025); -#pragma pop + J3DAnmTransform* transform = NULL; + int i_mode = 0; -/* 80C0FBCC-80C0FBD4 000150 0008+00 0/13 0/0 0/0 .rodata @5026 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_5026[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FBCC, &lit_5026); -#pragma pop + if (l_bckGetParamList[param_1] >= 0) { + transform = getTrnsfrmKeyAnmP(l_resNames[l_bckGetParamList[param_1 + 1]], l_bckGetParamList[param_1]); + } -/* 80C0FBD4-80C0FBDC 000158 0008+00 0/13 0/0 0/0 .rodata @5027 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_5027[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FBD4, &lit_5027); -#pragma pop + cLib_offBit(field_0x840, 0x44); + cLib_offBit(field_0x840, 0x22); -/* 80C0FBDC-80C0FBE4 000160 0008+00 0/13 0/0 0/0 .rodata @5028 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_5028[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FBDC, &lit_5028); -#pragma pop + switch (param_1) { + case 22: + case 23: + case 24: + case 25: + i_mode = 2; + setFaceBtp(0); + break; -/* 80C01D7C-80C01FE4 001F5C 0268+00 1/0 0/0 0/0 .text mainProc__11daObj_GrA_cFv */ -void daObj_GrA_c::mainProc() { - // NONMATCHING -} + case 26: + case 27: + case 28: + setFaceBtp(0); + break; -/* 80C01FE4-80C01FE8 0021C4 0004+00 1/0 0/0 0/0 .text adjustShapeAngle__11daObj_GrA_cFv - */ -void daObj_GrA_c::adjustShapeAngle() { - /* empty function */ -} - -/* ############################################################################################## */ -/* 80C0FBE4-80C0FBE8 000168 0004+00 0/1 0/0 0/0 .rodata @5241 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5241 = 0x3F93C86D; -COMPILER_STRIP_GATE(0x80C0FBE4, &lit_5241); -#pragma pop + case 29: + setFaceBtp(1); + break; -/* 80C0FBE8-80C0FBEC 00016C 0004+00 0/1 0/0 0/0 .rodata @5242 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5242 = 0xBD57EFE1; -COMPILER_STRIP_GATE(0x80C0FBE8, &lit_5242); -#pragma pop - -/* 80C0FBEC-80C0FBF0 000170 0004+00 0/1 0/0 0/0 .rodata @5243 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5243 = 0x3F826D0D; -COMPILER_STRIP_GATE(0x80C0FBEC, &lit_5243); -#pragma pop - -/* 80C0FBF0-80C0FBF4 000174 0004+00 0/1 0/0 0/0 .rodata @5244 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5244 = 0x3F38E2A0; -COMPILER_STRIP_GATE(0x80C0FBF0, &lit_5244); -#pragma pop + case 30: + setFaceBtp(2); + break; -/* 80C0FBF4-80C0FBF8 000178 0004+00 0/1 0/0 0/0 .rodata @5245 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5245 = 0xBE0F6406; -COMPILER_STRIP_GATE(0x80C0FBF4, &lit_5245); -#pragma pop + case 31: + setFaceBtp(0); + break; -/* 80C0FBF8-80C0FBFC 00017C 0004+00 0/1 0/0 0/0 .rodata @5246 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5246 = 0x3FAAA68F; -COMPILER_STRIP_GATE(0x80C0FBF8, &lit_5246); -#pragma pop + case 32: + setFaceBtp(3); + break; -/* 80C0FBFC-80C0FC00 000180 0004+00 0/1 0/0 0/0 .rodata @5247 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5247 = 0xBFAF2D4D; -COMPILER_STRIP_GATE(0x80C0FBFC, &lit_5247); -#pragma pop + case 33: + setFaceBtp(0); + break; -/* 80C0FC00-80C0FC04 000184 0004+00 0/1 0/0 0/0 .rodata @5248 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5248 = 0xBE7F6901; -COMPILER_STRIP_GATE(0x80C0FC00, &lit_5248); -#pragma pop + case 34: + setFaceBtp(0); + break; -/* 80C0FC04-80C0FC08 000188 0004+00 0/1 0/0 0/0 .rodata @5249 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5249 = 0x3DBC31DF; -COMPILER_STRIP_GATE(0x80C0FC04, &lit_5249); -#pragma pop + default: + transform = NULL; + } -/* 80C0FC08-80C0FC0C 00018C 0004+00 0/1 0/0 0/0 .rodata @5250 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5250 = 0x3EFC15F4; -COMPILER_STRIP_GATE(0x80C0FC08, &lit_5250); -#pragma pop + if (transform != NULL && setBckAnm(transform, 1.0f, i_mode, 0, -1, i_modify) != 0) { + cLib_onBit(field_0x840, 0x22); + mpModelMorf->setMorf(i_morf); + } +} -/* 80C0FC0C-80C0FC10 000190 0004+00 0/1 0/0 0/0 .rodata @5251 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5251 = 0xBEBC9E88; -COMPILER_STRIP_GATE(0x80C0FC0C, &lit_5251); -#pragma pop +/* 80C01698-80C0178C 001878 00F4+00 2/2 0/0 0/0 .text setFaceBtp__11daObj_GrA_cFi */ +void daObj_GrA_c::setFaceBtp(int param_1) { + // NONMATCHING + J3DAnmTexPattern* texPattern = NULL; + int i_mode = 0; -/* 80C0FC10-80C0FC14 000194 0004+00 0/1 0/0 0/0 .rodata @5252 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5252 = 0xBF932064; -COMPILER_STRIP_GATE(0x80C0FC10, &lit_5252); -#pragma pop + cLib_offBit(field_0x840, 0x44); -/* 80C0FC14-80C0FC18 000198 0004+00 0/1 0/0 0/0 .rodata @5253 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5253 = 0x3EE0F8E8; -COMPILER_STRIP_GATE(0x80C0FC14, &lit_5253); -#pragma pop + if (l_btpGetParamList[param_1] >= 0) { + texPattern = (J3DAnmTexPattern*)getTexPtrnAnmP(l_resNames[l_btpGetParamList[param_1 + 1]], l_btpGetParamList[param_1]); + } -/* 80C0FC18-80C0FC1C 00019C 0004+00 0/1 0/0 0/0 .rodata @5254 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5254 = 0xBEF809F6; -COMPILER_STRIP_GATE(0x80C0FC18, &lit_5254); -#pragma pop + switch (param_1) { + case 0: + i_mode = 2; + break; -/* 80C0FC1C-80C0FC20 0001A0 0004+00 0/1 0/0 0/0 .rodata @5255 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5255 = 0x3FEB5F4E; -COMPILER_STRIP_GATE(0x80C0FC1C, &lit_5255); -#pragma pop + case 1: + case 2: + case 3: + break; -/* 80C0FC20-80C0FC24 0001A4 0004+00 0/1 0/0 0/0 .rodata @5256 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5256 = 0xBFC9527E; -COMPILER_STRIP_GATE(0x80C0FC20, &lit_5256); -#pragma pop + default: + texPattern = NULL; + } -/* 80C0FC24-80C0FC28 0001A8 0004+00 0/1 0/0 0/0 .rodata @5257 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5257 = 0xBF15C7BD; -COMPILER_STRIP_GATE(0x80C0FC24, &lit_5257); -#pragma pop + if (field_0x844 != false) { + texPattern = NULL; + } -/* 80C0FC28-80C0FC2C 0001AC 0004+00 0/1 0/0 0/0 .rodata @5258 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5258 = 0x3EDF3472; -COMPILER_STRIP_GATE(0x80C0FC28, &lit_5258); -#pragma pop + if (texPattern != NULL && setBtpAnm(texPattern, mpModelMorf->getModel()->getModelData(), 1.0f, i_mode) != 0) { + cLib_onBit(field_0x840, 0x44); + } +} -/* 80C0FC2C-80C0FC30 0001B0 0004+00 0/1 0/0 0/0 .rodata @5259 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5259 = 0x3F96655A; -COMPILER_STRIP_GATE(0x80C0FC2C, &lit_5259); -#pragma pop +/* 80C0178C-80C017AC 00196C 0020+00 22/22 0/0 0/0 .text setBaseMotion__11daObj_GrA_cFif */ +void daObj_GrA_c::setBaseMotion(int param_1, f32 param_2) { + if (field_0xa90 >= 22) { + return; + } -/* 80C0FC30-80C0FC34 0001B4 0004+00 0/1 0/0 0/0 .rodata @5260 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5260 = 0xBF2863BF; -COMPILER_STRIP_GATE(0x80C0FC30, &lit_5260); -#pragma pop + field_0xa90 = param_1; + field_0xa94 = param_2; + field_0xa8d = 1; +} -/* 80C0FC34-80C0FC38 0001B8 0004+00 0/1 0/0 0/0 .rodata @5261 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5261 = 0xBF93F783; -COMPILER_STRIP_GATE(0x80C0FC34, &lit_5261); -#pragma pop +/* 80C017AC-80C017F0 00198C 0044+00 25/25 0/0 0/0 .text setFaceMotion__11daObj_GrA_cFif */ +void daObj_GrA_c::setFaceMotion(int param_1, f32 param_2) { + if (field_0xa92 >= 14) { + return; + } -/* 80C0FC38-80C0FC3C 0001BC 0004+00 0/1 0/0 0/0 .rodata @5262 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5262 = 0x3FAB3355; -COMPILER_STRIP_GATE(0x80C0FC38, &lit_5262); -#pragma pop + field_0xa92 = param_1; + field_0xa8e = 1; -/* 80C0FC3C-80C0FC40 0001C0 0004+00 0/1 0/0 0/0 .rodata @5263 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5263 = 0xBF30A601; -COMPILER_STRIP_GATE(0x80C0FC3C, &lit_5263); -#pragma pop + if (param_2 < 0.0f) { + field_0xa98 = daObj_GrA_Param_c::m.field_0x0c; + return; + } -/* 80C0FC40-80C0FC44 0001C4 0004+00 0/1 0/0 0/0 .rodata @5264 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5264 = 0x3F89BE7F; -COMPILER_STRIP_GATE(0x80C0FC40, &lit_5264); -#pragma pop + field_0xa98 = param_2; +} -/* 80C0FC44-80C0FC48 0001C8 0004+00 0/1 0/0 0/0 .rodata @5265 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5265 = 0xBF7226F6; -COMPILER_STRIP_GATE(0x80C0FC44, &lit_5265); -#pragma pop +/* 80C017F0-80C018C0 0019D0 00D0+00 7/7 0/0 0/0 .text calcMotion__11daObj_GrA_cFv */ +void daObj_GrA_c::calcMotion() { + if (field_0xa90 < 22 && mBaseMotionList[field_0xa90]) { + field_0xa88 = (this->*mBaseMotionList[field_0xa90])(field_0xa8d); + } -/* 80C0FC48-80C0FC4C 0001CC 0004+00 0/1 0/0 0/0 .rodata @5266 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5266 = 0xBF2B5AFB; -COMPILER_STRIP_GATE(0x80C0FC48, &lit_5266); -#pragma pop + if (field_0xa92 < 14 && mFaceMotionList[field_0xa92]) { + (this->*mFaceMotionList[field_0xa92])(field_0xa8e); + } -/* 80C0FC4C-80C0FC50 0001D0 0004+00 0/1 0/0 0/0 .rodata @5267 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5267 = 0xBCF7A4E8; -COMPILER_STRIP_GATE(0x80C0FC4C, &lit_5267); -#pragma pop + field_0xa8d = 0; + field_0xa8e = 0; +} -/* 80C0FC50-80C0FC54 0001D4 0004+00 0/1 0/0 0/0 .rodata @5268 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5268 = 0x3D86809D; -COMPILER_STRIP_GATE(0x80C0FC50, &lit_5268); -#pragma pop +/* 80C018C0-80C018F4 001AA0 0034+00 4/4 0/0 0/0 .text checkProcess__11daObj_GrA_cFM11daObj_GrA_cFPCvPvPv_i */ +BOOL daObj_GrA_c::checkProcess(int (daObj_GrA_c::*process)(void*)) { + return process == field_0xa50; +} -/* 80C0FC54-80C0FC58 0001D8 0004+00 0/1 0/0 0/0 .rodata @5269 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5269 = 0xBF154F05; -COMPILER_STRIP_GATE(0x80C0FC54, &lit_5269); -#pragma pop +/* 80C018F4-80C019A4 001AD4 00B0+00 22/22 0/0 0/0 .text setProcess__11daObj_GrA_cFM11daObj_GrA_cFPCvPvPv_i */ +int daObj_GrA_c::setProcess(int (daObj_GrA_c::*process)(void*)) { + field_0xa7c = 2; -/* 80C0FC58-80C0FC5C 0001DC 0004+00 0/1 0/0 0/0 .rodata @5270 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5270 = 0xBF917B8D; -COMPILER_STRIP_GATE(0x80C0FC58, &lit_5270); -#pragma pop + if (field_0xa50) { + (this->*field_0xa50)(NULL); + } -/* 80C0FC5C-80C0FC60 0001E0 0004+00 0/1 0/0 0/0 .rodata @5271 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5271 = 0x3F89E397; -COMPILER_STRIP_GATE(0x80C0FC5C, &lit_5271); -#pragma pop + field_0xa7c = 0; + field_0xa50 = process; -/* 80C0FC60-80C0FC64 0001E4 0004+00 0/1 0/0 0/0 .rodata @5272 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5272 = 0xBEE0B0F2; -COMPILER_STRIP_GATE(0x80C0FC60, &lit_5272); -#pragma pop + if (field_0xa50) { + (this->*field_0xa50)(NULL); + } -/* 80C0FC64-80C0FC68 0001E8 0004+00 0/1 0/0 0/0 .rodata @5273 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5273 = 0x3E3D7A9A; -COMPILER_STRIP_GATE(0x80C0FC64, &lit_5273); -#pragma pop + field_0xa7c = 1; -/* 80C0FC68-80C0FC6C 0001EC 0004+00 0/1 0/0 0/0 .rodata @5274 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5274 = 0xBBC77DD8; -COMPILER_STRIP_GATE(0x80C0FC68, &lit_5274); -#pragma pop + return 1; +} -/* 80C0FC6C-80C0FC70 0001F0 0004+00 0/1 0/0 0/0 .rodata @5275 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5275 = 0xBE8C79F6; -COMPILER_STRIP_GATE(0x80C0FC6C, &lit_5275); -#pragma pop +/* 80C019A4-80C019B8 001B84 0014+00 2/2 0/0 0/0 .text getDistTableIdx__Fii */ +static u8 getDistTableIdx(int param_1, int param_2) { + // NONMATCHING +} -/* 80C0FC70-80C0FC74 0001F4 0004+00 0/1 0/0 0/0 .rodata @5276 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5276 = 0x3FBAC122; -COMPILER_STRIP_GATE(0x80C0FC70, &lit_5276); -#pragma pop +/* 80C019B8-80C01C18 001B98 0260+00 1/0 0/0 0/0 .text setParam__11daObj_GrA_cFv */ +void daObj_GrA_c::setParam() { + // NONMATCHING + if (mMode == 0) { + if (!checkProcess(&daObj_GrA_c::standWait)) { + if (checkProcess(&daObj_GrA_c::wait)) { + if (field_0x150c != 0) { + if (!checkProcess(&daObj_GrA_c::rollReturn)) { + if (checkProcess(&daObj_GrA_c::toStone)) { + attnSttsOn(0, 0); + } else { + attention_info.flags = 0x200004; + } + } + } + } + } + } else if (mMode == 1) { + if (checkProcess(&daObj_GrA_c::standWaitJump)) { + attnSttsOn(1, 1); + attention_info.distances[0] = getDistTableIdx(6, 6); + attention_info.distances[1] = attention_info.distances[0]; + attention_info.distances[3] = getDistTableIdx(4, 6); + } else { + attention_info.flags = 0; + } -/* 80C0FC74-80C0FC78 0001F8 0004+00 0/1 0/0 0/0 .rodata @5277 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5277 = 0xBF9D1740; -COMPILER_STRIP_GATE(0x80C0FC74, &lit_5277); -#pragma pop + if (field_0x844 == false && daPy_py_c::checkNowWolf() != 0) { + attention_info.flags = 0; + } + } else if (mMode == 2) { + attention_info.flags &= 0xffffffef; + attention_info.flags = 0x200000; + } else { + attention_info.flags &= 0xffffffef; + if (field_0x1508 == 0) { + attnSttsOn(0, 0); + } + } -/* 80C0FC78-80C0FC7C 0001FC 0004+00 0/1 0/0 0/0 .rodata @5278 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5278 = 0xBDFD701E; -COMPILER_STRIP_GATE(0x80C0FC78, &lit_5278); -#pragma pop + scale.set(daObj_GrA_Param_c::m.field_0x08, daObj_GrA_Param_c::m.field_0x08, daObj_GrA_Param_c::m.field_0x08); + mCcStts.SetWeight(daObj_GrA_Param_c::m.mWeight); + gravity = daObj_GrA_Param_c::m.mGravity; +} -/* 80C0FC7C-80C0FC80 000200 0004+00 0/1 0/0 0/0 .rodata @5279 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5279 = 0x3E3ADFF8; -COMPILER_STRIP_GATE(0x80C0FC7C, &lit_5279); -#pragma pop +/* 80C01C18-80C01D7C 001DF8 0164+00 1/1 0/0 0/0 .text checkEvent__11daObj_GrA_cFv */ +BOOL daObj_GrA_c::checkEvent() { + // NONMATCHING + BOOL rv = TRUE; + if (dComIfGp_event_runCheck()) { + rv = FALSE; + if (eventInfo.checkCommandTalk()) { + if (checkProcess(&daObj_GrA_c::talk)) { + rv = (this->*field_0xa50)(NULL); + } else if (!dComIfGp_event_chkTalkXY() || dComIfGp_evmng_ChkPresentEnd()) { + setProcess(&daObj_GrA_c::talk); + } + } else if (eventInfo.checkCommandDemoAccrpt()) { + if (dComIfGp_getEventManager().endCheck(mEvtIdx) != 0) { + dComIfGp_event_reset(); + field_0x1520 = 0; + mEvtIdx = -1; + rv = TRUE; + } -/* 80C0FC80-80C0FC84 000204 0004+00 0/1 0/0 0/0 .rodata @5280 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5280 = 0xBF445D10; -COMPILER_STRIP_GATE(0x80C0FC80, &lit_5280); -#pragma pop + if (field_0x209c == 1) { + rv = TRUE; + } + } else { + rv = TRUE; + } + } -/* 80C0FC84-80C0FC88 000208 0004+00 0/1 0/0 0/0 .rodata @5281 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5281 = 0xBCABCF92; -COMPILER_STRIP_GATE(0x80C0FC84, &lit_5281); -#pragma pop + return rv; +} -/* 80C0FC88-80C0FC8C 00020C 0004+00 0/1 0/0 0/0 .rodata @5282 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5282 = 0xBF914092; -COMPILER_STRIP_GATE(0x80C0FC88, &lit_5282); -#pragma pop +/* 80C01D7C-80C01FE4 001F5C 0268+00 1/0 0/0 0/0 .text mainProc__11daObj_GrA_cFv */ +void daObj_GrA_c::mainProc() { + // NONMATCHING + fopAcM_setCullSizeBox(this, -160.0f, -100.0f, -160.0f, 160.0f, 240.0f, 160.0f); + + if (checkEvent()) { + hitChk(); + if (field_0xa50) { + (this->*field_0xa50)(NULL); + if (mMode == 0) { + if (getSrchCircleR() < (home.pos - current.pos).absXZ()) { + cXyz sp3c(0.0f, 0.0f, getSrchCircleR()); + cLib_offsetPos(¤t.pos, &home.pos, + cLib_targetAngleY(&home.pos, ¤t.pos), &sp3c); + } + } + } -/* 80C10908-80C10918 000070 000C+04 0/1 0/0 0/0 .bss @5037 */ -#pragma push -#pragma force_active on -static u8 lit_5037[12 + 4 /* padding */]; -#pragma pop + orderEvent(field_0x1508, l_evtNameList[field_0x1520]); + } -/* 80C10918-80C10924 000080 000C+00 0/1 0/0 0/0 .bss @5040 */ -#pragma push -#pragma force_active on -static u8 lit_5040[12]; -#pragma pop + if (field_0xa8c != 0) { + field_0xa94 = 0.0f; + field_0xa98 = 0.0f; + field_0xa8c = 0; + } -/* 80C10924-80C10930 00008C 000C+00 0/1 0/0 0/0 .bss @5041 */ -#pragma push -#pragma force_active on -static u8 lit_5041[12]; -#pragma pop + calcMotion(); +} -/* 80C10930-80C1093C 000098 000C+00 0/1 0/0 0/0 .bss @5042 */ -#pragma push -#pragma force_active on -static u8 lit_5042[12]; -#pragma pop +/* 80C01FE4-80C01FE8 0021C4 0004+00 1/0 0/0 0/0 .text adjustShapeAngle__11daObj_GrA_cFv */ +void daObj_GrA_c::adjustShapeAngle() { + /* empty function */ +} -/* 80C1093C-80C10948 0000A4 000C+00 0/1 0/0 0/0 .bss @5043 */ -#pragma push -#pragma force_active on -static u8 lit_5043[12]; -#pragma pop +/* 80C01FE8-80C02614 0021C8 062C+00 1/0 0/0 0/0 .text setMtx__11daObj_GrA_cFi */ +void daObj_GrA_c::setMtx(int param_1) { + // NONMATCHING + static cXyz aTrembleTrans[15] = { + cXyz(0.0f, 0.0f, 0.0f), + cXyz(1.154554f, -0.052719f, 1.018953f), + cXyz(0.722208f, -0.14003f, 1.333208f), + cXyz(-1.36857f, -0.249424f, 0.091892f), + cXyz(0.492355f, -0.368397f, -1.149426f), + cXyz(0.439399, -0.484451f, 1.838846f), + cXyz(-1.57283f, -0.585079f, 0.435947f), + cXyz(1.174968f, -0.657772f, -1.155991f), + cXyz(1.337504f, -0.690033f, 1.076126f), + cXyz(-0.945907f, -0.669357f, -0.03023f), + cXyz(0.065675f, -0.583237f, -1.136583f), + cXyz(1.077258f, -0.43885f, 0.185038f), + cXyz(-0.006088f, -0.274368f, 1.459019f), + cXyz(-1.227272f, -0.123749f, 0.182495f), + cXyz(-0.767045f, -0.020973f, -1.134783f), + }; + + J3DModel* model = mpModelMorf->getModel(); + J3DModelData* modelData = model->getModelData(); + for (u16 i = 0; i < modelData->getJointNum(); i++) { + modelData->getJointNodePointer(i)->setCallBack(jointCtrlCallBack); + } -/* 80C10948-80C10954 0000B0 000C+00 0/1 0/0 0/0 .bss @5044 */ -#pragma push -#pragma force_active on -static u8 lit_5044[12]; -#pragma pop + if (field_0x109c != 0) { + cXyz sp30(l_centerOfst); + mDoMtx_stack_c::transS(0.0f, 0.0f, 0.0f); + mDoMtx_stack_c::ZXYrotM(field_0x91a); + sp30.x += aTrembleTrans[field_0x10a0 % 15].x; + sp30.y += aTrembleTrans[field_0x10a0 % 15].y; + sp30.z += aTrembleTrans[field_0x10a0 % 15].z; + mDoMtx_stack_c::transM(sp30); + mDoMtx_stack_c::multVecZero(&sp30); + mDoMtx_stack_c::transS(current.pos.x + sp30.x, current.pos.y + sp30.y, current.pos.z + sp30.z); + mDoMtx_stack_c::ZXYrotM(field_0x91a); + + cXyz sp3c(scale); + mDoMtx_stack_c::scaleM(sp3c); + cMtx_copy(mDoMtx_stack_c::get(), mBgMtx); + } -/* 80C10954-80C10960 0000BC 000C+00 0/1 0/0 0/0 .bss @5045 */ -#pragma push -#pragma force_active on -static u8 lit_5045[12]; -#pragma pop + if (field_0x109c != 0) { + cXyz sp48; + mDoMtx_stack_c::transS(0.0f, 0.0f, 0.0f); + mDoMtx_stack_c::ZXYrotM(field_0x91a); + mDoMtx_stack_c::transM(aTrembleTrans[field_0x10a0 % 15].x, aTrembleTrans[field_0x10a0 % 15].y, aTrembleTrans[field_0x10a0 % 15].z); + mDoMtx_stack_c::multVecZero(&sp48); + mDoMtx_stack_c::transS(current.pos.x + sp48.x, current.pos.y + sp48.y, current.pos.z + sp48.z); + } else { + mDoMtx_stack_c::transS(current.pos); + } -/* 80C10960-80C1096C 0000C8 000C+00 0/1 0/0 0/0 .bss @5046 */ -#pragma push -#pragma force_active on -static u8 lit_5046[12]; -#pragma pop + mDoMtx_stack_c::ZXYrotM(field_0x91a); + mDoMtx_stack_c::scaleM(scale); -/* 80C1096C-80C10978 0000D4 000C+00 0/1 0/0 0/0 .bss @5047 */ -#pragma push -#pragma force_active on -static u8 lit_5047[12]; -#pragma pop + model->setBaseTRMtx(mDoMtx_stack_c::get()); -/* 80C10978-80C10984 0000E0 000C+00 0/1 0/0 0/0 .bss @5048 */ -#pragma push -#pragma force_active on -static u8 lit_5048[12]; -#pragma pop + if (param_1 != 0) { + model->setUserArea((u32)this); + } else { + model->setUserArea(0); + } -/* 80C10984-80C10990 0000EC 000C+00 0/1 0/0 0/0 .bss @5049 */ -#pragma push -#pragma force_active on -static u8 lit_5049[12]; -#pragma pop + if (cLib_checkBit(field_0x840, 0x20) != 0) { + mBck.getBckAnm()->setFrame(mBck.getFrame()); + mpModelMorf->modelCalc(); + } else { + mpModelMorf->modelCalc(); + } +} -/* 80C10990-80C1099C 0000F8 000C+00 0/1 0/0 0/0 .bss @5050 */ -#pragma push -#pragma force_active on -static u8 lit_5050[12]; -#pragma pop +/* 80C02614-80C02970 0027F4 035C+00 1/0 0/0 0/0 .text setCollisions__11daObj_GrA_cFv */ +void daObj_GrA_c::setCollisions() { + // NONMATCHING + cXyz sp1c; -/* 80C1099C-80C109A8 000104 000C+00 0/1 0/0 0/0 .bss @5051 */ -#pragma push -#pragma force_active on -static u8 lit_5051[12]; -#pragma pop + if (field_0x1fc4 != 0 || field_0x844 != false) { + field_0xf50.ClrTgHit(); + } else { + if (field_0x109c == 0) { + field_0xf50.SetAtType(AT_TYPE_800); + if (mMode == 2) { + field_0xf50.OnAtSetBit(); + field_0xf50.OffAtSPrmBit(12); + field_0xf50.OnAtSPrmBit(16); + } else { + field_0xf50.OnAtSPrmBit(12); + } -/* 80C109A8-80C109B4 000110 000C+00 0/1 0/0 0/0 .bss @5052 */ -#pragma push -#pragma force_active on -static u8 lit_5052[12]; -#pragma pop + field_0xf50.SetAtSe(10); + field_0xf50.SetAtSpl((dCcG_At_Spl)13); + field_0xf50.SetAtType(AT_TYPE_CSTATUE_SWING); -/* 80C109B4-80C109C0 00011C 000C+00 0/1 0/0 0/0 .bss @5053 */ -#pragma push -#pragma force_active on -static u8 lit_5053[12]; -#pragma pop + if (mMode == 1) { + field_0xf50.ClrTgHit(); + } else { + field_0xf50.SetTgType(-1); + field_0xf50.SetTgHitMark((CcG_Tg_HitMark)2); + field_0xf50.SetTgSPrm(19); + field_0xf50.OnTgShield(); + field_0xf50.OnTgNoConHit(); + } -/* 80C109C0-80C10A74 000128 00B4+00 0/1 0/0 0/0 .bss aTrembleTrans$5036 */ -#pragma push -#pragma force_active on -static u8 aTrembleTrans[180]; -#pragma pop + static cXyz aOfst(0.0f, 0.0f, 20.0f); -/* 80C01FE8-80C02614 0021C8 062C+00 1/0 0/0 0/0 .text setMtx__11daObj_GrA_cFi */ -void daObj_GrA_c::setMtx(int param_0) { - // NONMATCHING -} + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&aOfst, &sp1c); + field_0xf50.SetC(sp1c); -/* ############################################################################################## */ -/* 80C0FC8C-80C0FC90 000210 0004+00 0/11 0/0 0/0 .rodata @5397 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5397 = 20.0f; -COMPILER_STRIP_GATE(0x80C0FC8C, &lit_5397); -#pragma pop + if (field_0xa90 == 10 || field_0xa90 == 4) { + field_0xf50.SetH(200.0f); + } else { + field_0xf50.SetH(daObj_GrA_Param_c::m.field_0x14); + } -/* 80C0FC90-80C0FC94 000214 0004+00 0/3 0/0 0/0 .rodata @5398 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5398 = 200.0f; -COMPILER_STRIP_GATE(0x80C0FC90, &lit_5398); -#pragma pop + field_0xf50.SetR(daObj_GrA_Param_c::m.mWallH); -/* 80C0FC94-80C0FC98 000218 0004+00 0/4 0/0 0/0 .rodata @5399 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5399 = 40.0f; -COMPILER_STRIP_GATE(0x80C0FC94, &lit_5399); -#pragma pop + if (field_0xf50.ChkAtSet()) { + field_0xf50.SetR(daObj_GrA_Param_c::m.mWallH + 40.0f); + } -/* 80C10A74-80C10A84 0001DC 000C+04 0/1 0/0 0/0 .bss @5298 */ -#pragma push -#pragma force_active on -static u8 lit_5298[12 + 4 /* padding */]; -#pragma pop + if (cLib_calcTimer(&field_0x1fd8) == 0) { + field_0xf50.OnCoSetBit(); + } else { + field_0xf50.OffCoSetBit(); + } -/* 80C10A84-80C10A90 0001EC 000C+00 0/1 0/0 0/0 .bss aOfst$5297 */ -#pragma push -#pragma force_active on -static u8 aOfst[12]; -#pragma pop + dComIfG_Ccsp()->Set(&field_0xf50); + } -/* 80C02614-80C02970 0027F4 035C+00 1/0 0/0 0/0 .text setCollisions__11daObj_GrA_cFv */ -void daObj_GrA_c::setCollisions() { - // NONMATCHING + if (checkProcess(&daObj_GrA_c::step)) { + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(11)); + mDoMtx_stack_c::scaleM(scale); + mDoMtx_stack_c::multVecZero(&sp1c); + field_0xce0[1].SetC(sp1c); + field_0xce0[1].SetR(daObj_GrA_Param_c::m.field_0x8c); + dComIfG_Ccsp()->Set(&field_0xce0[1]); + + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(11)); + mDoMtx_stack_c::scaleM(scale); + mDoMtx_stack_c::multVecZero(&sp1c); + field_0xce0[0].SetC(sp1c); + field_0xce0[0].SetR(daObj_GrA_Param_c::m.field_0x8c); + dComIfG_Ccsp()->Set(&field_0xce0[0]); + } + } } -/* ############################################################################################## */ -/* 80C0FC98-80C0FC9C 00021C 0004+00 0/6 0/0 0/0 .rodata @5431 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5431 = 15.0f; -COMPILER_STRIP_GATE(0x80C0FC98, &lit_5431); -#pragma pop - -/* 80C0FC9C-80C0FCA0 000220 0004+00 0/6 0/0 0/0 .rodata @5432 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5432 = 25.0f; -COMPILER_STRIP_GATE(0x80C0FC9C, &lit_5432); -#pragma pop - -/* 80C10A90-80C10AA0 0001F8 000C+04 0/1 0/0 0/0 .bss @5404 */ -#pragma push -#pragma force_active on -static u8 lit_5404[12 + 4 /* padding */]; -#pragma pop - -/* 80C10AA0-80C10AAC 000208 000C+00 0/1 0/0 0/0 .bss aEyeOfst$5403 */ -#pragma push -#pragma force_active on -static u8 aEyeOfst[12]; -#pragma pop - /* 80C02970-80C02A5C 002B50 00EC+00 1/0 0/0 0/0 .text setAttnPos__11daObj_GrA_cFv */ void daObj_GrA_c::setAttnPos() { // NONMATCHING + lookat(); + + static cXyz aEyeOfst(15.0f, 25.0f, 0.0f); + + cXyz sp18; + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(4)); + mDoMtx_stack_c::multVec(&aEyeOfst, &eyePos); + mDoMtx_stack_c::multVecZero(&sp18); + attention_info.position.set(sp18.x, sp18.y + daObj_GrA_Param_c::m.field_0x00, sp18.z); } /* 80C02A5C-80C02A60 002C3C 0004+00 1/0 0/0 0/0 .text drawOtherMdls__11daObj_GrA_cFv */ @@ -2618,88 +2587,237 @@ bool daObj_GrA_c::dbgDraw() { } /* 80C02A68-80C02AD4 002C48 006C+00 2/2 0/0 0/0 .text ppMoveInit__11daObj_GrA_cFv */ -void daObj_GrA_c::ppMoveInit() { - // NONMATCHING +int daObj_GrA_c::ppMoveInit() { + memset(&field_0x10ac, 0, 16); + + field_0x109c = 0; + field_0x10a4 = 0; + field_0x10a8 = 0; + field_0x10bc = -1; + field_0x10c4 = 0; + field_0x14b0 = -1; + field_0x14f0 = FLT_MAX; + field_0x14f4 = -1; + + return 1; } /* 80C02AD4-80C02AE8 002CB4 0014+00 17/17 0/0 0/0 .text setLookMode__11daObj_GrA_cFi */ -void daObj_GrA_c::setLookMode(int param_0) { - // NONMATCHING +int daObj_GrA_c::setLookMode(int iNo) { + JUT_ASSERT(2656, 0 <= iNo && iNo < NUMLOOKMODES_e); + mLookMode = iNo; + field_0x1500 = 1; + return 1; } -/* ############################################################################################## */ -/* 80C0FCA0-80C0FCA4 000224 0004+00 1/8 0/0 0/0 .rodata @5568 */ -SECTION_RODATA static f32 const lit_5568 = 0.5f; -COMPILER_STRIP_GATE(0x80C0FCA0, &lit_5568); +/* 80C02AE8-80C0308C 002CC8 05A4+00 1/1 0/0 0/0 .text lookat__11daObj_GrA_cFv */ +int daObj_GrA_c::lookat() { + // NONMATCHING + J3DModel* model = mpModelMorf->getModel(); + s16 sVar1 = current.angle.y - old.angle.y; + s8 sVar2 = 0; + cXyz* pcVar11 = NULL; -/* 80C0FCA4-80C0FCA8 000228 0004+00 0/0 0/0 0/0 .rodata @5582 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5582 = 149.0f; -COMPILER_STRIP_GATE(0x80C0FCA4, &lit_5582); -#pragma pop + if (field_0x1500 != 0) { + field_0x14f8.entry(NULL); + switch (mLookMode) { + case 1: + field_0x14f8.entry(daPy_getPlayerActorClass()); + break; -/* 80C0FCA8-80C0FCAC 00022C 0004+00 0/0 0/0 0/0 .rodata @5583 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5583 = 74.0f; -COMPILER_STRIP_GATE(0x80C0FCA8, &lit_5583); -#pragma pop + case 2: + field_0x14f8.entry(field_0x204c.getActor()); + break; -/* 80C0FCAC-80C0FCB0 000230 0004+00 0/0 0/0 0/0 .rodata @5725 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5725 = 75.0f; -COMPILER_STRIP_GATE(0x80C0FCAC, &lit_5725); -#pragma pop + case 3: + break; + } + } -/* 80C0FCB0-80C0FCB4 000234 0004+00 2/11 0/0 0/0 .rodata @5726 */ -SECTION_RODATA static f32 const lit_5726 = 100.0f; -COMPILER_STRIP_GATE(0x80C0FCB0, &lit_5726); + field_0x1500 = 0; + + csXyz acStack_60[4]; + csXyz acStack_78[4]; + acStack_60[0].set(cM_deg2s(-daObj_GrA_Param_c::m.field_0x28) - 0x4000, cM_deg2s(daObj_GrA_Param_c::m.field_0x2c), 0); + acStack_60[1].set(-0x4000, 0, 0); + acStack_60[2].set(cM_deg2s(-daObj_GrA_Param_c::m.field_0x38), cM_deg2s(daObj_GrA_Param_c::m.field_0x3c), 0); + acStack_60[3].set(0, 0, 0); + acStack_78[0].set(cM_deg2s(-daObj_GrA_Param_c::m.field_0x24) - 0x4000, cM_deg2s(daObj_GrA_Param_c::m.field_0x30), 0); + acStack_78[1].set(-0x4000, 0, 0); + acStack_78[2].set(cM_deg2s(-daObj_GrA_Param_c::m.field_0x34), cM_deg2s(daObj_GrA_Param_c::m.field_0x40), 0); + acStack_78[3].set(0, 0, 0); + cXyz sp48[4]; + + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(1)); + mDoMtx_stack_c::multVecZero(&sp48[0]); + + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(3)); + mDoMtx_stack_c::multVecZero(&sp48[1]); + + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(4)); + mDoMtx_stack_c::multVecZero(&sp48[2]); + + cXyz sp88(0.0f, 0.0f, 32.0f); + mDoMtx_stack_c::transS(sp48[2]); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp88, &sp48[3]); + + cXyz sp94, spa0; + fopAc_ac_c* actor_p; + switch (mLookMode) { + case 1: + case 2: + actor_p = field_0x14f8.getActor(); + if (actor_p != NULL) { + pcVar11 = &actor_p->eyePos; + } + break; -/* 80C0FCB4-80C0FCC0 000238 000C+00 0/0 0/0 0/0 .rodata @5756 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_5756[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FCB4, &lit_5756); -#pragma pop + case 3: + spa0.set(0.0f, 0.0f, 200.0f); + mDoMtx_stack_c::YrotS(field_0x91a.y); + mDoMtx_stack_c::multVec(&spa0, &spa0); + spa0 += current.pos; + pcVar11 = &spa0; + break; -/* 80C0FCC0-80C0FCC4 000244 0004+00 1/4 0/0 0/0 .rodata @5966 */ -SECTION_RODATA static u32 const lit_5966 = 0x43360B61; -COMPILER_STRIP_GATE(0x80C0FCC0, &lit_5966); + case 0: + break; + } + mLookat.setAttnPos(pcVar11); -/* 80C0FCC4-80C0FCC8 000248 0004+00 0/1 0/0 0/0 .rodata @5967 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5967 = 32.0f; -COMPILER_STRIP_GATE(0x80C0FCC4, &lit_5967); -#pragma pop + for (int i = 0; i < 4; i++) { + mLookat.setMaxJntLmt(acStack_60[i], sVar1); + mLookat.setMinJntLmt(acStack_78[i], sVar1); + mLookat.setJntPos(sp48[i], i); + } + mLookat.calc(this, model->getBaseTRMtx(), sVar1); + + csXyz* local_ac[3] = { &field_0x9bc, &field_0x9c2, &field_0x9c8 }; + int iVar2 = 0; + for (int i = 2, iVar1 = 1; i >= 0; i--) { + if (sVar1 == 0) { + cLib_addCalcAngleS2(&local_ac[i]->x, mLookat.getRot(i).x, 8, 0x800 / iVar1); + cLib_addCalcAngleS2(&local_ac[i]->y, mLookat.getRot(i).y, 8, 0x800 / iVar1); + cLib_addCalcAngleS2(&local_ac[i]->z, mLookat.getRot(i).y, 8, 0x800 / iVar1); + } else { + local_ac[i]->x = mLookat.getRot(i).x; + local_ac[i]->y = mLookat.getRot(i).y; + local_ac[i]->z = mLookat.getRot(i).z; + } -/* 80C02AE8-80C0308C 002CC8 05A4+00 1/1 0/0 0/0 .text lookat__11daObj_GrA_cFv */ -void daObj_GrA_c::lookat() { - // NONMATCHING + iVar2 = 0; + if (local_ac[i]->x == 0 && local_ac[i]->y == 0) { + if (local_ac[i]->z != 0) { + iVar2 = 1; + } + } + iVar1++; + } + + if (iVar2 != 0 && field_0x109c == 0) { + setMtx(1); + } + + return 1; } /* 80C0308C-80C031E4 00326C 0158+00 1/1 0/0 0/0 .text hitChk__11daObj_GrA_cFv */ -void daObj_GrA_c::hitChk() { +int daObj_GrA_c::hitChk() { // NONMATCHING + if (field_0xaa4 != 0) { + cLib_calcTimer(&field_0xaa4); + } else { + mCcStts.Move(); + if (mMode == 0 && field_0xf50.ChkTgHit() != 0) { + field_0xab0.entry(field_0xf50.GetAc()); + + if (field_0x1528.field_0xa18 != 0) { + field_0xaa4 = daObj_GrA_Param_c::m.field_0x54; + def_se_set(&mSound, field_0xf50.GetTgHitObj(), 0x2C, NULL); + setProcess(&daObj_GrA_c::rollReturn); + health = 0; + field_0x1528.field_0xa18 = 0; + } else { + def_se_set(&mSound, field_0xf50.GetTgHitObj(), 0x2C, NULL); + if (health != 0) { + setProcess(&daObj_GrA_c::defence); + } + } + + field_0xf50.ClrTgHit(); + } + } + + return 1; } /* 80C031E4-80C0335C 0033C4 0178+00 12/0 0/0 0/0 .text wait__11daObj_GrA_cFPv */ -int daObj_GrA_c::wait(void* param_0) { +int daObj_GrA_c::wait(void* param_1) { // NONMATCHING + if (field_0xa7c == 0 && field_0x844 == false) { + switch (mMode) { + case 0: + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(0, -1.0f); + setProcess(&daObj_GrA_c::standWait); + break; + + case 1: + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(0, -1.0f); + setProcess(&daObj_GrA_c::standWaitJump); + setLookMode(1); + break; + + case 2: + setProcess(&daObj_GrA_c::standRoll); + break; + + case 3: + setProcess(&daObj_GrA_c::waitDemo); + } + } + + return 1; } /* 80C0335C-80C035B8 00353C 025C+00 2/0 0/0 0/0 .text talk__11daObj_GrA_cFPv */ -void daObj_GrA_c::talk(void* param_0) { +int daObj_GrA_c::talk(void* param_1) { // NONMATCHING + int rv = 0; + switch (field_0xa7c) { + case 1: + s16 sVar1 = cLib_targetAngleY(¤t.pos, &daPy_getPlayerActorClass()->current.pos); + if (sVar1 != field_0x91a.y) { + if (field_0x1fcc < 2) { + if (turn_step(sVar1, 0, 19, 20)) { + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(0, -1.0f); + } + + return 0; + } + + turn_step(sVar1, -1, -1, 20); + } + + if (mMsgFlow.doFlow(this, NULL, 0) != 0) { + if (mMsgFlow.getChoiceNo() != 0) { + setProcess(&daObj_GrA_c::wait); + } else { + setProcess(&daObj_GrA_c::rollReturn); + } + + rv = 1; + } + + + } } -/* 80C035B8-80C036B4 003798 00FC+00 2/2 0/0 0/0 .text ctrlMsgAnm__11daObj_GrA_cFRiRiP10fopAc_ac_c - */ -void daObj_GrA_c::ctrlMsgAnm(int& param_0, int& param_1, fopAc_ac_c* param_2) { +/* 80C035B8-80C036B4 003798 00FC+00 2/2 0/0 0/0 .text ctrlMsgAnm__11daObj_GrA_cFRiRiP10fopAc_ac_c */ +void daObj_GrA_c::ctrlMsgAnm(int& param_1, int& param_2, fopAc_ac_c* param_3) { // NONMATCHING } @@ -2768,22 +2886,25 @@ void daObj_GrA_c::setPrtcl() { } /* 80C03B14-80C03B48 003CF4 0034+00 1/0 0/0 0/0 .text base000__11daObj_GrA_cFi */ -void daObj_GrA_c::base000(int param_0) { +int daObj_GrA_c::base000(int param_1) { // NONMATCHING + if (param_1 != 0) { + + } } /* 80C03B48-80C03B7C 003D28 0034+00 1/0 0/0 0/0 .text base001__11daObj_GrA_cFi */ -void daObj_GrA_c::base001(int param_0) { +int daObj_GrA_c::base001(int param_0) { // NONMATCHING } /* 80C03B7C-80C03C1C 003D5C 00A0+00 1/0 0/0 0/0 .text base003__11daObj_GrA_cFi */ -void daObj_GrA_c::base003(int param_0) { +int daObj_GrA_c::base003(int param_0) { // NONMATCHING } /* 80C03C1C-80C03CBC 003DFC 00A0+00 1/0 0/0 0/0 .text base004__11daObj_GrA_cFi */ -void daObj_GrA_c::base004(int param_0) { +int daObj_GrA_c::base004(int param_0) { // NONMATCHING } @@ -3247,27 +3368,27 @@ SECTION_RODATA static f32 const lit_10651 = 5.5f; COMPILER_STRIP_GATE(0x80C0FDFC, &lit_10651); /* 80C03CBC-80C03D54 003E9C 0098+00 1/0 0/0 0/0 .text base005__11daObj_GrA_cFi */ -void daObj_GrA_c::base005(int param_0) { +int daObj_GrA_c::base005(int param_0) { // NONMATCHING } /* 80C03D54-80C03D88 003F34 0034+00 1/0 0/0 0/0 .text base006__11daObj_GrA_cFi */ -void daObj_GrA_c::base006(int param_0) { +int daObj_GrA_c::base006(int param_0) { // NONMATCHING } /* 80C03D88-80C03DF0 003F68 0068+00 1/0 0/0 0/0 .text base007__11daObj_GrA_cFi */ -void daObj_GrA_c::base007(int param_0) { +int daObj_GrA_c::base007(int param_0) { // NONMATCHING } /* 80C03DF0-80C03E74 003FD0 0084+00 1/0 0/0 0/0 .text base008__11daObj_GrA_cFi */ -void daObj_GrA_c::base008(int param_0) { +int daObj_GrA_c::base008(int param_0) { // NONMATCHING } /* 80C03E74-80C03F14 004054 00A0+00 1/0 0/0 0/0 .text base009__11daObj_GrA_cFi */ -void daObj_GrA_c::base009(int param_0) { +int daObj_GrA_c::base009(int param_0) { // NONMATCHING } @@ -3287,7 +3408,7 @@ COMPILER_STRIP_GATE(0x80C0FE04, &lit_10706); #pragma pop /* 80C03F14-80C03FC0 0040F4 00AC+00 1/0 0/0 0/0 .text base010__11daObj_GrA_cFi */ -void daObj_GrA_c::base010(int param_0) { +int daObj_GrA_c::base010(int param_0) { // NONMATCHING } @@ -3300,132 +3421,132 @@ COMPILER_STRIP_GATE(0x80C0FE08, &lit_10768); #pragma pop /* 80C03FC0-80C04118 0041A0 0158+00 1/0 0/0 0/0 .text base013__11daObj_GrA_cFi */ -void daObj_GrA_c::base013(int param_0) { +int daObj_GrA_c::base013(int param_0) { // NONMATCHING } /* 80C04118-80C04180 0042F8 0068+00 1/0 0/0 0/0 .text base016__11daObj_GrA_cFi */ -void daObj_GrA_c::base016(int param_0) { +int daObj_GrA_c::base016(int param_0) { // NONMATCHING } /* 80C04180-80C041E8 004360 0068+00 1/0 0/0 0/0 .text base017__11daObj_GrA_cFi */ -void daObj_GrA_c::base017(int param_0) { +int daObj_GrA_c::base017(int param_0) { // NONMATCHING } /* 80C041E8-80C04260 0043C8 0078+00 1/0 0/0 0/0 .text base018__11daObj_GrA_cFi */ -void daObj_GrA_c::base018(int param_0) { +int daObj_GrA_c::base018(int param_0) { // NONMATCHING } /* 80C04260-80C042D4 004440 0074+00 1/0 0/0 0/0 .text base019__11daObj_GrA_cFi */ -void daObj_GrA_c::base019(int param_0) { +int daObj_GrA_c::base019(int param_0) { // NONMATCHING } /* 80C042D4-80C04308 0044B4 0034+00 1/0 0/0 0/0 .text base020__11daObj_GrA_cFi */ -void daObj_GrA_c::base020(int param_0) { +int daObj_GrA_c::base020(int param_0) { // NONMATCHING } /* 80C04308-80C0433C 0044E8 0034+00 1/0 0/0 0/0 .text base021__11daObj_GrA_cFi */ -void daObj_GrA_c::base021(int param_0) { +int daObj_GrA_c::base021(int param_0) { // NONMATCHING } /* 80C0433C-80C04370 00451C 0034+00 1/0 0/0 0/0 .text base022__11daObj_GrA_cFi */ -void daObj_GrA_c::base022(int param_0) { +int daObj_GrA_c::base022(int param_0) { // NONMATCHING } /* 80C04370-80C043A4 004550 0034+00 1/0 0/0 0/0 .text base023__11daObj_GrA_cFi */ -void daObj_GrA_c::base023(int param_0) { +int daObj_GrA_c::base023(int param_0) { // NONMATCHING } /* 80C043A4-80C043D8 004584 0034+00 1/0 0/0 0/0 .text base024__11daObj_GrA_cFi */ -void daObj_GrA_c::base024(int param_0) { +int daObj_GrA_c::base024(int param_0) { // NONMATCHING } /* 80C043D8-80C0440C 0045B8 0034+00 1/0 0/0 0/0 .text base025__11daObj_GrA_cFi */ -void daObj_GrA_c::base025(int param_0) { +int daObj_GrA_c::base025(int param_0) { // NONMATCHING } /* 80C0440C-80C04440 0045EC 0034+00 1/0 0/0 0/0 .text base026__11daObj_GrA_cFi */ -void daObj_GrA_c::base026(int param_0) { +int daObj_GrA_c::base026(int param_0) { // NONMATCHING } /* 80C04440-80C04478 004620 0038+00 1/0 0/0 0/0 .text face000__11daObj_GrA_cFi */ -void daObj_GrA_c::face000(int param_0) { +int daObj_GrA_c::face000(int param_0) { // NONMATCHING } /* 80C04478-80C04518 004658 00A0+00 1/0 0/0 0/0 .text face003__11daObj_GrA_cFi */ -void daObj_GrA_c::face003(int param_0) { +int daObj_GrA_c::face003(int param_0) { // NONMATCHING } /* 80C04518-80C045B8 0046F8 00A0+00 1/0 0/0 0/0 .text face004__11daObj_GrA_cFi */ -void daObj_GrA_c::face004(int param_0) { +int daObj_GrA_c::face004(int param_0) { // NONMATCHING } /* 80C045B8-80C045F0 004798 0038+00 1/0 0/0 0/0 .text face005__11daObj_GrA_cFi */ -void daObj_GrA_c::face005(int param_0) { +int daObj_GrA_c::face005(int param_0) { // NONMATCHING } /* 80C045F0-80C04628 0047D0 0038+00 1/0 0/0 0/0 .text face006__11daObj_GrA_cFi */ -void daObj_GrA_c::face006(int param_0) { +int daObj_GrA_c::face006(int param_0) { // NONMATCHING } /* 80C04628-80C04660 004808 0038+00 1/0 0/0 0/0 .text face007__11daObj_GrA_cFi */ -void daObj_GrA_c::face007(int param_0) { +int daObj_GrA_c::face007(int param_0) { // NONMATCHING } /* 80C04660-80C04700 004840 00A0+00 1/0 0/0 0/0 .text face008__11daObj_GrA_cFi */ -void daObj_GrA_c::face008(int param_0) { +int daObj_GrA_c::face008(int param_0) { // NONMATCHING } /* 80C04700-80C047A0 0048E0 00A0+00 1/0 0/0 0/0 .text face009__11daObj_GrA_cFi */ -void daObj_GrA_c::face009(int param_0) { +int daObj_GrA_c::face009(int param_0) { // NONMATCHING } /* 80C047A0-80C047D8 004980 0038+00 1/0 0/0 0/0 .text face010__11daObj_GrA_cFi */ -void daObj_GrA_c::face010(int param_0) { +int daObj_GrA_c::face010(int param_0) { // NONMATCHING } /* 80C047D8-80C04810 0049B8 0038+00 1/0 0/0 0/0 .text face011__11daObj_GrA_cFi */ -void daObj_GrA_c::face011(int param_0) { +int daObj_GrA_c::face011(int param_0) { // NONMATCHING } /* 80C04810-80C04848 0049F0 0038+00 1/0 0/0 0/0 .text face012__11daObj_GrA_cFi */ -void daObj_GrA_c::face012(int param_0) { +int daObj_GrA_c::face012(int param_0) { // NONMATCHING } /* 80C04848-80C04880 004A28 0038+00 1/0 0/0 0/0 .text face016__11daObj_GrA_cFi */ -void daObj_GrA_c::face016(int param_0) { +int daObj_GrA_c::face016(int param_0) { // NONMATCHING } /* 80C04880-80C048B8 004A60 0038+00 1/0 0/0 0/0 .text face017__11daObj_GrA_cFi */ -void daObj_GrA_c::face017(int param_0) { +int daObj_GrA_c::face017(int param_0) { // NONMATCHING } /* 80C048B8-80C048F8 004A98 0040+00 1/0 0/0 0/0 .text face999__11daObj_GrA_cFi */ -void daObj_GrA_c::face999(int param_0) { +int daObj_GrA_c::face999(int param_0) { // NONMATCHING } @@ -3641,12 +3762,12 @@ REGISTER_CTORS(0x80C04F74, __sinit_d_a_obj_gra2_cpp); #pragma pop /* 80C0536C-80C053C4 00554C 0058+00 4/4 0/0 0/0 .text getSrchCircleR__11daObj_GrA_cFv */ -void daObj_GrA_c::getSrchCircleR() { +f32 daObj_GrA_c::getSrchCircleR() { // NONMATCHING } /* 80C053C4-80C05920 0055A4 055C+00 2/0 0/0 0/0 .text standWait__11daObj_GrA_cFPv */ -void daObj_GrA_c::standWait(void* param_0) { +int daObj_GrA_c::standWait(void* param_0) { // NONMATCHING } @@ -3656,7 +3777,7 @@ void daObj_GrA_c::walk(void* param_0) { } /* 80C05F64-80C061F4 006144 0290+00 1/0 0/0 0/0 .text defence__11daObj_GrA_cFPv */ -void daObj_GrA_c::defence(void* param_0) { +int daObj_GrA_c::defence(void* param_0) { // NONMATCHING } @@ -3668,17 +3789,17 @@ SECTION_DEAD static char const* const stringBase_80C0FE60 = "F_SP109"; #pragma pop /* 80C061F4-80C067D8 0063D4 05E4+00 5/0 0/0 0/0 .text toStone__11daObj_GrA_cFPv */ -void daObj_GrA_c::toStone(void* param_0) { +int daObj_GrA_c::toStone(void* param_0) { // NONMATCHING } /* 80C067D8-80C06CDC 0069B8 0504+00 2/0 0/0 0/0 .text step__11daObj_GrA_cFPv */ -void daObj_GrA_c::step(void* param_0) { +int daObj_GrA_c::step(void* param_0) { // NONMATCHING } /* 80C06CDC-80C0780C 006EBC 0B30+00 3/0 0/0 0/0 .text rollReturn__11daObj_GrA_cFPv */ -void daObj_GrA_c::rollReturn(void* param_0) { +int daObj_GrA_c::rollReturn(void* param_0) { // NONMATCHING } @@ -3708,7 +3829,7 @@ void daObj_GrA_c::getSpeed() { } /* 80C07D38-80C083F0 007F18 06B8+00 1/0 0/0 0/0 .text standRoll__11daObj_GrA_cFPv */ -void daObj_GrA_c::standRoll(void* param_0) { +int daObj_GrA_c::standRoll(void* param_0) { // NONMATCHING } @@ -3837,7 +3958,7 @@ void daObj_GrA_c::checkGraSub(fopAc_ac_c* param_0) { } /* 80C0D000-80C0D2FC 00D1E0 02FC+00 1/0 0/0 0/0 .text waitDemo__11daObj_GrA_cFPv */ -void daObj_GrA_c::waitDemo(void* param_0) { +int daObj_GrA_c::waitDemo(void* param_0) { // NONMATCHING } @@ -3862,7 +3983,7 @@ void daObj_GrA_c::turn(s16 param_0, f32 param_1, int param_2) { } /* 80C0F17C-80C0F330 00F35C 01B4+00 2/2 0/0 0/0 .text turn_step__11daObj_GrA_cFsiii */ -void daObj_GrA_c::turn_step(s16 param_0, int param_1, int param_2, int param_3) { +BOOL daObj_GrA_c::turn_step(s16 param_0, int param_1, int param_2, int param_3) { // NONMATCHING } @@ -3903,7 +4024,7 @@ void daObj_GrA_c::getAttentionPos(fopAc_ac_c* param_0) { } /* 80C0F860-80C0FA68 00FA40 0208+00 2/0 0/0 0/0 .text standWaitJump__11daObj_GrA_cFPv */ -void daObj_GrA_c::standWaitJump(void* param_0) { +int daObj_GrA_c::standWaitJump(void* param_0) { // NONMATCHING } From c637ed819d13f762b51a131b08a2a1bca3136e21 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:39:39 -0400 Subject: [PATCH 04/21] More work --- include/JSystem/JParticle/JPAEmitter.h | 4 + include/d/actor/d_a_obj_gra2.h | 49 +- include/d/actor/d_a_tag_gra.h | 4 + include/d/d_msg_object.h | 4 + src/d/actor/d_a_obj_gra2.cpp | 1548 ++++++++++++------------ 5 files changed, 833 insertions(+), 776 deletions(-) diff --git a/include/JSystem/JParticle/JPAEmitter.h b/include/JSystem/JParticle/JPAEmitter.h index f7a3f85f854..63322b84128 100644 --- a/include/JSystem/JParticle/JPAEmitter.h +++ b/include/JSystem/JParticle/JPAEmitter.h @@ -210,6 +210,10 @@ class JPABaseEmitter { JPAEmitterCallBack* getEmitterCallBackPtr() const { return mpEmtrCallBack; } u32 getAge() const { return mTick; } + void setVolumeMiniRadius(f32 param_1) { + mVolumeMinRad = param_1; + } + public: /* 0x00 */ JGeometry::TVec3 mLocalScl; /* 0x0C */ JGeometry::TVec3 mLocalTrs; diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index a146b3564ae..95b2cfc6fdc 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -15,7 +15,7 @@ class daObj_GrA_Param_c { public: - /* 80C04B1C */ ~daObj_GrA_Param_c(); + /* 80C04B1C */ virtual ~daObj_GrA_Param_c() {} struct Data { /* 0x00 */ f32 field_0x00; @@ -88,10 +88,15 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { class daObj_GrA_prtclMngr_c { public: - /* 80C04E14 */ ~daObj_GrA_prtclMngr_c(); - /* 80C04E50 */ daObj_GrA_prtclMngr_c(); + /* 80C04E14 */ ~daObj_GrA_prtclMngr_c() {} + /* 80C04E50 */ daObj_GrA_prtclMngr_c() {} - /* 0x00 */ u8 field_0x0[0x24 - 0x0]; + /* 0x00 */ s8 field_0x0; + /* 0x01 */ u8 field_0x1[0x4 - 0x1]; + /* 0x04 */ cXyz field_0x4; + /* 0x10 */ csXyz field_0x10; + /* 0x16 */ u8 field_0x16[2]; + /* 0x18 */ cXyz field_0x18; /* 0x24 */ dPaPo_c* field_0x24[6]; /* 0x3C */ u8 field_0x3c[0x5c - 0x3c]; }; @@ -136,10 +141,10 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C0308C */ int hitChk(); /* 80C031E4 */ int wait(void*); /* 80C0335C */ int talk(void*); - /* 80C035B8 */ void ctrlMsgAnm(int&, int&, fopAc_ac_c*); - /* 80C03720 */ void checkTagGraSub(fopAc_ac_c*); - /* 80C03764 */ void fallAbyssCheck(); - /* 80C03830 */ void setPrtcl(); + /* 80C035B8 */ int ctrlMsgAnm(int&, int&, fopAc_ac_c*); + /* 80C03720 */ bool checkTagGraSub(fopAc_ac_c*); + /* 80C03764 */ BOOL fallAbyssCheck(); + /* 80C03830 */ int setPrtcl(); /* 80C03B14 */ int base000(int); /* 80C03B48 */ int base001(int); /* 80C03B7C */ int base003(int); @@ -176,11 +181,11 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C04848 */ int face016(int); /* 80C04880 */ int face017(int); /* 80C048B8 */ int face999(int); - /* 80C048F8 */ void evtcutTalk(int, int); + /* 80C048F8 */ int evtcutTalk(int, int); /* 80C04A0C */ void setFaceTalkAfter(); /* 80C0536C */ f32 getSrchCircleR(); /* 80C053C4 */ int standWait(void*); - /* 80C05920 */ void walk(void*); + /* 80C05920 */ int walk(void*); /* 80C05F64 */ int defence(void*); /* 80C061F4 */ int toStone(void*); /* 80C067D8 */ int step(void*); @@ -212,7 +217,7 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C0C84C */ void initCrazyAttack(); /* 80C0CA64 */ void executeCrazyJumping(); /* 80C0CDBC */ void modeChangeCheck(); - /* 80C0CF98 */ void checkGraSub(fopAc_ac_c*); + /* 80C0CF98 */ bool checkGraSub(fopAc_ac_c*); /* 80C0D000 */ int waitDemo(void*); /* 80C0D2FC */ void skipDemoGra(); /* 80C0D3E0 */ void startDemo(void*); @@ -242,7 +247,7 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x0A4C */ daObj_GrA_Param_c* field_0xa4c; /* 0x0A50 */ Process field_0xa50; /* 0x0A5C */ request_of_phase_process_class* field_0xa5c[8]; - /* 0x0A7C */ s16 field_0xa7c; + /* 0x0A7C */ u16 field_0xa7c; /* 0x0A7E */ u8 mMode; /* 0x0A7F */ u8 field_0xa7f; /* 0x0A80 */ u8 field_0xa80[0xa88 - 0xa80]; @@ -258,13 +263,14 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x0A9C */ int field_0xa9c; /* 0x0AA0 */ int field_0xaa0; /* 0x0AA4 */ int field_0xaa4; - /* 0x0AA8 */ u8 field_0xaa8[0xaac - 0xaa8]; + /* 0x0AA8 */ int field_0xaa8; /* 0x0AAC */ int field_0xaac; /* 0x0AB0 */ daBaseNpc_acMngr_c field_0xab0; /* 0x0AB8 */ daObj_GrA_prtclMngr_c field_0xab8[6]; /* 0x0CE0 */ dCcD_Sph field_0xce0[2]; /* 0x0F50 */ dCcD_Cyl field_0xf50; - /* 0x108C */ u8 field_0x108c[0x109c - 0x108c]; + /* 0x108C */ cXyz field_0x108c; + /* 0x1098 */ f32 field_0x1098; /* 0x109C */ int field_0x109c; /* 0x10A0 */ int field_0x10a0; /* 0x10A4 */ int field_0x10a4; @@ -288,13 +294,15 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x1504 */ int mLookMode; /* 0x1508 */ int field_0x1508; /* 0x150C */ int field_0x150c; - /* 0x1510 */ u8 field_0x1510[0x1520 - 0x1510]; + /* 0x1510 */ u8 field_0x1510[0x1518 - 0x1510]; + /* 0x1518 */ int field_0x1518; + /* 0x151C */ u8 field_0x151c[0x1520 - 0x151c]; /* 0x1520 */ int field_0x1520; /* 0x1524 */ u8 field_0x1524[0x1528 - 0x1524]; /* 0x1528 */ daBaseNpc_path_c field_0x1528; /* 0x1F4C */ dBgS_LinkLinChk field_0x1f4c; /* 0x1FBC */ int field_0x1fbc; - /* 0x1FC0 */ u8 field_0x1fc0[0x1fc4 - 0x1fc0]; + /* 0x1FC0 */ int field_0x1fc0; /* 0x1FC4 */ u8 field_0x1fc4; /* 0x1FC5 */ u8 field_0x1fc5[0x1fcc - 0x1fc5]; /* 0x1FCC */ int field_0x1fcc; @@ -317,14 +325,15 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x2006 */ u8 field_0x2006[0x2008 - 0x2006]; /* 0x2008 */ f32 field_0x2008; /* 0x200C */ u16 field_0x200c; - /* 0x200E */ u8 field_0x200e[0x2014 - 0x200e]; + /* 0x200E */ u8 field_0x200e[0x2010 - 0x200e]; + /* 0x2010 */ int field_0x2010; /* 0x2014 */ u8 field_0x2014; /* 0x2015 */ u8 field_0x2015[0x201c - 0x2015]; - /* 0x201C */ u8 field_0x201c; + /* 0x201C */ s8 field_0x201c; /* 0x201D */ u8 field_0x201d; /* 0x201E */ u8 field_0x201e[0x2020 - 0x201e]; - /* 0x2020 */ int field_0x2020[3]; - /* 0x202C */ u8 field_0x202c[0x2030 - 0x202c]; + /* 0x2020 */ u32 field_0x2020[3]; + /* 0x202C */ u32 field_0x202c; /* 0x2030 */ u8 field_0x2030; /* 0x2031 */ u8 field_0x2031; /* 0x2032 */ u8 field_0x2032; diff --git a/include/d/actor/d_a_tag_gra.h b/include/d/actor/d_a_tag_gra.h index 3bd492dabf3..c7715cfdb98 100644 --- a/include/d/actor/d_a_tag_gra.h +++ b/include/d/actor/d_a_tag_gra.h @@ -13,6 +13,10 @@ class daTagGra_c : public fopAc_ac_c { return (fopAcM_GetParam(this) >> 16) & 0xFF; } + s16 getGraNo() { + return fopAcM_GetParam(this) & 0xFF; + } + int create() { fopAcM_SetupActor(this, daTagGra_c); diff --git a/include/d/d_msg_object.h b/include/d/d_msg_object.h index 611e9b0d364..82a62c7fdf0 100644 --- a/include/d/d_msg_object.h +++ b/include/d/d_msg_object.h @@ -543,6 +543,10 @@ inline s16 dMsgObject_getSelectBombPrice() { dMsgObject_getMsgObjectClass()->getSelectBombPrice(); } +inline bool dMsgObject_isMouthCheck() { + return dMsgObject_getMsgObjectClass()->isMouthCheck(); +} + class dMsgObject_HowlHIO_c { public: /* 80232AEC */ dMsgObject_HowlHIO_c(); diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index 8e95b44476e..1c473fa0407 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -5,11 +5,14 @@ #include "d/actor/d_a_obj_gra2.h" #include "Z2AudioLib/Z2Instances.h" +#include "d/actor/d_a_tag_gra.h" #include "d/d_bg_w.h" #include "d/d_cc_uty.h" #include "d/d_com_inf_game.h" #include "dol2asm.h" #include "d/d_camera.h" +#include "d/d_msg_object.h" +#include // // Forward References: @@ -478,14 +481,14 @@ static int l_btpGetParamList[8] = { }; /* 80C1002C-80C10044 0001C4 0016+02 1/2 0/0 0/0 .data l_eventMotionChangeTable */ -static s16 l_eventMotionChangeTable[11] = { +static u16 l_eventMotionChangeTable[11] = { 0, 1, 0, 2, 3, 0, 0, 0, 0, 0, 0, }; /* 80C10044-80C1004C 0001DC 0008+00 1/2 0/0 0/0 .data l_eventFaceChangeTable */ -static s16 l_eventFaceChangeTable[4] = { +static u16 l_eventFaceChangeTable[4] = { 1, 2, 6, 7, }; @@ -2785,10 +2788,21 @@ int daObj_GrA_c::wait(void* param_1) { /* 80C0335C-80C035B8 00353C 025C+00 2/0 0/0 0/0 .text talk__11daObj_GrA_cFPv */ int daObj_GrA_c::talk(void* param_1) { // NONMATCHING + int iVar1, iVar2; int rv = 0; + int iVar3; + int iVar4 = field_0x848; + s16 sVar1; switch (field_0xa7c) { + case 0: + field_0x1fcc = 0; + mMsgFlow.init(this, iVar4, 0, NULL); + setLookMode(1); + field_0xaa0 = 0; + break; + case 1: - s16 sVar1 = cLib_targetAngleY(¤t.pos, &daPy_getPlayerActorClass()->current.pos); + sVar1 = cLib_targetAngleY(¤t.pos, &daPy_getPlayerActorClass()->current.pos); if (sVar1 != field_0x91a.y) { if (field_0x1fcc < 2) { if (turn_step(sVar1, 0, 19, 20)) { @@ -2803,6 +2817,17 @@ int daObj_GrA_c::talk(void* param_1) { } if (mMsgFlow.doFlow(this, NULL, 0) != 0) { + #ifdef DEBUG + char* cVar1; + int choiceNo = mMsgFlow.getChoiceNo(); + if (choiceNo != 0) { + cVar1 = "はい"; // Yes + } else { + cVar1 = "いいえ"; // No + } + OS_REPORT("二択分岐 %s %d\n", cVar1, choiceNo); + #endif + if (mMsgFlow.getChoiceNo() != 0) { setProcess(&daObj_GrA_c::wait); } else { @@ -2812,861 +2837,651 @@ int daObj_GrA_c::talk(void* param_1) { rv = 1; } - - } -} - -/* 80C035B8-80C036B4 003798 00FC+00 2/2 0/0 0/0 .text ctrlMsgAnm__11daObj_GrA_cFRiRiP10fopAc_ac_c */ -void daObj_GrA_c::ctrlMsgAnm(int& param_1, int& param_2, fopAc_ac_c* param_3) { - // NONMATCHING -} + iVar3 = field_0xaa0; + if (ctrlMsgAnm(iVar1, iVar2, this) != 0) { + if (iVar2 != -1) { + setBaseMotion(l_eventMotionChangeTable[iVar2], daObj_GrA_Param_c::m.field_0x0c); + } -/* 80C036B4-80C03720 003894 006C+00 2/2 0/0 0/0 .text s_sub__FPvPv */ -static void s_sub(void* param_0, void* param_1) { - // NONMATCHING -} + if (iVar1 != -1) { + setFaceMotion(l_eventFaceChangeTable[iVar1], -1.0f); + } + } else if (iVar3 != 0) { + setFaceTalkAfter(); + } + break; -/* 80C03720-80C03764 003900 0044+00 1/1 0/0 0/0 .text checkTagGraSub__11daObj_GrA_cFP10fopAc_ac_c - */ -void daObj_GrA_c::checkTagGraSub(fopAc_ac_c* param_0) { - // NONMATCHING -} + case 2: + dComIfGp_event_reset(); + rv = 1; + field_0x1fcc = 0; + } -/* 80C03764-80C03830 003944 00CC+00 1/1 0/0 0/0 .text fallAbyssCheck__11daObj_GrA_cFv */ -void daObj_GrA_c::fallAbyssCheck() { - // NONMATCHING + return rv; } -/* ############################################################################################## */ -/* 80C0FCC8-80C0FCCC 00024C 0004+00 0/7 0/0 0/0 .rodata @6054 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6054 = 0.25f; -COMPILER_STRIP_GATE(0x80C0FCC8, &lit_6054); -#pragma pop +/* 80C035B8-80C036B4 003798 00FC+00 2/2 0/0 0/0 .text ctrlMsgAnm__11daObj_GrA_cFRiRiP10fopAc_ac_c */ +int daObj_GrA_c::ctrlMsgAnm(int& param_1, int& param_2, fopAc_ac_c* param_3) { + param_1 = -1; + param_2 = -1; + + dMsgObject_c* msg_p = (dMsgObject_c*)dMsgObject_c::getActor(); + JUT_ASSERT(3163, 0 != msg_p); + + if (msg_p->mode == 2 || msg_p->mode == 3) { + field_0xa9c = -1; + } else if (msg_p->mode == 6) { + if (msg_p->msg_idx != field_0xa9c) { + param_1 = dComIfGp_getMesgFaceAnimeAttrInfo(); + param_2 = dComIfGp_getMesgAnimeAttrInfo(); + field_0xa9c = msg_p->msg_idx; + } -/* 80C0FCCC-80C0FCD0 000250 0004+00 0/6 0/0 0/0 .rodata @6055 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6055 = 3.5f; -COMPILER_STRIP_GATE(0x80C0FCCC, &lit_6055); -#pragma pop + if (dMsgObject_isMouthCheck()) { + cLib_offBit(field_0x840, 0x100); + } else { + cLib_onBit(field_0x840, 0x100); + } -/* 80C0FCD0-80C0FCD8 000254 0006+02 0/1 0/0 0/0 .rodata l_prticles_id$6229 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const l_prticles_id[6 + 2 /* padding */] = { - 0x83, - 0xB5, - 0x83, - 0xB6, - 0x83, - 0xB7, - /* padding */ - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FCD0, &l_prticles_id); -#pragma pop + field_0xaa0 = 20; + } else { + if (cLib_checkBit(field_0x840, 0x100) != 0) { + cLib_offBit(field_0x840, 0x100); + } -/* 80C0FCD8-80C0FCDC 00025C 0004+00 0/1 0/0 0/0 .rodata @6320 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6320 = 7.0f / 10.0f; -COMPILER_STRIP_GATE(0x80C0FCD8, &lit_6320); -#pragma pop + field_0xa9c = -1; + } -/* 80C0FCDC-80C0FCE0 000260 0004+00 1/8 0/0 0/0 .rodata @6321 */ -SECTION_RODATA static f32 const lit_6321 = 2.0f; -COMPILER_STRIP_GATE(0x80C0FCDC, &lit_6321); + cLib_calcTimer(&field_0xaa0); -/* 80C03830-80C03B14 003A10 02E4+00 1/1 0/0 0/0 .text setPrtcl__11daObj_GrA_cFv */ -void daObj_GrA_c::setPrtcl() { - // NONMATCHING + return field_0xaa0; } -/* 80C03B14-80C03B48 003CF4 0034+00 1/0 0/0 0/0 .text base000__11daObj_GrA_cFi */ -int daObj_GrA_c::base000(int param_1) { - // NONMATCHING - if (param_1 != 0) { - +/* 80C036B4-80C03720 003894 006C+00 2/2 0/0 0/0 .text s_sub__FPvPv */ +static void* s_sub(void* i_actor, void* i_data) { + daObj_GrA_c* i_this = (daObj_GrA_c*)i_data; + if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_TAG_GRA && i_this->checkTagGraSub((fopAc_ac_c*)i_actor)) { + return i_actor; } + return NULL; } -/* 80C03B48-80C03B7C 003D28 0034+00 1/0 0/0 0/0 .text base001__11daObj_GrA_cFi */ -int daObj_GrA_c::base001(int param_0) { +/* 80C03720-80C03764 003900 0044+00 1/1 0/0 0/0 .text checkTagGraSub__11daObj_GrA_cFP10fopAc_ac_c */ +bool daObj_GrA_c::checkTagGraSub(fopAc_ac_c* a_this) { // NONMATCHING + daTagGra_c* i_this = (daTagGra_c*)a_this; + return (getTagNo() & 0xFFFF) == i_this->getGraNo(); } -/* 80C03B7C-80C03C1C 003D5C 00A0+00 1/0 0/0 0/0 .text base003__11daObj_GrA_cFi */ -int daObj_GrA_c::base003(int param_0) { - // NONMATCHING -} +/* 80C03764-80C03830 003944 00CC+00 1/1 0/0 0/0 .text fallAbyssCheck__11daObj_GrA_cFv */ +BOOL daObj_GrA_c::fallAbyssCheck() { + if (mGroundY == -1000000000.0f && field_0x1528.isPath()) { + field_0x1fc0++; + if (field_0x1fc0 == 30) { + current.pos = field_0x1528.getPntPos(0); + old.pos = current.pos; + field_0x1528.setIdx(0); + field_0x1fc0 = 0; + + return TRUE; + } + } else { + field_0x1fc0 = 0; + } -/* 80C03C1C-80C03CBC 003DFC 00A0+00 1/0 0/0 0/0 .text base004__11daObj_GrA_cFi */ -int daObj_GrA_c::base004(int param_0) { - // NONMATCHING + return FALSE; } -/* ############################################################################################## */ -/* 80C0FCE0-80C0FCE4 000264 0004+00 1/1 0/0 0/0 .rodata @6330 */ -SECTION_RODATA static f32 const lit_6330 = 10.0f; -COMPILER_STRIP_GATE(0x80C0FCE0, &lit_6330); - -/* 80C0FCE4-80C0FCE8 000268 0004+00 0/2 0/0 0/0 .rodata @6478 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6478 = 4.0f; -COMPILER_STRIP_GATE(0x80C0FCE4, &lit_6478); -#pragma pop - -/* 80C0FCE8-80C0FCEC 00026C 0004+00 0/1 0/0 0/0 .rodata @6479 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6479 = 0xBEE568FF; -COMPILER_STRIP_GATE(0x80C0FCE8, &lit_6479); -#pragma pop - -/* 80C0FCEC-80C0FCF0 000270 0004+00 0/1 0/0 0/0 .rodata @6480 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6480 = 0xBF2C65D1; -COMPILER_STRIP_GATE(0x80C0FCEC, &lit_6480); -#pragma pop - -/* 80C0FCF0-80C0FCF4 000274 0004+00 0/1 0/0 0/0 .rodata @6481 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6481 = 0x3FE597C7; -COMPILER_STRIP_GATE(0x80C0FCF0, &lit_6481); -#pragma pop - -/* 80C0FCF4-80C0FCF8 000278 0004+00 0/1 0/0 0/0 .rodata @6482 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6482 = 0xBF67A157; -COMPILER_STRIP_GATE(0x80C0FCF4, &lit_6482); -#pragma pop - -/* 80C0FCF8-80C0FCFC 00027C 0004+00 0/5 0/0 0/0 .rodata @6483 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6483 = 300.0f; -COMPILER_STRIP_GATE(0x80C0FCF8, &lit_6483); -#pragma pop - -/* 80C0FCFC-80C0FD00 000280 0004+00 0/3 0/0 0/0 .rodata @6651 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6651 = 50.0f; -COMPILER_STRIP_GATE(0x80C0FCFC, &lit_6651); -#pragma pop - -/* 80C0FD00-80C0FD04 000284 0004+00 0/1 0/0 0/0 .rodata @6722 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6722 = 4.0f / 5.0f; -COMPILER_STRIP_GATE(0x80C0FD00, &lit_6722); -#pragma pop - -/* 80C0FD04-80C0FD08 000288 0004+00 0/2 0/0 0/0 .rodata @6723 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6723 = 45.0f; -COMPILER_STRIP_GATE(0x80C0FD04, &lit_6723); -#pragma pop - -/* 80C0FD08-80C0FD0C 00028C 0004+00 0/1 0/0 0/0 .rodata @6873 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6873 = 95.0f; -COMPILER_STRIP_GATE(0x80C0FD08, &lit_6873); -#pragma pop - -/* 80C0FD0C-80C0FD10 000290 0004+00 1/3 0/0 0/0 .rodata @6874 */ -SECTION_RODATA static f32 const lit_6874 = 12.0f; -COMPILER_STRIP_GATE(0x80C0FD0C, &lit_6874); - -/* 80C0FD10-80C0FD14 000294 0004+00 1/2 0/0 0/0 .rodata @7003 */ -SECTION_RODATA static f32 const lit_7003 = 3.0f; -COMPILER_STRIP_GATE(0x80C0FD10, &lit_7003); - -/* 80C0FD14-80C0FD18 000298 0004+00 0/1 0/0 0/0 .rodata @7004 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7004 = 9.0f; -COMPILER_STRIP_GATE(0x80C0FD14, &lit_7004); -#pragma pop - -/* 80C0FD18-80C0FD1C 00029C 0004+00 0/1 0/0 0/0 .rodata @7005 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7005 = 24.0f; -COMPILER_STRIP_GATE(0x80C0FD18, &lit_7005); -#pragma pop - -/* 80C0FD1C-80C0FD20 0002A0 0004+00 0/5 0/0 0/0 .rodata @7312 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7312 = 150.0f; -COMPILER_STRIP_GATE(0x80C0FD1C, &lit_7312); -#pragma pop - -/* 80C0FD20-80C0FD24 0002A4 0004+00 0/3 0/0 0/0 .rodata @7313 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7313 = 14.0f; -COMPILER_STRIP_GATE(0x80C0FD20, &lit_7313); -#pragma pop - -/* 80C0FD24-80C0FD28 0002A8 0004+00 0/2 0/0 0/0 .rodata @7314 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7314 = 1.0f / 20.0f; -COMPILER_STRIP_GATE(0x80C0FD24, &lit_7314); -#pragma pop - -/* 80C0FD28-80C0FD2C 0002AC 0004+00 0/6 0/0 0/0 .rodata @7315 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7315 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x80C0FD28, &lit_7315); -#pragma pop - -/* 80C0FD2C-80C0FD34 0002B0 0008+00 1/1 0/0 0/0 .rodata @7443 */ -SECTION_RODATA static u8 const lit_7443[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C0FD2C, &lit_7443); - -/* 80C0FD34-80C0FD38 0002B8 0004+00 0/2 0/0 0/0 .rodata @7613 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7613 = -30.0f; -COMPILER_STRIP_GATE(0x80C0FD34, &lit_7613); -#pragma pop - -/* 80C0FD38-80C0FD3C 0002BC 0004+00 0/2 0/0 0/0 .rodata @7996 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7996 = 1800.0f; -COMPILER_STRIP_GATE(0x80C0FD38, &lit_7996); -#pragma pop - -/* 80C0FD3C-80C0FD40 0002C0 0004+00 0/2 0/0 0/0 .rodata @7997 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7997 = 2000.0f; -COMPILER_STRIP_GATE(0x80C0FD3C, &lit_7997); -#pragma pop - -/* 80C0FD40-80C0FD44 0002C4 0004+00 0/2 0/0 0/0 .rodata @7998 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7998 = -4500.0f; -COMPILER_STRIP_GATE(0x80C0FD40, &lit_7998); -#pragma pop - -/* 80C0FD44-80C0FD48 0002C8 0004+00 1/4 0/0 0/0 .rodata @7999 */ -SECTION_RODATA static f32 const lit_7999 = 30.0f; -COMPILER_STRIP_GATE(0x80C0FD44, &lit_7999); - -/* 80C0FD48-80C0FD4C 0002CC 0004+00 0/2 0/0 0/0 .rodata @8701 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8701 = 250.0f; -COMPILER_STRIP_GATE(0x80C0FD48, &lit_8701); -#pragma pop - -/* 80C0FD4C-80C0FD50 0002D0 0004+00 0/2 0/0 0/0 .rodata @8702 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8702 = 500.0f; -COMPILER_STRIP_GATE(0x80C0FD4C, &lit_8702); -#pragma pop - -/* 80C0FD50-80C0FD54 0002D4 0004+00 0/1 0/0 0/0 .rodata @8703 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8703 = 55.0f; -COMPILER_STRIP_GATE(0x80C0FD50, &lit_8703); -#pragma pop - -/* 80C0FD54-80C0FD58 0002D8 0004+00 0/1 0/0 0/0 .rodata @8704 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8704 = 210.0f; -COMPILER_STRIP_GATE(0x80C0FD54, &lit_8704); -#pragma pop - -/* 80C0FD58-80C0FD5C 0002DC 0004+00 0/1 0/0 0/0 .rodata @8705 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8705 = -335.0f; -COMPILER_STRIP_GATE(0x80C0FD58, &lit_8705); -#pragma pop - -/* 80C0FD5C-80C0FD60 0002E0 0004+00 0/1 0/0 0/0 .rodata @8706 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8706 = 17.0f; -COMPILER_STRIP_GATE(0x80C0FD5C, &lit_8706); -#pragma pop - -/* 80C0FD60-80C0FD64 0002E4 0004+00 0/1 0/0 0/0 .rodata @8956 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8956 = 3.0f / 20.0f; -COMPILER_STRIP_GATE(0x80C0FD60, &lit_8956); -#pragma pop - -/* 80C0FD64-80C0FD68 0002E8 0004+00 0/3 0/0 0/0 .rodata @8957 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8957 = 60.0f; -COMPILER_STRIP_GATE(0x80C0FD64, &lit_8957); -#pragma pop - -/* 80C0FD68-80C0FD6C 0002EC 0004+00 0/2 0/0 0/0 .rodata @8958 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8958 = -300.0f; -COMPILER_STRIP_GATE(0x80C0FD68, &lit_8958); -#pragma pop - -/* 80C0FD6C-80C0FD70 0002F0 0004+00 0/2 0/0 0/0 .rodata @8959 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_8959 = 90.0f; -COMPILER_STRIP_GATE(0x80C0FD6C, &lit_8959); -#pragma pop - -/* 80C0FD70-80C0FD74 0002F4 0004+00 0/1 0/0 0/0 .rodata @9046 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_9046 = -200.0f; -COMPILER_STRIP_GATE(0x80C0FD70, &lit_9046); -#pragma pop - -/* 80C0FD74-80C0FD78 0002F8 0004+00 0/3 0/0 0/0 .rodata @9047 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_9047 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x80C0FD74, &lit_9047); -#pragma pop - -/* 80C0FD78-80C0FD7C 0002FC 0004+00 0/1 0/0 0/0 .rodata @9205 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_9205 = 5.0f; -COMPILER_STRIP_GATE(0x80C0FD78, &lit_9205); -#pragma pop - -/* 80C0FD7C-80C0FD80 000300 0004+00 1/2 0/0 0/0 .rodata @9223 */ -SECTION_RODATA static f32 const lit_9223 = -120.0f; -COMPILER_STRIP_GATE(0x80C0FD7C, &lit_9223); - -/* 80C0FD80-80C0FD84 000304 0004+00 1/3 0/0 0/0 .rodata @9280 */ -SECTION_RODATA static f32 const lit_9280 = -110.0f; -COMPILER_STRIP_GATE(0x80C0FD80, &lit_9280); - -/* 80C0FD84-80C0FD8C 000308 0008+00 0/1 0/0 0/0 .rodata @9333 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_9333[8] = { - 0x3F, 0xC9, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9A, -}; -COMPILER_STRIP_GATE(0x80C0FD84, &lit_9333); -#pragma pop - -/* 80C0FD8C-80C0FD90 000310 0004+00 0/2 0/0 0/0 .rodata @9334 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_9334 = -7.0f / 10.0f; -COMPILER_STRIP_GATE(0x80C0FD8C, &lit_9334); -#pragma pop - -/* 80C0FD90-80C0FD94 000314 0004+00 0/2 0/0 0/0 .rodata @9385 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_9385 = -4.0f; -COMPILER_STRIP_GATE(0x80C0FD90, &lit_9385); -#pragma pop - -/* 80C0FD94-80C0FD98 000318 0004+00 0/1 0/0 0/0 .rodata @9464 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_9464 = -1.0f / 10.0f; -COMPILER_STRIP_GATE(0x80C0FD94, &lit_9464); -#pragma pop - -/* 80C0FD98-80C0FD9C 00031C 0004+00 0/1 0/0 0/0 .rodata @10241 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10241 = 700.0f; -COMPILER_STRIP_GATE(0x80C0FD98, &lit_10241); -#pragma pop - -/* 80C0FD9C-80C0FDA0 000320 0004+00 0/1 0/0 0/0 .rodata @10242 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10242 = 3.0f / 50.0f; -COMPILER_STRIP_GATE(0x80C0FD9C, &lit_10242); -#pragma pop - -/* 80C0FDA0-80C0FDA4 000324 0004+00 0/1 0/0 0/0 .rodata @10243 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10243 = 70.0f; -COMPILER_STRIP_GATE(0x80C0FDA0, &lit_10243); -#pragma pop - -/* 80C0FDA4-80C0FDA8 000328 0004+00 0/1 0/0 0/0 .rodata @10244 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10244 = 230.0f; -COMPILER_STRIP_GATE(0x80C0FDA4, &lit_10244); -#pragma pop +/* 80C03830-80C03B14 003A10 02E4+00 1/1 0/0 0/0 .text setPrtcl__11daObj_GrA_cFv */ +int daObj_GrA_c::setPrtcl() { + // NONMATCHING + static u16 const l_prticles_id[3] = { + 0x83B5, + 0x83B6, + 0x83B7, + }; -/* 80C0FDA8-80C0FDAC 00032C 0004+00 0/1 0/0 0/0 .rodata @10245 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10245 = 1.0f / 100.0f; -COMPILER_STRIP_GATE(0x80C0FDA8, &lit_10245); -#pragma pop + csXyz* pcVar8; + cXyz* pcVar7; + int iVar1; -/* 80C0FDAC-80C0FDB0 000330 0004+00 0/1 0/0 0/0 .rodata @10246 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10246 = 280.0f; -COMPILER_STRIP_GATE(0x80C0FDAC, &lit_10246); -#pragma pop + for (int i = 0; i < 6; i++) { + if (i == 2 || i == 3 || i == 5) { + iVar1 = 1; + } else { + iVar1 = 0; + } -/* 80C0FDB0-80C0FDB4 000334 0004+00 0/1 0/0 0/0 .rodata @10247 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10247 = -50.0f; -COMPILER_STRIP_GATE(0x80C0FDB0, &lit_10247); -#pragma pop + // if (field_0xab8[i].field_0x0 == 1) { + // pcVar8 = &field_0xab8[i].field_0x10; + // } -/* 80C0FDB4-80C0FDB8 000338 0004+00 0/1 0/0 0/0 .rodata @10248 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10248 = -800.0f; -COMPILER_STRIP_GATE(0x80C0FDB4, &lit_10248); -#pragma pop + // if (field_0xab8[i].field_0x0 == 1) { + // pcVar7 = &field_0xab8[i].field_0x4; + // } -/* 80C0FDB8-80C0FDBC 00033C 0004+00 0/1 0/0 0/0 .rodata @10249 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10249 = 35.0f; -COMPILER_STRIP_GATE(0x80C0FDB8, &lit_10249); -#pragma pop + field_0xab8[i].field_0x24[i]->setEffectCenter(&tevStr, &field_0xab8[i].field_0x4, iVar1, 0, &field_0xab8[i].field_0x4, &field_0xab8[i].field_0x10, NULL, fopAcM_GetRoomNo(this), 0.0f, speedF); -/* 80C0FDBC-80C0FDC0 000340 0004+00 0/1 0/0 0/0 .rodata @10250 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10250 = 7.0f / 20.0f; -COMPILER_STRIP_GATE(0x80C0FDBC, &lit_10250); -#pragma pop + if (field_0xab8[i].field_0x0 != 0) { + JPABaseEmitter* centerEmitter = field_0xab8[i].field_0x24[i]->getCenterEmitter(0, 0); + if (centerEmitter != NULL) { + switch (i) { + case 0: + case 1: + field_0xab8[i].field_0x18.set(0.7f, 0.7f, 0.7f); + centerEmitter->setAwayFromCenterSpeed(0.0f); + centerEmitter->setRandomDirectionSpeed(0.0f); + centerEmitter->setSpread(1.0f); + centerEmitter->setGlobalParticleScale(field_0xab8[i].field_0x18); + break; -/* 80C0FDC0-80C0FDC4 000344 0004+00 0/0 0/0 0/0 .rodata @10251 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10251 = 80.0f; -COMPILER_STRIP_GATE(0x80C0FDC0, &lit_10251); -#pragma pop + case 5: + field_0xab8[i].field_0x18.set(2.0f, 2.0f, 2.0f); + break; -/* 80C0FDC4-80C0FDC8 000348 0004+00 0/0 0/0 0/0 .rodata @10252 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_10252 = 0x4312170A; -COMPILER_STRIP_GATE(0x80C0FDC4, &lit_10252); -#pragma pop + case 4: + centerEmitter->setVolumeSize(40); + centerEmitter->setVolumeMiniRadius(1.0f); + centerEmitter->setDirectionalSpeed(0.0f); + break; + } + } -/* 80C0FDC8-80C0FDCC 00034C 0004+00 0/0 0/0 0/0 .rodata @10253 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_10253 = 0x4321F852; -COMPILER_STRIP_GATE(0x80C0FDC8, &lit_10253); -#pragma pop + field_0xab8[i].field_0x0 = 0; + } + } -/* 80C0FDCC-80C0FDD0 000350 0004+00 1/1 0/0 0/0 .rodata @10254 */ -SECTION_RODATA static f32 const lit_10254 = 6.0f; -COMPILER_STRIP_GATE(0x80C0FDCC, &lit_10254); + if (field_0x201d == 1) { + cXyz sp28(current.pos); + cXyz sp34(1.0f, 1.0f, 1.0f); -/* 80C0FDD0-80C0FDD4 000354 0004+00 0/0 0/0 0/0 .rodata @10255 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10255 = 13.0f; -COMPILER_STRIP_GATE(0x80C0FDD0, &lit_10255); -#pragma pop + for (int i = 0; i < 3; i++) { + if (i == 0) { + field_0x2020[i] = dComIfGp_particle_set(field_0x2020[i], l_prticles_id[i], &sp28, &tevStr, ¤t.angle, + &sp34, 0xFF, NULL, -1, NULL, NULL, NULL); + } else { + field_0x2020[i] = dComIfGp_particle_setPolyColor(field_0x2020[i], l_prticles_id[i], mAcch.m_gnd, &sp28, + &tevStr, ¤t.angle, &sp34, 0, NULL, -1, NULL); + } -/* 80C0FDD4-80C0FDD8 000358 0004+00 0/0 0/0 0/0 .rodata @10256 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10256 = -1482.0f; -COMPILER_STRIP_GATE(0x80C0FDD4, &lit_10256); -#pragma pop + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(field_0x2020[i]); + if (emitter != NULL) { + emitter->setGlobalTranslation(sp28.x, sp28.y, sp28.z); + } + } + } -/* 80C0FDD8-80C0FDDC 00035C 0004+00 0/0 0/0 0/0 .rodata @10257 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10257 = 3650.0f; -COMPILER_STRIP_GATE(0x80C0FDD8, &lit_10257); -#pragma pop + field_0x201d = 0; -/* 80C0FDDC-80C0FDE0 000360 0004+00 0/0 0/0 0/0 .rodata @10258 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10258 = -4459.0f; -COMPILER_STRIP_GATE(0x80C0FDDC, &lit_10258); -#pragma pop + return 1; +} -/* 80C0FDE0-80C0FDE4 000364 0004+00 1/2 0/0 0/0 .rodata @10292 */ -SECTION_RODATA static u32 const lit_10292 = 0x3BB40000; -COMPILER_STRIP_GATE(0x80C0FDE0, &lit_10292); +/* 80C03B14-80C03B48 003CF4 0034+00 1/0 0/0 0/0 .text base000__11daObj_GrA_cFi */ +int daObj_GrA_c::base000(int param_1) { + if (param_1 != 0) { + setBaseAnm(0, field_0xa94); + } -/* 80C0FDE4-80C0FDE8 000368 0004+00 1/3 0/0 0/0 .rodata @10293 */ -SECTION_RODATA static f32 const lit_10293 = 180.0f; -COMPILER_STRIP_GATE(0x80C0FDE4, &lit_10293); + return 1; +} -/* 80C0FDE8-80C0FDEC 00036C 0004+00 0/1 0/0 0/0 .rodata @10294 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10294 = 8.0f; -COMPILER_STRIP_GATE(0x80C0FDE8, &lit_10294); -#pragma pop +/* 80C03B48-80C03B7C 003D28 0034+00 1/0 0/0 0/0 .text base001__11daObj_GrA_cFi */ +int daObj_GrA_c::base001(int param_1) { + if (param_1 != 0) { + setBaseAnm(2, field_0xa94); + } -/* 80C0FDEC-80C0FDF0 000370 0004+00 0/1 0/0 0/0 .rodata @10295 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10295 = 16384.0f; -COMPILER_STRIP_GATE(0x80C0FDEC, &lit_10295); -#pragma pop + return 1; +} -/* 80C0FDF0-80C0FDF4 000374 0004+00 0/1 0/0 0/0 .rodata @10406 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10406 = 110.0f; -COMPILER_STRIP_GATE(0x80C0FDF0, &lit_10406); -#pragma pop +/* 80C03B7C-80C03C1C 003D5C 00A0+00 1/0 0/0 0/0 .text base003__11daObj_GrA_cFi */ +int daObj_GrA_c::base003(int param_1) { + if (param_1 != 0) { + setBaseAnm(4, field_0xa94); + } else if (mpModelMorf->isStop()) { + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setBaseAnm(0, field_0xa94); + } -/* 80C0FDF4-80C0FDF8 000378 0004+00 0/1 0/0 0/0 .rodata @10407 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10407 = 135.0f; -COMPILER_STRIP_GATE(0x80C0FDF4, &lit_10407); -#pragma pop + return 1; +} -/* 80C0FDF8-80C0FDFC 00037C 0004+00 1/1 0/0 0/0 .rodata @10650 */ -SECTION_RODATA static f32 const lit_10650 = 4.5f; -COMPILER_STRIP_GATE(0x80C0FDF8, &lit_10650); +/* 80C03C1C-80C03CBC 003DFC 00A0+00 1/0 0/0 0/0 .text base004__11daObj_GrA_cFi */ +int daObj_GrA_c::base004(int param_1) { + if (param_1 != 0) { + setBaseAnm(5, field_0xa94); + } else if (mpModelMorf->isStop()) { + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setBaseAnm(0, field_0xa94); + } -/* 80C0FDFC-80C0FE00 000380 0004+00 1/1 0/0 0/0 .rodata @10651 */ -SECTION_RODATA static f32 const lit_10651 = 5.5f; -COMPILER_STRIP_GATE(0x80C0FDFC, &lit_10651); + return 1; +} /* 80C03CBC-80C03D54 003E9C 0098+00 1/0 0/0 0/0 .text base005__11daObj_GrA_cFi */ -int daObj_GrA_c::base005(int param_0) { +int daObj_GrA_c::base005(int param_1) { // NONMATCHING + if (param_1 != 0) { + setBaseAnm(6, field_0xa94); + } + + if (mpModelMorf->getFrame() >= 4.5f && mpModelMorf->getFrame() <= 5.5f) { + mSound.startCreatureVoice(Z2SE_GORON_V_TO_STONE, -1); + } + + return 1; } /* 80C03D54-80C03D88 003F34 0034+00 1/0 0/0 0/0 .text base006__11daObj_GrA_cFi */ -int daObj_GrA_c::base006(int param_0) { - // NONMATCHING +int daObj_GrA_c::base006(int param_1) { + if (param_1 != 0) { + setBaseAnm(7, field_0xa94); + } + + return 1; } /* 80C03D88-80C03DF0 003F68 0068+00 1/0 0/0 0/0 .text base007__11daObj_GrA_cFi */ -int daObj_GrA_c::base007(int param_0) { - // NONMATCHING +int daObj_GrA_c::base007(int param_1) { + if (param_1 != 0) { + setBaseAnm(8, field_0xa94); + mSound.startCreatureVoice(Z2SE_GORON_V_RECOVER, -1); + } + + return 1; } /* 80C03DF0-80C03E74 003FD0 0084+00 1/0 0/0 0/0 .text base008__11daObj_GrA_cFi */ -int daObj_GrA_c::base008(int param_0) { +int daObj_GrA_c::base008(int param_1) { // NONMATCHING + if (param_1 != 0) { + setBaseAnm(10, field_0xa94); + } + + if (mpModelMorf->checkFrame(2.0f)) { + mSound.startCreatureVoice(Z2SE_GORON_V_GUARD, -1); + } + + return 1; } /* 80C03E74-80C03F14 004054 00A0+00 1/0 0/0 0/0 .text base009__11daObj_GrA_cFi */ -int daObj_GrA_c::base009(int param_0) { +int daObj_GrA_c::base009(int param_1) { // NONMATCHING -} + if (param_1 != 0) { + setBaseAnm(1, field_0xa94); + } -/* ############################################################################################## */ -/* 80C0FE00-80C0FE04 000384 0004+00 0/1 0/0 0/0 .rodata @10705 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10705 = 18.5f; -COMPILER_STRIP_GATE(0x80C0FE00, &lit_10705); -#pragma pop + if (mpModelMorf->checkFrame(12.0f) || mpModelMorf->checkFrame(30.0f)) { + mSound.startCreatureVoice(Z2SE_GORON_V_FIGHTING_WAIT, -1); + } -/* 80C0FE04-80C0FE08 000388 0004+00 0/1 0/0 0/0 .rodata @10706 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10706 = 19.5f; -COMPILER_STRIP_GATE(0x80C0FE04, &lit_10706); -#pragma pop + return 1; +} /* 80C03F14-80C03FC0 0040F4 00AC+00 1/0 0/0 0/0 .text base010__11daObj_GrA_cFi */ -int daObj_GrA_c::base010(int param_0) { +int daObj_GrA_c::base010(int param_1) { // NONMATCHING -} + if (param_1 != 0) { + setBaseAnm(3, field_0xa94); + } -/* ############################################################################################## */ -/* 80C0FE08-80C0FE0C 00038C 0004+00 0/1 0/0 0/0 .rodata @10768 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_10768 = 127.0f; -COMPILER_STRIP_GATE(0x80C0FE08, &lit_10768); -#pragma pop + if (mpModelMorf->getFrame() == 4.0f || ( mpModelMorf->getFrame() >= 18.5 && mpModelMorf->getFrame() <= 19.5)) { + mSound.startCreatureVoice(Z2SE_GORON_V_PUNCH, -1); + } + + return 1; +} /* 80C03FC0-80C04118 0041A0 0158+00 1/0 0/0 0/0 .text base013__11daObj_GrA_cFi */ -int daObj_GrA_c::base013(int param_0) { +int daObj_GrA_c::base013(int param_1) { // NONMATCHING + if (param_1 != 0) { + setBaseAnm(9, field_0xa94); + mpModelMorf->setEndFrame(30.0f); + field_0x2010 = 0; + } + + if (mAcch.ChkGroundHit()) { + if (mpModelMorf->getPlaySpeed() >= 1.0f || mpModelMorf->getPlaySpeed() <= -1.0f) { + field_0x201d = 1; + } + + field_0x201c = 0; + } else if (field_0x201c < 10) { + field_0x201c++; + } + + if (field_0x2010 != field_0x842 && field_0x201c < 10) { + mSound.startCreatureSound(Z2SE_GORON_ROLLING, cLib_minMaxLimit(fabsf(mpModelMorf->getPlaySpeed()) * 20.0f, 1.0f, 127.0f), -1); + field_0x2010 = field_0x842; + } + + return 1; } /* 80C04118-80C04180 0042F8 0068+00 1/0 0/0 0/0 .text base016__11daObj_GrA_cFi */ -int daObj_GrA_c::base016(int param_0) { - // NONMATCHING +int daObj_GrA_c::base016(int param_1) { + if (param_1 != 0) { + setBaseAnm(11, field_0xa94); + mSound.startCreatureVoice(Z2SE_GORON_V_HEAD_BACK, -1); + } + + return 1; } /* 80C04180-80C041E8 004360 0068+00 1/0 0/0 0/0 .text base017__11daObj_GrA_cFi */ -int daObj_GrA_c::base017(int param_0) { - // NONMATCHING +int daObj_GrA_c::base017(int param_1) { + if (param_1 != 0) { + setBaseAnm(12, field_0xa94); + mSound.startCreatureVoice(Z2SE_GORON_V_HEAD_BACK, -1); + } + + return 1; } /* 80C041E8-80C04260 0043C8 0078+00 1/0 0/0 0/0 .text base018__11daObj_GrA_cFi */ -int daObj_GrA_c::base018(int param_0) { +int daObj_GrA_c::base018(int param_1) { // NONMATCHING + if (param_1 != 0) { + setBaseAnm(13, field_0xa94); + mpModelMorf->setFrame(6.0f); + mSound.startCreatureVoice(Z2SE_GORON_V_TOTTER, -1); + } + + return 1; } /* 80C04260-80C042D4 004440 0074+00 1/0 0/0 0/0 .text base019__11daObj_GrA_cFi */ -int daObj_GrA_c::base019(int param_0) { - // NONMATCHING +int daObj_GrA_c::base019(int param_1) { + if (param_1 != 0) { + setBaseAnm(14, field_0xa94); + mpModelMorf->setEndFrame(20.0f); + mSound.startCreatureVoice(Z2SE_GORON_V_HIT_TO_STONE, -1); + } + + return 1; } /* 80C042D4-80C04308 0044B4 0034+00 1/0 0/0 0/0 .text base020__11daObj_GrA_cFi */ -int daObj_GrA_c::base020(int param_0) { - // NONMATCHING +int daObj_GrA_c::base020(int param_1) { + if (param_1 != 0) { + setBaseAnm(15, field_0xa94); + } + + return 1; } /* 80C04308-80C0433C 0044E8 0034+00 1/0 0/0 0/0 .text base021__11daObj_GrA_cFi */ -int daObj_GrA_c::base021(int param_0) { - // NONMATCHING +int daObj_GrA_c::base021(int param_1) { + if (param_1 != 0) { + setBaseAnm(16, field_0xa94); + } + + return 1; } /* 80C0433C-80C04370 00451C 0034+00 1/0 0/0 0/0 .text base022__11daObj_GrA_cFi */ -int daObj_GrA_c::base022(int param_0) { - // NONMATCHING +int daObj_GrA_c::base022(int param_1) { + if (param_1 != 0) { + setBaseAnm(17, field_0xa94); + } + + return 1; } /* 80C04370-80C043A4 004550 0034+00 1/0 0/0 0/0 .text base023__11daObj_GrA_cFi */ -int daObj_GrA_c::base023(int param_0) { - // NONMATCHING +int daObj_GrA_c::base023(int param_1) { + if (param_1 != 0) { + setBaseAnm(18, field_0xa94); + } + + return 1; } /* 80C043A4-80C043D8 004584 0034+00 1/0 0/0 0/0 .text base024__11daObj_GrA_cFi */ -int daObj_GrA_c::base024(int param_0) { - // NONMATCHING +int daObj_GrA_c::base024(int param_1) { + if (param_1 != 0) { + setBaseAnm(19, field_0xa94); + } + + return 1; } /* 80C043D8-80C0440C 0045B8 0034+00 1/0 0/0 0/0 .text base025__11daObj_GrA_cFi */ -int daObj_GrA_c::base025(int param_0) { - // NONMATCHING +int daObj_GrA_c::base025(int param_1) { + if (param_1 != 0) { + setBaseAnm(20, field_0xa94); + } + + return 1; } /* 80C0440C-80C04440 0045EC 0034+00 1/0 0/0 0/0 .text base026__11daObj_GrA_cFi */ -int daObj_GrA_c::base026(int param_0) { - // NONMATCHING +int daObj_GrA_c::base026(int param_1) { + if (param_1 != 0) { + setBaseAnm(21, field_0xa94); + } + + return 1; } /* 80C04440-80C04478 004620 0038+00 1/0 0/0 0/0 .text face000__11daObj_GrA_cFi */ -int daObj_GrA_c::face000(int param_0) { - // NONMATCHING +int daObj_GrA_c::face000(int param_1) { + if (param_1 != 0) { + setFaceAnm(22, true, field_0xa98); + } + + return 1; } /* 80C04478-80C04518 004658 00A0+00 1/0 0/0 0/0 .text face003__11daObj_GrA_cFi */ -int daObj_GrA_c::face003(int param_0) { - // NONMATCHING +int daObj_GrA_c::face003(int param_1) { + if (param_1 != 0) { + setFaceAnm(27, true, field_0xa98); + } else if (mBck.isStop()) { + setFaceMotion(0, -1.0f); + setFaceAnm(22, true, field_0xa98); + } + + return 1; } /* 80C04518-80C045B8 0046F8 00A0+00 1/0 0/0 0/0 .text face004__11daObj_GrA_cFi */ -int daObj_GrA_c::face004(int param_0) { - // NONMATCHING +int daObj_GrA_c::face004(int param_1) { + if (param_1 != 0) { + setFaceAnm(28, true, field_0xa98); + } else if (mBck.isStop()) { + setFaceMotion(0, -1.0f); + setFaceAnm(22, true, field_0xa98); + } + + return 1; } /* 80C045B8-80C045F0 004798 0038+00 1/0 0/0 0/0 .text face005__11daObj_GrA_cFi */ -int daObj_GrA_c::face005(int param_0) { - // NONMATCHING +int daObj_GrA_c::face005(int param_1) { + if (param_1 != 0) { + setFaceAnm(31, true, field_0xa98); + } + + return 1; } /* 80C045F0-80C04628 0047D0 0038+00 1/0 0/0 0/0 .text face006__11daObj_GrA_cFi */ -int daObj_GrA_c::face006(int param_0) { - // NONMATCHING +int daObj_GrA_c::face006(int param_1) { + if (param_1 != 0) { + setFaceAnm(24, true, field_0xa98); + } + + return 1; } /* 80C04628-80C04660 004808 0038+00 1/0 0/0 0/0 .text face007__11daObj_GrA_cFi */ -int daObj_GrA_c::face007(int param_0) { - // NONMATCHING +int daObj_GrA_c::face007(int param_1) { + if (param_1 != 0) { + setFaceAnm(25, true, field_0xa98); + } + + return 1; } /* 80C04660-80C04700 004840 00A0+00 1/0 0/0 0/0 .text face008__11daObj_GrA_cFi */ -int daObj_GrA_c::face008(int param_0) { - // NONMATCHING +int daObj_GrA_c::face008(int param_1) { + if (param_1 != 0) { + setFaceAnm(29, true, field_0xa98); + } else if (mBck.isStop()) { + setFaceMotion(4, -1.0f); + setFaceAnm(24, true, field_0xa98); + } + + return 1; } /* 80C04700-80C047A0 0048E0 00A0+00 1/0 0/0 0/0 .text face009__11daObj_GrA_cFi */ -int daObj_GrA_c::face009(int param_0) { - // NONMATCHING -} +int daObj_GrA_c::face009(int param_1) { + if (param_1 != 0) { + setFaceAnm(30, true, field_0xa98); + } else if (mBck.isStop()) { + setFaceMotion(5, -1.0f); + setFaceAnm(25, true, field_0xa98); + } -/* 80C047A0-80C047D8 004980 0038+00 1/0 0/0 0/0 .text face010__11daObj_GrA_cFi */ -int daObj_GrA_c::face010(int param_0) { - // NONMATCHING + return 1; } -/* 80C047D8-80C04810 0049B8 0038+00 1/0 0/0 0/0 .text face011__11daObj_GrA_cFi */ -int daObj_GrA_c::face011(int param_0) { - // NONMATCHING -} +/* 80C047A0-80C047D8 004980 0038+00 1/0 0/0 0/0 .text face010__11daObj_GrA_cFi */ +int daObj_GrA_c::face010(int param_1) { + if (param_1 != 0) { + setFaceAnm(23, true, field_0xa98); + } -/* 80C04810-80C04848 0049F0 0038+00 1/0 0/0 0/0 .text face012__11daObj_GrA_cFi */ -int daObj_GrA_c::face012(int param_0) { - // NONMATCHING + return 1; } -/* 80C04848-80C04880 004A28 0038+00 1/0 0/0 0/0 .text face016__11daObj_GrA_cFi */ -int daObj_GrA_c::face016(int param_0) { - // NONMATCHING -} +/* 80C047D8-80C04810 0049B8 0038+00 1/0 0/0 0/0 .text face011__11daObj_GrA_cFi */ +int daObj_GrA_c::face011(int param_1) { + if (param_1 != 0) { + setFaceAnm(26, true, field_0xa98); + } -/* 80C04880-80C048B8 004A60 0038+00 1/0 0/0 0/0 .text face017__11daObj_GrA_cFi */ -int daObj_GrA_c::face017(int param_0) { - // NONMATCHING + return 1; } -/* 80C048B8-80C048F8 004A98 0040+00 1/0 0/0 0/0 .text face999__11daObj_GrA_cFi */ -int daObj_GrA_c::face999(int param_0) { - // NONMATCHING -} +/* 80C04810-80C04848 0049F0 0038+00 1/0 0/0 0/0 .text face012__11daObj_GrA_cFi */ +int daObj_GrA_c::face012(int param_1) { + if (param_1 != 0) { + setFaceAnm(32, true, field_0xa98); + } -/* 80C048F8-80C04A0C 004AD8 0114+00 2/2 0/0 0/0 .text evtcutTalk__11daObj_GrA_cFii */ -void daObj_GrA_c::evtcutTalk(int param_0, int param_1) { - // NONMATCHING + return 1; } -/* 80C04A0C-80C04A88 004BEC 007C+00 2/2 0/0 0/0 .text setFaceTalkAfter__11daObj_GrA_cFv - */ -void daObj_GrA_c::setFaceTalkAfter() { - // NONMATCHING -} +/* 80C04848-80C04880 004A28 0038+00 1/0 0/0 0/0 .text face016__11daObj_GrA_cFi */ +int daObj_GrA_c::face016(int param_1) { + if (param_1 != 0) { + setFaceAnm(33, true, field_0xa98); + } -/* 80C04A88-80C04AA8 004C68 0020+00 1/0 0/0 0/0 .text daObj_GrA_Create__FPv */ -static void daObj_GrA_Create(void* param_0) { - // NONMATCHING + return 1; } -/* 80C04AA8-80C04AC8 004C88 0020+00 1/0 0/0 0/0 .text daObj_GrA_Delete__FPv */ -static void daObj_GrA_Delete(void* param_0) { - // NONMATCHING -} +/* 80C04880-80C048B8 004A60 0038+00 1/0 0/0 0/0 .text face017__11daObj_GrA_cFi */ +int daObj_GrA_c::face017(int param_1) { + if (param_1 != 0) { + setFaceAnm(34, true, field_0xa98); + } -/* 80C04AC8-80C04AE8 004CA8 0020+00 1/0 0/0 0/0 .text daObj_GrA_Execute__FPv */ -static void daObj_GrA_Execute(void* param_0) { - // NONMATCHING + return 1; } -/* 80C04AE8-80C04B14 004CC8 002C+00 1/0 0/0 0/0 .text daObj_GrA_Draw__FPv */ -static void daObj_GrA_Draw(void* param_0) { - // NONMATCHING -} +/* 80C048B8-80C048F8 004A98 0040+00 1/0 0/0 0/0 .text face999__11daObj_GrA_cFi */ +int daObj_GrA_c::face999(int param_1) { + if (param_1 != 0) { + cLib_offBit(field_0x840, 0x22); + setFaceBtp(0); + } -/* 80C04B14-80C04B1C 004CF4 0008+00 1/0 0/0 0/0 .text daObj_GrA_IsDelete__FPv */ -static bool daObj_GrA_IsDelete(void* param_0) { - return true; + return 1; } -/* ############################################################################################## */ -/* 80C10888-80C10894 000A20 000C+00 2/2 0/0 0/0 .data __vt__17daObj_GrA_Param_c */ -SECTION_DATA extern void* __vt__17daObj_GrA_Param_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__17daObj_GrA_Param_cFv, -}; +/* 80C048F8-80C04A0C 004AD8 0114+00 2/2 0/0 0/0 .text evtcutTalk__11daObj_GrA_cFii */ +int daObj_GrA_c::evtcutTalk(int param_1, int param_2) { + s32 sVar1 = field_0x848; + if (param_2 != 0) { + mMsgFlow.init(this, sVar1, 0, NULL); + field_0xaa0 = 0; + } -/* 80C04B1C-80C04B64 004CFC 0048+00 2/1 0/0 0/0 .text __dt__17daObj_GrA_Param_cFv */ -daObj_GrA_Param_c::~daObj_GrA_Param_c() { - // NONMATCHING -} + if (mMsgFlow.doFlow(this, NULL, 0)) { + return 1; + } -/* 80C04B64-80C04BAC 004D44 0048+00 1/0 0/0 0/0 .text __dt__16daBaseNpc_path_cFv */ -// daBaseNpc_path_c::~daBaseNpc_path_c() { -extern "C" void __dt__16daBaseNpc_path_cFv() { - // NONMATCHING -} + int iVar1, iVar2; + int iVar3 = field_0xaa0; + if (ctrlMsgAnm(iVar1, iVar2, this) != 0) { + if (iVar2 != -1) { + setBaseMotion(l_eventMotionChangeTable[iVar2], daObj_GrA_Param_c::m.field_0x0c); + } -/* 80C04BAC-80C04BB0 004D8C 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */ -// cXyz::cXyz() { -extern "C" void __ct__4cXyzFv() { - /* empty function */ -} + if (iVar1 != -1) { + setFaceMotion(l_eventFaceChangeTable[iVar1], -1.0f); + } + } else { + if (iVar3 != 0) { + setFaceTalkAfter(); + } + } -/* 80C04BB0-80C04BF8 004D90 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -// cM3dGCyl::~cM3dGCyl() { -extern "C" void __dt__8cM3dGCylFv() { - // NONMATCHING + return 0; } -/* 80C04BF8-80C04C40 004DD8 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} +/* 80C04A0C-80C04A88 004BEC 007C+00 2/2 0/0 0/0 .text setFaceTalkAfter__11daObj_GrA_cFv */ +void daObj_GrA_c::setFaceTalkAfter() { + switch (field_0xa92) { + case 6: + setFaceMotion(4, daObj_GrA_Param_c::m.field_0x0c); + break; -/* 80C04C40-80C04C7C 004E20 003C+00 6/6 0/0 0/0 .text __dt__4cXyzFv */ -// cXyz::~cXyz() { -extern "C" void __dt__4cXyzFv() { - // NONMATCHING -} + case 7: + setFaceMotion(5, daObj_GrA_Param_c::m.field_0x0c); + break; -/* 80C04C7C-80C04D48 004E5C 00CC+00 2/2 0/0 0/0 .text __dt__8dCcD_SphFv */ -// dCcD_Sph::~dCcD_Sph() { -extern "C" void __dt__8dCcD_SphFv() { - // NONMATCHING + default: + setFaceMotion(0, daObj_GrA_Param_c::m.field_0x0c); + } } -/* 80C04D48-80C04DCC 004F28 0084+00 1/1 0/0 0/0 .text __ct__8dCcD_SphFv */ -// dCcD_Sph::dCcD_Sph() { -extern "C" void __ct__8dCcD_SphFv() { - // NONMATCHING +/* 80C04A88-80C04AA8 004C68 0020+00 1/0 0/0 0/0 .text daObj_GrA_Create__FPv */ +static int daObj_GrA_Create(void* param_1) { + daObj_GrA_c* i_this = (daObj_GrA_c*)param_1; + return i_this->create(); } -/* 80C04DCC-80C04E14 004FAC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -// cM3dGSph::~cM3dGSph() { -extern "C" void __dt__8cM3dGSphFv() { - // NONMATCHING +/* 80C04AA8-80C04AC8 004C88 0020+00 1/0 0/0 0/0 .text daObj_GrA_Delete__FPv */ +static int daObj_GrA_Delete(void* param_1) { + daObj_GrA_c* i_this = (daObj_GrA_c*)param_1; + return i_this->MoveBGDelete(); } -/* 80C04E14-80C04E50 004FF4 003C+00 2/2 0/0 0/0 .text - * __dt__Q211daObj_GrA_c21daObj_GrA_prtclMngr_cFv */ -daObj_GrA_c::daObj_GrA_prtclMngr_c::~daObj_GrA_prtclMngr_c() { - // NONMATCHING +/* 80C04AC8-80C04AE8 004CA8 0020+00 1/0 0/0 0/0 .text daObj_GrA_Execute__FPv */ +static int daObj_GrA_Execute(void* param_1) { + daObj_GrA_c* i_this = (daObj_GrA_c*)param_1; + return i_this->MoveBGExecute(); } -/* 80C04E50-80C04E54 005030 0004+00 1/1 0/0 0/0 .text - * __ct__Q211daObj_GrA_c21daObj_GrA_prtclMngr_cFv */ -daObj_GrA_c::daObj_GrA_prtclMngr_c::daObj_GrA_prtclMngr_c() { - /* empty function */ +/* 80C04AE8-80C04B14 004CC8 002C+00 1/0 0/0 0/0 .text daObj_GrA_Draw__FPv */ +static int daObj_GrA_Draw(void* param_1) { + daObj_GrA_c* i_this = (daObj_GrA_c*)param_1; + return i_this->Draw(); } -/* 80C04E54-80C04E9C 005034 0048+00 1/0 0/0 0/0 .text __dt__18daBaseNpc_acMngr_cFv */ -// daBaseNpc_acMngr_c::~daBaseNpc_acMngr_c() { -extern "C" void __dt__18daBaseNpc_acMngr_cFv() { - // NONMATCHING +/* 80C04B14-80C04B1C 004CF4 0008+00 1/0 0/0 0/0 .text daObj_GrA_IsDelete__FPv */ +static int daObj_GrA_IsDelete(void* param_1) { + return 1; } -/* 80C04E9C-80C04EFC 00507C 0060+00 1/0 0/0 0/0 .text __dt__23daBaseNpc_moveBgActor_cFv - */ +/* 80C04E9C-80C04EFC 00507C 0060+00 1/0 0/0 0/0 .text __dt__23daBaseNpc_moveBgActor_cFv */ // daBaseNpc_moveBgActor_c::~daBaseNpc_moveBgActor_c() { extern "C" void __dt__23daBaseNpc_moveBgActor_cFv() { // NONMATCHING @@ -3679,33 +3494,6 @@ extern "C" bool Draw__23daBaseNpc_moveBgActor_cFv() { return true; } -/* 80C04F04-80C04F0C 0050E4 0008+00 2/0 0/0 0/0 .text Create__23daBaseNpc_moveBgActor_cFv - */ -// bool daBaseNpc_moveBgActor_c::Create() { -extern "C" bool Create__23daBaseNpc_moveBgActor_cFv() { - return true; -} - -/* 80C04F0C-80C04F14 0050EC 0008+00 2/0 0/0 0/0 .text IsDelete__23daBaseNpc_moveBgActor_cFv */ -// bool daBaseNpc_moveBgActor_c::IsDelete() { -extern "C" bool IsDelete__23daBaseNpc_moveBgActor_cFv() { - return true; -} - -/* 80C04F14-80C04F1C 0050F4 0008+00 2/0 0/0 0/0 .text ToFore__23daBaseNpc_moveBgActor_cFv - */ -// bool daBaseNpc_moveBgActor_c::ToFore() { -extern "C" bool ToFore__23daBaseNpc_moveBgActor_cFv() { - return true; -} - -/* 80C04F1C-80C04F24 0050FC 0008+00 2/0 0/0 0/0 .text ToBack__23daBaseNpc_moveBgActor_cFv - */ -// bool daBaseNpc_moveBgActor_c::ToBack() { -extern "C" bool ToBack__23daBaseNpc_moveBgActor_cFv() { - return true; -} - /* 80C04F24-80C04F2C 005104 0008+00 1/0 0/0 0/0 .text CreateHeap__23daBaseNpc_moveBgActor_cFv */ // bool daBaseNpc_moveBgActor_c::CreateHeap() { extern "C" bool CreateHeap__23daBaseNpc_moveBgActor_cFv() { @@ -3726,59 +3514,205 @@ extern "C" bool Delete__23daBaseNpc_moveBgActor_cFv() { return true; } -/* 80C04F3C-80C04F58 00511C 001C+00 5/5 0/0 0/0 .text cLib_calcTimer__FPi */ -extern "C" void func_80C04F3C(void* _this, int* param_0) { +/* 80C0536C-80C053C4 00554C 0058+00 4/4 0/0 0/0 .text getSrchCircleR__11daObj_GrA_cFv */ +f32 daObj_GrA_c::getSrchCircleR() { // NONMATCHING + f32 srchCircleR; + u8 uVar1 = fopAcM_GetParam(this) & 0x7F; + if (uVar1 == 0) { + srchCircleR = daObj_GrA_Param_c::m.field_0x6c * 10.0f; + } else { + srchCircleR = uVar1 * 10; + } + + return srchCircleR; } -/* 80C04F58-80C04F74 005138 001C+00 1/1 0/0 0/0 .text cLib_calcTimer__FPs */ -extern "C" void func_80C04F58(void* _this, s16* param_0) { +/* 80C053C4-80C05920 0055A4 055C+00 2/0 0/0 0/0 .text standWait__11daObj_GrA_cFPv */ +int daObj_GrA_c::standWait(void* param_1) { // NONMATCHING -} + cXyz sp5c; -/* ############################################################################################## */ -/* 80C0FE0C-80C0FE10 000390 0004+00 0/1 0/0 0/0 .rodata @11071 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_11071 = 67.0f; -COMPILER_STRIP_GATE(0x80C0FE0C, &lit_11071); -#pragma pop + switch (field_0xa7c) { + case 0: + field_0xf50.OffAtSetBit(); + field_0x1518 = 0; + break; -/* 80C0FE10-80C0FE14 000394 0004+00 0/1 0/0 0/0 .rodata @11072 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_11072 = 26.0f; -COMPILER_STRIP_GATE(0x80C0FE10, &lit_11072); -#pragma pop + case 1: + cLib_calcTimer(&field_0x1fdc); + if (cLib_calcTimer(&field_0x1528.field_0xa18) != 0) { + if (field_0xa90 != 8) { + cXyz sp68(0.0f, 0.0f, 0.0f); + if (field_0xa90 == 11) { + if (mpModelMorf->getFrame() >= 4.0f) { + sp68.z = -0.44806668; + } + } else if (field_0xa90 == 12) { + sp68.z = -0.6734286; + } else if (field_0xa90 == 13) { + sp68.z = 1.7936944; + sp68.x = -0.9048056; + } -/* 80C04F74-80C0536C 005154 03F8+00 0/0 1/0 0/0 .text __sinit_d_a_obj_gra2_cpp */ -void __sinit_d_a_obj_gra2_cpp() { - // NONMATCHING -} + cLib_offsetPos(¤t.pos, ¤t.pos, shape_angle.y, &sp68); -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80C04F74, __sinit_d_a_obj_gra2_cpp); -#pragma pop + if (mpModelMorf->isStop()) { + setBaseMotion(8, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(1); + } + } + } else { + sp5c.y -= daPy_getPlayerActorClass()->getAttentionOffsetY(); + f32 fVar1 = (sp5c - current.pos).absXZ(); + cLib_targetAngleY(&attention_info.position, &sp5c); + cLib_targetAngleY(¤t.pos, &eyePos); + + if (field_0x1fdc == 0 && dComIfGp_checkPlayerStatus0(0, 0x100) == 0) { + f32 fVar2 = getSrchCircleR(); + if ((home.pos - current.pos).absXZ() <= fVar2 && getSrchCircleR() <= fVar2) { + if (std::abs(sp5c.y - current.pos.y) < 300.0f) { + field_0x150c = 1; + } -/* 80C0536C-80C053C4 00554C 0058+00 4/4 0/0 0/0 .text getSrchCircleR__11daObj_GrA_cFv */ -f32 daObj_GrA_c::getSrchCircleR() { - // NONMATCHING -} + if (field_0x150c != 0) { + setProcess(&daObj_GrA_c::walk); + setBaseMotion(1, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + } else { + cLib_addCalcAngleS2(¤t.angle.y, home.angle.y, 1, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + + if (current.angle.y == home.angle.y) { + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + } + } + } + } + } + } -/* 80C053C4-80C05920 0055A4 055C+00 2/0 0/0 0/0 .text standWait__11daObj_GrA_cFPv */ -int daObj_GrA_c::standWait(void* param_0) { - // NONMATCHING + return 1; } /* 80C05920-80C05F64 005B00 0644+00 3/0 0/0 0/0 .text walk__11daObj_GrA_cFPv */ -void daObj_GrA_c::walk(void* param_0) { +int daObj_GrA_c::walk(void* param_1) { // NONMATCHING + cXyz sp60; + + switch (field_0xa7c) { + case 0: + setBaseMotion(1, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + break; + + case 1: + daPy_py_c* player = daPy_getPlayerActorClass(); + sp60 = player->current.pos; + f32 fVar1 = (sp60 - current.pos).absXZ(); + s16 sVar1 = cLib_targetAngleY(¤t.pos, &sp60); + cLib_targetAngleY(¤t.pos, &eyePos); + s16 sVar2 = shape_angle.y; + cXyz sp6c(home.pos); + cLib_calcTimer(&field_0x1fdc); + + if (field_0x1fdc == 0 && dComIfGp_checkPlayerStatus0(0, 0x100) == 0) { + if ((sp6c - sp60).absXZ() <= (getSrchCircleR() + 100.0f) && fVar1 <= getSrchCircleR() + 100.0f) { + if (std::abs(sp60.y - current.pos.y) < 300.0f) { + field_0x150c = 1; + } + } + } else { + field_0x150c = 0; + } + + if (field_0x150c == 0) { + setLookMode(1); + sp6c = sp60; + if (fVar1 < daObj_GrA_Param_c::m.field_0x94) { + if ((sVar1 - sVar2) < cM_deg2s(daObj_GrA_Param_c::m.field_0x80)) { + setProcess(&daObj_GrA_c::step); + field_0x1098 = daObj_GrA_Param_c::m.field_0x50; + field_0x108c = current.pos; + return 1; + } + } + } else if ((sp6c - current.pos).absXZ() < 50.0f) { + setLookMode(1); + setProcess(&daObj_GrA_c::wait); + speedF = 0.0f; + return 1; + } + + cLib_addCalc2(&speedF, daObj_GrA_Param_c::m.field_0x90, 0.25f, 3.5f); + sVar1 = cLib_targetAngleY(¤t.pos, &sp6c); + cLib_addCalcAngleS2(¤t.angle.y, sVar1, 1, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + break; + } + + return 1; } /* 80C05F64-80C061F4 006144 0290+00 1/0 0/0 0/0 .text defence__11daObj_GrA_cFPv */ -int daObj_GrA_c::defence(void* param_0) { +int daObj_GrA_c::defence(void* param_1) { // NONMATCHING + fopAc_ac_c* aTgHitActor_p; + s16 sVar1; + switch (field_0xa7c) { + case 0: + setBaseMotion(7, 0.0f); + setFaceMotion(10, 0.0f); + calcMotion(); + + aTgHitActor_p = field_0xab0.getActor(); + JUT_ASSERT(309, 0 != aTgHitActor_p); + + sVar1 = cLib_targetAngleY(¤t.pos, &aTgHitActor_p->current.pos); + current.angle.y = sVar1; + sVar1 = current.angle.y; + field_0x91a.y = sVar1; + shape_angle.y = sVar1; + field_0x108c = current.pos; + field_0x1098 = 0.0f; + break; + + case 1: + if (field_0x842 != 0) { + setProcess(&daObj_GrA_c::walk); + } else { + cLib_addCalc2(&field_0x1098, daObj_GrA_Param_c::m.field_0x50, 0.25f, 20.0f); + cXyz sp2c(field_0x108c); + sp2c.x -= field_0x1098 * cM_ssin(current.angle.y); + sp2c.z -= field_0x1098 * cM_scos(current.angle.y); + cLib_addCalcPos2(¤t.pos, sp2c, 0.8f, 45.0f); + + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(26)); + mDoMtx_stack_c::multVecZero(&field_0xab8[0].field_0x4); + field_0xab8[0].field_0x4.y -= 20.0f; + field_0xab8[0].field_0x10 = current.angle; + field_0xab8[0].field_0x10.y -= 0x8000; + field_0xab8[0].field_0x0 = 1; + + mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(23)); + mDoMtx_stack_c::multVecZero(&field_0xab8[1].field_0x4); + field_0xab8[1].field_0x4.y -= 20.0f; + field_0xab8[1].field_0x10 = current.angle; + field_0xab8[1].field_0x10.y -= 0x8000; + field_0xab8[1].field_0x0 = 1; + field_0xaa4 = daObj_GrA_Param_c::m.field_0x54; + } + break; + + case 2: + field_0xab0.entry(NULL); + } + + return 1; } /* ############################################################################################## */ @@ -3789,8 +3723,106 @@ SECTION_DEAD static char const* const stringBase_80C0FE60 = "F_SP109"; #pragma pop /* 80C061F4-80C067D8 0063D4 05E4+00 5/0 0/0 0/0 .text toStone__11daObj_GrA_cFPv */ -int daObj_GrA_c::toStone(void* param_0) { +int daObj_GrA_c::toStone(void* param_1) { // NONMATCHING + int iVar1; + f32 fVar1; + + switch (field_0xa7c) { + case 0: + field_0xaac = 1; + ppMoveInit(); + field_0xaa8 = 0; + current.angle.y = shape_angle.y; + field_0x202c = field_0x842; + + if (mMode != 1 && !dComIfGs_isSaveDunSwitch(0x1D)) { + dComIfGs_onSaveDunSwitch(0x1D); + } + break; + + case 1: + switch (field_0xaac) { + case 1: + if (field_0x109c == 0) { + if (mpModelMorf->checkFrame(0.0f)) { + setBaseMotion(4, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + setFaceMotion(13, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + calcMotion(); + mpModelMorf->setFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setPlaySpeed(1.0f); + field_0x109c = 1; + } + } else { + cXyz sp70(daPy_getPlayerActorClass()->current.pos); + fVar1 = (sp70 - current.pos).absXZ(); + if (field_0xaa8 == 0) { + if ((getSrchCircleR() < fVar1 || std::abs(sp70.y - current.pos.y) > 300.0f) || field_0x10c4 != 0) { + field_0xaa8 = 30; + } + } else { + field_0xaa8--; + if (field_0xaa8 < 1) { + field_0x10a0 = 90; + field_0xaac = 2; + } + } + } + break; + + case 2: + if (field_0x10a0 == 0) { + if (field_0x10c4 == 0 || daPy_py_c::checkNowWolf() != 0) { + field_0xf50.OnAtSetBit(); + field_0x109c = 0; + } else { + iVar1 = cM_deg2s(daObj_GrA_Param_c::m.field_0x4c); + + if (strcmp(dComIfGp_getStartStageName(), "F_SP109") == 0) { + fVar1 = 95.0f; + } else { + fVar1 = daObj_GrA_Param_c::m.field_0x48; + } + + daPy_getPlayerActorClass()->setRollJump(fVar1 * cM_scos(iVar1), fVar1 * cM_ssin(iVar1), daPy_getPlayerActorClass()->shape_angle.y); + } + + setBaseMotion(6, 0.0f); + setFaceMotion(3, 0.0f); + mpModelMorf->setPlaySpeed(1.0f); + field_0x10a0 = 3; + field_0xaac = 3; + } else { + cXyz sp7c(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp7c, &field_0xab8[4].field_0x4); + field_0xab8[4].field_0x0 = 1; + mSound.startCreatureSoundLevel(Z2SE_GORON_TREMBLE, 0, -1); + field_0x10a0--; + } + break; + + case 3: + if (field_0x842 == 0 && mpModelMorf->checkFrame(12.0f)) { + field_0xab8[3].field_0x4 = current.pos; + field_0xab8[3].field_0x10 = field_0x91a; + field_0xab8[3].field_0x0 = 1; + } else { + field_0xf50.OffAtSetBit(); + setProcess(&daObj_GrA_c::wait); + setLookMode(1); + field_0x1528.field_0xa18 = 0; + field_0xaac = 0; + health = 1; + field_0x109c = 0; + } + } + } + + field_0x10c4 = 0; + + return 1; } /* 80C067D8-80C06CDC 0069B8 0504+00 2/0 0/0 0/0 .text step__11daObj_GrA_cFPv */ @@ -3948,12 +3980,16 @@ extern "C" void getGraPos__10daTagGra_cFv() { } /* 80C0CF2C-80C0CF98 00D10C 006C+00 1/1 0/0 0/0 .text s_sub2__FPvPv */ -static void s_sub2(void* param_0, void* param_1) { - // NONMATCHING +static void* s_sub2(void* i_actor, void* i_data) { + daObj_GrA_c* i_this = (daObj_GrA_c*)i_data; + if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_OBJ_GRA && i_this->checkGraSub((fopAc_ac_c*)i_actor)) { + return i_actor; + } + return NULL; } /* 80C0CF98-80C0D000 00D178 0068+00 1/1 0/0 0/0 .text checkGraSub__11daObj_GrA_cFP10fopAc_ac_c */ -void daObj_GrA_c::checkGraSub(fopAc_ac_c* param_0) { +bool daObj_GrA_c::checkGraSub(fopAc_ac_c* param_0) { // NONMATCHING } From 95704ee868ba4fb7d103a42d037130d3486c1758 Mon Sep 17 00:00:00 2001 From: carter-ktb21 <144170194+carter-ktb21@users.noreply.github.com> Date: Tue, 10 Jun 2025 20:51:31 -0400 Subject: [PATCH 05/21] work on some rolling functions and deme camera --- include/d/actor/d_a_npc.h | 10 +- include/d/actor/d_a_obj_gra2.h | 55 +- include/d/actor/d_a_player.h | 4 + include/d/actor/d_a_tag_gra.h | 12 + src/d/actor/d_a_npc2.cpp | 18 +- src/d/actor/d_a_obj_gra2.cpp | 1305 ++++++++++++++++++++++++++++++-- 6 files changed, 1301 insertions(+), 103 deletions(-) diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index 97760db9bc6..1b8a52e5725 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -770,8 +770,8 @@ class daBaseNpc_path_c { /* 8014D9BC */ int setPathInfo(u8, s8, s8); /* 8014DA48 */ void reverseDir(); /* 8014DA64 */ s32 chkPnt(cXyz); - /* 8014DAC4 */ void setNextPnt(); - /* 8014DB04 */ u16 getIdx(); + /* 8014DAC4 */ BOOL setNextPnt(); + /* 8014DB04 */ s16 getIdx(); /* 8014DB0C */ void setIdx(u16); /* 8014DB14 */ Vec getPntPos(u16); /* 801503FC */ virtual ~daBaseNpc_path_c() {} @@ -784,9 +784,11 @@ class daBaseNpc_path_c { /* 0x00C */ dPnt mCurvePnts[160]; /* 0xA0C */ u8 field_0xa0c[0xA0E - 0xA0C]; /* 0xA0E */ u16 mCurvePntNum; - /* 0xA10 */ u16 mIdx; + /* 0xA10 */ s16 mIdx; /* 0xA12 */ s8 mDirection; - /* 0xA13 */ u8 field_0xa13[5]; + /* 0xA13 */ u8 field_0xa13; + /* 0xA14 */ s16 field_0xa14; + /* 0xA16 */ u8 field_0xa16[2]; /* 0xA18 */ int field_0xa18; /* 0xA1C */ u8 field_0xa1c[8]; }; diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 95b2cfc6fdc..15933412618 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -143,7 +143,7 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C0335C */ int talk(void*); /* 80C035B8 */ int ctrlMsgAnm(int&, int&, fopAc_ac_c*); /* 80C03720 */ bool checkTagGraSub(fopAc_ac_c*); - /* 80C03764 */ BOOL fallAbyssCheck(); + /* 80C03764 */ bool fallAbyssCheck(); /* 80C03830 */ int setPrtcl(); /* 80C03B14 */ int base000(int); /* 80C03B48 */ int base001(int); @@ -190,23 +190,23 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C061F4 */ int toStone(void*); /* 80C067D8 */ int step(void*); /* 80C06CDC */ int rollReturn(void*); - /* 80C0780C */ void soldierDemoSkip(); - /* 80C078A8 */ void soldierDemo(void*); - /* 80C07C40 */ void getSrchLinkR(); - /* 80C07C98 */ void getSrchGraR(); - /* 80C07CF0 */ void getSpeed(); + /* 80C0780C */ int soldierDemoSkip(); + /* 80C078A8 */ int soldierDemo(void*); + /* 80C07C40 */ f32 getSrchLinkR(); + /* 80C07C98 */ f32 getSrchGraR(); + /* 80C07CF0 */ f32 getSpeed(); /* 80C07D38 */ int standRoll(void*); - /* 80C083F0 */ void rollDemo(void*); - /* 80C08804 */ void rollAttack(void*); - /* 80C09298 */ void rollAttacked(void*); - /* 80C09918 */ void rollEscape(void*); + /* 80C083F0 */ int rollDemo(void*); + /* 80C08804 */ int rollAttack(void*); + /* 80C09298 */ int rollAttacked(void*); + /* 80C09918 */ int rollEscape(void*); /* 80C09F08 */ void rollLanding(); - /* 80C0A018 */ void thrown(void*); + /* 80C0A018 */ int thrown(void*); /* 80C0A120 */ void demo_camera(); /* 80C0AF94 */ void rollAttackedDemo(); /* 80C0B9AC */ void graThrowDemo(); /* 80C0BD90 */ void setCarryStatus(); - /* 80C0BE5C */ void checkThrow(); + /* 80C0BE5C */ bool checkThrow(); /* 80C0BF34 */ void calcCatchPos(f32, int); /* 80C0C348 */ void initCrazyBeforeCatch(int); /* 80C0C364 */ void executeCrazyBeforeCatch(); @@ -216,7 +216,7 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C0C690 */ void executeCrazyThrow(); /* 80C0C84C */ void initCrazyAttack(); /* 80C0CA64 */ void executeCrazyJumping(); - /* 80C0CDBC */ void modeChangeCheck(); + /* 80C0CDBC */ int modeChangeCheck(); /* 80C0CF98 */ bool checkGraSub(fopAc_ac_c*); /* 80C0D000 */ int waitDemo(void*); /* 80C0D2FC */ void skipDemoGra(); @@ -310,7 +310,8 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x1FD8 */ s16 field_0x1fd8; /* 0x1FDA */ u8 field_0x1fda[0x1fdc - 0x1fda]; /* 0x1FDC */ int field_0x1fdc; - /* 0x1FE0 */ u8 field_0x1fe0[0x1fe4 - 0x1fe0]; + /* 0x1FE0 */ u8 field_0x1fe0; + /* 0x1FE1 */ u8 field_0x1fe1[0x1fe4 - 0x1fe1]; /* 0x1FE4 */ int field_0x1fe4; /* 0x1FE8 */ u8 field_0x1fe8; /* 0x1FE9 */ u8 field_0x1fe9; @@ -318,17 +319,20 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x1FEC */ int field_0x1fec; /* 0x1FF0 */ int field_0x1ff0; /* 0x1FF4 */ u8 field_0x1ff4; - /* 0x1FF5 */ u8 field_0x1ff5[0x2000 - 0x1ff5]; + /* 0x1FF5 */ u8 field_0x1ff5[0x1ff8 - 0x1ff5]; + /* 0x1FF8 */ int field_0x1ff8; + /* 0x1FFC */ u8 field_0x1ffc[0x2000 - 0x1ffc]; /* 0x2000 */ int field_0x2000; /* 0x2004 */ u8 field_0x2004; - /* 0x2005 */ u8 field_0x2005; + /* 0x2005 */ s8 field_0x2005; /* 0x2006 */ u8 field_0x2006[0x2008 - 0x2006]; /* 0x2008 */ f32 field_0x2008; /* 0x200C */ u16 field_0x200c; /* 0x200E */ u8 field_0x200e[0x2010 - 0x200e]; /* 0x2010 */ int field_0x2010; /* 0x2014 */ u8 field_0x2014; - /* 0x2015 */ u8 field_0x2015[0x201c - 0x2015]; + /* 0x2015 */ u8 field_0x2015[0x2018 - 0x2015]; + /* 0x2018 */ int field_0x2018; /* 0x201C */ s8 field_0x201c; /* 0x201D */ u8 field_0x201d; /* 0x201E */ u8 field_0x201e[0x2020 - 0x201e]; @@ -337,13 +341,22 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x2030 */ u8 field_0x2030; /* 0x2031 */ u8 field_0x2031; /* 0x2032 */ u8 field_0x2032; - /* 0x2033 */ u8 field_0x2033[0x2048 - 0x2033]; - /* 0x2048 */ s16 field_0x2048; + /* 0x2033 */ u8 field_0x2033[0x2034 - 0x2033]; + /* 0x2034 */ cXyz mGraPos; + /* 0x2040 */ f32 mGraExtent; + /* 0x2044 */ f32 mGraHeight; + /* 0x2048 */ s16 mGraMode; /* 0x204A */ u8 field_0x204a[0x204c - 0x204a]; /* 0x204C */ daBaseNpc_acMngr_c field_0x204c; - /* 0x2054 */ s16 field_0x2054; + /* 0x2054 */ s16 mDemoCamMode; /* 0x2056 */ s16 field_0x2056; - /* 0x2058 */ u8 field_0x2058[0x209c - 0x2058]; + /* 0x2058 */ cXyz field_0x2058; + /* 0x2064 */ cXyz field_0x2064; + /* 0x2070 */ f32 field_0x2070; + /* 0x2074 */ cXyz field_0x2074; + /* 0x2080 */ cXyz field_0x2080; + /* 0x208C */ f32 field_0x208c; + /* 0x2090 */ u8 field_0x2090[12]; /* 0x209C */ int field_0x209c; /* 0x20A0 */ u8 field_0x20a0[0x20a4 - 0x20a0]; }; diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 9969d364e27..d82fc1dbfc3 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -973,6 +973,10 @@ class daPy_py_c : public fopAc_ac_c { } } + void offGoronUpStopCancel() { + offNoResetFlg0(FLG0_UNK_200000); + } + s16 getBodyAngleX() const { return mBodyAngle.x; } s16 getBodyAngleY() const { return mBodyAngle.y; } diff --git a/include/d/actor/d_a_tag_gra.h b/include/d/actor/d_a_tag_gra.h index c7715cfdb98..7586d399182 100644 --- a/include/d/actor/d_a_tag_gra.h +++ b/include/d/actor/d_a_tag_gra.h @@ -17,6 +17,18 @@ class daTagGra_c : public fopAc_ac_c { return fopAcM_GetParam(this) & 0xFF; } + cXyz getGraPos() { + return home.pos; + } + + f32 getGraExtent() { + return scale.x * 100.0f; + } + + f32 getGraHeight() { + return scale.y * 100.0f; + } + int create() { fopAcM_SetupActor(this, daTagGra_c); diff --git a/src/d/actor/d_a_npc2.cpp b/src/d/actor/d_a_npc2.cpp index 52cab601d31..f08e1612017 100644 --- a/src/d/actor/d_a_npc2.cpp +++ b/src/d/actor/d_a_npc2.cpp @@ -5,7 +5,7 @@ static u16 daBaseNpc_putNurbs(dPnt* i_CPnts, int i_CPntNum, int i_maxPntNum, dPn static s16 daBaseNpc_getGroundAngle(cBgS_PolyInfo* param_0, s16 param_1); /* 8014D538-8014D584 147E78 004C+00 2/2 0/0 0/0 .text daBaseNpc_addIdx__FiiPUsi */ -static int daBaseNpc_addIdx(int i_step, int i_num, u16* i_idx, BOOL i_closed) { +static int daBaseNpc_addIdx(int i_step, int i_num, s16* i_idx, BOOL i_closed) { BOOL new_idx = *i_idx; BOOL ret; @@ -26,7 +26,7 @@ static int daBaseNpc_addIdx(int i_step, int i_num, u16* i_idx, BOOL i_closed) { } /* 8014D584-8014D5C4 147EC4 0040+00 2/2 0/0 0/0 .text daBaseNpc_subIdx__FiiPUsi */ -static BOOL daBaseNpc_subIdx(int i_step, int i_num, u16* i_idx, BOOL i_closed) { +static BOOL daBaseNpc_subIdx(int i_step, int i_num, s16* i_idx, BOOL i_closed) { int new_idx = *i_idx; BOOL ret; @@ -47,16 +47,16 @@ static BOOL daBaseNpc_subIdx(int i_step, int i_num, u16* i_idx, BOOL i_closed) { } /* 8014D5C4-8014D620 147F04 005C+00 2/2 0/0 0/0 .text daBaseNpc_incIdx__FiPUsii */ -static void daBaseNpc_incIdx(int i_pathNo, u16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { +static BOOL daBaseNpc_incIdx(int i_pathNo, s16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { if (i_pathDirection < 0) { - daBaseNpc_subIdx(1, i_pathNo, i_pathIdx, i_pathClosed); + return daBaseNpc_subIdx(1, i_pathNo, i_pathIdx, i_pathClosed); } else { - daBaseNpc_addIdx(1, i_pathNo, i_pathIdx, i_pathClosed); + return daBaseNpc_addIdx(1, i_pathNo, i_pathIdx, i_pathClosed); } } /* 8014D620-8014D67C 147F60 005C+00 1/1 0/0 0/0 .text daBaseNpc_decIdx__FiPUsii */ -static void daBaseNpc_decIdx(int i_pathNo, u16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { +static void daBaseNpc_decIdx(int i_pathNo, s16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { if (i_pathDirection < 0) { daBaseNpc_addIdx(1, i_pathNo, i_pathIdx, i_pathClosed); } else { @@ -180,12 +180,12 @@ s32 daBaseNpc_path_c::chkPnt(cXyz i_pos) { } /* 8014DAC4-8014DB04 148404 0040+00 0/0 0/0 3/3 .text setNextPnt__16daBaseNpc_path_cFv */ -void daBaseNpc_path_c::setNextPnt() { - daBaseNpc_incIdx(mPathInfo->m_num, &mIdx, dPath_ChkClose(mPathInfo), mDirection); +BOOL daBaseNpc_path_c::setNextPnt() { + return daBaseNpc_incIdx(mPathInfo->m_num, &mIdx, dPath_ChkClose(mPathInfo), mDirection); } /* 8014DB04-8014DB0C 148444 0008+00 0/0 0/0 3/3 .text getIdx__16daBaseNpc_path_cFv */ -u16 daBaseNpc_path_c::getIdx() { +s16 daBaseNpc_path_c::getIdx() { return mIdx; } diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index 1c473fa0407..c30033c4657 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -9,6 +9,7 @@ #include "d/d_bg_w.h" #include "d/d_cc_uty.h" #include "d/d_com_inf_game.h" +#include "d/d_com_inf_actor.h" #include "dol2asm.h" #include "d/d_camera.h" #include "d/d_msg_object.h" @@ -392,7 +393,6 @@ extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; extern "C" u8 now__14mDoMtx_stack_c[48]; extern "C" u8 mCurrentMtx__6J3DSys[48]; extern "C" u8 sincosTable___5JMath[65536]; -extern "C" extern u8 g_dComIfGoat_gameInfo[4 + 4 /* padding */]; extern "C" void __register_global_object(); /* 80BFFF0C-80BFFF58 0000EC 004C+00 2/2 0/0 0/0 .text jointCtrlCallBack__FP8J3DJointi */ @@ -1962,7 +1962,7 @@ void daObj_GrA_c::restart() { field_0x1ff0 = 0; field_0x1ff4 = 0; field_0x2000 = -1; - field_0x2054 = 0; + mDemoCamMode = 0; field_0x2056 = 0; field_0x2004 = 0; field_0x2005 = 0; @@ -1981,7 +1981,7 @@ void daObj_GrA_c::restart() { field_0x2014 = 0; field_0x1fdc = 0; field_0x2032 = 0; - field_0x2048 = 0; + mGraMode = 0; setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); setFaceMotion(0, -1.0f); @@ -2914,7 +2914,7 @@ bool daObj_GrA_c::checkTagGraSub(fopAc_ac_c* a_this) { } /* 80C03764-80C03830 003944 00CC+00 1/1 0/0 0/0 .text fallAbyssCheck__11daObj_GrA_cFv */ -BOOL daObj_GrA_c::fallAbyssCheck() { +bool daObj_GrA_c::fallAbyssCheck() { if (mGroundY == -1000000000.0f && field_0x1528.isPath()) { field_0x1fc0++; if (field_0x1fc0 == 30) { @@ -2923,13 +2923,13 @@ BOOL daObj_GrA_c::fallAbyssCheck() { field_0x1528.setIdx(0); field_0x1fc0 = 0; - return TRUE; + return true; } } else { field_0x1fc0 = 0; } - return FALSE; + return false; } /* 80C03830-80C03B14 003A10 02E4+00 1/1 0/0 0/0 .text setPrtcl__11daObj_GrA_cFv */ @@ -3715,17 +3715,10 @@ int daObj_GrA_c::defence(void* param_1) { return 1; } -/* ############################################################################################## */ -/* 80C0FE14-80C0FE14 000398 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C0FE60 = "F_SP109"; -#pragma pop - /* 80C061F4-80C067D8 0063D4 05E4+00 5/0 0/0 0/0 .text toStone__11daObj_GrA_cFPv */ int daObj_GrA_c::toStone(void* param_1) { // NONMATCHING - int iVar1; + s16 sVar1; f32 fVar1; switch (field_0xa7c) { @@ -3744,39 +3737,40 @@ int daObj_GrA_c::toStone(void* param_1) { case 1: switch (field_0xaac) { case 1: - if (field_0x109c == 0) { - if (mpModelMorf->checkFrame(0.0f)) { - setBaseMotion(4, daObj_GrA_Param_c::m.field_0x0c * 0.5f); - setFaceMotion(13, daObj_GrA_Param_c::m.field_0x0c * 0.5f); - calcMotion(); - mpModelMorf->setFrame(mpModelMorf->getEndFrame()); - mpModelMorf->setPlaySpeed(1.0f); - field_0x109c = 1; - } - } else { + if (field_0x109c != 0) { cXyz sp70(daPy_getPlayerActorClass()->current.pos); fVar1 = (sp70 - current.pos).absXZ(); - if (field_0xaa8 == 0) { - if ((getSrchCircleR() < fVar1 || std::abs(sp70.y - current.pos.y) > 300.0f) || field_0x10c4 != 0) { - field_0xaa8 = 30; - } - } else { + if (field_0xaa8 != 0) { field_0xaa8--; - if (field_0xaa8 < 1) { + if (field_0xaa8 <= 0) { field_0x10a0 = 90; field_0xaac = 2; } + } else if ((fVar1 > getSrchCircleR() || std::abs(sp70.y - current.pos.y) > 300.0f) || field_0x10c4 != 0) { + field_0xaa8 = 30; } + } else if (mpModelMorf->checkFrame(0.0f)) { + setBaseMotion(4, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + setFaceMotion(13, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + calcMotion(); + mpModelMorf->setFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setPlaySpeed(1.0f); + field_0x109c = 1; } break; case 2: - if (field_0x10a0 == 0) { - if (field_0x10c4 == 0 || daPy_py_c::checkNowWolf() != 0) { - field_0xf50.OnAtSetBit(); - field_0x109c = 0; - } else { - iVar1 = cM_deg2s(daObj_GrA_Param_c::m.field_0x4c); + if (field_0x10a0 != 0) { + cXyz sp7c(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp7c, &field_0xab8[4].field_0x4); + field_0xab8[4].field_0x0 = 1; + mSound.startCreatureSoundLevel(Z2SE_GORON_TREMBLE, 0, -1); + field_0x10a0--; + } else { + if (field_0x10c4 != 0 && daPy_py_c::checkNowWolf() == 0) { + sVar1 = cM_deg2s(daObj_GrA_Param_c::m.field_0x4c); if (strcmp(dComIfGp_getStartStageName(), "F_SP109") == 0) { fVar1 = 95.0f; @@ -3784,38 +3778,33 @@ int daObj_GrA_c::toStone(void* param_1) { fVar1 = daObj_GrA_Param_c::m.field_0x48; } - daPy_getPlayerActorClass()->setRollJump(fVar1 * cM_scos(iVar1), fVar1 * cM_ssin(iVar1), daPy_getPlayerActorClass()->shape_angle.y); + daPy_getPlayerActorClass()->setRollJump(fVar1 * cM_scos(sVar1), fVar1 * cM_ssin(sVar1), daPy_getPlayerActorClass()->shape_angle.y); + } else { + field_0xf50.OnAtSetBit(); + field_0x109c = 0; } setBaseMotion(6, 0.0f); setFaceMotion(3, 0.0f); mpModelMorf->setPlaySpeed(1.0f); - field_0x10a0 = 3; + field_0x10a0 = 0; field_0xaac = 3; - } else { - cXyz sp7c(0.0f, 0.0f, 20.0f); - mDoMtx_stack_c::transS(current.pos); - mDoMtx_stack_c::YrotM(field_0x91a.y); - mDoMtx_stack_c::multVec(&sp7c, &field_0xab8[4].field_0x4); - field_0xab8[4].field_0x0 = 1; - mSound.startCreatureSoundLevel(Z2SE_GORON_TREMBLE, 0, -1); - field_0x10a0--; } break; case 3: - if (field_0x842 == 0 && mpModelMorf->checkFrame(12.0f)) { - field_0xab8[3].field_0x4 = current.pos; - field_0xab8[3].field_0x10 = field_0x91a; - field_0xab8[3].field_0x0 = 1; - } else { + if (field_0x842 != 0) { field_0xf50.OffAtSetBit(); setProcess(&daObj_GrA_c::wait); setLookMode(1); field_0x1528.field_0xa18 = 0; field_0xaac = 0; - health = 1; + health = daObj_GrA_Param_c::m.field_0x10; field_0x109c = 0; + } else if (mpModelMorf->checkFrame(12.0f)) { + field_0xab8[3].field_0x4 = current.pos; + field_0xab8[3].field_0x10 = field_0x91a; + field_0xab8[3].field_0x0 = 1; } } } @@ -3826,78 +3815,1256 @@ int daObj_GrA_c::toStone(void* param_1) { } /* 80C067D8-80C06CDC 0069B8 0504+00 2/0 0/0 0/0 .text step__11daObj_GrA_cFPv */ -int daObj_GrA_c::step(void* param_0) { +int daObj_GrA_c::step(void* param_1) { // NONMATCHING + switch (field_0xa7c) { + case 0: + setBaseMotion(9, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(9, -1.0f); + field_0x1098 = 0.0f; + field_0x1fe0 = 0; + field_0x1fdc = 0; + break; + + case 1: + if (field_0x842 != 0) { + field_0x1528.field_0xa18 = daObj_GrA_Param_c::m.field_0x98; + setProcess(&daObj_GrA_c::wait); + setBaseMotion(8, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(8, -1.0f); + } else if (mpModelMorf->getFrame() >= 25.0f && field_0x1fe0 == 0) { + field_0x1528.field_0xa18 = daObj_GrA_Param_c::m.field_0x98; + setProcess(&daObj_GrA_c::wait); + setBaseMotion(13, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(8, -1.0f); + setLookMode(0); + field_0xce0[0].OffAtSetBit(); + field_0xce0[0].ClrAtHit(); + field_0xce0[1].OffAtSetBit(); + field_0xce0[1].ClrAtHit(); + } else { + cLib_addCalc2(&speedF, daObj_GrA_Param_c::m.field_0x90 / 3.0f, 0.25f, 3.5f); + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &daPy_getPlayerActorClass()->current.pos), + 4, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + + if (mpModelMorf->getFrame() == 9.0f) { + field_0xce0[1].OnAtSetBit(); + } else { + if (mpModelMorf->getFrame() == 15.0f) { + field_0xce0[1].OffAtSetBit(); + } else { + if (mpModelMorf->getFrame() == 20.0f) { + field_0xce0[0].OnAtSetBit(); + } else { + if (mpModelMorf->getFrame() >= 24.0f) { + field_0xce0[0].OffAtSetBit(); + } + } + } + } + + if (field_0xce0[1].ChkAtShieldHit()) { + field_0xce0[1].ClrAtHit(); + field_0xab0.entry(field_0xce0[1].GetAtHitAc()); + field_0x1528.field_0xa18 = daObj_GrA_Param_c::m.field_0x98; + + setProcess(&daObj_GrA_c::wait); + setBaseMotion(11, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(8, -1.0f); + setLookMode(0); + + if (!dComIfGs_isSaveDunSwitch(0x1C)) { + dComIfGs_onSaveDunSwitch(0x1C); + } + } else if (field_0xce0[1].ChkAtHit() != 0) { + field_0x1fe0 = 1; + field_0x1fdc = 60; + if (!dComIfGs_isSaveDunSwitch(0x1C)) { + dComIfGs_onSaveDunSwitch(0x1C); + } + } + + if (field_0xce0[0].ChkAtShieldHit()) { + field_0xab0.entry(field_0xce0[0].GetAtHitAc()); + field_0x1528.field_0xa18 = daObj_GrA_Param_c::m.field_0x98; + + setProcess(&daObj_GrA_c::wait); + setBaseMotion(12, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(8, -1.0f); + setLookMode(0); + + if (!dComIfGs_isSaveDunSwitch(0x1C)) { + dComIfGs_onSaveDunSwitch(0x1C); + } + } else if (field_0xce0[0].ChkAtHit() != 0) { + field_0x1fe0 = 1; + field_0x1fdc = 60; + + if (!dComIfGs_isSaveDunSwitch(0x1C)) { + dComIfGs_onSaveDunSwitch(0x1C); + } + } + } + break; + + case 2: + field_0xce0[0].OffAtSetBit(); + field_0xce0[0].ClrAtHit(); + field_0xce0[1].OffAtSetBit(); + field_0xce0[1].ClrAtHit(); + speedF = 0.0f; + } + + return 1; } /* 80C06CDC-80C0780C 006EBC 0B30+00 3/0 0/0 0/0 .text rollReturn__11daObj_GrA_cFPv */ -int daObj_GrA_c::rollReturn(void* param_0) { +int daObj_GrA_c::rollReturn(void* param_1) { // NONMATCHING + cXyz sp48; + f32 fVar1; + s16 sVar1, sVar2; + + switch (field_0xa7c) { + case 0: + setLookMode(0); + field_0x1fe4 = 0; + field_0x2008 = 0.0f; + speedF = 0.0f; + + if (mMode == 1) { + setBaseMotion(20, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + setFaceMotion(13, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + } else { + if ((home.pos - current.pos).absXZ() < 150.0f) { + setBaseMotion(4, 0.0f); + setFaceMotion(13, 0.0f); + } else { + if (abs(cLib_targetAngleY(¤t.pos, &home.pos) - current.angle.y) < 0x4000) { + current.angle.y = cLib_targetAngleY(¤t.pos, &home.pos); + sVar1 = current.angle.y; + field_0x91a.y = current.angle.y; + shape_angle.y = current.angle.y; + setBaseMotion(4, 0.0f); + setFaceMotion(13, 0.0f); + } else { + current.angle.y = cLib_targetAngleY(¤t.pos, &home.pos); + sVar1 = current.angle.y + 0x8000; + field_0x91a.y = sVar1; + shape_angle.y = sVar1; + setBaseMotion(14, 0.0f); + setFaceMotion(13, 0.0f); + } + } + } + + calcMotion(); + break; + + case 1: + switch (field_0x1fe4) { + case 0: + if (field_0xa90 != 4 && field_0xa90 != 20) { + if (!mpModelMorf->isStop()) { + if (mMode != 1) { + if ((home.pos - current.pos).absXZ() < 150.0f) { + field_0x1fe4 = 1; + setBaseMotion(10, 0.0f); + setFaceMotion(13, 0.0f); + calcMotion(); + + if (abs(current.angle.y - field_0x91a.y) >= 0x4000) { + mpModelMorf->setFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setLoopFrame(mpModelMorf->getEndFrame()); + } + + mpModelMorf->setPlaySpeed(0.0f); + + return 1; + } + + setProcess(&daObj_GrA_c::toStone); + field_0x109c = 1; + } + } else if (mpModelMorf->checkFrame(14.0f)) { + cXyz sp54(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp54, &field_0xab8[2].field_0x4); + field_0xab8[2].field_0x10 = field_0x91a; + field_0xab8[2].field_0x0 = 1; + } + } else { + cXyz sp60(home.pos); + cLib_addCalc2(&field_0x2008, daObj_GrA_Param_c::m.field_0xa0, 0.05f, 1.0f); + cLib_chasePos(¤t.pos, sp60, field_0x2008); + + fVar1 = field_0x2008 * 0.1f; + if (cM3d_IsZero(field_0x2008)) { + fVar1 = 0.0f; + } + + sVar1 = current.angle.y + 0x8000; + field_0x91a.y = sVar1; + shape_angle.y = sVar1; + + if (mpModelMorf->isStop()) { + if ((home.pos - current.pos).absXZ() < 40.0f) { + setProcess(&daObj_GrA_c::toStone); + setBaseMotion(4, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + setFaceMotion(13, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + calcMotion(); + mpModelMorf->setFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setPlaySpeed(1.0f); + field_0x109c = 1; + } else { + field_0x1fe4 = 1; + setBaseMotion(10, 0.0f); + setFaceMotion(13, 0.0f); + calcMotion(); + + mpModelMorf->setFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setLoopFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setPlaySpeed(-fVar1); + } + } + } + break; + + case 1: + cXyz sp6c(home.pos); + cLib_addCalc2(&field_0x2008, daObj_GrA_Param_c::m.field_0xa0, 0.25f, 3.5f); + cLib_chasePos(¤t.pos, sp6c, field_0x2008); + + fVar1 = field_0x2008 * 0.1f; + if (cM3d_IsZero(field_0x2008)) { + fVar1 = 0.0f; + } + + if (abs(current.angle.y - field_0x91a.y) < 0x4000) { + mpModelMorf->setPlaySpeed(fVar1); + sVar1 = current.angle.y; + field_0x91a.y = sVar1; + shape_angle.y = sVar1; + } else { + mpModelMorf->setPlaySpeed(-fVar1); + sVar2 = current.angle.y + 0x8000; + field_0x91a.y = sVar2; + shape_angle.y = sVar2; + } + + fVar1 = (home.pos - current.pos).absXZ(); + if (fVar1 < 40.0f) { + setProcess(&daObj_GrA_c::toStone); + } + break; + } + + case 2: + field_0x2008 = 0.0f; + field_0x1fe4 = -1; + } + + return 1; } /* 80C0780C-80C078A8 0079EC 009C+00 1/1 0/0 0/0 .text soldierDemoSkip__11daObj_GrA_cFv */ -void daObj_GrA_c::soldierDemoSkip() { +int daObj_GrA_c::soldierDemoSkip() { // NONMATCHING + setLookMode(1); + setBaseMotion(0, 0.0f); + setFaceMotion(13, 0.0f); + field_0x109c = 0; + setProcess(&daObj_GrA_c::wait); + mDemoCamMode = 0; + field_0x209c = 0; + return 1; } /* 80C078A8-80C07C40 007A88 0398+00 1/0 0/0 0/0 .text soldierDemo__11daObj_GrA_cFPv */ -void daObj_GrA_c::soldierDemo(void* param_0) { +int daObj_GrA_c::soldierDemo(void* param_1) { // NONMATCHING + cXyz sp1c; + + switch (field_0xa7c) { + case 0: + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(2); + mDemoCamMode = 0; + field_0x209c = 1; + break; + + case 1: + switch (mDemoCamMode) { + case 1: + if (field_0xa90 == 17) { + setBaseMotion(20, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + setFaceMotion(13, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + setLookMode(0); + } else if (mpModelMorf->isStop()) { + field_0x109c = 1; + } else if (mpModelMorf->checkFrame(14.0f)) { + cXyz sp28(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp28, &field_0xab8[2].field_0x4); + field_0xab8[2].field_0x10 = field_0x91a; + field_0xab8[2].field_0x0 = 1; + } + break; + + case 3: + if (field_0x10a0 != 0) { + cXyz sp34(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp34, &field_0xab8[4].field_0x4); + field_0xab8[4].field_0x10 = field_0x91a; + field_0xab8[4].field_0x0 = 1; + + mSound.startCreatureSoundLevel(Z2SE_GORON_TREMBLE, 0, -1); + + field_0x10a0--; + if (field_0x10a0 == 0) { + setBaseMotion(6, 0.0f); + setFaceMotion(3, 0.0f); + mpModelMorf->setPlaySpeed(1.0f); + field_0x10a0 = 0; + field_0x109c = 0; + mDemoCamMode = 4; + } + } else { + field_0x10a0 = 90; + } + break; + + case 4: + if (mpModelMorf->isStop() && field_0xa90 != 0) { + setLookMode(1); + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + } else if (mpModelMorf->checkFrame(12.0f)) { + field_0xab8[3].field_0x4 = current.pos; + field_0xab8[3].field_0x10 = field_0x91a; + field_0xab8[3].field_0x0 = 1; + } + } + break; + + case 2: + mDemoCamMode = 0; + field_0x209c = 0; + } + + return 1; } /* 80C07C40-80C07C98 007E20 0058+00 1/1 0/0 0/0 .text getSrchLinkR__11daObj_GrA_cFv */ -void daObj_GrA_c::getSrchLinkR() { +f32 daObj_GrA_c::getSrchLinkR() { // NONMATCHING + int iVar1 = fopAcM_GetParam(this) & 0x7F; + if (iVar1 == 0) { + return daObj_GrA_Param_c::m.field_0x70 * 100.0f; + } + + return iVar1 * 100; } /* 80C07C98-80C07CF0 007E78 0058+00 1/1 0/0 0/0 .text getSrchGraR__11daObj_GrA_cFv */ -void daObj_GrA_c::getSrchGraR() { +f32 daObj_GrA_c::getSrchGraR() { // NONMATCHING + if (field_0x200c == 0) { + return daObj_GrA_Param_c::m.field_0x74 * 100.0f; + } + + return field_0x200c * 100; } /* 80C07CF0-80C07D38 007ED0 0048+00 3/3 0/0 0/0 .text getSpeed__11daObj_GrA_cFv */ -void daObj_GrA_c::getSpeed() { +f32 daObj_GrA_c::getSpeed() { // NONMATCHING + u32 uVar1 = fopAcM_GetParam(this) >> 14 & 63; + if (uVar1 == 63) { + return daObj_GrA_Param_c::m.field_0x84; + } + + return uVar1; } /* 80C07D38-80C083F0 007F18 06B8+00 1/0 0/0 0/0 .text standRoll__11daObj_GrA_cFPv */ -int daObj_GrA_c::standRoll(void* param_0) { +int daObj_GrA_c::standRoll(void* param_1) { // NONMATCHING + cXyz sp38; + daPy_py_c* player = daPy_getPlayerActorClass(); + + switch (field_0xa7c) { + case 0: + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(1); + field_0x2014 = 0; + break; + + case 1: + if (field_0x2031 == 0 && player != NULL) { + if (player->current.pos.y > current.pos.y) { + fopAcM_delete(this); + } else { + field_0x2031 = 1; + } + } + + if (getTagNo() != 0) { + if (field_0x2032 == 0) { + daTagGra_c* graTag_p = (daTagGra_c*)fpcM_Search(s_sub, this); + if (graTag_p != NULL) { + mGraPos = graTag_p->getGraPos(); + mGraExtent = graTag_p->getGraExtent(); + mGraHeight = graTag_p->getGraHeight(); + fopAcM_delete(graTag_p); + mGraMode = graTag_p->getMode(); + field_0x2032 = 1; + } + } else if (mGraMode == 1) { + sp38 = player->current.pos - current.pos; + sp38.y *= 2.0f; + if (sp38.abs() < getSrchLinkR() && player->checkPlayerFly() == 0 && !player->checkClimbMove() && + dComIfGp_checkPlayerStatus0(0, 8) == 0) { + setProcess(&daObj_GrA_c::rollDemo); + dComIfGoat_SetThrow(this); + } + } else { + sp38 = player->current.pos - mGraPos; + if (sp38.absXZ() < mGraExtent && player->checkPlayerFly() == 0 && sp38.y > -30.0f && sp38.y < mGraHeight && + !player->checkClimbMove() && dComIfGp_checkPlayerStatus0(0, 8) == 0) { + setProcess(&daObj_GrA_c::rollDemo); + dComIfGoat_SetThrow(this); + } + } + } else { + sp38 = player->current.pos - current.pos; + sp38.y = sp38.y * 2.0f; + if (sp38.abs() < getSrchLinkR() && player->checkPlayerFly() == 0 && !player->checkClimbMove() && + dComIfGp_checkPlayerStatus0(0, 8) == 0) { + setProcess(&daObj_GrA_c::rollDemo); + dComIfGoat_SetThrow(this); + } + } + break; + + case 2: + break; + } + + return 1; } /* 80C083F0-80C08804 0085D0 0414+00 3/0 0/0 0/0 .text rollDemo__11daObj_GrA_cFPv */ -void daObj_GrA_c::rollDemo(void* param_0) { +int daObj_GrA_c::rollDemo(void* param_1) { // NONMATCHING + switch (field_0xa7c) { + case 0: + if (isFirstGra()) { + mDemoCamMode = 1; + } + + field_0x209c = 1; + break; + + case 1: + if (isFirstGra()) { + switch (field_0x2000) { + case -1: + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &daPy_getPlayerActorClass()->current.pos), + 4, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + + if (mDemoCamMode >= 5) { + field_0x848 = 4; + evtcutTalk(-1, 1); + field_0x2000 = 0; + } + break; + + case 0: + if (evtcutTalk(-1, 0) != 0) { + setBaseMotion(20, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(0); + field_0x2000 = 1; + } + + field_0x2056 = 0; + break; + + case 1: + if (mpModelMorf->checkFrame(14.0f)) { + cXyz sp30(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp30, &field_0xab8[2].field_0x4); + field_0xab8[2].field_0x10 = field_0x91a; + field_0xab8[2].field_0x0 = 1; + + setLookMode(0); + setBaseMotion(10, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + calcMotion(); + + mpModelMorf->setEndFrame(29.0f); + mpModelMorf->setPlaySpeed(0.0f); + + field_0x2000 = 2; + } + break; + + case 2: + f32 playSpeed = mpModelMorf->getPlaySpeed(); + if (playSpeed < 1.0f) { + cLib_addCalc2(&playSpeed, 1.0f, 0.25f, 3.5f); + mpModelMorf->setPlaySpeed(playSpeed); + } + + if (mDemoCamMode == 0) { + setProcess(&daObj_GrA_c::rollAttack); + } + } + } else if (field_0xa90 == 4) { + setBaseMotion(4, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(1); + } else if (mpModelMorf->checkFrame(14.0f)) { + cXyz sp3c(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp3c, &field_0xab8[2].field_0x4); + field_0xab8[2].field_0x10 = field_0x91a; + field_0xab8[2].field_0x0 = 1; + + setLookMode(0); + setBaseMotion(10, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + calcMotion(); + + mpModelMorf->setEndFrame(29.0f); + mpModelMorf->setPlaySpeed(0.0f); + + setProcess(&daObj_GrA_c::rollAttack); + } + break; + + case 2: + field_0x2000 = -1; + field_0x209c = 0; + } + + demo_camera(); + return 1; } /* 80C08804-80C09298 0089E4 0A94+00 4/0 0/0 0/0 .text rollAttack__11daObj_GrA_cFPv */ -void daObj_GrA_c::rollAttack(void* param_0) { +int daObj_GrA_c::rollAttack(void* param_1) { // NONMATCHING + daPy_py_c* player = daPy_getPlayerActorClass(); + cXyz sp3c; + s16 sVar1; + f32 fVar1, fVar2; + bool bVar1; + cXyz sp48; + + switch (field_0xa7c) { + case 0: + field_0x1fe9 = 0; + setLookMode(0); + field_0x2005 = 0; + field_0x209c = 1; + break; + + case 1: + if (fallAbyssCheck()) { + break; + } + + sp48 = player->current.pos; + fVar1 = (sp48 - current.pos).abs(); + + if (fVar1 <= 1800.0f) { + if (field_0x2005 != 2) { + dComIfGp_getVibration().StartQuake(2, 15, cXyz(0.0f, 1.0f, 0.0f)); + field_0x2005 = 2; + } + } else if (fVar1 <= 2000.0f) { + if (field_0x2005 != 1) { + dComIfGp_getVibration().StartQuake(1, 15, cXyz(0.0f, 1.0f, 0.0f)); + field_0x2005 = 1; + } + } else { + if (dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StopQuake(31); + } + + field_0x2005 = 0; + } + + rollLanding(); + + bVar1 = false; + if (field_0x201c < 10 && field_0x1fe9 == 0 && fVar1 < getSrchGraR()) { + cXyz sp54(current.pos); + sp54.y += 100.0f; + field_0x1f4c.Set(&sp54, &player->eyePos, this); + field_0x1f4c.SetActorPid(parentActorID); + + s16 sVar1 = cLib_targetAngleX(&sp54, &player->eyePos); + if (!isFirstGra()) { + if (!dComIfG_Bgsp().LineCross(&field_0x1f4c)) { + if (!player->checkClimbMove() && dComIfGp_checkPlayerStatus0(0, 8) == 0 && sVar1 > -0x2000 && sVar1 < 0x2000) { + field_0x150c = 1; + bVar1 = true; + + if ((field_0x2014 == 0 && isFirstGra()) || player->checkEquipHeavyBoots() != 0) { + player->setGoronSideMove(this); + field_0x2014 = 1; + } + } + } + } + } + + if (isFirstGra()) { + if (player->current.pos.y < -4500.0f) { + setProcess(&daObj_GrA_c::rollAttacked); + return 1; + } + } else { + cXyz sp60(current.pos); + sp60.y += 100.0f; + field_0x1f4c.Set(&sp60, &player->eyePos, this); + field_0x1f4c.SetActorPid(parentActorID); + + if (player->checkPlayerFly() == 0 && (player->current.pos.y - current.pos.y) > 50.0f) { + player->offGoronSideMove(); + field_0x2014 = 1; + field_0x1fe9 = 1; + } + } + + if (!bVar1) { + field_0x150c = 0; + if (field_0x2014 == 0 && (player->current.pos.y - current.pos.y) > 0.0f) { + field_0x1fe9 = 1; + player->offGoronSideMove(); + field_0x2014 = 1; + } + } + + if (field_0x150c != 0 && field_0x1fe9 == 0) { + setCarryStatus(); + if (checkThrow()) { + return 1; + } + + if (field_0x1fe9 == 0) { + cXyz sp6c(sp48); + cLib_chaseF(&speedF, getSpeed(), daObj_GrA_Param_c::m.field_0xa8); + + if (field_0x201c < 10) { + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &sp6c), + 1, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + } + } + + bVar1 = false; + if (field_0x1528.isPath()) { + while (!bVar1) { + if (field_0x1528.chkPnt(current.pos) == 0) break; + + if (field_0x1528.setNextPnt()) { + bVar1 = true; + field_0x1fe9 = 1; + field_0x2014 = 1; + } + } + } + } else { + if (field_0x1fe9 == 1 && !dComIfGp_event_runCheck() && mDemoCamMode == 0) { + if (dComIfGoat_GetThrow() == this) { + dComIfGoat_SetThrow(NULL); + } + + if (field_0x2030 == 1 && field_0x2005 == 0 && fopAcM_otherBgCheck(this, dComIfGp_getPlayer(0))) { + fopAcM_delete(this); + if (dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StopQuake(31); + } + + return 1; + } + } + + bVar1 = false; + if (field_0x1528.isPath()) { + while (!bVar1) { + if (field_0x1528.chkPnt(current.pos) == 0) break; + + if (field_0x1528.setNextPnt()) { + bVar1 = true; + } + } + } else { + bVar1 = true; + } + + if (!bVar1) { + cXyz sp78(field_0x1528.getPntPos(field_0x1528.getIdx())); + sVar1 = current.angle.y; + cLib_chaseF(&speedF, getSpeed(), daObj_GrA_Param_c::m.field_0xa8); + + if (field_0x201c < 10) { + s16 sVar2 = cLib_targetAngleY(¤t.pos, &sp78); + cLib_addCalcAngleS2(¤t.angle.y, sVar2, 8, field_0x1528.field_0xa14); + field_0x1528.field_0xa14 = abs(current.angle.y - sVar2); + + cLib_addCalcAngleS2(&field_0x1528.field_0xa14, daObj_GrA_Param_c::m.field_0x88, 8, 0x40); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + } + } else if (cM3d_IsZero(speedF)) { + speedF = 0.0f; + if (mAcch.ChkGroundHit()) { + if (modeChangeCheck() == 0) { + cLib_addCalc2(&speedF, 0.0f, 0.25f, 3.5f); + if (mpModelMorf->isLoop()) { + speedF = 0.0f; + } else if (speedF < 1.0f) { + speedF = 1.0f; + } + + if (mpModelMorf->getFrame() < 2.0f) { + speedF = 0.0f; + if (mAcch.ChkGroundHit()) { + if (modeChangeCheck() == 0) { + fVar2 = speedF * 0.1f; + if (fVar2 < 0.5f) { + mpModelMorf->setPlaySpeed(0.5f); + } else { + mpModelMorf->setPlaySpeed(fVar2); + } + + if (field_0x1fe9 == 0 && field_0xf50.ChkCoHit() != 0) { + if (fopAcM_GetName(dCc_GetAc(field_0xf50.GetCoHitObj()->GetAc())) == PROC_ALINK) { + field_0x1fe9 = 1; + player->offGoronSideMove(); + player->offGoronUpStopCancel(); + + if (isFirstGra()) { + sVar1 = home.angle.y; + if (player->checkEquipHeavyBoots() != 0) { + player->setThrowDamage(sVar1, 30.0f, 40.0f, 1, 0, 0); + } else { + player->setThrowDamage(sVar1, daObj_GrA_Param_c::m.field_0xb8, daObj_GrA_Param_c::m.field_0xbc, 2, 0, 0); + } + + setProcess(&daObj_GrA_c::rollAttacked); + } + } + } + } + } + } + } + } + } + } + break; + + case 2: + dComIfGp_getVibration().StopQuake(31); + field_0x209c = 1; + break; + } + + return 1; } /* 80C09298-80C09918 009478 0680+00 4/0 0/0 0/0 .text rollAttacked__11daObj_GrA_cFPv */ -void daObj_GrA_c::rollAttacked(void* param_0) { +int daObj_GrA_c::rollAttacked(void* param_1) { // NONMATCHING + BOOL bVar1; + cXyz sp3c; + s16 sVar1; + daPy_py_c* player = daPy_getPlayerActorClass(); + attention_info.flags = 0; + + switch (field_0xa7c) { + case 0: + speedF = 0.0f; + field_0x2018 = -1; + mDemoCamMode = 1; + field_0x209c = 1; + break; + + case 1: + switch (field_0x2018) { + case -1: + if (mpModelMorf->checkFrame(0.0f)) { + mpModelMorf->setPlaySpeed(0.0f); + field_0x2018 = 0; + } + // fallthrough + case 0: + if (player->checkPlayerFly() == 0) { + if (player->current.pos.y < -4500.0f) { + field_0x2018 = 1; + current.pos = mGraPos; + old.pos = current.pos; + current.angle.y = cLib_targetAngleY(¤t.pos, &player->current.pos); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + field_0x1fec = 0; + setBaseMotion(0, 0.0f); + setFaceMotion(13, 0.0f); + setLookMode(1); + mpModelMorf->setPlaySpeed(1.0f); + player->offGoronSideMove(); + + if (dComIfGoat_GetThrow() == this) { + dComIfGoat_SetThrow(NULL); + } + } else { + field_0x1fec = 60; + field_0x2018 = 5; + field_0x1528.reverseDir(); + current.angle.y += 0x8000; + mpModelMorf->setLoopFrame(mpModelMorf->getEndFrame()); + player->setGoronSideMove(this); + field_0x2014 = 1; + mDemoCamMode = 7; + } + } + + field_0x2056 = 0; + break; + + case 1: + if (cLib_calcTimer(&field_0x1fec) == 0) { + if (dComIfGs_getLife() == 0) { + setProcess(&daObj_GrA_c::wait); + speedF = 0.0f; + current.pos = home.pos; + old.pos = home.pos; + current.angle.y = home.angle.y; + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + mDemoCamMode = 7; + } else { + field_0x2018 = 2; + } + } + break; + + case 2: + if (mDemoCamMode >= 5) { + field_0x848 = 5; + evtcutTalk(-1, 1); + field_0x2018 = 3; + } + break; + + case 3: + if (evtcutTalk(-1, 0) != 0) { + setLookMode(0); + field_0x2018 = 4; + setBaseMotion(1, 0.0f); + setFaceMotion(13, 0.0f); + } + + field_0x2056 = 0; + break; + + case 4: + if (mDemoCamMode != 0) { + cLib_addCalc2(&speedF, daObj_GrA_Param_c::m.field_0x90 * 0.5f, 0.25f, 3.5f); + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &home.pos), + 1, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + } else { + setProcess(&daObj_GrA_c::wait); + speedF = 0.0f; + current.pos = home.pos; + old.pos = home.pos; + current.angle.y = home.angle.y; + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + } + break; + + case 5: + if (cLib_calcTimer(&field_0x1fec) == 0) { + current.angle.y += 0x8000; + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + setProcess(&daObj_GrA_c::rollAttack); + field_0x1528.reverseDir(); + mpModelMorf->setLoopFrame(mpModelMorf->getStartFrame()); + } else { + bVar1 = false; + if (field_0x1528.isPath()) { + while (!bVar1) { + if (field_0x1528.chkPnt(current.pos) == 0) break; + + if (field_0x1528.setNextPnt()) { + bVar1 = true; + } + } + } else { + bVar1 = true; + } + + if (!bVar1) { + sp3c = field_0x1528.getPntPos(field_0x1528.getIdx()); + sVar1 = current.angle.y; + cLib_chaseF(&speedF, getSpeed(), daObj_GrA_Param_c::m.field_0xa8); + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &sp3c), + 8, field_0x1528.field_0xa14); + field_0x1528.field_0xa14 = abs(current.angle.y - sVar1); + cLib_addCalcAngleS2(&field_0x1528.field_0xa14, daObj_GrA_Param_c::m.field_0x88, + 8, 0x40); + shape_angle.y = current.angle.y + 0x8000; + field_0x91a.y = current.angle.y + 0x8000; + } else { + cLib_addCalc2(&speedF, 0.0f, 0.25f, 3.5f); + } + + mpModelMorf->setPlaySpeed(-(speedF * 0.1f)); + } + } + break; + + case 2: + field_0x2014 = 0; + field_0x209c = 0; + } + + rollAttackedDemo(); + return 1; } /* 80C09918-80C09F08 009AF8 05F0+00 2/0 0/0 0/0 .text rollEscape__11daObj_GrA_cFPv */ -void daObj_GrA_c::rollEscape(void* param_0) { +int daObj_GrA_c::rollEscape(void* param_1) { // NONMATCHING + cXyz sp50; + f32 fVar1; + BOOL bVar1; + cXyz sp68; + s16 sVar1; + daPy_py_c* player; + + switch (field_0xa7c) { + case 0: + field_0x2005 = 0; + mpModelMorf->setLoopFrame(mpModelMorf->getEndFrame()); + field_0x209c = 1; + break; + + case 1: + player = daPy_getPlayerActorClass(); + fVar1 = (player->current.pos - current.pos).absXZ(); + if (fVar1 <= 1800.0f) { + if (field_0x2005 != 2) { + dComIfGp_getVibration().StartQuake(2, 15, cXyz(0.0f, 1.0f, 0.0f)); + field_0x2005 = 2; + } + } else if (fVar1 <= 2000.0f) { + if (field_0x2005 != 1) { + dComIfGp_getVibration().StartQuake(1, 15, cXyz(0.0f, 1.0f, 0.0f)); + field_0x2005 = 1; + } + } else { + if (dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StopQuake(31); + } + + field_0x2005 = 0; + } + + rollLanding(); + if (dComIfGp_event_runCheck()) { + if (dComIfGp_getEvent().isOrderOK()) { + if (dComIfGoat_GetThrow() == this) { + dComIfGoat_SetThrow(0); + if (isFirstGra()) { + mDemoCamMode = 3; + graThrowDemo(); + daNpcF_onEvtBit(0x52); + } + } + + if (field_0x2030 == 1 && field_0x2005 == 0 && + (fopAcM_otherBgCheck(this, dComIfGp_getPlayer(0)) || fopAcM_CheckCondition(this, 4) != 0)) { + if (dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StopQuake(31); + } + + fopAcM_delete(this); + return 1; + } + } + } + + bVar1 = FALSE; + if (field_0x1528.isPath()) { + while (!bVar1) { + if (field_0x1528.chkPnt(current.pos) == 0) break; + + if (field_0x1528.setNextPnt()) { + bVar1 = TRUE; + } + } + } else { + bVar1 = TRUE; + } + + int iVar2; + if (!bVar1) { + sp68 = field_0x1528.getPntPos(field_0x1528.getIdx()); + sVar1 = current.angle.y; + cLib_chaseF(&speedF, getSpeed(), daObj_GrA_Param_c::m.field_0xa8); + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &sp68), + 8, field_0x1528.field_0xa14); + field_0x1528.field_0xa14 = abs(current.angle.y - sVar1); + cLib_addCalcAngleS2(&field_0x1528.field_0xa14, daObj_GrA_Param_c::m.field_0x88, 8, 0x40); + cLib_addCalcAngleS2(&shape_angle.y, current.angle.y + 0x8000, 8, 0x1000); + field_0x91a.y = shape_angle.y; + } else if (cM3d_IsZero(speedF)) { + speedF = 0.0f; + if (mAcch.ChkGroundHit()) { + if (modeChangeCheck()) { + break; + } + } + + cLib_addCalc2(&speedF, 0.0f, 0.25f, 3.5f); + if (mpModelMorf->isLoop()) { + speedF = 0.0f; + } else if (speedF < 1.0f) { + speedF = 1.0f; + } + + if (mpModelMorf->getFrame() < 2.0f) { + speedF = 0.0f; + if (mAcch.ChkGroundHit()) { + if (modeChangeCheck()) { + break; + } + } + } + } + + fVar1 = speedF * 0.1f; + if (cM3d_IsZero(speedF)) { + fVar1 = 0.0f; + } + + mpModelMorf->setPlaySpeed(-fVar1); + break; + + case 2: + dComIfGp_getVibration().StopQuake(31); + field_0x209c = 0; + } + + graThrowDemo(); + return 1; } /* 80C09F08-80C0A018 00A0E8 0110+00 2/2 0/0 0/0 .text rollLanding__11daObj_GrA_cFv */ void daObj_GrA_c::rollLanding() { - // NONMATCHING + if (mAcch.ChkGroundLanding() && field_0x201c >= 10) { + cXyz sp28(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp28, &field_0xab8[5].field_0x4); + field_0xab8[5].field_0x10 = field_0x91a; + field_0xab8[5].field_0x0 = 1; + + dComIfGp_getVibration().StartShock(8, 15, cXyz(0.0f, 1.0f, 0.0f)); + mSound.startCreatureSound(Z2SE_GORON_ROLL_BOUND, 0, -1); + } } /* 80C0A018-80C0A120 00A1F8 0108+00 3/0 0/0 0/0 .text thrown__11daObj_GrA_cFPv */ -void daObj_GrA_c::thrown(void* param_0) { - // NONMATCHING +int daObj_GrA_c::thrown(void* param_1) { + int rv = 0; + + switch (field_0xa7c) { + case 0: + fopAcM_OnStatus(this, 0x4000); + field_0x1ff0 = 1; + mDemoCamMode = 0; + field_0x209c = 1; + break; + + case 1: + if (field_0x1ff8 != 0) { + field_0x1ff8--; + } + + switch (field_0x1ff0) { + case 1: + executeCrazyBeforeCatch(); + break; + + case 2: + executeCrazyCatch(); + break; + + case 3: + executeCrazyThrow(); + break; + + case 4: + executeCrazyJumping(); + } + + rv = 1; + break; + + case 2: + field_0x209c = 0; + } + + graThrowDemo(); + return rv; } /* 80C0A120-80C0AF94 00A300 0E74+00 2/1 0/0 0/0 .text demo_camera__11daObj_GrA_cFv */ void daObj_GrA_c::demo_camera() { // NONMATCHING + f32 fVar1; + cXyz sp4c, sp58, sp64, sp70, sp7c, sp88, sp94; + csXyz cStack_144; + daPy_py_c* player = daPy_getPlayerActorClass(); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + dCamera_c* camBody = dCam_getBody(); + + switch (mDemoCamMode) { + case 1: + if (!eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(this, 0, 0xFFEF, 0); + eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + + camera->mCamera.Stop(); + mDemoCamMode = 2; + field_0x2056 = 0; + fVar1 = camBody->Fovy(); + field_0x208c = fVar1; + field_0x2070 = fVar1; + field_0x2080 = camBody->Center(); + field_0x2064 = field_0x2080; + field_0x2074 = camBody->Eye(); + field_0x2058 = field_0x2074; + camera->mCamera.SetTrimSize(2); + break; + + case 2: + break; + + case 3: + if (field_0x2056 < daObj_GrA_Param_c::m.field_0xac) { + sp4c = current.pos; + sp4c.y += 150.0f; + cLib_addCalcPos2(&field_0x2064, sp4c, 0.1f, (field_0x2080 - sp4c).abs() / 25.0f); + break; + } + + mDemoCamMode++; + field_0x2056 = 0; + // fallthrough + case 4: + if (field_0x2056 < daObj_GrA_Param_c::m.field_0xb0) { + mDoMtx_stack_c::YrotS(shape_angle.y); + sp58.x = 0.0f; + sp58.y = 250.0f; + sp58.z = 500.0f; + mDoMtx_stack_c::multVec(&sp58, &sp58); + sp58 += current.pos; + cLib_addCalcPos2(&field_0x2058, sp58, 0.1f, (field_0x2074 - sp58).abs() / 25.0f); + + sp64 = current.pos; + sp64.y += 150.0f; + cLib_addCalcPos2(&field_0x2064, sp64, 0.1f, (field_0x2080 - sp64).abs() / 25.0f); + + field_0x2070 += (55.0f - field_0x208c) / 0.0f; + break; + } + + mDemoCamMode++; + field_0x2056 = 0; + // fallthrough + case 5: + if (field_0x2056 < 40) { + mDoMtx_stack_c::YrotS(shape_angle.y); + sp70.x = 0.0f; + sp70.y = 250.0f; + sp70.z = 500.0f; + mDoMtx_stack_c::multVec(&sp70, &sp70); + sp70 += current.pos; + cLib_addCalcPos2(&field_0x2058, sp70, 0.1f, (field_0x2074 - sp70).abs() / 25.0f); + + sp7c = current.pos; + sp7c.y += 150.0f; + cLib_addCalcPos2(&field_0x2064, sp7c, 0.1f, (field_0x2080 - sp7c).abs() / 25.0f); + break; + } + + mDemoCamMode++; + field_0x2056 = 0; + cStack_144 = player->current.angle; + cStack_144.y = cLib_targetAngleY(&player->current.pos, ¤t.pos); + player->setPlayerPosAndAngle(&player->current.pos, &cStack_144); + field_0x2074 = field_0x2058; + field_0x2080 = field_0x2064; + // fallthrough + case 6: + if (field_0x2056 < daObj_GrA_Param_c::m.field_0xb4) { + sp88 = player->current.pos; + sp88.y += 150.0f; + cLib_chasePos(&field_0x2064, sp88, (field_0x2080 - sp88).abs() / 0.0f); + + mDoMtx_stack_c::YrotS(player->current.angle.y); + sp94.x = 0.0f; + sp94.y = 210.0f; + sp94.z = -335.0f; + mDoMtx_stack_c::multVec(&sp94, &sp94); + sp94 += player->current.pos; + cLib_chasePos(&field_0x2058, sp94, (field_0x2074 - sp94).abs() / 0.0f); + field_0x2070 += INFINITY; + } else { + camera->mCamera.Reset(field_0x2064, field_0x2058); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + mDemoCamMode = 0; + field_0x2056 = 0; + } + // fallthrough + default: + if (mDemoCamMode != 0) { + camera->mCamera.Set(field_0x2064, field_0x2058, field_0x2070, 0); + field_0x2056++; + } + + } } /* 80C0AF94-80C0B9AC 00B174 0A18+00 2/1 0/0 0/0 .text rollAttackedDemo__11daObj_GrA_cFv @@ -3917,7 +5084,7 @@ void daObj_GrA_c::setCarryStatus() { } /* 80C0BE5C-80C0BF34 00C03C 00D8+00 1/1 0/0 0/0 .text checkThrow__11daObj_GrA_cFv */ -void daObj_GrA_c::checkThrow() { +bool daObj_GrA_c::checkThrow() { // NONMATCHING } @@ -3969,7 +5136,7 @@ void daObj_GrA_c::executeCrazyJumping() { } /* 80C0CDBC-80C0CF10 00CF9C 0154+00 2/2 0/0 0/0 .text modeChangeCheck__11daObj_GrA_cFv */ -void daObj_GrA_c::modeChangeCheck() { +int daObj_GrA_c::modeChangeCheck() { // NONMATCHING } From 49c7f77561c0aafac9649a26d1a029ef183cc722 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:22:23 -0400 Subject: [PATCH 06/21] Almost all functions worked on --- include/d/actor/d_a_obj_gra2.h | 28 +- src/d/actor/d_a_obj_gra2.cpp | 961 +++++++++++++++++++++++++++++---- 2 files changed, 884 insertions(+), 105 deletions(-) diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 15933412618..6639bc904bf 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -113,7 +113,7 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C00D5C */ const char* getResName(); /* 80C00D74 */ u8 getMode(); /* 80C00DF8 */ u8 getPathNo(); - /* 80C00E04 */ u32 getTagNo(); + /* 80C00E04 */ u16 getTagNo(); /* 80C00E10 */ u32 getJumpType(); /* 80C00E1C */ BOOL isDelete(); /* 80C00EFC */ void restart(); @@ -216,11 +216,11 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C0C690 */ void executeCrazyThrow(); /* 80C0C84C */ void initCrazyAttack(); /* 80C0CA64 */ void executeCrazyJumping(); - /* 80C0CDBC */ int modeChangeCheck(); - /* 80C0CF98 */ bool checkGraSub(fopAc_ac_c*); + /* 80C0CDBC */ BOOL modeChangeCheck(); + /* 80C0CF98 */ BOOL checkGraSub(fopAc_ac_c*); /* 80C0D000 */ int waitDemo(void*); - /* 80C0D2FC */ void skipDemoGra(); - /* 80C0D3E0 */ void startDemo(void*); + /* 80C0D2FC */ int skipDemoGra(); + /* 80C0D3E0 */ int startDemo(void*); /* 80C0EFC4 */ void turn(s16, f32, int); /* 80C0F17C */ BOOL turn_step(s16, int, int, int); /* 80C0F330 */ void chkFindPlayer2(int, s16); @@ -241,6 +241,8 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { bool isFirstGra() { return field_0x1fe8 == 0; } + void setDemoMode(s16 mDemoMode) { mDemoCamMode = mDemoMode; } + private: /* 0x0A48 */ u16 field_0xa48; /* 0x0A4A */ u8 field_0xa4a[0xa4c - 0xa4a]; @@ -313,7 +315,7 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x1FE0 */ u8 field_0x1fe0; /* 0x1FE1 */ u8 field_0x1fe1[0x1fe4 - 0x1fe1]; /* 0x1FE4 */ int field_0x1fe4; - /* 0x1FE8 */ u8 field_0x1fe8; + /* 0x1FE8 */ s8 field_0x1fe8; /* 0x1FE9 */ u8 field_0x1fe9; /* 0x1FEA */ u8 field_0x1fea[0x1fec - 0x1fea]; /* 0x1FEC */ int field_0x1fec; @@ -321,7 +323,8 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x1FF4 */ u8 field_0x1ff4; /* 0x1FF5 */ u8 field_0x1ff5[0x1ff8 - 0x1ff5]; /* 0x1FF8 */ int field_0x1ff8; - /* 0x1FFC */ u8 field_0x1ffc[0x2000 - 0x1ffc]; + /* 0x1FFC */ u8 field_0x1ffc; + /* 0x1FFD */ u8 field_0x1ffd[0x2000 - 0x1ffd]; /* 0x2000 */ int field_0x2000; /* 0x2004 */ u8 field_0x2004; /* 0x2005 */ s8 field_0x2005; @@ -350,15 +353,16 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x204C */ daBaseNpc_acMngr_c field_0x204c; /* 0x2054 */ s16 mDemoCamMode; /* 0x2056 */ s16 field_0x2056; - /* 0x2058 */ cXyz field_0x2058; - /* 0x2064 */ cXyz field_0x2064; - /* 0x2070 */ f32 field_0x2070; + /* 0x2058 */ cXyz mDemoCamEye; + /* 0x2064 */ cXyz mDemoCamCenter; + /* 0x2070 */ f32 mDemoCamFovy; /* 0x2074 */ cXyz field_0x2074; /* 0x2080 */ cXyz field_0x2080; /* 0x208C */ f32 field_0x208c; - /* 0x2090 */ u8 field_0x2090[12]; + /* 0x2090 */ cXyz field_0x2090; /* 0x209C */ int field_0x209c; - /* 0x20A0 */ u8 field_0x20a0[0x20a4 - 0x20a0]; + /* 0x20A0 */ u8 field_0x20a0; + /* 0x20A1 */ u8 field_0x20a1[0x20a4 - 0x20a1]; }; STATIC_ASSERT(sizeof(daObj_GrA_c) == 0x20a4); diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index c30033c4657..f317ff43dd9 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -10,6 +10,9 @@ #include "d/d_cc_uty.h" #include "d/d_com_inf_game.h" #include "d/d_com_inf_actor.h" +#ifdef DEBUG +#include "d/d_debug_viewer.h" +#endif #include "dol2asm.h" #include "d/d_camera.h" #include "d/d_msg_object.h" @@ -1891,7 +1894,7 @@ u8 daObj_GrA_c::getPathNo() { } /* 80C00E04-80C00E10 000FE4 000C+00 4/4 0/0 0/0 .text getTagNo__11daObj_GrA_cFv */ -u32 daObj_GrA_c::getTagNo() { +u16 daObj_GrA_c::getTagNo() { return fopAcM_GetParam(this) >> 7 & 0x7F; } @@ -4949,14 +4952,13 @@ int daObj_GrA_c::thrown(void* param_1) { void daObj_GrA_c::demo_camera() { // NONMATCHING f32 fVar1; - cXyz sp4c, sp58, sp64, sp70, sp7c, sp88, sp94; + cXyz sp40, sp4c, sp58, sp64, sp70, sp7c, sp88, sp94; csXyz cStack_144; daPy_py_c* player = daPy_getPlayerActorClass(); camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); dCamera_c* camBody = dCam_getBody(); - switch (mDemoCamMode) { - case 1: + if (mDemoCamMode <= 6) { if (!eventInfo.checkCommandDemoAccrpt()) { fopAcM_orderPotentialEvent(this, 0, 0xFFEF, 0); eventInfo.onCondition(dEvtCnd_CANDEMO_e); @@ -4968,78 +4970,86 @@ void daObj_GrA_c::demo_camera() { field_0x2056 = 0; fVar1 = camBody->Fovy(); field_0x208c = fVar1; - field_0x2070 = fVar1; + mDemoCamFovy = fVar1; field_0x2080 = camBody->Center(); - field_0x2064 = field_0x2080; + mDemoCamCenter = field_0x2080; field_0x2074 = camBody->Eye(); - field_0x2058 = field_0x2074; + mDemoCamEye = field_0x2074; camera->mCamera.SetTrimSize(2); - break; - case 2: - break; + if (daObj_GrA_Param_c::m.field_0xac >= field_0x2056) { + mDemoCamMode++; + field_0x2056 = 0; + } else { + sp40 = current.pos; + sp40.y += 150.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp40, 0.1f, (field_0x2080 - sp40).abs() / 25.0f); + } - case 3: - if (field_0x2056 < daObj_GrA_Param_c::m.field_0xac) { + if (daObj_GrA_Param_c::m.field_0xae >= field_0x2056) { + mDemoCamMode++; + field_0x2056 = 0; + } else { sp4c = current.pos; sp4c.y += 150.0f; - cLib_addCalcPos2(&field_0x2064, sp4c, 0.1f, (field_0x2080 - sp4c).abs() / 25.0f); - break; + cLib_addCalcPos2(&mDemoCamCenter, sp4c, 0.1f, (field_0x2080 - sp4c).abs() / 25.0f); + } - mDemoCamMode++; - field_0x2056 = 0; - // fallthrough - case 4: - if (field_0x2056 < daObj_GrA_Param_c::m.field_0xb0) { + if (daObj_GrA_Param_c::m.field_0xb0 >= field_0x2056) { + mDemoCamMode++; + field_0x2056 = 0; + } else { mDoMtx_stack_c::YrotS(shape_angle.y); sp58.x = 0.0f; sp58.y = 250.0f; sp58.z = 500.0f; mDoMtx_stack_c::multVec(&sp58, &sp58); sp58 += current.pos; - cLib_addCalcPos2(&field_0x2058, sp58, 0.1f, (field_0x2074 - sp58).abs() / 25.0f); + cLib_addCalcPos2(&mDemoCamEye, sp58, 0.1f, (field_0x2074 - sp58).abs() / 25.0f); sp64 = current.pos; sp64.y += 150.0f; - cLib_addCalcPos2(&field_0x2064, sp64, 0.1f, (field_0x2080 - sp64).abs() / 25.0f); + cLib_addCalcPos2(&mDemoCamCenter, sp64, 0.1f, (field_0x2080 - sp64).abs() / 25.0f); - field_0x2070 += (55.0f - field_0x208c) / 0.0f; - break; + mDemoCamFovy += (55.0f - field_0x208c) / 0.0f; } - mDemoCamMode++; - field_0x2056 = 0; - // fallthrough - case 5: - if (field_0x2056 < 40) { - mDoMtx_stack_c::YrotS(shape_angle.y); - sp70.x = 0.0f; - sp70.y = 250.0f; - sp70.z = 500.0f; - mDoMtx_stack_c::multVec(&sp70, &sp70); - sp70 += current.pos; - cLib_addCalcPos2(&field_0x2058, sp70, 0.1f, (field_0x2074 - sp70).abs() / 25.0f); - - sp7c = current.pos; - sp7c.y += 150.0f; - cLib_addCalcPos2(&field_0x2064, sp7c, 0.1f, (field_0x2080 - sp7c).abs() / 25.0f); - break; + if (daObj_GrA_Param_c::m.field_0xb2 >= field_0x2056) { + mDemoCamMode++; + field_0x2056 = 0; + cStack_144 = player->current.angle; + cStack_144.y = cLib_targetAngleY(&player->current.pos, ¤t.pos); + player->setPlayerPosAndAngle(&player->current.pos, &cStack_144); + field_0x2074 = mDemoCamEye; + field_0x2080 = mDemoCamCenter; + } else { + // if (field_0x2056 < 40) { + mDoMtx_stack_c::YrotS(shape_angle.y); + sp70.x = 0.0f; + sp70.y = 250.0f; + sp70.z = 500.0f; + mDoMtx_stack_c::multVec(&sp70, &sp70); + sp70 += current.pos; + cLib_addCalcPos2(&mDemoCamEye, sp70, 0.1f, (field_0x2074 - sp70).abs() / 25.0f); + + sp7c = current.pos; + sp7c.y += 150.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp7c, 0.1f, (field_0x2080 - sp7c).abs() / 25.0f); + // } } - mDemoCamMode++; - field_0x2056 = 0; - cStack_144 = player->current.angle; - cStack_144.y = cLib_targetAngleY(&player->current.pos, ¤t.pos); - player->setPlayerPosAndAngle(&player->current.pos, &cStack_144); - field_0x2074 = field_0x2058; - field_0x2080 = field_0x2064; - // fallthrough - case 6: - if (field_0x2056 < daObj_GrA_Param_c::m.field_0xb4) { + if (daObj_GrA_Param_c::m.field_0xb4 >= field_0x2056) { + camera->mCamera.Reset(mDemoCamCenter, mDemoCamEye); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + mDemoCamMode = 0; + field_0x2056 = 0; + } else { sp88 = player->current.pos; sp88.y += 150.0f; - cLib_chasePos(&field_0x2064, sp88, (field_0x2080 - sp88).abs() / 0.0f); + cLib_chasePos(&mDemoCamCenter, sp88, (field_0x2080 - sp88).abs() / 0.0f); mDoMtx_stack_c::YrotS(player->current.angle.y); sp94.x = 0.0f; @@ -5047,137 +5057,902 @@ void daObj_GrA_c::demo_camera() { sp94.z = -335.0f; mDoMtx_stack_c::multVec(&sp94, &sp94); sp94 += player->current.pos; - cLib_chasePos(&field_0x2058, sp94, (field_0x2074 - sp94).abs() / 0.0f); - field_0x2070 += INFINITY; - } else { - camera->mCamera.Reset(field_0x2064, field_0x2058); - camera->mCamera.Start(); - camera->mCamera.SetTrimSize(0); - dComIfGp_event_reset(); - mDemoCamMode = 0; - field_0x2056 = 0; - } - // fallthrough - default: - if (mDemoCamMode != 0) { - camera->mCamera.Set(field_0x2064, field_0x2058, field_0x2070, 0); - field_0x2056++; + cLib_chasePos(&mDemoCamEye, sp94, (field_0x2074 - sp94).abs() / 0.0f); + mDemoCamFovy += INFINITY; } - + } else if (mDemoCamMode != 0) { + camera->mCamera.Set(mDemoCamCenter, mDemoCamEye, mDemoCamFovy, 0); + field_0x2056++; } } -/* 80C0AF94-80C0B9AC 00B174 0A18+00 2/1 0/0 0/0 .text rollAttackedDemo__11daObj_GrA_cFv - */ +/* 80C0AF94-80C0B9AC 00B174 0A18+00 2/1 0/0 0/0 .text rollAttackedDemo__11daObj_GrA_cFv */ void daObj_GrA_c::rollAttackedDemo() { // NONMATCHING + daPy_py_c* player = daPy_getPlayerActorClass(); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + dCamera_c* camBody = dCam_getBody(); + + if (mDemoCamMode <= 7) { + if (!eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(this, 0, 0xFFEF, 0); + eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + + + } } /* 80C0B9AC-80C0BD90 00BB8C 03E4+00 2/2 0/0 0/0 .text graThrowDemo__11daObj_GrA_cFv */ void daObj_GrA_c::graThrowDemo() { // NONMATCHING + cXyz sp2c; + daPy_py_c* player = daPy_getPlayerActorClass(); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + dCamera_c* camBody = dCam_getBody(); + + switch (mDemoCamMode) { + case 0: + break; + + case 1: + if (dComIfGp_event_runCheck()) { + if (checkProcess(&daObj_GrA_c::thrown)) { + camera->mCamera.Stop(); + mDemoCamMode = 2; + mDemoCamFovy = camBody->Fovy(); + mDemoCamCenter = camBody->Center(); + mDemoCamEye = camBody->Eye(); + mDoMtx_stack_c::YrotS(player->current.angle.y); + + if (field_0x1ffc != 0) { + field_0x2090.x = -300.0f; + } else { + field_0x2090.x = 300.0f; + } + field_0x2090.y = 500.0f; + field_0x2090.z = 0.0f; + + mDoMtx_stack_c::multVec(&field_0x2090, &field_0x2090); + field_0x2090 += current.pos; + + if (fopAcM_lc_c::lineCheck(&mDemoCamEye, &field_0x2090, this)) { + if (field_0x1ffc != 0) { + field_0x2090.x = 300.0f; + } else { + field_0x2090.x = -300.0f; + } + + field_0x20a0 = 1; + } else { + if (field_0x1ffc != 0) { + field_0x2090.x = -200.0f; + } else { + field_0x2090.x = 200.0f; + } + + field_0x20a0 = 0; + } + + mDoMtx_stack_c::YrotS(player->current.angle.y); + field_0x2090.y = 500.0f; + field_0x2090.z = 0.0f; + mDoMtx_stack_c::multVec(&field_0x2090, &field_0x2090); + field_0x2090 += current.pos; + } + } else { + return; + } + // fallthrough + case 2: + sp2c.set(0.0f ,150.0f, -200.0f); + if (field_0x1ff8 != 0) { + mDoMtx_stack_c::YrotS(cLib_targetAngleY(&player->current.pos, ¤t.pos)); + mDoMtx_stack_c::multVec(&sp2c, &sp2c); + sp2c += player->current.pos; + + if (fopAcM_lc_c::lineCheck(&mDemoCamEye, &sp2c, this)) { + field_0x20a0 = 1; + } + } + + if (field_0x1ff8 != 0 && field_0x20a0 == 0) { + cLib_addCalcPos2(&mDemoCamEye, sp2c, 0.2f, 100.0f); + cLib_addCalcPos2(&mDemoCamCenter, current.pos, 0.2f, 200.0f); + } else { + cLib_addCalcPos2(&mDemoCamEye, field_0x2090, 0.1f, 15.0f); + cLib_addCalcPos2(&mDemoCamCenter, (current.pos + player->current.pos) / 2.0f, 0.1f, 15.0f); + } + break; + + case 3: + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + field_0x1520 = 1; + mDemoCamMode = 0; + break; + } + + if (mDemoCamMode != 0) { + camera->mCamera.Set(mDemoCamCenter, mDemoCamEye, mDemoCamFovy, 0); + } } /* 80C0BD90-80C0BE5C 00BF70 00CC+00 1/1 0/0 0/0 .text setCarryStatus__11daObj_GrA_cFv */ void daObj_GrA_c::setCarryStatus() { // NONMATCHING + cXyz sp38; + mDoMtx_stack_c::YrotS(-shape_angle.y); + mDoMtx_stack_c::transM(-current.pos.x, -current.pos.y, -current.pos.z); + mDoMtx_stack_c::multVec(&daPy_getPlayerActorClass()->current.pos, &sp38); + if (fabsf(sp38.x) < 100.0f && sp38.z > 0.0f && sp38.z < 800.0f) { + attention_info.flags |= 0x10; + } } /* 80C0BE5C-80C0BF34 00C03C 00D8+00 1/1 0/0 0/0 .text checkThrow__11daObj_GrA_cFv */ bool daObj_GrA_c::checkThrow() { // NONMATCHING + if (field_0xa48 != 0) { + if ((field_0xa48 & 1) != 0) { + setProcess(&daObj_GrA_c::thrown); + initCrazyBeforeCatch(0); + field_0xa48 &= 0xFFFE; + return true; + } + + if ((field_0xa48 & 2) != 0) { + setProcess(&daObj_GrA_c::thrown); + initCrazyCatch(0); + field_0xa48 &= 0xFFFD; + return true; + } + } + + return false; } /* 80C0BF34-80C0C348 00C114 0414+00 5/5 0/0 0/0 .text calcCatchPos__11daObj_GrA_cFfi */ -void daObj_GrA_c::calcCatchPos(f32 param_0, int param_1) { +void daObj_GrA_c::calcCatchPos(f32 param_1, int param_2) { // NONMATCHING + daPy_py_c* player = daPy_getPlayerActorClass(); + f32 fVar1 = player->current.pos.y - mGroundY; + s16 HandsHeight = cM_atan2s(current.pos.absXZ(player->current.pos), fVar1); + cXyz sp6c(0.0f, param_1 * (cM_scos(HandsHeight)), param_1 * cM_ssin(HandsHeight)); + cXyz sp78(player->current.pos); + cXyz sp84, sp90, sp9c, spa8; + + mDoMtx_stack_c::copy(player->getLeftHandMatrix()); + mDoMtx_stack_c::multVecZero(&sp84); + mDoMtx_stack_c::copy(player->getRightHandMatrix()); + mDoMtx_stack_c::multVecZero(&sp90); + + sp9c = (sp84 + sp90) / 2.0f; + + mDoMtx_stack_c::copy(player->getHeadMtx()); + mDoMtx_stack_c::multVecZero(&spa8); + + spa8.y = sp78.y; + HandsHeight = cLib_targetAngleY(&sp9c, &spa8); + + if (param_2 != 0) { + cXyz spb4; + sp9c.y -= daObj_GrA_Param_c::m.field_0x60 * 0.5f; + cLib_offsetPos(&spb4, &sp9c, player->shape_angle.y + 0x8000, &sp6c); + + if (param_2 == 1) { + cLib_chasePos(¤t.pos, spb4, 100.0f); + } else if (param_2 == 2) { + cLib_chasePos(¤t.pos, spb4, 5.0f); + cLib_addCalcAngleS2(&shape_angle.y, HandsHeight, 8, 0x400); + field_0x91a.y = shape_angle.y; + } + } else { + #ifdef DEBUG + dDbVw_Report(100, 100, "pos.y = %f", sp9c.y - player->current.pos.y); + #endif + + cXyz spc0; + sp9c.y -= daObj_GrA_Param_c::m.field_0x60 * 0.5f; + cXyz spcc(0.0f, 0.0f, param_1); + cLib_offsetPos(&spc0, &sp9c, HandsHeight, &spcc); + + OS_REPORT("angle = %d, HandsHeight = %f\n", sp9c.y, HandsHeight); + + current.pos = spc0; + + if (field_0x1ffc != 0) { + current.angle.y = HandsHeight + 0x5000; + } else { + current.angle.y = HandsHeight + -0x5000; + } + + cLib_addCalcAngleS2(&shape_angle.y, HandsHeight, 2, 0x2000); + field_0x91a.y = shape_angle.y; + } } /* 80C0C348-80C0C364 00C528 001C+00 1/1 0/0 0/0 .text initCrazyBeforeCatch__11daObj_GrA_cFi */ -void daObj_GrA_c::initCrazyBeforeCatch(int param_0) { - // NONMATCHING +void daObj_GrA_c::initCrazyBeforeCatch(int param_1) { + field_0x1ff0 = 1; + speedF = 0.0f; + gravity = 0.0f; } /* 80C0C364-80C0C3E0 00C544 007C+00 1/1 0/0 0/0 .text executeCrazyBeforeCatch__11daObj_GrA_cFv */ void daObj_GrA_c::executeCrazyBeforeCatch() { // NONMATCHING + calcCatchPos(-120.0f, 1); + if ((field_0xa48 & 2) != 0) { + initCrazyCatch(0); + field_0xa48 &= 0xFFFFFFFD; + } else if ((field_0xa48 & 4) != 0) { + initCrazyAttack(); + field_0xa48 &= 0xFFFFFFFB; + } } /* 80C0C3E0-80C0C478 00C5C0 0098+00 2/2 0/0 0/0 .text initCrazyCatch__11daObj_GrA_cFi */ -void daObj_GrA_c::initCrazyCatch(int param_0) { +void daObj_GrA_c::initCrazyCatch(int param_1) { // NONMATCHING + dComIfGp_getVibration().StartQuake(8, 15, cXyz(0.0f, 1.0f, 0.0f)); + field_0x1ff0 = 2; + speedF = 0.0f; + field_0x1ff4 = 0; + calcCatchPos(-120.0f, 1); + gravity = 0.0f; } -/* 80C0C478-80C0C5F0 00C658 0178+00 1/1 0/0 0/0 .text executeCrazyCatch__11daObj_GrA_cFv - */ +/* 80C0C478-80C0C5F0 00C658 0178+00 1/1 0/0 0/0 .text executeCrazyCatch__11daObj_GrA_cFv */ void daObj_GrA_c::executeCrazyCatch() { // NONMATCHING + switch (field_0x1ff4) { + case 0: + if (daPy_getPlayerActorClass()->speedF == 0.0f) { + field_0x1ff4 = 1; + calcCatchPos(-110.0f, 2); + dComIfGp_getVibration().StartQuake(1, 15, cXyz(0.0f, 1.0f, 0.0f)); + } else { + calcCatchPos(-110.0f, 2); + } + break; + + case 1: + calcCatchPos(-1120.0f, 2); + break; + } + + f32 fVar1 = mpModelMorf->getPlaySpeed(); + if (fVar1 > 0.2f) { + mpModelMorf->setPlaySpeed(fVar1 - 0.2f); + } else { + mpModelMorf->setPlaySpeed(0.0f); + } + + if (field_0xa48 != 0) { + if ((field_0xa48 & 8) != 0) { + initCrazyThrow(0); + } else if ((field_0xa48 & 16) != 0) { + initCrazyThrow(1); + } else if ((field_0xa48 & 4) != 0) { + if (daPy_getPlayerActorClass()->speedF == 0.0f) { + initCrazyAttack(); + } else { + initCrazyAttack(); + } + } + + field_0xa48 = 0; + } } /* 80C0C5F0-80C0C690 00C7D0 00A0+00 1/1 0/0 0/0 .text initCrazyThrow__11daObj_GrA_cFi */ -void daObj_GrA_c::initCrazyThrow(int param_0) { +void daObj_GrA_c::initCrazyThrow(int param_1) { // NONMATCHING + field_0x1ffc = 1 - ((param_1 & 0xFF) << 31); + field_0x1ff4 = 0; + field_0x1ff0 = 3; + gravity = 0.0f; + speedF = 0.0f; + speed.y = 0.0f; + + if (field_0x1fe8 == 0) { + mDemoCamMode = 1; + } + + field_0x1ff8 = 34; + calcCatchPos(-110.0f, 2); + field_0x2004 = 0; + gravity = 0.0f; } -/* 80C0C690-80C0C84C 00C870 01BC+00 1/1 0/0 0/0 .text executeCrazyThrow__11daObj_GrA_cFv - */ +/* 80C0C690-80C0C84C 00C870 01BC+00 1/1 0/0 0/0 .text executeCrazyThrow__11daObj_GrA_cFv */ void daObj_GrA_c::executeCrazyThrow() { // NONMATCHING + f32 fVar1; + cXyz spa0; + dBgS_LinChk dStack_90; + + switch (field_0x1ff4) { + case 0: + fVar1 = mpModelMorf->getPlaySpeed(); + if (fVar1 > 0.2f) { + mpModelMorf->setPlaySpeed(fVar1 - 0.2f); + } else { + mpModelMorf->setPlaySpeed(0.0f); + } + + if (field_0x1ff8 == 0) { + field_0x1ff0 = 4; + gravity = -0.7f; + speedF = 25.0f; + speed.y = 15.0f; + cLib_addCalcAngleS2(&shape_angle.y, current.angle.y + 0x8000, 4, 0x1000); + field_0x91a.y = shape_angle.y; + } else if (field_0x1ff8 <= 10) { + if (field_0x1ff8 == 10) { + if (isFirstGra()) { + mSound.startCreatureVoice(Z2SE_GORON_V_THROWN_FIRST, -1); + } else { + mSound.startCreatureVoice(Z2SE_GORON_V_THROWN, -1); + } + } + + calcCatchPos(-110.0f, 0); + } else { + calcCatchPos(-110.0f, 2); + } + break; + + case 1: + executeCrazyJumping(); + } + + if (field_0xa48 != 0) { + if ((field_0xa48 & 4) != 0) { + initCrazyAttack(); + } + + field_0xa48 = 0; + + return; + } } /* 80C0C84C-80C0CA64 00CA2C 0218+00 3/3 0/0 0/0 .text initCrazyAttack__11daObj_GrA_cFv */ void daObj_GrA_c::initCrazyAttack() { // NONMATCHING + camera_class* camera; + + if (field_0x1ff0 == 3 && field_0x1ff8 == 0) { + field_0x1ff0 = 4; + field_0x1fe9 = 1; + + daPy_getPlayerActorClass()->offGoronSideMove(); + daPy_getPlayerActorClass()->offGoronUpStopCancel(); + + if (isFirstGra()) { + camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + mDemoCamMode = 0; + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + daNpcF_onEvtBit(0x52); + gravity = -0.7f; + speedF = 25.0f; + speed.y = 15.0f; + cLib_addCalcAngleS2(&shape_angle.y, current.angle.y + 0x8000, 4, 0x1000); + field_0x91a.y = shape_angle.y; + } + } else { + daPy_getPlayerActorClass()->offGoronSideMove(); + + if (isFirstGra()) { + if (mDemoCamMode != 0) { + camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + mDemoCamMode = 0; + } + + setProcess(&daObj_GrA_c::rollAttacked); + } else { + setProcess(&daObj_GrA_c::rollAttack); + field_0x1fe9 = 1; + field_0x1fd8 = 60; + } + + gravity = -4.0f; + current.angle.y = cLib_targetAngleY(¤t.pos, &daPy_getPlayerActorClass()->current.pos); + } } /* 80C0CA64-80C0CDBC 00CC44 0358+00 2/2 0/0 0/0 .text executeCrazyJumping__11daObj_GrA_cFv */ void daObj_GrA_c::executeCrazyJumping() { // NONMATCHING + cLib_addCalcAngleS2(&shape_angle.y, current.angle.y + 0x8000, 4, 0x1000); + field_0x91a.y = shape_angle.y; + + if (mAcch.ChkGroundLanding()) { + cXyz sp28(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp28, &field_0xab8[2].field_0x4); + field_0xab8[2].field_0x10 = field_0x91a; + field_0xab8[2].field_0x0 = 1; + + mSound.startCreatureSound(Z2SE_GORON_ROLL_BOUND, 0, -1); + + if (field_0x2004 != 0) { + dComIfGp_getVibration().StartShock(5, 15, cXyz(0.0f, 1.0f, 0.0f)); + speed.y = 0.0f; + setProcess(&daObj_GrA_c::rollEscape); + field_0x1fe9 = 1; + daPy_getPlayerActorClass()->offGoronSideMove(); + field_0x2004 = 0; + gravity = -4.0f; + } else { + dComIfGp_getVibration().StartShock(8, 15, cXyz(0.0f, 1.0f, 0.0f)); + speed.y = 15.0f; + field_0x2004 = 1; + mpModelMorf->setLoopFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setPlaySpeed(-0.1f); + } + } else if (mAcch.ChkWallHit() != 0) { + cXyz sp34(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&sp34, &field_0xab8[2].field_0x4); + field_0xab8[2].field_0x10 = field_0x91a; + field_0xab8[2].field_0x0 = 1; + + mSound.startCreatureSound(Z2SE_GORON_ROLL_BOUND, 0, -1); + dComIfGp_getVibration().StartShock(5, 15, cXyz(0.0f, 1.0f, 0.0f)); + speed.y = 0.0f; + + setProcess(&daObj_GrA_c::rollEscape); + field_0x1fe9 = 1; + daPy_getPlayerActorClass()->offGoronSideMove(); + field_0x2004 = 0; + gravity = -4.0f; + } } /* 80C0CDBC-80C0CF10 00CF9C 0154+00 2/2 0/0 0/0 .text modeChangeCheck__11daObj_GrA_cFv */ -int daObj_GrA_c::modeChangeCheck() { +BOOL daObj_GrA_c::modeChangeCheck() { // NONMATCHING -} + BOOL rv = (field_0x2030 == 0); -/* 80C0CF10-80C0CF2C 00D0F0 001C+00 2/2 0/0 0/0 .text getGraPos__10daTagGra_cFv */ -// void daTagGra_c::getGraPos() { -extern "C" void getGraPos__10daTagGra_cFv() { - // NONMATCHING + if (rv != FALSE) { + mMode = 0; + home.angle.y = cLib_targetAngleY(¤t.pos, &home.pos); + home.pos = current.pos; + field_0xf50.OffAtSetBit(); + setProcess(&daObj_GrA_c::toStone); + field_0x109c = 1; + setBaseMotion(4, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + setFaceMotion(13, daObj_GrA_Param_c::m.field_0x0c * 0.5f); + calcMotion(); + mpModelMorf->setFrame(mpModelMorf->getEndFrame()); + mpModelMorf->setPlaySpeed(1.0f); + return TRUE; + } + + return FALSE; } /* 80C0CF2C-80C0CF98 00D10C 006C+00 1/1 0/0 0/0 .text s_sub2__FPvPv */ static void* s_sub2(void* i_actor, void* i_data) { daObj_GrA_c* i_this = (daObj_GrA_c*)i_data; - if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_OBJ_GRA && i_this->checkGraSub((fopAc_ac_c*)i_actor)) { + if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_OBJ_GRA && (u8)i_this->checkGraSub((fopAc_ac_c*)i_actor)) { return i_actor; } return NULL; } /* 80C0CF98-80C0D000 00D178 0068+00 1/1 0/0 0/0 .text checkGraSub__11daObj_GrA_cFP10fopAc_ac_c */ -bool daObj_GrA_c::checkGraSub(fopAc_ac_c* param_0) { - // NONMATCHING +BOOL daObj_GrA_c::checkGraSub(fopAc_ac_c* a_this) { + daObj_GrA_c* i_this = (daObj_GrA_c*)a_this; + + if (i_this->mMode != 0) { + return FALSE; + } + + if (getTagNo() == i_this->getTagNo()) { + return TRUE; + } + + return FALSE; } /* 80C0D000-80C0D2FC 00D1E0 02FC+00 1/0 0/0 0/0 .text waitDemo__11daObj_GrA_cFPv */ -int daObj_GrA_c::waitDemo(void* param_0) { +int daObj_GrA_c::waitDemo(void* param_1) { // NONMATCHING + fopAc_ac_c* actor_p; + cXyz sp34; + daPy_py_c* player = daPy_getPlayerActorClass(); + + switch (field_0xa7c) { + case 0: + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(0); + break; + + case 1: + if (getTagNo() != 0) { + actor_p = field_0x204c.getActor(); + + if (field_0x2032 == 0 || actor_p != NULL) { + if (field_0x2032 == 0) { + daTagGra_c* graTag_p = (daTagGra_c*)fpcM_Search(s_sub, this); + if (graTag_p != NULL && graTag_p->getMode() == 2) { + mGraPos = graTag_p->getGraPos(); + mGraExtent = graTag_p->getGraExtent(); + mGraHeight = graTag_p->getGraHeight(); + mGraMode = graTag_p->getMode(); + field_0x2032 = 1; + fopAcM_delete(graTag_p); + } + + if (actor_p != NULL) { + actor_p = (fopAc_ac_c*)fpcM_Search(s_sub2, this); + if (actor_p != NULL) { + field_0x204c.entry(actor_p); + } + } + } + } else { + #ifdef DEBUG + if (daObj_GrA_Param_c::m.field_0x8a == 0) { + fopAcM_OnStatus(this, 0x100); + } else { + fopAcM_OffStatus(this, 0x100); + } + #endif + + sp34 = player->current.pos - mGraPos; + if (sp34.absXZ() < mGraExtent && sp34.z > -30.0f && sp34.z < mGraHeight) { + setProcess(&daObj_GrA_c::startDemo); + } + } + } + break; + + case 2: + #ifdef DEBUG + fopAcM_OnStatus(this, 0x100); + #endif + break; + } + + return 1; } /* 80C0D2FC-80C0D3A8 00D4DC 00AC+00 1/1 0/0 0/0 .text skipDemoGra__11daObj_GrA_cFv */ -void daObj_GrA_c::skipDemoGra() { - // NONMATCHING +int daObj_GrA_c::skipDemoGra() { + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + daObj_GrA_c* gra_p = (daObj_GrA_c*)field_0x204c.getActor(); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + gra_p->soldierDemoSkip(); + gra_p->field_0x204c.entry(NULL); + dComIfGs_onSwitch(field_0xa7f, fopAcM_GetRoomNo(this)); + return 1; } /* 80C0D3A8-80C0D3E0 00D588 0038+00 1/1 0/0 0/0 .text skipCallBack__FPvi */ -static void skipCallBack(void* param_0, int param_1) { - // NONMATCHING +static int skipCallBack(void* param_1, int param_2) { + daObj_GrA_c* i_this = (daObj_GrA_c*)param_1; + i_this->skipDemoGra(); + fopAcM_delete(i_this); + return 1; } /* 80C0D3E0-80C0EFC4 00D5C0 1BE4+00 2/0 0/0 0/0 .text startDemo__11daObj_GrA_cFPv */ -void daObj_GrA_c::startDemo(void* param_0) { +int daObj_GrA_c::startDemo(void* param_1) { // NONMATCHING + f32 fVar1; + cXyz sp30, sp3c, sp48, sp54, sp60, sp6c, sp78, sp84, sp90, sp9c, spa8, spb4, spcc, spd8, spe4; + s16 sVar1; + csXyz cStack_1b8, cStack_1c0, cStack_1c8; + daPy_py_c* player = daPy_getPlayerActorClass(); + daObj_GrA_c* gra_p = (daObj_GrA_c *)field_0x204c.getActor(); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + dCamera_c* camBody = dCam_getBody(); + + switch (field_0xa7c) { + case 0: + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(0); + mDemoCamMode = 1; + field_0x209c = 1; + break; + + case 1: + switch (mDemoCamMode) { + case 1: + if (!eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(this, 2, 0xFFEF, 0); + eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return 1; + } + + camera->mCamera.Stop(); + mDemoCamMode = 2; + field_0x2056 = 0; + fVar1 = camBody->Fovy(); + field_0x208c = fVar1; + mDemoCamFovy = fVar1; + mDemoCamCenter = mGraPos; + mDemoCamCenter.y += 150.0f; + mDemoCamEye = mDemoCamCenter; + mDemoCamEye.z += 700.0f; + mDemoCamCenter.x += 50.0f; + field_0x2080 = mDemoCamCenter; + field_0x2074 = mDemoCamEye; + + camera->mCamera.SetTrimSize(2); + player->changeOriginalDemo(); + gra_p->field_0x204c.entry(this); + setProcess(&daObj_GrA_c::soldierDemo); + fopAcM_OnStatus(gra_p, 0x8000); + field_0x2056 = 0; + dComIfGp_getEvent().setSkipProc(this, skipCallBack, 0); + dComIfGp_getEvent().onSkipFade(); + // fallthrough + case 2: + sp30 = player->current.pos; + if ((sp30 - mGraPos).abs() < 50.0f) { + mDemoCamMode = 3; + field_0x2056 = 0; + break; + } + + if (field_0x2056 >= 60) { + cStack_1b8 = player->current.angle; + cLib_addCalcAngleS2(&cStack_1b8.y, cLib_targetAngleY(&player->current.pos, ¤t.pos) + 0x800, + 2, field_0x1528.field_0xa14); + player->setPlayerPosAndAngle(&player->current.pos, &cStack_1b8); + field_0x2056++; + } else { + player->changeDemoMode(3, 0, 0, 0); + player->changeDemoPos0(&mGraPos); + } + // fallthrough + case 3: + if (field_0x2056 >= 180) { + mDemoCamMode = 4; + field_0x2056 = 0; + field_0x2080 = mDemoCamCenter; + field_0x2074 = mDemoCamEye; + break; + } + + cStack_1c0 = player->current.angle; + sVar1 = cLib_targetAngleY(&player->current.pos, ¤t.pos) + 0x2800; + cLib_addCalcAngleS2(&cStack_1c0.y, sVar1, 4, field_0x1528.field_0xa14); + player->setPlayerPosAndAngle(&player->current.pos, &cStack_1c0); + + mDoMtx_stack_c::YrotS(sVar1); + sp3c.set(0.0f, 150.0f, 100.0f); + mDoMtx_stack_c::multVec(&sp3c, &sp3c); + sp3c += player->current.pos; + cLib_addCalcPos2(&mDemoCamEye, sp3c, 0.05f, (field_0x2074 - sp3c).abs() / 40.0f); + + mDoMtx_stack_c::YrotS(sVar1); + sp48.set(0.0f, 100.0f, 300.0f); + mDoMtx_stack_c::multVec(&sp48, &sp48); + sp48 += player->current.pos; + cLib_addCalcPos2(&mDemoCamCenter, sp48, 0.05f, (sp48 - field_0x2080).abs() / 25.0f); + field_0x2056++; + // fallthrough + case 4: + if (field_0x2056 >= 180) { + mDemoCamMode = 5; + field_0x2056 = 0; + field_0x2080 = mDemoCamCenter; + field_0x2074 = mDemoCamEye; + break; + } + + cStack_1c8 = player->current.angle; + sVar1 = cLib_targetAngleY(&player->current.pos, ¤t.pos) + 0x800; + cLib_addCalcAngleS2(&cStack_1c8.y, sVar1, 1, field_0x1528.field_0xa14); + player->setPlayerPosAndAngle(&player->current.pos, &cStack_1c8); + + mDoMtx_stack_c::YrotS(sVar1); + sp54.set(0.0f, 150.0f, 100.0f); + mDoMtx_stack_c::multVec(&sp54, &sp54); + sp54 += player->current.pos; + cLib_addCalcPos2(&mDemoCamEye, sp54, 0.06f, (field_0x2074 - sp54).abs() / 70.0f); + + mDoMtx_stack_c::YrotS(sVar1); + sp60.set(0.0f, 230.0f, 300.0f); + mDoMtx_stack_c::multVec(&sp60, &sp60); + sp60 += player->current.pos; + cLib_addCalcPos2(&mDemoCamCenter, sp60, 0.06f, (sp60 - field_0x2080).abs() / 70.0f); + + if (field_0x2056 == 150) { + setBaseMotion(16, 0.0f); + setFaceMotion(11, 0.0f); + setLookMode(0); + gra_p->setBaseMotion(17, daObj_GrA_Param_c::m.field_0x0c); + gra_p->setFaceMotion(12, -1.0f); + gra_p->setLookMode(0); + + current.angle.y += 0x4000; + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + } + + field_0x2056++; + // fallthrough + case 5: + if (field_0x2056 >= 40) { + mDemoCamMode = 6; + field_0x2056 = 0; + break; + } + + mDoMtx_stack_c::YrotS(cLib_targetAngleY(&player->current.pos, ¤t.pos)); + sp6c.set(0.0f, 150.0f, 100.0f); + mDoMtx_stack_c::multVec(&sp6c, &sp6c); + sp6c += player->current.pos; + cLib_addCalcPos2(&mDemoCamEye, sp6c, 0.01f, (field_0x2074 - sp6c).abs() / 60.0f); + + sp78 = current.pos; + sp78.y += 280.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp78, 0.5f, (sp78 - field_0x2080).abs() / (200.0f - field_0x2056 * 3)); + field_0x2056++; + // fallthrough + case 6: + if (field_0x2056 >= 90) { + mDemoCamMode = 7; + field_0x2056 = 0; + break; + } + + mDoMtx_stack_c::YrotS(cLib_targetAngleY(&player->current.pos, ¤t.pos)); + sp84.set(100.0f, -50.0f, -800.0f); + mDoMtx_stack_c::multVec(&sp84, &sp84); + sp84 += current.pos; + cLib_addCalcPos2(&mDemoCamEye, sp84, 0.5f, (field_0x2074 - sp84).abs() / 35.0f); + + sp90 = current.pos; + sp90.y += 280.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp90, 0.35f, (sp90 - field_0x2080).abs() / 20.0f); + field_0x2056++; + // fallthrough + case 7: + if (mpModelMorf->isStop()) { + gra_p->setDemoMode(1); + setDemoMode(8); + field_0x2056 = 0; + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(2); + } + break; + + case 8: + if (gra_p->field_0xa90 != 20 || !gra_p->mpModelMorf->isStop()) break; + + setDemoMode(9); + setBaseMotion(1, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + field_0x2080 = mDemoCamCenter; + // fallthrough + case 9: + sp9c.set(0.0f, 0.0f, 80.0f); + mDoMtx_stack_c::YrotS(gra_p->current.angle.y); + mDoMtx_stack_c::multVec(&sp9c, &sp9c); + sp9c += gra_p->current.pos; + + case 10: + if (mAcchCir.ChkWallHit() && gra_p == dComIfG_Bgsp().GetActorPointer(mAcchCir)) { + if (field_0xa90 != 15) { + setBaseMotion(15, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(13, -1.0f); + setLookMode(0); + current.angle.y = cLib_targetAngleY(¤t.pos, &sp9c); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + mAcch.SetGrndNone(); + mAcch.SetWallNone(); + gravity = 0.0f; + speed.setall(0.0f); + speedF = 0.0f; + } + } else { + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &sp9c), 4, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + cLib_chasePosXZ(¤t.pos, sp9c, daObj_GrA_Param_c::m.field_0x90); + } + + if (field_0xa90 != 15) { + if (mpModelMorf->isStop()) { + mAcch.SetGrndNone(); + mAcch.SetWallNone(); + gravity = 0.0f; + } else { + spa8.set(0.0f, 146.09f, 161.97f); + mDoMtx_stack_c::YrotS(field_0x91a.y); + mDoMtx_stack_c::multVec(&spa8, &spa8); + current.pos += spa8; + old.pos = current.pos; + gravity = 0.0f; + setLookMode(0); + setDemoMode(10); + gra_p->setDemoMode(3); + setBaseMotion(18, 0.0f); + setFaceMotion(13, 0.0f); + } + + spb4 = gra_p->current.pos; + cLib_addCalcPosXZ2(&mDemoCamCenter, spb4, 0.1f, (spb4 - field_0x2080).abs() / 30.0f); + break; + } + + case 11: + if (field_0x2056 >= 250) { + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + fopAcM_OffStatus(gra_p, 0x8000); + setProcess(&daObj_GrA_c::wait); + dComIfGs_onSwitch(field_0xa7f, fopAcM_GetRoomNo(this)); + fopAcM_delete(this); + break; + } + + if (mAcch.ChkGroundLanding()) { + spcc.set(0.0f, 0.0f, 20.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(field_0x91a.y); + mDoMtx_stack_c::multVec(&spcc, &field_0xab8[2].field_0x4); + field_0xab8[2].field_0x10 = field_0x91a; + field_0xab8[2].field_0x0 = 1; + + mSound.startCreatureSound(Z2SE_GORON_ROLL_BOUND, 0, -1); + speedF = 0.0f; + } else if (mAcch.ChkGroundHit()) { + spd8.set(-1428.0f, 3650.0f, -4459.0f); + if ((current.pos - spd8).absXZ() > 50.0f) { + cLib_addCalcAngleS2(¤t.angle.y, cLib_targetAngleY(¤t.pos, &spd8), + 24, daObj_GrA_Param_c::m.field_0x88); + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + } + + field_0x2056++; + } + + if (speed.y > 0.0f) { + spe4 = mDemoCamCenter; + mDemoCamEye += (current.pos - spe4); + } + + mDemoCamCenter = current.pos; + + } + break; + + case 2: + break; + + default: + if (mDemoCamMode != 0) { + camera->mCamera.Set(mDemoCamCenter, mDemoCamEye, mDemoCamFovy, 0); + field_0x2056++; + } + break; + } + + return 1; } /* 80C0EFC4-80C0F17C 00F1A4 01B8+00 1/1 0/0 0/0 .text turn__11daObj_GrA_cFsfi */ From b3fb0e3823061b1b37f161a7d4ff22f6cb4e3483 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:48:33 -0400 Subject: [PATCH 07/21] All functions worked on --- include/d/actor/d_a_obj_gra2.h | 21 +- src/d/actor/d_a_obj_gra2.cpp | 1884 +++++++------------------------- 2 files changed, 413 insertions(+), 1492 deletions(-) diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 6639bc904bf..6b96c1698e4 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -114,7 +114,7 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C00D74 */ u8 getMode(); /* 80C00DF8 */ u8 getPathNo(); /* 80C00E04 */ u16 getTagNo(); - /* 80C00E10 */ u32 getJumpType(); + /* 80C00E10 */ u16 getJumpType(); /* 80C00E1C */ BOOL isDelete(); /* 80C00EFC */ void restart(); /* 80C010D4 */ int init(); @@ -221,13 +221,13 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 80C0D000 */ int waitDemo(void*); /* 80C0D2FC */ int skipDemoGra(); /* 80C0D3E0 */ int startDemo(void*); - /* 80C0EFC4 */ void turn(s16, f32, int); + /* 80C0EFC4 */ BOOL turn(s16, f32, int); /* 80C0F17C */ BOOL turn_step(s16, int, int, int); - /* 80C0F330 */ void chkFindPlayer2(int, s16); - /* 80C0F668 */ void chkPointInArea(cXyz, cXyz, cXyz, s16); - /* 80C0F5A4 */ void chkPointInArea(cXyz, cXyz, f32, f32, f32, s16); - /* 80C0F6E0 */ void chkActorInSight2(fopAc_ac_c*, f32, s16); - /* 80C0F7EC */ void getAttentionPos(fopAc_ac_c*); + /* 80C0F330 */ BOOL chkFindPlayer2(int, s16); + /* 80C0F668 */ BOOL chkPointInArea(cXyz, cXyz, cXyz, s16); + /* 80C0F5A4 */ BOOL chkPointInArea(cXyz, cXyz, f32, f32, f32, s16); + /* 80C0F6E0 */ BOOL chkActorInSight2(fopAc_ac_c*, f32, s16); + /* 80C0F7EC */ cXyz getAttentionPos(fopAc_ac_c*); /* 80C0F860 */ int standWaitJump(void*); bool checkNpcObjGra() { return mMode == 1; } @@ -306,9 +306,12 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x1FBC */ int field_0x1fbc; /* 0x1FC0 */ int field_0x1fc0; /* 0x1FC4 */ u8 field_0x1fc4; - /* 0x1FC5 */ u8 field_0x1fc5[0x1fcc - 0x1fc5]; + /* 0x1FC5 */ u8 field_0x1fc5[0x1fc8 - 0x1fc5]; + /* 0x1FC8 */ int field_0x1fc8; /* 0x1FCC */ int field_0x1fcc; - /* 0x1FD0 */ u8 field_0x1fd0[0x1fd8 - 0x1fd0]; + /* 0x1FD0 */ f32 field_0x1fd0; + /* 0x1FD4 */ s16 field_0x1fd4; + /* 0x1FD6 */ s16 field_0x1fd6; /* 0x1FD8 */ s16 field_0x1fd8; /* 0x1FDA */ u8 field_0x1fda[0x1fdc - 0x1fda]; /* 0x1FDC */ int field_0x1fdc; diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index f317ff43dd9..d9facdf744f 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -16,391 +16,20 @@ #include "dol2asm.h" #include "d/d_camera.h" #include "d/d_msg_object.h" +#include "d/d_attention.h" #include -// -// Forward References: -// - -extern "C" static void jointCtrlCallBack__FP8J3DJointi(); -extern "C" void rideCallBack__11daObj_GrA_cFP4dBgWP10fopAc_ac_cP10fopAc_ac_c(); -extern "C" void __ct__11daObj_GrA_cFv(); -extern "C" void __dt__11daObj_GrA_cFv(); -extern "C" void create__11daObj_GrA_cFv(); -extern "C" void CreateHeap__11daObj_GrA_cFv(); -extern "C" void Delete__11daObj_GrA_cFv(); -extern "C" void Execute__11daObj_GrA_cFPPA3_A4_f(); -extern "C" void Draw__11daObj_GrA_cFv(); -extern "C" void jointCtrl__11daObj_GrA_cFP8J3DJointP8J3DModel(); -extern "C" void getResName__11daObj_GrA_cFv(); -extern "C" void getMode__11daObj_GrA_cFv(); -extern "C" void getPathNo__11daObj_GrA_cFv(); -extern "C" void getTagNo__11daObj_GrA_cFv(); -extern "C" void getJumpType__11daObj_GrA_cFv(); -extern "C" void isDelete__11daObj_GrA_cFv(); -extern "C" void restart__11daObj_GrA_cFv(); -extern "C" void init__11daObj_GrA_cFv(); -extern "C" void setBaseAnm__11daObj_GrA_cFif(); -extern "C" void setFaceAnm__11daObj_GrA_cFibf(); -extern "C" void setFaceBtp__11daObj_GrA_cFi(); -extern "C" void setBaseMotion__11daObj_GrA_cFif(); -extern "C" void setFaceMotion__11daObj_GrA_cFif(); -extern "C" void calcMotion__11daObj_GrA_cFv(); -extern "C" void checkProcess__11daObj_GrA_cFM11daObj_GrA_cFPCvPvPv_i(); -extern "C" void setProcess__11daObj_GrA_cFM11daObj_GrA_cFPCvPvPv_i(); -extern "C" static void getDistTableIdx__Fii(); -extern "C" void setParam__11daObj_GrA_cFv(); -extern "C" void checkEvent__11daObj_GrA_cFv(); -extern "C" void mainProc__11daObj_GrA_cFv(); -extern "C" void adjustShapeAngle__11daObj_GrA_cFv(); -extern "C" void setMtx__11daObj_GrA_cFi(); -extern "C" void setCollisions__11daObj_GrA_cFv(); -extern "C" void setAttnPos__11daObj_GrA_cFv(); -extern "C" void drawOtherMdls__11daObj_GrA_cFv(); -extern "C" bool dbgDraw__11daObj_GrA_cFv(); -extern "C" void ppMoveInit__11daObj_GrA_cFv(); -extern "C" void setLookMode__11daObj_GrA_cFi(); -extern "C" void lookat__11daObj_GrA_cFv(); -extern "C" void hitChk__11daObj_GrA_cFv(); -extern "C" void wait__11daObj_GrA_cFPv(); -extern "C" void talk__11daObj_GrA_cFPv(); -extern "C" void ctrlMsgAnm__11daObj_GrA_cFRiRiP10fopAc_ac_c(); -extern "C" static void s_sub__FPvPv(); -extern "C" void checkTagGraSub__11daObj_GrA_cFP10fopAc_ac_c(); -extern "C" void fallAbyssCheck__11daObj_GrA_cFv(); -extern "C" void setPrtcl__11daObj_GrA_cFv(); -extern "C" void base000__11daObj_GrA_cFi(); -extern "C" void base001__11daObj_GrA_cFi(); -extern "C" void base003__11daObj_GrA_cFi(); -extern "C" void base004__11daObj_GrA_cFi(); -extern "C" void base005__11daObj_GrA_cFi(); -extern "C" void base006__11daObj_GrA_cFi(); -extern "C" void base007__11daObj_GrA_cFi(); -extern "C" void base008__11daObj_GrA_cFi(); -extern "C" void base009__11daObj_GrA_cFi(); -extern "C" void base010__11daObj_GrA_cFi(); -extern "C" void base013__11daObj_GrA_cFi(); -extern "C" void base016__11daObj_GrA_cFi(); -extern "C" void base017__11daObj_GrA_cFi(); -extern "C" void base018__11daObj_GrA_cFi(); -extern "C" void base019__11daObj_GrA_cFi(); -extern "C" void base020__11daObj_GrA_cFi(); -extern "C" void base021__11daObj_GrA_cFi(); -extern "C" void base022__11daObj_GrA_cFi(); -extern "C" void base023__11daObj_GrA_cFi(); -extern "C" void base024__11daObj_GrA_cFi(); -extern "C" void base025__11daObj_GrA_cFi(); -extern "C" void base026__11daObj_GrA_cFi(); -extern "C" void face000__11daObj_GrA_cFi(); -extern "C" void face003__11daObj_GrA_cFi(); -extern "C" void face004__11daObj_GrA_cFi(); -extern "C" void face005__11daObj_GrA_cFi(); -extern "C" void face006__11daObj_GrA_cFi(); -extern "C" void face007__11daObj_GrA_cFi(); -extern "C" void face008__11daObj_GrA_cFi(); -extern "C" void face009__11daObj_GrA_cFi(); -extern "C" void face010__11daObj_GrA_cFi(); -extern "C" void face011__11daObj_GrA_cFi(); -extern "C" void face012__11daObj_GrA_cFi(); -extern "C" void face016__11daObj_GrA_cFi(); -extern "C" void face017__11daObj_GrA_cFi(); -extern "C" void face999__11daObj_GrA_cFi(); -extern "C" void evtcutTalk__11daObj_GrA_cFii(); -extern "C" void setFaceTalkAfter__11daObj_GrA_cFv(); -extern "C" static void daObj_GrA_Create__FPv(); -extern "C" static void daObj_GrA_Delete__FPv(); -extern "C" static void daObj_GrA_Execute__FPv(); -extern "C" static void daObj_GrA_Draw__FPv(); -extern "C" static bool daObj_GrA_IsDelete__FPv(); -extern "C" void __dt__17daObj_GrA_Param_cFv(); -extern "C" void __dt__16daBaseNpc_path_cFv(); -extern "C" void __ct__4cXyzFv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__4cXyzFv(); -extern "C" void __dt__8dCcD_SphFv(); -extern "C" void __ct__8dCcD_SphFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__Q211daObj_GrA_c21daObj_GrA_prtclMngr_cFv(); -extern "C" void __ct__Q211daObj_GrA_c21daObj_GrA_prtclMngr_cFv(); -extern "C" void __dt__18daBaseNpc_acMngr_cFv(); -extern "C" void __dt__23daBaseNpc_moveBgActor_cFv(); -extern "C" bool Draw__23daBaseNpc_moveBgActor_cFv(); -extern "C" bool Create__23daBaseNpc_moveBgActor_cFv(); -extern "C" bool IsDelete__23daBaseNpc_moveBgActor_cFv(); -extern "C" bool ToFore__23daBaseNpc_moveBgActor_cFv(); -extern "C" bool ToBack__23daBaseNpc_moveBgActor_cFv(); -extern "C" bool CreateHeap__23daBaseNpc_moveBgActor_cFv(); -extern "C" bool Execute__23daBaseNpc_moveBgActor_cFPPA3_A4_f(); -extern "C" bool Delete__23daBaseNpc_moveBgActor_cFv(); -extern "C" void func_80C04F3C(void* _this, int*); -extern "C" void func_80C04F58(void* _this, s16*); -extern "C" void __sinit_d_a_obj_gra2_cpp(); -extern "C" void getSrchCircleR__11daObj_GrA_cFv(); -extern "C" void standWait__11daObj_GrA_cFPv(); -extern "C" void walk__11daObj_GrA_cFPv(); -extern "C" void defence__11daObj_GrA_cFPv(); -extern "C" void toStone__11daObj_GrA_cFPv(); -extern "C" void step__11daObj_GrA_cFPv(); -extern "C" void rollReturn__11daObj_GrA_cFPv(); -extern "C" void soldierDemoSkip__11daObj_GrA_cFv(); -extern "C" void soldierDemo__11daObj_GrA_cFPv(); -extern "C" void getSrchLinkR__11daObj_GrA_cFv(); -extern "C" void getSrchGraR__11daObj_GrA_cFv(); -extern "C" void getSpeed__11daObj_GrA_cFv(); -extern "C" void standRoll__11daObj_GrA_cFPv(); -extern "C" void rollDemo__11daObj_GrA_cFPv(); -extern "C" void rollAttack__11daObj_GrA_cFPv(); -extern "C" void rollAttacked__11daObj_GrA_cFPv(); -extern "C" void rollEscape__11daObj_GrA_cFPv(); -extern "C" void rollLanding__11daObj_GrA_cFv(); -extern "C" void thrown__11daObj_GrA_cFPv(); -extern "C" void demo_camera__11daObj_GrA_cFv(); -extern "C" void rollAttackedDemo__11daObj_GrA_cFv(); -extern "C" void graThrowDemo__11daObj_GrA_cFv(); -extern "C" void setCarryStatus__11daObj_GrA_cFv(); -extern "C" void checkThrow__11daObj_GrA_cFv(); -extern "C" void calcCatchPos__11daObj_GrA_cFfi(); -extern "C" void initCrazyBeforeCatch__11daObj_GrA_cFi(); -extern "C" void executeCrazyBeforeCatch__11daObj_GrA_cFv(); -extern "C" void initCrazyCatch__11daObj_GrA_cFi(); -extern "C" void executeCrazyCatch__11daObj_GrA_cFv(); -extern "C" void initCrazyThrow__11daObj_GrA_cFi(); -extern "C" void executeCrazyThrow__11daObj_GrA_cFv(); -extern "C" void initCrazyAttack__11daObj_GrA_cFv(); -extern "C" void executeCrazyJumping__11daObj_GrA_cFv(); -extern "C" void modeChangeCheck__11daObj_GrA_cFv(); -extern "C" void getGraPos__10daTagGra_cFv(); -extern "C" static void s_sub2__FPvPv(); -extern "C" void checkGraSub__11daObj_GrA_cFP10fopAc_ac_c(); -extern "C" void waitDemo__11daObj_GrA_cFPv(); -extern "C" void skipDemoGra__11daObj_GrA_cFv(); -extern "C" static void skipCallBack__FPvi(); -extern "C" void startDemo__11daObj_GrA_cFPv(); -extern "C" void turn__11daObj_GrA_cFsfi(); -extern "C" void turn_step__11daObj_GrA_cFsiii(); -extern "C" void chkFindPlayer2__11daObj_GrA_cFis(); -extern "C" void getDistTable__12dAttention_cFi(); -extern "C" void chkPointInArea__11daObj_GrA_cF4cXyz4cXyzfffs(); -extern "C" void chkPointInArea__11daObj_GrA_cF4cXyz4cXyz4cXyzs(); -extern "C" void chkActorInSight2__11daObj_GrA_cFP10fopAc_ac_cfs(); -extern "C" void getAttentionPos__11daObj_GrA_cFP10fopAc_ac_c(); -extern "C" void standWaitJump__11daObj_GrA_cFPv(); -extern "C" u8 const m__17daObj_GrA_Param_c[192]; -extern "C" extern char const* const d_a_obj_gra2__stringBase0; -extern "C" u8 mBaseMotionList__11daObj_GrA_c[264]; -extern "C" u8 mFaceMotionList__11daObj_GrA_c[168]; - -// -// External References: -// - -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void transS__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void transM__14mDoMtx_stack_cFfff(); -extern "C" void transM__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void scaleM__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void ZXYrotS__14mDoMtx_stack_cFRC5csXyz(); -extern "C" void ZXYrotM__14mDoMtx_stack_cFRC5csXyz(); -extern "C" void changeBckOnly__13mDoExt_bckAnmFP15J3DAnmTransform(); -extern "C" void setMorf__13mDoExt_morf_cFf(); -extern "C" void -__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl(); -extern "C" void modelCalc__16mDoExt_McaMorfSOFv(); -extern "C" void stopZelAnime__16mDoExt_McaMorfSOFv(); -extern "C" void fopAc_IsActor__FPv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void fopAcM_posMoveF__FP10fopAc_ac_cPC4cXyz(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_orderPotentialEvent__FP10fopAc_ac_cUsUsUs(); -extern "C" void fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void lineCheck__11fopAcM_lc_cFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void fpcEx_Search__FPFPvPv_PvPv(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfGs_wolfeye_effect_check__Fv(); -extern "C" void onSwitch__12dSv_danBit_cFi(); -extern "C" void isSwitch__12dSv_danBit_cCFi(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void getObjectResName2Index__14dRes_control_cFPCcPCc(); -extern "C" void reset__14dEvt_control_cFv(); -extern "C" void setSkipProc__14dEvt_control_cFPvPFPvi_ii(); -extern "C" void onSkipFade__14dEvt_control_cFv(); -extern "C" void endCheck__16dEvent_manager_cFs(); -extern "C" void ChkPresentEnd__16dEvent_manager_cFv(); -extern "C" void getEmitter__Q213dPa_control_c7level_cFUl(); -extern "C" void -set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void -setPoly__13dPa_control_cFUlUsR13cBgS_PolyInfoPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyziP18dPa_levelEcallBackScPC4cXyz(); -extern "C" void init__7dPaPo_cFP9dBgS_Acchff(); -extern "C" void setEffectCenter__7dPaPo_cFPC12dKy_tevstr_cPC4cXyzUlUlPC4cXyzPC5csXyzPC4cXyzScff(); -extern "C" void StartShock__12dVibration_cFii4cXyz(); -extern "C" void StartQuake__12dVibration_cFii4cXyz(); -extern "C" void StopQuake__12dVibration_cFi(); -extern "C" void CheckQuake__12dVibration_cFv(); -extern "C" void Release__4cBgSFP9dBgW_Base(); -extern "C" void LineCross__4cBgSFP11cBgS_LinChk(); -extern "C" void GetActorPointer__4cBgSCFi(); -extern "C" void Regist__4dBgSFP9dBgW_BaseP10fopAc_ac_c(); -extern "C" void SetWall__12dBgS_AcchCirFff(); -extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); -extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); -extern "C" void __ct__11dBgS_LinChkFv(); -extern "C" void __dt__11dBgS_LinChkFv(); -extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void __ct__15dBgS_LinkLinChkFv(); -extern "C" void __dt__15dBgS_LinkLinChkFv(); -extern "C" void GetAc__22dCcD_GAtTgCoCommonBaseFv(); -extern "C" void Move__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void __dt__12dCcD_GObjInfFv(); -extern "C" void ChkAtHit__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void ChkCoHit__12dCcD_GObjInfFv(); -extern "C" void GetCoHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_CylFRC11dCcD_SrcCyl(); -extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); -extern "C" void def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c(); -extern "C" void __ct__18daBaseNpc_acMngr_cFv(); -extern "C" void entry__18daBaseNpc_acMngr_cFP10fopAc_ac_c(); -extern "C" void getActor__18daBaseNpc_acMngr_cFv(); -extern "C" void __ct__16daBaseNpc_path_cFv(); -extern "C" void isPath__16daBaseNpc_path_cFv(); -extern "C" void setPathInfo__16daBaseNpc_path_cFUcScSc(); -extern "C" void reverseDir__16daBaseNpc_path_cFv(); -extern "C" void chkPnt__16daBaseNpc_path_cF4cXyz(); -extern "C" void setNextPnt__16daBaseNpc_path_cFv(); -extern "C" void getIdx__16daBaseNpc_path_cFv(); -extern "C" void setIdx__16daBaseNpc_path_cFUs(); -extern "C" void getPntPos__16daBaseNpc_path_cFUs(); -extern "C" void calc__18daBaseNpc_lookat_cFP10fopAc_ac_cPA4_fs(); -extern "C" void setMaxJntLmt__18daBaseNpc_lookat_cF5csXyzi(); -extern "C" void setMinJntLmt__18daBaseNpc_lookat_cF5csXyzi(); -extern "C" void setJntPos__18daBaseNpc_lookat_cF4cXyzi(); -extern "C" void setAttnPos__18daBaseNpc_lookat_cFP4cXyz(); -extern "C" void getRot__18daBaseNpc_lookat_cFi(); -extern "C" void __dt__11daBaseNpc_cFv(); -extern "C" void execute__11daBaseNpc_cFv(); -extern "C" void draw__11daBaseNpc_cFf(); -extern "C" bool getResName__11daBaseNpc_cFv(); -extern "C" void getTrnsfrmKeyAnmP__11daBaseNpc_cFPci(); -extern "C" void setMcaMorfAnm__11daBaseNpc_cFP18J3DAnmTransformKeyffiii(); -extern "C" void setBckAnm__11daBaseNpc_cFP15J3DAnmTransformfiiib(); -extern "C" void getTexPtrnAnmP__11daBaseNpc_cFPci(); -extern "C" void setBtpAnm__11daBaseNpc_cFP16J3DAnmTexPatternP12J3DModelDatafi(); -extern "C" void attnSttsOn__11daBaseNpc_cFii(); -extern "C" void setParam__11daBaseNpc_cFv(); -extern "C" void orderEvent__11daBaseNpc_cFiPc(); -extern "C" void mainProc__11daBaseNpc_cFv(); -extern "C" void setEnvTevColor__11daBaseNpc_cFv(); -extern "C" void setRoomNo__11daBaseNpc_cFv(); -extern "C" bool btkCtrl__11daBaseNpc_cFv(); -extern "C" void allAnmPlay__11daBaseNpc_cFv(); -extern "C" void adjustShapeAngle__11daBaseNpc_cFv(); -extern "C" void setMtx__11daBaseNpc_cFi(); -extern "C" void setCollisions__11daBaseNpc_cFv(); -extern "C" void setAttnPos__11daBaseNpc_cFv(); -extern "C" void drawOtherMdls__11daBaseNpc_cFv(); -extern "C" bool dbgDraw__11daBaseNpc_cFv(); -extern "C" void __ct__23daBaseNpc_moveBgActor_cFv(); -extern "C" void -MoveBGCreate__23daBaseNpc_moveBgActor_cFPCciPFP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz_vUl(); -extern "C" void MoveBGDelete__23daBaseNpc_moveBgActor_cFv(); -extern "C" void MoveBGExecute__23daBaseNpc_moveBgActor_cFv(); -extern "C" void daNpcF_chkEvtBit__FUl(); -extern "C" void daNpcF_onEvtBit__FUl(); -extern "C" void daNpcF_chkPointInArea__F4cXyz4cXyz4cXyzs(); -extern "C" void getAttentionOffsetY__9daPy_py_cFv(); -extern "C" void Start__9dCamera_cFv(); -extern "C" void Stop__9dCamera_cFv(); -extern "C" void SetTrimSize__9dCamera_cFl(); -extern "C" void Set__9dCamera_cF4cXyz4cXyzfs(); -extern "C" void Reset__9dCamera_cF4cXyz4cXyzfs(); -extern "C" void Reset__9dCamera_cF4cXyz4cXyz(); -extern "C" void dCam_getBody__Fv(); -extern "C" void Eye__9dCamera_cFv(); -extern "C" void Center__9dCamera_cFv(); -extern "C" void dKy_darkworld_check__Fv(); -extern "C" void getActor__12dMsgObject_cFv(); -extern "C" void isMouthCheck__12dMsgObject_cFv(); -extern "C" void init__10dMsgFlow_cFP10fopAc_ac_ciiPP10fopAc_ac_c(); -extern "C" void doFlow__10dMsgFlow_cFP10fopAc_ac_cPP10fopAc_ac_ci(); -extern "C" void GetAc__8cCcD_ObjFv(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void __dv__4cXyzCFf(); -extern "C" void cM_atan2s__Fff(); -extern "C" void __ct__11cBgS_GndChkFv(); -extern "C" void __dt__11cBgS_GndChkFv(); -extern "C" void ChkUsed__9cBgW_BgIdCFv(); -extern "C" void SetC__8cM3dGCylFRC4cXyz(); -extern "C" void SetH__8cM3dGCylFf(); -extern "C" void SetR__8cM3dGCylFf(); -extern "C" void SetC__8cM3dGSphFRC4cXyz(); -extern "C" void SetR__8cM3dGSphFf(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalcPos2__FP4cXyzRC4cXyzff(); -extern "C" void cLib_addCalcPosXZ2__FP4cXyzRC4cXyzff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void cLib_chaseF__FPfff(); -extern "C" void cLib_chasePos__FP4cXyzRC4cXyzf(); -extern "C" void cLib_chasePosXZ__FP4cXyzRC4cXyzf(); -extern "C" void cLib_targetAngleY__FPC3VecPC3Vec(); -extern "C" void cLib_targetAngleX__FPC4cXyzPC4cXyz(); -extern "C" void cLib_offsetPos__FP4cXyzPC4cXyzsPC4cXyz(); -extern "C" void __ct__7cSAngleFRC7cSAngle(); -extern "C" void __ct__7cSAngleFs(); -extern "C" void Inv__7cSAngleCFv(); -extern "C" void __mi__7cSAngleCFs(); -extern "C" void __ct__7cSGlobeFRC4cXyz(); -extern "C" void init__10Z2CreatureFP3VecP3VecUcUc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void checkPass__12J3DFrameCtrlFf(); -extern "C" void __destroy_arr(); -extern "C" void __construct_array(); -extern "C" void __ptmf_test(); -extern "C" void __ptmf_cmpr(); -extern "C" void __ptmf_scall(); -extern "C" void __cvt_fp2unsigned(); -extern "C" void _savegpr_23(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_23(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" u8 dist_table__12dAttention_c[6552]; -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__8dCcD_Cyl[36]; -extern "C" u8 mCcDCyl__11daBaseNpc_c[68]; -extern "C" u8 mCcDSph__11daBaseNpc_c[64]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -extern "C" extern void* __vt__12cCcD_CylAttr[25]; -extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" u8 mCurrentMtx__6J3DSys[48]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" void __register_global_object(); - /* 80BFFF0C-80BFFF58 0000EC 004C+00 2/2 0/0 0/0 .text jointCtrlCallBack__FP8J3DJointi */ static int jointCtrlCallBack(J3DJoint* i_joint, int param_2) { - // NONMATCHING + if (param_2 == 0) { + J3DModel* model = j3dSys.getModel(); + daObj_GrA_c* i_this = (daObj_GrA_c*)model->getUserArea(); + if (i_this != NULL) { + i_this->jointCtrl(i_joint, model); + } + } + + return 1; } /* 80BFFF58-80BFFF70 000138 0018+00 1/1 0/0 0/0 .text rideCallBack__11daObj_GrA_cFP4dBgWP10fopAc_ac_cP10fopAc_ac_c */ @@ -471,948 +100,66 @@ static int l_bckGetParamList[70] = { 14, 1, 10, 0, 9, 1, 7, 1, 8, 0, 12, 1, - 13, 1, 10, 1, - 8, 1, 11, 1, - 6, 0, 4, 3, - 9, 0, -}; - -/* 80C1000C-80C1002C 0001A4 0020+00 1/1 0/0 0/0 .data l_btpGetParamList */ -static int l_btpGetParamList[8] = { - 28, 1, 32, 1, - 31, 1, 21, 0, -}; - -/* 80C1002C-80C10044 0001C4 0016+02 1/2 0/0 0/0 .data l_eventMotionChangeTable */ -static u16 l_eventMotionChangeTable[11] = { - 0, 1, 0, 2, - 3, 0, 0, 0, - 0, 0, 0, -}; - -/* 80C10044-80C1004C 0001DC 0008+00 1/2 0/0 0/0 .data l_eventFaceChangeTable */ -static u16 l_eventFaceChangeTable[4] = { - 1, 2, 6, 7, -}; - -/* 80C1004C-80C10054 -00001 0008+00 1/1 0/0 0/0 .data l_evtNameList */ -static char* l_evtNameList[2] = { - NULL, - "GRA_THROWN", -}; - -/* 80C10054-80C1005C 0001EC 0008+00 0/1 0/0 0/0 .data l_entryJntNoList */ -static u16 l_entryJntNoList[4] = { - 5, 6, 7, -1, -}; - -/* 80C1005C-80C10068 -00001 000C+00 1/1 0/0 0/0 .data @4591 */ -SECTION_DATA static void* lit_4591[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; - -/* 80C10068-80C100C0 -00001 0058+00 1/1 0/0 0/0 .data @4762 */ -SECTION_DATA static void* lit_4762[22] = { - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0x98), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xA0), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xA0), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xA8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xB0), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xB8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xB8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xB8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xB8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xA8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xC0), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xC8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xC8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xA8), - (void*)(((char*)setBaseAnm__11daObj_GrA_cFif) + 0xD4), -}; - -/* 80C100C0-80C100F4 -00001 0034+00 1/1 0/0 0/0 .data @4792 */ -SECTION_DATA static void* lit_4792[13] = { - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xB0), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xB0), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xB0), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xB0), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xC4), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xC4), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xC4), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xD4), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xE4), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0xF4), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0x104), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0x114), - (void*)(((char*)setFaceAnm__11daObj_GrA_cFibf) + 0x124), -}; - -/* 80C100F4-80C10100 -00001 000C+00 0/1 0/0 0/0 .data @4873 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4873[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)standWait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10100-80C1010C -00001 000C+00 0/1 0/0 0/0 .data @4875 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4875[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)walk__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C1010C-80C10118 -00001 000C+00 0/1 0/0 0/0 .data @4877 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4877[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollReturn__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10118-80C10124 -00001 000C+00 0/1 0/0 0/0 .data @4879 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4879[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)toStone__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10124-80C10130 -00001 000C+00 0/1 0/0 0/0 .data @4891 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4891[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)standWaitJump__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10130-80C1013C -00001 000C+00 1/1 0/0 0/0 .data @4933 */ -SECTION_DATA static void* lit_4933[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)talk__11daObj_GrA_cFPv, -}; - -/* 80C1013C-80C10148 -00001 000C+00 1/1 0/0 0/0 .data @4941 */ -SECTION_DATA static void* lit_4941[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)talk__11daObj_GrA_cFPv, -}; - -/* 80C10148-80C10154 -00001 000C+00 1/1 0/0 0/0 .data @5310 */ -SECTION_DATA static void* lit_5310[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)step__11daObj_GrA_cFPv, -}; - -/* 80C10154-80C10160 -00001 000C+00 1/1 0/0 0/0 .data @5987 */ -SECTION_DATA static void* lit_5987[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollReturn__11daObj_GrA_cFPv, -}; - -/* 80C10160-80C1016C -00001 000C+00 1/1 0/0 0/0 .data @5992 */ -SECTION_DATA static void* lit_5992[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)defence__11daObj_GrA_cFPv, -}; - -/* 80C1016C-80C10178 -00001 000C+00 0/1 0/0 0/0 .data @6065 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6065[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)standWait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10178-80C10184 -00001 000C+00 0/1 0/0 0/0 .data @6068 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6068[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)standWaitJump__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10184-80C10190 -00001 000C+00 0/1 0/0 0/0 .data @6071 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6071[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)standRoll__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10190-80C1019C -00001 000C+00 0/1 0/0 0/0 .data @6074 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6074[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)waitDemo__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C1019C-80C101A8 -00001 000C+00 0/1 0/0 0/0 .data @6107 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6107[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollReturn__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C101A8-80C101B4 -00001 000C+00 0/1 0/0 0/0 .data @6110 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6110[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C101B4-80C101C0 -00001 000C+00 1/1 0/0 0/0 .data @6363 */ -SECTION_DATA static void* lit_6363[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)walk__11daObj_GrA_cFPv, -}; - -/* 80C101C0-80C101CC -00001 000C+00 1/1 0/0 0/0 .data @6502 */ -SECTION_DATA static void* lit_6502[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)step__11daObj_GrA_cFPv, -}; - -/* 80C101CC-80C101D8 -00001 000C+00 1/1 0/0 0/0 .data @6507 */ -SECTION_DATA static void* lit_6507[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; - -/* 80C101D8-80C101E4 -00001 000C+00 1/1 0/0 0/0 .data @6661 */ -SECTION_DATA static void* lit_6661[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)walk__11daObj_GrA_cFPv, -}; - -/* 80C101E4-80C101F0 -00001 000C+00 1/1 0/0 0/0 .data @6763 */ -SECTION_DATA static void* lit_6763[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; - -/* 80C101F0-80C101FC -00001 000C+00 0/1 0/0 0/0 .data @6888 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6888[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C101FC-80C10208 -00001 000C+00 0/1 0/0 0/0 .data @6894 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6894[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10208-80C10214 -00001 000C+00 0/1 0/0 0/0 .data @6910 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6910[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10214-80C10220 -00001 000C+00 0/1 0/0 0/0 .data @6921 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_6921[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10220-80C1022C -00001 000C+00 0/1 0/0 0/0 .data @7031 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_7031[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)toStone__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C1022C-80C10238 -00001 000C+00 0/1 0/0 0/0 .data @7045 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_7045[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)toStone__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10238-80C10244 -00001 000C+00 0/1 0/0 0/0 .data @7055 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_7055[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)toStone__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10244-80C10250 -00001 000C+00 1/1 0/0 0/0 .data @7324 */ -SECTION_DATA static void* lit_7324[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; - -/* 80C10250-80C1025C -00001 000C+00 0/1 0/0 0/0 .data @7471 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_7471[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollDemo__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C1025C-80C10268 -00001 000C+00 0/1 0/0 0/0 .data @7481 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_7481[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollDemo__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10268-80C10274 -00001 000C+00 0/1 0/0 0/0 .data @7489 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_7489[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollDemo__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C10274-80C10280 -00001 000C+00 1/1 0/0 0/0 .data @7645 */ -SECTION_DATA static void* lit_7645[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollAttack__11daObj_GrA_cFPv, -}; - -/* 80C10280-80C1028C -00001 000C+00 1/1 0/0 0/0 .data @7653 */ -SECTION_DATA static void* lit_7653[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollAttack__11daObj_GrA_cFPv, -}; - -/* 80C1028C-80C10298 -00001 000C+00 1/1 0/0 0/0 .data @7744 */ -SECTION_DATA static void* lit_7744[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollAttacked__11daObj_GrA_cFPv, -}; - -/* 80C10298-80C102A4 -00001 000C+00 1/1 0/0 0/0 .data @7836 */ -SECTION_DATA static void* lit_7836[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollAttacked__11daObj_GrA_cFPv, -}; - -/* 80C102A4-80C102B0 -00001 000C+00 0/0 0/0 0/0 .data @8025 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_8025[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C102B0-80C102BC -00001 000C+00 0/0 0/0 0/0 .data @8037 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_8037[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C102BC-80C102C8 -00001 000C+00 0/0 0/0 0/0 .data @8042 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_8042[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollAttack__11daObj_GrA_cFPv, -}; -#pragma pop - -/* 80C102C8-80C102E4 -00001 001C+00 1/1 0/0 0/0 .data @8138 */ -SECTION_DATA static void* lit_8138[7] = { - (void*)(((char*)rollAttacked__11daObj_GrA_cFPv) + 0xAC), - (void*)(((char*)rollAttacked__11daObj_GrA_cFPv) + 0xD8), - (void*)(((char*)rollAttacked__11daObj_GrA_cFPv) + 0x25C), - (void*)(((char*)rollAttacked__11daObj_GrA_cFPv) + 0x30C), - (void*)(((char*)rollAttacked__11daObj_GrA_cFPv) + 0x338), - (void*)(((char*)rollAttacked__11daObj_GrA_cFPv) + 0x38C), - (void*)(((char*)rollAttacked__11daObj_GrA_cFPv) + 0x464), -}; - -/* 80C102E4-80C10300 -00001 001C+00 1/1 0/0 0/0 .data @8707 */ -SECTION_DATA static void* lit_8707[7] = { - (void*)(((char*)demo_camera__11daObj_GrA_cFv) + 0xDFC), - (void*)(((char*)demo_camera__11daObj_GrA_cFv) + 0x6C), - (void*)(((char*)demo_camera__11daObj_GrA_cFv) + 0x150), - (void*)(((char*)demo_camera__11daObj_GrA_cFv) + 0x2C0), - (void*)(((char*)demo_camera__11daObj_GrA_cFv) + 0x430), - (void*)(((char*)demo_camera__11daObj_GrA_cFv) + 0x740), - (void*)(((char*)demo_camera__11daObj_GrA_cFv) + 0xA84), -}; - -/* 80C10300-80C10320 -00001 0020+00 1/1 0/0 0/0 .data @8960 */ -SECTION_DATA static void* lit_8960[8] = { - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x9A0), - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x6C), - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x144), - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x9A0), - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x284), - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x438), - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x660), - (void*)(((char*)rollAttackedDemo__11daObj_GrA_cFv) + 0x924), -}; - -/* 80C10320-80C1032C -00001 000C+00 1/1 0/0 0/0 .data @8967 */ -SECTION_DATA static void* lit_8967[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)thrown__11daObj_GrA_cFPv, -}; - -/* 80C1032C-80C10338 -00001 000C+00 1/1 0/0 0/0 .data @9077 */ -SECTION_DATA static void* lit_9077[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)thrown__11daObj_GrA_cFPv, -}; - -/* 80C10338-80C10344 -00001 000C+00 1/1 0/0 0/0 .data @9082 */ -SECTION_DATA static void* lit_9082[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)thrown__11daObj_GrA_cFPv, -}; - -/* 80C10344-80C10350 -00001 000C+00 1/1 0/0 0/0 .data @9348 */ -SECTION_DATA static void* lit_9348[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollAttacked__11daObj_GrA_cFPv, -}; - -/* 80C10350-80C1035C -00001 000C+00 1/1 0/0 0/0 .data @9351 */ -SECTION_DATA static void* lit_9351[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollAttack__11daObj_GrA_cFPv, -}; - -/* 80C1035C-80C10368 -00001 000C+00 1/1 0/0 0/0 .data @9393 */ -SECTION_DATA static void* lit_9393[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollEscape__11daObj_GrA_cFPv, -}; - -/* 80C10368-80C10374 -00001 000C+00 1/1 0/0 0/0 .data @9399 */ -SECTION_DATA static void* lit_9399[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)rollEscape__11daObj_GrA_cFPv, -}; - -/* 80C10374-80C10380 -00001 000C+00 1/1 0/0 0/0 .data @9472 */ -SECTION_DATA static void* lit_9472[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)toStone__11daObj_GrA_cFPv, -}; - -/* 80C10380-80C1038C -00001 000C+00 1/1 0/0 0/0 .data @9541 */ -SECTION_DATA static void* lit_9541[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)startDemo__11daObj_GrA_cFPv, -}; - -/* 80C1038C-80C10398 -00001 000C+00 1/1 0/0 0/0 .data @9635 */ -SECTION_DATA static void* lit_9635[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)soldierDemo__11daObj_GrA_cFPv, -}; - -/* 80C10398-80C103A4 -00001 000C+00 1/1 0/0 0/0 .data @9691 */ -SECTION_DATA static void* lit_9691[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)wait__11daObj_GrA_cFPv, -}; - -/* 80C103A4-80C103D4 -00001 0030+00 1/1 0/0 0/0 .data @10259 */ -SECTION_DATA static void* lit_10259[12] = { - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x1B68), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0xE8), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x270), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x444), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x7C8), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0xBCC), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0xED8), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x11BC), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x1238), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x12B8), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x1644), - (void*)(((char*)startDemo__11daObj_GrA_cFPv) + 0x1840), -}; - -/* 80C103D4-80C103E0 -00001 000C+00 0/1 0/0 0/0 .data @10566 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10566[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base000__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C103E0-80C103EC -00001 000C+00 0/1 0/0 0/0 .data @10567 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10567[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base001__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C103EC-80C103F8 -00001 000C+00 0/1 0/0 0/0 .data @10568 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10568[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base003__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C103F8-80C10404 -00001 000C+00 0/1 0/0 0/0 .data @10569 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10569[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base004__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10404-80C10410 -00001 000C+00 0/1 0/0 0/0 .data @10570 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10570[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base005__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10410-80C1041C -00001 000C+00 0/1 0/0 0/0 .data @10571 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10571[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base006__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C1041C-80C10428 -00001 000C+00 0/1 0/0 0/0 .data @10572 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10572[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base007__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10428-80C10434 -00001 000C+00 0/1 0/0 0/0 .data @10573 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10573[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base008__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10434-80C10440 -00001 000C+00 0/1 0/0 0/0 .data @10574 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10574[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base009__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10440-80C1044C -00001 000C+00 0/1 0/0 0/0 .data @10575 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10575[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base010__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C1044C-80C10458 -00001 000C+00 0/1 0/0 0/0 .data @10576 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10576[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base013__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10458-80C10464 -00001 000C+00 0/1 0/0 0/0 .data @10577 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10577[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base016__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10464-80C10470 -00001 000C+00 0/1 0/0 0/0 .data @10578 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10578[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base017__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10470-80C1047C -00001 000C+00 0/1 0/0 0/0 .data @10579 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10579[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base018__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C1047C-80C10488 -00001 000C+00 0/1 0/0 0/0 .data @10580 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10580[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base019__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10488-80C10494 -00001 000C+00 0/1 0/0 0/0 .data @10581 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10581[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base020__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10494-80C104A0 -00001 000C+00 0/1 0/0 0/0 .data @10582 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10582[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base021__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C104A0-80C104AC -00001 000C+00 0/1 0/0 0/0 .data @10583 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10583[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base022__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C104AC-80C104B8 -00001 000C+00 0/1 0/0 0/0 .data @10584 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10584[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base023__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C104B8-80C104C4 -00001 000C+00 0/1 0/0 0/0 .data @10585 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10585[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base024__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C104C4-80C104D0 -00001 000C+00 0/1 0/0 0/0 .data @10586 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10586[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base025__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C104D0-80C104DC -00001 000C+00 0/1 0/0 0/0 .data @10587 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10587[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)base026__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C104DC-80C105E4 000674 0108+00 1/2 0/0 0/0 .data mBaseMotionList__11daObj_GrA_c */ -daObj_GrA_c::MotionFunc daObj_GrA_c::mBaseMotionList[22] = { - &daObj_GrA_c::base000, - &daObj_GrA_c::base001, - &daObj_GrA_c::base003, - &daObj_GrA_c::base004, - &daObj_GrA_c::base005, - &daObj_GrA_c::base006, - &daObj_GrA_c::base007, - &daObj_GrA_c::base008, - &daObj_GrA_c::base009, - &daObj_GrA_c::base010, - &daObj_GrA_c::base013, - &daObj_GrA_c::base016, - &daObj_GrA_c::base017, - &daObj_GrA_c::base018, - &daObj_GrA_c::base019, - &daObj_GrA_c::base020, - &daObj_GrA_c::base021, - &daObj_GrA_c::base022, - &daObj_GrA_c::base023, - &daObj_GrA_c::base024, - &daObj_GrA_c::base025, - &daObj_GrA_c::base026, -}; - -/* 80C105E4-80C105F0 -00001 000C+00 0/1 0/0 0/0 .data @10849 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10849[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face000__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C105F0-80C105FC -00001 000C+00 0/1 0/0 0/0 .data @10850 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10850[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face003__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C105FC-80C10608 -00001 000C+00 0/1 0/0 0/0 .data @10851 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10851[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face004__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10608-80C10614 -00001 000C+00 0/1 0/0 0/0 .data @10852 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10852[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face005__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10614-80C10620 -00001 000C+00 0/1 0/0 0/0 .data @10853 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10853[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face006__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10620-80C1062C -00001 000C+00 0/1 0/0 0/0 .data @10854 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10854[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face007__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C1062C-80C10638 -00001 000C+00 0/1 0/0 0/0 .data @10855 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10855[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face008__11daObj_GrA_cFi, -}; -#pragma pop - -/* 80C10638-80C10644 -00001 000C+00 0/1 0/0 0/0 .data @10856 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10856[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face009__11daObj_GrA_cFi, + 13, 1, 10, 1, + 8, 1, 11, 1, + 6, 0, 4, 3, + 9, 0, }; -#pragma pop -/* 80C10644-80C10650 -00001 000C+00 0/1 0/0 0/0 .data @10857 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10857[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face010__11daObj_GrA_cFi, +/* 80C1000C-80C1002C 0001A4 0020+00 1/1 0/0 0/0 .data l_btpGetParamList */ +static int l_btpGetParamList[8] = { + 28, 1, 32, 1, + 31, 1, 21, 0, }; -#pragma pop -/* 80C10650-80C1065C -00001 000C+00 0/1 0/0 0/0 .data @10858 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10858[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face011__11daObj_GrA_cFi, +/* 80C1002C-80C10044 0001C4 0016+02 1/2 0/0 0/0 .data l_eventMotionChangeTable */ +static u16 l_eventMotionChangeTable[11] = { + 0, 1, 0, 2, + 3, 0, 0, 0, + 0, 0, 0, }; -#pragma pop -/* 80C1065C-80C10668 -00001 000C+00 0/1 0/0 0/0 .data @10859 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10859[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face012__11daObj_GrA_cFi, +/* 80C10044-80C1004C 0001DC 0008+00 1/2 0/0 0/0 .data l_eventFaceChangeTable */ +static u16 l_eventFaceChangeTable[4] = { + 1, 2, 6, 7, }; -#pragma pop -/* 80C10668-80C10674 -00001 000C+00 0/1 0/0 0/0 .data @10860 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10860[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face016__11daObj_GrA_cFi, +/* 80C1004C-80C10054 -00001 0008+00 1/1 0/0 0/0 .data l_evtNameList */ +static char* l_evtNameList[2] = { + NULL, + "GRA_THROWN", }; -#pragma pop -/* 80C10674-80C10680 -00001 000C+00 0/1 0/0 0/0 .data @10861 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10861[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face017__11daObj_GrA_cFi, +/* 80C10054-80C1005C 0001EC 0008+00 0/1 0/0 0/0 .data l_entryJntNoList */ +static u16 l_entryJntNoList[4] = { + 5, 6, 7, -1, }; -#pragma pop -/* 80C10680-80C1068C -00001 000C+00 0/1 0/0 0/0 .data @10862 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_10862[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)face999__11daObj_GrA_cFi, +/* 80C104DC-80C105E4 000674 0108+00 1/2 0/0 0/0 .data mBaseMotionList__11daObj_GrA_c */ +daObj_GrA_c::MotionFunc daObj_GrA_c::mBaseMotionList[22] = { + &daObj_GrA_c::base000, + &daObj_GrA_c::base001, + &daObj_GrA_c::base003, + &daObj_GrA_c::base004, + &daObj_GrA_c::base005, + &daObj_GrA_c::base006, + &daObj_GrA_c::base007, + &daObj_GrA_c::base008, + &daObj_GrA_c::base009, + &daObj_GrA_c::base010, + &daObj_GrA_c::base013, + &daObj_GrA_c::base016, + &daObj_GrA_c::base017, + &daObj_GrA_c::base018, + &daObj_GrA_c::base019, + &daObj_GrA_c::base020, + &daObj_GrA_c::base021, + &daObj_GrA_c::base022, + &daObj_GrA_c::base023, + &daObj_GrA_c::base024, + &daObj_GrA_c::base025, + &daObj_GrA_c::base026, }; -#pragma pop /* 80C1068C-80C10734 000824 00A8+00 1/2 0/0 0/0 .data mFaceMotionList__11daObj_GrA_c */ daObj_GrA_c::MotionFunc daObj_GrA_c::mFaceMotionList[14] = { @@ -1432,103 +179,8 @@ daObj_GrA_c::MotionFunc daObj_GrA_c::mFaceMotionList[14] = { &daObj_GrA_c::face999, }; -/* 80C10784-80C107E8 00091C 0064+00 2/2 0/0 0/0 .data __vt__11daObj_GrA_c */ -SECTION_DATA extern void* __vt__11daObj_GrA_c[25] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__11daObj_GrA_cFv, - (void*)execute__11daBaseNpc_cFv, - (void*)draw__11daBaseNpc_cFf, - (void*)getResName__11daObj_GrA_cFv, - (void*)attnSttsOn__11daBaseNpc_cFii, - (void*)setParam__11daObj_GrA_cFv, - (void*)mainProc__11daObj_GrA_cFv, - (void*)btkCtrl__11daBaseNpc_cFv, - (void*)allAnmPlay__11daBaseNpc_cFv, - (void*)adjustShapeAngle__11daObj_GrA_cFv, - (void*)setMtx__11daObj_GrA_cFi, - (void*)setCollisions__11daObj_GrA_cFv, - (void*)setAttnPos__11daObj_GrA_cFv, - (void*)drawOtherMdls__11daObj_GrA_cFv, - (void*)dbgDraw__11daObj_GrA_cFv, - (void*)CreateHeap__11daObj_GrA_cFv, - (void*)Create__23daBaseNpc_moveBgActor_cFv, - (void*)Execute__11daObj_GrA_cFPPA3_A4_f, - (void*)Draw__11daObj_GrA_cFv, - (void*)Delete__11daObj_GrA_cFv, - (void*)IsDelete__23daBaseNpc_moveBgActor_cFv, - (void*)ToFore__23daBaseNpc_moveBgActor_cFv, - (void*)ToBack__23daBaseNpc_moveBgActor_cFv, -}; - -/* 80C107E8-80C1084C 000980 0064+00 2/2 0/0 0/0 .data __vt__23daBaseNpc_moveBgActor_c */ -SECTION_DATA extern void* __vt__23daBaseNpc_moveBgActor_c[25] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__23daBaseNpc_moveBgActor_cFv, - (void*)execute__11daBaseNpc_cFv, - (void*)draw__11daBaseNpc_cFf, - (void*)getResName__11daBaseNpc_cFv, - (void*)attnSttsOn__11daBaseNpc_cFii, - (void*)setParam__11daBaseNpc_cFv, - (void*)mainProc__11daBaseNpc_cFv, - (void*)btkCtrl__11daBaseNpc_cFv, - (void*)allAnmPlay__11daBaseNpc_cFv, - (void*)adjustShapeAngle__11daBaseNpc_cFv, - (void*)setMtx__11daBaseNpc_cFi, - (void*)setCollisions__11daBaseNpc_cFv, - (void*)setAttnPos__11daBaseNpc_cFv, - (void*)drawOtherMdls__11daBaseNpc_cFv, - (void*)dbgDraw__11daBaseNpc_cFv, - (void*)CreateHeap__23daBaseNpc_moveBgActor_cFv, - (void*)Create__23daBaseNpc_moveBgActor_cFv, - (void*)Execute__23daBaseNpc_moveBgActor_cFPPA3_A4_f, - (void*)Draw__23daBaseNpc_moveBgActor_cFv, - (void*)Delete__23daBaseNpc_moveBgActor_cFv, - (void*)IsDelete__23daBaseNpc_moveBgActor_cFv, - (void*)ToFore__23daBaseNpc_moveBgActor_cFv, - (void*)ToBack__23daBaseNpc_moveBgActor_cFv, -}; - -/* 80C1084C-80C10858 0009E4 000C+00 2/2 0/0 0/0 .data __vt__18daBaseNpc_acMngr_c */ -SECTION_DATA extern void* __vt__18daBaseNpc_acMngr_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__18daBaseNpc_acMngr_cFv, -}; - -/* 80C10858-80C10864 0009F0 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 80C10864-80C10870 0009FC 000C+00 2/2 0/0 0/0 .data __vt__16daBaseNpc_path_c */ -SECTION_DATA extern void* __vt__16daBaseNpc_path_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__16daBaseNpc_path_cFv, -}; - -/* 80C10870-80C1087C 000A08 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGCyl */ -SECTION_DATA extern void* __vt__8cM3dGCyl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGCylFv, -}; - -/* 80C1087C-80C10888 000A14 000C+00 5/5 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - /* 80BFFF70-80C0011C 000150 01AC+00 1/1 0/0 0/0 .text __ct__11daObj_GrA_cFv */ -daObj_GrA_c::daObj_GrA_c() { - // NONMATCHING -} +daObj_GrA_c::daObj_GrA_c() {} /* 80C0011C-80C003CC 0002FC 02B0+00 1/0 0/0 0/0 .text __dt__11daObj_GrA_cFv */ daObj_GrA_c::~daObj_GrA_c() { @@ -1608,7 +260,6 @@ cPhs__Step daObj_GrA_c::create() { return phase; } -/* ############################################################################################## */ /* 80C0FA7C-80C0FB3C 000000 00C0+00 54/54 0/0 0/0 .rodata m__17daObj_GrA_Param_c */ daObj_GrA_Param_c::Data const daObj_GrA_Param_c::m = { 85.0f, @@ -1899,7 +550,7 @@ u16 daObj_GrA_c::getTagNo() { } /* 80C00E10-80C00E1C 000FF0 000C+00 1/1 0/0 0/0 .text getJumpType__11daObj_GrA_cFv */ -u32 daObj_GrA_c::getJumpType() { +u16 daObj_GrA_c::getJumpType() { return fopAcM_GetParam(this) >> 7 & 0x7F; } @@ -1994,20 +645,8 @@ void daObj_GrA_c::restart() { UNK_REL_BSS; -/* 80C108E0-80C108EC 000048 000C+00 0/1 0/0 0/0 .bss @4026 */ -#pragma push -#pragma force_active on -static u8 lit_4026[12]; -#pragma pop - /* 80C108EC-80C108F8 000054 000C+00 0/2 0/0 0/0 .bss l_centerOfst */ -static cXyz l_centerOfst; - -/* 80C108F8-80C10904 000060 000C+00 0/1 0/0 0/0 .bss @4027 */ -#pragma push -#pragma force_active on -static u8 lit_4027[12]; -#pragma pop +static cXyz l_centerOfst(0.0f, 67.0f, 26.0f); /* 80C10904-80C10908 00006C 0004+00 1/2 0/0 0/0 .bss l_HIO */ static daObj_GrA_Param_c l_HIO; @@ -2302,7 +941,7 @@ int daObj_GrA_c::setProcess(int (daObj_GrA_c::*process)(void*)) { /* 80C019A4-80C019B8 001B84 0014+00 2/2 0/0 0/0 .text getDistTableIdx__Fii */ static u8 getDistTableIdx(int param_1, int param_2) { - // NONMATCHING + return param_1 + param_2 * 20 + 94; } /* 80C019B8-80C01C18 001B98 0260+00 1/0 0/0 0/0 .text setParam__11daObj_GrA_cFv */ @@ -3490,8 +2129,7 @@ extern "C" void __dt__23daBaseNpc_moveBgActor_cFv() { // NONMATCHING } -/* 80C04EFC-80C04F04 0050DC 0008+00 1/0 0/0 0/0 .text Draw__23daBaseNpc_moveBgActor_cFv - */ +/* 80C04EFC-80C04F04 0050DC 0008+00 1/0 0/0 0/0 .text Draw__23daBaseNpc_moveBgActor_cFv */ // bool daBaseNpc_moveBgActor_c::Draw() { extern "C" bool Draw__23daBaseNpc_moveBgActor_cFv() { return true; @@ -3503,15 +2141,13 @@ extern "C" bool CreateHeap__23daBaseNpc_moveBgActor_cFv() { return true; } -/* 80C04F2C-80C04F34 00510C 0008+00 1/0 0/0 0/0 .text Execute__23daBaseNpc_moveBgActor_cFPPA3_A4_f - */ +/* 80C04F2C-80C04F34 00510C 0008+00 1/0 0/0 0/0 .text Execute__23daBaseNpc_moveBgActor_cFPPA3_A4_f */ // bool daBaseNpc_moveBgActor_c::Execute(f32 (**param_0)[3][4]) { extern "C" bool Execute__23daBaseNpc_moveBgActor_cFPPA3_A4_f() { return true; } -/* 80C04F34-80C04F3C 005114 0008+00 1/0 0/0 0/0 .text Delete__23daBaseNpc_moveBgActor_cFv - */ +/* 80C04F34-80C04F3C 005114 0008+00 1/0 0/0 0/0 .text Delete__23daBaseNpc_moveBgActor_cFv */ // bool daBaseNpc_moveBgActor_c::Delete() { extern "C" bool Delete__23daBaseNpc_moveBgActor_cFv() { return true; @@ -3567,14 +2203,14 @@ int daObj_GrA_c::standWait(void* param_1) { } } } else { - sp5c.y -= daPy_getPlayerActorClass()->getAttentionOffsetY(); + sp5c = daPy_getPlayerActorClass()->current.pos; + sp5c.y = daPy_py_c::getAttentionOffsetY(); f32 fVar1 = (sp5c - current.pos).absXZ(); cLib_targetAngleY(&attention_info.position, &sp5c); cLib_targetAngleY(¤t.pos, &eyePos); if (field_0x1fdc == 0 && dComIfGp_checkPlayerStatus0(0, 0x100) == 0) { - f32 fVar2 = getSrchCircleR(); - if ((home.pos - current.pos).absXZ() <= fVar2 && getSrchCircleR() <= fVar2) { + if ((home.pos - current.pos).absXZ() <= getSrchCircleR() && getSrchCircleR() <= fVar1) { if (std::abs(sp5c.y - current.pos.y) < 300.0f) { field_0x150c = 1; } @@ -5069,19 +3705,133 @@ void daObj_GrA_c::demo_camera() { /* 80C0AF94-80C0B9AC 00B174 0A18+00 2/1 0/0 0/0 .text rollAttackedDemo__11daObj_GrA_cFv */ void daObj_GrA_c::rollAttackedDemo() { // NONMATCHING + csXyz cStack_118; + cXyz spa4, spb0, sp98; + cXyz sp80; + cXyz sp74; + cXyz sp68; + cXyz sp5c; + cXyz sp50; + cXyz sp44; + cXyz sp38; + cXyz sp2c; + f32 fVar1; + daPy_py_c* player = daPy_getPlayerActorClass(); camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); dCamera_c* camBody = dCam_getBody(); - if (mDemoCamMode <= 7) { - if (!eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(this, 0, 0xFFEF, 0); - eventInfo.onCondition(dEvtCnd_CANDEMO_e); + switch (mDemoCamMode) { + case 1: + if (!eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(this, 0, 0xFFEF, 0); + eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + + camera->mCamera.Stop(); + mDemoCamMode = 2; + field_0x2056 = 0; + fVar1 = camBody->Fovy(); + field_0x208c = fVar1; + mDemoCamFovy = fVar1; + sp74 = camBody->Center(); + field_0x2080 = sp74; + mDemoCamCenter = field_0x2080; + + sp80 = camBody->Eye(); + field_0x2074 = sp80; + mDemoCamEye = field_0x2074; + // fallthrough + case 2: + if (!dComIfGp_event_runCheck() && !eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(this, 0, 0xFFEF, 0); + eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + + if (field_0x2056 >= 20) { + mDemoCamMode = 4; + field_0x2056 = 0; + field_0x2080 = camBody->Center(); + mDemoCamCenter = field_0x2080; + + field_0x2074 = camBody->Eye(); + mDemoCamEye = field_0x2074; + + camera->mCamera.SetTrimSize(2); + break; + } else { + mDemoCamCenter += player->current.pos - player->old.pos; + mDemoCamCenter.y -= 2.0f; + mDemoCamEye += player->current.pos - player->old.pos; + } + // fallthrough + case 4: + if (field_0x2056 >= 30) { + mDoMtx_stack_c::YrotS(player->current.angle.y); + sp44.set(0.0f, 150.0f, 250.0f); + mDoMtx_stack_c::multVec(&sp44, &sp44); + sp44 += player->current.pos; + sp50 = current.pos; + sp50.y += 150.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp50, 0.1f, (sp44 - sp50).abs() / 60.0f); + break; + } else if (field_0x2056 >= daObj_GrA_Param_c::m.field_0xb2){ + mDemoCamMode += 1; + field_0x2056 = 0; + field_0x2074 = mDemoCamEye; + field_0x2080 = mDemoCamCenter; + cStack_118 = player->current.angle; + cStack_118.y = cLib_targetAngleY(&player->current.pos, ¤t.pos); + player->setPlayerPosAndAngle(&player->current.pos, &cStack_118); + } + break; + + case 5: + mDoMtx_stack_c::YrotS(player->current.angle.y); + sp2c.set(0.0f, 150.0f, 250.0f); + mDoMtx_stack_c::multVec(&sp2c, &sp2c); + sp2c += player->current.pos; + sp38 = current.pos; + sp38.y += 150.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp38, 0.15f, (sp2c - sp38).abs() / 60.0f); + break; + + case 6: + if (field_0x2056 >= 60) { + mDemoCamMode = 7; + } else { + mDoMtx_stack_c::YrotS(player->current.angle.y); + sp5c.set(0.0f, 100.0f, -300.0f); + mDoMtx_stack_c::multVec(&sp5c, &sp5c); + sp5c += player->current.pos; + cLib_addCalcPos2(&mDemoCamEye, sp5c, 0.1f, (field_0x2074 - sp5c).abs() / 30.0f); + + sp68 = player->current.pos; + sp68.y += 90.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp68, 0.1f, (sp68 - field_0x2080).abs() / 30.0f); + break; + } + // fallthrough + case 7: + camera->mCamera.Reset(mDemoCamCenter, mDemoCamEye, mDemoCamFovy, 0); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + mDemoCamMode = 0; + field_0x2056 = 0; return; - } + default: + break; + } + if (mDemoCamMode != 0) { + camera->mCamera.Set(mDemoCamCenter, mDemoCamEye, mDemoCamFovy, 0); + field_0x2056 += 1; } + return; } /* 80C0B9AC-80C0BD90 00BB8C 03E4+00 2/2 0/0 0/0 .text graThrowDemo__11daObj_GrA_cFv */ @@ -5956,80 +4706,248 @@ int daObj_GrA_c::startDemo(void* param_1) { } /* 80C0EFC4-80C0F17C 00F1A4 01B8+00 1/1 0/0 0/0 .text turn__11daObj_GrA_cFsfi */ -void daObj_GrA_c::turn(s16 param_0, f32 param_1, int param_2) { +BOOL daObj_GrA_c::turn(s16 param_1, f32 param_2, int param_3) { // NONMATCHING + if (field_0x1fc8 == 0) { + field_0x1fd0 = fabsf(cM_sht2d((s16)(current.angle.y - param_1))); + field_0x1fd0 = field_0x1fd0 / 180.0f * param_2; + field_0x1fd0 = (int)field_0x1fd0 + 1; + + if (field_0x1fd0 < 8.0f) { + field_0x1fd0 = 8.0f; + } + + field_0x1fd4 = current.angle.y; + } + + s16 sVar1 = field_0x1fd4; + if (param_3 == 0) { + if ((s16)(param_1 - sVar1) >= 0) { + param_3 = -1; + } else { + param_3 = 1; + } + } + + u16 sVar2 = param_1 - sVar1; + if (param_3 < 0) { + sVar2 = -(u16)(0xFFFF - sVar2); + } + + f32 fVar1 = cM_ssin(field_0x1fc8); + field_0x1fc8 = field_0x1fc8 + 16384.0f / field_0x1fd0; + if ((u16)field_0x1fc8 >= 0x4000) { + current.angle.y = param_1; + field_0x1fc8 = 0x4000; + } else { + current.angle.y = field_0x1fd4 + (int)(sVar2 * fVar1); + } + + return param_1 == current.angle.y; } /* 80C0F17C-80C0F330 00F35C 01B4+00 2/2 0/0 0/0 .text turn_step__11daObj_GrA_cFsiii */ -BOOL daObj_GrA_c::turn_step(s16 param_0, int param_1, int param_2, int param_3) { +BOOL daObj_GrA_c::turn_step(s16 param_1, int param_2, int param_3, int param_4) { // NONMATCHING + if (field_0x1fcc == 0) { + if ((int)fabsf(cM_sht2d((s16)(param_1 - field_0x91a.y))) > 20) { + if (param_2 >= 0 && field_0xa92 != param_2) { + setFaceMotion(param_2, 3.0f); + } + + if (param_3 >= 0 && field_0xa90 != param_3) { + setBaseMotion(param_3, 3.0f); + } + } + + field_0x1fd6 = param_1; + field_0x1fc8 = 0; + + if (field_0x91a.y == field_0x1fd6) { + field_0x1fcc++; + } + + current.angle.y = field_0x91a.y; + shape_angle.y = current.angle.y; + field_0x1fcc++; + } else if (field_0x1fcc == 1) { + if (turn(field_0x1fd6, param_4, 0) != 0) { + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + field_0x1fcc++; + } else { + shape_angle.y = current.angle.y; + field_0x91a.y = current.angle.y; + } + } + + u32 rv = field_0x1fcc ^ 1; + return ((rv >> 1) - (rv & field_0x1fcc)) >> 0x1F; } /* 80C0F330-80C0F590 00F510 0260+00 1/1 0/0 0/0 .text chkFindPlayer2__11daObj_GrA_cFis */ -void daObj_GrA_c::chkFindPlayer2(int param_0, s16 param_1) { +BOOL daObj_GrA_c::chkFindPlayer2(int param_1, s16 param_2) { // NONMATCHING -} + cXyz sp80 = getAttentionPos(this); + s16 playerAngleY = fopAcM_searchPlayerAngleY(this); + int iVar1 = abs((s16)(playerAngleY - current.angle.y)); + u8 uVar1; + + if (iVar1 < 0x3C00) { + if (param_1 == 0) { + uVar1 = getDistTableIdx(10, 6); + } else { + uVar1 = getDistTableIdx(12, 6); + } + } else if (param_1 == 0) { + uVar1 = getDistTableIdx(4, 6); + } else { + uVar1 = getDistTableIdx(6, 6); + } + iVar1 = uVar1; -/* 80C0F590-80C0F5A4 00F770 0014+00 1/1 0/0 0/0 .text getDistTable__12dAttention_cFi */ -// void dAttention_c::getDistTable(int param_0) { -extern "C" void getDistTable__12dAttention_cFi() { - // NONMATCHING + f32 fVar1, fVar2, fVar3; + if (param_1 == 0) { + dComIfGp_getAttention(); + fVar1 = dComIfGp_getAttention()->getDistTable(iVar1).mDistMax; + } else { + dComIfGp_getAttention(); + fVar1 = dComIfGp_getAttention()->getDistTable(iVar1).mDistMaxRelease; + } + + fVar2 = dComIfGp_getAttention()->getDistTable(iVar1).mLowerY * -1.0f; + fVar3 = dComIfGp_getAttention()->getDistTable(iVar1).mUpperY * -1.0f; + u32 uVar2 = dComIfGp_getAttention()->getDistTable(iVar1).mAngleSelect; + + f32 fVar4 = 180.0f; + if ((uVar2 & 8) != 0) { + fVar4 = 30.0f; + } else if ((uVar2 & 16) != 0) { + fVar4 = 45.0f; + } else if ((uVar2 & 32) != 0) { + fVar4 = 60.0f; + } else if ((uVar2 & 64) != 0) { + fVar4 = 90.0f; + } else if ((uVar2 & 128) != 0) { + fVar4 = 110.0f; + } else if ((uVar2 & 256) != 0) { + fVar4 = 135.0f; + } + + if (chkPointInArea(sp80, attention_info.position, fVar1, fVar2, fVar3, 0)) { + if (chkActorInSight2(daPy_getPlayerActorClass(), fVar4, param_2)) { + return TRUE; + } + } + + return FALSE; } -/* 80C0F5A4-80C0F668 00F784 00C4+00 1/1 0/0 0/0 .text chkPointInArea__11daObj_GrA_cF4cXyz4cXyzfffs - */ -void daObj_GrA_c::chkPointInArea(cXyz param_0, cXyz param_1, f32 param_2, f32 param_3, - f32 param_4, s16 param_5) { +/* 80C0F5A4-80C0F668 00F784 00C4+00 1/1 0/0 0/0 .text chkPointInArea__11daObj_GrA_cF4cXyz4cXyzfffs */ +BOOL daObj_GrA_c::chkPointInArea(cXyz param_1, cXyz param_2, f32 param_3, f32 param_4, f32 param_5, s16 param_6) { // NONMATCHING + f32 fVar1 = param_4; + f32 fVar2 = param_5; + f32 fVar3 = param_3; + cXyz sp68, sp74; + f32 fVar4 = fVar1; + + if (fVar1 < fVar2) { + fVar4 = fVar2; + fVar2 = fVar1; + } + + sp68.set(fVar3, fabsf(fVar4 - fVar2) * 0.5f, fVar3); + sp74 = param_2; + sp74.y = (sp74.y + fVar2) + sp68.y; + + return chkPointInArea(param_1, sp74, sp68, param_6); } -/* 80C0F668-80C0F6E0 00F848 0078+00 1/1 0/0 0/0 .text - * chkPointInArea__11daObj_GrA_cF4cXyz4cXyz4cXyzs */ -void daObj_GrA_c::chkPointInArea(cXyz param_0, cXyz param_1, cXyz param_2, s16 param_3) { - // NONMATCHING +/* 80C0F668-80C0F6E0 00F848 0078+00 1/1 0/0 0/0 .text chkPointInArea__11daObj_GrA_cF4cXyz4cXyz4cXyzs */ +BOOL daObj_GrA_c::chkPointInArea(cXyz param_1, cXyz param_2, cXyz param_3, s16 param_4) { + return daNpcF_chkPointInArea(param_1, param_2, param_3, param_4); } -/* 80C0F6E0-80C0F7EC 00F8C0 010C+00 1/1 0/0 0/0 .text - * chkActorInSight2__11daObj_GrA_cFP10fopAc_ac_cfs */ -void daObj_GrA_c::chkActorInSight2(fopAc_ac_c* param_0, f32 param_1, s16 param_2) { +/* 80C0F6E0-80C0F7EC 00F8C0 010C+00 1/1 0/0 0/0 .text chkActorInSight2__11daObj_GrA_cFP10fopAc_ac_cfs */ +BOOL daObj_GrA_c::chkActorInSight2(fopAc_ac_c* actor, f32 param_2, s16 param_3) { // NONMATCHING + if (param_2 < 180.0f) { + s16 sVar1 = cM_deg2s(param_2); + cXyz sp34 = getAttentionPos(actor); + cSGlobe cStack_48(attention_info.position - sp34); + cSAngle acStack_4c(cSAngle(cStack_48.U().Inv()) - param_3); + s16 sVar2 = acStack_4c.Val(); + if (sVar2 < 0) { + sVar2 = -sVar2; + } + + return sVar2 ^ sVar1; + } + + return 1; } -/* 80C0F7EC-80C0F860 00F9CC 0074+00 2/2 0/0 0/0 .text getAttentionPos__11daObj_GrA_cFP10fopAc_ac_c - */ -void daObj_GrA_c::getAttentionPos(fopAc_ac_c* param_0) { - // NONMATCHING +/* 80C0F7EC-80C0F860 00F9CC 0074+00 2/2 0/0 0/0 .text getAttentionPos__11daObj_GrA_cFP10fopAc_ac_c */ +cXyz daObj_GrA_c::getAttentionPos(fopAc_ac_c* i_actor_p) { + cXyz pos = i_actor_p->attention_info.position; + + if (fopAcM_GetName(i_actor_p) == PROC_ALINK) { + pos.y -= daPy_py_c::getAttentionOffsetY(); + } + + return pos; } /* 80C0F860-80C0FA68 00FA40 0208+00 2/0 0/0 0/0 .text standWaitJump__11daObj_GrA_cFPv */ -int daObj_GrA_c::standWaitJump(void* param_0) { - // NONMATCHING -} +int daObj_GrA_c::standWaitJump(void* param_1) { + switch (field_0xa7c) { + case 0: + field_0x1fcc = 0; + break; -/* ############################################################################################## */ -/* 80C10AAC-80C10ABC 000214 000C+04 0/0 0/0 0/0 .bss @5648 */ -#pragma push -#pragma force_active on -static u8 lit_5648[12 + 4 /* padding */]; -#pragma pop + case 1: + if (getJumpType() == 1) { + setLookMode(0); + if (home.angle.y != field_0x91a.y) { + if (turn_step(home.angle.y, 0, 19, 20) != 0) { + field_0x1fcc = 0; + setBaseMotion(21, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(0, -1.0f); + } + } else if (field_0xa90 != 21) { + setBaseMotion(21, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(0, -1.0f); + } + } else { + BOOL bVar1 = field_0x14f8.getActor() != NULL; + if (chkFindPlayer2(bVar1, shape_angle.y) != 0) { + if (!bVar1) { + field_0x14f8.entry(daPy_getPlayerActorClass()); + } + } else if (bVar1) { + field_0x14f8.entry(NULL); + } -/* 80C10ABC-80C10AC8 000224 000C+00 0/0 0/0 0/0 .bss @5651 */ -#pragma push -#pragma force_active on -static u8 lit_5651[12]; -#pragma pop + if (field_0x14f8.getActor() != NULL) { + setLookMode(1); + } else { + setLookMode(0); + if ((home.angle.y != field_0x91a.y) && (turn_step(home.angle.y, 0, 19, 20) != 0)) { + field_0x1fcc = 0; + setBaseMotion(0, daObj_GrA_Param_c::m.field_0x0c); + setFaceMotion(0, -1.0f); + } + } + } + break; -/* 80C10AC8-80C10AD4 000230 000C+00 0/0 0/0 0/0 .bss @5652 */ -#pragma push -#pragma force_active on -static u8 lit_5652[12]; -#pragma pop + case 2: + break; + } -/* 80C10AD4-80C10AE0 00023C 000C+00 0/0 0/0 0/0 .bss @5653 */ -#pragma push -#pragma force_active on -static u8 lit_5653[12]; -#pragma pop + return 1; +} /* 80C10AE0-80C10B10 000248 0030+00 0/0 0/0 0/0 .bss aVec$5647 */ #pragma push From deb3c885b9177c28d3090eb9f156e3a7c9fb9483 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Thu, 12 Jun 2025 14:09:17 -0400 Subject: [PATCH 08/21] Fixed some BaseNpc functions I broke --- include/d/actor/d_a_npc.h | 4 ++-- src/d/actor/d_a_npc2.cpp | 10 +++++----- src/d/actor/d_a_npc3.cpp | 2 +- src/d/actor/d_a_obj_gra2.cpp | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index 1b8a52e5725..a72dc97eec9 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -771,7 +771,7 @@ class daBaseNpc_path_c { /* 8014DA48 */ void reverseDir(); /* 8014DA64 */ s32 chkPnt(cXyz); /* 8014DAC4 */ BOOL setNextPnt(); - /* 8014DB04 */ s16 getIdx(); + /* 8014DB04 */ u16 getIdx(); /* 8014DB0C */ void setIdx(u16); /* 8014DB14 */ Vec getPntPos(u16); /* 801503FC */ virtual ~daBaseNpc_path_c() {} @@ -784,7 +784,7 @@ class daBaseNpc_path_c { /* 0x00C */ dPnt mCurvePnts[160]; /* 0xA0C */ u8 field_0xa0c[0xA0E - 0xA0C]; /* 0xA0E */ u16 mCurvePntNum; - /* 0xA10 */ s16 mIdx; + /* 0xA10 */ u16 mIdx; /* 0xA12 */ s8 mDirection; /* 0xA13 */ u8 field_0xa13; /* 0xA14 */ s16 field_0xa14; diff --git a/src/d/actor/d_a_npc2.cpp b/src/d/actor/d_a_npc2.cpp index f08e1612017..d63cffe1e3b 100644 --- a/src/d/actor/d_a_npc2.cpp +++ b/src/d/actor/d_a_npc2.cpp @@ -5,7 +5,7 @@ static u16 daBaseNpc_putNurbs(dPnt* i_CPnts, int i_CPntNum, int i_maxPntNum, dPn static s16 daBaseNpc_getGroundAngle(cBgS_PolyInfo* param_0, s16 param_1); /* 8014D538-8014D584 147E78 004C+00 2/2 0/0 0/0 .text daBaseNpc_addIdx__FiiPUsi */ -static int daBaseNpc_addIdx(int i_step, int i_num, s16* i_idx, BOOL i_closed) { +static int daBaseNpc_addIdx(int i_step, int i_num, u16* i_idx, BOOL i_closed) { BOOL new_idx = *i_idx; BOOL ret; @@ -26,7 +26,7 @@ static int daBaseNpc_addIdx(int i_step, int i_num, s16* i_idx, BOOL i_closed) { } /* 8014D584-8014D5C4 147EC4 0040+00 2/2 0/0 0/0 .text daBaseNpc_subIdx__FiiPUsi */ -static BOOL daBaseNpc_subIdx(int i_step, int i_num, s16* i_idx, BOOL i_closed) { +static BOOL daBaseNpc_subIdx(int i_step, int i_num, u16* i_idx, BOOL i_closed) { int new_idx = *i_idx; BOOL ret; @@ -47,7 +47,7 @@ static BOOL daBaseNpc_subIdx(int i_step, int i_num, s16* i_idx, BOOL i_closed) { } /* 8014D5C4-8014D620 147F04 005C+00 2/2 0/0 0/0 .text daBaseNpc_incIdx__FiPUsii */ -static BOOL daBaseNpc_incIdx(int i_pathNo, s16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { +static BOOL daBaseNpc_incIdx(int i_pathNo, u16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { if (i_pathDirection < 0) { return daBaseNpc_subIdx(1, i_pathNo, i_pathIdx, i_pathClosed); } else { @@ -56,7 +56,7 @@ static BOOL daBaseNpc_incIdx(int i_pathNo, s16* i_pathIdx, BOOL i_pathClosed, in } /* 8014D620-8014D67C 147F60 005C+00 1/1 0/0 0/0 .text daBaseNpc_decIdx__FiPUsii */ -static void daBaseNpc_decIdx(int i_pathNo, s16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { +static void daBaseNpc_decIdx(int i_pathNo, u16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection) { if (i_pathDirection < 0) { daBaseNpc_addIdx(1, i_pathNo, i_pathIdx, i_pathClosed); } else { @@ -185,7 +185,7 @@ BOOL daBaseNpc_path_c::setNextPnt() { } /* 8014DB04-8014DB0C 148444 0008+00 0/0 0/0 3/3 .text getIdx__16daBaseNpc_path_cFv */ -s16 daBaseNpc_path_c::getIdx() { +u16 daBaseNpc_path_c::getIdx() { return mIdx; } diff --git a/src/d/actor/d_a_npc3.cpp b/src/d/actor/d_a_npc3.cpp index b89b652ab43..00ec3e979a4 100644 --- a/src/d/actor/d_a_npc3.cpp +++ b/src/d/actor/d_a_npc3.cpp @@ -1,7 +1,7 @@ #include "d/actor/d_a_npc.h" #include "d/d_bg_w.h" -static void daBaseNpc_incIdx(int i_pathNo, u16* i_pathIdx, int i_pathClosed, int i_pathDirection); +static BOOL daBaseNpc_incIdx(int i_pathNo, u16* i_pathIdx, BOOL i_pathClosed, int i_pathDirection); static void daBaseNpc_decIdx(int i_pathNo, u16* i_pathIdx, int i_pathClosed, int i_pathDirection); static f32 daNpcBase_BBasis(int i_deg, int i_pntNo, int i_knotNo, int* i_knotVector_p); diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index d9facdf744f..63224abdf18 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -3012,7 +3012,7 @@ int daObj_GrA_c::rollAttack(void* param_1) { cXyz sp3c; s16 sVar1; f32 fVar1, fVar2; - bool bVar1; + BOOL bVar1; cXyz sp48; switch (field_0xa7c) { @@ -3119,13 +3119,13 @@ int daObj_GrA_c::rollAttack(void* param_1) { } } - bVar1 = false; + BOOL bVar2 = FALSE; if (field_0x1528.isPath()) { - while (!bVar1) { + while (!bVar2) { if (field_0x1528.chkPnt(current.pos) == 0) break; if (field_0x1528.setNextPnt()) { - bVar1 = true; + bVar2 = TRUE; field_0x1fe9 = 1; field_0x2014 = 1; } From 52c4437396c673530556f88b1764287c41450a27 Mon Sep 17 00:00:00 2001 From: carter-ktb21 <144170194+carter-ktb21@users.noreply.github.com> Date: Sun, 15 Jun 2025 19:09:16 -0400 Subject: [PATCH 09/21] PR Cleanup --- include/d/actor/d_a_obj_gra2.h | 13 ------- src/d/actor/d_a_obj_gra2.cpp | 66 +++++++++------------------------- 2 files changed, 17 insertions(+), 62 deletions(-) diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 6b96c1698e4..5ae38ef7f7a 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -306,53 +306,41 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x1FBC */ int field_0x1fbc; /* 0x1FC0 */ int field_0x1fc0; /* 0x1FC4 */ u8 field_0x1fc4; - /* 0x1FC5 */ u8 field_0x1fc5[0x1fc8 - 0x1fc5]; /* 0x1FC8 */ int field_0x1fc8; /* 0x1FCC */ int field_0x1fcc; /* 0x1FD0 */ f32 field_0x1fd0; /* 0x1FD4 */ s16 field_0x1fd4; /* 0x1FD6 */ s16 field_0x1fd6; /* 0x1FD8 */ s16 field_0x1fd8; - /* 0x1FDA */ u8 field_0x1fda[0x1fdc - 0x1fda]; /* 0x1FDC */ int field_0x1fdc; /* 0x1FE0 */ u8 field_0x1fe0; - /* 0x1FE1 */ u8 field_0x1fe1[0x1fe4 - 0x1fe1]; /* 0x1FE4 */ int field_0x1fe4; /* 0x1FE8 */ s8 field_0x1fe8; /* 0x1FE9 */ u8 field_0x1fe9; - /* 0x1FEA */ u8 field_0x1fea[0x1fec - 0x1fea]; /* 0x1FEC */ int field_0x1fec; /* 0x1FF0 */ int field_0x1ff0; /* 0x1FF4 */ u8 field_0x1ff4; - /* 0x1FF5 */ u8 field_0x1ff5[0x1ff8 - 0x1ff5]; /* 0x1FF8 */ int field_0x1ff8; /* 0x1FFC */ u8 field_0x1ffc; - /* 0x1FFD */ u8 field_0x1ffd[0x2000 - 0x1ffd]; /* 0x2000 */ int field_0x2000; /* 0x2004 */ u8 field_0x2004; /* 0x2005 */ s8 field_0x2005; - /* 0x2006 */ u8 field_0x2006[0x2008 - 0x2006]; /* 0x2008 */ f32 field_0x2008; /* 0x200C */ u16 field_0x200c; - /* 0x200E */ u8 field_0x200e[0x2010 - 0x200e]; /* 0x2010 */ int field_0x2010; /* 0x2014 */ u8 field_0x2014; - /* 0x2015 */ u8 field_0x2015[0x2018 - 0x2015]; /* 0x2018 */ int field_0x2018; /* 0x201C */ s8 field_0x201c; /* 0x201D */ u8 field_0x201d; - /* 0x201E */ u8 field_0x201e[0x2020 - 0x201e]; /* 0x2020 */ u32 field_0x2020[3]; /* 0x202C */ u32 field_0x202c; /* 0x2030 */ u8 field_0x2030; /* 0x2031 */ u8 field_0x2031; /* 0x2032 */ u8 field_0x2032; - /* 0x2033 */ u8 field_0x2033[0x2034 - 0x2033]; /* 0x2034 */ cXyz mGraPos; /* 0x2040 */ f32 mGraExtent; /* 0x2044 */ f32 mGraHeight; /* 0x2048 */ s16 mGraMode; - /* 0x204A */ u8 field_0x204a[0x204c - 0x204a]; /* 0x204C */ daBaseNpc_acMngr_c field_0x204c; /* 0x2054 */ s16 mDemoCamMode; /* 0x2056 */ s16 field_0x2056; @@ -365,7 +353,6 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { /* 0x2090 */ cXyz field_0x2090; /* 0x209C */ int field_0x209c; /* 0x20A0 */ u8 field_0x20a0; - /* 0x20A1 */ u8 field_0x20a1[0x20a4 - 0x20a1]; }; STATIC_ASSERT(sizeof(daObj_GrA_c) == 0x20a4); diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index 63224abdf18..a49c67136b9 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -698,7 +698,7 @@ int daObj_GrA_c::init() { setRoomNo(); if (mMode == 2) { - fopAcM_OffStatus(this, 0x4000); + fopAcM_OffStatus(this, fopAcM_STATUS_UNK_004000); } field_0x1528.setPathInfo(getPathNo(), fopAcM_GetRoomNo(this), 1); @@ -975,10 +975,10 @@ void daObj_GrA_c::setParam() { attention_info.flags = 0; } } else if (mMode == 2) { - attention_info.flags &= 0xffffffef; + attention_info.flags &= ~0x10; attention_info.flags = 0x200000; } else { - attention_info.flags &= 0xffffffef; + attention_info.flags &= ~0x10; if (field_0x1508 == 0) { attnSttsOn(0, 0); } @@ -2123,36 +2123,6 @@ static int daObj_GrA_IsDelete(void* param_1) { return 1; } -/* 80C04E9C-80C04EFC 00507C 0060+00 1/0 0/0 0/0 .text __dt__23daBaseNpc_moveBgActor_cFv */ -// daBaseNpc_moveBgActor_c::~daBaseNpc_moveBgActor_c() { -extern "C" void __dt__23daBaseNpc_moveBgActor_cFv() { - // NONMATCHING -} - -/* 80C04EFC-80C04F04 0050DC 0008+00 1/0 0/0 0/0 .text Draw__23daBaseNpc_moveBgActor_cFv */ -// bool daBaseNpc_moveBgActor_c::Draw() { -extern "C" bool Draw__23daBaseNpc_moveBgActor_cFv() { - return true; -} - -/* 80C04F24-80C04F2C 005104 0008+00 1/0 0/0 0/0 .text CreateHeap__23daBaseNpc_moveBgActor_cFv */ -// bool daBaseNpc_moveBgActor_c::CreateHeap() { -extern "C" bool CreateHeap__23daBaseNpc_moveBgActor_cFv() { - return true; -} - -/* 80C04F2C-80C04F34 00510C 0008+00 1/0 0/0 0/0 .text Execute__23daBaseNpc_moveBgActor_cFPPA3_A4_f */ -// bool daBaseNpc_moveBgActor_c::Execute(f32 (**param_0)[3][4]) { -extern "C" bool Execute__23daBaseNpc_moveBgActor_cFPPA3_A4_f() { - return true; -} - -/* 80C04F34-80C04F3C 005114 0008+00 1/0 0/0 0/0 .text Delete__23daBaseNpc_moveBgActor_cFv */ -// bool daBaseNpc_moveBgActor_c::Delete() { -extern "C" bool Delete__23daBaseNpc_moveBgActor_cFv() { - return true; -} - /* 80C0536C-80C053C4 00554C 0058+00 4/4 0/0 0/0 .text getSrchCircleR__11daObj_GrA_cFv */ f32 daObj_GrA_c::getSrchCircleR() { // NONMATCHING @@ -3545,7 +3515,7 @@ int daObj_GrA_c::thrown(void* param_1) { switch (field_0xa7c) { case 0: - fopAcM_OnStatus(this, 0x4000); + fopAcM_OnStatus(this, fopAcM_STATUS_UNK_004000); field_0x1ff0 = 1; mDemoCamMode = 0; field_0x209c = 1; @@ -3660,19 +3630,17 @@ void daObj_GrA_c::demo_camera() { field_0x2074 = mDemoCamEye; field_0x2080 = mDemoCamCenter; } else { - // if (field_0x2056 < 40) { - mDoMtx_stack_c::YrotS(shape_angle.y); - sp70.x = 0.0f; - sp70.y = 250.0f; - sp70.z = 500.0f; - mDoMtx_stack_c::multVec(&sp70, &sp70); - sp70 += current.pos; - cLib_addCalcPos2(&mDemoCamEye, sp70, 0.1f, (field_0x2074 - sp70).abs() / 25.0f); - - sp7c = current.pos; - sp7c.y += 150.0f; - cLib_addCalcPos2(&mDemoCamCenter, sp7c, 0.1f, (field_0x2080 - sp7c).abs() / 25.0f); - // } + mDoMtx_stack_c::YrotS(shape_angle.y); + sp70.x = 0.0f; + sp70.y = 250.0f; + sp70.z = 500.0f; + mDoMtx_stack_c::multVec(&sp70, &sp70); + sp70 += current.pos; + cLib_addCalcPos2(&mDemoCamEye, sp70, 0.1f, (field_0x2074 - sp70).abs() / 25.0f); + + sp7c = current.pos; + sp7c.y += 150.0f; + cLib_addCalcPos2(&mDemoCamCenter, sp7c, 0.1f, (field_0x2080 - sp7c).abs() / 25.0f); } if (daObj_GrA_Param_c::m.field_0xb4 >= field_0x2056) { @@ -4036,10 +4004,10 @@ void daObj_GrA_c::executeCrazyBeforeCatch() { calcCatchPos(-120.0f, 1); if ((field_0xa48 & 2) != 0) { initCrazyCatch(0); - field_0xa48 &= 0xFFFFFFFD; + field_0xa48 &= ~2; } else if ((field_0xa48 & 4) != 0) { initCrazyAttack(); - field_0xa48 &= 0xFFFFFFFB; + field_0xa48 &= ~4; } } From 53227b0ce22716df5b93b98b6ad2a1d389c32a5f Mon Sep 17 00:00:00 2001 From: carter-ktb21 <144170194+carter-ktb21@users.noreply.github.com> Date: Sun, 15 Jun 2025 19:09:56 -0400 Subject: [PATCH 10/21] PR cleanup part 2 --- src/d/actor/d_a_obj_gra2.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index a49c67136b9..a3938bbeb2a 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -4323,9 +4323,9 @@ int daObj_GrA_c::waitDemo(void* param_1) { } else { #ifdef DEBUG if (daObj_GrA_Param_c::m.field_0x8a == 0) { - fopAcM_OnStatus(this, 0x100); + fopAcM_OnStatus(this, fopAcM_STATUS_UNK_000100); } else { - fopAcM_OffStatus(this, 0x100); + fopAcM_OffStatus(this, fopAcM_STATUS_UNK_000100); } #endif @@ -4339,7 +4339,7 @@ int daObj_GrA_c::waitDemo(void* param_1) { case 2: #ifdef DEBUG - fopAcM_OnStatus(this, 0x100); + fopAcM_OnStatus(this, fopAcM_STATUS_UNK_000100); #endif break; } @@ -4416,7 +4416,7 @@ int daObj_GrA_c::startDemo(void* param_1) { player->changeOriginalDemo(); gra_p->field_0x204c.entry(this); setProcess(&daObj_GrA_c::soldierDemo); - fopAcM_OnStatus(gra_p, 0x8000); + fopAcM_OnStatus(gra_p, fopAcM_STATUS_UNK_008000); field_0x2056 = 0; dComIfGp_getEvent().setSkipProc(this, skipCallBack, 0); dComIfGp_getEvent().onSkipFade(); From 62f530763b13af7d0deb1c5fc73e83f9fe3400f0 Mon Sep 17 00:00:00 2001 From: carter-ktb21 <144170194+carter-ktb21@users.noreply.github.com> Date: Sun, 15 Jun 2025 20:24:48 -0400 Subject: [PATCH 11/21] Worked on create function --- include/d/actor/d_a_e_mf.h | 64 ++++++++- src/d/actor/d_a_e_mf.cpp | 260 ++++++++++++++++++++----------------- 2 files changed, 200 insertions(+), 124 deletions(-) diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index f1355f2134f..ad1e50e3c72 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -1,5 +1,9 @@ #ifndef D_A_E_MF_H #define D_A_E_MF_H +#include "d/d_bg_s_acch.h" +#include "d/d_cc_d.h" +#include "d/d_cc_uty.h" +#include "d/d_jnt_col.h" #include "f_op/f_op_actor_mng.h" /** @@ -10,17 +14,67 @@ * @details * */ -class e_mf_class : public fopEn_enemy_c { +class e_mf_class { +public: /* 80712F20 */ e_mf_class(); -private: - /* 0x5ac */ u8 field_0x5ac[0x10ec - 0x5ac]; + + /* 0x0000 */ fopEn_enemy_c actor; + /* 0x05AC */ request_of_phase_process_class mPhase; + /* 0x05B4 */ u8 field_0x5b4[0x5b6 - 0x5b4]; + /* 0x05B6 */ u8 field_0x5b6; + /* 0x05B7 */ u8 field_0x5b7; + /* 0x05B8 */ u8 field_0x5b8; + /* 0x05B9 */ u8 field_0x5b9; + /* 0x05BA */ u8 field_0x5ba[0x5dc - 0x5ba]; + /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; + /* 0x05E0 */ u8 field_0x5e0[0x5e8 - 0x5e0]; + /* 0x05E8 */ Z2CreatureEnemy mSound; + /* 0x068C */ u8 field_0x68c[0x694 - 0x68c]; + /* 0x0694 */ dJntCol_c field_0x694; + /* 0x06A4 */ u8 field_0x6a4[0x6ac - 0x6a4]; + /* 0x06AC */ u16 field_0x6ac; + /* 0x06AE */ s16 field_0x6ae; + /* 0x06B0 */ u8 field_0x6b0[0x6b8 - 0x6b0]; + /* 0x06B8 */ f32 field_0x6b8; + /* 0x06BC */ u8 field_0x6bc[0x742 - 0x6bc]; + /* 0x0742 */ csXyz field_0x742[11]; + /* 0x0784 */ csXyz field_0x784[11]; + /* 0x07C6 */ u8 field_0x7c6[0x7ee - 0x7c6]; + /* 0x07EE */ csXyz field_0x7ee[4]; + /* 0x0806 */ u8 field_0x806[0x824 - 0x806]; + /* 0x0824 */ dBgS_AcchCir mAcchCir; + /* 0x0864 */ dBgS_ObjAcch mObjAcch; + /* 0x0A3C */ u8 field_0xa3c[0xa40 - 0xa3c]; + /* 0x0A40 */ dCcD_Stts mStts; + /* 0x0A7C */ dCcD_Sph field_0xa7c[3]; + /* 0x0E24 */ dCcD_Sph field_0xe24; + /* 0x0F5C */ dCcD_Sph field_0xf5c; + /* 0x1094 */ dCcU_AtInfo mAtInfo; + /* 0x10B8 */ u8 field_0x10b8; + /* 0x10B9 */ u8 field_0x10b9; + /* 0x10BA */ u8 field_0x10ba[0x10ec - 0x10ba]; }; STATIC_ASSERT(sizeof(e_mf_class) == 0x10ec); -class daE_MF_HIO_c { +class daE_MF_HIO_c : public JORReflexible { +public: /* 8070A70C */ daE_MF_HIO_c(); - /* 80713464 */ ~daE_MF_HIO_c(); + /* 80713464 */ virtual ~daE_MF_HIO_c() {}; + + void genMessage(JORMContext*); + + /* 0x04 */ s8 field_0x4; + /* 0x08 */ f32 field_0x8; + /* 0x0C */ f32 field_0xc; + /* 0x10 */ f32 field_0x10; + /* 0x14 */ f32 field_0x14; + /* 0x18 */ f32 field_0x18; + /* 0x1C */ s16 field_0x1c; + /* 0x1E */ s16 field_0x1e; + /* 0x20 */ s16 field_0x20; + /* 0x22 */ u8 field_0x22; + /* 0x23 */ u8 field_0x23; }; diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 8f087f41ec6..11fe08447a6 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -235,42 +235,6 @@ extern "C" void __register_global_object(); // Declarations: // -/* ############################################################################################## */ -/* 807139A0-807139A4 00002C 0004+00 0/1 0/0 0/0 .rodata @3849 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3849 = 13.0f / 10.0f; -COMPILER_STRIP_GATE(0x807139A0, &lit_3849); -#pragma pop - -/* 807139A4-807139A8 000030 0004+00 0/1 0/0 0/0 .rodata @3850 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3850 = 8.0f; -COMPILER_STRIP_GATE(0x807139A4, &lit_3850); -#pragma pop - -/* 807139A8-807139AC 000034 0004+00 0/1 0/0 0/0 .rodata @3851 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3851 = 28.0f; -COMPILER_STRIP_GATE(0x807139A8, &lit_3851); -#pragma pop - -/* 807139AC-807139B0 000038 0004+00 0/6 0/0 0/0 .rodata @3852 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3852 = 300.0f; -COMPILER_STRIP_GATE(0x807139AC, &lit_3852); -#pragma pop - -/* 807139B0-807139B4 00003C 0004+00 0/1 0/0 0/0 .rodata @3853 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3853 = 350.0f; -COMPILER_STRIP_GATE(0x807139B0, &lit_3853); -#pragma pop - /* 80713B40-80713B6C -00001 002C+00 1/1 0/0 0/0 .data @4569 */ SECTION_DATA static void* lit_4569[11] = { (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x4C), @@ -442,54 +406,6 @@ SECTION_DATA static void* jc_data[36] = { (void*)&jv_offset, }; -/* 80713D74-80713DB4 00026C 0040+00 0/1 0/0 0/0 .data cc_sph_src$7407 */ -#pragma push -#pragma force_active on -static dCcD_SrcSph cc_sph_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fafdbf, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph - } // mSphAttr -}; -#pragma pop - -/* 80713DB4-80713DF4 0002AC 0040+00 0/1 0/0 0/0 .data at_sph_src$7408 */ -#pragma push -#pragma force_active on -static dCcD_SrcSph at_sph_src = { - { - {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0x0, 0x0}, 0x0}}, // mObj - {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 35.0f} // mSph - } // mSphAttr -}; -#pragma pop - -/* 80713DF4-80713E34 0002EC 0040+00 0/1 0/0 0/0 .data tate_sph_src$7409 */ -#pragma push -#pragma force_active on -static dCcD_SrcSph tate_sph_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_STONE, 0x5, 0x0, 0x0, 0x303}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 100.0f} // mSph - } // mSphAttr -}; -#pragma pop - /* 80713E34-80713E54 -00001 0020+00 1/0 0/0 0/0 .data l_daE_MF_Method */ static actor_method_class l_daE_MF_Method = { (process_method_func)daE_MF_Create__FP10fopAc_ac_c, @@ -590,7 +506,17 @@ SECTION_DATA extern void* __vt__12daE_MF_HIO_c[3] = { /* 8070A70C-8070A77C 0000EC 0070+00 1/1 0/0 0/0 .text __ct__12daE_MF_HIO_cFv */ daE_MF_HIO_c::daE_MF_HIO_c() { - // NONMATCHING + field_0x4 = -1; + field_0x8 = 1.3f; + field_0xc = 8.0f; + field_0x10 = 28.0f; + field_0x14 = 300.0f; + field_0x18 = 350.0f; + field_0x1c = 3; + field_0x1e = 40; + field_0x20 = 80; + field_0x22 = 1; + field_0x23 = 0; } /* 8070A77C-8070A82C 00015C 00B0+00 2/2 0/0 0/0 .text mf_disappear__FP10e_mf_class */ @@ -741,13 +667,15 @@ static u8 lit_1010[1 + 3 /* padding */]; /* 80713F64-80713F68 -00001 0004+00 1/2 0/0 0/0 .bss None */ /* 80713F64 0001+00 data_80713F64 @1009 */ /* 80713F65 0003+00 data_80713F65 None */ -static u8 struct_80713F64[4]; +static u8 struct_80713F64; -/* 80713F68-80713F74 000048 000C+00 1/1 0/0 0/0 .bss @3844 */ -static u8 lit_3844[12]; +static u8 data_80713F65; + +// /* 80713F68-80713F74 000048 000C+00 1/1 0/0 0/0 .bss @3844 */ +// static u8 lit_3844[12]; /* 80713F74-80713F98 000054 0024+00 9/10 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[36]; +static daE_MF_HIO_c l_HIO; /* 80713F98-80713FC0 000078 0028+00 2/2 0/0 0/0 .bss target_info */ static u8 target_info[40]; @@ -1481,7 +1409,7 @@ SECTION_DEAD static char const* const stringBase_80713AF9 = "D_MN07"; #pragma pop /* 80713FC4-80713FC8 0000A4 0004+00 1/2 0/0 0/0 .bss c_start */ -static u8 c_start[4]; +static int c_start; /* 80711CB8-80712998 007698 0CE0+00 2/1 0/0 0/0 .text daE_MF_Execute__FP10e_mf_class */ static void daE_MF_Execute(e_mf_class* param_0) { @@ -1499,34 +1427,133 @@ static void daE_MF_Delete(e_mf_class* param_0) { } /* 80712A08-80712BF0 0083E8 01E8+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -static void useHeapInit(fopAc_ac_c* param_0) { +static int useHeapInit(fopAc_ac_c* param_0) { // NONMATCHING } -/* ############################################################################################## */ -/* 80713AEC-80713AF0 000178 0004+00 0/1 0/0 0/0 .rodata @7484 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7484 = 100000.0f; -COMPILER_STRIP_GATE(0x80713AEC, &lit_7484); -#pragma pop - -/* 80713AF0-80713AF4 00017C 0004+00 0/1 0/0 0/0 .rodata @7485 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7485 = 65535.0f; -COMPILER_STRIP_GATE(0x80713AF0, &lit_7485); -#pragma pop - -/* 80713AF4-80713AF4 000180 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80713B00 = "D_MN09"; -#pragma pop - /* 80712BF0-80712F20 0085D0 0330+00 1/0 0/0 0/0 .text daE_MF_Create__FP10fopAc_ac_c */ -static void daE_MF_Create(fopAc_ac_c* param_0) { - // NONMATCHING +static cPhs__Step daE_MF_Create(fopAc_ac_c* a_this) { + // NONMATCHING + e_mf_class* i_this = (e_mf_class*)a_this; + + fopAcM_SetupActor(a_this, e_mf_class); + + cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_mf"); + if (phase == cPhs_COMPLEATE_e) { + int swBit = fopAcM_GetParam(a_this) >> 24; + if (swBit != 0xFF) { + if (dComIfGs_isSwitch(swBit, fopAcM_GetRoomNo(a_this))) { + return cPhs_ERROR_e; + } + } + + OS_REPORT("E_mf PARAM %x\n", fopAcM_GetParam(a_this)); + i_this->field_0x5b6 = fopAcM_GetParam(a_this); + i_this->field_0x5b9 = 1; + i_this->field_0x5b7 = (fopAcM_GetParam(a_this) >> 8) & 15; + i_this->field_0x5b8 = (fopAcM_GetParam(a_this) & 0xF000) >> 12; + + if ((a_this->home.angle.z & 0xFF) == 0 || (a_this->home.angle.z & 0xFF) == 0xFF) { + i_this->field_0x6b8 = 100000.0f; + } else { + i_this->field_0x6b8 = (a_this->home.angle.z & 0xFF) * 100.0f; + } + + OS_REPORT("E_mf AZ %x\n", a_this->home.angle.z); + OS_REPORT("E_mf PR %d\n", i_this->field_0x6b8); + a_this->shape_angle.z = 0; + a_this->current.angle.z = 0; + a_this->home.angle.z = 0; + OS_REPORT("E_mf//////////////E_MF SET 1 !!\n"); + + if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x33E0)) { + OS_REPORT("//////////////E_MF SET NON !!\n"); + return cPhs_ERROR_e; + } + + if (data_80713F65 == 0) { + i_this->field_0x10b9 = 1; + data_80713F65 = 1; + l_HIO.field_0x4 = -1; + } + + fopAcM_OnStatus(a_this, fopAcM_STATUS_UNK_000100); + a_this->attention_info.flags = 4; + fopAcM_SetMtx(a_this, i_this->mpModelMorf->getModel()->getBaseTRMtx()); + fopAcM_SetMin(a_this, -200.0f, -200.0f, -200.0f); + fopAcM_SetMax(a_this, 200.0f, 200.0f, 200.0f); + + i_this->mObjAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, + &i_this->mAcchCir, fopAcM_GetSpeed_p(a_this), NULL, NULL); + i_this->mAcchCir.SetWall(80.0f, 100.0f); + a_this->health = 200; + a_this->field_0x560 = 200; + i_this->mStts.Init(200, 0, a_this); + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fafdbf, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph + } // mSphAttr + }; + for (int i = 0; i <= 2; i++) { + i_this->field_0xa7c[i].Set(cc_sph_src); + i_this->field_0xa7c[i].SetStts(&i_this->mStts); + } + + static dCcD_SrcSph at_sph_src = { + { + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0x0, 0x0}, 0x0}}, // mObj + {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 35.0f} // mSph + } // mSphAttr + }; + i_this->field_0xe24.Set(at_sph_src); + i_this->field_0xe24.SetStts(&i_this->mStts); + + static dCcD_SrcSph tate_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_STONE, 0x5, 0x0, 0x0, 0x303}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 100.0f} // mSph + } // mSphAttr + }; + i_this->field_0xf5c.Set(tate_sph_src); + i_this->field_0xf5c.SetStts(&i_this->mStts); + + i_this->field_0x6ac = (int)cM_rndF(65535.0f) & 0xFF00; + + if (i_this->field_0x5b6 == 0) { + i_this->field_0x6ae = 9; + } + + i_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 3, 1); + i_this->mSound.setEnemyName("E_mf"); + i_this->mAtInfo.mpSound = &i_this->mSound; + + if (strcmp(dComIfGp_getStartStageName(), "D_MN09") == 0) { + fopAcM_OnStatus(a_this, fopAcM_STATUS_UNK_004000); + } + + c_start = 1; + daE_MF_Execute(i_this); + c_start = 0; + } + + return phase; } /* 80712F20-807130FC 008900 01DC+00 1/1 0/0 0/0 .text __ct__10e_mf_classFv */ @@ -1588,11 +1615,6 @@ extern "C" void __dt__10cCcD_GSttsFv() { // NONMATCHING } -/* 80713464-807134AC 008E44 0048+00 2/1 0/0 0/0 .text __dt__12daE_MF_HIO_cFv */ -daE_MF_HIO_c::~daE_MF_HIO_c() { - // NONMATCHING -} - /* 807134AC-807134E8 008E8C 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_mf_cpp */ void __sinit_d_a_e_mf_cpp() { // NONMATCHING From 3d9124db7fa2ca457596b8c6f7e1e0dcabe0f3c4 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:40:39 -0400 Subject: [PATCH 12/21] Worked up to search_bomb --- include/d/actor/d_a_e_mf.h | 93 ++- src/d/actor/d_a_e_mf.cpp | 1179 +++++++++++++++++++----------------- 2 files changed, 707 insertions(+), 565 deletions(-) diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index ad1e50e3c72..9f9b10fe6e8 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -20,28 +20,83 @@ class e_mf_class { /* 0x0000 */ fopEn_enemy_c actor; /* 0x05AC */ request_of_phase_process_class mPhase; - /* 0x05B4 */ u8 field_0x5b4[0x5b6 - 0x5b4]; + /* 0x05B4 */ s16 field_0x5b4; /* 0x05B6 */ u8 field_0x5b6; /* 0x05B7 */ u8 field_0x5b7; /* 0x05B8 */ u8 field_0x5b8; /* 0x05B9 */ u8 field_0x5b9; - /* 0x05BA */ u8 field_0x5ba[0x5dc - 0x5ba]; + /* 0x05BA */ u8 field_0x5ba[0x5d8 - 0x5ba]; + /* 0x05D8 */ s8 field_0x5d8; + /* 0x05D9 */ u8 field_0x5d9[0x5dc - 0x5d9]; /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; - /* 0x05E0 */ u8 field_0x5e0[0x5e8 - 0x5e0]; + /* 0x05E0 */ int field_0x5e0; + /* 0x05E4 */ J3DModel* field_0x5e4; /* 0x05E8 */ Z2CreatureEnemy mSound; - /* 0x068C */ u8 field_0x68c[0x694 - 0x68c]; + /* 0x068C */ J3DModel* field_0x68c; + /* 0x0690 */ u8 field_0x690[0x694 - 0x690]; /* 0x0694 */ dJntCol_c field_0x694; - /* 0x06A4 */ u8 field_0x6a4[0x6ac - 0x6a4]; - /* 0x06AC */ u16 field_0x6ac; + /* 0x06A4 */ s8 field_0x6a4; + /* 0x06A5 */ u8 field_0x6a5[0x6a8 - 0x6a5]; + /* 0x06A8 */ f32 field_0x6a8; + /* 0x06AC */ s16 field_0x6ac; /* 0x06AE */ s16 field_0x6ae; - /* 0x06B0 */ u8 field_0x6b0[0x6b8 - 0x6b0]; + /* 0x06B0 */ f32 field_0x6b0; + /* 0x06B4 */ u8 field_0x6b4[0x6b8 - 0x6b4]; /* 0x06B8 */ f32 field_0x6b8; - /* 0x06BC */ u8 field_0x6bc[0x742 - 0x6bc]; + /* 0x06BC */ u32 mShadowKey; + /* 0x06C0 */ s16 field_0x6c0[4]; + /* 0x06C8 */ s16 field_0x6c8; + /* 0x06CA */ s16 field_0x6ca; + /* 0x06CC */ s16 field_0x6cc; + /* 0x06CE */ s8 field_0x6ce; + /* 0x06CF */ s8 field_0x6cf; + /* 0x06D0 */ s8 field_0x6d0; + /* 0x06D1 */ s8 field_0x6d1; + /* 0x06D2 */ s8 field_0x6d2; + /* 0x06D3 */ u8 field_0x6d3[0x6d6 - 0x6d3]; + /* 0x06D6 */ s16 field_0x6d6; + /* 0x06D8 */ s16 field_0x6d8; + /* 0x06DA */ s16 field_0x6da; + /* 0x06DC */ u8 field_0x6dc[0x6e4 - 0x6dc]; + /* 0x06E4 */ f32 field_0x6e4; + /* 0x06E8 */ u8 field_0x6e8[0x700 - 0x6e8]; + /* 0x0700 */ f32 field_0x700; + /* 0x0704 */ csXyz field_0x704; + /* 0x070A */ csXyz field_0x70a; + /* 0x0710 */ u8 field_0x710[0x717 - 0x710]; + /* 0x0717 */ u8 field_0x717; + /* 0x0718 */ u8 field_0x718[0x728 - 0x718]; + /* 0x0728 */ u8 field_0x728; + /* 0x0729 */ u8 field_0x729[0x742 - 0x729]; /* 0x0742 */ csXyz field_0x742[11]; /* 0x0784 */ csXyz field_0x784[11]; - /* 0x07C6 */ u8 field_0x7c6[0x7ee - 0x7c6]; + /* 0x07C6 */ u8 field_0x7c6[0x7cc - 0x7c6]; + /* 0x07CC */ s16 field_0x7cc; + /* 0x07CE */ s16 field_0x7ce; + /* 0x07D0 */ s16 field_0x7d0; + /* 0x07D2 */ s16 field_0x7d2; + /* 0x07D4 */ s16 field_0x7d4; + /* 0x07D6 */ s16 field_0x7d6; + /* 0x07D8 */ s16 field_0x7d8; + /* 0x07DA */ s16 field_0x7da; + /* 0x07DC */ s16 field_0x7dc; + /* 0x07DE */ s16 field_0x7de; + /* 0x07E0 */ s16 field_0x7e0; + /* 0x07E2 */ u8 field_0x7e2[0x7ea - 0x7e2]; + /* 0x07EA */ s16 field_0x7ea; + /* 0x07EC */ u8 field_0x7ec[2]; /* 0x07EE */ csXyz field_0x7ee[4]; - /* 0x0806 */ u8 field_0x806[0x824 - 0x806]; + /* 0x0806 */ s16 field_0x806; + /* 0x0808 */ s16 field_0x808; + /* 0x080A */ u8 field_0x80a[0x80e - 0x80a]; + /* 0x080E */ s8 field_0x80e; + /* 0x080F */ u8 field_0x80f[0x810 - 0x80f]; + /* 0x0810 */ s16 field_0x810; + /* 0x0812 */ s16 field_0x812; + /* 0x0814 */ u8 field_0x814[0x81c - 0x814]; + /* 0x081C */ f32 field_0x81c; + /* 0x0820 */ s16 field_0x820; + /* 0x0822 */ s16 field_0x822; /* 0x0824 */ dBgS_AcchCir mAcchCir; /* 0x0864 */ dBgS_ObjAcch mObjAcch; /* 0x0A3C */ u8 field_0xa3c[0xa40 - 0xa3c]; @@ -65,16 +120,16 @@ class daE_MF_HIO_c : public JORReflexible { void genMessage(JORMContext*); /* 0x04 */ s8 field_0x4; - /* 0x08 */ f32 field_0x8; - /* 0x0C */ f32 field_0xc; - /* 0x10 */ f32 field_0x10; - /* 0x14 */ f32 field_0x14; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ s16 field_0x1c; - /* 0x1E */ s16 field_0x1e; - /* 0x20 */ s16 field_0x20; + /* 0x08 */ f32 base_size; // 基本サイズ + /* 0x0C */ f32 movement_speed; // 移動速度 + /* 0x10 */ f32 dash_speed; // 突進速度 + /* 0x14 */ f32 battle_init_range; // 戦闘開始範囲 + /* 0x18 */ f32 attack_init_range; // 攻撃開始範囲 + /* 0x1C */ s16 field_0x1c; // 防御静止間 + /* 0x1E */ s16 field_0x1e; // 魂抜間 弱 + /* 0x20 */ s16 field_0x20; // 魂抜間 強 /* 0x22 */ u8 field_0x22; - /* 0x23 */ u8 field_0x23; + /* 0x23 */ u8 invulnerable; // 不死身 }; diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 11fe08447a6..45273c07598 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -6,10 +6,11 @@ #include "d/actor/d_a_e_mf.h" #include "d/d_cc_d.h" #include "dol2asm.h" -UNK_REL_DATA; +#include "Z2AudioLib/Z2Instances.h" #include "f_op/f_op_actor_enemy.h" +#include "d/d_bomb.h" - +UNK_REL_DATA; // // Forward References: // @@ -390,47 +391,16 @@ SECTION_DATA static void* lit_6893[26] = { }; /* 80713CD8-80713CE4 0001D0 000C+00 1/0 0/0 0/0 .data jv_offset */ -SECTION_DATA static u8 jv_offset[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; +static Vec jv_offset = { 0.0f, 0.0f, 0.0f }; /* 80713CE4-80713D74 -00001 0090+00 1/1 0/0 0/0 .data jc_data */ -SECTION_DATA static void* jc_data[36] = { - (void*)0x00010002, (void*)0x42200000, (void*)&jv_offset, (void*)0x00010003, (void*)0x41F00000, - (void*)&jv_offset, (void*)0x00010016, (void*)0x42200000, (void*)&jv_offset, (void*)0x0001000B, - (void*)0x41700000, (void*)&jv_offset, (void*)0x0001000C, (void*)0x41200000, (void*)&jv_offset, - (void*)0x00010011, (void*)0x41700000, (void*)&jv_offset, (void*)0x00010012, (void*)0x41200000, - (void*)&jv_offset, (void*)0x00010017, (void*)0x41A00000, (void*)&jv_offset, (void*)0x00010018, - (void*)0x41700000, (void*)&jv_offset, (void*)0x0001001B, (void*)0x41A00000, (void*)&jv_offset, - (void*)0x0001001C, (void*)0x41700000, (void*)&jv_offset, (void*)0x00010020, (void*)0x41A00000, - (void*)&jv_offset, -}; - -/* 80713E34-80713E54 -00001 0020+00 1/0 0/0 0/0 .data l_daE_MF_Method */ -static actor_method_class l_daE_MF_Method = { - (process_method_func)daE_MF_Create__FP10fopAc_ac_c, - (process_method_func)daE_MF_Delete__FP10e_mf_class, - (process_method_func)daE_MF_Execute__FP10e_mf_class, - (process_method_func)daE_MF_IsDelete__FP10e_mf_class, - (process_method_func)daE_MF_Draw__FP10e_mf_class, -}; - -/* 80713E54-80713E84 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_MF */ -extern actor_process_profile_definition g_profile_E_MF = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_E_MF, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(e_mf_class), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 120, // mPriority - &l_daE_MF_Method, // sub_method - 0x00040000, // mStatus - fopAc_ENEMY_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType +static dJntColData_c jc_data[12] = { + {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, + {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, + {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, + {0, 1, 18, 10.0f, &jv_offset}, {0, 1, 23, 20.0f, &jv_offset}, + {0, 1, 24, 15.0f, &jv_offset}, {0, 1, 27, 20.0f, &jv_offset}, + {0, 1, 28, 15.0f, &jv_offset}, {0, 1, 32, 20.0f, &jv_offset}, }; /* 80713E84-80713E90 00037C 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */ @@ -507,162 +477,212 @@ SECTION_DATA extern void* __vt__12daE_MF_HIO_c[3] = { /* 8070A70C-8070A77C 0000EC 0070+00 1/1 0/0 0/0 .text __ct__12daE_MF_HIO_cFv */ daE_MF_HIO_c::daE_MF_HIO_c() { field_0x4 = -1; - field_0x8 = 1.3f; - field_0xc = 8.0f; - field_0x10 = 28.0f; - field_0x14 = 300.0f; - field_0x18 = 350.0f; + base_size = 1.3f; + movement_speed = 8.0f; + dash_speed = 28.0f; + battle_init_range = 300.0f; + attack_init_range = 350.0f; field_0x1c = 3; field_0x1e = 40; field_0x20 = 80; field_0x22 = 1; - field_0x23 = 0; + invulnerable = 0; } /* 8070A77C-8070A82C 00015C 00B0+00 2/2 0/0 0/0 .text mf_disappear__FP10e_mf_class */ -static void mf_disappear(e_mf_class* param_0) { - // NONMATCHING -} +static void mf_disappear(e_mf_class* i_this) { + fopEn_enemy_c* a_this = &i_this->actor; + cXyz sp1c, sp28; -/* ############################################################################################## */ -/* 807139B4-807139B8 000040 0004+00 1/4 0/0 0/0 .rodata @3893 */ -SECTION_RODATA static f32 const lit_3893 = -1.0f; -COMPILER_STRIP_GATE(0x807139B4, &lit_3893); + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp1c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp1c, &sp28); -/* 80713AF4-80713AF4 000180 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80713AF4 = "E_mf"; -#pragma pop + fopAcM_createDisappear(a_this, &sp28, 13, 0, 36); + fopAcM_delete(a_this); -/* 8070A82C-8070A8D8 00020C 00AC+00 16/16 0/0 0/0 .text anm_init__FP10e_mf_classifUcf */ -static void anm_init(e_mf_class* param_0, int param_1, f32 param_2, u8 param_3, f32 param_4) { - // NONMATCHING + int swBit = fopAcM_GetParam(a_this) >> 24; + if (swBit != 0xFF) { + dComIfGs_onSwitch(swBit, fopAcM_GetRoomNo(a_this)); + } } -/* 8070A8D8-8070AD94 0002B8 04BC+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ -static void nodeCallBack(J3DJoint* param_0, int param_1) { - // NONMATCHING +/* 8070A82C-8070A8D8 00020C 00AC+00 16/16 0/0 0/0 .text anm_init__FP10e_mf_classifUcf */ +static void anm_init(e_mf_class* i_this, int param_2, f32 i_morf, u8 i_attr, f32 i_rate) { + i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_mf", param_2), i_attr, i_morf, + i_rate, 0.0f, -1.0f); + i_this->field_0x5e0 = param_2; } -/* ############################################################################################## */ -/* 807139B8-807139BC 000044 0004+00 0/11 0/0 0/0 .rodata @4120 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4120 = 50.0f; -COMPILER_STRIP_GATE(0x807139B8, &lit_4120); -#pragma pop +/* 8070A8D8-8070AD94 0002B8 04BC+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ +static int nodeCallBack(J3DJoint* i_joint, int param_2) { + if (param_2 == 0) { + int jointNo = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + e_mf_class* i_this = (e_mf_class*)model->getUserArea(); + if (i_this != NULL) { + MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); + + if (jointNo != 0) { + if (jointNo == 22) { + cMtx_YrotM(*calc_mtx, i_this->field_0x812); + cMtx_ZrotM(*calc_mtx, i_this->field_0x7d0 + (i_this->field_0x810 - i_this->field_0x742[2].x)); + } else if (jointNo == 23) { + cMtx_YrotM(*calc_mtx, i_this->field_0x7da); + } else if (jointNo == 24) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x7dc); + } else if (jointNo == 27) { + cMtx_YrotM(*calc_mtx, i_this->field_0x7de); + } else if (jointNo == 28) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x7e0); + } else if (jointNo == 2) { + cMtx_YrotM(*calc_mtx, (i_this->field_0x6da / 2) + (i_this->field_0x742[1].y + - i_this->field_0x6d6)); + cMtx_ZrotM(*calc_mtx, i_this->field_0x742[1].x + i_this->field_0x7ce); + } else if (jointNo == 3 || jointNo == 4) { + cMtx_YrotM(*calc_mtx, i_this->field_0x742[0].y + (i_this->field_0x6da - i_this->field_0x6d6)); + cMtx_ZrotM(*calc_mtx, i_this->field_0x7cc + (i_this->field_0x742[0].x - i_this->field_0x6d8)); + } else if (jointNo == 11) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x742[3].y + i_this->field_0x7d2); + } else if (jointNo == 12) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x742[4].y + i_this->field_0x7d4); + } else if (jointNo == 17) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x742[5].y + i_this->field_0x7d6); + } else if (jointNo == 18) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x742[6].y + i_this->field_0x7d8); + } else if (jointNo >= 31 && jointNo <= 34) { + cMtx_YrotM(*calc_mtx, i_this->field_0x742[jointNo - 2].x + i_this->field_0x806); + cMtx_ZrotM(*calc_mtx, i_this->field_0x742[jointNo - 3].z); + } + } -/* 807139BC-807139C0 000048 0004+00 0/1 0/0 0/0 .rodata @4121 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4121 = 1150.0f; -COMPILER_STRIP_GATE(0x807139BC, &lit_4121); -#pragma pop + if (i_this->field_0x7ea != 0) { + if ((jointNo & 1) != 0) { + cMtx_YrotM(*calc_mtx, i_this->field_0x7ea); + } else if ((jointNo & 2) != 0) { + cMtx_XrotM(*calc_mtx, i_this->field_0x7ea); + } else if ((jointNo & 4) != 0) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x7ea); + } + } -/* 8070AD94-8070B03C 000774 02A8+00 1/0 0/0 0/0 .text daE_MF_Draw__FP10e_mf_class */ -static void daE_MF_Draw(e_mf_class* param_0) { - // NONMATCHING -} + model->setAnmMtx(jointNo, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + if (jointNo == 0) { + MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); + cMtx_YrotM(*calc_mtx, 0); + cMtx_XrotM(*calc_mtx, 0); + cMtx_ZrotM(*calc_mtx, 0); + model->setAnmMtx(jointNo, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } -/* 8070B03C-8070B114 000A1C 00D8+00 2/2 0/0 0/0 .text other_bg_check__FP10e_mf_classP10fopAc_ac_c - */ -static void other_bg_check(e_mf_class* param_0, fopAc_ac_c* param_1) { - // NONMATCHING -} + if (jointNo == 0) { + MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); + cMtx_YrotM(*calc_mtx, 0); + cMtx_XrotM(*calc_mtx, 0); + cMtx_ZrotM(*calc_mtx, 0); + model->setAnmMtx(jointNo, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } -/* 8070B114-8070B1EC 000AF4 00D8+00 1/1 0/0 0/0 .text other_bg_check2__FP10e_mf_classP4cXyz */ -static void other_bg_check2(e_mf_class* param_0, cXyz* param_1) { - // NONMATCHING + return 1; } -/* ############################################################################################## */ -/* 80713F28-80713F2C 000008 0001+03 1/1 0/0 0/0 .bss @1109 */ -static u8 lit_1109[1 + 3 /* padding */]; - -/* 80713F2C-80713F30 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ -#pragma push -#pragma force_active on -static u8 lit_1107[1 + 3 /* padding */]; -#pragma pop +/* 8070AD94-8070B03C 000774 02A8+00 1/0 0/0 0/0 .text daE_MF_Draw__FP10e_mf_class */ +static int daE_MF_Draw(e_mf_class* i_this) { + fopEn_enemy_c* a_this = &i_this->actor; -/* 80713F30-80713F34 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ -#pragma push -#pragma force_active on -static u8 lit_1105[1 + 3 /* padding */]; -#pragma pop + if (i_this->field_0x728 != 0) { + return 1; + } -/* 80713F34-80713F38 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ -#pragma push -#pragma force_active on -static u8 lit_1104[1 + 3 /* padding */]; -#pragma pop + J3DModel* model = i_this->mpModelMorf->getModel(); + g_env_light.settingTevStruct(0, &a_this->current.pos, &a_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model, &a_this->tevStr); + + J3DModelData* modelData; + J3DMaterial* matNode_p; + if (i_this->field_0x6a4 != 0) { + modelData = model->getModelData(); + for (u16 i = 0; i < modelData->getMaterialNum(); i++) { + matNode_p = modelData->getMaterialNodePointer(i); + matNode_p->getTevColor(0)->r = i_this->field_0x6a8; + matNode_p->getTevColor(0)->g = i_this->field_0x6a8; + matNode_p->getTevColor(0)->b = i_this->field_0x6a8; + } + } -/* 80713F38-80713F3C 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ -#pragma push -#pragma force_active on -static u8 lit_1099[1 + 3 /* padding */]; -#pragma pop + i_this->mpModelMorf->entryDL(); -/* 80713F3C-80713F40 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ -#pragma push -#pragma force_active on -static u8 lit_1097[1 + 3 /* padding */]; -#pragma pop + if (i_this->field_0x6a4 != 0) { + modelData = model->getModelData(); + for (u16 i = 0; i < modelData->getMaterialNum(); i++) { + matNode_p = modelData->getMaterialNodePointer(i); + matNode_p->getTevColor(0)->r = 0; + matNode_p->getTevColor(0)->g = 0; + matNode_p->getTevColor(0)->b = 0; + } + } -/* 80713F40-80713F44 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ -#pragma push -#pragma force_active on -static u8 lit_1095[1 + 3 /* padding */]; -#pragma pop + g_env_light.setLightTevColorType_MAJI(i_this->field_0x5e4, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->field_0x5e4); + g_env_light.setLightTevColorType_MAJI(i_this->field_0x68c, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->field_0x68c); + + cXyz sp50; + sp50.set(a_this->current.pos.x, a_this->current.pos.y + 50.0f, a_this->current.pos.z); + i_this->mShadowKey = dComIfGd_setShadow(i_this->mShadowKey, 1, model, &sp50, 1150.0f, 0.0f, + a_this->current.pos.y, i_this->mObjAcch.GetGroundH(), + i_this->mObjAcch.m_gnd, &a_this->tevStr, 0, 1.0f, + dDlst_shadowControl_c::getSimpleTex()); + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x5e4); + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x68c); + + return 1; +} + +/* 8070B03C-8070B114 000A1C 00D8+00 2/2 0/0 0/0 .text other_bg_check__FP10e_mf_classP10fopAc_ac_c */ +static BOOL other_bg_check(e_mf_class* i_this, fopAc_ac_c* i_actor) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_LinChk lin_chk; + cXyz start, end; + + end = i_actor->current.pos; + end.y += 100.0f; + start = a_this->current.pos; + start.y = a_this->eyePos.y; + lin_chk.Set(&start, &end, a_this); + + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + return TRUE; + } -/* 80713F44-80713F48 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ -#pragma push -#pragma force_active on -static u8 lit_1094[1 + 3 /* padding */]; -#pragma pop + return FALSE; +} -/* 80713F48-80713F4C 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ -#pragma push -#pragma force_active on -static u8 lit_1057[1 + 3 /* padding */]; -#pragma pop +/* 8070B114-8070B1EC 000AF4 00D8+00 1/1 0/0 0/0 .text other_bg_check2__FP10e_mf_classP4cXyz */ +static BOOL other_bg_check2(e_mf_class* i_this, cXyz* param_2) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_LinChk lin_chk; + cXyz start, end; -/* 80713F4C-80713F50 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ -#pragma push -#pragma force_active on -static u8 lit_1055[1 + 3 /* padding */]; -#pragma pop + end = *param_2; + end.y += 100.0f; + start = a_this->current.pos; + start.y = a_this->eyePos.y; -/* 80713F50-80713F54 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ -#pragma push -#pragma force_active on -static u8 lit_1053[1 + 3 /* padding */]; -#pragma pop + lin_chk.Set(&start, &end, a_this); -/* 80713F54-80713F58 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ -#pragma push -#pragma force_active on -static u8 lit_1052[1 + 3 /* padding */]; -#pragma pop - -/* 80713F58-80713F5C 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ -#pragma push -#pragma force_active on -static u8 lit_1014[1 + 3 /* padding */]; -#pragma pop + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + return TRUE; + } -/* 80713F5C-80713F60 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ -#pragma push -#pragma force_active on -static u8 lit_1012[1 + 3 /* padding */]; -#pragma pop + return FALSE; +} -/* 80713F60-80713F64 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ -#pragma push -#pragma force_active on -static u8 lit_1010[1 + 3 /* padding */]; -#pragma pop +UNK_REL_BSS; /* 80713F64-80713F68 -00001 0004+00 1/2 0/0 0/0 .bss None */ /* 80713F64 0001+00 data_80713F64 @1009 */ @@ -671,80 +691,111 @@ static u8 struct_80713F64; static u8 data_80713F65; -// /* 80713F68-80713F74 000048 000C+00 1/1 0/0 0/0 .bss @3844 */ -// static u8 lit_3844[12]; - /* 80713F74-80713F98 000054 0024+00 9/10 0/0 0/0 .bss l_HIO */ static daE_MF_HIO_c l_HIO; /* 80713F98-80713FC0 000078 0028+00 2/2 0/0 0/0 .bss target_info */ -static u8 target_info[40]; +static fopAc_ac_c* target_info[10]; /* 80713FC0-80713FC4 0000A0 0004+00 2/2 0/0 0/0 .bss target_info_count */ -static u8 target_info_count[4]; +static int target_info_count; /* 8070B1EC-8070B268 000BCC 007C+00 1/1 0/0 0/0 .text s_b_sub__FPvPv */ -static void s_b_sub(void* param_0, void* param_1) { - // NONMATCHING -} +static void* s_b_sub(void* i_actor, void* i_data) { + if (fopAcM_IsActor(i_actor) && dBomb_c::checkBombActor((fopAc_ac_c*)i_actor) && !((dBomb_c*)i_actor)->checkStateExplode() && target_info_count < 10) { + target_info[target_info_count] = (fopAc_ac_c*)i_actor; + target_info_count++; + } -/* ############################################################################################## */ -/* 807139C0-807139C4 00004C 0004+00 0/5 0/0 0/0 .rodata @4346 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4346 = 30.0f; -COMPILER_STRIP_GATE(0x807139C0, &lit_4346); -#pragma pop + return NULL; +} -/* 807139C4-807139C8 000050 0004+00 0/1 0/0 0/0 .rodata @4347 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4347 = 500.0f; -COMPILER_STRIP_GATE(0x807139C4, &lit_4347); -#pragma pop +/* 8070B268-8070B6E0 000C48 0478+00 2/2 0/0 0/0 .text search_bomb__FP10e_mf_classi */ +static dBomb_c* search_bomb(e_mf_class* i_this, BOOL param_2) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + target_info_count = 0; + for (int i = 0; i < 10; i++) { + target_info[i] = NULL; + } -/* 807139C8-807139CC 000054 0004+00 0/1 0/0 0/0 .rodata @4348 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4348 = -125.0f; -COMPILER_STRIP_GATE(0x807139C8, &lit_4348); -#pragma pop + fpcM_Search(s_b_sub, i_this); + + f32 threshold = 50.0f; + if (target_info_count != 0) { + cXyz sp44, sp50, sp5c; + for (int i = 0; i < target_info_count;) { + dBomb_c* bomb = (dBomb_c*)target_info[i]; + sp44.x = bomb->current.pos.x - a_this->eyePos.x; + sp44.y = 50.0f + bomb->current.pos.y - a_this->eyePos.y; + sp44.z = bomb->current.pos.z - a_this->eyePos.z; + sp50.x = bomb->current.pos.x - a_this->current.pos.x; + sp50.y = bomb->current.pos.y - a_this->current.pos.y; + sp50.z = bomb->current.pos.z - a_this->current.pos.z; + + if (sp44.abs() < threshold && !(sp50.abs() > i_this->field_0x6b0 + 30.0f) && (!other_bg_check(i_this, bomb) || !param_2)) { + if (param_2) { + if (fabsf(50.0f + bomb->current.pos.y - a_this->eyePos.y) <= 300.0f) { + s16 sVar1 = a_this->shape_angle.y - cM_atan2s(sp44.x, sp44.z); + if (sVar1 < 0) { + sVar1 = -1 * sVar1; + } + + if ((u16)sVar1 < 20000) { + return bomb; + } + + cMtx_YrotS(*calc_mtx, -a_this->shape_angle.y); + MtxPosition(&sp44, &sp5c); + + if (fabsf(sp5c.x) < 500.0f && fabsf(sp5c.y) < 300.0f && sp5c.z > -125.0f && sp5c.z < 500.0f) { + return bomb; + } + } + } else { + return bomb; + } + } -/* 807139CC-807139D0 000058 0004+00 0/1 0/0 0/0 .rodata @4349 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4349 = 1500.0f; -COMPILER_STRIP_GATE(0x807139CC, &lit_4349); -#pragma pop + i++; + if (i == target_info_count) { + i = 0; + threshold += 50.0f; + if (threshold > 1500.0f) { + return NULL; + } + } + } + } else { + return NULL; + } -/* 8070B268-8070B6E0 000C48 0478+00 2/2 0/0 0/0 .text search_bomb__FP10e_mf_classi */ -static void search_bomb(e_mf_class* param_0, int param_1) { - // NONMATCHING + return NULL; } /* 8070B6E0-8070B704 0010C0 0024+00 4/4 0/0 0/0 .text bomb_view_check__FP10e_mf_class */ -static void bomb_view_check(e_mf_class* param_0) { +static void bomb_view_check(e_mf_class* i_this) { // NONMATCHING } /* 8070B704-8070B728 0010E4 0024+00 1/1 0/0 0/0 .text bomb_check__FP10e_mf_class */ -static void bomb_check(e_mf_class* param_0) { +static void bomb_check(e_mf_class* i_this) { // NONMATCHING } /* 8070B728-8070B76C 001108 0044+00 1/1 0/0 0/0 .text player_way_check__FP10e_mf_class */ -static void player_way_check(e_mf_class* param_0) { +static void player_way_check(e_mf_class* i_this) { // NONMATCHING } /* 8070B76C-8070B848 00114C 00DC+00 4/4 0/0 0/0 .text pl_check__FP10e_mf_classfs */ -static void pl_check(e_mf_class* param_0, f32 param_1, s16 param_2) { +static void pl_check(e_mf_class* i_this, f32 param_1, s16 param_2) { // NONMATCHING } /* 8070B848-8070B950 001228 0108+00 3/3 0/0 0/0 .text move_gake_check__FP10e_mf_classfSc */ -static void move_gake_check(e_mf_class* param_0, f32 param_1, s8 param_2) { +static void move_gake_check(e_mf_class* i_this, f32 param_1, s8 param_2) { // NONMATCHING } @@ -757,7 +808,7 @@ COMPILER_STRIP_GATE(0x807139D0, &lit_4459); #pragma pop /* 8070B950-8070BB10 001330 01C0+00 1/1 0/0 0/0 .text jump_pos_check__FP10e_mf_classP4cXyz */ -static void jump_pos_check(e_mf_class* param_0, cXyz* param_1) { +static void jump_pos_check(e_mf_class* i_this, cXyz* param_1) { // NONMATCHING } @@ -791,7 +842,7 @@ COMPILER_STRIP_GATE(0x807139E0, &lit_4562); #pragma pop /* 8070BB10-8070BF94 0014F0 0484+00 2/1 0/0 0/0 .text e_mf_stay__FP10e_mf_class */ -static void e_mf_stay(e_mf_class* param_0) { +static void e_mf_stay(e_mf_class* i_this) { // NONMATCHING } @@ -869,12 +920,12 @@ COMPILER_STRIP_GATE(0x80713A0C, &lit_4636); #pragma pop /* 8070BF94-8070C2C4 001974 0330+00 1/1 0/0 0/0 .text e_mf_otoreac__FP10e_mf_class */ -static void e_mf_otoreac(e_mf_class* param_0) { +static void e_mf_otoreac(e_mf_class* i_this) { // NONMATCHING } /* 8070C2C4-8070C7C4 001CA4 0500+00 2/1 0/0 0/0 .text e_mf_bomb_action__FP10e_mf_class */ -static void e_mf_bomb_action(e_mf_class* param_0) { +static void e_mf_bomb_action(e_mf_class* i_this) { // NONMATCHING } @@ -922,7 +973,7 @@ COMPILER_STRIP_GATE(0x80713A24, &lit_4806); #pragma pop /* 8070C7C4-8070CB1C 0021A4 0358+00 1/1 0/0 0/0 .text e_mf_normal__FP10e_mf_class */ -static void e_mf_normal(e_mf_class* param_0) { +static void e_mf_normal(e_mf_class* i_this) { // NONMATCHING } @@ -935,7 +986,7 @@ COMPILER_STRIP_GATE(0x80713A28, &lit_4834); #pragma pop /* 8070CB1C-8070CCB8 0024FC 019C+00 1/1 0/0 0/0 .text e_mf_drawback__FP10e_mf_class */ -static void e_mf_drawback(e_mf_class* param_0) { +static void e_mf_drawback(e_mf_class* i_this) { // NONMATCHING } @@ -952,12 +1003,12 @@ SECTION_RODATA static f32 const lit_4900 = 150.0f; COMPILER_STRIP_GATE(0x80713A30, &lit_4900); /* 8070CCB8-8070D090 002698 03D8+00 1/1 0/0 0/0 .text e_mf_wolfbite__FP10e_mf_class */ -static void e_mf_wolfbite(e_mf_class* param_0) { +static void e_mf_wolfbite(e_mf_class* i_this) { // NONMATCHING } /* 8070D090-8070D0D0 002A70 0040+00 1/1 0/0 0/0 .text way_check__FP10e_mf_class */ -static void way_check(e_mf_class* param_0) { +static void way_check(e_mf_class* i_this) { // NONMATCHING } @@ -1011,12 +1062,12 @@ COMPILER_STRIP_GATE(0x80713A48, &lit_5156); #pragma pop /* 8070D2C8-8070DBB4 002CA8 08EC+00 1/1 0/0 0/0 .text e_mf_fight_run__FP10e_mf_class */ -static void e_mf_fight_run(e_mf_class* param_0) { +static void e_mf_fight_run(e_mf_class* i_this) { // NONMATCHING } /* 8070DBB4-8070DDDC 003594 0228+00 1/1 0/0 0/0 .text e_mf_jump__FP10e_mf_class */ -static void e_mf_jump(e_mf_class* param_0) { +static void e_mf_jump(e_mf_class* i_this) { // NONMATCHING } @@ -1036,12 +1087,12 @@ COMPILER_STRIP_GATE(0x80713A50, &lit_5311); #pragma pop /* 8070DDDC-8070E30C 0037BC 0530+00 1/1 0/0 0/0 .text e_mf_gakejump__FP10e_mf_class */ -static void e_mf_gakejump(e_mf_class* param_0) { +static void e_mf_gakejump(e_mf_class* i_this) { // NONMATCHING } /* 8070E30C-8070E36C 003CEC 0060+00 2/2 0/0 0/0 .text at_hit_check__FP10e_mf_class */ -static void at_hit_check(e_mf_class* param_0) { +static void at_hit_check(e_mf_class* i_this) { // NONMATCHING } @@ -1065,12 +1116,12 @@ SECTION_RODATA static f32 const lit_5391 = 25.0f; COMPILER_STRIP_GATE(0x80713A5C, &lit_5391); /* 8070E36C-8070E5E0 003D4C 0274+00 1/1 0/0 0/0 .text e_mf_attack__FP10e_mf_class */ -static void e_mf_attack(e_mf_class* param_0) { +static void e_mf_attack(e_mf_class* i_this) { // NONMATCHING } /* 8070E5E0-8070E760 003FC0 0180+00 1/1 0/0 0/0 .text tail_eff_set__FP10e_mf_class */ -static void tail_eff_set(e_mf_class* param_0) { +static void tail_eff_set(e_mf_class* i_this) { // NONMATCHING } @@ -1090,7 +1141,7 @@ COMPILER_STRIP_GATE(0x80713A64, &lit_5510); #pragma pop /* 8070E760-8070EA10 004140 02B0+00 1/1 0/0 0/0 .text e_mf_tail_attack__FP10e_mf_class */ -static void e_mf_tail_attack(e_mf_class* param_0) { +static void e_mf_tail_attack(e_mf_class* i_this) { // NONMATCHING } @@ -1103,12 +1154,12 @@ COMPILER_STRIP_GATE(0x80713A68, &lit_5566); #pragma pop /* 8070EA10-8070EC60 0043F0 0250+00 2/1 0/0 0/0 .text e_mf_guard__FP10e_mf_class */ -static void e_mf_guard(e_mf_class* param_0) { +static void e_mf_guard(e_mf_class* i_this) { // NONMATCHING } /* 8070EC60-8070ED10 004640 00B0+00 1/1 0/0 0/0 .text e_mf_s_damage__FP10e_mf_class */ -static void e_mf_s_damage(e_mf_class* param_0) { +static void e_mf_s_damage(e_mf_class* i_this) { // NONMATCHING } @@ -1128,12 +1179,12 @@ COMPILER_STRIP_GATE(0x80713A70, &lit_5616); #pragma pop /* 8070ED10-8070EEC4 0046F0 01B4+00 1/1 0/0 0/0 .text kado_check__FP10e_mf_class */ -static void kado_check(e_mf_class* param_0) { +static void kado_check(e_mf_class* i_this) { // NONMATCHING } /* 8070EEC4-8070F014 0048A4 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_mf_class */ -static void body_gake(e_mf_class* param_0) { +static void body_gake(e_mf_class* i_this) { // NONMATCHING } @@ -1152,7 +1203,7 @@ COMPILER_STRIP_GATE(0x80713A74, &lit_6006); #pragma pop /* 8070F08C-8070FBEC 004A6C 0B60+00 2/1 0/0 0/0 .text e_mf_damage__FP10e_mf_class */ -static void e_mf_damage(e_mf_class* param_0) { +static void e_mf_damage(e_mf_class* i_this) { // NONMATCHING } @@ -1193,17 +1244,17 @@ COMPILER_STRIP_GATE(0x80713A88, &lit_6034); #pragma pop /* 8070FBEC-8070FD40 0055CC 0154+00 1/1 0/0 0/0 .text e_mf_backdrop__FP10e_mf_class */ -static void e_mf_backdrop(e_mf_class* param_0) { +static void e_mf_backdrop(e_mf_class* i_this) { // NONMATCHING } /* 8070FD40-8070FEE0 005720 01A0+00 1/1 0/0 0/0 .text e_mf_water__FP10e_mf_class */ -static void e_mf_water(e_mf_class* param_0) { +static void e_mf_water(e_mf_class* i_this) { // NONMATCHING } /* 8070FEE0-8070FF98 0058C0 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_mf_class */ -static void wolfkick_damage(e_mf_class* param_0) { +static void wolfkick_damage(e_mf_class* i_this) { // NONMATCHING } @@ -1230,205 +1281,384 @@ COMPILER_STRIP_GATE(0x80713A94, &lit_6089); #pragma pop /* 8070FF98-807100A8 005978 0110+00 1/1 0/0 0/0 .text big_damage__FP10e_mf_class */ -static void big_damage(e_mf_class* param_0) { +static void big_damage(e_mf_class* i_this) { // NONMATCHING } /* 807100A8-80710158 005A88 00B0+00 1/1 0/0 0/0 .text small_damage__FP10e_mf_class */ -static void small_damage(e_mf_class* param_0) { +static void small_damage(e_mf_class* i_this) { // NONMATCHING } /* 80710158-807104EC 005B38 0394+00 1/1 0/0 0/0 .text damage_check__FP10e_mf_class */ -static void damage_check(e_mf_class* param_0) { +static void damage_check(e_mf_class* i_this) { // NONMATCHING } /* 807104EC-807119BC 005ECC 14D0+00 2/1 0/0 0/0 .text action__FP10e_mf_class */ -static void action(e_mf_class* param_0) { +static void action(e_mf_class* i_this) { // NONMATCHING } /* 807119BC-80711CB8 00739C 02FC+00 1/1 0/0 0/0 .text anm_se_set__FP10e_mf_class */ -static void anm_se_set(e_mf_class* param_0) { +static void anm_se_set(e_mf_class* i_this) { // NONMATCHING } -/* ############################################################################################## */ -/* 80713A98-80713A9C 000124 0004+00 0/0 0/0 0/0 .rodata @6886 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6886 = 3.0f / 10.0f; -COMPILER_STRIP_GATE(0x80713A98, &lit_6886); -#pragma pop +/* 80713FC4-80713FC8 0000A4 0004+00 1/2 0/0 0/0 .bss c_start */ +static int c_start; -/* 80713A9C-80713AA0 000128 0004+00 0/0 0/0 0/0 .rodata @6887 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6887 = -4.0f; -COMPILER_STRIP_GATE(0x80713A9C, &lit_6887); -#pragma pop +/* 80711CB8-80712998 007698 0CE0+00 2/1 0/0 0/0 .text daE_MF_Execute__FP10e_mf_class */ +static int daE_MF_Execute(e_mf_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = &i_this->actor; + + if (i_this->field_0x728 != 0) { + return 1; + } -/* 80713AA0-80713AA4 00012C 0004+00 0/0 0/0 0/0 .rodata @6888 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6888 = 7.0f; -COMPILER_STRIP_GATE(0x80713AA0, &lit_6888); -#pragma pop + if (c_start == 0 && dComIfGp_event_runCheck() && + (fopAcM_getTalkEventPartner((fopAc_ac_c*)daPy_getLinkPlayerActorClass()) == daPy_py_c::getMidnaActor() || daPy_getPlayerActorClass()->eventInfo.checkCommandDoor())) { + return 1; + } -/* 80713AA4-80713AA8 000130 0004+00 0/0 0/0 0/0 .rodata @6889 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6889 = 2500.0f; -COMPILER_STRIP_GATE(0x80713AA4, &lit_6889); -#pragma pop + cXyz sp2c; + cXyz sp38; + cXyz sp44; + i_this->field_0x6ac++; + for (int i = 0; i < 4; i++) { + if (i_this->field_0x6c0[i] != 0) { + i_this->field_0x6c0[i]--; + } + } -/* 80713AA8-80713AAC 000134 0004+00 0/0 0/0 0/0 .rodata @6890 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6890 = 15000.0f; -COMPILER_STRIP_GATE(0x80713AA8, &lit_6890); -#pragma pop + if (i_this->field_0x6c8 != 0) { + i_this->field_0x6c8--; + } -/* 80713AAC-80713AB0 000138 0004+00 0/0 0/0 0/0 .rodata @6891 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6891 = 12000.0f; -COMPILER_STRIP_GATE(0x80713AAC, &lit_6891); -#pragma pop + if (i_this->field_0x6cc != 0) { + i_this->field_0x6cc--; + } -/* 80713AB0-80713AB4 00013C 0004+00 0/0 0/0 0/0 .rodata @6892 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6892 = -1000000000.0f; -COMPILER_STRIP_GATE(0x80713AB0, &lit_6892); -#pragma pop + if (i_this->field_0x820 != 0) { + i_this->field_0x820--; + } -/* 80713AB4-80713AB8 000140 0004+00 0/1 0/0 0/0 .rodata @7307 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7307 = -10.0f; -COMPILER_STRIP_GATE(0x80713AB4, &lit_7307); -#pragma pop + if (i_this->field_0x6ca != 0) { + i_this->field_0x6ca--; + } -/* 80713AB8-80713ABC 000144 0004+00 0/2 0/0 0/0 .rodata @7308 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7308 = -200.0f; -COMPILER_STRIP_GATE(0x80713AB8, &lit_7308); -#pragma pop + i_this->field_0x6d2 = 1; + action(i_this); + + if (i_this->field_0x820 == 0 && i_this->field_0x5d8 == 0) { + if (i_this->field_0x6e4 != 0.0f) { + cMtx_YrotS(*calc_mtx, i_this->field_0x704.y); + sp2c.x = 0.0f; + sp2c.y = 0.0f; + sp2c.z = i_this->field_0x81c; + MtxPosition(&sp2c, &sp38); + a_this->current.pos += sp38; + a_this->old.pos += sp38; + cLib_addCalc2(&i_this->field_0x81c, i_this->field_0x6e4 * 2.0f, 1.0f, 5.0f); + } else { + cLib_addCalc0(&i_this->field_0x81c, 1.0f, 5.0f); + } -/* 80713ABC-80713AC0 000148 0004+00 0/1 0/0 0/0 .rodata @7309 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7309 = -20000.0f; -COMPILER_STRIP_GATE(0x80713ABC, &lit_7309); -#pragma pop + i_this->mObjAcch.CrrPos(dComIfG_Bgsp()); + if (i_this->field_0x6e4 != 0.0f) { + a_this->current.pos -= sp38; + a_this->old.pos -= sp38; + } -/* 80713AC0-80713AC4 00014C 0004+00 0/1 0/0 0/0 .rodata @7310 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7310 = 200000.0f; -COMPILER_STRIP_GATE(0x80713AC0, &lit_7310); -#pragma pop -/* 80713AC4-80713AC8 000150 0004+00 0/1 0/0 0/0 .rodata @7311 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7311 = 30000.0f; -COMPILER_STRIP_GATE(0x80713AC4, &lit_7311); -#pragma pop + if (!i_this->mObjAcch.ChkGroundHit()) { + if (a_this->speed.y < -10.0f) { + i_this->field_0x822++; + if (i_this->field_0x822 == 13) { + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DEATH, -1); + } + } + } else { + if (i_this->field_0x822 >= 13) { + i_this->field_0x6ae = 21; + i_this->field_0x5b4 = 0; + a_this->speed.y = 0.0f; + i_this->field_0x6e4 = -1.0; + i_this->field_0x704.x = -0x3000; + i_this->field_0x808 = 50; + i_this->field_0x6c8 = 1000; + a_this->health = 0; + } -/* 80713AC8-80713ACC 000154 0004+00 0/1 0/0 0/0 .rodata @7312 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7312 = 45.0f; -COMPILER_STRIP_GATE(0x80713AC8, &lit_7312); -#pragma pop + i_this->field_0x822 = 0; + } + } -/* 80713ACC-80713AD0 000158 0004+00 0/2 0/0 0/0 .rodata @7313 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7313 = 80.0f; -COMPILER_STRIP_GATE(0x80713ACC, &lit_7313); -#pragma pop + mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y + i_this->field_0x700, a_this->current.pos.z); + mDoMtx_stack_c::XrotM(i_this->field_0x70a.x); + mDoMtx_stack_c::ZrotM(i_this->field_0x70a.z); + mDoMtx_stack_c::YrotM(i_this->field_0x704.y); + mDoMtx_stack_c::XrotM(i_this->field_0x704.x); + mDoMtx_stack_c::YrotM(-i_this->field_0x704.y); + mDoMtx_stack_c::YrotM(a_this->shape_angle.y); + mDoMtx_stack_c::XrotM(a_this->shape_angle.x); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + mDoMtx_stack_c::scaleM(l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x); + + J3DModel* model = i_this->mpModelMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpModelMorf->play(0, 0); + anm_se_set(i_this); + i_this->mpModelMorf->modelCalc(); + MTXCopy(model->getAnmMtx(2), *calc_mtx); + + sp2c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + sp2c.set(0.0f, 0.0f, -200.0f); + MtxPosition(&sp2c, &sp44); + if (sp44.y < sp38.y) { + i_this->field_0x717 = 0; + } + else { + i_this->field_0x717 = 1; + } -/* 80713AD0-80713AD4 00015C 0004+00 0/1 0/0 0/0 .rodata @7314 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7314 = -23500.0f; -COMPILER_STRIP_GATE(0x80713AD0, &lit_7314); -#pragma pop + cXyz sp50(0.0f, 0.0f, 0.0f); + if (i_this->field_0x6c8 != 0) { + sp50.set(-20000.0f, 200000.0f, 30000.0f); + } -/* 80713AD4-80713AD8 000160 0004+00 0/1 0/0 0/0 .rodata @7315 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7315 = -50000.0f; -COMPILER_STRIP_GATE(0x80713AD4, &lit_7315); -#pragma pop + MTXCopy(model->getAnmMtx(6), *calc_mtx); + sp2c.set(30.0f, 30.0f, 0.0f); + MtxPosition(&sp2c, &a_this->eyePos); + cXyz sp5c; + sp5c = a_this->eyePos + sp50; + sp5c.y += 40.0f; + i_this->field_0xa7c[0].SetC(sp5c); + if (daPy_getPlayerActorClass()->checkHorseRide()) { + i_this->field_0xa7c[0].SetR(50.0f); + } else { + i_this->field_0xa7c[0].SetR(70.0f); + } + + a_this->attention_info.position = a_this->eyePos; + a_this->attention_info.position.y += 70.0f; + + MTXCopy(model->getAnmMtx(1), *calc_mtx); + sp2c.set(-30.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + i_this->field_0xa7c[1].SetC(sp38 + sp50); + i_this->field_0xa7c[1].SetR(45.0f); + MTXCopy(model->getAnmMtx(2), *calc_mtx); + sp2c.set(20.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + i_this->field_0xa7c[2].SetC(sp38 + sp50); + i_this->field_0xa7c[2].SetR(45.0f); + + for (int i = 0; i <= 2; i++) { + if (i_this->field_0x6d2 != 0) { + i_this->field_0xa7c[i].OnCoSetBit(); + } else { + i_this->field_0xa7c[i].OffCoSetBit(); + } -/* 80713AD8-80713ADC 000164 0004+00 0/1 0/0 0/0 .rodata @7316 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7316 = -30000.0f; -COMPILER_STRIP_GATE(0x80713AD8, &lit_7316); -#pragma pop + dComIfG_Ccsp()->Set(&i_this->field_0xa7c[i]); + } -/* 80713ADC-80713AE0 000168 0004+00 0/1 0/0 0/0 .rodata @7317 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7317 = 2.0f / 5.0f; -COMPILER_STRIP_GATE(0x80713ADC, &lit_7317); -#pragma pop + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(19), *calc_mtx); + i_this->field_0x5e4->setBaseTRMtx(*calc_mtx); -/* 80713AE0-80713AE4 00016C 0004+00 0/1 0/0 0/0 .rodata @7318 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7318 = 180.0f; -COMPILER_STRIP_GATE(0x80713AE0, &lit_7318); -#pragma pop + if (i_this->field_0x6cf != 0 && i_this->field_0x6ce <= 1) { + sp2c.set(0.0f, 35.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + if (i_this->field_0x6d0 == 0) { + i_this->field_0x6d0 = 1; + i_this->field_0xe24.StartCAt(sp38); + } else { + i_this->field_0xe24.MoveCAt(sp38); + } -/* 80713AE4-80713AE8 000170 0004+00 0/1 0/0 0/0 .rodata @7319 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7319 = -5000.0f; -COMPILER_STRIP_GATE(0x80713AE4, &lit_7319); -#pragma pop + if (i_this->field_0x6ce == 1) { + i_this->field_0xe24.SetR(l_HIO.base_size * 80.0f); + } else { + i_this->field_0xe24.SetR(l_HIO.base_size * 60.0f); + } + i_this->field_0xe24.SetAtAtp(2); -/* 80713AE8-80713AEC 000174 0004+00 0/1 0/0 0/0 .rodata @7320 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7320 = -300.0f; -COMPILER_STRIP_GATE(0x80713AE8, &lit_7320); -#pragma pop + if (i_this->field_0x6c0[1] != 0) { + i_this->field_0xe24.SetAtSpl((dCcG_At_Spl)1); + } else { + i_this->field_0xe24.SetAtSpl((dCcG_At_Spl)0); + } + } + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(12), *calc_mtx); + i_this->field_0x68c->setBaseTRMtx(*calc_mtx); + + if (i_this->field_0x6cf != 0 && i_this->field_0x6ce == 2) { + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(34), *calc_mtx); + sp2c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + + if (i_this->field_0x6d0 == 0) { + i_this->field_0x6d0 = 1; + i_this->field_0xe24.StartCAt(sp38); + } else { + i_this->field_0xe24.MoveCAt(sp38); + } -/* 80713AF4-80713AF4 000180 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80713AF9 = "D_MN07"; -#pragma pop + i_this->field_0xe24.SetR(70.0f * l_HIO.base_size); + i_this->field_0xe24.SetAtAtp(3); + i_this->field_0xe24.SetAtSpl((dCcG_At_Spl)10); + } -/* 80713FC4-80713FC8 0000A4 0004+00 1/2 0/0 0/0 .bss c_start */ -static int c_start; + if (i_this->field_0x6cf == 0) { + cXyz sp68(-23500.0f, -20000.0f, -50000.0f); + i_this->field_0xe24.SetC(a_this->current.pos + sp68); + i_this->field_0x6d0 = 0; + } else { + i_this->field_0x6cf = 0; + } -/* 80711CB8-80712998 007698 0CE0+00 2/1 0/0 0/0 .text daE_MF_Execute__FP10e_mf_class */ -static void daE_MF_Execute(e_mf_class* param_0) { - // NONMATCHING + dComIfG_Ccsp()->Set(&i_this->field_0xe24); + + daPy_py_c* player; + if (i_this->field_0x6d1 != 0 && i_this->field_0x6cc == 0) { + player = (daPy_py_c*)dComIfGp_getPlayer(0); + i_this->field_0x6c8 = 5; + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(12), *calc_mtx); + sp2c.set(50.0f, 0.0f, 30.0f); + MtxPosition(&sp2c, &sp38); + i_this->field_0xf5c.SetC(sp38); + i_this->field_0xf5c.SetR(70.0f * l_HIO.base_size); + + if (i_this->field_0xf5c.ChkTgHit()) { + def_se_set(&i_this->mSound, i_this->field_0xf5c.GetTgHitObj(), 40, 0); + dScnPly_c::setPauseTimer(l_HIO.field_0x1c); + i_this->field_0x6cc = 10; + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + sp2c.x = 0.0f; + sp2c.y = 120.0f; + sp2c.z = 50.0f; + MtxPosition(&sp2c, &sp38); + sp38 += a_this->current.pos; + dComIfGp_setHitMark(2, NULL, &sp38, &a_this->shape_angle, NULL, 0); + if (player->getIronBallCenterPos() != NULL) { + i_this->field_0x6ae = 12; + i_this->field_0x5b4 = 0; + if (i_this->field_0x80e != 0) { + a_this->current.angle.y = a_this->shape_angle.y; + } + + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DAMAGE, -1); + } + } + } else { + cXyz sp74(-23500.0f, -20000.0f, -30000.0f); + i_this->field_0xf5c.SetC(a_this->current.pos + sp74); + } + + i_this->field_0x6d1 = 0; + dComIfG_Ccsp()->Set(&i_this->field_0xf5c); + if (i_this->field_0x6a4 != 0) { + cLib_addCalc2(&i_this->field_0x6a8, -20.0f, 1.0f, 0.4f); + } + player = (daPy_py_c*)dComIfGp_getPlayer(0); + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp38); + sp2c = player->current.pos - sp38; + cMtx_YrotS(*calc_mtx, cM_atan2s(sp2c.x, sp2c.z)); + sp2c.x = 0.0; + sp2c.y = 45.0f; + sp2c.z = 30.0f; + MtxPosition(&sp2c, &sp44); + sp44 += sp38; + a_this->setDownPos(&sp44); + cXyz sp80(a_this->eyePos); + sp80.y += 180.0f; + a_this->setHeadLockPos(&sp80); + cXyz sp8c(1.5f, 1.5f, 1.5f); + setMidnaBindEffect(a_this, &i_this->mSound, &a_this->eyePos, &sp8c); + + if ((a_this->current.pos.y - a_this->home.pos.y) < -5000.0f) { + fopAcM_delete(a_this); + OS_REPORT("MF NARAKU\n"); + int swBit = fopAcM_GetParam(a_this) >> 24; + if (swBit != 0xFF) { + dComIfGs_onSwitch(swBit, fopAcM_GetRoomNo(a_this)); + } + } + + if (strcmp(dComIfGp_getStartStageName(), "D_MN07") == 0 && fopAcM_GetRoomNo(a_this) == 8 && a_this->health != 0 && a_this->current.pos.y <= -300.0f) { + i_this->field_0x6ae = 21; + i_this->field_0x5b4 = 0; + i_this->field_0x6e4 = 0.0; + a_this->health = 0; + } + + return 1; } /* 80712998-807129A0 008378 0008+00 1/0 0/0 0/0 .text daE_MF_IsDelete__FP10e_mf_class */ -static bool daE_MF_IsDelete(e_mf_class* param_0) { - return true; +static int daE_MF_IsDelete(e_mf_class* i_this) { + return 1; } /* 807129A0-80712A08 008380 0068+00 1/0 0/0 0/0 .text daE_MF_Delete__FP10e_mf_class */ -static void daE_MF_Delete(e_mf_class* param_0) { - // NONMATCHING +static int daE_MF_Delete(e_mf_class* i_this) { + fopEn_enemy_c* a_this = &i_this->actor; + dComIfG_resDelete(&i_this->mPhase, "E_mf"); + + if (i_this->field_0x10b9 != 0) { + data_80713F65 = 0; + } + + if (a_this->heap != NULL) { + i_this->mpModelMorf->stopZelAnime(); + } + + return 1; } /* 80712A08-80712BF0 0083E8 01E8+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -static int useHeapInit(fopAc_ac_c* param_0) { +static int useHeapInit(fopAc_ac_c* a_this) { // NONMATCHING + e_mf_class* i_this = (e_mf_class*)a_this; + + i_this->mpModelMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_mf", 38), NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("E_mf", 31), 0, 1.0f, + 0, -1, &i_this->mSound, 0x80000, 0x11000084); + if (i_this->mpModelMorf == NULL || i_this->mpModelMorf->getModel() == NULL) { + return 0; + } + + J3DModel* model = i_this->mpModelMorf->getModel(); + model->setUserArea((u32)i_this); + + for (u16 i = 0; i < model->getModelData()->getJointNum(); i++) { + model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); + } + + if (i_this->field_0x694.init(a_this, &jc_data[0], model, 12) == 0) { + return 0; + } + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_mf", 39); + JUT_ASSERT(5274, modelData != 0); + i_this->field_0x5e4 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->field_0x5e4 == NULL) { + return 0; + } + + modelData = (J3DModelData*)dComIfG_getObjectRes("E_mf", 40); + JUT_ASSERT(5286, modelData != 0); + i_this->field_0x68c = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->field_0x68c == NULL) { + return 0; + } + + return 1; } /* 80712BF0-80712F20 0085D0 0330+00 1/0 0/0 0/0 .text daE_MF_Create__FP10fopAc_ac_c */ @@ -1656,176 +1886,33 @@ extern "C" void __dt__5csXyzFv() { // NONMATCHING } -/* ############################################################################################## */ -/* 80713FC8-80713FCC 0000A8 0004+00 0/0 0/0 0/0 .bss - * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ -#pragma push -#pragma force_active on -static u8 data_80713FC8[4]; -#pragma pop - -/* 80713FCC-80713FD0 0000AC 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14JASAudioThread> */ -#pragma push -#pragma force_active on -static u8 data_80713FCC[4]; -#pragma pop - -/* 80713FD0-80713FD4 0000B0 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ -#pragma push -#pragma force_active on -static u8 data_80713FD0[4]; -#pragma pop - -/* 80713FD4-80713FD8 0000B4 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80713FD4[4]; -#pragma pop - -/* 80713FD8-80713FDC 0000B8 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80713FD8[4]; -#pragma pop - -/* 80713FDC-80713FE0 0000BC 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80713FDC[4]; -#pragma pop - -/* 80713FE0-80713FE4 0000C0 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> - */ -#pragma push -#pragma force_active on -static u8 data_80713FE0[4]; -#pragma pop - -/* 80713FE4-80713FE8 0000C4 0004+00 0/0 0/0 0/0 .bss - * sInstance__36JASGlobalInstance<15JAISoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80713FE4[4]; -#pragma pop - -/* 80713FE8-80713FEC 0000C8 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80713FE8[4]; -#pragma pop - -/* 80713FEC-80713FF0 0000CC 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ -#pragma push -#pragma force_active on -static u8 data_80713FEC[4]; -#pragma pop - -/* 80713FF0-80713FF4 0000D0 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ -#pragma push -#pragma force_active on -static u8 data_80713FF0[4]; -#pragma pop - -/* 80713FF4-80713FF8 0000D4 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80713FF4[4]; -#pragma pop - -/* 80713FF8-80713FFC 0000D8 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ -#pragma push -#pragma force_active on -static u8 data_80713FF8[4]; -#pragma pop - -/* 80713FFC-80714000 0000DC 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80713FFC[4]; -#pragma pop - -/* 80714000-80714004 0000E0 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAISoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_80714000[4]; -#pragma pop - -/* 80714004-80714008 0000E4 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13JAUSoundTable> */ -#pragma push -#pragma force_active on -static u8 data_80714004[4]; -#pragma pop - -/* 80714008-8071400C 0000E8 0004+00 0/0 0/0 0/0 .bss - * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ -#pragma push -#pragma force_active on -static u8 data_80714008[4]; -#pragma pop +AUDIO_INSTANCES; -/* 8071400C-80714010 0000EC 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_8071400C[4]; -#pragma pop - -/* 80714010-80714014 0000F0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> - */ -#pragma push -#pragma force_active on -static u8 data_80714010[4]; -#pragma pop - -/* 80714014-80714018 0000F4 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ -#pragma push -#pragma force_active on -static u8 data_80714014[4]; -#pragma pop - -/* 80714018-8071401C 0000F8 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> - */ -#pragma push -#pragma force_active on -static u8 data_80714018[4]; -#pragma pop - -/* 8071401C-80714020 0000FC 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8071401C[4]; -#pragma pop - -/* 80714020-80714024 000100 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80714020[4]; -#pragma pop - -/* 80714024-80714028 000104 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80714024[4]; -#pragma pop +/* 80713AF4-80713AF4 000180 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -/* 80714028-8071402C 000108 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ -#pragma push -#pragma force_active on -static u8 data_80714028[4]; -#pragma pop +/* 80713E34-80713E54 -00001 0020+00 1/0 0/0 0/0 .data l_daE_MF_Method */ +static actor_method_class l_daE_MF_Method = { + (process_method_func)daE_MF_Create, + (process_method_func)daE_MF_Delete, + (process_method_func)daE_MF_Execute, + (process_method_func)daE_MF_IsDelete, + (process_method_func)daE_MF_Draw, +}; -/* 80713AF4-80713AF4 000180 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 80713E54-80713E84 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_MF */ +extern actor_process_profile_definition g_profile_E_MF = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_E_MF, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(e_mf_class), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 120, // mPriority + &l_daE_MF_Method, // sub_method + 0x00040000, // mStatus + fopAc_ENEMY_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; From 1ddbb5c2c64d7dc899c0cc860ef3082d9caf872b Mon Sep 17 00:00:00 2001 From: carter-ktb21 <144170194+carter-ktb21@users.noreply.github.com> Date: Tue, 17 Jun 2025 13:39:42 -0400 Subject: [PATCH 13/21] Work on various action functions --- include/d/actor/d_a_e_mf.h | 27 +- src/d/actor/d_a_e_mf.cpp | 739 +++++++++++++++++++++++++++---------- 2 files changed, 563 insertions(+), 203 deletions(-) diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index 9f9b10fe6e8..d469bf6aff8 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -25,7 +25,9 @@ class e_mf_class { /* 0x05B7 */ u8 field_0x5b7; /* 0x05B8 */ u8 field_0x5b8; /* 0x05B9 */ u8 field_0x5b9; - /* 0x05BA */ u8 field_0x5ba[0x5d8 - 0x5ba]; + /* 0x05BA */ u8 field_0x5ba[0x5d4 - 0x5ba]; + /* 0x05D4 */ s16 field_0x5d4; + /* 0x05D6 */ u8 field_0x5d6[2]; /* 0x05D8 */ s8 field_0x5d8; /* 0x05D9 */ u8 field_0x5d9[0x5dc - 0x5d9]; /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; @@ -41,7 +43,8 @@ class e_mf_class { /* 0x06AC */ s16 field_0x6ac; /* 0x06AE */ s16 field_0x6ae; /* 0x06B0 */ f32 field_0x6b0; - /* 0x06B4 */ u8 field_0x6b4[0x6b8 - 0x6b4]; + /* 0x06B4 */ s16 field_0x6b4; + /* 0x06B6 */ u8 field_0x6b6[0x6b8 - 0x6b6]; /* 0x06B8 */ f32 field_0x6b8; /* 0x06BC */ u32 mShadowKey; /* 0x06C0 */ s16 field_0x6c0[4]; @@ -53,21 +56,29 @@ class e_mf_class { /* 0x06D0 */ s8 field_0x6d0; /* 0x06D1 */ s8 field_0x6d1; /* 0x06D2 */ s8 field_0x6d2; - /* 0x06D3 */ u8 field_0x6d3[0x6d6 - 0x6d3]; + /* 0x06D3 */ u8 field_0x6d3; + /* 0x06D4 */ u8 field_0x6d4; + /* 0x06D5 */ u8 field_0x6d5; /* 0x06D6 */ s16 field_0x6d6; /* 0x06D8 */ s16 field_0x6d8; /* 0x06DA */ s16 field_0x6da; /* 0x06DC */ u8 field_0x6dc[0x6e4 - 0x6dc]; /* 0x06E4 */ f32 field_0x6e4; - /* 0x06E8 */ u8 field_0x6e8[0x700 - 0x6e8]; + /* 0x06E8 */ u8 field_0x6e8[0x6f0 - 0x6e8]; + /* 0x06F0 */ u8 field_0x6f0; + /* 0x06F1 */ u8 field_0x6f1[0x700 - 0x6f1]; /* 0x0700 */ f32 field_0x700; /* 0x0704 */ csXyz field_0x704; /* 0x070A */ csXyz field_0x70a; /* 0x0710 */ u8 field_0x710[0x717 - 0x710]; /* 0x0717 */ u8 field_0x717; - /* 0x0718 */ u8 field_0x718[0x728 - 0x718]; + /* 0x0718 */ cXyz field_0x718; + /* 0x0724 */ u8 field_0x724[0x728 - 0x724]; /* 0x0728 */ u8 field_0x728; - /* 0x0729 */ u8 field_0x729[0x742 - 0x729]; + /* 0x0729 */ u8 field_0x729[0x72c - 0x729]; + /* 0x072C */ f32 field_0x72c; + /* 0x0730 */ s16 field_0x730; + /* 0x0732 */ u8 field_0x732[0x742 - 0x732]; /* 0x0742 */ csXyz field_0x742[11]; /* 0x0784 */ csXyz field_0x784[11]; /* 0x07C6 */ u8 field_0x7c6[0x7cc - 0x7c6]; @@ -107,7 +118,9 @@ class e_mf_class { /* 0x1094 */ dCcU_AtInfo mAtInfo; /* 0x10B8 */ u8 field_0x10b8; /* 0x10B9 */ u8 field_0x10b9; - /* 0x10BA */ u8 field_0x10ba[0x10ec - 0x10ba]; + /* 0x10BA */ u8 field_0x10ba[0x10c4 - 0x10ba]; + /* 0x10C4 */ u8 field_0x10c4; + /* 0x10C5 */ u8 field_0x10c5[0x10ec - 0x10c5]; }; STATIC_ASSERT(sizeof(e_mf_class) == 0x10ec); diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 45273c07598..be6b4878fd9 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -232,25 +232,6 @@ extern "C" u8 sincosTable___5JMath[65536]; extern "C" u8 m_midnaActor__9daPy_py_c[4]; extern "C" void __register_global_object(); -// -// Declarations: -// - -/* 80713B40-80713B6C -00001 002C+00 1/1 0/0 0/0 .data @4569 */ -SECTION_DATA static void* lit_4569[11] = { - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x4C), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x78), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x158), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x1AC), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x230), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x280), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x2D4), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x330), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x3BC), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x40C), - (void*)(((char*)e_mf_stay__FP10e_mf_class) + 0x3F8), -}; - /* 80713B6C-80713B9C -00001 0030+00 1/1 0/0 0/0 .data @4741 */ SECTION_DATA static void* lit_4741[12] = { (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x98), @@ -774,242 +755,607 @@ static dBomb_c* search_bomb(e_mf_class* i_this, BOOL param_2) { } /* 8070B6E0-8070B704 0010C0 0024+00 4/4 0/0 0/0 .text bomb_view_check__FP10e_mf_class */ -static void bomb_view_check(e_mf_class* i_this) { - // NONMATCHING +static dBomb_c* bomb_view_check(e_mf_class* i_this) { + return search_bomb(i_this, TRUE); } /* 8070B704-8070B728 0010E4 0024+00 1/1 0/0 0/0 .text bomb_check__FP10e_mf_class */ -static void bomb_check(e_mf_class* i_this) { - // NONMATCHING +static dBomb_c* bomb_check(e_mf_class* i_this) { + return search_bomb(i_this, FALSE); } /* 8070B728-8070B76C 001108 0044+00 1/1 0/0 0/0 .text player_way_check__FP10e_mf_class */ -static void player_way_check(e_mf_class* i_this) { - // NONMATCHING +static BOOL player_way_check(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + s16 sVar1 = a_this->shape_angle.y - dComIfGp_getPlayer(0)->shape_angle.y; + if ((int)sVar1 < 0) { + sVar1 = -sVar1; + } + + if (((u32)sVar1 & 0xFFFF) < 0x6000) { + return FALSE; + } + + return TRUE; } /* 8070B76C-8070B848 00114C 00DC+00 4/4 0/0 0/0 .text pl_check__FP10e_mf_classfs */ -static void pl_check(e_mf_class* i_this, f32 param_1, s16 param_2) { +static int pl_check(e_mf_class* i_this, f32 param_2, s16 param_3) { // NONMATCHING -} + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); -/* 8070B848-8070B950 001228 0108+00 3/3 0/0 0/0 .text move_gake_check__FP10e_mf_classfSc - */ -static void move_gake_check(e_mf_class* i_this, f32 param_1, s8 param_2) { - // NONMATCHING + if (i_this->field_0x6b0 < param_2) { + s16 sVar1 = a_this->shape_angle.y - i_this->field_0x6b4; + if (sVar1 < param_3 && sVar1 > (s16)-param_3 && !other_bg_check(i_this, player)) { + return 1; + } + } else { + for (int i = 0; i <= 2; i++) { + if (i_this->field_0xa7c[i].ChkCoHit() != 0) { + if (player == dCc_GetAc(i_this->field_0xa7c[i].GetCoHitObj()->GetAc())) { + return 2; + } + } + } + } + + return 0; } -/* ############################################################################################## */ -/* 807139D0-807139D4 00005C 0004+00 0/4 0/0 0/0 .rodata @4459 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4459 = 200.0f; -COMPILER_STRIP_GATE(0x807139D0, &lit_4459); -#pragma pop +/* 8070B848-8070B950 001228 0108+00 3/3 0/0 0/0 .text move_gake_check__FP10e_mf_classfSc */ +static BOOL move_gake_check(e_mf_class* i_this, f32 param_2, s8 param_3) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_GndChk gnd_chk; + cXyz sp84, sp90; + + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + sp84.x = 0.0f; + sp84.y = 100.0f; + if (param_3 != 0) { + sp84.z = -param_2; + } else { + sp84.z = param_2; + } + MtxPosition(&sp84, &sp90); + sp90 += a_this->current.pos; + gnd_chk.SetPos(&sp90); -/* 8070B950-8070BB10 001330 01C0+00 1/1 0/0 0/0 .text jump_pos_check__FP10e_mf_classP4cXyz */ -static void jump_pos_check(e_mf_class* i_this, cXyz* param_1) { - // NONMATCHING + if (a_this->current.pos.y - dComIfG_Bgsp().GroundCross(&gnd_chk) > 300.0f) { + return TRUE; + } + + return FALSE; } -/* ############################################################################################## */ -/* 807139D4-807139D8 000060 0004+00 0/7 0/0 0/0 .rodata @4559 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4559 = 10.0f; -COMPILER_STRIP_GATE(0x807139D4, &lit_4559); -#pragma pop +/* 8070B950-8070BB10 001330 01C0+00 1/1 0/0 0/0 .text jump_pos_check__FP10e_mf_classP4cXyz */ +static BOOL jump_pos_check(e_mf_class* i_this, cXyz* param_2) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_GndChk gnd_chk; + cXyz sp94, spa0; + f32 fVar1 = 300.0f; + + cMtx_YrotS(*calc_mtx, i_this->field_0x6b4); + sp94.x = 0.0f; + sp94.y = 200.0f; + + int i = 0; + while (i < 10) { + sp94.z = fVar1; + MtxPosition(&sp94, &spa0); + spa0 += a_this->current.pos; + gnd_chk.SetPos(&spa0); + spa0.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if ((a_this->current.pos.y - spa0.y) < 200.0f) { + *param_2 = spa0; + sp94.z += 200.0f; + MtxPosition(&sp94, &spa0); + spa0 += a_this->current.pos; + gnd_chk.SetPos(&spa0); + spa0.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if ((a_this->current.pos.y - spa0.y) < 200.0f) { + *param_2 = spa0; + } -/* 807139D8-807139DC 000064 0004+00 0/2 0/0 0/0 .rodata @4560 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4560 = 9.0f / 10.0f; -COMPILER_STRIP_GATE(0x807139D8, &lit_4560); -#pragma pop + return TRUE; + } -/* 807139DC-807139E0 000068 0004+00 0/3 0/0 0/0 .rodata @4561 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4561 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x807139DC, &lit_4561); -#pragma pop + fVar1 += 50.0f; + i++; + } -/* 807139E0-807139E4 00006C 0004+00 0/2 0/0 0/0 .rodata @4562 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4562 = 2000.0f; -COMPILER_STRIP_GATE(0x807139E0, &lit_4562); -#pragma pop + return FALSE; +} /* 8070BB10-8070BF94 0014F0 0484+00 2/1 0/0 0/0 .text e_mf_stay__FP10e_mf_class */ static void e_mf_stay(e_mf_class* i_this) { // NONMATCHING -} - -/* ############################################################################################## */ -/* 807139E4-807139E8 000070 0004+00 0/11 0/0 0/0 .rodata @4563 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4563 = 3.0f; -COMPILER_STRIP_GATE(0x807139E4, &lit_4563); -#pragma pop + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp30; + + i_this->field_0x6d4 = 5; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.1f) + 0.9f); + i_this->field_0x5b4 = 1; + // fallthrough + case 1: + if (fopAcM_otoCheck(a_this, 2000.0f) || daPy_getPlayerActorClass()->checkWolfBark()) { + SND_INFLUENCE* sound = dKy_Sound_get(); + sp30 = sound->position - a_this->current.pos; + if (cM_atan2s(sp30.y, JMAFastSqrt(sp30.x * sp30.x + sp30.z * sp30.z)) > 0x1000) { + i_this->field_0x5b4 = 5; + } else { + i_this->field_0x5b4 = 2; + } -/* 807139E8-807139EC 000074 0004+00 0/4 0/0 0/0 .rodata @4564 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4564 = 1.5f; -COMPILER_STRIP_GATE(0x807139E8, &lit_4564); -#pragma pop + i_this->field_0x6c0[0] = cM_rndF(10.0f) + 10.0f; + i_this->field_0x718 = sound->position; + } + break; -/* 807139EC-807139F0 000078 0004+00 0/5 0/0 0/0 .rodata @4565 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4565 = 20.0f; -COMPILER_STRIP_GATE(0x807139EC, &lit_4565); -#pragma pop + case 2: + if (i_this->field_0x6c0[0] == 0) { + anm_init(i_this, 21, 3.0f, 0, 1.5f); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND, -1); + i_this->field_0x5b4 = 3; + } + break; -/* 807139F0-807139F4 00007C 0004+00 0/10 0/0 0/0 .rodata @4566 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4566 = 5.0f; -COMPILER_STRIP_GATE(0x807139F0, &lit_4566); -#pragma pop + case 3: + if (i_this->mpModelMorf->isStop()) { + if (other_bg_check2(i_this, &i_this->field_0x718)) { + i_this->field_0x6c0[0] = cM_rndF(10.0f) + 20.0f; + i_this->field_0x5b4 = 4; + } else { + i_this->field_0x6ae = 10; + i_this->field_0x5b4 = 0; + } + } + break; -/* 807139F4-807139F8 000080 0004+00 0/1 0/0 0/0 .rodata @4567 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4567 = 40.0f; -COMPILER_STRIP_GATE(0x807139F4, &lit_4567); -#pragma pop + case 4: + if (i_this->field_0x6c0[0] == 0) { + i_this->field_0x5b4 = 10; + i_this->field_0x6c0[0] = cM_rndF(10.0f) + 30.0f; + anm_init(i_this, 33, 5.0f, 2, 1.5f); + } + break; -/* 807139F8-807139FC 000084 0004+00 0/0 0/0 0/0 .rodata @4568 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4568 = 75.0f; -COMPILER_STRIP_GATE(0x807139F8, &lit_4568); -#pragma pop + case 5: + if (i_this->field_0x6c0[0] == 0) { + anm_init(i_this, 21, 3.0f, 0, 1.5f); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND, -1); + i_this->field_0x5b4 = 6; + } + break; -/* 807139FC-80713A04 000088 0008+00 0/1 0/0 0/0 .rodata @4573 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4573[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x807139FC, &lit_4573); -#pragma pop + case 6: + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x6c0[0] = cM_rndF(10.0f) + 20.0f; + i_this->field_0x5b4 = 7; + } + break; + + case 7: + if (i_this->field_0x6c0[0] == 0) { + i_this->field_0x5b4 = 10; + i_this->field_0x6c0[0] = cM_rndF(40.0f) + 50.0f; + anm_init(i_this, 34, 5.0f, 2, 1.3f); + i_this->mpModelMorf->setFrame(cM_rndF(75.0f)); + } + break; -/* 80713A04-80713A08 000090 0004+00 0/1 0/0 0/0 .rodata @4634 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4634 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x80713A04, &lit_4634); -#pragma pop + case 8: + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x5b4 = 0; + } + break; -/* 80713A08-80713A0C 000094 0004+00 0/2 0/0 0/0 .rodata @4635 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4635 = 1.0f / 20.0f; -COMPILER_STRIP_GATE(0x80713A08, &lit_4635); -#pragma pop + case 10: + if (i_this->field_0x6c0[0] == 0) { + i_this->field_0x5b4 = 0; + } + } -/* 80713A0C-80713A10 000098 0004+00 0/2 0/0 0/0 .rodata @4636 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4636 = 250.0f; -COMPILER_STRIP_GATE(0x80713A0C, &lit_4636); -#pragma pop + if ((i_this->field_0x6ac & 15) == 0) { + if (pl_check(i_this, i_this->field_0x6b8, 0x4000) != 0) { + i_this->field_0x6ae = 3; + i_this->field_0x5b4 = -10; + i_this->field_0x6c0[0] = 60; + } else if (bomb_view_check(i_this) != NULL) { + i_this->field_0x6ae = 11; + i_this->field_0x5b4 = 0; + } + } +} /* 8070BF94-8070C2C4 001974 0330+00 1/1 0/0 0/0 .text e_mf_otoreac__FP10e_mf_class */ static void e_mf_otoreac(e_mf_class* i_this) { - // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp40, sp4c; + f32 fVar1 = 0.0f; + i_this->field_0x6d4 = 2; + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.2f) + 1.5f); + i_this->field_0x6c0[0] = cM_rndF(10.0f) + 20.0f; + i_this->field_0x5b4 = 1; + // fallthrough + case 1: + if (i_this->field_0x6c0[0] == 0) { + anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + i_this->field_0x5b4 = 2; + } + break; + + case 2: + fVar1 = l_HIO.dash_speed; + if ((i_this->field_0x6ac & 3) == 0) { + if ((i_this->field_0x6ac & 4) != 0) { + i_this->field_0x10c4 = 1; + } else { + i_this->field_0x10c4 = 2; + } + } + + sp40 = i_this->field_0x718 - a_this->current.pos; + cLib_addCalcAngleS2(&a_this->current.angle.y, cM_atan2s(sp40.x, sp40.z), 2, 0xC00); + if (sp40.abs() < 250.0f || i_this->mObjAcch.ChkWallHit() != 0) { + i_this->field_0x6ae = 0; + i_this->field_0x5b4 = 0; + i_this->field_0x6c0[0] = cM_rndF(50.0f) + 50.0f; + anm_init(i_this, 33, 10.0f, 2, 1.0f); + } + break; + + + } + + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); + if ((i_this->field_0x6ac & 15) == 0) { + if (pl_check(i_this, i_this->field_0x6b8, 0x4000) != 0) { + i_this->field_0x6ae = 3; + i_this->field_0x5b4 = -10; + i_this->field_0x6c0[0] = 60; + } else if (bomb_view_check(i_this) != NULL) { + i_this->field_0x6ae = 11; + i_this->field_0x5b4 = 0; + } + } } /* 8070C2C4-8070C7C4 001CA4 0500+00 2/1 0/0 0/0 .text e_mf_bomb_action__FP10e_mf_class */ static void e_mf_bomb_action(e_mf_class* i_this) { // NONMATCHING -} - -/* ############################################################################################## */ -/* 80713A10-80713A14 00009C 0004+00 0/1 0/0 0/0 .rodata @4737 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4737 = 600.0f; -COMPILER_STRIP_GATE(0x80713A10, &lit_4737); -#pragma pop + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + s16 sVar2; + cXyz sp3c, sp48; + dBomb_c* bomb = bomb_check(i_this); + if (bomb == NULL) { + i_this->field_0x6ae = 3; + i_this->field_0x5b4 = 0; + return; + } -/* 80713A14-80713A18 0000A0 0004+00 0/1 0/0 0/0 .rodata @4738 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4738 = -30.0f; -COMPILER_STRIP_GATE(0x80713A14, &lit_4738); -#pragma pop + sp3c.x = bomb->current.pos.x - a_this->current.pos.x; + sp3c.z = bomb->current.pos.z - a_this->current.pos.z; + s16 sVar1 = cM_atan2s(sp3c.x, sp3c.z); + f32 fVar1 = 0.0f; + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 21, 3.0f, 0, 1.5f); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND_BOMB, -1); + i_this->field_0x5b4 = 1; + break; + + case 1: + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x5b4 = 2; + } + break; + + case 2: + i_this->field_0x5b4 = 3; + anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->field_0x6c0[1] = cM_rndF(10.0f) + 10.0f; + // fallthrough + case 3: + if (i_this->field_0x6c0[1] == 0 && bomb->speedF < 0.1f) { + i_this->field_0x5b4 = 4; + anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + } + break; + + case 4: + if (bomb->speedF < 0.1f && !bomb->checkStateCarry() && JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 250.0f) { + sVar2 = i_this->field_0x6b4 - a_this->shape_angle.y; + if (sVar2 < 0x4000 && sVar2 > -0x4000) { + i_this->field_0x5b4 = 10; + break; + } + } -/* 80713A18-80713A1C 0000A4 0004+00 0/2 0/0 0/0 .rodata @4739 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4739 = 60.0f; -COMPILER_STRIP_GATE(0x80713A18, &lit_4739); -#pragma pop + sVar1 += 0x8000; + fVar1 = l_HIO.dash_speed; + if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) > 600.0f) { + i_this->field_0x5b4 = 5; + anm_init(i_this, 31, 5.0f, 2, 1.0f); + } + + break; + + case 5: + i_this->mSound.startCreatureSoundLevel(Z2SE_EN_MF_V_LOOK_BOMB, 0, -1); + sVar1 = i_this->field_0x6b4; + if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 500.0f) { + i_this->field_0x5b4 = 2; + } + break; + + case 10: + i_this->field_0x6d2 = 0; + fVar1 = l_HIO.dash_speed; + if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 100.0f) { + i_this->field_0x6c0[0] = 20; + i_this->field_0x5b4 = 11; + anm_init(i_this, 30, 5.0f, 0, cM_rndFX(0.05f) + 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_KICK_BOMB, -1); + } -/* 80713A1C-80713A20 0000A8 0004+00 0/2 0/0 0/0 .rodata @4740 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4740 = 15.0f; -COMPILER_STRIP_GATE(0x80713A1C, &lit_4740); -#pragma pop + if (bomb->speedF > 0.1f) { + i_this->field_0x5b4 = 2; + } + break; + + case 11: + i_this->field_0x6d2 = 0; + sVar1 = i_this->field_0x6b4; + + if (i_this->field_0x6c0[0] >= 10) { + cMtx_YrotS(*calc_mtx, sVar1); + sp3c.x = -30.0f; + sp3c.y = 0.0f; + sp3c.z = 60.0f; + MtxPosition(&sp3c, &sp48); + sp48 += a_this->current.pos; + + cLib_addCalc2(&bomb->current.pos.x, sp48.x, 1.0f, 15.0f); + cLib_addCalc2(&bomb->current.pos.z, sp48.z, 1.0f, 15.0f); + + if (i_this->field_0x6c0[0] == 10) { + bomb->speedF = 30.0f; + bomb->speed.y = 30.0f; + bomb->current.angle.y = a_this->shape_angle.y; + } + } -/* 80713A20-80713A24 0000AC 0004+00 0/1 0/0 0/0 .rodata @4805 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4805 = 32768.0f; -COMPILER_STRIP_GATE(0x80713A20, &lit_4805); -#pragma pop + if (i_this->field_0x6c0[0] == 0) { + anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->field_0x5b4 = 5; + } + } -/* 80713A24-80713A28 0000B0 0004+00 0/1 0/0 0/0 .rodata @4806 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4806 = 10000.0f; -COMPILER_STRIP_GATE(0x80713A24, &lit_4806); -#pragma pop + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); + cLib_addCalcAngleS2(&a_this->current.angle.y, sVar1, 4, 0x1000); + i_this->field_0x6d4 = 2; + i_this->field_0x718 = bomb->current.pos; +} /* 8070C7C4-8070CB1C 0021A4 0358+00 1/1 0/0 0/0 .text e_mf_normal__FP10e_mf_class */ static void e_mf_normal(e_mf_class* i_this) { // NONMATCHING -} + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp44, sp50; + f32 fVar1 = 0.0f; + s16 sVar1 = 0x4000; + s16 sVar2, sVar3; + + switch (i_this->field_0x5b4) { + case 0: + case 1: + case 2: + if (i_this->field_0x6c0[0] == 0) { + if (fopAcM_wayBgCheck(a_this, 200.0f, 50.0f) || move_gake_check(i_this, 200.0f, 0)) { + sVar2 = cM_rndFX(10000.0f) + 32768.0f; + i_this->field_0x6c0[1] = 40; + } else { + sp50.x = a_this->home.pos.x + cM_rndFX(600.0f); + sp50.y = a_this->home.pos.y; + sp50.z = a_this->home.pos.z + cM_rndFX(600.0f); + sp44 = sp50 - a_this->current.pos; + + sVar2 = cM_atan2s(sp44.x, sp44.z) - a_this->current.angle.y; + if (sVar2 > 0x3000) { + sVar2 = 0x3000; + } else if (sVar2 < -0x3000) { + sVar2 = -0x3000; + } + } -/* ############################################################################################## */ -/* 80713A28-80713A2C 0000B4 0004+00 0/2 0/0 0/0 .rodata @4834 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4834 = -5.0f; -COMPILER_STRIP_GATE(0x80713A28, &lit_4834); -#pragma pop + i_this->field_0x5d4 = a_this->current.angle.y + sVar2; + anm_init(i_this, 35, 10.0f, 2, 1.0f); + i_this->field_0x5b4 = 3; + i_this->field_0x6c0[0] = cM_rndF(100.0f) + 100.0f; + } else { + sVar1 = 0x7000; + } + break; + + case 3: + fVar1 = l_HIO.movement_speed; + sVar2 = a_this->current.angle.y; + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x5d4, 2, 0x400); + sVar3 = a_this->current.angle.y - i_this->field_0x5d4; + if (sVar3 > 0x1000 || sVar3 < -0x1000) { + fVar1 = 0.0f; + } -/* 8070CB1C-8070CCB8 0024FC 019C+00 1/1 0/0 0/0 .text e_mf_drawback__FP10e_mf_class */ -static void e_mf_drawback(e_mf_class* i_this) { - // NONMATCHING + sVar3 = (sVar2 - a_this->current.angle.y) * 2; + if (sVar3 > 0x1000) { + sVar2 = 0x1000; + } else if (sVar3 < -0x1000) { + sVar2 = -0x1000; + } + + cLib_addCalcAngleS2(&i_this->field_0x806, sVar2, 2, 0x400); + + if (i_this->field_0x6c0[0] == 0 || + ((i_this->field_0x6c0[1] == 0 && fopAcM_wayBgCheck(a_this, 200.0f, 50.0f)) || move_gake_check(i_this, 200.0f, 0))) { + i_this->field_0x5b4 = 2; + i_this->field_0x6c0[0] = cM_rndF(100.0f) + 50.0f; + anm_init(i_this, 33, 10.0f, 2, 1.0f); + } + break; + } + + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 3.0f); + BOOL bVar1 = fopAcM_otoCheck(a_this, 2000.0f) | daPy_getPlayerActorClass()->checkWolfBark(); + if ((i_this->field_0x6ac & 15) == 0 || bVar1) { + if (bVar1 || pl_check(i_this, i_this->field_0x6b8, sVar1) != 0) { + i_this->field_0x6ae = 3; + i_this->field_0x5b4 = -10; + i_this->field_0x6c0[0] = 60; + } + + if (bomb_view_check(i_this) != NULL) { + i_this->field_0x6ae = 11; + i_this->field_0x5b4 = 0; + } + } } -/* ############################################################################################## */ -/* 80713A2C-80713A30 0000B8 0004+00 0/2 0/0 0/0 .rodata @4899 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4899 = 2.0f; -COMPILER_STRIP_GATE(0x80713A2C, &lit_4899); -#pragma pop +/* 8070CB1C-8070CCB8 0024FC 019C+00 1/1 0/0 0/0 .text e_mf_drawback__FP10e_mf_class */ +static void e_mf_drawback(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 18, 5.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + a_this->speedF = -5.0f; + i_this->field_0x6c8 = 10; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DRAWBACK, -1); + i_this->field_0x5d4 = player->shape_angle.y + 0x8000; + i_this->field_0x6c0[0] = 50; + break; + + case 1: + a_this->onHeadLockFlg(); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x5d4, 4, 0x400); + cLib_addCalc0(&a_this->speedF, 1.0f, 0.1f); + + if (i_this->mpModelMorf->isStop() || i_this->field_0x6c0[0] == 0) { + i_this->field_0x6ae = 3; + i_this->field_0x5b4 = 0; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_AWAKE, -1); + } + break; + } -/* 80713A30-80713A34 0000BC 0004+00 1/5 0/0 0/0 .rodata @4900 */ -SECTION_RODATA static f32 const lit_4900 = 150.0f; -COMPILER_STRIP_GATE(0x80713A30, &lit_4900); + if (move_gake_check(i_this, 50.0f, 1)) { + i_this->field_0x6ae = 23; + i_this->field_0x5b4 = 0; + } +} /* 8070CCB8-8070D090 002698 03D8+00 1/1 0/0 0/0 .text e_mf_wolfbite__FP10e_mf_class */ static void e_mf_wolfbite(e_mf_class* i_this) { - // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + i_this->field_0x6c8 = 10; + cLib_addCalc0(&a_this->speedF, 1.0f, 2.0f); + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 23, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DRAWBACK, -1); + a_this->health -= 10; + i_this->field_0x10b8 = 0; + break; + + case 1: + if (i_this->mpModelMorf->isStop()) { + anm_init(i_this, 26, 3.0f, 2, 1.0f); + i_this->field_0x5b4 = 2; + } + break; + + case 2: + if (i_this->field_0x5e0 == 24) { + if (i_this->mpModelMorf->isStop()) { + anm_init(i_this, 26, 3.0f, 2, 1.0f); + } + } + + if (a_this->health <= 0 || a_this->checkWolfBiteDamage()) { + a_this->offWolfBiteDamage(); + anm_init(i_this, 24, 2.0f, 0, 1.0f); + a_this->health -= 10; + if (a_this->health <= 0) { + player->offWolfEnemyHangBite(); + i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - player->shape_angle.y; + i_this->field_0x72c = 150.0f; + i_this->field_0x6ae = 21; + i_this->field_0x5b4 = 0; + i_this->field_0x704.y = player->shape_angle.y + 0x8000; + a_this->speed.y = 0.0f; + i_this->field_0x6e4 = -1.0f; + i_this->field_0x808 = 50; + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 32); + i_this->field_0x6f0 = 1; + i_this->field_0x6c8 = 1000; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DEATH, -1); + return; + } + + i_this->field_0x10b8++; + if (i_this->field_0x10b8 >= 4) { + player->offWolfEnemyHangBite(); + anm_init(i_this, 25, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 3; + } + + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 30); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DAMAGE, -1); + } + + if (!player->checkWolfEnemyHangBiteOwn(a_this)) { + anm_init(i_this, 25, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 3; + } + break; + + case 3: + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x6ae = 3; + i_this->field_0x5b4 = 0; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_AWAKE, -1); + } + } } /* 8070D090-8070D0D0 002A70 0040+00 1/1 0/0 0/0 .text way_check__FP10e_mf_class */ -static void way_check(e_mf_class* i_this) { - // NONMATCHING +static int way_check(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + s16 sVar1 = a_this->shape_angle.y - i_this->field_0x6b4; + if (sVar1 <= 0x4000 && sVar1 >= -0x4000) { + return 0; + } + + if (sVar1 < 0) { + return 1; + } + + return 2; } /* ############################################################################################## */ @@ -1021,8 +1367,9 @@ COMPILER_STRIP_GATE(0x80713A34, &lit_4971); #pragma pop /* 8070D0D0-8070D2C8 002AB0 01F8+00 1/1 0/0 0/0 .text shot_s_sub__FPvPv */ -static void shot_s_sub(void* param_0, void* param_1) { +static void shot_s_sub(void* i_actor, void* i_data) { // NONMATCHING + } /* ############################################################################################## */ From ff79b2680a3a9e614dfb93ed3fa9a50b68b8753a Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Wed, 18 Jun 2025 15:43:05 -0400 Subject: [PATCH 14/21] Almost all functions worked on --- include/d/actor/d_a_e_mf.h | 66 +- include/f_op/f_op_actor.h | 1 + include/f_op/f_op_kankyo_mng.h | 1 + src/d/actor/d_a_e_mf.cpp | 2007 +++++++++++++++++++++++++++----- 4 files changed, 1762 insertions(+), 313 deletions(-) diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index d469bf6aff8..9afd9943ba2 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -25,9 +25,11 @@ class e_mf_class { /* 0x05B7 */ u8 field_0x5b7; /* 0x05B8 */ u8 field_0x5b8; /* 0x05B9 */ u8 field_0x5b9; - /* 0x05BA */ u8 field_0x5ba[0x5d4 - 0x5ba]; + /* 0x05BA */ u8 field_0x5ba[0x5bc - 0x5ba]; + /* 0x05BC */ cXyz field_0x5bc; + /* 0x05C8 */ cXyz field_0x5c8; /* 0x05D4 */ s16 field_0x5d4; - /* 0x05D6 */ u8 field_0x5d6[2]; + /* 0x05D6 */ s16 field_0x5d6; /* 0x05D8 */ s8 field_0x5d8; /* 0x05D9 */ u8 field_0x5d9[0x5dc - 0x5d9]; /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; @@ -41,10 +43,10 @@ class e_mf_class { /* 0x06A5 */ u8 field_0x6a5[0x6a8 - 0x6a5]; /* 0x06A8 */ f32 field_0x6a8; /* 0x06AC */ s16 field_0x6ac; - /* 0x06AE */ s16 field_0x6ae; - /* 0x06B0 */ f32 field_0x6b0; - /* 0x06B4 */ s16 field_0x6b4; - /* 0x06B6 */ u8 field_0x6b6[0x6b8 - 0x6b6]; + /* 0x06AE */ s16 mAction; + /* 0x06B0 */ f32 mPlayerDistance; + /* 0x06B4 */ s16 mYAngleToPlayer; + /* 0x06B6 */ s16 mXAngleToPlayer; /* 0x06B8 */ f32 field_0x6b8; /* 0x06BC */ u32 mShadowKey; /* 0x06C0 */ s16 field_0x6c0[4]; @@ -56,32 +58,45 @@ class e_mf_class { /* 0x06D0 */ s8 field_0x6d0; /* 0x06D1 */ s8 field_0x6d1; /* 0x06D2 */ s8 field_0x6d2; - /* 0x06D3 */ u8 field_0x6d3; + /* 0x06D3 */ s8 field_0x6d3; /* 0x06D4 */ u8 field_0x6d4; /* 0x06D5 */ u8 field_0x6d5; /* 0x06D6 */ s16 field_0x6d6; /* 0x06D8 */ s16 field_0x6d8; /* 0x06DA */ s16 field_0x6da; - /* 0x06DC */ u8 field_0x6dc[0x6e4 - 0x6dc]; + /* 0x06DC */ s16 field_0x6dc; + /* 0x06DE */ s16 field_0x6de; + /* 0x06E0 */ s8 field_0x6e0; + /* 0x06E1 */ s8 field_0x6e1; + /* 0x06E2 */ u8 field_0x6e2[0x6e4 - 0x6e2]; /* 0x06E4 */ f32 field_0x6e4; - /* 0x06E8 */ u8 field_0x6e8[0x6f0 - 0x6e8]; - /* 0x06F0 */ u8 field_0x6f0; + /* 0x06E8 */ f32 field_0x6e8; + /* 0x06EC */ s16 field_0x6ec; + /* 0x06EE */ s16 field_0x6ee; + /* 0x06F0 */ s8 field_0x6f0; /* 0x06F1 */ u8 field_0x6f1[0x700 - 0x6f1]; /* 0x0700 */ f32 field_0x700; /* 0x0704 */ csXyz field_0x704; /* 0x070A */ csXyz field_0x70a; - /* 0x0710 */ u8 field_0x710[0x717 - 0x710]; - /* 0x0717 */ u8 field_0x717; + /* 0x0710 */ csXyz field_0x710; + /* 0x0716 */ u8 field_0x716; + /* 0x0717 */ s8 field_0x717; /* 0x0718 */ cXyz field_0x718; - /* 0x0724 */ u8 field_0x724[0x728 - 0x724]; + /* 0x0724 */ u32 field_0x724; /* 0x0728 */ u8 field_0x728; /* 0x0729 */ u8 field_0x729[0x72c - 0x729]; /* 0x072C */ f32 field_0x72c; /* 0x0730 */ s16 field_0x730; - /* 0x0732 */ u8 field_0x732[0x742 - 0x732]; + /* 0x0732 */ u8 field_0x732[2]; + /* 0x0734 */ f32 field_0x734; + /* 0x0738 */ s16 field_0x738; + /* 0x073A */ u8 field_0x73a[2]; + /* 0x073C */ f32 field_0x73c; + /* 0x0740 */ s16 field_0x740; /* 0x0742 */ csXyz field_0x742[11]; /* 0x0784 */ csXyz field_0x784[11]; - /* 0x07C6 */ u8 field_0x7c6[0x7cc - 0x7c6]; + /* 0x07C6 */ u8 field_0x7c6[0x7c8 - 0x7c6]; + /* 0x07C8 */ f32 field_0x7c8; /* 0x07CC */ s16 field_0x7cc; /* 0x07CE */ s16 field_0x7ce; /* 0x07D0 */ s16 field_0x7d0; @@ -93,24 +108,26 @@ class e_mf_class { /* 0x07DC */ s16 field_0x7dc; /* 0x07DE */ s16 field_0x7de; /* 0x07E0 */ s16 field_0x7e0; - /* 0x07E2 */ u8 field_0x7e2[0x7ea - 0x7e2]; + /* 0x07E2 */ s16 field_0x7e2[4]; /* 0x07EA */ s16 field_0x7ea; - /* 0x07EC */ u8 field_0x7ec[2]; + /* 0x07EC */ s16 field_0x7ec; /* 0x07EE */ csXyz field_0x7ee[4]; /* 0x0806 */ s16 field_0x806; /* 0x0808 */ s16 field_0x808; - /* 0x080A */ u8 field_0x80a[0x80e - 0x80a]; + /* 0x080A */ s16 field_0x80a; + /* 0x080C */ s16 field_0x80c; /* 0x080E */ s8 field_0x80e; /* 0x080F */ u8 field_0x80f[0x810 - 0x80f]; /* 0x0810 */ s16 field_0x810; /* 0x0812 */ s16 field_0x812; - /* 0x0814 */ u8 field_0x814[0x81c - 0x814]; + /* 0x0814 */ u8 field_0x814[0x816 - 0x814]; + /* 0x0816 */ csXyz field_0x816; /* 0x081C */ f32 field_0x81c; /* 0x0820 */ s16 field_0x820; /* 0x0822 */ s16 field_0x822; /* 0x0824 */ dBgS_AcchCir mAcchCir; /* 0x0864 */ dBgS_ObjAcch mObjAcch; - /* 0x0A3C */ u8 field_0xa3c[0xa40 - 0xa3c]; + /* 0x0A3C */ f32 field_0xa3c; /* 0x0A40 */ dCcD_Stts mStts; /* 0x0A7C */ dCcD_Sph field_0xa7c[3]; /* 0x0E24 */ dCcD_Sph field_0xe24; @@ -118,9 +135,14 @@ class e_mf_class { /* 0x1094 */ dCcU_AtInfo mAtInfo; /* 0x10B8 */ u8 field_0x10b8; /* 0x10B9 */ u8 field_0x10b9; - /* 0x10BA */ u8 field_0x10ba[0x10c4 - 0x10ba]; + /* 0x10BA */ u8 field_0x10ba; + /* 0x10BB */ u8 field_0x10bb; + /* 0x10BC */ u32 field_0x10bc; + /* 0x10C0 */ u32 field_0x10c0; /* 0x10C4 */ u8 field_0x10c4; - /* 0x10C5 */ u8 field_0x10c5[0x10ec - 0x10c5]; + /* 0x10C5 */ u8 field_0x10c5[0x10e4 - 0x10c5]; + /* 0x10E4 */ u32 field_0x10e4; + /* 0x10E8 */ u32 field_0x10e8; }; STATIC_ASSERT(sizeof(e_mf_class) == 0x10ec); diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index dda4c80f16e..3fecb3fcd84 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -265,6 +265,7 @@ class fopEn_enemy_c : public fopAc_ac_c { bool checkWolfDownPullFlg() const { return mFlags & 0x10; } bool checkDownFlg() const { return mFlags & 0x1; } bool checkCutDownHitFlg() const { return mFlags & 0x2; } + bool checkWolfDownStartFlg() const { return mFlags & 0x4; } bool checkDeadFlg() const { return mFlags & 0x8; } bool checkThrowMode(u8 param_1) const { return mThrowMode & param_1; } diff --git a/include/f_op/f_op_kankyo_mng.h b/include/f_op/f_op_kankyo_mng.h index fbb09287969..975c1d2028f 100644 --- a/include/f_op/f_op_kankyo_mng.h +++ b/include/f_op/f_op_kankyo_mng.h @@ -20,6 +20,7 @@ fpc_ProcID fopKyM_Create(s16 i_procName, fopKyM_CreateFunc i_createFunc, void* i base_process_class* fopKyM_fastCreate(s16 i_procName, int i_param, cXyz* i_pos, cXyz* i_scale, fopKyM_CreateFunc i_createFunc); fpc_ProcID fopKyM_createWpillar(cXyz const* i_pos, f32 scale, int i_param); +fpc_ProcID fopKyM_createMpillar(cXyz const* i_pos, f32 i_size); inline fopKyM_prm_class* fopKyM_GetAppend(void* i_process) { return (fopKyM_prm_class*)fpcM_GetAppend(i_process); diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index be6b4878fd9..bfc0981220e 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -9,6 +9,9 @@ #include "Z2AudioLib/Z2Instances.h" #include "f_op/f_op_actor_enemy.h" #include "d/d_bomb.h" +#include "f_op/f_op_kankyo_mng.h" +#include "d/actor/d_a_horse.h" +#include "d/d_com_inf_game.h" UNK_REL_DATA; // @@ -261,16 +264,6 @@ SECTION_DATA static void* lit_5567[9] = { (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x1FC), }; -/* 80713BC0-80713BC8 0000B8 0008+00 1/1 0/0 0/0 .data kado_bit$5580 */ -SECTION_DATA static u8 kado_bit[8] = { - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, -}; - -/* 80713BC8-80713BD0 0000C0 0008+00 1/1 0/0 0/0 .data kado_check_x$5581 */ -SECTION_DATA static u8 kado_check_x[8] = { - 0x42, 0xA0, 0x00, 0x00, 0xC2, 0xA0, 0x00, 0x00, -}; - /* 80713BD0-80713C50 -00001 0080+00 1/1 0/0 0/0 .data @6010 */ SECTION_DATA static void* lit_6010[32] = { (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x194), @@ -307,35 +300,6 @@ SECTION_DATA static void* lit_6010[32] = { (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xA9C), }; -/* 80713C50-80713C68 000148 0016+02 1/1 0/0 0/0 .data j_spd$6379 */ -SECTION_DATA static u8 j_spd[22 + 2 /* padding */] = { - 0x40, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - /* padding */ - 0x00, - 0x00, -}; - /* 80713C68-80713C70 000160 0008+00 1/1 0/0 0/0 .data foot_idx$6427 */ SECTION_DATA static u8 foot_idx[8] = { 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1E, @@ -714,7 +678,7 @@ static dBomb_c* search_bomb(e_mf_class* i_this, BOOL param_2) { sp50.y = bomb->current.pos.y - a_this->current.pos.y; sp50.z = bomb->current.pos.z - a_this->current.pos.z; - if (sp44.abs() < threshold && !(sp50.abs() > i_this->field_0x6b0 + 30.0f) && (!other_bg_check(i_this, bomb) || !param_2)) { + if (sp44.abs() < threshold && !(sp50.abs() > i_this->mPlayerDistance + 30.0f) && (!other_bg_check(i_this, bomb) || !param_2)) { if (param_2) { if (fabsf(50.0f + bomb->current.pos.y - a_this->eyePos.y) <= 300.0f) { s16 sVar1 = a_this->shape_angle.y - cM_atan2s(sp44.x, sp44.z); @@ -786,8 +750,8 @@ static int pl_check(e_mf_class* i_this, f32 param_2, s16 param_3) { fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; fopAc_ac_c* player = dComIfGp_getPlayer(0); - if (i_this->field_0x6b0 < param_2) { - s16 sVar1 = a_this->shape_angle.y - i_this->field_0x6b4; + if (i_this->mPlayerDistance < param_2) { + s16 sVar1 = a_this->shape_angle.y - i_this->mYAngleToPlayer; if (sVar1 < param_3 && sVar1 > (s16)-param_3 && !other_bg_check(i_this, player)) { return 1; } @@ -836,7 +800,7 @@ static BOOL jump_pos_check(e_mf_class* i_this, cXyz* param_2) { cXyz sp94, spa0; f32 fVar1 = 300.0f; - cMtx_YrotS(*calc_mtx, i_this->field_0x6b4); + cMtx_YrotS(*calc_mtx, i_this->mYAngleToPlayer); sp94.x = 0.0f; sp94.y = 200.0f; @@ -911,7 +875,7 @@ static void e_mf_stay(e_mf_class* i_this) { i_this->field_0x6c0[0] = cM_rndF(10.0f) + 20.0f; i_this->field_0x5b4 = 4; } else { - i_this->field_0x6ae = 10; + i_this->mAction = 10; i_this->field_0x5b4 = 0; } } @@ -963,11 +927,11 @@ static void e_mf_stay(e_mf_class* i_this) { if ((i_this->field_0x6ac & 15) == 0) { if (pl_check(i_this, i_this->field_0x6b8, 0x4000) != 0) { - i_this->field_0x6ae = 3; + i_this->mAction = 3; i_this->field_0x5b4 = -10; i_this->field_0x6c0[0] = 60; } else if (bomb_view_check(i_this) != NULL) { - i_this->field_0x6ae = 11; + i_this->mAction = 11; i_this->field_0x5b4 = 0; } } @@ -1006,7 +970,7 @@ static void e_mf_otoreac(e_mf_class* i_this) { sp40 = i_this->field_0x718 - a_this->current.pos; cLib_addCalcAngleS2(&a_this->current.angle.y, cM_atan2s(sp40.x, sp40.z), 2, 0xC00); if (sp40.abs() < 250.0f || i_this->mObjAcch.ChkWallHit() != 0) { - i_this->field_0x6ae = 0; + i_this->mAction = 0; i_this->field_0x5b4 = 0; i_this->field_0x6c0[0] = cM_rndF(50.0f) + 50.0f; anm_init(i_this, 33, 10.0f, 2, 1.0f); @@ -1019,11 +983,11 @@ static void e_mf_otoreac(e_mf_class* i_this) { cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); if ((i_this->field_0x6ac & 15) == 0) { if (pl_check(i_this, i_this->field_0x6b8, 0x4000) != 0) { - i_this->field_0x6ae = 3; + i_this->mAction = 3; i_this->field_0x5b4 = -10; i_this->field_0x6c0[0] = 60; } else if (bomb_view_check(i_this) != NULL) { - i_this->field_0x6ae = 11; + i_this->mAction = 11; i_this->field_0x5b4 = 0; } } @@ -1037,7 +1001,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { cXyz sp3c, sp48; dBomb_c* bomb = bomb_check(i_this); if (bomb == NULL) { - i_this->field_0x6ae = 3; + i_this->mAction = 3; i_this->field_0x5b4 = 0; return; } @@ -1074,7 +1038,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { case 4: if (bomb->speedF < 0.1f && !bomb->checkStateCarry() && JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 250.0f) { - sVar2 = i_this->field_0x6b4 - a_this->shape_angle.y; + sVar2 = i_this->mYAngleToPlayer - a_this->shape_angle.y; if (sVar2 < 0x4000 && sVar2 > -0x4000) { i_this->field_0x5b4 = 10; break; @@ -1092,7 +1056,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { case 5: i_this->mSound.startCreatureSoundLevel(Z2SE_EN_MF_V_LOOK_BOMB, 0, -1); - sVar1 = i_this->field_0x6b4; + sVar1 = i_this->mYAngleToPlayer; if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 500.0f) { i_this->field_0x5b4 = 2; } @@ -1115,7 +1079,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { case 11: i_this->field_0x6d2 = 0; - sVar1 = i_this->field_0x6b4; + sVar1 = i_this->mYAngleToPlayer; if (i_this->field_0x6c0[0] >= 10) { cMtx_YrotS(*calc_mtx, sVar1); @@ -1218,13 +1182,13 @@ static void e_mf_normal(e_mf_class* i_this) { BOOL bVar1 = fopAcM_otoCheck(a_this, 2000.0f) | daPy_getPlayerActorClass()->checkWolfBark(); if ((i_this->field_0x6ac & 15) == 0 || bVar1) { if (bVar1 || pl_check(i_this, i_this->field_0x6b8, sVar1) != 0) { - i_this->field_0x6ae = 3; + i_this->mAction = 3; i_this->field_0x5b4 = -10; i_this->field_0x6c0[0] = 60; } if (bomb_view_check(i_this) != NULL) { - i_this->field_0x6ae = 11; + i_this->mAction = 11; i_this->field_0x5b4 = 0; } } @@ -1252,7 +1216,7 @@ static void e_mf_drawback(e_mf_class* i_this) { cLib_addCalc0(&a_this->speedF, 1.0f, 0.1f); if (i_this->mpModelMorf->isStop() || i_this->field_0x6c0[0] == 0) { - i_this->field_0x6ae = 3; + i_this->mAction = 3; i_this->field_0x5b4 = 0; i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_AWAKE, -1); } @@ -1260,7 +1224,7 @@ static void e_mf_drawback(e_mf_class* i_this) { } if (move_gake_check(i_this, 50.0f, 1)) { - i_this->field_0x6ae = 23; + i_this->mAction = 23; i_this->field_0x5b4 = 0; } } @@ -1304,7 +1268,7 @@ static void e_mf_wolfbite(e_mf_class* i_this) { player->offWolfEnemyHangBite(); i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - player->shape_angle.y; i_this->field_0x72c = 150.0f; - i_this->field_0x6ae = 21; + i_this->mAction = 21; i_this->field_0x5b4 = 0; i_this->field_0x704.y = player->shape_angle.y + 0x8000; a_this->speed.y = 0.0f; @@ -1336,7 +1300,7 @@ static void e_mf_wolfbite(e_mf_class* i_this) { case 3: if (i_this->mpModelMorf->isStop()) { - i_this->field_0x6ae = 3; + i_this->mAction = 3; i_this->field_0x5b4 = 0; i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_AWAKE, -1); } @@ -1346,7 +1310,7 @@ static void e_mf_wolfbite(e_mf_class* i_this) { /* 8070D090-8070D0D0 002A70 0040+00 1/1 0/0 0/0 .text way_check__FP10e_mf_class */ static int way_check(e_mf_class* i_this) { fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; - s16 sVar1 = a_this->shape_angle.y - i_this->field_0x6b4; + s16 sVar1 = a_this->shape_angle.y - i_this->mYAngleToPlayer; if (sVar1 <= 0x4000 && sVar1 >= -0x4000) { return 0; } @@ -1358,293 +1322,1754 @@ static int way_check(e_mf_class* i_this) { return 2; } -/* ############################################################################################## */ -/* 80713A34-80713A38 0000C0 0004+00 0/1 0/0 0/0 .rodata @4971 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4971 = 1000.0f; -COMPILER_STRIP_GATE(0x80713A34, &lit_4971); -#pragma pop - /* 8070D0D0-8070D2C8 002AB0 01F8+00 1/1 0/0 0/0 .text shot_s_sub__FPvPv */ -static void shot_s_sub(void* i_actor, void* i_data) { - // NONMATCHING - +static void* shot_s_sub(void* i_actor, void* i_data) { + e_mf_class* i_this = (e_mf_class*)i_data; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + if ((fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_ARROW && (fopAcM_GetParam(i_actor) == 1 || fopAcM_GetParam(i_actor) == 2)) || + fopAcM_GetName(i_actor) == PROC_BOOMERANG && dComIfGp_checkPlayerStatus0(0, 0x80000) == 0 && daPy_py_c::checkBoomerangCharge() && fopAcM_GetParam(i_actor) == 1) { + cXyz sp28(a_this->current.pos - ((fopAc_ac_c*)i_actor)->current.pos); + if (sp28.abs() < 1000.0f) { + return i_actor; + } + } + + if (dComIfGp_checkPlayerStatus0(0, 0x400) != 0 && i_this->mPlayerDistance < 1000.0f) { + return dComIfGp_getPlayer(0); + } + + return NULL; } -/* ############################################################################################## */ -/* 80713A38-80713A3C 0000C4 0004+00 0/2 0/0 0/0 .rodata @5152 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5152 = 120.0f; -COMPILER_STRIP_GATE(0x80713A38, &lit_5152); -#pragma pop +/* 8070D2C8-8070DBB4 002CA8 08EC+00 1/1 0/0 0/0 .text e_mf_fight_run__FP10e_mf_class */ +static void e_mf_fight_run(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp4c, sp58; + f32 fVar1 = 0.0f; + int frame = i_this->mpModelMorf->getFrame(); + s8 sVar4 = 1; -/* 80713A3C-80713A40 0000C8 0004+00 0/1 0/0 0/0 .rodata @5153 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5153 = 32763.0f; -COMPILER_STRIP_GATE(0x80713A3C, &lit_5153); -#pragma pop + if (pl_check(i_this, i_this->field_0x6b8 + 50.0f, 0x7FFF) == 0 && i_this->field_0x6c0[0] == 0) { + if (i_this->field_0x6ca == 0) { + sVar4 = 0; + } + } else { + i_this->field_0x6ca = 40; + } -/* 80713A40-80713A44 0000CC 0004+00 0/1 0/0 0/0 .rodata @5154 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5154 = 13.0f / 20.0f; -COMPILER_STRIP_GATE(0x80713A40, &lit_5154); -#pragma pop + switch (i_this->field_0x5b4) { + case -10: + anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->field_0x6c0[1] = cM_rndF(10.0f) + 15.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND, -1); + i_this->field_0x5b4 = -9; + break; -/* 80713A44-80713A48 0000D0 0004+00 0/4 0/0 0/0 .rodata @5155 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5155 = 0.5f; -COMPILER_STRIP_GATE(0x80713A44, &lit_5155); -#pragma pop + case -9: + cLib_addCalc0(&a_this->speedF, 1.0f, 5.0f); + if (i_this->field_0x6c0[1] == 0) { + i_this->field_0x5b4 = 0; + } + break; -/* 80713A48-80713A4C 0000D4 0004+00 0/1 0/0 0/0 .rodata @5156 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5156 = 19.0f / 10.0f; -COMPILER_STRIP_GATE(0x80713A48, &lit_5156); -#pragma pop + case 0: + anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + i_this->field_0x5b4 = 1; + i_this->field_0x80c = 0; + // fallthrough + case 1: + fVar1 = l_HIO.dash_speed; + if ((i_this->field_0x6ac & 3) == 0) { + if ((i_this->field_0x6ac & 4) != 0) { + i_this->field_0x10c4 = 1; + } else { + i_this->field_0x10c4 = 2; + } + } -/* 8070D2C8-8070DBB4 002CA8 08EC+00 1/1 0/0 0/0 .text e_mf_fight_run__FP10e_mf_class */ -static void e_mf_fight_run(e_mf_class* i_this) { - // NONMATCHING -} + if (i_this->mObjAcch.ChkWallHit() != 0 && !fopAcM_wayBgCheck(a_this, 200.0f, 120.0f)) { + i_this->field_0x80c++; + } else if (i_this->mPlayerDistance < l_HIO.battle_init_range) { + anm_init(i_this, 32, 5.0f, 2, 1.0f); + i_this->field_0x5b4 = 2; + i_this->field_0x6c0[2] = cM_rndF(30.0f) + 30.0f; + } -/* 8070DBB4-8070DDDC 003594 0228+00 1/1 0/0 0/0 .text e_mf_jump__FP10e_mf_class */ -static void e_mf_jump(e_mf_class* i_this) { - // NONMATCHING -} + if (i_this->field_0x80c > 20) { + i_this->mAction = 8; + i_this->field_0x5b4 = 0; + return; + } -/* ############################################################################################## */ -/* 80713A4C-80713A50 0000D8 0004+00 0/2 0/0 0/0 .rodata @5310 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5310 = 35.0f; -COMPILER_STRIP_GATE(0x80713A4C, &lit_5310); -#pragma pop + if (move_gake_check(i_this, 50.0f, 0)) { + i_this->mAction = 25; + i_this->field_0x5b4 = 0; + i_this->field_0x6c8 = 100; + a_this->speedF = 0.0f; + return; + } + break; -/* 80713A50-80713A54 0000DC 0004+00 0/1 0/0 0/0 .rodata @5311 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5311 = 11.0f / 10.0f; -COMPILER_STRIP_GATE(0x80713A50, &lit_5311); -#pragma pop + case 2: + i_this->field_0x80e = 1; + if (frame == 7 || frame == 21) { + a_this->speed.y = 10.0f; + if (i_this->mPlayerDistance > (l_HIO.battle_init_range + 250.0f)) { + i_this->field_0x5b4 = 0; + a_this->current.angle.y = a_this->shape_angle.y; + break; + } -/* 8070DDDC-8070E30C 0037BC 0530+00 1/1 0/0 0/0 .text e_mf_gakejump__FP10e_mf_class */ -static void e_mf_gakejump(e_mf_class* i_this) { - // NONMATCHING -} + if (i_this->mPlayerDistance > (l_HIO.battle_init_range + 100.0f)) { + a_this->current.angle.y = i_this->mYAngleToPlayer; + } else if (i_this->mPlayerDistance < (l_HIO.battle_init_range - 100.0f)) { + a_this->current.angle.y = -i_this->mYAngleToPlayer; + } else { + a_this->current.angle.y = cM_rndFX(32763.0f); + } -/* 8070E30C-8070E36C 003CEC 0060+00 2/2 0/0 0/0 .text at_hit_check__FP10e_mf_class */ -static void at_hit_check(e_mf_class* i_this) { - // NONMATCHING -} + a_this->speedF = cM_rndF(5.0f) + 5.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_BREATH, -1); + } -/* ############################################################################################## */ -/* 80713A54-80713A58 0000E0 0004+00 0/1 0/0 0/0 .rodata @5389 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5389 = 6.0f; -COMPILER_STRIP_GATE(0x80713A54, &lit_5389); -#pragma pop + if (frame == 13 || frame == 27) { + a_this->speedF = 0.0f; + i_this->field_0x10c4 = 3; + if (frame == 13) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_L, 0, -1); + } else { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_R, 0, -1); + } + } -/* 80713A58-80713A5C 0000E4 0004+00 0/1 0/0 0/0 .rodata @5390 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5390 = -35.0f; -COMPILER_STRIP_GATE(0x80713A58, &lit_5390); -#pragma pop + a_this->gravity = -5.0f; + break; + } -/* 80713A5C-80713A60 0000E8 0004+00 1/3 0/0 0/0 .rodata @5391 */ -SECTION_RODATA static f32 const lit_5391 = 25.0f; -COMPILER_STRIP_GATE(0x80713A5C, &lit_5391); + s16 sVar1; + if (i_this->field_0x5b4 >= 0) { + if (i_this->field_0x80e == 0) { + sVar1 = a_this->current.angle.y; + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + sVar1 -= a_this->current.angle.y; + s16 sVar2 = a_this->current.angle.y - i_this->mYAngleToPlayer; + if (sVar2 > 0x800 || sVar2 < -0x800) { + fVar1 = 0.0f; + } -/* 8070E36C-8070E5E0 003D4C 0274+00 1/1 0/0 0/0 .text e_mf_attack__FP10e_mf_class */ -static void e_mf_attack(e_mf_class* i_this) { - // NONMATCHING -} + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); + } else { + sVar1 = a_this->shape_angle.y; + cLib_addCalcAngleS2(&a_this->shape_angle.y, i_this->mYAngleToPlayer, 4, 0x800); + sVar1 -= a_this->shape_angle.y; + } -/* 8070E5E0-8070E760 003FC0 0180+00 1/1 0/0 0/0 .text tail_eff_set__FP10e_mf_class */ -static void tail_eff_set(e_mf_class* i_this) { - // NONMATCHING -} + sVar1 *= 2; + if (sVar1 > 0x1000) { + sVar1 = 0x1000; + } else if (sVar1 < -0x1000) { + sVar1 = -0x1000; + } + cLib_addCalcAngleS2(&i_this->field_0x806, sVar1, 2, 0x400); + } -/* ############################################################################################## */ -/* 80713A60-80713A64 0000EC 0004+00 0/1 0/0 0/0 .rodata @5509 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5509 = 55.0f; -COMPILER_STRIP_GATE(0x80713A60, &lit_5509); -#pragma pop + u8 sVar3 = 0; + if (fpcM_Search(shot_s_sub, i_this) != NULL || daPy_getPlayerActorClass()->checkHookshotShootReturnMode()) { + sVar3 = 1; + OS_REPORT(" DEF ON !!\n"); + } -/* 80713A64-80713A68 0000F0 0004+00 0/1 0/0 0/0 .rodata @5510 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5510 = 4.0f; -COMPILER_STRIP_GATE(0x80713A64, &lit_5510); -#pragma pop + if (i_this->mPlayerDistance < 300.0f && daPy_getPlayerActorClass()->checkSpinnerRide() != 0) { + sVar3 = 2; + } -/* 8070E760-8070EA10 004140 02B0+00 1/1 0/0 0/0 .text e_mf_tail_attack__FP10e_mf_class */ -static void e_mf_tail_attack(e_mf_class* i_this) { - // NONMATCHING -} + if (sVar4 == 0) { + if (i_this->field_0x6ca == 0) { + i_this->mAction = 0; + i_this->field_0x5b4 = 0; + i_this->field_0x6c0[0] = cM_rndF(50.0f) + 50.0f; + anm_init(i_this, 33, 10.0f, 2, 1.0f); -/* ############################################################################################## */ -/* 80713A68-80713A6C 0000F4 0004+00 0/1 0/0 0/0 .rodata @5566 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5566 = -8.0f; -COMPILER_STRIP_GATE(0x80713A68, &lit_5566); -#pragma pop + if (i_this->field_0x80e == 0) { + return; + } -/* 8070EA10-8070EC60 0043F0 0250+00 2/1 0/0 0/0 .text e_mf_guard__FP10e_mf_class */ -static void e_mf_guard(e_mf_class* i_this) { - // NONMATCHING -} + a_this->current.angle.y = a_this->shape_angle.y; + return; + } + } else { + if ((sVar3 == 2 || dComIfGp_checkPlayerStatus1(0, 0x2000000) != 0) || (((i_this->mXAngleToPlayer < 0x1000 && i_this->mXAngleToPlayer > -0x1000) || sVar3 != 0) && player_way_check(i_this))) { + if ((sVar3 != 0 || (i_this->mPlayerDistance < l_HIO.battle_init_range && + ((daPy_getPlayerActorClass()->getCutAtFlg() != 0 || daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_JUMP) || + ((i_this->field_0x6ac & 48) != 0 && daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_GUARD_ATTACK)))) && i_this->field_0x72c < 1.0f) { + i_this->mAction = 7; + if (cc_pl_cut_bit_get() == 0x100) { + i_this->field_0x5b4 = 0; + } else { + i_this->field_0x5b4 = 5; + } -/* 8070EC60-8070ED10 004640 00B0+00 1/1 0/0 0/0 .text e_mf_s_damage__FP10e_mf_class */ -static void e_mf_s_damage(e_mf_class* i_this) { - // NONMATCHING -} + i_this->field_0x6e8 = 30.0f; + i_this->field_0x6ec = a_this->shape_angle.y; + i_this->field_0x6c0[0] = 0; + i_this->field_0x6c8 = 15; + } else { + if (i_this->mPlayerDistance < l_HIO.attack_init_range) { + if (i_this->field_0x6c0[2] == 0) { + i_this->field_0x6c0[2] = cM_rndF(60.0f) + 30.0f; + if (way_check(i_this) == 0 && cM_rndF(1.0f) < 0.65f) { + i_this->mAction = 5; + i_this->field_0x5b4 = 0; + } else { + i_this->mAction = 6; + i_this->field_0x5b4 = 0; + } + } + } else { + i_this->field_0x6c0[2] = cM_rndF(50.0f) + 30.0f; + } -/* ############################################################################################## */ -/* 80713A6C-80713A70 0000F8 0004+00 0/2 0/0 0/0 .rodata @5615 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5615 = 70.0f; -COMPILER_STRIP_GATE(0x80713A6C, &lit_5615); -#pragma pop + } + } + } -/* 80713A70-80713A74 0000FC 0004+00 0/1 0/0 0/0 .rodata @5616 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5616 = -150.0f; -COMPILER_STRIP_GATE(0x80713A70, &lit_5616); -#pragma pop + i_this->field_0x6d4 = 1; + if ((i_this->field_0x6ac & 15) == 0 && bomb_view_check(i_this) != NULL) { + i_this->mAction = 11; + i_this->field_0x5b4 = 0; + } -/* 8070ED10-8070EEC4 0046F0 01B4+00 1/1 0/0 0/0 .text kado_check__FP10e_mf_class */ -static void kado_check(e_mf_class* i_this) { - // NONMATCHING -} + if (move_gake_check(i_this, 150.0f, 1) && (i_this->field_0x6ac & 15) == 0 && cM_rndF(1.0f) < 0.5f) { + i_this->field_0x6e0 = cM_rndF(10.0f) + 10.0f; + i_this->field_0x6e1 = cM_rndF(1.9f); + } -/* 8070EEC4-8070F014 0048A4 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_mf_class */ -static void body_gake(e_mf_class* i_this) { - // NONMATCHING -} + if (move_gake_check(i_this, 50.0f, 1)) { + if (cM_rndF(1.0f) < 0.5f) { + i_this->mAction = 6; + i_this->field_0x5b4 = 0; + } else { + i_this->mAction = 25; + i_this->field_0x5b4 = 0; + i_this->field_0x5c8 = a_this->current.pos; + i_this->field_0x5bc = a_this->current.pos; + i_this->field_0x6c8 = 100; + } -/* 8070F014-8070F08C 0049F4 0078+00 4/3 0/0 0/0 .text __dt__14dBgS_ObjGndChkFv */ -// dBgS_ObjGndChk::~dBgS_ObjGndChk() { -extern "C" void __dt__14dBgS_ObjGndChkFv() { - // NONMATCHING + a_this->speedF = 0.0f; + } + + if (i_this->mAction != 3 && i_this->field_0x80e != 0) { + a_this->current.angle.y = a_this->shape_angle.y; + } } -/* ############################################################################################## */ -/* 80713A74-80713A78 000100 0004+00 0/1 0/0 0/0 .rodata @6006 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6006 = 8000.0f; -COMPILER_STRIP_GATE(0x80713A74, &lit_6006); -#pragma pop +/* 8070DBB4-8070DDDC 003594 0228+00 1/1 0/0 0/0 .text e_mf_jump__FP10e_mf_class */ +static void e_mf_jump(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->field_0x6d4 = 1; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 27, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + return; -/* 8070F08C-8070FBEC 004A6C 0B60+00 2/1 0/0 0/0 .text e_mf_damage__FP10e_mf_class */ -static void e_mf_damage(e_mf_class* i_this) { - // NONMATCHING -} + case 1: + if (!i_this->mpModelMorf->isStop()) { + return; + } -/* ############################################################################################## */ -/* 80713A78-80713A7C 000104 0004+00 0/0 0/0 0/0 .rodata @6007 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6007 = -100.0f; -COMPILER_STRIP_GATE(0x80713A78, &lit_6007); -#pragma pop + a_this->speed.y = 50.0f; + i_this->field_0x5b4 = 2; + i_this->field_0x10c4 = 3; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_JUMP, -1); + // fallthrough + case 2: + a_this->speedF = 30.0f; + if (a_this->speed.y <= 0.0f) { + anm_init(i_this, 28, 5.0f, 0, 1.0f); + i_this->field_0x5b4 = 3; + } + return; -/* 80713A7C-80713A80 000108 0004+00 0/0 0/0 0/0 .rodata @6008 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6008 = 9.0f / 5.0f; -COMPILER_STRIP_GATE(0x80713A7C, &lit_6008); -#pragma pop + case 3: + if (!i_this->mObjAcch.ChkGroundHit()) { + return; + } -/* 80713A80-80713A84 00010C 0004+00 0/3 0/0 0/0 .rodata @6009 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6009 = -20.0f; -COMPILER_STRIP_GATE(0x80713A80, &lit_6009); -#pragma pop + anm_init(i_this, 29, 1.0f, 0, 1.0f); + i_this->field_0x5b4 = 4; + i_this->field_0x10c4 = 3; + i_this->field_0x6c0[0] = 3; + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_R, 0, -1); + return; -/* 80713A84-80713A88 000110 0004+00 0/1 0/0 0/0 .rodata @6033 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6033 = -3.0f; -COMPILER_STRIP_GATE(0x80713A84, &lit_6033); -#pragma pop + case 4: + if (i_this->field_0x6c0[0] == 1) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_L, 0, -1); + } -/* 80713A88-80713A8C 000114 0004+00 0/1 0/0 0/0 .rodata @6034 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6034 = -6.0f; -COMPILER_STRIP_GATE(0x80713A88, &lit_6034); -#pragma pop + cLib_addCalc0(&a_this->speedF, 1.0f, 10.0f); + if (!i_this->mpModelMorf->isStop()) { + return; + } -/* 8070FBEC-8070FD40 0055CC 0154+00 1/1 0/0 0/0 .text e_mf_backdrop__FP10e_mf_class */ -static void e_mf_backdrop(e_mf_class* i_this) { - // NONMATCHING + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + return; + } } -/* 8070FD40-8070FEE0 005720 01A0+00 1/1 0/0 0/0 .text e_mf_water__FP10e_mf_class */ -static void e_mf_water(e_mf_class* i_this) { - // NONMATCHING -} +/* 8070DDDC-8070E30C 0037BC 0530+00 1/1 0/0 0/0 .text e_mf_gakejump__FP10e_mf_class */ +static void e_mf_gakejump(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp24, sp30; -/* 8070FEE0-8070FF98 0058C0 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_mf_class */ -static void wolfkick_damage(e_mf_class* i_this) { - // NONMATCHING -} + i_this->field_0x6d4 = 1; + switch (i_this->field_0x5b4) { + case 0: + if (jump_pos_check(i_this, &i_this->field_0x5bc)) { + anm_init(i_this, 27, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 2; + a_this->current.angle.y = i_this->mYAngleToPlayer; + return; + } -/* ############################################################################################## */ -/* 80713A8C-80713A90 000118 0004+00 0/1 0/0 0/0 .rodata @6087 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6087 = 3000.0f; -COMPILER_STRIP_GATE(0x80713A8C, &lit_6087); -#pragma pop + if (i_this->field_0x5e0 != 31) { + anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + i_this->field_0x6c0[0] = cM_rndF(15.0f) + 35.0f; + i_this->field_0x5b4 = 1; + } -/* 80713A90-80713A94 00011C 0004+00 0/1 0/0 0/0 .rodata @6088 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6088 = 800.0f; -COMPILER_STRIP_GATE(0x80713A90, &lit_6088); -#pragma pop + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 4, 0x800); + return; -/* 80713A94-80713A98 000120 0004+00 0/1 0/0 0/0 .rodata @6089 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6089 = 700.0f; -COMPILER_STRIP_GATE(0x80713A94, &lit_6089); -#pragma pop + case 1: + i_this->field_0x6d4 = 2; + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + sp24.x = 0.0f; + sp24.y = 0.0f; + sp24.z = 100.0f; + MtxPosition(&sp24, &i_this->field_0x718); + i_this->field_0x718 += a_this->current.pos; + + if (i_this->field_0x6c0[0] != 0) { + return; + } + + i_this->field_0x5b4 = 0; + return; + + case 2: + if (!i_this->mpModelMorf->isStop()) { + return; + } + + if (jump_pos_check(i_this, &i_this->field_0x5bc)) { + i_this->field_0x5b4 = 3; + i_this->field_0x10c4 = 3; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_JUMP, -1); + i_this->field_0x6c0[0] = 20; + i_this->field_0x6c0[1] = 60; + i_this->field_0x5c8 = a_this->current.pos; + } else { + anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + i_this->field_0x6c0[0] = cM_rndF(15.0f) + 35.0f; + i_this->field_0x5b4 = 1; + return; + } + // fallthrough + case 3: + i_this->field_0x5d8 = 1; + sp24 = i_this->field_0x5bc - a_this->current.pos; + i_this->field_0x5d4 = cM_atan2s(sp24.x, sp24.z); + i_this->field_0x5d6 = -cM_atan2s(sp24.y, JMAFastSqrt(sp24.x * sp24.x + sp24.z * sp24.z)); + a_this->speedF = 50.0f; + + if (i_this->field_0x6c0[0] == 1) { + anm_init(i_this, 28, 5.0f, 0, 1.0f); + } + + if (sp24.abs() < (a_this->speedF * 1.1f)) { + a_this->current.pos = i_this->field_0x5bc; + anm_init(i_this, 29, 1.0f, 0, 1.0f); + i_this->field_0x5b4 = 4; + i_this->field_0x10c4 = 3; + i_this->field_0x6c0[0] = 3; + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_R, 0, -1); + a_this->speedF = 0.0f; + i_this->field_0x6c8 = 0; + } + + if (i_this->field_0x6c0[1] == 0 || i_this->mObjAcch.ChkWallHit() != 0) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + return; + + case 4: + if (i_this->field_0x6c0[0] == 1) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_L, 0, -1); + } + + if (!i_this->mpModelMorf->isStop()) { + return; + } + + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + return; + } +} + +/* 8070E30C-8070E36C 003CEC 0060+00 2/2 0/0 0/0 .text at_hit_check__FP10e_mf_class */ +static fopAc_ac_c* at_hit_check(e_mf_class* i_this) { + if (i_this->field_0x5b4 >= 10) { + return NULL; + } + + if (i_this->field_0xe24.ChkAtHit() != 0) { + return dCc_GetAc(i_this->field_0xe24.GetAtHitObj()->GetAc()); + } + + return NULL; +} + +/* 8070E36C-8070E5E0 003D4C 0274+00 1/1 0/0 0/0 .text e_mf_attack__FP10e_mf_class */ +static void e_mf_attack(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp34, sp40; + int frame = i_this->mpModelMorf->getFrame(); + + i_this->field_0x6d4 = 1; + s16 sVar1, sVar2; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 5, 6.0f, 0, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_KNIFE2_A, -1); + i_this->field_0x5b4 = 1; + // fallthrough + case 1: + if (frame < 15 || (frame >= 34 && frame <= 43)) { + sVar1 = a_this->current.angle.y; + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + sVar1 -= a_this->current.angle.y; + sVar1 *= 2; + if (sVar1 > 0x1000) { + sVar1 = 0x1000; + } else if (sVar1 < -0x1000) { + sVar1 = -0x1000; + } + cLib_addCalcAngleS2(&i_this->field_0x806, sVar1, 2, 0x400); + } + + if (frame >= 15 && frame <= 20) { + i_this->field_0x6cf = 1; + i_this->field_0x6ce = 0; + } + + if (frame >= 34 && frame <= 43) { + i_this->field_0x6cf = 1; + i_this->field_0x6ce = 1; + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + sp34.x = 0.0f; + sp34.y = 0.0f; + if (i_this->field_0x6c0[1] != 0) { + sp34.z = -35.0f; + } else { + sp34.z = 25.0f; + } + MtxPosition(&sp34, &sp40); + a_this->current.pos += sp40; + } + + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } + + cLib_addCalc0(&a_this->speedF, 1.0f, 5.0f); + if (i_this->field_0x6cf != 0) { + fopAc_ac_c* actor_p = at_hit_check(i_this); + if (actor_p != NULL && fopAcM_GetName(actor_p) == PROC_ALINK && daPy_getPlayerActorClass()->checkPlayerGuard()) { + i_this->mpModelMorf->setPlaySpeed(0.0f); + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } +} + +/* 8070E5E0-8070E760 003FC0 0180+00 1/1 0/0 0/0 .text tail_eff_set__FP10e_mf_class */ +static void tail_eff_set(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + J3DModel* model = i_this->mpModelMorf->getModel(); + i_this->field_0x10e4 = dComIfGp_particle_set(i_this->field_0x10e4, 0x815F, &a_this->current.pos, NULL, NULL); + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x10e4); + if (emitter != NULL) { + MTXCopy(model->getAnmMtx(0), *calc_mtx); + emitter->setGlobalRTMatrix(*calc_mtx); + } + + i_this->field_0x10e8 = dComIfGp_particle_set(i_this->field_0x10e8, 0x8160, &a_this->current.pos, NULL, NULL); + emitter = dComIfGp_particle_getEmitter(i_this->field_0x10e8); + if (emitter != NULL) { + MTXCopy(model->getAnmMtx(0), *calc_mtx); + emitter->setGlobalRTMatrix(*calc_mtx); + } +} + +/* 8070E760-8070EA10 004140 02B0+00 1/1 0/0 0/0 .text e_mf_tail_attack__FP10e_mf_class */ +static void e_mf_tail_attack(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp30, sp3c; + int frame = i_this->mpModelMorf->getFrame(); + + i_this->field_0x6d4 = 1; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 8, 5.0f, 0, 1.0f); + i_this->mpModelMorf->setFrame(20.0f); + i_this->field_0x5b4 = 1; + i_this->field_0x6c0[1] = 0; + break; + + case 1: + tail_eff_set(i_this); + if (frame >= 33 && frame <= 41) { + i_this->field_0x6cf = 1; + i_this->field_0x6ce = 2; + cMtx_YrotS(*calc_mtx, i_this->mYAngleToPlayer); + sp30.x = 0.0f; + sp30.y = 0.0f; + sp30.z = 30.0f; + MtxPosition(&sp30, &sp3c); + a_this->current.pos += sp3c; + + if (at_hit_check(i_this) != NULL) { + i_this->field_0x6c0[1] = 80; + } + } + + if (i_this->field_0x6c0[1] != 0 && i_this->mpModelMorf->checkFrame(55.0f)) { + i_this->mAction = 5; + i_this->field_0x5b4 = 1; + anm_init(i_this, 5, 4.0f, 0, 1.0f); + i_this->mpModelMorf->setFrame(20.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_KNIFE2_A, -1); + return; + } + + if (frame == 40) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_R, 0, -1); + } else if (frame == 43) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_L, 0, -1); + } + + if (i_this->mpModelMorf->isStop()) { + if (i_this->field_0x6c0[1] != 0) { + i_this->field_0x5b4 = 0; + } else { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } + } + + a_this->current.angle.y += i_this->field_0x80a; + a_this->shape_angle.y += i_this->field_0x80a; + cLib_addCalcAngleS2(&i_this->field_0x80a, 0, 1, 300); + cLib_addCalc0(&a_this->speedF, 1.0f, 3.0f); +} + +/* 8070EA10-8070EC60 0043F0 0250+00 2/1 0/0 0/0 .text e_mf_guard__FP10e_mf_class */ +static void e_mf_guard(e_mf_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->field_0x6d1 = 1; + i_this->field_0x6d4 = 1; + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 32, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + a_this->speed.y = 20.0f; + a_this->speedF = -8.0f; + i_this->field_0x10c4 = 3; + break; + + case 1: + i_this->field_0x6c8 = 5; + if (i_this->mpModelMorf->getFrame() >= 5.0f) { + i_this->field_0x5b4 = 5; + i_this->field_0x6c0[0] = 20; + } + break; + + case 5: + anm_init(i_this, 22, 3.0f, 0, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_GUARD, -1); + i_this->field_0x5b4 = 6; + // fallthrough + case 6: + i_this->field_0x6c8 = 5; + if (i_this->mObjAcch.ChkGroundHit()) { + cLib_addCalc0(&a_this->speedF, 1.0f, 10.0f); + } + + if (i_this->mpModelMorf->getFrame() >= 8.0f) { + i_this->mpModelMorf->setPlaySpeed(0.0f); + i_this->field_0x5b4 = 7; + a_this->speedF = 0.0f; + } + break; + + case 7: + if (cc_pl_cut_bit_get() == 0x80 || cc_pl_cut_bit_get() == 0x800) { + i_this->field_0x6c0[0] = 2; + i_this->field_0x6c8 = 10; + } + + if (dComIfGp_checkPlayerStatus0(0, 0x400) != 0) { + i_this->field_0x6c0[0] = 20; + } + + if (i_this->mPlayerDistance < 300.0f && daPy_getPlayerActorClass()->checkSpinnerRide() != 0) { + i_this->field_0x6c0[0] = 2; + } + + if (i_this->field_0x6c0[0] == 0) { + i_this->field_0x5b4 = 8; + i_this->mpModelMorf->setPlaySpeed(1.0f); + } + break; + + case 8: + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } +} + +/* 8070EC60-8070ED10 004640 00B0+00 1/1 0/0 0/0 .text e_mf_s_damage__FP10e_mf_class */ +static void e_mf_s_damage(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + switch (i_this->field_0x5b4) { + case 0: + i_this->field_0x5b4 = 1; + i_this->field_0x6c0[0] = 20; + anm_init(i_this, 31, 10.0f, 2, 1.0f); + break; + + case 1: + if (i_this->field_0x6c0[0] == 0) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + i_this->field_0x6c0[0] = 40; + } + } + + cLib_addCalc0(&a_this->speedF, 1.0f, 3.0f); +} + +/* 8070ED10-8070EEC4 0046F0 01B4+00 1/1 0/0 0/0 .text kado_check__FP10e_mf_class */ +static int kado_check(e_mf_class* i_this) { + // NONMATCHING + static int kado_bit[2] = { + 1, 2, + }; + + static f32 kado_check_x[2] = { + 80.0f, -80.0f, + }; + + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_LinChk lin_chk; + cXyz sp9c, spa8, spb4; + BOOL rv = FALSE; + + cMtx_YrotS(*calc_mtx, i_this->field_0x704.y); + for (int i = 0; i < 2; i++) { + spa8 = a_this->current.pos; + spa8.y += 100.0f; + sp9c.x = 0.0f; + sp9c.y = 0.0f; + sp9c.z = 70.0f; + MtxPosition(&sp9c, &spb4); + spa8 += spb4; + sp9c.y = 50.0f; + sp9c.z = -150.0f; + sp9c.x = 1.0f * kado_check_x[i]; + MtxPosition(&sp9c, &spb4); + spb4 += spa8; + lin_chk.Set(&spa8, &spb4, a_this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + rv |= kado_bit[i]; + } + } + + if (rv == 3) { + rv = FALSE; + } + + return rv; +} + +/* 8070EEC4-8070F014 0048A4 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_mf_class */ +static BOOL body_gake(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + J3DModel* model = i_this->mpModelMorf->getModel(); + cXyz sp7c, sp88; + + MTXCopy(model->getAnmMtx(2), *calc_mtx); + sp7c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp7c, &sp88); + + dBgS_ObjGndChk gnd_chk; + sp88.y += 100.0f; + gnd_chk.SetPos(&sp88); + sp88.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if ((a_this->current.pos.y - sp88.y) > 300.0f) { + return TRUE; + } + + return FALSE; +} + +/* 8070F08C-8070FBEC 004A6C 0B60+00 2/1 0/0 0/0 .text e_mf_damage__FP10e_mf_class */ +static void e_mf_damage(e_mf_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp34, sp40; + + if (a_this->health <= 0) { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } + + if (daPy_py_c::checkNowWolf() != 0) { + if (i_this->field_0x6d3 == 0 && a_this->checkWolfDownStartFlg()) { + if (i_this->field_0x6c0[0] > 40) { + i_this->field_0x6c0[0] = 90; + OS_REPORT(" DN WOLFHIT LONG \n"); + } else if (i_this->field_0x6c0[0] > 20) { + i_this->field_0x6c0[0] = 70; + OS_REPORT(" DN WOLFHIT MID \n"); + } else { + i_this->field_0x6c0[0] = 50; + OS_REPORT(" DN WOLFHIT SHORT \n"); + } + + i_this->field_0x5b4 = 30; + i_this->field_0x6d3 = 1; + i_this->field_0x6c0[1] = l_HIO.field_0x20 + 1; + } + } else if (i_this != NULL && a_this->checkCutDownHitFlg()) { + a_this->offCutDownHitFlg(); + i_this->field_0x5b4 = 3; + a_this->health = 0; + i_this->field_0x6c0[0] = 100; + i_this->field_0x6c0[1] = 46; + a_this->offDownFlg(); + a_this->health = 0; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DEATH, -1); + i_this->field_0x6a4 = 1; + daPy_getPlayerActorClass()->onEnemyDead(); + i_this->field_0x7ec = 15; + } + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 9, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + a_this->speedF = 0.0f; + i_this->field_0x7c8 = 8000.0f; + + if (a_this->health <= 0) { + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DEATH, -1); + i_this->field_0x6a4 = 1; + daPy_getPlayerActorClass()->onEnemyDead(); + } else { + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DAMAGE2, -1); + } + + i_this->field_0x6c0[0] = 0; + break; + + case 1: + if (i_this->mObjAcch.ChkWallHit() != 0 && i_this->field_0x6c0[0] == 0) { + int iVar1 = kado_check(i_this); + if (iVar1 != 0) { + OS_REPORT(" ..KADO KABE ..%x\n", iVar1); + if (iVar1 == 2) { + i_this->field_0x6ee = 0xC00; + i_this->field_0x704.y += -7000; + } else { + i_this->field_0x6ee = -0xC00; + i_this->field_0x704.y += 7000; + } + + i_this->field_0x7c8 = 8000.0f; + i_this->field_0x734 = 100.0f; + i_this->field_0x73c = 100.0f; + i_this->field_0x808 = 40; + i_this->field_0x6c0[0] = 60; + } else { + i_this->field_0x5b4 = 10; + a_this->speed.y = 0.0f; + i_this->field_0x6e4 *= 0.2f; + i_this->field_0x704.y += 0x8000; + i_this->field_0x7c8 = 8000.0f; + i_this->field_0x820 = 5; + i_this->field_0x734 = 100.0f; + i_this->field_0x73c = 100.0f; + i_this->field_0x808 = 40; + i_this->field_0x6ee = 0; + } + } else { + cLib_addCalcAngleS2(&i_this->field_0x704.x, -0x4000, 1, 0x300); + a_this->current.angle.y += i_this->field_0x6ee; + a_this->shape_angle.y = a_this->current.angle.y; + + if (i_this->field_0x704.x <= -0x3000 && i_this->mObjAcch.ChkGroundHit()) { + i_this->field_0x5b4 = 2; + i_this->field_0x716 = 10; + i_this->mSound.startCreatureSound(Z2SE_CM_BODYFALL_L, 0, -1); + + if (i_this->field_0x717 == 0) { + anm_init(i_this, 13, 5.0f, 0, 1.0f); + } else { + anm_init(i_this, 15, 5.0f, 0, 1.0f); + } + + if (i_this->field_0x6f0 != 0) { + i_this->field_0x6e4 = 0.0f; + i_this->field_0x7c8 = 2000.0f; + } else { + if (i_this->field_0x717 == 0) { + i_this->field_0x734 = -100.0f; + i_this->field_0x73c = -100.0f; + } else { + i_this->field_0x734 = 100.0f; + i_this->field_0x73c = 100.0f; + } + + i_this->field_0x738 = -0x5000; + i_this->field_0x740 = -0x4000; + i_this->field_0x808 = 40; + i_this->field_0x6e4 *= 0.5f; + a_this->speed.y = 20.0f; + i_this->field_0x6ee /= 2; + a_this->current.angle.y = i_this->field_0x704.y; + i_this->field_0x7c8 = 8000.0f; + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp34.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp34, &sp40); + + fopAcM_effSmokeSet1(&i_this->field_0x10bc, &i_this->field_0x10c0, &sp40, NULL, 1.8f, &a_this->tevStr, 1); + } + } + } + break; + + case 2: + a_this->current.angle.y += i_this->field_0x6ee; + a_this->shape_angle.y = a_this->current.angle.y; + cLib_addCalcAngleS2(&i_this->field_0x704.x, -0x4000, 1, 0x300); + + if (i_this->mObjAcch.ChkGroundHit()) { + if (a_this->health > 0 && daPy_py_c::checkNowWolf() == 0) { + a_this->onDownFlg(); + } + + dKy_Sound_set(a_this->current.pos, 100, fopAcM_GetID(a_this), 5); + i_this->field_0x716 = 10; + + if (i_this->field_0x717 == 0) { + anm_init(i_this, 13, 3.0f, 0, 1.0f); + } else { + anm_init(i_this, 15, 3.0f, 0, 1.0f); + } + + i_this->field_0x6e4 = 0.0f; + i_this->field_0x704.x = -0x4000; + + for (int i = 0; i < 4; i++) { + i_this->field_0x7e2[i] = cM_rndF(10.0f); + } + + a_this->current.angle.y = i_this->field_0x704.y; + if (daPy_py_c::checkNowWolf() != 0) { + i_this->field_0x6c0[0] = 80; + i_this->field_0x6c0[1] = 55; + } else { + if (a_this->health <= 0) { + i_this->field_0x6c0[0] = 60; + } else { + i_this->field_0x6c0[0] = 5; + } + i_this->field_0x6c0[1] = 35; + } + + i_this->field_0x5b4 = 3; + i_this->field_0x7c8 = 1500.0f; + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp34.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp34, &sp40); + + fopAcM_effSmokeSet1(&i_this->field_0x10bc, &i_this->field_0x10c0, &sp40, NULL, 1.0f, &a_this->tevStr, 1); + } + break; + + case 3: + if (body_gake(i_this)) { + i_this->field_0x6e4 = -20.0f; + i_this->field_0x704.x -= 0x300; + } + + if (a_this->health <= 0 && i_this->field_0x6c0[1] == 0) { + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp34.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp34, &sp40); + + mf_disappear(i_this); + fopAcM_delete(a_this); + return; + } + + if (daPy_getPlayerActorClass()->getCutType() != daPy_py_c::CUT_TYPE_DOWN && i_this->field_0x6c0[0] == 0) { + i_this->field_0x5b4 = 20; + if (i_this->field_0x717 == 0) { + anm_init(i_this, 14, 3.0f, 0, 1.0f); + } else { + anm_init(i_this, 16, 3.0f, 0, 1.0f); + } + + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_UP, -1); + + if (i_this != NULL) { + a_this->offDownFlg(); + } + } + break; + + case 10: + if (i_this->field_0x820 != 0) { + cLib_addCalcAngleS2(&i_this->field_0x704.x, 0, 1, 0x300); + } else { + cLib_addCalcAngleS2(&i_this->field_0x704.x, -0x4000, 1, 0x800); + if (i_this->mObjAcch.ChkGroundHit()) { + i_this->field_0x5b4 = 2; + if (i_this->field_0x717 == 0) { + i_this->field_0x734 = -100.0f; + i_this->field_0x73c = -100.0f; + } else { + i_this->field_0x734 = 100.0f; + i_this->field_0x73c = 100.0f; + } + + i_this->field_0x738 = -0x5000; + i_this->field_0x740 = -0x4000; + i_this->field_0x6e4 *= 0.5f; + a_this->speed.y = 20.0f; + a_this->current.angle.y = i_this->field_0x704.y; + i_this->field_0x7c8 = 8000.0f; + } + } + break; + + case 20: + if (i_this->mpModelMorf->getFrame() >= 35.0f) { + i_this->field_0x710.z = 0; + i_this->field_0x710.x = 0; + } + + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x704.y = 0; + i_this->field_0x704.x = 0; + anm_init(i_this, 31, 0.0f, 2, 1.0f); + i_this->field_0x6c0[0] = 5; + i_this->field_0x5b4 = 21; + + if (i_this != NULL) { + a_this->offDownFlg(); + } + } + break; + + case 21: + case 22: + i_this->field_0x6c8 = 0; + if (i_this->field_0x6c0[0] == 0) { + if (i_this->mPlayerDistance < 300.0f) { + i_this->mAction = 6; + i_this->field_0x5b4 = 0; + } else { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } + break; + + case 30: + if (!a_this->checkWolfDownPullFlg()) { + i_this->field_0x6c0[1] = 0; + } + + if (i_this->field_0x6c0[0] == 0) { + i_this->field_0x5b4 = 31; + if (i_this->field_0x717 == 0) { + anm_init(i_this, 10, 3.0f, 0, 1.0f); + } else { + anm_init(i_this, 11, 3.0f, 0, 1.0f); + } + + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_UP, -1); + i_this->field_0x6c0[0] = 10; + } else if (i_this->field_0x6c0[1] == 1) { + a_this->onWolfDownPullEndFlg(); + a_this->offCutDownHitFlg(); + a_this->health = 0; + i_this->field_0x6c0[0] = 1000; + i_this->field_0x6c0[1] = 35; + i_this->field_0x5b4 = 3; + } + break; + + case 31: + if (i_this->field_0x6c0[0] == 0) { + a_this->offDownFlg(); + i_this->field_0x5b4 = 20; + i_this->field_0x6d3 = 0; + } + } + + if (i_this != NULL && a_this->checkDownFlg()) { + i_this->field_0x6d2 = 0; + } + + if (i_this->field_0x7ec != 0) { + i_this->field_0x7ec--; + i_this->field_0x7ea = i_this->field_0x7ec * cM_ssin(i_this->field_0x7ec * 0x3800) * 100.0f; + } +} + +/* 8070FBEC-8070FD40 0055CC 0154+00 1/1 0/0 0/0 .text e_mf_backdrop__FP10e_mf_class */ +static void e_mf_backdrop(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 18, 3.0f, 0, 0.5f); + i_this->field_0x5b4 = 1; + i_this->field_0x704.y = a_this->shape_angle.y; + i_this->field_0x704.x = 0; + a_this->speedF = -3.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DEATH, -1); + // fallthrough + case 1: + if (i_this->field_0x704.x < -0x4000) { + a_this->speedF = -6.0f; + } + + if (a_this->speed.y < -20.0f) { + i_this->field_0x5b4 = 2; + a_this->speedF = 0.0f; + } + // fallthrough + case 2: + cLib_addCalcAngleS2(&i_this->field_0x704.x, -0x7000, 2, 0x800); + if (i_this->field_0x5b4 == 2 && a_this->current.pos.y <= (i_this->mObjAcch.GetGroundH() + 100.0f)) { + a_this->current.pos.y = i_this->mObjAcch.GetGroundH() + 100.0f; + i_this->field_0x704.x = -0x4000; + i_this->mAction = 21; + i_this->field_0x5b4 = 0; + i_this->field_0x6e4 = 0.0f; + a_this->health = 0; + } + } +} + +/* 8070FD40-8070FEE0 005720 01A0+00 1/1 0/0 0/0 .text e_mf_water__FP10e_mf_class */ +static void e_mf_water(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp20, sp2c, sp38; + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp20.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp20, &sp2c); + + i_this->field_0x6c8 = 10; + switch (i_this->field_0x5b4) { + case 0: + case 1: + a_this->speed.y = 0.0f; + if (i_this->field_0x717 == 0) { + anm_init(i_this, 19, 3.0f, 2, 1.0f); + } else { + anm_init(i_this, 20, 3.0f, 2, 1.0f); + } + + i_this->field_0x6c0[0] = 60; + a_this->speedF = 0.0f; + i_this->field_0x6e4 = 0.0f; + i_this->field_0x6e8 = 0.0f; + + sp38 = a_this->current.pos; + sp38.y = i_this->field_0xa3c; + if (i_this->field_0x5b4 == 0) { + fopKyM_createWpillar(&sp38, 1.5f, 0); + } else { + fopKyM_createMpillar(&sp38, 1.0f); + } + + i_this->field_0x5b4 = 10; + break; + + case 10: + a_this->speed.y = 0.0f; + cLib_addCalc2(&a_this->current.pos.y, i_this->field_0xa3c, 0.5f, 5.0f); + cLib_addCalcAngleS2(&i_this->field_0x704.x, -0x4000, 4, 0x400); + + if (i_this->field_0x6c0[0] == 0) { + mf_disappear(i_this); + } + } +} + +/* 8070FEE0-8070FF98 0058C0 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_mf_class */ +static void wolfkick_damage(e_mf_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + + i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x72c = 150.0f; + i_this->mAction = 21; + i_this->field_0x5b4 = 0; + i_this->field_0x704.y = player->shape_angle.y + 0x8000; + a_this->speed.y = 0.0f; + i_this->field_0x6e4 = -1.0f; + i_this->field_0x808 = 50; + i_this->mSound.startCollisionSE(Z2SE_HIT_WOOD_WEAPON, 31); + i_this->field_0x6f0 = 1; +} /* 8070FF98-807100A8 005978 0110+00 1/1 0/0 0/0 .text big_damage__FP10e_mf_class */ static void big_damage(e_mf_class* i_this) { - // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x72c = 150.0f; + i_this->mAction = 21; + i_this->field_0x5b4 = 0; + i_this->field_0x704.y = i_this->mAtInfo.mHitDirection.y; + a_this->speed.y = cM_rndF(10.0f) + 25.0f; + i_this->field_0x6e4 = -20.0f; + i_this->field_0x808 = 50; + if ((i_this->mAtInfo.mHitBit & 0x80) != 0) { + OS_REPORT("SPIN CUT HIT !!\n"); + i_this->field_0x6ee = cM_rndFX(800.0f) + 3000.0f; + } else if ((i_this->mAtInfo.mHitBit & 0x800) != 0) { + OS_REPORT("SPIN CUT L HIT !!\n"); + i_this->field_0x6ee = -(cM_rndFX(800.0f) + 3000.0f); + } else { + i_this->field_0x6ee = cM_rndFX(700.0f); + } + + i_this->field_0x6f0 = 0; } /* 807100A8-80710158 005A88 00B0+00 1/1 0/0 0/0 .text small_damage__FP10e_mf_class */ static void small_damage(e_mf_class* i_this) { - // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->mAction = 20; + i_this->field_0x5b4 = 0; + i_this->field_0x808 = 50; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DAMAGE, -1); + + if (i_this->field_0x80e != 0) { + a_this->current.angle.y = a_this->shape_angle.y; + } + + i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x72c = 150.0f; + i_this->field_0x6e8 = 25.0f; + i_this->field_0x6ec = i_this->mAtInfo.mHitDirection.y; } /* 80710158-807104EC 005B38 0394+00 1/1 0/0 0/0 .text damage_check__FP10e_mf_class */ static void damage_check(e_mf_class* i_this) { - // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + i_this->mStts.Move(); + + if (i_this->field_0x6c8 == 0) { + fopEn_enemy_c* mf_p = (fopEn_enemy_c*)i_this; + if (l_HIO.invulnerable != 0) { + a_this->health = 100; + } + + for (int i = 0; i <= 2; i++) { + if (i_this->field_0xa7c[i].ChkTgHit() != 0) { + i_this->mAtInfo.mpCollider = i_this->field_0xa7c[i].GetTgHitObj(); + if (player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_LEFT && player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_RIGHT && + i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK) != 0) { + if (!player->onWolfEnemyHangBite(mf_p)) { + return; + } + + OS_REPORT("DN PL BITE HANG \n"); + i_this->mAction = 13; + i_this->field_0x5b4 = 0; + i_this->field_0x6c8 = 1000; + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 31); + return; + } + + i_this->field_0x10ba = 3; + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000) != 0) { + wolfkick_damage(i_this); + i_this->field_0x6c8 = 1000; + } else { + at_power_check(&i_this->mAtInfo); + s16 sVar1 = a_this->health; + cc_at_check(a_this, &i_this->mAtInfo); + + if (daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_HEAD_JUMP) { + i_this->mAtInfo.mHitStatus = 0; + } + + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK) != 0) { + i_this->field_0x6c8 = 20; + } else { + i_this->field_0x6c8 = 10; + } + + if (i_this->mAtInfo.mAttackPower <= 1) { + i_this->field_0x6c8 = 10; + } + + i_this->field_0x724 |= i_this->mAtInfo.mHitBit; + if (i_this->mAtInfo.mHitType == 16 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) != 0) { + a_this->health = sVar1; + i_this->mAction = 12; + i_this->field_0x5b4 = 0; + + if (i_this->field_0x80e != 0) { + a_this->current.angle.y = a_this->shape_angle.y; + } + + i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x72c = 100.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DAMAGE, -1); + } else { + if (daPy_getPlayerActorClass()->checkHorseRide() != 0 && dComIfGp_getHorseActor()->speedF >= 20.0f && i_this->mAtInfo.mHitType == 1) { + i_this->mAtInfo.mAttackPower = 20; + if (cM_rndF(1.0f) < 0.5f) { + i_this->mAtInfo.mHitBit |= 0x80; + } else { + i_this->mAtInfo.mHitBit |= 0x800; + } + } + + if (a_this->health <= 0 || i_this->mAtInfo.mHitStatus != 0) { + if (player->getCutType() == daPy_py_c::CUT_TYPE_JUMP && player->checkCutJumpCancelTurn()) { + small_damage(i_this); + i_this->field_0x6c8 = 3; + } else { + big_damage(i_this); + i_this->field_0x6c8 = 1000; + } + } else { + small_damage(i_this); + } + + a_this->speedF = 0.0f; + } + } + break; + } + } + + for (int i = 0; i < 3; i++) { + if (a_this->health <= 1) { + i_this->field_0xa7c[i].SetTgHitMark((CcG_Tg_HitMark)3); + } + } + } } /* 807104EC-807119BC 005ECC 14D0+00 2/1 0/0 0/0 .text action__FP10e_mf_class */ static void action(e_mf_class* i_this) { // NONMATCHING + static s16 j_spd[11] = { + 0x4000, 0x4000, 0x4000, + 0x1000, 0x1000, 0x1000, + 0x1000, 0x4000, 0x4000, + 0x4000, 0x4000 + }; + + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz sp240, sp24c; + + i_this->field_0x6d4 = 0; + i_this->mPlayerDistance = fopAcM_searchPlayerDistanceXZ(a_this); + i_this->mYAngleToPlayer = fopAcM_searchPlayerAngleY(a_this); + i_this->mXAngleToPlayer = fopAcM_searchPlayerAngleX(a_this); + damage_check(i_this); + i_this->field_0x80e = 0; + + bool bVar1 = false; + bool bVar2 = true; + a_this->offHeadLockFlg(); + if (!fopAcM_otherBgCheck(player, a_this)) { + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; + } else { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } + + switch (i_this->mAction) { + case 0: + e_mf_normal(i_this); + break; + + case 3: + e_mf_fight_run(i_this); + bVar1 = true; + break; + + case 5: + e_mf_attack(i_this); + bVar1 = true; + break; + + case 6: + e_mf_tail_attack(i_this); + bVar1 = true; + break; + + case 7: + e_mf_guard(i_this); + bVar1 = true; + break; + + case 8: + e_mf_jump(i_this); + bVar1 = true; + break; + + case 9: + e_mf_stay(i_this); + break; + + case 10: + e_mf_otoreac(i_this); + break; + + case 11: + e_mf_bomb_action(i_this); + break; + + case 12: + e_mf_drawback(i_this); + bVar1 = true; + break; + + case 13: + e_mf_wolfbite(i_this); + break; + + case 20: + e_mf_s_damage(i_this); + break; + + case 21: + e_mf_damage(i_this); + break; + + case 23: + e_mf_backdrop(i_this); + break; + + case 24: + e_mf_water(i_this); + bVar2 = false; + break; + + case 25: + e_mf_gakejump(i_this); + bVar1 = true; + } + + f32 fVar1; + if (bVar2) { + dBgS_ObjGndChk gnd_chk; + dBgS_ObjGndChk_Spl spl_chk; + sp240 = a_this->current.pos; + sp240.y += 150.0f; + spl_chk.SetPos(&sp240); + gnd_chk.SetPos(&sp240); + i_this->field_0xa3c = dComIfG_Bgsp().GroundCross(&spl_chk); + if (a_this->current.pos.y < i_this->field_0xa3c && (i_this->field_0xa3c - dComIfG_Bgsp().GroundCross(&gnd_chk)) > 100.0f) { + OS_REPORT("DN YOGAN \n"); + i_this->mAction = 24; + if (dComIfG_Bgsp().GetPolyAtt0(spl_chk) == 6) { + i_this->field_0x5b4 = 1; + } else { + i_this->field_0x5b4 = 0; + } + + a_this->current.pos.y = i_this->field_0xa3c; + } + } + + if (bVar1) { + i_this->mSound.setLinkSearch(true); + } else { + i_this->mSound.setLinkSearch(false); + } + + if (i_this->field_0x80e == 0) { + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x2000); + } + + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x2000); + cLib_addCalcAngleS2(&a_this->shape_angle.z, a_this->current.angle.z, 2, 0x2000); + + if (i_this->field_0x5d8 == 0) { + cLib_addCalc0(&i_this->field_0x700, 1.0f, 30.0f); + + if (i_this->field_0x6e4 == 0.0f) { + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + sp240.z = a_this->speedF; + } else { + cMtx_YrotS(*calc_mtx, i_this->field_0x704.y); + if (i_this->field_0x820 == 0) { + sp240.z = i_this->field_0x6e4; + } else { + sp240.z = 0.0f; + a_this->speed.y = 0.0f; + } + + a_this->gravity = 0.0f; + } + sp240.x = 0.0f; + sp240.y = 0.0f; + MtxPosition(&sp240, &sp24c); + + a_this->speed.x = sp24c.x; + a_this->speed.z = sp24c.z; + a_this->speed.y += a_this->gravity; + a_this->current.pos += a_this->speed; + a_this->gravity = -5.0f; + + if (a_this->speed.y < -100.0f) { + a_this->speed.y = -100.0f; + } + + if (i_this->mAction != 9 && i_this->field_0x6d2 != 0) { + cXyz* move_pos = i_this->mStts.GetCCMoveP(); + if (move_pos != NULL) { + a_this->current.pos.x += move_pos->x; + a_this->current.pos.z += move_pos->z; + } + } + + if (i_this->field_0x6e8 > 0.1f) { + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = -i_this->field_0x6e8; + cMtx_YrotS(*calc_mtx, i_this->field_0x6ec); + MtxPosition(&sp240, &sp24c); + a_this->current.pos += sp24c; + cLib_addCalc0(&i_this->field_0x6e8, 1.0f, 7.0f); + } + } else { + cMtx_YrotS(*calc_mtx, i_this->field_0x5d4); + cMtx_XrotM(*calc_mtx, i_this->field_0x5d6); + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = a_this->speedF; + MtxPosition(&sp240, &sp24c); + a_this->current.pos += sp24c; + sp240 = i_this->field_0x5bc - i_this->field_0x5c8; + fVar1 = sp240.abs(); + sp240 = i_this->field_0x5bc - a_this->current.pos; + f32 fVar2 = sp240.abs(); + f32 fVar3 = fVar1 * 0.3f; + + if (fVar3 > 250.0f) { + fVar3 = 250.0f; + } + + i_this->field_0x700 = fVar3 * cM_ssin((fVar2 / fVar1) * 32768.0f); + i_this->field_0x5d8 = 0; + } + + s16 sVar1 = 0x800; + if (i_this->field_0x6e0 != 0) { + i_this->field_0x6e0--; + i_this->field_0x6d4 = 2;cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + + if (i_this->field_0x6e1 == 0) { + sp240.x = -100.0f; + } else { + sp240.x = 100.0f; + } + sp240.y = 100.0f; + sp240.z = -100.0f; + MtxPosition(&sp240, &i_this->field_0x718); + i_this->field_0x718 += a_this->current.pos; + sVar1 = 0x400; + } + + if (i_this->field_0x6d4 == 0) { + cLib_addCalcAngleS2(&i_this->field_0x6d6, 0, 2, sVar1); + cLib_addCalcAngleS2(&i_this->field_0x6d8, 0, 2, sVar1); + i_this->field_0x6dc = 0; + } else { + if (i_this->field_0x6d4 == 5) { + if ((i_this->field_0x6ac & 15) == 0 && cM_rndF(1.0f) < 0.3f) { + i_this->field_0x6dc = cM_rndFX(2500.0f); + } + } else { + if (i_this->field_0x6d4 == 1) { + sp240 = player->eyePos - a_this->current.pos; + } else if (i_this->field_0x6d4 == 2) { + sp240 = i_this->field_0x718 - a_this->current.pos; + } else { + sp240 = player->eyePos - a_this->current.pos; + } + sp240.y += l_HIO.base_size * -150.0f; + + s16 sVar2 = cM_atan2s(sp240.x, sp240.z) - a_this->shape_angle.y; + s16 sVar3 = a_this->shape_angle.x + cM_atan2s(sp240.y, JMAFastSqrt(sp240.x * sp240.x + sp240.z * sp240.z)); + if (sVar2 < 0x2711) { + if (sVar2 < -10000) { + sVar2 = -10000; + } + } else { + sVar2 = 10000; + } + + if (sVar3 < 0x2711) { + if (sVar3 < -20000) { + sVar3 = -20000; + } + } else { + sVar3 = 10000; + } + + cLib_addCalcAngleS2(&i_this->field_0x6d6, sVar2 / 2, 2, sVar1); + cLib_addCalcAngleS2(&i_this->field_0x6d8, sVar3 / 2, 2, sVar1); + } + + i_this->field_0x6dc = 0; + } + + cLib_addCalcAngleS2(&i_this->field_0x6da, i_this->field_0x6dc, 4, 0x400); + + if (i_this->field_0x6de != 0) { + i_this->field_0x6de--; + i_this->field_0x6da = i_this->field_0x6de * cM_ssin(i_this->field_0x6de * 1200) * 200.0f; + } + + if (i_this->field_0x72c > 1.0f) { + cMtx_YrotS(*calc_mtx, i_this->field_0x730); + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = i_this->field_0x72c * 120.0f; + if (sp240.z > 15000.0f) { + sp240.z = 15000.0f; + } + MtxPosition(&sp240, &sp24c); + + i_this->field_0x784[0].y = sp24c.x; + i_this->field_0x784[0].x = sp24c.z; + i_this->field_0x784[1].y = sp24c.x; + i_this->field_0x784[1].x = sp24c.z; + cLib_addCalc0(&i_this->field_0x72c, 0.5f, 10.0f); + } + + if (fabsf(i_this->field_0x73c) > 1.0f) { + i_this->field_0x784[1].x = i_this->field_0x73c * cM_scos(i_this->field_0x740) * 70.0f; + i_this->field_0x784[2].x += i_this->field_0x784[1].x; + cLib_addCalc0(&i_this->field_0x73c, 1.0f, 3.0f); + i_this->field_0x740 += 4000; + } + + if (fabsf(i_this->field_0x734) > 1.0f) { + i_this->field_0x784[0].x = i_this->field_0x734 * cM_scos(i_this->field_0x738) * 70.0f; + cLib_addCalc0(&i_this->field_0x734, 1.0f, 3.0f); + i_this->field_0x738 += 4000; + } + + if (a_this->speed.y < 0.0f && i_this->mObjAcch.ChkGroundHit()) { + cLib_addCalc0(&i_this->field_0x73c, 1.0f, 30.0f); + cLib_addCalc0(&i_this->field_0x734, 1.0f, 30.0f); + } + + if (i_this->field_0x6e4 != 0.0f) { + s16 sVar4 = i_this->field_0x704.y - a_this->shape_angle.y; + i_this->field_0x784[3].y = 0x4000 - sVar4; + if (i_this->field_0x784[3].y < 0x1771) { + if (i_this->field_0x784[3].y < -9000) { + i_this->field_0x784[3].y = -9000; + } + } else { + i_this->field_0x784[3].y = 6000; + } + + i_this->field_0x784[4].y = 0x4000 - sVar4; + if (i_this->field_0x784[4].y < 0x4269) { + if (i_this->field_0x784[4].y < 0) { + i_this->field_0x784[4].y = 0; + } + } else { + i_this->field_0x784[4].y = 17000; + } + + i_this->field_0x784[5].y = sVar4 + 0x4000; + if (i_this->field_0x784[5].y < 0x1771) { + if (i_this->field_0x784[5].y < -9000) { + i_this->field_0x784[5].y = -9000; + } + } else { + i_this->field_0x784[5].y = 6000; + } + + i_this->field_0x784[6].y = sVar4 + 0x4000; + if (i_this->field_0x784[6].y < 0x4269) { + if (i_this->field_0x784[6].y < 0) { + i_this->field_0x784[6].y = 0; + } + } else { + i_this->field_0x784[6].y = 17000; + } + + cMtx_YrotS(*calc_mtx, sVar4); + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = 12000.0f; + MtxPosition(&sp240, &sp24c); + i_this->field_0x816.y = -sp24c.x; + i_this->field_0x816.x = -sp24c.z * 1.3f; + + if (i_this->field_0x816.x > 10000) { + i_this->field_0x816.x = 10000; + } + + i_this->field_0x816.x += 6000; + } + + for (int i = 0; i < 11; i++) { + cLib_addCalcAngleS2(&i_this->field_0x742[i].x, i_this->field_0x784[i].x, 2, j_spd[i]); + cLib_addCalcAngleS2(&i_this->field_0x742[i].y, i_this->field_0x784[i].y, 2, j_spd[i]); + cLib_addCalcAngleS2(&i_this->field_0x742[i].z, i_this->field_0x784[i].z, 2, j_spd[i]); + i_this->field_0x784[i].z = 0; + i_this->field_0x784[i].x = 0; + + if (i < 3 || i > 6) { + i_this->field_0x784[i].y = 0; + } else if (i_this->field_0x7e2[i - 3] == 0) { + s16 sVar5; + if (i == 4 || i == 6) { + sVar5 = 0x600; + } else { + sVar5 = 0x800; + } + + cLib_addCalcAngleS2(&i_this->field_0x784[i].y, 0, 1, sVar5); + } else { + i_this->field_0x7e2[i - 6]--; + } + + if (i > 2) { + i_this->field_0x7e2[i - 2] = i_this->field_0x7c8 * cM_scos(i_this->field_0x6ac * 4000 + i * 20000); + } + } + + cLib_addCalc0(&i_this->field_0x7c8, 1.0f, 100.0f); + cLib_addCalcAngleS2(&i_this->field_0x812, i_this->field_0x816.y, 2, 0x800); + cLib_addCalcAngleS2(&i_this->field_0x810, i_this->field_0x816.x, 2, 0x800); + i_this->field_0x816.x = 0; + i_this->field_0x816.y = 0; + if (i_this->field_0x808 != 0) { + i_this->field_0x808--; + } + + f32 fVar4 = i_this->field_0x808 * 1.0f; + if (fVar4 > 30.0f) { + fVar4 = 30.0f; + } + fVar1 = fVar4 * fVar4; + + for (int i = 0; i < 4; i++) { + i_this->field_0x7ee[i].x = fVar1 * (cM_ssin(i_this->field_0x6ac * 5000 + i * -15000) * 5.0f); + i_this->field_0x7ee[i].y = fVar1 * (cM_ssin(i_this->field_0x6ac * 0x12C0 + i * -13000) * 5.0f); + } + + cLib_addCalcAngleS2(&i_this->field_0x806, 0, 4, 0x100); + if (i_this->field_0x716 != 0) { + i_this->field_0x716--; + if (i_this->field_0x704.x != 0) { + cXyz sp258, sp264, sp270; + dBgS_GndChk gnd_chk2; + s16 sVar6 = 0; + s16 sVar7 = 0; + fVar1 = 100.0f; + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp240.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp240, &sp264); + sp264.y += 100.0f + 100.0f; + gnd_chk2.SetPos(&sp264); + sp264.y = dComIfG_Bgsp().GroundCross(&gnd_chk2); + + if (sp264.y != -1000000000.0f) { + sp258.x = sp264.x; + sp258.y += 100.0f; + sp258.z = sp264.z + fVar1; + gnd_chk2.SetPos(&sp258); + sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk2); + + if (sp258.y != -1000000000.0f) { + sVar7 = -cM_atan2s(sp258.y - sp264.y, sp258.z - sp264.z); + if (sVar7 > 0x3000 || sVar7 < -0x3000) { + sVar7 = 0; + } + } + + sp258.x = sp264.x + fVar1; + sp258.y += 100.0f; + sp258.z = sp264.z; + gnd_chk2.SetPos(&sp258); + sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk2); + if (sp258.y != -1000000000.0f) { + sVar6 = cM_atan2s(sp258.y - sp264.y, sp258.x - sp264.x); + if (sVar6 > 0x3000 || sVar6 < -0x3000) { + sVar6 = 0; + } + } + } + + dBgS_LinChk lin_chk; + cXyz sp27c, sp288, sp294; + } + } } /* 807119BC-80711CB8 00739C 02FC+00 1/1 0/0 0/0 .text anm_se_set__FP10e_mf_class */ @@ -1728,7 +3153,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { } } else { if (i_this->field_0x822 >= 13) { - i_this->field_0x6ae = 21; + i_this->mAction = 21; i_this->field_0x5b4 = 0; a_this->speed.y = 0.0f; i_this->field_0x6e4 = -1.0; @@ -1892,7 +3317,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { sp38 += a_this->current.pos; dComIfGp_setHitMark(2, NULL, &sp38, &a_this->shape_angle, NULL, 0); if (player->getIronBallCenterPos() != NULL) { - i_this->field_0x6ae = 12; + i_this->mAction = 12; i_this->field_0x5b4 = 0; if (i_this->field_0x80e != 0) { a_this->current.angle.y = a_this->shape_angle.y; @@ -1938,7 +3363,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { } if (strcmp(dComIfGp_getStartStageName(), "D_MN07") == 0 && fopAcM_GetRoomNo(a_this) == 8 && a_this->health != 0 && a_this->current.pos.y <= -300.0f) { - i_this->field_0x6ae = 21; + i_this->mAction = 21; i_this->field_0x5b4 = 0; i_this->field_0x6e4 = 0.0; a_this->health = 0; @@ -2114,7 +3539,7 @@ static cPhs__Step daE_MF_Create(fopAc_ac_c* a_this) { i_this->field_0x6ac = (int)cM_rndF(65535.0f) & 0xFF00; if (i_this->field_0x5b6 == 0) { - i_this->field_0x6ae = 9; + i_this->mAction = 9; } i_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 3, 1); From 01aa69028e178c0583bb258165306ea7de494dda Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:54:15 -0400 Subject: [PATCH 15/21] d_a_e_mf equivalent --- include/d/actor/d_a_e_mf.h | 20 +- src/d/actor/d_a_e_mf.cpp | 1003 +++++++++++------------------------- 2 files changed, 311 insertions(+), 712 deletions(-) diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index 9afd9943ba2..14a970aa45d 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -59,7 +59,7 @@ class e_mf_class { /* 0x06D1 */ s8 field_0x6d1; /* 0x06D2 */ s8 field_0x6d2; /* 0x06D3 */ s8 field_0x6d3; - /* 0x06D4 */ u8 field_0x6d4; + /* 0x06D4 */ s8 field_0x6d4; /* 0x06D5 */ u8 field_0x6d5; /* 0x06D6 */ s16 field_0x6d6; /* 0x06D8 */ s16 field_0x6d8; @@ -79,7 +79,7 @@ class e_mf_class { /* 0x0704 */ csXyz field_0x704; /* 0x070A */ csXyz field_0x70a; /* 0x0710 */ csXyz field_0x710; - /* 0x0716 */ u8 field_0x716; + /* 0x0716 */ s8 field_0x716; /* 0x0717 */ s8 field_0x717; /* 0x0718 */ cXyz field_0x718; /* 0x0724 */ u32 field_0x724; @@ -97,17 +97,14 @@ class e_mf_class { /* 0x0784 */ csXyz field_0x784[11]; /* 0x07C6 */ u8 field_0x7c6[0x7c8 - 0x7c6]; /* 0x07C8 */ f32 field_0x7c8; - /* 0x07CC */ s16 field_0x7cc; - /* 0x07CE */ s16 field_0x7ce; + /* 0x07CC */ s16 field_0x7cc[2]; /* 0x07D0 */ s16 field_0x7d0; /* 0x07D2 */ s16 field_0x7d2; /* 0x07D4 */ s16 field_0x7d4; /* 0x07D6 */ s16 field_0x7d6; /* 0x07D8 */ s16 field_0x7d8; /* 0x07DA */ s16 field_0x7da; - /* 0x07DC */ s16 field_0x7dc; - /* 0x07DE */ s16 field_0x7de; - /* 0x07E0 */ s16 field_0x7e0; + /* 0x07DC */ s16 field_0x7dc[3]; /* 0x07E2 */ s16 field_0x7e2[4]; /* 0x07EA */ s16 field_0x7ea; /* 0x07EC */ s16 field_0x7ec; @@ -135,12 +132,15 @@ class e_mf_class { /* 0x1094 */ dCcU_AtInfo mAtInfo; /* 0x10B8 */ u8 field_0x10b8; /* 0x10B9 */ u8 field_0x10b9; - /* 0x10BA */ u8 field_0x10ba; + /* 0x10BA */ s8 field_0x10ba; /* 0x10BB */ u8 field_0x10bb; /* 0x10BC */ u32 field_0x10bc; /* 0x10C0 */ u32 field_0x10c0; - /* 0x10C4 */ u8 field_0x10c4; - /* 0x10C5 */ u8 field_0x10c5[0x10e4 - 0x10c5]; + /* 0x10C4 */ s8 field_0x10c4; + /* 0x10C5 */ u8 field_0x10c5[0x10c8 - 0x10c5]; + /* 0x10C8 */ u32 field_0x10c8[2]; + /* 0x10D0 */ u32 field_0x10d0[2]; + /* 0x10D8 */ u8 field_0x10d8[0x10e4 - 0x10d8]; /* 0x10E4 */ u32 field_0x10e4; /* 0x10E8 */ u32 field_0x10e8; }; diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index bfc0981220e..2b72fa403ee 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -5,419 +5,30 @@ #include "d/actor/d_a_e_mf.h" #include "d/d_cc_d.h" -#include "dol2asm.h" #include "Z2AudioLib/Z2Instances.h" +UNK_REL_DATA; #include "f_op/f_op_actor_enemy.h" #include "d/d_bomb.h" #include "f_op/f_op_kankyo_mng.h" #include "d/actor/d_a_horse.h" #include "d/d_com_inf_game.h" -UNK_REL_DATA; -// -// Forward References: -// - -extern "C" void __ct__12daE_MF_HIO_cFv(); -extern "C" static void mf_disappear__FP10e_mf_class(); -extern "C" static void anm_init__FP10e_mf_classifUcf(); -extern "C" static void nodeCallBack__FP8J3DJointi(); -extern "C" static void daE_MF_Draw__FP10e_mf_class(); -extern "C" static void other_bg_check__FP10e_mf_classP10fopAc_ac_c(); -extern "C" static void other_bg_check2__FP10e_mf_classP4cXyz(); -extern "C" static void s_b_sub__FPvPv(); -extern "C" static void search_bomb__FP10e_mf_classi(); -extern "C" static void bomb_view_check__FP10e_mf_class(); -extern "C" static void bomb_check__FP10e_mf_class(); -extern "C" static void player_way_check__FP10e_mf_class(); -extern "C" static void pl_check__FP10e_mf_classfs(); -extern "C" static void move_gake_check__FP10e_mf_classfSc(); -extern "C" static void jump_pos_check__FP10e_mf_classP4cXyz(); -extern "C" static void e_mf_stay__FP10e_mf_class(); -extern "C" static void e_mf_otoreac__FP10e_mf_class(); -extern "C" static void e_mf_bomb_action__FP10e_mf_class(); -extern "C" static void e_mf_normal__FP10e_mf_class(); -extern "C" static void e_mf_drawback__FP10e_mf_class(); -extern "C" static void e_mf_wolfbite__FP10e_mf_class(); -extern "C" static void way_check__FP10e_mf_class(); -extern "C" static void shot_s_sub__FPvPv(); -extern "C" static void e_mf_fight_run__FP10e_mf_class(); -extern "C" static void e_mf_jump__FP10e_mf_class(); -extern "C" static void e_mf_gakejump__FP10e_mf_class(); -extern "C" static void at_hit_check__FP10e_mf_class(); -extern "C" static void e_mf_attack__FP10e_mf_class(); -extern "C" static void tail_eff_set__FP10e_mf_class(); -extern "C" static void e_mf_tail_attack__FP10e_mf_class(); -extern "C" static void e_mf_guard__FP10e_mf_class(); -extern "C" static void e_mf_s_damage__FP10e_mf_class(); -extern "C" static void kado_check__FP10e_mf_class(); -extern "C" static void body_gake__FP10e_mf_class(); -extern "C" void __dt__14dBgS_ObjGndChkFv(); -extern "C" static void e_mf_damage__FP10e_mf_class(); -extern "C" static void e_mf_backdrop__FP10e_mf_class(); -extern "C" static void e_mf_water__FP10e_mf_class(); -extern "C" static void wolfkick_damage__FP10e_mf_class(); -extern "C" static void big_damage__FP10e_mf_class(); -extern "C" static void small_damage__FP10e_mf_class(); -extern "C" static void damage_check__FP10e_mf_class(); -extern "C" static void action__FP10e_mf_class(); -extern "C" static void anm_se_set__FP10e_mf_class(); -extern "C" static void daE_MF_Execute__FP10e_mf_class(); -extern "C" static bool daE_MF_IsDelete__FP10e_mf_class(); -extern "C" static void daE_MF_Delete__FP10e_mf_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" static void daE_MF_Create__FP10fopAc_ac_c(); -extern "C" void __ct__10e_mf_classFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__8dCcD_SphFv(); -extern "C" void __ct__8dCcD_SphFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__12dBgS_AcchCirFv(); -extern "C" void __ct__5csXyzFv(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void __dt__12daE_MF_HIO_cFv(); -extern "C" void __sinit_d_a_e_mf_cpp(); -extern "C" static void func_807134E8(); -extern "C" static void func_807134F0(); -extern "C" static void func_807134F8(); -extern "C" static void func_80713500(); -extern "C" static void func_80713508(); -extern "C" void __dt__5csXyzFv(); -extern "C" extern char const* const d_a_e_mf__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void -__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl(); -extern "C" void setAnm__16mDoExt_McaMorfSOFP15J3DAnmTransformiffff(); -extern "C" void play__16mDoExt_McaMorfSOFUlSc(); -extern "C" void entryDL__16mDoExt_McaMorfSOFv(); -extern "C" void modelCalc__16mDoExt_McaMorfSOFv(); -extern "C" void stopZelAnime__16mDoExt_McaMorfSOFv(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAc_IsActor__FPv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorAngleX__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistanceXZ__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_getTalkEventPartner__FPC10fopAc_ac_c(); -extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc(); -extern "C" void fopAcM_otoCheck__FPC10fopAc_ac_cf(); -extern "C" void fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_wayBgCheck__FPC10fopAc_ac_cff(); -extern "C" void fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci(); -extern "C" void fopKyM_createWpillar__FPC4cXyzfi(); -extern "C" void fopKyM_createMpillar__FPC4cXyzf(); -extern "C" void fpcEx_Search__FPFPvPv_PvPv(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void -dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); -extern "C" void checkStateCarry__7dBomb_cFv(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void __ct__9dJntCol_cFv(); -extern "C" void init__9dJntCol_cFP10fopAc_ac_cPC13dJntColData_cP8J3DModeli(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void getEmitter__Q213dPa_control_c7level_cFUl(); -extern "C" void setHitMark__13dPa_control_cFUsP10fopAc_ac_cPC4cXyzPC5csXyzPC4cXyzUl(); -extern "C" void -set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void -set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void addReal__21dDlst_shadowControl_cFUlP8J3DModel(); -extern "C" void LineCross__4cBgSFP11cBgS_LinChk(); -extern "C" void GroundCross__4cBgSFP11cBgS_GndChk(); -extern "C" void GetPolyAtt0__4dBgSFRC13cBgS_PolyInfo(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void SetWall__12dBgS_AcchCirFff(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); -extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); -extern "C" void __ct__11dBgS_GndChkFv(); -extern "C" void __dt__11dBgS_GndChkFv(); -extern "C" void __ct__18dBgS_ObjGndChk_SplFv(); -extern "C" void __dt__18dBgS_ObjGndChk_SplFv(); -extern "C" void __ct__11dBgS_LinChkFv(); -extern "C" void __dt__11dBgS_LinChkFv(); -extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Move__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void __dt__12dCcD_GObjInfFv(); -extern "C" void ChkAtHit__12dCcD_GObjInfFv(); -extern "C" void GetAtHitObj__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void ChkCoHit__12dCcD_GObjInfFv(); -extern "C" void GetCoHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); -extern "C" void StartCAt__8dCcD_SphFR4cXyz(); -extern "C" void MoveCAt__8dCcD_SphFR4cXyz(); -extern "C" void cc_pl_cut_bit_get__Fv(); -extern "C" void def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c(); -extern "C" void at_power_check__FP11dCcU_AtInfo(); -extern "C" void cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo(); -extern "C" void checkBoomerangCharge__9daPy_py_cFv(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void dKy_Sound_set__F4cXyziUii(); -extern "C" void dKy_Sound_get__Fv(); -extern "C" void dKy_darkworld_check__Fv(); -extern "C" void GetAc__8cCcD_ObjFv(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void cM_atan2s__Fff(); -extern "C" void cM_rndF__Ff(); -extern "C" void cM_rndFX__Ff(); -extern "C" void SetPos__11cBgS_GndChkFPC3Vec(); -extern "C" void SetPos__11cBgS_GndChkFPC4cXyz(); -extern "C" void __dt__13cBgS_PolyInfoFv(); -extern "C" void __dt__8cM3dGCirFv(); -extern "C" void SetC__8cM3dGSphFRC4cXyz(); -extern "C" void SetR__8cM3dGSphFf(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalc0__FPfff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void func_802807E0(); -extern "C" void __ct__15Z2CreatureEnemyFv(); -extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc(); -extern "C" void setLinkSearch__15Z2CreatureEnemyFb(); -extern "C" void setEnemyName__15Z2CreatureEnemyFPCc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void checkPass__12J3DFrameCtrlFf(); -extern "C" void __construct_array(); -extern "C" void _savegpr_19(); -extern "C" void _savegpr_23(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_19(); -extern "C" void _restgpr_23(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; -extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; -extern "C" u8 mCurrentMtx__6J3DSys[48]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" u8 m_midnaActor__9daPy_py_c[4]; -extern "C" void __register_global_object(); - -/* 80713B6C-80713B9C -00001 0030+00 1/1 0/0 0/0 .data @4741 */ -SECTION_DATA static void* lit_4741[12] = { - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x98), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0xE4), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x11C), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x15C), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x1A8), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x294), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x498), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x498), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x498), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x498), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x304), - (void*)(((char*)e_mf_bomb_action__FP10e_mf_class) + 0x3C4), -}; - -/* 80713B9C-80713BC0 -00001 0024+00 1/1 0/0 0/0 .data @5567 */ -SECTION_DATA static void* lit_5567[9] = { - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x50), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x88), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x238), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x238), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x238), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0xB8), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0xFC), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x150), - (void*)(((char*)e_mf_guard__FP10e_mf_class) + 0x1FC), -}; - -/* 80713BD0-80713C50 -00001 0080+00 1/1 0/0 0/0 .data @6010 */ -SECTION_DATA static void* lit_6010[32] = { - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x194), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x250), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x4F0), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x6E0), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x820), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x8D0), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x974), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x974), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xAC8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0x9B8), - (void*)(((char*)e_mf_damage__FP10e_mf_class) + 0xA9C), -}; - -/* 80713C68-80713C70 000160 0008+00 1/1 0/0 0/0 .data foot_idx$6427 */ -SECTION_DATA static u8 foot_idx[8] = { - 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1E, -}; - -/* 80713C70-80713CD8 -00001 0068+00 1/1 0/0 0/0 .data @6893 */ -SECTION_DATA static void* lit_6893[26] = { - (void*)(((char*)action__FP10e_mf_class) + 0xE4), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0xF0), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x100), - (void*)(((char*)action__FP10e_mf_class) + 0x110), - (void*)(((char*)action__FP10e_mf_class) + 0x120), - (void*)(((char*)action__FP10e_mf_class) + 0x130), - (void*)(((char*)action__FP10e_mf_class) + 0x140), - (void*)(((char*)action__FP10e_mf_class) + 0x14C), - (void*)(((char*)action__FP10e_mf_class) + 0x174), - (void*)(((char*)action__FP10e_mf_class) + 0x158), - (void*)(((char*)action__FP10e_mf_class) + 0x168), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x180), - (void*)(((char*)action__FP10e_mf_class) + 0x18C), - (void*)(((char*)action__FP10e_mf_class) + 0x1C0), - (void*)(((char*)action__FP10e_mf_class) + 0x198), - (void*)(((char*)action__FP10e_mf_class) + 0x1A4), - (void*)(((char*)action__FP10e_mf_class) + 0x1B4), -}; - -/* 80713CD8-80713CE4 0001D0 000C+00 1/0 0/0 0/0 .data jv_offset */ -static Vec jv_offset = { 0.0f, 0.0f, 0.0f }; - -/* 80713CE4-80713D74 -00001 0090+00 1/1 0/0 0/0 .data jc_data */ -static dJntColData_c jc_data[12] = { - {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, - {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, - {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, - {0, 1, 18, 10.0f, &jv_offset}, {0, 1, 23, 20.0f, &jv_offset}, - {0, 1, 24, 15.0f, &jv_offset}, {0, 1, 27, 20.0f, &jv_offset}, - {0, 1, 28, 15.0f, &jv_offset}, {0, 1, 32, 20.0f, &jv_offset}, -}; - -/* 80713E84-80713E90 00037C 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */ -SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_AcchCirFv, -}; - -/* 80713E90-80713E9C 000388 000C+00 2/2 0/0 0/0 .data __vt__10cCcD_GStts */ -SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10cCcD_GSttsFv, -}; - -/* 80713E9C-80713EA8 000394 000C+00 1/1 0/0 0/0 .data __vt__10dCcD_GStts */ -SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10dCcD_GSttsFv, -}; - -/* 80713EA8-80713EB4 0003A0 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 80713EB4-80713EC0 0003AC 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80713EC0-80713EE4 0003B8 0024+00 2/2 0/0 0/0 .data __vt__12dBgS_ObjAcch */ -SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_ObjAcchFv, - (void*)NULL, - (void*)NULL, - (void*)func_80713508, - (void*)NULL, - (void*)NULL, - (void*)func_80713500, -}; - -/* 80713EE4-80713F14 0003DC 0030+00 3/3 0/0 0/0 .data __vt__14dBgS_ObjGndChk */ -SECTION_DATA extern void* __vt__14dBgS_ObjGndChk[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__14dBgS_ObjGndChkFv, - (void*)NULL, - (void*)NULL, - (void*)func_807134E8, - (void*)NULL, - (void*)NULL, - (void*)func_807134F8, - (void*)NULL, - (void*)NULL, - (void*)func_807134F0, -}; - -/* 80713F14-80713F20 00040C 000C+00 2/2 0/0 0/0 .data __vt__12daE_MF_HIO_c */ -SECTION_DATA extern void* __vt__12daE_MF_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12daE_MF_HIO_cFv, -}; +#define ACTION_NORMAL 0 +#define ACTION_FIGHT_RUN 3 +#define ACTION_ATTACK 5 +#define ACTION_TAIL_ATTACK 6 +#define ACTION_GUARD 7 +#define ACTION_JUMP 8 +#define ACTION_STAY 9 +#define ACTION_OTOREAC 10 +#define ACTION_BOMB_ACTION 11 +#define ACTION_DRAWBACK 12 +#define ACTION_WOLFBITE 13 +#define ACTION_S_DAMAGE 20 +#define ACTION_DAMAGE 21 +#define ACTION_BACKDROP 23 +#define ACTION_WATER 24 +#define ACTION_GAKEJUMP 25 /* 8070A70C-8070A77C 0000EC 0070+00 1/1 0/0 0/0 .text __ct__12daE_MF_HIO_cFv */ daE_MF_HIO_c::daE_MF_HIO_c() { @@ -475,17 +86,17 @@ static int nodeCallBack(J3DJoint* i_joint, int param_2) { } else if (jointNo == 23) { cMtx_YrotM(*calc_mtx, i_this->field_0x7da); } else if (jointNo == 24) { - cMtx_ZrotM(*calc_mtx, i_this->field_0x7dc); + cMtx_ZrotM(*calc_mtx, i_this->field_0x7dc[0]); } else if (jointNo == 27) { - cMtx_YrotM(*calc_mtx, i_this->field_0x7de); + cMtx_YrotM(*calc_mtx, i_this->field_0x7dc[1]); } else if (jointNo == 28) { - cMtx_ZrotM(*calc_mtx, i_this->field_0x7e0); + cMtx_ZrotM(*calc_mtx, i_this->field_0x7dc[2]); } else if (jointNo == 2) { cMtx_YrotM(*calc_mtx, (i_this->field_0x6da / 2) + (i_this->field_0x742[1].y + - i_this->field_0x6d6)); - cMtx_ZrotM(*calc_mtx, i_this->field_0x742[1].x + i_this->field_0x7ce); + cMtx_ZrotM(*calc_mtx, i_this->field_0x742[1].x + i_this->field_0x7cc[1]); } else if (jointNo == 3 || jointNo == 4) { cMtx_YrotM(*calc_mtx, i_this->field_0x742[0].y + (i_this->field_0x6da - i_this->field_0x6d6)); - cMtx_ZrotM(*calc_mtx, i_this->field_0x7cc + (i_this->field_0x742[0].x - i_this->field_0x6d8)); + cMtx_ZrotM(*calc_mtx, i_this->field_0x7cc[0] + (i_this->field_0x742[0].x - i_this->field_0x6d8)); } else if (jointNo == 11) { cMtx_ZrotM(*calc_mtx, i_this->field_0x742[3].y + i_this->field_0x7d2); } else if (jointNo == 12) { @@ -629,21 +240,16 @@ static BOOL other_bg_check2(e_mf_class* i_this, cXyz* param_2) { UNK_REL_BSS; -/* 80713F64-80713F68 -00001 0004+00 1/2 0/0 0/0 .bss None */ -/* 80713F64 0001+00 data_80713F64 @1009 */ -/* 80713F65 0003+00 data_80713F65 None */ -static u8 struct_80713F64; - -static u8 data_80713F65; +u8 l_initHIO; /* 80713F74-80713F98 000054 0024+00 9/10 0/0 0/0 .bss l_HIO */ -static daE_MF_HIO_c l_HIO; +daE_MF_HIO_c l_HIO; /* 80713F98-80713FC0 000078 0028+00 2/2 0/0 0/0 .bss target_info */ -static fopAc_ac_c* target_info[10]; +fopAc_ac_c* target_info[10]; /* 80713FC0-80713FC4 0000A0 0004+00 2/2 0/0 0/0 .bss target_info_count */ -static int target_info_count; +int target_info_count; /* 8070B1EC-8070B268 000BCC 007C+00 1/1 0/0 0/0 .text s_b_sub__FPvPv */ static void* s_b_sub(void* i_actor, void* i_data) { @@ -657,8 +263,8 @@ static void* s_b_sub(void* i_actor, void* i_data) { /* 8070B268-8070B6E0 000C48 0478+00 2/2 0/0 0/0 .text search_bomb__FP10e_mf_classi */ static dBomb_c* search_bomb(e_mf_class* i_this, BOOL param_2) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBomb_c* bomb; target_info_count = 0; for (int i = 0; i < 10; i++) { target_info[i] = NULL; @@ -670,7 +276,7 @@ static dBomb_c* search_bomb(e_mf_class* i_this, BOOL param_2) { if (target_info_count != 0) { cXyz sp44, sp50, sp5c; for (int i = 0; i < target_info_count;) { - dBomb_c* bomb = (dBomb_c*)target_info[i]; + bomb = (dBomb_c*)target_info[i]; sp44.x = bomb->current.pos.x - a_this->eyePos.x; sp44.y = 50.0f + bomb->current.pos.y - a_this->eyePos.y; sp44.z = bomb->current.pos.z - a_this->eyePos.z; @@ -746,25 +352,24 @@ static BOOL player_way_check(e_mf_class* i_this) { /* 8070B76C-8070B848 00114C 00DC+00 4/4 0/0 0/0 .text pl_check__FP10e_mf_classfs */ static int pl_check(e_mf_class* i_this, f32 param_2, s16 param_3) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; - fopAc_ac_c* player = dComIfGp_getPlayer(0); + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); if (i_this->mPlayerDistance < param_2) { s16 sVar1 = a_this->shape_angle.y - i_this->mYAngleToPlayer; if (sVar1 < param_3 && sVar1 > (s16)-param_3 && !other_bg_check(i_this, player)) { return 1; } - } else { - for (int i = 0; i <= 2; i++) { - if (i_this->field_0xa7c[i].ChkCoHit() != 0) { - if (player == dCc_GetAc(i_this->field_0xa7c[i].GetCoHitObj()->GetAc())) { - return 2; - } + } + + for (int i = 0; i <= 2; i++) { + if (i_this->field_0xa7c[i].ChkCoHit() != 0) { + if (player == dCc_GetAc(i_this->field_0xa7c[i].GetCoHitObj()->GetAc())) { + return 2; } } } - + return 0; } @@ -836,7 +441,6 @@ static BOOL jump_pos_check(e_mf_class* i_this, cXyz* param_2) { /* 8070BB10-8070BF94 0014F0 0484+00 2/1 0/0 0/0 .text e_mf_stay__FP10e_mf_class */ static void e_mf_stay(e_mf_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; cXyz sp30; @@ -995,7 +599,6 @@ static void e_mf_otoreac(e_mf_class* i_this) { /* 8070C2C4-8070C7C4 001CA4 0500+00 2/1 0/0 0/0 .text e_mf_bomb_action__FP10e_mf_class */ static void e_mf_bomb_action(e_mf_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; s16 sVar2; cXyz sp3c, sp48; @@ -1113,7 +716,6 @@ static void e_mf_bomb_action(e_mf_class* i_this) { /* 8070C7C4-8070CB1C 0021A4 0358+00 1/1 0/0 0/0 .text e_mf_normal__FP10e_mf_class */ static void e_mf_normal(e_mf_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; cXyz sp44, sp50; f32 fVar1 = 0.0f; @@ -1152,7 +754,7 @@ static void e_mf_normal(e_mf_class* i_this) { break; case 3: - fVar1 = l_HIO.movement_speed; + fVar1 = l_HIO.movement_speed; sVar2 = a_this->current.angle.y; cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x5d4, 2, 0x400); sVar3 = a_this->current.angle.y - i_this->field_0x5d4; @@ -1160,17 +762,18 @@ static void e_mf_normal(e_mf_class* i_this) { fVar1 = 0.0f; } - sVar3 = (sVar2 - a_this->current.angle.y) * 2; - if (sVar3 > 0x1000) { + sVar2 -= a_this->current.angle.y; + sVar2 *= 2; + if (sVar2 > 0x1000) { sVar2 = 0x1000; - } else if (sVar3 < -0x1000) { + } else if (sVar2 < -0x1000) { sVar2 = -0x1000; } cLib_addCalcAngleS2(&i_this->field_0x806, sVar2, 2, 0x400); if (i_this->field_0x6c0[0] == 0 || - ((i_this->field_0x6c0[1] == 0 && fopAcM_wayBgCheck(a_this, 200.0f, 50.0f)) || move_gake_check(i_this, 200.0f, 0))) { + (i_this->field_0x6c0[1] == 0 && (fopAcM_wayBgCheck(a_this, 200.0f, 50.0f) || move_gake_check(i_this, 200.0f, 0)))) { i_this->field_0x5b4 = 2; i_this->field_0x6c0[0] = cM_rndF(100.0f) + 50.0f; anm_init(i_this, 33, 10.0f, 2, 1.0f); @@ -1886,7 +1489,6 @@ static void e_mf_tail_attack(e_mf_class* i_this) { /* 8070EA10-8070EC60 0043F0 0250+00 2/1 0/0 0/0 .text e_mf_guard__FP10e_mf_class */ static void e_mf_guard(e_mf_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; i_this->field_0x6d1 = 1; @@ -1979,7 +1581,6 @@ static void e_mf_s_damage(e_mf_class* i_this) { /* 8070ED10-8070EEC4 0046F0 01B4+00 1/1 0/0 0/0 .text kado_check__FP10e_mf_class */ static int kado_check(e_mf_class* i_this) { - // NONMATCHING static int kado_bit[2] = { 1, 2, }; @@ -2044,7 +1645,6 @@ static BOOL body_gake(e_mf_class* i_this) { /* 8070F08C-8070FBEC 004A6C 0B60+00 2/1 0/0 0/0 .text e_mf_damage__FP10e_mf_class */ static void e_mf_damage(e_mf_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; cXyz sp34, sp40; @@ -2611,119 +2211,115 @@ static void damage_check(e_mf_class* i_this) { /* 807104EC-807119BC 005ECC 14D0+00 2/1 0/0 0/0 .text action__FP10e_mf_class */ static void action(e_mf_class* i_this) { - // NONMATCHING - static s16 j_spd[11] = { - 0x4000, 0x4000, 0x4000, - 0x1000, 0x1000, 0x1000, - 0x1000, 0x4000, 0x4000, - 0x4000, 0x4000 - }; - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; - fopAc_ac_c* player = dComIfGp_getPlayer(0); + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); cXyz sp240, sp24c; i_this->field_0x6d4 = 0; - i_this->mPlayerDistance = fopAcM_searchPlayerDistanceXZ(a_this); - i_this->mYAngleToPlayer = fopAcM_searchPlayerAngleY(a_this); - i_this->mXAngleToPlayer = fopAcM_searchPlayerAngleX(a_this); + f32 fVar1 = fopAcM_searchPlayerDistanceXZ(a_this); + i_this->mPlayerDistance = fVar1; + s16 sVar1 = fopAcM_searchPlayerAngleY(a_this); + i_this->mYAngleToPlayer = sVar1; + sVar1 = fopAcM_searchPlayerAngleX(a_this); + i_this->mXAngleToPlayer = sVar1; damage_check(i_this); i_this->field_0x80e = 0; - bool bVar1 = false; - bool bVar2 = true; + s8 bVar1 = 0; + s8 bVar2 = 1; a_this->offHeadLockFlg(); - if (!fopAcM_otherBgCheck(player, a_this)) { - fopAcM_OnStatus(a_this, 0); - a_this->attention_info.flags = 4; - } else { + if (fopAcM_otherBgCheck(player, a_this)) { fopAcM_OffStatus(a_this, 0); a_this->attention_info.flags = 0; + } else { + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; } switch (i_this->mAction) { - case 0: + case ACTION_NORMAL: e_mf_normal(i_this); break; - case 3: + case ACTION_FIGHT_RUN: e_mf_fight_run(i_this); - bVar1 = true; + bVar1 = 1; break; - case 5: + case ACTION_ATTACK: e_mf_attack(i_this); - bVar1 = true; + bVar1 = 1; break; - case 6: + case ACTION_TAIL_ATTACK: e_mf_tail_attack(i_this); - bVar1 = true; + bVar1 = 1; break; - case 7: + case ACTION_GUARD: e_mf_guard(i_this); - bVar1 = true; + bVar1 = 1; break; - case 8: + case ACTION_JUMP: e_mf_jump(i_this); - bVar1 = true; + bVar1 = 1; break; - case 9: + case ACTION_STAY: e_mf_stay(i_this); break; - case 10: + case ACTION_OTOREAC: e_mf_otoreac(i_this); break; - case 11: - e_mf_bomb_action(i_this); - break; - - case 12: + case ACTION_DRAWBACK: e_mf_drawback(i_this); - bVar1 = true; + bVar1 = 1; break; - case 13: + case ACTION_WOLFBITE: e_mf_wolfbite(i_this); break; - case 20: + case ACTION_BOMB_ACTION: + e_mf_bomb_action(i_this); + break; + + case ACTION_S_DAMAGE: e_mf_s_damage(i_this); break; - case 21: + case ACTION_DAMAGE: e_mf_damage(i_this); break; - case 23: + case ACTION_BACKDROP: e_mf_backdrop(i_this); break; - case 24: + case ACTION_WATER: e_mf_water(i_this); - bVar2 = false; + bVar2 = 0; break; - case 25: + case ACTION_GAKEJUMP: e_mf_gakejump(i_this); - bVar1 = true; + bVar1 = 1; } - f32 fVar1; + f32 fVar6 = 0.0f; if (bVar2) { - dBgS_ObjGndChk gnd_chk; + dBgS_ObjGndChk obj_gnd_chk; dBgS_ObjGndChk_Spl spl_chk; sp240 = a_this->current.pos; sp240.y += 150.0f; spl_chk.SetPos(&sp240); - gnd_chk.SetPos(&sp240); + obj_gnd_chk.SetPos(&sp240); i_this->field_0xa3c = dComIfG_Bgsp().GroundCross(&spl_chk); - if (a_this->current.pos.y < i_this->field_0xa3c && (i_this->field_0xa3c - dComIfG_Bgsp().GroundCross(&gnd_chk)) > 100.0f) { + fVar1 = i_this->field_0xa3c - dComIfG_Bgsp().GroundCross(&obj_gnd_chk); + if (a_this->current.pos.y < i_this->field_0xa3c && fVar1 > 100.0f) { OS_REPORT("DN YOGAN \n"); i_this->mAction = 24; if (dComIfG_Bgsp().GetPolyAtt0(spl_chk) == 6) { @@ -2749,13 +2345,29 @@ static void action(e_mf_class* i_this) { cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x2000); cLib_addCalcAngleS2(&a_this->shape_angle.z, a_this->current.angle.z, 2, 0x2000); - if (i_this->field_0x5d8 == 0) { + if (i_this->field_0x5d8 != 0) { + cMtx_YrotS(*calc_mtx, i_this->field_0x5d4); + cMtx_XrotM(*calc_mtx, i_this->field_0x5d6); + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = a_this->speedF; + MtxPosition(&sp240, &sp24c); + a_this->current.pos += sp24c; + sp240 = i_this->field_0x5bc - i_this->field_0x5c8; + fVar1 = sp240.abs(); + sp240 = i_this->field_0x5bc - a_this->current.pos; + f32 fVar2 = sp240.abs(); + f32 fVar3 = fVar1 * 0.3f; + if (fVar3 > 250.0f) { + fVar3 = 250.0f; + } + + i_this->field_0x700 = fVar3 * cM_ssin((fVar2 / fVar1) * 32768.0f); + i_this->field_0x5d8 = 0; + } else { cLib_addCalc0(&i_this->field_0x700, 1.0f, 30.0f); - if (i_this->field_0x6e4 == 0.0f) { - cMtx_YrotS(*calc_mtx, a_this->current.angle.y); - sp240.z = a_this->speedF; - } else { + if (i_this->field_0x6e4 != fVar6) { cMtx_YrotS(*calc_mtx, i_this->field_0x704.y); if (i_this->field_0x820 == 0) { sp240.z = i_this->field_0x6e4; @@ -2764,7 +2376,10 @@ static void action(e_mf_class* i_this) { a_this->speed.y = 0.0f; } - a_this->gravity = 0.0f; + a_this->gravity = -4.0f; + } else { + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + sp240.z = a_this->speedF; } sp240.x = 0.0f; sp240.y = 0.0f; @@ -2797,37 +2412,18 @@ static void action(e_mf_class* i_this) { a_this->current.pos += sp24c; cLib_addCalc0(&i_this->field_0x6e8, 1.0f, 7.0f); } - } else { - cMtx_YrotS(*calc_mtx, i_this->field_0x5d4); - cMtx_XrotM(*calc_mtx, i_this->field_0x5d6); - sp240.x = 0.0f; - sp240.y = 0.0f; - sp240.z = a_this->speedF; - MtxPosition(&sp240, &sp24c); - a_this->current.pos += sp24c; - sp240 = i_this->field_0x5bc - i_this->field_0x5c8; - fVar1 = sp240.abs(); - sp240 = i_this->field_0x5bc - a_this->current.pos; - f32 fVar2 = sp240.abs(); - f32 fVar3 = fVar1 * 0.3f; - - if (fVar3 > 250.0f) { - fVar3 = 250.0f; - } - - i_this->field_0x700 = fVar3 * cM_ssin((fVar2 / fVar1) * 32768.0f); - i_this->field_0x5d8 = 0; } - s16 sVar1 = 0x800; + sVar1 = 0x800; if (i_this->field_0x6e0 != 0) { i_this->field_0x6e0--; - i_this->field_0x6d4 = 2;cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + i_this->field_0x6d4 = 2; + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); - if (i_this->field_0x6e1 == 0) { - sp240.x = -100.0f; - } else { + if (i_this->field_0x6e1 != 0) { sp240.x = 100.0f; + } else { + sp240.x = -100.0f; } sp240.y = 100.0f; sp240.z = -100.0f; @@ -2836,11 +2432,7 @@ static void action(e_mf_class* i_this) { sVar1 = 0x400; } - if (i_this->field_0x6d4 == 0) { - cLib_addCalcAngleS2(&i_this->field_0x6d6, 0, 2, sVar1); - cLib_addCalcAngleS2(&i_this->field_0x6d8, 0, 2, sVar1); - i_this->field_0x6dc = 0; - } else { + if (i_this->field_0x6d4 != 0) { if (i_this->field_0x6d4 == 5) { if ((i_this->field_0x6ac & 15) == 0 && cM_rndF(1.0f) < 0.3f) { i_this->field_0x6dc = cM_rndFX(2500.0f); @@ -2857,26 +2449,26 @@ static void action(e_mf_class* i_this) { s16 sVar2 = cM_atan2s(sp240.x, sp240.z) - a_this->shape_angle.y; s16 sVar3 = a_this->shape_angle.x + cM_atan2s(sp240.y, JMAFastSqrt(sp240.x * sp240.x + sp240.z * sp240.z)); - if (sVar2 < 0x2711) { - if (sVar2 < -10000) { - sVar2 = -10000; - } - } else { + if (sVar2 > 0x2710) { sVar2 = 10000; + } else if (sVar2 < -10000) { + sVar2 = -10000; } - if (sVar3 < 0x2711) { - if (sVar3 < -20000) { - sVar3 = -20000; - } - } else { + if (sVar3 > 0x2710) { sVar3 = 10000; + } else if (sVar3 < -20000) { + sVar3 = -20000; } cLib_addCalcAngleS2(&i_this->field_0x6d6, sVar2 / 2, 2, sVar1); cLib_addCalcAngleS2(&i_this->field_0x6d8, sVar3 / 2, 2, sVar1); } + i_this->field_0x6dc = 0; + } else { + cLib_addCalcAngleS2(&i_this->field_0x6d6, 0, 2, sVar1); + cLib_addCalcAngleS2(&i_this->field_0x6d8, 0, 2, sVar1); i_this->field_0x6dc = 0; } @@ -2884,7 +2476,7 @@ static void action(e_mf_class* i_this) { if (i_this->field_0x6de != 0) { i_this->field_0x6de--; - i_this->field_0x6da = i_this->field_0x6de * cM_ssin(i_this->field_0x6de * 1200) * 200.0f; + i_this->field_0x6da = i_this->field_0x6de * cM_ssin(i_this->field_0x6de * 12000) * 200.0f; } if (i_this->field_0x72c > 1.0f) { @@ -2922,42 +2514,34 @@ static void action(e_mf_class* i_this) { cLib_addCalc0(&i_this->field_0x734, 1.0f, 30.0f); } - if (i_this->field_0x6e4 != 0.0f) { + if (i_this->field_0x6e4 != fVar6) { s16 sVar4 = i_this->field_0x704.y - a_this->shape_angle.y; i_this->field_0x784[3].y = 0x4000 - sVar4; - if (i_this->field_0x784[3].y < 0x1771) { - if (i_this->field_0x784[3].y < -9000) { - i_this->field_0x784[3].y = -9000; - } - } else { + if (i_this->field_0x784[3].y > 0x1770) { i_this->field_0x784[3].y = 6000; + } else if (i_this->field_0x784[3].y < -9000) { + i_this->field_0x784[3].y = -9000; } i_this->field_0x784[4].y = 0x4000 - sVar4; - if (i_this->field_0x784[4].y < 0x4269) { - if (i_this->field_0x784[4].y < 0) { - i_this->field_0x784[4].y = 0; - } - } else { + if (i_this->field_0x784[4].y > 0x4268) { i_this->field_0x784[4].y = 17000; + } else if (i_this->field_0x784[4].y < 0) { + i_this->field_0x784[4].y = 0; } i_this->field_0x784[5].y = sVar4 + 0x4000; - if (i_this->field_0x784[5].y < 0x1771) { - if (i_this->field_0x784[5].y < -9000) { - i_this->field_0x784[5].y = -9000; - } - } else { + if (i_this->field_0x784[5].y > 0x1770) { i_this->field_0x784[5].y = 6000; + } else if (i_this->field_0x784[5].y < -9000) { + i_this->field_0x784[5].y = -9000; } i_this->field_0x784[6].y = sVar4 + 0x4000; - if (i_this->field_0x784[6].y < 0x4269) { - if (i_this->field_0x784[6].y < 0) { - i_this->field_0x784[6].y = 0; - } - } else { + if (i_this->field_0x784[6].y > 0x4268) { i_this->field_0x784[6].y = 17000; + } else if (i_this->field_0x784[6].y < 0) { + i_this->field_0x784[6].y = 0; } cMtx_YrotS(*calc_mtx, sVar4); @@ -2975,6 +2559,13 @@ static void action(e_mf_class* i_this) { i_this->field_0x816.x += 6000; } + static s16 j_spd[11] = { + 0x4000, 0x4000, 0x4000, + 0x1000, 0x1000, 0x1000, + 0x1000, 0x4000, 0x4000, + 0x4000, 0x4000 + }; + for (int i = 0; i < 11; i++) { cLib_addCalcAngleS2(&i_this->field_0x742[i].x, i_this->field_0x784[i].x, 2, j_spd[i]); cLib_addCalcAngleS2(&i_this->field_0x742[i].y, i_this->field_0x784[i].y, 2, j_spd[i]); @@ -2982,23 +2573,25 @@ static void action(e_mf_class* i_this) { i_this->field_0x784[i].z = 0; i_this->field_0x784[i].x = 0; - if (i < 3 || i > 6) { - i_this->field_0x784[i].y = 0; - } else if (i_this->field_0x7e2[i - 3] == 0) { - s16 sVar5; - if (i == 4 || i == 6) { - sVar5 = 0x600; + if (i >= 3 && i <= 6) { + if (i_this->field_0x7dc[i] == 0) { + s16 sVar5; + if (i == 4 || i == 6) { + sVar5 = 0x600; + } else { + sVar5 = 0x800; + } + + cLib_addCalcAngleS2(&i_this->field_0x784[i].y, 0, 1, sVar5); } else { - sVar5 = 0x800; + i_this->field_0x7dc[i]--; } - - cLib_addCalcAngleS2(&i_this->field_0x784[i].y, 0, 1, sVar5); } else { - i_this->field_0x7e2[i - 6]--; + i_this->field_0x784[i].y = 0; } - if (i > 2) { - i_this->field_0x7e2[i - 2] = i_this->field_0x7c8 * cM_scos(i_this->field_0x6ac * 4000 + i * 20000); + if (i >= 3) { + i_this->field_0x7cc[i] = i_this->field_0x7c8 * cM_scos(i_this->field_0x6ac * 4000 + i * 20000); } } @@ -3011,40 +2604,43 @@ static void action(e_mf_class* i_this) { i_this->field_0x808--; } - f32 fVar4 = i_this->field_0x808 * 1.0f; - if (fVar4 > 30.0f) { - fVar4 = 30.0f; + fVar1 = i_this->field_0x808 * 1.0f; + if (fVar1 > 30.0f) { + fVar1 = 30.0f; } - fVar1 = fVar4 * fVar4; + fVar1 *= fVar1; for (int i = 0; i < 4; i++) { i_this->field_0x7ee[i].x = fVar1 * (cM_ssin(i_this->field_0x6ac * 5000 + i * -15000) * 5.0f); i_this->field_0x7ee[i].y = fVar1 * (cM_ssin(i_this->field_0x6ac * 0x12C0 + i * -13000) * 5.0f); } + J3DModel* model; cLib_addCalcAngleS2(&i_this->field_0x806, 0, 4, 0x100); if (i_this->field_0x716 != 0) { i_this->field_0x716--; if (i_this->field_0x704.x != 0) { - cXyz sp258, sp264, sp270; - dBgS_GndChk gnd_chk2; - s16 sVar6 = 0; + Vec sp258; + cXyz sp264, sp270; + dBgS_GndChk gnd_chk; + int sVar6 = 0; s16 sVar7 = 0; fVar1 = 100.0f; MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); sp240.set(0.0f, 0.0f, 0.0f); MtxPosition(&sp240, &sp264); - sp264.y += 100.0f + 100.0f; - gnd_chk2.SetPos(&sp264); - sp264.y = dComIfG_Bgsp().GroundCross(&gnd_chk2); + sp264.y += 100.0f; + sp264.y += 100.0f; + gnd_chk.SetPos(&sp264); + sp264.y = dComIfG_Bgsp().GroundCross(&gnd_chk); if (sp264.y != -1000000000.0f) { sp258.x = sp264.x; - sp258.y += 100.0f; + sp258.y = sp264.y + 100.0f; sp258.z = sp264.z + fVar1; - gnd_chk2.SetPos(&sp258); - sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk2); + gnd_chk.SetPos(&sp258); + sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk); if (sp258.y != -1000000000.0f) { sVar7 = -cM_atan2s(sp258.y - sp264.y, sp258.z - sp264.z); @@ -3054,10 +2650,10 @@ static void action(e_mf_class* i_this) { } sp258.x = sp264.x + fVar1; - sp258.y += 100.0f; + sp258.y = sp264.y + 100.0f; sp258.z = sp264.z; - gnd_chk2.SetPos(&sp258); - sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk2); + gnd_chk.SetPos(&sp258); + sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk); if (sp258.y != -1000000000.0f) { sVar6 = cM_atan2s(sp258.y - sp264.y, sp258.x - sp264.x); if (sVar6 > 0x3000 || sVar6 < -0x3000) { @@ -3068,22 +2664,111 @@ static void action(e_mf_class* i_this) { dBgS_LinChk lin_chk; cXyz sp27c, sp288, sp294; + + sp288 = a_this->current.pos; + sp288.y += 30.0f; + model = i_this->mpModelMorf->getModel(); + sp27c.set(0.0f, 0.0f, 0.0f); + MTXCopy(model->getAnmMtx(4), *calc_mtx); + MtxPosition(&sp27c, &sp294); + sp294.y += 30.0f; + lin_chk.Set(&sp288, &sp294, a_this); + + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + sp27c = sp288 - sp294; + cMtx_YrotS(*calc_mtx, cM_atan2s(sp27c.x, sp27c.z)); + sp27c.x = 0.0f; + sp27c.y = 0.0f; + sp27c.z = 50.0f; + MtxPosition(&sp27c, &sp24c); + a_this->current.pos += sp24c; + } + + i_this->field_0x710.x = sVar7; + i_this->field_0x710.z = sVar6; } } + + cLib_addCalcAngleS2(&i_this->field_0x70a.x, i_this->field_0x710.x, 1, 0x400); + cLib_addCalcAngleS2(&i_this->field_0x70a.z, i_this->field_0x710.z, 1, 0x400); + + if (i_this->field_0x10c4 != 0) { + model = i_this->mpModelMorf->getModel(); + sp240.set(0.0f, 0.0f, 0.0f); + + static int foot_idx[2] = { + 26, 30, + }; + for (int i = 0; i < 2; i++) { + if ((i_this->field_0x10c4 == 3 || (i_this->field_0x10c4 == 2 && i == 1)) || (i_this->field_0x10c4 == 1 && i == 0)) { + MTXCopy(model->getAnmMtx(foot_idx[i]), *calc_mtx); + MtxPosition(&sp240, &sp24c); + fopAcM_effSmokeSet1(&i_this->field_0x10c8[i], &i_this->field_0x10d0[i], &sp24c, &a_this->shape_angle, 1.0f, &a_this->tevStr, 0); + } + } + + i_this->field_0x10c4 = 0; + } + + if (i_this->field_0x10ba != 0) { + i_this->field_0x10ba--; + if (i_this->field_0x10ba == 0) { + dComIfGp_particle_set(0x15E, &a_this->eyePos, &a_this->shape_angle, NULL); + } + } } /* 807119BC-80711CB8 00739C 02FC+00 1/1 0/0 0/0 .text anm_se_set__FP10e_mf_class */ static void anm_se_set(e_mf_class* i_this) { - // NONMATCHING + int frame = i_this->mpModelMorf->getFrame(); + + if (i_this->field_0x5e0 == 8) { + if (frame == 35) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_TAIL, 0, -1); + } else if (frame == 28) { + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_TAIL, -1); + } + } else if (i_this->field_0x5e0 == 4) { + if (frame == 18) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_KNIFE, 0, -1); + } + } else if (i_this->field_0x5e0 == 5) { + if (frame == 10) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_KNIFE2_A, 0, -1); + } + + if (frame == 24) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_KNIFE2_B, 0, -1); + } + } else if (i_this->field_0x5e0 == 35) { + if (frame == 3) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_L, 0, -1); + } else if (frame == 18) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_R, 0, -1); + } + } else if (i_this->field_0x5e0 == 30) { + if (frame == 10) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_L, 0, -1); + } else if (frame == 4) { + i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_R, 0, -1); + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_BREATH, -1); + } + } else if (i_this->field_0x5e0 == 33) { + if (frame == 15) { + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_SEARCH, -1); + } + } else if (i_this->field_0x5e0 == 34 && frame == 15) { + i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_SEARCH2, -1); + } } /* 80713FC4-80713FC8 0000A4 0004+00 1/2 0/0 0/0 .bss c_start */ -static int c_start; +int c_start; /* 80711CB8-80712998 007698 0CE0+00 2/1 0/0 0/0 .text daE_MF_Execute__FP10e_mf_class */ static int daE_MF_Execute(e_mf_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = &i_this->actor; + f32 fVar1 = 0.0f; if (i_this->field_0x728 != 0) { return 1; @@ -3124,7 +2809,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { action(i_this); if (i_this->field_0x820 == 0 && i_this->field_0x5d8 == 0) { - if (i_this->field_0x6e4 != 0.0f) { + if (i_this->field_0x6e4 != fVar1) { cMtx_YrotS(*calc_mtx, i_this->field_0x704.y); sp2c.x = 0.0f; sp2c.y = 0.0f; @@ -3138,7 +2823,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { } i_this->mObjAcch.CrrPos(dComIfG_Bgsp()); - if (i_this->field_0x6e4 != 0.0f) { + if (i_this->field_0x6e4 != fVar1) { a_this->current.pos -= sp38; a_this->old.pos -= sp38; } @@ -3189,7 +2874,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { MtxPosition(&sp2c, &sp38); sp2c.set(0.0f, 0.0f, -200.0f); MtxPosition(&sp2c, &sp44); - if (sp44.y < sp38.y) { + if (sp38.y < sp44.y) { i_this->field_0x717 = 0; } else { @@ -3209,9 +2894,9 @@ static int daE_MF_Execute(e_mf_class* i_this) { sp5c.y += 40.0f; i_this->field_0xa7c[0].SetC(sp5c); if (daPy_getPlayerActorClass()->checkHorseRide()) { - i_this->field_0xa7c[0].SetR(50.0f); - } else { i_this->field_0xa7c[0].SetR(70.0f); + } else { + i_this->field_0xa7c[0].SetR(50.0f); } a_this->attention_info.position = a_this->eyePos; @@ -3383,7 +3068,7 @@ static int daE_MF_Delete(e_mf_class* i_this) { dComIfG_resDelete(&i_this->mPhase, "E_mf"); if (i_this->field_0x10b9 != 0) { - data_80713F65 = 0; + l_initHIO = 0; } if (a_this->heap != NULL) { @@ -3393,9 +3078,21 @@ static int daE_MF_Delete(e_mf_class* i_this) { return 1; } +/* 80713CD8-80713CE4 0001D0 000C+00 1/0 0/0 0/0 .data jv_offset */ +Vec jv_offset = { 0.0f, 0.0f, 0.0f }; + +/* 80713CE4-80713D74 -00001 0090+00 1/1 0/0 0/0 .data jc_data */ +dJntColData_c jc_data[12] = { + {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, + {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, + {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, + {0, 1, 18, 10.0f, &jv_offset}, {0, 1, 23, 20.0f, &jv_offset}, + {0, 1, 24, 15.0f, &jv_offset}, {0, 1, 27, 20.0f, &jv_offset}, + {0, 1, 28, 15.0f, &jv_offset}, {0, 1, 32, 20.0f, &jv_offset}, +}; + /* 80712A08-80712BF0 0083E8 01E8+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ static int useHeapInit(fopAc_ac_c* a_this) { - // NONMATCHING e_mf_class* i_this = (e_mf_class*)a_this; i_this->mpModelMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_mf", 38), NULL, NULL, @@ -3409,7 +3106,9 @@ static int useHeapInit(fopAc_ac_c* a_this) { model->setUserArea((u32)i_this); for (u16 i = 0; i < model->getModelData()->getJointNum(); i++) { - model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); + if (i != 0) { + model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); + } } if (i_this->field_0x694.init(a_this, &jc_data[0], model, 12) == 0) { @@ -3435,7 +3134,6 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80712BF0-80712F20 0085D0 0330+00 1/0 0/0 0/0 .text daE_MF_Create__FP10fopAc_ac_c */ static cPhs__Step daE_MF_Create(fopAc_ac_c* a_this) { - // NONMATCHING e_mf_class* i_this = (e_mf_class*)a_this; fopAcM_SetupActor(a_this, e_mf_class); @@ -3473,9 +3171,9 @@ static cPhs__Step daE_MF_Create(fopAc_ac_c* a_this) { return cPhs_ERROR_e; } - if (data_80713F65 == 0) { + if (l_initHIO == 0) { i_this->field_0x10b9 = 1; - data_80713F65 = 1; + l_initHIO = 1; l_HIO.field_0x4 = -1; } @@ -3559,111 +3257,12 @@ static cPhs__Step daE_MF_Create(fopAc_ac_c* a_this) { } /* 80712F20-807130FC 008900 01DC+00 1/1 0/0 0/0 .text __ct__10e_mf_classFv */ -e_mf_class::e_mf_class() { - // NONMATCHING -} - -/* 807130FC-80713144 008ADC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -// cM3dGSph::~cM3dGSph() { -extern "C" void __dt__8cM3dGSphFv() { - // NONMATCHING -} - -/* 80713144-8071318C 008B24 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 8071318C-80713258 008B6C 00CC+00 1/1 0/0 0/0 .text __dt__8dCcD_SphFv */ -// dCcD_Sph::~dCcD_Sph() { -extern "C" void __dt__8dCcD_SphFv() { - // NONMATCHING -} - -/* 80713258-807132DC 008C38 0084+00 1/1 0/0 0/0 .text __ct__8dCcD_SphFv */ -// dCcD_Sph::dCcD_Sph() { -extern "C" void __ct__8dCcD_SphFv() { - // NONMATCHING -} - -/* 807132DC-80713338 008CBC 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - -/* 80713338-807133A8 008D18 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING -} - -/* 807133A8-80713418 008D88 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING -} - -/* 80713418-8071341C 008DF8 0004+00 1/1 0/0 0/0 .text __ct__5csXyzFv */ -// csXyz::csXyz() { -extern "C" void __ct__5csXyzFv() { - /* empty function */ -} - -/* 8071341C-80713464 008DFC 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* 807134AC-807134E8 008E8C 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_mf_cpp */ -void __sinit_d_a_e_mf_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x807134AC, __sinit_d_a_e_mf_cpp); -#pragma pop - -/* 807134E8-807134F0 008EC8 0008+00 1/0 0/0 0/0 .text @20@__dt__14dBgS_ObjGndChkFv */ -static void func_807134E8() { - // NONMATCHING -} - -/* 807134F0-807134F8 008ED0 0008+00 1/0 0/0 0/0 .text @76@__dt__14dBgS_ObjGndChkFv */ -static void func_807134F0() { - // NONMATCHING -} - -/* 807134F8-80713500 008ED8 0008+00 1/0 0/0 0/0 .text @60@__dt__14dBgS_ObjGndChkFv */ -static void func_807134F8() { - // NONMATCHING -} - -/* 80713500-80713508 008EE0 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_80713500() { - // NONMATCHING -} - -/* 80713508-80713510 008EE8 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_80713508() { - // NONMATCHING -} - -/* 80713924-80713960 009304 003C+00 1/1 0/0 0/0 .text __dt__5csXyzFv */ -// csXyz::~csXyz() { -extern "C" void __dt__5csXyzFv() { - // NONMATCHING -} +e_mf_class::e_mf_class() {} AUDIO_INSTANCES; -/* 80713AF4-80713AF4 000180 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ - /* 80713E34-80713E54 -00001 0020+00 1/0 0/0 0/0 .data l_daE_MF_Method */ -static actor_method_class l_daE_MF_Method = { +actor_method_class l_daE_MF_Method = { (process_method_func)daE_MF_Create, (process_method_func)daE_MF_Delete, (process_method_func)daE_MF_Execute, From 5d5859e448e5efb7ee86cdb4bc88c1578fe20802 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:18:22 -0400 Subject: [PATCH 16/21] Started copying over to d_a_e_dn --- include/d/actor/d_a_e_dn.h | 144 +- include/d/actor/d_a_e_mf.h | 19 +- src/d/actor/d_a_e_dn.cpp | 2746 +++++++++++++++++++++++++----------- src/d/actor/d_a_e_mf.cpp | 10 +- 4 files changed, 2100 insertions(+), 819 deletions(-) diff --git a/include/d/actor/d_a_e_dn.h b/include/d/actor/d_a_e_dn.h index 53c450ef66a..b2c07b73629 100644 --- a/include/d/actor/d_a_e_dn.h +++ b/include/d/actor/d_a_e_dn.h @@ -1,5 +1,9 @@ #ifndef D_A_E_DN_H #define D_A_E_DN_H +#include "d/d_bg_s_acch.h" +#include "d/d_cc_d.h" +#include "d/d_cc_uty.h" +#include "d/d_jnt_col.h" #include "f_op/f_op_actor_mng.h" /** @@ -11,16 +15,148 @@ * */ class e_dn_class : public fopEn_enemy_c { +public: /* 804EDE58 */ e_dn_class(); -private: - /* 0x5ac */ u8 field_0x5ac[0x110c - 0x5ac]; + + /* 0x05AC */ request_of_phase_process_class mPhase; + /* 0x05B4 */ s16 field_0x5b4; + /* 0x05B6 */ u8 field_0x5b6; + /* 0x05B7 */ u8 field_0x5b7; + /* 0x05B8 */ u8 field_0x5b8; + /* 0x05B9 */ u8 field_0x5b9; + /* 0x05BA */ u8 field_0x5ba[0x5bc - 0x5ba]; + /* 0x05BC */ cXyz field_0x5bc; + /* 0x05C8 */ cXyz field_0x5c8; + /* 0x05D4 */ s16 field_0x5d4; + /* 0x05D6 */ s16 field_0x5d6; + /* 0x05D8 */ s8 field_0x5d8; + /* 0x05D9 */ u8 field_0x5d9[0x5dc - 0x5d9]; + /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; + /* 0x05E0 */ int field_0x5e0; + /* 0x05E4 */ J3DModel* field_0x5e4; + /* 0x05E8 */ Z2CreatureEnemy mSound; + /* 0x068C */ J3DModel* field_0x68c; + /* 0x0690 */ J3DModel* field_0x690; + /* 0x0694 */ s8 field_0x694; + /* 0x0695 */ u8 field_0x695[3]; + /* 0x0698 */ cXyz field_0x698; + /* 0x06A4 */ cXyz field_0x6a4; + /* 0x06B0 */ s16 field_0x6b0; + /* 0x06B2 */ s16 field_0x6b2; + /* 0x06B4 */ dJntCol_c mJntCol; + /* 0x06C4 */ s8 field_0x6c4; + /* 0x06C5 */ u8 field_0x6c5[3]; + /* 0x06C8 */ f32 field_0x6c8; + /* 0x06CC */ s16 field_0x6cc; + /* 0x06CE */ s16 mAction; + /* 0x06D0 */ f32 mPlayerDistance; + /* 0x06D4 */ s16 mYAngleToPlayer; + /* 0x06D6 */ s16 mXAngleToPlayer; + /* 0x06D8 */ f32 field_0x6d8; + /* 0x06DC */ u32 mShadowKey; + /* 0x06E0 */ s16 field_0x6e0[4]; + /* 0x06E8 */ s16 field_0x6e8; + /* 0x06EA */ s16 field_0x6ea; + /* 0x06EC */ s16 field_0x6ec; + /* 0x06EE */ s8 field_0x6ee; + /* 0x06EF */ s8 field_0x6ef; + /* 0x06F0 */ s8 field_0x6f0; + /* 0x06F1 */ s8 field_0x6f1; + /* 0x06F2 */ s8 field_0x6f2; + /* 0x06F3 */ u8 field_0x6f3; + /* 0x06F4 */ u8 field_0x6f4; + /* 0x06F5 */ u8 field_0x6f5; + /* 0x06F6 */ s16 field_0x6f6; + /* 0x06F8 */ s16 field_0x6f8; + /* 0x06FA */ s16 field_0x6fa; + /* 0x06FC */ u8 field_0x6fc[0x700 - 0x6fc]; + /* 0x0700 */ u8 field_0x700; + /* 0x0701 */ u8 field_0x701; + /* 0x0702 */ u8 field_0x702[2]; + /* 0x0704 */ f32 field_0x704; + /* 0x0708 */ f32 field_0x708; + /* 0x070C */ s16 field_0x70c; + /* 0x070E */ s16 field_0x70e; + /* 0x0710 */ u8 field_0x710; + /* 0x0711 */ u8 field_0x711[0x720 - 0x711]; + /* 0x0720 */ f32 field_0x720; + /* 0x0724 */ csXyz field_0x724; + /* 0x072A */ csXyz field_0x72a; + /* 0x0730 */ u8 field_0x730[0x737 - 0x730]; + /* 0x0737 */ u8 field_0x737; + /* 0x0738 */ cXyz field_0x738; + /* 0x0744 */ int field_0x744; + /* 0x0748 */ u8 field_0x748[4]; + /* 0x074C */ f32 field_0x74c; + /* 0x0750 */ s16 field_0x750; + /* 0x0752 */ u8 field_0x752[0x762 - 0x752]; + /* 0x0762 */ csXyz field_0x762[11]; + /* 0x07A4 */ csXyz field_0x7a4[11]; + /* 0x07E6 */ u8 field_0x7e6[2]; + /* 0x07E8 */ f32 field_0x7e8; + /* 0x07EC */ s16 field_0x7ec[2]; + /* 0x07F0 */ s16 field_0x7f0; + /* 0x07F2 */ s16 field_0x7f2; + /* 0x07F4 */ s16 field_0x7f4; + /* 0x07F6 */ s16 field_0x7f6; + /* 0x07FA */ s16 field_0x7f8; + /* 0x07FA */ s16 field_0x7fa; + /* 0x07FC */ s16 field_0x7fc[3]; + /* 0x0802 */ u8 field_0x802[0x80a - 0x802]; + /* 0x080A */ s16 field_0x80a; + /* 0x080C */ s16 field_0x80c; + /* 0x080E */ csXyz field_0x80e[4]; + /* 0x0826 */ s16 field_0x826; + /* 0x0828 */ s16 field_0x828; + /* 0x082A */ s16 field_0x82a; + /* 0x082C */ s16 field_0x82c; + /* 0x082E */ s8 field_0x82e; + /* 0x082F */ u8 field_0x82f; + /* 0x0830 */ s16 field_0x830; + /* 0x0832 */ s16 field_0x832; + /* 0x0834 */ u8 field_0x834[0x83c - 0x834]; + /* 0x083C */ f32 field_0x83c; + /* 0x0840 */ s16 field_0x840; + /* 0x0842 */ s16 field_0x842; + /* 0x0844 */ dBgS_AcchCir mAcchCir; + /* 0x0884 */ dBgS_ObjAcch mObjAcch; + /* 0x0A5C */ u8 field_0xa5c[4]; + /* 0x0A60 */ dCcD_Stts mStts; + /* 0x0A9C */ dCcD_Sph field_0xa9c[3]; + /* 0x0E44 */ dCcD_Sph field_0xe44; + /* 0x0F7C */ dCcD_Sph field_0xf7c; + /* 0x10B4 */ dCcU_AtInfo mAtInfo; + /* 0x10D8 */ u8 field_0x10d8; + /* 0x10D9 */ u8 field_0x10d9; + /* 0x10DA */ u8 field_0x10da[0x10e4 - 0x10da]; + /* 0x10E4 */ u8 field_0x10e4; + /* 0x10E5 */ u8 field_0x10e5[0x10f8 - 0x10e5]; + /* 0x10F8 */ u32 field_0x10f8; + /* 0x10FC */ u32 field_0x10fc; + /* 0x1100 */ u8 field_0x1100[0x110c - 0x1100]; }; STATIC_ASSERT(sizeof(e_dn_class) == 0x110c); -class daE_DN_HIO_c { +class daE_DN_HIO_c : public JORReflexible { +public: /* 804E51AC */ daE_DN_HIO_c(); - /* 804EE39C */ ~daE_DN_HIO_c(); + /* 804EE39C */ virtual ~daE_DN_HIO_c() {} + + void genMessage(JORMContext*); + + /* 0x04 */ s8 field_0x4; + /* 0x08 */ f32 base_size; // 基本サイズ + /* 0x0C */ f32 movement_speed; // 移動速度 + /* 0x10 */ f32 dash_speed; // 突進速度 + /* 0x14 */ f32 battle_init_range; // 戦闘開始範囲 + /* 0x18 */ f32 attack_init_range; // 攻撃開始範囲 + /* 0x1C */ s16 field_0x1c; // 防御静止間 + /* 0x1E */ s16 field_0x1e; // 魂抜間 弱 + /* 0x20 */ s16 field_0x20; // 魂抜間 強 + /* 0x22 */ u8 field_0x22; + /* 0x23 */ u8 invulnerable; // 不死身 + /* 0x24 */ u8 field_0x24; // 学習なし }; diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index 14a970aa45d..5563ed95296 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -14,33 +14,29 @@ * @details * */ -class e_mf_class { +class e_mf_class : public fopEn_enemy_c { public: /* 80712F20 */ e_mf_class(); - /* 0x0000 */ fopEn_enemy_c actor; /* 0x05AC */ request_of_phase_process_class mPhase; /* 0x05B4 */ s16 field_0x5b4; /* 0x05B6 */ u8 field_0x5b6; /* 0x05B7 */ u8 field_0x5b7; /* 0x05B8 */ u8 field_0x5b8; /* 0x05B9 */ u8 field_0x5b9; - /* 0x05BA */ u8 field_0x5ba[0x5bc - 0x5ba]; /* 0x05BC */ cXyz field_0x5bc; /* 0x05C8 */ cXyz field_0x5c8; /* 0x05D4 */ s16 field_0x5d4; /* 0x05D6 */ s16 field_0x5d6; /* 0x05D8 */ s8 field_0x5d8; - /* 0x05D9 */ u8 field_0x5d9[0x5dc - 0x5d9]; /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; /* 0x05E0 */ int field_0x5e0; /* 0x05E4 */ J3DModel* field_0x5e4; /* 0x05E8 */ Z2CreatureEnemy mSound; /* 0x068C */ J3DModel* field_0x68c; - /* 0x0690 */ u8 field_0x690[0x694 - 0x690]; - /* 0x0694 */ dJntCol_c field_0x694; + /* 0x0690 */ u8 field_0x690[4]; + /* 0x0694 */ dJntCol_c mJntCol; /* 0x06A4 */ s8 field_0x6a4; - /* 0x06A5 */ u8 field_0x6a5[0x6a8 - 0x6a5]; /* 0x06A8 */ f32 field_0x6a8; /* 0x06AC */ s16 field_0x6ac; /* 0x06AE */ s16 mAction; @@ -68,7 +64,6 @@ class e_mf_class { /* 0x06DE */ s16 field_0x6de; /* 0x06E0 */ s8 field_0x6e0; /* 0x06E1 */ s8 field_0x6e1; - /* 0x06E2 */ u8 field_0x6e2[0x6e4 - 0x6e2]; /* 0x06E4 */ f32 field_0x6e4; /* 0x06E8 */ f32 field_0x6e8; /* 0x06EC */ s16 field_0x6ec; @@ -84,18 +79,14 @@ class e_mf_class { /* 0x0718 */ cXyz field_0x718; /* 0x0724 */ u32 field_0x724; /* 0x0728 */ u8 field_0x728; - /* 0x0729 */ u8 field_0x729[0x72c - 0x729]; /* 0x072C */ f32 field_0x72c; /* 0x0730 */ s16 field_0x730; - /* 0x0732 */ u8 field_0x732[2]; /* 0x0734 */ f32 field_0x734; /* 0x0738 */ s16 field_0x738; - /* 0x073A */ u8 field_0x73a[2]; /* 0x073C */ f32 field_0x73c; /* 0x0740 */ s16 field_0x740; /* 0x0742 */ csXyz field_0x742[11]; /* 0x0784 */ csXyz field_0x784[11]; - /* 0x07C6 */ u8 field_0x7c6[0x7c8 - 0x7c6]; /* 0x07C8 */ f32 field_0x7c8; /* 0x07CC */ s16 field_0x7cc[2]; /* 0x07D0 */ s16 field_0x7d0; @@ -114,10 +105,9 @@ class e_mf_class { /* 0x080A */ s16 field_0x80a; /* 0x080C */ s16 field_0x80c; /* 0x080E */ s8 field_0x80e; - /* 0x080F */ u8 field_0x80f[0x810 - 0x80f]; /* 0x0810 */ s16 field_0x810; /* 0x0812 */ s16 field_0x812; - /* 0x0814 */ u8 field_0x814[0x816 - 0x814]; + /* 0x0814 */ u8 field_0x814[2]; /* 0x0816 */ csXyz field_0x816; /* 0x081C */ f32 field_0x81c; /* 0x0820 */ s16 field_0x820; @@ -137,7 +127,6 @@ class e_mf_class { /* 0x10BC */ u32 field_0x10bc; /* 0x10C0 */ u32 field_0x10c0; /* 0x10C4 */ s8 field_0x10c4; - /* 0x10C5 */ u8 field_0x10c5[0x10c8 - 0x10c5]; /* 0x10C8 */ u32 field_0x10c8[2]; /* 0x10D0 */ u32 field_0x10d0[2]; /* 0x10D8 */ u8 field_0x10d8[0x10e4 - 0x10d8]; diff --git a/src/d/actor/d_a_e_dn.cpp b/src/d/actor/d_a_e_dn.cpp index ae56afc5e11..d4e7e2395c6 100644 --- a/src/d/actor/d_a_e_dn.cpp +++ b/src/d/actor/d_a_e_dn.cpp @@ -7,6 +7,7 @@ #include "d/d_cc_d.h" #include "dol2asm.h" UNK_REL_DATA; +#include "d/d_bomb.h" #include "f_op/f_op_actor_enemy.h" @@ -232,43 +233,6 @@ extern "C" u8 sincosTable___5JMath[65536]; extern "C" u8 m_midnaActor__9daPy_py_c[4]; extern "C" void __register_global_object(); -// -// Declarations: -// - -/* ############################################################################################## */ -/* 804EE8D8-804EE8DC 00002C 0004+00 0/2 0/0 0/0 .rodata @3810 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3810 = 11.0f / 10.0f; -COMPILER_STRIP_GATE(0x804EE8D8, &lit_3810); -#pragma pop - -/* 804EE8DC-804EE8E0 000030 0004+00 0/1 0/0 0/0 .rodata @3811 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3811 = 7.5f; -COMPILER_STRIP_GATE(0x804EE8DC, &lit_3811); -#pragma pop - -/* 804EE8E0-804EE8E4 000034 0004+00 1/4 0/0 0/0 .rodata @3812 */ -SECTION_RODATA static f32 const lit_3812 = 25.0f; -COMPILER_STRIP_GATE(0x804EE8E0, &lit_3812); - -/* 804EE8E4-804EE8E8 000038 0004+00 0/5 0/0 0/0 .rodata @3813 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3813 = 300.0f; -COMPILER_STRIP_GATE(0x804EE8E4, &lit_3813); -#pragma pop - -/* 804EE8E8-804EE8EC 00003C 0004+00 0/1 0/0 0/0 .rodata @3814 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3814 = 350.0f; -COMPILER_STRIP_GATE(0x804EE8E8, &lit_3814); -#pragma pop - /* 804EEA78-804EEAA4 -00001 002C+00 1/1 0/0 0/0 .data @4546 */ SECTION_DATA static void* lit_4546[11] = { (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x4C), @@ -458,96 +422,17 @@ SECTION_DATA static void* lit_6935[61] = { (void*)(((char*)action__FP10e_dn_class) + 0x1D4), }; -/* 804EEC9C-804EECA8 00025C 000C+00 1/0 0/0 0/0 .data jv_offset */ -SECTION_DATA static u8 jv_offset[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 804EECA8-804EED38 -00001 0090+00 1/1 0/0 0/0 .data jc_data */ -SECTION_DATA static void* jc_data[36] = { - (void*)0x00010002, (void*)0x42200000, (void*)&jv_offset, (void*)0x00010003, (void*)0x41F00000, - (void*)&jv_offset, (void*)0x00010016, (void*)0x42200000, (void*)&jv_offset, (void*)0x0001000B, - (void*)0x41700000, (void*)&jv_offset, (void*)0x0001000C, (void*)0x41200000, (void*)&jv_offset, - (void*)0x00010011, (void*)0x41700000, (void*)&jv_offset, (void*)0x00010012, (void*)0x41200000, - (void*)&jv_offset, (void*)0x00010017, (void*)0x41A00000, (void*)&jv_offset, (void*)0x00010018, - (void*)0x41700000, (void*)&jv_offset, (void*)0x0001001B, (void*)0x41A00000, (void*)&jv_offset, - (void*)0x0001001C, (void*)0x41700000, (void*)&jv_offset, (void*)0x00010020, (void*)0x41A00000, - (void*)&jv_offset, -}; - -/* 804EED38-804EED78 0002F8 0040+00 0/1 0/0 0/0 .data cc_sph_src$7459 */ -#pragma push -#pragma force_active on -static dCcD_SrcSph cc_sph_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph - } // mSphAttr -}; -#pragma pop - -/* 804EED78-804EEDB8 000338 0040+00 0/1 0/0 0/0 .data at_sph_src$7460 */ -#pragma push -#pragma force_active on -static dCcD_SrcSph at_sph_src = { - { - {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0xd}, {0x0, 0x0}, 0x0}}, // mObj - {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 35.0f} // mSph - } // mSphAttr -}; -#pragma pop - -/* 804EEDB8-804EEDF8 000378 0040+00 0/1 0/0 0/0 .data tate_sph_src$7461 */ -#pragma push -#pragma force_active on -static dCcD_SrcSph tate_sph_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_STONE, 0x5, 0x0, 0x0, 0x3}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 100.0f} // mSph - } // mSphAttr -}; -#pragma pop - -/* 804EEDF8-804EEE18 -00001 0020+00 1/0 0/0 0/0 .data l_daE_DN_Method */ -static actor_method_class l_daE_DN_Method = { - (process_method_func)daE_DN_Create__FP10fopAc_ac_c, - (process_method_func)daE_DN_Delete__FP10e_dn_class, - (process_method_func)daE_DN_Execute__FP10e_dn_class, - (process_method_func)daE_DN_IsDelete__FP10e_dn_class, - (process_method_func)daE_DN_Draw__FP10e_dn_class, -}; - -/* 804EEE18-804EEE48 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_DN */ -extern actor_process_profile_definition g_profile_E_DN = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_E_DN, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(e_dn_class), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 118, // mPriority - &l_daE_DN_Method, // sub_method - 0x00040000, // mStatus - fopAc_ENEMY_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType +/* 80713CD8-80713CE4 0001D0 000C+00 1/0 0/0 0/0 .data jv_offset */ +Vec jv_offset = { 0.0f, 0.0f, 0.0f }; + +/* 80713CE4-80713D74 -00001 0090+00 1/1 0/0 0/0 .data jc_data */ +dJntColData_c jc_data[12] = { + {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, + {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, + {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, + {0, 1, 18, 10.0f, &jv_offset}, {0, 1, 23, 20.0f, &jv_offset}, + {0, 1, 24, 15.0f, &jv_offset}, {0, 1, 27, 20.0f, &jv_offset}, + {0, 1, 28, 15.0f, &jv_offset}, {0, 1, 32, 20.0f, &jv_offset}, }; /* 804EEE48-804EEE54 000408 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */ @@ -623,583 +508,1529 @@ SECTION_DATA extern void* __vt__12daE_DN_HIO_c[3] = { /* 804E51AC-804E5220 0000EC 0074+00 1/1 0/0 0/0 .text __ct__12daE_DN_HIO_cFv */ daE_DN_HIO_c::daE_DN_HIO_c() { - // NONMATCHING + field_0x4 = -1; + base_size = 1.1f; + movement_speed = 7.5f; + dash_speed = 25.0f; + battle_init_range = 300.0f; + attack_init_range = 350.0f; + field_0x1c = 3; + field_0x1e = 40; + field_0x20 = 80; + field_0x22 = 1; + invulnerable = 0; + field_0x24 = 0; } /* 804E5220-804E52D0 000160 00B0+00 2/2 0/0 0/0 .text dn_disappear__FP10e_dn_class */ -static void dn_disappear(e_dn_class* param_0) { - // NONMATCHING -} +static void dn_disappear(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp1c, sp28; -/* ############################################################################################## */ -/* 804EE8EC-804EE8F0 000040 0004+00 1/4 0/0 0/0 .rodata @3854 */ -SECTION_RODATA static f32 const lit_3854 = -1.0f; -COMPILER_STRIP_GATE(0x804EE8EC, &lit_3854); + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp1c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp1c, &sp28); -/* 804EEA34-804EEA34 000188 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_804EEA34 = "E_dn"; -#pragma pop + fopAcM_createDisappear(a_this, &sp28, 13, 0, 21); + fopAcM_delete(a_this); + + int swBit = fopAcM_GetParam(a_this) >> 24; + if (swBit != 0xFF) { + dComIfGs_onSwitch(swBit, fopAcM_GetRoomNo(a_this)); + } +} /* 804E52D0-804E537C 000210 00AC+00 18/18 0/0 0/0 .text anm_init__FP10e_dn_classifUcf */ -static void anm_init(e_dn_class* param_0, int param_1, f32 param_2, u8 param_3, f32 param_4) { - // NONMATCHING +static void anm_init(e_dn_class* i_this, int param_2, f32 i_morf, u8 i_attr, f32 i_rate) { + i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_dn", param_2), i_attr, i_morf, + i_rate, 0.0f, -1.0f); + i_this->field_0x5e0 = param_2; } /* 804E537C-804E5838 0002BC 04BC+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ -static void nodeCallBack(J3DJoint* param_0, int param_1) { - // NONMATCHING +static int nodeCallBack(J3DJoint* i_joint, int param_2) { + if (param_2 == 0) { + int jointNo = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + e_dn_class* i_this = (e_dn_class*)model->getUserArea(); + if (i_this != NULL) { + MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); + + if (jointNo != 0) { + if (jointNo == 22) { + cMtx_YrotM(*calc_mtx, i_this->field_0x832); + cMtx_ZrotM(*calc_mtx, i_this->field_0x7f0 + (i_this->field_0x830 - i_this->field_0x762[2].x)); + } else if (jointNo == 23) { + cMtx_YrotM(*calc_mtx, i_this->field_0x7fa); + } else if (jointNo == 24) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x7fc[0]); + } else if (jointNo == 27) { + cMtx_YrotM(*calc_mtx, i_this->field_0x7fc[1]); + } else if (jointNo == 28) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x7fc[2]); + } else if (jointNo == 2) { + cMtx_YrotM(*calc_mtx, (i_this->field_0x6fa / 2) + (i_this->field_0x762[1].y + - i_this->field_0x6f6)); + cMtx_ZrotM(*calc_mtx, i_this->field_0x762[1].x + i_this->field_0x7ec[1]); + } else if (jointNo == 3 || jointNo == 4) { + cMtx_YrotM(*calc_mtx, i_this->field_0x762[0].y + (i_this->field_0x6fa - i_this->field_0x6f6)); + cMtx_ZrotM(*calc_mtx, i_this->field_0x7ec[0] + (i_this->field_0x762[0].x - i_this->field_0x6f8)); + } else if (jointNo == 11) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x762[3].y + i_this->field_0x7f2); + } else if (jointNo == 12) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x762[4].y + i_this->field_0x7f4); + } else if (jointNo == 17) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x762[5].y + i_this->field_0x7f6); + } else if (jointNo == 18) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x762[6].y + i_this->field_0x7f8); + } else if (jointNo >= 31 && jointNo <= 34) { + cMtx_YrotM(*calc_mtx, i_this->field_0x762[jointNo - 2].x + i_this->field_0x826); + cMtx_ZrotM(*calc_mtx, i_this->field_0x762[jointNo - 3].z); + } + } + + if (i_this->field_0x80a != 0) { + if ((jointNo & 1) != 0) { + cMtx_YrotM(*calc_mtx, i_this->field_0x80a); + } else if ((jointNo & 2) != 0) { + cMtx_XrotM(*calc_mtx, i_this->field_0x80a); + } else if ((jointNo & 4) != 0) { + cMtx_ZrotM(*calc_mtx, i_this->field_0x80a); + } + } + + model->setAnmMtx(jointNo, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + if (jointNo == 0) { + MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); + cMtx_YrotM(*calc_mtx, 0); + cMtx_XrotM(*calc_mtx, 0); + cMtx_ZrotM(*calc_mtx, 0); + model->setAnmMtx(jointNo, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + + if (jointNo == 0) { + MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); + cMtx_YrotM(*calc_mtx, 0); + cMtx_XrotM(*calc_mtx, 0); + cMtx_ZrotM(*calc_mtx, 0); + model->setAnmMtx(jointNo, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; } -/* ############################################################################################## */ -/* 804EE8F0-804EE8F4 000044 0004+00 0/11 0/0 0/0 .rodata @4094 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4094 = 50.0f; -COMPILER_STRIP_GATE(0x804EE8F0, &lit_4094); -#pragma pop - -/* 804EE8F4-804EE8F8 000048 0004+00 0/1 0/0 0/0 .rodata @4095 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4095 = 950.0f; -COMPILER_STRIP_GATE(0x804EE8F4, &lit_4095); -#pragma pop - /* 804E5838-804E5B20 000778 02E8+00 1/0 0/0 0/0 .text daE_DN_Draw__FP10e_dn_class */ -static void daE_DN_Draw(e_dn_class* param_0) { - // NONMATCHING -} - -/* 804E5B20-804E5BF8 000A60 00D8+00 2/2 0/0 0/0 .text other_bg_check__FP10e_dn_classP10fopAc_ac_c - */ -static void other_bg_check(e_dn_class* param_0, fopAc_ac_c* param_1) { - // NONMATCHING +static int daE_DN_Draw(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + if (i_this->field_0x10d8 != 0) { + return 1; + } + + J3DModel* model = i_this->mpModelMorf->getModel(); + g_env_light.settingTevStruct(0, &a_this->current.pos, &a_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model, &a_this->tevStr); + + J3DModelData* modelData; + J3DMaterial* matNode_p; + if (i_this->field_0x6c4 != 0) { + modelData = model->getModelData(); + for (u16 i = 0; i < modelData->getMaterialNum(); i++) { + matNode_p = modelData->getMaterialNodePointer(i); + matNode_p->getTevColor(0)->r = i_this->field_0x6c8; + matNode_p->getTevColor(0)->g = i_this->field_0x6c8; + matNode_p->getTevColor(0)->b = i_this->field_0x6c8; + } + } + + i_this->mpModelMorf->entryDL(); + + if (i_this->field_0x6c4 != 0) { + modelData = model->getModelData(); + for (u16 i = 0; i < modelData->getMaterialNum(); i++) { + matNode_p = modelData->getMaterialNodePointer(i); + matNode_p->getTevColor(0)->r = 0; + matNode_p->getTevColor(0)->g = 0; + matNode_p->getTevColor(0)->b = 0; + } + } + + g_env_light.setLightTevColorType_MAJI(i_this->field_0x5e4, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->field_0x5e4); + + if (i_this->field_0x690 != NULL) { + g_env_light.setLightTevColorType_MAJI(i_this->field_0x690, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->field_0x690); + } + + g_env_light.setLightTevColorType_MAJI(i_this->field_0x68c, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->field_0x68c); + + cXyz sp50; + sp50.set(a_this->current.pos.x, a_this->current.pos.y + 50.0f, a_this->current.pos.z); + i_this->mShadowKey = dComIfGd_setShadow(i_this->mShadowKey, 1, model, &sp50, 1150.0f, 0.0f, + a_this->current.pos.y, i_this->mObjAcch.GetGroundH(), + i_this->mObjAcch.m_gnd, &a_this->tevStr, 0, 1.0f, + dDlst_shadowControl_c::getSimpleTex()); + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x5e4); + if (i_this->field_0x690 != NULL) { + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x690); + } + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x68c); + + return 1; +} + +/* 804E5B20-804E5BF8 000A60 00D8+00 2/2 0/0 0/0 .text other_bg_check__FP10e_dn_classP10fopAc_ac_c */ +static BOOL other_bg_check(e_dn_class* i_this, fopAc_ac_c* i_actor) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_LinChk lin_chk; + cXyz start, end; + + end = i_actor->current.pos; + end.y += 100.0f; + start = a_this->current.pos; + start.y = a_this->eyePos.y; + lin_chk.Set(&start, &end, a_this); + + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + return TRUE; + } + + return FALSE; } /* 804E5BF8-804E5CD0 000B38 00D8+00 1/1 0/0 0/0 .text other_bg_check2__FP10e_dn_classP4cXyz */ -static void other_bg_check2(e_dn_class* param_0, cXyz* param_1) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 804EEEF0-804EEEF4 000008 0001+03 1/1 0/0 0/0 .bss @1109 */ -static u8 lit_1109[1 + 3 /* padding */]; +static BOOL other_bg_check2(e_dn_class* i_this, cXyz* param_2) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_LinChk lin_chk; + cXyz start, end; -/* 804EEEF4-804EEEF8 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ -#pragma push -#pragma force_active on -static u8 lit_1107[1 + 3 /* padding */]; -#pragma pop - -/* 804EEEF8-804EEEFC 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ -#pragma push -#pragma force_active on -static u8 lit_1105[1 + 3 /* padding */]; -#pragma pop - -/* 804EEEFC-804EEF00 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ -#pragma push -#pragma force_active on -static u8 lit_1104[1 + 3 /* padding */]; -#pragma pop - -/* 804EEF00-804EEF04 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ -#pragma push -#pragma force_active on -static u8 lit_1099[1 + 3 /* padding */]; -#pragma pop + end = *param_2; + end.y += 100.0f; + start = a_this->current.pos; + start.y = a_this->eyePos.y; -/* 804EEF04-804EEF08 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ -#pragma push -#pragma force_active on -static u8 lit_1097[1 + 3 /* padding */]; -#pragma pop + lin_chk.Set(&start, &end, a_this); -/* 804EEF08-804EEF0C 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ -#pragma push -#pragma force_active on -static u8 lit_1095[1 + 3 /* padding */]; -#pragma pop + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + return TRUE; + } -/* 804EEF0C-804EEF10 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ -#pragma push -#pragma force_active on -static u8 lit_1094[1 + 3 /* padding */]; -#pragma pop - -/* 804EEF10-804EEF14 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ -#pragma push -#pragma force_active on -static u8 lit_1057[1 + 3 /* padding */]; -#pragma pop - -/* 804EEF14-804EEF18 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ -#pragma push -#pragma force_active on -static u8 lit_1055[1 + 3 /* padding */]; -#pragma pop - -/* 804EEF18-804EEF1C 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ -#pragma push -#pragma force_active on -static u8 lit_1053[1 + 3 /* padding */]; -#pragma pop - -/* 804EEF1C-804EEF20 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ -#pragma push -#pragma force_active on -static u8 lit_1052[1 + 3 /* padding */]; -#pragma pop - -/* 804EEF20-804EEF24 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ -#pragma push -#pragma force_active on -static u8 lit_1014[1 + 3 /* padding */]; -#pragma pop - -/* 804EEF24-804EEF28 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ -#pragma push -#pragma force_active on -static u8 lit_1012[1 + 3 /* padding */]; -#pragma pop + return FALSE; +} -/* 804EEF28-804EEF2C 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ -#pragma push -#pragma force_active on -static u8 lit_1010[1 + 3 /* padding */]; -#pragma pop +UNK_REL_BSS; /* 804EEF2C-804EEF30 -00001 0004+00 1/2 0/0 0/0 .bss None */ /* 804EEF2C 0001+00 data_804EEF2C @1009 */ /* 804EEF2D 0003+00 data_804EEF2D None */ -static u8 struct_804EEF2C[4]; - -/* 804EEF30-804EEF3C 000048 000C+00 1/1 0/0 0/0 .bss @3805 */ -static u8 lit_3805[12]; +static u8 l_initHIO; /* 804EEF3C-804EEF64 000054 0028+00 10/11 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[40]; +static daE_DN_HIO_c l_HIO; /* 804EEF64-804EEF8C 00007C 0028+00 2/2 0/0 0/0 .bss target_info */ -static u8 target_info[40]; +static fopAc_ac_c* target_info[10]; /* 804EEF8C-804EEF90 0000A4 0004+00 2/2 0/0 0/0 .bss target_info_count */ -static u8 target_info_count[4]; +static int target_info_count; /* 804E5CD0-804E5D4C 000C10 007C+00 1/1 0/0 0/0 .text s_b_sub__FPvPv */ -static void s_b_sub(void* param_0, void* param_1) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 804EE8F8-804EE8FC 00004C 0004+00 0/5 0/0 0/0 .rodata @4322 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4322 = 30.0f; -COMPILER_STRIP_GATE(0x804EE8F8, &lit_4322); -#pragma pop +static void* s_b_sub(void* i_actor, void* i_data) { + if (fopAcM_IsActor(i_actor) && dBomb_c::checkBombActor((fopAc_ac_c*)i_actor) && !((dBomb_c*)i_actor)->checkStateExplode() && target_info_count < 10) { + target_info[target_info_count] = (fopAc_ac_c*)i_actor; + target_info_count++; + } -/* 804EE8FC-804EE900 000050 0004+00 0/1 0/0 0/0 .rodata @4323 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4323 = 500.0f; -COMPILER_STRIP_GATE(0x804EE8FC, &lit_4323); -#pragma pop - -/* 804EE900-804EE904 000054 0004+00 0/1 0/0 0/0 .rodata @4324 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4324 = -125.0f; -COMPILER_STRIP_GATE(0x804EE900, &lit_4324); -#pragma pop - -/* 804EE904-804EE908 000058 0004+00 0/1 0/0 0/0 .rodata @4325 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4325 = 1500.0f; -COMPILER_STRIP_GATE(0x804EE904, &lit_4325); -#pragma pop + return NULL; +} /* 804E5D4C-804E61D8 000C8C 048C+00 2/2 0/0 0/0 .text search_bomb__FP10e_dn_classi */ -static void search_bomb(e_dn_class* param_0, int param_1) { - // NONMATCHING +static dBomb_c* search_bomb(e_dn_class* i_this, int param_2) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBomb_c* bomb; + if ((i_this->field_0x744 & 0x10000000) == 0) { + return NULL; + } + + target_info_count = 0; + for (int i = 0; i < 10; i++) { + target_info[i] = NULL; + } + + fpcM_Search(s_b_sub, i_this); + + f32 threshold = 50.0f; + if (target_info_count != 0) { + cXyz sp44, sp50, sp5c; + for (int i = 0; i < target_info_count;) { + bomb = (dBomb_c*)target_info[i]; + sp44.x = bomb->current.pos.x - a_this->eyePos.x; + sp44.y = 50.0f + bomb->current.pos.y - a_this->eyePos.y; + sp44.z = bomb->current.pos.z - a_this->eyePos.z; + sp50.x = bomb->current.pos.x - a_this->current.pos.x; + sp50.y = bomb->current.pos.y - a_this->current.pos.y; + sp50.z = bomb->current.pos.z - a_this->current.pos.z; + + if (sp44.abs() < threshold && !(sp50.abs() > i_this->mPlayerDistance + 30.0f) && (!other_bg_check(i_this, bomb) || !param_2)) { + if (param_2) { + if (fabsf(50.0f + bomb->current.pos.y - a_this->eyePos.y) <= 300.0f) { + s16 sVar1 = a_this->shape_angle.y - cM_atan2s(sp44.x, sp44.z); + if (sVar1 < 0) { + sVar1 = -1 * sVar1; + } + + if ((u16)sVar1 < 20000) { + return bomb; + } + + cMtx_YrotS(*calc_mtx, -a_this->shape_angle.y); + MtxPosition(&sp44, &sp5c); + + if (fabsf(sp5c.x) < 500.0f && fabsf(sp5c.y) < 300.0f && sp5c.z > -125.0f && sp5c.z < 500.0f) { + return bomb; + } + } + } else { + return bomb; + } + } + + i++; + if (i == target_info_count) { + i = 0; + threshold += 50.0f; + if (threshold > 1500.0f) { + return NULL; + } + } + } + } else { + return NULL; + } + + return NULL; } /* 804E61D8-804E61FC 001118 0024+00 4/4 0/0 0/0 .text bomb_view_check__FP10e_dn_class */ -static void bomb_view_check(e_dn_class* param_0) { - // NONMATCHING +static dBomb_c* bomb_view_check(e_dn_class* i_this) { + return search_bomb(i_this, TRUE); } /* 804E61FC-804E6220 00113C 0024+00 1/1 0/0 0/0 .text bomb_check__FP10e_dn_class */ -static void bomb_check(e_dn_class* param_0) { - // NONMATCHING +static dBomb_c* bomb_check(e_dn_class* i_this) { + return search_bomb(i_this, FALSE); } /* 804E6220-804E6264 001160 0044+00 1/1 0/0 0/0 .text player_way_check__FP10e_dn_class */ -static void player_way_check(e_dn_class* param_0) { - // NONMATCHING -} +static BOOL player_way_check(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; -/* 804E6264-804E6340 0011A4 00DC+00 4/4 0/0 0/0 .text pl_check__FP10e_dn_classfs */ -static void pl_check(e_dn_class* param_0, f32 param_1, s16 param_2) { - // NONMATCHING -} + s16 sVar1 = a_this->shape_angle.y - dComIfGp_getPlayer(0)->shape_angle.y; + if ((int)sVar1 < 0) { + sVar1 = -sVar1; + } -/* 804E6340-804E6448 001280 0108+00 3/3 0/0 0/0 .text move_gake_check__FP10e_dn_classfSc - */ -static void move_gake_check(e_dn_class* param_0, f32 param_1, s8 param_2) { - // NONMATCHING + if (((u32)sVar1 & 0xFFFF) < 0x6000) { + return FALSE; + } + + return TRUE; } -/* ############################################################################################## */ -/* 804EE908-804EE90C 00005C 0004+00 0/4 0/0 0/0 .rodata @4435 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4435 = 200.0f; -COMPILER_STRIP_GATE(0x804EE908, &lit_4435); -#pragma pop +/* 804E6264-804E6340 0011A4 00DC+00 4/4 0/0 0/0 .text pl_check__FP10e_dn_classfs */ +static int pl_check(e_dn_class* i_this, f32 param_2, s16 param_3) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + if (i_this->mPlayerDistance < param_2) { + s16 sVar1 = a_this->shape_angle.y - i_this->mYAngleToPlayer; + if (sVar1 < param_3 && sVar1 > (s16)-param_3 && !other_bg_check(i_this, player)) { + return 1; + } + } + + for (int i = 0; i <= 2; i++) { + if (i_this->field_0xa9c[i].ChkCoHit() != 0) { + if (player == dCc_GetAc(i_this->field_0xa9c[i].GetCoHitObj()->GetAc())) { + return 2; + } + } + } + + return 0; +} + +/* 804E6340-804E6448 001280 0108+00 3/3 0/0 0/0 .text move_gake_check__FP10e_dn_classfSc */ +static BOOL move_gake_check(e_dn_class* i_this, f32 param_2, s8 param_3) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_GndChk gnd_chk; + cXyz sp84, sp90; + + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + sp84.x = 0.0f; + sp84.y = 100.0f; + if (param_3 != 0) { + sp84.z = -param_2; + } else { + sp84.z = param_2; + } + MtxPosition(&sp84, &sp90); + sp90 += a_this->current.pos; + gnd_chk.SetPos(&sp90); + + if (a_this->current.pos.y - dComIfG_Bgsp().GroundCross(&gnd_chk) > 300.0f) { + return TRUE; + } + + return FALSE; +} /* 804E6448-804E6608 001388 01C0+00 1/1 0/0 0/0 .text jump_pos_check__FP10e_dn_classP4cXyz */ -static void jump_pos_check(e_dn_class* param_0, cXyz* param_1) { - // NONMATCHING +static BOOL jump_pos_check(e_dn_class* i_this, cXyz* param_2) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_GndChk gnd_chk; + cXyz sp94, spa0; + f32 fVar1 = 300.0f; + + cMtx_YrotS(*calc_mtx, i_this->mYAngleToPlayer); + sp94.x = 0.0f; + sp94.y = 200.0f; + + int i = 0; + while (i < 10) { + sp94.z = fVar1; + MtxPosition(&sp94, &spa0); + spa0 += a_this->current.pos; + gnd_chk.SetPos(&spa0); + spa0.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if ((a_this->current.pos.y - spa0.y) < 200.0f) { + *param_2 = spa0; + sp94.z += 200.0f; + MtxPosition(&sp94, &spa0); + spa0 += a_this->current.pos; + gnd_chk.SetPos(&spa0); + spa0.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if ((a_this->current.pos.y - spa0.y) < 200.0f) { + *param_2 = spa0; + } + + return TRUE; + } + + fVar1 += 50.0f; + i++; + } + + return FALSE; } -/* ############################################################################################## */ -/* 804EE90C-804EE910 000060 0004+00 0/8 0/0 0/0 .rodata @4535 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4535 = 10.0f; -COMPILER_STRIP_GATE(0x804EE90C, &lit_4535); -#pragma pop - -/* 804EE910-804EE914 000064 0004+00 0/2 0/0 0/0 .rodata @4536 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4536 = 9.0f / 10.0f; -COMPILER_STRIP_GATE(0x804EE910, &lit_4536); -#pragma pop - -/* 804EE914-804EE918 000068 0004+00 0/3 0/0 0/0 .rodata @4537 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4537 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x804EE914, &lit_4537); -#pragma pop - -/* 804EE918-804EE91C 00006C 0004+00 0/3 0/0 0/0 .rodata @4538 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4538 = 2000.0f; -COMPILER_STRIP_GATE(0x804EE918, &lit_4538); -#pragma pop - /* 804E6608-804E6A8C 001548 0484+00 2/1 0/0 0/0 .text e_dn_stay__FP10e_dn_class */ -static void e_dn_stay(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_stay(e_dn_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp30; + + i_this->field_0x6f4 = 5; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.1f) + 0.9f); + i_this->field_0x5b4 = 1; + // fallthrough + case 1: + if (fopAcM_otoCheck(a_this, 2000.0f) || daPy_getPlayerActorClass()->checkWolfBark()) { + SND_INFLUENCE* sound = dKy_Sound_get(); + sp30 = sound->position - a_this->current.pos; + if (cM_atan2s(sp30.y, JMAFastSqrt(sp30.x * sp30.x + sp30.z * sp30.z)) > 0x1000) { + i_this->field_0x5b4 = 5; + } else { + i_this->field_0x5b4 = 2; + } + + i_this->field_0x6e0[0] = cM_rndF(10.0f) + 10.0f; + i_this->field_0x738 = sound->position; + } + break; + + case 2: + if (i_this->field_0x6e0[0] == 0) { + anm_init(i_this, 21, 3.0f, 0, 1.5f); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND, -1); + i_this->field_0x5b4 = 3; + } + break; + + case 3: + if (i_this->mpModelMorf->isStop()) { + if (other_bg_check2(i_this, &i_this->field_0x738)) { + i_this->field_0x6e0[0] = cM_rndF(10.0f) + 20.0f; + i_this->field_0x5b4 = 4; + } else { + i_this->mAction = 10; + i_this->field_0x5b4 = 0; + } + } + break; + + case 4: + if (i_this->field_0x6e0[0] == 0) { + i_this->field_0x5b4 = 10; + i_this->field_0x6e0[0] = cM_rndF(10.0f) + 30.0f; + anm_init(i_this, 33, 5.0f, 2, 1.5f); + } + break; + + case 5: + if (i_this->field_0x6e0[0] == 0) { + anm_init(i_this, 21, 3.0f, 0, 1.5f); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND, -1); + i_this->field_0x5b4 = 6; + } + break; + + case 6: + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x6e0[0] = cM_rndF(10.0f) + 20.0f; + i_this->field_0x5b4 = 7; + } + break; + + case 7: + if (i_this->field_0x6e0[0] == 0) { + i_this->field_0x5b4 = 10; + i_this->field_0x6e0[0] = cM_rndF(40.0f) + 50.0f; + anm_init(i_this, 34, 5.0f, 2, 1.3f); + i_this->mpModelMorf->setFrame(cM_rndF(75.0f)); + } + break; + + case 8: + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x5b4 = 0; + } + break; + + case 10: + if (i_this->field_0x6e0[0] == 0) { + i_this->field_0x5b4 = 0; + } + } + + if ((i_this->field_0x6cc & 15) == 0) { + if (pl_check(i_this, i_this->field_0x6d8, 0x4000) != 0) { + i_this->mAction = 3; + i_this->field_0x5b4 = -10; + i_this->field_0x6e0[0] = 60; + } else if (bomb_view_check(i_this) != NULL) { + i_this->mAction = 11; + i_this->field_0x5b4 = 0; + } + } } -/* ############################################################################################## */ -/* 804EE91C-804EE920 000070 0004+00 0/11 0/0 0/0 .rodata @4539 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4539 = 3.0f; -COMPILER_STRIP_GATE(0x804EE91C, &lit_4539); -#pragma pop - -/* 804EE920-804EE924 000074 0004+00 0/3 0/0 0/0 .rodata @4540 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4540 = 1.5f; -COMPILER_STRIP_GATE(0x804EE920, &lit_4540); -#pragma pop - -/* 804EE924-804EE928 000078 0004+00 0/4 0/0 0/0 .rodata @4541 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4541 = 20.0f; -COMPILER_STRIP_GATE(0x804EE924, &lit_4541); -#pragma pop - -/* 804EE928-804EE92C 00007C 0004+00 0/12 0/0 0/0 .rodata @4542 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4542 = 5.0f; -COMPILER_STRIP_GATE(0x804EE928, &lit_4542); -#pragma pop - -/* 804EE92C-804EE930 000080 0004+00 0/1 0/0 0/0 .rodata @4543 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4543 = 40.0f; -COMPILER_STRIP_GATE(0x804EE92C, &lit_4543); -#pragma pop - -/* 804EE930-804EE934 000084 0004+00 0/0 0/0 0/0 .rodata @4544 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4544 = 13.0f / 10.0f; -COMPILER_STRIP_GATE(0x804EE930, &lit_4544); -#pragma pop - -/* 804EE934-804EE93C 000088 0004+04 0/0 0/0 0/0 .rodata @4545 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4545[1 + 1 /* padding */] = { - 75.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x804EE934, &lit_4545); -#pragma pop - -/* 804EE93C-804EE944 000090 0008+00 0/1 0/0 0/0 .rodata @4550 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4550[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x804EE93C, &lit_4550); -#pragma pop - -/* 804EE944-804EE948 000098 0004+00 0/1 0/0 0/0 .rodata @4611 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4611 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x804EE944, &lit_4611); -#pragma pop - -/* 804EE948-804EE94C 00009C 0004+00 0/3 0/0 0/0 .rodata @4612 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4612 = 1.0f / 20.0f; -COMPILER_STRIP_GATE(0x804EE948, &lit_4612); -#pragma pop - -/* 804EE94C-804EE950 0000A0 0004+00 0/2 0/0 0/0 .rodata @4613 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4613 = 250.0f; -COMPILER_STRIP_GATE(0x804EE94C, &lit_4613); -#pragma pop - /* 804E6A8C-804E6DBC 0019CC 0330+00 1/1 0/0 0/0 .text e_dn_otoreac__FP10e_dn_class */ -static void e_dn_otoreac(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_otoreac(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp40, sp4c; + f32 fVar1 = 0.0f; + i_this->field_0x6f4 = 2; + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.2f) + 1.5f); + i_this->field_0x6e0[0] = cM_rndF(10.0f) + 20.0f; + i_this->field_0x5b4 = 1; + // fallthrough + case 1: + if (i_this->field_0x6e0[0] == 0) { + anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + i_this->field_0x5b4 = 2; + } + break; + + case 2: + fVar1 = l_HIO.dash_speed; + if ((i_this->field_0x6cc & 3) == 0) { + if ((i_this->field_0x6cc & 4) != 0) { + i_this->field_0x10e4 = 1; + } else { + i_this->field_0x10e4 = 2; + } + } + + sp40 = i_this->field_0x738 - a_this->current.pos; + cLib_addCalcAngleS2(&a_this->current.angle.y, cM_atan2s(sp40.x, sp40.z), 2, 0xC00); + if (sp40.abs() < 250.0f || i_this->mObjAcch.ChkWallHit() != 0) { + i_this->mAction = 0; + i_this->field_0x5b4 = 0; + i_this->field_0x6e0[0] = cM_rndF(50.0f) + 50.0f; + anm_init(i_this, 33, 10.0f, 2, 1.0f); + } + break; + + + } + + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); + if ((i_this->field_0x6cc & 15) == 0) { + if (pl_check(i_this, i_this->field_0x6d8, 0x4000) != 0) { + i_this->mAction = 3; + i_this->field_0x5b4 = -10; + i_this->field_0x6e0[0] = 60; + } else if (bomb_view_check(i_this) != NULL) { + i_this->mAction = 11; + i_this->field_0x5b4 = 0; + } + } } /* 804E6DBC-804E72C8 001CFC 050C+00 2/1 0/0 0/0 .text e_dn_bomb_action__FP10e_dn_class */ -static void e_dn_bomb_action(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_bomb_action(e_dn_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + s16 sVar2; + cXyz sp3c, sp48; + dBomb_c* bomb = bomb_check(i_this); + if (bomb == NULL) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + return; + } + + sp3c.x = bomb->current.pos.x - a_this->current.pos.x; + sp3c.z = bomb->current.pos.z - a_this->current.pos.z; + s16 sVar1 = cM_atan2s(sp3c.x, sp3c.z); + f32 fVar1 = 0.0f; + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 21, 3.0f, 0, 1.5f); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND_BOMB, -1); + i_this->field_0x5b4 = 1; + break; + + case 1: + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x5b4 = 2; + } + break; + + case 2: + i_this->field_0x5b4 = 3; + anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->field_0x6e0[1] = cM_rndF(10.0f) + 10.0f; + // fallthrough + case 3: + if (i_this->field_0x6e0[1] == 0 && bomb->speedF < 0.1f) { + i_this->field_0x5b4 = 4; + anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + } + break; + + case 4: + if (bomb->speedF < 0.1f && !bomb->checkStateCarry() && JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 250.0f) { + sVar2 = i_this->mYAngleToPlayer - a_this->shape_angle.y; + if (sVar2 < 0x4000 && sVar2 > -0x4000) { + i_this->field_0x5b4 = 10; + break; + } + } + + sVar1 += 0x8000; + fVar1 = l_HIO.dash_speed; + if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) > 600.0f) { + i_this->field_0x5b4 = 5; + anm_init(i_this, 31, 5.0f, 2, 1.0f); + } + + break; + + case 5: + i_this->mSound.startCreatureSoundLevel(Z2SE_EN_DN_V_LOOK_BOMB, 0, -1); + sVar1 = i_this->mYAngleToPlayer; + if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 500.0f) { + i_this->field_0x5b4 = 2; + } + break; + + case 10: + i_this->field_0x6f2 = 0; + fVar1 = l_HIO.dash_speed; + if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 100.0f) { + i_this->field_0x6e0[0] = 20; + i_this->field_0x5b4 = 11; + anm_init(i_this, 30, 5.0f, 0, cM_rndFX(0.05f) + 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_KICK_BOMB, -1); + } + + if (bomb->speedF > 0.1f) { + i_this->field_0x5b4 = 2; + } + break; + + case 11: + i_this->field_0x6f2 = 0; + sVar1 = i_this->mYAngleToPlayer; + + if (i_this->field_0x6e0[0] >= 10) { + cMtx_YrotS(*calc_mtx, sVar1); + sp3c.x = -30.0f; + sp3c.y = 0.0f; + sp3c.z = 60.0f; + MtxPosition(&sp3c, &sp48); + sp48 += a_this->current.pos; + + cLib_addCalc2(&bomb->current.pos.x, sp48.x, 1.0f, 15.0f); + cLib_addCalc2(&bomb->current.pos.z, sp48.z, 1.0f, 15.0f); + + if (i_this->field_0x6e0[0] == 10) { + bomb->speedF = 30.0f; + bomb->speed.y = 30.0f; + bomb->current.angle.y = a_this->shape_angle.y; + } + } + + if (i_this->field_0x6e0[0] == 0) { + anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->field_0x5b4 = 5; + } + } + + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); + cLib_addCalcAngleS2(&a_this->current.angle.y, sVar1, 4, 0x1000); + i_this->field_0x6f4 = 2; + i_this->field_0x738 = bomb->current.pos; } -/* ############################################################################################## */ -/* 804EE950-804EE954 0000A4 0004+00 0/1 0/0 0/0 .rodata @4715 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4715 = 600.0f; -COMPILER_STRIP_GATE(0x804EE950, &lit_4715); -#pragma pop - -/* 804EE954-804EE958 0000A8 0004+00 0/2 0/0 0/0 .rodata @4716 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4716 = -30.0f; -COMPILER_STRIP_GATE(0x804EE954, &lit_4716); -#pragma pop - -/* 804EE958-804EE95C 0000AC 0004+00 0/1 0/0 0/0 .rodata @4717 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4717 = 60.0f; -COMPILER_STRIP_GATE(0x804EE958, &lit_4717); -#pragma pop - -/* 804EE95C-804EE960 0000B0 0004+00 0/2 0/0 0/0 .rodata @4718 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4718 = 15.0f; -COMPILER_STRIP_GATE(0x804EE95C, &lit_4718); -#pragma pop - -/* 804EE960-804EE964 0000B4 0004+00 0/1 0/0 0/0 .rodata @4783 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4783 = 32768.0f; -COMPILER_STRIP_GATE(0x804EE960, &lit_4783); -#pragma pop - -/* 804EE964-804EE968 0000B8 0004+00 0/1 0/0 0/0 .rodata @4784 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4784 = 10000.0f; -COMPILER_STRIP_GATE(0x804EE964, &lit_4784); -#pragma pop - /* 804E72C8-804E7620 002208 0358+00 1/1 0/0 0/0 .text e_dn_normal__FP10e_dn_class */ -static void e_dn_normal(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_normal(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp44, sp50; + f32 fVar1 = 0.0f; + s16 sVar1 = 0x4000; + s16 sVar2, sVar3; + + switch (i_this->field_0x5b4) { + case 0: + case 1: + case 2: + if (i_this->field_0x6e0[0] == 0) { + if (fopAcM_wayBgCheck(a_this, 200.0f, 50.0f) || move_gake_check(i_this, 200.0f, 0)) { + sVar2 = cM_rndFX(10000.0f) + 32768.0f; + i_this->field_0x6e0[1] = 40; + } else { + sp50.x = a_this->home.pos.x + cM_rndFX(600.0f); + sp50.y = a_this->home.pos.y; + sp50.z = a_this->home.pos.z + cM_rndFX(600.0f); + sp44 = sp50 - a_this->current.pos; + + sVar2 = cM_atan2s(sp44.x, sp44.z) - a_this->current.angle.y; + if (sVar2 > 0x3000) { + sVar2 = 0x3000; + } else if (sVar2 < -0x3000) { + sVar2 = -0x3000; + } + } + + i_this->field_0x5d4 = a_this->current.angle.y + sVar2; + anm_init(i_this, 35, 10.0f, 2, 1.0f); + i_this->field_0x5b4 = 3; + i_this->field_0x6e0[0] = cM_rndF(100.0f) + 100.0f; + } else { + sVar1 = 0x7000; + } + break; + + case 3: + fVar1 = l_HIO.movement_speed; + sVar2 = a_this->current.angle.y; + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x5d4, 2, 0x400); + sVar3 = a_this->current.angle.y - i_this->field_0x5d4; + if (sVar3 > 0x1000 || sVar3 < -0x1000) { + fVar1 = 0.0f; + } + + sVar2 -= a_this->current.angle.y; + sVar2 *= 2; + if (sVar2 > 0x1000) { + sVar2 = 0x1000; + } else if (sVar2 < -0x1000) { + sVar2 = -0x1000; + } + + cLib_addCalcAngleS2(&i_this->field_0x826, sVar2, 2, 0x400); + + if (i_this->field_0x6e0[0] == 0 || + (i_this->field_0x6e0[1] == 0 && (fopAcM_wayBgCheck(a_this, 200.0f, 50.0f) || move_gake_check(i_this, 200.0f, 0)))) { + i_this->field_0x5b4 = 2; + i_this->field_0x6e0[0] = cM_rndF(100.0f) + 50.0f; + anm_init(i_this, 33, 10.0f, 2, 1.0f); + } + break; + } + + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 3.0f); + BOOL bVar1 = fopAcM_otoCheck(a_this, 2000.0f) | daPy_getPlayerActorClass()->checkWolfBark(); + if ((i_this->field_0x6cc & 15) == 0 || bVar1) { + if (bVar1 || pl_check(i_this, i_this->field_0x6d8, sVar1) != 0) { + i_this->mAction = 3; + i_this->field_0x5b4 = -10; + i_this->field_0x6e0[0] = 60; + } + + if (bomb_view_check(i_this) != NULL) { + i_this->mAction = 11; + i_this->field_0x5b4 = 0; + } + } } -/* ############################################################################################## */ -/* 804EE968-804EE96C 0000BC 0004+00 0/2 0/0 0/0 .rodata @4811 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4811 = -5.0f; -COMPILER_STRIP_GATE(0x804EE968, &lit_4811); -#pragma pop - /* 804E7620-804E77A8 002560 0188+00 1/1 0/0 0/0 .text e_dn_drawback__FP10e_dn_class */ -static void e_dn_drawback(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_drawback(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 18, 5.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + a_this->speedF = -5.0f; + i_this->field_0x6e8 = 10; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DRAWBACK, -1); + i_this->field_0x5d4 = player->shape_angle.y + 0x8000; + break; + + case 1: + a_this->onHeadLockFlg(); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x5d4, 4, 0x400); + cLib_addCalc0(&a_this->speedF, 1.0f, 0.1f); + + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_AWAKE, -1); + } + break; + } + + if (move_gake_check(i_this, 50.0f, 1)) { + i_this->mAction = 23; + i_this->field_0x5b4 = 0; + } } -/* ############################################################################################## */ -/* 804EE96C-804EE970 0000C0 0004+00 0/3 0/0 0/0 .rodata @4872 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4872 = 2.0f; -COMPILER_STRIP_GATE(0x804EE96C, &lit_4872); -#pragma pop - -/* 804EE970-804EE974 0000C4 0004+00 1/6 0/0 0/0 .rodata @4873 */ -SECTION_RODATA static f32 const lit_4873 = 150.0f; -COMPILER_STRIP_GATE(0x804EE970, &lit_4873); - /* 804E77A8-804E7B34 0026E8 038C+00 1/1 0/0 0/0 .text e_dn_wolfbite__FP10e_dn_class */ -static void e_dn_wolfbite(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_wolfbite(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + i_this->field_0x6e8 = 10; + cLib_addCalc0(&a_this->speedF, 1.0f, 2.0f); + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 23, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DRAWBACK, -1); + a_this->health -= 10; + break; + + case 1: + if (i_this->mpModelMorf->isStop()) { + anm_init(i_this, 26, 3.0f, 2, 1.0f); + i_this->field_0x5b4 = 2; + } + break; + + case 2: + if (i_this->field_0x5e0 == 24) { + if (i_this->mpModelMorf->isStop()) { + anm_init(i_this, 26, 3.0f, 2, 1.0f); + } + } + + if (a_this->health <= 0 || a_this->checkWolfBiteDamage()) { + a_this->offWolfBiteDamage(); + anm_init(i_this, 24, 2.0f, 0, 1.0f); + a_this->health -= 10; + if (a_this->health <= 0) { + player->offWolfEnemyHangBite(); + i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - player->shape_angle.y; + i_this->field_0x74c = 150.0f; + i_this->mAction = 21; + i_this->field_0x5b4 = 0; + i_this->field_0x724.y = player->shape_angle.y + 0x8000; + a_this->speed.y = 0.0f; + i_this->field_0x704 = -1.0f; + i_this->field_0x828 = 50; + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 32); + i_this->field_0x710 = 1; + i_this->field_0x6e8 = 1000; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DEATH, -1); + return; + } + + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 30); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DAMAGE, -1); + } + + if (!player->checkWolfEnemyHangBiteOwn(a_this)) { + anm_init(i_this, 25, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 3; + } + break; + + case 3: + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_AWAKE, -1); + } + } } /* 804E7B34-804E7B74 002A74 0040+00 1/1 0/0 0/0 .text way_check__FP10e_dn_class */ -static void way_check(e_dn_class* param_0) { - // NONMATCHING -} +static int way_check(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + s16 sVar1 = a_this->shape_angle.y - i_this->mYAngleToPlayer; + if (sVar1 <= 0x4000 && sVar1 >= -0x4000) { + return 0; + } -/* ############################################################################################## */ -/* 804EE974-804EE978 0000C8 0004+00 0/1 0/0 0/0 .rodata @4933 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4933 = 1000.0f; -COMPILER_STRIP_GATE(0x804EE974, &lit_4933); -#pragma pop - -/* 804EEF90-804EEF94 0000A8 0004+00 2/2 0/0 0/0 .bss learn_check */ -static u8 learn_check[4]; + if (sVar1 < 0) { + return 1; + } -/* 804E7B74-804E7D18 002AB4 01A4+00 1/1 0/0 0/0 .text shot_s_sub__FPvPv */ -static void shot_s_sub(void* param_0, void* param_1) { - // NONMATCHING + return 2; } -/* ############################################################################################## */ -/* 804EE978-804EE97C 0000CC 0004+00 0/2 0/0 0/0 .rodata @5115 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5115 = 120.0f; -COMPILER_STRIP_GATE(0x804EE978, &lit_5115); -#pragma pop - -/* 804EE97C-804EE980 0000D0 0004+00 0/1 0/0 0/0 .rodata @5116 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5116 = 32763.0f; -COMPILER_STRIP_GATE(0x804EE97C, &lit_5116); -#pragma pop - -/* 804EE980-804EE984 0000D4 0004+00 0/1 0/0 0/0 .rodata @5117 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5117 = 0.75f; -COMPILER_STRIP_GATE(0x804EE980, &lit_5117); -#pragma pop +/* 804EEF90-804EEF94 0000A8 0004+00 2/2 0/0 0/0 .bss learn_check */ +static int learn_check; -/* 804EE984-804EE988 0000D8 0004+00 0/4 0/0 0/0 .rodata @5118 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5118 = 0.5f; -COMPILER_STRIP_GATE(0x804EE984, &lit_5118); -#pragma pop +/* 804E7B74-804E7D18 002AB4 01A4+00 1/1 0/0 0/0 .text shot_s_sub__FPvPv */ +static void* shot_s_sub(void* i_actor, void* i_data) { + e_dn_class* i_this = (e_dn_class*)i_data; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + if ((fopAcM_IsActor(i_actor) && (learn_check & 0x80000000) != 0 && fopAcM_GetName(i_actor) == PROC_ARROW && (fopAcM_GetParam(i_actor) == 1 || + fopAcM_GetParam(i_actor) == 2))) { + cXyz sp28(a_this->current.pos - ((fopAc_ac_c*)i_actor)->current.pos); + if (sp28.abs() < 1000.0f) { + return i_actor; + } + } -/* 804EE988-804EE98C 0000DC 0004+00 0/1 0/0 0/0 .rodata @5119 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5119 = 19.0f / 10.0f; -COMPILER_STRIP_GATE(0x804EE988, &lit_5119); -#pragma pop + return NULL; +} /* 804E7D18-804E8620 002C58 0908+00 1/1 0/0 0/0 .text e_dn_fight_run__FP10e_dn_class */ -static void e_dn_fight_run(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_fight_run(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp4c, sp58; + f32 fVar1 = 0.0f; + int frame = i_this->mpModelMorf->getFrame(); + s8 sVar4 = 1; + + if (pl_check(i_this, i_this->field_0x6d8 + 50.0f, 0x7FFF) == 0 && i_this->field_0x6e0[0] == 0) { + if (i_this->field_0x6ea == 0) { + sVar4 = 0; + } + } else { + i_this->field_0x6ea = 40; + } + + switch (i_this->field_0x5b4) { + case -10: + anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->field_0x6e0[1] = cM_rndF(10.0f) + 15.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND, -1); + i_this->field_0x5b4 = -9; + break; + + case -9: + cLib_addCalc0(&a_this->speedF, 1.0f, 5.0f); + if (i_this->field_0x6e0[1] == 0) { + i_this->field_0x5b4 = 0; + } + break; + + case 0: + anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + i_this->field_0x5b4 = 1; + i_this->field_0x82c = 0; + // fallthrough + case 1: + fVar1 = l_HIO.dash_speed; + if ((i_this->field_0x6cc & 3) == 0) { + if ((i_this->field_0x6cc & 4) != 0) { + i_this->field_0x10e4 = 1; + } else { + i_this->field_0x10e4 = 2; + } + } + + if (i_this->mObjAcch.ChkWallHit() != 0 && !fopAcM_wayBgCheck(a_this, 200.0f, 120.0f)) { + i_this->field_0x82c++; + } else if (i_this->mPlayerDistance < l_HIO.battle_init_range) { + anm_init(i_this, 32, 5.0f, 2, 1.0f); + i_this->field_0x5b4 = 2; + i_this->field_0x6e0[2] = cM_rndF(30.0f) + 30.0f; + } + + if (i_this->field_0x82c > 20) { + i_this->mAction = 8; + i_this->field_0x5b4 = 0; + return; + } + + if (move_gake_check(i_this, 50.0f, 0)) { + i_this->mAction = 25; + i_this->field_0x5b4 = 0; + i_this->field_0x6e8 = 100; + a_this->speedF = 0.0f; + return; + } + break; + + case 2: + i_this->field_0x82e = 1; + if (frame == 7 || frame == 21) { + a_this->speed.y = 10.0f; + if (i_this->mPlayerDistance > (l_HIO.battle_init_range + 250.0f)) { + i_this->field_0x5b4 = 0; + a_this->current.angle.y = a_this->shape_angle.y; + break; + } + + if (i_this->mPlayerDistance > (l_HIO.battle_init_range + 100.0f)) { + a_this->current.angle.y = i_this->mYAngleToPlayer; + } else if (i_this->mPlayerDistance < (l_HIO.battle_init_range - 100.0f)) { + a_this->current.angle.y = -i_this->mYAngleToPlayer; + } else { + a_this->current.angle.y = cM_rndFX(32763.0f); + } + + a_this->speedF = cM_rndF(5.0f) + 5.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_BREATH, -1); + } + + if (frame == 13 || frame == 27) { + a_this->speedF = 0.0f; + i_this->field_0x10e4 = 3; + if (frame == 13) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_RUN_L, 0, -1); + } else { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_RUN_R, 0, -1); + } + } + + a_this->gravity = -5.0f; + break; + } + + s16 sVar1; + if (i_this->field_0x5b4 >= 0) { + if (i_this->field_0x82e == 0) { + sVar1 = a_this->current.angle.y; + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + sVar1 -= a_this->current.angle.y; + s16 sVar2 = a_this->current.angle.y - i_this->mYAngleToPlayer; + if (sVar2 > 0x800 || sVar2 < -0x800) { + fVar1 = 0.0f; + } + + cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); + } else { + sVar1 = a_this->shape_angle.y; + cLib_addCalcAngleS2(&a_this->shape_angle.y, i_this->mYAngleToPlayer, 4, 0x800); + sVar1 -= a_this->shape_angle.y; + } + + sVar1 *= 2; + if (sVar1 > 0x1000) { + sVar1 = 0x1000; + } else if (sVar1 < -0x1000) { + sVar1 = -0x1000; + } + cLib_addCalcAngleS2(&i_this->field_0x826, sVar1, 2, 0x400); + } + + u8 sVar3 = 0; + learn_check = i_this->field_0x744; + if (fpcM_Search(shot_s_sub, i_this) != NULL || ((i_this->field_0x744 & 0x1000) != 0 && daPy_getPlayerActorClass()->checkHookshotShootReturnMode())) { + sVar3 = 1; + OS_REPORT(" DEF ON !!\n"); + } + + if (sVar4 == 0) { + if (i_this->field_0x6ea == 0) { + i_this->mAction = 0; + i_this->field_0x5b4 = 0; + i_this->field_0x6e0[0] = cM_rndF(50.0f) + 50.0f; + anm_init(i_this, 33, 10.0f, 2, 1.0f); + + if (i_this->field_0x82e == 0) { + return; + } + + a_this->current.angle.y = a_this->shape_angle.y; + return; + } + } else { + if (dComIfGp_checkPlayerStatus1(0, 0x2000000) != 0 || + (((i_this->mXAngleToPlayer < 0x1000 && i_this->mXAngleToPlayer > -0x1000) || sVar3 != 0) && player_way_check(i_this))) { + if ((sVar3 != 0 || (i_this->mPlayerDistance < l_HIO.battle_init_range && (i_this->field_0x744 & cc_pl_cut_bit_get()) != 0 && + ((daPy_getPlayerActorClass()->getCutAtFlg() != 0 || daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_JUMP) || + (i_this->field_0x744 & 0x400) != 0))) && i_this->field_0x74c < 1.0f) { + i_this->mAction = 7; + if (cc_pl_cut_bit_get() == 0x100) { + i_this->field_0x5b4 = 0; + } else { + i_this->field_0x5b4 = 5; + } + + i_this->field_0x708 = 30.0f; + i_this->field_0x70c = a_this->shape_angle.y; + i_this->field_0x6e0[0] = 0; + i_this->field_0x6e8 = 15; + } else { + if (i_this->mPlayerDistance < l_HIO.attack_init_range) { + if (i_this->field_0x6e0[2] == 0) { + i_this->field_0x6e0[2] = cM_rndF(30.0f) + 30.0f; + if (cM_rndF(1.0f) < 1.0f) { + if (way_check(i_this) == 0 && cM_rndF(1.0f) < 0.75f) { + if (i_this->mPlayerDistance < l_HIO.attack_init_range - 100.0f) { + i_this->mAction = 4; + } else { + i_this->mAction = 5; + } + + i_this->field_0x5b4 = 0; + } else { + i_this->mAction = 6; + i_this->field_0x5b4 = 0; + } + } + } + } + + } + } + } + + i_this->field_0x6f4 = 1; + if ((i_this->field_0x6cc & 15) == 0 && bomb_view_check(i_this) != NULL) { + i_this->mAction = 11; + i_this->field_0x5b4 = 0; + } + + if (i_this->field_0x5b7 == 1 && move_gake_check(i_this, 150.0f, 1) && (i_this->field_0x6cc & 15) == 0 && cM_rndF(1.0f) < 0.5f) { + i_this->field_0x700 = cM_rndF(10.0f) + 10.0f; + i_this->field_0x701 = cM_rndF(1.9f); + } + + if (move_gake_check(i_this, 50.0f, 1)) { + if (i_this->field_0x5b7 == 1) { + if (cM_rndF(1.0f) < 0.5f) { + i_this->mAction = 6; + i_this->field_0x5b4 = 0; + } else { + i_this->mAction = 25; + i_this->field_0x5b4 = 0; + i_this->field_0x5c8 = a_this->current.pos; + i_this->field_0x5bc = a_this->current.pos; + i_this->field_0x6e8 = 100; + } + + a_this->speedF = 0.0f; + } else { + i_this->mAction = 23; + i_this->field_0x5b4 = 0; + } + } + + if (i_this->mAction != 3 && i_this->field_0x82e != 0) { + a_this->current.angle.y = a_this->shape_angle.y; + } } /* 804E8620-804E8848 003560 0228+00 1/1 0/0 0/0 .text e_dn_jump__FP10e_dn_class */ -static void e_dn_jump(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_jump(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->field_0x6f4 = 1; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 27, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + return; + + case 1: + if (!i_this->mpModelMorf->isStop()) { + return; + } + + a_this->speed.y = 50.0f; + i_this->field_0x5b4 = 2; + i_this->field_0x10e4 = 3; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_JUMP, -1); + // fallthrough + case 2: + a_this->speedF = 30.0f; + if (a_this->speed.y <= 0.0f) { + anm_init(i_this, 28, 5.0f, 0, 1.0f); + i_this->field_0x5b4 = 3; + } + return; + + case 3: + if (!i_this->mObjAcch.ChkGroundHit()) { + return; + } + + anm_init(i_this, 29, 1.0f, 0, 1.0f); + i_this->field_0x5b4 = 4; + i_this->field_0x10e4 = 3; + i_this->field_0x6e0[0] = 3; + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_R, 0, -1); + return; + + case 4: + if (i_this->field_0x6e0[0] == 1) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_L, 0, -1); + } + + cLib_addCalc0(&a_this->speedF, 1.0f, 10.0f); + if (!i_this->mpModelMorf->isStop()) { + return; + } + + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + return; + } } -/* ############################################################################################## */ -/* 804EE98C-804EE990 0000E0 0004+00 0/1 0/0 0/0 .rodata @5272 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5272 = 35.0f; -COMPILER_STRIP_GATE(0x804EE98C, &lit_5272); -#pragma pop - /* 804E8848-804E8D78 003788 0530+00 1/1 0/0 0/0 .text e_dn_gakejump__FP10e_dn_class */ -static void e_dn_gakejump(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_gakejump(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp24, sp30; + + i_this->field_0x6f4 = 1; + switch (i_this->field_0x5b4) { + case 0: + if (jump_pos_check(i_this, &i_this->field_0x5bc)) { + anm_init(i_this, 27, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 2; + a_this->current.angle.y = i_this->mYAngleToPlayer; + return; + } + + if (i_this->field_0x5e0 != 31) { + anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + i_this->field_0x6e0[0] = cM_rndF(15.0f) + 35.0f; + i_this->field_0x5b4 = 1; + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 4, 0x800); + return; + + case 1: + i_this->field_0x6f4 = 2; + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + sp24.x = 0.0f; + sp24.y = 0.0f; + sp24.z = 100.0f; + MtxPosition(&sp24, &i_this->field_0x738); + i_this->field_0x738 += a_this->current.pos; + + if (i_this->field_0x6e0[0] != 0) { + return; + } + + i_this->field_0x5b4 = 0; + return; + + case 2: + if (!i_this->mpModelMorf->isStop()) { + return; + } + + if (jump_pos_check(i_this, &i_this->field_0x5bc)) { + i_this->field_0x5b4 = 3; + i_this->field_0x10e4 = 3; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_JUMP, -1); + i_this->field_0x6e0[0] = 20; + i_this->field_0x6e0[1] = 60; + i_this->field_0x5c8 = a_this->current.pos; + } else { + anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + i_this->field_0x6e0[0] = cM_rndF(15.0f) + 35.0f; + i_this->field_0x5b4 = 1; + return; + } + // fallthrough + case 3: + i_this->field_0x5d8 = 1; + sp24 = i_this->field_0x5bc - a_this->current.pos; + i_this->field_0x5d4 = cM_atan2s(sp24.x, sp24.z); + i_this->field_0x5d6 = -cM_atan2s(sp24.y, JMAFastSqrt(sp24.x * sp24.x + sp24.z * sp24.z)); + a_this->speedF = 50.0f; + + if (i_this->field_0x6e0[0] == 1) { + anm_init(i_this, 28, 5.0f, 0, 1.0f); + } + + if (sp24.abs() < (a_this->speedF * 1.1f)) { + a_this->current.pos = i_this->field_0x5bc; + anm_init(i_this, 29, 1.0f, 0, 1.0f); + i_this->field_0x5b4 = 4; + i_this->field_0x10e4 = 3; + i_this->field_0x6e0[0] = 3; + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_R, 0, -1); + a_this->speedF = 0.0f; + i_this->field_0x6e8 = 0; + } + + if (i_this->field_0x6e0[1] == 0 || i_this->mObjAcch.ChkWallHit() != 0) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + return; + + case 4: + if (i_this->field_0x6e0[0] == 1) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_L, 0, -1); + } + + if (!i_this->mpModelMorf->isStop()) { + return; + } + + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + return; + } } /* 804E8D78-804E8DD8 003CB8 0060+00 2/2 0/0 0/0 .text at_hit_check__FP10e_dn_class */ -static void at_hit_check(e_dn_class* param_0) { - // NONMATCHING -} +static fopAc_ac_c* at_hit_check(e_dn_class* i_this) { + if (i_this->field_0x5b4 >= 10) { + return NULL; + } + + if (i_this->field_0xe44.ChkAtHit() != 0) { + return dCc_GetAc(i_this->field_0xe44.GetAtHitObj()->GetAc()); + } -/* ############################################################################################## */ -/* 804EE990-804EE994 0000E4 0004+00 0/2 0/0 0/0 .rodata @5333 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5333 = 6.0f; -COMPILER_STRIP_GATE(0x804EE990, &lit_5333); -#pragma pop + return NULL; +} /* 804E8DD8-804E8F78 003D18 01A0+00 1/1 0/0 0/0 .text e_dn_attack_0__FP10e_dn_class */ -static void e_dn_attack_0(e_dn_class* param_0) { +static void e_dn_attack_0(e_dn_class* i_this) { // NONMATCHING + } /* 804E8F78-804E91D4 003EB8 025C+00 1/1 0/0 0/0 .text e_dn_attack__FP10e_dn_class */ -static void e_dn_attack(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_attack(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp34, sp40; + int frame = i_this->mpModelMorf->getFrame(); + + i_this->field_0x6f4 = 1; + s16 sVar1, sVar2; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 5, 6.0f, 0, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_KNIFE2_A, -1); + i_this->field_0x5b4 = 1; + // fallthrough + case 1: + if (frame < 10 || (frame >= 25 && frame <= 30)) { + sVar1 = a_this->current.angle.y; + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + sVar1 -= a_this->current.angle.y; + sVar1 *= 2; + if (sVar1 > 0x1000) { + sVar1 = 0x1000; + } else if (sVar1 < -0x1000) { + sVar1 = -0x1000; + } + cLib_addCalcAngleS2(&i_this->field_0x826, sVar1, 2, 0x400); + } + + if (frame >= 13 && frame <= 18) { + i_this->field_0x6ef = 1; + i_this->field_0x6ee = 0; + } + + if (frame >= 25 && frame <= 30) { + i_this->field_0x6ef = 1; + i_this->field_0x6ee = 1; + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + sp34.x = 0.0f; + sp34.y = 0.0f; + sp34.z = 25.0f; + MtxPosition(&sp34, &sp40); + a_this->current.pos += sp40; + } + + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } + + cLib_addCalc0(&a_this->speedF, 1.0f, 5.0f); + if (i_this->field_0x6ef != 0) { + fopAc_ac_c* actor_p = at_hit_check(i_this); + if (actor_p != NULL && fopAcM_GetName(actor_p) == PROC_ALINK && daPy_getPlayerActorClass()->checkPlayerGuard()) { + i_this->mpModelMorf->setPlaySpeed(0.0f); + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } } /* 804E91D4-804E9354 004114 0180+00 1/1 0/0 0/0 .text tail_eff_set__FP10e_dn_class */ -static void tail_eff_set(e_dn_class* param_0) { - // NONMATCHING +static void tail_eff_set(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + J3DModel* model = i_this->mpModelMorf->getModel(); + i_this->field_0x10f8 = dComIfGp_particle_set(i_this->field_0x10f8, 0x815F, &a_this->current.pos, NULL, NULL); + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x10f8); + if (emitter != NULL) { + MTXCopy(model->getAnmMtx(0), *calc_mtx); + emitter->setGlobalRTMatrix(*calc_mtx); + } + + i_this->field_0x10fc = dComIfGp_particle_set(i_this->field_0x10fc, 0x8160, &a_this->current.pos, NULL, NULL); + emitter = dComIfGp_particle_getEmitter(i_this->field_0x10fc); + if (emitter != NULL) { + MTXCopy(model->getAnmMtx(0), *calc_mtx); + emitter->setGlobalRTMatrix(*calc_mtx); + } } /* 804E9354-804E9544 004294 01F0+00 1/1 0/0 0/0 .text e_dn_tail_attack__FP10e_dn_class */ -static void e_dn_tail_attack(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_tail_attack(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp30, sp3c; + int frame = i_this->mpModelMorf->getFrame(); + + i_this->field_0x6f4 = 1; + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 8, 5.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + break; + + case 1: + if (frame >= 19) { + tail_eff_set(i_this); + } + + if (frame >= 33 && frame <= 41) { + i_this->field_0x6ef = 1; + i_this->field_0x6ee = 2; + cMtx_YrotS(*calc_mtx, i_this->mYAngleToPlayer); + sp30.x = 0.0f; + sp30.y = 0.0f; + sp30.z = 30.0f; + MtxPosition(&sp30, &sp3c); + a_this->current.pos += sp3c; + } + + if (frame == 40) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_RUN_R, 0, -1); + } else if (frame == 43) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_RUN_L, 0, -1); + } + + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } + + a_this->current.angle.y += i_this->field_0x82a; + a_this->shape_angle.y += i_this->field_0x82a; + cLib_addCalcAngleS2(&i_this->field_0x82a, 0, 1, 300); + cLib_addCalc0(&a_this->speedF, 1.0f, 3.0f); } -/* ############################################################################################## */ -/* 804EE994-804EE998 0000E8 0004+00 0/1 0/0 0/0 .rodata @5542 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5542 = -8.0f; -COMPILER_STRIP_GATE(0x804EE994, &lit_5542); -#pragma pop - /* 804E9544-804E973C 004484 01F8+00 2/1 0/0 0/0 .text e_dn_guard__FP10e_dn_class */ -static void e_dn_guard(e_dn_class* param_0) { - // NONMATCHING +static void e_dn_guard(e_dn_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->field_0x6f1 = 1; + i_this->field_0x6f4 = 1; + + switch (i_this->field_0x5b4) { + case 0: + anm_init(i_this, 32, 3.0f, 0, 1.0f); + i_this->field_0x5b4 = 1; + a_this->speed.y = 20.0f; + a_this->speedF = -8.0f; + i_this->field_0x10e4 = 3; + break; + + case 1: + i_this->field_0x6e8 = 5; + if (i_this->mpModelMorf->getFrame() >= 5.0f) { + i_this->field_0x5b4 = 5; + i_this->field_0x6e0[0] = 20; + } + break; + + case 5: + anm_init(i_this, 22, 3.0f, 0, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_GUARD, -1); + i_this->field_0x5b4 = 6; + // fallthrough + case 6: + i_this->field_0x6e8 = 5; + if (i_this->mObjAcch.ChkGroundHit()) { + cLib_addCalc0(&a_this->speedF, 1.0f, 10.0f); + } + + if (i_this->mpModelMorf->getFrame() >= 8.0f) { + i_this->mpModelMorf->setPlaySpeed(0.0f); + i_this->field_0x5b4 = 7; + a_this->speedF = 0.0f; + } + break; + + case 7: + i_this->field_0x6e8 = 5; + if (cc_pl_cut_bit_get() == 0x80 || cc_pl_cut_bit_get() == 0x800) { + i_this->field_0x6e0[0] = 20; + } + + if (i_this->field_0x6e0[0] == 0) { + i_this->field_0x5b4 = 8; + i_this->mpModelMorf->setPlaySpeed(1.0f); + } + break; + + case 8: + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = 3; + i_this->field_0x5b4 = 0; + } + } } /* 804E973C-804E97EC 00467C 00B0+00 1/1 0/0 0/0 .text e_dn_s_damage__FP10e_dn_class */ -static void e_dn_s_damage(e_dn_class* param_0) { +static void e_dn_s_damage(e_dn_class* i_this) { // NONMATCHING } @@ -1226,12 +2057,12 @@ COMPILER_STRIP_GATE(0x804EE9A0, &lit_5593); #pragma pop /* 804E97EC-804E99A0 00472C 01B4+00 1/1 0/0 0/0 .text kado_check__FP10e_dn_class */ -static void kado_check(e_dn_class* param_0) { +static void kado_check(e_dn_class* i_this) { // NONMATCHING } /* 804E99A0-804E9AF0 0048E0 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_dn_class */ -static void body_gake(e_dn_class* param_0) { +static void body_gake(e_dn_class* i_this) { // NONMATCHING } @@ -1250,7 +2081,7 @@ COMPILER_STRIP_GATE(0x804EE9A4, &lit_5977); #pragma pop /* 804E9B68-804EA700 004AA8 0B98+00 2/1 0/0 0/0 .text e_dn_damage__FP10e_dn_class */ -static void e_dn_damage(e_dn_class* param_0) { +static void e_dn_damage(e_dn_class* i_this) { // NONMATCHING } @@ -1291,12 +2122,12 @@ COMPILER_STRIP_GATE(0x804EE9B8, &lit_6005); #pragma pop /* 804EA700-804EA854 005640 0154+00 1/1 0/0 0/0 .text e_dn_backdrop__FP10e_dn_class */ -static void e_dn_backdrop(e_dn_class* param_0) { +static void e_dn_backdrop(e_dn_class* i_this) { // NONMATCHING } /* 804EA854-804EA9F4 005794 01A0+00 1/1 0/0 0/0 .text e_dn_water__FP10e_dn_class */ -static void e_dn_water(e_dn_class* param_0) { +static void e_dn_water(e_dn_class* i_this) { // NONMATCHING } @@ -1344,12 +2175,12 @@ COMPILER_STRIP_GATE(0x804EE9D0, &lit_6102); #pragma pop /* 804EA9F4-804EAD1C 005934 0328+00 1/1 0/0 0/0 .text e_dn_reg__FP10e_dn_class */ -static void e_dn_reg(e_dn_class* param_0) { +static void e_dn_reg(e_dn_class* i_this) { // NONMATCHING } /* 804EAD1C-804EADD4 005C5C 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_dn_class */ -static void wolfkick_damage(e_dn_class* param_0) { +static void wolfkick_damage(e_dn_class* i_this) { // NONMATCHING } @@ -1362,231 +2193,534 @@ COMPILER_STRIP_GATE(0x804EE9D4, &lit_6120); #pragma pop /* 804EADD4-804EAEE4 005D14 0110+00 1/1 0/0 0/0 .text big_damage__FP10e_dn_class */ -static void big_damage(e_dn_class* param_0) { +static void big_damage(e_dn_class* i_this) { // NONMATCHING } /* 804EAEE4-804EAF94 005E24 00B0+00 1/1 0/0 0/0 .text small_damage__FP10e_dn_class */ -static void small_damage(e_dn_class* param_0) { +static void small_damage(e_dn_class* i_this) { // NONMATCHING } /* 804EAF94-804EB344 005ED4 03B0+00 1/1 0/0 0/0 .text damage_check__FP10e_dn_class */ -static void damage_check(e_dn_class* param_0) { +static void damage_check(e_dn_class* i_this) { // NONMATCHING } /* 804EB344-804EC854 006284 1510+00 2/1 0/0 0/0 .text action__FP10e_dn_class */ -static void action(e_dn_class* param_0) { +static void action(e_dn_class* i_this) { // NONMATCHING } /* 804EC854-804ECB50 007794 02FC+00 1/1 0/0 0/0 .text anm_se_set__FP10e_dn_class */ -static void anm_se_set(e_dn_class* param_0) { +static void anm_se_set(e_dn_class* i_this) { // NONMATCHING } -/* ############################################################################################## */ -/* 804EE9D8-804EE9DC 00012C 0004+00 0/0 0/0 0/0 .rodata @6928 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6928 = 3.0f / 10.0f; -COMPILER_STRIP_GATE(0x804EE9D8, &lit_6928); -#pragma pop - -/* 804EE9DC-804EE9E0 000130 0004+00 0/0 0/0 0/0 .rodata @6929 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6929 = -4.0f; -COMPILER_STRIP_GATE(0x804EE9DC, &lit_6929); -#pragma pop - -/* 804EE9E0-804EE9E4 000134 0004+00 0/0 0/0 0/0 .rodata @6930 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6930 = 7.0f; -COMPILER_STRIP_GATE(0x804EE9E0, &lit_6930); -#pragma pop - -/* 804EE9E4-804EE9E8 000138 0004+00 0/0 0/0 0/0 .rodata @6931 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6931 = 2500.0f; -COMPILER_STRIP_GATE(0x804EE9E4, &lit_6931); -#pragma pop - -/* 804EE9E8-804EE9EC 00013C 0004+00 0/0 0/0 0/0 .rodata @6932 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6932 = 15000.0f; -COMPILER_STRIP_GATE(0x804EE9E8, &lit_6932); -#pragma pop - -/* 804EE9EC-804EE9F0 000140 0004+00 0/0 0/0 0/0 .rodata @6933 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6933 = 12000.0f; -COMPILER_STRIP_GATE(0x804EE9EC, &lit_6933); -#pragma pop - -/* 804EE9F0-804EE9F4 000144 0004+00 0/0 0/0 0/0 .rodata @6934 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6934 = -1000000000.0f; -COMPILER_STRIP_GATE(0x804EE9F0, &lit_6934); -#pragma pop - -/* 804EE9F4-804EE9F8 000148 0004+00 0/1 0/0 0/0 .rodata @7355 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7355 = -10.0f; -COMPILER_STRIP_GATE(0x804EE9F4, &lit_7355); -#pragma pop - -/* 804EE9F8-804EE9FC 00014C 0004+00 0/2 0/0 0/0 .rodata @7356 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7356 = -200.0f; -COMPILER_STRIP_GATE(0x804EE9F8, &lit_7356); -#pragma pop - -/* 804EE9FC-804EEA00 000150 0004+00 0/1 0/0 0/0 .rodata @7357 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7357 = -20000.0f; -COMPILER_STRIP_GATE(0x804EE9FC, &lit_7357); -#pragma pop - -/* 804EEA00-804EEA04 000154 0004+00 0/1 0/0 0/0 .rodata @7358 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7358 = 200000.0f; -COMPILER_STRIP_GATE(0x804EEA00, &lit_7358); -#pragma pop - -/* 804EEA04-804EEA08 000158 0004+00 0/1 0/0 0/0 .rodata @7359 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7359 = 30000.0f; -COMPILER_STRIP_GATE(0x804EEA04, &lit_7359); -#pragma pop - -/* 804EEA08-804EEA0C 00015C 0004+00 0/1 0/0 0/0 .rodata @7360 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7360 = 45.0f; -COMPILER_STRIP_GATE(0x804EEA08, &lit_7360); -#pragma pop - -/* 804EEA0C-804EEA10 000160 0004+00 0/2 0/0 0/0 .rodata @7361 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7361 = 80.0f; -COMPILER_STRIP_GATE(0x804EEA0C, &lit_7361); -#pragma pop - -/* 804EEA10-804EEA14 000164 0004+00 0/1 0/0 0/0 .rodata @7362 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7362 = -23500.0f; -COMPILER_STRIP_GATE(0x804EEA10, &lit_7362); -#pragma pop - -/* 804EEA14-804EEA18 000168 0004+00 0/1 0/0 0/0 .rodata @7363 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7363 = -50000.0f; -COMPILER_STRIP_GATE(0x804EEA14, &lit_7363); -#pragma pop - -/* 804EEA18-804EEA1C 00016C 0004+00 0/1 0/0 0/0 .rodata @7364 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7364 = -30000.0f; -COMPILER_STRIP_GATE(0x804EEA18, &lit_7364); -#pragma pop - -/* 804EEA1C-804EEA20 000170 0004+00 0/1 0/0 0/0 .rodata @7365 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7365 = 2.0f / 5.0f; -COMPILER_STRIP_GATE(0x804EEA1C, &lit_7365); -#pragma pop - -/* 804EEA20-804EEA24 000174 0004+00 0/1 0/0 0/0 .rodata @7366 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7366 = 180.0f; -COMPILER_STRIP_GATE(0x804EEA20, &lit_7366); -#pragma pop - -/* 804EEA24-804EEA28 000178 0004+00 0/1 0/0 0/0 .rodata @7367 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7367 = -5000.0f; -COMPILER_STRIP_GATE(0x804EEA24, &lit_7367); -#pragma pop - -/* 804EEA28-804EEA2C 00017C 0004+00 0/1 0/0 0/0 .rodata @7368 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7368 = -300.0f; -COMPILER_STRIP_GATE(0x804EEA28, &lit_7368); -#pragma pop - -/* 804EEA34-804EEA34 000188 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_804EEA39 = "D_MN07"; -#pragma pop - /* 804EEF94-804EEF98 0000AC 0004+00 1/2 0/0 0/0 .bss c_start */ -static u8 c_start[4]; +static int c_start; /* 804ECB50-804ED83C 007A90 0CEC+00 2/1 0/0 0/0 .text daE_DN_Execute__FP10e_dn_class */ -static void daE_DN_Execute(e_dn_class* param_0) { - // NONMATCHING +static int daE_DN_Execute(e_dn_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + f32 fVar1 = 0.0f; + + if (i_this->field_0x10d8 != 0) { + return 1; + } + + if (c_start == 0 && dComIfGp_event_runCheck() && + (fopAcM_getTalkEventPartner((fopAc_ac_c*)daPy_getLinkPlayerActorClass()) == daPy_py_c::getMidnaActor() || daPy_getPlayerActorClass()->eventInfo.checkCommandDoor())) { + return 1; + } + + cXyz sp2c; + cXyz sp38; + cXyz sp44; + i_this->field_0x6cc++; + for (int i = 0; i < 4; i++) { + if (i_this->field_0x6e0[i] != 0) { + i_this->field_0x6e0[i]--; + } + } + + if (i_this->field_0x6e8 != 0) { + i_this->field_0x6e8--; + } + + if (i_this->field_0x6ec != 0) { + i_this->field_0x6ec--; + } + + if (i_this->field_0x840 != 0) { + i_this->field_0x840--; + } + + if (i_this->field_0x6ea != 0) { + i_this->field_0x6ea--; + } + + i_this->field_0x6f2 = 1; + action(i_this); + + if (i_this->field_0x840 == 0 && i_this->field_0x5d8 == 0) { + if (i_this->field_0x704 != fVar1) { + cMtx_YrotS(*calc_mtx, i_this->field_0x724.y); + sp2c.x = 0.0f; + sp2c.y = 0.0f; + sp2c.z = i_this->field_0x83c; + MtxPosition(&sp2c, &sp38); + a_this->current.pos += sp38; + a_this->old.pos += sp38; + cLib_addCalc2(&i_this->field_0x83c, i_this->field_0x704 * 2.0f, 1.0f, 5.0f); + } else { + cLib_addCalc0(&i_this->field_0x83c, 1.0f, 5.0f); + } + + i_this->mObjAcch.CrrPos(dComIfG_Bgsp()); + if (i_this->field_0x704 != fVar1) { + a_this->current.pos -= sp38; + a_this->old.pos -= sp38; + } + + + if (!i_this->mObjAcch.ChkGroundHit()) { + if (a_this->speed.y < -10.0f) { + i_this->field_0x842++; + if (i_this->field_0x842 == 13) { + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DEATH, -1); + } + } + } else { + if (i_this->field_0x842 >= 13) { + i_this->mAction = 21; + i_this->field_0x5b4 = 0; + a_this->speed.y = 0.0f; + i_this->field_0x704 = -1.0; + i_this->field_0x724.x = -0x3000; + i_this->field_0x828 = 50; + i_this->field_0x6e8 = 1000; + a_this->health = 0; + } + + i_this->field_0x842 = 0; + } + } + + mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y + i_this->field_0x720, a_this->current.pos.z); + mDoMtx_stack_c::XrotM(i_this->field_0x72a.x); + mDoMtx_stack_c::ZrotM(i_this->field_0x72a.z); + mDoMtx_stack_c::YrotM(i_this->field_0x724.y); + mDoMtx_stack_c::XrotM(i_this->field_0x724.x); + mDoMtx_stack_c::YrotM(-i_this->field_0x724.y); + mDoMtx_stack_c::YrotM(a_this->shape_angle.y); + mDoMtx_stack_c::XrotM(a_this->shape_angle.x); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + mDoMtx_stack_c::scaleM(l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x); + + J3DModel* model = i_this->mpModelMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpModelMorf->play(0, 0); + anm_se_set(i_this); + i_this->mpModelMorf->modelCalc(); + MTXCopy(model->getAnmMtx(2), *calc_mtx); + + sp2c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + sp2c.set(0.0f, 0.0f, -200.0f); + MtxPosition(&sp2c, &sp44); + if (sp38.y < sp44.y) { + i_this->field_0x737 = 0; + } + else { + i_this->field_0x737 = 1; + } + + cXyz sp50(0.0f, 0.0f, 0.0f); + if (i_this->field_0x6e8 != 0) { + sp50.set(-20000.0f, 200000.0f, 30000.0f); + } + + MTXCopy(model->getAnmMtx(6), *calc_mtx); + sp2c.set(30.0f, 30.0f, 0.0f); + MtxPosition(&sp2c, &a_this->eyePos); + + i_this->field_0xa9c[0].SetC(a_this->eyePos + sp50); + if (daPy_getPlayerActorClass()->checkHorseRide()) { + i_this->field_0xa9c[0].SetR(70.0f); + } else { + i_this->field_0xa9c[0].SetR(50.0f); + } + + a_this->attention_info.position = a_this->eyePos; + a_this->attention_info.position.y += 70.0f; + + MTXCopy(model->getAnmMtx(1), *calc_mtx); + sp2c.set(-30.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + i_this->field_0xa9c[1].SetC(sp38 + sp50); + i_this->field_0xa9c[1].SetR(45.0f); + MTXCopy(model->getAnmMtx(2), *calc_mtx); + sp2c.set(20.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + i_this->field_0xa9c[2].SetC(sp38 + sp50); + i_this->field_0xa9c[2].SetR(45.0f); + + for (int i = 0; i <= 2; i++) { + if (i_this->field_0x6f2 != 0) { + i_this->field_0xa9c[i].OnCoSetBit(); + } else { + i_this->field_0xa9c[i].OffCoSetBit(); + } + + dComIfG_Ccsp()->Set(&i_this->field_0xa9c[i]); + } + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(19), *calc_mtx); + i_this->field_0x5e4->setBaseTRMtx(*calc_mtx); + + if (i_this->field_0x6ef != 0 && i_this->field_0x6ee <= 1) { + sp2c.set(0.0f, 60.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + if (i_this->field_0x6f0 == 0) { + i_this->field_0x6f0 = 1; + i_this->field_0xe44.StartCAt(sp38); + } else { + i_this->field_0xe44.MoveCAt(sp38); + } + + if (i_this->field_0x6ee == 1) { + i_this->field_0xe44.SetR(l_HIO.base_size * 80.0f); + } else { + i_this->field_0xe44.SetR(l_HIO.base_size * 50.0f); + } + + i_this->field_0xe44.SetAtAtp(1); + } + + if (i_this->field_0x690 != NULL) { + if (i_this->field_0x694 == 0) { + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(6), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x698); + } else { + i_this->field_0x698 += i_this->field_0x6a4; + if (i_this->field_0x6a4.y <= i_this->mObjAcch.GetGroundH()) { + i_this->field_0x690 = NULL; + } + + i_this->field_0x6a4.y -= 5.0f; + mDoMtx_stack_c::transS(i_this->field_0x698.x, i_this->field_0x698.y, i_this->field_0x698.z); + mDoMtx_stack_c::YrotM(i_this->field_0x6b0); + mDoMtx_stack_c::XrotM(i_this->field_0x6b2); + } + + i_this->field_0x690->setBaseTRMtx(mDoMtx_stack_c::get()); + } + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(12), *calc_mtx); + i_this->field_0x68c->setBaseTRMtx(*calc_mtx); + + if (i_this->field_0x6ef != 0 && i_this->field_0x6ee == 2) { + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(34), *calc_mtx); + sp2c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp2c, &sp38); + + if (i_this->field_0x6f0 == 0) { + i_this->field_0x6f0 = 1; + i_this->field_0xe44.StartCAt(sp38); + } else { + i_this->field_0xe44.MoveCAt(sp38); + } + + i_this->field_0xe44.SetAtAtp(2); + i_this->field_0xe44.SetR(70.0f * l_HIO.base_size); + // i_this->field_0xe44.SetAtSpl((dCcG_At_Spl)2); + } + + if (i_this->field_0x6ef == 0) { + cXyz sp68(-23500.0f, -20000.0f, -50000.0f); + i_this->field_0xe44.SetC(a_this->current.pos + sp68); + i_this->field_0x6f0 = 0; + } else { + i_this->field_0x6ef = 0; + } + + dComIfG_Ccsp()->Set(&i_this->field_0xe44); + + if (i_this->field_0x6f1 != 0 && i_this->field_0x6ec == 0) { + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(12), *calc_mtx); + sp2c.set(50.0f, 0.0f, 30.0f); + MtxPosition(&sp2c, &sp38); + i_this->field_0xf7c.SetC(sp38); + i_this->field_0xf7c.SetR(70.0f * l_HIO.base_size); + + if (i_this->field_0xf7c.ChkTgHit()) { + def_se_set(&i_this->mSound, i_this->field_0xf7c.GetTgHitObj(), 40, 0); + dScnPly_c::setPauseTimer(l_HIO.field_0x1c); + i_this->field_0x6ec = 10; + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + sp2c.x = 0.0f; + sp2c.y = 120.0f; + sp2c.z = 50.0f; + MtxPosition(&sp2c, &sp38); + sp38 += a_this->current.pos; + dComIfGp_setHitMark(2, NULL, &sp38, &a_this->shape_angle, NULL, 0); + } + } else { + cXyz sp74(-23500.0f, -20000.0f, -30000.0f); + i_this->field_0xf7c.SetC(a_this->current.pos + sp74); + } + + i_this->field_0x6f1 = 0; + dComIfG_Ccsp()->Set(&i_this->field_0xf7c); + if (i_this->field_0x6c4 != 0) { + cLib_addCalc2(&i_this->field_0x6c8, -20.0f, 1.0f, 0.4f); + } + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp38); + sp2c = player->current.pos - sp38; + cMtx_YrotS(*calc_mtx, cM_atan2s(sp2c.x, sp2c.z)); + sp2c.x = 0.0; + sp2c.y = 45.0f; + sp2c.z = 30.0f; + MtxPosition(&sp2c, &sp44); + sp44 += sp38; + a_this->setDownPos(&sp44); + cXyz sp80(a_this->eyePos); + sp80.y += 180.0f; + a_this->setHeadLockPos(&sp80); + + a_this->attention_info.flags |= 0x200000; + + if ((a_this->current.pos.y - a_this->home.pos.y) < -5000.0f) { + fopAcM_delete(a_this); + OS_REPORT("DN NARAKU\n"); + int swBit = fopAcM_GetParam(a_this) >> 24; + if (swBit != 0xFF) { + dComIfGs_onSwitch(swBit, fopAcM_GetRoomNo(a_this)); + } + } + + if (strcmp(dComIfGp_getStartStageName(), "D_MN07") == 0 && fopAcM_GetRoomNo(a_this) == 8 && a_this->health != 0 && a_this->current.pos.y <= -300.0f) { + i_this->mAction = 21; + i_this->field_0x5b4 = 0; + i_this->field_0x704 = 0.0; + a_this->health = 0; + } + + return 1; } /* 804ED83C-804ED844 00877C 0008+00 1/0 0/0 0/0 .text daE_DN_IsDelete__FP10e_dn_class */ -static bool daE_DN_IsDelete(e_dn_class* param_0) { - return true; +static int daE_DN_IsDelete(e_dn_class* i_this) { + return 1; } /* 804ED844-804ED8AC 008784 0068+00 1/0 0/0 0/0 .text daE_DN_Delete__FP10e_dn_class */ -static void daE_DN_Delete(e_dn_class* param_0) { +static int daE_DN_Delete(e_dn_class* i_this) { // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dComIfG_resDelete(&i_this->mPhase, "E_dn"); + + if (i_this->field_0x10d9 != 0) { + l_initHIO = 0; + } + + if (a_this->heap != NULL) { + i_this->mpModelMorf->stopZelAnime(); + } + + return 1; } /* 804ED8AC-804EDAEC 0087EC 0240+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -static void useHeapInit(fopAc_ac_c* param_0) { - // NONMATCHING +static int useHeapInit(fopAc_ac_c* a_this) { + e_dn_class* i_this = (e_dn_class*)a_this; + + i_this->mpModelMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_dn", 38), NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("E_dn", 31), 0, 1.0f, + 0, -1, &i_this->mSound, 0x80000, 0x11000084); + if (i_this->mpModelMorf == NULL || i_this->mpModelMorf->getModel() == NULL) { + return 0; + } + + J3DModel* model = i_this->mpModelMorf->getModel(); + model->setUserArea((u32)i_this); + + for (u16 i = 0; i < model->getModelData()->getJointNum(); i++) { + if (i != 0) { + model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); + } + } + + if (i_this->mJntCol.init(a_this, &jc_data[0], model, 12) == 0) { + return 0; + } + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_dn", 39); + JUT_ASSERT(5420, modelData != 0); + i_this->field_0x5e4 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->field_0x5e4 == NULL) { + return 0; + } + + modelData = (J3DModelData*)dComIfG_getObjectRes("E_dn", 41); + JUT_ASSERT(5432, modelData != 0); + i_this->field_0x68c = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->field_0x68c == NULL) { + return 0; + } + + if (i_this->field_0x5b7 == 1) { + modelData = (J3DModelData*)dComIfG_getObjectRes("E_dn", 40); + JUT_ASSERT(5443, modelData != 0); + i_this->field_0x690 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->field_0x690 == NULL) { + return 0; + } + } + + return 1; } -/* ############################################################################################## */ -/* 804EEA2C-804EEA30 000180 0004+00 0/1 0/0 0/0 .rodata @7548 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7548 = 100000.0f; -COMPILER_STRIP_GATE(0x804EEA2C, &lit_7548); -#pragma pop - -/* 804EEA30-804EEA34 000184 0004+00 0/1 0/0 0/0 .rodata @7549 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7549 = 65535.0f; -COMPILER_STRIP_GATE(0x804EEA30, &lit_7549); -#pragma pop - /* 804EDAEC-804EDE58 008A2C 036C+00 1/0 0/0 0/0 .text daE_DN_Create__FP10fopAc_ac_c */ -static void daE_DN_Create(fopAc_ac_c* param_0) { - // NONMATCHING +static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { + // NONMATCHING + e_dn_class* i_this = (e_dn_class*)a_this; + + fopAcM_SetupActor(a_this, e_dn_class); + + cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_dn"); + if (phase == cPhs_COMPLEATE_e) { + int swBit = fopAcM_GetParam(a_this) >> 24; + if (swBit != 0xFF) { + if (dComIfGs_isSwitch(swBit, fopAcM_GetRoomNo(a_this))) { + return cPhs_ERROR_e; + } + } + + OS_REPORT("E_dn PARAM %x\n", fopAcM_GetParam(a_this)); + i_this->field_0x5b6 = fopAcM_GetParam(a_this); + i_this->field_0x5b9 = 1; + i_this->field_0x5b7 = (fopAcM_GetParam(a_this) >> 8) & 15; + i_this->field_0x5b8 = (fopAcM_GetParam(a_this) & 0xF000) >> 12; + + if ((a_this->home.angle.z & 0xFF) == 0 || (a_this->home.angle.z & 0xFF) == 0xFF) { + i_this->field_0x6d8 = 100000.0f; + } else { + i_this->field_0x6d8 = (a_this->home.angle.z & 0xFF) * 100.0f; + } + + OS_REPORT("E_dn AZ %x\n", a_this->home.angle.z); + OS_REPORT("E_dn PR %d\n", i_this->field_0x6d8); + a_this->shape_angle.z = 0; + a_this->current.angle.z = 0; + a_this->home.angle.z = 0; + OS_REPORT("E_dn//////////////E_DN SET 1 !!\n"); + + if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x3BF0)) { + OS_REPORT("//////////////E_DN SET NON !!\n"); + return cPhs_ERROR_e; + } + + if (l_initHIO == 0) { + i_this->field_0x10d9 = 1; + l_initHIO = 1; + l_HIO.field_0x4 = -1; + } + + fopAcM_OnStatus(a_this, fopAcM_STATUS_UNK_000100); + a_this->attention_info.flags = 4; + fopAcM_SetMtx(a_this, i_this->mpModelMorf->getModel()->getBaseTRMtx()); + fopAcM_SetMin(a_this, -200.0f, -200.0f, -200.0f); + fopAcM_SetMax(a_this, 200.0f, 200.0f, 200.0f); + + i_this->mObjAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, + &i_this->mAcchCir, fopAcM_GetSpeed_p(a_this), NULL, NULL); + i_this->mAcchCir.SetWall(80.0f, 100.0f); + + if (i_this->field_0x5b7 == 1) { + a_this->health = 100; + a_this->field_0x560 = 100; + } else { + a_this->health = 100; + a_this->field_0x560 = 100; + } + i_this->mStts.Init(200, 0, a_this); + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fafdbf, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph + } // mSphAttr + }; + for (int i = 0; i <= 2; i++) { + i_this->field_0xa9c[i].Set(cc_sph_src); + i_this->field_0xa9c[i].SetStts(&i_this->mStts); + } + + static dCcD_SrcSph at_sph_src = { + { + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0x0, 0x0}, 0x0}}, // mObj + {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 35.0f} // mSph + } // mSphAttr + }; + i_this->field_0xe44.Set(at_sph_src); + i_this->field_0xe44.SetStts(&i_this->mStts); + + static dCcD_SrcSph tate_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_STONE, 0x5, 0x0, 0x0, 0x303}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 100.0f} // mSph + } // mSphAttr + }; + i_this->field_0xf7c.Set(tate_sph_src); + i_this->field_0xf7c.SetStts(&i_this->mStts); + + i_this->field_0x6cc = (int)cM_rndF(65535.0f) & 0xFF00; + + if (i_this->field_0x5b6 == 0) { + i_this->mAction = 9; + } + + if ((i_this->field_0x5b6 == 13 || i_this->field_0x5b6 == 14) || (i_this->field_0x5b6 == 15 || i_this->field_0x5b6 == 16)) { + i_this->field_0x10d8 = 1; + i_this->mAction = 60; + fopAcM_OnStatus(a_this, fopAcM_STATUS_UNK_004000); + i_this->mAcchCir.SetWall(80.0f, 2.0f); + } + + i_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 3, 1); + i_this->mSound.setEnemyName("E_dn"); + i_this->mAtInfo.mpSound = &i_this->mSound; + + c_start = 1; + daE_DN_Execute(i_this); + c_start = 0; + } + + return phase; } /* 804EDE58-804EE034 008D98 01DC+00 1/1 0/0 0/0 .text __ct__10e_dn_classFv */ -e_dn_class::e_dn_class() { - // NONMATCHING -} +e_dn_class::e_dn_class() {} /* 804EE034-804EE07C 008F74 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ // cM3dGSph::~cM3dGSph() { @@ -1642,11 +2776,6 @@ extern "C" void __dt__10cCcD_GSttsFv() { // NONMATCHING } -/* 804EE39C-804EE3E4 0092DC 0048+00 2/1 0/0 0/0 .text __dt__12daE_DN_HIO_cFv */ -daE_DN_HIO_c::~daE_DN_HIO_c() { - // NONMATCHING -} - /* 804EE3E4-804EE420 009324 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_dn_cpp */ void __sinit_d_a_e_dn_cpp() { // NONMATCHING @@ -1861,3 +2990,30 @@ static u8 data_804EEFF8[4]; #pragma pop /* 804EEA34-804EEA34 000188 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ + +/* 804EEDF8-804EEE18 -00001 0020+00 1/0 0/0 0/0 .data l_daE_DN_Method */ +static actor_method_class l_daE_DN_Method = { + (process_method_func)daE_DN_Create, + (process_method_func)daE_DN_Delete, + (process_method_func)daE_DN_Execute, + (process_method_func)daE_DN_IsDelete, + (process_method_func)daE_DN_Draw, +}; + +/* 804EEE18-804EEE48 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_DN */ +extern actor_process_profile_definition g_profile_E_DN = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_E_DN, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(e_dn_class), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 118, // mPriority + &l_daE_DN_Method, // sub_method + 0x00040000, // mStatus + fopAc_ENEMY_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 2b72fa403ee..907030c86e5 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -47,7 +47,7 @@ daE_MF_HIO_c::daE_MF_HIO_c() { /* 8070A77C-8070A82C 00015C 00B0+00 2/2 0/0 0/0 .text mf_disappear__FP10e_mf_class */ static void mf_disappear(e_mf_class* i_this) { - fopEn_enemy_c* a_this = &i_this->actor; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; cXyz sp1c, sp28; MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); @@ -148,7 +148,7 @@ static int nodeCallBack(J3DJoint* i_joint, int param_2) { /* 8070AD94-8070B03C 000774 02A8+00 1/0 0/0 0/0 .text daE_MF_Draw__FP10e_mf_class */ static int daE_MF_Draw(e_mf_class* i_this) { - fopEn_enemy_c* a_this = &i_this->actor; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; if (i_this->field_0x728 != 0) { return 1; @@ -2767,7 +2767,7 @@ int c_start; /* 80711CB8-80712998 007698 0CE0+00 2/1 0/0 0/0 .text daE_MF_Execute__FP10e_mf_class */ static int daE_MF_Execute(e_mf_class* i_this) { - fopEn_enemy_c* a_this = &i_this->actor; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; f32 fVar1 = 0.0f; if (i_this->field_0x728 != 0) { @@ -3064,7 +3064,7 @@ static int daE_MF_IsDelete(e_mf_class* i_this) { /* 807129A0-80712A08 008380 0068+00 1/0 0/0 0/0 .text daE_MF_Delete__FP10e_mf_class */ static int daE_MF_Delete(e_mf_class* i_this) { - fopEn_enemy_c* a_this = &i_this->actor; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; dComIfG_resDelete(&i_this->mPhase, "E_mf"); if (i_this->field_0x10b9 != 0) { @@ -3111,7 +3111,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { } } - if (i_this->field_0x694.init(a_this, &jc_data[0], model, 12) == 0) { + if (i_this->mJntCol.init(a_this, &jc_data[0], model, 12) == 0) { return 0; } From ab81262a0b0e7c7f0d0bb8f176f9b2de30f4f3bb Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Fri, 20 Jun 2025 14:17:21 -0400 Subject: [PATCH 17/21] d_a_e_dn almost equivalent, e_mf cleanup --- configure.py | 2 +- include/d/actor/d_a_e_dn.h | 61 +- include/d/actor/d_a_e_mf.h | 8 +- src/d/actor/d_a_e_dn.cpp | 2931 +++++++++++++++++++++--------------- src/d/actor/d_a_e_mf.cpp | 281 ++-- 5 files changed, 1886 insertions(+), 1397 deletions(-) diff --git a/configure.py b/configure.py index ea04f845bd9..83699d503c7 100755 --- a/configure.py +++ b/configure.py @@ -1673,7 +1673,7 @@ def MatchingFor(*versions) -> bool: ActorRel(NonMatching, "d_a_e_kr"), ActorRel(MatchingFor("GZ2E01"), "d_a_e_mb"), ActorRel(MatchingFor("GZ2E01"), "d_a_e_md"), - ActorRel(NonMatching, "d_a_e_mf"), + ActorRel(Equivalent, "d_a_e_mf"), ActorRel(NonMatching, "d_a_e_mk"), ActorRel(NonMatching, "d_a_e_mk_bo"), ActorRel(NonMatching, "d_a_e_mm"), diff --git a/include/d/actor/d_a_e_dn.h b/include/d/actor/d_a_e_dn.h index b2c07b73629..1c063d13812 100644 --- a/include/d/actor/d_a_e_dn.h +++ b/include/d/actor/d_a_e_dn.h @@ -19,33 +19,29 @@ class e_dn_class : public fopEn_enemy_c { /* 804EDE58 */ e_dn_class(); /* 0x05AC */ request_of_phase_process_class mPhase; - /* 0x05B4 */ s16 field_0x5b4; + /* 0x05B4 */ s16 mMode; /* 0x05B6 */ u8 field_0x5b6; /* 0x05B7 */ u8 field_0x5b7; /* 0x05B8 */ u8 field_0x5b8; /* 0x05B9 */ u8 field_0x5b9; - /* 0x05BA */ u8 field_0x5ba[0x5bc - 0x5ba]; /* 0x05BC */ cXyz field_0x5bc; /* 0x05C8 */ cXyz field_0x5c8; /* 0x05D4 */ s16 field_0x5d4; /* 0x05D6 */ s16 field_0x5d6; /* 0x05D8 */ s8 field_0x5d8; - /* 0x05D9 */ u8 field_0x5d9[0x5dc - 0x5d9]; /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; - /* 0x05E0 */ int field_0x5e0; - /* 0x05E4 */ J3DModel* field_0x5e4; + /* 0x05E0 */ int mAnmID; + /* 0x05E4 */ J3DModel* mpKnifeModel; /* 0x05E8 */ Z2CreatureEnemy mSound; - /* 0x068C */ J3DModel* field_0x68c; - /* 0x0690 */ J3DModel* field_0x690; + /* 0x068C */ J3DModel* mpShieldModel; + /* 0x0690 */ J3DModel* mpSkullModel; /* 0x0694 */ s8 field_0x694; - /* 0x0695 */ u8 field_0x695[3]; /* 0x0698 */ cXyz field_0x698; /* 0x06A4 */ cXyz field_0x6a4; /* 0x06B0 */ s16 field_0x6b0; /* 0x06B2 */ s16 field_0x6b2; /* 0x06B4 */ dJntCol_c mJntCol; /* 0x06C4 */ s8 field_0x6c4; - /* 0x06C5 */ u8 field_0x6c5[3]; /* 0x06C8 */ f32 field_0x6c8; /* 0x06CC */ s16 field_0x6cc; /* 0x06CE */ s16 mAction; @@ -63,36 +59,39 @@ class e_dn_class : public fopEn_enemy_c { /* 0x06F0 */ s8 field_0x6f0; /* 0x06F1 */ s8 field_0x6f1; /* 0x06F2 */ s8 field_0x6f2; - /* 0x06F3 */ u8 field_0x6f3; - /* 0x06F4 */ u8 field_0x6f4; + /* 0x06F3 */ s8 field_0x6f3; + /* 0x06F4 */ s8 field_0x6f4; /* 0x06F5 */ u8 field_0x6f5; /* 0x06F6 */ s16 field_0x6f6; /* 0x06F8 */ s16 field_0x6f8; /* 0x06FA */ s16 field_0x6fa; - /* 0x06FC */ u8 field_0x6fc[0x700 - 0x6fc]; - /* 0x0700 */ u8 field_0x700; - /* 0x0701 */ u8 field_0x701; - /* 0x0702 */ u8 field_0x702[2]; + /* 0x06FC */ s16 field_0x6fc; + /* 0x06FE */ s16 field_0x6fe; + /* 0x0700 */ s8 field_0x700; + /* 0x0701 */ s8 field_0x701; /* 0x0704 */ f32 field_0x704; /* 0x0708 */ f32 field_0x708; /* 0x070C */ s16 field_0x70c; /* 0x070E */ s16 field_0x70e; - /* 0x0710 */ u8 field_0x710; - /* 0x0711 */ u8 field_0x711[0x720 - 0x711]; + /* 0x0710 */ s8 field_0x710; + /* 0x0711 */ u8 field_0x711[15]; /* 0x0720 */ f32 field_0x720; /* 0x0724 */ csXyz field_0x724; /* 0x072A */ csXyz field_0x72a; - /* 0x0730 */ u8 field_0x730[0x737 - 0x730]; - /* 0x0737 */ u8 field_0x737; + /* 0x0730 */ csXyz field_0x730; + /* 0x0736 */ s8 field_0x736; + /* 0x0737 */ s8 field_0x737; /* 0x0738 */ cXyz field_0x738; /* 0x0744 */ int field_0x744; /* 0x0748 */ u8 field_0x748[4]; /* 0x074C */ f32 field_0x74c; /* 0x0750 */ s16 field_0x750; - /* 0x0752 */ u8 field_0x752[0x762 - 0x752]; + /* 0x0754 */ f32 field_0x754; + /* 0x0758 */ s16 field_0x758; + /* 0x075C */ f32 field_0x75c; + /* 0x0760 */ s16 field_0x760; /* 0x0762 */ csXyz field_0x762[11]; /* 0x07A4 */ csXyz field_0x7a4[11]; - /* 0x07E6 */ u8 field_0x7e6[2]; /* 0x07E8 */ f32 field_0x7e8; /* 0x07EC */ s16 field_0x7ec[2]; /* 0x07F0 */ s16 field_0x7f0; @@ -102,7 +101,7 @@ class e_dn_class : public fopEn_enemy_c { /* 0x07FA */ s16 field_0x7f8; /* 0x07FA */ s16 field_0x7fa; /* 0x07FC */ s16 field_0x7fc[3]; - /* 0x0802 */ u8 field_0x802[0x80a - 0x802]; + /* 0x0802 */ s16 field_0x802[4]; /* 0x080A */ s16 field_0x80a; /* 0x080C */ s16 field_0x80c; /* 0x080E */ csXyz field_0x80e[4]; @@ -114,13 +113,13 @@ class e_dn_class : public fopEn_enemy_c { /* 0x082F */ u8 field_0x82f; /* 0x0830 */ s16 field_0x830; /* 0x0832 */ s16 field_0x832; - /* 0x0834 */ u8 field_0x834[0x83c - 0x834]; + /* 0x0836 */ csXyz field_0x836; /* 0x083C */ f32 field_0x83c; /* 0x0840 */ s16 field_0x840; /* 0x0842 */ s16 field_0x842; /* 0x0844 */ dBgS_AcchCir mAcchCir; /* 0x0884 */ dBgS_ObjAcch mObjAcch; - /* 0x0A5C */ u8 field_0xa5c[4]; + /* 0x0A5C */ f32 field_0xa5c; /* 0x0A60 */ dCcD_Stts mStts; /* 0x0A9C */ dCcD_Sph field_0xa9c[3]; /* 0x0E44 */ dCcD_Sph field_0xe44; @@ -128,12 +127,16 @@ class e_dn_class : public fopEn_enemy_c { /* 0x10B4 */ dCcU_AtInfo mAtInfo; /* 0x10D8 */ u8 field_0x10d8; /* 0x10D9 */ u8 field_0x10d9; - /* 0x10DA */ u8 field_0x10da[0x10e4 - 0x10da]; - /* 0x10E4 */ u8 field_0x10e4; - /* 0x10E5 */ u8 field_0x10e5[0x10f8 - 0x10e5]; + /* 0x10DA */ s8 field_0x10da; + /* 0x10DB */ u8 field_0x10db; + /* 0x10DC */ u32 field_0x10dc; + /* 0x10E0 */ u32 field_0x10e0; + /* 0x10E4 */ s8 field_0x10e4; + /* 0x10E8 */ u32 field_0x10e8[2]; + /* 0x10F0 */ u32 field_0x10f0[2]; /* 0x10F8 */ u32 field_0x10f8; /* 0x10FC */ u32 field_0x10fc; - /* 0x1100 */ u8 field_0x1100[0x110c - 0x1100]; + /* 0x1100 */ u8 field_0x1100[12]; }; STATIC_ASSERT(sizeof(e_dn_class) == 0x110c); @@ -146,7 +149,7 @@ class daE_DN_HIO_c : public JORReflexible { void genMessage(JORMContext*); /* 0x04 */ s8 field_0x4; - /* 0x08 */ f32 base_size; // 基本サイズ + /* 0x08 */ f32 model_size; // 基本サイズ /* 0x0C */ f32 movement_speed; // 移動速度 /* 0x10 */ f32 dash_speed; // 突進速度 /* 0x14 */ f32 battle_init_range; // 戦闘開始範囲 diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index 5563ed95296..6ecdfc99b3e 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -30,10 +30,10 @@ class e_mf_class : public fopEn_enemy_c { /* 0x05D6 */ s16 field_0x5d6; /* 0x05D8 */ s8 field_0x5d8; /* 0x05DC */ mDoExt_McaMorfSO* mpModelMorf; - /* 0x05E0 */ int field_0x5e0; - /* 0x05E4 */ J3DModel* field_0x5e4; + /* 0x05E0 */ int mAnmID; + /* 0x05E4 */ J3DModel* mpAxeModel; /* 0x05E8 */ Z2CreatureEnemy mSound; - /* 0x068C */ J3DModel* field_0x68c; + /* 0x068C */ J3DModel* mpShieldModel; /* 0x0690 */ u8 field_0x690[4]; /* 0x0694 */ dJntCol_c mJntCol; /* 0x06A4 */ s8 field_0x6a4; @@ -144,7 +144,7 @@ class daE_MF_HIO_c : public JORReflexible { void genMessage(JORMContext*); /* 0x04 */ s8 field_0x4; - /* 0x08 */ f32 base_size; // 基本サイズ + /* 0x08 */ f32 model_size; // 基本サイズ /* 0x0C */ f32 movement_speed; // 移動速度 /* 0x10 */ f32 dash_speed; // 突進速度 /* 0x14 */ f32 battle_init_range; // 戦闘開始範囲 diff --git a/src/d/actor/d_a_e_dn.cpp b/src/d/actor/d_a_e_dn.cpp index d4e7e2395c6..73443b29744 100644 --- a/src/d/actor/d_a_e_dn.cpp +++ b/src/d/actor/d_a_e_dn.cpp @@ -5,511 +5,75 @@ #include "d/actor/d_a_e_dn.h" #include "d/d_cc_d.h" -#include "dol2asm.h" UNK_REL_DATA; #include "d/d_bomb.h" +#include "f_op/f_op_kankyo_mng.h" +#include "d/actor/d_a_player.h" +#include "d/actor/d_a_horse.h" #include "f_op/f_op_actor_enemy.h" - - -// -// Forward References: -// - -extern "C" void __ct__12daE_DN_HIO_cFv(); -extern "C" static void dn_disappear__FP10e_dn_class(); -extern "C" static void anm_init__FP10e_dn_classifUcf(); -extern "C" static void nodeCallBack__FP8J3DJointi(); -extern "C" static void daE_DN_Draw__FP10e_dn_class(); -extern "C" static void other_bg_check__FP10e_dn_classP10fopAc_ac_c(); -extern "C" static void other_bg_check2__FP10e_dn_classP4cXyz(); -extern "C" static void s_b_sub__FPvPv(); -extern "C" static void search_bomb__FP10e_dn_classi(); -extern "C" static void bomb_view_check__FP10e_dn_class(); -extern "C" static void bomb_check__FP10e_dn_class(); -extern "C" static void player_way_check__FP10e_dn_class(); -extern "C" static void pl_check__FP10e_dn_classfs(); -extern "C" static void move_gake_check__FP10e_dn_classfSc(); -extern "C" static void jump_pos_check__FP10e_dn_classP4cXyz(); -extern "C" static void e_dn_stay__FP10e_dn_class(); -extern "C" static void e_dn_otoreac__FP10e_dn_class(); -extern "C" static void e_dn_bomb_action__FP10e_dn_class(); -extern "C" static void e_dn_normal__FP10e_dn_class(); -extern "C" static void e_dn_drawback__FP10e_dn_class(); -extern "C" static void e_dn_wolfbite__FP10e_dn_class(); -extern "C" static void way_check__FP10e_dn_class(); -extern "C" static void shot_s_sub__FPvPv(); -extern "C" static void e_dn_fight_run__FP10e_dn_class(); -extern "C" static void e_dn_jump__FP10e_dn_class(); -extern "C" static void e_dn_gakejump__FP10e_dn_class(); -extern "C" static void at_hit_check__FP10e_dn_class(); -extern "C" static void e_dn_attack_0__FP10e_dn_class(); -extern "C" static void e_dn_attack__FP10e_dn_class(); -extern "C" static void tail_eff_set__FP10e_dn_class(); -extern "C" static void e_dn_tail_attack__FP10e_dn_class(); -extern "C" static void e_dn_guard__FP10e_dn_class(); -extern "C" static void e_dn_s_damage__FP10e_dn_class(); -extern "C" static void kado_check__FP10e_dn_class(); -extern "C" static void body_gake__FP10e_dn_class(); -extern "C" void __dt__14dBgS_ObjGndChkFv(); -extern "C" static void e_dn_damage__FP10e_dn_class(); -extern "C" static void e_dn_backdrop__FP10e_dn_class(); -extern "C" static void e_dn_water__FP10e_dn_class(); -extern "C" static void e_dn_reg__FP10e_dn_class(); -extern "C" static void wolfkick_damage__FP10e_dn_class(); -extern "C" static void big_damage__FP10e_dn_class(); -extern "C" static void small_damage__FP10e_dn_class(); -extern "C" static void damage_check__FP10e_dn_class(); -extern "C" static void action__FP10e_dn_class(); -extern "C" static void anm_se_set__FP10e_dn_class(); -extern "C" static void daE_DN_Execute__FP10e_dn_class(); -extern "C" static bool daE_DN_IsDelete__FP10e_dn_class(); -extern "C" static void daE_DN_Delete__FP10e_dn_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" static void daE_DN_Create__FP10fopAc_ac_c(); -extern "C" void __ct__10e_dn_classFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__8dCcD_SphFv(); -extern "C" void __ct__8dCcD_SphFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__12dBgS_AcchCirFv(); -extern "C" void __ct__5csXyzFv(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void __dt__12daE_DN_HIO_cFv(); -extern "C" void __sinit_d_a_e_dn_cpp(); -extern "C" static void func_804EE420(); -extern "C" static void func_804EE428(); -extern "C" static void func_804EE430(); -extern "C" static void func_804EE438(); -extern "C" static void func_804EE440(); -extern "C" void __dt__5csXyzFv(); -extern "C" extern char const* const d_a_e_dn__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void -__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl(); -extern "C" void setAnm__16mDoExt_McaMorfSOFP15J3DAnmTransformiffff(); -extern "C" void play__16mDoExt_McaMorfSOFUlSc(); -extern "C" void entryDL__16mDoExt_McaMorfSOFv(); -extern "C" void modelCalc__16mDoExt_McaMorfSOFv(); -extern "C" void stopZelAnime__16mDoExt_McaMorfSOFv(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAc_IsActor__FPv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorAngleX__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistanceXZ__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_getTalkEventPartner__FPC10fopAc_ac_c(); -extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc(); -extern "C" void fopAcM_otoCheck__FPC10fopAc_ac_cf(); -extern "C" void fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_wayBgCheck__FPC10fopAc_ac_cff(); -extern "C" void fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci(); -extern "C" void fopKyM_createWpillar__FPC4cXyzfi(); -extern "C" void fopKyM_createMpillar__FPC4cXyzf(); -extern "C" void fpcEx_Search__FPFPvPv_PvPv(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void -dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); -extern "C" void checkStateCarry__7dBomb_cFv(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void __ct__9dJntCol_cFv(); -extern "C" void init__9dJntCol_cFP10fopAc_ac_cPC13dJntColData_cP8J3DModeli(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void getEmitter__Q213dPa_control_c7level_cFUl(); -extern "C" void setHitMark__13dPa_control_cFUsP10fopAc_ac_cPC4cXyzPC5csXyzPC4cXyzUl(); -extern "C" void -set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void -set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void addReal__21dDlst_shadowControl_cFUlP8J3DModel(); -extern "C" void StartShock__12dVibration_cFii4cXyz(); -extern "C" void LineCross__4cBgSFP11cBgS_LinChk(); -extern "C" void GroundCross__4cBgSFP11cBgS_GndChk(); -extern "C" void GetPolyAtt0__4dBgSFRC13cBgS_PolyInfo(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void SetWall__12dBgS_AcchCirFff(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); -extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); -extern "C" void __ct__11dBgS_GndChkFv(); -extern "C" void __dt__11dBgS_GndChkFv(); -extern "C" void __ct__18dBgS_ObjGndChk_SplFv(); -extern "C" void __dt__18dBgS_ObjGndChk_SplFv(); -extern "C" void __ct__11dBgS_LinChkFv(); -extern "C" void __dt__11dBgS_LinChkFv(); -extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Move__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void __dt__12dCcD_GObjInfFv(); -extern "C" void ChkAtHit__12dCcD_GObjInfFv(); -extern "C" void GetAtHitObj__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void ChkCoHit__12dCcD_GObjInfFv(); -extern "C" void GetCoHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); -extern "C" void StartCAt__8dCcD_SphFR4cXyz(); -extern "C" void MoveCAt__8dCcD_SphFR4cXyz(); -extern "C" void cc_pl_cut_bit_get__Fv(); -extern "C" void def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c(); -extern "C" void at_power_check__FP11dCcU_AtInfo(); -extern "C" void cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void dKy_Sound_set__F4cXyziUii(); -extern "C" void dKy_Sound_get__Fv(); -extern "C" void dKy_darkworld_check__Fv(); -extern "C" void GetAc__8cCcD_ObjFv(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void cM_atan2s__Fff(); -extern "C" void cM_rndF__Ff(); -extern "C" void cM_rndFX__Ff(); -extern "C" void SetPos__11cBgS_GndChkFPC3Vec(); -extern "C" void SetPos__11cBgS_GndChkFPC4cXyz(); -extern "C" void __dt__13cBgS_PolyInfoFv(); -extern "C" void __dt__8cM3dGCirFv(); -extern "C" void SetC__8cM3dGSphFRC4cXyz(); -extern "C" void SetR__8cM3dGSphFf(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalc0__FPfff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void func_802807E0(); -extern "C" void __ct__15Z2CreatureEnemyFv(); -extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc(); -extern "C" void setLinkSearch__15Z2CreatureEnemyFb(); -extern "C" void setEnemyName__15Z2CreatureEnemyFPCc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void __construct_array(); -extern "C" void _savegpr_19(); -extern "C" void _savegpr_23(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_19(); -extern "C" void _restgpr_23(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; -extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; -extern "C" u8 mCurrentMtx__6J3DSys[48]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" u8 m_midnaActor__9daPy_py_c[4]; -extern "C" void __register_global_object(); - -/* 804EEA78-804EEAA4 -00001 002C+00 1/1 0/0 0/0 .data @4546 */ -SECTION_DATA static void* lit_4546[11] = { - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x4C), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x78), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x158), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x1AC), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x230), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x280), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x2D4), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x330), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x3BC), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x40C), - (void*)(((char*)e_dn_stay__FP10e_dn_class) + 0x3F8), -}; - -/* 804EEAA4-804EEAD4 -00001 0030+00 1/1 0/0 0/0 .data @4719 */ -SECTION_DATA static void* lit_4719[12] = { - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x98), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0xE4), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x11C), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x15C), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x1A8), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x2A0), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x4A4), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x4A4), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x4A4), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x4A4), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x310), - (void*)(((char*)e_dn_bomb_action__FP10e_dn_class) + 0x3D0), -}; - -/* 804EEAD4-804EEAF8 -00001 0024+00 1/1 0/0 0/0 .data @5544 */ -SECTION_DATA static void* lit_5544[9] = { - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0x50), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0x88), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0x1E0), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0x1E0), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0x1E0), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0xB8), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0xFC), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0x150), - (void*)(((char*)e_dn_guard__FP10e_dn_class) + 0x1A4), -}; - -/* 804EEAF8-804EEB00 0000B8 0008+00 1/1 0/0 0/0 .data kado_bit$5557 */ -SECTION_DATA static u8 kado_bit[8] = { - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, -}; - -/* 804EEB00-804EEB08 0000C0 0008+00 1/1 0/0 0/0 .data kado_check_x$5558 */ -SECTION_DATA static u8 kado_check_x[8] = { - 0x42, 0xA0, 0x00, 0x00, 0xC2, 0xA0, 0x00, 0x00, -}; - -/* 804EEB08-804EEB88 -00001 0080+00 1/1 0/0 0/0 .data @5981 */ -SECTION_DATA static void* lit_5981[32] = { - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x1B8), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x274), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x514), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x704), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x844), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x8F4), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x998), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x998), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xB00), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0x9F0), - (void*)(((char*)e_dn_damage__FP10e_dn_class) + 0xAD4), -}; - -/* 804EEB88-804EEBA0 000148 0016+02 1/1 0/0 0/0 .data j_spd$6416 */ -SECTION_DATA static u8 j_spd[22 + 2 /* padding */] = { - 0x40, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - /* padding */ - 0x00, - 0x00, -}; - -/* 804EEBA0-804EEBA8 000160 0008+00 1/1 0/0 0/0 .data foot_idx$6464 */ -SECTION_DATA static u8 foot_idx[8] = { - 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1E, -}; - -/* 804EEBA8-804EEC9C -00001 00F4+00 1/1 0/0 0/0 .data @6935 */ -SECTION_DATA static void* lit_6935[61] = { - (void*)(((char*)action__FP10e_dn_class) + 0xE4), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0xF0), - (void*)(((char*)action__FP10e_dn_class) + 0x100), - (void*)(((char*)action__FP10e_dn_class) + 0x110), - (void*)(((char*)action__FP10e_dn_class) + 0x120), - (void*)(((char*)action__FP10e_dn_class) + 0x130), - (void*)(((char*)action__FP10e_dn_class) + 0x140), - (void*)(((char*)action__FP10e_dn_class) + 0x150), - (void*)(((char*)action__FP10e_dn_class) + 0x15C), - (void*)(((char*)action__FP10e_dn_class) + 0x184), - (void*)(((char*)action__FP10e_dn_class) + 0x168), - (void*)(((char*)action__FP10e_dn_class) + 0x178), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x190), - (void*)(((char*)action__FP10e_dn_class) + 0x19C), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1A8), - (void*)(((char*)action__FP10e_dn_class) + 0x1B4), - (void*)(((char*)action__FP10e_dn_class) + 0x1C4), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1DC), - (void*)(((char*)action__FP10e_dn_class) + 0x1D4), -}; - -/* 80713CD8-80713CE4 0001D0 000C+00 1/0 0/0 0/0 .data jv_offset */ -Vec jv_offset = { 0.0f, 0.0f, 0.0f }; - -/* 80713CE4-80713D74 -00001 0090+00 1/1 0/0 0/0 .data jc_data */ -dJntColData_c jc_data[12] = { - {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, - {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, - {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, - {0, 1, 18, 10.0f, &jv_offset}, {0, 1, 23, 20.0f, &jv_offset}, - {0, 1, 24, 15.0f, &jv_offset}, {0, 1, 27, 20.0f, &jv_offset}, - {0, 1, 28, 15.0f, &jv_offset}, {0, 1, 32, 20.0f, &jv_offset}, -}; - -/* 804EEE48-804EEE54 000408 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */ -SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_AcchCirFv, -}; - -/* 804EEE54-804EEE60 000414 000C+00 2/2 0/0 0/0 .data __vt__10cCcD_GStts */ -SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10cCcD_GSttsFv, -}; - -/* 804EEE60-804EEE6C 000420 000C+00 1/1 0/0 0/0 .data __vt__10dCcD_GStts */ -SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10dCcD_GSttsFv, -}; - -/* 804EEE6C-804EEE78 00042C 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 804EEE78-804EEE84 000438 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 804EEE84-804EEEA8 000444 0024+00 2/2 0/0 0/0 .data __vt__12dBgS_ObjAcch */ -SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_ObjAcchFv, - (void*)NULL, - (void*)NULL, - (void*)func_804EE440, - (void*)NULL, - (void*)NULL, - (void*)func_804EE438, -}; - -/* 804EEEA8-804EEED8 000468 0030+00 3/3 0/0 0/0 .data __vt__14dBgS_ObjGndChk */ -SECTION_DATA extern void* __vt__14dBgS_ObjGndChk[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__14dBgS_ObjGndChkFv, - (void*)NULL, - (void*)NULL, - (void*)func_804EE420, - (void*)NULL, - (void*)NULL, - (void*)func_804EE430, - (void*)NULL, - (void*)NULL, - (void*)func_804EE428, +#include "Z2AudioLib/Z2Instances.h" + + +enum Action { + /* 0x00 */ ACTION_NORMAL = 0, + /* 0x03 */ ACTION_FIGHT_RUN = 3, + /* 0x04 */ ACTION_ATTACK_0 = 4, + /* 0x05 */ ACTION_ATTACK = 5, + /* 0x06 */ ACTION_TAIL_ATTACK = 6, + /* 0x07 */ ACTION_GUARD = 7, + /* 0x08 */ ACTION_JUMP = 8, + /* 0x09 */ ACTION_STAY = 9, + /* 0x0A */ ACTION_OTOREAC = 10, + /* 0x0B */ ACTION_BOMB_ACTION = 11, + /* 0x0C */ ACTION_DRAWBACK = 12, + /* 0x0D */ ACTION_WOLFBITE = 13, + /* 0x14 */ ACTION_S_DAMAGE = 20, + /* 0x15 */ ACTION_DAMAGE = 21, + /* 0x17 */ ACTION_BACKDROP = 23, + /* 0x18 */ ACTION_WATER = 24, + /* 0x19 */ ACTION_GAKEJUMP = 25, + /* 0x3C */ ACTION_REG = 60, }; -/* 804EEED8-804EEEE4 000498 000C+00 2/2 0/0 0/0 .data __vt__12daE_DN_HIO_c */ -SECTION_DATA extern void* __vt__12daE_DN_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12daE_DN_HIO_cFv, +enum Animation { + /* 0x04 */ ANM_ATTACK_TAIL_01 = 4, + /* 0x05 */ ANM_ATTACK_TAIL_02, + /* 0x06 */ ANM_ATTACK_TAIL_03, + /* 0x07 */ ANM_ATTACK_00, + /* 0x08 */ ANM_ATTACK_01, + /* 0x09 */ ANM_BLOWNOFF, + /* 0x0A */ ANM_BRUSH_LEFT_UP, + /* 0x0B */ ANM_BRUSH_RIGHT_UP, + /* 0x0C */ ANM_DAMAGE_W, + /* 0x0D */ ANM_DIE_LEFT, + /* 0x0E */ ANM_DIE_LEFT_UP, + /* 0x0F */ ANM_DIE_RIGHT, + /* 0x10 */ ANM_DIE_RIGHT_UP, + /* 0x11 */ ANM_DIE_W, + /* 0x12 */ ANM_DRAWBACK, + /* 0x13 */ ANM_DROWNED_A, + /* 0x14 */ ANM_DROWNED_B, + /* 0x15 */ ANM_FIND, + /* 0x16 */ ANM_GUARD, + /* 0x17 */ ANM_HANGED, + /* 0x18 */ ANM_HANGED_DAMAGE, + /* 0x19 */ ANM_HANGED_BRUSH, + /* 0x1A */ ANM_HANGED_WAIT, + /* 0x1B */ ANM_JUMP_A, + /* 0x1C */ ANM_JUMP_B, + /* 0x1D */ ANM_JUMP_C, + /* 0x1E */ ANM_RUN, + /* 0x1F */ ANM_WAIT_01, + /* 0x20 */ ANM_WAIT_02, + /* 0x21 */ ANM_WAIT_03, + /* 0x22 */ ANM_WAIT_04, + /* 0x23 */ ANM_WALK, }; /* 804E51AC-804E5220 0000EC 0074+00 1/1 0/0 0/0 .text __ct__12daE_DN_HIO_cFv */ daE_DN_HIO_c::daE_DN_HIO_c() { field_0x4 = -1; - base_size = 1.1f; + model_size = 1.1f; movement_speed = 7.5f; dash_speed = 25.0f; battle_init_range = 300.0f; @@ -541,10 +105,10 @@ static void dn_disappear(e_dn_class* i_this) { } /* 804E52D0-804E537C 000210 00AC+00 18/18 0/0 0/0 .text anm_init__FP10e_dn_classifUcf */ -static void anm_init(e_dn_class* i_this, int param_2, f32 i_morf, u8 i_attr, f32 i_rate) { - i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_dn", param_2), i_attr, i_morf, +static void anm_init(e_dn_class* i_this, int i_anmID, f32 i_morf, u8 i_attr, f32 i_rate) { + i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_dn", i_anmID), i_attr, i_morf, i_rate, 0.0f, -1.0f); - i_this->field_0x5e0 = param_2; + i_this->mAnmID = i_anmID; } /* 804E537C-804E5838 0002BC 04BC+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ @@ -659,28 +223,28 @@ static int daE_DN_Draw(e_dn_class* i_this) { } } - g_env_light.setLightTevColorType_MAJI(i_this->field_0x5e4, &a_this->tevStr); - mDoExt_modelUpdateDL(i_this->field_0x5e4); + g_env_light.setLightTevColorType_MAJI(i_this->mpKnifeModel, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->mpKnifeModel); - if (i_this->field_0x690 != NULL) { - g_env_light.setLightTevColorType_MAJI(i_this->field_0x690, &a_this->tevStr); - mDoExt_modelUpdateDL(i_this->field_0x690); + if (i_this->mpSkullModel != NULL) { + g_env_light.setLightTevColorType_MAJI(i_this->mpSkullModel, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->mpSkullModel); } - g_env_light.setLightTevColorType_MAJI(i_this->field_0x68c, &a_this->tevStr); - mDoExt_modelUpdateDL(i_this->field_0x68c); + g_env_light.setLightTevColorType_MAJI(i_this->mpShieldModel, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->mpShieldModel); cXyz sp50; sp50.set(a_this->current.pos.x, a_this->current.pos.y + 50.0f, a_this->current.pos.z); - i_this->mShadowKey = dComIfGd_setShadow(i_this->mShadowKey, 1, model, &sp50, 1150.0f, 0.0f, + i_this->mShadowKey = dComIfGd_setShadow(i_this->mShadowKey, 1, model, &sp50, 950.0f, 0.0f, a_this->current.pos.y, i_this->mObjAcch.GetGroundH(), i_this->mObjAcch.m_gnd, &a_this->tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); - dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x5e4); - if (i_this->field_0x690 != NULL) { - dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x690); + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->mpKnifeModel); + if (i_this->mpSkullModel != NULL) { + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->mpSkullModel); } - dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x68c); + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->mpShieldModel); return 1; } @@ -726,19 +290,17 @@ static BOOL other_bg_check2(e_dn_class* i_this, cXyz* param_2) { UNK_REL_BSS; -/* 804EEF2C-804EEF30 -00001 0004+00 1/2 0/0 0/0 .bss None */ -/* 804EEF2C 0001+00 data_804EEF2C @1009 */ /* 804EEF2D 0003+00 data_804EEF2D None */ -static u8 l_initHIO; +u8 l_initHIO; /* 804EEF3C-804EEF64 000054 0028+00 10/11 0/0 0/0 .bss l_HIO */ -static daE_DN_HIO_c l_HIO; +daE_DN_HIO_c l_HIO; /* 804EEF64-804EEF8C 00007C 0028+00 2/2 0/0 0/0 .bss target_info */ -static fopAc_ac_c* target_info[10]; +fopAc_ac_c* target_info[10]; /* 804EEF8C-804EEF90 0000A4 0004+00 2/2 0/0 0/0 .bss target_info_count */ -static int target_info_count; +int target_info_count; /* 804E5CD0-804E5D4C 000C10 007C+00 1/1 0/0 0/0 .text s_b_sub__FPvPv */ static void* s_b_sub(void* i_actor, void* i_data) { @@ -934,24 +496,23 @@ static BOOL jump_pos_check(e_dn_class* i_this, cXyz* param_2) { /* 804E6608-804E6A8C 001548 0484+00 2/1 0/0 0/0 .text e_dn_stay__FP10e_dn_class */ static void e_dn_stay(e_dn_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; cXyz sp30; i_this->field_0x6f4 = 5; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.1f) + 0.9f); - i_this->field_0x5b4 = 1; + anm_init(i_this, ANM_WAIT_01, 10.0f, J3DFrameCtrl::EMode_LOOP, cM_rndF(0.1f) + 0.9f); + i_this->mMode = 1; // fallthrough case 1: if (fopAcM_otoCheck(a_this, 2000.0f) || daPy_getPlayerActorClass()->checkWolfBark()) { SND_INFLUENCE* sound = dKy_Sound_get(); sp30 = sound->position - a_this->current.pos; if (cM_atan2s(sp30.y, JMAFastSqrt(sp30.x * sp30.x + sp30.z * sp30.z)) > 0x1000) { - i_this->field_0x5b4 = 5; + i_this->mMode = 5; } else { - i_this->field_0x5b4 = 2; + i_this->mMode = 2; } i_this->field_0x6e0[0] = cM_rndF(10.0f) + 10.0f; @@ -961,9 +522,9 @@ static void e_dn_stay(e_dn_class* i_this) { case 2: if (i_this->field_0x6e0[0] == 0) { - anm_init(i_this, 21, 3.0f, 0, 1.5f); + anm_init(i_this, ANM_FIND, 3.0f, J3DFrameCtrl::EMode_NONE, 1.5f); i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND, -1); - i_this->field_0x5b4 = 3; + i_this->mMode = 3; } break; @@ -971,66 +532,66 @@ static void e_dn_stay(e_dn_class* i_this) { if (i_this->mpModelMorf->isStop()) { if (other_bg_check2(i_this, &i_this->field_0x738)) { i_this->field_0x6e0[0] = cM_rndF(10.0f) + 20.0f; - i_this->field_0x5b4 = 4; + i_this->mMode = 4; } else { - i_this->mAction = 10; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_OTOREAC; + i_this->mMode = 0; } } break; case 4: if (i_this->field_0x6e0[0] == 0) { - i_this->field_0x5b4 = 10; + i_this->mMode = 10; i_this->field_0x6e0[0] = cM_rndF(10.0f) + 30.0f; - anm_init(i_this, 33, 5.0f, 2, 1.5f); + anm_init(i_this, ANM_WAIT_03, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.5f); } break; case 5: if (i_this->field_0x6e0[0] == 0) { - anm_init(i_this, 21, 3.0f, 0, 1.5f); + anm_init(i_this, ANM_FIND, 3.0f, J3DFrameCtrl::EMode_NONE, 1.5f); i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND, -1); - i_this->field_0x5b4 = 6; + i_this->mMode = 6; } break; case 6: if (i_this->mpModelMorf->isStop()) { i_this->field_0x6e0[0] = cM_rndF(10.0f) + 20.0f; - i_this->field_0x5b4 = 7; + i_this->mMode = 7; } break; case 7: if (i_this->field_0x6e0[0] == 0) { - i_this->field_0x5b4 = 10; + i_this->mMode = 10; i_this->field_0x6e0[0] = cM_rndF(40.0f) + 50.0f; - anm_init(i_this, 34, 5.0f, 2, 1.3f); + anm_init(i_this, ANM_WAIT_04, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.3f); i_this->mpModelMorf->setFrame(cM_rndF(75.0f)); } break; case 8: if (i_this->mpModelMorf->isStop()) { - i_this->field_0x5b4 = 0; + i_this->mMode = 0; } break; case 10: if (i_this->field_0x6e0[0] == 0) { - i_this->field_0x5b4 = 0; + i_this->mMode = 0; } } if ((i_this->field_0x6cc & 15) == 0) { if (pl_check(i_this, i_this->field_0x6d8, 0x4000) != 0) { - i_this->mAction = 3; - i_this->field_0x5b4 = -10; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = -10; i_this->field_0x6e0[0] = 60; } else if (bomb_view_check(i_this) != NULL) { - i_this->mAction = 11; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_BOMB_ACTION; + i_this->mMode = 0; } } } @@ -1042,16 +603,16 @@ static void e_dn_otoreac(e_dn_class* i_this) { f32 fVar1 = 0.0f; i_this->field_0x6f4 = 2; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.2f) + 1.5f); + anm_init(i_this, ANM_WAIT_01, 10.0f, J3DFrameCtrl::EMode_LOOP, cM_rndF(0.2f) + 1.5f); i_this->field_0x6e0[0] = cM_rndF(10.0f) + 20.0f; - i_this->field_0x5b4 = 1; + i_this->mMode = 1; // fallthrough case 1: if (i_this->field_0x6e0[0] == 0) { - anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); - i_this->field_0x5b4 = 2; + anm_init(i_this, ANM_RUN, 5.0f, J3DFrameCtrl::EMode_LOOP, cM_rndFX(0.05f) + 1.0f); + i_this->mMode = 2; } break; @@ -1068,10 +629,10 @@ static void e_dn_otoreac(e_dn_class* i_this) { sp40 = i_this->field_0x738 - a_this->current.pos; cLib_addCalcAngleS2(&a_this->current.angle.y, cM_atan2s(sp40.x, sp40.z), 2, 0xC00); if (sp40.abs() < 250.0f || i_this->mObjAcch.ChkWallHit() != 0) { - i_this->mAction = 0; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_NORMAL; + i_this->mMode = 0; i_this->field_0x6e0[0] = cM_rndF(50.0f) + 50.0f; - anm_init(i_this, 33, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_03, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); } break; @@ -1081,26 +642,25 @@ static void e_dn_otoreac(e_dn_class* i_this) { cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, 5.0f); if ((i_this->field_0x6cc & 15) == 0) { if (pl_check(i_this, i_this->field_0x6d8, 0x4000) != 0) { - i_this->mAction = 3; - i_this->field_0x5b4 = -10; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = -10; i_this->field_0x6e0[0] = 60; } else if (bomb_view_check(i_this) != NULL) { - i_this->mAction = 11; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_BOMB_ACTION; + i_this->mMode = 0; } } } /* 804E6DBC-804E72C8 001CFC 050C+00 2/1 0/0 0/0 .text e_dn_bomb_action__FP10e_dn_class */ static void e_dn_bomb_action(e_dn_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; s16 sVar2; cXyz sp3c, sp48; dBomb_c* bomb = bomb_check(i_this); if (bomb == NULL) { - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; return; } @@ -1109,36 +669,36 @@ static void e_dn_bomb_action(e_dn_class* i_this) { s16 sVar1 = cM_atan2s(sp3c.x, sp3c.z); f32 fVar1 = 0.0f; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 21, 3.0f, 0, 1.5f); + anm_init(i_this, ANM_FIND, 3.0f, J3DFrameCtrl::EMode_NONE, 1.5f); i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND_BOMB, -1); - i_this->field_0x5b4 = 1; + i_this->mMode = 1; break; case 1: if (i_this->mpModelMorf->isStop()) { - i_this->field_0x5b4 = 2; + i_this->mMode = 2; } break; case 2: - i_this->field_0x5b4 = 3; - anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->mMode = 3; + anm_init(i_this, ANM_WAIT_01, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); i_this->field_0x6e0[1] = cM_rndF(10.0f) + 10.0f; // fallthrough case 3: if (i_this->field_0x6e0[1] == 0 && bomb->speedF < 0.1f) { - i_this->field_0x5b4 = 4; - anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + i_this->mMode = 4; + anm_init(i_this, ANM_RUN, 5.0f, J3DFrameCtrl::EMode_LOOP, cM_rndFX(0.05f) + 1.0f); } break; case 4: - if (bomb->speedF < 0.1f && !bomb->checkStateCarry() && JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 250.0f) { + if (i_this->field_0x5b7 == 1 && bomb->speedF < 0.1f && !bomb->checkStateCarry() && JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 250.0f) { sVar2 = i_this->mYAngleToPlayer - a_this->shape_angle.y; if (sVar2 < 0x4000 && sVar2 > -0x4000) { - i_this->field_0x5b4 = 10; + i_this->mMode = 10; break; } } @@ -1146,8 +706,8 @@ static void e_dn_bomb_action(e_dn_class* i_this) { sVar1 += 0x8000; fVar1 = l_HIO.dash_speed; if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) > 600.0f) { - i_this->field_0x5b4 = 5; - anm_init(i_this, 31, 5.0f, 2, 1.0f); + i_this->mMode = 5; + anm_init(i_this, ANM_WAIT_01, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); } break; @@ -1156,7 +716,7 @@ static void e_dn_bomb_action(e_dn_class* i_this) { i_this->mSound.startCreatureSoundLevel(Z2SE_EN_DN_V_LOOK_BOMB, 0, -1); sVar1 = i_this->mYAngleToPlayer; if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 500.0f) { - i_this->field_0x5b4 = 2; + i_this->mMode = 2; } break; @@ -1165,13 +725,13 @@ static void e_dn_bomb_action(e_dn_class* i_this) { fVar1 = l_HIO.dash_speed; if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 100.0f) { i_this->field_0x6e0[0] = 20; - i_this->field_0x5b4 = 11; - anm_init(i_this, 30, 5.0f, 0, cM_rndFX(0.05f) + 1.0f); + i_this->mMode = 11; + anm_init(i_this, ANM_RUN, 5.0f, J3DFrameCtrl::EMode_NONE, cM_rndFX(0.05f) + 1.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_KICK_BOMB, -1); } if (bomb->speedF > 0.1f) { - i_this->field_0x5b4 = 2; + i_this->mMode = 2; } break; @@ -1198,8 +758,8 @@ static void e_dn_bomb_action(e_dn_class* i_this) { } if (i_this->field_0x6e0[0] == 0) { - anm_init(i_this, 31, 5.0f, 2, 1.0f); - i_this->field_0x5b4 = 5; + anm_init(i_this, ANM_WAIT_01, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + i_this->mMode = 5; } } @@ -1217,7 +777,7 @@ static void e_dn_normal(e_dn_class* i_this) { s16 sVar1 = 0x4000; s16 sVar2, sVar3; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: case 1: case 2: @@ -1240,8 +800,8 @@ static void e_dn_normal(e_dn_class* i_this) { } i_this->field_0x5d4 = a_this->current.angle.y + sVar2; - anm_init(i_this, 35, 10.0f, 2, 1.0f); - i_this->field_0x5b4 = 3; + anm_init(i_this, ANM_WALK, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + i_this->mMode = 3; i_this->field_0x6e0[0] = cM_rndF(100.0f) + 100.0f; } else { sVar1 = 0x7000; @@ -1269,9 +829,9 @@ static void e_dn_normal(e_dn_class* i_this) { if (i_this->field_0x6e0[0] == 0 || (i_this->field_0x6e0[1] == 0 && (fopAcM_wayBgCheck(a_this, 200.0f, 50.0f) || move_gake_check(i_this, 200.0f, 0)))) { - i_this->field_0x5b4 = 2; + i_this->mMode = 2; i_this->field_0x6e0[0] = cM_rndF(100.0f) + 50.0f; - anm_init(i_this, 33, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_03, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); } break; } @@ -1280,14 +840,14 @@ static void e_dn_normal(e_dn_class* i_this) { BOOL bVar1 = fopAcM_otoCheck(a_this, 2000.0f) | daPy_getPlayerActorClass()->checkWolfBark(); if ((i_this->field_0x6cc & 15) == 0 || bVar1) { if (bVar1 || pl_check(i_this, i_this->field_0x6d8, sVar1) != 0) { - i_this->mAction = 3; - i_this->field_0x5b4 = -10; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = -10; i_this->field_0x6e0[0] = 60; } if (bomb_view_check(i_this) != NULL) { - i_this->mAction = 11; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_BOMB_ACTION; + i_this->mMode = 0; } } } @@ -1297,10 +857,10 @@ static void e_dn_drawback(e_dn_class* i_this) { fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; fopAc_ac_c* player = dComIfGp_getPlayer(0); - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 18, 5.0f, 0, 1.0f); - i_this->field_0x5b4 = 1; + anm_init(i_this, ANM_DRAWBACK, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 1; a_this->speedF = -5.0f; i_this->field_0x6e8 = 10; i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DRAWBACK, -1); @@ -1313,16 +873,16 @@ static void e_dn_drawback(e_dn_class* i_this) { cLib_addCalc0(&a_this->speedF, 1.0f, 0.1f); if (i_this->mpModelMorf->isStop()) { - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_AWAKE, -1); } break; } if (move_gake_check(i_this, 50.0f, 1)) { - i_this->mAction = 23; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_BACKDROP; + i_this->mMode = 0; } } @@ -1334,38 +894,38 @@ static void e_dn_wolfbite(e_dn_class* i_this) { i_this->field_0x6e8 = 10; cLib_addCalc0(&a_this->speedF, 1.0f, 2.0f); - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 23, 3.0f, 0, 1.0f); - i_this->field_0x5b4 = 1; + anm_init(i_this, ANM_HANGED, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 1; i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DRAWBACK, -1); a_this->health -= 10; break; case 1: if (i_this->mpModelMorf->isStop()) { - anm_init(i_this, 26, 3.0f, 2, 1.0f); - i_this->field_0x5b4 = 2; + anm_init(i_this, ANM_HANGED_WAIT, 3.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + i_this->mMode = 2; } break; case 2: - if (i_this->field_0x5e0 == 24) { + if (i_this->mAnmID == ANM_HANGED_DAMAGE) { if (i_this->mpModelMorf->isStop()) { - anm_init(i_this, 26, 3.0f, 2, 1.0f); + anm_init(i_this, ANM_HANGED_WAIT, 3.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); } } if (a_this->health <= 0 || a_this->checkWolfBiteDamage()) { a_this->offWolfBiteDamage(); - anm_init(i_this, 24, 2.0f, 0, 1.0f); + anm_init(i_this, ANM_HANGED_DAMAGE, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f); a_this->health -= 10; if (a_this->health <= 0) { player->offWolfEnemyHangBite(); i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - player->shape_angle.y; i_this->field_0x74c = 150.0f; - i_this->mAction = 21; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_DAMAGE; + i_this->mMode = 0; i_this->field_0x724.y = player->shape_angle.y + 0x8000; a_this->speed.y = 0.0f; i_this->field_0x704 = -1.0f; @@ -1382,15 +942,15 @@ static void e_dn_wolfbite(e_dn_class* i_this) { } if (!player->checkWolfEnemyHangBiteOwn(a_this)) { - anm_init(i_this, 25, 3.0f, 0, 1.0f); - i_this->field_0x5b4 = 3; + anm_init(i_this, ANM_HANGED_BRUSH, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 3; } break; case 3: if (i_this->mpModelMorf->isStop()) { - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_AWAKE, -1); } } @@ -1412,7 +972,7 @@ static int way_check(e_dn_class* i_this) { } /* 804EEF90-804EEF94 0000A8 0004+00 2/2 0/0 0/0 .bss learn_check */ -static int learn_check; +int learn_check; /* 804E7B74-804E7D18 002AB4 01A4+00 1/1 0/0 0/0 .text shot_s_sub__FPvPv */ static void* shot_s_sub(void* i_actor, void* i_data) { @@ -1445,24 +1005,24 @@ static void e_dn_fight_run(e_dn_class* i_this) { i_this->field_0x6ea = 40; } - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case -10: - anm_init(i_this, 31, 5.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_01, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); i_this->field_0x6e0[1] = cM_rndF(10.0f) + 15.0f; i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_FIND, -1); - i_this->field_0x5b4 = -9; + i_this->mMode = -9; break; case -9: cLib_addCalc0(&a_this->speedF, 1.0f, 5.0f); if (i_this->field_0x6e0[1] == 0) { - i_this->field_0x5b4 = 0; + i_this->mMode = 0; } break; case 0: - anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); - i_this->field_0x5b4 = 1; + anm_init(i_this, ANM_RUN, 5.0f, J3DFrameCtrl::EMode_LOOP, cM_rndFX(0.05f) + 1.0f); + i_this->mMode = 1; i_this->field_0x82c = 0; // fallthrough case 1: @@ -1478,20 +1038,20 @@ static void e_dn_fight_run(e_dn_class* i_this) { if (i_this->mObjAcch.ChkWallHit() != 0 && !fopAcM_wayBgCheck(a_this, 200.0f, 120.0f)) { i_this->field_0x82c++; } else if (i_this->mPlayerDistance < l_HIO.battle_init_range) { - anm_init(i_this, 32, 5.0f, 2, 1.0f); - i_this->field_0x5b4 = 2; + anm_init(i_this, ANM_WAIT_02, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + i_this->mMode = 2; i_this->field_0x6e0[2] = cM_rndF(30.0f) + 30.0f; } if (i_this->field_0x82c > 20) { - i_this->mAction = 8; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_JUMP; + i_this->mMode = 0; return; } if (move_gake_check(i_this, 50.0f, 0)) { - i_this->mAction = 25; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_GAKEJUMP; + i_this->mMode = 0; i_this->field_0x6e8 = 100; a_this->speedF = 0.0f; return; @@ -1503,7 +1063,7 @@ static void e_dn_fight_run(e_dn_class* i_this) { if (frame == 7 || frame == 21) { a_this->speed.y = 10.0f; if (i_this->mPlayerDistance > (l_HIO.battle_init_range + 250.0f)) { - i_this->field_0x5b4 = 0; + i_this->mMode = 0; a_this->current.angle.y = a_this->shape_angle.y; break; } @@ -1535,7 +1095,7 @@ static void e_dn_fight_run(e_dn_class* i_this) { } s16 sVar1; - if (i_this->field_0x5b4 >= 0) { + if (i_this->mMode >= 0) { if (i_this->field_0x82e == 0) { sVar1 = a_this->current.angle.y; cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); @@ -1570,10 +1130,10 @@ static void e_dn_fight_run(e_dn_class* i_this) { if (sVar4 == 0) { if (i_this->field_0x6ea == 0) { - i_this->mAction = 0; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_NORMAL; + i_this->mMode = 0; i_this->field_0x6e0[0] = cM_rndF(50.0f) + 50.0f; - anm_init(i_this, 33, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_03, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); if (i_this->field_0x82e == 0) { return; @@ -1588,11 +1148,11 @@ static void e_dn_fight_run(e_dn_class* i_this) { if ((sVar3 != 0 || (i_this->mPlayerDistance < l_HIO.battle_init_range && (i_this->field_0x744 & cc_pl_cut_bit_get()) != 0 && ((daPy_getPlayerActorClass()->getCutAtFlg() != 0 || daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_JUMP) || (i_this->field_0x744 & 0x400) != 0))) && i_this->field_0x74c < 1.0f) { - i_this->mAction = 7; + i_this->mAction = ACTION_GUARD; if (cc_pl_cut_bit_get() == 0x100) { - i_this->field_0x5b4 = 0; + i_this->mMode = 0; } else { - i_this->field_0x5b4 = 5; + i_this->mMode = 5; } i_this->field_0x708 = 30.0f; @@ -1606,15 +1166,15 @@ static void e_dn_fight_run(e_dn_class* i_this) { if (cM_rndF(1.0f) < 1.0f) { if (way_check(i_this) == 0 && cM_rndF(1.0f) < 0.75f) { if (i_this->mPlayerDistance < l_HIO.attack_init_range - 100.0f) { - i_this->mAction = 4; + i_this->mAction = ACTION_ATTACK_0; } else { - i_this->mAction = 5; + i_this->mAction = ACTION_ATTACK; } - i_this->field_0x5b4 = 0; + i_this->mMode = 0; } else { - i_this->mAction = 6; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_TAIL_ATTACK; + i_this->mMode = 0; } } } @@ -1626,8 +1186,8 @@ static void e_dn_fight_run(e_dn_class* i_this) { i_this->field_0x6f4 = 1; if ((i_this->field_0x6cc & 15) == 0 && bomb_view_check(i_this) != NULL) { - i_this->mAction = 11; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_BOMB_ACTION; + i_this->mMode = 0; } if (i_this->field_0x5b7 == 1 && move_gake_check(i_this, 150.0f, 1) && (i_this->field_0x6cc & 15) == 0 && cM_rndF(1.0f) < 0.5f) { @@ -1638,11 +1198,11 @@ static void e_dn_fight_run(e_dn_class* i_this) { if (move_gake_check(i_this, 50.0f, 1)) { if (i_this->field_0x5b7 == 1) { if (cM_rndF(1.0f) < 0.5f) { - i_this->mAction = 6; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_TAIL_ATTACK; + i_this->mMode = 0; } else { - i_this->mAction = 25; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_GAKEJUMP; + i_this->mMode = 0; i_this->field_0x5c8 = a_this->current.pos; i_this->field_0x5bc = a_this->current.pos; i_this->field_0x6e8 = 100; @@ -1650,8 +1210,8 @@ static void e_dn_fight_run(e_dn_class* i_this) { a_this->speedF = 0.0f; } else { - i_this->mAction = 23; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_BACKDROP; + i_this->mMode = 0; } } @@ -1665,10 +1225,10 @@ static void e_dn_jump(e_dn_class* i_this) { fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; i_this->field_0x6f4 = 1; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 27, 3.0f, 0, 1.0f); - i_this->field_0x5b4 = 1; + anm_init(i_this, ANM_JUMP_A, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 1; return; case 1: @@ -1677,15 +1237,15 @@ static void e_dn_jump(e_dn_class* i_this) { } a_this->speed.y = 50.0f; - i_this->field_0x5b4 = 2; + i_this->mMode = 2; i_this->field_0x10e4 = 3; i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_JUMP, -1); // fallthrough case 2: a_this->speedF = 30.0f; if (a_this->speed.y <= 0.0f) { - anm_init(i_this, 28, 5.0f, 0, 1.0f); - i_this->field_0x5b4 = 3; + anm_init(i_this, ANM_JUMP_B, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 3; } return; @@ -1694,8 +1254,8 @@ static void e_dn_jump(e_dn_class* i_this) { return; } - anm_init(i_this, 29, 1.0f, 0, 1.0f); - i_this->field_0x5b4 = 4; + anm_init(i_this, ANM_JUMP_C, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 4; i_this->field_0x10e4 = 3; i_this->field_0x6e0[0] = 3; i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_R, 0, -1); @@ -1711,8 +1271,8 @@ static void e_dn_jump(e_dn_class* i_this) { return; } - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; return; } } @@ -1723,19 +1283,19 @@ static void e_dn_gakejump(e_dn_class* i_this) { cXyz sp24, sp30; i_this->field_0x6f4 = 1; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: if (jump_pos_check(i_this, &i_this->field_0x5bc)) { - anm_init(i_this, 27, 3.0f, 0, 1.0f); - i_this->field_0x5b4 = 2; + anm_init(i_this, ANM_JUMP_A, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 2; a_this->current.angle.y = i_this->mYAngleToPlayer; return; } - if (i_this->field_0x5e0 != 31) { - anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + if (i_this->mAnmID != ANM_WAIT_01) { + anm_init(i_this, ANM_WAIT_01, 5.0f, J3DFrameCtrl::EMode_LOOP, cM_rndF(0.1f) + 0.9f); i_this->field_0x6e0[0] = cM_rndF(15.0f) + 35.0f; - i_this->field_0x5b4 = 1; + i_this->mMode = 1; } cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 4, 0x800); @@ -1754,7 +1314,7 @@ static void e_dn_gakejump(e_dn_class* i_this) { return; } - i_this->field_0x5b4 = 0; + i_this->mMode = 0; return; case 2: @@ -1763,16 +1323,16 @@ static void e_dn_gakejump(e_dn_class* i_this) { } if (jump_pos_check(i_this, &i_this->field_0x5bc)) { - i_this->field_0x5b4 = 3; + i_this->mMode = 3; i_this->field_0x10e4 = 3; i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_JUMP, -1); i_this->field_0x6e0[0] = 20; i_this->field_0x6e0[1] = 60; i_this->field_0x5c8 = a_this->current.pos; } else { - anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + anm_init(i_this, ANM_WAIT_01, 5.0f, J3DFrameCtrl::EMode_LOOP, cM_rndF(0.1f) + 0.9f); i_this->field_0x6e0[0] = cM_rndF(15.0f) + 35.0f; - i_this->field_0x5b4 = 1; + i_this->mMode = 1; return; } // fallthrough @@ -1784,13 +1344,13 @@ static void e_dn_gakejump(e_dn_class* i_this) { a_this->speedF = 50.0f; if (i_this->field_0x6e0[0] == 1) { - anm_init(i_this, 28, 5.0f, 0, 1.0f); + anm_init(i_this, ANM_JUMP_B, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f); } if (sp24.abs() < (a_this->speedF * 1.1f)) { a_this->current.pos = i_this->field_0x5bc; - anm_init(i_this, 29, 1.0f, 0, 1.0f); - i_this->field_0x5b4 = 4; + anm_init(i_this, ANM_JUMP_C, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 4; i_this->field_0x10e4 = 3; i_this->field_0x6e0[0] = 3; i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_R, 0, -1); @@ -1799,8 +1359,8 @@ static void e_dn_gakejump(e_dn_class* i_this) { } if (i_this->field_0x6e0[1] == 0 || i_this->mObjAcch.ChkWallHit() != 0) { - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; } return; @@ -1813,15 +1373,15 @@ static void e_dn_gakejump(e_dn_class* i_this) { return; } - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; return; } } /* 804E8D78-804E8DD8 003CB8 0060+00 2/2 0/0 0/0 .text at_hit_check__FP10e_dn_class */ static fopAc_ac_c* at_hit_check(e_dn_class* i_this) { - if (i_this->field_0x5b4 >= 10) { + if (i_this->mMode >= 10) { return NULL; } @@ -1834,8 +1394,37 @@ static fopAc_ac_c* at_hit_check(e_dn_class* i_this) { /* 804E8DD8-804E8F78 003D18 01A0+00 1/1 0/0 0/0 .text e_dn_attack_0__FP10e_dn_class */ static void e_dn_attack_0(e_dn_class* i_this) { - // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp2c, sp38; + int frame = i_this->mpModelMorf->getFrame(); + + i_this->field_0x6f4 = 1; + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_ATTACK_TAIL_01, 6.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_KNIFE, -1); + i_this->mMode = 1; + // fallthrough + case 1: + if (frame >= 22 && frame <= 28) { + i_this->field_0x6ef = 1; + i_this->field_0x6ee = 0; + } + + if (i_this->mpModelMorf->isStop()) { + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; + } + } + + cLib_addCalc0(&a_this->speedF, 1.0f, 5.0f); + if (i_this->field_0x6ef != 0) { + fopAc_ac_c* actor_p = at_hit_check(i_this); + if (actor_p != NULL && fopAcM_GetName(actor_p) == PROC_ALINK && daPy_getPlayerActorClass()->checkPlayerGuard()) { + dComIfGp_getVibration().StartShock(3, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + } } /* 804E8F78-804E91D4 003EB8 025C+00 1/1 0/0 0/0 .text e_dn_attack__FP10e_dn_class */ @@ -1846,11 +1435,11 @@ static void e_dn_attack(e_dn_class* i_this) { i_this->field_0x6f4 = 1; s16 sVar1, sVar2; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 5, 6.0f, 0, 1.0f); + anm_init(i_this, ANM_ATTACK_TAIL_02, 6.0f, J3DFrameCtrl::EMode_NONE, 1.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_KNIFE2_A, -1); - i_this->field_0x5b4 = 1; + i_this->mMode = 1; // fallthrough case 1: if (frame < 10 || (frame >= 25 && frame <= 30)) { @@ -1883,8 +1472,8 @@ static void e_dn_attack(e_dn_class* i_this) { } if (i_this->mpModelMorf->isStop()) { - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; } } @@ -1893,8 +1482,8 @@ static void e_dn_attack(e_dn_class* i_this) { fopAc_ac_c* actor_p = at_hit_check(i_this); if (actor_p != NULL && fopAcM_GetName(actor_p) == PROC_ALINK && daPy_getPlayerActorClass()->checkPlayerGuard()) { i_this->mpModelMorf->setPlaySpeed(0.0f); - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; } } } @@ -1926,10 +1515,10 @@ static void e_dn_tail_attack(e_dn_class* i_this) { int frame = i_this->mpModelMorf->getFrame(); i_this->field_0x6f4 = 1; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 8, 5.0f, 0, 1.0f); - i_this->field_0x5b4 = 1; + anm_init(i_this, ANM_ATTACK_01, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 1; break; case 1: @@ -1955,8 +1544,8 @@ static void e_dn_tail_attack(e_dn_class* i_this) { } if (i_this->mpModelMorf->isStop()) { - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; } } @@ -1968,16 +1557,15 @@ static void e_dn_tail_attack(e_dn_class* i_this) { /* 804E9544-804E973C 004484 01F8+00 2/1 0/0 0/0 .text e_dn_guard__FP10e_dn_class */ static void e_dn_guard(e_dn_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; i_this->field_0x6f1 = 1; i_this->field_0x6f4 = 1; - switch (i_this->field_0x5b4) { + switch (i_this->mMode) { case 0: - anm_init(i_this, 32, 3.0f, 0, 1.0f); - i_this->field_0x5b4 = 1; + anm_init(i_this, ANM_WAIT_02, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 1; a_this->speed.y = 20.0f; a_this->speedF = -8.0f; i_this->field_0x10e4 = 3; @@ -1986,15 +1574,15 @@ static void e_dn_guard(e_dn_class* i_this) { case 1: i_this->field_0x6e8 = 5; if (i_this->mpModelMorf->getFrame() >= 5.0f) { - i_this->field_0x5b4 = 5; + i_this->mMode = 5; i_this->field_0x6e0[0] = 20; } break; case 5: - anm_init(i_this, 22, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_GUARD, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_GUARD, -1); - i_this->field_0x5b4 = 6; + i_this->mMode = 6; // fallthrough case 6: i_this->field_0x6e8 = 5; @@ -2004,7 +1592,7 @@ static void e_dn_guard(e_dn_class* i_this) { if (i_this->mpModelMorf->getFrame() >= 8.0f) { i_this->mpModelMorf->setPlaySpeed(0.0f); - i_this->field_0x5b4 = 7; + i_this->mMode = 7; a_this->speedF = 0.0f; } break; @@ -2016,317 +1604,1434 @@ static void e_dn_guard(e_dn_class* i_this) { } if (i_this->field_0x6e0[0] == 0) { - i_this->field_0x5b4 = 8; + i_this->mMode = 8; i_this->mpModelMorf->setPlaySpeed(1.0f); } break; case 8: if (i_this->mpModelMorf->isStop()) { - i_this->mAction = 3; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; } } } /* 804E973C-804E97EC 00467C 00B0+00 1/1 0/0 0/0 .text e_dn_s_damage__FP10e_dn_class */ static void e_dn_s_damage(e_dn_class* i_this) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 804EE998-804EE99C 0000EC 0004+00 0/0 0/0 0/0 .rodata @5543 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5543 = 8.0f; -COMPILER_STRIP_GATE(0x804EE998, &lit_5543); -#pragma pop - -/* 804EE99C-804EE9A0 0000F0 0004+00 0/2 0/0 0/0 .rodata @5592 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5592 = 70.0f; -COMPILER_STRIP_GATE(0x804EE99C, &lit_5592); -#pragma pop - -/* 804EE9A0-804EE9A4 0000F4 0004+00 0/1 0/0 0/0 .rodata @5593 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5593 = -150.0f; -COMPILER_STRIP_GATE(0x804EE9A0, &lit_5593); -#pragma pop - -/* 804E97EC-804E99A0 00472C 01B4+00 1/1 0/0 0/0 .text kado_check__FP10e_dn_class */ -static void kado_check(e_dn_class* i_this) { - // NONMATCHING -} - -/* 804E99A0-804E9AF0 0048E0 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_dn_class */ -static void body_gake(e_dn_class* i_this) { - // NONMATCHING -} + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; -/* 804E9AF0-804E9B68 004A30 0078+00 4/3 0/0 0/0 .text __dt__14dBgS_ObjGndChkFv */ -// dBgS_ObjGndChk::~dBgS_ObjGndChk() { -extern "C" void __dt__14dBgS_ObjGndChkFv() { - // NONMATCHING -} + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + i_this->field_0x6e0[0] = 20; + anm_init(i_this, ANM_WAIT_01, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + break; -/* ############################################################################################## */ -/* 804EE9A4-804EE9A8 0000F8 0004+00 0/1 0/0 0/0 .rodata @5977 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5977 = 8000.0f; -COMPILER_STRIP_GATE(0x804EE9A4, &lit_5977); -#pragma pop + case 1: + if (i_this->field_0x6e0[0] == 0) { + i_this->mAction = ACTION_FIGHT_RUN; + i_this->mMode = 0; + i_this->field_0x6e0[0] = 40; + } + } -/* 804E9B68-804EA700 004AA8 0B98+00 2/1 0/0 0/0 .text e_dn_damage__FP10e_dn_class */ -static void e_dn_damage(e_dn_class* i_this) { - // NONMATCHING + cLib_addCalc0(&a_this->speedF, 1.0f, 3.0f); } -/* ############################################################################################## */ -/* 804EE9A8-804EE9AC 0000FC 0004+00 0/1 0/0 0/0 .rodata @5978 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5978 = -100.0f; -COMPILER_STRIP_GATE(0x804EE9A8, &lit_5978); -#pragma pop - -/* 804EE9AC-804EE9B0 000100 0004+00 0/0 0/0 0/0 .rodata @5979 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5979 = 9.0f / 5.0f; -COMPILER_STRIP_GATE(0x804EE9AC, &lit_5979); -#pragma pop - -/* 804EE9B0-804EE9B4 000104 0004+00 0/3 0/0 0/0 .rodata @5980 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5980 = -20.0f; -COMPILER_STRIP_GATE(0x804EE9B0, &lit_5980); -#pragma pop - -/* 804EE9B4-804EE9B8 000108 0004+00 0/1 0/0 0/0 .rodata @6004 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6004 = -3.0f; -COMPILER_STRIP_GATE(0x804EE9B4, &lit_6004); -#pragma pop - -/* 804EE9B8-804EE9BC 00010C 0004+00 0/1 0/0 0/0 .rodata @6005 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6005 = -6.0f; -COMPILER_STRIP_GATE(0x804EE9B8, &lit_6005); -#pragma pop +/* 804E97EC-804E99A0 00472C 01B4+00 1/1 0/0 0/0 .text kado_check__FP10e_dn_class */ +static BOOL kado_check(e_dn_class* i_this) { + static int kado_bit[2] = { + 1, 2, + }; -/* 804EA700-804EA854 005640 0154+00 1/1 0/0 0/0 .text e_dn_backdrop__FP10e_dn_class */ -static void e_dn_backdrop(e_dn_class* i_this) { - // NONMATCHING -} + static f32 kado_check_x[2] = { + 80.0f, -80.0f, + }; -/* 804EA854-804EA9F4 005794 01A0+00 1/1 0/0 0/0 .text e_dn_water__FP10e_dn_class */ -static void e_dn_water(e_dn_class* i_this) { - // NONMATCHING -} + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + dBgS_LinChk lin_chk; + cXyz sp9c, spa8, spb4; + BOOL rv = FALSE; + + cMtx_YrotS(*calc_mtx, i_this->field_0x724.y); + for (int i = 0; i < 2; i++) { + spa8 = a_this->current.pos; + spa8.y += 100.0f; + sp9c.x = 0.0f; + sp9c.y = 0.0f; + sp9c.z = 70.0f; + MtxPosition(&sp9c, &spb4); + spa8 += spb4; + sp9c.y = 50.0f; + sp9c.z = -150.0f; + sp9c.x = 1.0f * kado_check_x[i]; + MtxPosition(&sp9c, &spb4); + spb4 += spa8; + lin_chk.Set(&spa8, &spb4, a_this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + rv |= kado_bit[i]; + } + } -/* ############################################################################################## */ -/* 804EE9BC-804EE9C0 000110 0004+00 0/1 0/0 0/0 .rodata @6097 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6097 = -8613.0f; -COMPILER_STRIP_GATE(0x804EE9BC, &lit_6097); -#pragma pop - -/* 804EE9C0-804EE9C4 000114 0004+00 0/1 0/0 0/0 .rodata @6098 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6098 = 8017.0f; -COMPILER_STRIP_GATE(0x804EE9C0, &lit_6098); -#pragma pop - -/* 804EE9C4-804EE9C8 000118 0004+00 0/1 0/0 0/0 .rodata @6099 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6099 = -8044.0f; -COMPILER_STRIP_GATE(0x804EE9C4, &lit_6099); -#pragma pop - -/* 804EE9C8-804EE9CC 00011C 0004+00 0/1 0/0 0/0 .rodata @6100 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6100 = 8616.0f; -COMPILER_STRIP_GATE(0x804EE9C8, &lit_6100); -#pragma pop - -/* 804EE9CC-804EE9D0 000120 0004+00 0/2 0/0 0/0 .rodata @6101 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6101 = 3000.0f; -COMPILER_STRIP_GATE(0x804EE9CC, &lit_6101); -#pragma pop - -/* 804EE9D0-804EE9D4 000124 0004+00 0/2 0/0 0/0 .rodata @6102 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6102 = 800.0f; -COMPILER_STRIP_GATE(0x804EE9D0, &lit_6102); -#pragma pop + if (rv == 3) { + rv = FALSE; + } -/* 804EA9F4-804EAD1C 005934 0328+00 1/1 0/0 0/0 .text e_dn_reg__FP10e_dn_class */ -static void e_dn_reg(e_dn_class* i_this) { - // NONMATCHING + return rv; } -/* 804EAD1C-804EADD4 005C5C 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_dn_class */ -static void wolfkick_damage(e_dn_class* i_this) { - // NONMATCHING -} +/* 804E99A0-804E9AF0 0048E0 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_dn_class */ +static BOOL body_gake(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + J3DModel* model = i_this->mpModelMorf->getModel(); + cXyz sp7c, sp88; -/* ############################################################################################## */ -/* 804EE9D4-804EE9D8 000128 0004+00 0/1 0/0 0/0 .rodata @6120 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6120 = 700.0f; -COMPILER_STRIP_GATE(0x804EE9D4, &lit_6120); -#pragma pop + MTXCopy(model->getAnmMtx(2), *calc_mtx); + sp7c.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp7c, &sp88); -/* 804EADD4-804EAEE4 005D14 0110+00 1/1 0/0 0/0 .text big_damage__FP10e_dn_class */ -static void big_damage(e_dn_class* i_this) { - // NONMATCHING -} + dBgS_ObjGndChk gnd_chk; + sp88.y += 100.0f; + gnd_chk.SetPos(&sp88); + sp88.y = dComIfG_Bgsp().GroundCross(&gnd_chk); -/* 804EAEE4-804EAF94 005E24 00B0+00 1/1 0/0 0/0 .text small_damage__FP10e_dn_class */ -static void small_damage(e_dn_class* i_this) { - // NONMATCHING -} + if ((a_this->current.pos.y - sp88.y) > 300.0f) { + return TRUE; + } -/* 804EAF94-804EB344 005ED4 03B0+00 1/1 0/0 0/0 .text damage_check__FP10e_dn_class */ -static void damage_check(e_dn_class* i_this) { - // NONMATCHING + return FALSE; } -/* 804EB344-804EC854 006284 1510+00 2/1 0/0 0/0 .text action__FP10e_dn_class */ -static void action(e_dn_class* i_this) { - // NONMATCHING -} +/* 804E9B68-804EA700 004AA8 0B98+00 2/1 0/0 0/0 .text e_dn_damage__FP10e_dn_class */ +static void e_dn_damage(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp34, sp40; -/* 804EC854-804ECB50 007794 02FC+00 1/1 0/0 0/0 .text anm_se_set__FP10e_dn_class */ -static void anm_se_set(e_dn_class* i_this) { - // NONMATCHING -} + if (a_this->health <= 0) { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } -/* 804EEF94-804EEF98 0000AC 0004+00 1/2 0/0 0/0 .bss c_start */ -static int c_start; + if (daPy_py_c::checkNowWolf() != 0) { + if (i_this->field_0x6f3 == 0 && a_this->checkWolfDownStartFlg()) { + if (i_this->field_0x6e0[0] > 40) { + i_this->field_0x6e0[0] = 90; + OS_REPORT(" DN WOLFHIT LONG \n"); + } else if (i_this->field_0x6e0[0] > 20) { + i_this->field_0x6e0[0] = 70; + OS_REPORT(" DN WOLFHIT MID \n"); + } else { + i_this->field_0x6e0[0] = 50; + OS_REPORT(" DN WOLFHIT SHORT \n"); + } -/* 804ECB50-804ED83C 007A90 0CEC+00 2/1 0/0 0/0 .text daE_DN_Execute__FP10e_dn_class */ -static int daE_DN_Execute(e_dn_class* i_this) { - // NONMATCHING - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; - f32 fVar1 = 0.0f; - - if (i_this->field_0x10d8 != 0) { - return 1; - } + i_this->mMode = 30; + i_this->field_0x6f3 = 1; - if (c_start == 0 && dComIfGp_event_runCheck() && - (fopAcM_getTalkEventPartner((fopAc_ac_c*)daPy_getLinkPlayerActorClass()) == daPy_py_c::getMidnaActor() || daPy_getPlayerActorClass()->eventInfo.checkCommandDoor())) { - return 1; - } + if (i_this->field_0x5b7 == 1) { + i_this->field_0x6e0[1] = l_HIO.field_0x20 + 1; + } else { + i_this->field_0x6e0[1] = l_HIO.field_0x1e + 1; + } - cXyz sp2c; - cXyz sp38; - cXyz sp44; - i_this->field_0x6cc++; - for (int i = 0; i < 4; i++) { - if (i_this->field_0x6e0[i] != 0) { - i_this->field_0x6e0[i]--; } + } else if (i_this != NULL && a_this->checkCutDownHitFlg()) { + a_this->offCutDownHitFlg(); + i_this->mMode = 3; + a_this->health = 0; + i_this->field_0x6e0[0] = 100; + i_this->field_0x6e0[1] = 46; + a_this->offDownFlg(); + a_this->health = 0; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DEATH, -1); + i_this->field_0x6c4 = 1; + daPy_getPlayerActorClass()->onEnemyDead(); + i_this->field_0x80c = 15; } - if (i_this->field_0x6e8 != 0) { - i_this->field_0x6e8--; - } + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_BLOWNOFF, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + i_this->mMode = 1; + a_this->speedF = 0.0f; + i_this->field_0x7e8 = 8000.0f; - if (i_this->field_0x6ec != 0) { - i_this->field_0x6ec--; - } + if (a_this->health <= 0) { + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DEATH, -1); + i_this->field_0x6c4 = 1; + daPy_getPlayerActorClass()->onEnemyDead(); + } else { + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DAMAGE2, -1); + } - if (i_this->field_0x840 != 0) { - i_this->field_0x840--; - } + i_this->field_0x6e0[0] = 0; + break; - if (i_this->field_0x6ea != 0) { - i_this->field_0x6ea--; - } + case 1: + if (i_this->mObjAcch.ChkWallHit() != 0 && i_this->field_0x6e0[0] == 0) { + int iVar1 = kado_check(i_this); + if (iVar1 != 0) { + OS_REPORT(" ..KADO KABE ..%x\n", iVar1); + if (iVar1 == 2) { + i_this->field_0x70e = 0xC00; + i_this->field_0x724.y += -7000; + } else { + i_this->field_0x70e = -0xC00; + i_this->field_0x724.y += 7000; + } - i_this->field_0x6f2 = 1; - action(i_this); + i_this->field_0x7e8 = 8000.0f; + i_this->field_0x754 = 100.0f; + i_this->field_0x75c = 100.0f; + i_this->field_0x828 = 40; + i_this->field_0x6e0[0] = 60; + } else { + i_this->mMode = 10; + a_this->speed.y = 0.0f; + i_this->field_0x704 *= 0.2f; + i_this->field_0x724.y += 0x8000; + i_this->field_0x7e8 = 8000.0f; + i_this->field_0x840 = 5; + i_this->field_0x754 = 100.0f; + i_this->field_0x75c = 100.0f; + i_this->field_0x828 = 40; + i_this->field_0x70e = 0; + } + } else { + cLib_addCalcAngleS2(&i_this->field_0x724.x, -0x4000, 1, 0x300); + a_this->current.angle.y += i_this->field_0x70e; + a_this->shape_angle.y = a_this->current.angle.y; + + if (i_this->field_0x724.x <= -0x3000 && i_this->mObjAcch.ChkGroundHit()) { + i_this->mMode = 2; + i_this->field_0x736 = 10; + i_this->mSound.startCreatureSound(Z2SE_CM_BODYFALL_M, 0, -1); + + if (i_this->field_0x737 == 0) { + anm_init(i_this, ANM_DIE_LEFT, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } else { + anm_init(i_this, ANM_DIE_RIGHT, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } - if (i_this->field_0x840 == 0 && i_this->field_0x5d8 == 0) { - if (i_this->field_0x704 != fVar1) { - cMtx_YrotS(*calc_mtx, i_this->field_0x724.y); - sp2c.x = 0.0f; - sp2c.y = 0.0f; - sp2c.z = i_this->field_0x83c; - MtxPosition(&sp2c, &sp38); - a_this->current.pos += sp38; - a_this->old.pos += sp38; - cLib_addCalc2(&i_this->field_0x83c, i_this->field_0x704 * 2.0f, 1.0f, 5.0f); - } else { - cLib_addCalc0(&i_this->field_0x83c, 1.0f, 5.0f); - } + if (i_this->field_0x710 != 0) { + i_this->field_0x704 = 0.0f; + i_this->field_0x7e8 = 2000.0f; + } else { + if (i_this->field_0x737 == 0) { + i_this->field_0x754 = -100.0f; + i_this->field_0x75c = -100.0f; + } else { + i_this->field_0x754 = 100.0f; + i_this->field_0x75c = 100.0f; + } - i_this->mObjAcch.CrrPos(dComIfG_Bgsp()); - if (i_this->field_0x704 != fVar1) { - a_this->current.pos -= sp38; - a_this->old.pos -= sp38; - } + i_this->field_0x758 = -0x5000; + i_this->field_0x760 = -0x4000; + i_this->field_0x828 = 40; + i_this->field_0x704 *= 0.5f; + a_this->speed.y = 20.0f; + i_this->field_0x70e /= 2; + a_this->current.angle.y = i_this->field_0x724.y; + i_this->field_0x7e8 = 8000.0f; + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp34.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp34, &sp40); - if (!i_this->mObjAcch.ChkGroundHit()) { - if (a_this->speed.y < -10.0f) { - i_this->field_0x842++; - if (i_this->field_0x842 == 13) { - i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DEATH, -1); + fopAcM_effSmokeSet1(&i_this->field_0x10dc, &i_this->field_0x10e0, &sp40, NULL, 1.8f, &a_this->tevStr, 1); + } } } - } else { - if (i_this->field_0x842 >= 13) { - i_this->mAction = 21; - i_this->field_0x5b4 = 0; - a_this->speed.y = 0.0f; - i_this->field_0x704 = -1.0; - i_this->field_0x724.x = -0x3000; - i_this->field_0x828 = 50; - i_this->field_0x6e8 = 1000; - a_this->health = 0; - } + break; - i_this->field_0x842 = 0; - } - } + case 2: + a_this->current.angle.y += i_this->field_0x70e; + a_this->shape_angle.y = a_this->current.angle.y; + cLib_addCalcAngleS2(&i_this->field_0x724.x, -0x4000, 1, 0x300); - mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y + i_this->field_0x720, a_this->current.pos.z); - mDoMtx_stack_c::XrotM(i_this->field_0x72a.x); - mDoMtx_stack_c::ZrotM(i_this->field_0x72a.z); - mDoMtx_stack_c::YrotM(i_this->field_0x724.y); - mDoMtx_stack_c::XrotM(i_this->field_0x724.x); - mDoMtx_stack_c::YrotM(-i_this->field_0x724.y); - mDoMtx_stack_c::YrotM(a_this->shape_angle.y); - mDoMtx_stack_c::XrotM(a_this->shape_angle.x); - mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); - mDoMtx_stack_c::scaleM(l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x); + if (i_this->mObjAcch.ChkGroundHit()) { + if (a_this->health > 0 && daPy_py_c::checkNowWolf() == 0) { + a_this->onDownFlg(); + } - J3DModel* model = i_this->mpModelMorf->getModel(); - model->setBaseTRMtx(mDoMtx_stack_c::get()); - i_this->mpModelMorf->play(0, 0); - anm_se_set(i_this); - i_this->mpModelMorf->modelCalc(); - MTXCopy(model->getAnmMtx(2), *calc_mtx); + dKy_Sound_set(a_this->current.pos, 100, fopAcM_GetID(a_this), 5); + i_this->field_0x736 = 10; - sp2c.set(0.0f, 0.0f, 0.0f); + if (i_this->field_0x737 == 0) { + anm_init(i_this, ANM_DIE_LEFT, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } else { + anm_init(i_this, ANM_DIE_RIGHT, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } + + i_this->field_0x704 = 0.0f; + i_this->field_0x724.x = -0x4000; + + for (int i = 0; i < 4; i++) { + i_this->field_0x802[i] = cM_rndF(10.0f); + } + + a_this->current.angle.y = i_this->field_0x724.y; + if (daPy_py_c::checkNowWolf() != 0) { + i_this->field_0x6e0[0] = 80; + i_this->field_0x6e0[1] = 55; + } else { + i_this->field_0x6e0[0] = cM_rndF(10.0f) + 60.0f; + i_this->field_0x6e0[1] = 35; + } + + i_this->mMode = 3; + i_this->field_0x7e8 = 1500.0f; + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp34.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp34, &sp40); + + fopAcM_effSmokeSet1(&i_this->field_0x10dc, &i_this->field_0x10e0, &sp40, NULL, 1.0f, &a_this->tevStr, 1); + } + break; + + case 3: + if (body_gake(i_this)) { + i_this->field_0x704 = -20.0f; + i_this->field_0x724.x -= 0x300; + } + + if (a_this->health <= 0 && i_this->field_0x6e0[1] == 0) { + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp34.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp34, &sp40); + + dn_disappear(i_this); + fopAcM_delete(a_this); + return; + } + + if (daPy_getPlayerActorClass()->getCutType() != daPy_py_c::CUT_TYPE_DOWN && i_this->field_0x6e0[0] == 0) { + i_this->mMode = 20; + if (i_this->field_0x737 == 0) { + anm_init(i_this, ANM_DIE_LEFT_UP, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } else { + anm_init(i_this, ANM_DIE_RIGHT_UP, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } + + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_UP, -1); + + if (i_this != NULL) { + a_this->offDownFlg(); + } + } + break; + + case 10: + if (i_this->field_0x840 != 0) { + cLib_addCalcAngleS2(&i_this->field_0x724.x, 0, 1, 0x300); + } else { + cLib_addCalcAngleS2(&i_this->field_0x724.x, -0x4000, 1, 0x800); + if (i_this->mObjAcch.ChkGroundHit()) { + i_this->mMode = 2; + if (i_this->field_0x737 == 0) { + i_this->field_0x754 = -100.0f; + i_this->field_0x75c = -100.0f; + } else { + i_this->field_0x754 = 100.0f; + i_this->field_0x75c = 100.0f; + } + + i_this->field_0x758 = -0x5000; + i_this->field_0x760 = -0x4000; + i_this->field_0x704 *= 0.5f; + a_this->speed.y = 20.0f; + a_this->current.angle.y = i_this->field_0x724.y; + i_this->field_0x7e8 = 8000.0f; + } + } + break; + + case 20: + if (i_this->mpModelMorf->getFrame() >= 35.0f) { + i_this->field_0x730.z = 0; + i_this->field_0x730.x = 0; + } + + if (i_this->mpModelMorf->isStop()) { + i_this->field_0x724.y = 0; + i_this->field_0x724.x = 0; + anm_init(i_this, ANM_WAIT_01, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + i_this->field_0x6e0[0] = 5; + i_this->mMode = 21; + + if (i_this != NULL) { + a_this->offDownFlg(); + } + } + break; + + case 21: + case 22: + i_this->field_0x6e8 = 0; + if (i_this->field_0x6e0[0] == 0) { + i_this->mAction = ACTION_NORMAL; + i_this->mMode = 0; + i_this->field_0x6e0[0] = cM_rndF(50.0f) + 50.0f; + anm_init(i_this, ANM_WAIT_03, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + } + break; + + case 30: + if (!a_this->checkWolfDownPullFlg()) { + i_this->field_0x6e0[1] = 0; + } + + if (i_this->field_0x6e0[0] == 0) { + i_this->mMode = 31; + if (i_this->field_0x737 == 0) { + anm_init(i_this, ANM_BRUSH_LEFT_UP, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } else { + anm_init(i_this, ANM_BRUSH_RIGHT_UP, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f); + } + + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_UP, -1); + i_this->field_0x6e0[0] = 10; + } else if (i_this->field_0x6e0[1] == 1) { + a_this->onWolfDownPullEndFlg(); + a_this->offCutDownHitFlg(); + a_this->health = 0; + i_this->field_0x6e0[0] = 1000; + i_this->field_0x6e0[1] = 35; + i_this->mMode = 3; + } + break; + + case 31: + if (i_this->field_0x6e0[0] == 0) { + a_this->offDownFlg(); + i_this->mMode = 20; + i_this->field_0x6f3 = 0; + } + } + + if (i_this != NULL && a_this->checkDownFlg()) { + i_this->field_0x6f2 = 0; + } + + if (i_this->field_0x80c != 0) { + i_this->field_0x80c--; + i_this->field_0x80a = i_this->field_0x80c * cM_ssin(i_this->field_0x80c * 0x3800) * 100.0f; + } +} + +/* 804EA700-804EA854 005640 0154+00 1/1 0/0 0/0 .text e_dn_backdrop__FP10e_dn_class */ +static void e_dn_backdrop(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_DRAWBACK, 3.0f, J3DFrameCtrl::EMode_NONE, 0.5f); + i_this->mMode = 1; + i_this->field_0x724.y = a_this->shape_angle.y; + i_this->field_0x724.x = 0; + a_this->speedF = -3.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DEATH, -1); + // fallthrough + case 1: + if (i_this->field_0x724.x < -0x4000) { + a_this->speedF = -6.0f; + } + + if (a_this->speed.y < -20.0f) { + i_this->mMode = 2; + a_this->speedF = 0.0f; + } + // fallthrough + case 2: + cLib_addCalcAngleS2(&i_this->field_0x724.x, -0x7000, 2, 0x800); + if (i_this->mMode == 2 && a_this->current.pos.y <= (i_this->mObjAcch.GetGroundH() + 100.0f)) { + a_this->current.pos.y = i_this->mObjAcch.GetGroundH() + 100.0f; + i_this->field_0x724.x = -0x4000; + i_this->mAction = ACTION_DAMAGE; + i_this->mMode = 0; + i_this->field_0x704 = 0.0f; + a_this->health = 0; + } + } +} + +/* 804EA854-804EA9F4 005794 01A0+00 1/1 0/0 0/0 .text e_dn_water__FP10e_dn_class */ +static void e_dn_water(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp20, sp2c, sp38; + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp20.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp20, &sp2c); + + i_this->field_0x6e8 = 10; + switch (i_this->mMode) { + case 0: + case 1: + a_this->speed.y = 0.0f; + if (i_this->field_0x737 == 0) { + anm_init(i_this, ANM_DROWNED_A, 3.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + } else { + anm_init(i_this, ANM_DROWNED_B, 3.0f, J3DFrameCtrl::EMode_LOOP, 1.0f); + } + + i_this->field_0x6e0[0] = 60; + a_this->speedF = 0.0f; + i_this->field_0x704 = 0.0f; + i_this->field_0x708 = 0.0f; + + sp38 = a_this->current.pos; + sp38.y = i_this->field_0xa5c; + if (i_this->mMode == 0) { + fopKyM_createWpillar(&sp38, 1.5f, 0); + } else { + fopKyM_createMpillar(&sp38, 1.0f); + } + + i_this->mMode = 10; + break; + + case 10: + a_this->speed.y = 0.0f; + cLib_addCalc2(&a_this->current.pos.y, i_this->field_0xa5c, 0.5f, 5.0f); + cLib_addCalcAngleS2(&i_this->field_0x724.x, -0x4000, 4, 0x400); + + if (i_this->field_0x6e0[0] == 0) { + dn_disappear(i_this); + } + } +} + +/* 804EA9F4-804EAD1C 005934 0328+00 1/1 0/0 0/0 .text e_dn_reg__FP10e_dn_class */ +static void e_dn_reg(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + cXyz sp34, sp40; + f32 fVar1 = 0.0f; + + i_this->field_0x6f2 = 0; + i_this->field_0x6e8 = 10; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_RUN, 5.0f, J3DFrameCtrl::EMode_LOOP, cM_rndFX(0.05f) + 1.0f); + i_this->mMode = 1; + + if ((i_this->field_0x5b6 & 1) != 0) { + a_this->current.pos.set(-8613.0f, 2000.0f, 8017.0f); + a_this->current.angle.set(0, 0x19A0, 0); + } else { + a_this->current.pos.set(-8044.0f, 2000.0f, 8616.0f); + a_this->current.angle.set(0, -0x629E, 0); + } + + a_this->old.pos = a_this->current.pos; + i_this->field_0x5d4 = a_this->current.angle.y; + i_this->field_0x6e0[0] = 14; + // fallthrough + case 1: + fVar1 = l_HIO.dash_speed; + if ((i_this->field_0x6cc & 3) == 0) { + if ((i_this->field_0x6cc & 4) != 0) { + i_this->field_0x10e4 = 1; + } else { + i_this->field_0x10e4 = 2; + } + } + + if (i_this->field_0x6e0[0] == 0) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + + if ((i_this->field_0x5b6 & 1) != 0) { + sp34.x = 100.0f; + } else { + sp34.x = -100.0f; + } + sp34.y = 0.0f; + sp34.z = 0.0f; + MtxPosition(&sp34, &sp40); + sp40 += player->current.pos; + sp34 = sp40 - a_this->current.pos; + i_this->field_0x5d4 = cM_atan2s(sp34.x, sp34.z); + } + break; + + case 2: + if ((i_this->field_0x5b6 & 1) != 0) { + i_this->field_0x750 = a_this->shape_angle.y - (0x4000 << 2) + 0x4000; + i_this->field_0x724.y = a_this->shape_angle.y + 0x4000; + i_this->field_0x70e = (cM_rndFX(800.0f) + 3000.0f); + } else { + i_this->field_0x750 = a_this->shape_angle.y - 0x4000; + i_this->field_0x724.y = a_this->shape_angle.y - 0x4000; + i_this->field_0x70e = -(cM_rndFX(800.0f) + 3000.0f); + } + + i_this->field_0x74c = 150.0f; + i_this->mAction = ACTION_DAMAGE; + i_this->mMode = 0; + a_this->speed.y = cM_rndF(10.0f) + 40.0f; + i_this->field_0x704 = -30.0f; + i_this->field_0x828 = 50; + a_this->health = 0; + break; + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x5d4, 2, 0x800); + s16 sVar1 = a_this->current.angle.y - i_this->field_0x5d4; + if (sVar1 > 0x800 || sVar1 < -0x800) { + fVar1 = 0.0f; + } + + a_this->speedF = fVar1; + i_this->field_0x6f4 = 1; +} + +/* 804EAD1C-804EADD4 005C5C 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_dn_class */ +static void wolfkick_damage(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + + i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x74c = 150.0f; + i_this->mAction = ACTION_DAMAGE; + i_this->mMode = 0; + i_this->field_0x724.y = player->shape_angle.y + 0x8000; + a_this->speed.y = 0.0f; + i_this->field_0x704 = -1.0f; + i_this->field_0x828 = 50; + i_this->mSound.startCollisionSE(Z2SE_HIT_WOOD_WEAPON, 31); + i_this->field_0x710 = 1; +} + +/* 804EADD4-804EAEE4 005D14 0110+00 1/1 0/0 0/0 .text big_damage__FP10e_dn_class */ +static void big_damage(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x74c = 150.0f; + i_this->mAction = ACTION_DAMAGE; + i_this->mMode = 0; + i_this->field_0x724.y = i_this->mAtInfo.mHitDirection.y; + a_this->speed.y = cM_rndF(10.0f) + 25.0f; + i_this->field_0x704 = -20.0f; + i_this->field_0x828 = 50; + if ((i_this->mAtInfo.mHitBit & 0x80) != 0) { + OS_REPORT("SPIN CUT HIT !!\n"); + i_this->field_0x70e = cM_rndFX(800.0f) + 3000.0f; + } else if ((i_this->mAtInfo.mHitBit & 0x800) != 0) { + OS_REPORT("SPIN CUT L HIT !!\n"); + i_this->field_0x70e = -(cM_rndFX(800.0f) + 3000.0f); + } else { + i_this->field_0x70e = cM_rndFX(700.0f); + } + + i_this->field_0x710 = 0; +} + +/* 804EAEE4-804EAF94 005E24 00B0+00 1/1 0/0 0/0 .text small_damage__FP10e_dn_class */ +static void small_damage(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + + i_this->mAction = ACTION_S_DAMAGE; + i_this->mMode = 0; + i_this->field_0x828 = 50; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DAMAGE, -1); + + if (i_this->field_0x82e != 0) { + a_this->current.angle.y = a_this->shape_angle.y; + } + + i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x74c = 150.0f; + i_this->field_0x708 = 25.0f; + i_this->field_0x70c = i_this->mAtInfo.mHitDirection.y; +} + +/* 804EAF94-804EB344 005ED4 03B0+00 1/1 0/0 0/0 .text damage_check__FP10e_dn_class */ +static void damage_check(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + if (l_HIO.field_0x24 != 0) { + i_this->field_0x744 = 0; + } + + i_this->mStts.Move(); + + if (i_this->field_0x6e8 == 0) { + fopEn_enemy_c* dn_p = (fopEn_enemy_c*)i_this; + if (l_HIO.invulnerable != 0) { + a_this->health = 100; + } + + for (int i = 0; i <= 2; i++) { + if (i_this->field_0xa9c[i].ChkTgHit() != 0) { + i_this->mAtInfo.mpCollider = i_this->field_0xa9c[i].GetTgHitObj(); + if (player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_LEFT && player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_RIGHT && + i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK) != 0) { + if (!player->onWolfEnemyHangBite(dn_p)) { + return; + } + + OS_REPORT("DN PL BITE HANG \n"); + i_this->mAction = ACTION_WOLFBITE; + i_this->mMode = 0; + i_this->field_0x6e8 = 1000; + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 31); + return; + } + + i_this->field_0x10da = 3; + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000) != 0) { + wolfkick_damage(i_this); + i_this->field_0x6e8 = 1000; + } else { + at_power_check(&i_this->mAtInfo); + s16 sVar1 = a_this->health; + cc_at_check(a_this, &i_this->mAtInfo); + + if (daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_HEAD_JUMP) { + i_this->mAtInfo.mHitStatus = 0; + } + + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK) != 0) { + i_this->field_0x6e8 = 20; + } else { + i_this->field_0x6e8 = 10; + } + + if (i_this->mAtInfo.mAttackPower <= 1) { + i_this->field_0x6e8 = 10; + } + + i_this->field_0x744 |= i_this->mAtInfo.mHitBit; + if (i_this->mAtInfo.mHitType == 16 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) != 0) { + a_this->health = sVar1; + i_this->mAction = ACTION_DRAWBACK; + i_this->mMode = 0; + + if (i_this->field_0x82e != 0) { + a_this->current.angle.y = a_this->shape_angle.y; + } + + i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; + i_this->field_0x74c = 100.0f; + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DAMAGE, -1); + } else { + if (daPy_getPlayerActorClass()->checkHorseRide() != 0 && dComIfGp_getHorseActor()->speedF >= 20.0f && i_this->mAtInfo.mHitType == 1) { + i_this->mAtInfo.mAttackPower = 20; + if (cM_rndF(1.0f) < 0.5f) { + i_this->mAtInfo.mHitBit |= 0x80; + } else { + i_this->mAtInfo.mHitBit |= 0x800; + } + } + + if (a_this->health <= 0 || i_this->mAtInfo.mHitStatus != 0) { + if (player->getCutType() == daPy_py_c::CUT_TYPE_JUMP && player->checkCutJumpCancelTurn()) { + small_damage(i_this); + i_this->field_0x6e8 = 3; + } else { + big_damage(i_this); + i_this->field_0x6e8 = 1000; + } + } else { + small_damage(i_this); + } + + a_this->speedF = 0.0f; + } + } + break; + } + } + + for (int i = 0; i < 3; i++) { + if (a_this->health <= 1) { + i_this->field_0xa9c[i].SetTgHitMark((CcG_Tg_HitMark)3); + } + } + } +} + +/* 804EB344-804EC854 006284 1510+00 2/1 0/0 0/0 .text action__FP10e_dn_class */ +static void action(e_dn_class* i_this) { + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + cXyz sp240, sp24c; + + i_this->field_0x6f4 = 0; + f32 fVar1 = fopAcM_searchPlayerDistanceXZ(a_this); + i_this->mPlayerDistance = fVar1; + s16 sVar1 = fopAcM_searchPlayerAngleY(a_this); + i_this->mYAngleToPlayer = sVar1; + sVar1 = fopAcM_searchPlayerAngleX(a_this); + i_this->mXAngleToPlayer = sVar1; + damage_check(i_this); + i_this->field_0x82e = 0; + + s8 bVar1 = 0; + s8 bVar2 = 1; + a_this->offHeadLockFlg(); + if (fopAcM_otherBgCheck(player, a_this)) { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } else { + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; + } + + switch (i_this->mAction) { + case ACTION_NORMAL: + e_dn_normal(i_this); + break; + + case ACTION_FIGHT_RUN: + e_dn_fight_run(i_this); + bVar1 = 1; + break; + + case ACTION_ATTACK_0: + e_dn_attack_0(i_this); + bVar1 = 1; + break; + + case ACTION_ATTACK: + e_dn_attack(i_this); + bVar1 = 1; + break; + + case ACTION_TAIL_ATTACK: + e_dn_tail_attack(i_this); + bVar1 = 1; + break; + + case ACTION_GUARD: + e_dn_guard(i_this); + bVar1 = 1; + break; + + case ACTION_JUMP: + e_dn_jump(i_this); + bVar1 = 1; + break; + + case ACTION_STAY: + e_dn_stay(i_this); + break; + + case ACTION_OTOREAC: + e_dn_otoreac(i_this); + break; + + case ACTION_DRAWBACK: + e_dn_drawback(i_this); + bVar1 = 1; + break; + + case ACTION_WOLFBITE: + e_dn_wolfbite(i_this); + break; + + case ACTION_BOMB_ACTION: + e_dn_bomb_action(i_this); + break; + + case ACTION_S_DAMAGE: + e_dn_s_damage(i_this); + break; + + case ACTION_DAMAGE: + e_dn_damage(i_this); + break; + + case ACTION_BACKDROP: + e_dn_backdrop(i_this); + break; + + case ACTION_WATER: + e_dn_water(i_this); + bVar2 = 0; + break; + + case ACTION_GAKEJUMP: + e_dn_gakejump(i_this); + bVar1 = 1; + break; + + case ACTION_REG: + e_dn_reg(i_this); + } + + f32 fVar6 = 0.0f; + if (bVar2) { + dBgS_ObjGndChk obj_gnd_chk; + dBgS_ObjGndChk_Spl spl_chk; + sp240 = a_this->current.pos; + sp240.y += 150.0f; + spl_chk.SetPos(&sp240); + obj_gnd_chk.SetPos(&sp240); + i_this->field_0xa5c = dComIfG_Bgsp().GroundCross(&spl_chk); + fVar1 = i_this->field_0xa5c - dComIfG_Bgsp().GroundCross(&obj_gnd_chk); + if (a_this->current.pos.y < i_this->field_0xa5c && fVar1 > 100.0f) { + OS_REPORT("DN YOGAN \n"); + i_this->mAction = ACTION_WATER; + if (dComIfG_Bgsp().GetPolyAtt0(spl_chk) == 6) { + i_this->mMode = 1; + } else { + i_this->mMode = 0; + } + + a_this->current.pos.y = i_this->field_0xa5c; + } + } + + if (bVar1) { + i_this->mSound.setLinkSearch(true); + } else { + i_this->mSound.setLinkSearch(false); + } + + if (i_this->field_0x82e == 0) { + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x2000); + } + + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x2000); + cLib_addCalcAngleS2(&a_this->shape_angle.z, a_this->current.angle.z, 2, 0x2000); + + if (i_this->field_0x5d8 != 0) { + cMtx_YrotS(*calc_mtx, i_this->field_0x5d4); + cMtx_XrotM(*calc_mtx, i_this->field_0x5d6); + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = a_this->speedF; + MtxPosition(&sp240, &sp24c); + a_this->current.pos += sp24c; + sp240 = i_this->field_0x5bc - i_this->field_0x5c8; + fVar1 = sp240.abs(); + sp240 = i_this->field_0x5bc - a_this->current.pos; + f32 fVar2 = sp240.abs(); + f32 fVar3 = fVar1 * 0.3f; + if (fVar3 > 250.0f) { + fVar3 = 250.0f; + } + + i_this->field_0x720 = fVar3 * cM_ssin((fVar2 / fVar1) * 32768.0f); + i_this->field_0x5d8 = 0; + } else { + cLib_addCalc0(&i_this->field_0x720, 1.0f, 30.0f); + + if (i_this->field_0x704 != fVar6) { + cMtx_YrotS(*calc_mtx, i_this->field_0x724.y); + if (i_this->field_0x840 == 0) { + sp240.z = i_this->field_0x704; + } else { + sp240.z = 0.0f; + a_this->speed.y = 0.0f; + } + + a_this->gravity = -4.0f; + } else { + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + sp240.z = a_this->speedF; + } + sp240.x = 0.0f; + sp240.y = 0.0f; + MtxPosition(&sp240, &sp24c); + + a_this->speed.x = sp24c.x; + a_this->speed.z = sp24c.z; + a_this->speed.y += a_this->gravity; + a_this->current.pos += a_this->speed; + a_this->gravity = -5.0f; + + if (a_this->speed.y < -100.0f) { + a_this->speed.y = -100.0f; + } + + if (i_this->mAction != 9 && i_this->field_0x6f2 != 0) { + cXyz* move_pos = i_this->mStts.GetCCMoveP(); + if (move_pos != NULL) { + a_this->current.pos.x += move_pos->x; + a_this->current.pos.z += move_pos->z; + } + } + + if (i_this->field_0x708 > 0.1f) { + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = -i_this->field_0x708; + cMtx_YrotS(*calc_mtx, i_this->field_0x70c); + MtxPosition(&sp240, &sp24c); + a_this->current.pos += sp24c; + cLib_addCalc0(&i_this->field_0x708, 1.0f, 7.0f); + } + } + + sVar1 = 0x800; + if (i_this->field_0x700 != 0) { + i_this->field_0x700--; + i_this->field_0x6f4 = 2; + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + + if (i_this->field_0x701 != 0) { + sp240.x = 100.0f; + } else { + sp240.x = -100.0f; + } + sp240.y = 100.0f; + sp240.z = -100.0f; + MtxPosition(&sp240, &i_this->field_0x738); + i_this->field_0x738 += a_this->current.pos; + sVar1 = 0x400; + } + + if (i_this->field_0x6f4 != 0) { + if (i_this->field_0x6f4 == 5) { + if ((i_this->field_0x6cc & 15) == 0 && cM_rndF(1.0f) < 0.3f) { + i_this->field_0x6fc = cM_rndFX(2500.0f); + } + } else { + if (i_this->field_0x6f4 == 1) { + sp240 = player->eyePos - a_this->current.pos; + } else if (i_this->field_0x6f4 == 2) { + sp240 = i_this->field_0x738 - a_this->current.pos; + } else { + sp240 = player->eyePos - a_this->current.pos; + } + sp240.y += l_HIO.model_size * -150.0f; + + s16 sVar2 = cM_atan2s(sp240.x, sp240.z) - a_this->shape_angle.y; + s16 sVar3 = a_this->shape_angle.x + cM_atan2s(sp240.y, JMAFastSqrt(sp240.x * sp240.x + sp240.z * sp240.z)); + if (sVar2 > 0x2710) { + sVar2 = 10000; + } else if (sVar2 < -10000) { + sVar2 = -10000; + } + + if (sVar3 > 0x2710) { + sVar3 = 10000; + } else if (sVar3 < -20000) { + sVar3 = -20000; + } + + cLib_addCalcAngleS2(&i_this->field_0x6f6, sVar2 / 2, 2, sVar1); + cLib_addCalcAngleS2(&i_this->field_0x6f8, sVar3 / 2, 2, sVar1); + } + + i_this->field_0x6fc = 0; + } else { + cLib_addCalcAngleS2(&i_this->field_0x6f6, 0, 2, sVar1); + cLib_addCalcAngleS2(&i_this->field_0x6f8, 0, 2, sVar1); + i_this->field_0x6fc = 0; + } + + cLib_addCalcAngleS2(&i_this->field_0x6fa, i_this->field_0x6fc, 4, 0x400); + + if (i_this->field_0x6fe != 0) { + i_this->field_0x6fe--; + i_this->field_0x6fa = i_this->field_0x6fe * cM_ssin(i_this->field_0x6fe * 12000) * 200.0f; + } + + if (i_this->field_0x74c > 1.0f) { + cMtx_YrotS(*calc_mtx, i_this->field_0x750); + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = i_this->field_0x74c * 120.0f; + if (sp240.z > 15000.0f) { + sp240.z = 15000.0f; + } + MtxPosition(&sp240, &sp24c); + + i_this->field_0x7a4[0].y = sp24c.x; + i_this->field_0x7a4[0].x = sp24c.z; + i_this->field_0x7a4[1].y = sp24c.x; + i_this->field_0x7a4[1].x = sp24c.z; + cLib_addCalc0(&i_this->field_0x74c, 0.5f, 10.0f); + } + + if (fabsf(i_this->field_0x75c) > 1.0f) { + i_this->field_0x7a4[1].x = i_this->field_0x75c * cM_scos(i_this->field_0x760) * 70.0f; + i_this->field_0x7a4[2].x += i_this->field_0x7a4[1].x; + cLib_addCalc0(&i_this->field_0x75c, 1.0f, 3.0f); + i_this->field_0x760 += 4000; + } + + if (fabsf(i_this->field_0x754) > 1.0f) { + i_this->field_0x7a4[0].x = i_this->field_0x754 * cM_scos(i_this->field_0x758) * 70.0f; + cLib_addCalc0(&i_this->field_0x754, 1.0f, 3.0f); + i_this->field_0x758 += 4000; + } + + if (a_this->speed.y < 0.0f && i_this->mObjAcch.ChkGroundHit()) { + cLib_addCalc0(&i_this->field_0x75c, 1.0f, 30.0f); + cLib_addCalc0(&i_this->field_0x754, 1.0f, 30.0f); + } + + if (i_this->field_0x704 != fVar6) { + s16 sVar4 = i_this->field_0x724.y - a_this->shape_angle.y; + i_this->field_0x7a4[3].y = 0x4000 - sVar4; + if (i_this->field_0x7a4[3].y > 0x1770) { + i_this->field_0x7a4[3].y = 6000; + } else if (i_this->field_0x7a4[3].y < -9000) { + i_this->field_0x7a4[3].y = -9000; + } + + i_this->field_0x7a4[4].y = 0x4000 - sVar4; + if (i_this->field_0x7a4[4].y > 0x4268) { + i_this->field_0x7a4[4].y = 17000; + } else if (i_this->field_0x7a4[4].y < 0) { + i_this->field_0x7a4[4].y = 0; + } + + i_this->field_0x7a4[5].y = sVar4 + 0x4000; + if (i_this->field_0x7a4[5].y > 0x1770) { + i_this->field_0x7a4[5].y = 6000; + } else if (i_this->field_0x7a4[5].y < -9000) { + i_this->field_0x7a4[5].y = -9000; + } + + i_this->field_0x7a4[6].y = sVar4 + 0x4000; + if (i_this->field_0x7a4[6].y > 0x4268) { + i_this->field_0x7a4[6].y = 17000; + } else if (i_this->field_0x7a4[6].y < 0) { + i_this->field_0x7a4[6].y = 0; + } + + cMtx_YrotS(*calc_mtx, sVar4); + sp240.x = 0.0f; + sp240.y = 0.0f; + sp240.z = 12000.0f; + MtxPosition(&sp240, &sp24c); + i_this->field_0x836.y = -sp24c.x; + i_this->field_0x836.x = -sp24c.z * 1.3f; + + if (i_this->field_0x836.x > 10000) { + i_this->field_0x836.x = 10000; + } + + i_this->field_0x836.x += 6000; + } + + static s16 j_spd[11] = { + 0x4000, 0x4000, 0x4000, + 0x1000, 0x1000, 0x1000, + 0x1000, 0x4000, 0x4000, + 0x4000, 0x4000 + }; + + for (int i = 0; i < 11; i++) { + cLib_addCalcAngleS2(&i_this->field_0x762[i].x, i_this->field_0x7a4[i].x, 2, j_spd[i]); + cLib_addCalcAngleS2(&i_this->field_0x762[i].y, i_this->field_0x7a4[i].y, 2, j_spd[i]); + cLib_addCalcAngleS2(&i_this->field_0x762[i].z, i_this->field_0x7a4[i].z, 2, j_spd[i]); + i_this->field_0x7a4[i].z = 0; + i_this->field_0x7a4[i].x = 0; + + if (i >= 3 && i <= 6) { + if (i_this->field_0x7fc[i] == 0) { + s16 sVar5; + if (i == 4 || i == 6) { + sVar5 = 0x600; + } else { + sVar5 = 0x800; + } + + cLib_addCalcAngleS2(&i_this->field_0x7a4[i].y, 0, 1, sVar5); + } else { + i_this->field_0x7fc[i]--; + } + } else { + i_this->field_0x7a4[i].y = 0; + } + + if (i >= 3) { + i_this->field_0x7ec[i] = i_this->field_0x7e8 * cM_scos(i_this->field_0x6cc * 4000 + i * 20000); + } + } + + cLib_addCalc0(&i_this->field_0x7e8, 1.0f, 100.0f); + cLib_addCalcAngleS2(&i_this->field_0x832, i_this->field_0x836.y, 2, 0x800); + cLib_addCalcAngleS2(&i_this->field_0x830, i_this->field_0x836.x, 2, 0x800); + i_this->field_0x836.x = 0; + i_this->field_0x836.y = 0; + if (i_this->field_0x828 != 0) { + i_this->field_0x828--; + } + + fVar1 = i_this->field_0x828 * 1.0f; + if (fVar1 > 30.0f) { + fVar1 = 30.0f; + } + fVar1 *= fVar1; + + for (int i = 0; i < 4; i++) { + i_this->field_0x80e[i].x = fVar1 * (cM_ssin(i_this->field_0x6cc * 5000 + i * -15000) * 5.0f); + i_this->field_0x80e[i].y = fVar1 * (cM_ssin(i_this->field_0x6cc * 0x12C0 + i * -13000) * 5.0f); + } + + J3DModel* model; + cLib_addCalcAngleS2(&i_this->field_0x826, 0, 4, 0x100); + if (i_this->field_0x736 != 0) { + i_this->field_0x736--; + if (i_this->field_0x724.x != 0) { + Vec sp258; + cXyz sp264, sp270; + dBgS_GndChk gnd_chk; + int sVar6 = 0; + s16 sVar7 = 0; + fVar1 = 100.0f; + + MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); + sp240.set(0.0f, 0.0f, 0.0f); + MtxPosition(&sp240, &sp264); + sp264.y += 100.0f; + sp264.y += 100.0f; + gnd_chk.SetPos(&sp264); + sp264.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if (sp264.y != -1000000000.0f) { + sp258.x = sp264.x; + sp258.y = sp264.y + 100.0f; + sp258.z = sp264.z + fVar1; + gnd_chk.SetPos(&sp258); + sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if (sp258.y != -1000000000.0f) { + sVar7 = -cM_atan2s(sp258.y - sp264.y, sp258.z - sp264.z); + if (sVar7 > 0x3000 || sVar7 < -0x3000) { + sVar7 = 0; + } + } + + sp258.x = sp264.x + fVar1; + sp258.y = sp264.y + 100.0f; + sp258.z = sp264.z; + gnd_chk.SetPos(&sp258); + sp258.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + if (sp258.y != -1000000000.0f) { + sVar6 = cM_atan2s(sp258.y - sp264.y, sp258.x - sp264.x); + if (sVar6 > 0x3000 || sVar6 < -0x3000) { + sVar6 = 0; + } + } + } + + dBgS_LinChk lin_chk; + cXyz sp27c, sp288, sp294; + + sp288 = a_this->current.pos; + sp288.y += 30.0f; + model = i_this->mpModelMorf->getModel(); + sp27c.set(0.0f, 0.0f, 0.0f); + MTXCopy(model->getAnmMtx(4), *calc_mtx); + MtxPosition(&sp27c, &sp294); + sp294.y += 30.0f; + lin_chk.Set(&sp288, &sp294, a_this); + + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + sp27c = sp288 - sp294; + cMtx_YrotS(*calc_mtx, cM_atan2s(sp27c.x, sp27c.z)); + sp27c.x = 0.0f; + sp27c.y = 0.0f; + sp27c.z = 50.0f; + MtxPosition(&sp27c, &sp24c); + a_this->current.pos += sp24c; + } + + i_this->field_0x730.x = sVar7; + i_this->field_0x730.z = sVar6; + } + } + + cLib_addCalcAngleS2(&i_this->field_0x72a.x, i_this->field_0x730.x, 1, 0x400); + cLib_addCalcAngleS2(&i_this->field_0x72a.z, i_this->field_0x730.z, 1, 0x400); + + if (i_this->field_0x10e4 != 0) { + model = i_this->mpModelMorf->getModel(); + sp240.set(0.0f, 0.0f, 0.0f); + + static int foot_idx[2] = { + 26, 30, + }; + for (int i = 0; i < 2; i++) { + if ((i_this->field_0x10e4 == 3 || (i_this->field_0x10e4 == 2 && i == 1)) || (i_this->field_0x10e4 == 1 && i == 0)) { + MTXCopy(model->getAnmMtx(foot_idx[i]), *calc_mtx); + MtxPosition(&sp240, &sp24c); + fopAcM_effSmokeSet1(&i_this->field_0x10e8[i], &i_this->field_0x10f0[i], &sp24c, &a_this->shape_angle, 1.0f, &a_this->tevStr, 0); + } + } + + i_this->field_0x10e4 = 0; + } + + if (i_this->field_0x10da != 0) { + i_this->field_0x10da--; + if (i_this->field_0x10da == 0) { + dComIfGp_particle_set(0x15E, &a_this->eyePos, &a_this->shape_angle, NULL); + } + } + + cXyz sp2a4(1.3f, 1.3f, 1.3f); + setMidnaBindEffect(a_this, &i_this->mSound, &a_this->eyePos, &sp2a4); +} + +/* 804EC854-804ECB50 007794 02FC+00 1/1 0/0 0/0 .text anm_se_set__FP10e_dn_class */ +static void anm_se_set(e_dn_class* i_this) { + int frame = i_this->mpModelMorf->getFrame(); + + if (i_this->mAnmID == ANM_ATTACK_01) { + if (frame == 35) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_TAIL, 0, -1); + } else if (frame == 28) { + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_TAIL, -1); + } + } else if (i_this->mAnmID == ANM_ATTACK_TAIL_01) { + if (frame == 18) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_KNIFE, 0, -1); + } + } else if (i_this->mAnmID == ANM_ATTACK_TAIL_02) { + if (frame == 10) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_KNIFE2_A, 0, -1); + } + + if (frame == 24) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_KNIFE2_B, 0, -1); + } + } else if (i_this->mAnmID == ANM_WALK) { + if (frame == 3) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_L, 0, -1); + } else if (frame == 18) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_R, 0, -1); + } + } else if (i_this->mAnmID == ANM_RUN) { + if (frame == 10) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_RUN_L, 0, -1); + } else if (frame == 4) { + i_this->mSound.startCreatureSound(Z2SE_EN_DN_FN_RUN_R, 0, -1); + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_BREATH, -1); + } + } else if (i_this->mAnmID == ANM_WAIT_03) { + if (frame == 15) { + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_SEARCH, -1); + } + } else if (i_this->mAnmID == ANM_WAIT_04 && frame == 15) { + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_SEARCH2, -1); + } +} + +/* 804EEF94-804EEF98 0000AC 0004+00 1/2 0/0 0/0 .bss c_start */ +int c_start; + +/* 804ECB50-804ED83C 007A90 0CEC+00 2/1 0/0 0/0 .text daE_DN_Execute__FP10e_dn_class */ +static int daE_DN_Execute(e_dn_class* i_this) { + // NONMATCHING + fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + f32 fVar1 = 0.0f; + + if (i_this->field_0x10d8 != 0) { + return 1; + } + + if (c_start == 0 && dComIfGp_event_runCheck() && + (fopAcM_getTalkEventPartner((fopAc_ac_c*)daPy_getLinkPlayerActorClass()) == daPy_py_c::getMidnaActor() || daPy_getPlayerActorClass()->eventInfo.checkCommandDoor())) { + return 1; + } + + cXyz sp2c; + cXyz sp38; + cXyz sp44; + i_this->field_0x6cc++; + for (int i = 0; i < 4; i++) { + if (i_this->field_0x6e0[i] != 0) { + i_this->field_0x6e0[i]--; + } + } + + if (i_this->field_0x6e8 != 0) { + i_this->field_0x6e8--; + } + + if (i_this->field_0x6ec != 0) { + i_this->field_0x6ec--; + } + + if (i_this->field_0x840 != 0) { + i_this->field_0x840--; + } + + if (i_this->field_0x6ea != 0) { + i_this->field_0x6ea--; + } + + i_this->field_0x6f2 = 1; + action(i_this); + + if (i_this->field_0x840 == 0 && i_this->field_0x5d8 == 0) { + if (i_this->field_0x704 != fVar1) { + cMtx_YrotS(*calc_mtx, i_this->field_0x724.y); + sp2c.x = 0.0f; + sp2c.y = 0.0f; + sp2c.z = i_this->field_0x83c; + MtxPosition(&sp2c, &sp38); + a_this->current.pos += sp38; + a_this->old.pos += sp38; + cLib_addCalc2(&i_this->field_0x83c, i_this->field_0x704 * 2.0f, 1.0f, 5.0f); + } else { + cLib_addCalc0(&i_this->field_0x83c, 1.0f, 5.0f); + } + + i_this->mObjAcch.CrrPos(dComIfG_Bgsp()); + if (i_this->field_0x704 != fVar1) { + a_this->current.pos -= sp38; + a_this->old.pos -= sp38; + } + + + if (!i_this->mObjAcch.ChkGroundHit()) { + if (a_this->speed.y < -10.0f) { + i_this->field_0x842++; + if (i_this->field_0x842 == 13) { + i_this->mSound.startCreatureVoice(Z2SE_EN_DN_V_DEATH, -1); + } + } + } else { + if (i_this->field_0x842 >= 13) { + i_this->mAction = ACTION_DAMAGE; + i_this->mMode = 0; + a_this->speed.y = 0.0f; + i_this->field_0x704 = -1.0; + i_this->field_0x724.x = -0x3000; + i_this->field_0x828 = 50; + i_this->field_0x6e8 = 1000; + a_this->health = 0; + } + + i_this->field_0x842 = 0; + } + } + + mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y + i_this->field_0x720, a_this->current.pos.z); + mDoMtx_stack_c::XrotM(i_this->field_0x72a.x); + mDoMtx_stack_c::ZrotM(i_this->field_0x72a.z); + mDoMtx_stack_c::YrotM(i_this->field_0x724.y); + mDoMtx_stack_c::XrotM(i_this->field_0x724.x); + mDoMtx_stack_c::YrotM(-i_this->field_0x724.y); + mDoMtx_stack_c::YrotM(a_this->shape_angle.y); + mDoMtx_stack_c::XrotM(a_this->shape_angle.x); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + mDoMtx_stack_c::scaleM(l_HIO.model_size * a_this->scale.x, l_HIO.model_size * a_this->scale.x, l_HIO.model_size * a_this->scale.x); + + J3DModel* model = i_this->mpModelMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpModelMorf->play(0, 0); + anm_se_set(i_this); + i_this->mpModelMorf->modelCalc(); + MTXCopy(model->getAnmMtx(2), *calc_mtx); + + sp2c.set(0.0f, 0.0f, 0.0f); MtxPosition(&sp2c, &sp38); sp2c.set(0.0f, 0.0f, -200.0f); MtxPosition(&sp2c, &sp44); @@ -2378,7 +3083,7 @@ static int daE_DN_Execute(e_dn_class* i_this) { } MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(19), *calc_mtx); - i_this->field_0x5e4->setBaseTRMtx(*calc_mtx); + i_this->mpKnifeModel->setBaseTRMtx(*calc_mtx); if (i_this->field_0x6ef != 0 && i_this->field_0x6ee <= 1) { sp2c.set(0.0f, 60.0f, 0.0f); @@ -2391,22 +3096,22 @@ static int daE_DN_Execute(e_dn_class* i_this) { } if (i_this->field_0x6ee == 1) { - i_this->field_0xe44.SetR(l_HIO.base_size * 80.0f); + i_this->field_0xe44.SetR(l_HIO.model_size * 80.0f); } else { - i_this->field_0xe44.SetR(l_HIO.base_size * 50.0f); + i_this->field_0xe44.SetR(l_HIO.model_size * 50.0f); } i_this->field_0xe44.SetAtAtp(1); } - if (i_this->field_0x690 != NULL) { + if (i_this->mpSkullModel != NULL) { if (i_this->field_0x694 == 0) { MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(6), mDoMtx_stack_c::get()); mDoMtx_stack_c::multVecZero(&i_this->field_0x698); } else { i_this->field_0x698 += i_this->field_0x6a4; if (i_this->field_0x6a4.y <= i_this->mObjAcch.GetGroundH()) { - i_this->field_0x690 = NULL; + i_this->mpSkullModel = NULL; } i_this->field_0x6a4.y -= 5.0f; @@ -2415,11 +3120,11 @@ static int daE_DN_Execute(e_dn_class* i_this) { mDoMtx_stack_c::XrotM(i_this->field_0x6b2); } - i_this->field_0x690->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpSkullModel->setBaseTRMtx(mDoMtx_stack_c::get()); } MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(12), *calc_mtx); - i_this->field_0x68c->setBaseTRMtx(*calc_mtx); + i_this->mpShieldModel->setBaseTRMtx(*calc_mtx); if (i_this->field_0x6ef != 0 && i_this->field_0x6ee == 2) { MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(34), *calc_mtx); @@ -2434,8 +3139,7 @@ static int daE_DN_Execute(e_dn_class* i_this) { } i_this->field_0xe44.SetAtAtp(2); - i_this->field_0xe44.SetR(70.0f * l_HIO.base_size); - // i_this->field_0xe44.SetAtSpl((dCcG_At_Spl)2); + i_this->field_0xe44.SetR(70.0f * l_HIO.model_size); } if (i_this->field_0x6ef == 0) { @@ -2453,7 +3157,7 @@ static int daE_DN_Execute(e_dn_class* i_this) { sp2c.set(50.0f, 0.0f, 30.0f); MtxPosition(&sp2c, &sp38); i_this->field_0xf7c.SetC(sp38); - i_this->field_0xf7c.SetR(70.0f * l_HIO.base_size); + i_this->field_0xf7c.SetR(70.0f * l_HIO.model_size); if (i_this->field_0xf7c.ChkTgHit()) { def_se_set(&i_this->mSound, i_this->field_0xf7c.GetTgHitObj(), 40, 0); @@ -2477,7 +3181,8 @@ static int daE_DN_Execute(e_dn_class* i_this) { if (i_this->field_0x6c4 != 0) { cLib_addCalc2(&i_this->field_0x6c8, -20.0f, 1.0f, 0.4f); } - daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + daPy_py_c* player = daPy_getPlayerActorClass(); MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), mDoMtx_stack_c::get()); mDoMtx_stack_c::multVecZero(&sp38); sp2c = player->current.pos - sp38; @@ -2504,8 +3209,8 @@ static int daE_DN_Execute(e_dn_class* i_this) { } if (strcmp(dComIfGp_getStartStageName(), "D_MN07") == 0 && fopAcM_GetRoomNo(a_this) == 8 && a_this->health != 0 && a_this->current.pos.y <= -300.0f) { - i_this->mAction = 21; - i_this->field_0x5b4 = 0; + i_this->mAction = ACTION_DAMAGE; + i_this->mMode = 0; i_this->field_0x704 = 0.0; a_this->health = 0; } @@ -2520,7 +3225,6 @@ static int daE_DN_IsDelete(e_dn_class* i_this) { /* 804ED844-804ED8AC 008784 0068+00 1/0 0/0 0/0 .text daE_DN_Delete__FP10e_dn_class */ static int daE_DN_Delete(e_dn_class* i_this) { - // NONMATCHING fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; dComIfG_resDelete(&i_this->mPhase, "E_dn"); @@ -2535,6 +3239,19 @@ static int daE_DN_Delete(e_dn_class* i_this) { return 1; } +/* 80713CD8-80713CE4 0001D0 000C+00 1/0 0/0 0/0 .data jv_offset */ +Vec jv_offset = { 0.0f, 0.0f, 0.0f }; + +/* 80713CE4-80713D74 -00001 0090+00 1/1 0/0 0/0 .data jc_data */ +dJntColData_c jc_data[12] = { + {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, + {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, + {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, + {0, 1, 18, 10.0f, &jv_offset}, {0, 1, 23, 20.0f, &jv_offset}, + {0, 1, 24, 15.0f, &jv_offset}, {0, 1, 27, 20.0f, &jv_offset}, + {0, 1, 28, 15.0f, &jv_offset}, {0, 1, 32, 20.0f, &jv_offset}, +}; + /* 804ED8AC-804EDAEC 0087EC 0240+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ static int useHeapInit(fopAc_ac_c* a_this) { e_dn_class* i_this = (e_dn_class*)a_this; @@ -2561,23 +3278,23 @@ static int useHeapInit(fopAc_ac_c* a_this) { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_dn", 39); JUT_ASSERT(5420, modelData != 0); - i_this->field_0x5e4 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); - if (i_this->field_0x5e4 == NULL) { + i_this->mpKnifeModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->mpKnifeModel == NULL) { return 0; } modelData = (J3DModelData*)dComIfG_getObjectRes("E_dn", 41); JUT_ASSERT(5432, modelData != 0); - i_this->field_0x68c = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); - if (i_this->field_0x68c == NULL) { + i_this->mpShieldModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->mpShieldModel == NULL) { return 0; } if (i_this->field_0x5b7 == 1) { modelData = (J3DModelData*)dComIfG_getObjectRes("E_dn", 40); JUT_ASSERT(5443, modelData != 0); - i_this->field_0x690 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); - if (i_this->field_0x690 == NULL) { + i_this->mpSkullModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->mpSkullModel == NULL) { return 0; } } @@ -2587,7 +3304,6 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 804EDAEC-804EDE58 008A2C 036C+00 1/0 0/0 0/0 .text daE_DN_Create__FP10fopAc_ac_c */ static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { - // NONMATCHING e_dn_class* i_this = (e_dn_class*)a_this; fopAcM_SetupActor(a_this, e_dn_class); @@ -2652,7 +3368,7 @@ static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { static dCcD_SrcSph cc_sph_src = { { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fafdbf, 0x3}, 0x75}}, // mObj + {0x0, {{0x0, 0x0, 0x0}, {0xD8FBFDFf, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg {0x0}, // mGObjCo @@ -2668,7 +3384,7 @@ static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { static dCcD_SrcSph at_sph_src = { { - {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0x0, 0x0}, 0x0}}, // mObj + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0xD}, {0x0, 0x0}, 0x0}}, // mObj {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg {0x0}, // mGObjCo @@ -2682,9 +3398,9 @@ static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { static dCcD_SrcSph tate_sph_src = { { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj + {0x0, {{0x0, 0x0, 0x0}, {0xD8FBFDFF, 0x3}, 0x0}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_STONE, 0x5, 0x0, 0x0, 0x303}, // mGObjTg + {dCcD_SE_STONE, 0x5, 0x0, 0x0, 0x3}, // mGObjTg {0x0}, // mGObjCo }, // mObjInf { @@ -2697,12 +3413,12 @@ static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { i_this->field_0x6cc = (int)cM_rndF(65535.0f) & 0xFF00; if (i_this->field_0x5b6 == 0) { - i_this->mAction = 9; + i_this->mAction = ACTION_STAY; } if ((i_this->field_0x5b6 == 13 || i_this->field_0x5b6 == 14) || (i_this->field_0x5b6 == 15 || i_this->field_0x5b6 == 16)) { i_this->field_0x10d8 = 1; - i_this->mAction = 60; + i_this->mAction = ACTION_REG; fopAcM_OnStatus(a_this, fopAcM_STATUS_UNK_004000); i_this->mAcchCir.SetWall(80.0f, 2.0f); } @@ -2722,274 +3438,7 @@ static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { /* 804EDE58-804EE034 008D98 01DC+00 1/1 0/0 0/0 .text __ct__10e_dn_classFv */ e_dn_class::e_dn_class() {} -/* 804EE034-804EE07C 008F74 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -// cM3dGSph::~cM3dGSph() { -extern "C" void __dt__8cM3dGSphFv() { - // NONMATCHING -} - -/* 804EE07C-804EE0C4 008FBC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 804EE0C4-804EE190 009004 00CC+00 1/1 0/0 0/0 .text __dt__8dCcD_SphFv */ -// dCcD_Sph::~dCcD_Sph() { -extern "C" void __dt__8dCcD_SphFv() { - // NONMATCHING -} - -/* 804EE190-804EE214 0090D0 0084+00 1/1 0/0 0/0 .text __ct__8dCcD_SphFv */ -// dCcD_Sph::dCcD_Sph() { -extern "C" void __ct__8dCcD_SphFv() { - // NONMATCHING -} - -/* 804EE214-804EE270 009154 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - -/* 804EE270-804EE2E0 0091B0 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING -} - -/* 804EE2E0-804EE350 009220 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING -} - -/* 804EE350-804EE354 009290 0004+00 1/1 0/0 0/0 .text __ct__5csXyzFv */ -// csXyz::csXyz() { -extern "C" void __ct__5csXyzFv() { - /* empty function */ -} - -/* 804EE354-804EE39C 009294 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* 804EE3E4-804EE420 009324 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_dn_cpp */ -void __sinit_d_a_e_dn_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x804EE3E4, __sinit_d_a_e_dn_cpp); -#pragma pop - -/* 804EE420-804EE428 009360 0008+00 1/0 0/0 0/0 .text @20@__dt__14dBgS_ObjGndChkFv */ -static void func_804EE420() { - // NONMATCHING -} - -/* 804EE428-804EE430 009368 0008+00 1/0 0/0 0/0 .text @76@__dt__14dBgS_ObjGndChkFv */ -static void func_804EE428() { - // NONMATCHING -} - -/* 804EE430-804EE438 009370 0008+00 1/0 0/0 0/0 .text @60@__dt__14dBgS_ObjGndChkFv */ -static void func_804EE430() { - // NONMATCHING -} - -/* 804EE438-804EE440 009378 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_804EE438() { - // NONMATCHING -} - -/* 804EE440-804EE448 009380 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_804EE440() { - // NONMATCHING -} - -/* 804EE85C-804EE898 00979C 003C+00 1/1 0/0 0/0 .text __dt__5csXyzFv */ -// csXyz::~csXyz() { -extern "C" void __dt__5csXyzFv() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 804EEF98-804EEF9C 0000B0 0004+00 0/0 0/0 0/0 .bss - * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ -#pragma push -#pragma force_active on -static u8 data_804EEF98[4]; -#pragma pop - -/* 804EEF9C-804EEFA0 0000B4 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14JASAudioThread> */ -#pragma push -#pragma force_active on -static u8 data_804EEF9C[4]; -#pragma pop - -/* 804EEFA0-804EEFA4 0000B8 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ -#pragma push -#pragma force_active on -static u8 data_804EEFA0[4]; -#pragma pop - -/* 804EEFA4-804EEFA8 0000BC 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_804EEFA4[4]; -#pragma pop - -/* 804EEFA8-804EEFAC 0000C0 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFA8[4]; -#pragma pop - -/* 804EEFAC-804EEFB0 0000C4 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFAC[4]; -#pragma pop - -/* 804EEFB0-804EEFB4 0000C8 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFB0[4]; -#pragma pop - -/* 804EEFB4-804EEFB8 0000CC 0004+00 0/0 0/0 0/0 .bss - * sInstance__36JASGlobalInstance<15JAISoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_804EEFB4[4]; -#pragma pop - -/* 804EEFB8-804EEFBC 0000D0 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_804EEFB8[4]; -#pragma pop - -/* 804EEFBC-804EEFC0 0000D4 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ -#pragma push -#pragma force_active on -static u8 data_804EEFBC[4]; -#pragma pop - -/* 804EEFC0-804EEFC4 0000D8 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ -#pragma push -#pragma force_active on -static u8 data_804EEFC0[4]; -#pragma pop - -/* 804EEFC4-804EEFC8 0000DC 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_804EEFC4[4]; -#pragma pop - -/* 804EEFC8-804EEFCC 0000E0 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ -#pragma push -#pragma force_active on -static u8 data_804EEFC8[4]; -#pragma pop - -/* 804EEFCC-804EEFD0 0000E4 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFCC[4]; -#pragma pop - -/* 804EEFD0-804EEFD4 0000E8 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAISoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_804EEFD0[4]; -#pragma pop - -/* 804EEFD4-804EEFD8 0000EC 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13JAUSoundTable> */ -#pragma push -#pragma force_active on -static u8 data_804EEFD4[4]; -#pragma pop - -/* 804EEFD8-804EEFDC 0000F0 0004+00 0/0 0/0 0/0 .bss - * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ -#pragma push -#pragma force_active on -static u8 data_804EEFD8[4]; -#pragma pop - -/* 804EEFDC-804EEFE0 0000F4 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_804EEFDC[4]; -#pragma pop - -/* 804EEFE0-804EEFE4 0000F8 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFE0[4]; -#pragma pop - -/* 804EEFE4-804EEFE8 0000FC 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ -#pragma push -#pragma force_active on -static u8 data_804EEFE4[4]; -#pragma pop - -/* 804EEFE8-804EEFEC 000100 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFE8[4]; -#pragma pop - -/* 804EEFEC-804EEFF0 000104 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFEC[4]; -#pragma pop - -/* 804EEFF0-804EEFF4 000108 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFF0[4]; -#pragma pop - -/* 804EEFF4-804EEFF8 00010C 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> - */ -#pragma push -#pragma force_active on -static u8 data_804EEFF4[4]; -#pragma pop - -/* 804EEFF8-804EEFFC 000110 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ -#pragma push -#pragma force_active on -static u8 data_804EEFF8[4]; -#pragma pop - -/* 804EEA34-804EEA34 000188 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +AUDIO_INSTANCES; /* 804EEDF8-804EEE18 -00001 0020+00 1/0 0/0 0/0 .data l_daE_DN_Method */ static actor_method_class l_daE_DN_Method = { diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 907030c86e5..71d7ee4cdf1 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -13,27 +13,64 @@ UNK_REL_DATA; #include "d/actor/d_a_horse.h" #include "d/d_com_inf_game.h" -#define ACTION_NORMAL 0 -#define ACTION_FIGHT_RUN 3 -#define ACTION_ATTACK 5 -#define ACTION_TAIL_ATTACK 6 -#define ACTION_GUARD 7 -#define ACTION_JUMP 8 -#define ACTION_STAY 9 -#define ACTION_OTOREAC 10 -#define ACTION_BOMB_ACTION 11 -#define ACTION_DRAWBACK 12 -#define ACTION_WOLFBITE 13 -#define ACTION_S_DAMAGE 20 -#define ACTION_DAMAGE 21 -#define ACTION_BACKDROP 23 -#define ACTION_WATER 24 -#define ACTION_GAKEJUMP 25 +enum Action { + /* 0x00 */ ACTION_NORMAL = 0, + /* 0x03 */ ACTION_FIGHT_RUN = 3, + /* 0x05 */ ACTION_ATTACK = 5, + /* 0x06 */ ACTION_TAIL_ATTACK = 6, + /* 0x07 */ ACTION_GUARD = 7, + /* 0x08 */ ACTION_JUMP = 8, + /* 0x09 */ ACTION_STAY = 9, + /* 0x0A */ ACTION_OTOREAC = 10, + /* 0x0B */ ACTION_BOMB_ACTION = 11, + /* 0x0C */ ACTION_DRAWBACK = 12, + /* 0x0D */ ACTION_WOLFBITE = 13, + /* 0x14 */ ACTION_S_DAMAGE = 20, + /* 0x15 */ ACTION_DAMAGE = 21, + /* 0x17 */ ACTION_BACKDROP = 23, + /* 0x18 */ ACTION_WATER = 24, + /* 0x19 */ ACTION_GAKEJUMP = 25, +}; + +enum Animation { + /* 0x04 */ ANM_ATTACK_TAIL_01 = 4, + /* 0x05 */ ANM_ATTACK_TAIL_02, + /* 0x06 */ ANM_ATTACK_TAIL_03, + /* 0x07 */ ANM_ATTACK_00, + /* 0x08 */ ANM_ATTACK_01, + /* 0x09 */ ANM_BLOWNOFF, + /* 0x0A */ ANM_BRUSH_LEFT_UP, + /* 0x0B */ ANM_BRUSH_RIGHT_UP, + /* 0x0C */ ANM_DAMAGE_W, + /* 0x0D */ ANM_DIE_LEFT, + /* 0x0E */ ANM_DIE_LEFT_UP, + /* 0x0F */ ANM_DIE_RIGHT, + /* 0x10 */ ANM_DIE_RIGHT_UP, + /* 0x11 */ ANM_DIE_W, + /* 0x12 */ ANM_DRAWBACK, + /* 0x13 */ ANM_DROWNED_A, + /* 0x14 */ ANM_DROWNED_B, + /* 0x15 */ ANM_FIND, + /* 0x16 */ ANM_GUARD, + /* 0x17 */ ANM_HANGED, + /* 0x18 */ ANM_HANGED_DAMAGE, + /* 0x19 */ ANM_HANGED_BRUSH, + /* 0x1A */ ANM_HANGED_WAIT, + /* 0x1B */ ANM_JUMP_A, + /* 0x1C */ ANM_JUMP_B, + /* 0x1D */ ANM_JUMP_C, + /* 0x1E */ ANM_RUN, + /* 0x1F */ ANM_WAIT_01, + /* 0x20 */ ANM_WAIT_02, + /* 0x21 */ ANM_WAIT_03, + /* 0x22 */ ANM_WAIT_04, + /* 0x23 */ ANM_WALK, +}; /* 8070A70C-8070A77C 0000EC 0070+00 1/1 0/0 0/0 .text __ct__12daE_MF_HIO_cFv */ daE_MF_HIO_c::daE_MF_HIO_c() { field_0x4 = -1; - base_size = 1.3f; + model_size = 1.3f; movement_speed = 8.0f; dash_speed = 28.0f; battle_init_range = 300.0f; @@ -64,10 +101,10 @@ static void mf_disappear(e_mf_class* i_this) { } /* 8070A82C-8070A8D8 00020C 00AC+00 16/16 0/0 0/0 .text anm_init__FP10e_mf_classifUcf */ -static void anm_init(e_mf_class* i_this, int param_2, f32 i_morf, u8 i_attr, f32 i_rate) { - i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_mf", param_2), i_attr, i_morf, +static void anm_init(e_mf_class* i_this, int i_anmID, f32 i_morf, u8 i_attr, f32 i_rate) { + i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_mf", i_anmID), i_attr, i_morf, i_rate, 0.0f, -1.0f); - i_this->field_0x5e0 = param_2; + i_this->mAnmID = i_anmID; } /* 8070A8D8-8070AD94 0002B8 04BC+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ @@ -182,10 +219,10 @@ static int daE_MF_Draw(e_mf_class* i_this) { } } - g_env_light.setLightTevColorType_MAJI(i_this->field_0x5e4, &a_this->tevStr); - mDoExt_modelUpdateDL(i_this->field_0x5e4); - g_env_light.setLightTevColorType_MAJI(i_this->field_0x68c, &a_this->tevStr); - mDoExt_modelUpdateDL(i_this->field_0x68c); + g_env_light.setLightTevColorType_MAJI(i_this->mpAxeModel, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->mpAxeModel); + g_env_light.setLightTevColorType_MAJI(i_this->mpShieldModel, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->mpShieldModel); cXyz sp50; sp50.set(a_this->current.pos.x, a_this->current.pos.y + 50.0f, a_this->current.pos.z); @@ -193,8 +230,8 @@ static int daE_MF_Draw(e_mf_class* i_this) { a_this->current.pos.y, i_this->mObjAcch.GetGroundH(), i_this->mObjAcch.m_gnd, &a_this->tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); - dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x5e4); - dComIfGd_addRealShadow(i_this->mShadowKey, i_this->field_0x68c); + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->mpAxeModel); + dComIfGd_addRealShadow(i_this->mShadowKey, i_this->mpShieldModel); return 1; } @@ -447,7 +484,7 @@ static void e_mf_stay(e_mf_class* i_this) { i_this->field_0x6d4 = 5; switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.1f) + 0.9f); + anm_init(i_this, ANM_WAIT_01, 10.0f, 2, cM_rndF(0.1f) + 0.9f); i_this->field_0x5b4 = 1; // fallthrough case 1: @@ -467,7 +504,7 @@ static void e_mf_stay(e_mf_class* i_this) { case 2: if (i_this->field_0x6c0[0] == 0) { - anm_init(i_this, 21, 3.0f, 0, 1.5f); + anm_init(i_this, ANM_FIND, 3.0f, 0, 1.5f); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND, -1); i_this->field_0x5b4 = 3; } @@ -489,13 +526,13 @@ static void e_mf_stay(e_mf_class* i_this) { if (i_this->field_0x6c0[0] == 0) { i_this->field_0x5b4 = 10; i_this->field_0x6c0[0] = cM_rndF(10.0f) + 30.0f; - anm_init(i_this, 33, 5.0f, 2, 1.5f); + anm_init(i_this, ANM_WAIT_03, 5.0f, 2, 1.5f); } break; case 5: if (i_this->field_0x6c0[0] == 0) { - anm_init(i_this, 21, 3.0f, 0, 1.5f); + anm_init(i_this, ANM_FIND, 3.0f, 0, 1.5f); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND, -1); i_this->field_0x5b4 = 6; } @@ -512,7 +549,7 @@ static void e_mf_stay(e_mf_class* i_this) { if (i_this->field_0x6c0[0] == 0) { i_this->field_0x5b4 = 10; i_this->field_0x6c0[0] = cM_rndF(40.0f) + 50.0f; - anm_init(i_this, 34, 5.0f, 2, 1.3f); + anm_init(i_this, ANM_WAIT_04, 5.0f, 2, 1.3f); i_this->mpModelMorf->setFrame(cM_rndF(75.0f)); } break; @@ -550,13 +587,13 @@ static void e_mf_otoreac(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 31, 10.0f, 2, cM_rndF(0.2f) + 1.5f); + anm_init(i_this, ANM_WAIT_01, 10.0f, 2, cM_rndF(0.2f) + 1.5f); i_this->field_0x6c0[0] = cM_rndF(10.0f) + 20.0f; i_this->field_0x5b4 = 1; // fallthrough case 1: if (i_this->field_0x6c0[0] == 0) { - anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + anm_init(i_this, ANM_RUN, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); i_this->field_0x5b4 = 2; } break; @@ -577,7 +614,7 @@ static void e_mf_otoreac(e_mf_class* i_this) { i_this->mAction = 0; i_this->field_0x5b4 = 0; i_this->field_0x6c0[0] = cM_rndF(50.0f) + 50.0f; - anm_init(i_this, 33, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_03, 10.0f, 2, 1.0f); } break; @@ -616,7 +653,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 21, 3.0f, 0, 1.5f); + anm_init(i_this, ANM_FIND, 3.0f, 0, 1.5f); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND_BOMB, -1); i_this->field_0x5b4 = 1; break; @@ -629,13 +666,13 @@ static void e_mf_bomb_action(e_mf_class* i_this) { case 2: i_this->field_0x5b4 = 3; - anm_init(i_this, 31, 5.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_01, 5.0f, 2, 1.0f); i_this->field_0x6c0[1] = cM_rndF(10.0f) + 10.0f; // fallthrough case 3: if (i_this->field_0x6c0[1] == 0 && bomb->speedF < 0.1f) { i_this->field_0x5b4 = 4; - anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + anm_init(i_this, ANM_RUN, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); } break; @@ -652,7 +689,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { fVar1 = l_HIO.dash_speed; if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) > 600.0f) { i_this->field_0x5b4 = 5; - anm_init(i_this, 31, 5.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_01, 5.0f, 2, 1.0f); } break; @@ -671,7 +708,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { if (JMAFastSqrt(sp3c.x * sp3c.x + sp3c.z * sp3c.z) < 100.0f) { i_this->field_0x6c0[0] = 20; i_this->field_0x5b4 = 11; - anm_init(i_this, 30, 5.0f, 0, cM_rndFX(0.05f) + 1.0f); + anm_init(i_this, ANM_RUN, 5.0f, 0, cM_rndFX(0.05f) + 1.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_KICK_BOMB, -1); } @@ -703,7 +740,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { } if (i_this->field_0x6c0[0] == 0) { - anm_init(i_this, 31, 5.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_01, 5.0f, 2, 1.0f); i_this->field_0x5b4 = 5; } } @@ -745,7 +782,7 @@ static void e_mf_normal(e_mf_class* i_this) { } i_this->field_0x5d4 = a_this->current.angle.y + sVar2; - anm_init(i_this, 35, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WALK, 10.0f, 2, 1.0f); i_this->field_0x5b4 = 3; i_this->field_0x6c0[0] = cM_rndF(100.0f) + 100.0f; } else { @@ -776,7 +813,7 @@ static void e_mf_normal(e_mf_class* i_this) { (i_this->field_0x6c0[1] == 0 && (fopAcM_wayBgCheck(a_this, 200.0f, 50.0f) || move_gake_check(i_this, 200.0f, 0)))) { i_this->field_0x5b4 = 2; i_this->field_0x6c0[0] = cM_rndF(100.0f) + 50.0f; - anm_init(i_this, 33, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_03, 10.0f, 2, 1.0f); } break; } @@ -804,7 +841,7 @@ static void e_mf_drawback(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 18, 5.0f, 0, 1.0f); + anm_init(i_this, ANM_DRAWBACK, 5.0f, 0, 1.0f); i_this->field_0x5b4 = 1; a_this->speedF = -5.0f; i_this->field_0x6c8 = 10; @@ -842,7 +879,7 @@ static void e_mf_wolfbite(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 23, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_HANGED, 3.0f, 0, 1.0f); i_this->field_0x5b4 = 1; i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_DRAWBACK, -1); a_this->health -= 10; @@ -851,21 +888,21 @@ static void e_mf_wolfbite(e_mf_class* i_this) { case 1: if (i_this->mpModelMorf->isStop()) { - anm_init(i_this, 26, 3.0f, 2, 1.0f); + anm_init(i_this, ANM_HANGED_WAIT, 3.0f, 2, 1.0f); i_this->field_0x5b4 = 2; } break; case 2: - if (i_this->field_0x5e0 == 24) { + if (i_this->mAnmID == ANM_HANGED_DAMAGE) { if (i_this->mpModelMorf->isStop()) { - anm_init(i_this, 26, 3.0f, 2, 1.0f); + anm_init(i_this, ANM_HANGED_WAIT, 3.0f, 2, 1.0f); } } if (a_this->health <= 0 || a_this->checkWolfBiteDamage()) { a_this->offWolfBiteDamage(); - anm_init(i_this, 24, 2.0f, 0, 1.0f); + anm_init(i_this, ANM_HANGED_DAMAGE, 2.0f, 0, 1.0f); a_this->health -= 10; if (a_this->health <= 0) { player->offWolfEnemyHangBite(); @@ -887,7 +924,7 @@ static void e_mf_wolfbite(e_mf_class* i_this) { i_this->field_0x10b8++; if (i_this->field_0x10b8 >= 4) { player->offWolfEnemyHangBite(); - anm_init(i_this, 25, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_HANGED_BRUSH, 3.0f, 0, 1.0f); i_this->field_0x5b4 = 3; } @@ -896,7 +933,7 @@ static void e_mf_wolfbite(e_mf_class* i_this) { } if (!player->checkWolfEnemyHangBiteOwn(a_this)) { - anm_init(i_this, 25, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_HANGED_BRUSH, 3.0f, 0, 1.0f); i_this->field_0x5b4 = 3; } break; @@ -962,7 +999,7 @@ static void e_mf_fight_run(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case -10: - anm_init(i_this, 31, 5.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_01, 5.0f, 2, 1.0f); i_this->field_0x6c0[1] = cM_rndF(10.0f) + 15.0f; i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_FIND, -1); i_this->field_0x5b4 = -9; @@ -976,7 +1013,7 @@ static void e_mf_fight_run(e_mf_class* i_this) { break; case 0: - anm_init(i_this, 30, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); + anm_init(i_this, ANM_RUN, 5.0f, 2, cM_rndFX(0.05f) + 1.0f); i_this->field_0x5b4 = 1; i_this->field_0x80c = 0; // fallthrough @@ -993,7 +1030,7 @@ static void e_mf_fight_run(e_mf_class* i_this) { if (i_this->mObjAcch.ChkWallHit() != 0 && !fopAcM_wayBgCheck(a_this, 200.0f, 120.0f)) { i_this->field_0x80c++; } else if (i_this->mPlayerDistance < l_HIO.battle_init_range) { - anm_init(i_this, 32, 5.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_02, 5.0f, 2, 1.0f); i_this->field_0x5b4 = 2; i_this->field_0x6c0[2] = cM_rndF(30.0f) + 30.0f; } @@ -1091,7 +1128,7 @@ static void e_mf_fight_run(e_mf_class* i_this) { i_this->mAction = 0; i_this->field_0x5b4 = 0; i_this->field_0x6c0[0] = cM_rndF(50.0f) + 50.0f; - anm_init(i_this, 33, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_03, 10.0f, 2, 1.0f); if (i_this->field_0x80e == 0) { return; @@ -1174,7 +1211,7 @@ static void e_mf_jump(e_mf_class* i_this) { i_this->field_0x6d4 = 1; switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 27, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_JUMP_A, 3.0f, 0, 1.0f); i_this->field_0x5b4 = 1; return; @@ -1191,7 +1228,7 @@ static void e_mf_jump(e_mf_class* i_this) { case 2: a_this->speedF = 30.0f; if (a_this->speed.y <= 0.0f) { - anm_init(i_this, 28, 5.0f, 0, 1.0f); + anm_init(i_this, ANM_JUMP_B, 5.0f, 0, 1.0f); i_this->field_0x5b4 = 3; } return; @@ -1201,7 +1238,7 @@ static void e_mf_jump(e_mf_class* i_this) { return; } - anm_init(i_this, 29, 1.0f, 0, 1.0f); + anm_init(i_this, ANM_JUMP_C, 1.0f, 0, 1.0f); i_this->field_0x5b4 = 4; i_this->field_0x10c4 = 3; i_this->field_0x6c0[0] = 3; @@ -1233,14 +1270,14 @@ static void e_mf_gakejump(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: if (jump_pos_check(i_this, &i_this->field_0x5bc)) { - anm_init(i_this, 27, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_JUMP_A, 3.0f, 0, 1.0f); i_this->field_0x5b4 = 2; a_this->current.angle.y = i_this->mYAngleToPlayer; return; } - if (i_this->field_0x5e0 != 31) { - anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + if (i_this->mAnmID != ANM_WAIT_01) { + anm_init(i_this, ANM_WAIT_01, 5.0f, 2, cM_rndF(0.1f) + 0.9f); i_this->field_0x6c0[0] = cM_rndF(15.0f) + 35.0f; i_this->field_0x5b4 = 1; } @@ -1277,7 +1314,7 @@ static void e_mf_gakejump(e_mf_class* i_this) { i_this->field_0x6c0[1] = 60; i_this->field_0x5c8 = a_this->current.pos; } else { - anm_init(i_this, 31, 5.0f, 2, cM_rndF(0.1f) + 0.9f); + anm_init(i_this, ANM_WAIT_01, 5.0f, 2, cM_rndF(0.1f) + 0.9f); i_this->field_0x6c0[0] = cM_rndF(15.0f) + 35.0f; i_this->field_0x5b4 = 1; return; @@ -1291,12 +1328,12 @@ static void e_mf_gakejump(e_mf_class* i_this) { a_this->speedF = 50.0f; if (i_this->field_0x6c0[0] == 1) { - anm_init(i_this, 28, 5.0f, 0, 1.0f); + anm_init(i_this, ANM_JUMP_B, 5.0f, 0, 1.0f); } if (sp24.abs() < (a_this->speedF * 1.1f)) { a_this->current.pos = i_this->field_0x5bc; - anm_init(i_this, 29, 1.0f, 0, 1.0f); + anm_init(i_this, ANM_JUMP_C, 1.0f, 0, 1.0f); i_this->field_0x5b4 = 4; i_this->field_0x10c4 = 3; i_this->field_0x6c0[0] = 3; @@ -1349,7 +1386,7 @@ static void e_mf_attack(e_mf_class* i_this) { s16 sVar1, sVar2; switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 5, 6.0f, 0, 1.0f); + anm_init(i_this, ANM_ATTACK_TAIL_02, 6.0f, 0, 1.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_KNIFE2_A, -1); i_this->field_0x5b4 = 1; // fallthrough @@ -1433,7 +1470,7 @@ static void e_mf_tail_attack(e_mf_class* i_this) { i_this->field_0x6d4 = 1; switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 8, 5.0f, 0, 1.0f); + anm_init(i_this, ANM_ATTACK_01, 5.0f, 0, 1.0f); i_this->mpModelMorf->setFrame(20.0f); i_this->field_0x5b4 = 1; i_this->field_0x6c0[1] = 0; @@ -1459,7 +1496,7 @@ static void e_mf_tail_attack(e_mf_class* i_this) { if (i_this->field_0x6c0[1] != 0 && i_this->mpModelMorf->checkFrame(55.0f)) { i_this->mAction = 5; i_this->field_0x5b4 = 1; - anm_init(i_this, 5, 4.0f, 0, 1.0f); + anm_init(i_this, ANM_ATTACK_TAIL_02, 4.0f, 0, 1.0f); i_this->mpModelMorf->setFrame(20.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_KNIFE2_A, -1); return; @@ -1496,7 +1533,7 @@ static void e_mf_guard(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 32, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_WAIT_02, 3.0f, 0, 1.0f); i_this->field_0x5b4 = 1; a_this->speed.y = 20.0f; a_this->speedF = -8.0f; @@ -1512,7 +1549,7 @@ static void e_mf_guard(e_mf_class* i_this) { break; case 5: - anm_init(i_this, 22, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_GUARD, 3.0f, 0, 1.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_GUARD, -1); i_this->field_0x5b4 = 6; // fallthrough @@ -1565,7 +1602,7 @@ static void e_mf_s_damage(e_mf_class* i_this) { case 0: i_this->field_0x5b4 = 1; i_this->field_0x6c0[0] = 20; - anm_init(i_this, 31, 10.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_01, 10.0f, 2, 1.0f); break; case 1: @@ -1686,7 +1723,7 @@ static void e_mf_damage(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 9, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_BLOWNOFF, 3.0f, 0, 1.0f); i_this->field_0x5b4 = 1; a_this->speedF = 0.0f; i_this->field_0x7c8 = 8000.0f; @@ -1743,9 +1780,9 @@ static void e_mf_damage(e_mf_class* i_this) { i_this->mSound.startCreatureSound(Z2SE_CM_BODYFALL_L, 0, -1); if (i_this->field_0x717 == 0) { - anm_init(i_this, 13, 5.0f, 0, 1.0f); + anm_init(i_this, ANM_DIE_LEFT, 5.0f, 0, 1.0f); } else { - anm_init(i_this, 15, 5.0f, 0, 1.0f); + anm_init(i_this, ANM_DIE_RIGHT, 5.0f, 0, 1.0f); } if (i_this->field_0x6f0 != 0) { @@ -1793,9 +1830,9 @@ static void e_mf_damage(e_mf_class* i_this) { i_this->field_0x716 = 10; if (i_this->field_0x717 == 0) { - anm_init(i_this, 13, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_DIE_LEFT, 3.0f, 0, 1.0f); } else { - anm_init(i_this, 15, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_DIE_RIGHT, 3.0f, 0, 1.0f); } i_this->field_0x6e4 = 0.0f; @@ -1848,9 +1885,9 @@ static void e_mf_damage(e_mf_class* i_this) { if (daPy_getPlayerActorClass()->getCutType() != daPy_py_c::CUT_TYPE_DOWN && i_this->field_0x6c0[0] == 0) { i_this->field_0x5b4 = 20; if (i_this->field_0x717 == 0) { - anm_init(i_this, 14, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_DIE_LEFT_UP, 3.0f, 0, 1.0f); } else { - anm_init(i_this, 16, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_DIE_RIGHT_UP, 3.0f, 0, 1.0f); } i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_UP, -1); @@ -1895,7 +1932,7 @@ static void e_mf_damage(e_mf_class* i_this) { if (i_this->mpModelMorf->isStop()) { i_this->field_0x704.y = 0; i_this->field_0x704.x = 0; - anm_init(i_this, 31, 0.0f, 2, 1.0f); + anm_init(i_this, ANM_WAIT_01, 0.0f, 2, 1.0f); i_this->field_0x6c0[0] = 5; i_this->field_0x5b4 = 21; @@ -1927,9 +1964,9 @@ static void e_mf_damage(e_mf_class* i_this) { if (i_this->field_0x6c0[0] == 0) { i_this->field_0x5b4 = 31; if (i_this->field_0x717 == 0) { - anm_init(i_this, 10, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_BRUSH_LEFT_UP, 3.0f, 0, 1.0f); } else { - anm_init(i_this, 11, 3.0f, 0, 1.0f); + anm_init(i_this, ANM_BRUSH_RIGHT_UP, 3.0f, 0, 1.0f); } i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_UP, -1); @@ -1968,7 +2005,7 @@ static void e_mf_backdrop(e_mf_class* i_this) { switch (i_this->field_0x5b4) { case 0: - anm_init(i_this, 18, 3.0f, 0, 0.5f); + anm_init(i_this, ANM_DRAWBACK, 3.0f, 0, 0.5f); i_this->field_0x5b4 = 1; i_this->field_0x704.y = a_this->shape_angle.y; i_this->field_0x704.x = 0; @@ -2013,9 +2050,9 @@ static void e_mf_water(e_mf_class* i_this) { case 1: a_this->speed.y = 0.0f; if (i_this->field_0x717 == 0) { - anm_init(i_this, 19, 3.0f, 2, 1.0f); + anm_init(i_this, ANM_DROWNED_A, 3.0f, 2, 1.0f); } else { - anm_init(i_this, 20, 3.0f, 2, 1.0f); + anm_init(i_this, ANM_DROWNED_B, 3.0f, 2, 1.0f); } i_this->field_0x6c0[0] = 60; @@ -2445,7 +2482,7 @@ static void action(e_mf_class* i_this) { } else { sp240 = player->eyePos - a_this->current.pos; } - sp240.y += l_HIO.base_size * -150.0f; + sp240.y += l_HIO.model_size * -150.0f; s16 sVar2 = cM_atan2s(sp240.x, sp240.z) - a_this->shape_angle.y; s16 sVar3 = a_this->shape_angle.x + cM_atan2s(sp240.y, JMAFastSqrt(sp240.x * sp240.x + sp240.z * sp240.z)); @@ -2689,50 +2726,50 @@ static void action(e_mf_class* i_this) { } } - cLib_addCalcAngleS2(&i_this->field_0x70a.x, i_this->field_0x710.x, 1, 0x400); - cLib_addCalcAngleS2(&i_this->field_0x70a.z, i_this->field_0x710.z, 1, 0x400); + cLib_addCalcAngleS2(&i_this->field_0x70a.x, i_this->field_0x710.x, 1, 0x400); + cLib_addCalcAngleS2(&i_this->field_0x70a.z, i_this->field_0x710.z, 1, 0x400); - if (i_this->field_0x10c4 != 0) { - model = i_this->mpModelMorf->getModel(); - sp240.set(0.0f, 0.0f, 0.0f); + if (i_this->field_0x10c4 != 0) { + model = i_this->mpModelMorf->getModel(); + sp240.set(0.0f, 0.0f, 0.0f); - static int foot_idx[2] = { - 26, 30, - }; - for (int i = 0; i < 2; i++) { - if ((i_this->field_0x10c4 == 3 || (i_this->field_0x10c4 == 2 && i == 1)) || (i_this->field_0x10c4 == 1 && i == 0)) { - MTXCopy(model->getAnmMtx(foot_idx[i]), *calc_mtx); - MtxPosition(&sp240, &sp24c); - fopAcM_effSmokeSet1(&i_this->field_0x10c8[i], &i_this->field_0x10d0[i], &sp24c, &a_this->shape_angle, 1.0f, &a_this->tevStr, 0); - } + static int foot_idx[2] = { + 26, 30, + }; + for (int i = 0; i < 2; i++) { + if ((i_this->field_0x10c4 == 3 || (i_this->field_0x10c4 == 2 && i == 1)) || (i_this->field_0x10c4 == 1 && i == 0)) { + MTXCopy(model->getAnmMtx(foot_idx[i]), *calc_mtx); + MtxPosition(&sp240, &sp24c); + fopAcM_effSmokeSet1(&i_this->field_0x10c8[i], &i_this->field_0x10d0[i], &sp24c, &a_this->shape_angle, 1.0f, &a_this->tevStr, 0); } - - i_this->field_0x10c4 = 0; } - if (i_this->field_0x10ba != 0) { - i_this->field_0x10ba--; - if (i_this->field_0x10ba == 0) { - dComIfGp_particle_set(0x15E, &a_this->eyePos, &a_this->shape_angle, NULL); - } + i_this->field_0x10c4 = 0; + } + + if (i_this->field_0x10ba != 0) { + i_this->field_0x10ba--; + if (i_this->field_0x10ba == 0) { + dComIfGp_particle_set(0x15E, &a_this->eyePos, &a_this->shape_angle, NULL); } + } } /* 807119BC-80711CB8 00739C 02FC+00 1/1 0/0 0/0 .text anm_se_set__FP10e_mf_class */ static void anm_se_set(e_mf_class* i_this) { int frame = i_this->mpModelMorf->getFrame(); - if (i_this->field_0x5e0 == 8) { + if (i_this->mAnmID == ANM_ATTACK_01) { if (frame == 35) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_TAIL, 0, -1); } else if (frame == 28) { i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_TAIL, -1); } - } else if (i_this->field_0x5e0 == 4) { + } else if (i_this->mAnmID == ANM_ATTACK_TAIL_01) { if (frame == 18) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_KNIFE, 0, -1); } - } else if (i_this->field_0x5e0 == 5) { + } else if (i_this->mAnmID == ANM_ATTACK_TAIL_02) { if (frame == 10) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_KNIFE2_A, 0, -1); } @@ -2740,24 +2777,24 @@ static void anm_se_set(e_mf_class* i_this) { if (frame == 24) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_KNIFE2_B, 0, -1); } - } else if (i_this->field_0x5e0 == 35) { + } else if (i_this->mAnmID == ANM_WALK) { if (frame == 3) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_L, 0, -1); } else if (frame == 18) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_R, 0, -1); } - } else if (i_this->field_0x5e0 == 30) { + } else if (i_this->mAnmID == ANM_RUN) { if (frame == 10) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_L, 0, -1); } else if (frame == 4) { i_this->mSound.startCreatureSound(Z2SE_EN_MF_FN_RUN_R, 0, -1); i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_BREATH, -1); } - } else if (i_this->field_0x5e0 == 33) { + } else if (i_this->mAnmID == ANM_WAIT_03) { if (frame == 15) { i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_SEARCH, -1); } - } else if (i_this->field_0x5e0 == 34 && frame == 15) { + } else if (i_this->mAnmID == ANM_WAIT_04 && frame == 15) { i_this->mSound.startCreatureVoice(Z2SE_EN_MF_V_SEARCH2, -1); } } @@ -2861,7 +2898,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { mDoMtx_stack_c::YrotM(a_this->shape_angle.y); mDoMtx_stack_c::XrotM(a_this->shape_angle.x); mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); - mDoMtx_stack_c::scaleM(l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x, l_HIO.base_size * a_this->scale.x); + mDoMtx_stack_c::scaleM(l_HIO.model_size * a_this->scale.x, l_HIO.model_size * a_this->scale.x, l_HIO.model_size * a_this->scale.x); J3DModel* model = i_this->mpModelMorf->getModel(); model->setBaseTRMtx(mDoMtx_stack_c::get()); @@ -2924,7 +2961,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { } MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(19), *calc_mtx); - i_this->field_0x5e4->setBaseTRMtx(*calc_mtx); + i_this->mpAxeModel->setBaseTRMtx(*calc_mtx); if (i_this->field_0x6cf != 0 && i_this->field_0x6ce <= 1) { sp2c.set(0.0f, 35.0f, 0.0f); @@ -2937,9 +2974,9 @@ static int daE_MF_Execute(e_mf_class* i_this) { } if (i_this->field_0x6ce == 1) { - i_this->field_0xe24.SetR(l_HIO.base_size * 80.0f); + i_this->field_0xe24.SetR(l_HIO.model_size * 80.0f); } else { - i_this->field_0xe24.SetR(l_HIO.base_size * 60.0f); + i_this->field_0xe24.SetR(l_HIO.model_size * 60.0f); } i_this->field_0xe24.SetAtAtp(2); @@ -2951,7 +2988,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { } MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(12), *calc_mtx); - i_this->field_0x68c->setBaseTRMtx(*calc_mtx); + i_this->mpShieldModel->setBaseTRMtx(*calc_mtx); if (i_this->field_0x6cf != 0 && i_this->field_0x6ce == 2) { MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(34), *calc_mtx); @@ -2965,7 +3002,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { i_this->field_0xe24.MoveCAt(sp38); } - i_this->field_0xe24.SetR(70.0f * l_HIO.base_size); + i_this->field_0xe24.SetR(70.0f * l_HIO.model_size); i_this->field_0xe24.SetAtAtp(3); i_this->field_0xe24.SetAtSpl((dCcG_At_Spl)10); } @@ -2988,7 +3025,7 @@ static int daE_MF_Execute(e_mf_class* i_this) { sp2c.set(50.0f, 0.0f, 30.0f); MtxPosition(&sp2c, &sp38); i_this->field_0xf5c.SetC(sp38); - i_this->field_0xf5c.SetR(70.0f * l_HIO.base_size); + i_this->field_0xf5c.SetR(70.0f * l_HIO.model_size); if (i_this->field_0xf5c.ChkTgHit()) { def_se_set(&i_this->mSound, i_this->field_0xf5c.GetTgHitObj(), 40, 0); @@ -3117,15 +3154,15 @@ static int useHeapInit(fopAc_ac_c* a_this) { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_mf", 39); JUT_ASSERT(5274, modelData != 0); - i_this->field_0x5e4 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); - if (i_this->field_0x5e4 == NULL) { + i_this->mpAxeModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->mpAxeModel == NULL) { return 0; } modelData = (J3DModelData*)dComIfG_getObjectRes("E_mf", 40); JUT_ASSERT(5286, modelData != 0); - i_this->field_0x68c = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); - if (i_this->field_0x68c == NULL) { + i_this->mpShieldModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (i_this->mpShieldModel == NULL) { return 0; } From 2ba62d2256b106de155ec10982427211562b2951 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Fri, 20 Jun 2025 14:22:07 -0400 Subject: [PATCH 18/21] somehow accidentally took out something from gra2 in a previous commit --- include/d/actor/d_a_obj_gra2.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 5ae38ef7f7a..e289db8b3b5 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -86,6 +86,10 @@ class daObj_GrA_c : public daBaseNpc_moveBgActor_c { typedef int (daObj_GrA_c::*MotionFunc)(int); typedef int (daObj_GrA_c::*Process)(void*); + enum { + NUMLOOKMODES_e = 4, + }; + class daObj_GrA_prtclMngr_c { public: /* 80C04E14 */ ~daObj_GrA_prtclMngr_c() {} From 077203ba0478e2f69d5cf5028d1c78e7dce5f75c Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Fri, 20 Jun 2025 14:25:17 -0400 Subject: [PATCH 19/21] Fixed data layout issue in d_a_e_dn --- include/d/actor/d_a_e_dn.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/d/actor/d_a_e_dn.h b/include/d/actor/d_a_e_dn.h index 1c063d13812..cc1881f357c 100644 --- a/include/d/actor/d_a_e_dn.h +++ b/include/d/actor/d_a_e_dn.h @@ -113,6 +113,7 @@ class e_dn_class : public fopEn_enemy_c { /* 0x082F */ u8 field_0x82f; /* 0x0830 */ s16 field_0x830; /* 0x0832 */ s16 field_0x832; + /* 0x0834 */ u8 field_0x834[2]; /* 0x0836 */ csXyz field_0x836; /* 0x083C */ f32 field_0x83c; /* 0x0840 */ s16 field_0x840; From 4026d309354d62906156cd101f50d4a4b8026577 Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Fri, 20 Jun 2025 16:06:57 -0400 Subject: [PATCH 20/21] PR cleanup --- include/d/actor/d_a_e_mf.h | 2 +- src/d/actor/d_a_e_dn.cpp | 11 ++++++----- src/d/actor/d_a_e_mf.cpp | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index 6ecdfc99b3e..348a93466a1 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -139,7 +139,7 @@ STATIC_ASSERT(sizeof(e_mf_class) == 0x10ec); class daE_MF_HIO_c : public JORReflexible { public: /* 8070A70C */ daE_MF_HIO_c(); - /* 80713464 */ virtual ~daE_MF_HIO_c() {}; + /* 80713464 */ virtual ~daE_MF_HIO_c() {} void genMessage(JORMContext*); diff --git a/src/d/actor/d_a_e_dn.cpp b/src/d/actor/d_a_e_dn.cpp index 73443b29744..94ab10e0685 100644 --- a/src/d/actor/d_a_e_dn.cpp +++ b/src/d/actor/d_a_e_dn.cpp @@ -1851,7 +1851,7 @@ static void e_dn_damage(e_dn_class* i_this) { cLib_addCalcAngleS2(&i_this->field_0x724.x, -0x4000, 1, 0x300); if (i_this->mObjAcch.ChkGroundHit()) { - if (a_this->health > 0 && daPy_py_c::checkNowWolf() == 0) { + if (a_this->health > 0 && !daPy_py_c::checkNowWolf()) { a_this->onDownFlg(); } @@ -2271,7 +2271,7 @@ static void damage_check(e_dn_class* i_this) { if (i_this->field_0xa9c[i].ChkTgHit() != 0) { i_this->mAtInfo.mpCollider = i_this->field_0xa9c[i].GetTgHitObj(); if (player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_LEFT && player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_RIGHT && - i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK) != 0) { + i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK)) { if (!player->onWolfEnemyHangBite(dn_p)) { return; } @@ -2285,7 +2285,7 @@ static void damage_check(e_dn_class* i_this) { } i_this->field_0x10da = 3; - if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000) != 0) { + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000)) { wolfkick_damage(i_this); i_this->field_0x6e8 = 1000; } else { @@ -2297,7 +2297,7 @@ static void damage_check(e_dn_class* i_this) { i_this->mAtInfo.mHitStatus = 0; } - if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK) != 0) { + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK)) { i_this->field_0x6e8 = 20; } else { i_this->field_0x6e8 = 10; @@ -2308,7 +2308,7 @@ static void damage_check(e_dn_class* i_this) { } i_this->field_0x744 |= i_this->mAtInfo.mHitBit; - if (i_this->mAtInfo.mHitType == 16 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) != 0) { + if (i_this->mAtInfo.mHitType == 16 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) { a_this->health = sVar1; i_this->mAction = ACTION_DRAWBACK; i_this->mMode = 0; @@ -2464,6 +2464,7 @@ static void action(e_dn_class* i_this) { case ACTION_REG: e_dn_reg(i_this); + break; } f32 fVar6 = 0.0f; diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 71d7ee4cdf1..18c1194ad0c 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -2160,7 +2160,7 @@ static void damage_check(e_mf_class* i_this) { if (i_this->field_0xa7c[i].ChkTgHit() != 0) { i_this->mAtInfo.mpCollider = i_this->field_0xa7c[i].GetTgHitObj(); if (player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_LEFT && player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_RIGHT && - i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK) != 0) { + i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK)) { if (!player->onWolfEnemyHangBite(mf_p)) { return; } @@ -2174,7 +2174,7 @@ static void damage_check(e_mf_class* i_this) { } i_this->field_0x10ba = 3; - if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000) != 0) { + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000)) { wolfkick_damage(i_this); i_this->field_0x6c8 = 1000; } else { @@ -2186,7 +2186,7 @@ static void damage_check(e_mf_class* i_this) { i_this->mAtInfo.mHitStatus = 0; } - if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK) != 0) { + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK)) { i_this->field_0x6c8 = 20; } else { i_this->field_0x6c8 = 10; @@ -2197,7 +2197,7 @@ static void damage_check(e_mf_class* i_this) { } i_this->field_0x724 |= i_this->mAtInfo.mHitBit; - if (i_this->mAtInfo.mHitType == 16 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) != 0) { + if (i_this->mAtInfo.mHitType == 16 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) { a_this->health = sVar1; i_this->mAction = 12; i_this->field_0x5b4 = 0; @@ -2344,6 +2344,7 @@ static void action(e_mf_class* i_this) { case ACTION_GAKEJUMP: e_mf_gakejump(i_this); bVar1 = 1; + break; } f32 fVar6 = 0.0f; From ee452c0641edd8bf31bb6d2800bc26dd9cd431bb Mon Sep 17 00:00:00 2001 From: Carter <144170194+carter-ktb21@users.noreply.github.com> Date: Fri, 20 Jun 2025 16:11:26 -0400 Subject: [PATCH 21/21] Took out fopen_enemy_c inheritance --- include/d/actor/d_a_e_dn.h | 3 +- include/d/actor/d_a_e_mf.h | 3 +- src/d/actor/d_a_e_dn.cpp | 78 +++++++++++++++++++------------------- src/d/actor/d_a_e_mf.cpp | 74 ++++++++++++++++++------------------ 4 files changed, 80 insertions(+), 78 deletions(-) diff --git a/include/d/actor/d_a_e_dn.h b/include/d/actor/d_a_e_dn.h index cc1881f357c..7e5472f77bb 100644 --- a/include/d/actor/d_a_e_dn.h +++ b/include/d/actor/d_a_e_dn.h @@ -14,10 +14,11 @@ * @details * */ -class e_dn_class : public fopEn_enemy_c { +class e_dn_class { public: /* 804EDE58 */ e_dn_class(); + /* 0x0000 */ fopEn_enemy_c actor; /* 0x05AC */ request_of_phase_process_class mPhase; /* 0x05B4 */ s16 mMode; /* 0x05B6 */ u8 field_0x5b6; diff --git a/include/d/actor/d_a_e_mf.h b/include/d/actor/d_a_e_mf.h index 348a93466a1..d75a115010c 100644 --- a/include/d/actor/d_a_e_mf.h +++ b/include/d/actor/d_a_e_mf.h @@ -14,10 +14,11 @@ * @details * */ -class e_mf_class : public fopEn_enemy_c { +class e_mf_class { public: /* 80712F20 */ e_mf_class(); + /* 0x0000 */ fopEn_enemy_c actor; /* 0x05AC */ request_of_phase_process_class mPhase; /* 0x05B4 */ s16 field_0x5b4; /* 0x05B6 */ u8 field_0x5b6; diff --git a/src/d/actor/d_a_e_dn.cpp b/src/d/actor/d_a_e_dn.cpp index 94ab10e0685..355ea168387 100644 --- a/src/d/actor/d_a_e_dn.cpp +++ b/src/d/actor/d_a_e_dn.cpp @@ -88,7 +88,7 @@ daE_DN_HIO_c::daE_DN_HIO_c() { /* 804E5220-804E52D0 000160 00B0+00 2/2 0/0 0/0 .text dn_disappear__FP10e_dn_class */ static void dn_disappear(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp1c, sp28; MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); @@ -189,7 +189,7 @@ static int nodeCallBack(J3DJoint* i_joint, int param_2) { /* 804E5838-804E5B20 000778 02E8+00 1/0 0/0 0/0 .text daE_DN_Draw__FP10e_dn_class */ static int daE_DN_Draw(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; if (i_this->field_0x10d8 != 0) { return 1; @@ -251,7 +251,7 @@ static int daE_DN_Draw(e_dn_class* i_this) { /* 804E5B20-804E5BF8 000A60 00D8+00 2/2 0/0 0/0 .text other_bg_check__FP10e_dn_classP10fopAc_ac_c */ static BOOL other_bg_check(e_dn_class* i_this, fopAc_ac_c* i_actor) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_LinChk lin_chk; cXyz start, end; @@ -270,7 +270,7 @@ static BOOL other_bg_check(e_dn_class* i_this, fopAc_ac_c* i_actor) { /* 804E5BF8-804E5CD0 000B38 00D8+00 1/1 0/0 0/0 .text other_bg_check2__FP10e_dn_classP4cXyz */ static BOOL other_bg_check2(e_dn_class* i_this, cXyz* param_2) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_LinChk lin_chk; cXyz start, end; @@ -314,7 +314,7 @@ static void* s_b_sub(void* i_actor, void* i_data) { /* 804E5D4C-804E61D8 000C8C 048C+00 2/2 0/0 0/0 .text search_bomb__FP10e_dn_classi */ static dBomb_c* search_bomb(e_dn_class* i_this, int param_2) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBomb_c* bomb; if ((i_this->field_0x744 & 0x10000000) == 0) { return NULL; @@ -391,7 +391,7 @@ static dBomb_c* bomb_check(e_dn_class* i_this) { /* 804E6220-804E6264 001160 0044+00 1/1 0/0 0/0 .text player_way_check__FP10e_dn_class */ static BOOL player_way_check(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; s16 sVar1 = a_this->shape_angle.y - dComIfGp_getPlayer(0)->shape_angle.y; if ((int)sVar1 < 0) { @@ -407,7 +407,7 @@ static BOOL player_way_check(e_dn_class* i_this) { /* 804E6264-804E6340 0011A4 00DC+00 4/4 0/0 0/0 .text pl_check__FP10e_dn_classfs */ static int pl_check(e_dn_class* i_this, f32 param_2, s16 param_3) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); if (i_this->mPlayerDistance < param_2) { @@ -430,7 +430,7 @@ static int pl_check(e_dn_class* i_this, f32 param_2, s16 param_3) { /* 804E6340-804E6448 001280 0108+00 3/3 0/0 0/0 .text move_gake_check__FP10e_dn_classfSc */ static BOOL move_gake_check(e_dn_class* i_this, f32 param_2, s8 param_3) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_GndChk gnd_chk; cXyz sp84, sp90; @@ -455,7 +455,7 @@ static BOOL move_gake_check(e_dn_class* i_this, f32 param_2, s8 param_3) { /* 804E6448-804E6608 001388 01C0+00 1/1 0/0 0/0 .text jump_pos_check__FP10e_dn_classP4cXyz */ static BOOL jump_pos_check(e_dn_class* i_this, cXyz* param_2) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_GndChk gnd_chk; cXyz sp94, spa0; f32 fVar1 = 300.0f; @@ -496,7 +496,7 @@ static BOOL jump_pos_check(e_dn_class* i_this, cXyz* param_2) { /* 804E6608-804E6A8C 001548 0484+00 2/1 0/0 0/0 .text e_dn_stay__FP10e_dn_class */ static void e_dn_stay(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp30; i_this->field_0x6f4 = 5; @@ -598,7 +598,7 @@ static void e_dn_stay(e_dn_class* i_this) { /* 804E6A8C-804E6DBC 0019CC 0330+00 1/1 0/0 0/0 .text e_dn_otoreac__FP10e_dn_class */ static void e_dn_otoreac(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp40, sp4c; f32 fVar1 = 0.0f; i_this->field_0x6f4 = 2; @@ -654,7 +654,7 @@ static void e_dn_otoreac(e_dn_class* i_this) { /* 804E6DBC-804E72C8 001CFC 050C+00 2/1 0/0 0/0 .text e_dn_bomb_action__FP10e_dn_class */ static void e_dn_bomb_action(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; s16 sVar2; cXyz sp3c, sp48; dBomb_c* bomb = bomb_check(i_this); @@ -771,7 +771,7 @@ static void e_dn_bomb_action(e_dn_class* i_this) { /* 804E72C8-804E7620 002208 0358+00 1/1 0/0 0/0 .text e_dn_normal__FP10e_dn_class */ static void e_dn_normal(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp44, sp50; f32 fVar1 = 0.0f; s16 sVar1 = 0x4000; @@ -854,7 +854,7 @@ static void e_dn_normal(e_dn_class* i_this) { /* 804E7620-804E77A8 002560 0188+00 1/1 0/0 0/0 .text e_dn_drawback__FP10e_dn_class */ static void e_dn_drawback(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); switch (i_this->mMode) { @@ -888,7 +888,7 @@ static void e_dn_drawback(e_dn_class* i_this) { /* 804E77A8-804E7B34 0026E8 038C+00 1/1 0/0 0/0 .text e_dn_wolfbite__FP10e_dn_class */ static void e_dn_wolfbite(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); i_this->field_0x6e8 = 10; @@ -958,7 +958,7 @@ static void e_dn_wolfbite(e_dn_class* i_this) { /* 804E7B34-804E7B74 002A74 0040+00 1/1 0/0 0/0 .text way_check__FP10e_dn_class */ static int way_check(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; s16 sVar1 = a_this->shape_angle.y - i_this->mYAngleToPlayer; if (sVar1 <= 0x4000 && sVar1 >= -0x4000) { return 0; @@ -977,7 +977,7 @@ int learn_check; /* 804E7B74-804E7D18 002AB4 01A4+00 1/1 0/0 0/0 .text shot_s_sub__FPvPv */ static void* shot_s_sub(void* i_actor, void* i_data) { e_dn_class* i_this = (e_dn_class*)i_data; - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; if ((fopAcM_IsActor(i_actor) && (learn_check & 0x80000000) != 0 && fopAcM_GetName(i_actor) == PROC_ARROW && (fopAcM_GetParam(i_actor) == 1 || fopAcM_GetParam(i_actor) == 2))) { cXyz sp28(a_this->current.pos - ((fopAc_ac_c*)i_actor)->current.pos); @@ -991,7 +991,7 @@ static void* shot_s_sub(void* i_actor, void* i_data) { /* 804E7D18-804E8620 002C58 0908+00 1/1 0/0 0/0 .text e_dn_fight_run__FP10e_dn_class */ static void e_dn_fight_run(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp4c, sp58; f32 fVar1 = 0.0f; int frame = i_this->mpModelMorf->getFrame(); @@ -1222,7 +1222,7 @@ static void e_dn_fight_run(e_dn_class* i_this) { /* 804E8620-804E8848 003560 0228+00 1/1 0/0 0/0 .text e_dn_jump__FP10e_dn_class */ static void e_dn_jump(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->field_0x6f4 = 1; switch (i_this->mMode) { @@ -1279,7 +1279,7 @@ static void e_dn_jump(e_dn_class* i_this) { /* 804E8848-804E8D78 003788 0530+00 1/1 0/0 0/0 .text e_dn_gakejump__FP10e_dn_class */ static void e_dn_gakejump(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp24, sp30; i_this->field_0x6f4 = 1; @@ -1394,7 +1394,7 @@ static fopAc_ac_c* at_hit_check(e_dn_class* i_this) { /* 804E8DD8-804E8F78 003D18 01A0+00 1/1 0/0 0/0 .text e_dn_attack_0__FP10e_dn_class */ static void e_dn_attack_0(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp2c, sp38; int frame = i_this->mpModelMorf->getFrame(); @@ -1429,7 +1429,7 @@ static void e_dn_attack_0(e_dn_class* i_this) { /* 804E8F78-804E91D4 003EB8 025C+00 1/1 0/0 0/0 .text e_dn_attack__FP10e_dn_class */ static void e_dn_attack(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp34, sp40; int frame = i_this->mpModelMorf->getFrame(); @@ -1490,7 +1490,7 @@ static void e_dn_attack(e_dn_class* i_this) { /* 804E91D4-804E9354 004114 0180+00 1/1 0/0 0/0 .text tail_eff_set__FP10e_dn_class */ static void tail_eff_set(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; J3DModel* model = i_this->mpModelMorf->getModel(); i_this->field_0x10f8 = dComIfGp_particle_set(i_this->field_0x10f8, 0x815F, &a_this->current.pos, NULL, NULL); @@ -1510,7 +1510,7 @@ static void tail_eff_set(e_dn_class* i_this) { /* 804E9354-804E9544 004294 01F0+00 1/1 0/0 0/0 .text e_dn_tail_attack__FP10e_dn_class */ static void e_dn_tail_attack(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp30, sp3c; int frame = i_this->mpModelMorf->getFrame(); @@ -1557,7 +1557,7 @@ static void e_dn_tail_attack(e_dn_class* i_this) { /* 804E9544-804E973C 004484 01F8+00 2/1 0/0 0/0 .text e_dn_guard__FP10e_dn_class */ static void e_dn_guard(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->field_0x6f1 = 1; i_this->field_0x6f4 = 1; @@ -1619,7 +1619,7 @@ static void e_dn_guard(e_dn_class* i_this) { /* 804E973C-804E97EC 00467C 00B0+00 1/1 0/0 0/0 .text e_dn_s_damage__FP10e_dn_class */ static void e_dn_s_damage(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; switch (i_this->mMode) { case 0: @@ -1649,7 +1649,7 @@ static BOOL kado_check(e_dn_class* i_this) { 80.0f, -80.0f, }; - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_LinChk lin_chk; cXyz sp9c, spa8, spb4; BOOL rv = FALSE; @@ -1683,7 +1683,7 @@ static BOOL kado_check(e_dn_class* i_this) { /* 804E99A0-804E9AF0 0048E0 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_dn_class */ static BOOL body_gake(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; J3DModel* model = i_this->mpModelMorf->getModel(); cXyz sp7c, sp88; @@ -1705,7 +1705,7 @@ static BOOL body_gake(e_dn_class* i_this) { /* 804E9B68-804EA700 004AA8 0B98+00 2/1 0/0 0/0 .text e_dn_damage__FP10e_dn_class */ static void e_dn_damage(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp34, sp40; if (a_this->health <= 0) { @@ -2023,7 +2023,7 @@ static void e_dn_damage(e_dn_class* i_this) { /* 804EA700-804EA854 005640 0154+00 1/1 0/0 0/0 .text e_dn_backdrop__FP10e_dn_class */ static void e_dn_backdrop(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; switch (i_this->mMode) { case 0: @@ -2059,7 +2059,7 @@ static void e_dn_backdrop(e_dn_class* i_this) { /* 804EA854-804EA9F4 005794 01A0+00 1/1 0/0 0/0 .text e_dn_water__FP10e_dn_class */ static void e_dn_water(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp20, sp2c, sp38; MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); @@ -2106,7 +2106,7 @@ static void e_dn_water(e_dn_class* i_this) { /* 804EA9F4-804EAD1C 005934 0328+00 1/1 0/0 0/0 .text e_dn_reg__FP10e_dn_class */ static void e_dn_reg(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp34, sp40; f32 fVar1 = 0.0f; @@ -2191,7 +2191,7 @@ static void e_dn_reg(e_dn_class* i_this) { /* 804EAD1C-804EADD4 005C5C 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_dn_class */ static void wolfkick_damage(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; @@ -2208,7 +2208,7 @@ static void wolfkick_damage(e_dn_class* i_this) { /* 804EADD4-804EAEE4 005D14 0110+00 1/1 0/0 0/0 .text big_damage__FP10e_dn_class */ static void big_damage(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->field_0x750 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; i_this->field_0x74c = 150.0f; @@ -2233,7 +2233,7 @@ static void big_damage(e_dn_class* i_this) { /* 804EAEE4-804EAF94 005E24 00B0+00 1/1 0/0 0/0 .text small_damage__FP10e_dn_class */ static void small_damage(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->mAction = ACTION_S_DAMAGE; i_this->mMode = 0; @@ -2252,7 +2252,7 @@ static void small_damage(e_dn_class* i_this) { /* 804EAF94-804EB344 005ED4 03B0+00 1/1 0/0 0/0 .text damage_check__FP10e_dn_class */ static void damage_check(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); if (l_HIO.field_0x24 != 0) { @@ -2359,7 +2359,7 @@ static void damage_check(e_dn_class* i_this) { /* 804EB344-804EC854 006284 1510+00 2/1 0/0 0/0 .text action__FP10e_dn_class */ static void action(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); cXyz sp240, sp24c; @@ -2929,7 +2929,7 @@ int c_start; /* 804ECB50-804ED83C 007A90 0CEC+00 2/1 0/0 0/0 .text daE_DN_Execute__FP10e_dn_class */ static int daE_DN_Execute(e_dn_class* i_this) { // NONMATCHING - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; f32 fVar1 = 0.0f; if (i_this->field_0x10d8 != 0) { @@ -3226,7 +3226,7 @@ static int daE_DN_IsDelete(e_dn_class* i_this) { /* 804ED844-804ED8AC 008784 0068+00 1/0 0/0 0/0 .text daE_DN_Delete__FP10e_dn_class */ static int daE_DN_Delete(e_dn_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dComIfG_resDelete(&i_this->mPhase, "E_dn"); if (i_this->field_0x10d9 != 0) { diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 18c1194ad0c..7f7c9f9a2bb 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -84,7 +84,7 @@ daE_MF_HIO_c::daE_MF_HIO_c() { /* 8070A77C-8070A82C 00015C 00B0+00 2/2 0/0 0/0 .text mf_disappear__FP10e_mf_class */ static void mf_disappear(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp1c, sp28; MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); @@ -185,7 +185,7 @@ static int nodeCallBack(J3DJoint* i_joint, int param_2) { /* 8070AD94-8070B03C 000774 02A8+00 1/0 0/0 0/0 .text daE_MF_Draw__FP10e_mf_class */ static int daE_MF_Draw(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; if (i_this->field_0x728 != 0) { return 1; @@ -238,7 +238,7 @@ static int daE_MF_Draw(e_mf_class* i_this) { /* 8070B03C-8070B114 000A1C 00D8+00 2/2 0/0 0/0 .text other_bg_check__FP10e_mf_classP10fopAc_ac_c */ static BOOL other_bg_check(e_mf_class* i_this, fopAc_ac_c* i_actor) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_LinChk lin_chk; cXyz start, end; @@ -257,7 +257,7 @@ static BOOL other_bg_check(e_mf_class* i_this, fopAc_ac_c* i_actor) { /* 8070B114-8070B1EC 000AF4 00D8+00 1/1 0/0 0/0 .text other_bg_check2__FP10e_mf_classP4cXyz */ static BOOL other_bg_check2(e_mf_class* i_this, cXyz* param_2) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_LinChk lin_chk; cXyz start, end; @@ -300,7 +300,7 @@ static void* s_b_sub(void* i_actor, void* i_data) { /* 8070B268-8070B6E0 000C48 0478+00 2/2 0/0 0/0 .text search_bomb__FP10e_mf_classi */ static dBomb_c* search_bomb(e_mf_class* i_this, BOOL param_2) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBomb_c* bomb; target_info_count = 0; for (int i = 0; i < 10; i++) { @@ -373,7 +373,7 @@ static dBomb_c* bomb_check(e_mf_class* i_this) { /* 8070B728-8070B76C 001108 0044+00 1/1 0/0 0/0 .text player_way_check__FP10e_mf_class */ static BOOL player_way_check(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; s16 sVar1 = a_this->shape_angle.y - dComIfGp_getPlayer(0)->shape_angle.y; if ((int)sVar1 < 0) { @@ -389,7 +389,7 @@ static BOOL player_way_check(e_mf_class* i_this) { /* 8070B76C-8070B848 00114C 00DC+00 4/4 0/0 0/0 .text pl_check__FP10e_mf_classfs */ static int pl_check(e_mf_class* i_this, f32 param_2, s16 param_3) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); if (i_this->mPlayerDistance < param_2) { @@ -412,7 +412,7 @@ static int pl_check(e_mf_class* i_this, f32 param_2, s16 param_3) { /* 8070B848-8070B950 001228 0108+00 3/3 0/0 0/0 .text move_gake_check__FP10e_mf_classfSc */ static BOOL move_gake_check(e_mf_class* i_this, f32 param_2, s8 param_3) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_GndChk gnd_chk; cXyz sp84, sp90; @@ -437,7 +437,7 @@ static BOOL move_gake_check(e_mf_class* i_this, f32 param_2, s8 param_3) { /* 8070B950-8070BB10 001330 01C0+00 1/1 0/0 0/0 .text jump_pos_check__FP10e_mf_classP4cXyz */ static BOOL jump_pos_check(e_mf_class* i_this, cXyz* param_2) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_GndChk gnd_chk; cXyz sp94, spa0; f32 fVar1 = 300.0f; @@ -478,7 +478,7 @@ static BOOL jump_pos_check(e_mf_class* i_this, cXyz* param_2) { /* 8070BB10-8070BF94 0014F0 0484+00 2/1 0/0 0/0 .text e_mf_stay__FP10e_mf_class */ static void e_mf_stay(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp30; i_this->field_0x6d4 = 5; @@ -580,7 +580,7 @@ static void e_mf_stay(e_mf_class* i_this) { /* 8070BF94-8070C2C4 001974 0330+00 1/1 0/0 0/0 .text e_mf_otoreac__FP10e_mf_class */ static void e_mf_otoreac(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp40, sp4c; f32 fVar1 = 0.0f; i_this->field_0x6d4 = 2; @@ -636,7 +636,7 @@ static void e_mf_otoreac(e_mf_class* i_this) { /* 8070C2C4-8070C7C4 001CA4 0500+00 2/1 0/0 0/0 .text e_mf_bomb_action__FP10e_mf_class */ static void e_mf_bomb_action(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; s16 sVar2; cXyz sp3c, sp48; dBomb_c* bomb = bomb_check(i_this); @@ -753,7 +753,7 @@ static void e_mf_bomb_action(e_mf_class* i_this) { /* 8070C7C4-8070CB1C 0021A4 0358+00 1/1 0/0 0/0 .text e_mf_normal__FP10e_mf_class */ static void e_mf_normal(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp44, sp50; f32 fVar1 = 0.0f; s16 sVar1 = 0x4000; @@ -836,7 +836,7 @@ static void e_mf_normal(e_mf_class* i_this) { /* 8070CB1C-8070CCB8 0024FC 019C+00 1/1 0/0 0/0 .text e_mf_drawback__FP10e_mf_class */ static void e_mf_drawback(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); switch (i_this->field_0x5b4) { @@ -871,7 +871,7 @@ static void e_mf_drawback(e_mf_class* i_this) { /* 8070CCB8-8070D090 002698 03D8+00 1/1 0/0 0/0 .text e_mf_wolfbite__FP10e_mf_class */ static void e_mf_wolfbite(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); i_this->field_0x6c8 = 10; @@ -949,7 +949,7 @@ static void e_mf_wolfbite(e_mf_class* i_this) { /* 8070D090-8070D0D0 002A70 0040+00 1/1 0/0 0/0 .text way_check__FP10e_mf_class */ static int way_check(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; s16 sVar1 = a_this->shape_angle.y - i_this->mYAngleToPlayer; if (sVar1 <= 0x4000 && sVar1 >= -0x4000) { return 0; @@ -965,7 +965,7 @@ static int way_check(e_mf_class* i_this) { /* 8070D0D0-8070D2C8 002AB0 01F8+00 1/1 0/0 0/0 .text shot_s_sub__FPvPv */ static void* shot_s_sub(void* i_actor, void* i_data) { e_mf_class* i_this = (e_mf_class*)i_data; - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; if ((fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_ARROW && (fopAcM_GetParam(i_actor) == 1 || fopAcM_GetParam(i_actor) == 2)) || fopAcM_GetName(i_actor) == PROC_BOOMERANG && dComIfGp_checkPlayerStatus0(0, 0x80000) == 0 && daPy_py_c::checkBoomerangCharge() && fopAcM_GetParam(i_actor) == 1) { cXyz sp28(a_this->current.pos - ((fopAc_ac_c*)i_actor)->current.pos); @@ -983,7 +983,7 @@ static void* shot_s_sub(void* i_actor, void* i_data) { /* 8070D2C8-8070DBB4 002CA8 08EC+00 1/1 0/0 0/0 .text e_mf_fight_run__FP10e_mf_class */ static void e_mf_fight_run(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp4c, sp58; f32 fVar1 = 0.0f; int frame = i_this->mpModelMorf->getFrame(); @@ -1206,7 +1206,7 @@ static void e_mf_fight_run(e_mf_class* i_this) { /* 8070DBB4-8070DDDC 003594 0228+00 1/1 0/0 0/0 .text e_mf_jump__FP10e_mf_class */ static void e_mf_jump(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->field_0x6d4 = 1; switch (i_this->field_0x5b4) { @@ -1263,7 +1263,7 @@ static void e_mf_jump(e_mf_class* i_this) { /* 8070DDDC-8070E30C 0037BC 0530+00 1/1 0/0 0/0 .text e_mf_gakejump__FP10e_mf_class */ static void e_mf_gakejump(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp24, sp30; i_this->field_0x6d4 = 1; @@ -1378,7 +1378,7 @@ static fopAc_ac_c* at_hit_check(e_mf_class* i_this) { /* 8070E36C-8070E5E0 003D4C 0274+00 1/1 0/0 0/0 .text e_mf_attack__FP10e_mf_class */ static void e_mf_attack(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp34, sp40; int frame = i_this->mpModelMorf->getFrame(); @@ -1443,7 +1443,7 @@ static void e_mf_attack(e_mf_class* i_this) { /* 8070E5E0-8070E760 003FC0 0180+00 1/1 0/0 0/0 .text tail_eff_set__FP10e_mf_class */ static void tail_eff_set(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; J3DModel* model = i_this->mpModelMorf->getModel(); i_this->field_0x10e4 = dComIfGp_particle_set(i_this->field_0x10e4, 0x815F, &a_this->current.pos, NULL, NULL); @@ -1463,7 +1463,7 @@ static void tail_eff_set(e_mf_class* i_this) { /* 8070E760-8070EA10 004140 02B0+00 1/1 0/0 0/0 .text e_mf_tail_attack__FP10e_mf_class */ static void e_mf_tail_attack(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp30, sp3c; int frame = i_this->mpModelMorf->getFrame(); @@ -1526,7 +1526,7 @@ static void e_mf_tail_attack(e_mf_class* i_this) { /* 8070EA10-8070EC60 0043F0 0250+00 2/1 0/0 0/0 .text e_mf_guard__FP10e_mf_class */ static void e_mf_guard(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->field_0x6d1 = 1; i_this->field_0x6d4 = 1; @@ -1596,7 +1596,7 @@ static void e_mf_guard(e_mf_class* i_this) { /* 8070EC60-8070ED10 004640 00B0+00 1/1 0/0 0/0 .text e_mf_s_damage__FP10e_mf_class */ static void e_mf_s_damage(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; switch (i_this->field_0x5b4) { case 0: @@ -1626,7 +1626,7 @@ static int kado_check(e_mf_class* i_this) { 80.0f, -80.0f, }; - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dBgS_LinChk lin_chk; cXyz sp9c, spa8, spb4; BOOL rv = FALSE; @@ -1660,7 +1660,7 @@ static int kado_check(e_mf_class* i_this) { /* 8070EEC4-8070F014 0048A4 0150+00 1/1 0/0 0/0 .text body_gake__FP10e_mf_class */ static BOOL body_gake(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; J3DModel* model = i_this->mpModelMorf->getModel(); cXyz sp7c, sp88; @@ -1682,7 +1682,7 @@ static BOOL body_gake(e_mf_class* i_this) { /* 8070F08C-8070FBEC 004A6C 0B60+00 2/1 0/0 0/0 .text e_mf_damage__FP10e_mf_class */ static void e_mf_damage(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp34, sp40; if (a_this->health <= 0) { @@ -2001,7 +2001,7 @@ static void e_mf_damage(e_mf_class* i_this) { /* 8070FBEC-8070FD40 0055CC 0154+00 1/1 0/0 0/0 .text e_mf_backdrop__FP10e_mf_class */ static void e_mf_backdrop(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; switch (i_this->field_0x5b4) { case 0: @@ -2037,7 +2037,7 @@ static void e_mf_backdrop(e_mf_class* i_this) { /* 8070FD40-8070FEE0 005720 01A0+00 1/1 0/0 0/0 .text e_mf_water__FP10e_mf_class */ static void e_mf_water(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; cXyz sp20, sp2c, sp38; MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(2), *calc_mtx); @@ -2084,7 +2084,7 @@ static void e_mf_water(e_mf_class* i_this) { /* 8070FEE0-8070FF98 0058C0 00B8+00 1/1 0/0 0/0 .text wolfkick_damage__FP10e_mf_class */ static void wolfkick_damage(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; @@ -2101,7 +2101,7 @@ static void wolfkick_damage(e_mf_class* i_this) { /* 8070FF98-807100A8 005978 0110+00 1/1 0/0 0/0 .text big_damage__FP10e_mf_class */ static void big_damage(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->field_0x730 = (a_this->shape_angle.y - 0x8000) - i_this->mAtInfo.mHitDirection.y; i_this->field_0x72c = 150.0f; @@ -2126,7 +2126,7 @@ static void big_damage(e_mf_class* i_this) { /* 807100A8-80710158 005A88 00B0+00 1/1 0/0 0/0 .text small_damage__FP10e_mf_class */ static void small_damage(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; i_this->mAction = 20; i_this->field_0x5b4 = 0; @@ -2145,7 +2145,7 @@ static void small_damage(e_mf_class* i_this) { /* 80710158-807104EC 005B38 0394+00 1/1 0/0 0/0 .text damage_check__FP10e_mf_class */ static void damage_check(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); i_this->mStts.Move(); @@ -2248,7 +2248,7 @@ static void damage_check(e_mf_class* i_this) { /* 807104EC-807119BC 005ECC 14D0+00 2/1 0/0 0/0 .text action__FP10e_mf_class */ static void action(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); cXyz sp240, sp24c; @@ -2805,7 +2805,7 @@ int c_start; /* 80711CB8-80712998 007698 0CE0+00 2/1 0/0 0/0 .text daE_MF_Execute__FP10e_mf_class */ static int daE_MF_Execute(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; f32 fVar1 = 0.0f; if (i_this->field_0x728 != 0) { @@ -3102,7 +3102,7 @@ static int daE_MF_IsDelete(e_mf_class* i_this) { /* 807129A0-80712A08 008380 0068+00 1/0 0/0 0/0 .text daE_MF_Delete__FP10e_mf_class */ static int daE_MF_Delete(e_mf_class* i_this) { - fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; + fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; dComIfG_resDelete(&i_this->mPhase, "E_mf"); if (i_this->field_0x10b9 != 0) {