Cleanup, improve readability of conditionals

This commit is contained in:
LagoLunatic
2026-05-28 20:27:24 -04:00
parent b597e195b4
commit 5cde617f29
6 changed files with 735 additions and 608 deletions
+2 -1
View File
@@ -2714,9 +2714,10 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) {
i_this->mpDeadHeadMorf = new mDoExt_McaMorf(
(J3DModelData*)dComIfG_getObjectRes("Btd", BTD_BMD_NAMAKUBI), NULL, NULL, NULL, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 0, NULL, 0, 0x11020203
);
if ((i_this->mpDeadHeadMorf == NULL) || (pModel = i_this->mpDeadHeadMorf->getModel(), pModel == NULL)) {
if ((i_this->mpDeadHeadMorf == NULL) || (i_this->mpDeadHeadMorf->getModel() == NULL)) {
return FALSE;
}
pModel = i_this->mpDeadHeadMorf->getModel();
i_this->mpDeadHeadBtkAnm = new mDoExt_btkAnm();
if (i_this->mpDeadHeadBtkAnm == NULL) {
return FALSE;
+15 -6
View File
@@ -511,16 +511,25 @@ cPhs_State daDoor10_c::create() {
}
cPhs_State ret;
if (m364 != 0 && (ret = dComIfG_resLoad(&mPhase, "DoorBs")) != cPhs_COMPLEATE_e) {
return ret;
if (m364 != 0) {
ret = dComIfG_resLoad(&mPhase, "DoorBs");
if (ret != cPhs_COMPLEATE_e) {
return ret;
}
}
if (chkMakeKey() && (ret = mKeyLock.keyResLoad()) != cPhs_COMPLEATE_e) {
return ret;
if (chkMakeKey()) {
ret = mKeyLock.keyResLoad();
if (ret != cPhs_COMPLEATE_e) {
return ret;
}
}
if (mHkyo.chkUse() && (ret = mHkyo.resLoad()) != cPhs_COMPLEATE_e) {
return ret;
if (mHkyo.chkUse()) {
ret = mHkyo.resLoad();
if (ret != cPhs_COMPLEATE_e) {
return ret;
}
}
fopAcM_SetRoomNo(this, getFRoomNo());
+1
View File
@@ -1219,6 +1219,7 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) {
#if VERSION == VERSION_DEMO
model = i_this->mpMorf->getModel();
#else
// Fakematch?
if (i_this->mpMorf == NULL || (model = i_this->mpMorf->getModel()) == NULL) {
return FALSE;
}
+115 -110
View File
@@ -171,7 +171,7 @@ static void yari_off_check(mo2_class* i_this) {
}
if (i_this->mbThrowWeapon != 0) {
daBoko_c* boko = (daBoko_c*)fopAcM_SearchByID(i_this->mWeaponPcId);
if ((boko != NULL) && (i_this->mSpawnWeaponActorMode != 2)) {
if (boko != NULL && i_this->mSpawnWeaponActorMode != 2) {
boko->setRotAngleSpeed(cM_rndFX(2000.0f));
s16 angleY = actor->shape_angle.y + 0x8000 + (s16)cM_rndFX(8000.0f);
f32 speedY = 20.0f + cM_rndF(10.0f);
@@ -414,7 +414,7 @@ static BOOL nodeCallBack_P(J3DNode* node, int calcTiming) {
cXyz cStack_c8;
for (s32 i = 0; i < 16; i++) {
MtxPush();
offset.x = (0.25f * (460.0f + (2.0f * (3.5f * (i)) - 28.0f))) - 10.0f;
offset.x = (0.25f * (460.0f + (2.0f * (3.5f * i) - 28.0f))) - 10.0f;
MtxRotX(0.73919827f * i, 0);
MtxPosition(&offset, &cStack_c8);
MtxPull();
@@ -690,7 +690,7 @@ static BOOL daMo2_Draw(mo2_class* i_this) {
shape->show();
}
shape = model->getModelData()->getMaterialNodePointer(0x00)->getShape();
if ((REG17_S(1) != 0) || (i_this->m2951 != 0)) {
if (REG17_S(1) != 0 || i_this->m2951 != 0) {
shape->hide();
} else {
shape->show();
@@ -703,7 +703,7 @@ static BOOL daMo2_Draw(mo2_class* i_this) {
if (i_this->mMode != 100) {
i_this->m02C8.remove(model->getModelData());
}
if ((i_this->mbHasInnateWeapon == 1) && (l_mo2HIO.m020 <= 1)) {
if (i_this->mbHasInnateWeapon == 1 && l_mo2HIO.m020 <= 1) {
ke_disp(i_this);
}
daMo2_shadowDraw(i_this);
@@ -915,7 +915,7 @@ static fopAc_ac_c* search_bomb(mo2_class* i_this, int r26) {
sp28.y = 50.0f + r24->current.pos.y - actor->eyePos.y;
sp28.z = r24->current.pos.z - actor->current.pos.z;
f32 f0 = std::sqrtf(SQUARE(sp28.x) + SQUARE(sp28.z));
if (f0 < f29 && !(f0 > 30.0f + i_this->m05C0) && !(daMo2_other_bg_check(i_this, r24) && r26)) {
if (f0 < f29 && !(f0 > 30.0f + i_this->m05C0) && (!daMo2_other_bg_check(i_this, r24) || !r26)) {
if (r26) {
if (std::fabsf(r24->current.pos.y + 50.0f - actor->eyePos.y) <= l_mo2HIO.m03C) {
s16 angleDiff = i_this->m05D4 - cM_atan2s(sp28.x, sp28.z);
@@ -959,7 +959,7 @@ static s32 daMo2_wepon_view_check(mo2_class* i_this) {
return FALSE;
}
i_this->mWeaponPcId = search_wepon(i_this);
if ((i_this->mWeaponPcId != fpcM_ERROR_PROCESS_ID_e) && (fopAcM_SearchByID(i_this->mWeaponPcId) != NULL)) {
if (i_this->mWeaponPcId != fpcM_ERROR_PROCESS_ID_e && fopAcM_SearchByID(i_this->mWeaponPcId) != NULL) {
return TRUE;
}
return FALSE;
@@ -1062,7 +1062,7 @@ static s32 daMo2_player_way_check(mo2_class* i_this) {
/* 00003F04-00004040 .text wait_set__FP9mo2_class */
static void wait_set(mo2_class* i_this) {
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
if (i_this->mMode == 1) {
anm_init(i_this, MO2_BCK_KWAIT, 15.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_KWAIT);
i_this->m05A4[1] = cM_rndF(100.0f) + 100.0f;
@@ -1113,7 +1113,7 @@ static void path_check(mo2_class* i_this) {
cXyz local_c8;
cXyz local_d4;
if ((i_this->ppd != NULL) && (i_this->mbHasInnateWeapon != 0 || (i_this->m2943 != 0))) {
if (i_this->ppd != NULL && (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0)) {
dBgS_LinChk chk;
local_c8 = actor->current.pos;
local_c8.y += REG13_F(0) + 10.0f;
@@ -1201,7 +1201,7 @@ static void attack_set(mo2_class* i_this, u8 param_2) {
dVar7 = cM_rndF(100.0f);
i_this->mWeaponSph.SetR(100.0f);
if (i_this->mbHasInnateWeapon != 0) {
if (((player->checkPlayerGuard()) && (cM_rndF(1.0f) < 0.5f)) && (param_2 == 0)) {
if (player->checkPlayerGuard() && cM_rndF(1.0f) < 0.5f && param_2 == 0) {
i_this->m2060 = 3;
i_this->m206C = 9.0f;
i_this->m2070 = 16.0f;
@@ -1326,7 +1326,7 @@ static void jyunkai(mo2_class* i_this) {
case -1:
{
i_this->mDamageReaction.mMode = 1;
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
if (i_this->m2968 != 0) {
i_this->m2969 = i_this->m2969 + i_this->mHasPath;
if (i_this->m2969 >= (s8)i_this->ppd->m_num) {
@@ -1360,7 +1360,7 @@ static void jyunkai(mo2_class* i_this) {
}
case 1:
{
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
maxSpeed = 0x400;
dVar12 = l_mo2HIO.m050;
} else {
@@ -1370,12 +1370,12 @@ static void jyunkai(mo2_class* i_this) {
local_3c.x = i_this->m05C4.x - actor->current.pos.x;
local_3c.z = i_this->m05C4.z - actor->current.pos.z;
i_this->mDamageReaction.m4D0 = cM_atan2s(local_3c.x, local_3c.z);
if ((i_this->m2968 != 0) && (i_this->mbHasInnateWeapon != 0 || (i_this->m2943 != 0))) {
if (i_this->m2968 != 0 && (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0)) {
fVar13 = std::sqrtf(SQUARE(local_3c.x) + SQUARE(local_3c.z));
if (fVar13 < (dVar12 * 0.25f) * 15.0f) {
dPnt* point = i_this->ppd->m_points;
point = &point[i_this->m2969];
if (((point->mArg3 == 3) || (point->mArg3 == 7)) || (point->mArg3 == 8)) {
if (point->mArg3 == 3 || point->mArg3 == 7 || point->mArg3 == 8) {
wait_set(i_this);
if (point->mArg3 >= 7) {
i_this->m05A4[1] = cM_rndF(80.0f) + 70.0f;
@@ -1386,7 +1386,7 @@ static void jyunkai(mo2_class* i_this) {
}
}
path_check2(i_this);
if (((i_this->mCoCyl.ChkCoHit()) || (i_this->mDamageReaction.mAcch.ChkWallHit())) && (i_this->m05A4[2] == 0)) {
if ((i_this->mCoCyl.ChkCoHit() || i_this->mDamageReaction.mAcch.ChkWallHit()) && i_this->m05A4[2] == 0) {
wait_set(i_this);
i_this->m05A4[1] = cM_rndF(80.0f) + 70.0f;
i_this->mHasPath *= -1;
@@ -1394,8 +1394,9 @@ static void jyunkai(mo2_class* i_this) {
}
} else {
fVar13 = std::sqrtf(SQUARE(local_3c.x) + SQUARE(local_3c.z));
if ((fVar13 < (dVar12 * 0.25f) * 2.0f) || (i_this->m05A4[2] == 0 && ((i_this->mDamageReaction.mAcch.ChkWallHit()) ||
(ground_4_check(i_this, 1, actor->current.angle.y, 200.0f)))))
if ((fVar13 < dVar12 * 0.25f * 2.0f) ||
(i_this->m05A4[2] == 0 &&
(i_this->mDamageReaction.mAcch.ChkWallHit() || ground_4_check(i_this, 1, actor->current.angle.y, 200.0f))))
{
wait_set(i_this);
i_this->mDamageReaction.mMode = 2;
@@ -1409,10 +1410,10 @@ static void jyunkai(mo2_class* i_this) {
{
actor->speedF = 0.0f;
if (i_this->m05A4[1] == 0) {
if ((i_this->m2968 != 0) && (i_this->mbHasInnateWeapon != 0 || (i_this->m2943 != 0))) {
if (i_this->m2968 != 0 && (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0)) {
dPnt* point = i_this->ppd->m_points;
point = &point[i_this->m2969];
if ((point->mArg3 == 7) || (point->mArg3 == 8)) {
if (point->mArg3 == 7 || point->mArg3 == 8) {
i_this->mDamageReaction.mMode = 4;
i_this->m05A4[1] = cM_rndF(100.0f) + 100.0f;
anm_init(i_this, MO2_BCK_KKEIKAI, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_KKEIKAI);
@@ -1425,10 +1426,10 @@ static void jyunkai(mo2_class* i_this) {
}
}
i_this->mDamageReaction.mMode = 0;
if ((i_this->mPathIndex != 0xFF) && (i_this->m2968 == 0)) {
if (i_this->mPathIndex != 0xFF && i_this->m2968 == 0) {
path_check(i_this);
}
if (((i_this->mbHasInnateWeapon == 0) && (i_this->m2943 == 0)) && (i_this->m05AE == 0)) {
if (i_this->mbHasInnateWeapon == 0 && i_this->m2943 == 0 && i_this->m05AE == 0) {
i_this->m2943 = 1;
}
}
@@ -1441,20 +1442,23 @@ static void jyunkai(mo2_class* i_this) {
{
actor->speedF = 0.0f;
int frame = i_this->mpMorf->getFrame();
if ((frame == 3) || (frame == 0x35)) {
if (frame == 3 || frame == 0x35) {
fopAcM_monsSeStart(actor, JA_SE_CV_MO_SEARCH, 0);
}
if (((i_this->m05A4[1] == 0) && (i_this->mDamageReaction.mMode = 0, i_this->mPathIndex != 0xFF)) && (i_this->m2968 == 0)) {
path_check(i_this);
if (i_this->m05A4[1] == 0) {
i_this->mDamageReaction.mMode = 0;
if (i_this->mPathIndex != 0xFF && i_this->m2968 == 0) {
path_check(i_this);
}
}
break;
}
}
int iVar6 = fopAcM_otoCheck(actor, 1000.0f);
iVar6 += search_sp;
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if ((iVar6 != 0) ||
(i_this->m05C0 < l_mo2HIO.m02C && (daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038) != 0)))
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
if (iVar6 != 0 ||
(i_this->m05C0 < l_mo2HIO.m02C && daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038) != 0))
{
if (i_this->mMode == 1) {
i_this->mDamageReaction.mAction = ACTION_NAGE;
@@ -1475,13 +1479,13 @@ static void jyunkai(mo2_class* i_this) {
}
fopAcM_monsSeStart(actor, JA_SE_CV_MO_FIND_ENEMY, 0);
}
} else if ((i_this->m2943 == 0) && (i_this->mDamageReaction.mMode == 2)) {
} else if (i_this->m2943 == 0 && i_this->mDamageReaction.mMode == 2) {
int frame = i_this->mpMorf->getFrame();
if (((frame == 0xb) || (frame == 0x19)) && (cM_rndF(1.0f) < 0.5f)) {
if ((frame == 0xb || frame == 0x19) && cM_rndF(1.0f) < 0.5f) {
fopAcM_monsSeStart(actor, JA_SE_CV_MO_LOSE_LANCE, 0);
}
}
if ((i_this->mbHasInnateWeapon == 0) && (daMo2_wepon_view_check(i_this))) {
if (i_this->mbHasInnateWeapon == 0 && daMo2_wepon_view_check(i_this)) {
i_this->mDamageReaction.mAction = ACTION_WEPON_SEARCH;
i_this->mDamageReaction.mMode = -1;
}
@@ -1502,7 +1506,7 @@ static void fight_run(mo2_class* i_this) {
dVar9 = g_mDoCPd_cpadInfo[0].mMainStickPosX;
i_this->mDamageReaction.m4D0 = i_this->m05D6;
if ((i_this->m05B0 == 0) && (i_this->mDamageReaction.mMode != 0)) {
if (i_this->m05B0 == 0 && i_this->mDamageReaction.mMode != 0) {
maxSpeed = 0x400;
if (i_this->mDamageReaction.mMode == 1) {
maxSpeed = 0x800;
@@ -1526,7 +1530,7 @@ static void fight_run(mo2_class* i_this) {
i_this->m05F0 = l_mo2HIO.m024 + 4;
i_this->m05F2 = 4;
} else {
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
target = l_mo2HIO.m058;
} else {
target = l_mo2HIO.m05C;
@@ -1544,19 +1548,19 @@ static void fight_run(mo2_class* i_this) {
i_this->m05B0 = 0;
fight_run_set(i_this);
}
if ((i_this->m05B0 == 0) && (i_this->m05C0 < l_mo2HIO.m030)) {
if (i_this->m05B0 == 0 && i_this->m05C0 < l_mo2HIO.m030) {
i_this->mDamageReaction.mMode = 2;
i_this->m05A4[4] = 0x32;
}
} else {
if ((i_this->m2964 == 0) && (i_this->mbHasInnateWeapon != 0)) {
if (i_this->m2964 == 0 && i_this->mbHasInnateWeapon != 0) {
i_this->m2964 = 1;
anm_init(i_this, MO2_BCK_DASH, 5.0f, J3DFrameCtrl::EMode_LOOP, l_mo2HIO.m070, MO2_BAS_DASH);
}
if (i_this->m2964 != 0) {
i_this->m2964 = i_this->m2964 + 1;
}
if ((i_this->m05B0 == 0) && (i_this->m05C0 < l_mo2HIO.m034)) {
if (i_this->m05B0 == 0 && i_this->m05C0 < l_mo2HIO.m034) {
i_this->mDamageReaction.mAction = ACTION_FIGHT;
i_this->mDamageReaction.mMode = 0;
return;
@@ -1565,13 +1569,13 @@ static void fight_run(mo2_class* i_this) {
break;
case 2:
i_this->m2964 = 0;
if ((cM_rndF(1.0f) < 0.3f) && (i_this->mbHasInnateWeapon == 0)) {
if (cM_rndF(1.0f) < 0.3f && i_this->mbHasInnateWeapon == 0) {
i_this->mDamageReaction.mMode = 8;
wait_set(i_this);
i_this->m05A4[1] = cM_rndF(20.0f) + 20.0f;
} else {
if (std::fabsf(dVar9) > 0.1f) {
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
anm_init(i_this, MO2_BCK_BWALKLR, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_BWALKLR);
} else {
anm_init(i_this, MO2_BCK_NBWALKLR, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_NBWALKLR);
@@ -1583,14 +1587,14 @@ static void fight_run(mo2_class* i_this) {
}
} else {
if (i_this->m05C0 < l_mo2HIO.m034) {
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
anm_init(i_this, MO2_BCK_BWALKFB, 10.0f, J3DFrameCtrl::EMode_LOOP, -1.0f, MO2_BAS_BWALKFB);
} else {
anm_init(i_this, MO2_BCK_NBWALKFB, 10.0f, J3DFrameCtrl::EMode_LOOP, -1.0f, MO2_BAS_NBWALKFB);
}
i_this->mDamageReaction.mMode = 4;
} else {
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
anm_init(i_this, MO2_BCK_BWALKFB, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_BWALKFB);
} else {
anm_init(i_this, MO2_BCK_NBWALKFB, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_NBWALKFB);
@@ -1598,7 +1602,7 @@ static void fight_run(mo2_class* i_this) {
i_this->mDamageReaction.mMode = 3;
}
}
i_this->m05A4[1] = (s16)(int)(cM_rndF(20.0f) + 20.0f);
i_this->m05A4[1] = (s16)(cM_rndF(20.0f) + 20.0f);
}
break;
case 3:
@@ -1615,7 +1619,7 @@ static void fight_run(mo2_class* i_this) {
}
} else {
i_this->mDamageReaction.mMode = 3;
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
anm_init(i_this, MO2_BCK_BWALKFB, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_BWALKFB);
} else {
anm_init(i_this, MO2_BCK_NBWALKFB, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_NBWALKFB);
@@ -1649,14 +1653,14 @@ static void fight_run(mo2_class* i_this) {
i_this->mDamageReaction.mMode = 2;
}
}
if ((i_this->mDamageReaction.mMode >= 3) && (i_this->m05BA <= 2)) {
if (i_this->mDamageReaction.mMode >= 3 && i_this->m05BA <= 2) {
if (i_this->m05C0 > l_mo2HIO.m030 + 75.0f) {
i_this->mDamageReaction.mAction = ACTION_JYUNKAI;
path_check(i_this);
wait_set(i_this);
i_this->mDamageReaction.mMode = 0;
}
if (((i_this->m05C0 < l_mo2HIO.m034 + 62.5f) && (i_this->m05C0 > l_mo2HIO.m034 - 62.5f)) && (i_this->m05A4[4] == 0)) {
if (((i_this->m05C0 < l_mo2HIO.m034 + 62.5f) && (i_this->m05C0 > l_mo2HIO.m034 - 62.5f)) && i_this->m05A4[4] == 0) {
i_this->m05A4[4] = l_mo2HIO.m074;
if (cM_rndF(100.0f) < l_mo2HIO.m078) {
i_this->mDamageReaction.mAction = ACTION_FIGHT;
@@ -1665,19 +1669,19 @@ static void fight_run(mo2_class* i_this) {
}
if (i_this->m05B6 == 0) {
dAttention_c& attention = dComIfGp_getAttention();
if ((i_this->mbHasInnateWeapon != 0) && (player->getCutType() != 0 && ((cc_pl_cut_bit_get() & i_this->m2960) != 0))) {
if ((attention.Lockon()) && (actor == attention.LockonTarget(0))) {
if (i_this->mbHasInnateWeapon != 0 && (player->getCutType() != 0 && ((cc_pl_cut_bit_get() & i_this->m2960) != 0))) {
if (attention.Lockon() && actor == attention.LockonTarget(0)) {
i_this->mDamageReaction.mAction = ACTION_DEFENCE;
i_this->mDamageReaction.mMode = 0;
}
}
}
}
if (((i_this->mbHasInnateWeapon != 0) && (i_this->m05C0 < l_mo2HIO.m034 - 62.5f)) &&
(daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038)))
if ((i_this->mbHasInnateWeapon != 0 && (i_this->m05C0 < l_mo2HIO.m034 - 62.5f)) &&
daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038))
{
i_this->m05A0++;
if ((i_this->m05A0 >= 0xF) && (cM_rndF(1.0f) < 0.5f)) {
if (i_this->m05A0 >= 0xF && cM_rndF(1.0f) < 0.5f) {
i_this->m05A0 = 0;
i_this->mDamageReaction.mAction = ACTION_OSHI;
i_this->mDamageReaction.mMode = 0;
@@ -1691,7 +1695,7 @@ static void fight_run(mo2_class* i_this) {
wait_set(i_this);
i_this->mDamageReaction.mMode = -10;
}
if ((i_this->mbHasInnateWeapon == 0) && (daMo2_wepon_view_check(i_this))) {
if (i_this->mbHasInnateWeapon == 0 && daMo2_wepon_view_check(i_this)) {
i_this->mDamageReaction.mAction = ACTION_WEPON_SEARCH;
i_this->mDamageReaction.mMode = -1;
}
@@ -1746,7 +1750,7 @@ static fopAc_ac_c* yari_hit_check(mo2_class* i_this) {
}
if (i_this->m2060 == 5) {
i_this->m2904 = i_this->m28F8;
} else if ((i_this->m2060 == 3) || (i_this->m2060 == 4)) {
} else if (i_this->m2060 == 3 || i_this->m2060 == 4) {
i_this->m2904 = i_this->m28EC;
} else {
i_this->m2904 = i_this->m28D4;
@@ -1757,7 +1761,7 @@ static fopAc_ac_c* yari_hit_check(mo2_class* i_this) {
i_this->m207C--;
return NULL;
}
if ((i_this->m2068 < i_this->m206C) || (i_this->m2068 > i_this->m2070)) {
if (i_this->m2068 < i_this->m206C || i_this->m2068 > i_this->m2070) {
return NULL;
}
i_this->m2940 <<= 1;
@@ -1765,7 +1769,7 @@ static fopAc_ac_c* yari_hit_check(mo2_class* i_this) {
i_this->mWeapon2Sph.SetAtSpl(mo2_at_kind[i_this->m2060]);
i_this->mWeaponSph.SetAtSe(mo2_at_sm_kind[i_this->m2060]);
i_this->mWeapon2Sph.SetAtSe(mo2_at_sm_kind[i_this->m2060]);
if ((i_this->m2060 == 2) || (i_this->m2060 == 1) || (i_this->m2060 == 5)) {
if (i_this->m2060 == 2 || i_this->m2060 == 1 || i_this->m2060 == 5) {
i_this->mWeaponSph.SetAtType(AT_TYPE_UNK8);
i_this->mWeapon2Sph.SetAtType(AT_TYPE_UNK8);
} else {
@@ -1784,11 +1788,11 @@ static fopAc_ac_c* yari_hit_check(mo2_class* i_this) {
i_this->mWeapon2Sph.MoveCAt(i_this->m2910);
dComIfG_Ccsp()->Set(&i_this->mWeaponSph);
dComIfG_Ccsp()->Set(&i_this->mWeapon2Sph);
if ((i_this->m2060 == 2) || (i_this->m2060 == 1)) {
if (i_this->m2060 == 2 || i_this->m2060 == 1) {
dComIfG_Ccsp()->SetMass(&i_this->mWeaponSph, 3);
dComIfG_Ccsp()->SetMass(&i_this->mWeapon2Sph, 3);
}
if ((i_this->mWeaponSph.ChkAtHit()) || (i_this->mWeapon2Sph.ChkAtHit())) {
if (i_this->mWeaponSph.ChkAtHit() || i_this->mWeapon2Sph.ChkAtHit()) {
if (i_this->mWeaponSph.ChkAtHit()) {
pcVar2 = i_this->mWeaponSph.GetAtHitObj();
} else {
@@ -1840,9 +1844,9 @@ static void fight(mo2_class* i_this) {
f32 r3 = info[i_this->m2064].speed;
i_this->m2068 += r3;
cLib_addCalc2(&actor->speedF, 0.0f, 1.0f, 20.0f);
if ((i_this->m2060 == 3) && (i_this->m2064 == 0)) {
if (i_this->m2060 == 3 && i_this->m2064 == 0) {
actor->speedF = 30.0f;
} else if ((i_this->m2060 == 5) && (i_this->m2064 == 1)) {
} else if (i_this->m2060 == 5 && i_this->m2064 == 1) {
if (i_this->m207E > 0) {
actor->speedF = 70.0f;
} else {
@@ -1851,7 +1855,7 @@ static void fight(mo2_class* i_this) {
i_this->m05F0 = l_mo2HIO.m024 + 3;
i_this->m05F2 = 4;
}
if ((i_this->m2068 > i_this->m2074) && (daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038)))
if (i_this->m2068 > i_this->m2074 && daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038))
{
i_this->mDamageReaction.m710 = 1;
}
@@ -1883,23 +1887,23 @@ static void fight(mo2_class* i_this) {
}
}
if (i_this->m0594 == 0) {
if (((i_this->m2068 >= br_set_tm[i_this->m2060]) && (i_this->m2068 <= br_set_tm[i_this->m2060] + 2.0f)) && (i_this->m2060 == 2)) {
if (i_this->m2068 >= br_set_tm[i_this->m2060] && (i_this->m2068 <= br_set_tm[i_this->m2060] + 2.0f) && i_this->m2060 == 2) {
i_this->m05F0 = l_mo2HIO.m024 + 0x10;
i_this->m05F2 = 0;
i_this->m05EE = actor->current.angle.y + 0x2000 + REG0_S(8);
}
}
if (((i_this->m2060 == 1) && (i_this->m2068 >= 31.0f)) && (i_this->m2068 <= 32.1f)) {
if (i_this->m2060 == 1 && i_this->m2068 >= 31.0f && i_this->m2068 <= 32.1f) {
i_this->m05F0 = l_mo2HIO.m024 + 8;
i_this->m05F2 = 2;
mDoAud_seStart(JA_SE_CM_LANCE_HIT_FLOOR, &i_this->m28D4, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor)));
}
if ((i_this->m2060 == 2) && (i_this->m05A4[2] == 1)) {
if (i_this->m2060 == 2 && i_this->m05A4[2] == 1) {
i_this->m05F0 = l_mo2HIO.m024 + 4;
i_this->m05F2 = 4;
}
if (fopAcM_searchPlayerDistance(actor) < 500.0f) {
if ((i_this->m2068 < i_this->m2078) || (i_this->m2942 != 0)) {
if (i_this->m2068 < i_this->m2078 || i_this->m2942 != 0) {
i_this->mDamageReaction.m4D0 = i_this->m05D6;
}
cLib_addCalcAngleS2(&actor->current.angle.y, i_this->mDamageReaction.m4D0, 4, 0x800);
@@ -1958,7 +1962,7 @@ static void fight(mo2_class* i_this) {
} else {
if (i_this->m05C0 < l_mo2HIO.m030) {
if (daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038)) {
if ((cM_rndF(1.0f) < 0.5f) || (i_this->m207E < 0)) {
if (cM_rndF(1.0f) < 0.5f || i_this->m207E < 0) {
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->mDamageReaction.mMode = 2;
i_this->m05A4[1] = 0;
@@ -1966,7 +1970,7 @@ static void fight(mo2_class* i_this) {
i_this->mDamageReaction.mMode = 0;
}
} else {
if ((i_this->mbHasInnateWeapon != 0) || (i_this->m2943 != 0)) {
if (i_this->mbHasInnateWeapon != 0 || i_this->m2943 != 0) {
i_this->mDamageReaction.mAction = ACTION_P_LOST;
i_this->mDamageReaction.mMode = 0;
i_this->m05A4[1] = 0;
@@ -2020,8 +2024,8 @@ static void nage(mo2_class* i_this) {
i_this->m2A48 = 1;
break;
}
if (((i_this->m05B4 != 0) || (i_this->m2A0C != 0)) ||
(daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038)))
if (i_this->m05B4 != 0 || i_this->m2A0C != 0 ||
daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038))
{
i_this->m05A4[1] = l_mo2HIO.m00A + l_mo2HIO.m00C;
i_this->m05A4[2] = l_mo2HIO.m00C;
@@ -2038,11 +2042,11 @@ static void nage(mo2_class* i_this) {
break;
}
case -9:
maxSpeed = (i_this->m05A4[0] != 0) ? (s16)0 : (s16)0x1000;
maxSpeed = i_this->m05A4[0] != 0 ? (s16)0 : (s16)0x1000;
if (i_this->m05A4[1] == 0) {
iVar5 = 2;
} else if (
(i_this->m05A4[2] == 0) && (daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038) != 0)
i_this->m05A4[2] == 0 && daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038) != 0
)
{
i_this->mDamageReaction.mMode = -5;
@@ -2085,7 +2089,7 @@ static void nage(mo2_class* i_this) {
}
}
cLib_addCalcAngleS2(&actor->current.angle.y, i_this->mDamageReaction.m4D0, 3, maxSpeed);
if ((iVar5 != 0) || (daMo2_player_bg_check(i_this, &i_this->mDamageReaction.m714->current.pos) == 1)) {
if (iVar5 != 0 || daMo2_player_bg_check(i_this, &i_this->mDamageReaction.m714->current.pos) == 1) {
i_this->mDamageReaction.mAction = ACTION_JYUNKAI;
wait_set(i_this);
if (iVar5 == 2) {
@@ -2131,7 +2135,7 @@ static void p_lost(mo2_class* i_this) {
break;
case 1:
actor->speedF = 0.0f;
if (((i_this->m059C & 0x1F) == 0) && (cM_rndF(1.0f) < 0.5f)) {
if ((i_this->m059C & 0x1F) == 0 && cM_rndF(1.0f) < 0.5f) {
fopAcM_monsSeStart(actor, JA_SE_CV_MO_SEARCH, 0);
}
if (i_this->mpMorf->isStop()) {
@@ -2142,8 +2146,8 @@ static void p_lost(mo2_class* i_this) {
i_this->m05A4[1] = 0;
}
}
if ((((int)i_this->mpMorf->getFrame() > 25) && (i_this->m05A4[1] == 0)) &&
(daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038)))
if (((int)i_this->mpMorf->getFrame() > 25 && i_this->m05A4[1] == 0) &&
daMo2_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->m05D6, l_mo2HIO.m038))
{
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->mDamageReaction.mMode = 2;
@@ -2307,7 +2311,7 @@ static void hukki(mo2_class* i_this) {
i_this->m05F2 = 3;
}
if (i_this->mpMorf->isStop()) {
if ((!player->checkGrabWear()) && (i_this->m05C0 < l_mo2HIO.m030)) {
if (!player->checkGrabWear() && i_this->m05C0 < l_mo2HIO.m030) {
i_this->mDamageReaction.mMode = 0xe;
i_this->m05A4[1] = 10;
} else {
@@ -2462,7 +2466,7 @@ static void wepon_search(mo2_class* i_this) {
daBoko_c* boko = (daBoko_c*)fopAcM_SearchByID(i_this->mWeaponPcId);
f32 dVar9;
if ((i_this->mDamageReaction.mMode < 2) && (boko == NULL || (boko != NULL && fopAcM_checkCarryNow(boko)))) {
if (i_this->mDamageReaction.mMode < 2 && (boko == NULL || boko != NULL && fopAcM_checkCarryNow(boko))) {
i_this->mDamageReaction.mAction = ACTION_JYUNKAI;
path_check(i_this);
wait_set(i_this);
@@ -2495,7 +2499,7 @@ static void wepon_search(mo2_class* i_this) {
actor->speedF = 0.0f;
if (i_this->m05B2 == 0) {
cLib_addCalcAngleS2(&actor->current.angle.y, i_this->mDamageReaction.m4D0, 2, 0x3000);
if ((i_this->mpMorf->isStop()) || (i_this->m05A4[1] == 0)) {
if (i_this->mpMorf->isStop() || i_this->m05A4[1] == 0) {
i_this->mDamageReaction.mMode = 1;
i_this->m05AE = l_mo2HIO.m08A;
anm_init(i_this, MO2_BCK_SWALK, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, MO2_BAS_SWALK);
@@ -2518,7 +2522,7 @@ static void wepon_search(mo2_class* i_this) {
anm_init(i_this, MO2_BCK_SCATCH, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, MO2_BAS_SCATCH);
i_this->m05A4[1] = 0x1d;
} else {
if ((i_this->m05AE == 0) || (i_this->mDamageReaction.mAcch.ChkWallHit())) {
if (i_this->m05AE == 0 || i_this->mDamageReaction.mAcch.ChkWallHit()) {
i_this->m02E2 = 0x46;
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->m05A4[1] = 0;
@@ -2531,7 +2535,7 @@ static void wepon_search(mo2_class* i_this) {
{
actor->speedF = 0.0f;
if (i_this->m05A4[1] == 0x18) {
if ((boko != NULL) && !fopAcM_checkCarryNow(boko)) {
if (boko != NULL && !fopAcM_checkCarryNow(boko)) {
i_this->mbHasInnateWeapon = 1;
fopAcM_delete(boko);
fopAcM_seStart(actor, JA_SE_CM_LANCE_PICKUP, 0);
@@ -2548,7 +2552,7 @@ static void wepon_search(mo2_class* i_this) {
cLib_addCalcAngleS2(&actor->current.angle.y, i_this->mDamageReaction.m4D0, 3, 0x800);
}
if (i_this->mpMorf->isStop()) {
if (((l_mo2HIO.m009 == 0) && (!player->checkGrabWear())) && (i_this->m05C0 < l_mo2HIO.m030)) {
if (l_mo2HIO.m009 == 0 && !player->checkGrabWear() && i_this->m05C0 < l_mo2HIO.m030) {
i_this->mDamageReaction.mAction = ACTION_FIGHT;
i_this->m2060 = 2;
i_this->m2068 = REG0_F(8) + 33.0f;
@@ -2649,7 +2653,7 @@ static void d_mahi(mo2_class* i_this) {
i_this->m05A4[0] = 100;
// Fall-through
case 1:
if ((i_this->m05A4[0] <= 0x50) && (i_this->m05A4[0] >= 0x28)) {
if (i_this->m05A4[0] <= 0x50 && i_this->m05A4[0] >= 0x28) {
if (i_this->m05A4[0] == 0x50) {
enemy_piyo_set(actor);
}
@@ -2710,8 +2714,8 @@ static void d_dozou(mo2_class* i_this) {
}
// Fall-through
case 1:
if (((i_this->mEnableSpawnSwitch != 0xFF) && (dComIfGs_isSwitch(i_this->mEnableSpawnSwitch, fopAcM_GetRoomNo(actor)))) ||
(i_this->mEnableSpawnSwitch == 0xFF && (dComIfGs_isEventBit(dSv_event_flag_c::COLORS_IN_HYRULE))))
if ((i_this->mEnableSpawnSwitch != 0xFF && dComIfGs_isSwitch(i_this->mEnableSpawnSwitch, fopAcM_GetRoomNo(actor))) ||
(i_this->mEnableSpawnSwitch == 0xFF && dComIfGs_isEventBit(dSv_event_flag_c::COLORS_IN_HYRULE)))
{
i_this->mpMorf->setPlaySpeed(1.0f);
i_this->mDamageReaction.mMode = 2;
@@ -2803,7 +2807,7 @@ static void e3_demo(mo2_class* i_this) {
case 2:
cLib_addCalc0(&i_this->m2A40, 0.1f, 3.0f);
cLib_addCalc2(&actor->speedF, l_mo2HIO.m058, 1.0f, 20.0f);
if ((i_this->m05C0 < l_mo2HIO.m030) || (ground_4_check(i_this, 1, actor->current.angle.y, 100.0f))) {
if (i_this->m05C0 < l_mo2HIO.m030 || ground_4_check(i_this, 1, actor->current.angle.y, 100.0f)) {
i_this->mDamageReaction.mMode = 3;
anm_init(i_this, MO2_BCK_KNAGE, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f, MO2_BAS_KNAGE);
}
@@ -2823,7 +2827,7 @@ static void e3_demo(mo2_class* i_this) {
}
case 4:
cLib_addCalc2(&actor->speedF, l_mo2HIO.m058, 1.0f, 20.0f);
if ((fopAcM_searchPlayerDistance(actor) < 250.0f) || (ground_4_check(i_this, 1, actor->current.angle.y, 100.0f))) {
if (fopAcM_searchPlayerDistance(actor) < 250.0f || ground_4_check(i_this, 1, actor->current.angle.y, 100.0f)) {
i_this->mDamageReaction.mMode = 5;
anm_init(i_this, MO2_BCK_WAITDEMO, 15.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1);
i_this->m05A4[1] = 0x1E;
@@ -2867,7 +2871,7 @@ static void Mo2_move(mo2_class* i_this) {
}
i_this->m02E0 = 2;
i_this->m05B4 = 5;
if ((std::fabsf(i_this->mDamageReaction.m478) > 40.0f) && (!i_this->mDamageReaction.mAcch.ChkGroundHit())) {
if (std::fabsf(i_this->mDamageReaction.m478) > 40.0f && !i_this->mDamageReaction.mAcch.ChkGroundHit()) {
i_this->mWeaponSph.SetC(i_this->mDamageReaction.m100[0xc]);
i_this->mWeaponSph.SetR(60.0f);
i_this->mWeaponSph.OffAtVsPlayerBit();
@@ -2875,7 +2879,7 @@ static void Mo2_move(mo2_class* i_this) {
i_this->mWeaponSph.SetAtSpl(dCcG_At_Spl_UNK1);
dComIfG_Ccsp()->Set(&i_this->mWeaponSph);
dComIfG_Ccsp()->SetMass(&i_this->mWeaponSph, 3);
if ((i_this->mWeaponSph.ChkAtHit() != 0) && (actor->speed.y < -50.0f)) {
if (i_this->mWeaponSph.ChkAtHit() != 0 && actor->speed.y < -50.0f) {
actor->speed.y = 0.0f;
i_this->mDamageReaction.m474 = 8000.0f;
}
@@ -2888,9 +2892,9 @@ static void Mo2_move(mo2_class* i_this) {
} else {
i_this->mCoCyl.OffCoSetBit();
}
if ((i_this->mDamageReaction.m48A) && (i_this->mDamageReaction.m488 == 0)) {
if (i_this->mDamageReaction.m48A && i_this->mDamageReaction.m488 == 0) {
if (i_this->mDamageReaction.m48A == 1) {
if (((i_this->mMode != 1) || (rouya_mode == 0)) && (i_this->mDamageReaction.mAction != ACTION_P_LOST || (i_this->m05A4[1] == 0))) {
if ((i_this->mMode != 1 || rouya_mode == 0) && (i_this->mDamageReaction.mAction != ACTION_P_LOST || i_this->m05A4[1] == 0)) {
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->mDamageReaction.mMode = 0;
i_this->m05A4[1] = 0;
@@ -2986,7 +2990,7 @@ static void Mo2_move(mo2_class* i_this) {
local_20.x = 0.0f;
local_20.y = 0.0f;
local_20.z = actor->speedF;
if (((i_this->mDamageReaction.mAction != ACTION_HUKKI) && (i_this->mDamageReaction.mAction != ACTION_FAIL)) && (i_this->mDamageReaction.m48A == 0))
if (i_this->mDamageReaction.mAction != ACTION_HUKKI && i_this->mDamageReaction.mAction != ACTION_FAIL && i_this->mDamageReaction.m48A == 0)
{
i_this->mDamageReaction.m482 = actor->current.angle.y;
cMtx_YrotS(*calc_mtx, actor->current.angle.y + i_this->m05D8);
@@ -3071,7 +3075,7 @@ static u8 damage_check(mo2_class* i_this) {
} else {
i_this->m2928.y = -10000.0f;
i_this->mDefenseSph.SetR(-200.0f);
if ((i_this->m05B4 == 0) && (i_this->mHeadSph.ChkTgHit() || (i_this->mTgCyl.ChkTgHit()))) {
if (i_this->m05B4 == 0 && (i_this->mHeadSph.ChkTgHit() || i_this->mTgCyl.ChkTgHit())) {
i_this->m05A0 = 0;
i_this->m2944 = -1;
i_this->m294E = 0;
@@ -3107,18 +3111,18 @@ static u8 damage_check(mo2_class* i_this) {
return 0;
}
if (atInfo.mpObj->ChkAtType(AT_TYPE_FIRE | AT_TYPE_FIRE_ARROW)) {
(i_this->mEnemyFire).mFireDuration = REG0_S(2) + 100;
i_this->mEnemyFire.mFireDuration = REG0_S(2) + 100;
i_this->m05B4 = 0x32;
}
hp = actor->health;
at_power_check(&atInfo);
if ((atInfo.mResultingAttackType == 10) || (atInfo.mResultingAttackType == 0xe)) {
if (atInfo.mResultingAttackType == 10 || atInfo.mResultingAttackType == 0xe) {
actor->health = 0x14;
}
atInfo.mpActor = cc_at_check(actor, &atInfo);
if ((atInfo.mResultingAttackType == 10) || (atInfo.mResultingAttackType == 0xe)) {
if (atInfo.mResultingAttackType == 10 || atInfo.mResultingAttackType == 0xe) {
actor->health = hp;
if ((atInfo.mResultingAttackType == 0xe) && (i_this->m2951 == 0)) {
if (atInfo.mResultingAttackType == 0xe && i_this->m2951 == 0) {
i_this->m2951 = 1;
i_this->mDamageReaction.mAction = ACTION_P_LOST;
i_this->mDamageReaction.mMode = -10;
@@ -3170,7 +3174,7 @@ static u8 damage_check(mo2_class* i_this) {
cMtx_YrotS(*calc_mtx, atInfo.m0C.y);
}
}
if ((iVar11 != 0) && (i_this->mMode == 1)) {
if (iVar11 != 0 && i_this->mMode == 1) {
if (rouya_mode != 0) {
i_this->mDamageReaction.mAction = ACTION_NAGE;
i_this->mDamageReaction.mMode = -10;
@@ -3247,7 +3251,7 @@ static u8 damage_check(mo2_class* i_this) {
}
}
if (iVar11 != 0) {
if ((actor->health <= 0) && (atInfo.mbDead != 0)) {
if (actor->health <= 0 && atInfo.mbDead != 0) {
fopAcM_monsSeStart(actor, JA_SE_CV_MO_FAINTED, 0);
if (fopAcM_CheckStatus(actor, fopAcStts_BOSS_e)) {
i_this->m2A1D = 0x32;
@@ -3389,7 +3393,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
}
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &actor->current.pos, &actor->tevStr);
enemy_fire(&i_this->mEnemyFire);
if ((i_this->m2A4B != 0) || (i_this->m2A4C == 1)) {
if (i_this->m2A4B != 0 || i_this->m2A4C == 1) {
dComIfGp_setNextStage("majroom", 0, 0, 0xFF, 0.0f, 0, 1, 0);
return TRUE;
}
@@ -3399,7 +3403,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
mDoAud_seStop(JA_SE_MAJUTOU_ALERM, 30);
}
}
if ((i_this->m2970 != 0) || (actor->home.pos.y - actor->current.pos.y > 4000.0f)) {
if (i_this->m2970 != 0 || (actor->home.pos.y - actor->current.pos.y > 4000.0f)) {
fopAcM_delete(actor);
return TRUE;
}
@@ -3421,7 +3425,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
i_this->mDamageReaction.mMode = 0;
}
}
if ((i_this->mDamageReaction.mAction == ACTION_JYUNKAI) && (player->checkGrabWear())) {
if (i_this->mDamageReaction.mAction == ACTION_JYUNKAI && player->checkGrabWear()) {
if (i_this->mDamageReaction.mMode < 2) {
l_mo2HIO.m02C = REG0_F(10) + 800.0f;
} else {
@@ -3433,7 +3437,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
l_mo2HIO.m04C = -200.0f;
}
u8 r23 = 0;
if (((l_mo2HIO.m006 == 0) || (CPad_CHECK_TRIG_B(0))) || (CPad_CHECK_HOLD_Y(0))) {
if (l_mo2HIO.m006 == 0 || CPad_CHECK_TRIG_B(0) || CPad_CHECK_HOLD_Y(0)) {
i_this->m059C++;
for (s32 i = 0; i < 5; i++) {
if (i_this->m05A4[i] != 0) {
@@ -3466,7 +3470,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
if (i_this->m05B6 != 0) {
i_this->m05B6--;
}
if (((dComIfGs_isCollect(0, 0)) || (dComIfGs_isCollect(0, 1))) || (dComIfGs_isCollect(0, 2) || (dComIfGs_isCollect(0, 3)))) {
if (dComIfGs_isCollect(0, 0) || dComIfGs_isCollect(0, 1) || dComIfGs_isCollect(0, 2) || dComIfGs_isCollect(0, 3)) {
rouya_mode = 0;
} else {
rouya_mode = 1;
@@ -3512,7 +3516,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
switch (r3) {
case 1:
anm_init(i_this, MO2_BCK_PAOMUKE, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, MO2_BAS_PAOMUKE);
if ((i_this->mbHasInnateWeapon != 0) && ((actor->health <= 0 || (r23 >= 4)) || (cM_rndF(1.0f) < 0.5f))) {
if (i_this->mbHasInnateWeapon != 0 && (actor->health <= 0 || r23 >= 4 || cM_rndF(1.0f) < 0.5f)) {
i_this->mSpawnWeaponActor = 1;
}
i_this->mDamageReaction.mAction = ACTION_JYUNKAI;
@@ -3521,9 +3525,10 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
anm_init(i_this, MO2_BCK_PUTSUBUSE, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, MO2_BAS_PUTSUBUSE);
break;
case 5:
if (((i_this->mMode != 1) || (rouya_mode == 0)) &&
if ((i_this->mMode != 1 || rouya_mode == 0) &&
(i_this->mDamageReaction.mAction != ACTION_FIGHT_RUN &&
((i_this->mDamageReaction.mAction != ACTION_HUKKI && (i_this->mDamageReaction.mAction != ACTION_P_LOST)) && (i_this->m05A4[1] == 0))))
i_this->mDamageReaction.mAction != ACTION_HUKKI &&
i_this->mDamageReaction.mAction != ACTION_P_LOST && i_this->m05A4[1] == 0))
{
wait_set(i_this);
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
@@ -3617,7 +3622,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
f32 f1 = dComIfG_Bgsp()->GroundCross(&gndChk);
if (f1 != -G_CM3D_F_INF) {
r22 = -cM_atan2s(f1 - pos.y, tmp.z - pos.z);
if ((r22 > 0x2000) || (r22 < -0x2000)) {
if (r22 > 0x2000 || r22 < -0x2000) {
r22 = 0;
}
}
@@ -3628,7 +3633,7 @@ static BOOL daMo2_Execute(mo2_class* i_this) {
f1 = dComIfG_Bgsp()->GroundCross(&gndChk);
if (f1 != -G_CM3D_F_INF) {
r21 = (s16)cM_atan2s(f1 - pos.y, tmp.x - pos.x);
if ((r21 > 0x2000) || (r21 < -0x2000)) {
if (r21 > 0x2000 || r21 < -0x2000) {
r21 = 0;
}
}
@@ -3855,7 +3860,7 @@ static BOOL createHeap(fopAc_ac_c* a_this) {
0x00080000,
0x37441422
);
if ((i_this->mpMorf == NULL) || (i_this->mpMorf->getModel() == NULL)) {
if (i_this->mpMorf == NULL || i_this->mpMorf->getModel() == NULL) {
return FALSE;
}
J3DModel* model = i_this->mpMorf->getModel();
@@ -4081,7 +4086,7 @@ static cPhs_State daMo2_Create(fopAc_ac_c* a_this) {
return res2;
}
i_this->mMode = fopAcM_GetParam(a_this);
if ((i_this->mMode == 1) && (kantera_get_init(i_this) != 0)) {
if (i_this->mMode == 1 && kantera_get_init(i_this) != 0) {
return cPhs_INIT_e;
}
a_this->gbaName = 2;
@@ -4099,11 +4104,11 @@ static cPhs_State daMo2_Create(fopAc_ac_c* a_this) {
if (i_this->mDeathSwitch == 0xFF) {
i_this->mDeathSwitch = 0;
}
if ((i_this->mDeathSwitch != 0) && (i_this->mDeathSwitch <= 0x7F)) {
if (i_this->mDeathSwitch != 0 && i_this->mDeathSwitch <= 0x7F) {
fopAcM_OnStatus(a_this, fopAcStts_BOSS_e);
search_sp = 1;
}
if (((dComIfGs_isEventBit(dSv_event_flag_c::UNK_1101)) && (i_this->mDeathSwitch != 0)) &&
if ((dComIfGs_isEventBit(dSv_event_flag_c::UNK_1101) && i_this->mDeathSwitch != 0) &&
(dComIfGs_isSwitch(i_this->mDeathSwitch, fopAcM_GetRoomNo(a_this))))
{
return cPhs_ERROR_e;
@@ -4135,16 +4140,16 @@ static cPhs_State daMo2_Create(fopAc_ac_c* a_this) {
i_this->mbHasInnateWeapon = 1;
i_this->mDamageReaction.mInvincibleTimer = 5;
#if VERSION == VERSION_DEMO
if (((dComIfGs_isCollect(0, 0)) || (dComIfGs_isCollect(0, 1))) || (dComIfGs_isCollect(0, 2)))
if (dComIfGs_isCollect(0, 0) || dComIfGs_isCollect(0, 1) || dComIfGs_isCollect(0, 2))
#else
if (((dComIfGs_isCollect(0, 0)) || (dComIfGs_isCollect(0, 1))) || (dComIfGs_isCollect(0, 2) || (dComIfGs_isCollect(0, 3))))
if (dComIfGs_isCollect(0, 0) || dComIfGs_isCollect(0, 1) || dComIfGs_isCollect(0, 2) || dComIfGs_isCollect(0, 3))
#endif
{
rouya_mode = 0;
} else {
rouya_mode = 1;
}
if ((i_this->mMode != 1) || (rouya_mode == 0)) {
if (i_this->mMode != 1 || rouya_mode == 0) {
a_this->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e;
}
if (i_this->mMode == 5) {
+99 -110
View File
@@ -107,7 +107,7 @@ static void tate_anm_init(tn_class* i_this, int bckFileIdx, f32 morf, u8 loopMod
/* 000002D4-00000398 .text yoroi_anm_init__FP8tn_classifUcf */
static void yoroi_anm_init(tn_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f32 speed) {
if ((i_this->m03EC != 0) || (!(i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR))) {
if (i_this->m03EC != 0 || !(i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR)) {
return;
}
i_this->mpArmorMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Tn", bckFileIdx), loopMode, morf, speed, 0.0f, -1.0f, NULL);
@@ -266,11 +266,11 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) {
fopAc_ac_c* actor = &i_this->actor;
if (i_this != NULL) {
if (
((jntNo >= 0xB) && (jntNo < 0x12) && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD))
(jntNo >= 0xB && jntNo < 0x12 && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD))
#if VERSION == VERSION_DEMO
&& (i_this->mEnemyIce.mFreezeTimer == 0) && ((i_this->mDamageReaction.mAction != ACTION_S_DEMO) || (i_this->m0414_demo == 0))
&& i_this->mEnemyIce.mFreezeTimer == 0 && (i_this->mDamageReaction.mAction != ACTION_S_DEMO || i_this->m0414_demo == 0)
#else
&& (i_this->mEnemyIce.mFreezeTimer == 0)
&& i_this->mEnemyIce.mFreezeTimer == 0
#endif
)
{
@@ -289,7 +289,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) {
offset.y = 0.0f;
offset.z = 0.0f;
cXyz local_38;
if (((u32)r28 <= 6) || (r28 == 7)) {
if ((u32)r28 <= 6 || r28 == 7) {
offset.x = 0.0f;
} else if (r28 == 0x12) {
offset.x = 0.0f;
@@ -327,11 +327,11 @@ static BOOL nodeCallBack_P(J3DNode* node, int calcTiming) {
tn_class* i_this = (tn_class*)model->getUserArea();
if (i_this != NULL) {
if (
((jntNo >= 0xB) && (jntNo < 0x12) && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD))
(jntNo >= 0xB && jntNo < 0x12 && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD))
#if VERSION == VERSION_DEMO
&& (i_this->mEnemyIce.mFreezeTimer == 0) && ((i_this->mDamageReaction.mAction != ACTION_S_DEMO) || (i_this->m0414_demo == 0))
&& i_this->mEnemyIce.mFreezeTimer == 0 && (i_this->mDamageReaction.mAction != ACTION_S_DEMO || i_this->m0414_demo == 0)
#else
&& (i_this->mEnemyIce.mFreezeTimer == 0)
&& i_this->mEnemyIce.mFreezeTimer == 0
#endif
)
{
@@ -373,7 +373,7 @@ static BOOL nodeCallBack_mimi(J3DNode* node, int calcTiming) {
s32 jntNo = joint->getJntNo();
J3DModel* model = j3dSys.getModel();
tn_class* i_this = (tn_class*)model->getUserArea();
if ((i_this != NULL) && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_HELMET)) {
if (i_this != NULL && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_HELMET)) {
MTXCopy(model->getAnmMtx(jntNo), *calc_mtx);
cMtx_YrotM(*calc_mtx, -0x8000);
model->setAnmMtx(jntNo, *calc_mtx);
@@ -412,7 +412,7 @@ static void part_draw(tn_class* i_this, s8 param_2) {
g_env_light.setLightTevColorType(model, &actor->tevStr);
i_this->mpArmorMorf->entryDL();
}
} else if ((i != 2) || (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD)) {
} else if (i != 2 || (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD)) {
model = i_this->mParts[i].mpPartModel;
if (param_2 != 0) {
dMat_control_c::iceUpdateDL(model, -1, NULL);
@@ -434,7 +434,7 @@ static BOOL daTn_Draw(tn_class* i_this) {
cXyz local_24;
J3DModel* model = i_this->mpBodyMorf->getModel();
if ((i_this->m1518 != 0) || (i_this->m02C1 != 0)) {
if (i_this->m1518 != 0 || i_this->m02C1 != 0) {
return TRUE;
}
if (i_this->mEnemyIce.mFreezeTimer > 20) {
@@ -452,7 +452,7 @@ static BOOL daTn_Draw(tn_class* i_this) {
g_env_light.setLightTevColorType(model, &actor->tevStr);
i_this->mpBrkAnm->entry(model->getModelData());
J3DShape* shape = model->getModelData()->getMaterialNodePointer(0)->getShape();
if ((DEMO_SELECT(REG17_S(1), REG0_S(1)) != 0) || (i_this->m1400 != 0)) {
if ((DEMO_SELECT(REG17_S(1), REG0_S(1)) != 0) || i_this->m1400 != 0) {
shape->hide();
} else {
shape->show();
@@ -477,7 +477,7 @@ static BOOL daTn_Draw(tn_class* i_this) {
if (i_this->mShadowId != 0) {
if (i_this->m0C34 != 0) {
fopAc_ac_c* boko_actor = fopAcM_SearchByID(i_this->mBokoPcId);
if ((boko_actor != NULL) && (boko_actor->model != NULL)) {
if (boko_actor != NULL && boko_actor->model != NULL) {
dComIfGd_addRealShadow(i_this->mShadowId, boko_actor->model);
}
}
@@ -883,7 +883,7 @@ static void path_check(tn_class* i_this) {
cXyz local_c8;
cXyz local_d4;
if ((i_this->ppd != NULL) && (i_this->m0C34 != 0 || (i_this->m13FF != 0))) {
if (i_this->ppd != NULL && (i_this->m0C34 != 0 || i_this->m13FF != 0)) {
dBgS_LinChk chk;
local_c8 = actor->current.pos;
local_c8.y += 100.0f;
@@ -973,7 +973,7 @@ static void jyunkai(tn_class* i_this) {
// Fall-through
case -1:
i_this->mDamageReaction.mMode = 1;
if ((i_this->m0C34 != 0) || (i_this->m13FF != 0)) {
if (i_this->m0C34 != 0 || i_this->m13FF != 0) {
if (i_this->m1424 != 0) {
i_this->m1425 += i_this->m1426;
if (i_this->m1425 >= (s8)i_this->ppd->m_num) {
@@ -1003,7 +1003,7 @@ static void jyunkai(tn_class* i_this) {
i_this->mCountDownTimers[2] = 30;
// Fall-through
case 1:
if ((i_this->m0C34 != 0) || (i_this->m13FF != 0)) {
if (i_this->m0C34 != 0 || i_this->m13FF != 0) {
maxSpeed = 0x400;
f31 = l_tnHIO.m04C;
} else {
@@ -1013,11 +1013,11 @@ static void jyunkai(tn_class* i_this) {
local_3c.x = i_this->mPathXyz.x - actor->current.pos.x;
local_3c.z = i_this->mPathXyz.z - actor->current.pos.z;
i_this->mDamageReaction.m4D0 = cM_atan2s(local_3c.x, local_3c.z);
if ((i_this->m1424 != 0) && (i_this->m0C34 != 0 || (i_this->m13FF != 0))) {
if (i_this->m1424 != 0 && (i_this->m0C34 != 0 || i_this->m13FF != 0)) {
if (std::sqrtf(SQUARE(local_3c.x) + SQUARE(local_3c.z)) < (f31 * 0.25f) * 15.0f) {
dPnt* point = i_this->ppd->m_points;
point = &point[i_this->m1425];
if (((point->mArg3 == 3) || (point->mArg3 == 7)) || (point->mArg3 == 8)) {
if (point->mArg3 == 3 || point->mArg3 == 7 || point->mArg3 == 8) {
wait_set(i_this);
if (point->mArg3 >= 7) {
i_this->mCountDownTimers[1] = cM_rndF(80.0f) + 70.0f;
@@ -1029,8 +1029,8 @@ static void jyunkai(tn_class* i_this) {
}
} else {
if ((std::sqrtf(SQUARE(local_3c.x) + SQUARE(local_3c.z)) < (f31 * 0.25f) * 2.0f) ||
((i_this->mCountDownTimers[2] == 0) &&
((i_this->mDamageReaction.mAcch.ChkWallHit()) || (ground_4_check(i_this, 1, actor->current.angle.y, 200.0f)))))
(i_this->mCountDownTimers[2] == 0 &&
(i_this->mDamageReaction.mAcch.ChkWallHit() || ground_4_check(i_this, 1, actor->current.angle.y, 200.0f))))
{
wait_set(i_this);
i_this->mDamageReaction.mMode = 2;
@@ -1042,10 +1042,10 @@ static void jyunkai(tn_class* i_this) {
case 2:
actor->speedF = 0.0f;
if (i_this->mCountDownTimers[1] == 0) {
if ((i_this->m1424 != 0) && (i_this->m0C34 != 0 || (i_this->m13FF != 0))) {
if (i_this->m1424 != 0 && (i_this->m0C34 != 0 || i_this->m13FF != 0)) {
dPnt* point = i_this->ppd->m_points;
point = &point[i_this->m1425];
if ((point->mArg3 == 7) || (point->mArg3 == 8)) {
if (point->mArg3 == 7 || point->mArg3 == 8) {
i_this->mDamageReaction.mMode = 4;
i_this->mCountDownTimers[1] = cM_rndF(100.0f) + 100.0f;
if (point->mArg3 == 7) {
@@ -1057,7 +1057,7 @@ static void jyunkai(tn_class* i_this) {
}
}
i_this->mDamageReaction.mMode = 0;
if (((i_this->m0C34 == 0) && (i_this->m13FF == 0)) && (i_this->m03EA == 0)) {
if (i_this->m0C34 == 0 && i_this->m13FF == 0 && i_this->m03EA == 0) {
i_this->m13FF = 1;
}
}
@@ -1075,12 +1075,12 @@ static void jyunkai(tn_class* i_this) {
s32 r3 = fopAcM_otoCheck(actor, 1000.0f);
if (i_this->mMantPcId != 0xFFFF) {
mant_class* mant_actor = (mant_class*)fopAcM_SearchByID(i_this->mMantPcId);
if ((mant_actor != NULL) && (mant_actor->m1C0E != 0)) {
if (mant_actor != NULL && mant_actor->m1C0E != 0) {
r3 |= 2;
}
}
r3 += search_sp;
if ((i_this->m0C34 != 0) || (i_this->m13FF != 0)) {
if (i_this->m0C34 != 0 || i_this->m13FF != 0) {
if (r3 != 0 || (i_this->mPlayerDistance < l_tnHIO.m028 &&
daTn_player_view_check(i_this, &i_this->mDamageReaction.m714->current.pos, i_this->mTargetAngle, get_view_H(i_this))))
{
@@ -1089,7 +1089,7 @@ static void jyunkai(tn_class* i_this) {
fopAcM_monsSeStart(actor, JA_SE_CV_TN_FOUND, 0);
}
}
if ((i_this->m0C34 == 0) && (daTn_wepon_view_check(i_this))) {
if (i_this->m0C34 == 0 && daTn_wepon_view_check(i_this)) {
i_this->mDamageReaction.mAction = ACTION_WEPON_SEARCH;
i_this->mDamageReaction.mMode = -1;
}
@@ -1117,7 +1117,7 @@ static void fight_run(tn_class* i_this) {
f32 stickPosX = g_mDoCPd_cpadInfo[0].mMainStickPosX;
i_this->mDamageReaction.m710 = 1;
i_this->mDamageReaction.m4D0 = i_this->mTargetAngle;
if ((i_this->m03EC == 0) && (i_this->mDamageReaction.mMode != 0)) {
if (i_this->m03EC == 0 && i_this->mDamageReaction.mMode != 0) {
maxSpeed = 0x400;
if (i_this->mDamageReaction.mMode == 1) {
maxSpeed = 0x800;
@@ -1249,12 +1249,12 @@ static void fight_run(tn_class* i_this) {
i_this->mDamageReaction.mMode = 0;
return;
}
if ((i_this->m0C34 != 0) && (player->checkCutCharge())) {
if (i_this->m0C34 != 0 && player->checkCutCharge()) {
i_this->mDamageReaction.mAction = ACTION_FIGHT;
i_this->mDamageReaction.mMode = 10;
return;
}
if (((i_this->mPlayerDistance < l_tnHIO.m030 + 62.5f) && (i_this->mPlayerDistance > l_tnHIO.m030 - 62.5f)) && (i_this->mCountDownTimers[3] == 0)) {
if (((i_this->mPlayerDistance < l_tnHIO.m030 + 62.5f) && (i_this->mPlayerDistance > l_tnHIO.m030 - 62.5f)) && i_this->mCountDownTimers[3] == 0) {
i_this->mCountDownTimers[3] = l_tnHIO.m06C;
if (cM_rndF(100.0f) < l_tnHIO.m070) {
i_this->mDamageReaction.mAction = ACTION_FIGHT;
@@ -1265,7 +1265,7 @@ static void fight_run(tn_class* i_this) {
if (i_this->m03F2 == 0) {
bool r27 = false;
fopAc_ac_c* r28 = (fopAc_ac_c*)fpcM_Search(shot_s_sub, i_this);
if ((r28 != NULL) && (r28->speedF > 10.0f)) {
if (r28 != NULL && r28->speedF > 10.0f) {
local_54 = r28->current.pos - actor->eyePos;
if (local_54.abs() < r28->speedF * 10.0f) {
r27 = true;
@@ -1275,7 +1275,7 @@ static void fight_run(tn_class* i_this) {
if (daTn_player_way_check(i_this) &&
(r27 || (player->getCutType() != daPy_py_c::CUT_TYPE_NONE && attention.Lockon() && actor == attention.LockonTarget(0))))
{
if (!(i_this->m03D8 & 3) && ((i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD) && (cM_rndF(1.0f) <= 0.8f))) {
if (!(i_this->m03D8 & 3) && ((i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_SHIELD) && cM_rndF(1.0f) <= 0.8f)) {
i_this->mDamageReaction.mAction = ACTION_DEFENCE;
i_this->mDamageReaction.mMode = 0;
if (player->getCutType() == daPy_py_c::CUT_TYPE_JUMPCUT_SWORD) {
@@ -1309,7 +1309,7 @@ static void fight_run(tn_class* i_this) {
wait_set(i_this);
i_this->mDamageReaction.mMode = -10;
} else {
if ((i_this->m0C34 == 0) && (daTn_wepon_view_check(i_this))) {
if (i_this->m0C34 == 0 && daTn_wepon_view_check(i_this)) {
i_this->mDamageReaction.mAction = ACTION_WEPON_SEARCH;
i_this->mDamageReaction.mMode = -1;
}
@@ -1360,7 +1360,7 @@ static fopAc_ac_c* wepon_hit_check(tn_class* i_this) {
r5 = 0;
r6 = 1000;
}
if ((frame < r5) || (frame > r6)) {
if (frame < r5 || frame > r6) {
return NULL;
}
if (i_this->m0C66 < 0) {
@@ -1401,7 +1401,7 @@ static fopAc_ac_c* wepon_hit_check(tn_class* i_this) {
if (i_this->m0C48 <= 1) {
i_this->mWeponSph.SetAtSpl(dCcG_At_Spl_UNK6);
i_this->mWepon2Sph.SetAtSpl(dCcG_At_Spl_UNK6);
} else if ((i_this->m0C48 == 4) || (i_this->m0C48 == 5)) {
} else if (i_this->m0C48 == 4 || i_this->m0C48 == 5) {
i_this->mWeponSph.SetAtSpl(dCcG_At_Spl_UNK7);
i_this->mWepon2Sph.SetAtSpl(dCcG_At_Spl_UNK7);
} else {
@@ -1410,7 +1410,7 @@ static fopAc_ac_c* wepon_hit_check(tn_class* i_this) {
}
dComIfG_Ccsp()->Set(&i_this->mWeponSph);
dComIfG_Ccsp()->Set(&i_this->mWepon2Sph);
if ((i_this->mWeponSph.ChkAtHit()) || (i_this->mWepon2Sph.ChkAtHit())) {
if (i_this->mWeponSph.ChkAtHit() || i_this->mWepon2Sph.ChkAtHit()) {
cCcD_Obj* hitObj;
if (i_this->mWeponSph.ChkAtHit()) {
hitObj = i_this->mWeponSph.GetAtHitObj();
@@ -1488,7 +1488,7 @@ static void fight(tn_class* i_this) {
fopAcM_monsSeStart(actor, JA_SE_CV_TN_KAMAE_S, 0);
}
} else {
if ((cM_rndF(100.0f) < l_tnHIO.m07C) || (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR)) {
if (cM_rndF(100.0f) < l_tnHIO.m07C || (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR)) {
anm_init(i_this, TN_BCK_BAT_SYOUTEI_S1, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, TN_BAS_BAT_SYOUTEI_S1);
i_this->m0C48 = 2;
fopAcM_monsSeStart(actor, JA_SE_CV_TN_PUNCH_S, 0);
@@ -1505,13 +1505,13 @@ static void fight(tn_class* i_this) {
i_this->m0C67 = 0;
case 1:
{
if (((i_this->m0C48 == 3) && (i_this->mpBodyMorf->getFrame() >= 12.0f)) && (i_this->mpBodyMorf->getFrame() <= 30.0f)) {
if ((i_this->m0C48 == 3 && (i_this->mpBodyMorf->getFrame() >= 12.0f)) && (i_this->mpBodyMorf->getFrame() <= 30.0f)) {
if (i_this->m0C67 != 0) {
actor->speedF = REG0_F(10) + 80.0f;
} else {
actor->speedF = REG0_F(9) + 50.0f;
}
} else if (((i_this->m0C48 == 4) && (i_this->mpBodyMorf->getFrame() >= 4.0f)) && (i_this->mpBodyMorf->getFrame() <= 21.0f)) {
} else if ((i_this->m0C48 == 4 && (i_this->mpBodyMorf->getFrame() >= 4.0f)) && (i_this->mpBodyMorf->getFrame() <= 21.0f)) {
actor->speedF = REG0_F(16) + 50.0f;
frame = (int)i_this->mpBodyMorf->getFrame();
if (frame == 20) {
@@ -1548,8 +1548,8 @@ static void fight(tn_class* i_this) {
}
}
}
if ((i_this->m0C48 == 0) || (i_this->m0C48 == 4)) {
if ((i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR) || (i_this->m0C48 == 4)) {
if (i_this->m0C48 == 0 || i_this->m0C48 == 4) {
if ((i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR) || i_this->m0C48 == 4) {
frame = 21;
} else {
frame = 19;
@@ -1747,7 +1747,7 @@ static void wepon_search(tn_class* i_this) {
cXyz local_30;
fopAc_ac_c* boko_actor = fopAcM_SearchByID(i_this->mBokoPcId);
if (i_this->mDamageReaction.mMode < 2 && (boko_actor == NULL || (boko_actor != NULL && (fopAcM_checkCarryNow(boko_actor))))) {
if (i_this->mDamageReaction.mMode < 2 && (boko_actor == NULL || (boko_actor != NULL && fopAcM_checkCarryNow(boko_actor)))) {
i_this->mDamageReaction.mAction = ACTION_JYUNKAI;
path_check(i_this);
wait_set(i_this);
@@ -1777,7 +1777,7 @@ static void wepon_search(tn_class* i_this) {
actor->speedF = 0.0f;
if (i_this->m03EE == 0) {
cLib_addCalcAngleS2(&actor->current.angle.y, i_this->mDamageReaction.m4D0, 2, 0x3000);
if ((i_this->mpBodyMorf->isStop()) || (i_this->mCountDownTimers[1] == 0)) {
if (i_this->mpBodyMorf->isStop() || i_this->mCountDownTimers[1] == 0) {
i_this->mDamageReaction.mMode = 1;
i_this->m03EA = l_tnHIO.m082;
fight_run_set(i_this);
@@ -1795,7 +1795,7 @@ static void wepon_search(tn_class* i_this) {
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->mCountDownTimers[1] = 0;
i_this->m13FF = 1;
} else if ((i_this->mDamageReaction.mAcch.ChkGroundHit()) && (i_this->mDamageReaction.mAcch.ChkWallHit())) {
} else if (i_this->mDamageReaction.mAcch.ChkGroundHit() && i_this->mDamageReaction.mAcch.ChkWallHit()) {
i_this->mDamageReaction.mAction = ACTION_JYUNKAI;
path_check(i_this);
wait_set(i_this);
@@ -1806,7 +1806,7 @@ static void wepon_search(tn_class* i_this) {
case 2:
actor->speedF = 0.0f;
if (i_this->mCountDownTimers[1] == (s16)(REG0_S(7) + 0x12)) {
if ((boko_actor != NULL) && (!fopAcM_checkCarryNow(boko_actor))) {
if (boko_actor != NULL && !fopAcM_checkCarryNow(boko_actor)) {
i_this->m0C34 = 2;
fopAcM_setCarryNow(boko_actor, 0);
} else {
@@ -1932,7 +1932,7 @@ static void defence(tn_class* i_this) {
case 1:
actor->speedF = 0.0f;
i_this->m1444 = 1;
if ((i_this->mCountDownTimers[1] == 0) && (player->getCutType() == daPy_py_c::CUT_TYPE_NONE)) {
if (i_this->mCountDownTimers[1] == 0 && player->getCutType() == daPy_py_c::CUT_TYPE_NONE) {
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->mCountDownTimers[1] = 0;
i_this->mDamageReaction.mMode = 0;
@@ -1987,7 +1987,7 @@ static void hukki(tn_class* i_this) {
}
}
if (i_this->mpBodyMorf->isStop()) {
if (!(player->checkGrabWear()) && (i_this->mPlayerDistance < l_tnHIO.m02C)) {
if (!player->checkGrabWear() && i_this->mPlayerDistance < l_tnHIO.m02C) {
i_this->mDamageReaction.mMode = 0xE;
i_this->mCountDownTimers[1] = 10;
} else {
@@ -2127,7 +2127,7 @@ static void d_mahi(tn_class* i_this) {
i_this->mCountDownTimers[0] = 60;
// Fall-through
case 1:
if ((i_this->mCountDownTimers[0] <= 40) && (i_this->mCountDownTimers[0] >= 10)) {
if (i_this->mCountDownTimers[0] <= 40 && i_this->mCountDownTimers[0] >= 10) {
if (i_this->mCountDownTimers[0] == 40) {
enemy_piyo_set(actor);
}
@@ -2192,7 +2192,7 @@ static void stand(tn_class* i_this) {
s32 r30 = fopAcM_otoCheck(actor, 1000.0f);
if (i_this->mMantPcId != 0xFFFF) {
mant_class* mant_actor = (mant_class*)fopAcM_SearchByID(i_this->mMantPcId);
if ((mant_actor != NULL) && (mant_actor->m1C0E != 0)) {
if (mant_actor != NULL && mant_actor->m1C0E != 0) {
r30 |= 2;
}
}
@@ -2261,11 +2261,11 @@ static void stand(tn_class* i_this) {
cLib_addCalc2(&actor->speedF, l_tnHIO.m054, 1.0f, 5.0f);
break;
}
if ((i_this->mDamageReaction.mMode < 10) && (r30 != 0)) {
if (i_this->mDamageReaction.mMode < 10 && r30 != 0) {
i_this->mDamageReaction.mMode = 10;
i_this->mCountDownTimers[1] = cM_rndF(10.0f) + 45.0f;
}
if ((i_this->mCountDownTimers[2] == 0) && (i_this->mDamageReaction.mMode != 0x14)) {
if (i_this->mCountDownTimers[2] == 0 && i_this->mDamageReaction.mMode != 0x14) {
f32 fVar8;
if (i_this->mRangeOrFrozenAnim != 0xFF) {
fVar8 = i_this->mRangeOrFrozenAnim * 10.0f;
@@ -2291,7 +2291,7 @@ static void stand(tn_class* i_this) {
i_this->mDamageReaction.mMode = 0;
}
}
if ((i_this->m0C34 == 0) && (daTn_wepon_view_check(i_this))) {
if (i_this->m0C34 == 0 && daTn_wepon_view_check(i_this)) {
i_this->mDamageReaction.mAction = ACTION_WEPON_SEARCH;
i_this->mDamageReaction.mMode = -1;
}
@@ -2368,7 +2368,7 @@ static void s_demo(tn_class* i_this) {
if (r29 == 0xc1) {
fopAcM_monsSeStart(actor, JA_SE_CV_TN_KAMAE_L, 0);
}
if ((r29 == 0xe7) || (r29 == 0x106)) {
if (r29 == 0xe7 || r29 == 0x106) {
fopAcM_monsSeStart(actor, JA_SE_CV_TN_ATTACK_L, 0);
}
if (i_this->mpBodyMorf->isStop()) {
@@ -2383,19 +2383,19 @@ static void s_demo(tn_class* i_this) {
actor->speed.y = 0.0f;
#if VERSION == VERSION_DEMO
i_this->m0414_demo = REG0_S(8) + 0x4000;
if (!(dComIfGp_evmng_existence("btl_of_swroom")) && (s_check == 0)) {
if (!dComIfGp_evmng_existence("btl_of_swroom") && s_check == 0) {
return;
}
#else
if (!dComIfGp_evmng_existence("btl_of_swroom")) {
if (!(dComIfGp_evmng_existence("btl_of_swroom2")) && (s_check == 0)) {
if (!dComIfGp_evmng_existence("btl_of_swroom2") && s_check == 0) {
return;
}
}
#endif
int staffIdx = dComIfGp_evmng_getMyStaffId("Tn", NULL, 0);
if ((staffIdx != -1) || (s_check != 0)) {
if (staffIdx != -1 || s_check != 0) {
if (s_check == 0) {
if (strcmp(dComIfGp_getPEvtManager()->getMyNowCutName(staffIdx), "Appear")) {
return;
@@ -2440,10 +2440,10 @@ static void s_demo(tn_class* i_this) {
}
case 0xb:
#if VERSION > VERSION_DEMO
if ((dComIfGp_evmng_existence("btl_of_swroom")) || (dComIfGp_evmng_existence("btl_of_swroom2"))) {
if (dComIfGp_evmng_existence("btl_of_swroom") || dComIfGp_evmng_existence("btl_of_swroom2")) {
int staffIdx = dComIfGp_evmng_getMyStaffId("Tn", NULL, 0);
if (staffIdx != -1) {
if (!(strcmp(dComIfGp_getPEvtManager()->getMyNowCutName(staffIdx), "Appear2"))) {
if (!strcmp(dComIfGp_getPEvtManager()->getMyNowCutName(staffIdx), "Appear2")) {
actor->current.pos.x = actor->home.pos.x;
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
if (player != NULL) {
@@ -2606,7 +2606,7 @@ static void Tn_move(tn_class* i_this) {
cLib_addCalcAngleS2(&i_this->m1404, 0, 2, 0x800);
if (i_this->mDamageReaction.mMode <= -100) {
i_this->m03F0 = 5;
if ((std::fabsf(i_this->mDamageReaction.m478) > 40.0f) && (!(i_this->mDamageReaction.mAcch.ChkGroundHit()))) {
if (std::fabsf(i_this->mDamageReaction.m478) > 40.0f && !i_this->mDamageReaction.mAcch.ChkGroundHit()) {
i_this->mWeponSph.SetC(i_this->mDamageReaction.m100[12]);
i_this->mWeponSph.SetR(60.0f);
i_this->mWeponSph.OffAtVsPlayerBit();
@@ -2614,7 +2614,7 @@ static void Tn_move(tn_class* i_this) {
i_this->mWeponSph.SetAtSpl(dCcG_At_Spl_UNK1);
dComIfG_Ccsp()->Set(&i_this->mWeponSph);
dComIfG_Ccsp()->SetMass(&i_this->mWeponSph, 3);
if ((i_this->mWeponSph.ChkAtHit()) && (actor->speed.y < -50.0f)) {
if (i_this->mWeponSph.ChkAtHit() && actor->speed.y < -50.0f) {
actor->speed.y = 0.0f;
i_this->mDamageReaction.m474 = 8000.0f;
}
@@ -2623,7 +2623,7 @@ static void Tn_move(tn_class* i_this) {
} else {
i_this->mWeponSph.OnAtVsPlayerBit();
i_this->mCoCyl.OnCoSetBit();
if ((i_this->mDamageReaction.m48A != 0) && (i_this->mDamageReaction.m488 == 0)) {
if (i_this->mDamageReaction.m48A != 0 && i_this->mDamageReaction.m488 == 0) {
if (i_this->mDamageReaction.m48A == 1) {
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->mDamageReaction.mMode = 0;
@@ -2709,7 +2709,7 @@ static void Tn_move(tn_class* i_this) {
}
#endif
}
if ((i_this->mBehaviorType == BEHAVIOR_GUARDS_AREA) && (i_this->mDamageReaction.mAction == ACTION_FIGHT_RUN)) {
if (i_this->mBehaviorType == BEHAVIOR_GUARDS_AREA && i_this->mDamageReaction.mAction == ACTION_FIGHT_RUN) {
local_40 = actor->home.pos - actor->current.pos;
if (i_this->mRangeOrFrozenAnim != 0xFF) {
fVar9 = (i_this->mRangeOrFrozenAnim * 10.0f) * 1.5f;
@@ -2728,7 +2728,7 @@ static void Tn_move(tn_class* i_this) {
local_40.x = 0.0f;
local_40.y = 0.0f;
local_40.z = actor->speedF;
if (((i_this->mDamageReaction.mAction != ACTION_HUKKI) && (i_this->mDamageReaction.mAction != ACTION_FAIL)) && (i_this->mDamageReaction.m48A == 0)) {
if (i_this->mDamageReaction.mAction != ACTION_HUKKI && i_this->mDamageReaction.mAction != ACTION_FAIL && i_this->mDamageReaction.m48A == 0) {
i_this->mDamageReaction.m482 = actor->current.angle.y;
cMtx_YrotS(*calc_mtx, actor->current.angle.y + i_this->m0418);
} else {
@@ -2814,12 +2814,6 @@ static u8 damage_check(tn_class* i_this) {
mant_class* mant_actor;
csXyz local_a0;
csXyz local_a8;
cXyz local_50;
cXyz local_5c;
cXyz local_68;
cXyz local_74;
cXyz local_80;
cXyz local_8c;
CcAtInfo atInfo;
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
@@ -2831,14 +2825,12 @@ static u8 damage_check(tn_class* i_this) {
if (i_this->m1444 != 0) {
i_this->m1444--;
MTXCopy(i_this->mpBodyMorf->getModel()->getAnmMtx(0xF), *calc_mtx);
local_50.x = 0.0f;
local_50.y = 0.0f;
local_50.z = 0.0f;
cXyz local_50(0.0f, 0.0f, 0.0f);
MtxPosition(&local_50, &i_this->m13E4);
i_this->mDefenceSph.SetR(70.0f);
i_this->mDefenceSph.SetC(i_this->m13E4);
} else {
local_5c = actor->current.pos;
cXyz local_5c = actor->current.pos;
local_5c.y = -20000.0f;
i_this->mDefenceSph.SetC(local_5c);
}
@@ -2846,14 +2838,12 @@ static u8 damage_check(tn_class* i_this) {
if (i_this->mDefenceSph.ChkTgHit()) {
def_se_set(actor, i_this->mDefenceSph.GetTgHitObj(), 0x40);
cMtx_YrotS(*calc_mtx, actor->shape_angle.y);
local_68.x = 0.0f;
local_68.y = 0.0f;
local_68.z = -10.0f;
cXyz local_68(0.0f, 0.0f, -10.0f);
MtxPosition(&local_68, &i_this->mDamageReaction.m42C);
i_this->mDamageReaction.m4D4 = -10.0f;
return 0;
}
if ((i_this->m03F0 == 0) && (i_this->mHeadSph.ChkTgHit() || (i_this->mTgCyl.ChkTgHit()))) {
if (i_this->m03F0 == 0 && (i_this->mHeadSph.ChkTgHit() || i_this->mTgCyl.ChkTgHit())) {
i_this->m03F0 = REG0_S(7) + 5;
if (i_this->mHeadSph.ChkTgHit()) {
r26 = 1;
@@ -2868,8 +2858,8 @@ static u8 damage_check(tn_class* i_this) {
if (hitObj->ChkAtType(AT_TYPE_ICE_ARROW | AT_TYPE_LIGHT_ARROW)) {
s8 r25 = 0;
if (hitObj->ChkAtType(AT_TYPE_ICE_ARROW)) {
if (((r26 == 2) && (!(i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR))) ||
(r26 == 1 && (!(i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_HELMET))))
if ((r26 == 2 && !(i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR)) ||
(r26 == 1 && !(i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_HELMET)))
{
i_this->mEnemyIce.mFreezeDuration = REG0_S(4) + 60;
i_this->mEnemyIce.m00C = 1;
@@ -2888,7 +2878,7 @@ static u8 damage_check(tn_class* i_this) {
if (r25 != 0) {
if (r25 == 2) {
for (s32 i = 0; i < ARRAY_SSIZE(i_this->mParts); i++) {
if ((i <= 1) && (i_this->mParts[i].m08 >= 0)) {
if (i <= 1 && i_this->mParts[i].m08 >= 0) {
yoroi_break(i_this, &i_this->mParts[i].m0C, (u8)i);
}
i_this->mParts[i].m08 = -1;
@@ -2922,11 +2912,11 @@ static u8 damage_check(tn_class* i_this) {
i_this->mEnemyFire.mFireDuration = REG0_S(2) + 100;
}
}
if (((r26 == 2) && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR)) ||
if ((r26 == 2 && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_BODY_ARMOR)) ||
(r26 == 1 && (i_this->mRemainingEquipmentPieces & EQUIPMENT_PIECE_HELMET)))
{
fopAc_ac_c* hitActor = atInfo.mpObj->GetAc();
if ((hitActor != NULL) && (fopAcM_GetName(hitActor) == fpcNm_PLAYER_e)) {
fopAc_ac_c* hitActor = dCc_GetAc(atInfo.mpObj->GetAc());
if (hitActor != NULL && fopAcM_GetName(hitActor) == fpcNm_PLAYER_e) {
if (r26 == 1) {
if (player->getCutType() == daPy_py_c::CUT_TYPE_BT_JUMPCUT) {
at_power_check(&atInfo);
@@ -2939,7 +2929,7 @@ static u8 damage_check(tn_class* i_this) {
dScnPly_ply_c::setPauseTimer(REG0_S(7) + 6);
fopAcM_seStart(actor, JA_SE_CM_TN_HELMET_OUT, 0);
cXyz* particlePos = i_this->mTgCyl.GetTgHitPosP();
local_74.set(2.0f, 2.0f, 2.0f);
cXyz local_74(2.0f, 2.0f, 2.0f);
local_a0.x = local_a0.z = 0;
local_a0.y = fopAcM_searchPlayerAngleY(actor);
dComIfGp_particle_set(dPa_name::ID_AK_JN_OK, particlePos, &local_a0, &local_74);
@@ -2953,17 +2943,17 @@ static u8 damage_check(tn_class* i_this) {
r3 = -r3;
}
cXyz* particlePos = i_this->mTgCyl.GetTgHitPosP();
local_80.set(2.0f, 2.0f, 2.0f);
cXyz local_80(2.0f, 2.0f, 2.0f);
local_a8.x = local_a8.z = 0;
local_a8.y = fopAcM_searchPlayerAngleY(actor);
r26_2 = false;
if (i_this->mMantPcId != 0xFFFF) {
mant_actor = (mant_class*)fopAcM_SearchByID(i_this->mMantPcId);
if ((mant_actor != NULL) && (mant_actor->m2834 != 0 || (mant_actor->m2836 != 0))) {
if (mant_actor != NULL && (mant_actor->m2834 != 0 || mant_actor->m2836 != 0)) {
r26_2 = true;
}
}
if (((u16)r3 > 0x4000) && (!r26_2)) {
if ((u16)r3 > 0x4000 && !r26_2) {
i_this->m02DD |= 1;
fopAcM_OffStatus(actor, fopAcStts_CULL_e);
i_this->mDamageReaction.mAction = ACTION_D_SIT;
@@ -3021,14 +3011,14 @@ static u8 damage_check(tn_class* i_this) {
}
s8 r25 = actor->health;
at_power_check(&atInfo);
if ((atInfo.mResultingAttackType == 10) || (atInfo.mResultingAttackType == 0xe)) {
if (atInfo.mResultingAttackType == 10 || atInfo.mResultingAttackType == 0xe) {
actor->health = 20;
}
actor->stealItemBitNo = i_this->m1400;
atInfo.mpActor = cc_at_check(actor, &atInfo);
if ((atInfo.mResultingAttackType == 10) || (atInfo.mResultingAttackType == 0xe)) {
if (atInfo.mResultingAttackType == 10 || atInfo.mResultingAttackType == 0xe) {
actor->health = r25;
if ((atInfo.mResultingAttackType == 0xe) && (i_this->m1400 == 0)) {
if (atInfo.mResultingAttackType == 0xe && i_this->m1400 == 0) {
i_this->m1400 = 1;
}
}
@@ -3119,9 +3109,7 @@ static u8 damage_check(tn_class* i_this) {
i_this->mDamageReaction.m428 = 26.0f;
}
if (i_this->mDamageReaction.m424 != 0) {
local_8c.x = 0.0f;
local_8c.y = 0.0f;
local_8c.z = -10.0f;
cXyz local_8c(0.0f, 0.0f, -10.0f);
MtxPosition(&local_8c, &i_this->mDamageReaction.m42C);
if (i_this->mDamageReaction.m428 < 25.0f) {
i_this->mDamageReaction.m4D4 = -l_tnHIO.m0D0;
@@ -3130,7 +3118,7 @@ static u8 damage_check(tn_class* i_this) {
}
}
if (r30 != 0) {
if ((actor->health <= 0) && (atInfo.mbDead != 0)) {
if (actor->health <= 0 && atInfo.mbDead != 0) {
fopAcM_monsSeStart(actor, JA_SE_CV_TN_DIE, 0);
if (fopAcM_CheckStatus(actor, fopAcStts_BOSS_e)) {
if (s_check == 0) {
@@ -3158,13 +3146,11 @@ static void part_move(tn_class* i_this, int partIndex) {
tn_p* part;
f32 dVar14;
f32 fVar15;
cXyz local_134;
cXyz cStack_140;
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
part = &i_this->mParts[partIndex];
dBgS_GndChk gndChk;
local_134.set(0.0f, 0.0f, 0.0f);
cXyz local_134(0.0f, 0.0f, 0.0f);
part->m42++;
iVar12 = j_dt[partIndex];
if (part->m44 != 0) {
@@ -3231,6 +3217,7 @@ static void part_move(tn_class* i_this, int partIndex) {
local_134.x = 0.0f;
local_134.y = 30.0f;
local_134.z = 20.0f;
cXyz cStack_140;
MtxPosition(&local_134, &cStack_140);
local_134 = part->m0C;
local_134.y += 30.0f;
@@ -3283,7 +3270,7 @@ static void part_move(tn_class* i_this, int partIndex) {
if (part->m44 == 1) {
part->m08 = -1;
yoroi_break(i_this, &part->m0C, partIndex);
if ((partIndex == 0) && (i_this->mMantPcId != 0xFFFF)) {
if (partIndex == 0 && i_this->mMantPcId != 0xFFFF) {
mant_actor = (mant_class*)fopAcM_SearchByID(i_this->mMantPcId);
if (mant_actor != NULL) {
fopAcM_delete(mant_actor);
@@ -3301,7 +3288,7 @@ static void part_move(tn_class* i_this, int partIndex) {
switch (part->m09) {
case 0:
MTXCopy(i_this->mpBodyMorf->getModel()->getAnmMtx(iVar12), *calc_mtx);
if ((partIndex == 0) && (i_this->m1402 != 0)) {
if (partIndex == 0 && i_this->m1402 != 0) {
fVar15 = (i_this->m1402 * cM_scos(i_this->m1402 * 0x5100) * -0.0033f) + 1.0f;
MtxScale(fVar15, fVar15, fVar15, true);
dVar14 = (i_this->m1402 * (REG0_F(16) + 0.01f));
@@ -3428,10 +3415,10 @@ static void spin_blur_set(tn_class* i_this) {
static BOOL daTn_Execute(tn_class* i_this) {
/* Nonmatching - retail-only regalloc */
fopEn_enemy_c* actor = (fopEn_enemy_c*)&i_this->actor;
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
mant_class* mant_actor;
daBoko_c* boko_actor;
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
#if VERSION > VERSION_DEMO
if (i_this->m1520 != 0) {
i_this->m1520--;
@@ -3440,6 +3427,7 @@ static BOOL daTn_Execute(tn_class* i_this) {
}
}
#endif
if (enemy_ice(&i_this->mEnemyIce)) {
if (i_this->mEnemyIce.mLightShrinkTimer == 0) {
if (i_this->mEnemyIce.mFreezeTimer == 23) {
@@ -3452,7 +3440,8 @@ static BOOL daTn_Execute(tn_class* i_this) {
i_this->mpArmorMorf->play(NULL, 0, 0);
i_this->mpShieldMorf->play(NULL, 0, 0);
}
i_this->mpBodyMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::now);
J3DModel* model = i_this->mpBodyMorf->getModel();
model->setBaseTRMtx(mDoMtx_stack_c::get());
i_this->mpBodyMorf->calc();
i_this->mpShieldMorf->calc();
for (s32 i = 0; i < ARRAY_SSIZE(i_this->mParts); i++) {
@@ -3473,7 +3462,7 @@ static BOOL daTn_Execute(tn_class* i_this) {
return TRUE;
}
u8 r25 = 0;
if (((l_tnHIO.m006 == 0) || (CPad_CHECK_TRIG_B(0))) || (CPad_CHECK_HOLD_Y(0))) {
if (l_tnHIO.m006 == 0 || CPad_CHECK_TRIG_B(0) || CPad_CHECK_HOLD_Y(0)) {
i_this->m03D8++;
for (s32 i = 0; i < ARRAY_SSIZE(i_this->mCountDownTimers); i++) {
if (i_this->mCountDownTimers[i] != 0) {
@@ -3565,7 +3554,7 @@ static BOOL daTn_Execute(tn_class* i_this) {
switch (r3) {
case 1:
anm_init(i_this, TN_BCK_BDOWN_A1, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1);
if ((i_this->m0C34 != 0) && ((actor->health <= 0) || (r25 >= 4) || (cM_rndF(1.0f) < 0.5f))) {
if (i_this->m0C34 != 0 && (actor->health <= 0 || r25 >= 4 || cM_rndF(1.0f) < 0.5f)) {
i_this->m0C38 = 1;
}
i_this->mDamageReaction.mAction = ACTION_JYUNKAI;
@@ -3574,7 +3563,7 @@ static BOOL daTn_Execute(tn_class* i_this) {
anm_init(i_this, TN_BCK_BDOWN_U1, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1);
break;
case 5:
if ((i_this->mDamageReaction.mAction != ACTION_FIGHT_RUN) && (i_this->mDamageReaction.mAction != ACTION_HUKKI)) {
if (i_this->mDamageReaction.mAction != ACTION_FIGHT_RUN && i_this->mDamageReaction.mAction != ACTION_HUKKI) {
wait_set(i_this);
i_this->mDamageReaction.mAction = ACTION_FIGHT_RUN;
i_this->mDamageReaction.mMode = 0;
@@ -3689,7 +3678,7 @@ static BOOL daTn_Execute(tn_class* i_this) {
f32 f1 = dComIfG_Bgsp()->GroundCross(&gndChk);
if (f1 != -G_CM3D_F_INF) {
r22 = (s16)-cM_atan2s(f1 - pos.y, tmp.z - pos.z);
if ((r22 > 0x2000) || (r22 < -0x2000)) {
if (r22 > 0x2000 || r22 < -0x2000) {
r22 = 0;
}
}
@@ -3700,7 +3689,7 @@ static BOOL daTn_Execute(tn_class* i_this) {
f1 = dComIfG_Bgsp()->GroundCross(&gndChk);
if (f1 != -G_CM3D_F_INF) {
r23 = (s16)cM_atan2s(f1 - pos.y, tmp.x - pos.x);
if ((r23 > 0x2000) || (r23 < -0x2000)) {
if (r23 > 0x2000 || r23 < -0x2000) {
r23 = 0;
}
}
@@ -3967,7 +3956,7 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) {
);
i_this->mParts[i].mpPartModel = i_this->mpArmorMorf->getModel();
} else {
if ((i == 1) && (i_this->mEquipmentType & EQUIPMENT_HELMET)) {
if (i == 1 && (i_this->mEquipmentType & EQUIPMENT_HELMET)) {
modelData = (J3DModelData*)dComIfG_getObjectRes("Tn", TN_BMD_TN_KABUTO2); // Mighty Darknut helmet
} else {
modelData = (J3DModelData*)dComIfG_getObjectRes("Tn", part_bmd[i]);
@@ -3982,7 +3971,7 @@ static BOOL useHeapInit(fopAc_ac_c* a_this) {
if (i_this->mParts[i].mpPartBrkAnm == 0) {
return FALSE;
}
if ((i == 1) && (i_this->mEquipmentType & EQUIPMENT_HELMET)) {
if (i == 1 && (i_this->mEquipmentType & EQUIPMENT_HELMET)) {
if (!i_this->mParts[i].mpPartBrkAnm->init(
i_this->mParts[i].mpPartModel->getModelData(),
(J3DAnmTevRegKey*)dComIfG_getObjectRes("Tn", TN_BRK_TN_KABUTO2),
@@ -4219,7 +4208,7 @@ static cPhs_State daTn_Create(fopAc_ac_c* a_this) {
i_this->mPathIndex = (fopAcM_GetParam(a_this) >> 16) & 0xFF;
i_this->mEnableSpawnSwitch = (fopAcM_GetParam(a_this) >> 24) & 0xFF;
i_this->mDisableSpawnOnDeathSwitch = a_this->current.angle.z;
if ((REG0_S(0) != 0) || (i_this->mDisableSpawnOnDeathSwitch != 0 && (i_this->mDisableSpawnOnDeathSwitch <= 0x7F))) {
if (REG0_S(0) != 0 || (i_this->mDisableSpawnOnDeathSwitch != 0 && i_this->mDisableSpawnOnDeathSwitch <= 0x7F)) {
fopAcM_OnStatus(a_this, fopAcStts_BOSS_e);
search_sp = 1;
}
@@ -4246,11 +4235,11 @@ static cPhs_State daTn_Create(fopAc_ac_c* a_this) {
if (i_this->mDisableSpawnOnDeathSwitch == 0xFF) {
i_this->mDisableSpawnOnDeathSwitch = 0;
}
if ((i_this->mDisableSpawnOnDeathSwitch != 0) && (dComIfGs_isSwitch(i_this->mDisableSpawnOnDeathSwitch, fopAcM_GetRoomNo(a_this)))) {
if (i_this->mDisableSpawnOnDeathSwitch != 0 && (dComIfGs_isSwitch(i_this->mDisableSpawnOnDeathSwitch, fopAcM_GetRoomNo(a_this)))) {
return cPhs_ERROR_e;
}
s_check = 0;
if ((i_this->mBehaviorType == BEHAVIOR_MINIBOSS) || (i_this->mBehaviorType == BEHAVIOR_MSWORD_CHAMBER_AMBUSH)) {
if (i_this->mBehaviorType == BEHAVIOR_MINIBOSS || i_this->mBehaviorType == BEHAVIOR_MSWORD_CHAMBER_AMBUSH) {
fopAcM_OnStatus(a_this, fopAcStts_BOSS_e);
#if VERSION > VERSION_DEMO
search_sp = 1;
+503 -381
View File
File diff suppressed because it is too large Load Diff