diff --git a/configure.py b/configure.py index 255262857..1766bd8d4 100755 --- a/configure.py +++ b/configure.py @@ -1567,7 +1567,7 @@ config.libs = [ ActorRel(Matching, "d_a_atdoor"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_auction"), ActorRel(Matching, "d_a_bb"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_bdk"), + ActorRel(Matching, "d_a_bdk"), ActorRel(Matching, "d_a_bdkobj"), ActorRel(NonMatching, "d_a_bgn"), ActorRel(NonMatching, "d_a_bgn2"), diff --git a/include/d/actor/d_a_bdk.h b/include/d/actor/d_a_bdk.h index 32289bcac..180d94505 100644 --- a/include/d/actor/d_a_bdk.h +++ b/include/d/actor/d_a_bdk.h @@ -127,7 +127,9 @@ public: /* 0x2593 */ s8 m2593; /* 0x2594 */ s8 m2594; /* 0x2598 */ fopAc_ac_c* mp2598; +#if VERSION > VERSION_DEMO /* 0x259C */ u8 m259C[0x259E - 0x259C]; +#endif /* 0x259E */ s16 m259E; /* 0x25A0 */ s16 m25A0; /* 0x25A2 */ s8 m25A2; diff --git a/src/d/actor/d_a_bdk.cpp b/src/d/actor/d_a_bdk.cpp index 6d6545777..09af543f5 100644 --- a/src/d/actor/d_a_bdk.cpp +++ b/src/d/actor/d_a_bdk.cpp @@ -23,9 +23,7 @@ #include "JSystem/JUtility/JUTReport.h" #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_hostIO.h" -#if VERSION > VERSION_DEMO #include "m_Do/m_Do_graphic.h" -#endif enum ActionStatus { ACTION_FLY = 0, @@ -47,6 +45,74 @@ enum ActionStatus { ACTION_AFTER_FIGHT = 0x6E, }; +enum DK_JOINT { + JNT_DK_ALLROOT, + JNT_DK_SKLROOT, + JNT_J_DK_KOSI, + JNT_J_DK_ASHI_L1, + JNT_J_DK_ASHI_L2, + JNT_J_DK_ASHI_L3, + JNT_J_DK_YUBI_LA1, + JNT_J_DK_YUBI_LA2, + JNT_J_DK_YUBI_LB1, + JNT_J_DK_YUBI_LB2, + JNT_J_DK_YUBI_LC1, + JNT_J_DK_YUBI_LC2, + JNT_J_DK_ASHI_R1, + JNT_J_DK_ASHI_R2, + JNT_J_DK_ASHI_R3, + JNT_J_DK_YUBI_RA1, + JNT_J_DK_YUBI_RA2, + JNT_J_DK_YUBI_RB1, + JNT_J_DK_YUBI_RB2, + JNT_J_DK_YUBI_RC1, + JNT_J_DK_YUBI_RC2, + JNT_J_DK_MUNE1, + JNT_J_DK_MUNE2, + JNT_J_DK_KUBI1, + JNT_J_DK_ATAMA1, + JNT_J_DK_AGO, + JNT_J_DK_KAMINOKE, + JNT_J_DK_KUTIBASI, + JNT_J_DK_MABUTA, + JNT_J_DK_ODEKO, + JNT_J_DK_SITA, + JNT_J_DK_TOSAKA_A1, + JNT_J_DK_TOSAKA_A2, + JNT_J_DK_TOSAKA_A3, + JNT_J_DK_TOSAKA_A4, + JNT_J_DK_TOSAKA_B1, + JNT_J_DK_TOSAKA_B2, + JNT_J_DK_TUBASA_L1, + JNT_J_DK_TUBASA_L2, + JNT_J_DK_HANE_L1, + JNT_J_DK_HANE_L2, + JNT_J_DK_HANE_L3, + JNT_J_DK_HANE_L4, + JNT_J_DK_HANE_L5, + JNT_J_DK_HANE_L6, + JNT_J_DK_PIKO_LA, + JNT_J_DK_PIKO_LB, + JNT_J_DK_TUBASA_R1, + JNT_J_DK_TUBASA_R2, + JNT_J_DK_HANE_R1, + JNT_J_DK_HANE_R2, + JNT_J_DK_HANE_R3, + JNT_J_DK_HANE_R4, + JNT_J_DK_HANE_R5, + JNT_J_DK_HANE_R6, + JNT_J_DK_PIKO_RA, + JNT_J_DK_PIKO_RB, + JNT_J_DK_O_LA1, + JNT_J_DK_O_LA2, + JNT_J_DK_O_LB1, + JNT_J_DK_O_LB2, + JNT_J_DK_O_RA1, + JNT_J_DK_O_RA2, + JNT_J_DK_O_RB1, + JNT_J_DK_O_RB2, +}; + static cXyz center_pos; static cXyz center_pos2; static cXyz wind_se_pos; @@ -70,7 +136,7 @@ daBdk_HIO_c::daBdk_HIO_c() { } /* 0000015C-000001A8 .text kamome_delete_sub__FPvPv */ -void* kamome_delete_sub(void* param_1, void*) { +static void* kamome_delete_sub(void* param_1, void*) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_KAMOME) { fopAcM_delete(static_cast(param_1)); } @@ -78,7 +144,7 @@ void* kamome_delete_sub(void* param_1, void*) { } /* 000001A8-000001F4 .text kui_delete_sub__FPvPv */ -void* kui_delete_sub(void* param_1, void*) { +static void* kui_delete_sub(void* param_1, void*) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_KUI) { fopAcM_delete(static_cast(param_1)); } @@ -86,7 +152,7 @@ void* kui_delete_sub(void* param_1, void*) { } /* 000001F4-00000240 .text ep_delete_sub__FPvPv */ -void* ep_delete_sub(void* param_1, void*) { +static void* ep_delete_sub(void* param_1, void*) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_EP) { fopAcM_delete(static_cast(param_1)); } @@ -94,7 +160,7 @@ void* ep_delete_sub(void* param_1, void*) { } /* 00000240-0000028C .text dk_delete_sub__FPvPv */ -void* dk_delete_sub(void* param_1, void*) { +static void* dk_delete_sub(void* param_1, void*) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_DK) { fopAcM_delete(static_cast(param_1)); } @@ -102,17 +168,16 @@ void* dk_delete_sub(void* param_1, void*) { } /* 0000028C-000002E8 .text obj_delete_sub__FPvPv */ -void* obj_delete_sub(void* param_1, void*) { +static void* obj_delete_sub(void* param_1, void*) { fopAc_ac_c* actor = static_cast(param_1); - if (fopAcM_IsActor(actor) && fopAcM_GetName(actor) == PROC_BDKOBJ - && (fopAcM_GetParam(actor) & 0xF) >= 2) { + if (fopAcM_IsActor(actor) && fopAcM_GetName(actor) == PROC_BDKOBJ && (fopAcM_GetParam(actor) & 0xF) >= 2) { fopAcM_delete(actor); } return NULL; } /* 000002E8-00000334 .text sea_delete_sub__FPvPv */ -void* sea_delete_sub(void* param_1, void*) { +static void* sea_delete_sub(void* param_1, void*) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_Obj_Tide) { fopAcM_delete(static_cast(param_1)); } @@ -120,7 +185,7 @@ void* sea_delete_sub(void* param_1, void*) { } /* 00000334-00000380 .text bk_delete_sub__FPvPv */ -void* bk_delete_sub(void* param_1, void*) { +static void* bk_delete_sub(void* param_1, void*) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_BK) { fopAcM_delete(static_cast(param_1)); } @@ -128,7 +193,7 @@ void* bk_delete_sub(void* param_1, void*) { } /* 00000380-000003CC .text boko_delete_sub__FPvPv */ -void* boko_delete_sub(void* param_1, void*) { +static void* boko_delete_sub(void* param_1, void*) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_BOKO) { fopAcM_delete(static_cast(param_1)); } @@ -136,27 +201,26 @@ void* boko_delete_sub(void* param_1, void*) { } /* 000003CC-00000424 .text obj2_delete_sub__FPvPv */ -void* obj2_delete_sub(void* param_1, void*) { +static void* obj2_delete_sub(void* param_1, void*) { fopAc_ac_c* actor = static_cast(param_1); - if (fopAcM_IsActor(actor) && fopAcM_GetName(actor) == PROC_BDKOBJ - && actor->model == NULL) { + if (fopAcM_IsActor(actor) && fopAcM_GetName(actor) == PROC_BDKOBJ && actor->model == NULL) { fopAcM_delete(actor); } return NULL; } /* 00000424-000004D4 .text land_area_check__FP4cXyzf */ -BOOL land_area_check(cXyz* param_1, float param_2) { +static BOOL land_area_check(cXyz* param_1, float param_2) { f32 val1 = param_1->x - 3600.0f; f32 val2 = param_1->z - (-3800.0f); - if ((std::sqrtf(val1 * val1 + val2 * val2) < param_2)) { + if (std::sqrtf(val1 * val1 + val2 * val2) < param_2) { return TRUE; } return FALSE; } /* 000004D4-0000073C .text eff_hane_set__FP9bdk_classP4cXyziSc */ -void eff_hane_set(bdk_class* i_this, cXyz* offset, int param_3, signed char param_4) { +static void eff_hane_set(bdk_class* i_this, cXyz* offset, int param_3, signed char param_4) { fopAc_ac_c* actor = &i_this->actor; bdk_eff_s* eff; for (s32 iVar4 = 0, i = 0; i < (s32)(ARRAY_SIZE(i_this->m261C) - 1); i++) { @@ -203,7 +267,7 @@ void eff_hane_set(bdk_class* i_this, cXyz* offset, int param_3, signed char para } /* 0000073C-000007A4 .text pl_view_check__FP9bdk_class */ -BOOL pl_view_check(bdk_class* i_this) { +static BOOL pl_view_check(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; s16 angle = fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0)); angle = actor->current.angle.y - angle; @@ -217,7 +281,7 @@ BOOL pl_view_check(bdk_class* i_this) { } /* 000007A4-000008F8 .text anm_init__FP9bdk_classifUcfiUc */ -void anm_init(bdk_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f32 speed, int soundFileIdx, unsigned char param7) { +static void anm_init(bdk_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f32 speed, int soundFileIdx, unsigned char param7) { if (param7 == 0) { i_this->m2588 = bckFileIdx; i_this->m258C = soundFileIdx; @@ -229,16 +293,10 @@ void anm_init(bdk_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f32 spee if (soundFileIdx >= 0) { i_this->mpMorf->setAnm( - (J3DAnmTransform*)dComIfG_getObjectRes("Bdk", bckFileIdx), - loopMode, morf, speed, 0.0f, -1.0f, - dComIfG_getObjectRes("Bdk", soundFileIdx) + (J3DAnmTransform*)dComIfG_getObjectRes("Bdk", bckFileIdx), loopMode, morf, speed, 0.0f, -1.0f, dComIfG_getObjectRes("Bdk", soundFileIdx) ); } else { - i_this->mpMorf->setAnm( - (J3DAnmTransform*)dComIfG_getObjectRes("Bdk", bckFileIdx), - loopMode, morf, speed, 0.0f, -1.0f, - NULL - ); + i_this->mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Bdk", bckFileIdx), loopMode, morf, speed, 0.0f, -1.0f, NULL); } } @@ -251,13 +309,13 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { bdk_class* bdk = (bdk_class*)model->getUserArea(); if (bdk != NULL) { MTXCopy(model->getAnmMtx(jnt_no), *calc_mtx); - if (jnt_no == 0x17) { // j_dk_kubi1 joint + if (jnt_no == JNT_J_DK_KUBI1) { cMtx_YrotM(*calc_mtx, bdk->mF14); cMtx_XrotM(*calc_mtx, bdk->mF12); model->setAnmMtx(jnt_no, *calc_mtx); MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); - } else if (jnt_no >= 0x1F && 0x24 >= jnt_no) { // j_dk_tosaka_A1 to j_dk_tosaka_B2 joints - if (jnt_no >= 0x23) { // j_dk_tosaka_B1 and j_dk_tosaka_B2 joints + } else if (jnt_no >= JNT_J_DK_TOSAKA_A1 && JNT_J_DK_TOSAKA_B2 >= jnt_no) { + if (jnt_no >= JNT_J_DK_TOSAKA_B1) { cMtx_YrotM(*calc_mtx, bdk->m112E + bdk->m1120 + bdk->m1124); cMtx_ZrotM(*calc_mtx, bdk->m112C + bdk->m1122 + bdk->m1126); } else { @@ -269,10 +327,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { } else { cXyz offset; jnt_no = (jnt_no - 0x3A) / 2; - - offset.z = 0; - offset.y = 0; - offset.x = 0; + offset.x = offset.y = offset.z = 0.0f; MtxPosition(&offset, &bdk->m300[jnt_no].m0150[1]); offset.x = -10.0f; MtxPosition(&offset, &bdk->m300[jnt_no].m0150[0]); @@ -283,7 +338,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { } /* 00000B4C-00001008 .text tail_control__FP9bdk_classP10bdk_tail_s */ -void tail_control(bdk_class* i_this, bdk_tail_s* tail) { +static void tail_control(bdk_class* i_this, bdk_tail_s* tail) { cXyz sp10; cXyz sp28; cXyz sp1C; @@ -314,11 +369,11 @@ void tail_control(bdk_class* i_this, bdk_tail_s* tail) { fVar2 = -30000.0f; } - for(i = 1; i < (s32)ARRAY_SIZE(tail->m024); i++, array_24++, array_9c++, array_d8++) { + for (i = 1; i < (s32)ARRAY_SIZE(tail->m024); i++, array_24++, array_9c++, array_d8++) { f32 fVar1 = 1.0f - (i - 1) * 0.1f; - sp1C.x = array_d8->x + tail->m0170.x * fVar1; - sp1C.y = array_d8->y + tail->m0170.y * fVar1; - sp1C.z = array_d8->z + tail->m0170.z * fVar1; + sp1C.x = array_d8->x + tail->m0170.x * fVar1; + sp1C.y = array_d8->y + tail->m0170.y * fVar1; + sp1C.z = array_d8->z + tail->m0170.z * fVar1; f32 fVar3 = array_24->y + sp1C.y; if (fVar3 < fVar2) { @@ -356,17 +411,25 @@ void tail_control(bdk_class* i_this, bdk_tail_s* tail) { } static f32 tial_scale[] = { - 0.25f, 0.275f, 0.2875f, 0.3f, 0.325f, 0.375f, 0.4625f, 0.575f, 0.8f, + 0.25f, + 0.275f, + 0.2875f, + 0.3f, + 0.325f, + 0.375f, + 0.4625f, + 0.575f, + 0.8f, }; /* 00001008-00001120 .text tail_draw__FP9bdk_classP10bdk_tail_s */ -void tail_draw(bdk_class* i_this, bdk_tail_s* tail) { +static void tail_draw(bdk_class* i_this, bdk_tail_s* tail) { fopAc_ac_c* actor = &i_this->actor; if (i_this->m2F6 != 0) { i_this->m2F6--; } else { cXyz* pos = tail->m024; csXyz* angle = tail->m09C; - for(s32 i = 0; i < 9; pos++, angle++, i++) { + for (s32 i = 0; i < 9; pos++, angle++, i++) { f32 scale = l_HIO.m00C * tial_scale[i]; MtxTrans(pos->x, pos->y, pos->z, FALSE); MtxScale(scale, scale, scale, TRUE); @@ -382,7 +445,7 @@ void tail_draw(bdk_class* i_this, bdk_tail_s* tail) { } /* 00001120-000011A0 .text kamen_break_draw__FP9bdk_class */ -void kamen_break_draw(bdk_class* i_this) { +static void kamen_break_draw(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; J3DModel* model; for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m8FC); i++) { @@ -395,7 +458,7 @@ void kamen_break_draw(bdk_class* i_this) { } /* 000011A0-00001278 .text obj_draw__FP9bdk_class */ -void obj_draw(bdk_class* i_this) { +static void obj_draw(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; g_env_light.settingTevStruct(TEV_TYPE_BG3, &actor->current.pos, &i_this->m6224); J3DModel* model = i_this->mp62D8; @@ -413,7 +476,7 @@ void obj_draw(bdk_class* i_this) { static s32 kamen_pt[] = {0, 1, 2, 3}; /* 00001278-00001488 .text kamen_draw__FP9bdk_class */ -void kamen_draw(bdk_class* i_this) { +static void kamen_draw(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; J3DModel* kamen_model = i_this->mp8F0; f32 fVar1 = i_this->m2FA * (REG0_F(14) + 150.0f); @@ -425,7 +488,7 @@ void kamen_draw(bdk_class* i_this) { fVar3 = REG8_F(18) + 1.20f; } - MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(0x18), *calc_mtx); // j_dk_atama1 joint + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_ATAMA1), *calc_mtx); cMtx_YrotM(*calc_mtx, sVar1 + 0x4000); cMtx_ZrotM(*calc_mtx, sVar2 + -0x4000); MtxTrans(0.0f, 40.0f, 125.0f, TRUE); @@ -441,7 +504,7 @@ void kamen_draw(bdk_class* i_this) { } /* 00001488-000014D0 .text eff_hane_draw__FP9bdk_classP9bdk_eff_s */ -void eff_hane_draw(bdk_class* i_this, bdk_eff_s* eff) { +static void eff_hane_draw(bdk_class* i_this, bdk_eff_s* eff) { fopAc_ac_c* actor = &i_this->actor; J3DModel* model = eff->m044; g_env_light.setLightTevColorType(model, &actor->tevStr); @@ -449,14 +512,14 @@ void eff_hane_draw(bdk_class* i_this, bdk_eff_s* eff) { } /* 000014D0-00001518 .text eff_Grock_draw__FP9bdk_classP9bdk_eff_s */ -void eff_Grock_draw(bdk_class* i_this, bdk_eff_s* eff) { +static void eff_Grock_draw(bdk_class* i_this, bdk_eff_s* eff) { J3DModel* model = eff->m044; g_env_light.setLightTevColorType(model, &i_this->m6224); mDoExt_modelUpdateDL(model); } /* 00001518-0000159C .text my_effect_draw__FP9bdk_class */ -void my_effect_draw(bdk_class* i_this) { +static void my_effect_draw(bdk_class* i_this) { bdk_eff_s* eff = &i_this->m261C[0]; for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m261C); i++, eff++) { s8 cVar1 = eff->m000; @@ -475,7 +538,7 @@ static BOOL daBdk_Draw(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; J3DModel* model = i_this->mpMorf->getModel(); - #if VERSION > VERSION_DEMO +#if VERSION > VERSION_DEMO if (i_this->m259E > 1) { mDoGph_gInf_c::setBlureRate(i_this->m259E); mDoGph_gInf_c::onBlure(); @@ -483,7 +546,7 @@ static BOOL daBdk_Draw(bdk_class* i_this) { i_this->m259E = 0; mDoGph_gInf_c::mBlureFlag = FALSE; } - #endif +#endif if (!dComIfGs_isStageBossEnemy()) { fopAc_ac_c* player = dComIfGp_getLinkPlayer(); @@ -499,17 +562,9 @@ static BOOL daBdk_Draw(bdk_class* i_this) { model_2bc->setWeightAnmMtx(i, model->getWeightAnmMtx(i)); } - cXyz shadow_pos ( - actor->current.pos.x, - actor->current.pos.y + (REG0_F(1) * 10.0f), - actor->current.pos.z) - ; + cXyz shadow_pos(actor->current.pos.x, actor->current.pos.y + (REG0_F(1) * 10.0f), actor->current.pos.z); f32 p5 = REG0_F(2) * 10.0f + 2000; - i_this->m2C0 = dComIfGd_setRealShadow( - i_this->m2C0, 1, i_this->mp2BC, - &shadow_pos, - p5, 0.0f, &actor->tevStr - ); + i_this->m2C0 = dComIfGd_setRealShadow(i_this->m2C0, 1, i_this->mp2BC, &shadow_pos, p5, 0.0f, &actor->tevStr); kamen_draw(i_this); for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m300); i++) { @@ -525,7 +580,7 @@ static BOOL daBdk_Draw(bdk_class* i_this) { } /* 000018C4-00001BA0 .text pos_move__FP9bdk_class */ -void pos_move(bdk_class* i_this) { +static void pos_move(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz diff; cXyz out; @@ -534,9 +589,7 @@ void pos_move(bdk_class* i_this) { s16 targetAngleY = -cM_atan2s(diff.y, std::sqrtf(diff.x * diff.x + diff.z * diff.z)); s16 sVar1 = actor->current.angle.y; - cLib_addCalcAngleS2(&actor->current.angle.y, targetAngleXZ, - REG0_S(3) + 10, - i_this->m2DC * i_this->m2E0); + cLib_addCalcAngleS2(&actor->current.angle.y, targetAngleXZ, REG0_S(3) + 10, i_this->m2DC * i_this->m2E0); sVar1 = (sVar1 - actor->current.angle.y) * 0x20; s16 sVar2 = REG0_S(1) + 5500; @@ -547,13 +600,9 @@ void pos_move(bdk_class* i_this) { sVar1 = -sVar2; } - cLib_addCalcAngleS2(&actor->current.angle.z, (s16)sVar1, - REG0_S(3) + 10, - i_this->m2DC * i_this->m2E0 * 0.5f); + cLib_addCalcAngleS2(&actor->current.angle.z, (s16)sVar1, REG0_S(3) + 10, i_this->m2DC * i_this->m2E0 * 0.5f); - cLib_addCalcAngleS2(&actor->current.angle.x, targetAngleY, - REG0_S(3) + 10, - i_this->m2DC*i_this->m2E0); + cLib_addCalcAngleS2(&actor->current.angle.x, targetAngleY, REG0_S(3) + 10, i_this->m2DC * i_this->m2E0); cLib_addCalc2(&i_this->m2E0, 1.0f, 1.0f, 0.05f); cLib_addCalc2(&actor->speedF, i_this->m2E4, 1.0f, i_this->m2E8); @@ -573,20 +622,20 @@ void pos_move(bdk_class* i_this) { actor->speed.z = out.z; if (i_this->mpMorf->getFrame() < 20.0f) { - actor->speed.y -= REG0_F(9) + 1.5f; + actor->speed.y -= DEMO_SELECT(REG14_F(9), REG0_F(9)) + 1.5f; } else { - actor->speed.y += REG0_F(10) + 1.5f; + actor->speed.y += DEMO_SELECT(REG14_F(10), REG0_F(10)) + 1.5f; } } actor->current.pos += actor->speed; } /* 00001BA0-00001CE0 .text ground_move__FP9bdk_class */ -void ground_move(bdk_class* i_this) { +static void ground_move(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz diff; cXyz out; - cLib_addCalcAngleS2(&actor->current.angle.z, 0, 2 , 0x800); + cLib_addCalcAngleS2(&actor->current.angle.z, 0, 2, 0x800); cLib_addCalcAngleS2(&actor->current.angle.x, 0, 2, 0x800); cLib_addCalc2(&actor->speedF, i_this->m2E4, 1.0f, i_this->m2E8); @@ -607,53 +656,53 @@ void ground_move(bdk_class* i_this) { cLib_addCalc2(&i_this->m2E0, 1.0f, 1.0f, 0.1f); } - /* 00001CE0-00001EB4 .text up_fly__FP9bdk_class */ -void up_fly(bdk_class* i_this) { +static void up_fly(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz diff; cXyz out; u8 pos_flag = 0; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); - i_this->m2618 = 0x19; - cMtx_YrotS(*calc_mtx, actor->current.angle.y); - diff.x = 0.0f; - diff.y = 2000.0f; - diff.z = 5000.0f; - MtxPosition(&diff, &out); - i_this->m2CC = actor->current.pos + out; - i_this->mState++; - i_this->m2E4 = 0.0f; - i_this->m2E8 = 1.0f; - actor->speedF = 0.0f; - break; - case 1: { - s32 frame = i_this->mpMorf->getFrame(); - if (frame == REG0_S(7) + 0x17) { - i_this->mState = 2; - actor->speedF = REG0_F(8) + 50.0f; - i_this->m2E4 = 40.0f; - i_this->m2E8 = REG0_F(9) + 1.0f; - actor->current.angle.x = -0x3000; - } else { - pos_flag = 1; + case 0: + anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); + i_this->m2618 = 0x19; + cMtx_YrotS(*calc_mtx, actor->current.angle.y); + diff.x = 0.0f; + diff.y = 2000.0f; + diff.z = 5000.0f; + MtxPosition(&diff, &out); + i_this->m2CC = actor->current.pos + out; + i_this->mState++; + i_this->m2E4 = 0.0f; + i_this->m2E8 = 1.0f; + actor->speedF = 0.0f; + break; + case 1: + { + s32 frame = i_this->mpMorf->getFrame(); + if (frame == DEMO_SELECT(REG12_S(7), REG0_S(7)) + 0x17) { + i_this->mState = 2; + actor->speedF = DEMO_SELECT(REG12_F(8), REG0_F(8)) + 50.0f; + i_this->m2E4 = 40.0f; + i_this->m2E8 = DEMO_SELECT(REG12_F(9), REG0_F(9)) + 1.0f; + actor->current.angle.x = -0x3000; + } else { + pos_flag = 1; + break; + } + // Fall-through + } + case 2: + i_this->m2E0 = 0.0f; + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACTION_FLY; + i_this->m2CA = -1; + i_this->mState = 0; + } + break; + default: break; - } - // Fall-through - } - case 2: - i_this->m2E0 = 0.0f; - if (i_this->mpMorf->isStop()) { - i_this->mAction = ACTION_FLY; - i_this->m2CA = -1; - i_this->mState = 0; - } - break; - default: - break; } if (!pos_flag) { @@ -662,95 +711,105 @@ void up_fly(bdk_class* i_this) { } /* 00001EB4-00002368 .text fly__FP9bdk_class */ -void fly(bdk_class* i_this) { +static void fly(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz diff; i_this->mF10 = 1; switch (i_this->m2CA) { - case 0: - break; - case -1: - anm_init(i_this, BDK_BCK_FLY1, 10.0f, 2, 1.0f, BDK_BAS_FLY1, 0); - i_this->m2CA = 0; - break; - default: - break; + case 0: + break; + case -1: + anm_init(i_this, BDK_BCK_FLY1, 10.0f, 2, 1.0f, BDK_BAS_FLY1, 0); + i_this->m2CA = 0; + break; + default: + break; } i_this->m2E4 = l_HIO.m020; - i_this->m2E8 = REG0_F(9) + 1.0f; + i_this->m2E8 = DEMO_SELECT(REG12_F(9), REG0_F(9)) + 1.0f; i_this->m2DC = 600.0f; switch (i_this->mState) { - case 0: - if (i_this->m2FC == 0) { - i_this->m2FC = cM_rndF(2.990f); - } else { - if (cM_rndF(1.0f) < 0.8f) { - if (i_this->m2FC == 1) { - i_this->m2FC = 2; - } else if (i_this->m2FC == 2) { - i_this->m2FC = 1; + case 0: + if (i_this->m2FC == 0) { + i_this->m2FC = cM_rndF(2.990f); + } else { + if (cM_rndF(1.0f) < 0.8f) { + if (i_this->m2FC == 1) { + i_this->m2FC = 2; + } else if (i_this->m2FC == 2) { + i_this->m2FC = 1; + } + } else { + i_this->m2FC = 0; } - } else { - i_this->m2FC = 0; } - } - if (i_this->m2FC == 0) { - actor->home.pos.x = REG0_F(0) + 6500.0f; - actor->home.pos.y = REG0_F(1) + 11000.0f; - actor->home.pos.z = REG0_F(2) + 2600.0f; + if (i_this->m2FC == 0) { + actor->home.pos.x = DEMO_SELECT(REG14_F(0), REG0_F(0)) + 6500.0f; + actor->home.pos.y = DEMO_SELECT(REG14_F(1), REG0_F(1)) + 11000.0f; + actor->home.pos.z = DEMO_SELECT(REG14_F(2), REG0_F(2)) + 2600.0f; - i_this->m2CC.x = actor->home.pos.x + cM_rndFX(REG0_F(3) + 3000.0f); - i_this->m2CC.y = actor->home.pos.y + 1000.0f; - i_this->m2CC.z = actor->home.pos.z + cM_rndFX(REG0_F(3) + 3000.0f); - } else if (i_this->m2FC == 1) { - actor->home.pos.x = REG0_F(0) + 9800.0f; - actor->home.pos.y = REG0_F(1) + 12000.0f; - actor->home.pos.z = REG0_F(2) + -1500.0f; + i_this->m2CC.x = actor->home.pos.x + cM_rndFX(DEMO_SELECT(REG14_F(3), REG0_F(3)) + 3000.0f); + i_this->m2CC.y = actor->home.pos.y + 1000.0f; + i_this->m2CC.z = actor->home.pos.z + cM_rndFX(DEMO_SELECT(REG14_F(3), REG0_F(3)) + 3000.0f); + } else if (i_this->m2FC == 1) { + actor->home.pos.x = DEMO_SELECT(REG14_F(0), REG0_F(0)) + 9800.0f; + actor->home.pos.y = DEMO_SELECT(REG14_F(1), REG0_F(1)) + 12000.0f; + actor->home.pos.z = DEMO_SELECT(REG14_F(2), REG0_F(2)) + -1500.0f; - i_this->m2CC.x = actor->home.pos.x + cM_rndFX(REG0_F(3) + 1000.0f); - i_this->m2CC.y = actor->home.pos.y + cM_rndF(1000.0f); - i_this->m2CC.z = actor->home.pos.z + cM_rndFX(REG0_F(3) + 1000.0f); - } else if (i_this->m2FC == 2) { - actor->home.pos.x = REG0_F(0) + -1000.0f; - actor->home.pos.y = REG0_F(1) + 12000.0f; - actor->home.pos.z = REG0_F(2) + -2900.0f; + i_this->m2CC.x = actor->home.pos.x + cM_rndFX(DEMO_SELECT(REG14_F(3), REG0_F(3)) + 1000.0f); + i_this->m2CC.y = actor->home.pos.y + cM_rndF(1000.0f); + i_this->m2CC.z = actor->home.pos.z + cM_rndFX(DEMO_SELECT(REG14_F(3), REG0_F(3)) + 1000.0f); + } else if (i_this->m2FC == 2) { + actor->home.pos.x = DEMO_SELECT(REG14_F(0), REG0_F(0)) + -1000.0f; + actor->home.pos.y = DEMO_SELECT(REG14_F(1), REG0_F(1)) + 12000.0f; + actor->home.pos.z = DEMO_SELECT(REG14_F(2), REG0_F(2)) + -2900.0f; - i_this->m2CC.x = actor->home.pos.x + cM_rndFX(REG0_F(3) + 1000.0f); - i_this->m2CC.y = actor->home.pos.y + 1000.0f; - i_this->m2CC.z = actor->home.pos.z + cM_rndFX(REG0_F(3) + 1000.0f); - } - i_this->m2E0 = 0.0f; - diff = i_this->m2CC - actor->current.pos; - if (diff.abs() > 1000.0f) { - i_this->mState++; - i_this->m2EC[0] = 0; - } - break; - case 1: - diff = i_this->m2CC - actor->current.pos; - if (diff.abs() < 1500.0f) { - if (i_this->m2FC == 0 || cM_rndF(1.0f) < 0.3f || i_this->m2593 >= 4 || i_this->m8F8 < 2) { - i_this->mAction = ACTION_LANDING; - i_this->m2593 = 0; - i_this->mState = 0; - } else { - i_this->mAction = ACTION_FLY_ATTACK; - i_this->mState = 0; - i_this->m2593++; + i_this->m2CC.x = actor->home.pos.x + cM_rndFX(DEMO_SELECT(REG14_F(3), REG0_F(3)) + 1000.0f); + i_this->m2CC.y = actor->home.pos.y + 1000.0f; + i_this->m2CC.z = actor->home.pos.z + cM_rndFX(DEMO_SELECT(REG14_F(3), REG0_F(3)) + 1000.0f); } - } - break; - default: - break; + i_this->m2E0 = 0.0f; + diff = i_this->m2CC - actor->current.pos; + if (diff.abs() > 1000.0f) { + i_this->mState++; + i_this->m2EC[0] = 0; + } + break; + case 1: + diff = i_this->m2CC - actor->current.pos; + if (diff.abs() < 1500.0f) { +#if VERSION > VERSION_DEMO + if (i_this->m2FC == 0 || cM_rndF(1.0f) < 0.3f || i_this->m2593 >= 4 || i_this->m8F8 < 2) { + i_this->mAction = ACTION_LANDING; + i_this->m2593 = 0; +#else + if (i_this->m2FC == 0 || cM_rndF(1.0f) < 0.3f || i_this->m2593 >= 4) { + i_this->mAction = ACTION_LANDING; + i_this->m2593 = 0; + if (cM_rndF(1.0f) < 0.3f) { + i_this->mState = -2; + break; + } +#endif + i_this->mState = 0; + } else { + i_this->mAction = ACTION_FLY_ATTACK; + i_this->mState = 0; + i_this->m2593++; + } + } + break; + default: + break; } pos_move(i_this); } /* 00002368-000029F4 .text landing__FP9bdk_class */ -void landing(bdk_class* i_this) { +static void landing(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); cXyz diff1; @@ -761,106 +820,121 @@ void landing(bdk_class* i_this) { u8 eff_hane_num = 0; i_this->mF10 = 1; switch (i_this->mState) { - case -2: - case 0: { - s16 angle = fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0)); - cMtx_YrotS(*calc_mtx, angle); - diff2.x = 0.0f; - diff2.y = 0.0f; - if (i_this->mState == 0) { - diff2.z = -800.0f; - } else { - diff2.z = 0.0f; - } + case -2: + case 0: + { + s16 angle = fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0)); + cMtx_YrotS(*calc_mtx, angle); + diff2.x = 0.0f; + diff2.y = 0.0f; + if (i_this->mState == 0) { + diff2.z = -800.0f; + } else { + diff2.z = 0.0f; + } - MtxPosition(&diff2, &out); - i_this->m2CC = player->current.pos + out; - if (land_area_check(&i_this->m2CC, 1400.0f)) { - i_this->m2CC.y += REG0_F(2) + 600.0f; - i_this->mState = 1; - i_this->m2DC = 1000.0f; - i_this->m2E0 = 0.0f; - i_this->m2EC[0] = 50.0f; - } else { - i_this->mAction = ACTION_FLY; - i_this->mState = 0; - break; - } - // Fall-through - } - case 1: - diff1 = i_this->m2CC - actor->current.pos; - if (diff1.abs() < 1300.0f) { - i_this->mState = 2; - anm_init(i_this, BDK_BCK_TYAKUTI1, 15.0f, 0, 0.001f, BDK_BAS_TYAKUTI1, 0); - i_this->m2E0 = 1.0f; - pos_flag = 1; - } else { - if (i_this->m2EC[0] == 1) { - anm_init(i_this, BDK_BCK_KAKKU1, 30.0f, 2, 1.0f, -1, 0); + MtxPosition(&diff2, &out); + i_this->m2CC = player->current.pos + out; + if (land_area_check(&i_this->m2CC, 1400.0f)) { +#if VERSION > VERSION_DEMO + i_this->m2CC.y += REG0_F(2) + 600.0f; +#else + if (i_this->mState == 0) { + i_this->m2CC.y += REG0_F(2) + 600.0f; + } else { + i_this->m2CC.y += REG0_F(2) + 1000.0f; + } + +#endif + i_this->mState = 1; + i_this->m2DC = 1000.0f; + i_this->m2E0 = 0.0f; + i_this->m2EC[0] = 50.0f; + } else { + i_this->mAction = ACTION_FLY; + i_this->mState = 0; + break; + } + // Fall-through } - } - break; - case 2: - pos_flag = 1; - - cLib_addCalc2(&actor->current.pos.x, i_this->m2CC.x, 1.0f, std::fabsf(actor->speed.x) * i_this->m2E0); - cLib_addCalc2(&actor->current.pos.y, i_this->m2CC.y, 1.0f, std::fabsf(actor->speed.y) * i_this->m2E0); - cLib_addCalc2(&actor->current.pos.z, i_this->m2CC.z, 1.0f, std::fabsf(actor->speed.z) * i_this->m2E0); - cLib_addCalcAngleS2(&actor->current.angle.z, 0, 2, 0x800); - cLib_addCalcAngleS2(&actor->current.angle.x, 0, 2, 0x800); - diff1 = i_this->m2CC - actor->current.pos; - if (diff1.abs() < REG0_F(3) + 300.0f) { - i_this->mState = 3; - } - break; - case 3: - case 4: - pos_flag = 1; - eff_hane_num = 3; - actor->current.pos.y += actor->speed.y; - actor->speed.y += actor->gravity; - - cLib_addCalc2(&actor->current.pos.x, i_this->m2CC.x, 0.2f, std::fabsf(actor->speed.x) * i_this->m2E0); - cLib_addCalc2(&actor->current.pos.z, i_this->m2CC.z, 0.2f, std::fabsf(actor->speed.z) * i_this->m2E0); - cLib_addCalcAngleS2(&actor->current.angle.z, 0, 2, 0x800); - cLib_addCalcAngleS2(&actor->current.angle.x, 0, 2, 0x800); - - if (i_this->m2586 != 0 || i_this->mAcch.ChkGroundHit() || actor->current.pos.y <= i_this->mAcch.GetGroundH() + 1.0f) { - actor->speedF = 0.0f; - - actor->speed.z = 0.0f; - actor->speed.x = 0.0f; - actor->speed.y = -10.0f; - if (i_this->mState == 3) { - anm_init(i_this, BDK_BCK_TYAKUTI1, 5.0f, 0, 1.0f, BDK_BAS_TYAKUTI1, 0); - i_this->mState = 4; - eff_hane_num = 10; - dComIfGp_getVibration().StartShock(REG0_S(2) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - - dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_TYAKUTI_ROCK00, &actor->current.pos, NULL, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &i_this->m6224.mColorK0, &i_this->m6224.mColorK0 - ); - if (i_this->m6078[0] == 0) { - i_this->m6078[0] = 100; - dComIfGp_particle_setToon( - dPa_name::ID_IT_ST_DK_TYAKUTI_SMOKE00, &actor->current.pos, NULL, NULL, - 0xB9, &i_this->m6080[0], (s8)fopAcM_GetRoomNo(actor) - ); + case 1: + diff1 = i_this->m2CC - actor->current.pos; + if (diff1.abs() < 1300.0f) { + i_this->mState = 2; + anm_init(i_this, BDK_BCK_TYAKUTI1, 15.0f, 0, 0.001f, BDK_BAS_TYAKUTI1, 0); + i_this->m2E0 = 1.0f; + pos_flag = 1; + } else { + if (i_this->m2EC[0] == 1) { + anm_init(i_this, BDK_BCK_KAKKU1, 30.0f, 2, 1.0f, -1, 0); } } - } - if (i_this->mpMorf->isStop()) { - i_this->mAction = ACTION_WAIT; - i_this->mState = 0; - i_this->m2EC[3] = cM_rndF(600.0f) + 600.0f; - } - i_this->m2584 = 2; - break; - default: - break; + break; + case 2: + pos_flag = 1; + + cLib_addCalc2(&actor->current.pos.x, i_this->m2CC.x, 1.0f, std::fabsf(actor->speed.x) * i_this->m2E0); + cLib_addCalc2(&actor->current.pos.y, i_this->m2CC.y, 1.0f, std::fabsf(actor->speed.y) * i_this->m2E0); + cLib_addCalc2(&actor->current.pos.z, i_this->m2CC.z, 1.0f, std::fabsf(actor->speed.z) * i_this->m2E0); + cLib_addCalcAngleS2(&actor->current.angle.z, 0, 2, 0x800); + cLib_addCalcAngleS2(&actor->current.angle.x, 0, 2, 0x800); + diff1 = i_this->m2CC - actor->current.pos; + if (diff1.abs() < REG0_F(3) + 300.0f) { + i_this->mState = 3; + } + break; + case 3: + case 4: + pos_flag = 1; + eff_hane_num = 3; + actor->current.pos.y += actor->speed.y; + actor->speed.y += actor->gravity; + + cLib_addCalc2(&actor->current.pos.x, i_this->m2CC.x, 0.2f, std::fabsf(actor->speed.x) * i_this->m2E0); + cLib_addCalc2(&actor->current.pos.z, i_this->m2CC.z, 0.2f, std::fabsf(actor->speed.z) * i_this->m2E0); + cLib_addCalcAngleS2(&actor->current.angle.z, 0, 2, 0x800); + cLib_addCalcAngleS2(&actor->current.angle.x, 0, 2, 0x800); + + if (i_this->m2586 != 0 || i_this->mAcch.ChkGroundHit() || actor->current.pos.y <= i_this->mAcch.GetGroundH() + 1.0f) { + actor->speedF = 0.0f; + + actor->speed.z = 0.0f; + actor->speed.x = 0.0f; + actor->speed.y = -10.0f; + if (i_this->mState == 3) { + anm_init(i_this, BDK_BCK_TYAKUTI1, 5.0f, 0, 1.0f, BDK_BAS_TYAKUTI1, 0); + i_this->mState = 4; + eff_hane_num = 10; + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f)); + + dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_TYAKUTI_ROCK00, + &actor->current.pos, + NULL, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &i_this->m6224.mColorK0, + &i_this->m6224.mColorK0 + ); + if (i_this->m6078[0] == 0) { + i_this->m6078[0] = 100; + dComIfGp_particle_setToon( + dPa_name::ID_IT_ST_DK_TYAKUTI_SMOKE00, &actor->current.pos, NULL, NULL, 0xB9, &i_this->m6080[0], (s8)fopAcM_GetRoomNo(actor) + ); + } + } + } + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACTION_WAIT; + i_this->mState = 0; + i_this->m2EC[3] = cM_rndF(600.0f) + 600.0f; + } + i_this->m2584 = 2; + break; + default: + break; } if (!pos_flag) { @@ -878,7 +952,7 @@ void landing(bdk_class* i_this) { } /* 000029F4-00002F64 .text wait__FP9bdk_class */ -void wait(bdk_class* i_this) { +static void wait(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); @@ -894,130 +968,130 @@ void wait(bdk_class* i_this) { BOOL view = pl_view_check(i_this); switch (i_this->mState) { - case 0: - if (5 <= i_this->m2594 || (2 <= i_this->m2592 && i_this->m8F8 < 4) || !view || i_this->m2EC[3] == 0) { - i_this->mAction = ACTION_UP_FLY; - i_this->m2594 = 0; - i_this->m2592 = 0; - break; - } - anm_init(i_this, BDK_BCK_WAIT1, 10.0f, 2, 1.0f, -1, 0); - i_this->mState = 1; - i_this->m2EC[0] = cM_rndF(30.0f) + 40.0f; - i_this->m2CA = 0; - actor->speedF = 0.0f; - // Fall-through - case 1: - if (angle > 0x3000 || angle < -0x3000) { - i_this->mState = 5; - } else { - if (i_this->m2EC[1] == 0) { - if (!view) { - i_this->mState = 0; - break; - } - if (angle > 0x800) { - if (i_this->m2CA != 1) { - i_this->m2CA = 1; - anm_init(i_this, BDK_BCK_SENKAI_L1, 10.0f, 2, 1.0f, BDK_BAS_SENKAI_L1, 0); - i_this->m2EC[1] = 0x14; - } - } else { - if (angle < -0x800) { - if (i_this->m2CA != 2) { - i_this->m2CA = 2; - anm_init(i_this, BDK_BCK_SENKAI_R1, 10.0f, 2, 1.0f, BDK_BAS_SENKAI_R1, 0); - i_this->m2EC[1] = 0x14; - } - } else if (i_this->m2CA != 3) { - i_this->m2CA = 3; - anm_init(i_this, BDK_BCK_WAIT1, 10.0f, 2, 1.0f, -1, 0); - i_this->m2EC[1] = 0x14; - } - } + case 0: + if (5 <= i_this->m2594 || (2 <= i_this->m2592 && i_this->m8F8 < 4) || !view || i_this->m2EC[3] == 0) { + i_this->mAction = ACTION_UP_FLY; + i_this->m2594 = 0; + i_this->m2592 = 0; + break; } - if (i_this->m2CA != 3) { - i_this->m2DC = REG0_F(0) + 800.0f; - } - if ((i_this->m2EC[0] == 0) && (i_this->m2CA == 3)) { - if (l_HIO.m014 != 0) { - if (l_HIO.m014 == 1) { - i_this->mAction = ACTION_KUTI_ATTACK; - } else if (l_HIO.m014 == 2) { - i_this->mAction = ACTION_WIND_ATTACK; - } - i_this->mState = 0; - } else { - i_this->m2592++; - if (dist < REG0_F(11) + 450.0f) { - i_this->mAction = ACTION_JIDA_ATTACK; + anm_init(i_this, BDK_BCK_WAIT1, 10.0f, 2, 1.0f, -1, 0); + i_this->mState = 1; + i_this->m2EC[0] = cM_rndF(30.0f) + 40.0f; + i_this->m2CA = 0; + actor->speedF = 0.0f; + // Fall-through + case 1: + if (angle > 0x3000 || angle < -0x3000) { + i_this->mState = 5; + } else { + if (i_this->m2EC[1] == 0) { + if (!view) { i_this->mState = 0; - } else if (dist < REG0_F(12) + 550.0f ) { - #if VERSION > VERSION_DEMO - if (i_this->m8F8 < 2) { + break; + } + if (angle > 0x800) { + if (i_this->m2CA != 1) { + i_this->m2CA = 1; + anm_init(i_this, BDK_BCK_SENKAI_L1, 10.0f, 2, 1.0f, BDK_BAS_SENKAI_L1, 0); + i_this->m2EC[1] = 0x14; + } + } else { + if (angle < -0x800) { + if (i_this->m2CA != 2) { + i_this->m2CA = 2; + anm_init(i_this, BDK_BCK_SENKAI_R1, 10.0f, 2, 1.0f, BDK_BAS_SENKAI_R1, 0); + i_this->m2EC[1] = 0x14; + } + } else if (i_this->m2CA != 3) { + i_this->m2CA = 3; + anm_init(i_this, BDK_BCK_WAIT1, 10.0f, 2, 1.0f, -1, 0); + i_this->m2EC[1] = 0x14; + } + } + } + if (i_this->m2CA != 3) { + i_this->m2DC = REG0_F(0) + 800.0f; + } + if ((i_this->m2EC[0] == 0) && (i_this->m2CA == 3)) { + if (l_HIO.m014 != 0) { + if (l_HIO.m014 == 1) { i_this->mAction = ACTION_KUTI_ATTACK; - } else - #endif - { - if (cM_rndF(1.0f) < 0.25f) { - i_this->mAction = ACTION_WIND_ATTACK; - } else { + } else if (l_HIO.m014 == 2) { + i_this->mAction = ACTION_WIND_ATTACK; + } + i_this->mState = 0; + } else { + i_this->m2592++; + if (dist < DEMO_SELECT(REG12_F(11), REG0_F(11)) + 450.0f) { + i_this->mAction = ACTION_JIDA_ATTACK; + i_this->mState = 0; + } else if (dist < DEMO_SELECT(REG12_F(12), REG0_F(12)) + 550.0f) { +#if VERSION > VERSION_DEMO + if (i_this->m8F8 < 2) { i_this->mAction = ACTION_KUTI_ATTACK; + } else +#endif + { + if (cM_rndF(1.0f) < 0.25f) { + i_this->mAction = ACTION_WIND_ATTACK; + } else { + i_this->mAction = ACTION_KUTI_ATTACK; + } + } + i_this->mState = 0; + } else if (dist < DEMO_SELECT(REG12_F(15), REG0_F(15)) + 1300.0f) { + i_this->mState = 2; + anm_init(i_this, BDK_BCK_WALK1, 3.0f, 2, l_HIO.m01C, BDK_BAS_WALK1, 0); + i_this->m2E0 = 0.0f; + actor->speedF = 0.0f; + } else { + if (cM_rndF(1.0f) < 0.5f) { + i_this->mAction = ACTION_JUMP; + i_this->mState = 0; + } else { + i_this->mAction = ACTION_WIND_ATTACK; + i_this->mState = 0; } } - i_this->mState = 0; - } else if (dist < REG0_F(15) + 1300.0f) { - i_this->mState = 2; - anm_init(i_this, BDK_BCK_WALK1, 3.0f, 2, l_HIO.m01C, BDK_BAS_WALK1, 0); - i_this->m2E0 = 0.0f; - actor->speedF = 0.0f; - } else { - if (cM_rndF(1.0f) < 0.5f) { - i_this->mAction = ACTION_JUMP; - i_this->mState = 0; - } else { - i_this->mAction = ACTION_WIND_ATTACK; - i_this->mState = 0; - } } } } - } - break; - case 2: - i_this->m2E4 = l_HIO.m018; - i_this->m2E8 = 1.0f; - if (dist < REG0_F(12) + 530.0f || dist > 1350.0f) { - i_this->mState = 1; - } - break; - case 5: - anm_init(i_this, BDK_BCK_JUMP1, 5.0f, 0, 0.0f, BDK_BAS_JUMP1, 0); - i_this->mState = 6; - fopAcM_GetSpeed_p(actor)->y = REG8_F(9) + 50.0f; - actor->speedF = 0.0f; - // Fall-through - case 6: - i_this->m2DC = 700.0f; - if (fopAcM_GetSpeed_p(actor)->y < 0.0f && fopAcM_GetPosition_p(actor)->y < i_this->mAcch.GetGroundH() + 5.0f) { - anm_init(i_this, BDK_BCK_JUMP1, 2.0f, 0, 1.0f, BDK_BAS_JUMP1, 0); - i_this->mState = 7; - } - break; - case 7: - i_this->m2DC = 0.0f; - if (i_this->mpMorf->isStop()) { - i_this->mState = 1; - } - break; - default: - break; + break; + case 2: + i_this->m2E4 = l_HIO.m018; + i_this->m2E8 = 1.0f; + if (dist < DEMO_SELECT(REG12_F(12), REG0_F(12)) + 530.0f || dist > 1350.0f) { + i_this->mState = 1; + } + break; + case 5: + anm_init(i_this, BDK_BCK_JUMP1, 5.0f, 0, 0.0f, BDK_BAS_JUMP1, 0); + i_this->mState = 6; + fopAcM_GetSpeed_p(actor)->y = REG8_F(9) + 50.0f; + actor->speedF = 0.0f; + // Fall-through + case 6: + i_this->m2DC = 700.0f; + if (fopAcM_GetSpeed_p(actor)->y < 0.0f && fopAcM_GetPosition_p(actor)->y < i_this->mAcch.GetGroundH() + 5.0f) { + anm_init(i_this, BDK_BCK_JUMP1, 2.0f, 0, 1.0f, BDK_BAS_JUMP1, 0); + i_this->mState = 7; + } + break; + case 7: + i_this->m2DC = 0.0f; + if (i_this->mpMorf->isStop()) { + i_this->mState = 1; + } + break; + default: + break; } ground_move(i_this); } /* 00002F64-00003164 .text jump__FP9bdk_class */ -void jump(bdk_class* i_this) { +static void jump(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz diff; cXyz out; @@ -1028,49 +1102,49 @@ void jump(bdk_class* i_this) { i_this->m2DC = 500.0f; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); - i_this->m2618 = 0x19; - i_this->mState = 1; - i_this->m2CC = player->current.pos; - break; - case 1: - if (REG0_S(7) + 0x17 != (s32)i_this->mpMorf->getFrame()) { + case 0: + anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); + i_this->m2618 = 0x19; + i_this->mState = 1; + i_this->m2CC = player->current.pos; break; - } - actor->speed.y = REG8_F(9) + 50.0f; - i_this->mState = 2; - i_this->m2586 = 0; - diff.x = 0.0f; - diff.y = 0.0f; - diff.z = 10000.0f; - cMtx_YrotS(*calc_mtx, actor->current.angle.y); - MtxPosition(&diff, &out); + case 1: + if (DEMO_SELECT(REG12_S(7), REG0_S(7)) + 0x17 != (s32)i_this->mpMorf->getFrame()) { + break; + } + actor->speed.y = REG8_F(9) + 50.0f; + i_this->mState = 2; + i_this->m2586 = 0; + diff.x = 0.0f; + diff.y = 0.0f; + diff.z = 10000.0f; + cMtx_YrotS(*calc_mtx, actor->current.angle.y); + MtxPosition(&diff, &out); - i_this->m2CC = out + actor->current.pos; - i_this->m2EC[0] = REG8_S(5) + 0x1E; - // Fall-through - case 2: - actor->speedF = REG8_F(10) + 30.0f; - i_this->m2E4 = 30.0f; - i_this->m2E8 = 30.0f; - if (actor->speed.y < 0.0f) { - actor->speed.y = 0.0f; - } - if (i_this->m2EC[0] == 0) { - anm_init(i_this, BDK_BCK_TYAKUTI1, 15.0f, 0, 0.001f, BDK_BAS_TYAKUTI1, 0); - i_this->mAction = ACTION_LANDING; - i_this->mState = 3; - } - break; - default: - break; + i_this->m2CC = out + actor->current.pos; + i_this->m2EC[0] = REG8_S(5) + 0x1E; + // Fall-through + case 2: + actor->speedF = REG8_F(10) + 30.0f; + i_this->m2E4 = 30.0f; + i_this->m2E8 = 30.0f; + if (actor->speed.y < 0.0f) { + actor->speed.y = 0.0f; + } + if (i_this->m2EC[0] == 0) { + anm_init(i_this, BDK_BCK_TYAKUTI1, 15.0f, 0, 0.001f, BDK_BAS_TYAKUTI1, 0); + i_this->mAction = ACTION_LANDING; + i_this->mState = 3; + } + break; + default: + break; } ground_move(i_this); } /* 00003164-0000345C .text jida_attack__FP9bdk_class */ -void jida_attack(bdk_class* i_this) { +static void jida_attack(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); @@ -1079,67 +1153,73 @@ void jida_attack(bdk_class* i_this) { i_this->mF10 = 1; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_JIDANDA1, 10.0f, 2, 1.0f, BDK_BAS_JIDANDA1, 0); - i_this->mState = 1; - i_this->m2EC[0] = (s16)cM_rndF(5.0f) * 0x18; - // Fall-through - case 1: { - if (!(i_this->m2C4 & 7)) { - eff_hane_set(i_this, &i_this->m1168, 1, 0); - } - i_this->m2584 = 2; - s32 frame = (s32)i_this->mpMorf->getFrame(); - if (frame == 1 || frame == 0xD) { - s32 index = 0; - if (frame == 0xD) { - index = 1; + case 0: + anm_init(i_this, BDK_BCK_JIDANDA1, 10.0f, 2, 1.0f, BDK_BAS_JIDANDA1, 0); + i_this->mState = 1; + i_this->m2EC[0] = (s16)cM_rndF(5.0f) * 0x18; + // Fall-through + case 1: + { + if (!(i_this->m2C4 & 7)) { + eff_hane_set(i_this, &i_this->m1168, 1, 0); } - dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_JIDANDA_ROCK00, &i_this->m1174[index], NULL, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &i_this->m6224.mColorK0, &i_this->m6224.mColorK0 - ); - if (i_this->m6078[1] == 0) { - i_this->m6078[1] = 0xA; - dComIfGp_particle_setToon( - dPa_name::ID_IT_ST_DK_JIDANDA_SMOKE00, &i_this->m1174[index], 0, NULL, 0xB9, - &i_this->m6080[1], (s8)fopAcM_GetRoomNo(actor) - ); + i_this->m2584 = 2; + s32 frame = (s32)i_this->mpMorf->getFrame(); + if (frame == 1 || frame == 0xD) { + s32 index = 0; + if (frame == 0xD) { + index = 1; + } + dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_JIDANDA_ROCK00, + &i_this->m1174[index], + NULL, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &i_this->m6224.mColorK0, + &i_this->m6224.mColorK0 + ); + if (i_this->m6078[1] == 0) { + i_this->m6078[1] = 0xA; + dComIfGp_particle_setToon( + dPa_name::ID_IT_ST_DK_JIDANDA_SMOKE00, &i_this->m1174[index], 0, NULL, 0xB9, &i_this->m6080[1], (s8)fopAcM_GetRoomNo(actor) + ); + } + } + + if ((frame >= 4 && frame <= 0xB) || (frame >= 0x10 && frame <= 0x17)) { + cLib_addCalcAngleS2(&actor->current.angle.y, fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0)), 8, 0x200); + vec1.z = DEMO_SELECT(REG6_F(1), REG0_F(1)) + 10.0f; + + if (frame == 4 || frame == 0x10) { + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 4, -0x21, cXyz(0.0f, 1.0f, 0.0f)); + } + } else { + vec1.z = 0.0f; + } + + cMtx_YrotS(*calc_mtx, fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0))); + + vec1.x = 0.0f; + vec1.y = -10.0f; + MtxPosition(&vec1, &actor->speed); + actor->current.pos += actor->speed; + + if (i_this->m2EC[0] == 0 || dist > 600.0f) { + i_this->mAction = ACTION_WAIT; + i_this->mState = 0; + } + break; } - } - - if ((frame >= 4 && frame <= 0xB) || (frame >= 0x10 && frame <= 0x17)) { - cLib_addCalcAngleS2(&actor->current.angle.y, fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0)), 8, 0x200); - vec1.z = REG0_F(1) + 10.0f; - - if (frame == 4 || frame == 0x10) { - dComIfGp_getVibration().StartShock(REG0_S(2) + 4, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - } - } else { - vec1.z = 0.0f; - } - - cMtx_YrotS(*calc_mtx, fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0))); - - vec1.x = 0.0f; - vec1.y = -10.0f; - MtxPosition(&vec1, &actor->speed); - actor->current.pos += actor->speed; - - if (i_this->m2EC[0] == 0 || dist > 600.0f) { - i_this->mAction = ACTION_WAIT; - i_this->mState = 0; - } - break; - } - default: - break; + default: + break; } } /* 0000345C-00003BC4 .text kuti_attack__FP9bdk_class */ -void kuti_attack(bdk_class* i_this) { +static void kuti_attack(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz vec1; @@ -1147,90 +1227,87 @@ void kuti_attack(bdk_class* i_this) { s8 bVar2 = 0; i_this->m1134 = 2500; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_ATTACK1, 5.0f, 0, 1.0f, BDK_BAS_ATTACK1, 0); - i_this->mState = 2; - fopAcM_monsSeStart(actor, JA_SE_CV_DK_ATTACK, 0); - break; - case 2: - if (i_this->mpMorf->getFrame() < 36.0f) { - i_this->m2584 = 1; - } - - if ((s16)(REG0_S(5) + 0x1E) == (s16)i_this->mpMorf->getFrame()) { - i_this->m1138 = REG0_S(6) + 0x1E; - i_this->m1136 = 0; - - fopAcM_seStart(actor, JA_SE_CM_DK_ATTACK, 0); - dComIfGp_getVibration().StartShock(REG0_S(2) + 6, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - - i_this->m261C[0x27].m000 = 2; - i_this->m261C[0x27].m03C = 0; - - cMtx_YrotS(*calc_mtx, actor->shape_angle.y); - vec1.x = 0.0f; - vec1.y = 0.0f; - vec1.z = 500.0f; - MtxPosition(&vec1, &i_this->m261C[0x27].m004); - - i_this->m261C[0x27].m004 += actor->current.pos; - - dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_KUTI_SENKO00, &i_this->m261C[0x27].m004, NULL, NULL, - 0xFF, NULL, -1 - ); - eff_hane_set(i_this, &i_this->m1168, 5, 0); - bVar2 = 1; - } - if (i_this->mpMorf->isStop()) { - anm_init(i_this, BDK_BCK_NUKENAI1, 2.0f, 0, 1.0f, -1, 0); - i_this->mState = 5; - i_this->m2EC[0] = cM_rndF(60.0f) + 90.0f; - - mDoAud_seStart(JA_SE_CM_DK_JITABATA, &actor->eyePos, 0x0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - fopAcM_monsSeStart(actor, JA_SE_CV_DK_NUKEZU, 0); - } - break; - case 3: - if (i_this->mpMorf->isStop()) { - i_this->mAction = ACTION_WAIT; - i_this->mState = 0; - } - break; - case 5: - if (i_this->mpMorf->isStop()) { - if (i_this->m2EC[0] == 0) { - bVar1 = 1; - } else { - i_this->mpMorf->setPlaySpeed(-1.0f); - i_this->mState = 6; + case 0: + anm_init(i_this, BDK_BCK_ATTACK1, 5.0f, 0, 1.0f, BDK_BAS_ATTACK1, 0); + i_this->mState = 2; + fopAcM_monsSeStart(actor, JA_SE_CV_DK_ATTACK, 0); + break; + case 2: + if (i_this->mpMorf->getFrame() < 36.0f) { + i_this->m2584 = 1; } - } - break; - case 6: - if (i_this->mpMorf->isStop()) { - i_this->mpMorf->setPlaySpeed(1.0f); - i_this->mState = 5; - fopAcM_seStart(actor, JA_SE_CM_DK_JITABATA, 0); - fopAcM_monsSeStart(actor, JA_SE_CV_DK_NUKEZU, 0); - eff_hane_set(i_this, &i_this->m1168, 2, 0); - } - break; - case 10: - if (i_this->mpMorf->isStop()) { - if (i_this->m2EC[0] == 0) { - bVar1 = 1; - } else { + + if ((s16)(REG0_S(5) + 0x1E) == (s16)i_this->mpMorf->getFrame()) { + i_this->m1138 = REG0_S(6) + 0x1E; + i_this->m1136 = 0; + + fopAcM_seStart(actor, JA_SE_CM_DK_ATTACK, 0); + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 6, -0x21, cXyz(0.0f, 1.0f, 0.0f)); + + i_this->m261C[0x27].m000 = 2; + i_this->m261C[0x27].m03C = 0; + + cMtx_YrotS(*calc_mtx, actor->shape_angle.y); + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = 500.0f; + MtxPosition(&vec1, &i_this->m261C[0x27].m004); + + i_this->m261C[0x27].m004 += actor->current.pos; + + dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_KUTI_SENKO00, &i_this->m261C[0x27].m004, NULL, NULL, 0xFF, NULL, -1); + eff_hane_set(i_this, &i_this->m1168, 5, 0); + bVar2 = 1; + } + if (i_this->mpMorf->isStop()) { anm_init(i_this, BDK_BCK_NUKENAI1, 2.0f, 0, 1.0f, -1, 0); i_this->mState = 5; + i_this->m2EC[0] = cM_rndF(60.0f) + 90.0f; + + mDoAud_seStart(JA_SE_CM_DK_JITABATA, &actor->eyePos, 0x0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + fopAcM_monsSeStart(actor, JA_SE_CV_DK_NUKEZU, 0); + } + break; + case 3: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACTION_WAIT; + i_this->mState = 0; + } + break; + case 5: + if (i_this->mpMorf->isStop()) { + if (i_this->m2EC[0] == 0) { + bVar1 = 1; + } else { + i_this->mpMorf->setPlaySpeed(-1.0f); + i_this->mState = 6; + } + } + break; + case 6: + if (i_this->mpMorf->isStop()) { + i_this->mpMorf->setPlaySpeed(1.0f); + i_this->mState = 5; fopAcM_seStart(actor, JA_SE_CM_DK_JITABATA, 0); fopAcM_monsSeStart(actor, JA_SE_CV_DK_NUKEZU, 0); + eff_hane_set(i_this, &i_this->m1168, 2, 0); } - eff_hane_set(i_this, &i_this->m1168, 2, 0); - } - break; - default: - break; + break; + case 10: + if (i_this->mpMorf->isStop()) { + if (i_this->m2EC[0] == 0) { + bVar1 = 1; + } else { + anm_init(i_this, BDK_BCK_NUKENAI1, 2.0f, 0, 1.0f, -1, 0); + i_this->mState = 5; + fopAcM_seStart(actor, JA_SE_CM_DK_JITABATA, 0); + fopAcM_monsSeStart(actor, JA_SE_CV_DK_NUKEZU, 0); + } + eff_hane_set(i_this, &i_this->m1168, 2, 0); + } + break; + default: + break; } if (i_this->m2EC[2] == 1 || bVar1 != 0) { anm_init(i_this, BDK_BCK_NUKU1, 1.0f, 0, 1.0f, -1, 0); @@ -1245,21 +1322,26 @@ void kuti_attack(bdk_class* i_this) { i_this->m6078[2] = 0x3c; dComIfGp_particle_setToon( - dPa_name::ID_IT_ST_DK_KUTI_SMOKE00, &i_this->m261C[0x27].m004, 0, NULL, 0xB9, - &i_this->m6080[2], (s8)fopAcM_GetRoomNo(actor) + dPa_name::ID_IT_ST_DK_KUTI_SMOKE00, &i_this->m261C[0x27].m004, 0, NULL, 0xB9, &i_this->m6080[2], (s8)fopAcM_GetRoomNo(actor) ); } dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_KUTI_ROCK00, &i_this->m261C[0x27].m004, NULL, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &i_this->m6224.mColorK0, &i_this->m6224.mColorK0 + dPa_name::ID_IT_SN_DK_KUTI_ROCK00, + &i_this->m261C[0x27].m004, + NULL, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &i_this->m6224.mColorK0, + &i_this->m6224.mColorK0 ); } actor->current.pos.y += actor->speed.y; } /* 00003BC4-00003D9C .text wind_set__FP9bdk_classP4cXyz */ -void wind_set(bdk_class* i_this, cXyz* param2) { +static void wind_set(bdk_class* i_this, cXyz* param2) { fopAc_ac_c* actor = &i_this->actor; fopAc_ac_c* player; camera_class* camera; @@ -1270,7 +1352,7 @@ void wind_set(bdk_class* i_this, cXyz* param2) { player = dComIfGp_getPlayer(0); vec1.y = 0.0f; vec1.x = 0.0f; - vec1.z = REG0_F(4) + 100.0f; + vec1.z = DEMO_SELECT(REG6_F(4), REG0_F(4)) + 100.0f; for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m2494); i++) { if (i_this->m2488[i] == 0) { @@ -1291,7 +1373,7 @@ void wind_set(bdk_class* i_this, cXyz* param2) { } /* 00003D9C-000045C8 .text fly_attack__FP9bdk_class */ -void fly_attack(bdk_class* i_this) { +static void fly_attack(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; fopAc_ac_c* player = daPy_getPlayerActorClass(); @@ -1301,119 +1383,131 @@ void fly_attack(bdk_class* i_this) { u8 bVar1 = 0; i_this->mF10 = 1; switch (i_this->mState) { - case 0: - i_this->mState = 1; - i_this->m2EC[0] = 0x1E; - i_this->m2E0 = 0.0f; - i_this->m2EC[1] = 200; - i_this->mF18 = cM_rndFX(100.0f); - // Fall-through - case 1: - bVar1 = 1; - i_this->m2CC = player->current.pos; - i_this->m2CC.x = i_this->m2CC.x + i_this->mF18; - i_this->m2CC.z = i_this->m2CC.z + i_this->mF18; - if (i_this->m2EC[0] == 0) { - i_this->m2DC = 400.0f; - } else { - i_this->m2CC.x = 3273.0f; - i_this->m2CC.z = -3108.0f; - i_this->m2DC = 1000.0f; - } - i_this->m2E4 = l_HIO.m024; - i_this->m2E8 = 1.0f; - offset = i_this->m2CC - actor->current.pos; - if (offset.abs() < REG8_F(11) + 1000.0f || i_this->m2EC[1] == 0) { - i_this->mState = 2; - cMtx_YrotS(*calc_mtx, actor->current.angle.y); - - offset2.x = 0.0f; - offset2.y = 500.0f; - offset2.z = 4000.0f; - - MtxPosition(&offset2, &dest); - i_this->m2CC = actor->current.pos + dest; + case 0: + i_this->mState = 1; + i_this->m2EC[0] = 0x1E; i_this->m2E0 = 0.0f; - i_this->m2EC[0] = 0x28; - eff_hane_set(i_this, &i_this->m1168, 10, 0); - } else if (i_this->m2EC[0] == 1) { - anm_init(i_this, BDK_BCK_KAKKU1, 30.0f, 2, 1.0f, -1, 0); - } - break; - case 2: - bVar1 = 1; - offset2.x = 0.0f; - offset2.y = 0.0f; - offset2.z = REG0_F(11) + -1000.0f; - cMtx_YrotS(*calc_mtx, actor->current.angle.y); - MtxPosition(&offset2, &dest); - dest += actor->current.pos; - wind_set(i_this, &dest); - if (i_this->m2EC[0] == 0) { - i_this->mAction = ACTION_FLY; - i_this->m2CA = -1; - i_this->mState = 0; - } - break; - case 10: - anm_init(i_this, BDK_BCK_DAMAGE4, 2.0f, 0, 1.0f, -1, 1); - i_this->mState = 0xB; - actor->speed.y = 0.0f; - i_this->m2EC[0] = REG0_S(5) + 0x28; - i_this->m2EC[1] = REG0_S(6) + 0x50; - dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - fopAcM_seStart(actor, JA_SE_CM_DK_CRASH_WALL, 0); - fopAcM_monsSeStart(actor, JA_SE_CV_DK_KABE_DAMAGE, 0); + i_this->m2EC[1] = 200; + i_this->mF18 = cM_rndFX(100.0f); + // Fall-through + case 1: + bVar1 = 1; + i_this->m2CC = player->current.pos; + i_this->m2CC.x = i_this->m2CC.x + i_this->mF18; + i_this->m2CC.z = i_this->m2CC.z + i_this->mF18; + if (i_this->m2EC[0] == 0) { + i_this->m2DC = 400.0f; + } else { + i_this->m2CC.x = 3273.0f; + i_this->m2CC.z = -3108.0f; + i_this->m2DC = 1000.0f; + } + i_this->m2E4 = l_HIO.m024; + i_this->m2E8 = 1.0f; + offset = i_this->m2CC - actor->current.pos; + if (offset.abs() < REG8_F(11) + 1000.0f || i_this->m2EC[1] == 0) { + i_this->mState = 2; + cMtx_YrotS(*calc_mtx, actor->current.angle.y); - JPABaseEmitter* emitter; - if (i_this->m6078[3] == 0) { - i_this->m6078[3] = 100; - emitter = dComIfGp_particle_setToon( - dPa_name::ID_IT_ST_DK_BUTSUKARI_SMOKE00, &actor->current.pos, &actor->shape_angle, NULL, - 0xB9, &i_this->m6080[3], (s8)fopAcM_GetRoomNo(actor) + offset2.x = 0.0f; + offset2.y = 500.0f; + offset2.z = 4000.0f; + + MtxPosition(&offset2, &dest); + i_this->m2CC = actor->current.pos + dest; + i_this->m2E0 = 0.0f; + i_this->m2EC[0] = 0x28; + eff_hane_set(i_this, &i_this->m1168, 10, 0); + } else if (i_this->m2EC[0] == 1) { + anm_init(i_this, BDK_BCK_KAKKU1, 30.0f, 2, 1.0f, -1, 0); + } + break; + case 2: + bVar1 = 1; + offset2.x = 0.0f; + offset2.y = 0.0f; + offset2.z = REG0_F(11) + -1000.0f; + cMtx_YrotS(*calc_mtx, actor->current.angle.y); + MtxPosition(&offset2, &dest); + dest += actor->current.pos; + wind_set(i_this, &dest); + if (i_this->m2EC[0] == 0) { + i_this->mAction = ACTION_FLY; + i_this->m2CA = -1; + i_this->mState = 0; + } + break; + case 10: + anm_init(i_this, BDK_BCK_DAMAGE4, 2.0f, 0, 1.0f, -1, 1); + i_this->mState = 0xB; + actor->speed.y = 0.0f; + i_this->m2EC[0] = REG0_S(5) + 0x28; + i_this->m2EC[1] = REG0_S(6) + 0x50; + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f)); + fopAcM_seStart(actor, JA_SE_CM_DK_CRASH_WALL, 0); + fopAcM_monsSeStart(actor, JA_SE_CV_DK_KABE_DAMAGE, 0); + + JPABaseEmitter* emitter; + if (i_this->m6078[3] == 0) { + i_this->m6078[3] = 100; + emitter = dComIfGp_particle_setToon( + dPa_name::ID_IT_ST_DK_BUTSUKARI_SMOKE00, + &actor->current.pos, + &actor->shape_angle, + NULL, + 0xB9, + &i_this->m6080[3], + (s8)fopAcM_GetRoomNo(actor) + ); + if (emitter) { + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_MABUTA)); + } + } + emitter = dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_DMG_HANE_M00, + &actor->current.pos, + &actor->shape_angle, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 ); if (emitter) { - emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x1C)); // j_dk_mabuta joint + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_MUNE2)); } - } - emitter = dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_DMG_HANE_M00, &actor->current.pos, &actor->shape_angle, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), &actor->tevStr.mColorK0, &actor->tevStr.mColorK0 - ); - if (emitter) { - emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x16)); // j_dk_mune2 joint - } - // Fall-through - case 0xB: - actor->current.pos.y += actor->speed.y; - if (i_this->mpMorf->isStop()) { - anm_init(i_this, BDK_BCK_PIKUPIKU1, 5.0f, 2, 1.0f, -1, 0); - } - if (i_this->m2EC[0] == 0) { - actor->speed.y -= (0.5f + REG0_F(7)); - actor->current.angle.z += (s16)(REG0_S(7) + 0x50); - if (i_this->m2EC[1] == 0) { - i_this->mState = 0xC; - i_this->m2D8 = actor->current.angle.y + 0x8000; - i_this->m2EC[0] = REG0_S(8) + 0x28; - anm_init(i_this, BDK_BCK_FLY2, 5.0f, 2, 2.0f, BDK_BAS_FLY2, 0); + // Fall-through + case 0xB: + actor->current.pos.y += actor->speed.y; + if (i_this->mpMorf->isStop()) { + anm_init(i_this, BDK_BCK_PIKUPIKU1, 5.0f, 2, 1.0f, -1, 0); } - } - break; - case 0xC: - actor->speed.y += REG0_F(8) + 2.0f; - actor->current.pos.y += actor->speed.y; - cLib_addCalcAngleS2(&actor->current.angle.y, i_this->m2D8, 8, 0x400); + if (i_this->m2EC[0] == 0) { + actor->speed.y -= (0.5f + REG0_F(7)); + actor->current.angle.z += (s16)(REG0_S(7) + 0x50); + if (i_this->m2EC[1] == 0) { + i_this->mState = 0xC; + i_this->m2D8 = actor->current.angle.y + 0x8000; + i_this->m2EC[0] = REG0_S(8) + 0x28; + anm_init(i_this, BDK_BCK_FLY2, 5.0f, 2, 2.0f, BDK_BAS_FLY2, 0); + } + } + break; + case 0xC: + actor->speed.y += REG0_F(8) + 2.0f; + actor->current.pos.y += actor->speed.y; + cLib_addCalcAngleS2(&actor->current.angle.y, i_this->m2D8, 8, 0x400); - if (i_this->m2EC[0] == 0) { - i_this->mAction = ACTION_FLY; - i_this->m2CA = -1; - i_this->mState = 0; - actor->speedF = 0.0f; - } - break; - default: - break; + if (i_this->m2EC[0] == 0) { + i_this->mAction = ACTION_FLY; + i_this->m2CA = -1; + i_this->mState = 0; + actor->speedF = 0.0f; + } + break; + default: + break; } if (i_this->mAction == ACTION_FLY_ATTACK && (i_this->mState < 10)) { i_this->m2584 = 2; @@ -1424,11 +1518,9 @@ void fly_attack(bdk_class* i_this) { for (s32 i = 0; i <= 1; i++) { foot_eff_pos[i] = i_this->m1174[i]; - i_this->mp6214[0 + i] = dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_TSUME_HIBANA_A00, &foot_eff_pos[i], &actor->shape_angle); + i_this->mp6214[0 + i] = dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_TSUME_HIBANA_A00, &foot_eff_pos[i], &actor->shape_angle); - i_this->mp6214[2 + i] = dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_TSUME_HIBANA_B00, &foot_eff_pos[i], &actor->shape_angle); + i_this->mp6214[2 + i] = dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_TSUME_HIBANA_B00, &foot_eff_pos[i], &actor->shape_angle); } i_this->m2619++; } @@ -1442,54 +1534,54 @@ void fly_attack(bdk_class* i_this) { } /* 000045C8-0000491C .text wind_attack__FP9bdk_class */ -void wind_attack(bdk_class* i_this) { +static void wind_attack(bdk_class* i_this) { fopAc_ac_c* player = dComIfGp_getPlayer(0); fopAc_ac_c* actor = &i_this->actor; cXyz offset; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); - i_this->m2618 = 0x19; - i_this->mState++; - i_this->m2CC = actor->current.pos; - i_this->m2E0 = 0; - // Fall-through - case 1: - if (i_this->mpMorf->getFrame() == 23) { - i_this->mState = 2; - i_this->m2CC.y += 500.0f; - } - break; - case 2: - if (i_this->mpMorf->isStop()) { - anm_init(i_this, BDK_BCK_FLY2, 5.0f, 2, 2.0f, BDK_BAS_FLY2, 0); - i_this->mState = 3; - i_this->m2EC[0] = 200; - } - break; - case 3: - wind_set(i_this, &actor->current.pos); - if (!(i_this->m2C4 & 1)) { - offset = i_this->m1168; - offset.x += cM_rndFX(300.0f); - offset.y -= cM_rndF(200.0f); - offset.z += cM_rndFX(300.0f); - eff_hane_set(i_this, &offset, 1, 1); - } - cLib_addCalc2(&i_this->m2608, 1.0f, 1.0f, 0.05f); - cLib_addCalc2(&i_this->m2E0, 1.0f, 1.0f, 0.05f); + case 0: + anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); + i_this->m2618 = 0x19; + i_this->mState++; + i_this->m2CC = actor->current.pos; + i_this->m2E0 = 0; + // Fall-through + case 1: + if (i_this->mpMorf->getFrame() == 23) { + i_this->mState = 2; + i_this->m2CC.y += 500.0f; + } + break; + case 2: + if (i_this->mpMorf->isStop()) { + anm_init(i_this, BDK_BCK_FLY2, 5.0f, 2, 2.0f, BDK_BAS_FLY2, 0); + i_this->mState = 3; + i_this->m2EC[0] = 200; + } + break; + case 3: + wind_set(i_this, &actor->current.pos); + if (!(i_this->m2C4 & 1)) { + offset = i_this->m1168; + offset.x += cM_rndFX(300.0f); + offset.y -= cM_rndF(200.0f); + offset.z += cM_rndFX(300.0f); + eff_hane_set(i_this, &offset, 1, 1); + } + cLib_addCalc2(&i_this->m2608, 1.0f, 1.0f, 0.05f); + cLib_addCalc2(&i_this->m2E0, 1.0f, 1.0f, 0.05f); - if (i_this->m2EC[0] == 0 || i_this->m2F8 != 0) { - i_this->mAction = ACTION_LANDING; - i_this->mState = 3; + if (i_this->m2EC[0] == 0 || i_this->m2F8 != 0) { + i_this->mAction = ACTION_LANDING; + i_this->mState = 3; - i_this->m2CC = player->current.pos; - actor->speed.y = -20.0f; - return; - } - break; - default: - break; + i_this->m2CC = player->current.pos; + actor->speed.y = -20.0f; + return; + } + break; + default: + break; } cLib_addCalcAngleS2(&actor->current.angle.y, fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0)), 4, 0x800); @@ -1499,7 +1591,7 @@ void wind_attack(bdk_class* i_this) { } /* 0000491C-000049C0 .text end_set__FP9bdk_class */ -void end_set(bdk_class* i_this) { +static void end_set(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; i_this->mAction = ACTION_END; i_this->m261C[0x27].m000 = 0; @@ -1519,7 +1611,7 @@ void end_set(bdk_class* i_this) { } /* 000049C0-00005018 .text damage_check__FP9bdk_class */ -void damage_check(bdk_class* i_this) { +static void damage_check(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; fopAc_ac_c* player = daPy_getPlayerActorClass(); @@ -1551,7 +1643,7 @@ void damage_check(bdk_class* i_this) { if (i_this->m2B4 == 1) { i_this->mAction = ACTION_T_DOWN; i_this->mState = 0; - i_this->m2FA = REG0_S(3) + 10; + i_this->m2FA = DEMO_SELECT(REG6_S(3), REG0_S(3)) + 10; i_this->m2F8 = 0x1E; fopAcM_monsSeStart(actor, JA_SE_CV_DK_LAST_DAMAGE, 0); @@ -1559,9 +1651,9 @@ void damage_check(bdk_class* i_this) { mDoAud_bgmStop(0x1E); } else { dComIfGs_onEventBit(dSv_event_flag_c::UNK_3C01); - #if VERSION > VERSION_DEMO +#if VERSION > VERSION_DEMO dScnPly_ply_c::setPauseTimer(5); - #endif +#endif i_this->m8F8++; if (i_this->m8F8 == 4) { i_this->m8F8 = 3; @@ -1569,7 +1661,7 @@ void damage_check(bdk_class* i_this) { i_this->mState = 0; fopAcM_seStart(actor, JA_SE_CM_DK_BREAK_MASK, 0); } else { - i_this->m2FA = REG0_S(3) + 10; + i_this->m2FA = DEMO_SELECT(REG6_S(3), REG0_S(3)) + 10; i_this->m2EC[2] = 0xF; i_this->m2F8 = 0x1E; } @@ -1586,8 +1678,7 @@ void damage_check(bdk_class* i_this) { dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_KAMEN_HAHEN00, i_this->mHeadTgSph.GetTgHitPosP(), &actor->shape_angle, NULL); dKy_SordFlush_set(actor->current.pos, 1); - dComIfGp_getVibration().StartShock(REG0_S(2) + 5, - -0x21, cXyz(0.0f, 1.0f, 0.0f)); + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f)); } else { def_se_set(actor, atInfo.mpObj, 0x40); } @@ -1598,8 +1689,7 @@ void damage_check(bdk_class* i_this) { fopAcM_monsSeStart(actor, JA_SE_CV_DK_DAMAGE, 0); i_this->m1138 = REG0_S(5) + 0x1E; - i_this->m1136 = cM_atan2s(actor->eyePos.x - player->current.pos.x, - actor->eyePos.z - player->current.pos.z); + i_this->m1136 = cM_atan2s(actor->eyePos.x - player->current.pos.x, actor->eyePos.z - player->current.pos.z); if (i_this->mAction == ACTION_KUTI_ATTACK && i_this->m1150.y < 10000.0f) { anm_init(i_this, BDK_BCK_DAMAGE1, 2.0f, 0, 1.0f, -1, 0); @@ -1634,185 +1724,229 @@ void damage_check(bdk_class* i_this) { fopAcM_monsSeStart(actor, JA_SE_CV_DK_LAST_DAMAGE, 0); } else if (sVar1) { JPABaseEmitter* emitter = dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_DMG_HANE_M00, &actor->current.pos, &actor->shape_angle, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &actor->tevStr.mColorK0, &actor->tevStr.mColorK0 + dPa_name::ID_IT_SN_DK_DMG_HANE_M00, + &actor->current.pos, + &actor->shape_angle, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 ); if (emitter) { - emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x16)); // j_dk_mune2 joint + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_MUNE2)); } } } } } static f32 kamen_break_off_x[] = { - 50.0f, 30.0f, -50.0f, -30.0f, + 50.0f, + 30.0f, + -50.0f, + -30.0f, }; static f32 kamen_break_off_y[] = { - 0.0f, -120.0f, 20.0f, 0.0f, + 0.0f, + -120.0f, + 20.0f, + 0.0f, }; static f32 kamen_break_off_z[] = { - 50.0f, 20.0f, 50.0f, 0.0f, + 50.0f, + 20.0f, + 50.0f, + 0.0f, }; static f32 kamen_break_sd_x[] = { - -5.0f, 0.0f, 5.0f, 0.0f, + -5.0f, + 0.0f, + 5.0f, + 0.0f, }; static f32 kamen_break_sd_z[] = { - 0.0f, 5.0f, 0.0f, 0.0f, + 0.0f, + 5.0f, + 0.0f, + 0.0f, }; static u8 kamen_break_time[] = { - 0x1E, 0x2D, 0x28, 0x23, + 0x1E, + 0x2D, + 0x28, + 0x23, }; /* 00005054-000053C4 .text kamen_demo__FP9bdk_class */ -void kamen_demo(bdk_class* i_this) { +static void kamen_demo(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz pos; cXyz dist; i_this->m1134 = 0; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_NUKENAI1, 0.0f, 0, 0.0f, -1, 0); - i_this->mState = 1; - i_this->m25A0 = 1; - fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); - break; - case 1: - i_this->m25A4 = 0; - i_this->m25A6 = 0; - i_this->m25C8 = 45.0f; + case 0: + anm_init(i_this, BDK_BCK_NUKENAI1, 0.0f, 0, 0.0f, -1, 0); + i_this->mState = 1; + i_this->m25A0 = 1; + fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); + break; + case 1: + i_this->m25A4 = 0; + i_this->m25A6 = 0; + i_this->m25C8 = 45.0f; - for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m90C); i++) { - i_this->m90C[i] = 1; - pos.x = 0.0f; - pos.y = 0.0f; - pos.z = 0.0f; + for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m90C); i++) { + i_this->m90C[i] = 1; + pos.x = 0.0f; + pos.y = 0.0f; + pos.z = 0.0f; - MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(0x18), *calc_mtx); // j_dk_atama1 joint - MtxPosition(&pos, &i_this->m910[i]); - i_this->m9A0[i].y = actor->shape_angle.y; - i_this->m9A0[i].x = REG0_S(6) + 0x3625; - i_this->m9A0[i].z = 0; - pos.x = -kamen_break_off_x[i]; - pos.y = 0.01f * REG0_F(15) + (55.0f - kamen_break_off_y[i]); - pos.z = 0.01f * REG0_F(16) + (110.0f - kamen_break_off_z[i]); - cMtx_YrotS(*calc_mtx, i_this->m9A0[i].y); - cMtx_XrotM(*calc_mtx, i_this->m9A0[i].x); - MtxPosition(&pos, &dist); - i_this->m910[i] += dist; - i_this->m940[i].x = i_this->m910[i].x; - i_this->m940[i].y = i_this->m910[i].y; - i_this->m940[i].z = i_this->m910[i].z; - cMtx_YrotS(*calc_mtx, i_this->m9A0[i].y); - pos.x = (1.0f + REG0_F(7)) * kamen_break_sd_x[i]; - pos.y = 0.0f; - pos.z = (1.0f + REG0_F(7)) * kamen_break_sd_z[i]; + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_ATAMA1), *calc_mtx); + MtxPosition(&pos, &i_this->m910[i]); + i_this->m9A0[i].y = actor->shape_angle.y; + i_this->m9A0[i].x = REG0_S(6) + 0x3625; + i_this->m9A0[i].z = 0; + pos.x = -kamen_break_off_x[i]; + pos.y = 0.01f * REG0_F(15) + (55.0f - kamen_break_off_y[i]); + pos.z = 0.01f * REG0_F(16) + (110.0f - kamen_break_off_z[i]); + cMtx_YrotS(*calc_mtx, i_this->m9A0[i].y); + cMtx_XrotM(*calc_mtx, i_this->m9A0[i].x); + MtxPosition(&pos, &dist); + i_this->m910[i] += dist; + i_this->m940[i].x = i_this->m910[i].x; + i_this->m940[i].y = i_this->m910[i].y; + i_this->m940[i].z = i_this->m910[i].z; + cMtx_YrotS(*calc_mtx, i_this->m9A0[i].y); + pos.x = (1.0f + DEMO_SELECT(REG14_F(7), REG0_F(7))) * kamen_break_sd_x[i]; + pos.y = 0.0f; + pos.z = (1.0f + DEMO_SELECT(REG14_F(7), REG0_F(7))) * kamen_break_sd_z[i]; - MtxPosition(&pos, &i_this->m970[i]); - i_this->m9E8[i] = kamen_break_time[i]; - } - i_this->mState = 2; - break; - case 2: - if (i_this->m25A6 > REG0_S(8) + 0x2d) { - i_this->m1134 = 500; - i_this->m113A = 1; - } - if (i_this->m25A6 >= 0x6E && REG8_S(8) == 0) { - i_this->m25A0 = 150; - i_this->mAction = ACTION_KUTI_ATTACK; - anm_init(i_this, BDK_BCK_NUKENAI1, 2.0f, 0, 1.0f, -1, 0); - i_this->mState = 5; - i_this->m2EC[0] = cM_rndF(120.0f) + 30.0f; - mDoAud_bgmStart(JA_BGM_UNK_110); - } - break; - default: - break; + MtxPosition(&pos, &i_this->m970[i]); + i_this->m9E8[i] = kamen_break_time[i]; + } + i_this->mState = 2; + break; + case 2: + if (i_this->m25A6 > DEMO_SELECT(REG14_S(8), REG0_S(8)) + 0x2d) { + i_this->m1134 = 500; + i_this->m113A = 1; + } + if (i_this->m25A6 >= 0x6E && REG8_S(8) == 0) { + i_this->m25A0 = 150; + i_this->mAction = ACTION_KUTI_ATTACK; + anm_init(i_this, BDK_BCK_NUKENAI1, 2.0f, 0, 1.0f, -1, 0); + i_this->mState = 5; + i_this->m2EC[0] = cM_rndF(120.0f) + 30.0f; + mDoAud_bgmStart(JA_BGM_UNK_110); + } + break; + default: + break; } } /* 000053C4-000057E8 .text start__FP9bdk_class */ -void start(bdk_class* i_this) { +static void start(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; daPy_py_c* player = daPy_getPlayerActorClass(); switch (i_this->mState) { - case 0: - if (player->current.pos.y >= 9800.0f && !player->checkPlayerFly()) { - if (i_this->m2EC[0] == 0) { - i_this->mState = 1; - i_this->m25A0 = 10; - i_this->m25A4 = 0; - i_this->m25A6 = 0; - fpcM_Search(&kamome_delete_sub, i_this); - fpcM_Search(&dk_delete_sub, i_this); - fpcM_Search(&kui_delete_sub, i_this); - fpcM_Search(&sea_delete_sub, i_this); - fpcM_Search(&obj_delete_sub, i_this); - fpcM_Search(&bk_delete_sub, i_this); - fpcM_Search(&boko_delete_sub, i_this); - fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); + case 0: + if (player->current.pos.y >= 9800.0f && !player->checkPlayerFly()) { + if (i_this->m2EC[0] == 0) { + i_this->mState = 1; + i_this->m25A0 = 10; + i_this->m25A4 = 0; + i_this->m25A6 = 0; + fpcM_Search(&kamome_delete_sub, i_this); + fpcM_Search(&dk_delete_sub, i_this); + fpcM_Search(&kui_delete_sub, i_this); + fpcM_Search(&sea_delete_sub, i_this); + fpcM_Search(&obj_delete_sub, i_this); + fpcM_Search(&bk_delete_sub, i_this); + fpcM_Search(&boko_delete_sub, i_this); + fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); + } +#if VERSION > VERSION_DEMO + } else { + i_this->m2EC[0] = 0x14; } - } else { - i_this->m2EC[0] = 0x14; - } - break; - case 1: - if (i_this->m25D8 != 0) { - i_this->m25D8 = 0; - i_this->mState = 2; - i_this->m2F6 = REG0_S(6) + 0x19; - actor->current.pos.y = REG0_F(10) + 8500.0f; - actor->speed.y = REG0_F(12) + 80.0f; - anm_init(i_this, BDK_BCK_S_DEMO1, 5.0f, 2, 1.0f, -1, 0); - fopAcM_seStart(actor, JA_SE_CM_DK_ROUND_UP, 0); +#else + break; + } + i_this->m2EC[0] = 0x1E; +#endif + break; + case 1: + if (i_this->m25D8 != 0) { + i_this->m25D8 = 0; + i_this->mState = 2; + i_this->m2F6 = REG0_S(6) + 0x19; + actor->current.pos.y = DEMO_SELECT(REG13_F(10), REG0_F(10)) + 8500.0f; + actor->speed.y = DEMO_SELECT(REG13_F(12), REG0_F(12)) + 80.0f; + anm_init(i_this, BDK_BCK_S_DEMO1, 5.0f, 2, 1.0f, -1, 0); + fopAcM_seStart(actor, JA_SE_CM_DK_ROUND_UP, 0); - dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DEMO_HANE00, &actor->current.pos, &actor->shape_angle, NULL, - 0xFF, &i_this->m61B0, (s8)fopAcM_GetRoomNo(actor), - &actor->tevStr.mColorK0, &actor->tevStr.mColorK0); - } - break; - case 2: - actor->current.pos.y += actor->speed.y; - actor->speed.y -= REG0_F(13) + 1.0f; - actor->current.angle.y += 0x1300; - if (i_this->m25D8 != 0) { - i_this->m25D8 = 0; - i_this->mState = 3; - anm_init(i_this, BDK_BCK_S_DEMO2, 5.0f, 0, 1.0f, BDK_BAS_S_DEMO2, 0); - i_this->m2EC[0] = 0x2D; - } - break; - case 3: - if (i_this->m2EC[0] != 0) { + dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_DEMO_HANE00, + &actor->current.pos, + &actor->shape_angle, + NULL, + 0xFF, + &i_this->m61B0, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 + ); + } + break; + case 2: actor->current.pos.y += actor->speed.y; - actor->speed.y -= REG0_F(13) + 1.0f; - } - if (i_this->m2EC[0] == (s16)(REG8_S(8) + 5)) { - fopAcM_monsSeStart(actor, JA_SE_CV_DK_ENTER, 0); - i_this->m61B0.remove(); - for (s32 i = 0; i < 2; i++) { - JPABaseEmitter* emitter = dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DEMO_HANE01, &actor->current.pos, &actor->shape_angle, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &actor->tevStr.mColorK0, &actor->tevStr.mColorK0); + actor->speed.y -= DEMO_SELECT(REG13_F(13), REG0_F(13)) + 1.0f; + actor->current.angle.y += 0x1300; + if (i_this->m25D8 != 0) { + i_this->m25D8 = 0; + i_this->mState = 3; + anm_init(i_this, BDK_BCK_S_DEMO2, 5.0f, 0, 1.0f, BDK_BAS_S_DEMO2, 0); + i_this->m2EC[0] = 0x2D; + } + break; + case 3: + if (i_this->m2EC[0] != 0) { + actor->current.pos.y += actor->speed.y; + actor->speed.y -= DEMO_SELECT(REG13_F(13), REG0_F(13)) + 1.0f; + } + if (i_this->m2EC[0] == (s16)(REG8_S(8) + 5)) { + fopAcM_monsSeStart(actor, JA_SE_CV_DK_ENTER, 0); + i_this->m61B0.remove(); + for (s32 i = 0; i < 2; i++) { + JPABaseEmitter* emitter = dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_DEMO_HANE01, + &actor->current.pos, + &actor->shape_angle, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 + ); - if (emitter) { - emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x16)); // j_dk_mune2 joint + if (emitter) { + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_MUNE2)); + } } } - } - cLib_addCalcAngleS2(&actor->current.angle.y, - fopAcM_searchActorAngleY(actor, daPy_getPlayerActorClass()), - 10, 0x1300); - default: - break; + cLib_addCalcAngleS2(&actor->current.angle.y, fopAcM_searchActorAngleY(actor, daPy_getPlayerActorClass()), 10, 0x1300); + default: + break; } } /* 000057E8-00005EA0 .text end__FP9bdk_class */ -void end(bdk_class* i_this) { +static void end(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; s8 bVar1 = 0; u16 particle_id = 0; @@ -1823,104 +1957,119 @@ void end(bdk_class* i_this) { offset.y = 0.0f; offset.z = 0.0f; - switch(i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_LAST_DAMAGE1, 2.0f, 0, 1.0f, BDK_BAS_LAST_DAMAGE1, 0); - i_this->mState = 5; - i_this->m2EC[0] = 0xB3; - particle_id = dPa_name::ID_IT_SN_DK_LASTDMG_HANE_W00; - break; - case 1: - anm_init(i_this, BDK_BCK_LAST_DAMAGE3, 2.0f, 0, 1.0f, BDK_BAS_LAST_DAMAGE3, 0); - i_this->mState = 5; - i_this->m2EC[0] = 0xB3; - particle_id = dPa_name::ID_IT_SN_DK_LASTDMG_HANE_W02; - break; - case 2: - anm_init(i_this, BDK_BCK_LAST_DAMAGE2, 2.0f, 0, 1.0f, BDK_BAS_LAST_DAMAGE2, 0); - i_this->mState = 5; - i_this->m2EC[0] = 0; - particle_id = dPa_name::ID_IT_SN_DK_LASTDMG_HANE_W01; - break; - case 5: - if (i_this->mpMorf->isStop()) { - i_this->mState = 6; - anm_init(i_this, BDK_BCK_DEATH1, 2.0f, 2, 1.0f, BDK_BAS_DEATH1, 0); - i_this->m2EC[0] = REG0_S(3) + 300; - - for (s32 i = 0; i <= 1; i++) { - JPABaseEmitter* emitter = dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_DEAD_HANE_A00, &actor->current.pos, NULL, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &actor->tevStr.mColorK0, &actor->tevStr.mColorK0); - - i_this->m6100[i] = emitter; - } - } else { - if (i_this->m2EC[0] == 0) { - cLib_addCalc2(&actor->current.pos.y, 10800.0f, 0.1f, 50.0f); - bVar1 = 1; - } + switch (i_this->mState) { + case 0: + anm_init(i_this, BDK_BCK_LAST_DAMAGE1, 2.0f, 0, 1.0f, BDK_BAS_LAST_DAMAGE1, 0); + i_this->mState = 5; + i_this->m2EC[0] = 0xB3; + particle_id = dPa_name::ID_IT_SN_DK_LASTDMG_HANE_W00; break; - } - // Fall-through - case 6: - bVar1 = 1; - for (s32 i = 0; i <= 1; i++) { - JPABaseEmitter* emitter = i_this->m6100[i]; - if (emitter) { - emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x28 + i * 0xA)); // j_dk_hane_l2 joint, j_dk_hane_r2 joint - } - } - if (i_this->m2EC[0] == 0xAA) { - i_this->m25A0 = 0x6E; - } - cLib_addCalc2(&actor->current.pos.x, 3600.0f, 0.05f, 50.0f); - cLib_addCalc2(&actor->current.pos.y, REG8_F(18) + 15800.0f, 0.1f, - REG8_F(19) + 20.0f); - cLib_addCalc2(&actor->current.pos.z, -3800.0f, 0.05f, 50.0f); - cLib_addCalcAngleS2(&actor->current.angle.y, -8000, 0x10, 0x80); - if (i_this->m2EC[0] == 0x3C) { - fopAcM_seStart(actor, JA_SE_CV_DK_DIE, 0); - anm_init(i_this, BDK_BCK_DEATH2, 5.0f, 0, 1.0f, -1, 0); - } - if (i_this->m2EC[0] == 0 && REG0_S(4) == 0) { - i_this->mState = 7; - for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m90C); i++) { - i_this->m90C[i] = 0; - } - fpcM_Search(&obj2_delete_sub, actor); - i_this->m2CC = actor->current.pos; - i_this->m2CC.y += 200.0f; - actor->current.angle.y = 0x4000; - fopAcM_createDisappear(actor, &i_this->m2CC, 0x32, 2); - mDoAud_seStart(JA_SE_CM_DK_DIE_EXPLODE, &i_this->m2CC, 0x0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - i_this->m2EC[0] = 0x1E; + case 1: + anm_init(i_this, BDK_BCK_LAST_DAMAGE3, 2.0f, 0, 1.0f, BDK_BAS_LAST_DAMAGE3, 0); + i_this->mState = 5; + i_this->m2EC[0] = 0xB3; + particle_id = dPa_name::ID_IT_SN_DK_LASTDMG_HANE_W02; + break; + case 2: + anm_init(i_this, BDK_BCK_LAST_DAMAGE2, 2.0f, 0, 1.0f, BDK_BAS_LAST_DAMAGE2, 0); + i_this->mState = 5; + i_this->m2EC[0] = 0; + particle_id = dPa_name::ID_IT_SN_DK_LASTDMG_HANE_W01; + break; + case 5: + if (i_this->mpMorf->isStop()) { + i_this->mState = 6; + anm_init(i_this, BDK_BCK_DEATH1, 2.0f, 2, 1.0f, BDK_BAS_DEATH1, 0); + i_this->m2EC[0] = DEMO_SELECT(REG6_S(3), REG0_S(3)) + 300; - for (s32 i = 0; i < 2; i++) { - if (i_this->m6100[i]) { - i_this->m6100[i]->becomeInvalidEmitter(); - i_this->m6100[i] = NULL; + for (s32 i = 0; i <= 1; i++) { + JPABaseEmitter* emitter = dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_DEAD_HANE_A00, + &actor->current.pos, + NULL, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 + ); + + i_this->m6100[i] = emitter; + } + } else { + if (i_this->m2EC[0] == 0) { + cLib_addCalc2(&actor->current.pos.y, 10800.0f, 0.1f, 50.0f); + bVar1 = 1; + } + break; + } + // Fall-through + case 6: + bVar1 = 1; + for (s32 i = 0; i <= 1; i++) { + JPABaseEmitter* emitter = i_this->m6100[i]; + if (emitter) { + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_HANE_L2 + i * 0xA)); // j_dk_hane_l2 joint, j_dk_hane_r2 joint } } - dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_DEAD_HANE_B00, &actor->current.pos, NULL, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &actor->tevStr.mColorK0, &actor->tevStr.mColorK0); - } - break; - case 7: - actor->current.pos.x = 100000.0f; - actor->current.pos.y = 100000.0f; - if (i_this->m2EC[0] == 0) { - i_this->m25A0++; - i_this->mState = 8; - } - break; - case 8: - break; - default: - break; + if (i_this->m2EC[0] == 0xAA) { + i_this->m25A0 = 0x6E; + } + cLib_addCalc2(&actor->current.pos.x, 3600.0f, 0.05f, 50.0f); + cLib_addCalc2(&actor->current.pos.y, REG8_F(18) + 15800.0f, 0.1f, REG8_F(19) + 20.0f); + cLib_addCalc2(&actor->current.pos.z, -3800.0f, 0.05f, 50.0f); + cLib_addCalcAngleS2(&actor->current.angle.y, -8000, 0x10, 0x80); + if (i_this->m2EC[0] == 0x3C) { + fopAcM_seStart(actor, JA_SE_CV_DK_DIE, 0); + anm_init(i_this, BDK_BCK_DEATH2, 5.0f, 0, 1.0f, -1, 0); + } + if (i_this->m2EC[0] == 0 && DEMO_SELECT(REG6_S(4), REG0_S(4)) == 0) { + i_this->mState = 7; + for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m90C); i++) { + i_this->m90C[i] = 0; + } + fpcM_Search(&obj2_delete_sub, actor); + i_this->m2CC = actor->current.pos; + i_this->m2CC.y += 200.0f; +#if VERSION > VERSION_DEMO + actor->current.angle.y = 0x4000; +#endif + fopAcM_createDisappear(actor, &i_this->m2CC, 0x32, 2); + mDoAud_seStart(JA_SE_CM_DK_DIE_EXPLODE, &i_this->m2CC, 0x0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + i_this->m2EC[0] = 0x1E; + + for (s32 i = 0; i < 2; i++) { + if (i_this->m6100[i]) { + i_this->m6100[i]->becomeInvalidEmitter(); + i_this->m6100[i] = NULL; + } + } + dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_DEAD_HANE_B00, + &actor->current.pos, + NULL, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 + ); + } + break; + case 7: + actor->current.pos.x = 100000.0f; + actor->current.pos.y = 100000.0f; + if (i_this->m2EC[0] == 0) { + i_this->m25A0++; + i_this->mState = 8; + } + break; + case 8: + break; + default: + break; } if (bVar1 != 0 && i_this->m2EC[4] == 0) { i_this->m2EC[4] = cM_rndF(30.0) + 25.0f; @@ -1930,20 +2079,34 @@ void end(bdk_class* i_this) { cLib_addCalcAngleS2(&actor->current.angle.x, 0, 2, 0x800); if ((u16)particle_id) { JPABaseEmitter* emitter = dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_LASTDMG_HANE_M00, &actor->current.pos, &actor->shape_angle, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &actor->tevStr.mColorK0, &actor->tevStr.mColorK0); + dPa_name::ID_IT_SN_DK_LASTDMG_HANE_M00, + &actor->current.pos, + &actor->shape_angle, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 + ); if (emitter) { - emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x16)); // j_dk_mune2 joint + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_MUNE2)); } for (s32 i = 0; i <= 1; i++) { JPABaseEmitter* emitter = dComIfGp_particle_set( - particle_id, &actor->current.pos, &actor->shape_angle, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &actor->tevStr.mColorK0, &actor->tevStr.mColorK0); + particle_id, + &actor->current.pos, + &actor->shape_angle, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &actor->tevStr.mColorK0, + &actor->tevStr.mColorK0 + ); if (emitter) { - emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x28 + i * 0xA)); // j_dk_hane_l2 joint, j_dk_hane_r2 joint + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_HANE_L2 + i * 0xA)); // j_dk_hane_l2 joint, j_dk_hane_r2 joint } } } @@ -1951,7 +2114,7 @@ void end(bdk_class* i_this) { } /* 00005EA0-00005F08 .text obj_s_sub__FPvPv */ -void* obj_s_sub(void* param_1, void*) { +static void* obj_s_sub(void* param_1, void*) { fopAc_ac_c* actor = (fopAc_ac_c*)param_1; if (fopAcM_IsActor(actor) && fopAcM_GetName(actor) == PROC_BDKOBJ && (fpcM_GetParam(actor) & 0xF) != 0xF && actor->health != 0) { return param_1; @@ -1959,7 +2122,7 @@ void* obj_s_sub(void* param_1, void*) { return NULL; } /* 00005F08-000065FC .text t_fly__FP9bdk_class */ -void t_fly(bdk_class* i_this) { +static void t_fly(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; daPy_py_c* player = daPy_getPlayerActorClass(); s32 frame; @@ -1975,80 +2138,79 @@ void t_fly(bdk_class* i_this) { fpcM_Search(&kamome_delete_sub, actor); } - switch(i_this->mState) { - case -10: - anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); - i_this->mState++; - break; - case -9: - if (i_this->mpMorf->isStop()) { - i_this->mState = 0; - } - break; - case 0: - fopAcM_OffStatus(actor, fopAcStts_UNK4000_e); - anm_init(i_this, BDK_BCK_FLY2, 5.0f, 2, 1.0f, BDK_BAS_FLY2, 0); - i_this->mState++; - // Fall-through - case 1: - if (bdkobj) { - i_this->m2CC = bdkobj->current.pos; - anm_init(i_this, BDK_BCK_ATTACK_T1, 5.0f, 0, 1.0f, -1, 0); + switch (i_this->mState) { + case -10: + anm_init(i_this, BDK_BCK_TOBITATU1, 5.0f, 0, 1.0f, BDK_BAS_TOBITATU1, 0); i_this->mState++; - fopAcM_monsSeStart(actor, JA_SE_CV_DK_ATTACK, 0); - i_this->mp2598 = bdkobj; - } else { - i_this->m2CC = player->current.pos; - if (i_this->m2EC[0] == 0) { - anm_init(i_this, BDK_BCK_ATTACK_T2, 5.0f, 0, 1.0f, -1, 0); - i_this->mState = 10; + break; + case -9: + if (i_this->mpMorf->isStop()) { + i_this->mState = 0; + } + break; + case 0: + fopAcM_OffStatus(actor, fopAcStts_UNK4000_e); + anm_init(i_this, BDK_BCK_FLY2, 5.0f, 2, 1.0f, BDK_BAS_FLY2, 0); + i_this->mState++; + // Fall-through + case 1: + if (bdkobj) { + i_this->m2CC = bdkobj->current.pos; + anm_init(i_this, BDK_BCK_ATTACK_T1, 5.0f, 0, 1.0f, -1, 0); + i_this->mState++; fopAcM_monsSeStart(actor, JA_SE_CV_DK_ATTACK, 0); - fopAcM_seStart(actor, JA_SE_CM_DK_FOOT_ATTACK, 0); - i_this->m2EC[0] = l_HIO.m028; + i_this->mp2598 = bdkobj; + } else { + i_this->m2CC = player->current.pos; + if (i_this->m2EC[0] == 0) { + anm_init(i_this, BDK_BCK_ATTACK_T2, 5.0f, 0, 1.0f, -1, 0); + i_this->mState = 10; + fopAcM_monsSeStart(actor, JA_SE_CV_DK_ATTACK, 0); + fopAcM_seStart(actor, JA_SE_CM_DK_FOOT_ATTACK, 0); + i_this->m2EC[0] = l_HIO.m028; + } } - } - break; - case 2: - frame = i_this->mpMorf->getFrame(); - if (frame >= REG0_S(3) + 0x2B && (s32)i_this->mpMorf->getFrame() <= REG0_S(4) + 0x32) { - wind_set(i_this, &actor->current.pos); - i_this->m2584 = 1; - dVar11 = REG8_F(8) + 150.0f; - dVar10 = 300.0f; - if (i_this->mp2598 && (s32)i_this->mpMorf->getFrame() == 0x30) { - fopAcM_SetParam(i_this->mp2598, 0xF); - i_this->mp2598 = NULL; - fopAcM_seStart(actor, JA_SE_CM_DK_PECK, 0); + break; + case 2: + frame = i_this->mpMorf->getFrame(); + if (frame >= REG0_S(3) + 0x2B && (s32)i_this->mpMorf->getFrame() <= REG0_S(4) + 0x32) { + wind_set(i_this, &actor->current.pos); + i_this->m2584 = 1; + dVar11 = REG8_F(8) + 150.0f; + dVar10 = 300.0f; + if (i_this->mp2598 && (s32)i_this->mpMorf->getFrame() == 0x30) { + fopAcM_SetParam(i_this->mp2598, 0xF); + i_this->mp2598 = NULL; + fopAcM_seStart(actor, JA_SE_CM_DK_PECK, 0); + } } - } - if (i_this->mpMorf->isStop()) { - i_this->mState = 0; - i_this->m2E0 = 0.0f; - } - break; - case 10: - frame = i_this->mpMorf->getFrame(); - if (frame >= REG0_S(3) + 0x17 && - (s32)i_this->mpMorf->getFrame() <= (REG0_S(4) + 0x32)) { - wind_set(i_this, &actor->current.pos); - dVar12 = REG8_F(9) + -50.0f; - dVar11 = REG8_F(10) + 250.0f; - dVar10 = 300.0f; + if (i_this->mpMorf->isStop()) { + i_this->mState = 0; + i_this->m2E0 = 0.0f; + } + break; + case 10: + frame = i_this->mpMorf->getFrame(); + if (frame >= REG0_S(3) + 0x17 && (s32)i_this->mpMorf->getFrame() <= (REG0_S(4) + 0x32)) { + wind_set(i_this, &actor->current.pos); + dVar12 = REG8_F(9) + -50.0f; + dVar11 = REG8_F(10) + 250.0f; + dVar10 = 300.0f; - if ((s32)i_this->mpMorf->getFrame() <= REG0_S(5) + 0x23) { - i_this->m2584 = 2; + if ((s32)i_this->mpMorf->getFrame() <= REG0_S(5) + 0x23) { + i_this->m2584 = 2; + } } - } - if (i_this->mFootCCSph[0].ChkAtHit() ||i_this->mFootCCSph[1].ChkAtHit()) { - fopAcM_seStart(actor, JA_SE_CM_DK_FOOT_ATK_COL, 0); - } - if (i_this->mpMorf->isStop()) { - i_this->mState = 0; - i_this->m2E0 = 0.0; - } - break; - default: - break; + if (i_this->mFootCCSph[0].ChkAtHit() || i_this->mFootCCSph[1].ChkAtHit()) { + fopAcM_seStart(actor, JA_SE_CM_DK_FOOT_ATK_COL, 0); + } + if (i_this->mpMorf->isStop()) { + i_this->mState = 0; + i_this->m2E0 = 0.0; + } + break; + default: + break; } pos = i_this->m2CC - center_pos; @@ -2065,38 +2227,37 @@ void t_fly(bdk_class* i_this) { if (actor->speed.y > 0.0f) { actor->current.pos.y = actor->current.pos.y + actor->speed.y; actor->speed.y = actor->speed.y - 5.0f; - } - else { + } else { cLib_addCalc2(&actor->current.pos.y, i_this->m2CC.y + dist.y, 0.2f, dVar10 * i_this->m2E0); } cLib_addCalc2(&actor->current.pos.z, i_this->m2CC.z + dist.z, 0.2f, dVar10 * i_this->m2E0); cLib_addCalc2(&i_this->m2E0, 1.0f, 1.0f, 0.02f); - if (player->current.pos.y > REG0_F(3) + 9300.0f - 50.0f) { + if (player->current.pos.y > DEMO_SELECT(REG13_F(3), REG0_F(3)) + 9300.0f - 50.0f) { i_this->mAction = ACTION_T_LASTATTACK; i_this->mState = 0; } } /* 000065FC-00006680 .text t_landing__FP9bdk_class */ -void t_landing(bdk_class* i_this) { +static void t_landing(bdk_class* i_this) { i_this->mF10 = 1; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_TOBITATU_T1, 5.0f, 2, 1.0f, -1, 0); - i_this->mState++; - break; - case 1: - break; - default: - break; + case 0: + anm_init(i_this, BDK_BCK_TOBITATU_T1, 5.0f, 2, 1.0f, -1, 0); + i_this->mState++; + break; + case 1: + break; + default: + break; } pos_move(i_this); } /* 00006680-00006C10 .text t_lastattack__FP9bdk_class */ -void t_lastattack(bdk_class* i_this) { +static void t_lastattack(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; daPy_py_c* player = (daPy_py_c*)daPy_getPlayerActorClass(); @@ -2106,9 +2267,9 @@ void t_lastattack(bdk_class* i_this) { s8 isfalling = 0; - fVar2 = (REG0_F(9) * 0.01f) + -3872.0f; - fVar1 = (REG0_F(8) * 0.01f) + 9579.0f; - i_this->m2CC.x = REG0_F(7) * 0.01f + 2825.0f - 40.0f; + fVar2 = (DEMO_SELECT(REG13_F(9), REG0_F(9)) * 0.01f) + -3872.0f; + fVar1 = (DEMO_SELECT(REG13_F(8), REG0_F(8)) * 0.01f) + 9579.0f; + i_this->m2CC.x = DEMO_SELECT(REG13_F(7), REG0_F(7)) * 0.01f + 2825.0f - 40.0f; i_this->m2CC.y = fVar1; i_this->m2CC.z = fVar2; cLib_addCalc2(&actor->current.pos.x, i_this->m2CC.x, 0.5f, 30.0f); @@ -2121,216 +2282,234 @@ void t_lastattack(bdk_class* i_this) { isfalling = 1; } - s16 angle = fopAcM_searchActorAngleY(actor, daPy_getPlayerActorClass()) -0x8000; + s16 angle = fopAcM_searchActorAngleY(actor, daPy_getPlayerActorClass()) - 0x8000; if (angle < -0xEB8) { angle = -0xEB8; - } - else if (0xE8 < angle) { + } else if (0xE8 < angle) { angle = 0xE8; } cLib_addCalcAngleS2(&actor->current.angle.y, angle + 0x8000, 2, 0x800); switch (i_this->mState) { - case 0: - actor->speed.y = REG0_F(6) + 80.0f; - i_this->mState++; - anm_init(i_this, BDK_BCK_TYAKUTI_T1, 10.0f, 0, 0.001f, BDK_BAS_TYAKUTI_T1, 0); - break; - case 1: - if (!(s8)isfalling) { - break; - } - - anm_init(i_this, BDK_BCK_TYAKUTI_T1, 1.0f, 0, 1.0f, BDK_BAS_TYAKUTI_T1, 0); - i_this->mState++; - dComIfGp_getVibration().StartShock(REG0_S(2) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - dComIfGp_particle_set( - dPa_name::ID_IT_SN_DK_TYAKUTI_ROCK00, &actor->current.pos, NULL, NULL, - 0xFF, NULL, (s8)fopAcM_GetRoomNo(actor), - &i_this->m6224.mColorK0, &i_this->m6224.mColorK0); - - if (i_this->m6078[0] == 0) { - i_this->m6078[0] = 100; - - dComIfGp_particle_setToon( - dPa_name::ID_IT_ST_DK_TYAKUTI_SMOKE00, &actor->current.pos, NULL, NULL, 0xB9, - &i_this->m6080[0], (s8)fopAcM_GetRoomNo(actor)); - } - break; - case 2: - if (i_this->mpMorf->isStop()) { - anm_init(i_this, BDK_BCK_WAIT_T1, 5.0, 2, 1.0f, -1, 0); + case 0: + actor->speed.y = DEMO_SELECT(REG13_F(6), REG0_F(6)) + 80.0f; i_this->mState++; - } - break; - case 3: - if (i_this->m2EC[0] == 0 && - fopAcM_searchActorDistance(actor, daPy_getPlayerActorClass()) < REG0_F(13) + 700.0f) { - anm_init(i_this, BDK_BCK_ATTACK_T3, 5.0f, 0, 1.0f, -1, 0); - fopAcM_monsSeStart(actor, JA_SE_CV_DK_ATTACK, 0); - i_this->mState = 4; - } - break; - case 4: - fVar3 = i_this->mpMorf->getFrame(); - if (fVar3 > 10.0f && fVar3 < 15.0f) { - i_this->m2584 = 1; - } + anm_init(i_this, BDK_BCK_TYAKUTI_T1, 10.0f, 0, 0.001f, BDK_BAS_TYAKUTI_T1, 0); + break; + case 1: + if (!(s8)isfalling) { + break; + } - if ((s16)(REG0_S(5) + 0xD) == (s16)i_this->mpMorf->getFrame()) { - fopAcM_seStart(actor, JA_SE_CM_DK_PECK, 0); - dComIfGp_getVibration().StartShock(REG0_S(2) + 3, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - eff_hane_set(i_this, &i_this->m1168, 5, 0); - } - if (i_this->mpMorf->isStop()) { - anm_init(i_this, BDK_BCK_WAIT_T1, 5.0f, 2, 1.0f, -1, 0); - i_this->mState = 3; - i_this->m2EC[0] = cM_rndF(100.0f) + 100.0f; - } - break; - default: - break; + anm_init(i_this, BDK_BCK_TYAKUTI_T1, 1.0f, 0, 1.0f, BDK_BAS_TYAKUTI_T1, 0); + i_this->mState++; + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f)); + dComIfGp_particle_set( + dPa_name::ID_IT_SN_DK_TYAKUTI_ROCK00, + &actor->current.pos, + NULL, + NULL, + 0xFF, + NULL, + (s8)fopAcM_GetRoomNo(actor), + &i_this->m6224.mColorK0, + &i_this->m6224.mColorK0 + ); + + if (i_this->m6078[0] == 0) { + i_this->m6078[0] = 100; + + dComIfGp_particle_setToon( + dPa_name::ID_IT_ST_DK_TYAKUTI_SMOKE00, &actor->current.pos, NULL, NULL, 0xB9, &i_this->m6080[0], (s8)fopAcM_GetRoomNo(actor) + ); + } + break; + case 2: + if (i_this->mpMorf->isStop()) { + anm_init(i_this, BDK_BCK_WAIT_T1, 5.0, 2, 1.0f, -1, 0); + i_this->mState++; + } + break; + case 3: + if (i_this->m2EC[0] == 0 && fopAcM_searchActorDistance(actor, daPy_getPlayerActorClass()) < REG0_F(13) + 700.0f) { + anm_init(i_this, BDK_BCK_ATTACK_T3, 5.0f, 0, 1.0f, -1, 0); + fopAcM_monsSeStart(actor, JA_SE_CV_DK_ATTACK, 0); + i_this->mState = 4; + } + break; + case 4: + fVar3 = i_this->mpMorf->getFrame(); + if (fVar3 > 10.0f && fVar3 < 15.0f) { + i_this->m2584 = 1; + } + + if ((s16)(REG0_S(5) + 0xD) == (s16)i_this->mpMorf->getFrame()) { + fopAcM_seStart(actor, JA_SE_CM_DK_PECK, 0); + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 3, -0x21, cXyz(0.0f, 1.0f, 0.0f)); + eff_hane_set(i_this, &i_this->m1168, 5, 0); + } + if (i_this->mpMorf->isStop()) { + anm_init(i_this, BDK_BCK_WAIT_T1, 5.0f, 2, 1.0f, -1, 0); + i_this->mState = 3; + i_this->m2EC[0] = cM_rndF(100.0f) + 100.0f; + } + break; + default: + break; } - if (player->current.pos.y < REG0_F(3) + 9290.0f - 50.0f) { + if (player->current.pos.y < DEMO_SELECT(REG13_F(3), REG0_F(3)) + 9290.0f - 50.0f) { i_this->mAction = ACTION_T_FLY; i_this->mState = -10; - actor->speed.y = REG0_F(7) + 70.0f; + actor->speed.y = DEMO_SELECT(REG13_F(7), REG0_F(7)) + 70.0f; } } /* 00006C10-00007008 .text t_down__FP9bdk_class */ -void t_down(bdk_class* i_this) { +static void t_down(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz offset; switch (i_this->mState) { - case 0: - anm_init(i_this, BDK_BCK_TO_DAMAGE_T1, 2.0f, 0, 1.0f, -1, 0); - i_this->mState++; - i_this->m2EC[0] = REG0_S(6) + 0x50; - i_this->m2EC[1] = REG0_S(7) + 0x50; - i_this->m25A0 = 0x32; - fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); - eff_hane_set(i_this, &i_this->m1168, 5, 0); - dComIfGs_offSwitch(0x80, fopAcM_GetRoomNo(actor)); - i_this->m259E = 0xB4; - // Fall-through - case 1: - case 2: - if (i_this->mpMorf->isStop()) { - anm_init(i_this, BDK_BCK_DAMAGE_T1, 2.0f, 2, 1.0f, -1, 0); - } - cLib_addCalc2(&actor->current.pos.x, center_pos.x, 0.2f, REG0_F(4) + 10.0f); - cLib_addCalc2(&actor->current.pos.z, center_pos.z, 0.2f, REG0_F(4) + 10.0f); + case 0: + anm_init(i_this, BDK_BCK_TO_DAMAGE_T1, 2.0f, 0, 1.0f, -1, 0); + i_this->mState++; + i_this->m2EC[0] = REG0_S(6) + 0x50; + i_this->m2EC[1] = REG0_S(7) + 0x50; + i_this->m25A0 = 0x32; + fopAcM_OnStatus(actor, fopAcStts_UNK4000_e); + eff_hane_set(i_this, &i_this->m1168, 5, 0); + dComIfGs_offSwitch(0x80, fopAcM_GetRoomNo(actor)); +#if VERSION > VERSION_DEMO + i_this->m259E = 0xB4; +#else + mDoGph_gInf_c::setBlureRate(REG8_S(4) + 0xb4); + mDoGph_gInf_c::mBlureFlag = TRUE; + mDoMtx_copy(cMtx_getIdentity(), mDoGph_gInf_c::mBlureMtx); - cLib_addCalcAngleS2(&i_this->m259E, 1, 1, 2); - if (i_this->m2EC[1] == 1) { - anm_init(i_this, BDK_BCK_RAKKA_T1, REG0_F(6) + 20.0f, 2, 1.0f, -1, 0); - i_this->m259E = 1; - fopAcM_seStart(actor, JA_SE_CM_DK_FALL_WATER, 0); - } +#endif - if (i_this->m2EC[0] != 0) { - return; - } - actor->current.pos.y += actor->speed.y; - actor->speed.y -= 5.0f; - if (actor->current.pos.y < 6900.0f && i_this->mState == 1) { - i_this->mState = 2; + // Fall-through + case 1: + case 2: + if (i_this->mpMorf->isStop()) { + anm_init(i_this, BDK_BCK_DAMAGE_T1, 2.0f, 2, 1.0f, -1, 0); + } + cLib_addCalc2(&actor->current.pos.x, center_pos.x, 0.2f, REG0_F(4) + 10.0f); + cLib_addCalc2(&actor->current.pos.z, center_pos.z, 0.2f, REG0_F(4) + 10.0f); - offset.x = 3600.f; - offset.y = 6900.f; - offset.z = -3800.f; +#if VERSION > VERSION_DEMO + cLib_addCalcAngleS2(&i_this->m259E, 1, 1, 2); +#endif + if (i_this->m2EC[1] == 1) { + anm_init(i_this, BDK_BCK_RAKKA_T1, DEMO_SELECT(REG13_F(6), REG0_F(6)) + 20.0f, 2, 1.0f, -1, 0); +#if VERSION > VERSION_DEMO + i_this->m259E = 1; +#else + mDoGph_gInf_c::mBlureFlag = FALSE; +#endif + fopAcM_seStart(actor, JA_SE_CM_DK_FALL_WATER, 0); + } - dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_HAMON00, &offset, NULL, NULL); - dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_HAMON01, &offset, NULL, NULL); - dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_SHIBUKI00, &offset, NULL, NULL); - dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_WP00, &offset, NULL, NULL); - fopAcM_seStart(actor, JA_SE_CM_DK_WATER_COLUMN, 0); - } - if (actor->current.pos.y < 5500.0f) { - i_this->mAction = ACTION_START; - i_this->mState = 0; - actor->current.pos.y = -25000.0f; - actor->health = 20; - actor->max_health = 20; - } - break; - default: - break; + if (i_this->m2EC[0] != 0) { + return; + } + actor->current.pos.y += actor->speed.y; + actor->speed.y -= 5.0f; + if (actor->current.pos.y < 6900.0f && i_this->mState == 1) { + i_this->mState = 2; + + offset.x = 3600.f; + offset.y = 6900.f; + offset.z = -3800.f; + + dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_HAMON00, &offset, NULL, NULL); + dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_HAMON01, &offset, NULL, NULL); + dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_SHIBUKI00, &offset, NULL, NULL); + dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_DOBON_WP00, &offset, NULL, NULL); + fopAcM_seStart(actor, JA_SE_CM_DK_WATER_COLUMN, 0); + } + if (actor->current.pos.y < 5500.0f) { + i_this->mAction = ACTION_START; + i_this->mState = 0; + actor->current.pos.y = -25000.0f; + actor->health = 20; + actor->max_health = 20; + } + break; + default: + break; } - } /* 00007008-00007014 .text after_fight__FP9bdk_class */ -void after_fight(bdk_class* i_this) { +static void after_fight(bdk_class* i_this) { i_this->m2F8 = 10; } /* 00007014-00007218 .text move__FP9bdk_class */ -void move(bdk_class* i_this) { +static void move(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; actor->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e; switch (i_this->mAction) { - case ACTION_FLY: - fly(i_this); - break; - case ACTION_UP_FLY: - up_fly(i_this); - break; - case ACTION_LANDING: - landing(i_this); - break; - case ACTION_WAIT: - wait(i_this); - break; - case ACTION_JUMP: - jump(i_this); - break; - case ACTION_KUTI_ATTACK: - kuti_attack(i_this); - break; - case ACTION_JIDA_ATTACK: - jida_attack(i_this); - break; - case ACTION_FLY_ATTACK: - fly_attack(i_this); - break; - case ACTION_WIND_ATTACK: - wind_attack(i_this); - break; - case ACTION_KAMEN_DEMO: - kamen_demo(i_this); - break; - case ACTION_END: - end(i_this); - break; - case ACTION_START: - start(i_this); - break; - case ACTION_T_FLY: - t_fly(i_this); - fopAcM_OffStatus(actor, 0); - actor->attention_info.flags = 0; - break; - case ACTION_T_LANDING: - t_landing(i_this); - break; - case ACTION_T_LASTATTACK: - t_lastattack(i_this); - break; - case ACTION_T_DOWN: - t_down(i_this); - fopAcM_OffStatus(actor, 0); - actor->attention_info.flags = 0; - break; - case ACTION_AFTER_FIGHT: - after_fight(i_this); - fopAcM_OffStatus(actor, 0); - actor->attention_info.flags = 0; - break; - default: - break; + case ACTION_FLY: + fly(i_this); + break; + case ACTION_UP_FLY: + up_fly(i_this); + break; + case ACTION_LANDING: + landing(i_this); + break; + case ACTION_WAIT: + wait(i_this); + break; + case ACTION_JUMP: + jump(i_this); + break; + case ACTION_KUTI_ATTACK: + kuti_attack(i_this); + break; + case ACTION_JIDA_ATTACK: + jida_attack(i_this); + break; + case ACTION_FLY_ATTACK: + fly_attack(i_this); + break; + case ACTION_WIND_ATTACK: + wind_attack(i_this); + break; + case ACTION_KAMEN_DEMO: + kamen_demo(i_this); + break; + case ACTION_END: + end(i_this); + break; + case ACTION_START: + start(i_this); + break; + case ACTION_T_FLY: + t_fly(i_this); + fopAcM_OffStatus(actor, 0); + actor->attention_info.flags = 0; + break; + case ACTION_T_LANDING: + t_landing(i_this); + break; + case ACTION_T_LASTATTACK: + t_lastattack(i_this); + break; + case ACTION_T_DOWN: + t_down(i_this); + fopAcM_OffStatus(actor, 0); + actor->attention_info.flags = 0; + break; + case ACTION_AFTER_FIGHT: + after_fight(i_this); + fopAcM_OffStatus(actor, 0); + actor->attention_info.flags = 0; + break; + default: + break; } if (i_this->m2591 != 0) { @@ -2342,7 +2521,7 @@ void move(bdk_class* i_this) { } /* 00007218-00007684 .text col_set__FP9bdk_class */ -void col_set(bdk_class* i_this) { +static void col_set(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; cXyz offset; cXyz dist; @@ -2351,7 +2530,7 @@ void col_set(bdk_class* i_this) { i_this->m1168 = actor->current.pos; i_this->m1168.y += 380.0f; model = i_this->mpMorf->getModel(); - MTXCopy(model->getAnmMtx(0x18), *calc_mtx); // j_dk_atama1 joint + MTXCopy(model->getAnmMtx(JNT_J_DK_ATAMA1), *calc_mtx); offset.x = REG8_F(0) + 40.0f; offset.y = REG8_F(1); @@ -2366,8 +2545,7 @@ void col_set(bdk_class* i_this) { i_this->m1144 = i_this->m1150; MtxPosition(&offset, &i_this->m1150); if (i_this->m2584 == 1) { - model = i_this->mpMorf->getModel(); - MTXCopy(model->getAnmMtx(0x19), *calc_mtx); // j_dk_ago joint + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_AGO), *calc_mtx); offset.x = REG8_F(3) + 120.0f; offset.y = REG8_F(4); offset.z = REG8_F(5); @@ -2385,8 +2563,10 @@ void col_set(bdk_class* i_this) { dComIfG_Ccsp()->Set(&i_this->mBodyCCSph); if (4 <= i_this->m8F8) { - model = i_this->mpMorf->getModel(); - MTXCopy(model->getAnmMtx(REG8_S(2) + 0x21), *calc_mtx); // j_dk_tosaka_A3 joint + MTXCopy( + i_this->mpMorf->getModel()->getAnmMtx(REG8_S(2) + 0x21), // j_dk_tosaka_a3 joint + *calc_mtx + ); offset.x = REG8_F(3); offset.y = REG8_F(4); @@ -2399,30 +2579,29 @@ void col_set(bdk_class* i_this) { for (s32 i = 0; i < 2; i++) { if (i == 0) { model = i_this->mpMorf->getModel(); - MTXCopy(model->getAnmMtx(0x5), *calc_mtx); // j_dk_ashi_l3 joint + MTXCopy(model->getAnmMtx(JNT_J_DK_ASHI_L3), *calc_mtx); } else { model = i_this->mpMorf->getModel(); - MTXCopy(model->getAnmMtx(0xE), *calc_mtx); // j_dk_ashi_r3 joint + MTXCopy(model->getAnmMtx(JNT_J_DK_ASHI_R3), *calc_mtx); } if (i_this->mAction == ACTION_T_LASTATTACK) { - i_this->mFootCCSph[i].SetR(REG0_F(8) + 300.0f); + i_this->mFootCCSph[i].SetR(DEMO_SELECT(REG12_F(8), REG0_F(8)) + 300.0f); i_this->mFootCCSph[i].OffTgSetBit(); - offset.x = REG0_F(3) + 100.0f; - offset.y = REG0_F(4) + 200.0f; + offset.x = DEMO_SELECT(REG12_F(3), REG0_F(3)) + 100.0f; + offset.y = DEMO_SELECT(REG12_F(4), REG0_F(4)) + 200.0f; } else { - i_this->mFootCCSph[i].SetR(REG0_F(9) + 60.0f); + i_this->mFootCCSph[i].SetR(DEMO_SELECT(REG12_F(9), REG0_F(9)) + 60.0f); i_this->mFootCCSph[i].OnTgSetBit(); - offset.x = REG0_F(3) + 50.0f; - offset.y = REG0_F(4); + offset.x = DEMO_SELECT(REG12_F(3), REG0_F(3)) + 50.0f; + offset.y = DEMO_SELECT(REG12_F(4), REG0_F(4)); } - offset.z = REG0_F(5); + offset.z = DEMO_SELECT(REG12_F(5), REG0_F(5)); MtxPosition(&offset, &i_this->m1174[i]); i_this->mFootCCSph[i].SetC(i_this->m1174[i]); if (i_this->m2584 == 2) { i_this->mFootCCSph[i].OnAtSetBit(); - s16 action = i_this->mAction; - if (action == ACTION_FLY_ATTACK || action == ACTION_T_FLY || action == ACTION_JIDA_ATTACK) { + if (i_this->mAction == ACTION_FLY_ATTACK || i_this->mAction == ACTION_T_FLY || i_this->mAction == ACTION_JIDA_ATTACK) { i_this->mFootCCSph[i].SetAtSpl(dCcG_At_Spl_UNK9); } else { i_this->mFootCCSph[i].SetAtSpl(dCcG_At_Spl_UNK0); @@ -2442,7 +2621,7 @@ void col_set(bdk_class* i_this) { } /* 00007684-000078AC .text kankyo_cont__FP9bdk_class */ -void kankyo_cont(bdk_class* i_this) { +static void kankyo_cont(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; i_this->m25DC = actor->current.pos; cXyz local_38(0.0f, 0.0f, 1.0f); @@ -2494,7 +2673,7 @@ static s16 z_d[] = {0x2000, 0x2000, -0x2000, -0x2000}; static s16 z_d2[] = {-0x1000, -0x1000, 0x1000, 0x1000}; /* 000078AC-00008520 .text kamen_break_move__FP9bdk_class */ -void kamen_break_move(bdk_class* i_this) { +static void kamen_break_move(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; static cXyz non_pos(-50000.0f, -50000.0f, -50000.0f); CcAtInfo hit_atInfo; @@ -2527,22 +2706,22 @@ void kamen_break_move(bdk_class* i_this) { vec3.y += 200.0f; gndChk.SetPos(&vec3); - f32 ground_y = dComIfG_Bgsp()->GroundCross(&gndChk) + 15.0f + REG0_F(11); + f32 ground_y = dComIfG_Bgsp()->GroundCross(&gndChk) + 15.0f + DEMO_SELECT(REG12_F(11), REG0_F(11)); if (i_this->m910[i].y <= ground_y) { i_this->m910[i].y = ground_y; csXyz* m9D0 = &i_this->m9D0[i]; m9D0->x = 0; m9D0->y = 0; - if (i_this->m970[i].y < REG0_F(2) + -30.0f) { - i_this->m970[i].y = 4.0f + (10.0f + REG0_F(3)); - i_this->m9EC[i] = REG0_F(4) + 3000.0f; + if (i_this->m970[i].y < DEMO_SELECT(REG12_F(2), REG0_F(2)) + -30.0f) { + i_this->m970[i].y = 4.0f + (10.0f + DEMO_SELECT(REG12_F(3), REG0_F(3))); + i_this->m9EC[i] = DEMO_SELECT(REG12_F(4), REG0_F(4)) + 3000.0f; i_this->m9A0[i].z = z_d2[i]; mDoAud_seStart(JA_SE_CM_MAGBALL_BOUND, &i_this->m910[i], 0x63, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); } else { i_this->m970[i].y = 0.0f; - s32 target = i_this->m9EC[i] * cM_ssin(i_this->m2C4 * + 0x2000 + i * 0x3000); - cLib_addCalc0(&i_this->m9EC[i], 1.0f, 200.0f + REG0_F(5)); + s32 target = i_this->m9EC[i] * cM_ssin(i_this->m2C4 * +0x2000 + i * 0x3000); + cLib_addCalc0(&i_this->m9EC[i], 1.0f, 200.0f + DEMO_SELECT(REG12_F(5), REG0_F(5))); cLib_addCalcAngleS2(&i_this->m9A0[i].z, z_d[i] + target, 1, 0x1000); } vec1.x = 0.0f; @@ -2555,14 +2734,14 @@ void kamen_break_move(bdk_class* i_this) { i_this->m970[i].z = vec2.z; i_this->m9A0[i].y += (s16)(i_this->mF00[i] * i_this->m9FC[i]); - cLib_addCalc0(&i_this->m9FC[i], 1.0f, REG0_F(5) + 0.2f); + cLib_addCalc0(&i_this->m9FC[i], 1.0f, DEMO_SELECT(REG14_F(5), REG0_F(5)) + 0.2f); if (i_this->mA50[i].ChkTgHit() && i_this->m9FC[i] < 1.0f) { hit_atInfo.mpObj = i_this->mA50[i].GetTgHitObj(); hit_atInfo.mpActor = at_power_check(&hit_atInfo); if (hit_atInfo.mResultingAttackType == 8) { - i_this->m9FC[i] = REG0_F(4) + 7.0f + cM_rndF(2.0f); + i_this->m9FC[i] = DEMO_SELECT(REG14_F(4), REG0_F(4)) + 7.0f + cM_rndF(2.0f); if (hit_atInfo.mpActor) { i_this->mA0C[i] = hit_atInfo.mpActor->shape_angle.y + (s16)cM_rndFX(2000.0f); } @@ -2633,12 +2812,17 @@ void kamen_break_move(bdk_class* i_this) { } /* 00008AF0-00008CB8 .text obj_move__FP9bdk_class */ -void obj_move(bdk_class* i_this) { +static void obj_move(bdk_class* i_this) { if (dComIfGs_isStageBossEnemy()) { cLib_addCalc2(&i_this->m62D4, -500.0f, 1.0f, 20.0f); } - MtxTrans(REG0_F(10) + 4600.0f + 155.0f, REG0_F(11) + 9800.0f + i_this->m62D4, REG0_F(12) - 4700.0f, 0); - cMtx_YrotM(*calc_mtx, (REG0_S(0) + -7000)); + MtxTrans( + DEMO_SELECT(REG6_F(10), REG0_F(10)) + 4600.0f + 155.0f, + DEMO_SELECT(REG6_F(11), REG0_F(11)) + 9800.0f + i_this->m62D4, + DEMO_SELECT(REG6_F(12), REG0_F(12)) - 4700.0f, + 0 + ); + cMtx_YrotM(*calc_mtx, DEMO_SELECT(REG6_S(0), REG0_S(0)) + -7000); i_this->mp62D8->setBaseTRMtx(*calc_mtx); MTXCopy(*calc_mtx, i_this->m62DC); i_this->pm_bgw->Move(); @@ -2656,9 +2840,10 @@ void obj_move(bdk_class* i_this) { } /* 00008CB8-0000A7C8 .text demo_camera__FP9bdk_class */ -void demo_camera(bdk_class* i_this) { +static void demo_camera(bdk_class* i_this) { fopAc_ac_c* actor = &i_this->actor; - daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + fopAc_ac_c* player_actor = (fopAc_ac_c*)dComIfGp_getPlayer(0); + daPy_py_c* player = (daPy_py_c*)player_actor; camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); csXyz local_14C; csXyz local_154; @@ -2668,7 +2853,7 @@ void demo_camera(bdk_class* i_this) { cXyz local_e4; cXyz local_f0; - f32 dVar16 = 45.0f; + f32 dVar16 = 45.0f; f32 dVar15 = 1.0f; f32 dVar14 = 0.05f; @@ -2676,453 +2861,469 @@ void demo_camera(bdk_class* i_this) { u8 r27 = 0; switch (i_this->m25A0) { - case 0x0: - break; - case 0x1: - if (!actor->eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); - actor->eventInfo.onCondition(dEvtCnd_UNK2_e); - r28 = 0; + case 0x0: break; - } - - i_this->m25A0++; - camera->mCamera.Stop(); - camera->mCamera.SetTrimSize(2); - i_this->m25A4 = 0; - i_this->m25A6 = 0; - i_this->m25C8 = dVar16; - i_this->m8F8 = 4; - player->changeOriginalDemo(); - case 0x2: { - cMtx_YrotS(*calc_mtx, actor->shape_angle.y); - - local_104.x = REG0_F(0) + -30.0f - 50.0f; - local_104.y = REG0_F(1) + -30.0f; - local_104.z = REG0_F(2) + 50.0f; - MtxPosition(&local_104, &i_this->m25B4); - i_this->m25B4 += i_this->m1150; - - local_104.x = REG0_F(5) + 400.0f; - local_104.y = REG0_F(6) + -100.0f; - local_104.z = REG0_F(7) + 400.0f; - MtxPosition(&local_104, &i_this->m25A8); - i_this->m25A8 += i_this->m1150; - - local_104.x = (REG0_F(0) + -150.0f) - 30.0f - 50.0f; - local_104.y = 0.0f; - local_104.z = REG0_F(2) + 100.0f + 10.0f; - MtxPosition(&local_104, &local_108); - - local_108.x += i_this->m1150.x; - local_108.y = player->current.pos.y; - local_108.z += i_this->m1150.z; - player->setPlayerPosAndAngle(&local_108, actor->shape_angle.y + 20000 + REG0_S(6)); - - s16 r4 = i_this->m25A6; - if (i_this->m25A6 > REG0_S(7) + 0x3C) { - dVar16 = 20.0f; - dVar15 = 1.0f; - dVar14 = 0.5f; - } else if ((s16)r4 > 0) { - dVar16 = 35.0f; - dVar15 = 0.35f; - } - if (r4 == 0x51) { - player->changeDemoMode(daPy_demo_c::DEMO_SMILE_e); - } - cLib_addCalc2(&i_this->m25C8, dVar16, dVar14, dVar15); - break; - } - case 0xA: - if (!actor->eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); - actor->eventInfo.onCondition(dEvtCnd_UNK2_e); - r28 = 0; - break; - } - i_this->m25A0++; - i_this->m25CC = 0.0f; - i_this->m25A4 = 0; - i_this->m25A6 = 0; - camera->mCamera.Stop(); - camera->mCamera.SetTrimSize(2); - i_this->m25C8 = 55.0f; - - i_this->m25B4.x = 2598.0f; - i_this->m25B4.y = 9902.0f; - i_this->m25B4.z = -3498.0f; - - i_this->m25A8.x = 2228.0f; - i_this->m25A8.y = 9961.0f; - i_this->m25A8.z = -3403.0f; - - mDoAud_bgmStreamPrepare(JA_STRM_DK_START); - player->changeOriginalDemo(); - // Fall-through - case 0xB: - cLib_addCalc2(&i_this->m25B4.x, 164.0f, 0.05f, i_this->m25CC * 24.34f); - cLib_addCalc2(&i_this->m25B4.y, 11617.0f, 0.05f, i_this->m25CC * 17.15f); - cLib_addCalc2(&i_this->m25B4.z, -2802.0f, 0.05f, i_this->m25CC * 6.96f); - cLib_addCalc2(&i_this->m25A8.x, -167.0f, 0.05f, i_this->m25CC * 23.949999f); - cLib_addCalc2(&i_this->m25A8.y, 11791.0f, 0.05f, i_this->m25CC * 18.3f); - cLib_addCalc2(&i_this->m25A8.z, -2706.0f, 0.05f, i_this->m25CC * 6.97f); - - if (i_this->m25A6 > (s16)(REG0_S(1) + 0x1E)) { - cLib_addCalc2(&i_this->m25CC, REG0_F(1) + 1.0f, 1.0f, REG0_F(2) + 0.015f); - } - - if (i_this->m25A6 >= (s16)(REG0_S(6) + 0xBE)) { - if (i_this->m25A6 == (s16)(REG0_S(6) + 0xD2)) { - player->changeDemoMode(daPy_demo_c::DEMO_UNK_028_e); - mDoAud_bgmStreamPlay(); + case 0x1: + if (!actor->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); + actor->eventInfo.onCondition(dEvtCnd_UNK2_e); + r28 = 0; + break; } - if (i_this->m25A6 == (s16)(REG0_S(6) + 0xBE)) { - local_14C.x = 0; - local_14C.y = 0; - local_14C.z = 0; - for (s32 i = 0; i <= 2; i++) { - local_14C.y = 10000 + i * 0x5555 + REG8_S(4); - dComIfGp_particle_setToon(dPa_name::ID_IT_ST_DK_FUTATOJI_SMOKE_A00, ¢er_pos, &local_14C, NULL, 0xB9, &i_this->m6130[i], (s16)fopAcM_GetRoomNo(actor)); - } - dComIfGp_particle_setToon(dPa_name::ID_IT_ST_DK_FUTATOJI_SMOKE_B00, ¢er_pos2, NULL, NULL, 0xB9, &i_this->m6130[3], (s16)fopAcM_GetRoomNo(actor)); - i_this->m6100[1] = dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_FUTATOJI_ROCK00, ¢er_pos2, NULL, NULL, 0xFF); - } - i_this->m25D4 = REG0_F(18) + 1.5f; - mDoAud_seStart(JA_SE_ATM_MJT_JINARI, 0); - cLib_addCalc0(&i_this->m6320, 1.0f, REG0_F(0) + 1.0f); - i_this->m631C += 0.003f + REG0_F(8); - r27 = 1; - } - if (i_this->m25A6 > (s16)(REG0_S(2) + 0xFA)) { - i_this->m25A0 = 0xC; - i_this->m25B4.x = 2195.0f; - i_this->m25B4.y = 10007.0f; - i_this->m25B4.z = -4079.0f; - - i_this->m25A8.x = 1816.0f; - i_this->m25A8.y = 10051.0f; - i_this->m25A8.z = -4137.0f; - i_this->m25CC = 0.0f; + i_this->m25A0++; + camera->mCamera.Stop(); + camera->mCamera.SetTrimSize(2); + i_this->m25A4 = 0; i_this->m25A6 = 0; - } else { + i_this->m25C8 = 45.0f; + i_this->m8F8 = 4; +#if VERSION > VERSION_DEMO + player->changeOriginalDemo(); +#endif + // Fall-through + case 0x2: + { + cMtx_YrotS(*calc_mtx, actor->shape_angle.y); + +#if VERSION > VERSION_DEMO + local_104.x = REG0_F(0) + -30.0f - 50.0f; +#else + local_104.x = REG14_F(0) + -30.0f; +#endif + local_104.y = DEMO_SELECT(REG14_F(1), REG0_F(1)) + -30.0f; + local_104.z = DEMO_SELECT(REG14_F(2), REG0_F(2)) + 50.0f; + MtxPosition(&local_104, &i_this->m25B4); + i_this->m25B4 += i_this->m1150; + + local_104.x = DEMO_SELECT(REG12_F(5), REG0_F(5)) + 400.0f; + local_104.y = DEMO_SELECT(REG12_F(6), REG0_F(6)) + -100.0f; + local_104.z = DEMO_SELECT(REG12_F(7), REG0_F(7)) + 400.0f; + MtxPosition(&local_104, &i_this->m25A8); + i_this->m25A8 += i_this->m1150; + +#if VERSION > VERSION_DEMO + local_104.x = REG0_F(0) + -150.0f - 30.0f - 50.0f; +#else + local_104.x = REG6_F(0) + -150.0f - 30.0f; +#endif + local_104.y = 0.0f; + local_104.z = DEMO_SELECT(REG6_F(2), REG0_F(2)) + 100.0f + 10.0f; + MtxPosition(&local_104, &local_108); + + local_108.x += i_this->m1150.x; + local_108.y = player->current.pos.y; + local_108.z += i_this->m1150.z; + player->setPlayerPosAndAngle(&local_108, actor->shape_angle.y + 20000 + DEMO_SELECT(REG6_S(6), REG0_S(6))); + + s16 r4 = i_this->m25A6; + if (i_this->m25A6 > DEMO_SELECT(REG6_S(7), REG0_S(7)) + 0x3C) { + dVar16 = 20.0f; + dVar15 = 1.0f; + dVar14 = 0.5f; + } else if ((s16)r4 > 0) { + dVar16 = 35.0f; + dVar15 = 0.35f; + } +#if VERSION > VERSION_DEMO + if (r4 == 0x51) { + player->changeDemoMode(daPy_demo_c::DEMO_SMILE_e); + } +#endif + cLib_addCalc2(&i_this->m25C8, dVar16, dVar14, dVar15); + break; + } + case 0xA: + if (!actor->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); + actor->eventInfo.onCondition(dEvtCnd_UNK2_e); + r28 = 0; + break; + } + i_this->m25A0++; + i_this->m25CC = 0.0f; + i_this->m25A4 = 0; + i_this->m25A6 = 0; + camera->mCamera.Stop(); + camera->mCamera.SetTrimSize(2); + i_this->m25C8 = 55.0f; + + i_this->m25B4.x = 2598.0f; + i_this->m25B4.y = 9902.0f; + i_this->m25B4.z = -3498.0f; + + i_this->m25A8.x = 2228.0f; + i_this->m25A8.y = 9961.0f; + i_this->m25A8.z = -3403.0f; + + mDoAud_bgmStreamPrepare(JA_STRM_DK_START); + player->changeOriginalDemo(); + // Fall-through + case 0xB: + cLib_addCalc2(&i_this->m25B4.x, 164.0f, 0.05f, i_this->m25CC * 24.34f); + cLib_addCalc2(&i_this->m25B4.y, 11617.0f, 0.05f, i_this->m25CC * 17.15f); + cLib_addCalc2(&i_this->m25B4.z, -2802.0f, 0.05f, i_this->m25CC * 6.96f); + cLib_addCalc2(&i_this->m25A8.x, -167.0f, 0.05f, i_this->m25CC * 23.949999f); + cLib_addCalc2(&i_this->m25A8.y, 11791.0f, 0.05f, i_this->m25CC * 18.3f); + cLib_addCalc2(&i_this->m25A8.z, -2706.0f, 0.05f, i_this->m25CC * 6.97f); + + if (i_this->m25A6 > (s16)(DEMO_SELECT(REG13_S(1), REG0_S(1)) + 0x1E)) { + cLib_addCalc2(&i_this->m25CC, DEMO_SELECT(REG13_F(1), REG0_F(1)) + 1.0f, 1.0f, DEMO_SELECT(REG13_F(2), REG0_F(2)) + 0.015f); + } + if (i_this->m25A6 >= (s16)(DEMO_SELECT(REG13_S(6), REG0_S(6)) + 0xBE)) { + if (i_this->m25A6 == (s16)(DEMO_SELECT(REG13_S(6), REG0_S(6)) + 0xD2)) { + player->changeDemoMode(daPy_demo_c::DEMO_UNK_028_e); + mDoAud_bgmStreamPlay(); + } + if (i_this->m25A6 == (s16)(DEMO_SELECT(REG13_S(6), REG0_S(6)) + 0xBE)) { + local_14C.x = 0; + local_14C.y = 0; + local_14C.z = 0; + + for (s32 i = 0; i <= 2; i++) { + local_14C.y = 10000 + i * 0x5555 + REG8_S(4); + dComIfGp_particle_setToon( + dPa_name::ID_IT_ST_DK_FUTATOJI_SMOKE_A00, ¢er_pos, &local_14C, NULL, 0xB9, &i_this->m6130[i], (s16)fopAcM_GetRoomNo(actor) + ); + } + dComIfGp_particle_setToon( + dPa_name::ID_IT_ST_DK_FUTATOJI_SMOKE_B00, ¢er_pos2, NULL, NULL, 0xB9, &i_this->m6130[3], (s16)fopAcM_GetRoomNo(actor) + ); + i_this->m6100[1] = dComIfGp_particle_set(dPa_name::ID_IT_SN_DK_FUTATOJI_ROCK00, ¢er_pos2, NULL, NULL, 0xFF); + } + i_this->m25D4 = DEMO_SELECT(REG13_F(18), REG0_F(18)) + 1.5f; + mDoAud_seStart(JA_SE_ATM_MJT_JINARI, 0); + cLib_addCalc0(&i_this->m6320, 1.0f, DEMO_SELECT(REG13_F(0), REG0_F(0)) + 1.0f); + i_this->m631C += 0.003f + REG0_F(8); + r27 = 1; + } + if (i_this->m25A6 > (s16)(DEMO_SELECT(REG13_S(2), REG0_S(2)) + 0xFA)) { + i_this->m25A0 = 0xC; + i_this->m25B4.x = 2195.0f; + i_this->m25B4.y = 10007.0f; + i_this->m25B4.z = -4079.0f; + + i_this->m25A8.x = 1816.0f; + i_this->m25A8.y = 10051.0f; + i_this->m25A8.z = -4137.0f; + i_this->m25CC = 0.0f; + i_this->m25A6 = 0; + } else { + local_108.x = 2580.0f; + local_108.y = player_actor->current.pos.y; + local_108.z = -3670.0f; + player->setPlayerPosAndAngle(&local_108, player->shape_angle.y); + break; + } + // Fall-through + case 0xC: + cLib_addCalc0(&i_this->m6320, 1.0f, DEMO_SELECT(REG13_F(0), REG0_F(0)) + 1.0f); + r27 = 1; + i_this->m631C += REG0_F(8) + 0.003f; + + if (i_this->m25A6 < (s16)(DEMO_SELECT(REG13_S(6), REG0_S(6)) + 0x9B)) { + i_this->m25D4 = DEMO_SELECT(REG13_F(5), REG0_F(5)) + 5.0f; + mDoAud_seStart(JA_SE_ATM_MJT_JINARI, 0); + } + if (i_this->m25A6 == (s16)(DEMO_SELECT(REG13_S(6), REG0_S(6)) + 0x96)) { + i_this->m25D8 = 1; + } + if (i_this->m25A6 == (s16)(DEMO_SELECT(REG13_S(7), REG0_S(7)) + 0xA0)) { + i_this->m25A6 = 0; + i_this->m25A0 = 0xD; + } + cLib_addCalc2(&i_this->m25B4.x, 2682.0f, 0.05f, i_this->m25CC * 4.87f); + cLib_addCalc2(&i_this->m25B4.y, 9904.0f, 0.05f, i_this->m25CC * 1.03f); + cLib_addCalc2(&i_this->m25B4.z, -3600.0f, 0.05f, i_this->m25CC * 4.79f); + cLib_addCalc2(&i_this->m25A8.x, 2308.0f, 0.05f, i_this->m25CC * 4.92f); + cLib_addCalc2(&i_this->m25A8.y, 9961.0f, 0.05f, i_this->m25CC * 0.9f); + + cLib_addCalc2(&i_this->m25A8.z, -3524.0f, 0.05f, i_this->m25CC * 6.1299998f); + cLib_addCalc2(&i_this->m25CC, DEMO_SELECT(REG13_F(3), REG0_F(3)) + 1.5f, 1.0f, DEMO_SELECT(REG13_F(4), REG0_F(4)) + 0.02f); + local_108.x = 2580.0f; local_108.y = player->current.pos.y; local_108.z = -3670.0f; - player->setPlayerPosAndAngle(&local_108, player->shape_angle.y); + player->setPlayerPosAndAngle(&local_108, 18000); break; - } - // Fall-through - case 0xC: - cLib_addCalc0(&i_this->m6320, 1.0f, REG0_F(0) + 1.0f); - r27 = 1; - i_this->m631C += REG0_F(8) + 0.003f; + case 0xD: + if (i_this->m25A6 < (s16)(REG0_S(3) + 0x64)) { + cLib_addCalc2(&i_this->m25C8, 25.0f, 0.1f, 0.5f); + } else { + cLib_addCalc2(&i_this->m25C8, 55.0f, 0.2f, 3.0f); + } + if (i_this->m25A6 == (s16)(DEMO_SELECT(REG13_S(8), REG0_S(8)) + 0x37)) { + i_this->m25D8 = 1; + } + cLib_addCalc2(&i_this->m25B4.x, i_this->m1150.x, 0.1f, 50.0f); + cLib_addCalc2(&i_this->m25B4.y, (i_this->m1150.y - 200.0f) + DEMO_SELECT(REG13_F(11), REG0_F(11)), 0.1f, 50.0f); + cLib_addCalc2(&i_this->m25B4.z, i_this->m1150.z, 0.1f, 50.0f); - if (i_this->m25A6 < (s16)(REG0_S(6) + 0x9B)) { - i_this->m25D4 = REG0_F(5) + 5.0f; - mDoAud_seStart(JA_SE_ATM_MJT_JINARI, 0); - } - if (i_this->m25A6 == (s16)(REG0_S(6) + 0x96)) { - i_this->m25D8 = 1; - } - if (i_this->m25A6 == (s16)(REG0_S(7) + 0xA0)) { + if (i_this->mpMorf->isStop()) { + anm_init(i_this, BDK_BCK_FLY3, 1.0f, 2, 1.0f, BDK_BAS_FLY3, 0); + player->changeDemoMode(daPy_demo_c::DEMO_A_WAIT_e); + player->changeDemoParam0(2); + } + + if (i_this->m25A6 == (s16)(DEMO_SELECT(REG13_S(8), REG0_S(8)) + 0xF0)) { + i_this->m25A6 = 0; + i_this->m25A0 = 0xE; + } + r27 = 1; + break; + case 0xE: + i_this->m25B4.x = 3304.0f; + i_this->m25B4.y = 10983.0f; + i_this->m25B4.z = -3644.0f; + + i_this->m25A8.x = 2841.0f; + i_this->m25A8.y = 13058.0f; + i_this->m25A8.z = -3272.0f; + + i_this->m25A0 = 0xF; i_this->m25A6 = 0; - i_this->m25A0 = 0xD; - } - cLib_addCalc2(&i_this->m25B4.x, 2682.0f, 0.05f, i_this->m25CC * 4.87f); - cLib_addCalc2(&i_this->m25B4.y, 9904.0f, 0.05f, i_this->m25CC * 1.03f); - cLib_addCalc2(&i_this->m25B4.z, -3600.0f, 0.05f, i_this->m25CC * 4.79f); - cLib_addCalc2(&i_this->m25A8.x, 2308.0f, 0.05f, i_this->m25CC * 4.92f); - cLib_addCalc2(&i_this->m25A8.y, 9961.0f, 0.05f, i_this->m25CC * 0.9f); + i_this->m25CC = 0.0f; + i_this->m6320 = DEMO_SELECT(REG13_F(17), REG0_F(17)) + -100.0f; + i_this->m631C = 0.0f; + case 0xF: + r27 = 1; + // Fall-through + case 0x10: + cLib_addCalc0(&i_this->m6320, 1.0f, DEMO_SELECT(REG6_F(11), REG0_F(11)) + 1.5f); + if (std::fabsf(i_this->m6320) < 1.0f) { + cLib_addCalc0(&i_this->m6324, 1.0f, DEMO_SELECT(REG6_F(12), REG0_F(12)) + 1.0f); + if (i_this->m25A0 == 0xF) { + dComIfGs_onTmpBit(dSv_event_tmp_flag_c::UNK_0401); + dComIfGs_onStageBossDemo(); + fpcM_Search(ep_delete_sub, actor); - cLib_addCalc2(&i_this->m25A8.z, -3524.0f, 0.05f, i_this->m25CC * 6.1299998f); - cLib_addCalc2(&i_this->m25CC, REG0_F(3) + 1.5f, 1.0f, REG0_F(4) + 0.02f); + mDoAud_seStart(JA_SE_ATM_MJT_SHUTTER_END, ¢er_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + dComIfGp_getVibration().StartShock(DEMO_SELECT(REG6_S(2), REG0_S(2)) + 4, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - local_108.x = 2580.0f; - local_108.y = player->current.pos.y; - local_108.z = -3670.0f; - player->setPlayerPosAndAngle(&local_108, 18000); - break; - case 0xD: - if (i_this->m25A6 < (s16)(REG0_S(3) + 0x64)) { - cLib_addCalc2(&i_this->m25C8, 25.0f, 0.1f, 0.5f); - } else { - cLib_addCalc2(&i_this->m25C8, 55.0f, 0.2f, 3.0f); - } - if (i_this->m25A6 == (s16)(REG0_S(8) + 0x37)) { - i_this->m25D8 = 1; - } - cLib_addCalc2(&i_this->m25B4.x, i_this->m1150.x, 0.1f, 50.0f); - cLib_addCalc2(&i_this->m25B4.y, (i_this->m1150.y - 200.0f) + REG0_F(11), 0.1f, 50.0f); - cLib_addCalc2(&i_this->m25B4.z, i_this->m1150.z, 0.1f, 50.0f); + r27 = 0; + i_this->m25A0 = 0x10; + local_154.x = 0; + local_154.y = 0; + local_154.z = 0; - if (i_this->mpMorf->isStop()) { - anm_init(i_this, BDK_BCK_FLY3, 1.0f, 2, 1.0f, BDK_BAS_FLY3, 0); - player->changeDemoMode(daPy_demo_c::DEMO_A_WAIT_e); - player->changeDemoParam0(2); - } + for (s32 i = 0; i <= 2; i++) { + local_154.y = i * 0x5555; + dComIfGp_particle_setToon( + dPa_name::ID_IT_ST_DK_FUTATOJI_SMOKE_C00, ¢er_pos, &local_154, NULL, 0xB9, &i_this->m6130[i], (u8)fopAcM_GetRoomNo(actor) + ); + } + i_this->m6130[3].remove(); - if (i_this->m25A6 == (s16)(REG0_S(8) + 0xF0)) { - i_this->m25A6 = 0; - i_this->m25A0 = 0xE; - } - r27 = 1; - break; - case 0xE: - i_this->m25B4.x = 3304.0f; - i_this->m25B4.y = 10983.0f; - i_this->m25B4.z = -3644.0f; - - i_this->m25A8.x = 2841.0f; - i_this->m25A8.y = 13058.0f; - i_this->m25A8.z = -3272.0f; - - i_this->m25A0 = 0xF; - i_this->m25A6 = 0; - i_this->m25CC = 0.0f; - i_this->m6320 = REG0_F(17) + -100.0f; - i_this->m631C = 0.0f; - case 0xF: - r27 = 1; - // Fall-through - case 0x10: - cLib_addCalc0(&i_this->m6320, 1.0f, REG0_F(11) + 1.5f); - if (std::fabsf(i_this->m6320) < 1.0f) { - cLib_addCalc0(&i_this->m6324, 1.0f, REG0_F(12) + 1.0f); - if (i_this->m25A0 == 0xF) { - dComIfGs_onTmpBit(dSv_event_tmp_flag_c::UNK_0401); - dComIfGs_onStageBossDemo(); - fpcM_Search(ep_delete_sub, actor); - - mDoAud_seStart(JA_SE_ATM_MJT_SHUTTER_END, ¢er_pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - dComIfGp_getVibration().StartShock(REG0_S(2) + 4, -0x21, cXyz(0.0f, 1.0f, 0.0f)); - - r27 = 0; - i_this->m25A0 = 0x10; - - local_154.x = 0; - local_154.y = 0; - local_154.z = 0; - dPa_smokeEcallBack* a; - s32 i = 0; - - for (i = 0; i <= 2; i++) { - a = &i_this->m6130[i]; - local_154.y = i * 0x5555; - dComIfGp_particle_setToon(dPa_name::ID_IT_ST_DK_FUTATOJI_SMOKE_C00, ¢er_pos, - &local_154, NULL, 0xB9, a, (u8)fopAcM_GetRoomNo(actor)); - } - i_this->m6130[3].remove(); - - if (i_this->m6100[1]) { - i_this->m6100[1]->becomeInvalidEmitter(); - i_this->m6100[1] = NULL; + if (i_this->m6100[1]) { + i_this->m6100[1]->becomeInvalidEmitter(); + i_this->m6100[1] = NULL; + } } } - } - cLib_addCalc2(&i_this->m25A8.x, 3152.0f, 0.05f, i_this->m25CC * 3.11f); - cLib_addCalc2(&i_this->m25A8.z, -3070.0f, 0.05f, i_this->m25CC * 2.02f); - cLib_addCalc2(&i_this->m25CC, REG0_F(3) + 1.2f, 1.0f, REG0_F(4) + 0.015f); + cLib_addCalc2(&i_this->m25A8.x, 3152.0f, 0.05f, i_this->m25CC * 3.11f); + cLib_addCalc2(&i_this->m25A8.z, -3070.0f, 0.05f, i_this->m25CC * 2.02f); + cLib_addCalc2(&i_this->m25CC, DEMO_SELECT(REG13_F(3), REG0_F(3)) + 1.2f, 1.0f, DEMO_SELECT(REG13_F(4), REG0_F(4)) + 0.015f); - if (i_this->m25A6 == 0xA0) { - i_this->m25A0 = 0x96; - i_this->mAction = ACTION_FLY; - i_this->m2CA = -1; - i_this->mState = 0; + if (i_this->m25A6 == 0xA0) { + i_this->m25A0 = 0x96; + i_this->mAction = ACTION_FLY; + i_this->m2CA = -1; + i_this->mState = 0; - actor->gravity = REG0_F(4) + -5.0f; - i_this->m2B4 = 0; - for (s32 i = 0; i < ARRAY_SIZE(i_this->mWindAtSph); i++) { - i_this->mWindAtSph[i].SetAtType(AT_TYPE_WIND); + actor->gravity = REG0_F(4) + -5.0f; + i_this->m2B4 = 0; + for (s32 i = 0; i < ARRAY_SIZE(i_this->mWindAtSph); i++) { + i_this->mWindAtSph[i].SetAtType(AT_TYPE_WIND); + } + actor->shape_angle.x = 0; + mDoAud_bgmStart(JA_BGM_DK_BATTLE); } - actor->shape_angle.x = 0; - mDoAud_bgmStart(JA_BGM_DK_BATTLE); - } - break; - case 0x32: - if (!actor->eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); - actor->eventInfo.onCondition(dEvtCnd_UNK2_e); - r28 = 0; break; - } + case 0x32: + if (!actor->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); + actor->eventInfo.onCondition(dEvtCnd_UNK2_e); + r28 = 0; + break; + } - i_this->m25A0++; - i_this->m25CC = 0.0f; - i_this->m25A4 = 0; - i_this->m25A6 = 0; - camera->mCamera.Stop(); - camera->mCamera.SetTrimSize(2); + i_this->m25A0++; + i_this->m25CC = 0.0f; + i_this->m25A4 = 0; + i_this->m25A6 = 0; + camera->mCamera.Stop(); + camera->mCamera.SetTrimSize(2); - i_this->m25A8.x = 3267.0f; - i_this->m25A8.y = 9561.0f; - i_this->m25A8.z = -4562.0f; + i_this->m25A8.x = 3267.0f; + i_this->m25A8.y = 9561.0f; + i_this->m25A8.z = -4562.0f; - i_this->m25B4 = actor->eyePos; - i_this->m25B4.y -= (REG0_F(7) + 100.0f); - i_this->m25C8 = 60.0f; - // Fall-through - case 0x33: - cLib_addCalc2(&i_this->m25B4.x, actor->eyePos.x, 0.1f, i_this->m25CC * 100.0f); - cLib_addCalc2(&i_this->m25B4.y, actor->eyePos.y -(REG0_F(7)+ 100.0f), 0.3f, i_this->m25CC * 200.0f); - cLib_addCalc2(&i_this->m25B4.z, actor->eyePos.z, 0.1f, i_this->m25CC * 100.0f); + i_this->m25B4 = actor->eyePos; + i_this->m25B4.y -= (REG0_F(7) + 100.0f); + i_this->m25C8 = 60.0f; + // Fall-through + case 0x33: + cLib_addCalc2(&i_this->m25B4.x, actor->eyePos.x, 0.1f, i_this->m25CC * 100.0f); + cLib_addCalc2(&i_this->m25B4.y, actor->eyePos.y - (REG0_F(7) + 100.0f), 0.3f, i_this->m25CC * 200.0f); + cLib_addCalc2(&i_this->m25B4.z, actor->eyePos.z, 0.1f, i_this->m25CC * 100.0f); + + if (i_this->mAction == ACTION_START) { + i_this->m25A0++; + i_this->m25A6 = 0; + } + cLib_addCalc2(&i_this->m25CC, 1.0f, 1.0f, REG0_F(4) + 0.02f); + break; + case 0x34: + if (i_this->m25A6 >= 0x64) { + i_this->m25A0 = 0x96; + } + break; + case 0x64: + { + if (!actor->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); + actor->eventInfo.onCondition(dEvtCnd_UNK2_e); + r28 = 0; + break; + } + i_this->m25A0++; + i_this->m25CC = 0.0f; + i_this->m25A4 = 0; + i_this->m25A6 = 0; + camera->mCamera.Stop(); + camera->mCamera.SetTrimSize(2); + + camera_class* pCamera = dComIfGp_getCamera(0); + i_this->m25A8 = pCamera->mLookat.mEye; + local_104.x = pCamera->mLookat.mEye.x - i_this->m1150.x; + local_104.z = pCamera->mLookat.mEye.z - i_this->m1150.z; + + i_this->m25C0.y = cM_atan2s(local_104.x, local_104.z); + + i_this->m25C0.x = -cM_atan2s(local_104.y, std::sqrtf(local_104.x * local_104.x + local_104.z * local_104.z)); + actor->current.angle.y = i_this->m25C0.y + (s16)cM_rndFX(4000.0f); + i_this->m25D0 = 1500.0f; + i_this->m25C8 = 45.0f; + player->changeOriginalDemo(); + mDoAud_bgmStreamPrepare(JA_STRM_DK_CLEAR); + // Fall-through + } + case 0x65: + if (i_this->m25A6 == 0x3C) { + mDoAud_bgmStreamPlay(); + } + i_this->m25B4 = i_this->m1150; + i_this->m25B4.y += DEMO_SELECT(REG6_F(16), REG0_F(16)) + -100.0f; + local_104.x = 0.0f; + local_104.y = 0.0f; + local_104.z = i_this->m25D0 + DEMO_SELECT(REG6_F(17), REG0_F(17)); + + cMtx_YrotS(*calc_mtx, i_this->m25C0.y); + cMtx_XrotM(*calc_mtx, i_this->m25C0.x); + MtxPosition(&local_104, &local_108); + local_108 += i_this->m25B4; + cLib_addCalc2(&i_this->m25A8.x, local_108.x, 0.1f, 100.0f); + if (i_this->m25A2 == 0) { + i_this->m25A8.y = DEMO_SELECT(REG6_F(18), REG0_F(18)) + 9950.0f; + } else { + cLib_addCalc2(&i_this->m25A8.y, local_108.y + DEMO_SELECT(REG6_F(13), REG0_F(13)), 0.1f, 100.0f); + } + cLib_addCalc2(&i_this->m25A8.z, local_108.z, 0.1f, 100.0f); + break; + case 0x6E: + i_this->m25C8 = 40.0f; + + i_this->m25A8.x = -25267.0f; + i_this->m25A8.y = -948.0f; + i_this->m25A8.z = 22916.0f; + i_this->m25A0 = 0x6F; + // Fall-through + case 0x6F: + { + i_this->m25B4.x = 3600.0f; + f32 fVar17 = actor->current.pos.y; + if (fVar17 < 30000.0f) { + i_this->m25B4.y = (fVar17 - 6000.0f) + DEMO_SELECT(REG6_F(19), REG0_F(19)); + } + i_this->m25B4.z = -3800.0f; + cLib_addCalc2(&i_this->m25A8.z, 30449.0f, 0.02f, i_this->m25CC * 75.33f); + if (i_this->m25A6 > DEMO_SELECT(REG6_S(2), REG0_S(2))) { + cLib_addCalc2(&i_this->m25CC, DEMO_SELECT(REG6_S(1), REG0_S(1)) + 1.5f, 1.0f, DEMO_SELECT(REG6_F(2), REG0_F(2)) + 0.02f); + } + local_108.x = 4444.0f; + local_108.y = 9800.0f; + local_108.z = -4500.0f; + + player->setPlayerPosAndAngle(&local_108, (s16)0); + break; + } + case 0x70: + i_this->m25B4 = i_this->m2CC; - if (i_this->mAction == ACTION_START) { i_this->m25A0++; i_this->m25A6 = 0; - } - cLib_addCalc2(&i_this->m25CC, 1.0f, 1.0f, REG0_F(4) + 0.02f); - break; - case 0x34: - if (i_this->m25A6 >= 0x64) { - i_this->m25A0 = 0x96; - } - break; - case 0x64: { - if (!actor->eventInfo.checkCommandDemoAccrpt()) { - fopAcM_orderPotentialEvent(actor, dEvtType_OTHER_e, 0xFFFF, 0); - actor->eventInfo.onCondition(dEvtCnd_UNK2_e); - r28 = 0; + i_this->m25C8 = dVar16; + // Fall-through + case 0x71: + if (i_this->m25A6 == 0x78) { + local_104 = center_pos; + local_104.y = 10300.0f; + eff_hane_set(i_this, &local_104, 0x27, -1); + } + + if (i_this->m25A6 > DEMO_SELECT(REG12_S(7), REG0_S(7)) + 0x43) { + cLib_addCalc2(&i_this->m25B4.y, DEMO_SELECT(REG12_F(4), REG0_F(4)) + 9900.0f, 0.5f, DEMO_SELECT(REG12_F(6), REG0_F(6)) + 200.0f); + } + i_this->m25A8 = i_this->m2CC; + i_this->m25A8.y = DEMO_SELECT(REG12_F(5), REG0_F(5)) + 10000.0f; + i_this->m25A8.x += DEMO_SELECT(REG12_F(7), REG0_F(7)) + 500.0f; + + local_108 = i_this->m2CC; + + local_108.x += REG0_F(11) - 200.0f; + local_108.z += REG0_F(12) - 150.0f; + local_108.y = player->current.pos.y; + + player->setPlayerPosAndAngle(&local_108, 10000); + if (i_this->m25A6 == DEMO_SELECT(REG6_S(2), REG0_S(2)) + 0x6E) { + player->changeDemoMode(daPy_demo_c::DEMO_SMILE_e); + } + if (i_this->m25A6 == DEMO_SELECT(REG6_S(2), REG0_S(2)) + 0x82) { + player->changeDemoMode(daPy_demo_c::DEMO_UNK_029_e); + } + if (i_this->m25A6 == DEMO_SELECT(REG6_S(4), REG0_S(4)) + 0xBE) { + i_this->m25A0++; + i_this->m25A6 = 0; + } break; - } - i_this->m25A0++; - i_this->m25CC = 0.0f; - i_this->m25A4 = 0; - i_this->m25A6 = 0; - camera->mCamera.Stop(); - camera->mCamera.SetTrimSize(2); + case 0x72: + i_this->m25B4.x = 4386.0f; + i_this->m25B4.y = 10020.0f; + i_this->m25B4.z = -4368.0f; - camera_class* pCamera = dComIfGp_getCamera(0); - i_this->m25A8 = pCamera->mLookat.mEye; - local_104.x = pCamera->mLookat.mEye.x - i_this->m1150.x; - local_104.z = pCamera->mLookat.mEye.z - i_this->m1150.z; + i_this->m25A8.x = 4144.0f; + i_this->m25A8.y = 10061.0f; + i_this->m25A8.z = -4131.0f; - i_this->m25C0.y = cM_atan2s(local_104.x, local_104.z); - - i_this->m25C0.x = -cM_atan2s(local_104.y, std::sqrtf(local_104.x * local_104.x + local_104.z * local_104.z)); - actor->current.angle.y = i_this->m25C0.y + (s16)cM_rndFX(4000.0f); - i_this->m25D0 = 1500.0f; - i_this->m25C8 = 45.0f; - player->changeOriginalDemo(); - mDoAud_bgmStreamPrepare(JA_STRM_DK_CLEAR); - // Fall-through - } - case 0x65: - if (i_this->m25A6 == 0x3C) { - mDoAud_bgmStreamPlay(); - } - i_this->m25B4 = i_this->m1150; - i_this->m25B4.y += REG0_F(16) + -100.0f; - local_104.x = 0.0f; - local_104.y = 0.0f; - local_104.z = i_this->m25D0 + REG0_F(17); - - cMtx_YrotS(*calc_mtx, i_this->m25C0.y); - cMtx_XrotM(*calc_mtx, i_this->m25C0.x); - MtxPosition(&local_104, &local_108); - local_108 += i_this->m25B4; - cLib_addCalc2(&i_this->m25A8.x, local_108.x, 0.1f, 100.0f); - if (i_this->m25A2 == 0) { - i_this->m25A8.y = REG0_F(18) + 9950.0f; - } else { - cLib_addCalc2(&i_this->m25A8.y, local_108.y + REG0_F(13), 0.1f, 100.0f); - } - cLib_addCalc2(&i_this->m25A8.z, local_108.z, 0.1f, 100.0f); - break; - case 0x6E: - i_this->m25C8 = 40.0f; - - i_this->m25A8.x = -25267.0f; - i_this->m25A8.y = -948.0f; - i_this->m25A8.z = 22916.0f; - i_this->m25A0 = 0x6F; - // Fall-through - case 0x6F: { - i_this->m25B4.x = 3600.0f; - f32 fVar17 = actor->current.pos.y; - if (fVar17 < 30000.0f) { - i_this->m25B4.y = (fVar17 - 6000.0f) + REG0_F(19); - } - i_this->m25B4.z = -3800.0f; - cLib_addCalc2(&i_this->m25A8.z, 30449.0f, 0.02f, i_this->m25CC * 75.33f); - if (i_this->m25A6 > REG0_S(2)) { - cLib_addCalc2(&i_this->m25CC, REG0_S(1) + 1.5f, 1.0f, REG0_F(2) + 0.02f); - } - local_108.x = 4444.0f; - local_108.y = 9800.0f; - local_108.z = -4500.0f; - - player->setPlayerPosAndAngle(&local_108, (s16)0); - break; - } - case 0x70: - i_this->m25B4 = i_this->m2CC; - - i_this->m25A0++; - i_this->m25A6 = 0; - i_this->m25C8 = dVar16; - // Fall-through - case 0x71: - if (i_this->m25A6 == 0x78) { - local_104 = center_pos; - local_104.y = 10300.0f; - eff_hane_set(i_this, &local_104, 0x27, -1); - } - - if (i_this->m25A6 > REG0_S(7) + 0x43) { - cLib_addCalc2(&i_this->m25B4.y, REG0_F(4) + 9900.0f, 0.5f, REG0_F(6) + 200.0f); - } - i_this->m25A8 = i_this->m2CC; - i_this->m25A8.y = REG0_F(5) + 10000.0f; - i_this->m25A8.x += REG0_F(7) + 500.0f; - - local_108 = i_this->m2CC; - - local_108.x += REG0_F(11) -200.0f; - local_108.z += REG0_F(12) -150.0f; - local_108.y = player->current.pos.y; - - player->setPlayerPosAndAngle(&local_108, 10000); - if (i_this->m25A6 == REG0_S(2) + 0x6E) { - player->changeDemoMode(daPy_demo_c::DEMO_SMILE_e); - } - if (i_this->m25A6 == REG0_S(2) + 0x82) { - player->changeDemoMode(daPy_demo_c::DEMO_UNK_029_e); - } - if (i_this->m25A6 == REG0_S(4) + 0xBE) { - i_this->m25A0++; - i_this->m25A6 = 0; - } - break; - case 0x72: - i_this->m25B4.x = 4386.0f; - i_this->m25B4.y = 10020.0f; - i_this->m25B4.z = -4368.0f; - - i_this->m25A8.x = 4144.0f; - i_this->m25A8.y = 10061.0f; - i_this->m25A8.z = -4131.0f; - - if (i_this->m25A6 == 10) { - dComIfGs_onStageBossEnemy(); - mDoAud_seStart(JA_SE_OBJ_TOGE_IN, NULL, 0x0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); - } - if (i_this->m25A6 == 0x28) { - i_this->m25A0 = 0x96; - } - break; - case 0x96: - i_this->m25A0 = 0; - camera->mCamera.Reset(i_this->m25B4, i_this->m25A8); - camera->mCamera.Start(); - camera->mCamera.SetTrimSize(0); - dComIfGp_event_reset(); - fopAcM_OffStatus(actor, fopAcStts_UNK4000_e); - break; - default: - break; + if (i_this->m25A6 == 10) { + dComIfGs_onStageBossEnemy(); + mDoAud_seStart(JA_SE_OBJ_TOGE_IN, NULL, 0x0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor))); + } + if (i_this->m25A6 == 0x28) { + i_this->m25A0 = 0x96; + } + break; + case 0x96: + i_this->m25A0 = 0; + camera->mCamera.Reset(i_this->m25B4, i_this->m25A8); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + fopAcM_OffStatus(actor, fopAcStts_UNK4000_e); + break; + default: + break; } if (i_this->m25A0 != 0 && r28) { @@ -3138,7 +3339,7 @@ void demo_camera(bdk_class* i_this) { s16 r20 = 0; if (i_this->m25D4 > 0.1f) { - r20 = (50.0f + REG0_F(6)) * cM_scos(i_this->m25A4 * 0x1c00); + r20 = (50.0f + DEMO_SELECT(REG13_F(6), REG0_F(6))) * cM_scos(i_this->m25A4 * 0x1c00); } if (i_this->m25A0 < 10) { @@ -3163,14 +3364,17 @@ void demo_camera(bdk_class* i_this) { } /* 0000A7C8-0000B204 .text eff_hane_move__FP9bdk_classP9bdk_eff_s */ -void eff_hane_move(bdk_class* i_this, bdk_eff_s* i_eff) { +static void eff_hane_move(bdk_class* i_this, bdk_eff_s* i_eff) { fopAc_ac_c* actor = &i_this->actor; - f32 fVar1 = -130.0f; - f32 fVar2 = 2.0f; - cXyz vec1; cXyz vec2; cXyz vec3; + f32 height; + f32 fVar1 = -130.0f; + f32 fVar2 = 2.0f; + f32 fVar3; + f32 fVar4; + dBgS_GndChk gndChk; dBgS_LinChk linChk; @@ -3210,9 +3414,9 @@ void eff_hane_move(bdk_class* i_this, bdk_eff_s* i_eff) { vec1 = i_eff->m004; vec1.y += 200.0f; gndChk.SetPos(&vec1); - f32 height = dComIfG_Bgsp()->GroundCross(&gndChk) + 20.0f; + height = dComIfG_Bgsp()->GroundCross(&gndChk) + 20.0f; - i_eff->m01C -= (0.1f + REG8_F(14)); + i_eff->m01C -= 0.1f + REG8_F(14); if (i_eff->m01C < REG8_F(15) + -5.0f) { i_eff->m01C = REG8_F(15) + -5.0f; @@ -3230,12 +3434,16 @@ void eff_hane_move(bdk_class* i_this, bdk_eff_s* i_eff) { i_eff->m030.x = i_eff->m028 * cM_ssin(i_eff->m03C * 0x500); i_eff->m030.z = i_eff->m028 * cM_scos(i_eff->m03C * 0x400); - f32 fVar3; - f32 fVar4; if (i_eff->m040 != 0) { +#if VERSION > VERSION_DEMO fVar3 = REG8_F(7) + 15000.0f; fVar4 = 1000.0f; fVar1 = REG8_F(8) + -300.0f; +#else + fVar3 = 20000.0f; + fVar4 = 1000.0f; + fVar1 = 300.0f; +#endif fVar2 = 10.0f; } else { fVar3 = 8000.0f; @@ -3271,28 +3479,19 @@ void eff_hane_move(bdk_class* i_this, bdk_eff_s* i_eff) { dComIfG_Ccsp()->Set(&i_eff->m048); } - fopAc_ac_c* tgActor; - CcAtInfo hit_atInfo; if (i_eff->m048.ChkTgHit() != NULL && i_eff->m040 == 0) { - CcAtInfo hit_atInfo; - cCcD_Stts* stts = i_eff->m048.GetTgHitObj()->GetStts(); - if (stts == NULL) { - tgActor = NULL; - } else { - tgActor = stts->GetActor(); - } - + fopAc_ac_c* tgActor = i_eff->m048.GetTgHitObj()->GetAc(); if (tgActor != NULL) { vec3 = i_eff->m004 - tgActor->current.pos; if (i_eff->m020 < 5.0f) { i_eff->m030.y = cM_atan2s(vec3.x, vec3.z) + (s16)cM_rndFX(4000.0f); - i_eff->m020 = 10.0f + cM_rndF(5.0f) + REG0_F(8); - i_eff->m01C = 10.0f + cM_rndF(5.0f) + REG0_F(9); + i_eff->m020 = 10.0f + cM_rndF(5.0f) + DEMO_SELECT(REG13_F(8), REG0_F(8)); + i_eff->m01C = 10.0f + cM_rndF(5.0f) + DEMO_SELECT(REG13_F(9), REG0_F(9)); } - i_eff->m036.z = cM_rndFX(REG0_F(10) + 1500.0f); - i_eff->m036.x = cM_rndFX(REG0_F(16) + 1500.0f); + i_eff->m036.z = cM_rndFX(DEMO_SELECT(REG13_F(10), REG0_F(10)) + 1500.0f); + i_eff->m036.x = cM_rndFX(DEMO_SELECT(REG13_F(16), REG0_F(16)) + 1500.0f); i_eff->m040 = cM_rndF(30.0f) + 30.0f; } } @@ -3302,7 +3501,7 @@ void eff_hane_move(bdk_class* i_this, bdk_eff_s* i_eff) { } /* 0000B204-0000B278 .text eff_Grock_move__FP9bdk_classP9bdk_eff_s */ -void eff_Grock_move(bdk_class* i_this, bdk_eff_s* eff) { +static void eff_Grock_move(bdk_class*, bdk_eff_s* eff) { f32 fVar1 = 0.0f; if (eff->m03C == 1) { fVar1 = -10.0f; @@ -3312,7 +3511,7 @@ void eff_Grock_move(bdk_class* i_this, bdk_eff_s* eff) { } /* 0000B278-0000B30C .text my_effect_move__FP9bdk_class */ -void my_effect_move(bdk_class* i_this) { +static void my_effect_move(bdk_class* i_this) { bdk_eff_s* eff = &i_this->m261C[0]; for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m261C); i++, eff++) { if (eff->m000 != 0) { @@ -3328,7 +3527,6 @@ void my_effect_move(bdk_class* i_this) { /* 0000B30C-0000BD74 .text daBdk_Execute__FP9bdk_class */ static BOOL daBdk_Execute(bdk_class* i_this) { - /* Nonmatching */ fopAc_ac_c* actor = &i_this->actor; daPy_py_c* player = daPy_getPlayerActorClass(); @@ -3341,10 +3539,10 @@ static BOOL daBdk_Execute(bdk_class* i_this) { } } if (i_this->m2F8 != 0) { - i_this->m2F8--; + i_this->m2F8--; } if (i_this->m2FA != 0) { - i_this->m2FA--; + i_this->m2FA--; } if (i_this->m1138 != 0) { i_this->m1138--; @@ -3399,7 +3597,7 @@ static BOOL daBdk_Execute(bdk_class* i_this) { cMtx_YrotS(*calc_mtx, -actor->shape_angle.y); offset = i_this->m1150 - i_this->m1144; MtxPosition(&offset, &out); - s16 angle = out.z * (REG8_F(0xF) + - 200.0f); + s16 angle = out.z * (REG8_F(0xF) + -200.0f); if (angle > 8000) { angle = 8000; } else { @@ -3408,11 +3606,11 @@ static BOOL daBdk_Execute(bdk_class* i_this) { } } - s16 iVar4 = (REG0_F(5) + - 2000.0f) * i_this->m1140 * cM_ssin(i_this->m1130 * (REG8_S(4) + 2500)); + s16 iVar4 = (DEMO_SELECT(REG14_F(5), REG0_F(5)) + -2000.0f) * i_this->m1140 * cM_ssin(i_this->m1130 * (REG8_S(4) + 2500)); s16 iVar11 = i_this->m113C * 4000.0f; - cLib_addCalc2(&i_this->m113C, 1.0f, 1.0f, REG0_F(4) + 0.01f); - if (i_this->m25A6 > REG0_S(9) + 0x41) { - cLib_addCalc2(&i_this->m1140, 1.0f, 1.0f, REG0_F(0x2) + 0.4f); + cLib_addCalc2(&i_this->m113C, 1.0f, 1.0f, DEMO_SELECT(REG14_F(4), REG0_F(4)) + 0.01f); + if (i_this->m25A6 > DEMO_SELECT(REG14_S(9), REG0_S(9)) + 0x41) { + cLib_addCalc2(&i_this->m1140, 1.0f, 1.0f, DEMO_SELECT(REG14_F(0x2), REG0_F(0x2)) + 0.4f); } cLib_addCalcAngleS2(&i_this->m1120, angle + iVar4 + 4500, 4, iVar11); cLib_addCalcAngleS2(&i_this->m1122, 4, 10, iVar11); @@ -3451,11 +3649,11 @@ static BOOL daBdk_Execute(bdk_class* i_this) { } actor->shape_angle.y = actor->current.angle.y; actor->shape_angle.z = actor->current.angle.z; - MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(0x18), *calc_mtx); // j_dk_atama1 joint + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(JNT_J_DK_ATAMA1), *calc_mtx); - offset.x = REG0_F(10) + 120.0f; + offset.x = DEMO_SELECT(REG6_F(10), REG0_F(10)) + 120.0f; offset.y = 0.0f; - offset.z = REG0_F(12) + - 120.0f; + offset.z = DEMO_SELECT(REG6_F(12), REG0_F(12)) + -120.0f; MtxPosition(&offset, &actor->eyePos); actor->attention_info.position = actor->eyePos; s16 angle; @@ -3474,6 +3672,9 @@ static BOOL daBdk_Execute(bdk_class* i_this) { angle = 0; } i_this->mF10 = 0; +#if VERSION == VERSION_DEMO + i_this->m2584 = 0; +#endif cLib_addCalcAngleS2(&i_this->mF12, angle, 4, 0x800); cLib_addCalcAngleS2(&i_this->mF14, 0, 0x10, 0x200); @@ -3489,21 +3690,24 @@ static BOOL daBdk_Execute(bdk_class* i_this) { } if (i_this->m2618 != 0 && (i_this->m2618--, i_this->m2618 == 0)) { dComIfGp_particle_setToon( - dPa_name::ID_IT_ST_DK_TOBITATI_SMOKE00, &i_this->m260C, &actor->shape_angle, NULL, 0xB9, - &i_this->m6110, (s8)fopAcM_GetRoomNo(actor) + dPa_name::ID_IT_ST_DK_TOBITATI_SMOKE00, &i_this->m260C, &actor->shape_angle, NULL, 0xB9, &i_this->m6110, (s8)fopAcM_GetRoomNo(actor) ); } if (i_this->m2619 != 0) { fopAcM_seStartCurrent(actor, JA_SE_CM_DK_NAIL, 0); for (s32 i = 0; i < ARRAY_SIZE(i_this->m1174); i++) { foot_eff_pos[i] = i_this->m1174[i]; - foot_eff_pos[i].y -= REG0_F(0x9) + 200.0f; + foot_eff_pos[i].y -= DEMO_SELECT(REG6_F(9), REG0_F(9)) + 200.0f; if (foot_eff_pos[i].y < 9800.0f) { foot_eff_pos[i].y = 9800.0f; } } +#if VERSION > VERSION_DEMO if (foot_eff_pos[0].y > 9810.0f || (i_this->m2584 == 0)) { +#else + if (foot_eff_pos[0].y > 9810.0f) { +#endif i_this->m2619 = 0; for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->mp6214); i++) { @@ -3521,27 +3725,33 @@ static BOOL daBdk_Execute(bdk_class* i_this) { } } } +#if VERSION > VERSION_DEMO i_this->m2584 = 0; +#endif return TRUE; } /* 0000BD74-0000BD7C .text daBdk_IsDelete__FP9bdk_class */ -static BOOL daBdk_IsDelete(bdk_class* i_this) { +static BOOL daBdk_IsDelete(bdk_class*) { return TRUE; } /* 0000BD7C-0000BF08 .text daBdk_Delete__FP9bdk_class */ static BOOL daBdk_Delete(bdk_class* i_this) { - fopAc_ac_c* actor = &i_this->actor; dComIfG_resDeleteDemo(&i_this->mPhase, "Bdk"); mDoHIO_deleteChild(l_HIO.mNo); +#if VERSION > VERSION_DEMO + fopAc_ac_c* actor = &i_this->actor; if (actor->heap) { +#endif dComIfG_Bgsp()->Release(i_this->pm_bgw); dComIfG_Bgsp()->Release(i_this->mp63BC[0]); dComIfG_Bgsp()->Release(i_this->mp63BC[1]); dComIfG_Bgsp()->Release(i_this->mp63BC[2]); +#if VERSION > VERSION_DEMO i_this->mpMorf->stopZelAnime(); } +#endif for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->m910); i++) { mDoAud_seDeleteObject(&i_this->m910[i]); } @@ -3562,12 +3772,17 @@ static BOOL daBdk_Delete(bdk_class* i_this) { /* 0000BF08-0000C684 .text useHeapInit__FP10fopAc_ac_c */ static BOOL useHeapInit(fopAc_ac_c* i_actor) { - bdk_class* i_this = (bdk_class *)i_actor; + bdk_class* i_this = (bdk_class*)i_actor; i_this->mpMorf = new mDoExt_McaMorf( (J3DModelData*)dComIfG_getObjectRes("Bdk", BDK_BDL_DK), - NULL, NULL, + NULL, + NULL, (J3DAnmTransformKey*)dComIfG_getObjectRes("Bdk", BDK_BCK_FLY1), - J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1, + J3DFrameCtrl::EMode_LOOP, + 1.0f, + 0, + -1, + 1, dComIfG_getObjectRes("Bdk", BDK_BAS_FLY1), 0x80000, 0x11000022 @@ -3578,8 +3793,9 @@ static BOOL useHeapInit(fopAc_ac_c* i_actor) { } for (u16 i = 0; i < i_this->mpMorf->getModel()->getModelData()->getJointNum(); i++) { - // j_dk_kubi1, (j_dk_tosaka_A1 to j_dk_tosaka_B2), j_dk_o_lA2, j_dk_o_lB2, j_dk_o_rA2, j_dk_o_rB2 joints - if (i == 0x17 || (0x1F <= i && i <= 0x24) || i == 0x3A || i == 0x3C || i == 0x3E || i == 0x40) { + if (i == JNT_J_DK_KUBI1 || (JNT_J_DK_TOSAKA_A1 <= i && i <= JNT_J_DK_TOSAKA_B2) || i == JNT_J_DK_O_LA2 || i == JNT_J_DK_O_LB2 || i == JNT_J_DK_O_RA2 || + i == JNT_J_DK_O_RB2) + { i_this->mpMorf->getModel()->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); } } @@ -3600,28 +3816,33 @@ static BOOL useHeapInit(fopAc_ac_c* i_actor) { static u16 kamen_break_bdl[] = {BDK_BDL_BUHINA, BDK_BDL_BUHINB, BDK_BDL_BUHINC, BDK_BDL_BUHIND}; for (s32 i = 0; i < 0x4; i++) { - i_this->m8FC[i] = mDoExt_J3DModel__create((J3DModelData*)dComIfG_getObjectRes("Bdk", kamen_break_bdl[i]) - , 0x80000, 0x11000022); + i_this->m8FC[i] = mDoExt_J3DModel__create((J3DModelData*)dComIfG_getObjectRes("Bdk", kamen_break_bdl[i]), 0x80000, 0x11000022); if (!i_this->m8FC[i]) { return FALSE; } } - i_this->bva = new mDoExt_bvaAnm(); - JUT_ASSERT(0x1864, i_this->bva); - s32 bva = i_this->bva->init(i_this->mp8F0, (J3DAnmVisibilityFull *)dComIfG_getObjectRes("Bdk", BDK_BVA_HIBIWARE1), 1, J3DFrameCtrl::EMode_NONE); + i_this->bva = new mDoExt_bvaAnm(); + JUT_ASSERT(DEMO_SELECT(0x1831, 0x1864), i_this->bva); + + s32 bva = i_this->bva->init(i_this->mp8F0, (J3DAnmVisibilityFull*)dComIfG_getObjectRes("Bdk", BDK_BVA_HIBIWARE1), 1, J3DFrameCtrl::EMode_NONE); +#if VERSION > VERSION_DEMO if (bva == 0) { return FALSE; } +#endif modelData = (J3DModelData*)dComIfG_getObjectRes("Bdk", BDK_BDL_DK_TAIL); - JUT_ASSERT(0x1878, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(0x183D, 0x1878), modelData != NULL); + for (int i = 0; i < 4; i++) { - for(s32 j = 0; j < 9; j++) { + for (s32 j = 0; j < 9; j++) { i_this->m300[i].m000[j] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000022); +#if VERSION > VERSION_DEMO if (i_this->m300[i].m000[j] == NULL) { return FALSE; } +#endif } } @@ -3631,7 +3852,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_actor) { } else if (i < 0x27) { modelData = (J3DModelData*)dComIfG_getObjectRes("Bdk", BDK_BDL_GHANE00); } - JUT_ASSERT(0x189C, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(0x185B, 0x189C), modelData != NULL); i_this->m261C[i].m044 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000022); if (i_this->m261C[i].m044 == NULL) { return FALSE; @@ -3639,7 +3860,8 @@ static BOOL useHeapInit(fopAc_ac_c* i_actor) { } modelData = (J3DModelData*)dComIfG_getObjectRes("Bdk", BDK_BDL_S_TSHUTTER); - JUT_ASSERT(0x18A9, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(0x1868, 0x18A9), modelData != NULL); + for (s32 i = 0; i < 3; i++) { i_this->mp6310[i] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000022); if (i_this->mp6310[i] == NULL) { @@ -3656,14 +3878,15 @@ static BOOL useHeapInit(fopAc_ac_c* i_actor) { i_this->mp63BC[i]->SetCrrFunc(dBgS_MoveBGProc_Typical); } modelData = (J3DModelData*)dComIfG_getObjectRes("Bdk", BDK_BDL_S_TTOGE); - JUT_ASSERT(0x18C4, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(0x1883, 0x18C4), modelData != NULL); + i_this->mp62D8 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000022); if (i_this->mp62D8 == NULL) { return FALSE; } i_this->pm_bgw = new dBgW(); - JUT_ASSERT(0x18CE, i_this->pm_bgw != NULL); + JUT_ASSERT(DEMO_SELECT(0x188D, 0x18CE), i_this->pm_bgw != NULL); i_this->pm_bgw->Set((cBgD_t*)(dComIfG_getObjectRes("Bdk", BDK_DZB_S_TTOGE)), dBgW::MOVE_BG_e, &i_this->m62DC); i_this->pm_bgw->SetCrrFunc(dBgS_MoveBGProc_Typical); @@ -3672,10 +3895,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_actor) { static Vec mune1_offset[] = {{105.0f, 0.0f, 40.0f}}; static Vec mune2_offset[] = {{-15.0f, 0.0f, 25.0f}}; static Vec mune3_offset[] = {{-15.0f, 0.0f, 110.0f}}; - static Vec kubi1_offset[] = { - {-80.0f, 0.0f, 35.0f}, - {0.0f, 0.0f, -5.0f} - }; + static Vec kubi1_offset[] = {{-80.0f, 0.0f, 35.0f}, {0.0f, 0.0f, -5.0f}}; static Vec atama_offset[] = {{40.0f, 0.0f, 5.0f}}; static Vec tubasaL1_0_offset[] = {{0.0f, -30.0f, -5.0f}}; static Vec tubasaL1_1_offset[] = { @@ -3699,79 +3919,79 @@ static BOOL useHeapInit(fopAc_ac_c* i_actor) { static __jnt_hit_data_c search_data[] = { { /* mShapeType */ JntHitType_SPH_e, - /* mJointIndex */ 0x02, // kosi1: joint + /* mJointIndex */ JNT_J_DK_KOSI, /* mRadius */ 132.0f, /* mpOffsets */ kosi1_offset, }, { /* mShapeType */ JntHitType_SPH_e, - /* mJointIndex */ 0x15, // mune1: joint + /* mJointIndex */ JNT_J_DK_MUNE1, /* mRadius */ 140.0f, /* mpOffsets */ mune1_offset, }, { /* mShapeType */ JntHitType_SPH_e, - /* mJointIndex */ 0x16, // mune2: joint + /* mJointIndex */ JNT_J_DK_MUNE2, /* mRadius */ 148.0f, /* mpOffsets */ mune2_offset, }, { /* mShapeType */ JntHitType_SPH_e, - /* mJointIndex */ 0x16, // mune2: joint + /* mJointIndex */ JNT_J_DK_MUNE2, /* mRadius */ 112.0f, /* mpOffsets */ mune3_offset, }, { /* mShapeType */ JntHitType_CYL_e, - /* mJointIndex */ 0x17, // kubi3: joint + /* mJointIndex */ JNT_J_DK_KUBI1, /* mRadius */ 85.0f, /* mpOffsets */ kubi1_offset, }, { /* mShapeType */ JntHitType_SPH_DELETE_e, - /* mJointIndex */ 0x18, // atama: joint + /* mJointIndex */ JNT_J_DK_ATAMA1, /* mRadius */ 90.0f, /* mpOffsets */ atama_offset, }, { /* mShapeType */ JntHitType_SPH_e, - /* mJointIndex */ 0x25, // tubasaL1_0: joint + /* mJointIndex */ JNT_J_DK_TUBASA_L1, /* mRadius */ 100.0f, /* mpOffsets */ tubasaL1_0_offset, }, { /* mShapeType */ JntHitType_CYL_e, - /* mJointIndex */ 0x25, // tubasaL1_0: joint + /* mJointIndex */ JNT_J_DK_TUBASA_L1, /* mRadius */ 55.0f, /* mpOffsets */ tubasaL1_1_offset, }, { /* mShapeType */ JntHitType_CYL2_e, - /* mJointIndex */ 0x25, // tubasaL1_0: joint + /* mJointIndex */ JNT_J_DK_TUBASA_L1, /* mRadius */ 110.0f, /* mpOffsets */ tubasaL1_2_offset, }, { /* mShapeType */ JntHitType_SPH_e, - /* mJointIndex */ 0x2F, // tubasaR1_0: joint + /* mJointIndex */ JNT_J_DK_TUBASA_R1, /* mRadius */ 100.0f, /* mpOffsets */ tubasaR1_0_offset, }, { /* mShapeType */ JntHitType_CYL_e, - /* mJointIndex */ 0x2F, // tubasaR1_0: joint + /* mJointIndex */ JNT_J_DK_TUBASA_R1, /* mRadius */ 55.0f, /* mpOffsets */ tubasaR1_1_offset, }, { /* mShapeType */ JntHitType_CYL2_e, - /* mJointIndex */ 0x2F, // tubasaR1_0: joint + /* mJointIndex */ JNT_J_DK_TUBASA_R1, /* mRadius */ 110.0f, /* mpOffsets */ tubasaR1_2_offset, }, }; i_this->mp63C8 = JntHit_create(i_this->mpMorf->getModel(), search_data, ARRAY_SIZE(search_data)); - if (i_this->mp63C8 !=NULL) { + if (i_this->mp63C8 != NULL) { fopAcM_SetJntHit(i_actor, i_this->mp63C8); } @@ -4041,7 +4261,7 @@ static cPhs_State daBdk_Create(fopAc_ac_c* a_this) { actor->attention_info.distances[fopAc_Attn_TYPE_BATTLE_e] = 0x2A; l_HIO.mNo = mDoHIO_createChild("戦闘用大怪鳥", &l_HIO); - i_this->mAcch.Set(fopAcM_GetPosition_p(actor), fopAcM_GetOldPosition_p(actor), actor, 1 , &i_this->mAcchCir, fopAcM_GetSpeed_p(actor)); + i_this->mAcch.Set(fopAcM_GetPosition_p(actor), fopAcM_GetOldPosition_p(actor), actor, 1, &i_this->mAcchCir, fopAcM_GetSpeed_p(actor)); i_this->mAcch.OffSameActorChk(); i_this->mAcchCir.SetWall(400.0f, 500.0f); @@ -4087,7 +4307,7 @@ static cPhs_State daBdk_Create(fopAc_ac_c* a_this) { center_pos2.y = 9720.0f; center_pos2.z = -3800.0f; - if (dComIfGs_isStageBossEnemy() || REG0_S(0) != 0) { + if (dComIfGs_isStageBossEnemy() || DEMO_SELECT(REG17_S(0), REG0_S(0) != 0)) { dComIfGs_onStageBossEnemy(); i_this->mAction = ACTION_AFTER_FIGHT; actor->current.pos.x = 300000.0f; @@ -4119,9 +4339,9 @@ static cPhs_State daBdk_Create(fopAc_ac_c* a_this) { } } } - #if VERSION > VERSION_DEMO +#if VERSION > VERSION_DEMO i_this->m6224 = actor->tevStr; - #endif +#endif return phase_state; } static actor_method_class l_daBdk_Method = {