diff --git a/include/d/actor/d_a_e_mk.h b/include/d/actor/d_a_e_mk.h index 84a8799b260..2fdb4e9cda7 100644 --- a/include/d/actor/d_a_e_mk.h +++ b/include/d/actor/d_a_e_mk.h @@ -1,6 +1,5 @@ #ifndef D_A_E_MK_H #define D_A_E_MK_H -#include "d/actor/d_a_b_bh.h" #include "d/actor/d_a_e_db.h" #include "d/actor/d_a_obj_pillar.h" #include "d/d_bg_s_acch.h" @@ -17,7 +16,7 @@ * @details * */ -class e_mk_class : public fopEn_enemy_c { +class e_mk_class { public: /* 8071C190 */ e_mk_class() {} @@ -33,6 +32,7 @@ public: ACT_R04_DEMO = 35, }; + /* 0x000 */ fopEn_enemy_c enemy; /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ s16 mMode; /* 0x5B6 */ u8 field_0x5b6; diff --git a/src/d/actor/d_a_e_mk.cpp b/src/d/actor/d_a_e_mk.cpp index 3f68882b641..ac0d67bd778 100644 --- a/src/d/actor/d_a_e_mk.cpp +++ b/src/d/actor/d_a_e_mk.cpp @@ -17,7 +17,7 @@ #include "d/d_camera.h" #include "Z2AudioLib/Z2Instances.h" -UNK_REL_BSS +UNK_REL_BSS; /* 8071412C-8071417C 0000EC 0050+00 1/1 0/0 0/0 .text __ct__12daE_MK_HIO_cFv */ daE_MK_HIO_c::daE_MK_HIO_c() { @@ -47,38 +47,38 @@ static void ok_anm_init(e_mk_class* i_this, int i_index, f32 i_morf, u8 i_mode, /* 807142D0-80714498 000290 01C8+00 1/0 0/0 0/0 .text daE_MK_Draw__FP10e_mk_class */ static int daE_MK_Draw(e_mk_class* i_this) { J3DModel* model = i_this->mpModelMorf->getModel(); - g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr); - g_env_light.setLightTevColorType_MAJI(model, &i_this->tevStr); + g_env_light.settingTevStruct(0, &i_this->enemy.current.pos, &i_this->enemy.tevStr); + g_env_light.setLightTevColorType_MAJI(model, &i_this->enemy.tevStr); J3DModelData* modelData = model->getModelData(); i_this->mBtp->entry(modelData); i_this->mpModelMorf->entryDL(); cXyz sp38; if (i_this->field_0x6f8 != 0) { - sp38.set(i_this->current.pos.x, i_this->current.pos.y + 50.0f, i_this->current.pos.z); + sp38.set(i_this->enemy.current.pos.x, i_this->enemy.current.pos.y + 50.0f, i_this->enemy.current.pos.z); i_this->mShadowKey1 = dComIfGd_setShadow(i_this->mShadowKey1, 1, model, &sp38, - 1200.0f, 0.0f, i_this->current.pos.y, + 1200.0f, 0.0f, i_this->enemy.current.pos.y, i_this->mAcch.GetGroundH(), i_this->mAcch.m_gnd, - &i_this->tevStr, 0, 1.0f, + &i_this->enemy.tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); } if (i_this->field_0x60c != 0) { model = i_this->mpCrownModelMorf->getModel(); - g_env_light.setLightTevColorType_MAJI(model, &i_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model, &i_this->enemy.tevStr); i_this->mpCrownModelMorf->entryDL(); if (i_this->field_0x5e0 != 0) { - sp38.set(i_this->field_0x5e4.x, i_this->current.pos.y + 50.0f, i_this->field_0x5e4.z); + sp38.set(i_this->field_0x5e4.x, i_this->enemy.current.pos.y + 50.0f, i_this->field_0x5e4.z); i_this->mShadowKey2 = dComIfGd_setShadow(i_this->mShadowKey2, 1, i_this->mpCrownModelMorf->getModel(), - &sp38, 500.0f, 0.0f, i_this->current.pos.y, + &sp38, 500.0f, 0.0f, i_this->enemy.current.pos.y, i_this->mAcch.GetGroundH(), i_this->mAcch.m_gnd, - &i_this->tevStr, 0, 1.0f, + &i_this->enemy.tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); } } if (i_this->field_0x60d != 0) { - g_env_light.setLightTevColorType_MAJI(i_this->mpBoomerangModel, &i_this->tevStr); + g_env_light.setLightTevColorType_MAJI(i_this->mpBoomerangModel, &i_this->enemy.tevStr); mDoExt_modelUpdateDL(i_this->mpBoomerangModel); } @@ -99,13 +99,13 @@ static void* s_obj_delete(void* i_actor, void* i_data) { } /* 8071CAB4-8071CAC0 000054 000C+00 0/2 0/0 0/0 .bss demo_jump_pos_1 */ -static cXyz demo_jump_pos_1; +static cXyz demo_jump_pos_1(1050.0f, 500.0f, -450.0f); /* 8071CACC-8071CAD8 00006C 000C+00 0/2 0/0 0/0 .bss demo_jump_pos_2 */ -static cXyz demo_jump_pos_2; +static cXyz demo_jump_pos_2(1262.0f, 1030.0f, -1665.0f); /* 8071CAE4-8071CAF0 000084 000C+00 0/2 0/0 0/0 .bss demo_jump_pos_3 */ -static cXyz demo_jump_pos_3; +static cXyz demo_jump_pos_3(2400.0f, 1115.0f, -1850.0f); /* 8071CAFC-8071CB08 00009C 000C+00 1/6 0/0 0/0 .bss STAGE_CENTER_POS */ static cXyz STAGE_CENTER_POS; @@ -158,10 +158,10 @@ static daPillar_c* search_hasira(e_mk_class* i_this) { int i = 0; while (i < target_info_count) { pPillar = (daPillar_c*)target_info[i]; - sp44 = pPillar->current.pos - i_this->current.pos; + sp44 = pPillar->current.pos - i_this->enemy.current.pos; f32 fVar2 = sp44.abs(); if (fVar2 > 700.0f && fVar2 < fVar1) { - s16 sVar1 = i_this->current.angle.y - cM_atan2s(sp44.x, sp44.z); + s16 sVar1 = i_this->enemy.current.angle.y - cM_atan2s(sp44.x, sp44.z); if (sVar1 < 0x7000 && sVar1 > -0x7000) { if (iVar1 == 0 || cM_rndF(1.0f) < 0.3f) { rv = pPillar; @@ -216,7 +216,7 @@ static e_db_class* search_db(e_mk_class* i_this) { int i = 0; while (i < target_info_count) { pDekuBaba = (e_db_class*)target_info[i]; - sp44 = pDekuBaba->current.pos - i_this->current.pos; + sp44 = pDekuBaba->current.pos - i_this->enemy.current.pos; f32 fVar2 = sp44.abs(); if ((cM_rndF(1.0f) < 0.5f && fVar2 > 500.0f) && fVar2 < fVar1) { @@ -241,7 +241,6 @@ static e_db_class* search_db(e_mk_class* i_this) { /* 80714B78-807154A8 000B38 0930+00 2/1 0/0 0/0 .text e_mk_move__FP10e_mk_class */ static void e_mk_move(e_mk_class* i_this) { - // NONMATCHING cXyz sp28; int frame = i_this->mpModelMorf->getFrame(); switch(i_this->mMode) { @@ -251,7 +250,7 @@ static void e_mk_move(e_mk_class* i_this) { // fallthrough case 1: i_this->field_0x6dc.set(0.0f, 0.0f, 0.0f); - i_this->speed.set(0.0f, 0.0f, 0.0f); + i_this->enemy.speed.set(0.0f, 0.0f, 0.0f); if (i_this->field_0xc30 == 2) { i_this->mPillar = NULL; target_info_count = 0; @@ -268,16 +267,16 @@ static void e_mk_move(e_mk_class* i_this) { } else { i_this->mAction = e_mk_class::ACT_E_DEMO; i_this->mMode = 100; - i_this->gravity = 0.0f; - i_this->scale.x = 1.0f; + i_this->enemy.gravity = 0.0f; + i_this->enemy.scale.x = 1.0f; return; } i_this->field_0x71e++; i_this->field_0x5b8 = STAGE_CENTER_POS + sp28; - sp28 = i_this->field_0x5b8 - i_this->current.pos; - i_this->current.angle.y = cM_atan2s(sp28.x, sp28.z); - i_this->current.angle.x = -cM_atan2s(sp28.y, JMAFastSqrt(sp28.x * sp28.x + sp28.z * sp28.z)); + sp28 = i_this->field_0x5b8 - i_this->enemy.current.pos; + i_this->enemy.current.angle.y = cM_atan2s(sp28.x, sp28.z); + i_this->enemy.current.angle.x = -cM_atan2s(sp28.y, JMAFastSqrt(sp28.x * sp28.x + sp28.z * sp28.z)); anm_init(i_this, 29, 5.0f, 0, 1.0f); i_this->mMode = 3; } else { @@ -298,9 +297,9 @@ static void e_mk_move(e_mk_class* i_this) { i_this->field_0x5b8.y = fopAcM_gc_c::getGroundY(); } - sp28 = i_this->field_0x5b8 - i_this->current.pos; - i_this->current.angle.y = cM_atan2s(sp28.x, sp28.z); - i_this->current.angle.x = -cM_atan2s(sp28.y, JMAFastSqrt(sp28.x * sp28.x + sp28.z * sp28.z)); + sp28 = i_this->field_0x5b8 - i_this->enemy.current.pos; + i_this->enemy.current.angle.y = cM_atan2s(sp28.x, sp28.z); + i_this->enemy.current.angle.x = -cM_atan2s(sp28.y, JMAFastSqrt(sp28.x * sp28.x + sp28.z * sp28.z)); anm_init(i_this, 29, 5.0f, 0, 1.0f); i_this->mMode++; } @@ -309,14 +308,14 @@ static void e_mk_move(e_mk_class* i_this) { case 3: if (frame == 9) { - cMtx_YrotS(*calc_mtx, i_this->current.angle.y); - cMtx_XrotM(*calc_mtx, i_this->current.angle.x); + cMtx_YrotS(*calc_mtx, i_this->enemy.current.angle.y); + cMtx_XrotM(*calc_mtx, i_this->enemy.current.angle.x); sp28.x = 0.0f; sp28.y = 0.0f; sp28.z = 70.0f; - MtxPosition(&sp28, &i_this->speed); + MtxPosition(&sp28, &i_this->enemy.speed); i_this->field_0x6be = 1; - i_this->field_0x6c0 = i_this->current.pos; + i_this->field_0x6c0 = i_this->enemy.current.pos; i_this->field_0x6cc = i_this->field_0x5b8; i_this->mSound.startCreatureVoice(Z2SE_EN_MK_V_JUMP, -1); @@ -328,7 +327,7 @@ static void e_mk_move(e_mk_class* i_this) { if (i_this->mPillar != NULL) { sp28 = i_this->mPillar->current.pos; sp28.y += 500.0f; - sp28 -= i_this->current.pos; + sp28 -= i_this->enemy.current.pos; if (sp28.abs() < 200.0f) { i_this->mPillar->setShake(2); } @@ -342,12 +341,12 @@ static void e_mk_move(e_mk_class* i_this) { break; case 4: - sp28 = i_this->field_0x5b8 - i_this->current.pos; + sp28 = i_this->field_0x5b8 - i_this->enemy.current.pos; if (sp28.abs() < 300.0f) { anm_init(i_this, 26, 2.0f, 0, 1.0f); i_this->mMode++; - i_this->field_0x6dc = i_this->speed; - i_this->speed.set(0.0f, 0.0f, 0.0f); + i_this->field_0x6dc = i_this->enemy.speed; + i_this->enemy.speed.set(0.0f, 0.0f, 0.0f); } break; @@ -393,9 +392,9 @@ static void e_mk_move(e_mk_class* i_this) { } - cLib_addCalc2(&i_this->current.pos.x, i_this->field_0x5b8.x, 1.0f, fabsf(i_this->field_0x6dc.x)); - cLib_addCalc2(&i_this->current.pos.z, i_this->field_0x5b8.z, 1.0f, fabsf(i_this->field_0x6dc.z)); - cLib_addCalc2(&i_this->current.pos.y, i_this->field_0x5b8.y, 1.0f, fabsf(i_this->field_0x6dc.y)); + cLib_addCalc2(&i_this->enemy.current.pos.x, i_this->field_0x5b8.x, 1.0f, fabsf(i_this->field_0x6dc.x)); + cLib_addCalc2(&i_this->enemy.current.pos.z, i_this->field_0x5b8.z, 1.0f, fabsf(i_this->field_0x6dc.z)); + cLib_addCalc2(&i_this->enemy.current.pos.y, i_this->field_0x5b8.y, 1.0f, fabsf(i_this->field_0x6dc.y)); } /* 807154A8-80715618 001468 0170+00 1/1 0/0 0/0 .text e_mk_wait__FP10e_mk_class */ @@ -426,7 +425,7 @@ static void e_mk_wait(e_mk_class* i_this) { } } - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleToPlayer, 2, 0x1000); + cLib_addCalcAngleS2(&i_this->enemy.current.angle.y, i_this->mAngleToPlayer, 2, 0x1000); if (i_this->mDistToPlayer < 800.0f) { i_this->mAction = e_mk_class::ACT_MOVE; i_this->mMode = 0; @@ -435,7 +434,6 @@ static void e_mk_wait(e_mk_class* i_this) { /* 80715618-80715B18 0015D8 0500+00 2/1 0/0 0/0 .text e_mk_shoot__FP10e_mk_class */ static void e_mk_shoot(e_mk_class* i_this) { - // NONMATCHING cXyz sp48; int frame = i_this->mpModelMorf->getFrame(); fopAc_ac_c *actor = fopAcM_SearchByID(i_this->field_0x708); @@ -459,7 +457,7 @@ static void e_mk_shoot(e_mk_class* i_this) { break; case 2: - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleToPlayer, 2, 0x1000); + cLib_addCalcAngleS2(&i_this->enemy.current.angle.y, i_this->mAngleToPlayer, 2, 0x1000); if (i_this->mpModelMorf->checkFrame(15.0f)) { i_this->mSound.startCreatureVoice(Z2SE_EN_MK_V_THROW_BOOM, -1); @@ -493,8 +491,8 @@ static void e_mk_shoot(e_mk_class* i_this) { break; case 10: - sp48 = i_this->field_0x70c->current.pos - i_this->current.pos; - cLib_addCalcAngleS2(&i_this->current.angle.y, cM_atan2s(sp48.x, sp48.z), 2, 0x1000); + sp48 = i_this->field_0x70c->current.pos - i_this->enemy.current.pos; + cLib_addCalcAngleS2(&i_this->enemy.current.angle.y, cM_atan2s(sp48.x, sp48.z), 2, 0x1000); if (i_this->mpModelMorf->checkFrame(15.0f)) { i_this->mSound.startCreatureVoice(Z2SE_EN_MK_V_THROW_BOOM, -1); } @@ -527,8 +525,8 @@ static void e_mk_shoot(e_mk_class* i_this) { if (bVar5 != 0) { if ((bVar5 == 2) && (actor != NULL)) { - cXyz sp54 = actor->current.pos - i_this->current.pos; - cLib_addCalcAngleS2(&i_this->current.angle.y, cM_atan2s(sp54.x,sp54.z), 2, 0x800); + cXyz sp54 = actor->current.pos - i_this->enemy.current.pos; + cLib_addCalcAngleS2(&i_this->enemy.current.angle.y, cM_atan2s(sp54.x,sp54.z), 2, 0x800); } if (bVar5 <= 2) { if (i_this->field_0x707 == 5) { @@ -631,11 +629,11 @@ static void e_mk_drop(e_mk_class* i_this) { case 0: anm_init(i_this, 23, 3.0f, 0, 1.0f); i_this->mMode = 1; - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + cMtx_YrotS(*calc_mtx, i_this->enemy.shape_angle.y); sp24.x = 0.0; sp24.y = 30.0; sp24.z = -10.0; - MtxPosition(&sp24, &i_this->speed); + MtxPosition(&sp24, &i_this->enemy.speed); i_this->field_0x704 = 50; break; @@ -666,7 +664,7 @@ static void e_mk_drop(e_mk_class* i_this) { } if (frame >= 45) { - i_this->speed.set(0.0f, 0.0f, 0.0f); + i_this->enemy.speed.set(0.0f, 0.0f, 0.0f); } if (i_this->mpModelMorf->isStop()) { @@ -696,7 +694,7 @@ static void e_mk_drop(e_mk_class* i_this) { i_this->field_0x6dc.set(0.0f, 0.0f, 0.0f); i_this->field_0x6fa = cM_rndF(3.0f) + 2.0f; i_this->field_0x718 = 1; - if (i_this->health > 100) { + if (i_this->enemy.health > 100) { Z2GetAudioMgr()->changeSubBgmStatus(2); } else { Z2GetAudioMgr()->changeSubBgmStatus(3); @@ -710,7 +708,7 @@ static void e_mk_damage(e_mk_class* i_this) { switch (i_this->mMode) { case 0: i_this->field_0x719++; - i_this->speed.set(0.0f, 0.0f, 0.0f); + i_this->enemy.speed.set(0.0f, 0.0f, 0.0f); if (i_this->field_0x719 >= 4) { anm_init(i_this, 35, 3.0f, 0, 1.0f); i_this->mAction = e_mk_class::ACT_DROP; @@ -741,14 +739,14 @@ static void damage_check(e_mk_class* i_this) { if (i_this->mAction >= 9) { if (i_this->field_0xad0.ChkTgHit()) { i_this->mAtInfo.mpCollider = i_this->field_0xad0.GetTgHitObj(); - cc_at_check(i_this, &i_this->mAtInfo); + cc_at_check(&i_this->enemy, &i_this->mAtInfo); if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK) != 0) { i_this->field_0x704 = 20; } else { i_this->field_0x704 = 10; } - if (i_this->health <= 0) { + if (i_this->enemy.health <= 0) { fpcM_Search(s_obj_delete, i_this); i_this->mAction = 30; i_this->mMode = 0; @@ -766,8 +764,8 @@ static void damage_check(e_mk_class* i_this) { } } - if (i_this->health <= 1) { - i_this->health = 0; + if (i_this->enemy.health <= 1) { + i_this->enemy.health = 0; i_this->field_0xad0.SetTgHitMark((CcG_Tg_HitMark )3); } } @@ -892,48 +890,48 @@ static int e_mk_e_demo(e_mk_class* i_this) { i_this->mMode = 1; i_this->field_0xc30 = 2; i_this->mDemoMode = 1; - dComIfGs_onSwitch(108, fopAcM_GetRoomNo(i_this)); + dComIfGs_onSwitch(108, fopAcM_GetRoomNo(&i_this->enemy)); break; case 1: if (i_this->mpModelMorf->isStop()) { anm_init(i_this, 17, 1.0f, 2, 1.0f); i_this->mMode = 2; - i_this->current.angle.y = STAGE_ANGLE_Y + -0x4000; - cMtx_YrotS(*calc_mtx,i_this->current.angle.y); + i_this->enemy.current.angle.y = STAGE_ANGLE_Y + -0x4000; + cMtx_YrotS(*calc_mtx,i_this->enemy.current.angle.y); sp38.x = 0.0; sp38.y = 0.0; sp38.z = -1000.0; MtxPosition(&sp38, &sp44); - i_this->current.pos = STAGE_CENTER_POS + sp44; - i_this->old.pos = STAGE_CENTER_POS + sp44; + i_this->enemy.current.pos = STAGE_CENTER_POS + sp44; + i_this->enemy.old.pos = STAGE_CENTER_POS + sp44; i_this->mDemoMode = 4; i_this->mDemoCamTimer = 0; - i_this->gravity = -10.0f; + i_this->enemy.gravity = -10.0f; } break; case 2: if (i_this->mAcch.ChkGroundHit()) { - i_this->speedF = 0.0f; + i_this->enemy.speedF = 0.0f; } if (frame == 1 || frame == 18) { - i_this->speed.y = 50.0f; - i_this->speedF = 30.0f; + i_this->enemy.speed.y = 50.0f; + i_this->enemy.speedF = 30.0f; i_this->mSound.startCreatureSound(Z2SE_EN_MK_JUMP_START, 0, -1); } - sp38 = STAGE_CENTER_POS - i_this->current.pos; + sp38 = STAGE_CENTER_POS - i_this->enemy.current.pos; fVar1 = JMAFastSqrt(sp38.x * sp38.x + sp38.z * sp38.z); if (fVar1 < 200.0f) { rv = 2; if (fVar1 < 100.0f) { i_this->mMode = 3; anm_init(i_this, 16, 2.0f, 0, 1.0f); - i_this->speedF = 0.0f; - i_this->gravity = 0.0f; - i_this->speed.y = 0.0f; + i_this->enemy.speedF = 0.0f; + i_this->enemy.gravity = 0.0f; + i_this->enemy.speed.y = 0.0f; i_this->field_0x6fc[0] = 40; cVar6 = 60; target_info_count = 0; @@ -954,11 +952,11 @@ static int e_mk_e_demo(e_mk_class* i_this) { } if (i_this->field_0x6fc[0] == 0) { - i_this->gravity = -0.03f; - if (i_this->speed.y < -1.0f) { + i_this->enemy.gravity = -0.03f; + if (i_this->enemy.speed.y < -1.0f) { anm_init(i_this, 14, 10.0f, 0, 1.0f); - i_this->speedF = 0.0f; - i_this->gravity = -2.0f; + i_this->enemy.speedF = 0.0f; + i_this->enemy.gravity = -2.0f; i_this->mMode = 4; } } @@ -966,19 +964,19 @@ static int e_mk_e_demo(e_mk_class* i_this) { case 4: if (i_this->mAcch.ChkGroundHit()) { - i_this->speedF = 0.0f; + i_this->enemy.speedF = 0.0f; i_this->field_0x71b = 2; cVar6 = 30; i_this->mMode = 100; i_this->field_0x5e0 = 1; ok_anm_init(i_this, 43, 1.0f, 2, 1.0f); - cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + cMtx_YrotS(*calc_mtx, i_this->enemy.current.angle.y); sp38.x = 0.0f; sp38.y = 0.0f; sp38.z = -50.0f; MtxPosition(&sp38, &sp44); i_this->field_0x5e4 += sp44; - i_this->field_0x5f0 = i_this->shape_angle; + i_this->field_0x5f0 = i_this->enemy.shape_angle; i_this->field_0x5f0.x = 0x4000; i_this->field_0x5fc = 30.0f; i_this->field_0x600 = -20.0f; @@ -1009,20 +1007,20 @@ static int e_mk_e_demo(e_mk_class* i_this) { i_this->field_0x718 = 0; i_this->field_0x6fa = 100; i_this->field_0x6dc.set(0.0f, 0.0f, 0.0f); - i_this->speed.set(0.0f, 0.0f, 0.0f); + i_this->enemy.speed.set(0.0f, 0.0f, 0.0f); i_this->field_0x5b8 = STAGE_CENTER_POS; i_this->field_0x5b8.y += 500.0f; - sp38 = i_this->field_0x5b8 - i_this->current.pos; - i_this->current.angle.y = cM_atan2s(sp38.x, sp38.z); - i_this->current.angle.x = -cM_atan2s(sp38.y, JMAFastSqrt(sp38.x * sp38.x + sp38.z * sp38.z)); - cMtx_YrotS(*calc_mtx, i_this->current.angle.y); - cMtx_XrotM(*calc_mtx, i_this->current.angle.x); + sp38 = i_this->field_0x5b8 - i_this->enemy.current.pos; + i_this->enemy.current.angle.y = cM_atan2s(sp38.x, sp38.z); + i_this->enemy.current.angle.x = -cM_atan2s(sp38.y, JMAFastSqrt(sp38.x * sp38.x + sp38.z * sp38.z)); + cMtx_YrotS(*calc_mtx, i_this->enemy.current.angle.y); + cMtx_XrotM(*calc_mtx, i_this->enemy.current.angle.x); sp38.x = 0.0; sp38.y = 0.0; sp38.z = 70.0; - MtxPosition(&sp38, &i_this->speed); + MtxPosition(&sp38, &i_this->enemy.speed); i_this->field_0x6be = 1; - i_this->field_0x6c0 = i_this->current.pos; + i_this->field_0x6c0 = i_this->enemy.current.pos; i_this->field_0x6cc = i_this->field_0x5b8; i_this->mSound.startCreatureSound(Z2SE_EN_MK_JUMP_WIND, 0, -1); i_this->mAction = e_mk_class::ACT_MOVE; @@ -1036,13 +1034,13 @@ static int e_mk_e_demo(e_mk_class* i_this) { break; } - cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + cMtx_YrotS(*calc_mtx, i_this->enemy.current.angle.y); sp38.x = 0.0f; sp38.y = 0.0f; - sp38.z = i_this->speedF; + sp38.z = i_this->enemy.speedF; MtxPosition(&sp38, &sp44); - i_this->speed.x = sp44.x; - i_this->speed.z = sp44.z; + i_this->enemy.speed.x = sp44.x; + i_this->enemy.speed.z = sp44.z; if (cVar6 != 0) { dComIfGp_getVibration().StartShock(5, 1, cXyz(0.0f, 1.0f, 0.0f)); i_this->mSound.startCreatureSound(Z2SE_EN_FM_FOOTNOTE, 0, -1); @@ -1073,7 +1071,7 @@ static void e_mk_r04_demo(e_mk_class* i_this) { case 3: fVar2 = 30.0f; - if (i_this->current.pos.z > -600.0f) { + if (i_this->enemy.current.pos.z > -600.0f) { i_this->mMode = 4; anm_init(i_this, 40, 5.0f, 2, 1.0f); i_this->field_0x6fc[0] = 0; @@ -1165,22 +1163,22 @@ static void e_mk_r04_demo(e_mk_class* i_this) { fVar2 = 30.0f; } - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->home.angle.y + (u16)-0x8000, 2, 0x1000); + cLib_addCalcAngleS2(&i_this->enemy.current.angle.y, i_this->enemy.home.angle.y + (u16)-0x8000, 2, 0x1000); break; } - cLib_addCalc2(&i_this->speedF, fVar2, 1.0f, 5.0f); - i_this->gravity = -10.0f; - cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + cLib_addCalc2(&i_this->enemy.speedF, fVar2, 1.0f, 5.0f); + i_this->enemy.gravity = -10.0f; + cMtx_YrotS(*calc_mtx, i_this->enemy.current.angle.y); cXyz sp2c, sp38; sp2c.x = 0.0f; sp2c.y = 0.0f; - sp2c.z = i_this->speedF; + sp2c.z = i_this->enemy.speedF; MtxPosition(&sp2c, &sp38); - i_this->speed.x = sp38.x; - i_this->speed.z = sp38.z; - i_this->current.pos += i_this->speed; - i_this->speed.y += i_this->gravity; + i_this->enemy.speed.x = sp38.x; + i_this->enemy.speed.z = sp38.z; + i_this->enemy.current.pos += i_this->enemy.speed; + i_this->enemy.speed.y += i_this->enemy.gravity; } /* 80717400-807174E4 0033C0 00E4+00 1/1 0/0 0/0 .text cam_3d_morf__FP10e_mk_classf */ @@ -1195,8 +1193,9 @@ static void cam_3d_morf(e_mk_class* i_this, f32 param_2) { /* 807174E4-8071823C 0034A4 0D58+00 1/1 0/0 0/0 .text demo_camera_start__FP10e_mk_class */ static void demo_camera_start(e_mk_class* i_this) { - // NONMATCHING - fopAc_ac_c *actor1, *actor2; + // EQUIVALENT - REGALLOC + fopAc_ac_c* a_this = &i_this->enemy; + fopAc_ac_c* actor1, * actor2, * actor3; daPy_py_c *player = (daPy_py_c*)dComIfGp_getPlayer(0); actor1 = fopAcM_SearchByID(i_this->field_0x708); camera_class *camera1 = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); @@ -1208,24 +1207,24 @@ static void demo_camera_start(e_mk_class* i_this) { break; case 1: - if (!i_this->eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(i_this, 2, 0xffff, 0); - i_this->eventInfo.onCondition(dEvtCnd_CANDEMO_e); + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xffff, 0); + a_this->eventInfo.onCondition(dEvtCnd_CANDEMO_e); return; } - camera1->mCamera.Stop(); + camera2->mCamera.Stop(); i_this->mDemoMode = 2; i_this->mDemoCamTimer = 0; i_this->mDemoCamFovy = 50.0f; - camera1->mCamera.SetTrimSize(3); + camera2->mCamera.SetTrimSize(3); i_this->field_0xc90 = 2500.0f; daPy_getPlayerActorClass()->changeOriginalDemo(); Z2GetAudioMgr()->bgmStreamPrepare(0x200000D); - i_this->mCamEye = camera2->mCamera.mEye; - i_this->mCamCenter = camera2->mCamera.mCenter; + i_this->mCamEye = camera1->lookat.eye; + i_this->mCamCenter = camera1->lookat.center; i_this->field_0xc50.set(-271.0f, 4559.0f, -7241.0f); i_this->field_0xc5c.set(-70.0f, 4378.0f, -6233.0f); @@ -1256,12 +1255,10 @@ static void demo_camera_start(e_mk_class* i_this) { case 3: cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); - sp34.x = 0.0f; - sp34.y = 150.0f; - sp34.z = 250.0f; + sp34.set(0.0f, 150.0f, 250.0f); MtxPosition(&sp34, &sp40); - i_this->mCamEye = i_this->current.pos + sp40; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye = a_this->current.pos + sp40; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 150.0f; if (i_this->mDemoCamTimer >= 60) { i_this->mDemoCamTimer = 0; @@ -1272,12 +1269,10 @@ static void demo_camera_start(e_mk_class* i_this) { case 4: cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); - sp34.x = 0.0f; - sp34.y = 150.0f; - sp34.z = 700.0f; + sp34.set(0.0f, 150.0f, 700.0f); MtxPosition(&sp34, &sp40); - i_this->mCamEye = i_this->current.pos + sp40; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye = a_this->current.pos + sp40; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 230.0f; if (i_this->mDemoCamTimer == 35) { @@ -1296,20 +1291,16 @@ static void demo_camera_start(e_mk_class* i_this) { sp34.y = 0.0f; sp34.z = i_this->field_0xc90; MtxPosition(&sp34, &sp4c); - sp4c += i_this->current.pos; + sp4c += a_this->current.pos; cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); - sp34.x = -300.0f; - sp34.y = 0.0f; - sp34.z = 0.0f; + sp34.set(-300.0f, 0.0f, 0.0f); MtxPosition(&sp34, &sp40); sp4c += sp40; - sp34.x = 100.0f; - sp34.y = 0.0f; - sp34.z = 200.0f; + sp34.set(100.0f, 0.0f, 200.0f); MtxPosition(&sp34, &sp40); sp40 += sp4c; sp40.y = player->current.pos.y; - player->setPlayerPosAndAngle(&sp40, i_this->current.angle.y + (u16)-0x8000, 0); + player->setPlayerPosAndAngle(&sp40, a_this->current.angle.y + (u16)-0x8000, 0); } break; @@ -1318,22 +1309,18 @@ static void demo_camera_start(e_mk_class* i_this) { i_this->field_0xc9c = 500.0f; cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); cMtx_XrotM(*calc_mtx, i_this->field_0xc9c); - sp34.x = 0.0f; - sp34.y = 0.0f; - sp34.z = 3500.0f; + sp34.set(0.0f, 0.0f, 3500.0f); MtxPosition(&sp34, &i_this->mCamCenter); - i_this->mCamCenter += i_this->current.pos; + i_this->mCamCenter += a_this->current.pos; cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); cMtx_XrotM(*calc_mtx, 2000); sp34.x = 0.0f; sp34.y = 0.0f; sp34.z = i_this->field_0xc90; MtxPosition(&sp34, &i_this->mCamEye); - i_this->mCamEye += i_this->current.pos; + i_this->mCamEye += a_this->current.pos; cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); - sp34.x = -300.0f; - sp34.y = 0.0f; - sp34.z = 0.0f; + sp34.set(-300.0f, 0.0f, 0.0f); MtxPosition(&sp34, &sp40); i_this->mCamEye += sp40; @@ -1349,12 +1336,10 @@ static void demo_camera_start(e_mk_class* i_this) { case 6: cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); - sp34.x = 0.0f; - sp34.y = 150.0f; - sp34.z = 700.0f; + sp34.set(0.0f, 150.0f, 700.0f); MtxPosition(&sp34, &sp40); - i_this->mCamEye = i_this->current.pos + sp40; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye = a_this->current.pos + sp40; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 230.0f; if (i_this->mDemoCamTimer == 2) { @@ -1364,12 +1349,10 @@ static void demo_camera_start(e_mk_class* i_this) { if (i_this->mDemoCamTimer >= 10) { i_this->mMode = 4; i_this->mDemoMode = 100; - sp34.x = 200.0f; - sp34.y = 0.0f; - sp34.z = -150.0f; + sp34.set(200.0f, 0.0f,-150.0f); MtxPosition(&sp34, &sp40); sp40 += player->current.pos; - player->setPlayerPosAndAngle(&sp40, i_this->current.angle.y + (u16)-0x8000, 0); + player->setPlayerPosAndAngle(&sp40, a_this->current.angle.y + (u16)-0x8000, 0); } break; @@ -1378,11 +1361,9 @@ static void demo_camera_start(e_mk_class* i_this) { i_this->mCamCenter = actor1->current.pos; cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); - sp34.x = 300.0f; - sp34.y = -200.0f; - sp34.z = 1000.0f; + sp34.set(300.0f, -200.0f, 1000.0f); MtxPosition(&sp34, &sp40); - i_this->mCamEye = i_this->current.pos + sp40; + i_this->mCamEye = a_this->current.pos + sp40; i_this->mDemoMode = 8; i_this->mDemoCamTimer = 0; // fallthrough @@ -1401,16 +1382,16 @@ static void demo_camera_start(e_mk_class* i_this) { // fallthrough case 9: actor2 = fopAcM_SearchByID(i_this->mBabaChildID); - actor1 = fopAcM_SearchByID(i_this->mBabaChildID2); + actor3 = fopAcM_SearchByID(i_this->mBabaChildID2); if (i_this->mDemoCamTimer == 0) { actor2->current.pos.x = player->current.pos.x - 200.0f; actor2->current.pos.y = player->current.pos.y + 500.0f; actor2->current.pos.z = player->current.pos.z - 1200.0f; actor2->speed.y = 0.0f; - actor1->current.pos.x = player->current.pos.x + 200.0f; - actor1->current.pos.y = player->current.pos.y + 1000.0f; - actor1->current.pos.z = player->current.pos.z - 1000.0f; - actor1->speed.y = 0.0f; + actor3->current.pos.x = player->current.pos.x + 200.0f; + actor3->current.pos.y = player->current.pos.y + 1000.0f; + actor3->current.pos.z = player->current.pos.z - 1000.0f; + actor3->speed.y = 0.0f; i_this->mCamCenter.x = actor2->current.pos.x; i_this->mCamCenter.z = actor2->current.pos.z; } @@ -1435,12 +1416,10 @@ static void demo_camera_start(e_mk_class* i_this) { case 10: cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); - sp34.x = 0.0f; - sp34.y = 150.0f; - sp34.z = 700.0f; + sp34.set(0.0f, 150.0f, 700.0f); MtxPosition(&sp34, &sp40); - i_this->mCamEye = i_this->current.pos + sp40; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye = a_this->current.pos + sp40; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 230.0f; actor1 = fopAcM_SearchByID(i_this->mBabaChildID); @@ -1454,15 +1433,13 @@ static void demo_camera_start(e_mk_class* i_this) { case 11: if (i_this->mDemoCamTimer >= 30) { cMtx_YrotS(*calc_mtx, player->shape_angle.y); - sp34.x = 0.0f; - sp34.y = 200.0f; - sp34.z = -400.0f; + sp34.set(0.0f, 200.0f, -400.0f); MtxPosition(&sp34, &i_this->mCamEye); i_this->mCamEye += player->current.pos; i_this->mCamCenter = player->current.pos; i_this->mCamCenter.y += 100.0f; i_this->field_0xc30 = 10; - fopAcM_OffStatus(i_this, 0x4000); + fopAcM_OffStatus(a_this, 0x4000); Z2GetAudioMgr()->subBgmStart(Z2BGM_BOOMERAMG_MONKEY); } @@ -1481,26 +1458,27 @@ static void demo_camera_start(e_mk_class* i_this) { if (dComIfGp_getEvent().checkSkipEdge()) { u8 uVar1 = fopAcM_GetParam(i_this) >> 16; if (uVar1 != 0xff) { - dComIfGs_onSwitch(uVar1, fopAcM_GetRoomNo(i_this)); + dComIfGs_onSwitch(uVar1, fopAcM_GetRoomNo(a_this)); } - dStage_changeScene(2, 0.0f, 0, fopAcM_GetRoomNo(i_this), 0, -1); + dStage_changeScene(2, 0.0f, 0, fopAcM_GetRoomNo(a_this), 0, -1); } } /* 8071823C-80719488 0041FC 124C+00 1/1 0/0 0/0 .text demo_camera_end__FP10e_mk_class */ static void demo_camera_end(e_mk_class* i_this) { // NONMATCHING - daPy_py_c *player = (daPy_py_c*)dComIfGp_getPlayer(0); - fopAc_ac_c *actor = fopAcM_SearchByID(i_this->field_0x708); - camera_class *camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + fopEn_enemy_c* a_this = &i_this->enemy; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + fopAc_ac_c* actor = fopAcM_SearchByID(i_this->field_0x708); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); cXyz sp2c, i_pos, sp44, sp50; switch (i_this->mDemoMode) { case 1: - if (!i_this->eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(i_this, 2, 0xffff, 0); - i_this->eventInfo.onCondition(dEvtCnd_CANDEMO_e); + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xffff, 0); + a_this->eventInfo.onCondition(dEvtCnd_CANDEMO_e); return; } @@ -1515,23 +1493,23 @@ static void demo_camera_end(e_mk_class* i_this) { dComIfGs_onStageMiddleBoss(); // fallthrough case 2: - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); sp2c.x = 0.0f; sp2c.y = 130.0f; sp2c.z = 0.0f; MtxPosition(&sp2c, &i_this->mCamCenter); - i_this->mCamCenter += i_this->current.pos; + i_this->mCamCenter += a_this->current.pos; sp2c.x = 400.0f; sp2c.y = 100.0f; sp2c.z = 200.0f; MtxPosition(&sp2c, &i_this->mCamEye); - i_this->mCamEye += i_this->current.pos; + i_this->mCamEye += a_this->current.pos; sp2c.x = 0.0f; sp2c.y = 0.0f; sp2c.z = -300.0f; MtxPosition(&sp2c, &i_pos); - i_pos += i_this->current.pos; - player->setPlayerPosAndAngle(&i_pos, i_this->shape_angle.y, 0); + i_pos += a_this->current.pos; + player->setPlayerPosAndAngle(&i_pos, a_this->shape_angle.y, 0); if (i_this->mDemoCamTimer < 30) { return; @@ -1542,17 +1520,17 @@ static void demo_camera_end(e_mk_class* i_this) { return; case 3: - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); sp2c.x = -300.0f; sp2c.y = 0.0f; sp2c.z = -150.0f; MtxPosition(&sp2c, &i_this->mCamCenter); - i_this->mCamCenter += i_this->current.pos; + i_this->mCamCenter += a_this->current.pos; sp2c.x = 100.0f; sp2c.y = 1000.0f; sp2c.z = 0.0f; MtxPosition(&sp2c, &i_this->mCamEye); - i_this->mCamEye += i_this->current.pos; + i_this->mCamEye += a_this->current.pos; return; case 4: @@ -1596,7 +1574,7 @@ static void demo_camera_end(e_mk_class* i_this) { sp2c.z = 500.0f; MtxPosition(&sp2c, &i_pos); i_pos += STAGE_CENTER_POS; - player->setPlayerPosAndAngle(&i_pos, i_this->shape_angle.y, 0); + player->setPlayerPosAndAngle(&i_pos, a_this->shape_angle.y, 0); // fallthrough case 6: cLib_addCalc2(&i_this->mCamCenter.x, i_this->field_0x5e4.x, 0.1f, i_this->field_0xc84 * 20.0f); @@ -1611,7 +1589,7 @@ static void demo_camera_end(e_mk_class* i_this) { i_pos += STAGE_CENTER_POS; cLib_addCalc2(&i_this->field_0xc84, 1.0f, 1.0f , 0.1f); - if (9 < i_this->mDemoCamTimer) { + if (i_this->mDemoCamTimer >= 10) { cLib_addCalc2(&i_this->mCamEye.x, i_pos.x, 0.1f, i_this->field_0xc68.x * i_this->field_0xc88); cLib_addCalc2(&i_this->mCamEye.y, i_pos.y, 0.1f, i_this->field_0xc68.y * i_this->field_0xc88); cLib_addCalc2(&i_this->mCamEye.z, i_pos.z, 0.1f, i_this->field_0xc68.z * i_this->field_0xc88); @@ -1632,7 +1610,7 @@ static void demo_camera_end(e_mk_class* i_this) { sp2c.z = 0.0f; MtxPosition(&sp2c, &i_pos); i_pos += STAGE_CENTER_POS; - player->setPlayerPosAndAngle(&i_pos, i_this->shape_angle.y, 0); + player->setPlayerPosAndAngle(&i_pos, a_this->shape_angle.y, 0); player->changeDemoMode(3, 1, 0, 0); sp2c.x = 170.0f; sp2c.y = 0.0f; @@ -1648,13 +1626,13 @@ static void demo_camera_end(e_mk_class* i_this) { if (i_this->mDemoCamTimer == 180) { i_this->field_0x60c = 0; - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); sp2c.x = 0.0f; sp2c.y = 0.0f; sp2c.z = -20.0f; MtxPosition(&sp2c, &i_pos); i_pos += i_this->field_0x5e4; - fopAcM_createDisappear(i_this, &i_pos, 5, 0, 0xff); + fopAcM_createDisappear(a_this, &i_pos, 5, 0, 0xff); } if (i_this->mDemoCamTimer != 248) { @@ -1670,14 +1648,14 @@ static void demo_camera_end(e_mk_class* i_this) { sp2c.z = 300.0f; MtxPosition(&sp2c, &i_pos); i_pos += STAGE_CENTER_POS; - i_this->current.pos.x = i_pos.x; - i_this->current.pos.z = i_pos.z; + a_this->current.pos.x = i_pos.x; + a_this->current.pos.z = i_pos.z; sp2c.x = 130.0f; sp2c.y = 100.0f; sp2c.z = 100.0f; MtxPosition(&sp2c, &i_this->mCamEye); i_this->mCamEye += STAGE_CENTER_POS; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 190.0f; sp2c.x = 400.0f; sp2c.y = 0.0f; @@ -1687,8 +1665,10 @@ static void demo_camera_end(e_mk_class* i_this) { sp2c.x = STAGE_CENTER_POS.x - i_pos.x; sp2c.z = STAGE_CENTER_POS.z - i_pos.z; player->setPlayerPosAndAngle(&i_pos, cM_atan2s(sp2c.x, sp2c.z), 0); - i_this->current.angle.y = player->shape_angle.y; + a_this->current.angle.y = player->shape_angle.y; Z2GetAudioMgr()->bgmStreamPlay(); + // fallthrough + case 7: return; case 8: @@ -1734,7 +1714,7 @@ static void demo_camera_end(e_mk_class* i_this) { cMtx_YrotS(*calc_mtx, STAGE_ANGLE_Y); sp2c.x = 0.0f; sp2c.y = 300.0f; - sp2c.z = 100.0f; + sp2c.z = -100.0f; MtxPosition(&sp2c, &i_this->mCamCenter); i_this->mCamCenter += STAGE_CENTER_POS; sp2c.x = 800.0f; @@ -1782,7 +1762,7 @@ static void demo_camera_end(e_mk_class* i_this) { cLib_addCalc2(&i_this->field_0xc84, 0.5f, 1.0f, 0.02f); if (i_this->mDemoCamTimer == 2) { - fopAc_ac_c *local_b0 = fopAcM_SearchByID(i_this->field_0x708); + fopAc_ac_c* local_b0 = fopAcM_SearchByID(i_this->field_0x708); sp2c.x = 50.0f; sp2c.y = 10.0f; sp2c.z = 700.0f; @@ -1819,11 +1799,11 @@ static void demo_camera_end(e_mk_class* i_this) { player->changeDemoPos0(&i_pos); sp2c.z = 10000.0f; MtxPosition(&sp2c, &i_pos); - i_this->current.pos = i_pos; + a_this->current.pos = i_pos; } i_pos = actor->current.pos - player->eyePos; - i_this->current.pos = player->eyePos + (i_pos * 20.0f); + a_this->current.pos = player->eyePos + (i_pos * 20.0f); if (i_this->mDemoCamTimer != 20) { return; } @@ -1841,16 +1821,16 @@ static void demo_camera_end(e_mk_class* i_this) { cLib_addCalc2(&i_this->mCamEye.y, player->current.pos.y + 110.0f, 0.1f, i_this->field_0xc84 * 10.0f); cLib_addCalc2(&i_this->field_0xc84, 1.0f, 1.0f, 0.02f); i_pos = actor->current.pos - player->eyePos; - i_this->current.pos = player->eyePos + (i_pos * 20.0f); + a_this->current.pos = player->eyePos + (i_pos * 20.0f); if (i_this->mDemoCamTimer < 70) { return; } if (i_this->mDemoCamTimer == 70) { - i_this->mMsgFlow.init(i_this, 102, 0, NULL); + i_this->mMsgFlow.init(a_this, 102, 0, NULL); } - if (i_this->mMsgFlow.doFlow(i_this, NULL, 0) == 0) { + if (i_this->mMsgFlow.doFlow(a_this, NULL, 0) == 0) { return; } @@ -1862,25 +1842,25 @@ static void demo_camera_end(e_mk_class* i_this) { i_this->mDemoMode++; i_this->mDemoCamTimer = 0; i_this->mSound.startCreatureSound(Z2SE_EN_MK_CATCH_BOOM, 0, -1); - break; + // fallthrough + case 23: + cLib_addCalc2(&i_this->mCamCenter.x, player->current.pos.x, 0.4f, i_this->field_0xc84 * 200.0f); + cLib_addCalc2(&i_this->mCamCenter.z, player->current.pos.z, 0.4f, i_this->field_0xc84 * 200.0f); - default: + if (i_this->mDemoCamTimer == 20) { + fopAcM_createItemForMidBoss(&player->current.pos, 64, fopAcM_GetRoomNo(a_this), 0, 0, 0, -1); + i_this->field_0xc30 = 10; + a_this->current.pos.y += 20000.0f; + target_info_count = 0; + fpcM_Search(s_h_sub, i_this); + fopAcM_delete(static_cast(target_info[0])); + fopAcM_delete(static_cast(target_info[7])); + } + + case 0: case 100: return; } - - cLib_addCalc2(&i_this->mCamCenter.x, player->current.pos.x, 0.4f, i_this->field_0xc84 * 200.0f); - cLib_addCalc2(&i_this->mCamCenter.z, player->current.pos.z, 0.4f, i_this->field_0xc84 * 200.0f); - - if (i_this->mDemoCamTimer == 20) { - fopAcM_createItemForMidBoss(&player->current.pos, 64, fopAcM_GetRoomNo(i_this), 0, 0, 0, -1); - i_this->field_0xc30 = 10; - i_this->current.pos.y += 20000.0f; - target_info_count = 0; - fpcM_Search(s_h_sub, i_this); - fopAcM_delete(static_cast(target_info[0])); - fopAcM_delete(static_cast(target_info[7])); - } } /* 80719488-807194E0 005448 0058+00 2/2 0/0 0/0 .text s_ks_sub__FPvPv */ @@ -1913,14 +1893,14 @@ static void* s_brg_sub2(void* i_actor, void* i_data) { /* 80719594-8071A06C 005554 0AD8+00 1/1 0/0 0/0 .text demo_camera_r04__FP10e_mk_class */ static void demo_camera_r04(e_mk_class* i_this) { - // EQUIVALENT - Register Mismatch u8 uVar1; - daPy_py_c *player = (daPy_py_c *)dComIfGp_getPlayer(0); - fopAc_ac_c *actor = fopAcM_SearchByID(i_this->field_0x708); - camera_class *camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c *)dComIfGp_getPlayer(0); + fopAc_ac_c* actor = fopAcM_SearchByID(i_this->field_0x708); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); cXyz sp2c, sp38; - npc_ks_class *i_actor = (npc_ks_class*)fpcM_Search(s_ks_sub, i_this); + npc_ks_class* i_actor = (npc_ks_class*)fpcM_Search(s_ks_sub, i_this); if (i_actor == NULL) { return; } @@ -1985,11 +1965,11 @@ static void demo_camera_r04(e_mk_class* i_this) { } } - i_this->current.pos.y = i_this->home.pos.y + 10000.0f; + a_this->current.pos.y = a_this->home.pos.y + 10000.0f; return; case 3: - i_this->current.pos.y = i_this->home.pos.y + 10000.0f; + a_this->current.pos.y = a_this->home.pos.y + 10000.0f; cLib_addCalc2(&i_this->mCamCenter.z, i_actor->current.pos.z, 0.2f, 50.0f); cLib_addCalc2(&i_this->mCamCenter.y, i_actor->current.pos.y + 130.0f + cM_ssin(i_this->mDemoCamTimer * 0xA00) * 30.0f, 0.2f, 50.0f); @@ -1997,14 +1977,14 @@ static void demo_camera_r04(e_mk_class* i_this) { return; } - i_this->current.pos.y = i_this->home.pos.y; - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + a_this->current.pos.y = a_this->home.pos.y; + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); sp2c.x = 0.0f; sp2c.y = -200.0f; sp2c.z = 3350.0f; MtxPosition(&sp2c, &i_this->mCamEye); - i_this->mCamEye += i_this->current.pos; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye += a_this->current.pos; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 220.0f; i_this->mDemoMode = 4; i_this->mDemoCamTimer = 0; @@ -2013,8 +1993,8 @@ static void demo_camera_r04(e_mk_class* i_this) { return; case 4: - cLib_addCalc2(&i_this->mCamCenter.z, i_this->current.pos.z, 0.2f, 50.0f); - cLib_addCalc2(&i_this->mCamCenter.y, i_this->current.pos.y + 220.0f, 0.2f, 50.0f); + cLib_addCalc2(&i_this->mCamCenter.z, a_this->current.pos.z, 0.2f, 50.0f); + cLib_addCalc2(&i_this->mCamCenter.y, a_this->current.pos.y + 220.0f, 0.2f, 50.0f); if (i_this->mDemoCamTimer != 74) { return; @@ -2049,13 +2029,13 @@ static void demo_camera_r04(e_mk_class* i_this) { i_this->mDemoCamTimer = 0; // fallthrough case 46: - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); sp2c.x = 0.0f; sp2c.y = 100.0f; sp2c.z = 600.0f; MtxPosition(&sp2c, &i_this->mCamEye); - i_this->mCamEye += i_this->current.pos; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye += a_this->current.pos; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 220.0f; if (i_this->mDemoCamTimer < 45) { @@ -2098,13 +2078,13 @@ static void demo_camera_r04(e_mk_class* i_this) { i_this->mDemoMode = 7; i_this->mDemoCamTimer = 0; - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); sp2c.x = -300.0f; sp2c.y = 100.0f; sp2c.z = 550.0f; MtxPosition(&sp2c, &i_this->mCamEye); - i_this->mCamEye += i_this->current.pos; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye += a_this->current.pos; + i_this->mCamCenter = a_this->current.pos; i_this->mCamCenter.y += 190.0f; // fallthrough case 7: @@ -2162,13 +2142,13 @@ static void demo_camera_r04(e_mk_class* i_this) { camera->mCamera.SetTrimSize(0); dComIfGp_event_reset(); daPy_getPlayerActorClass()->cancelOriginalDemo(); - fopAcM_delete(i_this); + fopAcM_delete(a_this); uVar1 = fopAcM_GetParam(i_this) >> 16; if (uVar1 == 0xFF) { return; } - dComIfGs_onSwitch(uVar1, fopAcM_GetRoomNo(i_this)); + dComIfGs_onSwitch(uVar1, fopAcM_GetRoomNo(a_this)); return; case 0: @@ -2185,9 +2165,9 @@ static void demo_camera_bohit(e_mk_class* i_this) { switch (i_this->mDemoMode) { case 1: - if (!i_this->eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(i_this, 2, 0xffff, 0); - i_this->eventInfo.onCondition(dEvtCnd_CANDEMO_e); + if (!i_this->enemy.eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(&i_this->enemy, 2, 0xffff, 0); + i_this->enemy.eventInfo.onCondition(dEvtCnd_CANDEMO_e); return; } @@ -2197,7 +2177,7 @@ static void demo_camera_bohit(e_mk_class* i_this) { i_this->mDemoCamFovy = 55.0f; camera->mCamera.SetTrimSize(3); - cMtx_YrotS(*calc_mtx, i_this->shape_angle.y); + cMtx_YrotS(*calc_mtx, i_this->enemy.shape_angle.y); if (cM_rndF(1.0f) < 0.5f) { sp20.x = 500.0f; } else { @@ -2207,13 +2187,13 @@ static void demo_camera_bohit(e_mk_class* i_this) { sp20.y = -120.0f; sp20.z = 0.0f; MtxPosition(&sp20, &i_this->mCamEye); - i_this->mCamEye += i_this->current.pos; - i_this->mCamCenter = i_this->current.pos; + i_this->mCamEye += i_this->enemy.current.pos; + i_this->mCamCenter = i_this->enemy.current.pos; // fallthrough case 2: - cLib_addCalc2(&i_this->mCamCenter.x, i_this->current.pos.x, 0.5f, 50.0f); - cLib_addCalc2(&i_this->mCamCenter.y, i_this->current.pos.y + 100.0f, 0.5f, 50.0f); - cLib_addCalc2(&i_this->mCamCenter.z, i_this->current.pos.z, 0.5f, 50.0f); + cLib_addCalc2(&i_this->mCamCenter.x, i_this->enemy.current.pos.x, 0.5f, 50.0f); + cLib_addCalc2(&i_this->mCamCenter.y, i_this->enemy.current.pos.y + 100.0f, 0.5f, 50.0f); + cLib_addCalc2(&i_this->mCamCenter.z, i_this->enemy.current.pos.z, 0.5f, 50.0f); if (i_this->mDemoCamTimer == 25) { i_this->field_0xc98 = 30.0f; @@ -2233,7 +2213,6 @@ static void demo_camera_bohit(e_mk_class* i_this) { /* 8071A22C-8071A538 0061EC 030C+00 2/1 0/0 0/0 .text demo_camera__FP10e_mk_class */ static void demo_camera(e_mk_class* i_this) { - // NONMATCHING camera_class *camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); cXyz sp34, sp40; @@ -2253,7 +2232,7 @@ static void demo_camera(e_mk_class* i_this) { if (i_actor != NULL) { u8 i_no = fopAcM_GetParam(i_this) >> 16; if (i_no != 0xFF) { - dComIfGs_onSwitch(i_no, fopAcM_GetRoomNo(i_this)); + dComIfGs_onSwitch(i_no, fopAcM_GetRoomNo(&i_this->enemy)); } i_no = fopAcM_GetParam(i_actor) >> 24; @@ -2278,10 +2257,18 @@ static void demo_camera(e_mk_class* i_this) { i_this->field_0xc30 = 0; i_this->mDemoMode = 0; daPy_getPlayerActorClass()->cancelOriginalDemo(); + + case 5: + case 6: + case 7: + case 8: + case 9: + case 0: + break; } if (i_this->field_0xc30 != 0) { - int iVar1 = i_this->field_0xc98 * cM_scos(i_this->field_0x6b4 * 0x2C00) * 7.5f; + s16 sVar1 = i_this->field_0xc98 * cM_scos(i_this->field_0x6b4 * 0x2C00) * 7.5f; cXyz i_center = i_this->mCamCenter; cXyz i_eye = i_this->mCamEye; @@ -2292,7 +2279,7 @@ static void demo_camera(e_mk_class* i_this) { i_center.z += i_this->field_0xc98 * cM_scos(i_this->field_0x6b4 * 0x2C00); i_eye.z += i_this->field_0xc98 * cM_scos(i_this->field_0x6b4 * 0x2C00); - camera->mCamera.Set(i_center, i_eye, iVar1, i_this->mDemoCamFovy); + camera->mCamera.Set(i_center, i_eye, sVar1, i_this->mDemoCamFovy); cLib_addCalc0(&i_this->field_0xc98, 1.0f, 3.0f); i_this->mDemoCamTimer++; @@ -2305,10 +2292,10 @@ static void demo_camera(e_mk_class* i_this) { /* 8071A538-8071A808 0064F8 02D0+00 2/1 0/0 0/0 .text action__FP10e_mk_class */ static void action(e_mk_class* i_this) { - // NONMATCHING + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; cXyz sp28, sp34; - i_this->mDistToPlayer = fopAcM_searchPlayerDistanceXZ(i_this); - i_this->mAngleToPlayer = fopAcM_searchPlayerAngleY(i_this); + i_this->mDistToPlayer = fopAcM_searchPlayerDistanceXZ(a_this); + i_this->mAngleToPlayer = fopAcM_searchPlayerAngleY(a_this); damage_check(i_this); s8 sVar1 = 1; s8 sVar2 = 1; @@ -2358,24 +2345,24 @@ static void action(e_mk_class* i_this) { } if (sVar2) { - fopAcM_OnStatus(i_this, 0); - i_this->attention_info.flags = 4; + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; } else { - fopAcM_OffStatus(i_this, 0); - i_this->attention_info.flags = 0; + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; } - cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 4, 0x2000); + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 4, 0x2000); if (i_this->field_0x6f8 != 0) { - i_this->current.pos += i_this->speed; - i_this->speed.y += i_this->gravity; + a_this->current.pos += a_this->speed; + a_this->speed.y += a_this->gravity; if (i_this->field_0x6f8 == 1) { i_this->mAcch.CrrPos(dComIfG_Bgsp()); } } else { - i_this->current.pos += i_this->speed; + a_this->current.pos += a_this->speed; } if (i_this->field_0x71b != 0) { @@ -2384,13 +2371,13 @@ static void action(e_mk_class* i_this) { PSMTXCopy(model->getAnmMtx(29), *calc_mtx); sp28.set(0.0f, 0.0f, 0.0f); MtxPosition(&sp28, &sp34); - fopAcM_effSmokeSet1(&i_this->field_0xc08, &i_this->field_0xc0c, &sp34, &i_this->shape_angle, 2.5f, &i_this->tevStr, 0); + fopAcM_effSmokeSet1(&i_this->field_0xc08, &i_this->field_0xc0c, &sp34, &a_this->shape_angle, 2.5f, &a_this->tevStr, 0); PSMTXCopy(model->getAnmMtx(33), *calc_mtx); MtxPosition(&sp28, &sp34); - fopAcM_effSmokeSet1(&i_this->field_0xc10, &i_this->field_0xc14, &sp34, &i_this->shape_angle, 2.5f, &i_this->tevStr, 0); + fopAcM_effSmokeSet1(&i_this->field_0xc10, &i_this->field_0xc14, &sp34, &a_this->shape_angle, 2.5f, &a_this->tevStr, 0); } else { - fopAcM_effSmokeSet1(&i_this->field_0xc08, &i_this->field_0xc0c, &i_this->current.pos, &i_this->shape_angle, 2.5f, &i_this->tevStr, 1); + fopAcM_effSmokeSet1(&i_this->field_0xc08, &i_this->field_0xc0c, &a_this->current.pos, &a_this->shape_angle, 2.5f, &a_this->tevStr, 1); } i_this->field_0x71b = 0; @@ -2403,7 +2390,11 @@ static void action(e_mk_class* i_this) { /* 8071A808-8071AF14 0067C8 070C+00 1/1 0/0 0/0 .text anm_se_set__FP10e_mk_class */ static void anm_se_set(e_mk_class* i_this) { - // NONMATCHING + static u16 bo_eno_1[2] = { + 0x8214, + 0x8215, + }; + static u16 bo_eno_0[4] = { 0x8211, 0x8212, @@ -2411,10 +2402,7 @@ static void anm_se_set(e_mk_class* i_this) { 0x820C, }; - static u16 bo_eno_1[2] = { - 0x8214, - 0x8215, - }; + if (i_this->mAnm == 40) { if (i_this->mpModelMorf->checkFrame(2.0f) || i_this->mpModelMorf->checkFrame(13.0f)) { @@ -2480,7 +2468,7 @@ static void anm_se_set(e_mk_class* i_this) { if (i_this->mAnm == 19 || i_this->mAnm == 21) { for (int i = 0; i < 2; i++) { - i_this->field_0xc18[i] = dComIfGp_particle_set(i_this->field_0xc18[i], bo_eno_1[i], &i_this->current.pos, NULL, 0); + i_this->field_0xc18[i] = dComIfGp_particle_set(i_this->field_0xc18[i], bo_eno_1[i], &i_this->enemy.current.pos, NULL, 0); JPABaseEmitter *pEmitter1 = dComIfGp_particle_getEmitter(i_this->field_0xc18[i]); if (pEmitter1 != NULL) { @@ -2491,7 +2479,7 @@ static void anm_se_set(e_mk_class* i_this) { if (i_this->mAnm == 21) { for (int i = 0; i < 4; i++) { - i_this->field_0xc20[i] = dComIfGp_particle_set(i_this->field_0xc20[i], bo_eno_0[i], &i_this->current.pos, NULL, 0); + i_this->field_0xc20[i] = dComIfGp_particle_set(i_this->field_0xc20[i], bo_eno_0[i], &i_this->enemy.eyePos, NULL, 0); JPABaseEmitter *pEmitter2 = dComIfGp_particle_getEmitter(i_this->field_0xc20[i]); if (pEmitter2 != NULL) { @@ -2533,7 +2521,7 @@ static int daE_MK_Execute(e_mk_class* i_this) { sp6c = i_this->field_0x6cc - i_this->field_0x6c0; f32 fVar1 = sp6c.abs(); - sp6c = i_this->field_0x6cc - i_this->current.pos; + sp6c = i_this->field_0x6cc - i_this->enemy.current.pos; f32 fVar2 = sp6c.abs(); f32 fVar3 = fVar1 * 0.1f; @@ -2548,14 +2536,14 @@ static int daE_MK_Execute(e_mk_class* i_this) { i_this->field_0x6d8 = 0; } - mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y + i_this->field_0x6d8, i_this->current.pos.z); - mDoMtx_stack_c::YrotM(i_this->shape_angle.y); - mDoMtx_stack_c::XrotM(i_this->shape_angle.x); + mDoMtx_stack_c::transS(i_this->enemy.current.pos.x, i_this->enemy.current.pos.y + i_this->field_0x6d8, i_this->enemy.current.pos.z); + mDoMtx_stack_c::YrotM(i_this->enemy.shape_angle.y); + mDoMtx_stack_c::XrotM(i_this->enemy.shape_angle.x); mDoMtx_stack_c::scaleM(l_HIO.mSize, l_HIO.mSize, l_HIO.mSize); J3DModel *model = i_this->mpModelMorf->getModel(); model->setBaseTRMtx(mDoMtx_stack_c::get()); - i_this->mpModelMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + i_this->mpModelMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(&i_this->enemy))); if (i_this->field_0x5d4 == 0) { i_this->field_0x5d4 = cM_rndF(60.0f) + 30.0f; @@ -2578,9 +2566,9 @@ static int daE_MK_Execute(e_mk_class* i_this) { i_this->mpModelMorf->modelCalc(); PSMTXCopy(model->getAnmMtx(7), *calc_mtx); sp6c.set(0.0f, 0.0f, 0.0f); - MtxPosition(&sp6c, &i_this->eyePos); - i_this->attention_info.position = i_this->eyePos; - i_this->attention_info.position.y += 70.0f; + MtxPosition(&sp6c, &i_this->enemy.eyePos); + i_this->enemy.attention_info.position = i_this->enemy.eyePos; + i_this->enemy.attention_info.position.y += 70.0f; if (i_this->field_0x60c != 0) { if (i_this->field_0x5e0 == 0) { @@ -2645,7 +2633,7 @@ static int daE_MK_Execute(e_mk_class* i_this) { } i_this->field_0x708 = fopAcM_createChild(PROC_E_MK_BO, fopAcM_GetID(i_this), i_parameters, - &i_this->current.pos, fopAcM_GetRoomNo(i_this), NULL, NULL, + &i_this->enemy.current.pos, fopAcM_GetRoomNo(&i_this->enemy), NULL, NULL, -1, NULL); i_this->field_0x707 = 0; } @@ -2667,9 +2655,9 @@ static int daE_MK_Execute(e_mk_class* i_this) { MtxPosition(&sp6c, &sp78); if (i_this->mAction >= 9) { - i_this->eyePos = sp78; - i_this->attention_info.position = i_this->eyePos; - i_this->attention_info.position.y += 40.0f; + i_this->enemy.eyePos = sp78; + i_this->enemy.attention_info.position = i_this->enemy.eyePos; + i_this->enemy.attention_info.position.y += 40.0f; } if (i_this->field_0x704 != 0) { @@ -2694,7 +2682,7 @@ static int daE_MK_Execute(e_mk_class* i_this) { if (i_this->field_0x706 != 0) { i_this->field_0x706--; if (i_this->field_0x706 == 0) { - dComIfGp_particle_set(0x15E, &i_this->eyePos, &i_this->shape_angle, NULL); + dComIfGp_particle_set(0x15E, &i_this->enemy.eyePos, &i_this->enemy.shape_angle, NULL); } } @@ -2715,7 +2703,7 @@ static int daE_MK_Delete(e_mk_class* i_this) { lbl_210_bss_AA = 0; } - if (i_this->heap != NULL) { + if (i_this->enemy.heap != NULL) { i_this->mpModelMorf->stopZelAnime(); } @@ -2760,7 +2748,7 @@ static int useHeapInit(fopAc_ac_c* actor) { /* 8071BD14-8071C190 007CD4 047C+00 1/0 0/0 0/0 .text daE_MK_Create__FP10fopAc_ac_c */ static int daE_MK_Create(fopAc_ac_c* actor) { - // NONMATCHING + // EQUIVALENT - REGALLOC static dCcD_SrcSph cc_sph_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x43}, 0x75}}, // mObj @@ -2774,19 +2762,20 @@ static int daE_MK_Create(fopAc_ac_c* actor) { }; fopAcM_SetupActor(actor, e_mk_class); - e_mk_class *i_this; + e_mk_class* i_this; + fopAc_ac_c* a_this = &i_this->enemy; int phase = dComIfG_resLoad(&i_this->mPhase, "E_mk"); if (phase == cPhs_COMPLEATE_e) { OS_REPORT("E_MK PARAM %x\n", fopAcM_GetParam(i_this)); - if (strcmp(dComIfGp_getStartStageName(), "D_MNO05B") == 0 && dComIfGs_isStageMiddleBoss()) { + if (strcmp(dComIfGp_getStartStageName(), "D_MN05B") == 0 && dComIfGs_isStageMiddleBoss()) { OS_REPORT("中ボスE_MK やられ後なので再セットしません\n"); // Since it's the middle boss E_MK after being defeated, I won't reset it. return cPhs_ERROR_e; } u32 uVar1 = fopAcM_GetParam(i_this) >> 24; if (uVar1 != 0xFF) { - if (dComIfGs_isSwitch(uVar1, fopAcM_GetRoomNo(i_this))) { + if (dComIfGs_isSwitch(uVar1, fopAcM_GetRoomNo(a_this))) { OS_REPORT("E_MK やられ後なので再セットしません\n"); // Since it's after the E_MK was done, I won't reset it. return cPhs_ERROR_e; } @@ -2795,7 +2784,7 @@ static int daE_MK_Create(fopAc_ac_c* actor) { i_this->field_0x5b6 = fopAcM_GetParam(i_this); OS_REPORT("E_MK//////////////E_MK SET 1 !!\n"); - if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x56f0)) { + if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x56f0)) { OS_REPORT("//////////////E_MK SET NON !!\n"); return cPhs_ERROR_e; } @@ -2807,24 +2796,24 @@ static int daE_MK_Create(fopAc_ac_c* actor) { l_HIO.field_0x4 = -1; } - i_this->attention_info.flags = 4; + a_this->attention_info.flags = 4; - fopAcM_SetMtx(i_this, i_this->mpModelMorf->getModel()->getBaseTRMtx()); - fopAcM_SetMin(i_this, -500.0f, -500.0f, -500.0f); - fopAcM_SetMax(i_this, 500.0f, 500.0f, 500.0f); + fopAcM_SetMtx(a_this, i_this->mpModelMorf->getModel()->getBaseTRMtx()); + fopAcM_SetMin(a_this, -500.0f, -500.0f, -500.0f); + fopAcM_SetMax(a_this, 500.0f, 500.0f, 500.0f); - i_this->mAcch.Set(fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), i_this, 1, &i_this->mAcchCir, - fopAcM_GetSpeed_p(i_this), NULL, NULL); + i_this->mAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), &i_this->enemy, 1, &i_this->mAcchCir, + fopAcM_GetSpeed_p(a_this), NULL, NULL); i_this->mAcchCir.SetWall(80.0f, 30.0f); - i_this->health = 200; - i_this->field_0x560 = 200; + a_this->health = 200; + a_this->field_0x560 = 200; - i_this->mSound.init(&i_this->current.pos, &i_this->eyePos, 3, 1); + i_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 3, 1); i_this->mAtInfo.mpSound = &i_this->mSound; - i_this->attention_info.distances[2] = 4; + a_this->attention_info.distances[2] = 4; - i_this->field_0x95c.Init(0xFF, 0, i_this); + i_this->field_0x95c.Init(0xFF, 0, a_this); i_this->field_0xad0.Set(cc_sph_src); i_this->field_0xad0.SetStts(&i_this->field_0x95c); i_this->field_0x998.Set(cc_sph_src); @@ -2833,42 +2822,40 @@ static int daE_MK_Create(fopAc_ac_c* actor) { i_this->field_0x60c = 1; i_this->field_0x60d = 1; - if (fopAcM_GetRoomNo(i_this) == 4) { + if (fopAcM_GetRoomNo(a_this) == 4) { i_this->mAction = e_mk_class::ACT_R04_DEMO; - i_this->current.pos.set(0.0f, 3900.0f, -3000.0f); - i_this->current.angle.y = 0; - i_this->home = i_this->current; + a_this->current.pos.set(0.0f, 3900.0f, -3000.0f); + a_this->current.angle.y = 0; + a_this->home = a_this->current; } else { - STAGE_CENTER_POS = i_this->home.pos; + STAGE_CENTER_POS = a_this->home.pos; STAGE_CENTER_POS.y -= 500.0f; - STAGE_ANGLE_Y = i_this->home.angle.y; + STAGE_ANGLE_Y = a_this->home.angle.y; - int uVar2 = fopAcM_GetParam(i_this) >> 16; - if (uVar2 != 0xFF) { - if (dComIfGs_isSwitch(uVar2, fopAcM_GetRoomNo(i_this))) { - dComIfGs_offSwitch(uVar2, fopAcM_GetRoomNo(i_this)); - i_this->mAction = e_mk_class::ACT_WAIT; - Z2GetAudioMgr()->subBgmStart(Z2BGM_BOOMERAMG_MONKEY); - } + u8 uVar2 = fopAcM_GetParamBit(i_this, 16, 8); + if (uVar2 != 0xFF && dComIfGs_isSwitch(uVar2, fopAcM_GetRoomNo(a_this))) { + dComIfGs_offSwitch(uVar2, fopAcM_GetRoomNo(a_this)); + i_this->mAction = e_mk_class::ACT_WAIT; + Z2GetAudioMgr()->subBgmStart(Z2BGM_BOOMERAMG_MONKEY); } else { i_this->mAction = e_mk_class::ACT_S_DEMO; - int uVar3 = (u8)fopAcM_GetParam(i_this) & (0xFF | 0xFFFF01); + u32 uVar3 = fopAcM_GetParam(i_this) & 0xFF000000 | 0xFFFF01; cXyz sp30(-21.0f, 5114.0f, -4941.0f); i_this->mBabaChildID = fopAcM_createChild(PROC_E_DB, fopAcM_GetID(i_this), uVar3, - &sp30, fopAcM_GetRoomNo(i_this), NULL, + &sp30, fopAcM_GetRoomNo(a_this), NULL, NULL, -1, NULL); sp30.set(-10.0f, 5114.0f, -4401.0f); i_this->mBabaChildID2 = fopAcM_createChild(PROC_E_DB, fopAcM_GetID(i_this), uVar3, - &sp30, fopAcM_GetRoomNo(i_this), NULL, + &sp30, fopAcM_GetRoomNo(a_this), NULL, NULL, -1, NULL); - fopAcM_OnStatus(i_this, 0x4000); + fopAcM_OnStatus(a_this, 0x4000); } } - i_this->gravity = -5.0f; - i_this->scale.x = l_HIO.mSize * l_HIO.mBoomerangRatio; + a_this->gravity = -5.0f; + a_this->scale.x = l_HIO.mSize * l_HIO.mBoomerangRatio; daE_MK_Execute(i_this); }