diff --git a/configure.py b/configure.py index 88307dbb5da..2f97c87ea55 100755 --- a/configure.py +++ b/configure.py @@ -1649,7 +1649,7 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01"), "d_a_e_db_leaf"), ActorRel(NonMatching, "d_a_e_dd"), ActorRel(Equivalent, "d_a_e_df"), # weak func order - ActorRel(NonMatching, "d_a_e_dk"), + ActorRel(MatchingFor("GZ2E01"), "d_a_e_dk"), ActorRel(Equivalent, "d_a_e_dt"), # weak func order ActorRel(NonMatching, "d_a_e_fb"), ActorRel(NonMatching, "d_a_e_fk"), diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h index 6e6d20ef13f..6d382dea8e3 100644 --- a/include/JSystem/J3DGraphBase/J3DMatBlock.h +++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h @@ -699,6 +699,7 @@ struct J3DBlend : public J3DBlendInfo { J3DBlend(J3DBlendInfo const& info) : J3DBlendInfo(info) {} void setType(u8 i_type) { mType = i_type; } + void setSrcFactor(u8 i_factor) { mSrcFactor = i_factor; } void setDstFactor(u8 i_factor) { mDstFactor = i_factor; } GXBlendMode getBlendMode() const { return (GXBlendMode)mType; } diff --git a/include/d/actor/d_a_e_dk.h b/include/d/actor/d_a_e_dk.h index df0e8e7ab63..d54799a554c 100644 --- a/include/d/actor/d_a_e_dk.h +++ b/include/d/actor/d_a_e_dk.h @@ -18,15 +18,15 @@ */ class daE_DK_c : public fopEn_enemy_c { public: - /* 806AA228 */ void draw(); - /* 806AA5C8 */ void setBck(int, u8, f32, f32); - /* 806AA68C */ void setBckCore(int, u8, f32, f32); - /* 806AA730 */ void setActionMode(int, int); + /* 806AA228 */ int draw(); + /* 806AA5C8 */ void setBck(int i_resIndex, u8 i_attr, f32 i_morf, f32 i_rate); + /* 806AA68C */ void setBckCore(int i_resIndex, u8 i_attr, f32 i_morf, f32 i_rate); + /* 806AA730 */ void setActionMode(int i_actionMode, int i_moveMode); /* 806AA73C */ void damage_check(); - /* 806AA8B0 */ void checkPlayerSearch(); - /* 806AAB18 */ void checkPlayerAttack(f32); + /* 806AA8B0 */ bool checkPlayerSearch(); + /* 806AAB18 */ int checkPlayerAttack(f32); /* 806AAC24 */ void checkWaterHeight(); - /* 806AAD68 */ void SphBgcCallBack(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*); + /* 806AAD68 */ static void SphBgcCallBack(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*); /* 806AAE10 */ void setElectricEffect(); /* 806AB054 */ void setCoreDeadEffect(); /* 806AB158 */ void setBodyDeadEffect(); @@ -39,10 +39,10 @@ public: /* 806AC390 */ void action(); /* 806AC5BC */ void mtx_set(); /* 806AC754 */ void cc_set(); - /* 806AC968 */ void execute(); - /* 806ACA10 */ void _delete(); - /* 806ACAA4 */ void CreateHeap(); - /* 806ACE14 */ void create(); + /* 806AC968 */ int execute(); + /* 806ACA10 */ int _delete(); + /* 806ACAA4 */ int CreateHeap(); + /* 806ACE14 */ int create(); /* 806AD0AC */ daE_DK_c(); private: @@ -62,7 +62,7 @@ private: /* 0x690 */ u8 field_0x690; /* 0x691 */ u8 field_0x691; /* 0x692 */ u8 field_0x692; - /* 0x694 */ s16 field_0x694; + /* 0x694 */ u16 field_0x694; /* 0x698 */ s32 field_0x698; /* 0x69C */ s32 field_0x69c; /* 0x6A0 */ u8 field_0x6a0; @@ -82,9 +82,9 @@ private: /* 0x964 */ dCcD_Sph mSphere; /* 0xA9C */ dCcD_Sph mAtSphere; /* 0xBD4 */ dCcD_Sph mCoreSphere; - /* 0xD0C */ dCcU_AtInfo field_0xd0c; - /* 0xD30 */ u32 mEffects[6]; - /* 0xD48 */ u8 field_0xD48[0xD50 - 0xD48]; + /* 0xD0C */ dCcU_AtInfo mAtInfo; + /* 0xD30 */ u32 mElectricEffects[6]; + /* 0xD48 */ u32 mDeadEffects[2]; /* 0xD50 */ u8 mHIOInit; }; @@ -93,7 +93,7 @@ STATIC_ASSERT(sizeof(daE_DK_c) == 0xd54); class daE_DK_HIO_c : public JORReflexible { public: /* 806AA1EC */ daE_DK_HIO_c(); - /* 806AD490 */ virtual ~daE_DK_HIO_c(); + /* 806AD490 */ virtual ~daE_DK_HIO_c() {} void genMessage(JORMContext*); diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 2fb0725013b..d87ccdf5cb9 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -3862,28 +3862,28 @@ inline void dComIfGp_clearMesgCameraAttrInfo() { g_dComIfG_gameInfo.play.clearMesgCamInfoBasicID(); } -inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* param_2, - const dKy_tevstr_c* param_3, const csXyz* param_4, - const cXyz* param_5, u8 param_6, dPa_levelEcallBack* param_7, +inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, + const dKy_tevstr_c* param_3, const csXyz* i_rotation, + const cXyz* i_scale, u8 i_alpha, dPa_levelEcallBack* param_7, s8 param_8, const GXColor* param_9, const GXColor* param_10, const cXyz* param_11) { return g_dComIfG_gameInfo.play.getParticle()->setNormal( - param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, + param_0, param_1, i_pos, param_3, i_rotation, i_scale, i_alpha, param_7, param_8, param_9, param_10, param_11, 1.0f); } -inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* param_2, - const csXyz* param_3, const cXyz* param_4, u8 param_5, +inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, + const csXyz* i_rotation, const cXyz* i_scale, u8 param_5, dPa_levelEcallBack* param_6, s8 param_7, const GXColor* param_8, const GXColor* param_9, const cXyz* param_10) { return g_dComIfG_gameInfo.play.getParticle()->setNormal( - param_0, param_1, param_2, NULL, param_3, param_4, param_5, param_6, param_7, param_8, + param_0, param_1, i_pos, NULL, i_rotation, i_scale, param_5, param_6, param_7, param_8, param_9, param_10, 1.0f); } -inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* param_2, +inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, const dKy_tevstr_c* param_3) { - return dComIfGp_particle_set(param_0, param_1, param_2, param_3, 0, 0, 0xFF, 0, 0xFFFFFFFF, 0, + return dComIfGp_particle_set(param_0, param_1, i_pos, param_3, 0, 0, 0xFF, 0, 0xFFFFFFFF, 0, 0, 0); } @@ -3921,45 +3921,45 @@ inline JPABaseEmitter* dComIfGp_particle_set(u16 i_resID, const cXyz* i_pos, NULL, NULL); } -inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* param_2, +inline u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, const csXyz* param_3, const cXyz* param_4) { - return dComIfGp_particle_set(param_0, param_1, param_2, param_3, param_4, 0xFF, NULL, -1, NULL, + return dComIfGp_particle_set(param_0, param_1, i_pos, param_3, param_4, 0xFF, NULL, -1, NULL, NULL, NULL); } -inline u32 dComIfGp_particle_setColor(u32 param_0, u16 param_1, const cXyz* param_2, +inline u32 dComIfGp_particle_setColor(u32 param_0, u16 param_1, const cXyz* i_pos, const dKy_tevstr_c* param_3, const GXColor* param_4, const GXColor* param_5, f32 param_6, u8 param_7, const csXyz* param_8, const cXyz* param_9, dPa_levelEcallBack* param_10, s8 param_11, const cXyz* param_12) { return g_dComIfG_gameInfo.play.getParticle()->setNormal( - param_0, param_1, param_2, param_3, param_8, param_9, param_7, param_10, param_11, param_4, + param_0, param_1, i_pos, param_3, param_8, param_9, param_7, param_10, param_11, param_4, param_5, param_12, param_6); } -inline JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* param_1, +inline JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* i_pos, const dKy_tevstr_c* param_2, const GXColor* param_3, const GXColor* param_4, f32 param_5, u8 param_6, const csXyz* param_7, const cXyz* param_8, dPa_levelEcallBack* param_9, s8 param_10, const cXyz* param_11) { - return g_dComIfG_gameInfo.play.getParticle()->setNormal(param_0, param_1, param_2, param_7, + return g_dComIfG_gameInfo.play.getParticle()->setNormal(param_0, i_pos, param_2, param_7, param_8, param_6, param_9, param_10, param_3, param_4, param_11, param_5); } -inline JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* param_1, +inline JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* i_pos, const dKy_tevstr_c* param_2, const GXColor* param_3, const GXColor* param_4, f32 param_5, u8 param_6) { - return dComIfGp_particle_setColor(param_0, param_1, param_2, param_3, param_4, param_5, param_6, + return dComIfGp_particle_setColor(param_0, i_pos, param_2, param_3, param_4, param_5, param_6, NULL, NULL, NULL, -1, NULL); } -inline void dComIfGp_particle_setSimple(u16 param_0, cXyz* param_1, u8 param_2, _GXColor& param_3, +inline void dComIfGp_particle_setSimple(u16 param_0, cXyz* i_pos, u8 param_2, _GXColor& param_3, _GXColor& param_4, int param_5, float param_6) { - g_dComIfG_gameInfo.play.getParticle()->setSimple(param_0, param_1, 0, param_2, param_3, param_4, + g_dComIfG_gameInfo.play.getParticle()->setSimple(param_0, i_pos, 0, param_2, param_3, param_4, param_5, param_6); } diff --git a/include/d/d_particle.h b/include/d/d_particle.h index eea3e1d825f..c1c01f91ff1 100644 --- a/include/d/d_particle.h +++ b/include/d/d_particle.h @@ -367,19 +367,19 @@ public: void forceOnEventMove(u32 param_0) { field_0x210.forceOnEventMove(param_0); } JPABaseEmitter* getEmitter(u32 param_0) { return field_0x210.getEmitter(param_0); } - u32 setNormal(u32 param_0, u16 param_1, const cXyz* param_2, const dKy_tevstr_c* param_3, - const csXyz* param_4, const cXyz* param_5, u8 param_6, - dPa_levelEcallBack* param_7, s8 param_8, const GXColor* param_9, - const GXColor* param_10, const cXyz* param_11, f32 param_12) { - return set(param_0, 0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, + u32 setNormal(u32 param_0, u16 param_1, const cXyz* i_pos, const dKy_tevstr_c* param_3, + const csXyz* i_rotation, const cXyz* i_scale, u8 i_alpha, dPa_levelEcallBack* param_7, + s8 param_8, const GXColor* param_9, const GXColor* param_10, const cXyz* param_11, + f32 param_12) { + return set(param_0, 0, param_1, i_pos, param_3, i_rotation, i_scale, i_alpha, param_7, param_8, param_9, param_10, param_11, param_12); } - JPABaseEmitter* setNormal(u16 param_1, const cXyz* param_2, const dKy_tevstr_c* param_3, - const csXyz* param_4, const cXyz* param_5, u8 param_6, + JPABaseEmitter* setNormal(u16 param_1, const cXyz* i_pos, const dKy_tevstr_c* param_3, + const csXyz* i_rotation, const cXyz* i_scale, u8 i_alpha, dPa_levelEcallBack* param_7, s8 param_8, const GXColor* param_9, const GXColor* param_10, const cXyz* param_11, f32 param_12) { - return set(0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, + return set(0, param_1, i_pos, param_3, i_rotation, i_scale, i_alpha, param_7, param_8, param_9, param_10, param_11, param_12); } diff --git a/src/d/actor/d_a_e_dk.cpp b/src/d/actor/d_a_e_dk.cpp index 2c3d71e5395..6a84804de3e 100644 --- a/src/d/actor/d_a_e_dk.cpp +++ b/src/d/actor/d_a_e_dk.cpp @@ -4,973 +4,1112 @@ */ #include "d/actor/d_a_e_dk.h" +#include "d/actor/d_a_player.h" +#include "d/d_com_inf_game.h" +#include "d/d_s_play.h" #include "dol2asm.h" +#include - - -// -// Forward References: -// - -extern "C" void __ct__12daE_DK_HIO_cFv(); -extern "C" void draw__8daE_DK_cFv(); -extern "C" static void daE_DK_Draw__FP8daE_DK_c(); -extern "C" void setBck__8daE_DK_cFiUcff(); -extern "C" void setBckCore__8daE_DK_cFiUcff(); -extern "C" void setActionMode__8daE_DK_cFii(); -extern "C" void damage_check__8daE_DK_cFv(); -extern "C" void checkPlayerSearch__8daE_DK_cFv(); -extern "C" void checkPlayerAttack__8daE_DK_cFf(); -extern "C" void checkWaterHeight__8daE_DK_cFv(); -extern "C" void SphBgcCallBack__8daE_DK_cFP11dBgS_SphChkP10cBgD_Vtx_tiiiP8cM3dGPlaPv(); -extern "C" void setElectricEffect__8daE_DK_cFv(); -extern "C" void setCoreDeadEffect__8daE_DK_cFv(); -extern "C" void setBodyDeadEffect__8daE_DK_cFv(); -extern "C" void executeWait__8daE_DK_cFv(); -extern "C" void executeChase__8daE_DK_cFv(); -extern "C" void executeAttack__8daE_DK_cFv(); -extern "C" void executeDamage__8daE_DK_cFv(); -extern "C" void BodyDeathMove__8daE_DK_cFv(); -extern "C" void executeDeath__8daE_DK_cFv(); -extern "C" void action__8daE_DK_cFv(); -extern "C" void mtx_set__8daE_DK_cFv(); -extern "C" void cc_set__8daE_DK_cFv(); -extern "C" void execute__8daE_DK_cFv(); -extern "C" static void daE_DK_Execute__FP8daE_DK_c(); -extern "C" static bool daE_DK_IsDelete__FP8daE_DK_c(); -extern "C" void _delete__8daE_DK_cFv(); -extern "C" static void daE_DK_Delete__FP8daE_DK_c(); -extern "C" void CreateHeap__8daE_DK_cFv(); -extern "C" void __dt__12J3DFrameCtrlFv(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" void create__8daE_DK_cFv(); -extern "C" void __ct__8daE_DK_cFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__12dBgS_AcchCirFv(); -extern "C" static void daE_DK_Create__FP8daE_DK_c(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void __dt__12daE_DK_HIO_cFv(); -extern "C" void __sinit_d_a_e_dk_cpp(); -extern "C" static void func_806AD514(); -extern "C" static void func_806AD51C(); -extern "C" extern char const* const d_a_e_dk__stringBase0; - -// -// External References: -// - -extern "C" void transM__14mDoMtx_stack_cFfff(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void ZXYrotM__14mDoMtx_stack_cFRC5csXyz(); -extern "C" void play__14mDoExt_baseAnmFv(); -extern "C" void init__13mDoExt_btkAnmFP16J3DMaterialTableP19J3DAnmTextureSRTKeyiifss(); -extern "C" void entry__13mDoExt_btkAnmFP16J3DMaterialTablef(); -extern "C" void init__13mDoExt_brkAnmFP16J3DMaterialTableP15J3DAnmTevRegKeyiifss(); -extern "C" void entry__13mDoExt_brkAnmFP16J3DMaterialTablef(); -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 __ct__10fopAc_ac_cFv(); -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_posMoveF__FP10fopAc_ac_cPC4cXyz(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_createItem__FPC4cXyziiiPC5csXyzPC4cXyzi(); -extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc(); -extern "C" void fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfGp_getReverb__Fi(); -extern "C" void -dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void getEmitter__Q213dPa_control_c7level_cFUl(); -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 GroundCross__4cBgSFP11cBgS_GndChk(); -extern "C" void SphChk__4dBgSFP11dBgS_SphChkPv(); -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_SphChkFv(); -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 ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); -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_camera_water_in_status_check__Fv(); -extern "C" void GetAc__8cCcD_ObjFv(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void __ct__5csXyzFsss(); -extern "C" void cM_atan2s__Fff(); -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_addCalcAngleS__FPsssss(); -extern "C" void cLib_chaseUC__FPUcUcUc(); -extern "C" void cLib_chaseF__FPfff(); -extern "C" void cLib_chaseAngleS__FPsss(); -extern "C" void cLib_targetAngleY__FPC3VecPC3Vec(); -extern "C" void func_80280808(); -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 init__12J3DFrameCtrlFs(); -extern "C" void checkPass__12J3DFrameCtrlFf(); -extern "C" void _savegpr_22(); -extern "C" void _savegpr_23(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_22(); -extern "C" void _restgpr_23(); -extern "C" void _restgpr_25(); -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" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; -extern "C" extern u8 j3dZModeTable[96]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" void __register_global_object(); +#define ACTION_MODE_WAIT 0 +#define ACTION_MODE_CHASE 1 +#define ACTION_MODE_ATTACK 2 +#define ACTION_MODE_HURT 3 +#define ACTION_MODE_DIE 4 // // Declarations: // -/* ############################################################################################## */ -/* 806AD538-806AD53C 000000 0004+00 17/17 0/0 0/0 .rodata @3764 */ -SECTION_RODATA static f32 const lit_3764 = 2.0f; -COMPILER_STRIP_GATE(0x806AD538, &lit_3764); +UNK_REL_DATA; -/* 806AD53C-806AD540 000004 0004+00 0/2 0/0 0/0 .rodata @3765 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3765 = 700.0f; -COMPILER_STRIP_GATE(0x806AD53C, &lit_3765); -#pragma pop - -/* 806AD540-806AD544 000008 0004+00 0/3 0/0 0/0 .rodata @3766 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3766 = 1000.0f; -COMPILER_STRIP_GATE(0x806AD540, &lit_3766); -#pragma pop - -/* 806AD634-806AD640 000000 000C+00 1/1 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, +static dCcD_SrcSph cc_dk_src = { + { // mObjInf + { 0x0, { { 0, 0, { 0 } }, { (s32)0xd8fbbddf, { 3 } }, { { 0x75 } } } }, // mObj + { 0x09, 0, 0, 0, { 0 } }, // mGObjAt + { 0x00, 0x00, 0x00, 0x00, { 5 } }, // mGObjTg + { { 0 } }, // mGObjCo + }, + { { { 0.0f, 0.0f, 0.0f }, 40.0f, } } // mSphAttr }; -/* 806AD640-806AD654 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 - -/* 806AD654-806AD694 000020 0040+00 0/1 0/0 0/0 .data cc_dk_src__22@unnamed@d_a_e_dk_cpp@ - */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 data_806AD654[64] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xD8, 0xFB, 0xBD, 0xDF, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x75, 0x09, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00, -}; -#pragma pop - -/* 806AD694-806AD6D4 000060 0040+00 0/1 0/0 0/0 .data cc_dk_at_src__22@unnamed@d_a_e_dk_cpp@ */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 data_806AD694[64] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00, -}; -#pragma pop - -/* 806AD6D4-806AD714 0000A0 0040+00 0/1 0/0 0/0 .data cc_dk_core_src__22@unnamed@d_a_e_dk_cpp@ */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 data_806AD6D4[64] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x20, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00, -}; -#pragma pop - -/* 806AD714-806AD720 0000E0 000C+00 1/1 0/0 0/0 .data elect_effect_name$4066 */ -SECTION_DATA static u8 elect_effect_name[12] = { - 0x84, 0xBE, 0x84, 0xBF, 0x84, 0xC0, 0x84, 0xC1, 0x84, 0xC2, 0x84, 0xC3, +static dCcD_SrcSph cc_dk_at_src = { + { // mObjInf + { 0x0, { { 0x400, 2, { 0xc } }, { 0, { 0 } }, { { 0 } } } }, // mObj + { 0x09, 0, 0, 0, { 0 } }, // mGObjAt + { 0x00, 0x00, 0x00, 0x00, { 2 } }, // mGObjTg + { { 0 } }, // mGObjCo + }, + { { { 0.0f, 0.0f, 0.0f }, 40.0f, } } // mSphAttr }; -/* 806AD720-806AD724 0000EC 0004+00 1/1 0/0 0/0 .data dead_effect_name$4178 */ -SECTION_DATA static u8 dead_effect_name[4] = { - 0x86, - 0x0D, - 0x86, - 0x0E, -}; - -/* 806AD724-806AD744 -00001 0020+00 1/0 0/0 0/0 .data l_daE_DK_Method */ -static actor_method_class l_daE_DK_Method = { - (process_method_func)daE_DK_Create__FP8daE_DK_c, - (process_method_func)daE_DK_Delete__FP8daE_DK_c, - (process_method_func)daE_DK_Execute__FP8daE_DK_c, - (process_method_func)daE_DK_IsDelete__FP8daE_DK_c, - (process_method_func)daE_DK_Draw__FP8daE_DK_c, -}; - -/* 806AD744-806AD774 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_DK */ -extern actor_process_profile_definition g_profile_E_DK = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_E_DK, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(daE_DK_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 755, // mPriority - &l_daE_DK_Method, // sub_method - 0x000C0100, // mStatus - fopAc_ENEMY_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 806AD774-806AD780 000140 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, -}; - -/* 806AD780-806AD78C 00014C 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, -}; - -/* 806AD78C-806AD798 000158 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, -}; - -/* 806AD798-806AD7A4 000164 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 806AD7A4-806AD7B0 000170 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 806AD7B0-806AD7D4 00017C 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_806AD51C, - (void*)NULL, - (void*)NULL, - (void*)func_806AD514, -}; - -/* 806AD7D4-806AD7E0 0001A0 000C+00 2/2 0/0 0/0 .data __vt__12J3DFrameCtrl */ -SECTION_DATA extern void* __vt__12J3DFrameCtrl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12J3DFrameCtrlFv, -}; - -/* 806AD7E0-806AD7EC 0001AC 000C+00 2/2 0/0 0/0 .data __vt__12daE_DK_HIO_c */ -SECTION_DATA extern void* __vt__12daE_DK_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12daE_DK_HIO_cFv, +static dCcD_SrcSph cc_dk_core_src = { + { // mObjInf + { 0x0, { { 0, 0, { 0 } }, { 0x4020, { 3 } }, { { 0 } } } }, // mObj + { 0x09, 0, 0, 0, { 0 } }, // mGObjAt + { 0x00, 0x00, 0x00, 0x00, { 2 } }, // mGObjTg + { { 0 } }, // mGObjCo + }, + { { { 0.0f, 0.0f, 0.0f }, 40.0f, } } // mSphAttr }; /* 806AA1EC-806AA228 0000EC 003C+00 1/1 0/0 0/0 .text __ct__12daE_DK_HIO_cFv */ daE_DK_HIO_c::daE_DK_HIO_c() { - // NONMATCHING + field_0x4 = -1; + model_size = 2.0f; + player_detection_range = 700.0f; + field_0x10 = 1000.0f; + first_attack_range = 1000.0f; } -/* ############################################################################################## */ -/* 806AD544-806AD54C 00000C 0008+00 0/1 0/0 0/0 .rodata dk_brk_name__22@unnamed@d_a_e_dk_cpp@ */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const data_806AD544[8] = { - 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x16, -}; -COMPILER_STRIP_GATE(0x806AD544, &data_806AD544); -#pragma pop - -/* 806AD54C-806AD554 000014 0008+00 0/1 0/0 0/0 .rodata dk_btk_name__22@unnamed@d_a_e_dk_cpp@ */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const data_806AD54C[8] = { - 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1A, -}; -COMPILER_STRIP_GATE(0x806AD54C, &data_806AD54C); -#pragma pop - -/* 806AD554-806AD558 00001C 0004+00 0/9 0/0 0/0 .rodata @3872 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3872 = 100.0f; -COMPILER_STRIP_GATE(0x806AD554, &lit_3872); -#pragma pop - -/* 806AD558-806AD55C 000020 0004+00 3/14 0/0 0/0 .rodata @3873 */ -SECTION_RODATA static u8 const lit_3873[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x806AD558, &lit_3873); - -/* 806AD55C-806AD560 000024 0004+00 2/10 0/0 0/0 .rodata @3874 */ -SECTION_RODATA static f32 const lit_3874 = 1.0f; -COMPILER_STRIP_GATE(0x806AD55C, &lit_3874); +static u32 const dk_brk_name[2] = { 0x17, 0x16 }; +static u32 const dk_btk_name[2] = { 0x1B, 0x1A }; /* 806AA228-806AA5A8 000128 0380+00 1/1 0/0 0/0 .text draw__8daE_DK_cFv */ -void daE_DK_c::draw() { - // NONMATCHING +int daE_DK_c::draw() { + J3DModel* model = mpMorfSO->getModel(); + J3DModel* modelCore = mpCoreMorfSO->getModel(); + + g_env_light.settingTevStruct(0, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(model, &tevStr); + g_env_light.setLightTevColorType_MAJI(modelCore, &tevStr); + + J3DModelData* modelData = model->getModelData(); + for (u16 i = 0; i < modelData->getMaterialNum(); i++) { + J3DMaterial* matNodePtr = modelData->getMaterialNodePointer(i); + if (i == 0) { + J3DBlend* blend = matNodePtr->getBlend(); + if (this->field_0x692 != 0xff) { + blend->setType(1); + blend->setSrcFactor(4); + blend->setDstFactor(5); + matNodePtr->getZMode()->setUpdateEnable(0); + matNodePtr->setZCompLoc(0); + } else { + blend->setType(0); + blend->setSrcFactor(1); + blend->setDstFactor(0); + matNodePtr->getZMode()->setUpdateEnable(1); + matNodePtr->setZCompLoc(1); + } + matNodePtr->getTevKColor(3)->a = (u8)field_0x692; + } else { + matNodePtr->getTevKColor(3)->a = (u8)field_0x691; + } + } + + mpBrkAnm[field_0x6a0]->entry(model->getModelData()); + mpBtkAnm[field_0x6a0]->entry(model->getModelData()); + + mpMorfSO->entryDL(); + + if (field_0x6a1 == 0) { + mpCoreMorfSO->entryDL(); + } + + if (field_0x6a1 != 0) { + return 1; + } + + cXyz shadowPos; + shadowPos.set(current.pos.x, current.pos.y + 100.0f, current.pos.z); + + mShadowKey2 = dComIfGd_setShadow(mShadowKey2, 1, modelCore, &shadowPos, 700.0f + nREG_F(19), + 0.0f, current.pos.y, this->mObjAcch.GetGroundH(), mObjAcch.m_gnd, + &tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); + + if (field_0x6a2 == 0) { + mShadowKey = dComIfGd_setShadow(mShadowKey, 1, model, &shadowPos, 700.0f + nREG_F(19), + 0.0f, current.pos.y, this->mObjAcch.GetGroundH(), mObjAcch.m_gnd, + &tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); + } else { + shadowPos.set(field_0x670.x, field_0x670.y + 100.0f, field_0x670.z); + + mShadowKey = dComIfGd_setShadow(mShadowKey, 1, model, &shadowPos, 700.0f + nREG_F(19), + 0.0f, field_0x670.y, this->mObjAcch.GetGroundH(), mObjAcch.m_gnd, + &tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); + } + + return 1; } /* 806AA5A8-806AA5C8 0004A8 0020+00 1/0 0/0 0/0 .text daE_DK_Draw__FP8daE_DK_c */ -static void daE_DK_Draw(daE_DK_c* param_0) { - // NONMATCHING +static int daE_DK_Draw(daE_DK_c* i_this) { + return i_this->draw(); } -/* ############################################################################################## */ -/* 806AD560-806AD568 000028 0004+04 2/2 0/0 0/0 .rodata @3893 */ -SECTION_RODATA static f32 const lit_3893[1 + 1 /* padding */] = { - -1.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x806AD560, &lit_3893); - -/* 806AD628-806AD628 0000F0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_806AD628 = "E_DK"; -#pragma pop - /* 806AA5C8-806AA68C 0004C8 00C4+00 5/5 0/0 0/0 .text setBck__8daE_DK_cFiUcff */ -void daE_DK_c::setBck(int param_0, u8 param_1, f32 param_2, f32 param_3) { - // NONMATCHING +void daE_DK_c::setBck(int i_resIndex, u8 i_attr, f32 i_morf, f32 i_rate) { + field_0x6a0 = 0; + if (i_resIndex == 7 || i_resIndex == 6) { + field_0x6a0 = 1; + } + + mpMorfSO->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_DK", i_resIndex), + i_attr, i_morf, i_rate, 0.0f, -1.0f); } /* 806AA68C-806AA730 00058C 00A4+00 5/5 0/0 0/0 .text setBckCore__8daE_DK_cFiUcff */ -void daE_DK_c::setBckCore(int param_0, u8 param_1, f32 param_2, f32 param_3) { - // NONMATCHING +void daE_DK_c::setBckCore(int i_resIndex, u8 i_attr, f32 i_morf, f32 i_rate) { + mpCoreMorfSO->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_DK", i_resIndex), + i_attr, i_morf, i_rate, 0.0f, -1.0f); } /* 806AA730-806AA73C 000630 000C+00 6/6 0/0 0/0 .text setActionMode__8daE_DK_cFii */ -void daE_DK_c::setActionMode(int param_0, int param_1) { - // NONMATCHING +void daE_DK_c::setActionMode(int i_actionMode, int i_moveMode) { + mActionMode = i_actionMode; + mMoveMode = i_moveMode; } /* 806AA73C-806AA8B0 00063C 0174+00 1/1 0/0 0/0 .text damage_check__8daE_DK_cFv */ void daE_DK_c::damage_check() { - // NONMATCHING + if (field_0x694 == 0 && field_0x6a2 == 0) { + mStts.Move(); + if (mSphere.ChkTgHit() != 0) { + field_0x694 = 10; + + mAtInfo.mpCollider = mSphere.GetTgHitObj(); + + fopAc_ac_c* colliderActor = dCc_GetAc(mAtInfo.mpCollider->GetAc()); + f32 xDiff = current.pos.x - colliderActor->current.pos.x; + f32 zDiff = current.pos.z - colliderActor->current.pos.z; + + mAtInfo.mHitDirection.y = cM_atan2s(-xDiff, -zDiff); + if (field_0x6a3 == 0) { + if (mAtInfo.mpCollider->ChkAtType(0x10) != 0) { + setActionMode(3, 1); + } else { + setActionMode(3, 0); + } + } + + mSphere.ClrTgHit(); + } + if (mCoreSphere.ChkTgHit() != 0) { + mAtInfo.mpCollider = mCoreSphere.GetTgHitObj(); + + cc_at_check(this, &mAtInfo); + + field_0x694 = 10; + + if (mAtInfo.mpCollider->ChkAtType(0x20) != 0) { + setActionMode(4, 1); + } else { + if (field_0x6a3 == 0) { + setActionMode(4, 0); + } + } + + mCoreSphere.ClrTgHit(); + } + } } -/* ############################################################################################## */ -/* 806AD568-806AD570 000030 0008+00 0/3 0/0 0/0 .rodata @3993 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3993[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x806AD568, &lit_3993); -#pragma pop - -/* 806AD570-806AD578 000038 0008+00 0/3 0/0 0/0 .rodata @3994 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3994[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x806AD570, &lit_3994); -#pragma pop - -/* 806AD578-806AD580 000040 0008+00 0/3 0/0 0/0 .rodata @3995 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3995[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x806AD578, &lit_3995); -#pragma pop - /* 806AD7F8-806AD7FC 000008 0004+00 2/2 0/0 0/0 .bss None */ -static u8 data_806AD7F8[4]; - -/* 806AD7FC-806AD808 00000C 000C+00 1/1 0/0 0/0 .bss @3759 */ -static u8 lit_3759[12]; +static u8 data_806AD7F8; /* 806AD808-806AD820 000018 0018+00 9/9 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[24]; +static daE_DK_HIO_c l_HIO; /* 806AA8B0-806AAB18 0007B0 0268+00 2/2 0/0 0/0 .text checkPlayerSearch__8daE_DK_cFv */ -void daE_DK_c::checkPlayerSearch() { - // NONMATCHING +bool daE_DK_c::checkPlayerSearch() { + if (current.pos.abs(home.pos) > field_0x6a8) { + return 0; + } + + if (daPy_getPlayerActorClass()->current.pos.abs(home.pos) > l_HIO.player_detection_range) { + return 0; + } + + if (fopAcM_otherBgCheck(this, daPy_getPlayerActorClass()) != 0) { + return 0; + } + + return 1; } -/* ############################################################################################## */ -/* 806AD580-806AD584 000048 0004+00 0/2 0/0 0/0 .rodata @4018 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4018 = 8.0f; -COMPILER_STRIP_GATE(0x806AD580, &lit_4018); -#pragma pop - -/* 806AD584-806AD588 00004C 0004+00 0/3 0/0 0/0 .rodata @4019 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4019 = 30.0f; -COMPILER_STRIP_GATE(0x806AD584, &lit_4019); -#pragma pop - -/* 806AD588-806AD58C 000050 0004+00 0/4 0/0 0/0 .rodata @4020 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4020 = 60.0f; -COMPILER_STRIP_GATE(0x806AD588, &lit_4020); -#pragma pop - -/* 806AD58C-806AD590 000054 0004+00 0/1 0/0 0/0 .rodata @4021 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4021 = 400.0f; -COMPILER_STRIP_GATE(0x806AD58C, &lit_4021); -#pragma pop - /* 806AAB18-806AAC24 000A18 010C+00 2/2 0/0 0/0 .text checkPlayerAttack__8daE_DK_cFf */ -void daE_DK_c::checkPlayerAttack(f32 param_0) { - // NONMATCHING +int daE_DK_c::checkPlayerAttack(f32 param_0) { + if (field_0x69c == 0) { + f32 dist = fopAcM_searchPlayerDistance(this); + if (field_0x690 == 0 && dist < l_HIO.first_attack_range) { + if (dist > 8.0f) { + setActionMode(2, 0); + field_0x690 = 2; + return 1; + } else if (dist < l_HIO.first_attack_range - 100.0f) { + field_0x690 = 1; + } + } + + if (param_0 > 30.0f && param_0 < 60.0f && dist < 400.0f) { + setActionMode(2, 0); + return 1; + } + } + + return 0; } -/* ############################################################################################## */ -/* 806AD590-806AD594 000058 0004+00 0/1 0/0 0/0 .rodata @4043 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4043 = -1000000000.0f; -COMPILER_STRIP_GATE(0x806AD590, &lit_4043); -#pragma pop - -/* 806AD594-806AD598 00005C 0004+00 0/1 0/0 0/0 .rodata @4044 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4044 = 350.0f; -COMPILER_STRIP_GATE(0x806AD594, &lit_4044); -#pragma pop - /* 806AAC24-806AAD68 000B24 0144+00 1/1 0/0 0/0 .text checkWaterHeight__8daE_DK_cFv */ void daE_DK_c::checkWaterHeight() { - // NONMATCHING + dBgS_ObjGndChk_Spl gndChk; + Vec gndChkPos; + if (mActionMode != ACTION_MODE_DIE) { + gndChkPos = current.pos; + gndChkPos.y += 1000.0f; + gndChk.SetPos(&gndChkPos); + field_0x6b8 = dComIfG_Bgsp().GroundCross(&gndChk); + if (field_0x6b8 != -1000000000.0f && current.pos.y + 350.0f > field_0x6b8) { + current.pos.y = field_0x6b8 - 350.0f; + } + } else { + gndChkPos = field_0x670; + gndChkPos.y += 1000.0f; + gndChk.SetPos(&gndChkPos); + field_0x6b8 = dComIfG_Bgsp().GroundCross(&gndChk); + if (field_0x6b8 != -1000000000.0f && field_0x670.y + 350.0f > field_0x6b8) { + field_0x670.y = field_0x6b8 - 350.0f; + } + } } -/* ############################################################################################## */ -/* 806AD598-806AD59C 000060 0004+00 0/6 0/0 0/0 .rodata @4061 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4061 = 3.0f; -COMPILER_STRIP_GATE(0x806AD598, &lit_4061); -#pragma pop - -/* 806AD59C-806AD5A0 000064 0004+00 1/5 0/0 0/0 .rodata @4062 */ -SECTION_RODATA static f32 const lit_4062 = 150.0f; -COMPILER_STRIP_GATE(0x806AD59C, &lit_4062); - /* 806AAD68-806AAE10 000C68 00A8+00 1/1 0/0 0/0 .text * SphBgcCallBack__8daE_DK_cFP11dBgS_SphChkP10cBgD_Vtx_tiiiP8cM3dGPlaPv */ void daE_DK_c::SphBgcCallBack(dBgS_SphChk* param_0, cBgD_Vtx_t* param_1, int param_2, - int param_3, int param_4, cM3dGPla* param_5, void* param_6) { - // NONMATCHING + int param_3, int param_4, cM3dGPla* param_5, void* param_6) { + fopAc_ac_c* actor = (fopAc_ac_c*)param_6; + f32 speedY = actor->speed.y; + if (!speedY) { + return; + } + + s32 isOutsideRange = FALSE; + f32 unkFloat1 = (param_1[param_2].y + param_1[param_3].y + param_1[param_4].y) / 3.0f; + if (actor->speed.y < 0.0f) { + if (actor->current.pos.y + 150.0f + nREG_F(18) > unkFloat1) { + isOutsideRange = TRUE; + } + } else { + if (actor->current.pos.y + 150.0f + nREG_F(18) < unkFloat1) { + isOutsideRange = TRUE; + } + } + + if (isOutsideRange) { + actor->speed.y = 0.0f; + actor->current.pos.y = actor->old.pos.y; + } } -/* ############################################################################################## */ -/* 806AD5A0-806AD5A4 000068 0004+00 0/1 0/0 0/0 .rodata @4125 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4125 = 32768.0f; -COMPILER_STRIP_GATE(0x806AD5A0, &lit_4125); -#pragma pop - -/* 806AD5A4-806AD5A8 00006C 0004+00 0/1 0/0 0/0 .rodata @4126 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4126 = 0x3BB400B4; -COMPILER_STRIP_GATE(0x806AD5A4, &lit_4126); -#pragma pop - -/* 806AD5A8-806AD5B0 000070 0008+00 0/1 0/0 0/0 .rodata @4131 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4131[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x806AD5A8, &lit_4131); -#pragma pop - /* 806AAE10-806AB054 000D10 0244+00 1/1 0/0 0/0 .text setElectricEffect__8daE_DK_cFv */ void daE_DK_c::setElectricEffect() { - // NONMATCHING + static u16 elect_effect_name[6] = { + 0x84BE, 0x84BF, 0x84C0, 0x84C1, 0x84C2, 0x84C3, + }; + + cXyz emitterPos(current.pos); + emitterPos.y += 100.0f; + cXyz emitterScale(l_HIO.model_size, l_HIO.model_size, l_HIO.model_size); + csXyz emitterRot; + + JPABaseEmitter* emitter; + + u8 alpha = 0xff; + if (dKy_camera_water_in_status_check() == 0) { + alpha = 0x55; + } + + for (s32 i = 0; i < 6; i++) { + emitterRot.set(0, 0, 0); + mElectricEffects[i] = dComIfGp_particle_set(mElectricEffects[i], elect_effect_name[i], + &emitterPos, &tevStr, &emitterRot, &emitterScale, alpha, 0, -1, 0, 0, 0); + if (i == 1 || i == 2 || i == 3) { + emitter = dComIfGp_particle_getEmitter(mElectricEffects[i]); + if (emitter != NULL) { + emitterRot.x = cM_rndFX(32768.0f); + emitterRot.y = cM_rndFX(32768.0f); + emitterRot.z = cM_rndFX(32768.0f); + emitter->setLocalRotation(*(JGeometry::TVec3*)&emitterRot); + } + } + } + + mCreatureSound.startCreatureSoundLevel(Z2SE_EN_DK_ATTACK, 0, -1); } /* 806AB054-806AB158 000F54 0104+00 1/1 0/0 0/0 .text setCoreDeadEffect__8daE_DK_cFv */ void daE_DK_c::setCoreDeadEffect() { - // NONMATCHING + cXyz emitterPos; + cXyz emitterScale(l_HIO.model_size, l_HIO.model_size, l_HIO.model_size); + csXyz emitterRot(0, 0, 0); + + u8 alpha = 0xff; + if (dKy_camera_water_in_status_check() == 0) { + alpha = 0x55; + } + + J3DModel* model = mpCoreMorfSO->getModel(); + mDoMtx_stack_c::copy(model->getAnmMtx(1)); + mDoMtx_stack_c::multVecZero(&emitterPos); + dComIfGp_particle_set(0x860c, &emitterPos, &tevStr, &emitterRot, &emitterScale, alpha, NULL, + -1, NULL, NULL, NULL); } /* 806AB158-806AB29C 001058 0144+00 1/1 0/0 0/0 .text setBodyDeadEffect__8daE_DK_cFv */ void daE_DK_c::setBodyDeadEffect() { - // NONMATCHING + static u16 dead_effect_name[2] = { + 0x860D, + 0x860E, + }; + + cXyz emitterPos; + cXyz emitterScale(l_HIO.model_size, l_HIO.model_size, l_HIO.model_size); + csXyz emitterRot(0, 0, 0); + + u8 alpha = 0xff; + if (dKy_camera_water_in_status_check() == 0) { + alpha = 0x55; + } + + for (s32 i = 0; i < 2; i++) { + mDeadEffects[i] = dComIfGp_particle_set(mDeadEffects[i], dead_effect_name[i], &emitterPos, &tevStr, + &emitterRot, &emitterScale, alpha, 0, -1, 0, 0, 0); + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(mDeadEffects[i]); + if (emitter != NULL) { + emitter->setGlobalSRTMatrix(mpMorfSO->getModel()->getAnmMtx(1)); + } + } } -/* ############################################################################################## */ -/* 806AD5B0-806AD5B4 000078 0004+00 0/2 0/0 0/0 .rodata @4327 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4327 = 80.0f; -COMPILER_STRIP_GATE(0x806AD5B0, &lit_4327); -#pragma pop - -/* 806AD5B4-806AD5B8 00007C 0004+00 0/3 0/0 0/0 .rodata @4328 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4328 = 70.0f; -COMPILER_STRIP_GATE(0x806AD5B4, &lit_4328); -#pragma pop - -/* 806AD5B8-806AD5BC 000080 0004+00 0/3 0/0 0/0 .rodata @4329 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4329 = 5.0f; -COMPILER_STRIP_GATE(0x806AD5B8, &lit_4329); -#pragma pop - -/* 806AD5BC-806AD5C0 000084 0004+00 0/2 0/0 0/0 .rodata @4330 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4330 = 4.0f; -COMPILER_STRIP_GATE(0x806AD5BC, &lit_4330); -#pragma pop - -/* 806AD5C0-806AD5C4 000088 0004+00 0/3 0/0 0/0 .rodata @4331 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4331 = 6.0f; -COMPILER_STRIP_GATE(0x806AD5C0, &lit_4331); -#pragma pop - -/* 806AD5C4-806AD5C8 00008C 0004+00 0/3 0/0 0/0 .rodata @4332 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4332 = 200.0f; -COMPILER_STRIP_GATE(0x806AD5C4, &lit_4332); -#pragma pop - -/* 806AD5C8-806AD5CC 000090 0004+00 0/2 0/0 0/0 .rodata @4333 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4333 = 9.0f; -COMPILER_STRIP_GATE(0x806AD5C8, &lit_4333); -#pragma pop - -/* 806AD5CC-806AD5D0 000094 0004+00 0/6 0/0 0/0 .rodata @4334 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4334 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x806AD5CC, &lit_4334); -#pragma pop - -/* 806AD5D0-806AD5D4 000098 0004+00 0/2 0/0 0/0 .rodata @4335 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4335 = -5.0f; -COMPILER_STRIP_GATE(0x806AD5D0, &lit_4335); -#pragma pop - -/* 806AD5D4-806AD5D8 00009C 0004+00 0/2 0/0 0/0 .rodata @4336 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4336 = 3.0f / 10.0f; -COMPILER_STRIP_GATE(0x806AD5D4, &lit_4336); -#pragma pop - /* 806AB29C-806AB684 00119C 03E8+00 1/1 0/0 0/0 .text executeWait__8daE_DK_cFv */ void daE_DK_c::executeWait() { - // NONMATCHING -} + cXyz dirFromHome; + switch (mMoveMode) { + case 0: { + setBck(0xf, 2, 3.0f, 1.0f); + setBckCore(0xc, 2, 3.0f, 1.0f); + mMoveMode = 1; + break; + } + case 1: { + if (mpMorfSO->checkFrame(0.0f) != 0 || mpMorfSO->checkFrame(80.0f) != 0) { + mCreatureSound.startCreatureSound(Z2SE_EN_DK_WAIT, 0, -1); + } + f32 fVar4 = mpMorfSO->getFrame(); + if (mpMorfSO->checkFrame(70.0f) != 0 || mpMorfSO->checkFrame(150.0f) != 0) { + dirFromHome = current.pos - home.pos; + if (std::abs(dirFromHome.y) < 100.0f) { + field_0x6ac = 5.0f; + } else { + if (dirFromHome.y > 0.0f) { + field_0x6ac = 4.0f; + } else { + field_0x6ac = 6.0f; + } + } + if (dirFromHome.absXZ() < 200.0f) { + field_0x6b0 = 0; + } else { + field_0x6b0 = 3.0f + nREG_F(3); + } -/* ############################################################################################## */ -/* 806AD5D8-806AD5DC 0000A0 0004+00 0/3 0/0 0/0 .rodata @4437 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4437 = 50.0f; -COMPILER_STRIP_GATE(0x806AD5D8, &lit_4437); -#pragma pop + current.angle.y = cLib_targetAngleY(¤t.pos, &home.pos); + } + if (fVar4 >= 80.0f) { + fVar4 -= 80.0f; + } + + if (70.0f <= fVar4 || fVar4 <= 9.0f) { + cLib_chaseF(&speed.y, field_0x6ac, 1.0f); + } else if (fVar4 < 30.0f) { + cLib_chaseF(&speed.y, 0.0f, 0.2f); + } else if (fVar4 < 60.0f) { + cLib_chaseF(&speed.y, -5.0f, 0.3f); + } else { + cLib_chaseF(&speed.y, 0.0f, 0.2f); + } + + if (fVar4 < 60.0f || fVar4 >= 70.0f) { + cLib_chaseF(&speedF, field_0x6b0, 0.2f); + } else { + cLib_chaseF(&speedF, 0.0f, 0.2f); + } + + cLib_addCalcAngleS(&shape_angle.y, current.angle.y, 0x10, 0x100, 0x10); + + if (checkPlayerSearch()) { + setActionMode(1, 0); + } else { + checkPlayerAttack(fVar4); + } + } + } +} /* 806AB684-806ABA78 001584 03F4+00 1/1 0/0 0/0 .text executeChase__8daE_DK_cFv */ void daE_DK_c::executeChase() { - // NONMATCHING + cXyz dirFromHome; + switch (mMoveMode) { + case 0: { + setBck(0xf, 2, 3.0f, 1.0f); + setBckCore(0xc, 2, 3.0f, 1.0f); + mMoveMode = 1; + break; + } + case 1: { + if (mpMorfSO->checkFrame(0.0f) != 0 || mpMorfSO->checkFrame(80.0f) != 0) { + mCreatureSound.startCreatureSound(Z2SE_EN_DK_WAIT, 0, -1); + } + f32 fVar4 = mpMorfSO->getFrame(); + if (mpMorfSO->checkFrame(70.0f) != 0 || mpMorfSO->checkFrame(150.0f) != 0) { + dirFromHome = current.pos - daPy_getPlayerActorClass()->current.pos; + if (std::abs(dirFromHome.y) < 50.0f) { + field_0x6ac = 5.0f; + } else { + if (dirFromHome.y > 0.0f) { + field_0x6ac = 4.0f; + } else { + field_0x6ac = 6.0f; + } + } + if (dirFromHome.absXZ() < 200.0f) { + field_0x6b0 = 0; + } else { + field_0x6b0 = 3.0f + nREG_F(3); + } + + current.angle.y = fopAcM_searchActorAngleY(this, daPy_getPlayerActorClass()); + } + if (fVar4 >= 80.0f) { + fVar4 -= 80.0f; + } + + if (70.0f <= fVar4 || fVar4 <= 9.0f) { + cLib_chaseF(&speed.y, field_0x6ac, 1.0f); + } else if (fVar4 < 30.0f) { + cLib_chaseF(&speed.y, 0.0f, 0.2f); + } else if (fVar4 < 60.0f) { + cLib_chaseF(&speed.y, -5.0f, 0.3f); + } else { + cLib_chaseF(&speed.y, 0.0f, 0.2f); + } + + if (fVar4 < 60.0f || fVar4 >= 70.0f) { + cLib_chaseF(&speedF, field_0x6b0, 0.2f); + } else { + cLib_chaseF(&speedF, 0.0f, 0.2f); + } + + cLib_addCalcAngleS(&shape_angle.y, current.angle.y, 0x10, 0x100, 0x10); + + if (!checkPlayerSearch()) { + setActionMode(0, 0); + } else { + checkPlayerAttack(fVar4); + } + } + } } -/* ############################################################################################## */ -/* 806AD5DC-806AD5E0 0000A4 0004+00 0/1 0/0 0/0 .rodata @4478 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4478 = 14.0f; -COMPILER_STRIP_GATE(0x806AD5DC, &lit_4478); -#pragma pop - -/* 806AD5E0-806AD5E4 0000A8 0004+00 0/1 0/0 0/0 .rodata @4479 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4479 = -3.0f; -COMPILER_STRIP_GATE(0x806AD5E0, &lit_4479); -#pragma pop - /* 806ABA78-806ABCC8 001978 0250+00 1/1 0/0 0/0 .text executeAttack__8daE_DK_cFv */ void daE_DK_c::executeAttack() { - // NONMATCHING + switch (mMoveMode) { + case 0: { + setBck(7, 2, 6.0f, 2.0f); + setBckCore(9, 2, 3.0f, 2.0f); + field_0x698 = 45 + nREG_S(9); + mMoveMode = 1; + break; + } + case 1: { + if (mpMorfSO->checkFrame(14.0f) != 0) { + mCreatureSound.startCreatureSound(Z2SE_EN_DK_CHARGE, 0, -1); + } + cLib_chaseF(&speed.y, -3.0f, 0.2f); + cLib_chaseF(&speedF, 0.0f, 0.2f); + if (field_0x698 == 0) { + setBck(6, 2, 3.0f, 1.0f); + setBckCore(8, 2, 3.0f, 1.0f); + field_0x698 = 100; + mMoveMode = 2; + } + break; + } + case 2: + case 3: { + cLib_chaseF(&speed.y, 0.0, 0.2f); + cLib_chaseF(&speedF, 0.0, 0.2f); + mAtSphere.OnAtSetBit(); + mAtSphere.SetTgSpl(1); + mAtSphere.SetAtMtrl(5); + mSphere.SetTgSpl(1); + mCoreSphere.SetTgSpl(1); + setElectricEffect(); + field_0x6a3 = 1; + fopAcM_OffStatus(this, 0x80000); + if (mMoveMode == 2) { + if (field_0x698 == 0) { + field_0x69c = 150; + setActionMode(1, 0); + } + if (daPy_getPlayerActorClass()->checkElecDamage() != 0) { + mMoveMode = 3; + } + } else { + if (daPy_getPlayerActorClass()->checkElecDamage() == 0) { + field_0x69c = 150; + setActionMode(1, 0); + } + } + break; + } + } } /* 806ABCC8-806ABE3C 001BC8 0174+00 1/1 0/0 0/0 .text executeDamage__8daE_DK_cFv */ void daE_DK_c::executeDamage() { - // NONMATCHING -} + switch (mMoveMode) { + case 0: + case 1: { + if (mMoveMode == 0) { + speedF = 8.0f + nREG_F(5); + } else { + speedF = 8.0f + nREG_F(5); + } -/* ############################################################################################## */ -/* 806AD5E4-806AD5E8 0000AC 0004+00 0/2 0/0 0/0 .rodata @4524 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4524 = -2.0f; -COMPILER_STRIP_GATE(0x806AD5E4, &lit_4524); -#pragma pop + shape_angle.x = 0xf000; + + setBck(13, 0, 3.0f, 1.0f); + setBckCore(11, 0, 3.0f, 1.0f); + + shape_angle.y = mAtInfo.mHitDirection.y; + current.angle.y = mAtInfo.mHitDirection.y + 0x8000; + + mMoveMode = 2; + + mCreatureSound.startCreatureSound(Z2SE_EN_DK_GUARD, 0, -1); + + break; + } + case 2: { + cLib_addCalcAngleS(&shape_angle.x, 0, 0x10, 0x100, 0x10); + + cLib_chaseF(&speed.y, 0.0, 0.2f); + cLib_chaseF(&speedF, 0.0, 0.2f); + + if (mpMorfSO->isStop() != 0) { + shape_angle.x = 0; + setActionMode(1, 0); + } + + break; + } + } +} /* 806ABE3C-806ABF6C 001D3C 0130+00 1/1 0/0 0/0 .text BodyDeathMove__8daE_DK_cFv */ void daE_DK_c::BodyDeathMove() { - // NONMATCHING + cLib_chaseF(&field_0x6ac, -2.0f, 0.2f); + cLib_chaseF(&field_0x6b0, 0.0f, 0.2f); + + field_0x670.x += field_0x6b0 * cM_ssin(field_0x68c); + field_0x670.y += field_0x6ac; + field_0x670.z += field_0x6b0 * cM_scos(field_0x68c); + + dBgS_GndChk gndChk; + + cXyz gndChkPos(field_0x670); + gndChkPos.y += 100.0f; + gndChk.SetPos(&gndChkPos); + + f32 crossY = dComIfG_Bgsp().GroundCross(&gndChk); + if (field_0x670.y + 50.0f < crossY) { + field_0x6ac = 0; + field_0x670.y = crossY - 50.0f; + } } -/* ############################################################################################## */ -/* 806AD5E8-806AD5EC 0000B0 0004+00 0/1 0/0 0/0 .rodata @4595 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4595 = 7.0f; -COMPILER_STRIP_GATE(0x806AD5E8, &lit_4595); -#pragma pop - -/* 806AD5EC-806AD5F0 0000B4 0004+00 0/1 0/0 0/0 .rodata @4596 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4596 = 10.0f; -COMPILER_STRIP_GATE(0x806AD5EC, &lit_4596); -#pragma pop - -/* 806AD5F0-806AD5F4 0000B8 0004+00 0/1 0/0 0/0 .rodata @4597 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4597 = 125.0f; -COMPILER_STRIP_GATE(0x806AD5F0, &lit_4597); -#pragma pop - -/* 806AD5F4-806AD5F8 0000BC 0004+00 0/1 0/0 0/0 .rodata @4598 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4598 = -25.0f; -COMPILER_STRIP_GATE(0x806AD5F4, &lit_4598); -#pragma pop - -/* 806AD5F8-806AD5FC 0000C0 0004+00 0/3 0/0 0/0 .rodata @4599 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4599 = 90.0f; -COMPILER_STRIP_GATE(0x806AD5F8, &lit_4599); -#pragma pop - -/* 806AD5FC-806AD600 0000C4 0004+00 0/1 0/0 0/0 .rodata @4600 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4600 = 120.0f; -COMPILER_STRIP_GATE(0x806AD5FC, &lit_4600); -#pragma pop - /* 806ABF6C-806AC390 001E6C 0424+00 1/1 0/0 0/0 .text executeDeath__8daE_DK_cFv */ void daE_DK_c::executeDeath() { - // NONMATCHING + cXyz itemPos; + switch (mMoveMode) { + case 0: { + setCoreDeadEffect(); + } + case 1: { + setBodyDeadEffect(); + + setBck(14, 0, 3.0f, 0.0f); + setBckCore(10, 0, 3.0f, 0.0f); + + field_0x6a2 = 1; + + field_0x670 = current.pos; + + field_0x6b4 = 100.0f; + + mSphere.OffCoSetBit(); + mSphere.OffTgSetBit(); + mCoreSphere.OffTgSetBit(); + fopAcM_OffStatus(this, 0x100); + + field_0x68e = 0; + + attention_info.flags = 0x0; + + mCreatureSound.startCreatureSound(Z2SE_EN_DK_PULLOUT, 0, -1); + + if (mMoveMode == 0) { + field_0x68c = mAtInfo.mHitDirection.y + 0x8000; + + field_0x6b0 = 3.0f; + field_0x6ac = 5.0f; + } else { + field_0x68c = mAtInfo.mHitDirection.y + 0x8000; + + field_0x6b0 = 5.0f; + field_0x6ac = 7.0f; + + current.angle.y = mAtInfo.mHitDirection.y + 0x8000; + + speedF = 10.0f; + speed.y = 5.0f; + + field_0x68e = 0x1000; + } + mMoveMode = 2; + mCreatureSound.startCreatureSound(Z2SE_EN_DK_BUBBLE, 0, -1); + + break; + } + case 2: { + setBodyDeadEffect(); + + shape_angle.y += field_0x68e; + shape_angle.x += field_0x68e; + + if (mObjAcch.ChkGroundHit()) { + cLib_chaseAngleS(&field_0x68e, 0, 0x40); + } else { + cLib_chaseAngleS(&field_0x68e, 0x100, 0x40); + } + + BodyDeathMove(); + + if (fopAcM_checkStatus(this, 0x100000) == 0) { + mMoveMode = 3; + + mpMorfSO->setPlaySpeed(1.0f); + mpCoreMorfSO->setPlaySpeed(1.0f); + + current.pos.y += 125.0f; + + field_0x6b4 = -25.0f + nREG_F(7); + + field_0x68e = 0x800; + field_0x69c = 30; + field_0x698 = 100; + } + + break; + } + case 3: { + setBodyDeadEffect(); + + if (field_0x69c != 0) { + shape_angle.y += field_0x68e; + shape_angle.x += field_0x68e; + + if (mObjAcch.ChkGroundHit()) { + cLib_chaseAngleS(&field_0x68e, 0, 0x40); + } else { + cLib_chaseAngleS(&field_0x68e, 0x100, 0x40); + } + + cLib_chaseF(&speed.y, -2.0f + nREG_F(8), 0.2f); + cLib_chaseF(&speedF, 0.0f, 0.2f); + + if (field_0x69c == 1) { + itemPos.set(current.pos.x, current.pos.y + 90.0f, current.pos.z); + + fopAcM_createItem(&itemPos, 0, -1, -1, 0, NULL, 0); + fopAcM_createDisappear(this, &itemPos, 5, 0, 0x16); + + field_0x6a1 = 1; + } + } + BodyDeathMove(); + if (mpMorfSO->isStop() == 0) { + cLib_chaseUC(&field_0x691, 120.0f - mpMorfSO->getFrame(), 2); + cLib_chaseUC(&field_0x692, field_0x691, 3); + } else { + cLib_chaseUC(&field_0x691, 0, 2); + cLib_chaseUC(&field_0x692, field_0x691, 3); + + if (field_0x691 == 0) { + fopAcM_delete(this); + } + } + + break; + } + } } /* 806AC390-806AC5BC 002290 022C+00 1/1 0/0 0/0 .text action__8daE_DK_cFv */ void daE_DK_c::action() { - // NONMATCHING + checkWaterHeight(); + + mAtSphere.OffAtSetBit(); + + damage_check(); + + fopAcM_OnStatus(this, 0x80000); + + if (fopAcM_searchPlayerDistance(this) > l_HIO.first_attack_range) { + field_0x690 = 0x0; + } + + mAtSphere.SetTgSpl(0); + mAtSphere.SetAtMtrl(0); + mSphere.SetTgSpl(0); + mCoreSphere.SetTgSpl(0); + + field_0x6a3 = 0; + + s32 isFocusedOnPlayer = FALSE; + + switch (mActionMode) { + case ACTION_MODE_WAIT: + executeWait(); + break; + case ACTION_MODE_CHASE: + isFocusedOnPlayer = TRUE; + executeChase(); + break; + case ACTION_MODE_ATTACK: + isFocusedOnPlayer = TRUE; + executeAttack(); + break; + case ACTION_MODE_HURT: + isFocusedOnPlayer = TRUE; + executeDamage(); + break; + case ACTION_MODE_DIE: + executeDeath(); + break; + } + + mCreatureSound.setLinkSearch(isFocusedOnPlayer); + + fopAcM_posMoveF(this, mStts.GetCCMoveP()); + + mObjAcch.CrrPos(dComIfG_Bgsp()); + + if (!mObjAcch.ChkWallHit() && speed.y) { + cXyz collCenter(current.pos); + collCenter.y += 150.0f + nREG_F(18); + mSphereChk.SetC(collCenter); + mSphereChk.SetR(150.0f + nREG_F(19)); + mSphereChk.SetCallback((SphChk_Callback)SphBgcCallBack); + dComIfG_Bgsp().SphChk(&mSphereChk, this); + } + + mpBrkAnm[field_0x6a0]->play(); + mpBtkAnm[field_0x6a0]->play(); + + mpMorfSO->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); + mpCoreMorfSO->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); } -/* ############################################################################################## */ -/* 806AD600-806AD604 0000C8 0004+00 0/1 0/0 0/0 .rodata @4690 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4690 = -50.0f; -COMPILER_STRIP_GATE(0x806AD600, &lit_4690); -#pragma pop - -/* 806AD604-806AD608 0000CC 0004+00 0/1 0/0 0/0 .rodata @4691 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4691 = -90.0f; -COMPILER_STRIP_GATE(0x806AD604, &lit_4691); -#pragma pop - /* 806AC5BC-806AC754 0024BC 0198+00 1/1 0/0 0/0 .text mtx_set__8daE_DK_cFv */ void daE_DK_c::mtx_set() { - // NONMATCHING + if (field_0x6a2 == 0) { + mDoMtx_stack_c::transS(current.pos.x, current.pos.y + 100.0f, current.pos.z); + mDoMtx_stack_c::ZXYrotM(shape_angle); + } else { + mDoMtx_stack_c::transS(field_0x670.x, field_0x670.y + 100.0f, field_0x670.z); + } + mDoMtx_stack_c::scaleM(l_HIO.model_size, l_HIO.model_size, l_HIO.model_size); + + J3DModel* model = mpMorfSO->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + mpMorfSO->modelCalc(); + + if (!field_0x6a2) { + mDoMtx_stack_c::copy(model->getAnmMtx(14)); + mDoMtx_stack_c::transS(mDoMtx_stack_c::get()[0][3], mDoMtx_stack_c::get()[1][3], + mDoMtx_stack_c::get()[2][3]); + mDoMtx_stack_c::ZXYrotM(shape_angle); + mDoMtx_stack_c::transM(0.0f, -50.0f + nREG_F(17), 0.0f); + } else { + mDoMtx_stack_c::transS(current.pos.x, current.pos.y + field_0x6b4, current.pos.z); + mDoMtx_stack_c::transM(0.0f, 90.0f, 0.0f); + mDoMtx_stack_c::ZXYrotM(shape_angle); + mDoMtx_stack_c::transM(0.0f, -90.0f, 0.0f); + } + mDoMtx_stack_c::scaleM(l_HIO.model_size, l_HIO.model_size, l_HIO.model_size); + + mpCoreMorfSO->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + mpCoreMorfSO->modelCalc(); } -/* ############################################################################################## */ -/* 806AD608-806AD60C 0000D0 0004+00 0/1 0/0 0/0 .rodata @4767 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4767 = 40.0f; -COMPILER_STRIP_GATE(0x806AD608, &lit_4767); -#pragma pop - -/* 806AD60C-806AD610 0000D4 0004+00 0/1 0/0 0/0 .rodata @4768 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4768 = 20.0f; -COMPILER_STRIP_GATE(0x806AD60C, &lit_4768); -#pragma pop - -/* 806AD610-806AD614 0000D8 0004+00 0/1 0/0 0/0 .rodata @4769 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4769 = 160.0f; -COMPILER_STRIP_GATE(0x806AD610, &lit_4769); -#pragma pop - /* 806AC754-806AC968 002654 0214+00 1/1 0/0 0/0 .text cc_set__8daE_DK_cFv */ void daE_DK_c::cc_set() { - // NONMATCHING + cXyz sphCenter; + + mDoMtx_stack_c::copy(mpMorfSO->getModel()->getAnmMtx(14)); + mDoMtx_stack_c::transS(mDoMtx_stack_c::get()[0][3], mDoMtx_stack_c::get()[1][3], + mDoMtx_stack_c::get()[2][3]); + + mDoMtx_stack_c::multVecZero(&eyePos); + eyePos.y += 60.0f + nREG_F(14); + + attention_info.position = eyePos; + attention_info.position.y += 100.0f + nREG_F(15); + + if (field_0x6a2 == 0) { + mDoMtx_stack_c::copy(mpMorfSO->getModel()->getAnmMtx(0)); + mDoMtx_stack_c::transM(nREG_F(10), 40.0f + nREG_F(0xb), nREG_F(0xc)); + mDoMtx_stack_c::multVecZero(&sphCenter); + mSphere.SetC(sphCenter); + mSphere.SetR(90.0f + nREG_F(13)); + dComIfG_Ccsp()->Set(&mSphere); + + mDoMtx_stack_c::copy(mpMorfSO->getModel()->getAnmMtx(0)); + mDoMtx_stack_c::transM(0.0f, 20.0f + nREG_F(16), 0.0f); + mDoMtx_stack_c::multVecZero(&sphCenter); + mAtSphere.SetC(sphCenter); + mAtSphere.SetR(160.0f + nREG_F(14)); + dComIfG_Ccsp()->Set(&mAtSphere); + + mDoMtx_stack_c::copy(mpMorfSO->getModel()->getAnmMtx(0)); + mDoMtx_stack_c::transM(0.0f, 50.0f + nREG_F(16), 0.0f); + mDoMtx_stack_c::multVecZero(&sphCenter); + mCoreSphere.SetC(sphCenter); + mCoreSphere.SetR(70.0f + nREG_F(15)); + dComIfG_Ccsp()->Set(&mCoreSphere); + } } /* 806AC968-806AC9E8 002868 0080+00 1/1 0/0 0/0 .text execute__8daE_DK_cFv */ -void daE_DK_c::execute() { - // NONMATCHING +int daE_DK_c::execute() { + if (field_0x698 != 0) { + field_0x698--; + } + if (field_0x69c != 0) { + field_0x69c--; + } + if (field_0x694) { + field_0x694--; + } + + action(); + mtx_set(); + cc_set(); + + return 1; } /* 806AC9E8-806ACA08 0028E8 0020+00 2/1 0/0 0/0 .text daE_DK_Execute__FP8daE_DK_c */ -static void daE_DK_Execute(daE_DK_c* param_0) { - // NONMATCHING +static int daE_DK_Execute(daE_DK_c* i_this) { + return i_this->execute(); } /* 806ACA08-806ACA10 002908 0008+00 1/0 0/0 0/0 .text daE_DK_IsDelete__FP8daE_DK_c */ -static bool daE_DK_IsDelete(daE_DK_c* param_0) { - return true; +static int daE_DK_IsDelete(daE_DK_c* i_this) { + return 1; } /* 806ACA10-806ACA84 002910 0074+00 1/1 0/0 0/0 .text _delete__8daE_DK_cFv */ -void daE_DK_c::_delete() { - // NONMATCHING +int daE_DK_c::_delete() { + dComIfG_resDelete(&mPhaseReq, "E_DK"); + + if (mHIOInit != 0) { + data_806AD7F8 = 0; + mDoHIO_DELETE_CHILD(data_806AD7F8); + } + + if (heap != NULL) { + mCreatureSound.deleteObject(); + } + + return 1; } /* 806ACA84-806ACAA4 002984 0020+00 1/0 0/0 0/0 .text daE_DK_Delete__FP8daE_DK_c */ -static void daE_DK_Delete(daE_DK_c* param_0) { - // NONMATCHING +static int daE_DK_Delete(daE_DK_c* i_this) { + fpc_ProcID unusedId = fopAcM_GetID(i_this); // debug match + return i_this->_delete(); } /* 806ACAA4-806ACDAC 0029A4 0308+00 1/1 0/0 0/0 .text CreateHeap__8daE_DK_cFv */ -void daE_DK_c::CreateHeap() { - // NONMATCHING -} +int daE_DK_c::CreateHeap() { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_DK", 0x12); + JUT_ASSERT(1488, modelData != NULL); + mpMorfSO = new mDoExt_McaMorfSO(modelData, NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("E_DK", 0xf), 0, 1.0f, 0, + -1, &mCreatureSound, 0x80000, 0x31000284); -/* 806ACDAC-806ACDF4 002CAC 0048+00 1/0 0/0 0/0 .text __dt__12J3DFrameCtrlFv */ -// J3DFrameCtrl::~J3DFrameCtrl() { -extern "C" void __dt__12J3DFrameCtrlFv() { - // NONMATCHING + if (mpMorfSO == NULL || mpMorfSO->getModel() == NULL) { + return 0; + } + + for (s32 i = 0; i < 2; i++) { + mpBrkAnm[i] = new mDoExt_brkAnm(); + if (mpBrkAnm[i] == 0) { + return 0; + } + + J3DAnmTevRegKey* tevKey = (J3DAnmTevRegKey*)dComIfG_getObjectRes("E_DK", dk_brk_name[i]); + if (mpBrkAnm[i]->init(mpMorfSO->getModel()->getModelData(), tevKey, + 1, 2, 1.0f, 0, -1) == 0) + { + return 0; + } + + mpBtkAnm[i] = new mDoExt_btkAnm(); + if (mpBtkAnm[i] == 0) { + return 0; + } + + J3DAnmTextureSRTKey* texKey = + (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("E_DK", dk_btk_name[i]); + if (mpBtkAnm[i]->init(mpMorfSO->getModel()->getModelData(), texKey, + 1, 2, 1.0f, 0, -1) == 0) { + return 0; + } + } + + modelData = (J3DModelData*)dComIfG_getObjectRes("E_DK", 0x13); + JUT_ASSERT(1537, modelData != NULL); + mpCoreMorfSO = new mDoExt_McaMorfSO(modelData, NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("E_DK", 0xc), 0, + 1.0f, 0, -1, &mCreatureSound, 0x80000, 0x11000084); + + if (mpCoreMorfSO == NULL || mpCoreMorfSO->getModel() == NULL) { + return 0; + } else { + return 1; + } } /* 806ACDF4-806ACE14 002CF4 0020+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* i_this) { + daE_DK_c* dk = (daE_DK_c*)i_this; + return dk->CreateHeap(); } -/* ############################################################################################## */ -/* 806AD614-806AD618 0000DC 0004+00 0/1 0/0 0/0 .rodata @4983 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4983 = 500.0f; -COMPILER_STRIP_GATE(0x806AD614, &lit_4983); -#pragma pop - -/* 806AD618-806AD620 0000E0 0004+04 0/1 0/0 0/0 .rodata @4984 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4984[1 + 1 /* padding */] = { - -200.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x806AD618, &lit_4984); -#pragma pop - -/* 806AD620-806AD628 0000E8 0008+00 0/1 0/0 0/0 .rodata @4986 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4986[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x806AD620, &lit_4986); -#pragma pop - -/* 806AD628-806AD628 0000F0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_806AD62D = "E_dk"; -#pragma pop - /* 806ACE14-806AD0AC 002D14 0298+00 1/1 0/0 0/0 .text create__8daE_DK_cFv */ -void daE_DK_c::create() { - // NONMATCHING +int daE_DK_c::create() { + fopAcM_SetupActor(this, daE_DK_c); + + s32 loadRes = dComIfG_resLoad(&mPhaseReq, "E_DK"); + if (loadRes == cPhs_COMPLEATE_e) { + OS_REPORT("E_DK PARAM %x\n", fopAcM_GetParam(this)); + field_0x6a4 = fopAcM_GetParam(this); + + if (field_0x6a4 != 0xff) { + if (dComIfGs_isSwitch(field_0x6a4, fopAcM_GetRoomNo(this)) != 0) { + OS_REPORT("E_DK やられ後なので再セットしません\n"); + return cPhs_ERROR_e; + } + } + + u8 param_1 = fopAcM_GetParam(this) >> 8 & 0xff; + if (param_1 == 0xff) { + field_0x6a8 = 1000.0f; + } else { + field_0x6a8 = param_1 * 100.0f; + if (field_0x6a8 < 500.0f) { + field_0x6a8 = 500.0f; + } + } + + if (fopAcM_entrySolidHeap(this, useHeapInit, 0x2520) == 0) { + return cPhs_ERROR_e; + } + + if (data_806AD7F8 == 0) { + data_806AD7F8 = 1; + this->mHIOInit = 1; + l_HIO.field_0x4 = mDoHIO_CREATE_CHILD("", &l_HIO); + } + + attention_info.flags = 4; + + fopAcM_SetMtx(this, mpMorfSO->getModel()->getBaseTRMtx()); + fopAcM_SetMin(this, -200.0, -200.0, -200.0); + fopAcM_SetMax(this, 200.0, 200.0, 200.0); + + mObjAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, + fopAcM_GetSpeed_p(this), NULL, NULL); + + mAcchCir.SetWall(150.0f + nREG_F(0x12), 150.0f + nREG_F(0x13)); + + field_0x560 = health = 100; + + mStts.Init(100, 0, this); + mSphere.Set(cc_dk_src); + mSphere.SetStts(&mStts); + + mAtSphere.Set(cc_dk_at_src); + mAtSphere.SetStts(&mStts); + + mCoreSphere.Set(cc_dk_core_src); + mCoreSphere.SetStts(&mStts); + + mCreatureSound.init(¤t.pos, &eyePos, 3, 1); + mCreatureSound.setEnemyName("E_dk"); + + mAtInfo.mpSound = &mCreatureSound; + + mAtInfo.mPowerType = 0x1; + + field_0x691 = 0x96; + field_0x692 = 0xff; + + onWolfNoLock(); + + daE_DK_Execute(this); + } + return loadRes; } /* 806AD0AC-806AD25C 002FAC 01B0+00 1/1 0/0 0/0 .text __ct__8daE_DK_cFv */ daE_DK_c::daE_DK_c() { - // NONMATCHING -} - -/* 806AD25C-806AD2A4 00315C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -// cM3dGSph::~cM3dGSph() { -extern "C" void __dt__8cM3dGSphFv() { - // NONMATCHING -} - -/* 806AD2A4-806AD2EC 0031A4 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 806AD2EC-806AD348 0031EC 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - -/* 806AD348-806AD3B8 003248 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING -} - -/* 806AD3B8-806AD428 0032B8 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING } /* 806AD428-806AD448 003328 0020+00 1/0 0/0 0/0 .text daE_DK_Create__FP8daE_DK_c */ -static void daE_DK_Create(daE_DK_c* param_0) { - // NONMATCHING +static int daE_DK_Create(daE_DK_c* i_this) { + return i_this->create(); } -/* 806AD448-806AD490 003348 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} +/* 806AD724-806AD744 -00001 0020+00 1/0 0/0 0/0 .data l_daE_DK_Method */ +static actor_method_class l_daE_DK_Method = { + (process_method_func)daE_DK_Create, + (process_method_func)daE_DK_Delete, + (process_method_func)daE_DK_Execute, + (process_method_func)daE_DK_IsDelete, + (process_method_func)daE_DK_Draw, +}; -/* 806AD490-806AD4D8 003390 0048+00 2/1 0/0 0/0 .text __dt__12daE_DK_HIO_cFv */ -daE_DK_HIO_c::~daE_DK_HIO_c() { - // NONMATCHING -} - -/* 806AD4D8-806AD514 0033D8 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_dk_cpp */ -void __sinit_d_a_e_dk_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x806AD4D8, __sinit_d_a_e_dk_cpp); -#pragma pop - -/* 806AD514-806AD51C 003414 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_806AD514() { - // NONMATCHING -} - -/* 806AD51C-806AD524 00341C 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_806AD51C() { - // NONMATCHING -} - -/* 806AD628-806AD628 0000F0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 806AD744-806AD774 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_DK */ +extern actor_process_profile_definition g_profile_E_DK = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_E_DK, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(daE_DK_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 755, // mPriority + &l_daE_DK_Method, // sub_method + 0x000C0100, // mStatus + fopAc_ENEMY_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 0ddf6401a1d..7e546acc3d9 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -836,7 +836,7 @@ JPABaseEmitter* dPa_simpleEcallBack::createEmitter(JPAEmitterManager* param_0) { /* 8004B168-8004B4E0 045AA8 0378+00 1/1 0/0 0/0 .text * set__19dPa_simpleEcallBackFPC4cXyzPC12dKy_tevstr_cUcRC8_GXColorRC8_GXColorif */ -u32 dPa_simpleEcallBack::set(cXyz const* param_1, dKy_tevstr_c const* param_2, u8 param_3, +u32 dPa_simpleEcallBack::set(cXyz const* i_pos, dKy_tevstr_c const* param_2, u8 param_3, _GXColor const& param_4, _GXColor const& param_5, int param_6, f32 param_7) { f32 dVar7 = param_7; @@ -855,7 +855,7 @@ u32 dPa_simpleEcallBack::set(cXyz const* param_1, dKy_tevstr_c const* param_2, u return 0; } pData = mData + field_0xc; - pData->field_0x00 = *param_1; + pData->field_0x00 = *i_pos; u32 uVar5 = dPa_control_c::getEmitterManager()->getResourceManager(dPa_control_c::getRM_ID(mID))->getResUserWork(mID); u32 uVar6 = (uVar5 & 0xef0000) >> 0x10; if (uVar6 < 100) { @@ -875,7 +875,7 @@ u32 dPa_simpleEcallBack::set(cXyz const* param_1, dKy_tevstr_c const* param_2, u if (¶m_4 != NULL) { local_68 = param_4; } - dKy_ParticleColor_get_actor((cXyz*)param_1, (dKy_tevstr_c*)param_2, &local_5c, &local_60, + dKy_ParticleColor_get_actor((cXyz*)i_pos, (dKy_tevstr_c*)param_2, &local_5c, &local_60, &local_64, &local_68, dVar7); pData->field_0x0c.r = local_60.r; pData->field_0x0c.g = local_60.g; @@ -895,7 +895,7 @@ u32 dPa_simpleEcallBack::set(cXyz const* param_1, dKy_tevstr_c const* param_2, u if (¶m_4 != NULL) { local_78 = param_4; } - dKy_ParticleColor_get_bg((cXyz*)param_1, (dKy_tevstr_c*)param_2, &local_6c, &local_70, &local_74, &local_78, + dKy_ParticleColor_get_bg((cXyz*)i_pos, (dKy_tevstr_c*)param_2, &local_6c, &local_70, &local_74, &local_78, dVar7); dVar7 = g_env_light.bg_light_influence + (1.0f - g_env_light.bg_light_influence) * dVar7; @@ -1478,11 +1478,11 @@ void dPa_control_c::setWaterRipple(u32* param_0, cBgS_PolyInfo& param_1, cXyz co /* 8004CA90-8004CF90 0473D0 0500+00 3/3 20/20 418/418 .text * set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf */ -JPABaseEmitter* dPa_control_c::set(u8 param_0, u16 param_1, cXyz const* param_2, - dKy_tevstr_c const* param_3, csXyz const* param_4, cXyz const* param_5, - u8 param_6, dPa_levelEcallBack* param_7, s8 param_8, - _GXColor const* param_9, _GXColor const* param_10, cXyz const* param_11, - f32 param_12) { +JPABaseEmitter* dPa_control_c::set(u8 param_0, u16 param_1, cXyz const* i_pos, + dKy_tevstr_c const* param_3, csXyz const* i_rotation, + cXyz const* i_scale, u8 i_alpha, dPa_levelEcallBack* param_7, + s8 param_8, _GXColor const* param_9, _GXColor const* param_10, + cXyz const* param_11, f32 param_12) { u8 local_e0 = getRM_ID(param_1); JPAResourceManager* local_a8 = mEmitterMng->getResourceManager(local_e0); if (local_a8 == NULL) { @@ -1496,7 +1496,7 @@ JPABaseEmitter* dPa_control_c::set(u8 param_0, u16 param_1, cXyz const* param_2, dPa_group_id_change(&local_ac, ¶m_0); JGeometry::TVec3 aTStack_78; - aTStack_78.set(param_2->x, param_2->y, param_2->z); + aTStack_78.set(i_pos->x, i_pos->y, i_pos->z); JPABaseEmitter* this_00 = mEmitterMng->createSimpleEmitterID( aTStack_78, param_1, param_0, local_e0, NULL, NULL); @@ -1505,25 +1505,25 @@ JPABaseEmitter* dPa_control_c::set(u8 param_0, u16 param_1, cXyz const* param_2, return NULL; } - if (param_4 != NULL) { + if (i_rotation != NULL) { JGeometry::TVec3 aTStack_a4; - aTStack_a4.x = param_4->x; - aTStack_a4.y = param_4->y; - aTStack_a4.z = param_4->z; + aTStack_a4.x = i_rotation->x; + aTStack_a4.y = i_rotation->y; + aTStack_a4.z = i_rotation->z; this_00->setGlobalRotation(aTStack_a4); } - if (param_5 != NULL) { + if (i_scale != NULL) { JGeometry::TVec3 aTStack_84; - aTStack_84.x = param_5->x; - aTStack_84.y = param_5->y; - aTStack_84.z = param_5->z; + aTStack_84.x = i_scale->x; + aTStack_84.y = i_scale->y; + aTStack_84.z = i_scale->z; this_00->setGlobalScale(aTStack_84); } - this_00->setGlobalAlpha(param_6); + this_00->setGlobalAlpha(i_alpha); if (param_7 != NULL) { this_00->setEmitterCallBackPtr(param_7); - param_7->setup(this_00, param_2, param_4, param_8); + param_7->setup(this_00, i_pos, i_rotation, param_8); } if ((local_ac & 0x100) != 0) { this_00->setParticleCallBackPtr(getFsenthPcallBack()); @@ -1531,17 +1531,17 @@ JPABaseEmitter* dPa_control_c::set(u8 param_0, u16 param_1, cXyz const* param_2, if ((local_ac & 0x800) != 0) { this_00->setEmitterCallBackPtr(getGen_d_Light8EcallBack()); if ((local_ac & 0x20) != 0) { - getGen_d_Light8EcallBack()->setup(this_00, param_2, param_4, 0); + getGen_d_Light8EcallBack()->setup(this_00, i_pos, i_rotation, 0); } else { - getGen_d_Light8EcallBack()->setup(this_00, param_2, param_4, 1); + getGen_d_Light8EcallBack()->setup(this_00, i_pos, i_rotation, 1); } } else { if ((local_ac & 0x400) != 0) { this_00->setEmitterCallBackPtr(getGen_b_Light8EcallBack()); if ((local_ac & 0x20) != 0) { - getGen_b_Light8EcallBack()->setup(this_00, param_2, param_4, 0); + getGen_b_Light8EcallBack()->setup(this_00, i_pos, i_rotation, 0); } else { - getGen_b_Light8EcallBack()->setup(this_00, param_2, param_4, 1); + getGen_b_Light8EcallBack()->setup(this_00, i_pos, i_rotation, 1); } } else { if ((local_ac & 0xef0000) >> 0x10 < 100) { @@ -1558,7 +1558,7 @@ JPABaseEmitter* dPa_control_c::set(u8 param_0, u16 param_1, cXyz const* param_2, if (param_9 != NULL) { local_bc = *param_9; } - dKy_ParticleColor_get_actor((cXyz*)param_2, (dKy_tevstr_c*)param_3, &local_b0, + dKy_ParticleColor_get_actor((cXyz*)i_pos, (dKy_tevstr_c*)param_3, &local_b0, &local_b4, &local_b8, &local_bc, param_12); this_00->setGlobalEnvColor(local_b0.r, local_b0.g, local_b0.b); this_00->setGlobalPrmColor(local_b4.r, local_b4.g, local_b4.b); @@ -1574,7 +1574,7 @@ JPABaseEmitter* dPa_control_c::set(u8 param_0, u16 param_1, cXyz const* param_2, if (param_9 != NULL) { local_cc = *param_9; } - dKy_ParticleColor_get_bg((cXyz*)param_2, (dKy_tevstr_c*)param_3, &local_c0, + dKy_ParticleColor_get_bg((cXyz*)i_pos, (dKy_tevstr_c*)param_3, &local_c0, &local_c4, &local_c8, &local_cc, param_12); param_12 = g_env_light.bg_light_influence + (1.0f - g_env_light.bg_light_influence) * param_12; local_c0 = dKy_light_influence_col(&local_c0, param_12); @@ -1659,7 +1659,7 @@ bool dPa_control_c::newSimple(u16 param_0, u8 param_1, u32* param_2) { /* 8004D1B8-8004D23C 047AF8 0084+00 0/0 0/0 9/9 .text * setSimple__13dPa_control_cFUsPC4cXyzPC12dKy_tevstr_cUcRC8_GXColorRC8_GXColorif */ -u32 dPa_control_c::setSimple(u16 param_0, cXyz const* param_1, dKy_tevstr_c const* param_2, +u32 dPa_control_c::setSimple(u16 param_0, cXyz const* i_pos, dKy_tevstr_c const* param_2, u8 param_3, _GXColor const& param_4, _GXColor const& param_5, int param_6, f32 param_7) { dPa_simpleEcallBack* cb = getSimple(param_0); @@ -1667,7 +1667,7 @@ u32 dPa_control_c::setSimple(u16 param_0, cXyz const* param_1, dKy_tevstr_c cons return 0; } - return cb->set(param_1, param_2, param_3, param_4, param_5, param_6, param_7); + return cb->set(i_pos, param_2, param_3, param_4, param_5, param_6, param_7); } /* 8004D23C-8004D278 047B7C 003C+00 1/1 0/0 0/0 .text getSimple__13dPa_control_cFUs */ @@ -1732,11 +1732,10 @@ static void dPa_kankyocolor_set(f32 param_0, JPABaseEmitter* param_1, /* 8004D4CC-8004D6A4 047E0C 01D8+00 3/3 11/11 364/364 .text * set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf */ -u32 dPa_control_c::set(u32 param_0, u8 param_1, u16 param_2, cXyz const* param_3, - dKy_tevstr_c const* param_4, csXyz const* param_5, cXyz const* param_6, - u8 param_7, dPa_levelEcallBack* param_8, s8 param_9, - _GXColor const* param_10, _GXColor const* param_11, cXyz const* param_12, - f32 param_13) { +u32 dPa_control_c::set(u32 param_0, u8 param_1, u16 param_2, cXyz const* pos, + dKy_tevstr_c const* param_4, csXyz const* i_rotation, cXyz const* i_scale, + u8 alpha, dPa_levelEcallBack* param_8, s8 param_9, _GXColor const* param_10, + _GXColor const* param_11, cXyz const* param_12, f32 param_13) { level_c::emitter_c* this_00 = field_0x210.get(param_0); u8 uVar7 = getRM_ID(param_2); JPAResourceManager* this_01 = mEmitterMng->getResourceManager(uVar7); @@ -1747,19 +1746,19 @@ u32 dPa_control_c::set(u32 param_0, u8 param_1, u16 param_2, cXyz const* param_3 JPABaseEmitter* pJVar4 = this_00->getEmitter(); pJVar4->playCalcEmitter(); if (this_00->getCallback() == 0) { - pJVar4->setGlobalTranslation(param_3->x, param_3->y, param_3->z); - if (param_5 != NULL) { + pJVar4->setGlobalTranslation(pos->x, pos->y, pos->z); + if (i_rotation != NULL) { JGeometry::TVec3 aTStack_64; - aTStack_64.x = param_5->x; - aTStack_64.y = param_5->y; - aTStack_64.z = param_5->z; + aTStack_64.x = i_rotation->x; + aTStack_64.y = i_rotation->y; + aTStack_64.z = i_rotation->z; pJVar4->setGlobalRotation(aTStack_64); } } if (pJVar4->checkStatus(JPAEmtrStts_StopEmit)) { pJVar4->playCreateParticle(); } - dPa_kankyocolor_set(param_13, pJVar4, param_4, uVar3, param_3, param_10, param_11); + dPa_kankyocolor_set(param_13, pJVar4, param_4, uVar3, pos, param_10, param_11); return this_00->getId(); } field_0x210.cutTable(this_00); @@ -1767,7 +1766,7 @@ u32 dPa_control_c::set(u32 param_0, u8 param_1, u16 param_2, cXyz const* param_3 if (param_8 != NULL) { param_8->cleanup(); } - JPABaseEmitter* pJVar5 = set(param_1, param_2, param_3, param_4, param_5, param_6, param_7, + JPABaseEmitter* pJVar5 = set(param_1, param_2, pos, param_4, i_rotation, i_scale, alpha, param_8, param_9, param_10, param_11, param_12, param_13); if (pJVar5 == NULL) { return 0;