diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2025-10-08 08:35:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-08 18:35:58 +0300 |
| commit | 3077f6a9716c2be2475a31828c0212d9bd7777db (patch) | |
| tree | f8293311bc947140af4e3d3220a5903b45080e34 /src/d/actor/d_a_e_mm.cpp | |
| parent | fc6c0fd88c64a0f67f30547713088c7f93cd1566 (diff) | |
knBullet / lv6Lblock done, lv6ChangeGate equivalent (#2729)
* knBullet / lv6Lblock done, lv6ChangeGate equivalent
* d_a_e_mm matching
* debug fix
* obj_kage matching
Diffstat (limited to 'src/d/actor/d_a_e_mm.cpp')
| -rw-r--r-- | src/d/actor/d_a_e_mm.cpp | 1699 |
1 files changed, 1091 insertions, 608 deletions
diff --git a/src/d/actor/d_a_e_mm.cpp b/src/d/actor/d_a_e_mm.cpp index 92bf65baa9..41192eb68b 100644 --- a/src/d/actor/d_a_e_mm.cpp +++ b/src/d/actor/d_a_e_mm.cpp @@ -6,697 +6,1180 @@ #include "d/dolzel_rel.h" // IWYU pragma: keep #include "d/actor/d_a_e_mm.h" -#include "d/d_cc_d.h" -#include "dol2asm.h" -#include "f_op/f_op_actor_enemy.h" - - -// -// Forward References: -// - -extern "C" void __ct__12daE_MM_HIO_cFv(); -extern "C" static void anm_init__FP10e_mm_classifUcf(); -extern "C" static void daE_MM_Draw__FP10e_mm_class(); -extern "C" static void pl_check__FP10e_mm_classfs(); -extern "C" static void damage_checkMetOn__FP10e_mm_class(); -extern "C" static void damage_check__FP10e_mm_class(); -extern "C" static void wall_check__FP10e_mm_classf(); -extern "C" static void mGround_WaterEffSet__FP10e_mm_class(); -extern "C" static void mWaterEffSet__FP10e_mm_classb(); -extern "C" static void way_gake_check__FP10e_mm_class(); -extern "C" static void e_mm_normal__FP10e_mm_class(); -extern "C" static void e_mm_dash__FP10e_mm_class(); -extern "C" static void e_mm_defence__FP10e_mm_class(); -extern "C" static void e_mm_magne_wait__FP10e_mm_class(); -extern "C" static void e_mm_turn__FP10e_mm_class(); -extern "C" static void e_mm_damage__FP10e_mm_class(); -extern "C" static void action__FP10e_mm_class(); -extern "C" static void daE_MM_Execute__FP10e_mm_class(); -extern "C" static bool daE_MM_IsDelete__FP10e_mm_class(); -extern "C" static void daE_MM_Delete__FP10e_mm_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" static void daE_MM_Create__FP10fopAc_ac_c(); -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" void __dt__10cCcD_GSttsFv(); -extern "C" void __dt__12daE_MM_HIO_cFv(); -extern "C" void __sinit_d_a_e_mm_cpp(); -extern "C" static void func_80722804(); -extern "C" static void func_8072280C(); -extern "C" extern char const* const d_a_e_mm__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -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_SearchByID__FUiPP10fopAc_ac_c(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_createChild__FsUiUlPC4cXyziPC5csXyzPC4cXyzScPFPv_i(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc(); -extern "C" void fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_wayBgCheck__FPC10fopAc_ac_cff(); -extern "C" void fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci(); -extern "C" void 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 onSwitch__10dSv_info_cFii(); -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 LineCross__4cBgSFP11cBgS_LinChk(); -extern "C" void GroundCross__4cBgSFP11cBgS_GndChk(); -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__11dBgS_LinChkFv(); -extern "C" void __dt__11dBgS_LinChkFv(); -extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Move__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void GetAtHitObj__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void GetTgHitGObj__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_darkworld_check__Fv(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void atan2sX_Z__4cXyzCFv(); -extern "C" void cM_atan2s__Fff(); -extern "C" void cM_rndF__Ff(); -extern "C" void cM_rndFX__Ff(); -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_addCalc__FPfffff(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalc0__FPfff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void func_802807E0(); -extern "C" void __ct__15Z2CreatureEnemyFv(); -extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc(); -extern "C" void setLinkSearch__15Z2CreatureEnemyFb(); -extern "C" void setEnemyName__15Z2CreatureEnemyFPCc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void _savegpr_19(); -extern "C" void _savegpr_23(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_19(); -extern "C" void _restgpr_23(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; -extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; -extern "C" u8 m_midnaActor__9daPy_py_c[4]; -extern "C" void __register_global_object(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80722C68-80722C6C 00002C 0004+00 0/1 0/0 0/0 .rodata @3810 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3810 = 7.0f / 5.0f; -COMPILER_STRIP_GATE(0x80722C68, &lit_3810); -#pragma pop - -/* 80722C6C-80722C70 000030 0004+00 1/2 0/0 0/0 .rodata @3811 */ -SECTION_RODATA static f32 const lit_3811 = 2.0f; -COMPILER_STRIP_GATE(0x80722C6C, &lit_3811); - -/* 80722C70-80722C74 000034 0004+00 0/1 0/0 0/0 .rodata @3812 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3812 = 15.0f; -COMPILER_STRIP_GATE(0x80722C70, &lit_3812); -#pragma pop - -/* 80722C74-80722C78 000038 0004+00 0/1 0/0 0/0 .rodata @3813 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3813 = 1000.0f; -COMPILER_STRIP_GATE(0x80722C74, &lit_3813); -#pragma pop - -/* 80722C78-80722C7C 00003C 0004+00 0/1 0/0 0/0 .rodata @3814 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3814 = 2.5f; -COMPILER_STRIP_GATE(0x80722C78, &lit_3814); -#pragma pop - -/* 80722C7C-80722C80 000040 0004+00 0/2 0/0 0/0 .rodata @3815 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3815 = 8.0f; -COMPILER_STRIP_GATE(0x80722C7C, &lit_3815); -#pragma pop - -/* 80722C80-80722C84 000044 0004+00 0/6 0/0 0/0 .rodata @3816 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3816 = 10.0f; -COMPILER_STRIP_GATE(0x80722C80, &lit_3816); -#pragma pop - -/* 80722D2C-80722D34 000038 0008+00 1/1 0/0 0/0 .data mDropEff$4000 */ -SECTION_DATA static u8 mDropEff[8] = { - 0x01, 0xB8, 0x01, 0xB9, 0x01, 0xBA, 0x01, 0xBB, -}; +#include "d/d_s_play.h" -/* 80722D34-80722D40 000040 000C+00 1/1 0/0 0/0 .data mDushEff$4038 */ -SECTION_DATA static u8 mDushEff[12] = { - 0x87, 0x7A, 0x87, 0x7B, 0x87, 0x7C, 0x01, 0xAF, 0x01, 0xB0, 0x01, 0xB1, -}; - -/* 80722D40-80722D6C -00001 002C+00 1/1 0/0 0/0 .data @4621 */ -SECTION_DATA static void* lit_4621[11] = { - (void*)(((char*)action__FP10e_mm_class) + 0x94), - (void*)(((char*)action__FP10e_mm_class) + 0xA0), - (void*)(((char*)action__FP10e_mm_class) + 0xB0), - (void*)(((char*)action__FP10e_mm_class) + 0xBC), - (void*)(((char*)action__FP10e_mm_class) + 0xC8), - (void*)(((char*)action__FP10e_mm_class) + 0xDC), - (void*)(((char*)action__FP10e_mm_class) + 0xDC), - (void*)(((char*)action__FP10e_mm_class) + 0xDC), - (void*)(((char*)action__FP10e_mm_class) + 0xDC), - (void*)(((char*)action__FP10e_mm_class) + 0xDC), - (void*)(((char*)action__FP10e_mm_class) + 0xD4), -}; - -/* 80722D6C-80722DAC 000078 0040+00 1/1 0/0 0/0 .data cc_sph_src$4753 */ -static dCcD_SrcSph cc_sph_src = { - { - {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0xd}, {0xd8fbfdff, 0x43}, 0x75}}, // mObj - {dCcD_SE_SOFT_BODY, 0x0, 0x1, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x406}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph - } // mSphAttr -}; - -/* 80722DAC-80722DEC 0000B8 0040+00 1/1 0/0 0/0 .data cc_wind_sph_src$4754 */ -static dCcD_SrcSph cc_wind_sph_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0x200, 0x11}, 0x0}}, // mObj - {dCcD_SE_SOFT_BODY, 0x0, 0x1, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x4}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph - } // mSphAttr -}; - -/* 80722DEC-80722E0C -00001 0020+00 1/0 0/0 0/0 .data l_daE_MM_Method */ -static actor_method_class l_daE_MM_Method = { - (process_method_func)daE_MM_Create__FP10fopAc_ac_c, - (process_method_func)daE_MM_Delete__FP10e_mm_class, - (process_method_func)daE_MM_Execute__FP10e_mm_class, - (process_method_func)daE_MM_IsDelete__FP10e_mm_class, - (process_method_func)daE_MM_Draw__FP10e_mm_class, -}; - -/* 80722E0C-80722E3C -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_MM */ -extern actor_process_profile_definition g_profile_E_MM = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_E_MM, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(e_mm_class), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 167, // mPriority - &l_daE_MM_Method, // sub_method - 0x00040120, // mStatus - fopAc_ENEMY_e, // mActorType - fopAc_CULLBOX_0_e, // cullType -}; - -/* 80722E3C-80722E48 000148 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, -}; - -/* 80722E48-80722E54 000154 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, -}; - -/* 80722E54-80722E60 000160 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, -}; - -/* 80722E60-80722E6C 00016C 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, -}; +#include "f_op/f_op_actor_enemy.h" -/* 80722E6C-80722E78 000178 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, -}; +enum daE_MM_ACTION { + ACTION_NORMAL, + ACTION_DASH, + ACTION_DEFENCE, + ACTION_MAGNE_WAIT, + ACTION_TURN, -/* 80722E78-80722E9C 000184 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_8072280C, - (void*)NULL, - (void*)NULL, - (void*)func_80722804, + ACTION_DAMAGE = 10, }; -/* 80722E9C-80722EA8 0001A8 000C+00 2/2 0/0 0/0 .data __vt__12daE_MM_HIO_c */ -SECTION_DATA extern void* __vt__12daE_MM_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12daE_MM_HIO_cFv, +class daE_MM_HIO_c : public JORReflexible { +public: + /* 8071F9CC */ daE_MM_HIO_c(); + /* 80722780 */ virtual ~daE_MM_HIO_c() {} + + void genMessage(JORMContext*); + + /* 0x04 */ s8 id; + /* 0x08 */ f32 base_size; + /* 0x0C */ f32 move_speed; + /* 0x10 */ f32 charge_speed; + /* 0x14 */ f32 pl_search_range; + /* 0x18 */ s16 reflect_chance_time; + /* 0x1C */ f32 donketsu_base_size; + /* 0x20 */ f32 donketsu_move_speed; + /* 0x24 */ f32 donketsu_charge_speed; + /* 0x28 */ f32 donketsu_pl_search_range; + /* 0x2C */ f32 donketsu_reflect_speed; + /* 0x30 */ s16 donketsu_reflect_chance_time; + /* 0x32 */ s16 donketsu_angle; }; /* 8071F9CC-8071FA44 0000EC 0078+00 1/1 0/0 0/0 .text __ct__12daE_MM_HIO_cFv */ daE_MM_HIO_c::daE_MM_HIO_c() { - // NONMATCHING + id = -1; + base_size = 1.4f; + move_speed = 2.0f; + charge_speed = 15.0f; + pl_search_range = 1000.0f; + reflect_chance_time = 50; + donketsu_base_size = 2.5f; + donketsu_move_speed = 2.0f; + donketsu_charge_speed = 8.0f; + donketsu_pl_search_range = 1000.0f; + donketsu_reflect_speed = 10.0f; + donketsu_reflect_chance_time = 75; + donketsu_angle = 300; } -/* ############################################################################################## */ -/* 80722C84-80722C88 000048 0004+00 1/4 0/0 0/0 .rodata @3830 */ -SECTION_RODATA static f32 const lit_3830 = -1.0f; -COMPILER_STRIP_GATE(0x80722C84, &lit_3830); - -/* 80722CE8-80722CE8 0000AC 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80722CE8 = "E_MM"; -#pragma pop - /* 8071FA44-8071FAF0 000164 00AC+00 8/8 0/0 0/0 .text anm_init__FP10e_mm_classifUcf */ -static void anm_init(e_mm_class* param_0, int param_1, f32 param_2, u8 param_3, f32 param_4) { - // NONMATCHING +static void anm_init(e_mm_class* i_this, int i_anm, f32 i_morf, u8 i_mode, f32 i_speed) { + i_this->modelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_MM", i_anm), i_mode, i_morf, i_speed, 0.0f, -1.0f); + i_this->anm = i_anm; } -/* ############################################################################################## */ -/* 80722C88-80722C8C 00004C 0004+00 0/1 0/0 0/0 .rodata @3860 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3860 = 700.0f; -COMPILER_STRIP_GATE(0x80722C88, &lit_3860); -#pragma pop - /* 8071FAF0-8071FBC4 000210 00D4+00 1/0 0/0 0/0 .text daE_MM_Draw__FP10e_mm_class */ -static void daE_MM_Draw(e_mm_class* param_0) { - // NONMATCHING +static int daE_MM_Draw(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + J3DModel* model = i_this->modelMorf->getModel(); + + g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr); + g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr); + i_this->modelMorf->entryDL(); + + cXyz spC; + spC.set(actor->current.pos.x, 100.0f + actor->current.pos.y, actor->current.pos.z); + i_this->shadowId = dComIfGd_setShadow(i_this->shadowId, 1, model, &spC, 700.0f, 0.0f, actor->current.pos.y, i_this->acch.GetGroundH(), i_this->acch.m_gnd, &actor->tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); + return 1; } /* 8071FBC4-8071FC24 0002E4 0060+00 1/1 0/0 0/0 .text pl_check__FP10e_mm_classfs */ -static void pl_check(e_mm_class* param_0, f32 param_1, s16 param_2) { - // NONMATCHING -} +static BOOL pl_check(e_mm_class* i_this, f32 i_range, s16) { + fopAc_ac_c* actor = &i_this->enemy; -/* ############################################################################################## */ -/* 80722C8C-80722C90 000050 0004+00 0/7 0/0 0/0 .rodata @3909 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3909 = 3.0f; -COMPILER_STRIP_GATE(0x80722C8C, &lit_3909); -#pragma pop - -/* 80722C90-80722C94 000054 0004+00 0/3 0/0 0/0 .rodata @3910 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3910 = -20.0f; -COMPILER_STRIP_GATE(0x80722C90, &lit_3910); -#pragma pop - -/* 80722C94-80722C98 000058 0004+00 0/2 0/0 0/0 .rodata @3911 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3911 = 25.0f; -COMPILER_STRIP_GATE(0x80722C94, &lit_3911); -#pragma pop + if (i_this->dist_to_pl < i_range && !fopAcM_otherBgCheck(actor, dComIfGp_getPlayer(0)) && !dComIfGp_checkPlayerStatus0(0, 0x100)) { + return 1; + } -/* 80722EB0-80722EB4 000008 0004+00 2/2 0/0 0/0 .bss None */ -static u8 data_80722EB0[4]; + return 0; +} -/* 80722EB4-80722EC0 00000C 000C+00 1/1 0/0 0/0 .bss @3805 */ -static u8 lit_3805[12]; +/* 80722EB0-80722EB4 000008 0004+00 2/2 0/0 0/0 .bss None */ +static u8 l_HIOInit; /* 80722EC0-80722EF4 000018 0034+00 7/7 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[52]; +static daE_MM_HIO_c l_HIO; /* 8071FC24-8071FE98 000344 0274+00 1/1 0/0 0/0 .text damage_checkMetOn__FP10e_mm_class */ -static void damage_checkMetOn(e_mm_class* param_0) { - // NONMATCHING +static void damage_checkMetOn(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + + if (actor->health <= 0 || i_this->action == ACTION_DAMAGE) { + return; + } + + fopEn_enemy_c* enemy = &i_this->enemy; + setMidnaBindEffect(enemy, &i_this->sound, &actor->current.pos, &actor->scale); + + if ((i_this->field_0xb99 & 4) && i_this->action != ACTION_MAGNE_WAIT) { + i_this->field_0x6a4 = 10; + i_this->field_0x672 = 0; + + anm_init(i_this, 0xB, 3.0f, 0, 1.0f); + + i_this->ccSph.OffTgNoHitMark(); + i_this->action = ACTION_MAGNE_WAIT; + i_this->mode = 0; + + i_this->ccSph.SetTgType(0xD8FBFFFF); + i_this->sound.startCreatureSound(Z2SE_EN_MM_MET_TAKEN, 0, -1); + return; + } + + if (i_this->field_0x6a4 == 0) { + if (i_this->field_0xb99 & 1) { + actor->speedF = -20.0f + BREG_F(14); + if (actor->argument == 1) { + actor->speedF = -1.0f * l_HIO.donketsu_reflect_speed; + } + + i_this->action = ACTION_DASH; + i_this->mode = 5; + i_this->field_0x6a4 = 10; + + anm_init(i_this, 0xD, 10.0f, 2, 1.0f); + i_this->ccSph.SetTgHitMark(CcG_Tg_UNK_MARK_2); + + if (actor->argument == 1) { + i_this->timers[0] = l_HIO.donketsu_reflect_chance_time; + } else { + i_this->timers[0] = l_HIO.reflect_chance_time; + } + + i_this->field_0xb99 &= ~1; + } else if (i_this->field_0xb99 & 2) { + i_this->field_0x6a4 = 10; + i_this->action = ACTION_DEFENCE; + i_this->field_0xb99 &= ~2; + i_this->mode = 0; + } else if (i_this->field_0xb99 & 8) { + i_this->action = ACTION_DAMAGE; + i_this->mode = 3; + i_this->field_0x6a8 = 25.0f; + i_this->field_0x6a4 = 10; + actor->speedF = 0.0f; + } else if (i_this->field_0xb99 & 16) { + i_this->action = ACTION_DAMAGE; + i_this->mode = 0; + i_this->field_0x6a8 = 25.0f; + actor->speedF = 0.0f; + i_this->field_0x6a4 = 10; + i_this->mode = 0; + actor->health = 0; + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_DEAD, -1); + } + } } -/* ############################################################################################## */ -/* 80722C98-80722C9C 00005C 0004+00 0/2 0/0 0/0 .rodata @3961 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3961 = 0.5f; -COMPILER_STRIP_GATE(0x80722C98, &lit_3961); -#pragma pop - -/* 80722C9C-80722CA0 000060 0004+00 0/2 0/0 0/0 .rodata @3962 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3962 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x80722C9C, &lit_3962); -#pragma pop - /* 8071FE98-807201A0 0005B8 0308+00 1/1 0/0 0/0 .text damage_check__FP10e_mm_class */ -static void damage_check(e_mm_class* param_0) { - // NONMATCHING +static void damage_check(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + + if (actor->health > 0) { + fopEn_enemy_c* enemy = &i_this->enemy; + setMidnaBindEffect(enemy, &i_this->sound, &actor->current.pos, &actor->scale); + + if (i_this->field_0x6a4 == 0) { + i_this->ccStts.Move(); + + if (i_this->ccSph.ChkAtShieldHit()) { + actor->speedF = -20.0f + BREG_F(14); + if (actor->argument == 1) { + actor->speedF = -1.0f * l_HIO.donketsu_reflect_speed; + } + + i_this->action = ACTION_DASH; + i_this->mode = 5; + anm_init(i_this, 0xD, 10.0f, 2, 1.0f); + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_NO_DAMAGE, -1); + + if (actor->argument == 1) { + i_this->timers[0] = l_HIO.donketsu_reflect_chance_time; + } else { + i_this->timers[0] = l_HIO.reflect_chance_time; + } + + i_this->atInfo.mpCollider = i_this->ccSph.GetAtHitObj(); + cCcD_Obj* sp20 = i_this->atInfo.mpCollider; + i_this->field_0x6a4 = 10; + return; + } + + if (i_this->ccSph.ChkTgHit()) { + i_this->atInfo.mpCollider = i_this->ccSph.GetTgHitObj(); + s16 prev_hp = actor->health; + cc_at_check(actor, &i_this->atInfo); + + i_this->action = ACTION_DAMAGE; + actor->speedF = 0.0f; + i_this->mode = 3; + i_this->field_0x6a4 = 10; + + if (prev_hp == actor->health) { + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_NO_DAMAGE, -1); + } else { + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_DAMAGE, -1); + } + + i_this->field_0x6a8 = 25.0f; + i_this->field_0x6ac = i_this->atInfo.mHitDirection.y; + } + + if (actor->health <= 1) { + fopAcM_OffStatus(actor, 0); + actor->attention_info.flags &= ~fopAc_AttnFlag_BATTLE_e; + + i_this->ccSph.OffAtSetBit(); + i_this->ccSph.OffTgSetBit(); + + i_this->action = ACTION_DAMAGE; + i_this->mode = 0; + i_this->field_0x6a4 = 1000; + actor->health = 0; + + i_this->ccSph.SetTgHitMark(CcG_Tg_UNK_MARK_3); + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_DEAD, -1); + } + + if (i_this->ccWindSph.ChkTgHit()) { + dCcD_GObjInf* hit_gobj = i_this->ccWindSph.GetTgHitGObj(); + if (hit_gobj->GetAtMtrl() == dCcD_MTRL_WIND) { + cXyz* hit_vec_p = hit_gobj->GetAtVecP(); + *hit_vec_p *= 0.5f + NREG_F(2); + + cLib_addCalc(&i_this->field_0xbf4.x, hit_vec_p->x, 0.1f, 100.0f, 0.0f); + cLib_addCalc(&i_this->field_0xbf4.y, hit_vec_p->y, 0.1f, 100.0f, 0.0f); + cLib_addCalc(&i_this->field_0xbf4.z, hit_vec_p->z, 0.1f, 100.0f, 0.0f); + actor->current.pos += i_this->field_0xbf4; + } + } + } + + } } -/* ############################################################################################## */ -/* 80722CA0-80722CA4 000064 0004+00 1/2 0/0 0/0 .rodata @3995 */ -SECTION_RODATA static f32 const lit_3995 = 40.0f; -COMPILER_STRIP_GATE(0x80722CA0, &lit_3995); - -/* 80722CA4-80722CA8 000068 0004+00 0/1 0/0 0/0 .rodata @3996 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3996 = -50.0f; -COMPILER_STRIP_GATE(0x80722CA4, &lit_3996); -#pragma pop - /* 807201A0-807202F0 0008C0 0150+00 2/2 0/0 0/0 .text wall_check__FP10e_mm_classf */ -static void wall_check(e_mm_class* param_0, f32 param_1) { - // NONMATCHING +static bool wall_check(e_mm_class* i_this, f32 param_1) { + fopAc_ac_c* actor = &i_this->enemy; + dBgS_LinChk linchk; + cXyz sp24; + cXyz start; + cXyz end; + + cMtx_YrotS(*calc_mtx, actor->shape_angle.y); + + sp24.x = 0.0f; + sp24.y = 40.0f + BREG_F(8); + sp24.z = -50.0f + BREG_F(9); + MtxPosition(&sp24, &start); + start += actor->current.pos; + i_this->field_0xbc4.set(start); + + sp24.x = 0.0f; + sp24.y = 40.0f + BREG_F(8); + sp24.z = param_1; + MtxPosition(&sp24, &end); + end += actor->current.pos; + i_this->field_0xbd0.set(end); + + linchk.Set(&start, &end, actor); + + if (!dComIfG_Bgsp().LineCross(&linchk)) { + return FALSE; + } + + return TRUE; } /* 807202F0-807203E0 000A10 00F0+00 2/2 0/0 0/0 .text mGround_WaterEffSet__FP10e_mm_class */ -static void mGround_WaterEffSet(e_mm_class* param_0) { - // NONMATCHING +static void mGround_WaterEffSet(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + J3DModel* model = i_this->modelMorf->getModel(); + + for (int i = 0; i < 4; i++) { + static u16 mDropEff[] = { + ID_ZI_J_DOWNWTRA_A, + ID_ZI_J_DOWNWTRA_B, + ID_ZI_J_DOWNWTRA_C, + ID_ZI_J_DOWNWTRA_D, + }; + + i_this->waterEffEmtIds[i] = dComIfGp_particle_set(i_this->waterEffEmtIds[i], mDropEff[i], &actor->current.pos, NULL, NULL); + + JPABaseEmitter* emt = dComIfGp_particle_getEmitter(i_this->waterEffEmtIds[i]); + if (emt != NULL) { + emt->setGlobalRTMatrix(model->getAnmMtx(0)); + } + } } /* 807203E0-80720590 000B00 01B0+00 1/1 0/0 0/0 .text mWaterEffSet__FP10e_mm_classb */ -static void mWaterEffSet(e_mm_class* param_0, bool param_1) { - // NONMATCHING +static void mWaterEffSet(e_mm_class* i_this, bool param_1) { + fopAc_ac_c* actor = &i_this->enemy; + J3DModel* model = i_this->modelMorf->getModel(); + + if (i_this->acch.ChkWaterHit()) { + for (int i = 0; i < 6; i++) { + if (!param_1 || i != 2) { + static u16 mDushEff[] = { + dPa_RM(ID_ZF_S_MMRUNWAVE00), + dPa_RM(ID_ZF_S_MMRUNWAVE01), + dPa_RM(ID_ZF_S_MMRUNWAVE02), + ID_ZI_J_DASHWTRA_A, + ID_ZI_J_DASHWTRA_B, + ID_ZI_J_DASHWTRA_C, + }; + + i_this->field_0xb9c[i] = dComIfGp_particle_set(i_this->field_0xb9c[i], mDushEff[i], &actor->current.pos, NULL, NULL); + + JPABaseEmitter* emt = dComIfGp_particle_getEmitter(i_this->field_0xb9c[i]); + if (emt != NULL) { + emt->setGlobalRTMatrix(model->getAnmMtx(0)); + if (param_1 && i == 1) { + emt->setRate(2.0f); + } + } + } + } + + if (param_1 && i_this->field_0xc01 == 0) { + i_this->field_0xc01 = 1; + + JPABaseEmitter* emt = dComIfGp_particle_set(dPa_RM(ID_ZF_S_MMSTOPWAVE00), &actor->current.pos, NULL, NULL); + if (emt != NULL) { + emt->setGlobalRTMatrix(model->getAnmMtx(0)); + } + } + } } -/* ############################################################################################## */ -/* 80722CA8-80722CAC 00006C 0004+00 0/2 0/0 0/0 .rodata @4141 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4141 = 200.0f; -COMPILER_STRIP_GATE(0x80722CA8, &lit_4141); -#pragma pop - -/* 80722CAC-80722CB0 000070 0004+00 0/1 0/0 0/0 .rodata @4142 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4142 = -G_CM3D_F_INF; -COMPILER_STRIP_GATE(0x80722CAC, &lit_4142); -#pragma pop - /* 80720590-807206FC 000CB0 016C+00 3/3 0/0 0/0 .text way_gake_check__FP10e_mm_class */ -static void way_gake_check(e_mm_class* param_0) { - // NONMATCHING +static bool way_gake_check(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + dBgS_GndChk gndchk; + cXyz sp14; + cXyz sp8; + + if (wall_check(i_this, 200.0f + BREG_F(10)) || i_this->acch.ChkWallHit()) { + return FALSE; + } + + cMtx_YrotS(*calc_mtx, actor->shape_angle.y); + sp14.x = 0.0f; + sp14.y = 200.0f + BREG_F(11); + sp14.z = 200.0f + BREG_F(12); + MtxPosition(&sp14, &sp8); + sp8 += actor->current.pos; + + i_this->field_0xbdc.set(sp8); + gndchk.SetPos(&sp8); + + sp8.y = dComIfG_Bgsp().GroundCross(&gndchk); + if (-G_CM3D_F_INF == sp8.y) { + return TRUE; + } + + i_this->field_0xbe8.set(sp8); + if (actor->current.pos.y - sp8.y > 200.0f) { + return TRUE; + } + + return FALSE; } -/* ############################################################################################## */ -/* 80722CB0-80722CB4 000074 0004+00 0/1 0/0 0/0 .rodata @4227 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4227 = 32768.0f; -COMPILER_STRIP_GATE(0x80722CB0, &lit_4227); -#pragma pop - -/* 80722CB4-80722CB8 000078 0004+00 0/1 0/0 0/0 .rodata @4228 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4228 = 10000.0f; -COMPILER_STRIP_GATE(0x80722CB4, &lit_4228); -#pragma pop - -/* 80722CB8-80722CBC 00007C 0004+00 1/3 0/0 0/0 .rodata @4229 */ -SECTION_RODATA static f32 const lit_4229 = 50.0f; -COMPILER_STRIP_GATE(0x80722CB8, &lit_4229); - -/* 80722CBC-80722CC4 000080 0004+04 0/1 0/0 0/0 .rodata @4230 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4230[1 + 1 /* padding */] = { - 600.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x80722CBC, &lit_4230); -#pragma pop - -/* 80722CC4-80722CCC 000088 0008+00 0/1 0/0 0/0 .rodata @4232 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4232[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80722CC4, &lit_4232); -#pragma pop - /* 807206FC-80720B50 000E1C 0454+00 1/1 0/0 0/0 .text e_mm_normal__FP10e_mm_class */ -static void e_mm_normal(e_mm_class* param_0) { - // NONMATCHING +static void e_mm_normal(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + cXyz sp38; + cXyz sp2C; + + f32 move_speed = 0.0f; + + if (way_gake_check(i_this)) { + anm_init(i_this, 0xE, 10.0f, 2, 1.0f); + i_this->target_ya = actor->current.angle.y + (s16)(32768.0f + cM_rndFX(10000.0f)); + i_this->mode = 0; + i_this->action = ACTION_TURN; + return; + } + + switch (i_this->mode) { + case 0: + if (actor->argument == 1) { + move_speed = l_HIO.donketsu_move_speed; + } else { + move_speed = l_HIO.move_speed; + } + + cLib_addCalcAngleS2(&actor->current.angle.y, i_this->target_ya, 8, 0x100); + + if ((int)i_this->modelMorf->getFrame() == 15 || (int)i_this->modelMorf->getFrame() == 28) { + u32 sp1C = 1; + if (i_this->field_0x672 == 0) { + sp1C = 2; + } + + if (!i_this->acch.ChkWaterHit()) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_WALK_LND, sp1C, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_EN_MM_WALK_WTR, sp1C, -1); + } + } + + if (i_this->timers[0] == 0 || (i_this->timers[1] == 0 && fopAcM_wayBgCheck(actor, 200.0f, 50.0f))) { + i_this->mode = 1; + i_this->timers[0] = 50.0f + cM_rndF(100.0f); + anm_init(i_this, 8, 10.0f, 2, 1.0f); + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_KYORO, -1); + } + break; + case 1: + if (!i_this->modelMorf->getFrame()) { + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_KYORO, -1); + } + + s16 sp8; + if (i_this->timers[0] == 0) { + s16 var_r27; + if (fopAcM_wayBgCheck(actor, 200.0f, 50.0f)) { + var_r27 = 32768.0f + cM_rndFX(10000.0f); + i_this->timers[1] = TREG_S(5) + 80; + } else { + sp2C.x = actor->home.pos.x + cM_rndFX(600.0f); + sp2C.y = actor->home.pos.y; + sp2C.z = actor->home.pos.z + cM_rndFX(600.0f); + sp38 = sp2C - actor->current.pos; + + var_r27 = sp38.atan2sX_Z() - actor->current.angle.y; + if (var_r27 > 0x3000) { + var_r27 = 0x3000; + } else if (var_r27 < -0x3000) { + var_r27 = -0x3000; + } + } + + i_this->target_ya = actor->current.angle.y + var_r27; + anm_init(i_this, 0xE, 10.0f, 2, 1.0f); + i_this->mode = 0; + i_this->timers[0] = 100.0f + cM_rndF(100.0f); + } else { + sp8 = 0x6000; + } + break; + } + + cLib_addCalc2(&actor->speedF, move_speed, 1.0f, 3.0f); + + f32 pl_search_range; + if (actor->argument == 1) { + pl_search_range = l_HIO.donketsu_pl_search_range; + } else { + pl_search_range = l_HIO.pl_search_range; + } + + if (i_this->field_0x5b4 != 0xFF && i_this->field_0x5b4 != 0) { + pl_search_range = 10.0f * i_this->field_0x5b4; + } + + if (pl_check(i_this, pl_search_range, 0x5000) && fopAcM_searchActorDistanceY(actor, dComIfGp_getPlayer(0)) < 100.0f) { + i_this->action = ACTION_DASH; + i_this->mode = 0; + } } -/* ############################################################################################## */ -/* 80722CCC-80722CD0 000090 0004+00 0/1 0/0 0/0 .rodata @4358 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4358 = 1.5f; -COMPILER_STRIP_GATE(0x80722CCC, &lit_4358); -#pragma pop - -/* 80722CD0-80722CD4 000094 0004+00 0/2 0/0 0/0 .rodata @4359 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4359 = 20.0f; -COMPILER_STRIP_GATE(0x80722CD0, &lit_4359); -#pragma pop - /* 80720B50-807211CC 001270 067C+00 1/1 0/0 0/0 .text e_mm_dash__FP10e_mm_class */ -static void e_mm_dash(e_mm_class* param_0) { - // NONMATCHING +static void e_mm_dash(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + cXyz sp40; + cXyz sp34; + + f32 move_speed = 0.0f; + f32 var_f30 = 3.0f; + s16 spA = 0; + s16 sp8 = 0; + int var_r27 = 1; + + if (i_this->mode != 4 && way_gake_check(i_this)) { + i_this->mode = 4; + anm_init(i_this, 0xA, 3.0f, 0, 1.0f); + mWaterEffSet(i_this, 1); + } + + switch (i_this->mode) { + case 0: + i_this->field_0xc01 = 0; + anm_init(i_this, 7, 3.0f, 0, 1.0f); + i_this->mode = 1; + break; + case 1: + if ((int)i_this->modelMorf->getFrame() == 3) { + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_FIND, -1); + } + + if (i_this->modelMorf->isStop()) { + anm_init(i_this, 0xC, 3.0f, 2, 1.0f); + i_this->mode = 2; + } + break; + case 2: + if (i_this->field_0x672 == 0) { + var_r27 = 2; + } + + if ((int)i_this->modelMorf->getFrame() == 9 || (int)i_this->modelMorf->getFrame() == 19) { + if (!i_this->acch.ChkWaterHit()) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_WALK_LND, var_r27, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_EN_MM_WALK_WTR, var_r27, -1); + } + } + + i_this->target_ya = i_this->angle_to_pl; + spA = 0x300; + sp8 = (i_this->target_ya - actor->current.angle.y); + if (sp8 < 0x200 && sp8 > -0x200) { + anm_init(i_this, 9, 3.0f, 2, 1.0f); + i_this->mode = 3; + i_this->timers[0] = 70; + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_RUSH, -1); + } + break; + case 3: + spA = 0x300; + if (actor->argument == 1) { + move_speed = l_HIO.donketsu_charge_speed; + } else { + move_speed = l_HIO.charge_speed; + } + + i_this->field_0xb98 = 1; + + if ((i_this->timers[0] & 3) == 0) { + fopAcM_effSmokeSet2(&i_this->field_0xc04, &i_this->field_0xc08, &actor->current.pos, &actor->shape_angle, 1.5f * actor->scale.x, &actor->tevStr); + } + + if (i_this->field_0x672 == 0) { + var_r27 = 2; + } + + mWaterEffSet(i_this, 0); + + if ((int)i_this->modelMorf->getFrame() == 5 || (int)i_this->modelMorf->getFrame() == 8) { + if (!i_this->acch.ChkWaterHit()) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_RUN_LND, var_r27, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_EN_MM_RUN_WTR, var_r27, -1); + } + } + + if (wall_check(i_this, 100.0f + BREG_F(13))) { + actor->speedF = -20.0f + BREG_F(14); + if (actor->argument == 1) { + actor->speedF = -1.0f * l_HIO.donketsu_reflect_speed; + } + + i_this->mode = 5; + anm_init(i_this, 0xD, 10.0f, 2, 1.0f); + + if (actor->argument == 1) { + i_this->timers[0] = l_HIO.donketsu_reflect_chance_time; + } else { + i_this->timers[0] = l_HIO.reflect_chance_time; + } + + if (i_this->field_0x672 != 0) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_R2W_MET, 0, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_EN_MM_R2W_NOMET, 0, -1); + } + } + + if (i_this->timers[0] == 0) { + if (!i_this->acch.ChkWaterHit()) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_BRAKE_LND, 0, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_EN_MM_BRAKE_WTR, 0, -1); + } + + i_this->mode = 4; + anm_init(i_this, 0xA, 3.0f, 0, 1.0f); + } + break; + case 4: + move_speed = 0.0f; + var_f30 = 1.0f + TREG_F(13); + + if (actor->speedF < 0.1f) { + i_this->action = ACTION_NORMAL; + i_this->mode = 0; + i_this->timers[0] = 0; + anm_init(i_this, 0xE, 20.0f, 2, 1.0f); + } + + mWaterEffSet(i_this, 1); + + if ((i_this->timers[0] & 3) == 0) { + fopAcM_effSmokeSet2(&i_this->field_0xc04, &i_this->field_0xc08, &actor->current.pos, &actor->shape_angle, 1.5f + XREG_F(3), &actor->tevStr); + } + break; + case 5: + move_speed = 0.0f; + var_f30 = 1.0f + TREG_F(13); + + if (actor->speedF >= 1.0f) { + mWaterEffSet(i_this, 1); + } + + if (actor->speedF < 0.1f && i_this->timers[0] == 0) { + i_this->action = ACTION_NORMAL; + i_this->mode = 0; + } + break; + } + + if (actor->argument == 1) { + spA = l_HIO.donketsu_angle; + } + + cLib_addCalcAngleS2(&actor->current.angle.y, i_this->target_ya, 1, spA); + cLib_addCalc2(&actor->speedF, move_speed, 1.0f, var_f30); } /* 807211CC-807212C8 0018EC 00FC+00 1/1 0/0 0/0 .text e_mm_defence__FP10e_mm_class */ -static void e_mm_defence(e_mm_class* param_0) { - // NONMATCHING +static void e_mm_defence(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + cXyz sp14; + cXyz sp8; + + switch (i_this->mode) { + case 0: + if (actor->argument == 1) { + anm_init(i_this, 5, 3.0f, 2, 0.5f); + } else { + anm_init(i_this, 5, 3.0f, 2, 1.0f); + } + + i_this->mode = 1; + i_this->timers[0] = 30; + break; + case 1: + if (i_this->timers[0] == 0 && !i_this->modelMorf->isStop()) { + i_this->action = ACTION_DASH; + i_this->mode = 0; + } + break; + } + + cLib_addCalc0(&actor->speedF, 1.0f, 3.0f); } /* 807212C8-807213BC 0019E8 00F4+00 1/1 0/0 0/0 .text e_mm_magne_wait__FP10e_mm_class */ -static void e_mm_magne_wait(e_mm_class* param_0) { - // NONMATCHING +static void e_mm_magne_wait(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + cXyz sp18; + cXyz spC; + + switch (i_this->mode) { + case 0: + if ((int)i_this->modelMorf->getFrame() == 16) { + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_SURPRISE, -1); + } + + if (i_this->modelMorf->isStop()) { + i_this->action = ACTION_NORMAL; + i_this->mode = 0; + i_this->timers[0] = 0; + anm_init(i_this, 0xE, 20.0f, 2, 1.0f); + } + } + + cLib_addCalc0(&actor->speedF, 1.0f, 3.0f); } /* 807213BC-80721538 001ADC 017C+00 1/1 0/0 0/0 .text e_mm_turn__FP10e_mm_class */ -static void e_mm_turn(e_mm_class* param_0) { - // NONMATCHING +static void e_mm_turn(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + + cLib_addCalcAngleS2(&actor->current.angle.y, i_this->target_ya, 8, 0x200); + + if ((int)i_this->modelMorf->getFrame() == 9 || (int)i_this->modelMorf->getFrame() == 19) { + u32 var_r27 = 1; + if (i_this->field_0x672 == 0) { + var_r27 = 2; + } + + if (!i_this->acch.ChkWaterHit()) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_WALK_LND, var_r27, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_EN_MM_WALK_WTR, var_r27, -1); + } + } + + if (BREG_S(1) != 0) { + OS_REPORT("abs ( actor->current.angle.sy - i_this->target_ya ) %x\n", abs ( actor->current.angle.y - i_this->target_ya )); + } + + if (abs(actor->current.angle.y - i_this->target_ya) < 0x400) { + if (!way_gake_check(i_this)) { + i_this->mode = 1; + i_this->timers[0] = 50.0f + cM_rndF(100.0f); + anm_init(i_this, 8, 10.0f, 2, 1.0f); + i_this->action = ACTION_NORMAL; + return; + } + + i_this->target_ya += 0x2000; + } + + cLib_addCalc0(&actor->speedF, 1.0f, 3.0f); } /* 80721538-807217F4 001C58 02BC+00 1/1 0/0 0/0 .text e_mm_damage__FP10e_mm_class */ -static void e_mm_damage(e_mm_class* param_0) { - // NONMATCHING +static void e_mm_damage(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + + switch (i_this->mode) { + case 0: + anm_init(i_this, 6, 3.0f, 0, 1.0f); + i_this->mode = 1; + break; + case 1: + if ((int)i_this->modelMorf->getFrame() == 25) { + if (!i_this->acch.ChkWaterHit()) { + i_this->sound.startCreatureSound(Z2SE_CM_BODYFALL_S, 0, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_CM_BODYFALL_ASASE_S, 0, -1); + } + + if (i_this->acch.ChkWaterHit()) { + mGround_WaterEffSet(i_this); + } + } + + if (i_this->modelMorf->isStop()) { + i_this->timers[0] = 18; + i_this->mode = 2; + } + break; + case 2: + if (i_this->timers[0] == 0) { + i_this->field_0x672 = 0; + + fopAc_ac_c* armor_actor; + if (actor->argument == 1 && fopAcM_SearchByID(i_this->armorChildId, &armor_actor) && armor_actor != NULL) { + fopAcM_delete(armor_actor); + } + + if (actor->argument == 1) { + fopAcM_createDisappear(actor, &actor->current.pos, 8.0f * actor->scale.x, 0, 0x25); + } else { + fopAcM_createDisappear(actor, &actor->current.pos, 8.0f * actor->scale.x, 0, 0x14); + } + + if (i_this->bitSw != 0xFF) { + fopAcM_onSwitch(actor, i_this->bitSw); + } + + fopAcM_delete(actor); + } + break; + case 3: + anm_init(i_this, 4, 3.0f, 0, 1.0f); + i_this->mode = 4; + break; + case 4: + if (i_this->modelMorf->isStop()) { + i_this->field_0xb99 ^= 8; + i_this->action = ACTION_DASH; + i_this->mode = 0; + } + break; + } + + cLib_addCalcAngleS2(&actor->current.angle.y, i_this->field_0x6ac, 2, 0x800); } /* 807217F4-80721D44 001F14 0550+00 2/1 0/0 0/0 .text action__FP10e_mm_class */ -static void action(e_mm_class* param_0) { - // NONMATCHING +static void action(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + cXyz sp40; + cXyz sp34; + + i_this->angle_to_pl = fopAcM_searchPlayerAngleY(actor); + i_this->dist_to_pl = fopAcM_searchPlayerDistance(actor); + + if (i_this->field_0x672 != 0) { + damage_checkMetOn(i_this); + } else { + damage_check(i_this); + } + + i_this->field_0xb98 = 0; + BOOL sp30 = FALSE; + + switch (i_this->action) { + case ACTION_NORMAL: + e_mm_normal(i_this); + break; + case ACTION_DASH: + e_mm_dash(i_this); + sp30 = TRUE; + break; + case ACTION_DEFENCE: + e_mm_defence(i_this); + break; + case ACTION_MAGNE_WAIT: + e_mm_magne_wait(i_this); + break; + case ACTION_TURN: + e_mm_turn(i_this); + break; + case ACTION_DAMAGE: + e_mm_damage(i_this); + break; + } + + i_this->sound.setLinkSearch(sp30); + + cXyz* cc_move_p = i_this->ccStts.GetCCMoveP(); + if (cc_move_p != NULL) { + actor->current.pos.x += cc_move_p->x; + actor->current.pos.y += cc_move_p->y; + actor->current.pos.z += cc_move_p->z; + } + + cMtx_YrotS(*calc_mtx, actor->current.angle.y); + + sp40.x = 0.0f; + sp40.y = 0.0f; + sp40.z = actor->speedF * actor->scale.x; + MtxPosition(&sp40, &sp34); + actor->speed.x = sp34.x; + actor->speed.z = sp34.z; + actor->speed.y -= 3.0f; + actor->current.pos += actor->speed; + + if (i_this->field_0x6a8 > 0.1f) { + sp40.x = 0.0f; + sp40.y = 0.0f; + sp40.z = -i_this->field_0x6a8; + cMtx_YrotS(*calc_mtx, i_this->field_0x6ac); + MtxPosition(&sp40, &sp34); + actor->current.pos += sp34; + + cLib_addCalc0(&i_this->field_0x6a8, 1.0f, 3.0f + TREG_F(12)); + } + + cLib_addCalcAngleS2(&actor->shape_angle.y, actor->current.angle.y, 4, 0x1000); + actor->shape_angle.x = actor->current.angle.x; + i_this->acchcir.SetWall(50.0f, 80.0f); + actor->current.pos += i_this->field_0x674; + i_this->acch.CrrPos(dComIfG_Bgsp()); + + if (actor->health > 1) { + if (-G_CM3D_F_INF == i_this->acch.GetGroundH()) { + if (actor->current.pos.y < actor->home.pos.y - 3000.0f) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_FALL_LND, 0, -1); + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_DEAD, -1); + + i_this->field_0x6a8 = 0.0f; + actor->speedF = 0.0f; + actor->health = 0; + + fopAc_ac_c* armor_actor; + if (i_this->field_0x672 != 0 && fopAcM_SearchByID(i_this->armorChildId, &armor_actor) && armor_actor != NULL) { + fopAcM_delete(armor_actor); + } + + fopAcM_createDisappear(actor, &actor->current.pos, 8.0f * actor->scale.x, 0, 0xFF); + + if (i_this->bitSw != 0xFF) { + fopAcM_onSwitch(actor, i_this->bitSw); + } + + fopAcM_delete(actor); + } + } else if (i_this->acch.ChkWaterHit() && i_this->acch.m_wtr.GetHeight() - 50.0f > actor->current.pos.y) { + i_this->action = 10; + i_this->mode = 0; + i_this->sound.startCreatureSound(Z2SE_EN_MM_FALL_WTR, 0, -1); + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_DEAD, -1); + mGround_WaterEffSet(i_this); + i_this->field_0x6a8 = 0.0f; + actor->speedF = 0.0f; + actor->health = 0; + return; + } + + if (i_this->acch.ChkGroundHit()) { + if (i_this->field_0x698 - 500.0f > actor->current.pos.y) { + i_this->action = ACTION_DAMAGE; + i_this->mode = 0; + i_this->sound.startCreatureSound(Z2SE_EN_MM_FALL_LND, 0, -1); + i_this->sound.startCreatureVoice(Z2SE_EN_MM_V_DEAD, -1); + i_this->field_0x6a8 = 0.0f; + actor->speedF = 0.0f; + actor->health = 0; + } else if (i_this->field_0x698 - 100.0f > actor->current.pos.y) { + if (!i_this->acch.ChkWaterHit()) { + i_this->sound.startCreatureSound(Z2SE_EN_MM_FALL_LND, 0, -1); + } else { + i_this->sound.startCreatureSound(Z2SE_EN_MM_FALL_WTR, 0, -1); + } + + mGround_WaterEffSet(i_this); + } + + i_this->field_0x698 = actor->current.pos.y; + } + } } -/* ############################################################################################## */ -/* 80722CD4-80722CD8 000098 0004+00 0/0 0/0 0/0 .rodata @4618 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4618 = 80.0f; -COMPILER_STRIP_GATE(0x80722CD4, &lit_4618); -#pragma pop - -/* 80722CD8-80722CDC 00009C 0004+00 0/0 0/0 0/0 .rodata @4619 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4619 = 3000.0f; -COMPILER_STRIP_GATE(0x80722CD8, &lit_4619); -#pragma pop - -/* 80722CDC-80722CE0 0000A0 0004+00 0/0 0/0 0/0 .rodata @4620 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4620 = 500.0f; -COMPILER_STRIP_GATE(0x80722CDC, &lit_4620); -#pragma pop - -/* 80722CE0-80722CE4 0000A4 0004+00 1/1 0/0 0/0 .rodata @4701 */ -SECTION_RODATA static f32 const lit_4701 = 35353.0f; -COMPILER_STRIP_GATE(0x80722CE0, &lit_4701); - /* 80721D44-80722004 002464 02C0+00 2/1 0/0 0/0 .text daE_MM_Execute__FP10e_mm_class */ -static void daE_MM_Execute(e_mm_class* param_0) { - // NONMATCHING +static int daE_MM_Execute(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; + cXyz sp20; + cXyz sp14; + + if (actor->argument == 1) { + actor->scale.set(l_HIO.donketsu_base_size, l_HIO.donketsu_base_size, l_HIO.donketsu_base_size); + fopAc_ac_c* armor_actor; + if (i_this->armorChildId != 0 && fopAcM_SearchByID(i_this->armorChildId, &armor_actor) && armor_actor != NULL) { + armor_actor->scale.set(l_HIO.donketsu_base_size, l_HIO.donketsu_base_size, l_HIO.donketsu_base_size); + } + } + + i_this->lifetime++; + + for (int i = 0; i < 4; i++) { + if (i_this->timers[i] != 0) { + i_this->timers[i]--; + } + } + + if (i_this->field_0x6a4 != 0) { + i_this->field_0x6a4--; + } + + action(i_this); + + mDoMtx_stack_c::transS(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z); + mDoMtx_stack_c::YrotM(actor->shape_angle.y); + mDoMtx_stack_c::XrotM(actor->shape_angle.x); + mDoMtx_stack_c::scaleM(actor->scale.x, actor->scale.y, actor->scale.z); + + J3DModel* model = i_this->modelMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + + int sp8 = 0; + if (actor->argument == 1) { + sp8 = 3; + } + + i_this->modelMorf->play(sp8, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + i_this->modelMorf->modelCalc(); + + actor->eyePos = actor->current.pos; + actor->eyePos.y += (40.0f + JREG_F(2)) * actor->scale.x; + actor->attention_info.position = actor->eyePos; + actor->attention_info.position.y += 40.0f * actor->scale.x; + + if (i_this->field_0x672 == 0) { + sp14 = actor->current.pos; + sp14.y += (40.0f + JREG_F(4)) * actor->scale.x; + + if (i_this->field_0x6a4 != 0) { + sp14.x += 35353.0f; + } + + i_this->ccSph.SetC(sp14); + i_this->ccSph.SetR((40.0f + JREG_F(3)) * actor->scale.x); + dComIfG_Ccsp()->Set(&i_this->ccSph); + + i_this->ccWindSph.SetC(sp14); + i_this->ccWindSph.SetR((40.0f + JREG_F(3)) * actor->scale.x); + dComIfG_Ccsp()->Set(&i_this->ccWindSph); + + if (i_this->field_0xb98 != 0) { + i_this->ccSph.OnAtSetBit(); + } else { + i_this->ccSph.OffAtSetBit(); + } + } + + return 1; } /* 80722004-8072200C 002724 0008+00 1/0 0/0 0/0 .text daE_MM_IsDelete__FP10e_mm_class */ -static bool daE_MM_IsDelete(e_mm_class* param_0) { - return true; +static int daE_MM_IsDelete(e_mm_class* i_this) { + return 1; } /* 8072200C-80722080 00272C 0074+00 1/0 0/0 0/0 .text daE_MM_Delete__FP10e_mm_class */ -static void daE_MM_Delete(e_mm_class* param_0) { - // NONMATCHING -} +static int daE_MM_Delete(e_mm_class* i_this) { + fopAc_ac_c* actor = &i_this->enemy; -/* 80722080-8072218C 0027A0 010C+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -static void useHeapInit(fopAc_ac_c* param_0) { - // NONMATCHING -} + fopAcM_GetID(actor); + dComIfG_resDelete(&i_this->phase, "E_MM"); -/* ############################################################################################## */ -/* 80722CE4-80722CE8 0000A8 0004+00 1/1 0/0 0/0 .rodata @4886 */ -SECTION_RODATA static f32 const lit_4886 = 60.0f; -COMPILER_STRIP_GATE(0x80722CE4, &lit_4886); + if (i_this->field_0xc00) { + l_HIOInit = 0; + } -/* 80722CE8-80722CE8 0000AC 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80722CED = "E_mm"; -#pragma pop + if (actor->heap != NULL) { + i_this->sound.deleteObject(); + } -/* 8072218C-8072256C 0028AC 03E0+00 1/0 0/0 0/0 .text daE_MM_Create__FP10fopAc_ac_c */ -static void daE_MM_Create(fopAc_ac_c* param_0) { - // NONMATCHING -} - -/* 8072256C-807225B4 002C8C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -// cM3dGSph::~cM3dGSph() { -extern "C" void __dt__8cM3dGSphFv() { - // NONMATCHING -} - -/* 807225B4-807225FC 002CD4 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 807225FC-80722658 002D1C 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING + return 1; } -/* 80722658-807226C8 002D78 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING -} +/* 80722080-8072218C 0027A0 010C+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ +static int useHeapInit(fopAc_ac_c* i_this) { + e_mm_class* a_this = (e_mm_class*)i_this; -/* 807226C8-80722738 002DE8 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING -} + int bmd_index = 0x13; + if (i_this->argument == 1) { + bmd_index = 0x12; + } -/* 80722738-80722780 002E58 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} + a_this->modelMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_MM", bmd_index), NULL, NULL, (J3DAnmTransform*)dComIfG_getObjectRes("E_MM", 0xD), 2, 1.0f, 0, -1, &a_this->sound, 0x80000, 0x11000084); + if (a_this->modelMorf == NULL || a_this->modelMorf->getModel() == NULL) { + return 0; + } -/* 80722780-807227C8 002EA0 0048+00 2/1 0/0 0/0 .text __dt__12daE_MM_HIO_cFv */ -daE_MM_HIO_c::~daE_MM_HIO_c() { - // NONMATCHING + return 1; } -/* 807227C8-80722804 002EE8 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_mm_cpp */ -void __sinit_d_a_e_mm_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x807227C8, __sinit_d_a_e_mm_cpp); -#pragma pop - -/* 80722804-8072280C 002F24 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_80722804() { - // NONMATCHING +/* 8072218C-8072256C 0028AC 03E0+00 1/0 0/0 0/0 .text daE_MM_Create__FP10fopAc_ac_c */ +static int daE_MM_Create(fopAc_ac_c* actor) { + fopAcM_SetupActor(actor, e_mm_class); + e_mm_class* i_this = (e_mm_class*)actor; + + int phase_state = dComIfG_resLoad(&i_this->phase, "E_MM"); + if (phase_state == cPhs_COMPLEATE_e) { + OS_REPORT("E_MM PARAM %x\n", fopAcM_GetParam(actor)); + i_this->field_0x5b4 = fopAcM_GetParam(actor); + i_this->bitSw = (fopAcM_GetParam(actor) & 0xFF00) >> 8; + + if (i_this->bitSw != 0xFF && fopAcM_isSwitch(actor, i_this->bitSw)) { + return cPhs_ERROR_e; + } + + OS_REPORT("E_MM・i_this->bitSw %x\n", i_this->bitSw); + OS_REPORT("E_MM//////////////E_MM SET 1 !!\n"); + + u32 heap_size = 0x1AF0; + if (actor->argument == 1) { + heap_size = 0x1BB0; + } + + if (!fopAcM_entrySolidHeap(actor, useHeapInit, heap_size)) { + OS_REPORT("//////////////E_MM SET NON !!\n"); + return cPhs_ERROR_e; + } + + OS_REPORT("//////////////E_MM SET 2 !!\n"); + + if (!l_HIOInit) { + i_this->field_0xc00 = TRUE; + l_HIOInit = TRUE; + l_HIO.id = mDoHIO_CREATE_CHILD("マグネメット", &l_HIO); + } + + actor->attention_info.flags = fopAc_AttnFlag_BATTLE_e; + fopAcM_SetMtx(actor, i_this->modelMorf->getModel()->getBaseTRMtx()); + + i_this->ccStts.Init(100, 0, actor); + + actor->health = 20; + actor->field_0x560 = 20; + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0xd}, {0xd8fbfdff, 0x43}, 0x75}}, // mObj + {dCcD_SE_SOFT_BODY, 0x0, 0x1, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x406}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph cc_wind_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0x200, 0x11}, 0x0}}, // mObj + {dCcD_SE_SOFT_BODY, 0x0, 0x1, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x4}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph + } // mSphAttr + }; + + i_this->ccSph.Set(cc_sph_src); + i_this->ccSph.SetStts(&i_this->ccStts); + i_this->ccWindSph.Set(cc_wind_sph_src); + i_this->ccWindSph.SetStts(&i_this->ccStts); + + i_this->acch.Set(fopAcM_GetPosition_p(actor), fopAcM_GetOldPosition_p(actor), actor, 1, &i_this->acchcir, fopAcM_GetSpeed_p(actor), NULL, NULL); + i_this->acchcir.SetWall(50.0f, 60.0f); + + i_this->field_0x698 = actor->current.pos.y; + i_this->sound.init(&actor->current.pos, &actor->eyePos, 3, 1); + i_this->sound.setEnemyName("E_mm"); + i_this->atInfo.mpSound = &i_this->sound; + i_this->atInfo.mPowerType = 9; + + if (BREG_S(0) != 0) { + actor->argument = 1; + } + + if (actor->argument == 1) { + i_this->ccStts.SetWeight(254); + i_this->ccSph.SetAtAtp(2); + + actor->scale.set(l_HIO.donketsu_base_size, l_HIO.donketsu_base_size, l_HIO.donketsu_base_size); + actor->health = 40; + actor->field_0x560 = 40; + } else { + i_this->ccStts.SetWeight(200); + actor->scale.set(l_HIO.base_size, l_HIO.base_size, l_HIO.base_size); + } + + i_this->armorChildId = fopAcM_createChild(PROC_E_MM_MT, fopAcM_GetID(actor), 0, &actor->current.pos, fopAcM_GetRoomNo(actor), &actor->shape_angle, &actor->scale, actor->argument, NULL); + i_this->field_0x672 = 1; + + daE_MM_Execute(i_this); + } + + return phase_state; } -/* 8072280C-80722814 002F2C 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_8072280C() { - // NONMATCHING -} +/* 80722DEC-80722E0C -00001 0020+00 1/0 0/0 0/0 .data l_daE_MM_Method */ +static actor_method_class l_daE_MM_Method = { + (process_method_func)daE_MM_Create, + (process_method_func)daE_MM_Delete, + (process_method_func)daE_MM_Execute, + (process_method_func)daE_MM_IsDelete, + (process_method_func)daE_MM_Draw, +}; -/* 80722CE8-80722CE8 0000AC 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 80722E0C-80722E3C -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_MM */ +extern actor_process_profile_definition g_profile_E_MM = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_E_MM, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(e_mm_class), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 167, // mPriority + &l_daE_MM_Method, // sub_method + 0x00040120, // mStatus + fopAc_ENEMY_e, // mActorType + fopAc_CULLBOX_0_e, // cullType +}; |
