From 7824fb54c08e9006bb8454e2c7f5f0c22b8b74ce Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Tue, 3 Oct 2023 04:07:42 -0400 Subject: [PATCH] d_a_am 50% --- include/JSystem/J3DGraphAnimator/J3DJoint.h | 4 +- include/JSystem/JParticle/JPAEmitter.h | 2 +- include/SSystem/SComponent/c_cc_d.h | 24 +- include/SSystem/SComponent/c_data_tbl.h | 2 + include/c/c_damagereaction.h | 194 ++++ include/d/actor/d_a_item.h | 2 - include/d/actor/d_a_player.h | 1 + include/d/d_bg_s_acch.h | 2 +- include/d/d_com_inf_game.h | 38 +- include/d/d_jnt_hit.h | 19 +- include/d/d_particle.h | 7 +- include/d/d_snap.h | 18 +- include/f_op/f_op_actor.h | 14 +- include/f_op/f_op_actor_mng.h | 2 + include/m_Do/m_Do_ext.h | 2 +- include/m_Do/m_Do_mtx.h | 12 + src/c/c_damagereaction.cpp | 167 +--- src/d/actor/d_a_am.cpp | 1001 ++++++++++++------- src/d/actor/d_a_branch.cpp | 2 +- src/d/actor/d_a_kaji.cpp | 2 +- src/d/actor/d_a_mozo.cpp | 2 +- src/d/d_jnt_hit.cpp | 12 +- 22 files changed, 962 insertions(+), 567 deletions(-) create mode 100644 include/c/c_damagereaction.h diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h index 070759dd1..90d73f795 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -140,7 +140,7 @@ private: friend struct J3DJointFactory; friend class J3DJointTree; - /* 0x14 */ u16 mJntNo; + /* 0x18 */ u16 mJntNo; /* 0x1A */ u8 mKind; /* 0x1B */ u8 mScaleCompensate; /* 0x1C */ J3DTransformInfo mTransformInfo; @@ -150,6 +150,6 @@ private: /* 0x58 */ J3DMtxCalc* mMtxCalc; /* 0x5C */ J3DMtxCalc* mOldMtxCalc; /* 0x60 */ J3DMaterial* mMesh; -}; // Size: 0x54 +}; // Size: 0x64 #endif /* J3DJOINT_H */ diff --git a/include/JSystem/JParticle/JPAEmitter.h b/include/JSystem/JParticle/JPAEmitter.h index 976901592..69e8f50ca 100644 --- a/include/JSystem/JParticle/JPAEmitter.h +++ b/include/JSystem/JParticle/JPAEmitter.h @@ -28,7 +28,7 @@ template class JPACallBackBase { public: JPACallBackBase() {} - virtual ~JPACallBackBase(); + virtual ~JPACallBackBase() {} virtual void init(JPABaseEmitter*); virtual void execute(JPABaseEmitter*); diff --git a/include/SSystem/SComponent/c_cc_d.h b/include/SSystem/SComponent/c_cc_d.h index c8743fb99..e962f94da 100644 --- a/include/SSystem/SComponent/c_cc_d.h +++ b/include/SSystem/SComponent/c_cc_d.h @@ -23,13 +23,23 @@ class cCcD_CylAttr; class cCcD_SphAttr; enum cCcD_ObjAtType { - /* 0x00000002 */ AT_TYPE_SWORD = (1 << 1), - /* 0x00000020 */ AT_TYPE_BOMB = (1 << 5), - /* 0x00000040 */ AT_TYPE_BOOMERANG = (1 << 6), - /* 0x00004000 */ AT_TYPE_NORMAL_ARROW = (1 << 14), - /* 0x00040000 */ AT_TYPE_FIRE_ARROW = (1 << 18), - /* 0x00080000 */ AT_TYPE_ICE_ARROW = (1 << 19), - /* 0x00100000 */ AT_TYPE_LIGHT_ARROW = (1 << 20), + /* 0x00000002 */ AT_TYPE_SWORD = (1 << 1), + /* 0x00000020 */ AT_TYPE_BOMB = (1 << 5), + /* 0x00000040 */ AT_TYPE_BOOMERANG = (1 << 6), + /* 0x00000080 */ AT_TYPE_BOKO_STICK = (1 << 7), + /* 0x00000100 */ AT_TYPE_WATER = (1 << 8), + /* 0x00000200 */ AT_TYPE_FIRE = (1 << 9), + /* 0x00000400 */ AT_TYPE_MACHETE = (1 << 10), + /* 0x00004000 */ AT_TYPE_NORMAL_ARROW = (1 << 14), + /* 0x00010000 */ AT_TYPE_SKULL_HAMMER = (1 << 16), + /* 0x00040000 */ AT_TYPE_FIRE_ARROW = (1 << 18), + /* 0x00080000 */ AT_TYPE_ICE_ARROW = (1 << 19), + /* 0x00100000 */ AT_TYPE_LIGHT_ARROW = (1 << 20), + /* 0x00200000 */ AT_TYPE_LEAF_WIND = (1 << 21), + /* 0x01000000 */ AT_TYPE_STALFOS_MACE = (1 << 24), + /* 0x04000000 */ AT_TYPE_DARKNUT_SWORD = (1 << 26), + /* 0x08000000 */ AT_TYPE_GRAPPLING_HOOK = (1 << 27), + /* 0x10000000 */ AT_TYPE_MOBLIN_SPEAR = (1 << 28), }; class cCcD_ShapeAttr { diff --git a/include/SSystem/SComponent/c_data_tbl.h b/include/SSystem/SComponent/c_data_tbl.h index b57e569d0..42dbf3bba 100644 --- a/include/SSystem/SComponent/c_data_tbl.h +++ b/include/SSystem/SComponent/c_data_tbl.h @@ -41,6 +41,8 @@ public: u8 GetInf(int row, int col) const; void Set(u32 fmtNum, char **pFmt, u32 nameNum, char **pName, u8* pData); + + int GetNameIndex(const char* pName, int start) const { return mName.GetIndex(pName, start); } cDT_Format mFmt; cDT_Name mName; diff --git a/include/c/c_damagereaction.h b/include/c/c_damagereaction.h new file mode 100644 index 000000000..80eeacc6f --- /dev/null +++ b/include/c/c_damagereaction.h @@ -0,0 +1,194 @@ +#ifndef C_DAMAGEREACTION_H +#define C_DAMAGEREACTION_H + +#include "d/d_cc_d.h" +#include "d/d_bg_s_acch.h" +#include "d/d_kankyo.h" +#include "m_Do/m_Do_ext.h" + +struct enemyice { +public: + /* 0x000 */ fopAc_ac_c* mpActor; + /* 0x004 */ s16 mTotalNumFramesToRemainFrozen; + /* 0x006 */ u8 mNumFramesDyingToLightArrowsSoFar; + /* 0x007 */ u8 m007[0x008 - 0x007]; + /* 0x008 */ f32 mYOffset; + /* 0x00C */ u8 m00C; + /* 0x00D */ u8 mState; + /* 0x00E */ s16 mNumFramesLeftToRemainFrozen; + /* 0x010 */ s16 m010; + /* 0x012 */ s16 m012; + /* 0x014 */ s16 m014; + /* 0x016 */ u8 m016[0x018 - 0x016]; + /* 0x018 */ cXyz m018; + /* 0x024 */ f32 m024; + /* 0x028 */ f32 m028; + /* 0x02C */ f32 m02C; + /* 0x030 */ dCcD_Stts mStts; + /* 0x06C */ dCcD_Cyl mCyl; + /* 0x19C */ f32 mCylHeight; + /* 0x1A0 */ f32 mWallRadius; + /* 0x1A4 */ f32 mScaleXZ; + /* 0x1A8 */ f32 mScaleY; + /* 0x1AC */ f32 m1AC; + /* 0x1B0 */ u8 m1B0; + /* 0x1B1 */ u8 mDeathSwitch; + /* 0x1B2 */ u8 m1B2[0x1B4 - 0x1B2]; + /* 0x1B4 */ dBgS_AcchCir mBgAcchCir; + /* 0x1F4 */ dBgS_ObjAcch mBgAcch; +}; +STATIC_ASSERT(sizeof(enemyice) == 0x3B8); + +struct enemyfire { +public: + /* 0x000 */ fopAc_ac_c* mpActor; + /* 0x004 */ s16 m004; + /* 0x006 */ u8 m006; + /* 0x007 */ u8 m007[0x008 - 0x007]; + /* 0x008 */ s16 m008; + /* 0x00A */ u8 m00A[0x00C - 0x00A]; + /* 0x00C */ mDoExt_McaMorf* mpMcaMorf; + /* 0x010 */ u8 m010[10]; + /* 0x01A */ u8 m01A[0x01C - 0x01A]; + /* 0x01C */ f32 m01C[10]; + /* 0x044 */ u8 m044[0x080 - 0x044]; + /* 0x080 */ cXyz m080; + /* 0x08C */ f32 m08C; + /* 0x090 */ f32 m090; + /* 0x094 */ f32 m094; + /* 0x098 */ f32 m098; + /* 0x09C */ u8 m09C[0x09D - 0x09C]; + /* 0x09D */ char m09D; + /* 0x09E */ u8 m09E[0x0A0 - 0x09E]; + /* 0x0A0 */ dCcD_Stts mStts; + /* 0x0DC */ dCcD_Sph mSph; + /* 0x208 */ LIGHT_INFLUENCE mLight; +}; +STATIC_ASSERT(sizeof(enemyfire) == 0x228); + +struct damagereaction { + /* 0x000 */ fopEn_enemy_c* mpEnemy; + /* 0x004 */ s16 m004; + /* 0x006 */ s16 mState; + /* 0x008 */ u16 mEnemyType; + /* 0x00A */ u8 m00A[0x00C - 0x00A]; + /* 0x00C */ s32 mTimer; + /* 0x010 */ csXyz m010[20]; + /* 0x088 */ csXyz m088[20]; + /* 0x100 */ cXyz m100[20]; + /* 0x1F0 */ cXyz m1F0[20]; + /* 0x2E0 */ cXyz m2E0[20]; + /* 0x3D0 */ u8 m3D0[0x410 - 0x3D0]; + /* 0x410 */ s32 m410; + /* 0x414 */ u8 m414[0x418 - 0x414]; + /* 0x418 */ s32 m418; + /* 0x41C */ u8 m41C[0x420 - 0x41C]; + /* 0x420 */ s32 m420; + /* 0x424 */ s32 m424; + /* 0x428 */ f32 m428; + /* 0x42C */ cXyz m42C; + /* 0x438 */ s32 m438; + /* 0x43C */ u8 m43C[0x440 - 0x43C]; + /* 0x440 */ s16 m440; + /* 0x442 */ s16 m442; + /* 0x444 */ s16 m444; + /* 0x446 */ u8 m446[0x448 - 0x446]; + /* 0x448 */ s16 m448; + /* 0x44A */ u8 m44A[0x44C - 0x44A]; + /* 0x44C */ cXyz m44C; + /* 0x458 */ cXyz m458; + /* 0x464 */ u8 m464[0x468 - 0x464]; + /* 0x468 */ f32 m468; + /* 0x46C */ f32 m46C; + /* 0x470 */ f32 m470; + /* 0x474 */ f32 m474; + /* 0x478 */ f32 m478; + /* 0x47C */ s32 m47C; + /* 0x480 */ s16 m480; + /* 0x482 */ s16 m482; + /* 0x484 */ s16 m484; + /* 0x486 */ s16 m486; + /* 0x488 */ s16 m488; + /* 0x48A */ s16 m48A; + /* 0x48C */ csXyz m48C; + /* 0x492 */ u8 m492[0x496 - 0x492]; + /* 0x496 */ s16 m496; + /* 0x498 */ s16 m498; + /* 0x49A */ s16 m49A; + /* 0x49C */ s16 m49C; + /* 0x49E */ s16 m49E; + /* 0x4A0 */ s16 m4A0; + /* 0x4A2 */ s16 m4A2; + /* 0x4A4 */ s16 m4A4; + /* 0x4A6 */ s16 m4A6; + /* 0x4A8 */ s16 m4A8; + /* 0x4AA */ s16 m4AA; + /* 0x4AC */ s16 m4AC; + /* 0x4AE */ s16 m4AE; + /* 0x4B0 */ s16 m4B0; + /* 0x4B2 */ s16 m4B2; + /* 0x4B4 */ s16 m4B4; + /* 0x4B6 */ s16 m4B6; + /* 0x4B8 */ s16 m4B8; + /* 0x4BA */ s16 m4BA; + /* 0x4BC */ s16 m4BC; + /* 0x4BE */ s16 m4BE; + /* 0x4C0 */ s16 m4C0; + /* 0x4C2 */ u8 m4C2[0x4C8 - 0x4C2]; + /* 0x4C8 */ s16 m4C8[3]; + /* 0x4CE */ s16 mInvincibleTimer; + /* 0x4D0 */ s16 m4D0; + /* 0x4D2 */ u8 m4D2[0x4D4 - 0x4D2]; + /* 0x4D4 */ f32 m4D4; + /* 0x4D8 */ u8 m4D8[0x4DC - 0x4D8]; + /* 0x4DC */ dBgS_AcchCir mAcchCir; + /* 0x51C */ dBgS_Acch mAcch; + /* 0x6E0 */ s32 m6E0; + /* 0x6E4 */ f32 mSpawnY; + /* 0x6E8 */ cXyz m6E8; + /* 0x6F4 */ cXyz m6F4[2]; + /* 0x70C */ u8 m70C; + /* 0x70D */ u8 m70D; + /* 0x70E */ u8 m70E; + /* 0x70F */ u8 m70F[0x710 - 0x70F]; + /* 0x710 */ u8 m710; + /* 0x711 */ u8 m711[0x712 - 0x711]; + /* 0x712 */ u8 m712; + /* 0x713 */ u8 m713; + /* 0x714 */ u8 m714[0x71E - 0x714]; + /* 0x71E */ s16 m71E; + /* 0x720 */ f32 mMaxFallDistance; + /* 0x724 */ dCcD_Stts mStts; + /* 0x760 */ cXyz mParticlePos; + /* 0x76C */ csXyz mParticleAngle; + /* 0x772 */ u8 m772[0x774 - 0x772]; + /* 0x774 */ dPa_levelEcallBack mParticleCallBack; + /* 0x778 */ u8 m778[0x794 - 0x778]; + /* 0x794 */ s16 m794; + /* 0x796 */ u8 m796[0x7A0 - 0x796]; + /* 0x7A0 */ cXyz m7A0; + /* 0x7AC */ u8 m7AC[0x7AE - 0x7AC]; + /* 0x7AE */ s16 m7AE; + /* 0x7B0 */ u8 m7B0[0x7B2 - 0x7B0]; + /* 0x7B2 */ s16 m7B2; + /* 0x7B4 */ u8 m7B4[0x7B8 - 0x7B4]; + /* 0x7B8 */ s32 m7B8; +}; +// STATIC_ASSERT(sizeof(damagereaction) == 0x7BC); + +void ice_bg_check(enemyice*); +BOOL enemy_ice(enemyice*); +void enemy_fire(enemyfire*); +void enemy_fire_remove(enemyfire*); +void enemy_piyo_set(fopAc_ac_c*); +void wall_angle_get(fopAc_ac_c*, short); +void dr_body_bg_check(damagereaction*); +void dr_joint_bg_check(damagereaction*); +void kado_check(damagereaction*); +void hang_ang_get(damagereaction*); +void dr_damage_set(damagereaction*); +void dr_damage_anime(damagereaction*); +void dr_matrix_set(damagereaction*); +void damage_reaction(damagereaction*); + +#endif /* C_DAMAGEREACTION_H */ diff --git a/include/d/actor/d_a_item.h b/include/d/actor/d_a_item.h index a56017948..12dfc2d45 100644 --- a/include/d/actor/d_a_item.h +++ b/include/d/actor/d_a_item.h @@ -9,8 +9,6 @@ class daItem_c : public daItemBase_c { public: typedef void (daItem_c::*daItem_c_ModeFunc)(); - daItem_c() : mPtclFollowCb(0, 0), mPtclSmokeCb(1) {} - float getYOffset(); void set_mtx(); void set_mtx_base(J3DModel*, cXyz, csXyz); diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 1f8a1dd6e..985a4475d 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -94,6 +94,7 @@ public: s16 getBodyAngleX() { return mBodyAngle.x; } s16 getBodyAngleY() { return mBodyAngle.y; } void changeDemoMoveAngle(s16 angle) { mDemo.setMoveAngle(angle); } + u8 getCutType() const { return mAttackState; } virtual MtxP getLeftHandMatrix() = 0; virtual MtxP getRightHandMatrix() = 0; diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index 8593708fa..214961edd 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -33,7 +33,7 @@ public: void ClrWallHit(); void SetWallR(f32); void CalcWallRR(); - void SetWall(f32, f32); + void SetWall(f32 i_halfHeight, f32 i_radius); void SetWallHDirect(f32); virtual ~dBgS_AcchCir() {} diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index c6c9b06b1..0461842d4 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -18,6 +18,7 @@ #include "d/d_wood.h" #include "d/d_demo.h" #include "d/d_timer.h" +#include "SSystem/SComponent/c_data_tbl.h" class JKRArchive; class JKRExpHeap; @@ -54,11 +55,42 @@ public: /* 0x10 */ u8 mTimerType; }; +class dADM_CharTbl : public cDT { +public: + /* 0x28 */ s32 mIndex_ARG; + /* 0x2C */ s32 mIndex_N_ITEM0; + /* 0x30 */ s32 mIndex_N_ITEM1; + /* 0x34 */ s32 mIndex_N_ITEM2; + /* 0x38 */ s32 mIndex_N_ITEM3; + /* 0x3C */ s32 mIndex_N_ITEM4; + /* 0x40 */ s32 mIndex_N_ITEM5; + /* 0x44 */ s32 mIndex_N_ITEM6; + /* 0x48 */ s32 mIndex_N_ITEM7; + /* 0x4C */ s32 mIndex_N_ITEM8; + /* 0x50 */ s32 mIndex_N_ITEM9; + /* 0x54 */ s32 mIndex_N_ITEM10; + /* 0x58 */ s32 mIndex_N_ITEM11; + /* 0x5C */ s32 mIndex_N_ITEM12; + /* 0x60 */ s32 mIndex_N_ITEM13; + /* 0x64 */ s32 mIndex_N_ITEM14; + /* 0x68 */ s32 mIndex_N_ITEM15; + /* 0x6C */ s32 mIndex_percent; + /* 0x70 */ s32 mIndex_ITEM0; + /* 0x74 */ s32 mIndex_ITEM1; + /* 0x78 */ s32 mIndex_ITEM2; + /* 0x7C */ s32 mIndex_ITEM3; + /* 0x80 */ s32 mIndex_ITEM4; + /* 0x84 */ s32 mIndex_ITEM5; + /* 0x88 */ s32 mIndex_ITEM6; + /* 0x8C */ s32 mIndex_ITEM7; +}; +STATIC_ASSERT(sizeof(dADM_CharTbl) == 0x90); + class dADM { public: /* 0x00 */ int mBlockCount; /* 0x04 */ void* mpData; - /* 0x08 */ u8 mCharTbl[0x90]; + /* 0x08 */ dADM_CharTbl mCharTbl; public: dADM(); @@ -1186,6 +1218,10 @@ inline u8 dComIfGp_getMiniGameType() { inline dDlst_window_c * dComIfGp_getWindow(int idx) { return &g_dComIfG_gameInfo.play.mDlstWindow[idx]; } +inline dADM_CharTbl* dComIfGp_CharTbl() { + return &g_dComIfG_gameInfo.play.mADM.mCharTbl; +} + /** * === EVENT ===*/ diff --git a/include/d/d_jnt_hit.h b/include/d/d_jnt_hit.h index 520ce88ea..cf5656b4f 100644 --- a/include/d/d_jnt_hit.h +++ b/include/d/d_jnt_hit.h @@ -3,12 +3,13 @@ #include "global.h" #include "SSystem/SComponent/c_xyz.h" +#include "SSystem/SComponent/c_sxyz.h" #include "JSystem/J3DGraphAnimator/J3DModel.h" struct __jnt_hit_data_c { public: - /* 0x0 */ s16 mJointIndex; - /* 0x2 */ s16 field_0x2; + /* 0x0 */ s16 field_0x0; + /* 0x2 */ s16 mJointIndex; /* 0x4 */ f32 field_0x4; /* 0x8 */ cXyz* field_0x8; }; @@ -16,9 +17,9 @@ public: class JntHit_c { public: void CreateInit(); - void CylHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, float); - void Cyl2HitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, float); - void SphHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, float); + void CylHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, f32); + void Cyl2HitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, f32); + void SphHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, f32); void HitBufferUpdate(int*, cXyz*, int, csXyz*, cXyz*); s32 searchJntHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*); @@ -34,4 +35,12 @@ public: /* 0x1A */ u8 field_0x1A[0x20 - 0x1A]; }; +class JntHit_HIO_c { +public: + JntHit_HIO_c(); + virtual ~JntHit_HIO_c(); +}; + +JntHit_c* JntHit_create(J3DModel* model, __jnt_hit_data_c* jntHitData, s16 hitDataCount); + #endif /* D_JNT_HIT_H */ diff --git a/include/d/d_particle.h b/include/d/d_particle.h index efcc56857..e14510dd9 100644 --- a/include/d/d_particle.h +++ b/include/d/d_particle.h @@ -36,7 +36,7 @@ public: class dPa_followEcallBack : public dPa_levelEcallBack { public: - dPa_followEcallBack(u8, u8); + dPa_followEcallBack(u8=0, u8=0); virtual ~dPa_followEcallBack(); virtual void execute(JPABaseEmitter*); @@ -45,6 +45,7 @@ public: virtual void end(); JPABaseEmitter* getEmitter() { return mpEmitter; } + void setRateOff(u8 param_0) { field_0x11 = param_0; } /* 0x04 */ JPABaseEmitter* mpEmitter; /* 0x08 */ u8 field_0x08[0x10 - 0x08]; @@ -58,8 +59,8 @@ STATIC_ASSERT(sizeof(dPa_followEcallBack) == 0x14); class dPa_smokeEcallBack : public dPa_followEcallBack { public: - dPa_smokeEcallBack(u8); - virtual ~dPa_smokeEcallBack(); + dPa_smokeEcallBack(u8=1); + virtual ~dPa_smokeEcallBack() {} /* 0x14 */ s8 field_0x14; /* 0x15 */ u8 field_0x15; diff --git a/include/d/d_snap.h b/include/d/d_snap.h index 13e6ce7de..1489dfa32 100644 --- a/include/d/d_snap.h +++ b/include/d/d_snap.h @@ -1,7 +1,23 @@ #ifndef D_SNAP_H #define D_SNAP_H -void dSnap_DebugDraw(); +#include "f_op/f_op_actor.h" + +class dSnap_Obj; + +void dSnap_PhotoIndex2TableIndex(int); +void dSnap_GetFigRoomId(int); +void dSnap_MatDl(); +void dSnap_AlphaClearDL(); +void dSnap_Create(); +void dSnap_ReleaseShutter(); void dSnap_Execute(); +void dSnap_GetResult(); +void dSnap_GetResultDetail(); +void dSnap_RegistSnapObj(dSnap_Obj&); +void dSnap_RegistFig(unsigned char, fopAc_ac_c*, float, float, float); +void dSnap_RegistFig(unsigned char, fopAc_ac_c*, const Vec&, short, float, float, float); +void dSnap_DebugDraw(); +void dSnap_Delete(); #endif /* D_SNAP_H */ \ No newline at end of file diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index be3a42f2d..655d73685 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -249,7 +249,19 @@ public: STATIC_ASSERT(sizeof(fopAc_ac_c) == 0x290); -class fopEn_enemy_c; +class fopEn_enemy_c : public fopAc_ac_c { +public: + /* 0x290 */ f32 m290; + /* 0x294 */ f32 m294; + /* 0x298 */ f32 m298; + /* 0x29C */ f32 m29C; + /* 0x2A0 */ f32 m2A0; + /* 0x2A4 */ f32 m2A4; + /* 0x2A8 */ u8 mCurrParryOpeningType; + /* 0x2A9 */ u8 field_2A9[0x2AC - 0x2A9]; +}; + +STATIC_ASSERT(sizeof(fopEn_enemy_c) == 0x2AC); s32 fopAc_IsActor(void* actor); diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index b0d8b60fd..f62be57d0 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -498,6 +498,8 @@ fopAc_ac_c* fopAcM_searchFromName4Event(char* name, s16 eventID); s32 fopAcM_getWaterY(const cXyz*, f32*); void fpoAcM_relativePos(fopAc_ac_c* actor, cXyz* p_inPos, cXyz* p_outPos); +void fopAcM_setGbaName(fopAc_ac_c* i_this, u8 itemNo, u8 gbaName0, u8 gbaName1); + inline void make_prm_warp_hole(u32* actorParams, u8 p1, u8 p2, u8 p3) { u32 pp1 = (p3 << 0x8); u32 pp2 = (p2 << 0x10); diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 55992820b..27f749dab 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -279,7 +279,7 @@ public: void calc(); void calc(u16); - void setAnm(J3DAnmTransform*, int, f32, f32, f32, f32, void*); + void setAnm(J3DAnmTransform* bckAnm, int loopMode, f32 morf, f32 speed, f32, f32, void* soundAnm); void setMorf(f32); J3DModel* getModel() { return mpModel; } void setFrame(f32 frame) { mFrameCtrl.setFrame(frame); } diff --git a/include/m_Do/m_Do_mtx.h b/include/m_Do/m_Do_mtx.h index b729a3c49..84027dffb 100644 --- a/include/m_Do/m_Do_mtx.h +++ b/include/m_Do/m_Do_mtx.h @@ -65,6 +65,18 @@ inline void cMtx_ZrotM(Mtx mtx, s16 z) { mDoMtx_ZrotM(mtx, z); } +inline void cMtx_XrotS(Mtx mtx, s16 x) { + mDoMtx_XrotS(mtx, x); +} + +inline void cMtx_YrotS(Mtx mtx, s16 y) { + mDoMtx_YrotS(mtx, y); +} + +inline void cMtx_ZrotS(Mtx mtx, s16 z) { + mDoMtx_ZrotS(mtx, z); +} + inline void cMtx_lookAt(Mtx param_0, const Vec* param_1, const Vec* param_2, s16 param_3) { mDoMtx_lookAt(param_0, param_1, param_2, param_3); } diff --git a/src/c/c_damagereaction.cpp b/src/c/c_damagereaction.cpp index 4ca28fcb6..eb6ac608d 100644 --- a/src/c/c_damagereaction.cpp +++ b/src/c/c_damagereaction.cpp @@ -12,12 +12,7 @@ void ice_bg_check(enemyice*) { } /* 8001C0B4-8001CD7C .text enemy_ice__FP8enemyice */ -void enemy_ice(enemyice*) { - /* Nonmatching */ -} - -/* 8001CD7C-8001CDB8 .text __dt__5csXyzFv */ -csXyz::~csXyz() { +BOOL enemy_ice(enemyice*) { /* Nonmatching */ } @@ -41,86 +36,16 @@ void wall_angle_get(fopAc_ac_c*, short) { /* Nonmatching */ } -/* 8001D890-8001D9BC .text __dt__11dBgS_LinChkFv */ -dBgS_LinChk::~dBgS_LinChk() { - /* Nonmatching */ -} - -/* 8001D9BC-8001DA5C .text __dt__8dBgS_ChkFv */ -dBgS_Chk::~dBgS_Chk() { - /* Nonmatching */ -} - -/* 8001DA5C-8001DAB8 .text __dt__15dBgS_GrpPassChkFv */ -dBgS_GrpPassChk::~dBgS_GrpPassChk() { - /* Nonmatching */ -} - -/* 8001DAB8-8001DB00 .text __dt__15cBgS_GrpPassChkFv */ -cBgS_GrpPassChk::~cBgS_GrpPassChk() { - /* Nonmatching */ -} - -/* 8001DB00-8001DB5C .text __dt__16dBgS_PolyPassChkFv */ -dBgS_PolyPassChk::~dBgS_PolyPassChk() { - /* Nonmatching */ -} - -/* 8001DB5C-8001DBA4 .text __dt__16cBgS_PolyPassChkFv */ -cBgS_PolyPassChk::~cBgS_PolyPassChk() { - /* Nonmatching */ -} - -/* 8001DBA4-8001DC38 .text __dt__11cBgS_LinChkFv */ -cBgS_LinChk::~cBgS_LinChk() { - /* Nonmatching */ -} - -/* 8001DC38-8001DC80 .text __dt__8cM3dGLinFv */ -cM3dGLin::~cM3dGLin() { - /* Nonmatching */ -} - -/* 8001DC80-8001DCC8 .text __dt__13cBgS_PolyInfoFv */ -cBgS_PolyInfo::~cBgS_PolyInfo() { - /* Nonmatching */ -} - /* 8001DCC8-8001E244 .text dr_body_bg_check__FP14damagereaction */ void dr_body_bg_check(damagereaction*) { /* Nonmatching */ } -/* 8001E244-8001E3AC .text __dt__18dBgS_ObjGndChk_SplFv */ -dBgS_ObjGndChk_Spl::~dBgS_ObjGndChk_Spl() { - /* Nonmatching */ -} - -/* 8001E3AC-8001E4EC .text __dt__14dBgS_ObjGndChkFv */ -dBgS_ObjGndChk::~dBgS_ObjGndChk() { - /* Nonmatching */ -} - -/* 8001E4EC-8001E604 .text __dt__11dBgS_GndChkFv */ -dBgS_GndChk::~dBgS_GndChk() { - /* Nonmatching */ -} - -/* 8001E604-8001E684 .text __dt__11cBgS_GndChkFv */ -cBgS_GndChk::~cBgS_GndChk() { - /* Nonmatching */ -} - /* 8001E684-8001F6A0 .text dr_joint_bg_check__FP14damagereaction */ void dr_joint_bg_check(damagereaction*) { /* Nonmatching */ } -/* 8001F6A0-8001F808 .text __dt__20dBgS_ObjGndChk_YoganFv */ -dBgS_ObjGndChk_Yogan::~dBgS_ObjGndChk_Yogan() { - /* Nonmatching */ -} - /* 8001F808-8001FBA8 .text kado_check__FP14damagereaction */ void kado_check(damagereaction*) { /* Nonmatching */ @@ -150,93 +75,3 @@ void dr_matrix_set(damagereaction*) { void damage_reaction(damagereaction*) { /* Nonmatching */ } - -/* 80022710-80022718 .text @20@__dt__11cBgS_LinChkFv */ -void @20@__dt__11cBgS_LinChkFv { - /* Nonmatching */ -} - -/* 80022718-80022720 .text @12@__dt__8dBgS_ChkFv */ -void @12@__dt__8dBgS_ChkFv { - /* Nonmatching */ -} - -/* 80022720-80022728 .text @20@__dt__11dBgS_LinChkFv */ -void @20@__dt__11dBgS_LinChkFv { - /* Nonmatching */ -} - -/* 80022728-80022730 .text @100@__dt__11dBgS_LinChkFv */ -void @100@__dt__11dBgS_LinChkFv { - /* Nonmatching */ -} - -/* 80022730-80022738 .text @88@__dt__11dBgS_LinChkFv */ -void @88@__dt__11dBgS_LinChkFv { - /* Nonmatching */ -} - -/* 80022738-80022740 .text @20@__dt__11dBgS_GndChkFv */ -void @20@__dt__11dBgS_GndChkFv { - /* Nonmatching */ -} - -/* 80022740-80022748 .text @76@__dt__11dBgS_GndChkFv */ -void @76@__dt__11dBgS_GndChkFv { - /* Nonmatching */ -} - -/* 80022748-80022750 .text @64@__dt__11dBgS_GndChkFv */ -void @64@__dt__11dBgS_GndChkFv { - /* Nonmatching */ -} - -/* 80022750-80022758 .text @20@__dt__14dBgS_ObjGndChkFv */ -void @20@__dt__14dBgS_ObjGndChkFv { - /* Nonmatching */ -} - -/* 80022758-80022760 .text @76@__dt__14dBgS_ObjGndChkFv */ -void @76@__dt__14dBgS_ObjGndChkFv { - /* Nonmatching */ -} - -/* 80022760-80022768 .text @64@__dt__14dBgS_ObjGndChkFv */ -void @64@__dt__14dBgS_ObjGndChkFv { - /* Nonmatching */ -} - -/* 80022768-80022770 .text @20@__dt__18dBgS_ObjGndChk_SplFv */ -void @20@__dt__18dBgS_ObjGndChk_SplFv { - /* Nonmatching */ -} - -/* 80022770-80022778 .text @76@__dt__18dBgS_ObjGndChk_SplFv */ -void @76@__dt__18dBgS_ObjGndChk_SplFv { - /* Nonmatching */ -} - -/* 80022778-80022780 .text @64@__dt__18dBgS_ObjGndChk_SplFv */ -void @64@__dt__18dBgS_ObjGndChk_SplFv { - /* Nonmatching */ -} - -/* 80022780-80022788 .text @20@__dt__11cBgS_GndChkFv */ -void @20@__dt__11cBgS_GndChkFv { - /* Nonmatching */ -} - -/* 80022788-80022790 .text @20@__dt__20dBgS_ObjGndChk_YoganFv */ -void @20@__dt__20dBgS_ObjGndChk_YoganFv { - /* Nonmatching */ -} - -/* 80022790-80022798 .text @76@__dt__20dBgS_ObjGndChk_YoganFv */ -void @76@__dt__20dBgS_ObjGndChk_YoganFv { - /* Nonmatching */ -} - -/* 80022798-800227A0 .text @64@__dt__20dBgS_ObjGndChk_YoganFv */ -void @64@__dt__20dBgS_ObjGndChk_YoganFv { - /* Nonmatching */ -} diff --git a/src/d/actor/d_a_am.cpp b/src/d/actor/d_a_am.cpp index 5cca2bac2..e5296a2a5 100644 --- a/src/d/actor/d_a_am.cpp +++ b/src/d/actor/d_a_am.cpp @@ -3,441 +3,708 @@ // Translation Unit: d_a_am.cpp // -#include "d_a_am.h" -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" +#include "JSystem/JKernel/JKRHeap.h" +#include "JSystem/J3DGraphAnimator/J3DNode.h" +#include "SSystem/SComponent/c_xyz.h" +#include "d/d_procname.h" +#include "d/d_cc_d.h" +#include "d/d_bg_s_acch.h" +#include "d/d_particle.h" +#include "d/d_s_play.h" +#include "d/d_com_inf_game.h" +#include "d/d_item_data.h" +#include "c/c_damagereaction.h" +#include "m_Do/m_Do_mtx.h" +#include "d/d_snap.h" +#include "d/actor/d_a_player.h" +#include "d/d_jnt_hit.h" + +class am_class : public fopEn_enemy_c { +public: + enum Action { + ACTION_DOUSA = 0x0, + ACTION_MODORU_MOVE = 0x1, + ACTION_HANDOU_MOVE = 0x2, + ACTION_ITAI_MOVE = 0x3, + }; + + /* 0x02AC */ request_of_phase_process_class mPhs; + /* 0x02B4 */ JntHit_c* m02B4; + /* 0x02B8 */ mDoExt_McaMorf* mpMorf; + /* 0x02BC */ u8 m02BC[0x02C0 - 0x02BC]; + /* 0x02C0 */ u8 mType; + /* 0x02C1 */ u8 mPrmAreaRadius; + /* 0x02C2 */ u8 mStartsInactive; + /* 0x02C3 */ u8 mSwitch; + /* 0x02C4 */ u8 mAction; + /* 0x02C5 */ u8 m02C5; + /* 0x02C6 */ u8 mHugeKnockback; + /* 0x02C7 */ bool mbIsBeingHit; + /* 0x02C8 */ s16 m02C8[4]; + /* 0x02D0 */ s16 m02D0[5]; + /* 0x02DA */ s16 m02DA; + /* 0x02DC */ s16 m02DC; + /* 0x02DE */ u8 m02DE[0x02E0 - 0x02DE]; + /* 0x02E0 */ int m02E0; + /* 0x02E4 */ int m02E4; + /* 0x02E8 */ f32 mAreaRadius; + /* 0x02EC */ f32 m02EC; + /* 0x02F0 */ f32 m02F0; + /* 0x02F4 */ cXyz m02F4; + /* 0x0300 */ cXyz m0300; + /* 0x030C */ cXyz m030C; + /* 0x0318 */ cXyz m0318; + /* 0x0324 */ cXyz m0324; + /* 0x0330 */ csXyz m0330; + /* 0x0336 */ s16 m0336; + /* 0x0338 */ s16 m0338; + /* 0x033A */ u8 m033A[0x033C - 0x033A]; + /* 0x033C */ JPABaseEmitter* m033C; + /* 0x0340 */ JPABaseEmitter* m0340; + /* 0x0344 */ dPa_smokeEcallBack mSmokeCbs[4]; + /* 0x03C4 */ dBgS_AcchCir mAcchCir; + /* 0x0404 */ dBgS_ObjAcch mAcch; + /* 0x05C8 */ dCcD_Stts mStts; + /* 0x0604 */ dCcD_Sph mEyeSph; + /* 0x0730 */ dCcD_Sph mMouthSph; + /* 0x085C */ dCcD_Cyl mBodyCyl; + /* 0x098C */ dCcD_Cyl mSwordCyl; + /* 0x0ABC */ enemyice mEnemyIce; + /* 0x0E74 */ enemyfire mEnemyFire; +}; /* 00000078-0000021C .text nodeCallBack__FP7J3DNodei */ -void nodeCallBack(J3DNode*, int) { - /* Nonmatching */ +BOOL nodeCallBack(J3DNode* node, int param_1) { + if (!param_1) { + J3DJoint* joint = (J3DJoint*)node; + s32 jntNo = joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + am_class* i_this = (am_class*)model->getUserArea(); + if (i_this) { + if (jntNo >= 1 && jntNo <= 4) { + cMtx_copy(model->getAnmMtx(jntNo), *calc_mtx); + } + + cXyz offset; + switch (jntNo) { + case 1: + offset.x = 0.0f; + offset.y = 240.0f; + offset.z = 60.0f; + MtxPosition(&offset, &i_this->m02F4); + offset.x = 0.0f; + offset.y = 150.0f; + offset.z = 70.0f; + MtxPosition(&offset, &i_this->m0300); + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = 0.0f; + MtxPosition(&offset, &i_this->m030C); + break; + case 2: + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = 0.0f; + MtxPosition(&offset, &i_this->m0318); + break; + case 4: + cMtx_YrotM(*calc_mtx, i_this->m0330.y); + cMtx_XrotM(*calc_mtx, i_this->m0330.x); + } + + if (jntNo >= 1 && jntNo <= 4) { + model->setAnmMtx(jntNo, *calc_mtx); + cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + return TRUE; } /* 0000021C-000002E4 .text draw_SUB__FP8am_class */ -void draw_SUB(am_class*) { - /* Nonmatching */ +void draw_SUB(am_class* i_this) { + J3DModel* model = i_this->mpMorf->getModel(); + model->setBaseScale(i_this->mScale); + mDoMtx_stack_c::transS(i_this->current.pos); + cMtx_YrotM(mDoMtx_stack_c::get(), i_this->shape_angle.y); + cMtx_XrotM(mDoMtx_stack_c::get(), i_this->shape_angle.x); + cMtx_ZrotM(mDoMtx_stack_c::get(), i_this->shape_angle.z); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + + i_this->mpMorf->calc(); + + g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &i_this->current.pos, &i_this->mTevStr); } /* 000002E4-00000378 .text daAM_Draw__FP8am_class */ -void daAM_Draw(am_class*) { - /* Nonmatching */ +BOOL daAM_Draw(am_class* i_this) { + g_env_light.setLightTevColorType(i_this->mpMorf->getModel(), &i_this->mTevStr); + + dSnap_RegistFig(0xB7, i_this, 1.0f, 1.0f, 1.0f); + + i_this->mpMorf->entryDL(); + + dComIfGd_setSimpleShadow2( + &i_this->current.pos, i_this->mAcch.GetGroundH(), 90.0f, i_this->mAcch.m_gnd, + 0, 1.0f, dDlst_shadowControl_c::getSimpleTex() + ); + + return TRUE; } /* 00000378-000004A4 .text anm_init__FP8am_classifUcfi */ -void anm_init(am_class*, int, float, unsigned char, float, int) { - /* Nonmatching */ +void anm_init(am_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f32 speed, int soundFileIdx) { + i_this->m02E0 = bckFileIdx; + if (soundFileIdx >= 0) { + void* soundAnm = dComIfG_getObjectRes("AM", soundFileIdx); + J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("AM", bckFileIdx); + i_this->mpMorf->setAnm(bckAnm, loopMode, morf, speed, 0.0f, -1.0f, soundAnm); + } else { + J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("AM", bckFileIdx); + i_this->mpMorf->setAnm(bckAnm, loopMode, morf, speed, 0.0f, -1.0f, NULL); + } } /* 000004A4-00000784 .text body_atari_check__FP8am_class */ -void body_atari_check(am_class*) { - /* Nonmatching */ +void body_atari_check(am_class* i_this) { + daPy_py_c* player = daPy_getPlayerActorClass(); + + i_this->mStts.Move(); + + if (i_this->mBodyCyl.ChkTgHit() || i_this->mSwordCyl.ChkTgHit()) { + if (i_this->mbIsBeingHit) { + return; + } + + cCcD_Obj* hitObj; + if (i_this->mBodyCyl.ChkTgHit()) { + hitObj = i_this->mBodyCyl.GetTgHitObj(); + } else { + hitObj = i_this->mSwordCyl.GetTgHitObj(); + } + if (!hitObj) { + return; + } + i_this->mbIsBeingHit = true; + + switch (hitObj->GetAtType()) { + case AT_TYPE_SWORD: + case AT_TYPE_MACHETE: + case 0x00000800: + case AT_TYPE_DARKNUT_SWORD: + case AT_TYPE_MOBLIN_SPEAR: + fopAcM_seStart(i_this, JA_SE_LK_SW_HIT_S, 0x42); + break; + case AT_TYPE_BOOMERANG: + case AT_TYPE_BOKO_STICK: + case 0x00002000: + case AT_TYPE_STALFOS_MACE: + fopAcM_seStart(i_this, JA_SE_LK_W_WEP_HIT, 0x42); + break; + case AT_TYPE_SKULL_HAMMER: + fopAcM_seStart(i_this, JA_SE_LK_HAMMER_HIT, 0x42); + if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF && !dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { + return; + } + if (i_this->mAction == am_class::ACTION_HANDOU_MOVE) { + return; + } + if (i_this->mAction == am_class::ACTION_ITAI_MOVE) { + return; + } + i_this->mAction = am_class::ACTION_HANDOU_MOVE; + i_this->m02C5 = 30; + i_this->mHugeKnockback = 0; + if (player->getCutType() == 0x11) { + // If the player hits the Armos Knight with the Skull Hammer's side swing, knock it back much farther than normal. + i_this->mHugeKnockback = 1; + } + break; + default: + fopAcM_seStart(i_this, JA_SE_LK_MS_WEP_HIT, 0x42); + break; + } + } else { + i_this->mbIsBeingHit = false; + } } /* 00000784-00000D14 .text medama_atari_check__FP8am_class */ -void medama_atari_check(am_class*) { +void medama_atari_check(am_class* i_this) { /* Nonmatching */ } /* 00000D14-00000F04 .text bomb_move_set__FP8am_classUc */ -void bomb_move_set(am_class*, unsigned char) { +void bomb_move_set(am_class* i_this, u8) { /* Nonmatching */ } /* 00000F04-00001138 .text bomb_nomi_check__FP8am_class */ -void bomb_nomi_check(am_class*) { +void bomb_nomi_check(am_class* i_this) { /* Nonmatching */ } /* 00001138-000011E4 .text BG_check__FP8am_class */ -void BG_check(am_class*) { - /* Nonmatching */ +void BG_check(am_class* i_this) { + f32 halfHeight = g_regHIO.mChild[12].mFloatRegs[3] + 30.0f; + f32 radius = g_regHIO.mChild[12].mFloatRegs[4] + 150.0f; + i_this->mAcchCir.SetWall(halfHeight, radius); + + i_this->current.pos.y -= i_this->m02EC; + i_this->next.pos.y -= i_this->m02EC; + i_this->mAcch.CrrPos(*dComIfG_Bgsp()); + i_this->current.pos.y += i_this->m02EC; + i_this->next.pos.y += i_this->m02EC; } /* 000011E4-00001504 .text Line_check__FP8am_class4cXyz */ -void Line_check(am_class*, cXyz) { - /* Nonmatching */ -} - -/* 00001504-00001630 .text __dt__11dBgS_LinChkFv */ -dBgS_LinChk::~dBgS_LinChk() { - /* Nonmatching */ -} - -/* 00001630-000016D0 .text __dt__8dBgS_ChkFv */ -dBgS_Chk::~dBgS_Chk() { - /* Nonmatching */ -} - -/* 000016D0-0000172C .text __dt__15dBgS_GrpPassChkFv */ -dBgS_GrpPassChk::~dBgS_GrpPassChk() { - /* Nonmatching */ -} - -/* 0000172C-00001774 .text __dt__15cBgS_GrpPassChkFv */ -cBgS_GrpPassChk::~cBgS_GrpPassChk() { - /* Nonmatching */ -} - -/* 00001774-000017D0 .text __dt__16dBgS_PolyPassChkFv */ -dBgS_PolyPassChk::~dBgS_PolyPassChk() { - /* Nonmatching */ -} - -/* 000017D0-00001818 .text __dt__16cBgS_PolyPassChkFv */ -cBgS_PolyPassChk::~cBgS_PolyPassChk() { - /* Nonmatching */ -} - -/* 00001818-000018AC .text __dt__11cBgS_LinChkFv */ -cBgS_LinChk::~cBgS_LinChk() { - /* Nonmatching */ -} - -/* 000018AC-000018F4 .text __dt__8cM3dGLinFv */ -cM3dGLin::~cM3dGLin() { - /* Nonmatching */ -} - -/* 000018F4-0000193C .text __dt__13cBgS_PolyInfoFv */ -cBgS_PolyInfo::~cBgS_PolyInfo() { +void Line_check(am_class* i_this, cXyz) { /* Nonmatching */ } /* 0000193C-00001B00 .text medama_move__FP8am_class */ -void medama_move(am_class*) { +void medama_move(am_class* i_this) { /* Nonmatching */ } /* 00001B00-00002564 .text action_dousa__FP8am_class */ -void action_dousa(am_class*) { +void action_dousa(am_class* i_this) { /* Nonmatching */ } /* 00002564-000028C4 .text action_modoru_move__FP8am_class */ -void action_modoru_move(am_class*) { +void action_modoru_move(am_class* i_this) { /* Nonmatching */ } /* 000028C4-00002A6C .text action_handou_move__FP8am_class */ -void action_handou_move(am_class*) { +void action_handou_move(am_class* i_this) { /* Nonmatching */ } /* 00002A6C-000034F4 .text action_itai_move__FP8am_class */ -void action_itai_move(am_class*) { +void action_itai_move(am_class* i_this) { /* Nonmatching */ } /* 000034F4-000039A4 .text daAM_Execute__FP8am_class */ -void daAM_Execute(am_class*) { - /* Nonmatching */ +BOOL daAM_Execute(am_class* i_this) { + fopAcM_setGbaName(i_this, BOW, 0xC, 0x2A); + + if (enemy_ice(&i_this->mEnemyIce)) { + i_this->mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpMorf->calc(); + return TRUE; + } + + for (int i = 0; i < ARRAY_SIZE(i_this->m02C8); i++) { + if (i_this->m02C8[i] != 0) { + i_this->m02C8[i]--; + } + } + + switch (i_this->mAction) { + case am_class::ACTION_DOUSA: + action_dousa(i_this); + break; + case am_class::ACTION_MODORU_MOVE: + action_modoru_move(i_this); + break; + case am_class::ACTION_HANDOU_MOVE: + action_handou_move(i_this); + break; + case am_class::ACTION_ITAI_MOVE: + action_itai_move(i_this); + break; + } + + if (i_this->mAction != am_class::ACTION_ITAI_MOVE && i_this->m02F0 - 1500.0f > i_this->current.pos.y) { + anm_init(i_this, 0x1A, 0.0f, 0, 0.0f, -1); + + dComIfGp_particle_set(0x8127, &i_this->m030C, NULL, NULL); + dComIfGp_particle_set(0x8128, &i_this->m030C, NULL, NULL); + + fopAcM_seStart(i_this, JA_SE_CM_AM_BEF_EXPLODE, 0); + + i_this->m02DA = i_this->current.angle.y; + + if (i_this->m033C) { + i_this->m033C->becomeInvalidEmitter(); + i_this->m033C = NULL; + } + if (i_this->m0340) { + i_this->m0340->becomeInvalidEmitter(); + i_this->m0340 = NULL; + } + + i_this->speedF = 0.0f; + i_this->mAction = am_class::ACTION_ITAI_MOVE; + i_this->m02C5 = 0x2F; + } + + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->m02DA, 1, 0x500); + if (i_this->m02C5 != 0x2E && i_this->m02C5 != 0x2F && i_this->m02C5 != 0x1F) { + cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 1, 0x500); + } + + if (i_this->m02C8[1] == 0) { + i_this->mpMorf->play(NULL, 0, 0); + } + + cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + cMtx_XrotM(*calc_mtx, i_this->current.angle.x); + cXyz offset; + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = i_this->speedF; + cXyz rotOffset; + MtxPosition(&offset, &rotOffset); + i_this->speed.x = rotOffset.x; + i_this->speed.z = rotOffset.z; + i_this->speed.y += i_this->mGravity; + if (i_this->speed.y < -100.0f) { + i_this->speed.y = -100.0f; + } + + body_atari_check(i_this); + + i_this->mAttentionInfo.mPosition = i_this->current.pos; + i_this->mAttentionInfo.mPosition.y += 330.0f; + i_this->mEyePos = i_this->current.pos; + i_this->mEyePos.y += 250.0f; + + cXyz swordPos = i_this->current.pos; + + i_this->mEyeSph.SetC(i_this->m02F4); + i_this->mEyeSph.SetR(60.0f); + dComIfG_Ccsp()->Set(&i_this->mEyeSph); + + i_this->mMouthSph.SetC(i_this->m0300); + i_this->mMouthSph.SetR(100.0f); + dComIfG_Ccsp()->Set(&i_this->mMouthSph); + + i_this->mBodyCyl.SetC(i_this->current.pos); + i_this->mBodyCyl.SetH(300.0f); + i_this->mBodyCyl.SetR(80.0f); + dComIfG_Ccsp()->Set(&i_this->mBodyCyl); + + swordPos.y += 40.0f; + i_this->mSwordCyl.SetC(swordPos); + i_this->mSwordCyl.SetH(30.0f); + i_this->mSwordCyl.SetR(130.0f); + dComIfG_Ccsp()->Set(&i_this->mSwordCyl); + + fopAcM_posMove(i_this, i_this->mStts.GetCCMoveP()); + BG_check(i_this); + draw_SUB(i_this); + + return TRUE; } /* 000039A4-000039AC .text daAM_IsDelete__FP8am_class */ -void daAM_IsDelete(am_class*) { - /* Nonmatching */ +BOOL daAM_IsDelete(am_class* i_this) { + return TRUE; } /* 000039AC-00003A84 .text daAM_Delete__FP8am_class */ -void daAM_Delete(am_class*) { - /* Nonmatching */ +BOOL daAM_Delete(am_class* i_this) { + dComIfG_resDelete(&i_this->mPhs, "AM"); + + for (int i = 0; i < 4; i++) { + i_this->mSmokeCbs[i].end(); + } + i_this->mSmokeCbs[2].end(); + + if (i_this->m033C) { + i_this->m033C->becomeInvalidEmitter(); + i_this->m033C = NULL; + } + if (i_this->m0340) { + i_this->m0340->becomeInvalidEmitter(); + i_this->m0340 = NULL; + } + + return TRUE; } /* 00003A84-00003C00 .text useHeapInit__FP10fopAc_ac_c */ -void useHeapInit(fopAc_ac_c*) { - /* Nonmatching */ +BOOL useHeapInit(fopAc_ac_c* i_actor) { + am_class* i_this = (am_class*)i_actor; + + i_this->mpMorf = new mDoExt_McaMorf( + (J3DModelData*)dComIfG_getObjectRes("AM", 0x22), // am.bdl + NULL, NULL, + (J3DAnmTransformKey*)dComIfG_getObjectRes("AM", 0x1F), // sleep_loop.bck + J3DFrameCtrl::LOOP_REPEAT_e, 0.0f, 0, -1, 1, + NULL, + 0x00000000, + 0x11020203 + ); + if (!i_this->mpMorf || !i_this->mpMorf->getModel()) { + return FALSE; + } + + i_this->mpMorf->getModel()->setUserArea((u32)i_this); + for (u16 i = 0; i < i_this->mpMorf->getModel()->getModelData()->getJointNum(); i++) { + i_this->mpMorf->getModel()->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); + } + + static Vec cyl2_eye_offset[] = { + {0.0f, 0.0f, 70.0f}, + {0.0f, 0.0f, 80.0f}, + }; + static __jnt_hit_data_c search_data[] = { + { + /* field_0x0 */ 2, + /* mJointIndex */ 0x05, // hitomi (pupil) joint + /* field_0x4 */ 5.0f, + /* field_0x8 */ (cXyz*)&cyl2_eye_offset, + }, + }; + i_this->m02B4 = JntHit_create(i_this->mpMorf->getModel(), search_data, ARRAY_SIZE(search_data)); + if (i_this->m02B4) { + i_this->mJntHit = i_this->m02B4; + } else { + return FALSE; + } + + return TRUE; } /* 00003C00-00003F5C .text daAM_Create__FP10fopAc_ac_c */ -void daAM_Create(fopAc_ac_c*) { - /* Nonmatching */ +s32 daAM_Create(fopAc_ac_c* i_actor) { + fopAcM_SetupActor(i_actor, am_class); + + am_class* i_this = (am_class*)i_actor; + + s32 phase_state = dComIfG_resLoad(&i_this->mPhs, "AM"); + if (phase_state == cPhs_COMPLEATE_e) { + if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x1C80)) { + return cPhs_ERROR_e; + } + + i_this->mItemStealLeft = 3; + + i_this->mSmokeCbs[0].setRateOff(0); + i_this->mSmokeCbs[1].setRateOff(0); + i_this->mSmokeCbs[3].setRateOff(0); + + i_this->mType = (fopAcM_GetParam(i_this) >> 0x00) & 0xFF; + i_this->mPrmAreaRadius = (fopAcM_GetParam(i_this) >> 0x08) & 0xFF; + i_this->mStartsInactive = (fopAcM_GetParam(i_this) >> 0x10) & 0xFF; + i_this->mSwitch = (fopAcM_GetParam(i_this) >> 0x18) & 0xFF; + + if (i_this->mType == 0xFF) { + i_this->mType = 0; + } + if (i_this->mStartsInactive == 0xFF) { + i_this->mStartsInactive = 0; + } + if (g_regHIO.mChild[8].mShortRegs[9] != 0) { + i_this->mType = 1; + } + if (i_this->mPrmAreaRadius == 0xFF || i_this->mPrmAreaRadius == 0) { + i_this->mAreaRadius = 400.0f; + } else { + i_this->mAreaRadius = i_this->mPrmAreaRadius * 100.0f; + } + i_this->m02F0 = i_this->current.pos.y; + i_this->m02E4 = -1; + + if (i_this->mStartsInactive == 0 && i_this->mSwitch != 0xFF && dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { + // When mStartsInactive is 0, the Armos Knight starts active and attacking the player. + // mSwitch being set disables it from spawning again in the future. + return cPhs_ERROR_e; + } + if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF && !dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { + // When mStartsInactive is 1, the Armos Knight is initially inactive. + // mSwitch being set causes it to become active and attack the player. + fopAcM_OffStatus(i_this, fopAcStts_SHOWMAP_e); + } + + i_this->mItemTableIdx = dComIfGp_CharTbl()->GetNameIndex("amos", 0); + i_this->mMaxHealth = 10; + i_this->mHealth = 10; + + i_this->mCullMtx = i_this->mpMorf->mpModel->getBaseTRMtx(); + fopAcM_setCullSizeBox(i_this, -100.0f, -10.0f, -80.0f, 120.0f, 400.0f, 100.0f); + + i_this->mAttentionInfo.mFlags = 0; + + i_this->mAcch.Set( + &fopAcM_GetPosition_p(i_this), &fopAcM_GetOldPosition_p(i_this), + i_this, 1, &i_this->mAcchCir, &fopAcM_GetSpeed_p(i_this), + NULL, NULL + ); + i_this->mStts.Init(0xFE, 1, i_this); + + i_this->mGravity = -10.0f; + + i_this->mEnemyIce.mpActor = i_this; + i_this->mEnemyIce.mWallRadius = 80.0f; + i_this->mEnemyIce.mCylHeight = 300.0f; + + static dCcD_SrcSph eye_co_sph_src = { + // dCcD_SrcGObjInf + { + /* Flags */ 0, + /* SrcObjAt Type */ 0x1000, + /* SrcObjAt Atp */ 0, + /* SrcObjAt SPrm */ 0, + /* SrcObjTg Type */ AT_TYPE_NORMAL_ARROW | AT_TYPE_FIRE_ARROW | AT_TYPE_ICE_ARROW | AT_TYPE_LIGHT_ARROW | AT_TYPE_GRAPPLING_HOOK, + /* SrcObjTg SPrm */ 0x03, + /* SrcObjCo SPrm */ 0, + /* SrcGObjAt Se */ 0, + /* SrcGObjAt HitMark */ 0, + /* SrcGObjAt Spl */ 0, + /* SrcGObjAt Mtrl */ 0, + /* SrcGObjAt GFlag */ 0, + /* SrcGObjTg Se */ 0, + /* SrcGObjTg HitMark */ 0, + /* SrcGObjTg Spl */ 0, + /* SrcGObjTg Mtrl */ 0, + /* SrcGObjTg GFlag */ 0x06, + /* SrcGObjCo GFlag */ 0, + }, + // cM3dGSphS + { + /* Center */ 0.0f, 0.0f, 0.0f, + /* Radius */ 15.0f, + }, + }; + i_this->mEyeSph.Set(eye_co_sph_src); + i_this->mEyeSph.SetStts(&i_this->mStts); + + static dCcD_SrcSph mouth_co_sph_src = { + // dCcD_SrcGObjInf + { + /* Flags */ 0, + /* SrcObjAt Type */ 0x1000, + /* SrcObjAt Atp */ 0, + /* SrcObjAt SPrm */ 0, + /* SrcObjTg Type */ 0, + /* SrcObjTg SPrm */ 0, + /* SrcObjCo SPrm */ 0x145, + /* SrcGObjAt Se */ 0, + /* SrcGObjAt HitMark */ 0, + /* SrcGObjAt Spl */ 0, + /* SrcGObjAt Mtrl */ 0, + /* SrcGObjAt GFlag */ 0, + /* SrcGObjTg Se */ 0, + /* SrcGObjTg HitMark */ 0, + /* SrcGObjTg Spl */ 0, + /* SrcGObjTg Mtrl */ 0, + /* SrcGObjTg GFlag */ 0x02, + /* SrcGObjCo GFlag */ 0, + }, + // cM3dGSphS + { + /* Center */ 0.0f, 0.0f, 0.0f, + /* Radius */ 15.0f, + }, + }; + i_this->mMouthSph.Set(mouth_co_sph_src); + i_this->mMouthSph.SetStts(&i_this->mStts); + + static dCcD_SrcCyl body_co_cyl_src = { + // dCcD_SrcGObjInf + { + /* Flags */ 0, + /* SrcObjAt Type */ 0x1000, + /* SrcObjAt Atp */ 0, + /* SrcObjAt SPrm */ 0, + /* SrcObjTg Type */ ~(0x100 | 0x20000 | AT_TYPE_LEAF_WIND | 0x400000 | 0x800000), + /* SrcObjTg SPrm */ 0x03, + /* SrcObjCo SPrm */ 0x75, + /* SrcGObjAt Se */ 0, + /* SrcGObjAt HitMark */ 0, + /* SrcGObjAt Spl */ 0, + /* SrcGObjAt Mtrl */ 0, + /* SrcGObjAt GFlag */ 0, + /* SrcGObjTg Se */ 0, + /* SrcGObjTg HitMark */ 0x0C, + /* SrcGObjTg Spl */ 0, + /* SrcGObjTg Mtrl */ 0, + /* SrcGObjTg GFlag */ 0x03, + /* SrcGObjCo GFlag */ 0, + }, + // cM3dGCylS + { + /* Center */ 0.0f, 0.0f, 0.0f, + /* Radius */ 15.0f, + /* Height */ 0.0f, + }, + }; + i_this->mBodyCyl.Set(body_co_cyl_src); + i_this->mBodyCyl.SetStts(&i_this->mStts); + + static dCcD_SrcCyl sword_co_cyl_src = { + // dCcD_SrcGObjInf + { + /* Flags */ 0, + /* SrcObjAt Type */ 0x1000, + /* SrcObjAt Atp */ 2, + /* SrcObjAt SPrm */ 0x0F, + /* SrcObjTg Type */ 0, + /* SrcObjTg SPrm */ 0, + /* SrcObjCo SPrm */ 0x75, + /* SrcGObjAt Se */ 0, + /* SrcGObjAt HitMark */ 0, + /* SrcGObjAt Spl */ 0x06, + /* SrcGObjAt Mtrl */ 0, + /* SrcGObjAt GFlag */ 0, + /* SrcGObjTg Se */ 0, + /* SrcGObjTg HitMark */ 0x0C, + /* SrcGObjTg Spl */ 0, + /* SrcGObjTg Mtrl */ 0, + /* SrcGObjTg GFlag */ 0x03, + /* SrcGObjCo GFlag */ 0, + }, + // cM3dGCylS + { + /* Center */ 0.0f, 0.0f, 0.0f, + /* Radius */ 15.0f, + /* Height */ 0.0f, + }, + }; + i_this->mSwordCyl.Set(sword_co_cyl_src); + i_this->mSwordCyl.SetStts(&i_this->mStts); + + i_this->mSwordCyl.OffAtSetBit(); + i_this->mSwordCyl.OffAtSetBit(); + + i_this->m02DA = i_this->current.angle.y; + i_this->m0324 = i_this->current.pos; + i_this->m02DC = i_this->current.angle.y; + + draw_SUB(i_this); + } + + return phase_state; } -/* 00003F5C-000042A4 .text __ct__8am_classFv */ -am_class::am_class() { - /* Nonmatching */ -} - -/* 000042A4-00004370 .text __dt__8dCcD_CylFv */ -dCcD_Cyl::~dCcD_Cyl() { - /* Nonmatching */ -} - -/* 00004370-000043B8 .text __dt__8cM3dGCylFv */ -cM3dGCyl::~cM3dGCyl() { - /* Nonmatching */ -} - -/* 000043B8-00004484 .text __dt__8dCcD_SphFv */ -dCcD_Sph::~dCcD_Sph() { - /* Nonmatching */ -} - -/* 00004484-000044CC .text __dt__8cM3dGSphFv */ -cM3dGSph::~cM3dGSph() { - /* Nonmatching */ -} - -/* 000044CC-00004528 .text __dt__14cCcD_ShapeAttrFv */ -cCcD_ShapeAttr::~cCcD_ShapeAttr() { - /* Nonmatching */ -} - -/* 00004528-00004570 .text __dt__8cM3dGAabFv */ -cM3dGAab::~cM3dGAab() { - /* Nonmatching */ -} - -/* 00004570-000045CC .text __dt__10dCcD_GSttsFv */ -dCcD_GStts::~dCcD_GStts() { - /* Nonmatching */ -} - -/* 000045CC-0000463C .text __dt__12dBgS_ObjAcchFv */ -dBgS_ObjAcch::~dBgS_ObjAcch() { - /* Nonmatching */ -} - -/* 0000463C-000046C4 .text __dt__12dBgS_AcchCirFv */ -dBgS_AcchCir::~dBgS_AcchCir() { - /* Nonmatching */ -} - -/* 000046C4-00004740 .text __dt__18dPa_smokeEcallBackFv */ -dPa_smokeEcallBack::~dPa_smokeEcallBack() { - /* Nonmatching */ -} - -/* 00004740-00004764 .text __defctor__18dPa_smokeEcallBackFv */ -void dPa_smokeEcallBack::__defctor() { - /* Nonmatching */ -} - -/* 00004764-00004768 .text draw__34JPACallBackBaseFP14JPABaseEmitter */ -void JPACallBackBase::draw(JPABaseEmitter*) { - /* Nonmatching */ -} - -/* 00004768-0000476C .text executeAfter__34JPACallBackBaseFP14JPABaseEmitter */ -void JPACallBackBase::executeAfter(JPABaseEmitter*) { - /* Nonmatching */ -} - -/* 0000476C-00004770 .text execute__34JPACallBackBaseFP14JPABaseEmitter */ -void JPACallBackBase::execute(JPABaseEmitter*) { - /* Nonmatching */ -} - -/* 00004770-00004774 .text init__34JPACallBackBaseFP14JPABaseEmitter */ -void JPACallBackBase::init(JPABaseEmitter*) { - /* Nonmatching */ -} - -/* 00004774-000047BC .text __dt__34JPACallBackBaseFv */ -JPACallBackBase::~JPACallBackBase() { - /* Nonmatching */ -} - -/* 000047BC-00004818 .text __dt__18dPa_levelEcallBackFv */ -dPa_levelEcallBack::~dPa_levelEcallBack() { - /* Nonmatching */ -} - -/* 00004818-00004860 .text __dt__8cM2dGCirFv */ -cM2dGCir::~cM2dGCir() { - /* Nonmatching */ -} - -/* 00004860-000048BC .text __dt__8cM3dGCirFv */ -cM3dGCir::~cM3dGCir() { - /* Nonmatching */ -} - -/* 000048BC-00004904 .text __dt__10cCcD_GSttsFv */ -cCcD_GStts::~cCcD_GStts() { - /* Nonmatching */ -} - -/* 00004904-00004914 .text GetShapeAttr__8dCcD_CylFv */ -void dCcD_Cyl::GetShapeAttr() { - /* Nonmatching */ -} - -/* 00004914-0000491C .text GetCoCP__12cCcD_CylAttrFv */ -void cCcD_CylAttr::GetCoCP() { - /* Nonmatching */ -} - -/* 0000491C-00004924 .text GetCoCP__12cCcD_CylAttrCFv */ -void cCcD_CylAttr::GetCoCP() const { - /* Nonmatching */ -} - -/* 00004924-0000492C .text CrossAtTg__12cCcD_CylAttrCFRC12cCcD_AabAttrP4cXyz */ -void cCcD_CylAttr::CrossAtTg(const cCcD_AabAttr&, cXyz*) const { - /* Nonmatching */ -} - -/* 0000492C-00004934 .text CrossAtTg__12cCcD_CylAttrCFRC12cCcD_PntAttrP4cXyz */ -void cCcD_CylAttr::CrossAtTg(const cCcD_PntAttr&, cXyz*) const { - /* Nonmatching */ -} - -/* 00004934-0000496C .text CrossAtTg__12cCcD_CylAttrCFRC14cCcD_ShapeAttrP4cXyz */ -void cCcD_CylAttr::CrossAtTg(const cCcD_ShapeAttr&, cXyz*) const { - /* Nonmatching */ -} - -/* 0000496C-00004974 .text CrossCo__12cCcD_CylAttrCFRC12cCcD_AabAttrPf */ -void cCcD_CylAttr::CrossCo(const cCcD_AabAttr&, float*) const { - /* Nonmatching */ -} - -/* 00004974-0000497C .text CrossCo__12cCcD_CylAttrCFRC12cCcD_TriAttrPf */ -void cCcD_CylAttr::CrossCo(const cCcD_TriAttr&, float*) const { - /* Nonmatching */ -} - -/* 0000497C-00004984 .text CrossCo__12cCcD_CylAttrCFRC12cCcD_PntAttrPf */ -void cCcD_CylAttr::CrossCo(const cCcD_PntAttr&, float*) const { - /* Nonmatching */ -} - -/* 00004984-000049BC .text CrossCo__12cCcD_CylAttrCFRC14cCcD_ShapeAttrPf */ -void cCcD_CylAttr::CrossCo(const cCcD_ShapeAttr&, float*) const { - /* Nonmatching */ -} - -/* 000049BC-000049C0 .text GetGObjInf__12cCcD_GObjInfCFv */ -void cCcD_GObjInf::GetGObjInf() const { - /* Nonmatching */ -} - -/* 000049C0-000049C8 .text GetShapeAttr__8cCcD_ObjCFv */ -void cCcD_Obj::GetShapeAttr() const { - /* Nonmatching */ -} - -/* 000049C8-000049D8 .text GetShapeAttr__8dCcD_SphFv */ -void dCcD_Sph::GetShapeAttr() { - /* Nonmatching */ -} - -/* 000049D8-000049E0 .text GetCoCP__12cCcD_SphAttrFv */ -void cCcD_SphAttr::GetCoCP() { - /* Nonmatching */ -} - -/* 000049E0-000049E8 .text GetCoCP__12cCcD_SphAttrCFv */ -void cCcD_SphAttr::GetCoCP() const { - /* Nonmatching */ -} - -/* 000049E8-000049F0 .text CrossAtTg__12cCcD_SphAttrCFRC12cCcD_AabAttrP4cXyz */ -void cCcD_SphAttr::CrossAtTg(const cCcD_AabAttr&, cXyz*) const { - /* Nonmatching */ -} - -/* 000049F0-000049F8 .text CrossAtTg__12cCcD_SphAttrCFRC12cCcD_PntAttrP4cXyz */ -void cCcD_SphAttr::CrossAtTg(const cCcD_PntAttr&, cXyz*) const { - /* Nonmatching */ -} - -/* 000049F8-00004A30 .text CrossAtTg__12cCcD_SphAttrCFRC14cCcD_ShapeAttrP4cXyz */ -void cCcD_SphAttr::CrossAtTg(const cCcD_ShapeAttr&, cXyz*) const { - /* Nonmatching */ -} - -/* 00004A30-00004A38 .text CrossCo__12cCcD_SphAttrCFRC12cCcD_AabAttrPf */ -void cCcD_SphAttr::CrossCo(const cCcD_AabAttr&, float*) const { - /* Nonmatching */ -} - -/* 00004A38-00004A40 .text CrossCo__12cCcD_SphAttrCFRC12cCcD_TriAttrPf */ -void cCcD_SphAttr::CrossCo(const cCcD_TriAttr&, float*) const { - /* Nonmatching */ -} - -/* 00004A40-00004A48 .text CrossCo__12cCcD_SphAttrCFRC12cCcD_PntAttrPf */ -void cCcD_SphAttr::CrossCo(const cCcD_PntAttr&, float*) const { - /* Nonmatching */ -} - -/* 00004A48-00004A80 .text CrossCo__12cCcD_SphAttrCFRC14cCcD_ShapeAttrPf */ -void cCcD_SphAttr::CrossCo(const cCcD_ShapeAttr&, float*) const { - /* Nonmatching */ -} - -/* 00004A80-00004A88 .text CrossAtTg__14cCcD_ShapeAttrCFRC14cCcD_ShapeAttrP4cXyz */ -void cCcD_ShapeAttr::CrossAtTg(const cCcD_ShapeAttr&, cXyz*) const { - /* Nonmatching */ -} - -/* 00004A88-00004A90 .text CrossCo__14cCcD_ShapeAttrCFRC14cCcD_ShapeAttrPf */ -void cCcD_ShapeAttr::CrossCo(const cCcD_ShapeAttr&, float*) const { - /* Nonmatching */ -} - -/* 00004A90-00004A9C .text GetCoCP__14cCcD_ShapeAttrFv */ -void cCcD_ShapeAttr::GetCoCP() { - /* Nonmatching */ -} - -/* 00004A9C-00004AA8 .text GetCoCP__14cCcD_ShapeAttrCFv */ -void cCcD_ShapeAttr::GetCoCP() const { - /* Nonmatching */ -} - -/* 00004AA8-00004AB0 .text @20@__dt__11cBgS_LinChkFv */ -void @20@__dt__11cBgS_LinChkFv { - /* Nonmatching */ -} - -/* 00004AB0-00004AB8 .text @12@__dt__8dBgS_ChkFv */ -void @12@__dt__8dBgS_ChkFv { - /* Nonmatching */ -} - -/* 00004AB8-00004AC0 .text @20@__dt__11dBgS_LinChkFv */ -void @20@__dt__11dBgS_LinChkFv { - /* Nonmatching */ -} - -/* 00004AC0-00004AC8 .text @100@__dt__11dBgS_LinChkFv */ -void @100@__dt__11dBgS_LinChkFv { - /* Nonmatching */ -} - -/* 00004AC8-00004AD0 .text @88@__dt__11dBgS_LinChkFv */ -void @88@__dt__11dBgS_LinChkFv { - /* Nonmatching */ -} - -/* 00004AD0-00004AD8 .text @32@__dt__12dBgS_ObjAcchFv */ -void @32@__dt__12dBgS_ObjAcchFv { - /* Nonmatching */ -} - -/* 00004AD8-00004AE0 .text @20@__dt__12dBgS_ObjAcchFv */ -void @20@__dt__12dBgS_ObjAcchFv { - /* Nonmatching */ -} - -/* 00004AE0-00004AE8 .text @280@__dt__8dCcD_SphFv */ -void @280@__dt__8dCcD_SphFv { - /* Nonmatching */ -} - -/* 00004AE8-00004AF0 .text @248@__dt__8dCcD_SphFv */ -void @248@__dt__8dCcD_SphFv { - /* Nonmatching */ -} - -/* 00004AF0-00004AF8 .text @280@__dt__8dCcD_CylFv */ -void @280@__dt__8dCcD_CylFv { - /* Nonmatching */ -} - -/* 00004AF8-00004B00 .text @248@__dt__8dCcD_CylFv */ -void @248@__dt__8dCcD_CylFv { - /* Nonmatching */ -} +static actor_method_class l_daAM_Method = { + (process_method_func)daAM_Create, + (process_method_func)daAM_Delete, + (process_method_func)daAM_Execute, + (process_method_func)daAM_IsDelete, + (process_method_func)daAM_Draw, +}; +extern actor_process_profile_definition g_profile_AM = { + /* LayerID */ fpcLy_CURRENT_e, + /* ListID */ 7, + /* ListPrio */ fpcPi_CURRENT_e, + /* ProcName */ PROC_AM, + /* Proc SubMtd */ &g_fpcLf_Method.mBase, + /* Size */ sizeof(am_class), + /* SizeOther */ 0, + /* Parameters */ 0, + /* Leaf SubMtd */ &g_fopAc_Method.base, + /* Priority */ 0x00BD, + /* Actor SubMtd */ &l_daAM_Method, + /* Status */ 0x00040120, + /* Group */ fopAc_ENEMY_e, + /* CullType */ fopAc_CULLBOX_CUSTOM_e, +}; diff --git a/src/d/actor/d_a_branch.cpp b/src/d/actor/d_a_branch.cpp index e70c727a9..7d71368c1 100644 --- a/src/d/actor/d_a_branch.cpp +++ b/src/d/actor/d_a_branch.cpp @@ -120,7 +120,7 @@ s32 daBranch_c::CreateHeap() { 0, 0, static_cast(dComIfG_getObjectIDRes(m_arcname, bckIds[i])), - 0, + -1, 1.0f, 0, -1, diff --git a/src/d/actor/d_a_kaji.cpp b/src/d/actor/d_a_kaji.cpp index 84e5dbc90..860484442 100644 --- a/src/d/actor/d_a_kaji.cpp +++ b/src/d/actor/d_a_kaji.cpp @@ -48,7 +48,7 @@ BOOL daKaji_c::CreateHeap() { modelData, NULL, NULL, (J3DAnmTransformKey*)dComIfG_getObjectRes("Kaji", 0xE), // kj_wait.bck - 2, 0.0f, 0, -1, 1, + J3DFrameCtrl::LOOP_REPEAT_e, 0.0f, 0, -1, 1, dComIfG_getObjectRes("Kaji", 0x8), // kj_wait.bas 0x00080000, 0x11000002 diff --git a/src/d/actor/d_a_mozo.cpp b/src/d/actor/d_a_mozo.cpp index ab57828d1..d2e3775e1 100644 --- a/src/d/actor/d_a_mozo.cpp +++ b/src/d/actor/d_a_mozo.cpp @@ -131,7 +131,7 @@ s32 daMozo_c::CreateHeap() { 0, 0, static_cast(dComIfG_getObjectRes("Mozo", 6)), - 2, + J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, diff --git a/src/d/d_jnt_hit.cpp b/src/d/d_jnt_hit.cpp index 411fd0647..2b8c197a2 100644 --- a/src/d/d_jnt_hit.cpp +++ b/src/d/d_jnt_hit.cpp @@ -3,7 +3,7 @@ // Translation Unit: d_jnt_hit.cpp // -#include "d_jnt_hit.h" +#include "d/d_jnt_hit.h" #include "dolphin/types.h" /* 80060BE8-80060C44 .text __ct__12JntHit_HIO_cFv */ @@ -17,17 +17,17 @@ void JntHit_c::CreateInit() { } /* 80060EC4-80061440 .text CylHitPosAngleOffset__8JntHit_cFP4cXyzP5csXyzP4cXyzP5csXyz4cXyz4cXyzf */ -void JntHit_c::CylHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, float) { +void JntHit_c::CylHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, f32) { /* Nonmatching */ } /* 80061440-80061830 .text Cyl2HitPosAngleOffset__8JntHit_cFP4cXyzP5csXyzP4cXyzP5csXyz4cXyz4cXyzf */ -void JntHit_c::Cyl2HitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, float) { +void JntHit_c::Cyl2HitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, cXyz, f32) { /* Nonmatching */ } /* 80061830-80061ACC .text SphHitPosAngleOffset__8JntHit_cFP4cXyzP5csXyzP4cXyzP5csXyz4cXyzf */ -void JntHit_c::SphHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, float) { +void JntHit_c::SphHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*, cXyz, f32) { /* Nonmatching */ } @@ -37,12 +37,12 @@ void JntHit_c::HitBufferUpdate(int*, cXyz*, int, csXyz*, cXyz*) { } /* 80061C28-800627DC .text searchJntHitPosAngleOffset__8JntHit_cFP4cXyzP5csXyzP4cXyzP5csXyz */ -void JntHit_c::searchJntHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*) { +s32 JntHit_c::searchJntHitPosAngleOffset(cXyz*, csXyz*, cXyz*, csXyz*) { /* Nonmatching */ } /* 800627DC-8006286C .text JntHit_create__FP8J3DModelP16__jnt_hit_data_cs */ -void JntHit_create(J3DModel*, __jnt_hit_data_c*, short) { +JntHit_c* JntHit_create(J3DModel* model, __jnt_hit_data_c* jntHitData, s16 hitDataCount) { /* Nonmatching */ }