From 337303fc79e9d82c2c4adeb8e2510fb37d9ffc96 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sat, 17 May 2025 14:01:12 -0400 Subject: [PATCH] Standardize mMode/mAction names in C-style actors --- include/c/c_damagereaction.h | 8 +- include/d/actor/d_a_am.h | 2 +- include/d/actor/d_a_am2.h | 2 +- include/d/actor/d_a_dr.h | 2 +- include/d/actor/d_a_fganon.h | 4 +- include/d/actor/d_a_ks.h | 4 +- include/d/actor/d_a_kt.h | 2 +- include/d/actor/d_a_pw.h | 2 +- src/c/c_damagereaction.cpp | 28 +- src/d/actor/d_a_am.cpp | 122 ++++---- src/d/actor/d_a_am2.cpp | 110 +++---- src/d/actor/d_a_bk.cpp | 578 +++++++++++++++++------------------ src/d/actor/d_a_dr.cpp | 16 +- src/d/actor/d_a_fganon.cpp | 304 +++++++++--------- src/d/actor/d_a_ks.cpp | 206 +++++++------ src/d/actor/d_a_kt.cpp | 24 +- src/d/actor/d_a_kytag00.cpp | 5 +- src/d/actor/d_a_npc_bs1.cpp | 348 +++++++++++---------- src/d/actor/d_a_npc_ji1.cpp | 110 +++---- src/d/actor/d_a_pw.cpp | 56 ++-- src/d/actor/d_a_rd.cpp | 8 +- 21 files changed, 979 insertions(+), 962 deletions(-) diff --git a/include/c/c_damagereaction.h b/include/c/c_damagereaction.h index 5370a60da..dbf406772 100644 --- a/include/c/c_damagereaction.h +++ b/include/c/c_damagereaction.h @@ -17,7 +17,7 @@ public: /* 0x007 */ u8 m007[0x008 - 0x007]; /* 0x008 */ f32 mYOffset; /* 0x00C */ s8 m00C; - /* 0x00D */ s8 mState; + /* 0x00D */ s8 mMode; /* 0x00E */ s16 mFreezeTimer; /* 0x010 */ s16 mMoveDelayTimer; /* 0x012 */ s16 mAngleY; @@ -46,7 +46,7 @@ struct enemyfire { public: /* 0x000 */ fopAc_ac_c* mpActor; /* 0x004 */ s16 mFireDuration; - /* 0x006 */ s8 mState; + /* 0x006 */ s8 mMode; /* 0x007 */ u8 m007[0x008 - 0x007]; /* 0x008 */ s16 mFireTimer; /* 0x00A */ u8 m00A[0x00C - 0x00A]; @@ -77,8 +77,8 @@ public: }; /* 0x000 */ fopEn_enemy_c* mpEnemy; - /* 0x004 */ s16 m004; - /* 0x006 */ s16 mState; + /* 0x004 */ s16 mMode; + /* 0x006 */ s16 mAction; /* 0x008 */ s16 mEnemyType; /* 0x00A */ u8 m00A[0x00C - 0x00A]; /* 0x00C */ int mTimer; diff --git a/include/d/actor/d_a_am.h b/include/d/actor/d_a_am.h index b4c5afeac..484350a6f 100644 --- a/include/d/actor/d_a_am.h +++ b/include/d/actor/d_a_am.h @@ -19,7 +19,7 @@ public: /* 0x02C2 */ u8 mStartsInactive; /* 0x02C3 */ u8 mSwitch; /* 0x02C4 */ u8 mAction; - /* 0x02C5 */ u8 mState; + /* 0x02C5 */ u8 mMode; /* 0x02C6 */ u8 mHugeKnockback; /* 0x02C7 */ bool mbIsBodyBeingHit; /* 0x02C8 */ s16 mCountDownTimers[4]; diff --git a/include/d/actor/d_a_am2.h b/include/d/actor/d_a_am2.h index 0d8632396..6128c619f 100644 --- a/include/d/actor/d_a_am2.h +++ b/include/d/actor/d_a_am2.h @@ -21,7 +21,7 @@ public: /* 0x2CA */ u8 mStartsInactive; /* 0x2CB */ u8 mSwitch; /* 0x2CC */ u8 mAction; - /* 0x2CD */ u8 mState; + /* 0x2CD */ u8 mMode; /* 0x2CE */ u8 m2CE; /* 0x2CF */ bool mbIsWeakBeingHit; /* 0x2D0 */ bool mbNotInHomeRoom; diff --git a/include/d/actor/d_a_dr.h b/include/d/actor/d_a_dr.h index adba4a25d..99be10431 100644 --- a/include/d/actor/d_a_dr.h +++ b/include/d/actor/d_a_dr.h @@ -16,7 +16,7 @@ public: /* 0x290 */ u8 m290[0x2AC - 0x290]; /* 0x2AC */ request_of_phase_process_class mPhs; /* 0x2B4 */ mDoExt_McaMorf* mpMorf; - /* 0x2B8 */ u8 mState; + /* 0x2B8 */ u8 mMode; /* 0x2B9 */ u8 m2B9[0x2BA - 0x2B9]; /* 0x2BA */ s16 mCountDownTimers[3]; /* 0x2C0 */ int mCurrBckIdx; diff --git a/include/d/actor/d_a_fganon.h b/include/d/actor/d_a_fganon.h index 347770926..f06c8599c 100644 --- a/include/d/actor/d_a_fganon.h +++ b/include/d/actor/d_a_fganon.h @@ -30,8 +30,8 @@ public: /* 0x2D1 */ u8 m2D1[0x2D4 - 0x2D1]; /* 0x2D4 */ dKy_tevstr_c mKenTevStr; /* 0x384 */ s16 m384; - /* 0x386 */ s16 m386; - /* 0x388 */ s16 m388; + /* 0x386 */ s16 mAction; + /* 0x388 */ s16 mMode; /* 0x38A */ s16 m38A; /* 0x38C */ cXyz m38C; /* 0x398 */ s16 m398; diff --git a/include/d/actor/d_a_ks.h b/include/d/actor/d_a_ks.h index 135fd024d..b1313ab55 100644 --- a/include/d/actor/d_a_ks.h +++ b/include/d/actor/d_a_ks.h @@ -20,8 +20,8 @@ public: /* 0x2C8 */ u8 m2C8; /* 0x2C9 */ u8 m2C9; /* 0x2CA */ u8 m2CA; - /* 0x2CB */ u8 m2CB; - /* 0x2CC */ u8 m2CC; + /* 0x2CB */ u8 mAction; + /* 0x2CC */ u8 mMode; /* 0x2CD */ u8 m2CD; /* 0x2CE */ u8 m2CE; /* 0x2CF */ u8 m2CF; diff --git a/include/d/actor/d_a_kt.h b/include/d/actor/d_a_kt.h index f24b2671e..74e7e6af3 100644 --- a/include/d/actor/d_a_kt.h +++ b/include/d/actor/d_a_kt.h @@ -26,7 +26,7 @@ public: /* 0x308 */ cXyz mHomePos; /* 0x314 */ s16 mTimer[3]; /* 0x31A */ s16 mAngleRoll; - /* 0x31C */ s8 mState; + /* 0x31C */ s8 mMode; /* 0x31D */ u8 field_0x31d; /* 0x31E */ bool mHitGround; /* 0x31E */ u8 field_0x31f; diff --git a/include/d/actor/d_a_pw.h b/include/d/actor/d_a_pw.h index ef1fcee9f..61392cb93 100644 --- a/include/d/actor/d_a_pw.h +++ b/include/d/actor/d_a_pw.h @@ -47,7 +47,7 @@ public: /* 0x359 */ u8 mPathIndex; /* 0x35A */ u8 m35A[0x366 - 0x35A]; /* 0x366 */ s16 mAction; - /* 0x368 */ s16 mState; + /* 0x368 */ s16 mMode; /* 0x36A */ u8 m36A[0x36C - 0x36A]; /* 0x36C */ fpc_ProcID mJalhallaID; /* 0x370 */ fpc_ProcID mKanteraID; diff --git a/src/c/c_damagereaction.cpp b/src/c/c_damagereaction.cpp index 2a584ac79..a36f22ec4 100644 --- a/src/c/c_damagereaction.cpp +++ b/src/c/c_damagereaction.cpp @@ -175,7 +175,7 @@ BOOL enemy_ice(enemyice* ei) { BOOL frozen = FALSE; BOOL moveAndCollide = FALSE; - switch (ei->mState) { + switch (ei->mMode) { case 0: // Not initialized // Initialize the enemyice now. ei->mStts.Init(250, 0xFF, ac); @@ -192,7 +192,7 @@ BOOL enemy_ice(enemyice* ei) { if (std::fabsf(ei->mYOffset) < 0.1f) { ei->mYOffset = 80.0f; } - ei->mState = 1; + ei->mMode = 1; ei->mScaleY = 1.0f; ei->mScaleXZ = 1.0f; fopAcM_OnStatus(ac, fopAcStts_UNK8000000_e); @@ -202,7 +202,7 @@ BOOL enemy_ice(enemyice* ei) { // The enemy has signaled that it wants to be frozen for some length of time. ei->mFreezeTimer = ei->mFreezeDuration; ei->mFreezeDuration = 0; - ei->mState = 2; + ei->mMode = 2; if (ei->m00C == 0) { ei->mSpeed.y = 30.0f; ei->mAngularVelY = (s16)cM_rndFX(3000.0f); @@ -232,7 +232,7 @@ BOOL enemy_ice(enemyice* ei) { ac->attention_info.distances[fopAc_Attn_TYPE_CARRY_e] = 0x12; if (fopAcM_CheckStatus(ac, fopAcStts_CARRY_e)) { cLib_offBit(ac->attention_info.flags, fopAc_Attn_ACTION_CARRY_e); - ei->mState = 3; + ei->mMode = 3; if (ei->m00C == 2) { ei->m00C = 0; } @@ -250,7 +250,7 @@ BOOL enemy_ice(enemyice* ei) { ei->mSpeed.y = -15.0f; } ei->mAngleY = player->shape_angle.y; - ei->mState = 2; + ei->mMode = 2; } break; } @@ -349,7 +349,7 @@ BOOL enemy_ice(enemyice* ei) { } if (ei->mFreezeTimer == 0) { - ei->mState = 1; + ei->mMode = 1; ei->mCyl.SetC(non_pos); dComIfG_Ccsp()->Set(&ei->mCyl); @@ -440,7 +440,7 @@ void enemy_fire(enemyfire* ef) { cXyz pos; offset.setall(0.0f); - switch (ef->mState) { + switch (ef->mMode) { case 0: // Not on fire. if (ef->mFireDuration == 0) { return; @@ -449,7 +449,7 @@ void enemy_fire(enemyfire* ef) { ef->mFireTimer = ef->mFireDuration; ef->mFireDuration = 0; - ef->mState = 1; // On fire + ef->mMode = 1; // On fire dKy_plight_set(&ef->mLight); @@ -562,7 +562,7 @@ void enemy_fire(enemyfire* ef) { fopAcM_seStart(ac, JA_SE_OBJ_TORCH_BURNING, 0); if (ef->mFireTimer == 0) { - ef->mState = 0; // Not on fire + ef->mMode = 0; // Not on fire dKy_plight_cut(&ef->mLight); ef->mSph.SetC(non_pos); dComIfG_Ccsp()->Set(&ef->mSph); @@ -579,7 +579,7 @@ void enemy_fire(enemyfire* ef) { /* 8001D3B0-8001D428 .text enemy_fire_remove__FP9enemyfire */ void enemy_fire_remove(enemyfire* ef) { - ef->mState = 0; // Not on fire + ef->mMode = 0; // Not on fire dKy_plight_cut(&ef->mLight); for (int i = 0; i < 10; i++) { @@ -641,7 +641,7 @@ void dr_body_bg_check(damagereaction* dr) { dr->m71E--; } - if (dr->mState != 21 && dr->mState != 22) { + if (dr->mAction != 21 && dr->mAction != 22) { dBgS_ObjGndChk_Spl gndChk; f32 x = dr->mpEnemy->current.pos.x; f32 y = dr->mpEnemy->current.pos.y; @@ -655,14 +655,14 @@ void dr_body_bg_check(damagereaction* dr) { f32 floor_y = dComIfG_Bgsp()->GroundCross(&gndChk); if (floor_y != C_BG_MIN_HEIGHT && dr->mpEnemy->current.pos.y <= floor_y) { dr->mpEnemy->current.pos.y = floor_y + REG0_F(13); - dr->m004 = 0; + dr->mMode = 0; dr->m47C = 0; if (dComIfG_Bgsp()->ChkGrpInf(gndChk, 0x100)) { - dr->mState = 22; + dr->mAction = 22; cXyz sp14(x, floor_y, z); fopKyM_createWpillar(&sp14, REG0_F(9) + 1.0f, REG0_F(10) + 1.0f, 0); } else { - dr->mState = 21; + dr->mAction = 21; cXyz sp08(x, floor_y, z); fopKyM_createMpillar(&sp08, REG0_F(14) + 0.5f); } diff --git a/src/d/actor/d_a_am.cpp b/src/d/actor/d_a_am.cpp index bf9cd5494..b51b20f41 100644 --- a/src/d/actor/d_a_am.cpp +++ b/src/d/actor/d_a_am.cpp @@ -34,17 +34,17 @@ enum Action { ACTION_ITAI_MOVE = 3, }; -enum State { - STATE_DOUSA_INIT = 0, - STATE_DOUSA_OKIRU = 2, - STATE_DOUSA_SLEEP_INIT = 9, - STATE_DOUSA_SLEEP_MAIN = 10, - STATE_MODORU_MOVE_INIT = 20, - STATE_MODORU_MOVE_MAIN = 21, - STATE_MODORU_MOVE_END = 22, - STATE_HANDOU_MOVE_INIT = 30, - STATE_HANDOU_MOVE_MAIN = 31, - STATE_ITAI_MOVE_INIT = 40, +enum Mode { + MODE_DOUSA_INIT = 0, + MODE_DOUSA_OKIRU = 2, + MODE_DOUSA_SLEEP_INIT = 9, + MODE_DOUSA_SLEEP_MAIN = 10, + MODE_MODORU_MOVE_INIT = 20, + MODE_MODORU_MOVE_MAIN = 21, + MODE_MODORU_MOVE_END = 22, + MODE_HANDOU_MOVE_INIT = 30, + MODE_HANDOU_MOVE_MAIN = 31, + MODE_ITAI_MOVE_INIT = 40, }; /* 00000078-0000021C .text nodeCallBack__FP7J3DNodei */ @@ -195,7 +195,7 @@ static void body_atari_check(am_class* i_this) { return; } i_this->mAction = ACTION_HANDOU_MOVE; - i_this->mState = STATE_HANDOU_MOVE_INIT; + i_this->mMode = MODE_HANDOU_MOVE_INIT; i_this->mHugeKnockback = 0; if (player->getCutType() == 0x11) { // If the player hits the Armos Knight with the Skull Hammer's side swing, knock it back much farther than normal. @@ -284,14 +284,14 @@ static BOOL medama_atari_check(am_class* i_this) { i_this->mNeedleCyl.OnAtSPrmBit(cCcD_AtSPrm_Set_e); i_this->mNeedleCyl.OnAtHitBit(); i_this->mAction = ACTION_DOUSA; - i_this->mState = STATE_DOUSA_OKIRU; + i_this->mMode = MODE_DOUSA_OKIRU; } else { dComIfGp_particle_set(dPa_name::ID_COMMON_0010, &i_this->mEyeballPos, &player->shape_angle); // fopAcM_seStart(i_this, JA_SE_CM_AM_EYE_DAMAGE, 0); mDoAud_seStart(JA_SE_CM_AM_EYE_DAMAGE, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); fopAcM_monsSeStart(i_this, JA_SE_CV_AM_EYE_DAMAGE, 0x42); i_this->mAction = ACTION_ITAI_MOVE; - i_this->mState = STATE_ITAI_MOVE_INIT; + i_this->mMode = MODE_ITAI_MOVE_INIT; } break; default: @@ -394,7 +394,7 @@ static BOOL bomb_nomi_check(am_class* i_this) { bomb->setBombNoHit(); bomb_move_set(i_this, 0); i_this->mAction = ACTION_ITAI_MOVE; - i_this->mState = 44; + i_this->mMode = 44; return TRUE; } } @@ -409,7 +409,7 @@ static BOOL bomb_nomi_check(am_class* i_this) { bomb2->set_no_hit(); bomb_move_set(i_this, 0); i_this->mAction = ACTION_ITAI_MOVE; - i_this->mState = 44; + i_this->mMode = 44; return TRUE; } } @@ -481,13 +481,13 @@ static void medama_move(am_class* i_this) { /* 00001B00-00002564 .text action_dousa__FP8am_class */ static void action_dousa(am_class* i_this) { daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); - switch (i_this->mState) { - case STATE_DOUSA_INIT: + switch (i_this->mMode) { + case MODE_DOUSA_INIT: for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; } anm_init(i_this, AM_BCK_SLEEP_LOOP, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 1: if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF && !dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { @@ -506,15 +506,15 @@ static void action_dousa(am_class* i_this) { i_this->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e; i_this->mNeedleCyl.OnAtSetBit(); i_this->mNeedleCyl.OnAtHitBit(); - i_this->mState += 1; // STATE_DOUSA_OKIRU + i_this->mMode += 1; // MODE_DOUSA_OKIRU } } break; - case STATE_DOUSA_OKIRU: + case MODE_DOUSA_OKIRU: if (!i_this->mpMorf->isStop()) { break; } - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 3: if (i_this->mCurrBckIdx != AM_BCK_CLOSE && i_this->mCurrBckIdx != AM_BCK_CLOSE_LOOP) { @@ -528,7 +528,7 @@ static void action_dousa(am_class* i_this) { i_this->mCountDownTimers[2] = 6; } i_this->mTargetAngleY = fopAcM_searchPlayerAngleY(i_this); - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 4: { if (i_this->mCountDownTimers[2] == 1) { @@ -544,24 +544,24 @@ static void action_dousa(am_class* i_this) { f32 xzDist = std::sqrtf(xDist*xDist + zDist*zDist); if (xzDist > i_this->mAreaRadius) { i_this->mAction = ACTION_MODORU_MOVE; - i_this->mState = STATE_MODORU_MOVE_INIT; + i_this->mMode = MODE_MODORU_MOVE_INIT; return; } } else { if (fopAcM_searchPlayerDistance(i_this) > 2000.0f) { - i_this->mState = STATE_DOUSA_SLEEP_INIT; + i_this->mMode = MODE_DOUSA_SLEEP_INIT; break; } f32 yDist = player->current.pos.y - i_this->current.pos.y; yDist = std::sqrtf(yDist*yDist); // ??? if (yDist > 300.0f) { - i_this->mState = STATE_DOUSA_SLEEP_INIT; + i_this->mMode = MODE_DOUSA_SLEEP_INIT; break; } } s16 yRotDiff = cLib_distanceAngleS(i_this->shape_angle.y, i_this->mTargetAngleY); if (yRotDiff < 0x100) { - i_this->mState += 1; + i_this->mMode += 1; } break; } @@ -573,7 +573,7 @@ static void action_dousa(am_class* i_this) { if (!Line_check(i_this, player->current.pos) || player->getDamageWaitTimer() != 0) { i_this->speedF = 0.0f; } - i_this->mState += 1; + i_this->mMode += 1; break; case 6: if (i_this->mCurrBckIdx == AM_BCK_CLOSE) { @@ -596,7 +596,7 @@ static void action_dousa(am_class* i_this) { if (i_this->mCountUpTimers[0] < 2) { i_this->mCountDownTimers[0] = 10; } - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 7: if (i_this->mCountDownTimers[0] != 0) { @@ -621,9 +621,9 @@ static void action_dousa(am_class* i_this) { 0xB9, &i_this->mSmokeCbs[2], fopAcM_GetRoomNo(i_this) ); } - i_this->mState = 8; + i_this->mMode = 8; } else { - i_this->mState = 3; + i_this->mMode = 3; } break; case 8: @@ -635,27 +635,27 @@ static void action_dousa(am_class* i_this) { } if (i_this->mCountDownTimers[0] == 0) { i_this->mSmokeCbs[2].remove(); - i_this->mState = 3; + i_this->mMode = 3; } break; - case STATE_DOUSA_SLEEP_INIT: + case MODE_DOUSA_SLEEP_INIT: anm_init(i_this, AM_BCK_SLEEP, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); fopAcM_seStart(i_this, JA_SE_CM_AM_NEEDLE_IN, 0); i_this->mNeedleCyl.OffAtSetBit(); i_this->mNeedleCyl.OffAtSetBit(); i_this->attention_info.flags = 0; - i_this->mState += 1; + i_this->mMode += 1; break; - case STATE_DOUSA_SLEEP_MAIN: + case MODE_DOUSA_SLEEP_MAIN: if (i_this->mpMorf->isStop()) { - i_this->mState = 0; + i_this->mMode = 0; } break; } medama_move(i_this); - if (i_this->mState != 2 && medama_atari_check(i_this)) { + if (i_this->mMode != 2 && medama_atari_check(i_this)) { i_this->mSmokeCbs[2].remove(); } else if (bomb_nomi_check(i_this)) { i_this->mSmokeCbs[2].remove(); @@ -664,8 +664,8 @@ static void action_dousa(am_class* i_this) { /* 00002564-000028C4 .text action_modoru_move__FP8am_class */ static void action_modoru_move(am_class* i_this) { - switch (i_this->mState) { - case STATE_MODORU_MOVE_INIT: { + switch (i_this->mMode) { + case MODE_MODORU_MOVE_INIT: { anm_init(i_this, AM_BCK_CLOSE_LOOP, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mNeedleCyl.OnAtSetBit(); i_this->mNeedleCyl.OnAtHitBit(); @@ -677,10 +677,10 @@ static void action_modoru_move(am_class* i_this) { f32 xDistToSpawn = i_this->mSpawnPos.x - i_this->current.pos.x; f32 zDistToSpawn = i_this->mSpawnPos.z - i_this->current.pos.z; i_this->mTargetAngleY = cM_atan2s(xDistToSpawn, zDistToSpawn); - i_this->mState += 1; + i_this->mMode += 1; break; } - case STATE_MODORU_MOVE_MAIN: { + case MODE_MODORU_MOVE_MAIN: { f32 xDistToSpawn = i_this->mSpawnPos.x - i_this->current.pos.x; f32 zDistToSpawn = i_this->mSpawnPos.z - i_this->current.pos.z; if (i_this->mAcch.ChkGroundHit()) { @@ -705,18 +705,18 @@ static void action_modoru_move(am_class* i_this) { if (xzDist < 20.0f) { i_this->mTargetAngleY = i_this->mSpawnRotY; i_this->speedF = 0.0f; - i_this->mState += 1; + i_this->mMode += 1; } break; } - case STATE_MODORU_MOVE_END: { + case MODE_MODORU_MOVE_END: { s16 angleDiff = cLib_distanceAngleS(i_this->shape_angle.y, i_this->mTargetAngleY); if (angleDiff < 0x100) { i_this->mNeedleCyl.OffAtSetBit(); i_this->mNeedleCyl.OffAtSetBit(); i_this->attention_info.flags = 0; i_this->mAction = ACTION_DOUSA; - i_this->mState = STATE_DOUSA_INIT; + i_this->mMode = MODE_DOUSA_INIT; } break; } @@ -726,8 +726,8 @@ static void action_modoru_move(am_class* i_this) { /* 000028C4-00002A6C .text action_handou_move__FP8am_class */ static void action_handou_move(am_class* i_this) { daPy_py_c* player = daPy_getPlayerActorClass(); - switch (i_this->mState) { - case STATE_HANDOU_MOVE_INIT: { + switch (i_this->mMode) { + case MODE_HANDOU_MOVE_INIT: { i_this->speedF = 20.0f; s16 angleToPlayer = fopAcM_searchPlayerAngleY(i_this); i_this->current.angle.y = angleToPlayer + 0x8000; @@ -743,17 +743,17 @@ static void action_handou_move(am_class* i_this) { mDoAud_seStart(JA_SE_CM_AM_MOUTH_CLOSE, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); anm_init(i_this, AM_BCK_CLOSE, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); } - i_this->mState += 1; + i_this->mMode += 1; // Fall-through } - case STATE_HANDOU_MOVE_MAIN: { + case MODE_HANDOU_MOVE_MAIN: { cLib_addCalc0(&i_this->speedF, 0.8f, 2.0f); if (i_this->speedF < 0.1f) { i_this->speedF = 0.0f; i_this->mCountDownTimers[2] = 6; i_this->current.angle.y = i_this->shape_angle.y; i_this->mAction = ACTION_DOUSA; - i_this->mState = 3; + i_this->mMode = 3; } break; } @@ -762,8 +762,8 @@ static void action_handou_move(am_class* i_this) { /* 00002A6C-000034F4 .text action_itai_move__FP8am_class */ static void action_itai_move(am_class* i_this) { - switch (i_this->mState) { - case STATE_ITAI_MOVE_INIT: + switch (i_this->mMode) { + case MODE_ITAI_MOVE_INIT: i_this->mEyeRot.setall(0); i_this->mNeedleCyl.OffAtSetBit(); i_this->mNeedleCyl.OffAtSetBit(); @@ -772,7 +772,7 @@ static void action_itai_move(am_class* i_this) { i_this->mTargetAngleY = i_this->current.angle.y; fopAcM_seStart(i_this, JA_SE_CM_AM_NEEDLE_IN, 0); anm_init(i_this, AM_BCK_DAMAGE, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 41: cLib_addCalc0(&i_this->speedF, 0.8f, 2.0f); @@ -782,7 +782,7 @@ static void action_itai_move(am_class* i_this) { i_this->mCountDownTimers[0] = 100; i_this->speedF = 0.0f; anm_init(i_this, AM_BCK_DAMAGE_LOOP, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mState += 1; + i_this->mMode += 1; break; case 42: if (i_this->mCountDownTimers[0] != 0) { @@ -793,7 +793,7 @@ static void action_itai_move(am_class* i_this) { // Using the fopAcM_seStart inline multiple times in a single case makes the codegen not match. // fopAcM_seStart(i_this, JA_SE_CM_AM_MOUTH_CLOSE, 0); mDoAud_seStart(JA_SE_CM_AM_MOUTH_CLOSE, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); - i_this->mState += 1; + i_this->mMode += 1; break; case 43: if (!i_this->mpMorf->isStop()) { @@ -803,7 +803,7 @@ static void action_itai_move(am_class* i_this) { i_this->mNeedleCyl.OnAtHitBit(); i_this->mCountUpTimers[0] = 0; i_this->mAction = ACTION_DOUSA; - i_this->mState = 3; + i_this->mMode = 3; break; case 44: i_this->mSmokeCbs[3].remove(); @@ -819,7 +819,7 @@ static void action_itai_move(am_class* i_this) { i_this->mNeedleCyl.OffAtSetBit(); i_this->mNeedleCyl.OffAtSetBit(); i_this->mCountDownTimers[1] = 10; - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 45: bomb_move_set(i_this, 0); @@ -846,7 +846,7 @@ static void action_itai_move(am_class* i_this) { } i_this->mCountDownTimers[0] = 100; i_this->mTargetAngleY = fopAcM_searchPlayerAngleY(i_this); - i_this->mState += 1; + i_this->mMode += 1; break; case 46: bomb_move_set(i_this, 1); @@ -889,7 +889,7 @@ static void action_itai_move(am_class* i_this) { i_this->m0340 = NULL; } i_this->speedF = 0.0f; - i_this->mState += 1; + i_this->mMode += 1; break; case 47: bomb_move_set(i_this, 1); @@ -930,7 +930,7 @@ static void action_itai_move(am_class* i_this) { i_this->m0340->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(2)); } - if (i_this->mState == 41 || i_this->mState == 42) { + if (i_this->mMode == 41 || i_this->mMode == 42) { bomb_nomi_check(i_this); } } @@ -987,11 +987,11 @@ static BOOL daAM_Execute(am_class* i_this) { i_this->speedF = 0.0f; i_this->mAction = ACTION_ITAI_MOVE; - i_this->mState = 47; + i_this->mMode = 47; } cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 1, 0x500); - if (i_this->mState != 46 && i_this->mState != 47 && i_this->mState != 31) { + if (i_this->mMode != 46 && i_this->mMode != 47 && i_this->mMode != 31) { cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 1, 0x500); } diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index d3461013a..2d26f1522 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -177,7 +177,7 @@ static BOOL medama_atari_check(am2_class* i_this) { i_this->mNeedleCyl.OnAtHitBit(); i_this->mNeedleCyl.OnTgSetBit(); i_this->mAction = ACTION_DOUSA; - i_this->mState = 2; + i_this->mMode = 2; } else { dComIfGp_particle_set(dPa_name::ID_COMMON_0010, &hitPos, &player->shape_angle); // Using the fopAcM_seStart inline breaks the codegen. @@ -185,7 +185,7 @@ static BOOL medama_atari_check(am2_class* i_this) { mDoAud_seStart(JA_SE_CM_AM2_PARALYZED, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); fopAcM_monsSeStart(i_this, JA_SE_CV_AM2_PARALYZED, 0x42); i_this->mAction = ACTION_MAHI; - i_this->mState = 10; + i_this->mMode = 10; } return TRUE; } @@ -294,7 +294,7 @@ static BOOL week_atari_check(am2_class* i_this) { } i_this->mAction = ACTION_ITAI; - i_this->mState = 20; + i_this->mMode = 20; if (i_this->m2CE == 7 || i_this->m2CE == 8) { actor->health = 0; } @@ -341,7 +341,7 @@ static BOOL body_atari_check(am2_class* i_this) { break; } i_this->mAction = ACTION_HANDOU_MOVE; - i_this->mState = 30; + i_this->mMode = 30; i_this->m2CE = 7; if (player->getCutType() == 0x11) { i_this->m2CE = 8; @@ -448,7 +448,7 @@ static void action_dousa(am2_class* i_this) { cXyz offset; cXyz rotOffset; - if (i_this->mState == 4 || i_this->mState == 5) { + if (i_this->mMode == 4 || i_this->mMode == 5) { cMtx_YrotS(*calc_mtx, i_this->current.angle.y); offset.set(0.0f, 0.0f, 200.0f); MtxPosition(&offset, &rotOffset); @@ -456,7 +456,7 @@ static void action_dousa(am2_class* i_this) { rotOffset.y += 100.0f + REG12_F(19); } - switch (i_this->mState) { + switch (i_this->mMode) { case 0: for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; @@ -465,7 +465,7 @@ static void action_dousa(am2_class* i_this) { if (i_this->mCurrBckIdx != AM2_BCK_WAIT) { anm_init(i_this, AM2_BCK_WAIT, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); } - i_this->mState++; + i_this->mMode++; // Fall-through case 1: { f32 playerDist = fopAcM_searchPlayerDistance(i_this); @@ -479,7 +479,7 @@ static void action_dousa(am2_class* i_this) { fopAcM_monsSeStart(i_this, JA_SE_CV_AM2_AWAKE, 0); i_this->mEyeSph.OnTgSetBit(); i_this->mWeakSph.OnTgSetBit(); - i_this->mState += 1; + i_this->mMode += 1; } } break; @@ -491,7 +491,7 @@ static void action_dousa(am2_class* i_this) { if (!i_this->mpMorf->isStop()) { break; } - i_this->mState++; + i_this->mMode++; // Fall-through case 3: { for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { @@ -501,7 +501,7 @@ static void action_dousa(am2_class* i_this) { f32 playerDist = fopAcM_searchPlayerDistance(i_this); f32 radiusAdjust = 200.0f; if (playerDist > i_this->mAreaRadius + radiusAdjust) { - i_this->mState = 6; + i_this->mMode = 6; } else { i_this->mNeedleCyl.OnAtSetBit(); i_this->mNeedleCyl.OnAtHitBit(); @@ -512,7 +512,7 @@ static void action_dousa(am2_class* i_this) { if (i_this->mCurrBckIdx != AM2_BCK_JUMP) { anm_init(i_this, AM2_BCK_JUMP, 2.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } - i_this->mState++; + i_this->mMode++; } break; } @@ -521,11 +521,11 @@ static void action_dousa(am2_class* i_this) { i_this->gravity = -3.0f; i_this->speed.y = 12.0f; fopAcM_seStart(i_this, JA_SE_CM_AM2_LANDING, 0); - i_this->mState = 3; + i_this->mMode = 3; s16 angleDiff = cLib_distanceAngleS(i_this->shape_angle.y, i_this->current.angle.y); if (angleDiff < 0x1000) { if (Line_check(i_this, rotOffset) || player->getDamageWaitTimer() == 0) { - i_this->mState = 5; + i_this->mMode = 5; } } } @@ -552,7 +552,7 @@ static void action_dousa(am2_class* i_this) { } if (i_this->mCountUpTimers[0] > 8) { - i_this->mState = 3; + i_this->mMode = 3; } else { i_this->speedF = 9.0f; i_this->gravity = -8.0f; @@ -570,7 +570,7 @@ static void action_dousa(am2_class* i_this) { fopAcM_seStart(i_this, JA_SE_CM_AM2_SPIKE_IN, 0); i_this->mWeakSph.OffTgSetBit(); i_this->mWeakSph.ClrTgHit(); - i_this->mState++; + i_this->mMode++; // Fall-through case 7: if (i_this->mpMorf->isStop()) { @@ -583,7 +583,7 @@ static void action_dousa(am2_class* i_this) { i_this->mNeedleCyl.ClrTgHit(); i_this->m304 = i_this->current.pos; i_this->mAction = ACTION_DOUSA; - i_this->mState = 1; + i_this->mMode = 1; } break; } @@ -598,10 +598,10 @@ static void action_dousa(am2_class* i_this) { fopAcM_delete(i_this); } else { i_this->mAction = ACTION_MODORU_MOVE; - i_this->mState = 40; + i_this->mMode = 40; } } else if (!medama_atari_check(i_this)) { - if (i_this->mState < 3 || !week_atari_check(i_this)) { + if (i_this->mMode < 3 || !week_atari_check(i_this)) { body_atari_check(i_this); } } @@ -612,7 +612,7 @@ static void action_mahi(am2_class* i_this) { daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); fopAc_ac_c* actor = i_this; // Fixes regswaps - switch (i_this->mState) { + switch (i_this->mMode) { case 10: for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; @@ -631,7 +631,7 @@ static void action_mahi(am2_class* i_this) { fopAcM_seStart(actor, JA_SE_CM_AM2_SPIKE_IN, 0); anm_init(i_this, AM2_BCK_DAMAGE, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mState++; + i_this->mMode++; break; case 11: cLib_addCalc0(&actor->speedF, 0.5f, 1.0f); @@ -640,7 +640,7 @@ static void action_mahi(am2_class* i_this) { actor->speedF = 0.0f; i_this->mCountDownTimers[2] = 20*30; anm_init(i_this, AM2_BCK_MAHI, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mState++; + i_this->mMode++; } } break; @@ -653,7 +653,7 @@ static void action_mahi(am2_class* i_this) { fopAcM_delete(actor); } else { i_this->mAction = ACTION_MODORU_MOVE; - i_this->mState = 40; + i_this->mMode = 40; } } else { if (i_this->mCountUpTimers[1] != 0 && i_this->mAcch.ChkGroundHit()) { @@ -672,7 +672,7 @@ static void action_mahi(am2_class* i_this) { actor->speedF = 0.0f; i_this->mbNotInHomeRoom = false; i_this->mBodyCyl.OffCoSetBit(); - i_this->mState++; + i_this->mMode++; } } break; @@ -692,11 +692,11 @@ static void action_mahi(am2_class* i_this) { actor->speed.y = 25.0f; actor->speedF = 35.0f; i_this->mAcch.OnLineCheck(); - i_this->mState = 14; + i_this->mMode = 14; } else { actor->gravity = -3.0f; i_this->mCountUpTimers[1] = 1; - i_this->mState = 12; + i_this->mMode = 12; } } break; @@ -710,7 +710,7 @@ static void action_mahi(am2_class* i_this) { } else { i_this->mAcch.OffLineCheck(); i_this->mAction = ACTION_MODORU_MOVE; - i_this->mState = 40; + i_this->mMode = 40; } } else { if (i_this->mAcch.ChkGroundHit()) { @@ -740,7 +740,7 @@ static void action_mahi(am2_class* i_this) { } else { actor->speedF = 0.0f; i_this->mCountUpTimers[0] = 0; - i_this->mState = 12; + i_this->mMode = 12; } } @@ -753,7 +753,7 @@ static void action_mahi(am2_class* i_this) { fopAcM_delete(actor); } else { i_this->mAction = ACTION_MODORU_MOVE; - i_this->mState = 40; + i_this->mMode = 40; return; } } @@ -764,14 +764,14 @@ static void action_mahi(am2_class* i_this) { actor->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e; fopAcM_OnStatus(actor, fopAcStts_SHOWMAP_e); i_this->mAction = ACTION_DOUSA; - i_this->mState = 3; + i_this->mMode = 3; } break; } i_this->mTargetAngleY = actor->current.angle.y; - if (i_this->mState >= 12 && i_this->mState != 15) { + if (i_this->mMode >= 12 && i_this->mMode != 15) { if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF) { if (!dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { i_this->mCountDownTimers[2] = 20*30; @@ -781,7 +781,7 @@ static void action_mahi(am2_class* i_this) { i_this->mSwitch = 0xFF; i_this->mAction = ACTION_DOUSA; - i_this->mState = 0; + i_this->mMode = 0; if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e)) { fopAcM_cancelCarryNow(actor); @@ -811,19 +811,19 @@ static void action_mahi(am2_class* i_this) { actor->gravity = -4.0f; actor->speed.y = 20.0f; i_this->mBodyCyl.OnCoSetBit(); - i_this->mState = 15; + i_this->mMode = 15; } } } - if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e) || i_this->mState == 15 || !week_atari_check(i_this)) { + if (fopAcM_CheckStatus(actor, fopAcStts_CARRY_e) || i_this->mMode == 15 || !week_atari_check(i_this)) { body_atari_check(i_this); } } /* 00002B08-000032AC .text action_itai__FP9am2_class */ static void action_itai(am2_class* i_this) { - switch (i_this->mState) { + switch (i_this->mMode) { case 20: for (int i = 0; i < ARRAY_SIZE(i_this->mCountUpTimers); i++) { i_this->mCountUpTimers[i] = 0; @@ -845,9 +845,9 @@ static void action_itai(am2_class* i_this) { if (i_this->mCountDownTimers[2] > 5) { i_this->speedF = 5.0f; } - i_this->mState++; + i_this->mMode++; } else { - i_this->mState = 22; + i_this->mMode = 22; } break; case 21: @@ -857,11 +857,11 @@ static void action_itai(am2_class* i_this) { i_this->gravity = -3.0f; if (i_this->mCountDownTimers[2] < 5) { i_this->mAction = ACTION_DOUSA; - i_this->mState = 3; + i_this->mMode = 3; } else { anm_init(i_this, AM2_BCK_MAHI, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mAction = ACTION_MAHI; - i_this->mState = 12; + i_this->mMode = 12; } } break; @@ -871,7 +871,7 @@ static void action_itai(am2_class* i_this) { i_this->mEyeSph.ClrTgHit(); i_this->mWeakSph.ClrTgHit(); anm_init(i_this, AM2_BCK_DEAD1, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mState++; + i_this->mMode++; break; case 23: if (!i_this->mpMorf->isStop()) { @@ -885,7 +885,7 @@ static void action_itai(am2_class* i_this) { i_this->mCountDownTimers[0] = 100; i_this->current.angle.y = fopAcM_searchPlayerAngleY(i_this); anm_init(i_this, AM2_BCK_DEAD2, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mState++; + i_this->mMode++; // Fall-through case 24: if (i_this->speed.y > 0.0f && i_this->mCountUpTimers[1] == 0) { @@ -921,7 +921,7 @@ static void action_itai(am2_class* i_this) { i_this->speedF = 0.0f; - i_this->mState++; + i_this->mMode++; } break; case 25: @@ -942,15 +942,15 @@ static void action_itai(am2_class* i_this) { if (naraku_check(i_this)) { if (i_this->mbNotInHomeRoom || i_this->health <= 0) { - if (i_this->mState != 25) { + if (i_this->mMode != 25) { anm_init(i_this, AM2_BCK_DEAD3, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); fopAcM_seStart(i_this, JA_SE_CM_AM2_BEF_EXPLODE, 0); i_this->speedF = 0.0f; - i_this->mState = 25; + i_this->mMode = 25; } } else { i_this->mAction = ACTION_MODORU_MOVE; - i_this->mState = 40; + i_this->mMode = 40; } } } @@ -958,7 +958,7 @@ static void action_itai(am2_class* i_this) { /* 000032AC-000034A4 .text action_handou_move__FP9am2_class */ static void action_handou_move(am2_class* i_this) { daPy_py_c* player = daPy_getPlayerActorClass(); - switch (i_this->mState) { + switch (i_this->mMode) { case 30: { i_this->speedF = 40.0f; s16 angleToPlayer = fopAcM_searchPlayerAngleY(i_this); @@ -972,7 +972,7 @@ static void action_handou_move(am2_class* i_this) { i_this->mNeedleCyl.OffTgSetBit(); i_this->mNeedleCyl.ClrTgHit(); i_this->mTargetAngleY = i_this->current.angle.y; - i_this->mState++; + i_this->mMode++; // Fall-through } case 31: @@ -982,12 +982,12 @@ static void action_handou_move(am2_class* i_this) { i_this->speedF = 0.0f; i_this->current.angle.y = i_this->shape_angle.y; i_this->mAction = ACTION_DOUSA; - i_this->mState = 3; + i_this->mMode = 3; if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF && !dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { i_this->attention_info.flags = 0; i_this->mCountDownTimers[2] = 20*30; i_this->mAction = ACTION_MAHI; - i_this->mState = 12; + i_this->mMode = 12; } } } @@ -997,7 +997,7 @@ static void action_handou_move(am2_class* i_this) { fopAcM_delete(i_this); } else { i_this->mAction = ACTION_MODORU_MOVE; - i_this->mState = 40; + i_this->mMode = 40; } } } @@ -1005,7 +1005,7 @@ static void action_handou_move(am2_class* i_this) { /* 000034A4-0000379C .text action_modoru_move__FP9am2_class */ static void action_modoru_move(am2_class* i_this) { // Respawns the Armos back at its spawn point after it falls into an abyss. - switch (i_this->mState) { + switch (i_this->mMode) { case 40: dCam_getBody()->ForceLockOff(fopAcM_GetID(i_this)); i_this->mInAbyssTimer = 0; @@ -1013,7 +1013,7 @@ static void action_modoru_move(am2_class* i_this) { i_this->mRippleCb.remove(); anm_init(i_this, AM2_BCK_WAIT, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); fopAcM_seStart(i_this, JA_SE_CM_AM2_WTR_RECOVER, 0); - i_this->mState++; + i_this->mMode++; // Fall-through case 41: cLib_addCalc0(&i_this->scale.x, 1.0f, 0.1f); @@ -1034,7 +1034,7 @@ static void action_modoru_move(am2_class* i_this) { i_this->current.pos = i_this->mSpawnPos; i_this->mTargetAngleY = i_this->current.angle.y; - i_this->mState++; + i_this->mMode++; } break; case 42: @@ -1056,13 +1056,13 @@ static void action_modoru_move(am2_class* i_this) { i_this->mWeakSph.ClrTgHit(); i_this->mNeedleCyl.ClrTgHit(); i_this->mAction = ACTION_DOUSA; - i_this->mState = 0; + i_this->mMode = 0; if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF && !dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { i_this->attention_info.flags = 0; i_this->mCountDownTimers[2] = 20*30; i_this->mAction = ACTION_MAHI; - i_this->mState = 12; + i_this->mMode = 12; } } break; @@ -1456,7 +1456,7 @@ static cPhs_State daAM2_Create(fopAc_ac_c* i_actor) { i_this->attention_info.flags = 0; i_this->mCountDownTimers[2] = 20*30; i_this->mAction = ACTION_MAHI; - i_this->mState = 12; + i_this->mMode = 12; } i_this->mAcchRadius = 40.0f + REG8_F(10); diff --git a/src/d/actor/d_a_bk.cpp b/src/d/actor/d_a_bk.cpp index 7d71542bd..c5f008ff6 100644 --- a/src/d/actor/d_a_bk.cpp +++ b/src/d/actor/d_a_bk.cpp @@ -82,7 +82,7 @@ static s8 joint_check[] = { /* 000000EC-00000234 .text anm_init__FP8bk_classifUcfi */ static void anm_init(bk_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f32 speed, int soundFileIdx) { - if (i_this->dr.mState == 19 && bckFileIdx != BK_BCK_BK_OTISOU1 && bckFileIdx != BK_BCK_BK_OTISOU2) { + if (i_this->dr.mAction == 19 && bckFileIdx != BK_BCK_BK_OTISOU1 && bckFileIdx != BK_BCK_BK_OTISOU2) { return; } if (soundFileIdx >= 0) { @@ -931,7 +931,7 @@ static BOOL daBk_player_way_check(bk_class* i_this) { static void wait_set(bk_class* i_this) { if (i_this->m0B30 != 0 || i_this->m11F3 != 0) { anm_init(i_this, BK_BCK_BK_KYORO1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO1); - } else if (i_this->dr.mState >= 4) { + } else if (i_this->dr.mAction >= 4) { anm_init(i_this, BK_BCK_BK_KYORO1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO1); } else { anm_init(i_this, BK_BCK_BK_KYORO2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO2); @@ -1033,16 +1033,16 @@ static void jyunkai(bk_class* i_this) { fopAc_ac_c* i_actor = i_this; if (i_this->mType == 4 || i_this->mType == 0xA) { - i_this->dr.mState = 1; - i_this->dr.m004 = 50; + i_this->dr.mAction = 1; + i_this->dr.mMode = 50; return; } else if (i_this->mType == 6) { - i_this->dr.mState = 2; - i_this->dr.m004 = 50; + i_this->dr.mAction = 2; + i_this->dr.mMode = 50; return; } else if (i_this->mType == 9) { - i_this->dr.mState = 3; - i_this->dr.m004 = 0; + i_this->dr.mAction = 3; + i_this->dr.mMode = 0; i_this->m0300[2] = 0; i_this->m120C = 0; i_this->m1210 = 0; @@ -1052,12 +1052,12 @@ static void jyunkai(bk_class* i_this) { cXyz sp10; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: walk_set(i_this); // Fall-through case -1: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; if (i_this->m0B30 != 0 || i_this->m11F3 != 0) { if (i_this->m1215 != 0) { i_this->m1216 += i_this->m1217; @@ -1106,9 +1106,9 @@ static void jyunkai(bk_class* i_this) { if (std::sqrtf(sp10.x*sp10.x + sp10.z*sp10.z) < f31 * 0.25f * 2.0f) { if (i_this->ppd->m_points[i_this->m1216].mArg3 == 3) { wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } else { - i_this->dr.m004 = -1; + i_this->dr.mMode = -1; } } } else if (std::sqrtf(sp10.x*sp10.x + sp10.z*sp10.z) < f31 * 0.25f * 2.0f || @@ -1120,7 +1120,7 @@ static void jyunkai(bk_class* i_this) { ) ) { wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0, 4, r29); cLib_addCalc2(&i_this->speedF, f31, 1.0f, 5.0f); @@ -1134,7 +1134,7 @@ static void jyunkai(bk_class* i_this) { } } if (i_this->m0300[1] == 0) { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; if (i_this->m0B30 == 0 && i_this->m11F3 == 0 && i_this->m030A == 0) { i_this->m11F3 = 1; } @@ -1147,7 +1147,7 @@ static void jyunkai(bk_class* i_this) { fopAcM_monsSeStart(i_this, JA_SE_CV_BK_SEARCH, 0); } if (i_this->m0300[1] == 0) { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } break; } @@ -1162,11 +1162,11 @@ static void jyunkai(bk_class* i_this) { daBk_player_view_check(i_this, &i_this->dr.m714->current.pos, i_this->m0332, l_bkHIO.m034) ) ) { - i_this->dr.mState = 4; + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } - } else if (i_this->m11F3 == 0 && i_this->dr.m004 == 2) { + } else if (i_this->m11F3 == 0 && i_this->dr.mMode == 2) { int frame = i_this->mpMorf->getFrame(); if ((frame == 0xB || frame == 0x19) && cM_rndF(1.0f) < 0.5f) { fopAcM_monsSeStart(i_this, JA_SE_CV_BK_SEARCH_BOKO, 0); @@ -1174,13 +1174,13 @@ static void jyunkai(bk_class* i_this) { } if (i_this->m0B30 == 0 && daBk_wepon_view_check(i_this)) { - i_this->dr.mState = 12; - i_this->dr.m004 = -1; + i_this->dr.mAction = 12; + i_this->dr.mMode = -1; } if (daBk_bomb_view_check(i_this)) { - i_this->dr.mState = 9; - i_this->dr.m004 = 0; + i_this->dr.mAction = 9; + i_this->dr.mMode = 0; } } @@ -1205,11 +1205,11 @@ static void stand(bk_class* i_this) { s32 r31 = fopAcM_otoCheck(i_this, 1000.0f); cXyz sp28; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case -20: fopAcM_OnStatus(i_this, fopAcStts_UNK4000_e); anm_init(i_this, BK_BCK_BK_WAIT, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_WAIT); - i_this->dr.m004 = -19; + i_this->dr.mMode = -19; i_this->m0300[1] = 20; i_this->m02B5 = 0; // Fall-through @@ -1220,10 +1220,10 @@ static void stand(bk_class* i_this) { sp28 = player->current.pos - ken->current.pos; if (sp28.abs() < 800.0f) { i_this->m1234 = 1; - i_this->dr.m004 = -18; + i_this->dr.mMode = -18; } } else { - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; break; } } @@ -1233,7 +1233,7 @@ static void stand(bk_class* i_this) { i_this->m0300[1] = l_bkHIO.m104 + cM_rndF(l_bkHIO.m106 - l_bkHIO.m104); // Fall-through case -1: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; if (i_this->m02DC != 0) { if (cM_rndF(1.0f) < 0.5f) { anm_init(i_this, BK_BCK_BK_NOZOKU, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); @@ -1256,9 +1256,9 @@ static void stand(bk_class* i_this) { anm_init(i_this, BK_BCK_BK_NOBI, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_NOBI); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_NOBI, 0); if (i_this->m121E < 3) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } else { - i_this->dr.m004 = 3; + i_this->dr.mMode = 3; i_this->m121E = 0; } } @@ -1267,7 +1267,7 @@ static void stand(bk_class* i_this) { r28 = true; i_this->m02CA = 2; if (i_this->mpMorf->isStop()) { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } break; case 3: @@ -1276,7 +1276,7 @@ static void stand(bk_class* i_this) { if (i_this->mpMorf->isStop()) { anm_init(i_this, BK_BCK_BK_SLEEP, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_SLEEP); i_this->m0300[1] = l_bkHIO.m108 + cM_rndF(l_bkHIO.m10A - l_bkHIO.m108); - i_this->dr.m004 += 1; + i_this->dr.mMode += 1; } break; case 4: @@ -1285,7 +1285,7 @@ static void stand(bk_class* i_this) { if (i_this->m0300[1] == 0) { anm_init(i_this, BK_BCK_BK_NOBI, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_NOBI); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_NOBI, 0); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; case 10: @@ -1294,13 +1294,13 @@ static void stand(bk_class* i_this) { } if (i_this->m0300[1] == 0) { anm_init(i_this, BK_BCK_BK_KYORO2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO2); - i_this->dr.m004 = 11; + i_this->dr.mMode = 11; i_this->m0300[3] = 30.0f + cM_rndF(30.0f); } break; case 11: if (i_this->m0300[3] == 0) { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } break; case 20: @@ -1308,15 +1308,15 @@ static void stand(bk_class* i_this) { i_this->dr.m710 = 1; } if (i_this->m0300[1] == 0) { - i_this->dr.mState = 4; + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; return; } break; case 50: anm_init(i_this, BK_BCK_BK_KYORO1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO1); - i_this->dr.m004 += 1; + i_this->dr.mMode += 1; i_this->m0300[1] = 50; // Fall-through case 51: @@ -1326,7 +1326,7 @@ static void stand(bk_class* i_this) { } if (i_this->m0300[1] == 0) { anm_init(i_this, BK_BCK_BK_RUN, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_RUN); - i_this->dr.m004 += 1; + i_this->dr.mMode += 1; i_this->m0300[2] = 60; } break; @@ -1334,14 +1334,14 @@ static void stand(bk_class* i_this) { sp28 = i_this->home.pos - i_this->current.pos; i_this->dr.m4D0 = cM_atan2s(sp28.x, sp28.z); if (std::sqrtf(sp28.x*sp28.x + sp28.z*sp28.z) < l_bkHIO.m054 * 0.25f * 5.0f) { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0, 4, 0x1000); cLib_addCalc2(&i_this->speedF, l_bkHIO.m054, 1.0f, 5.0f); if (i_this->dr.mAcch.ChkGroundHit() && i_this->dr.mAcch.ChkWallHit()) { if (i_this->m02DC != 0) { - i_this->dr.m004 = 60; + i_this->dr.mMode = 60; i_this->m0300[2] = 20; break; } @@ -1349,7 +1349,7 @@ static void stand(bk_class* i_this) { i_this->speed.y = 100.0f + REG0_F(16); anm_init(i_this, BK_BCK_BK_JUMP1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP1); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_JUMP, 0); - i_this->dr.m004 = 53; + i_this->dr.mMode = 53; } break; @@ -1359,19 +1359,19 @@ static void stand(bk_class* i_this) { break; } anm_init(i_this, BK_BCK_BK_JUMP2, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP2); - i_this->dr.m004 += 1; + i_this->dr.mMode += 1; break; case 54: i_this->speedF = 0.0f; if (i_this->mpMorf->isStop()) { - i_this->dr.m004 = 51; + i_this->dr.mMode = 51; } break; case 60: cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0 + 0x4000, 4, 0x1000); cLib_addCalc2(&i_this->speedF, l_bkHIO.m054, 1.0f, 5.0f); if (i_this->m0300[2] == 0) { - i_this->dr.m004 = 52; + i_this->dr.mMode = 52; } break; } @@ -1379,11 +1379,11 @@ static void stand(bk_class* i_this) { if (r27) { return; } - if (i_this->dr.m004 < 10 && r31 != 0) { - i_this->dr.m004 = 10; + if (i_this->dr.mMode < 10 && r31 != 0) { + i_this->dr.mMode = 10; i_this->m0300[1] = 45.0f + cM_rndF(10.0f); } - if (!r28 && i_this->m0300[2] == 0 && i_this->dr.m004 != 20) { + if (!r28 && i_this->m0300[2] == 0 && i_this->dr.mMode != 20) { f32 f1; if (i_this->m02B5 != 0xFF) { f1 = i_this->m02B5 * 10.0f; @@ -1394,12 +1394,12 @@ static void stand(bk_class* i_this) { if (i_this->mPlayerDistance < f1 && daBk_player_view_check(i_this, &i_this->dr.m714->current.pos, i_this->m0332, l_bkHIO.m034) ) { - if (i_this->dr.m004 >= 50) { - i_this->dr.mState = 4; + if (i_this->dr.mMode >= 50) { + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } else { - i_this->dr.m004 = 20; + i_this->dr.mMode = 20; anm_init(i_this, BK_BCK_BK_BIKKURI, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->m0300[1] = 30; fopAcM_monsSeStart(i_this, JA_SE_CV_BK_FOUND_LINK, 0); @@ -1407,13 +1407,13 @@ static void stand(bk_class* i_this) { } if (daBk_bomb_view_check(i_this)) { - i_this->dr.mState = 9; - i_this->dr.m004 = 0; + i_this->dr.mAction = 9; + i_this->dr.mMode = 0; } } if (i_this->m0B30 == 0 && daBk_wepon_view_check(i_this)) { - i_this->dr.mState = 12; - i_this->dr.m004 = -1; + i_this->dr.mAction = 12; + i_this->dr.mMode = -1; } } @@ -1455,9 +1455,9 @@ static void stand2(bk_class* i_this) { i_this->home.angle.y = i_this->mpSearchLight->current.angle.y + REG8_S(4); } - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; // Fall-through case 1: { if (i_this->mpSearchLight != NULL) { @@ -1500,13 +1500,13 @@ static void stand2(bk_class* i_this) { } if (i_this->m0300[1] == 0) { anm_init(i_this, BK_BCK_BK_KYORO2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO2); - i_this->dr.m004 = 11; + i_this->dr.mMode = 11; i_this->m0300[3] = 30.0f + cM_rndF(30.0f); } break; case 11: if (i_this->m0300[3] == 0) { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } break; case 20: @@ -1515,22 +1515,22 @@ static void stand2(bk_class* i_this) { i_this->dr.m710 = 1; } if (i_this->m0300[1] == 0) { - i_this->dr.mState = 4; + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; return; } break; case 50: anm_init(i_this, BK_BCK_BK_KYORO1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO1); - i_this->dr.m004 += 1; + i_this->dr.mMode += 1; i_this->m0300[1] = 50; // Fall-through case 51: i_this->speedF = 0.0f; if (i_this->m0300[1] == 0) { anm_init(i_this, BK_BCK_BK_RUN, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_RUN); - i_this->dr.m004 += 1; + i_this->dr.mMode += 1; path_check(i_this, 1); if (i_this->m1216 >= 4) { i_this->m1217 = 1; @@ -1551,10 +1551,10 @@ static void stand2(bk_class* i_this) { temp_568: i_this->dr.m4D0 = cM_atan2s(sp24.x, sp24.z); if (std::sqrtf(sp24.x*sp24.x + sp24.z*sp24.z) < l_bkHIO.m054 * 0.25f * 5.0f) { - if (i_this->dr.m004 == 60) { - i_this->dr.m004 = 0; + if (i_this->dr.mMode == 60) { + i_this->dr.mMode = 0; } else if (i_this->m1216 == 0) { - i_this->dr.m004 = 60; + i_this->dr.mMode = 60; } else { i_this->m1216 += i_this->m1217; if (i_this->m1216 >= (s8)i_this->ppd->m_num) { @@ -1569,12 +1569,12 @@ temp_568: break; } - if (i_this->dr.m004 < 10 && r31 != 0) { - i_this->dr.m004 = 10; + if (i_this->dr.mMode < 10 && r31 != 0) { + i_this->dr.mMode = 10; i_this->m0300[1] = cM_rndF(10.0f) + 45.0f; } - if (i_this->m0300[2] == 0 && i_this->dr.m004 != 20) { + if (i_this->m0300[2] == 0 && i_this->dr.mMode != 20) { f32 f1; if (i_this->m02B5 != 0xFF) { f1 = i_this->m02B5 * 10.0f; @@ -1585,12 +1585,12 @@ temp_568: if (i_this->mPlayerDistance < f1 && daBk_player_view_check(i_this, &i_this->dr.m714->current.pos, i_this->m0332, l_bkHIO.m034) ) { - if (i_this->dr.m004 >= 50) { - i_this->dr.mState = 4; + if (i_this->dr.mMode >= 50) { + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } else { - i_this->dr.m004 = 20; + i_this->dr.mMode = 20; anm_init(i_this, BK_BCK_BK_BIKKURI, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->m0300[1] = 30; fopAcM_monsSeStart(i_this, JA_SE_CV_BK_FOUND_LINK, 0); @@ -1598,14 +1598,14 @@ temp_568: } if (daBk_bomb_view_check(i_this)) { - i_this->dr.mState = 9; - i_this->dr.m004 = 0; + i_this->dr.mAction = 9; + i_this->dr.mMode = 0; } } if (i_this->m0B30 == 0 && daBk_wepon_view_check(i_this)) { - i_this->dr.mState = 12; - i_this->dr.m004 = -1; + i_this->dr.mAction = 12; + i_this->dr.mMode = -1; } } @@ -1613,10 +1613,10 @@ temp_568: static void path_run(bk_class* i_this) { i_this->dr.m710 = 0; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: anm_init(i_this, BK_BCK_BK_RUN, 10.0f, J3DFrameCtrl::EMode_LOOP, l_bkHIO.m070, BK_BAS_BK_RUN); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; // Fall-through case 1: dPnt* point = &i_this->ppd->m_points[i_this->m1216]; @@ -1696,9 +1696,9 @@ static void path_run(bk_class* i_this) { if (i_this->mPlayerDistance < l_bkHIO.m028 && daBk_player_view_check(i_this, &i_this->dr.m714->current.pos, i_this->m0332, l_bkHIO.m034) ) { - i_this->dr.mState = 4; + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } } @@ -1775,9 +1775,9 @@ static void fight_run(bk_class* i_this) { } i_this->dr.m4D0 = i_this->m0332; - if (i_this->dr.m004 != 0) { + if (i_this->dr.mMode != 0) { s16 r6 = 0x400; - if (i_this->dr.m004 == 1) { + if (i_this->dr.mMode == 1) { r6 = 0x800; } if (i_this->dr.mAcch.ChkGroundHit()) { @@ -1785,11 +1785,11 @@ static void fight_run(bk_class* i_this) { } } - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: if (i_this->m0300[1] == 0) { fight_run_set(i_this); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m120C = 0; i_this->m1212 = cM_rndF(1000.0f); } else { @@ -1812,7 +1812,7 @@ static void fight_run(bk_class* i_this) { i_this->m120C = 0; } if (i_this->mPlayerDistance < l_bkHIO.m02C) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; i_this->m0300[4] = 50; } break; @@ -1859,8 +1859,8 @@ static void fight_run(bk_class* i_this) { } if (i_this->mPlayerDistance < l_bkHIO.m030) { - i_this->dr.mState = 5; - i_this->dr.m004 = 0; + i_this->dr.mAction = 5; + i_this->dr.mMode = 0; return; } break; @@ -1868,7 +1868,7 @@ static void fight_run(bk_class* i_this) { i_this->m120C = 0; if (cM_rndF(1.0f) < 0.3f && i_this->m0B30 == 0) { - i_this->dr.m004 = 8; + i_this->dr.mMode = 8; wait_set(i_this); i_this->m0300[1] = 20.0f + cM_rndF(20.0f); break; @@ -1880,9 +1880,9 @@ static void fight_run(bk_class* i_this) { anm_init(i_this, BK_BCK_BK_WALK2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_WALK2); } if (stickPosX > 0.0f) { - i_this->dr.m004 = 5; + i_this->dr.mMode = 5; } else { - i_this->dr.m004 = 6; + i_this->dr.mMode = 6; } } else if (i_this->mPlayerDistance < l_bkHIO.m030) { if (i_this->m0B30 != 0 || i_this->m11F3 != 0) { @@ -1890,14 +1890,14 @@ static void fight_run(bk_class* i_this) { } else { anm_init(i_this, BK_BCK_BK_WALK2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_WALK2); } - i_this->dr.m004 = 4; + i_this->dr.mMode = 4; } else { if (i_this->m0B30 != 0 || i_this->m11F3 != 0) { anm_init(i_this, BK_BCK_BK_WALK2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_WALK2); } else { anm_init(i_this, BK_BCK_BK_WALK2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_WALK2); } - i_this->dr.m004 = 3; + i_this->dr.mMode = 3; } i_this->m0300[1] = 20.0f + cM_rndF(20.0f); break; @@ -1907,34 +1907,34 @@ static void fight_run(bk_class* i_this) { i_this->speed.y = 100.0f + REG0_F(16); anm_init(i_this, BK_BCK_BK_JUMP1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP1); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_JUMP, 0); - i_this->dr.m004 = 33; + i_this->dr.mMode = 33; break; } if (i_this->m0300[1] == 0) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; case 33: if (i_this->dr.mAcch.ChkGroundHit()) { anm_init(i_this, BK_BCK_BK_JUMP2, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP2); - i_this->dr.m004++; + i_this->dr.mMode++; } break; case 34: i_this->speedF = 0.0f; if (i_this->mpMorf->isStop()) { - i_this->dr.m004 = 3; + i_this->dr.mMode = 3; } break; case 4: if ((i_this->m02DD & 0x2) == 0) { cLib_addCalc2(&i_this->speedF, -l_bkHIO.m060, 1.0f, 20.0f); if (i_this->m0300[1] == 0) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; } - i_this->dr.m004 = 3; + i_this->dr.mMode = 3; if (i_this->m0B30 != 0 || i_this->m11F3 != 0) { anm_init(i_this, BK_BCK_BK_WALK2, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_WALK2); } else { @@ -1960,29 +1960,29 @@ static void fight_run(bk_class* i_this) { temp_860: cLib_addCalc2(&i_this->speedF, l_bkHIO.m064, 1.0f, 30.0f); if (i_this->m0300[1] == 0) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; case 8: i_this->speedF = 0.0f; if (i_this->m0300[1] == 0) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; } - if (i_this->dr.m004 >= 3 && i_this->m0314 <= 2) { + if (i_this->dr.mMode >= 3 && i_this->m0314 <= 2) { if (i_this->mPlayerDistance > l_bkHIO.m02C + 75.0f) { - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; path_check(i_this, 0); } if (i_this->mPlayerDistance < l_bkHIO.m030 + 62.5f && i_this->mPlayerDistance > l_bkHIO.m030 - 62.5f) { if (i_this->m0300[4] == 0) { i_this->m0300[4] = l_bkHIO.m078; if (cM_rndF(100.0f) < l_bkHIO.m07C) { - i_this->dr.mState = 5; - i_this->dr.m004 = 0; + i_this->dr.mAction = 5; + i_this->dr.mMode = 0; } } } @@ -2011,8 +2011,8 @@ static void fight_run(bk_class* i_this) { ) ) { if (i_this->m02D4 != 0 && (cM_rndF(1.0f) <= 0.5f || l_bkHIO.m008 != 0)) { - i_this->dr.mState = 10; - i_this->dr.m004 = 0; + i_this->dr.mAction = 10; + i_this->dr.mMode = 0; if (player->getCutType() == 0xA) { i_this->m0300[1] = 0x1E; } else { @@ -2021,10 +2021,10 @@ static void fight_run(bk_class* i_this) { } else { i_this->m030E = 0xA; if ((ground_4_check(i_this, 4, i_this->current.angle.y, 200.0f) & 0xD) == 0) { - i_this->dr.mState = 5; + i_this->dr.mAction = 5; attack_set(i_this, 1); anm_init(i_this, BK_BCK_BK_JUMP1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP1); - i_this->dr.m004 = -10; + i_this->dr.mMode = -10; i_this->speedF = -60.0f + REG0_F(3); i_this->speed.y = 80.0f + REG0_F(4); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_JUMP, 0); @@ -2043,8 +2043,8 @@ static void fight_run(bk_class* i_this) { if (cM_rndF(1.0f) < 0.5f + REG0_F(0) && (ground_4_check(i_this, 4, i_this->current.angle.y, 200.0f) & 0xD) == 0 ) { - i_this->dr.mState = 7; - i_this->dr.m004 = 0; + i_this->dr.mAction = 7; + i_this->dr.mMode = 0; } i_this->m02FC = 0; } @@ -2052,17 +2052,17 @@ static void fight_run(bk_class* i_this) { i_this->m02FC = 0; } if (daBk_player_bg_check(i_this, &i_this->dr.m714->current.pos)) { - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; path_check(i_this, 0); } if (i_this->m0B30 == 0 && daBk_wepon_view_check(i_this)) { - i_this->dr.mState = 12; - i_this->dr.m004 = -1; + i_this->dr.mAction = 12; + i_this->dr.mMode = -1; } if (daBk_bomb_view_check(i_this)) { - i_this->dr.mState = 9; - i_this->dr.m004 = 0; + i_this->dr.mAction = 9; + i_this->dr.mMode = 0; } i_this->m02DD = ground_4_check(i_this, 4, i_this->current.angle.y, 90.0f + REG6_F(7)); if (i_this->m0314 != 0) { @@ -2143,17 +2143,17 @@ static fopAc_ac_c* yari_hit_check(bk_class* i_this) { /* 000075E8-00007EF4 .text fight__FP8bk_class */ static void fight(bk_class* i_this) { daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case -10: if (i_this->dr.mAcch.ChkGroundHit()) { anm_init(i_this, BK_BCK_BK_JUMP2, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP2); - i_this->dr.m004 = -9; + i_this->dr.mMode = -9; i_this->speedF = 0.0f; } break; case -9: if (i_this->mpMorf->isStop()) { - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m0300[2] = 8; anm_init(i_this, BK_BCK_BK_JATTACK1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->speedF = 80.0f + REG0_F(5); @@ -2170,7 +2170,7 @@ static void fight(bk_class* i_this) { i_this->speed.y = 105.0f + REG0_F(8); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_ATTACK_L, 0); } - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m0300[2] = 8; // Fall-through temp_1B8: @@ -2255,8 +2255,8 @@ temp_1B8: i_this->mpMorf->play(&i_this->eyePos, 0, 0); if (i_this->m0B30 != 0 && i_this->m02D5 == 0 && cM_rndF(1.0f) < 0.5f) { i_this->m0B34 = 1; - i_this->dr.mState = 8; - i_this->dr.m004 = -10; + i_this->dr.mAction = 8; + i_this->dr.mMode = -10; i_this->m0300[0] = 10; i_this->m0300[1] = 100; } @@ -2276,10 +2276,10 @@ temp_1B8: i_this->m0B7A = -1; i_this->mpMorf->play(&i_this->eyePos, 0, 0); } else { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } i_this->m0318 = 1; i_this->m0314 = 0x10; @@ -2299,32 +2299,32 @@ temp_1B8: (i_this->m0B5C == 2 && i_this->m0B60 == 1) ) { if (i_this->m11FC != fpcM_ERROR_PROCESS_ID_e) { - i_this->dr.mState = 14; - i_this->dr.m004 = 0; + i_this->dr.mAction = 14; + i_this->dr.mMode = 0; } else if (i_this->mPlayerDistance < l_bkHIO.m02C) { if (daBk_player_view_check(i_this, &i_this->dr.m714->current.pos, i_this->m0332, l_bkHIO.m034)) { if (cM_rndF(1.0f) < 0.8f || i_this->m0B7A < 0) { - i_this->dr.mState = 4; - i_this->dr.m004 = 2; + i_this->dr.mAction = 4; + i_this->dr.mMode = 2; i_this->m0300[1] = 0; } else { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } } else { if (i_this->m0B30 != 0 || i_this->m11F3 != 0) { - i_this->dr.mState = 8; - i_this->dr.m004 = 0; + i_this->dr.mAction = 8; + i_this->dr.mMode = 0; } else { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } } } else { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } } else if (i_this->dr.mAcch.ChkGroundHit()) { attack_info_s* r6 = attack_info[i_this->m0B5C]; @@ -2346,10 +2346,10 @@ temp_1B8: /* 00007EF4-00008108 .text p_lost__FP8bk_class */ static void p_lost(bk_class* i_this) { i_this->dr.m710 = 0; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case -10: if (i_this->mpMorf->isStop() || i_this->m0300[0] == 0) { - i_this->dr.m004++; + i_this->dr.mMode++; i_this->m0300[0] = 5; } break; @@ -2359,7 +2359,7 @@ static void p_lost(bk_class* i_this) { } // Fall-through case 0: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; anm_init(i_this, BK_BCK_BK_KYORO2, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_KYORO2); i_this->speedF = 0.0f; i_this->m0300[1] = 30.0f + cM_rndF(30.0f); @@ -2370,17 +2370,17 @@ static void p_lost(bk_class* i_this) { fopAcM_monsSeStart(i_this, JA_SE_CV_BK_SEARCH, 0); } if (i_this->m0300[1] == 0) { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; } if (i_this->m0300[1] < 10 && daBk_player_view_check(i_this, &i_this->dr.m714->current.pos, i_this->m0332, l_bkHIO.m034)) { - i_this->dr.mState = 4; - i_this->dr.m004 = 2; + i_this->dr.mAction = 4; + i_this->dr.mMode = 2; i_this->m0300[1] = 0; } } @@ -2388,10 +2388,10 @@ static void p_lost(bk_class* i_this) { /* 00008108-00008470 .text b_nige__FP8bk_class */ static void b_nige(bk_class* i_this) { if (!daBk_bomb_check(i_this)) { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; return; } @@ -2401,9 +2401,9 @@ static void b_nige(bk_class* i_this) { sp10.z = r3->current.pos.z - i_this->current.pos.z; i_this->dr.m4D0 = cM_atan2s(-sp10.x, -sp10.z); - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; anm_init(i_this, BK_BCK_BK_HAKKEN, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_HAKKEN); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_FOUND_LINK, 0); i_this->m0300[1] = 20; @@ -2412,7 +2412,7 @@ static void b_nige(bk_class* i_this) { i_this->speedF = 0.0f; cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0 + 0x8000, 2, 0x3000); if (i_this->m0300[1] == 0) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; anm_init(i_this, BK_BCK_BK_NIGERU, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_NIGERU); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_LOST_BOKO, 0); } @@ -2423,7 +2423,7 @@ static void b_nige(bk_class* i_this) { i_this->m034E = 4; cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0, 4, 0x1000); if (std::sqrtf(sp10.x*sp10.x + sp10.z*sp10.z) > 800.0f) { - i_this->dr.m004 = 3; + i_this->dr.mMode = 3; anm_init(i_this, BK_BCK_BK_WAIT, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_WAIT); } break; @@ -2432,7 +2432,7 @@ static void b_nige(bk_class* i_this) { i_this->dr.m4D0 = i_this->m0332; cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0, 3, 0x1000); if (std::sqrtf(sp10.x*sp10.x + sp10.z*sp10.z) < 700.0f) { - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } break; } @@ -2444,9 +2444,9 @@ static void defence(bk_class* i_this) { i_this->dr.m4D0 = i_this->m0332; cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0, 4, 0x400); - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; anm_init(i_this, BK_BCK_BK_BOUGYO1, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->speedF = 0.0f; // Fall-through @@ -2455,12 +2455,12 @@ static void defence(bk_class* i_this) { i_this->m11D8 = i_this->m11CC; if (i_this->m0300[1] == 0) { if (cM_rndF(1.0f) < 0.5f) { - i_this->dr.mState = 5; - i_this->dr.m004 = 0; + i_this->dr.mAction = 5; + i_this->dr.mMode = 0; } else { - i_this->dr.mState = 4; + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } } break; @@ -2469,10 +2469,10 @@ static void defence(bk_class* i_this) { /* 00008580-00008654 .text oshi__FP8bk_class */ static void oshi(bk_class* i_this) { - i_this->dr.mState = 5; + i_this->dr.mAction = 5; attack_set(i_this, 1); anm_init(i_this, BK_BCK_BK_JUMP1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP1); - i_this->dr.m004 = -10; + i_this->dr.mMode = -10; i_this->speedF = -90.0f + REG6_F(10); i_this->speed.y = 85.0f + REG6_F(11); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_JUMP, 0); @@ -2489,7 +2489,7 @@ static void hukki(bk_class* i_this) { sp24.x = sp24.y = 0.0f; i_this->m030E = 2; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 10: anm_init(i_this, BK_BCK_BK_OKIRUA, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_OKIRUA); i_this->m0300[2] = 15; @@ -2499,7 +2499,7 @@ static void hukki(bk_class* i_this) { i_this->m0300[2] = 15 + REG0_S(5); temp_194: i_this->speedF = 0.0f; - i_this->dr.m004 = 13; + i_this->dr.mMode = 13; i_this->dr.m480 = 0; i_this->current.pos.y -= i_this->dr.m44C.y; i_this->old.pos.y -= i_this->dr.m44C.y; @@ -2522,13 +2522,13 @@ temp_194: } if (i_this->mpMorf->isStop()) { if (i_this->mPlayerDistance < l_bkHIO.m02C) { - i_this->dr.m004 = 14; + i_this->dr.mMode = 14; i_this->m0300[1] = 10; } else { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } i_this->dr.m488 = 0; } @@ -2539,7 +2539,7 @@ temp_194: cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0, 3, 0x1000); if (i_this->m0300[1] == 0) { if (!player->checkGrabWear() && l_bkHIO.m00A == 0 && i_this->m0B30 != 0) { - i_this->dr.mState = 5; + i_this->dr.mAction = 5; i_this->m0B5C = 0; i_this->m0B64 = 29.0f + REG0_F(8); i_this->m0B68 = 32.0f; @@ -2551,11 +2551,11 @@ temp_194: attack_info_s* info = attack_info[i_this->m0B5C]; info += 1; anm_init(i_this, info->bckFileIdx, 5.0f, J3DFrameCtrl::EMode_NONE, info->speed, info->soundFileIdx); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m11F2 = 1; } else { - i_this->dr.mState = 4; - i_this->dr.m004 = 0; + i_this->dr.mAction = 4; + i_this->dr.mMode = 0; } } break; @@ -2578,11 +2578,11 @@ temp_194: /* 00008C38-00008D1C .text aite_miru__FP8bk_class */ static void aite_miru(bk_class* i_this) { - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: i_this->m0300[1] = 20 + REG0_S(8); i_this->speedF = 0.0f; - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; // Fall-through case 1: cLib_addCalcAngleS2(&i_this->m11F4, 0x2EE0, 2, 0x1800); @@ -2595,8 +2595,8 @@ static void aite_miru(bk_class* i_this) { } if (i_this->m0300[1] == 0) { i_this->m11FC = fpcM_ERROR_PROCESS_ID_e; - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; path_check(i_this, 0); } break; @@ -2611,14 +2611,14 @@ static void fail(bk_class* i_this) { i_this->speedF = 0.0f; i_this->speed.y = 0.0f; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case -1: if (i_this->m1234 == 0) { fopAcM_delete(i_this); } break; case 0: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; // Fall-through case 1: cXyz sp08 = i_this->current.pos; @@ -2630,7 +2630,7 @@ static void fail(bk_class* i_this) { fopAcM_createDisappear(i_this, &sp08, 10, drop_type, i_this->stealItemBitNo); if (i_this->mType == 10) { i_this->m02DE = 1; - i_this->dr.m004 = -1; + i_this->dr.mMode = -1; mDoAud_subBgmStop(); } else { fopAcM_delete(i_this); @@ -2660,10 +2660,10 @@ static void yogan_fail(bk_class* i_this) { i_this->attention_info.flags = 0; i_this->speedF = 0.0f; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: anm_init(i_this, BK_BCK_BK_NIGERU, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_NIGERU); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->speed.y = 190.0f + REG0_F(19); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_SURPRISE, 0); i_this->dr.m458.y = 0.0f; @@ -2685,8 +2685,8 @@ static void yogan_fail(bk_class* i_this) { cLib_addCalcAngleS2(&i_this->current.angle.x, -0x4000, 10, 0x200); if (i_this->speed.y < 0.0f) { - i_this->dr.mState = 20; - i_this->dr.m004 = 0; + i_this->dr.mAction = 20; + i_this->dr.mMode = 0; i_this->m0300[2] = 2000; } break; @@ -2701,10 +2701,10 @@ static void water_fail(bk_class* i_this) { i_this->attention_info.flags = 0; i_this->speedF = 0.0f; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: anm_init(i_this, BK_BCK_BK_NIGERU, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_NIGERU); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; fopAcM_monsSeStart(i_this, JA_SE_CV_BK_SURPRISE, 0); i_this->dr.m458.y = 0.0f; i_this->dr.m44C.y = 0.0f; @@ -2734,11 +2734,11 @@ static void wepon_search(bk_class* i_this) { daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); daBoko_c* boko = (daBoko_c*)fopAcM_SearchByID(i_this->m1200); - if (i_this->dr.m004 < 2 && (boko == NULL || (boko != NULL && fopAcM_checkCarryNow(boko)))) { - i_this->dr.mState = 0; + if (i_this->dr.mMode < 2 && (boko == NULL || (boko != NULL && fopAcM_checkCarryNow(boko)))) { + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; return; } @@ -2751,9 +2751,9 @@ static void wepon_search(bk_class* i_this) { f31 = std::sqrtf(delta.x*delta.x + delta.z*delta.z); } - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case -1: - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; i_this->m11F3 = 0; anm_init(i_this, BK_BCK_BK_HAKKEN, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_HAKKEN); if (f31 < 900.0f) { @@ -2769,7 +2769,7 @@ static void wepon_search(bk_class* i_this) { if (i_this->m030C == 0) { cLib_addCalcAngleS2(&actor->current.angle.y, i_this->dr.m4D0, 2, 0x3000); if (i_this->mpMorf->isStop() || i_this->m0300[1] == 0) { - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m030A = l_bkHIO.m08E; anm_init(i_this, BK_BCK_BK_RUN, 3.0f, J3DFrameCtrl::EMode_LOOP, l_bkHIO.m074, BK_BAS_BK_RUN); i_this->m02CE = 0; @@ -2782,12 +2782,12 @@ static void wepon_search(bk_class* i_this) { i_this->m034E = 4; cLib_addCalcAngleS2(&actor->current.angle.y, i_this->dr.m4D0, 4, 0x1000); if (f31 < REG8_F(2) + 150.0f) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; anm_init(i_this, BK_BCK_BK_CATCH, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_CATCH); i_this->m0300[1] = 29; } else { if (i_this->m030A == 0) { - i_this->dr.mState = 4; + i_this->dr.mAction = 4; i_this->m0300[1] = 0; i_this->m11F3 = 1; } else if (i_this->dr.mAcch.ChkGroundHit() && i_this->dr.mAcch.ChkWallHit()) { @@ -2795,13 +2795,13 @@ static void wepon_search(bk_class* i_this) { actor->speed.y = 100.0f + REG0_F(16); anm_init(i_this, BK_BCK_BK_JUMP1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP1); fopAcM_monsSeStart(actor, JA_SE_CV_BK_JUMP, 0); - i_this->dr.m004 = 5; + i_this->dr.mMode = 5; i_this->m02CE++; } else { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; i_this->m02CC = 70; } } @@ -2823,10 +2823,10 @@ static void wepon_search(bk_class* i_this) { } fopAcM_setCarryNow(boko, FALSE); } else { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } } if (i_this->m0300[1] < 14) { @@ -2836,7 +2836,7 @@ static void wepon_search(bk_class* i_this) { } if (i_this->mpMorf->isStop()) { if (l_bkHIO.m00A == 0 && !player->checkGrabWear() && i_this->mPlayerDistance < l_bkHIO.m02C) { - i_this->dr.mState = 5; + i_this->dr.mAction = 5; i_this->m0B5C = 0; i_this->m0B64 = 18.0f; i_this->m0B68 = REG6_F(6) + 23.0f; @@ -2848,13 +2848,13 @@ static void wepon_search(bk_class* i_this) { attack_info_s* info = attack_info[i_this->m0B5C]; info++; // TODO: fakematch? anm_init(i_this, info->bckFileIdx, 5.0f, J3DFrameCtrl::EMode_NONE, info->speed, info->soundFileIdx); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m11F2 = 1; } else { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } } break; @@ -2862,13 +2862,13 @@ static void wepon_search(bk_class* i_this) { actor->speedF = l_bkHIO.m05C * 0.5f; if (i_this->dr.mAcch.ChkGroundHit()) { anm_init(i_this, BK_BCK_BK_JUMP2, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP2); - i_this->dr.m004++; + i_this->dr.mMode++; } break; case 6: actor->speedF = 0.0f; if (i_this->mpMorf->isStop()) { - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; anm_init(i_this, BK_BCK_BK_RUN, 3.0f, J3DFrameCtrl::EMode_LOOP, l_bkHIO.m074, BK_BAS_BK_RUN); } break; @@ -2881,9 +2881,9 @@ static void d_dozou(bk_class* i_this) { fopAcM_OffStatus(i_this, 0); i_this->attention_info.flags = 0; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->dr.mStts.Init(0xFF, 0xFF, i_this); if (i_this->m02B5 == 0) { anm_init(i_this, BK_BCK_BK_ATTACK2, 1.0f, J3DFrameCtrl::EMode_NONE, 0.0f, BK_BAS_BK_ATTACK2); @@ -2899,14 +2899,14 @@ static void d_dozou(bk_class* i_this) { (i_this->m02B7 == 0xFF && dComIfGs_isEventBit(0x3802)) ) { i_this->mpMorf->setPlaySpeed(1.0f); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; case 2: if (i_this->mpMorf->isStop()) { i_this->dr.mStts.Init(200, 0xFF, i_this); - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; i_this->attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e; } break; @@ -2928,16 +2928,16 @@ static void carry_drop(bk_class* i_this) { cLib_addCalcAngleS2(&i_this->shape_angle.z, 0, 1, 0x100); cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->m0332, 4, 0x800); - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: dComIfGs_onEventBit(0x0004); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; anm_init(i_this, BK_BCK_BK_KOUKA, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); // Fall-through case 1: if (i_this->dr.mAcch.ChkGroundHit()) { anm_init(i_this, BK_BCK_BK_TYAKU, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; i_this->m034C = l_bkHIO.m00C + 15; i_this->m034E = 3; i_this->dr.mMaxFallDistance = 1000.0f; @@ -2952,15 +2952,15 @@ static void carry_drop(bk_class* i_this) { cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); if (i_this->mpMorf->isStop()) { anm_init(i_this, BK_BCK_BK_KIME, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->dr.m004 = 3; + i_this->dr.mMode = 3; fopAcM_monsSeStart(actor, JA_SE_CV_BK_SURPRISE, 0); } break; case 3: cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); if (i_this->mpMorf->isStop()) { - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; i_this->current.angle = i_this->shape_angle; } break; @@ -2969,9 +2969,9 @@ static void carry_drop(bk_class* i_this) { /* 00009DF0-00009F1C .text d_mahi__FP8bk_class */ static void d_mahi(bk_class* i_this) { - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; anm_init(i_this, BK_BCK_BK_SUWARI, 20.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_SUWARI); i_this->m0300[0] = 100; // Fall-through @@ -2987,10 +2987,10 @@ static void d_mahi(bk_class* i_this) { i_this->dr.m49E = 0xF; } if (i_this->m0300[0] == 0) { - i_this->dr.mState = 0; + i_this->dr.mAction = 0; path_check(i_this, 0); wait_set(i_this); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; } @@ -3005,21 +3005,21 @@ static void tubo_wait(bk_class* i_this) { cLib_addCalc2(&actor->scale.x, 1.0f, 1.0f, 0.1f); actor->scale.y = actor->scale.z = actor->scale.x; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: if (i_this->m0300[0] != 0) { i_this->m0300[0] = REG0_S(3) + 30; anm_init(i_this, BK_BCK_BK_SUWARI, 0.0f, J3DFrameCtrl::EMode_NONE, 0.01f, BK_BAS_BK_SUWARI); - i_this->dr.m004 = 20; + i_this->dr.mMode = 20; } else { if (i_this->mType == 3) { anm_init(i_this, BK_BCK_BK_JATTACK1, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; actor->speed.y = REG0_F(8) + 120.0f; actor->speedF = REG0_F(9) + 40.0f; } else { anm_init(i_this, BK_BCK_BK_JUMP1, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP1); - i_this->dr.m004 = 10; + i_this->dr.mMode = 10; actor->speed.y = REG8_F(8) + 120.0f; actor->speedF = REG8_F(9) + 40.0f; } @@ -3033,7 +3033,7 @@ static void tubo_wait(bk_class* i_this) { break; case 1: if (i_this->dr.mAcch.ChkGroundHit()) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; anm_init(i_this, BK_BCK_BK_JATTACK2, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JATTACK2); fopAcM_monsSeStart(actor, JA_SE_CV_BK_ATTACK_L, 0); } @@ -3041,14 +3041,14 @@ static void tubo_wait(bk_class* i_this) { case 2: r28 = true; if (i_this->mpMorf->isStop()) { - i_this->dr.m004 = 11; + i_this->dr.mMode = 11; anm_init(i_this, BK_BCK_BK_JATTACK3, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JATTACK3); } break; case 10: if (i_this->m0300[0] == 0 && i_this->dr.mAcch.ChkGroundHit()) { anm_init(i_this, BK_BCK_BK_JUMP2, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP2); - i_this->dr.m004 = 11; + i_this->dr.mMode = 11; i_this->m034C = l_bkHIO.m00C + 6; i_this->m034E = 3; } @@ -3056,8 +3056,8 @@ static void tubo_wait(bk_class* i_this) { case 11: cLib_addCalc0(&i_this->speedF, 1.0f, 20.0f); if (i_this->mpMorf->isStop()) { - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; } break; case 20: @@ -3066,8 +3066,8 @@ static void tubo_wait(bk_class* i_this) { anm_init(i_this, BK_BCK_BK_SUWARI, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_SUWARI); } } else if (i_this->mpMorf->isStop()) { - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; } break; } @@ -3092,7 +3092,7 @@ static void z_demo_1(bk_class* i_this) { i_this->attention_info.flags = 0; i_this->m030E = 10; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: if (i_this->m0300[0] == 0) { f32 f1 = cM_rndF(1.0f); @@ -3101,7 +3101,7 @@ static void z_demo_1(bk_class* i_this) { } else { i_this->m0300[0] = 90; } - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; anm_init(i_this, BK_BCK_BK_TUTUKU1, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_TUTUKU1); } break; @@ -3122,7 +3122,7 @@ static void z_demo_1(bk_class* i_this) { } else { i_this->m0300[0] = 180; } - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; anm_init(i_this, BK_BCK_BK_TUTUKU2, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } break; @@ -3134,7 +3134,7 @@ static void z_demo_1(bk_class* i_this) { } else { i_this->m0300[0] = 150; } - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; anm_init(i_this, BK_BCK_BK_TUTUKU3, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } break; @@ -3151,8 +3151,8 @@ static void z_demo_1(bk_class* i_this) { && std::fabsf(player->current.pos.y - actor->current.pos.y) < 250.0f ) { i_this->mType = 0; - i_this->dr.mState = 1; - i_this->dr.m004 = 20; + i_this->dr.mAction = 1; + i_this->dr.mMode = 20; anm_init(i_this, BK_BCK_BK_BIKKURI, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->m0300[1] = 30; fopAcM_monsSeStart(actor, JA_SE_CV_BK_FOUND_LINK, 0); @@ -3168,18 +3168,18 @@ static void b_hang(bk_class* i_this) { if (i_this->dr.m7B8 != fpcM_ERROR_PROCESS_ID_e) { r29 = (bridge_class*)fopAcM_SearchByID(i_this->dr.m7B8); if (r29 == NULL) { - i_this->dr.mState = 4; - i_this->dr.m004 = 0; + i_this->dr.mAction = 4; + i_this->dr.mMode = 0; return; } } i_this->m0B88.OffCoSetBit(); i_this->dr.m71E = 5; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: anm_init(i_this, BK_BCK_BK_OTISOU1, REG12_F(9) + 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, BK_BAS_BK_OTISOU1); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->dr.m798 = 0.0f; i_this->m0300[0] = 100; if (i_this->m0B30 != 0) { @@ -3193,7 +3193,7 @@ static void b_hang(bk_class* i_this) { } if (i_this->m0300[0] == 0) { anm_init(i_this, BK_BCK_BK_OTISOU2, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_OTISOU2); - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; } break; case 2: @@ -3237,8 +3237,8 @@ static void b_hang(bk_class* i_this) { } if (r30) { - i_this->dr.mState = 4; - i_this->dr.m004 = 0; + i_this->dr.mAction = 4; + i_this->dr.mMode = 0; i_this->dr.m71E = 0; i_this->dr.mSpawnY = actor->current.pos.y; } @@ -3249,16 +3249,16 @@ static void rope_on(bk_class* i_this) { i_this->dr.m710 = 1; i_this->m030E = 2; - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: i_this->speedF = 0.0f; anm_init(i_this, BK_BCK_BK_KYORO2, 10.0f, J3DFrameCtrl::EMode_LOOP, 2.0f, BK_BAS_BK_KYORO2); - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m0300[0] = 40; // Fall-through case 1: if (i_this->m0300[0] == 0) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; anm_init(i_this, BK_BCK_BK_WALK, 10.0f, J3DFrameCtrl::EMode_LOOP, 2.0f, BK_BAS_BK_WALK); } break; @@ -3270,11 +3270,11 @@ static void rope_on(bk_class* i_this) { i_this->speed.y = 100.0f + REG0_F(16); anm_init(i_this, BK_BCK_BK_JUMP1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP1); fopAcM_monsSeStart(i_this, JA_SE_CV_BK_JUMP, 0); - i_this->dr.m004 = 3; + i_this->dr.mMode = 3; } if (fopAcM_searchPlayerDistance(i_this) < 200.0f) { anm_init(i_this, BK_BCK_BK_SUWARI, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_SUWARI); - i_this->dr.m004 = 5; + i_this->dr.mMode = 5; } break; } @@ -3282,20 +3282,20 @@ static void rope_on(bk_class* i_this) { i_this->speedF = 35.0f; if (i_this->dr.mAcch.ChkGroundHit()) { anm_init(i_this, BK_BCK_BK_JUMP2, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_JUMP2); - i_this->dr.m004 = 4; + i_this->dr.mMode = 4; } break; case 4: i_this->speedF = 0.0f; if (i_this->mpMorf->isStop()) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; anm_init(i_this, BK_BCK_BK_WALK, 10.0f, J3DFrameCtrl::EMode_LOOP, 2.0f, BK_BAS_BK_WALK); } break; case 5: i_this->speedF = 0.0f; if (fopAcM_searchPlayerDistance(i_this) > 250.0f) { - i_this->dr.m004 = 2; + i_this->dr.mMode = 2; anm_init(i_this, BK_BCK_BK_WALK, 10.0f, J3DFrameCtrl::EMode_LOOP, 2.0f, BK_BAS_BK_WALK); } break; @@ -3318,7 +3318,7 @@ static void Bk_move(bk_class* i_this) { i_this->dr.m711 = 0; cLib_addCalcAngleS2(&i_this->m11F4, 0, 2, 0x800); - if (i_this->dr.m004 <= -100) { + if (i_this->dr.mMode <= -100) { i_this->m030E = 5; if (std::fabsf(i_this->dr.m478) > 40.0f && !i_this->dr.mAcch.ChkGroundHit()) { i_this->m1040.SetC(i_this->dr.m100[12]); @@ -3346,8 +3346,8 @@ static void Bk_move(bk_class* i_this) { if (i_this->dr.m48A != 0 && i_this->dr.m488 == 0) { if (i_this->dr.m48A == 1) { - i_this->dr.mState = 4; - i_this->dr.m004 = 0; + i_this->dr.mAction = 4; + i_this->dr.mMode = 0; i_this->m0300[1] = 0; } else { i_this->dr.m4D0 = i_this->m0332; @@ -3367,12 +3367,12 @@ static void Bk_move(bk_class* i_this) { if (i_this->m122C != 0) { i_this->m122C--; if (i_this->m122C == 0) { - i_this->dr.mState = 18; - i_this->dr.m004 = 0; + i_this->dr.mAction = 18; + i_this->dr.mMode = 0; } } - switch (i_this->dr.mState) { + switch (i_this->dr.mAction) { case 0: jyunkai(i_this); break; @@ -3448,7 +3448,7 @@ static void Bk_move(bk_class* i_this) { } } - if ((i_this->mType == 4 || i_this->mType == 10 || i_this->mType == 6) && i_this->dr.mState == 4) { + if ((i_this->mType == 4 || i_this->mType == 10 || i_this->mType == 6) && i_this->dr.mAction == 4) { sp28 = actor->home.pos - actor->current.pos; f32 f31; @@ -3460,22 +3460,22 @@ static void Bk_move(bk_class* i_this) { if (sp28.abs() > f31) { if (i_this->mType == 4 || i_this->mType == 10) { - i_this->dr.mState = 1; + i_this->dr.mAction = 1; } if (i_this->mType == 6) { - i_this->dr.mState = 2; + i_this->dr.mAction = 2; } - i_this->dr.m004 = 51; + i_this->dr.mMode = 51; i_this->m0300[1] = 0; i_this->m0300[2] = 60; } } - if (i_this->dr.mState != 30) { + if (i_this->dr.mAction != 30) { sp28.x = 0.0f; sp28.y = 0.0f; sp28.z = actor->speedF; - if (i_this->dr.mState != 11 && i_this->dr.mState != 20 && i_this->dr.m48A == 0) { + if (i_this->dr.mAction != 11 && i_this->dr.mAction != 20 && i_this->dr.m48A == 0) { i_this->dr.m482 = actor->current.angle.y; cMtx_YrotS(*calc_mtx, actor->current.angle.y + i_this->m0334); } else { @@ -3572,7 +3572,7 @@ static void damage_check(bk_class* i_this) { at_power_check(&atInfo); if (atInfo.mDamage < 4) { - if (r26 || (i_this->dr.mState == 15 && i_this->m0310 != 0)) { + if (r26 || (i_this->dr.mAction == 15 && i_this->m0310 != 0)) { return; } } @@ -3580,8 +3580,8 @@ static void damage_check(bk_class* i_this) { if (atInfo.mpObj->ChkAtType(AT_TYPE_ICE_ARROW | AT_TYPE_LIGHT_ARROW)) { if (atInfo.mpObj->ChkAtType(AT_TYPE_ICE_ARROW)) { i_this->mEnemyIce.mFreezeDuration = REG0_S(3) + 300; - i_this->dr.mState = 0; - i_this->dr.m004 = 0; + i_this->dr.mAction = 0; + i_this->dr.mMode = 0; path_check(i_this, 0); } else { i_this->mEnemyIce.mLightShrinkTimer = 1; @@ -3718,8 +3718,8 @@ static void damage_check(bk_class* i_this) { } if (i_this->dr.m424 != 0) { - if (i_this->dr.mState == 19) { - i_this->dr.m004 = -100; + if (i_this->dr.mAction == 19) { + i_this->dr.mMode = -100; i_this->dr.m488 = 1; i_this->dr.m486 = -0x4000; i_this->dr.m71E = 20; @@ -3785,10 +3785,10 @@ static void waki_set(bk_class* i_this) { bool r30 = false; i_this->mpSearchLight = (daObj_Search::Act_c*)fpcM_Search(&s_s2_sub, i_this); - switch (i_this->dr.m004) { + switch (i_this->dr.mMode) { case 0: if (i_this->mpSearchLight != NULL) { - i_this->dr.m004 = 1; + i_this->dr.mMode = 1; i_this->m0300[0] = 1000; } break; @@ -3800,7 +3800,7 @@ static void waki_set(bk_class* i_this) { } else { daObj_Search::Act_c::setFindFlag(false); mDoAud_seStop(JA_SE_MAJUTOU_ALERM, 30); - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; i_this->m1212 = 0; } break; @@ -4016,9 +4016,9 @@ static void demo_camera(bk_class* i_this) { if (i_this->m1236 == 45) { i_this->m02B5 = 200; - i_this->dr.mState = 4; + i_this->dr.mAction = 4; i_this->m0300[1] = 0; - i_this->dr.m004 = 0; + i_this->dr.mMode = 0; } if (i_this->m1236 > 55) { @@ -4288,7 +4288,7 @@ static BOOL daBk_Execute(bk_class* i_this) { i_this->dr.mpEnemy = i_this; i_this->dr.mEnemyType = 2; } - if (i_this->dr.mState != 31) { + if (i_this->dr.mAction != 31) { i_this->shape_angle = i_this->current.angle; } @@ -4302,16 +4302,16 @@ static BOOL daBk_Execute(bk_class* i_this) { if (i_this->m0B30 != 0) { i_this->m0B34 = 1; } - i_this->dr.mState = 0; + i_this->dr.mAction = 0; break; case 2: anm_init(i_this, BK_BCK_BK_UTUBUSE, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, BK_BAS_BK_UTUBUSE); break; case 5: - if (i_this->dr.mState != 4 && i_this->dr.mState != 11) { + if (i_this->dr.mAction != 4 && i_this->dr.mAction != 11) { wait_set(i_this); - i_this->dr.mState = 4; - i_this->dr.m004 = 0; + i_this->dr.mAction = 4; + i_this->dr.mMode = 0; i_this->m0300[1] = 30; } i_this->m0336 = 5; @@ -4319,8 +4319,8 @@ static BOOL daBk_Execute(bk_class* i_this) { break; case 10: wait_set(i_this); - i_this->dr.m004 = 2; - i_this->dr.mState = 0; + i_this->dr.mMode = 2; + i_this->dr.mAction = 0; path_check(i_this, 0); break; case 20: @@ -4340,7 +4340,7 @@ static BOOL daBk_Execute(bk_class* i_this) { if (i_this->m0B30 != 0) { i_this->m0B34 = 1; } - i_this->dr.mState = 0; + i_this->dr.mAction = 0; fopAcM_monsSeStart(i_this, JA_SE_CV_BK_FAINTED, 0); break; } @@ -4424,7 +4424,7 @@ static BOOL daBk_Execute(bk_class* i_this) { sp40.y -= 20000.0f; sp34.y -= 20000.0f; } - if (i_this->dr.mState == 10) { + if (i_this->dr.mAction == 10) { sp40.y -= 20000.0f; sp34.y -= 100.0f; } @@ -4441,7 +4441,7 @@ static BOOL daBk_Execute(bk_class* i_this) { } } - if (i_this->dr.mAcch.ChkGroundHit() || i_this->dr.mState == 19) { + if (i_this->dr.mAcch.ChkGroundHit() || i_this->dr.mAction == 19) { dBgS_GndChk gndChk; s16 r21 = 0x7FFF; s16 r23 = 0x7FFF; @@ -4475,7 +4475,7 @@ static BOOL daBk_Execute(bk_class* i_this) { } } } - if (i_this->dr.mState == 19) { + if (i_this->dr.mAction == 19) { r23 = 0; r21 = 0; } @@ -4808,33 +4808,33 @@ static cPhs_State daBk_Create(fopAc_ac_c* i_actor) { } if (i_this->mType == 4 || i_this->mType == 0xA) { - i_this->dr.mState = 1; + i_this->dr.mAction = 1; if (i_this->mType == 0xA) { - i_this->dr.m004 = -20; + i_this->dr.mMode = -20; fopAcM_OnStatus(i_this, fopAcStts_BOSS_e); #if VERSION != VERSION_USA search_sp = 1; #endif } else { - i_this->dr.m004 = -1; + i_this->dr.mMode = -1; } i_this->m0300[1] = 1000.0f + cM_rndF(1000.0f); } else if (i_this->mType == 6) { - i_this->dr.mState = 2; + i_this->dr.mAction = 2; i_this->dr.mMaxFallDistance = 300.0f; } else if (i_this->mType == 7) { - i_this->dr.mState = 29; + i_this->dr.mAction = 29; i_this->dr.mMaxFallDistance = 300.0f; } else if (i_this->mType == 5) { anm_init(i_this, BK_BCK_BK_HAKOBI, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->dr.mState = 30; + i_this->dr.mAction = 30; i_this->dr.mMaxFallDistance = 100000.0f; } else if (i_this->mType == 2 || i_this->mType == 3) { i_this->m02BA = 0xFF; - i_this->dr.mState = 15; + i_this->dr.mAction = 15; i_this->m030E = 0xA; } else if (i_this->mType == 9) { - i_this->dr.mState = 3; + i_this->dr.mAction = 3; i_this->m1216 = i_this->current.angle.z; i_this->m1217 = i_this->current.angle.y; i_this->current.angle.z = 0; @@ -4848,7 +4848,7 @@ static cPhs_State daBk_Create(fopAc_ac_c* i_actor) { } if (i_this->mType == 0xF) { - i_this->dr.mState = 23; + i_this->dr.mAction = 23; i_this->m02BA = 0; } diff --git a/src/d/actor/d_a_dr.cpp b/src/d/actor/d_a_dr.cpp index 493d71e75..6b42d1cc6 100644 --- a/src/d/actor/d_a_dr.cpp +++ b/src/d/actor/d_a_dr.cpp @@ -58,29 +58,29 @@ static void anm_init(dr_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f3 /* 00000320-0000091C .text move__FP8dr_class */ static void move(dr_class* i_this) { bool isIdle = false; - switch (i_this->mState) { + switch (i_this->mMode) { case 0: isIdle = true; anm_init(i_this, DR_BCK_DR_WAIT1, l_HIO.mWait1Morf, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mState++; + i_this->mMode++; i_this->mCountDownTimers[0] = (s16)(200.0f + cM_rndF(200.0f)); break; case 1: isIdle = true; if (i_this->mCountDownTimers[0] == 0) { anm_init(i_this, DR_BCK_DR_AKUBI1, l_HIO.mAkubi1Morf, J3DFrameCtrl::EMode_NONE, 1.0f, DR_BAS_AKUBI1); - i_this->mState++; + i_this->mMode++; } break; case 2: isIdle = true; if (i_this->mpMorf->isStop()) { - i_this->mState = 0; + i_this->mMode = 0; } break; case 10: anm_init(i_this, DR_BCK_DR_BIKU1, l_HIO.mBiku1Morf, J3DFrameCtrl::EMode_NONE, 1.0f, DR_BAS_BIKU1); - i_this->mState++; + i_this->mMode++; i_this->mCountDownTimers[0] = l_HIO.m0E; i_this->mpBreathEmitter = dComIfGp_particle_set(dPa_name::ID_SCENE_81C4, &i_this->current.pos); i_this->m2C9 = 0; @@ -118,7 +118,7 @@ static void move(dr_class* i_this) { } else { anm_init(i_this, DR_BCK_DR_HO1, l_HIO.mHo1Morf, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mpBreathEmitter = dComIfGp_particle_set(dPa_name::ID_SCENE_81C6, &i_this->current.pos); - i_this->mState++; + i_this->mMode++; } } @@ -138,7 +138,7 @@ static void move(dr_class* i_this) { } if (i_this->mpMorf->isStop()) { - i_this->mState = 0; + i_this->mMode = 0; if (i_this->mpBreathEmitter) { i_this->mpBreathEmitter->becomeInvalidEmitter(); i_this->mpBreathEmitter = NULL; @@ -151,7 +151,7 @@ static void move(dr_class* i_this) { if ((isIdle && (l_HIO.m0C || dComIfGp_getVibration().CheckQuake())) || i_this->m2C8 != 0) { l_HIO.m0C = false; i_this->m2C8 = 0; - i_this->mState = 10; + i_this->mMode = 10; } } diff --git a/src/d/actor/d_a_fganon.cpp b/src/d/actor/d_a_fganon.cpp index 9e1721971..27317c7d4 100644 --- a/src/d/actor/d_a_fganon.cpp +++ b/src/d/actor/d_a_fganon.cpp @@ -185,23 +185,23 @@ void fly(fganon_class* i_this) { fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); dBgS_LinChk linChk; - if ((((i_this->m384 & 0xF) == 0) && (cM_rndF(1.0f) < 0.5f)) || (i_this->m388 == -10)) { + if ((((i_this->m384 & 0xF) == 0) && (cM_rndF(1.0f) < 0.5f)) || (i_this->mMode == -10)) { i_this->m398 = player->shape_angle.y; } - switch (i_this->m388) { + switch (i_this->mMode) { case -10: deru_brk(i_this); i_this->current.pos = i_this->home.pos; i_this->current.pos.y = player->current.pos.y + l_HIO.m10; i_this->shape_angle.y = fopAcM_searchPlayerAngleY(a_this); - i_this->m388 = 1; + i_this->mMode = 1; anm_init(i_this, FGANON_BCK_WAIT1, 20.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->m3A4[1] = 60; break; case 0: anm_init(i_this, FGANON_BCK_WAIT1, 20.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->m388++; + i_this->mMode++; i_this->m3A0 = 0.0f; i_this->m3A4[1] = (short)(cM_rndF(50.0f) + 50.0f); // Fall-through @@ -235,24 +235,24 @@ void fly(fganon_class* i_this) { fly_se_set(i_this); if (i_this->m3A4[1] == 0) { - i_this->m386 = 6; - i_this->m388 = 0; + i_this->mAction = 6; + i_this->mMode = 0; } if (i_this->m3A4[2] == 0) { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; } } /* 000015A8-00001BD0 .text shot__FP12fganon_class */ void shot(fganon_class* i_this) { cLib_addCalcAngleS2(&i_this->shape_angle.y, fopAcM_searchPlayerAngleY(i_this), 10, 0x400); - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { if (!i_this->m408) { anm_init(i_this, FGANON_BCK_TAME1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->m388++; + i_this->mMode++; i_this->m3A4[0] = 40; fopAcM_monsSeStart(i_this, JA_SE_CV_PG_EBALL_MAKE_S, 0); // Fall-through @@ -269,7 +269,7 @@ void shot(fganon_class* i_this) { } if (i_this->m3A4[0] == 0) { anm_init(i_this, FGANON_BCK_NAGERU1, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m388++; + i_this->mMode++; fopAcM_monsSeStart(i_this, JA_SE_CV_PG_EBALL_FIRE_S, 0); mDoAud_seStart(JA_SE_CM_PG_EBALL_FIRE_S, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); } @@ -285,7 +285,7 @@ void shot(fganon_class* i_this) { } if (i_this->mpMorf->isStop()) { anm_init(i_this, FGANON_BCK_WAIT1, 3.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->m388++; + i_this->mMode++; } // Fall-through } @@ -300,7 +300,7 @@ void shot(fganon_class* i_this) { else { anm_init(i_this, FGANON_BCK_TENNISRL1, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); } - i_this->m388++; + i_this->mMode++; fopAcM_monsSeStart(i_this, JA_SE_CV_PG_REFLECT_EBALL, 0); mDoAud_seStart(JA_SE_CM_PG_SWING_S, &i_this->eyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); i_this->m687++; @@ -309,8 +309,8 @@ void shot(fganon_class* i_this) { } } else if (i_this->m2BC == 2) { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; return; } } @@ -324,7 +324,7 @@ void shot(fganon_class* i_this) { if (i_this->mpMorf->isStop() || ((i_this->m2BC >= 1) && (i_this->mpMorf->getFrame() >= 20.0f))) { anm_init(i_this, FGANON_BCK_WAIT1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->m388 = 3; + i_this->mMode = 3; } // Fall-through } @@ -332,11 +332,11 @@ void shot(fganon_class* i_this) { cLib_addCalc0(&i_this->speedF, 1.0f, REG0_F(14) + 1.0f); pos_move(i_this, 0); fly_se_set(i_this); - if ((i_this->m388 >= 2) && (i_this->m408 == 0)) { - i_this->m386 = 5; - i_this->m388 = 0; + if ((i_this->mMode >= 2) && (i_this->m408 == 0)) { + i_this->mAction = 5; + i_this->mMode = 0; } - if ((i_this->m388 == 3) || (i_this->m388 == 4)) { + if ((i_this->mMode == 3) || (i_this->mMode == 4)) { mDoAud_monsSeStart(JA_SE_OBJ_PG_EBALL_FLY_S, &i_this->m3E0, 100, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); } } @@ -347,10 +347,10 @@ void spinattack(fganon_class* i_this) { fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); dBgS_LinChk linChk; int mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { i_this->shape_angle.y = player->shape_angle.y; - i_this->m388 = 1; + i_this->mMode = 1; // Fall-through } case 1: { @@ -363,7 +363,7 @@ void spinattack(fganon_class* i_this) { if (!dComIfG_Bgsp()->LineCross(&linChk)) { i_this->current.pos.y -= 100.0f; anm_init(i_this, FGANON_BCK_WAIT1, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->m388 = 2; + i_this->mMode = 2; i_this->m3A4[0] = 30; deru_brk(i_this); // Fall-through @@ -376,7 +376,7 @@ void spinattack(fganon_class* i_this) { case 2: { if (i_this->m3A4[0] == 0) { anm_init(i_this, FGANON_BCK_KAITEN1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m388 = 3; + i_this->mMode = 3; i_this->speedF = 0.0f; fopAcM_monsSeStart(i_this, JA_SE_CV_PG_EBALL_FIRE_S, 0); } @@ -406,8 +406,8 @@ void spinattack(fganon_class* i_this) { i_this->current.angle.x = 0; pos_move(i_this, 1); if (i_this->mpMorf->isStop()) { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; } break; } @@ -420,22 +420,22 @@ void fly2(fganon_class* i_this) { fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); dBgS_LinChk linChk; - if ((((i_this->m384 & 0xF) == 0) && (cM_rndF(1.0f) < 0.5f)) || (i_this->m388 == -10)) { + if ((((i_this->m384 & 0xF) == 0) && (cM_rndF(1.0f) < 0.5f)) || (i_this->mMode == -10)) { i_this->m398 = player->shape_angle.y; } - switch (i_this->m388) { + switch (i_this->mMode) { case -10: deru_brk(i_this); i_this->current.pos = i_this->home.pos; i_this->current.pos.y = player->current.pos.y + l_HIO.m18; i_this->shape_angle.y = fopAcM_searchPlayerAngleY(a_this); - i_this->m388 = 1; + i_this->mMode = 1; anm_init(i_this, FGANON_BCK_WAIT1, 20.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->m3A4[1] = 40; break; case 0: anm_init(i_this, FGANON_BCK_WAIT1, 20.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->m388++; + i_this->mMode++; i_this->m3A0 = 0.0f; i_this->m3A4[1] = (short)(cM_rndF(50.0f) + 50.0f); // Fall-through @@ -469,13 +469,13 @@ void fly2(fganon_class* i_this) { fly_se_set(i_this); if (i_this->m3A4[1] == 0) { - i_this->m386 = 11; - i_this->m388 = 0; + i_this->mAction = 11; + i_this->mMode = 0; } if (i_this->m3A4[2] == 0) { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; } } @@ -568,7 +568,7 @@ void mahou_set(fganon_class* i_this) { void shot2(fganon_class* i_this) { cLib_addCalcAngleS2(&i_this->shape_angle.y, fopAcM_searchPlayerAngleY(i_this), 10, 0x400); int mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { anm_init(i_this, FGANON_BCK_TAME_S1, 5.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); for (int i = 0; i < 2; i++) { @@ -580,7 +580,7 @@ void shot2(fganon_class* i_this) { i_this->mEmitters2[0] = dComIfGp_particle_set(dPa_name::ID_SCENE_8218, &i_this->current.pos, NULL); i_this->mEmitters2[1] = dComIfGp_particle_set(dPa_name::ID_SCENE_8219, &i_this->current.pos, NULL); fopAcM_monsSeStart(i_this, JA_SE_CV_PG_EBALL_MAKE_L, 0); - i_this->m388++; + i_this->mMode++; // Fall-through } case 1: { @@ -593,7 +593,7 @@ void shot2(fganon_class* i_this) { if (i_this->mpMorf->isStop()) { anm_init(i_this, FGANON_BCK_TAME_S2, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->m3A4[0] = l_HIO.m3C; - i_this->m388++; + i_this->mMode++; for (int i = 0; i < 2; i++) { if (i_this->mEmitters2[i] != NULL) { i_this->mEmitters2[i]->becomeInvalidEmitter(); @@ -611,7 +611,7 @@ void shot2(fganon_class* i_this) { fopAcM_seStart(i_this, JA_SE_CM_PG_EBALL_MAKING_L, 0); if (i_this->m3A4[0] == 0) { anm_init(i_this, FGANON_BCK_NAGERU_S1, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m388++; + i_this->mMode++; i_this->mEmitters2[0] = dComIfGp_particle_set(dPa_name::ID_SCENE_821C, &i_this->current.pos, NULL); i_this->mEmitters2[1] = dComIfGp_particle_set(dPa_name::ID_SCENE_821D, &i_this->current.pos, NULL); } @@ -642,7 +642,7 @@ void shot2(fganon_class* i_this) { } if (i_this->mpMorf->isStop()) { i_this->m3A4[0] = 60; - i_this->m388 = 4; + i_this->mMode = 4; for (int i = 0; i < 2; i++) { if (i_this->mEmitters2[i] != NULL) { i_this->mEmitters2[i]->becomeInvalidEmitter(); @@ -657,8 +657,8 @@ void shot2(fganon_class* i_this) { anm_init(i_this, FGANON_BCK_WAIT1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } if (i_this->m3A4[0] == 0) { - i_this->m386 = 9; - i_this->m388 = 0; + i_this->mAction = 9; + i_this->mMode = 0; } break; } @@ -678,10 +678,10 @@ void spinattack2(fganon_class* i_this) { fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); dBgS_LinChk linChk; int mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { i_this->shape_angle.y = player->shape_angle.y + i_this->m68F * 0x3333; - i_this->m388 = 1; + i_this->mMode = 1; if (i_this->m68F == 0) { for (int i = 1; i < 5; i++) { fopAcM_create(PROC_FGANON, (i * 16) | 3, &i_this->current.pos, i_this->current.roomNo); @@ -698,7 +698,7 @@ void spinattack2(fganon_class* i_this) { MtxPosition(&offset, &transformedPos); i_this->current.pos = player->current.pos + transformedPos; anm_init(i_this, 10, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->m388 = 2; + i_this->mMode = 2; deru_brk(i_this); i_this->m38C = player->current.pos; } @@ -711,7 +711,7 @@ void spinattack2(fganon_class* i_this) { local_e4 = i_this->m38C - i_this->current.pos; if (local_e4.abs() < l_HIO.m38) { anm_init(i_this, 9, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m388 = 3; + i_this->mMode = 3; i_this->speedF = 0.0f; fopAcM_monsSeStart(i_this, JA_SE_CV_PG_EBALL_FIRE_S, 0); break; @@ -731,21 +731,21 @@ void spinattack2(fganon_class* i_this) { } if (i_this->mpMorf->isStop()) { if (i_this->m68F == 0) { - i_this->m388 = 4; + i_this->mMode = 4; i_this->m3A4[0] = 40; anm_init(i_this, FGANON_BCK_WAIT1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } else { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; } } break; } case 4: { if (i_this->m3A4[0] == 0) { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; } break; } @@ -756,17 +756,17 @@ void spinattack2(fganon_class* i_this) { /* 00003690-00003B3C .text down__FP12fganon_class */ void down(fganon_class* i_this) { - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { anm_init(i_this, 6, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m388++; + i_this->mMode++; i_this->speed.y = 0.0f; } case 1: { i_this->m3AE = 5; if (i_this->mAcch.ChkGroundHit()) { if (i_this->mpMorf->isStop()) { - i_this->m388++; + i_this->mMode++; anm_init(i_this, FGANON_BCK_TYAKUTI1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); } } @@ -775,7 +775,7 @@ void down(fganon_class* i_this) { } case 2: { if (i_this->mpMorf->isStop()) { - i_this->m388++; + i_this->mMode++; anm_init(i_this, 8, 2.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } break; @@ -789,7 +789,7 @@ void down(fganon_class* i_this) { } case 10: { anm_init(i_this, 7, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m388 = 2; + i_this->mMode = 2; } default: break; @@ -811,8 +811,8 @@ void down(fganon_class* i_this) { bVar3 = TRUE; } if ((i_this->m3A4[0] == 0) || bVar3) { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; if (i_this->m2BC != 0) { i_this->health = 100; } @@ -844,54 +844,54 @@ BOOL kabe_check(fganon_class* i_this) { /* 00004300-000044CC .text deru__FP12fganon_class */ void deru(fganon_class* i_this) { i_this->m3AE = 3; - switch(i_this->m388) { + switch(i_this->mMode) { case 0: if(l_HIO.m06 != 0) { if (l_HIO.m06 == 1) { - i_this->m386 = 5; - i_this->m388 = -10; + i_this->mAction = 5; + i_this->mMode = -10; i_this->m3A4[2] = l_HIO.m0A; } else if (l_HIO.m06 == 2) { - i_this->m386 = 7; - i_this->m388 = 0; + i_this->mAction = 7; + i_this->mMode = 0; } else if (l_HIO.m06 == 3) { - i_this->m386 = 9; - i_this->m388 = -10; + i_this->mAction = 9; + i_this->mMode = -10; i_this->m3A4[2] = l_HIO.m0A; } else if (l_HIO.m06 == 4) { - i_this->m386 = 10; - i_this->m388 = 0; + i_this->mAction = 10; + i_this->mMode = 0; } } else { if (i_this->m2BC == 0) { if (cM_rndF(1.0f) < 0.5f) { - i_this->m386 = 5; - i_this->m388 = -10; + i_this->mAction = 5; + i_this->mMode = -10; i_this->m3A4[2] = l_HIO.m0A; } else { - i_this->m386 = 7; - i_this->m388 = 0; + i_this->mAction = 7; + i_this->mMode = 0; } } else { if ((cM_rndF(1.0f) < 0.4f) && !kabe_check(i_this)) { - i_this->m386 = 10; - i_this->m388 = 0; + i_this->mAction = 10; + i_this->mMode = 0; } else { if (cM_rndF(1.0f) < 0.5f) { - i_this->m386 = 9; - i_this->m388 = -10; + i_this->mAction = 9; + i_this->mMode = -10; i_this->m3A4[2] = l_HIO.m0A; } else { - i_this->m386 = 5; - i_this->m388 = -10; + i_this->mAction = 5; + i_this->mMode = -10; i_this->m3A4[2] = l_HIO.m0A; } } @@ -904,19 +904,19 @@ void deru(fganon_class* i_this) { /* 000044CC-00004584 .text kieru__FP12fganon_class */ void kieru(fganon_class* i_this) { i_this->m3AE = 3; - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { if ((i_this->m408 == 1) || (i_this->m408 == 2)) { i_this->m408 = 35; } kieru_brk(i_this, 0); if (i_this->m68F != 0) { - i_this->m388 = 1; + i_this->mMode = 1; i_this->m3A4[0] = 30; } else { - i_this->m386 = 0; - i_this->m388 = 0; + i_this->mAction = 0; + i_this->mMode = 0; } break; } @@ -934,16 +934,16 @@ void fail(fganon_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; i_this->m3AE = 3; - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { kieru_brk(i_this, 1); - i_this->m388 = 1; + i_this->mMode = 1; anm_init(i_this, 7, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); break; } case 1: { if (i_this->mpMorf->isStop()) { - i_this->m388 = 2; + i_this->mMode = 2; i_this->m3A4[0] = 30; dBgS_LinChk linChk; @@ -1013,7 +1013,7 @@ void fail(fganon_class* i_this) { else { i_this->m698 = 0.0f; i_this->m3A4[0] = 0; - i_this->m388 = 3; + i_this->mMode = 3; } } } @@ -1023,7 +1023,7 @@ void fail(fganon_class* i_this) { if (i_this->m3A4[0] == 0) { kieru_brk(i_this, 2); i_this->m3A4[0] = 10; - i_this->m388 = 4; + i_this->mMode = 4; i_this->mBokoID = fopAcM_create(PROC_BOKO, 5, &i_this->current.pos, i_this->current.roomNo); } break; @@ -1052,7 +1052,7 @@ void fail(fganon_class* i_this) { void standby(fganon_class* i_this) { fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); i_this->m3AE = 3; - switch(i_this->m388) { + switch(i_this->mMode) { case -1: { if (i_this->m2BC == 2) { if (!dComIfGs_checkGetItem(dItem_LIGHT_ARROW_e)) { @@ -1069,7 +1069,7 @@ void standby(fganon_class* i_this) { float distXZ = std::sqrtf(xOffset * xOffset + zOffset * zOffset); if (distXZ < i_this->m2BD * 10.0f) { i_this->m3A4[0] = l_HIO.m08; - i_this->m388 = 1; + i_this->mMode = 1; fopAcM_OnStatus(i_this, fopAcStts_SHOWMAP_e); i_this->mB89 = 22; } @@ -1077,13 +1077,13 @@ void standby(fganon_class* i_this) { } case 0: { i_this->m3A4[0] = l_HIO.m08; - i_this->m388++; + i_this->mMode++; // fallthrough } case 1: { if (i_this->m3A4[0] == 0) { - i_this->m386 = 1; - i_this->m388 = 0; + i_this->mAction = 1; + i_this->mMode = 0; i_this->m69C = 0.0f; i_this->m698 = 0.0f; i_this->m694 = 0.0f; @@ -1101,13 +1101,13 @@ void start(fganon_class* i_this) { i_this->m3AE = 3; fopAcM_OffStatus(i_this, 0); i_this->attention_info.flags = 0; - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { offset = player->current.pos - i_this->home.pos; float distXZ = std::sqrtf(offset.x * offset.x + offset.z * offset.z); if (distXZ < i_this->m2BD * 10.0f) { i_this->mB54 = 1; - i_this->m388 = 1; + i_this->mMode = 1; anm_init(i_this, FGANON_BCK_WAIT1, 0.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); mDoAud_bgmAllMute(30); } @@ -1120,11 +1120,11 @@ void start(fganon_class* i_this) { case 2: { anm_init(i_this, FGANON_BCK_WARAU1, 5.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); fopAcM_monsSeStart(i_this, JA_SE_CV_PG_LAUGH_2, 0); - i_this->m388 = 3; + i_this->mMode = 3; break; } case 4: { - i_this->m388 = 5; + i_this->mMode = 5; i_this->m3A4[0] = REG0_S(0) + 0x50; anm_init(i_this, FGANON_BCK_TAME1, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } @@ -1162,9 +1162,9 @@ void end(fganon_class* i_this) { fopAcM_OffStatus(i_this, 0); i_this->attention_info.flags = 0; s32 mFrame = i_this->mpMorf->mFrameCtrl.getFrame(); - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { - i_this->m388 = 1; + i_this->mMode = 1; anm_init(i_this, FGANON_BCK_LAST_DAMAGE1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mB54 = 50; dComIfGs_onEventBit(0x3f20); // PG_DEFEATED? It appears further down in `energy_ball_move` @@ -1179,13 +1179,13 @@ void end(fganon_class* i_this) { deru_brk(i_this); anm_init(i_this, FGANON_BCK_WARAU1, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); fopAcM_monsSeStart(i_this, JA_SE_CV_PG_LAUGH_2, 0); - i_this->m388 = 3; + i_this->mMode = 3; break; } case 4: { deru_brk(i_this); anm_init(i_this, FGANON_BCK_SARU1, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->m388 = 5; + i_this->mMode = 5; i_this->speed.y = 0.0f; fopAcM_seStart(i_this, JA_SE_CM_PG_END_1, 0); } @@ -1199,7 +1199,7 @@ void end(fganon_class* i_this) { kieru_brk2(i_this); } if (mFrame == 48) { - i_this->m388 = 6; + i_this->mMode = 6; } } case 6: @@ -1214,9 +1214,9 @@ void last_end(fganon_class* i_this) { i_this->m3AE = 3; fopAcM_OffStatus(i_this, 0); i_this->attention_info.flags = 0; - switch(i_this->m388) { + switch(i_this->mMode) { case 0: { - i_this->m388 = 1; + i_this->mMode = 1; anm_init(i_this, FGANON_BCK_MOGAKU1, 2.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->mB54 = 100; i_this->m3C0 = 10000.0f; @@ -1225,7 +1225,7 @@ void last_end(fganon_class* i_this) { } case 1: { if (i_this->m3A4[1] == 0) { - i_this->m388 = 2; + i_this->mMode = 2; i_this->m3A4[1] = 20; i_this->m2D0 = 1; i_this->mB54++; @@ -1237,7 +1237,7 @@ void last_end(fganon_class* i_this) { cLib_addCalc2(&i_this->scale.z, 0.1f, 1.0f, 0.05f); cLib_addCalc2(&i_this->scale.y, 0.1f, 1.0f, 0.05f); if (i_this->m3A4[1] == 0) { - i_this->m388 = 3; + i_this->mMode = 3; i_this->m3A4[1] = 30; fopAcM_seStart(i_this, JA_SE_CM_L_ARROW_PASS_AWAY, 0); } @@ -1251,7 +1251,7 @@ void last_end(fganon_class* i_this) { i_this->scale.x = 0.0f; i_this->scale.y = 0.0f; i_this->scale.z = 0.0f; - i_this->m388 = 4; + i_this->mMode = 4; i_this->m3A4[1] = 30; } break; @@ -1270,7 +1270,7 @@ void last_end(fganon_class* i_this) { mBoko->setMatrix(i_this->mpKenModel->getBaseTRMtx()); if (i_this->m3A4[1] == 1) { fopAcM_cancelCarryNow(mBoko); - i_this->m388 = 5; + i_this->mMode = 5; i_this->mB54++; i_this->mB56 = 0; } @@ -1340,8 +1340,8 @@ void damage_check(fganon_class* i_this) { dComIfGp_particle_set(dPa_name::ID_COMMON_NORMAL_HIT, &i_this->eyePos, &local_a0, &local_44); dKy_SordFlush_set(i_this->eyePos, 1); - i_this->m386 = 22; - i_this->m388 = 0; + i_this->mAction = 22; + i_this->mMode = 0; i_this->m3AE = 1000; mDoAud_subBgmStop(); @@ -1364,8 +1364,8 @@ void damage_check(fganon_class* i_this) { i_this->speedF = 0.0f; } else { - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; if ((i_this->m408 == 1) || (i_this->m408 == 2)) { i_this->m408 = 35; } @@ -1408,8 +1408,8 @@ void damage_check(fganon_class* i_this) { dComIfGp_particle_set(dPa_name::ID_COMMON_NORMAL_HIT, &i_this->eyePos, &local_a0, &local_44); dKy_SordFlush_set(i_this->eyePos, 1); - i_this->m386 = 8; - i_this->m388 = 0; + i_this->mAction = 8; + i_this->mMode = 0; i_this->m3B0 = REG8_F(11) + 80.0f; i_this->m3B8 = REG8_S(2) + 7; @@ -1426,7 +1426,7 @@ void damage_check(fganon_class* i_this) { } } if (i_this->m68F) { - if ((i_this->mCyl.ChkTgHit()) || (master->m386 == 8)) { + if ((i_this->mCyl.ChkTgHit()) || (master->mAction == 8)) { mEmitter = dComIfGp_particle_set(dPa_name::ID_SCENE_826B, &i_this->current.pos, NULL); if (mEmitter != NULL) { mEmitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0)); @@ -1438,7 +1438,7 @@ void damage_check(fganon_class* i_this) { if ((i_this->mCyl.ChkTgHit()) || (i_this->m68C)) { i_this->m3AE = 6; if (i_this->mCyl.ChkTgHit()) { - if(((i_this->m386 == 8) || (i_this->m386 == 7)) || (i_this->m386 == 10)) { + if(((i_this->mAction == 8) || (i_this->mAction == 7)) || (i_this->mAction == 10)) { atInfo.mpObj = i_this->mCyl.GetTgHitObj(); pPos = i_this->mCyl.GetTgHitPosP(); atInfo.pParticlePos = pPos; @@ -1472,14 +1472,14 @@ void damage_check(fganon_class* i_this) { dComIfGp_particle_set(dPa_name::ID_COMMON_NORMAL_HIT, pPos, &local_a0, &local_44); - if ((i_this->m386 == 7) || (i_this->m386 == 10)) { - i_this->m386 = 8; - i_this->m388 = 0; + if ((i_this->mAction == 7) || (i_this->mAction == 10)) { + i_this->mAction = 8; + i_this->mMode = 0; } else if (i_this->m2BC == 0) { if (i_this->health <= 0) { - i_this->m386 = 21; - i_this->m388 = 0; + i_this->mAction = 21; + i_this->mMode = 0; i_this->m3AE = 1000; mDoAud_subBgmStop(); } @@ -1487,17 +1487,17 @@ void damage_check(fganon_class* i_this) { i_this->m690 -= atInfo.mDamage; if (i_this->m690 <= 0) { i_this->m690 = 10; - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; } else { - i_this->m388 = 10; + i_this->mMode = 10; } } } else if (i_this->m2BC == 1) { - i_this->m386 = 3; - i_this->m388 = 0; + i_this->mAction = 3; + i_this->mMode = 0; i_this->health = 0; mDoAud_subBgmStop(); } @@ -1519,8 +1519,8 @@ void damage_check(fganon_class* i_this) { dComIfGp_particle_set(dPa_name::ID_COMMON_NORMAL_HIT, &i_this->eyePos, &local_a0, &local_44); dKy_SordFlush_set(i_this->eyePos, 1); - i_this->m386 = 8; - i_this->m388 = 0; + i_this->mAction = 8; + i_this->mMode = 0; i_this->m3B0 = REG8_F(11) + 80.0f; i_this->m3B8 = REG8_S(2) + 7; @@ -1537,8 +1537,8 @@ void damage_check(fganon_class* i_this) { /* 00006288-00006560 .text move__FP12fganon_class */ s32 move(fganon_class* i_this) { int res = 0; - if (!dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e) && !dComIfGp_checkPlayerStatus0(0, daPyStts0_SWIM_e) && i_this->m386) { - if (i_this->m386 == 10) { + if (!dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e) && !dComIfGp_checkPlayerStatus0(0, daPyStts0_SWIM_e) && i_this->mAction) { + if (i_this->mAction == 10) { dCam_getBody()->SetTypeForce("P_Ganon3", NULL); } else if (i_this->m2BC != 1) { @@ -1548,17 +1548,17 @@ s32 move(fganon_class* i_this) { dCam_getBody()->SetTypeForce("P_Ganon2", NULL); } } - if ((i_this->m2BC == 0) && (i_this->m386 < 20)) { + if ((i_this->m2BC == 0) && (i_this->mAction < 20)) { fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); - if ((i_this->m386 == 0) && (player->current.pos.y < 710.0f)) { + if ((i_this->mAction == 0) && (player->current.pos.y < 710.0f)) { return 0; } - if ((i_this->m386 != 2) && (player->current.pos.y < 710.0f)) { - i_this->m386 = 2; - i_this->m388 = 0; + if ((i_this->mAction != 2) && (player->current.pos.y < 710.0f)) { + i_this->mAction = 2; + i_this->mMode = 0; } } - switch(i_this->m386) { + switch(i_this->mAction) { case 0: standby(i_this); break; @@ -1734,14 +1734,14 @@ void demo_camera(fganon_class* i_this) { cLib_addCalc2(&i_this->mB80, 0.1f, 1.0f, REG8_F(7) + 0.01f); } if (i_this->mB56 == 110) { - i_this->m388 = 2; + i_this->mMode = 2; } if (i_this->mB56 == 180) { - i_this->m388 = 4; + i_this->mMode = 4; } if (i_this->mB56 == 280) { - i_this->m386 = 6; - i_this->m388 = 1; + i_this->mAction = 6; + i_this->mMode = 1; i_this->m3A4[0] = 29; i_this->mB54 = 150; if (i_this->m2BF != 0xFF) { @@ -1822,7 +1822,7 @@ void demo_camera(fganon_class* i_this) { player->setPlayerPosAndAngle(&transformedPos, 0.0f); if (i_this->mB56 == 10) { - i_this->m388++; + i_this->mMode++; } i_this->current.pos.x = (i_this->mB68.x - 50.0f) + REG0_F(4); @@ -1859,7 +1859,7 @@ void demo_camera(fganon_class* i_this) { i_this->mB68 = i_this->eyePos; i_this->mB68.y -= REG0_F(11) + 30.0f; - i_this->m388++; + i_this->mMode++; } case 54: { cLib_addCalc2(&i_this->mB68.y, (i_this->eyePos.y - 30.0f) + REG0_F(11), 0.1f, 20.0f); @@ -2130,8 +2130,8 @@ void energy_ball_move(fganon_class* i_this) { if (i_this->m40A != 0) { return; } - i_this->m386 = 2; - i_this->m388 = 0; + i_this->mAction = 2; + i_this->mMode = 0; i_this->m40A = 50; return; } @@ -2283,10 +2283,10 @@ void energy_ball_move(fganon_class* i_this) { if (i_this->mBallAtSph.ChkAtHit() != 0) { atInfo.mpActor = i_this->mBallAtSph.GetAtHitObj()->GetAc(); - if ((atInfo.mpActor && (fopAcM_GetName(atInfo.mpActor) == PROC_PLAYER)) && (i_this->m386 != 22)) { + if ((atInfo.mpActor && (fopAcM_GetName(atInfo.mpActor) == PROC_PLAYER)) && (i_this->mAction != 22)) { i_this->m68B = 1; - i_this->m386 = 5; - i_this->m388 = 1; + i_this->mAction = 5; + i_this->mMode = 1; i_this->m3A4[1] = (cM_rndF(30.0f)) + 70.f; } } @@ -2336,7 +2336,7 @@ static BOOL daFganon_Execute(fganon_class* i_this) { fpcM_Search(&mahou_se_set, i_this); g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &i_this->current.pos, &i_this->tevStr); - if (((((i_this->m386 == 5) || (i_this->m386 == 9)) || (i_this->m386 == 7)) || (i_this->m386 == 10)) && ((i_this->m68B != 0 && (i_this->m68A == 0)))) { + if (((((i_this->mAction == 5) || (i_this->mAction == 9)) || (i_this->mAction == 7)) || (i_this->mAction == 10)) && ((i_this->m68B != 0 && (i_this->m68A == 0)))) { i_this->m68B = 0; anm_init(i_this, FGANON_BCK_WARAU1, 6.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->m68A = 60; @@ -2431,7 +2431,7 @@ static BOOL daFganon_Execute(fganon_class* i_this) { energy_ball_move(i_this); for (int i = 0; i < 2; i++) { - if ((i_this->mbIsMaterialized != 0) && (i_this->m386 != 22)) { + if ((i_this->mbIsMaterialized != 0) && (i_this->mAction != 22)) { if (i_this->mEmitters1[i] != NULL) { i_this->mEmitters1[i]->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(jno[i])); } @@ -2831,8 +2831,8 @@ static cPhs_State daFganon_Create(fopAc_ac_c* i_act) { if (i_this->m68F == 0) { master = i_this; if (i_this->m2BC == 0) { - i_this->m386 = 20; - i_this->m388 = 0; + i_this->mAction = 20; + i_this->mMode = 0; kieru_brk(i_this, 0); i_this->max_health = 30; i_this->health = 30; @@ -2841,14 +2841,14 @@ static cPhs_State daFganon_Create(fopAc_ac_c* i_act) { else { i_this->max_health = 100; i_this->health = 100; - i_this->m386 = 0; - i_this->m388= -1; + i_this->mAction = 0; + i_this->mMode= -1; } i_this->current.pos.y += 10000.0f; } else { - i_this->m386 = 10; - i_this->m388 = 0; + i_this->mAction = 10; + i_this->mMode = 0; deru_brk(i_this); } i_this->initBt(REG8_F(8) + 300.0f, 300.0f); diff --git a/src/d/actor/d_a_ks.cpp b/src/d/actor/d_a_ks.cpp index a327a69d7..7c9ed5c3c 100644 --- a/src/d/actor/d_a_ks.cpp +++ b/src/d/actor/d_a_ks.cpp @@ -186,25 +186,26 @@ BOOL tyaku_check(ks_class* i_this) { /* 00000788-0000087C .text ks_kuttuki_check__FP8ks_class */ BOOL ks_kuttuki_check(ks_class* i_this) { fopAc_ac_c* mAtHitAc; - if (i_this->mSph.ChkAtHit() && !i_this->mSph.ChkAtShieldHit() && (mAtHitAc = i_this->mSph.GetAtHitAc(), mAtHitAc) && mAtHitAc == dComIfGp_getLinkPlayer() && KUTTUKU_ALL_COUNT >= 0 && KUTTUKU_ALL_COUNT < 0x14 && GORON_COUNT == 0) { - i_this->mSph.OffTgSetBit(); - i_this->mSph.ClrCoSet(); - i_this->mSph.ClrTgHit(); + if (i_this->mSph.ChkAtHit() && !i_this->mSph.ChkAtShieldHit()) { + mAtHitAc = i_this->mSph.GetAtHitAc(); + if (mAtHitAc && mAtHitAc == dComIfGp_getLinkPlayer() && KUTTUKU_ALL_COUNT >= 0 && KUTTUKU_ALL_COUNT < 20 && GORON_COUNT == 0) { + i_this->mSph.OffTgSetBit(); + i_this->mSph.ClrCoSet(); + i_this->mSph.ClrTgHit(); - if (i_this->m2CF) { - i_this->m2CF = 0; + if (i_this->m2CF) { + i_this->m2CF = 0; - i_this->m52C.remove(); + i_this->m52C.remove(); + } + + i_this->mAction = 4; + i_this->mMode = 40; + + return TRUE; } - - i_this->m2CB = 4; - i_this->m2CC = 0x28; - - return TRUE; - } - else { - return FALSE; } + return FALSE; } /* 0000087C-000008F4 .text gm_birth_delet__FP8ks_class */ @@ -232,8 +233,8 @@ BOOL shock_damage_check(ks_class* i_this) { if (distXZ < 200.0f) { if (std::sqrtf(mSwordTopPos.y * mSwordTopPos.y) < 40.0f) { - i_this->m2CB = 3; - i_this->m2CC = 0x20; + i_this->mAction = 3; + i_this->mMode = 32; return TRUE; } @@ -263,28 +264,28 @@ BOOL body_atari_check(ks_class* i_this) { a_this->current.angle.y = fopAcM_searchPlayerAngleY(a_this) + 0x8000; - i_this->m2CB = 3; + i_this->mAction = 3; switch (mTgHitObj->GetAtType()) { case AT_TYPE_WIND: { a_this->current.angle.y = cM_atan2s(a_this->current.pos.x - mTgHitPos.x, a_this->current.pos.z - mTgHitPos.z); - i_this->m2CB = 2; - i_this->m2CC = 20; + i_this->mAction = 2; + i_this->mMode = 20; return FALSE; } case AT_TYPE_UNK8: { - i_this->m2CC = 0x20; + i_this->mMode = 32; a_this->health = 0; - i_this->m2CC = 30; + i_this->mMode = 30; return FALSE; } case AT_TYPE_SWORD: { - if (i_this->m2CC != 43 || i_this->m2CE) { + if (i_this->mMode != 43 || i_this->m2CE) { dScnPly_ply_c::setPauseTimer(2); a_this->stealItemBitNo = 1; } @@ -306,7 +307,7 @@ BOOL body_atari_check(ks_class* i_this) { a_this->stealItemBitNo = 1; - i_this->m2CC = 0x20; + i_this->mMode = 32; return TRUE; } @@ -343,12 +344,13 @@ BOOL body_atari_check(ks_class* i_this) { default: { mParticleScale.setall(REG8_F(0) + 0.8f); dComIfGp_particle_set(dPa_name::ID_COMMON_NORMAL_HIT, &mTgHitPos, &mpCurPlayerActor->shape_angle, &mParticleScale); + break; } } a_this->health = 0; - i_this->m2CC = 30; + i_this->mMode = 30; return TRUE; } @@ -379,7 +381,7 @@ void speed_keisan(ks_class* i_this, short i_speed) { void action_dousa_move(ks_class* i_this) { daPy_lk_c* link = daPy_getPlayerLinkActorClass(); - switch (i_this->m2CC) { + switch (i_this->mMode) { case 0: i_this->m30C = 0.0f; @@ -389,7 +391,8 @@ void action_dousa_move(ks_class* i_this) { i_this->m2F0[i] = 0; } - i_this->m2CC++; + i_this->mMode++; + // Fall-through case 1: cLib_addCalcAngleS2(&i_this->shape_angle.z, 0, 1, 0x1000); @@ -414,7 +417,8 @@ void action_dousa_move(ks_class* i_this) { i_this->current.angle.y = i_this->m2FC + fopAcM_searchPlayerAngleY(i_this); - i_this->m2CC++; + i_this->mMode++; + // Fall-through case 2: if (i_this->mAcch.ChkGroundHit()) { i_this->current.angle.y = i_this->m2FC + fopAcM_searchPlayerAngleY(i_this); @@ -426,8 +430,8 @@ void action_dousa_move(ks_class* i_this) { !dComIfGp_checkPlayerStatus0(0, daPyStts0_SWIM_e) && tyaku_check(i_this)) { - i_this->m2CB = 1; - i_this->m2CC = 10; + i_this->mAction = 1; + i_this->mMode = 10; return; } @@ -468,9 +472,10 @@ void action_dousa_move(ks_class* i_this) { if (fopAcM_searchActorDistance(i_this, dComIfGp_getPlayer(0)) < 500.0f) { i_this->current.angle.y = fopAcM_searchPlayerAngleY(i_this); } + break; } - if (i_this->m2CC == 2 || i_this->m2CC == 3) { + if (i_this->mMode == 2 || i_this->mMode == 3) { cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 1, 0x1000); } @@ -489,8 +494,8 @@ void action_kougeki_move(ks_class* i_this) { i_this->m31C = 60.0f; } - switch (i_this->m2CC) { - case 0xa: { + switch (i_this->mMode) { + case 10: { i_this->mSph.OffCoSetBit(); i_this->speedF = 26.0f; @@ -509,11 +514,11 @@ void action_kougeki_move(ks_class* i_this) { fopAcM_monsSeStart(i_this, JA_SE_CV_KS_ATTACK, 0); - i_this->m2CC++; + i_this->mMode++; break; } - case 0xb: { + case 11: { if (i_this->speedF > 0.0f && i_this->m2F0[1] == 0 && i_this->mSph.ChkAtShieldHit()) { i_this->gravity = -4.0f; i_this->speed.y = 25.0f; @@ -534,9 +539,10 @@ void action_kougeki_move(ks_class* i_this) { i_this->m2E8[2] = (s16)(cM_rndF(20.0f) + 20.0f); - i_this->m2CC++; + i_this->mMode++; + // Fall-through } - case 0xc: + case 12: ks_kuttuki_check(i_this); if (tyaku_check(i_this)) { @@ -549,9 +555,10 @@ void action_kougeki_move(ks_class* i_this) { if (i_this->m2E8[2] == 0) { i_this->speedF = 0.0f; i_this->m31C = 20.0f; - i_this->m2CB = 0; - i_this->m2CC = 0; + i_this->mAction = 0; + i_this->mMode = 0; } + break; } cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 1, 0x1000); @@ -563,8 +570,8 @@ void action_kougeki_move(ks_class* i_this) { /* 00001630-00001874 .text action_kaze_move__FP8ks_class */ void action_kaze_move(ks_class* i_this) { - switch (i_this->m2CC) { - case 0x14: { + switch (i_this->mMode) { + case 20: { for (int i = 0; i < 5; i++) { i_this->m2F0[i] = 0; } @@ -582,20 +589,21 @@ void action_kaze_move(ks_class* i_this) { i_this->m308 = 0.0f; - i_this->m2CC++; + i_this->mMode++; + // Fall-through } - case 0x15: { + case 21: { cLib_addCalc2(&i_this->speed.y, i_this->m314, 0.8f, i_this->m308); cLib_addCalc2(&i_this->m308, 5.0f, 1.0f, 0.5f); if (i_this->m310 + 200.0f < i_this->current.pos.y || i_this->m2E8[1] == 0) { - i_this->m2CC++; + i_this->mMode++; } break; } - case 0x16: { + case 22: { cLib_addCalc2(&i_this->gravity, -1.0f, 0.3f, 0.5f); if (i_this->speed.y < -2.0f) { @@ -611,10 +619,11 @@ void action_kaze_move(ks_class* i_this) { i_this->m30C = 2.0f; if (tyaku_check(i_this)) { - i_this->m2CB = 0; - i_this->m2CC = 0; + i_this->mAction = 0; + i_this->mMode = 0; return; } + break; } } @@ -670,8 +679,8 @@ void dead_eff_set(ks_class* i_this, cXyz* i_pos) { void action_dead_move(ks_class* i_this) { cXyz local_28; - switch (i_this->m2CC) { - case 0x1e: { + switch (i_this->mMode) { + case 30: { for (int i = 0; i < 5; i++) { i_this->m2F0[i] = 0; } @@ -686,14 +695,15 @@ void action_dead_move(ks_class* i_this) { i_this->gravity = -3.0f; i_this->speed.y = cM_rndF(5.0f) + 20.0f; - i_this->m2CC++; + i_this->mMode++; i_this->m2F0[1] = (s16)cM_rndFX(4096.0f); i_this->mSph.OffAtSPrmBit(cCcD_AtSPrm_Set_e); i_this->mSph.OffAtSPrmBit(cCcD_AtSPrm_Set_e); + // Fall-through } - case 0x1f: { + case 31: { i_this->shape_angle.z += i_this->m2F0[1]; if (tyaku_check(i_this)) { @@ -713,14 +723,16 @@ void action_dead_move(ks_class* i_this) { local_28 = i_this->current.pos; local_28.y += 20.0f; dead_eff_set(i_this, &local_28); + break; } } break; } - case 0x20: { + case 32: { local_28 = i_this->current.pos; local_28.y += 45.0f; dead_eff_set(i_this, &local_28); + break; } } } @@ -761,8 +773,8 @@ void action_omoi(ks_class* i_this) { link->onHeavyState(); } - switch (i_this->m2CC) { - case 0x28: { + switch (i_this->mMode) { + case 40: { i_this->m52C.remove(); a_this->speedF = 0.0f; @@ -774,7 +786,7 @@ void action_omoi(ks_class* i_this) { fopAcM_OffStatus(a_this, fopAcStts_UNK4000_e); - i_this->m2CC = 0x2a; + i_this->mMode = 42; break; } @@ -818,7 +830,8 @@ void action_omoi(ks_class* i_this) { fopAcM_setStageLayer(a_this); - i_this->m2CC++; + i_this->mMode++; + // Fall-through } case 0x29: { fopAcM_SetRoomNo(a_this, fopAcM_GetRoomNo(mpCurPlayerActor)); @@ -887,6 +900,7 @@ void action_omoi(ks_class* i_this) { i_this->m2D2 = 0; i_this->m300++; } + break; } } @@ -924,7 +938,7 @@ void action_omoi(ks_class* i_this) { i_this->m2F0[1] = 0; } - i_this->m2CC = 0x2a; + i_this->mMode = 42; return; } @@ -966,6 +980,7 @@ void action_omoi(ks_class* i_this) { break; case 2: GORON_COUNT = KUTTUKU_ALL_COUNT; + break; } if (GORON_COUNT == 0) { @@ -992,7 +1007,7 @@ void action_omoi(ks_class* i_this) { GORON_COUNT = KUTTUKU_ALL_COUNT; - i_this->m2CC = 0x2a; + i_this->mMode = 42; return; } @@ -1006,12 +1021,12 @@ void action_omoi(ks_class* i_this) { link->offHeavyState(); } - i_this->m2CC = 0x2a; + i_this->mMode = 42; } break; } - case 0x2a: { + case 42: { if (i_this->m528) { fopAcM_OffStatus(a_this, fopAcStts_UNK4000_e); @@ -1027,22 +1042,24 @@ void action_omoi(ks_class* i_this) { i_this->gravity = -3.0f; i_this->speed.y = 26.0f; - i_this->m2CC++; + i_this->mMode++; + // Fall-through } - case 0x2b: { + case 43: { if (i_this->mAcch.ChkGroundHit() || i_this->mAcch.ChkWaterIn()) { i_this->m2E8[2] = (s16)(cM_rndF(40.0f) + 40.0f); i_this->mSph.OnCoSetBit(); i_this->mSph.OnTgSetBit(); - i_this->m2CB = 1; - i_this->m2CC = 0xc; + i_this->mAction = 1; + i_this->mMode = 12; } + break; } } - if (i_this->m2CC == 0x2b && body_atari_check(i_this) && i_this->m2CE) { + if (i_this->mMode == 43 && body_atari_check(i_this) && i_this->m2CE) { fopAcM_seStart(a_this, JA_SE_LK_LAST_HIT, 0); i_this->m2CE = 0; } @@ -1065,8 +1082,8 @@ BOOL tsubo_search(void* param_1, void* param_2) { /* 000027A0-00002A40 .text action_tubo_search__FP8ks_class */ void action_tubo_search(ks_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; - switch (i_this->m2CC) { - case 0x32: { + switch (i_this->mMode) { + case 50: { i_this->mKsID = fpcM_ERROR_PROCESS_ID_e; fpcEx_Search((fpcLyIt_JudgeFunc)tsubo_search, a_this); @@ -1075,12 +1092,12 @@ void action_tubo_search(ks_class* i_this) { fopAcM_delete(a_this); } else { - i_this->m2CC++; + i_this->mMode++; } break; } - case 0x33: { + case 51: { fopAc_ac_c* mpCurrActor = (fopAc_ac_c*)fopAcM_SearchByID(i_this->mKsID); if (mpCurrActor) { @@ -1113,11 +1130,11 @@ void action_tubo_search(ks_class* i_this) { dComIfG_Ccsp()->Set(&i_this->mSph); - i_this->m2CC++; + i_this->mMode++; break; } - case 0x34: { + case 52: { i_this->mSph.SetC(a_this->current.pos); i_this->mSph.SetR(i_this->m31C); @@ -1143,14 +1160,15 @@ void action_tubo_search(ks_class* i_this) { } fopAcM_delete(a_this); + break; } } } /* 00002A40-00002BC4 .text action_kb_birth_check__FP8ks_class */ void action_kb_birth_check(ks_class* i_this) { - switch (i_this->m2CC) { - case 0x3c: { + switch (i_this->mMode) { + case 60: { i_this->current.pos.y += REG8_F(13) + 30.0f; i_this->current.angle.y = cM_rndFX(32767.0f); @@ -1158,9 +1176,10 @@ void action_kb_birth_check(ks_class* i_this) { i_this->speed.y = REG8_F(10) + 20.0f + cM_rndF(REG8_F(11) + 5.0f); i_this->gravity = -(REG8_F(12) + 2.0f); - i_this->m2CC++; + i_this->mMode++; + // Fall-through } - case 0x3d: { + case 61: { if (i_this->speed.y <= 0.0f && (i_this->mAcch.ChkGroundHit() || i_this->mAcch.GetGroundH() + (REG8_F(19) + 10.0f) > i_this->current.pos.y )) { fopAcM_OffStatus(i_this, fopAcStts_UNK4000_e); @@ -1168,9 +1187,10 @@ void action_kb_birth_check(ks_class* i_this) { i_this->gravity = 0.0f; i_this->speed.setall(0.0f); - i_this->m2CB = 0; - i_this->m2CC = 0; + i_this->mAction = 0; + i_this->mMode = 0; } + break; } } } @@ -1205,7 +1225,7 @@ static BOOL daKS_Execute(ks_class* i_this) { } } - if (i_this->mGmID != 0 && i_this->m2CB != 3) { + if (i_this->mGmID != 0 && i_this->mAction != 3) { fopAc_ac_c* mpGmActor = fopAcM_SearchByID(i_this->mGmID); bool bVar5 = false; @@ -1221,12 +1241,12 @@ static BOOL daKS_Execute(ks_class* i_this) { } if (bVar5) { - if (i_this->m2CB != 4) { - i_this->m2CB = 3; - i_this->m2CC = 30; + if (i_this->mAction != 4) { + i_this->mAction = 3; + i_this->mMode = 30; } else { - if (i_this->m2CC != 43) { + if (i_this->mMode != 43) { daPy_py_c* link = (daPy_py_c*)daPy_getPlayerLinkActorClass(); link->offHeavyState(); @@ -1236,14 +1256,14 @@ static BOOL daKS_Execute(ks_class* i_this) { i_this->m2F0[0] = 0; i_this->m2F0[1] = 0; - i_this->m2CC = 0x2a; + i_this->mMode = 42; } } } } } - switch(i_this->m2CB) { + switch(i_this->mAction) { case 0: action_dousa_move(i_this); ks_kuttuki_check(i_this); @@ -1295,7 +1315,7 @@ static BOOL daKS_Execute(ks_class* i_this) { i_this->speed.x = local_c.x; i_this->speed.z = local_c.z; - if (i_this->m2CC != 41 && !i_this->mAcch.ChkGroundHit() && !i_this->mAcch.ChkWaterIn()) { + if (i_this->mMode != 41 && !i_this->mAcch.ChkGroundHit() && !i_this->mAcch.ChkWaterIn()) { i_this->speed.y += i_this->gravity; if (i_this->speed.y < -20.0f) { @@ -1312,14 +1332,14 @@ static BOOL daKS_Execute(ks_class* i_this) { dComIfG_Ccsp()->Set(&i_this->mSph); - if (i_this->mSph.ChkCoSet() && (i_this->m2CB == 0 || i_this->m2CB == 2)) { + if (i_this->mSph.ChkCoSet() && (i_this->mAction == 0 || i_this->mAction == 2)) { fopAcM_posMove(i_this, i_this->mStts.GetCCMoveP()); } else { fopAcM_posMove(i_this, NULL); } - if (i_this->m2CC != 41) { + if (i_this->mMode != 41) { BG_check(i_this); naraku_check(i_this); } @@ -1588,8 +1608,8 @@ static cPhs_State daKS_Create(fopAc_ac_c* i_this) { a_this->mSph.OffCoSetBit(); a_this->mSph.ClrTgHit(); - a_this->m2CB = 10; - a_this->m2CC = 0x32; + a_this->mAction = 10; + a_this->mMode = 50; return res; } @@ -1597,15 +1617,15 @@ static cPhs_State daKS_Create(fopAc_ac_c* i_this) { if (a_this->m2C8 == 7) { fopAcM_OnStatus(i_this, fopAcStts_UNK4000_e); - a_this->m2CB = 0x14; - a_this->m2CC = 0x3c; + a_this->mAction = 20; + a_this->mMode = 60; return res; } if (a_this->m2C8 == 2) { - a_this->m2CB = 0; - a_this->m2CC = 3; + a_this->mAction = 0; + a_this->mMode = 3; fopAcM_SetGravity(i_this, -3.0f); diff --git a/src/d/actor/d_a_kt.cpp b/src/d/actor/d_a_kt.cpp index 350145177..d0c1608f8 100644 --- a/src/d/actor/d_a_kt.cpp +++ b/src/d/actor/d_a_kt.cpp @@ -74,20 +74,20 @@ void kotori_move(kt_class* i_this) { s16* r17; s16* r16; - switch (i_this->mState) { + switch (i_this->mMode) { case 0: i_this->mSpeedFwd = kt_scale * 20.0f + 30.0f; if (CPad_CHECK_TRIG_LEFT(0) && fopAcM_GetParam(i_this) == 1000) { i_this->mTargetPos.x = player->current.pos.x; i_this->mTargetPos.y = player->current.pos.y + 500.0f; i_this->mTargetPos.z = player->current.pos.z; - i_this->mState = 2; + i_this->mMode = 2; i_this->mSpeedLerp = 0.0f; break; } if (i_this->mTimer[2] == 0) { - i_this->mState = 1; + i_this->mMode = 1; offs.x = 0.0f; offs.y = 0.0f; offs.z = REG0_F(13) * 100.0f + 3000.0f; @@ -117,7 +117,7 @@ void kotori_move(kt_class* i_this) { case 1: dist = std::sqrtf(vx*vx + vy*vy + vz*vz); if (dist < REG0_F(1) * 10.0f + 800.0f) { - i_this->mState = 8; + i_this->mMode = 8; } cLib_addCalc2(&i_this->mSpeedLerp, 3.0f, 1.0f, 0.1f); calc_012: @@ -153,7 +153,7 @@ calc_012: cLib_addCalc2(&*r26, i_this->mGroundY, REG0_F(6) + 0.3f, REG0_F(7) + 20.0f); if (std::fabsf(*r26 - i_this->mGroundY) < 1.0f) { *r26 = i_this->mGroundY; - i_this->mState = 10; + i_this->mMode = 10; } dispWing = true; ret = 1; @@ -163,7 +163,7 @@ calc_012: i_this->mTargetPos.y += 200.0f; dist = std::sqrtf(vx*vx + vy*vy + vz*vz); if (dist < REG0_F(1) * 10.0f + 800.0f) { - i_this->mState = 9; + i_this->mMode = 9; } cLib_addCalc2(&i_this->mSpeedLerp, 3.0f, 1.0f, 0.1f); goto calc_012; @@ -184,7 +184,7 @@ calc_012: *r27 += pt.z; cLib_addCalc2(&*r26, i_this->mTargetPos.y, REG0_F(6) + 0.5f, REG0_F(7) + 20.0f); if (std::fabsf(*r26 - i_this->mTargetPos.y) < 1.0f) { - i_this->mState = 20; + i_this->mMode = 20; i_this->mSpeedLerp = 0.0f; } dispWing = true; @@ -200,7 +200,7 @@ calc_012: if (std::fabsf(*r26 - i_this->mTargetPos.y) > 1.0f) dispWing = true; if (CPad_CHECK_TRIG_LEFT(0)) { - i_this->mState = 0; + i_this->mMode = 0; i_this->mTimer[0] = 0; i_this->mLiftYTimer = cM_rndFX(10.0f) + 10.0f; i_this->mTargetPosHome.y += 2000.0f; @@ -219,7 +219,7 @@ calc_012: cLib_addCalcAngleS2(&i_this->current.angle.y, angleX, 10, (s16)(REG0_F(10) * 10.0f + 500.0f)); if (i_this->mTimer[1] == 0 && i_this->mLiftY <= 0.0f) { i_this->mTimer[1] = 20.0f + cM_rndF(20.0f); - i_this->mState = 11; + i_this->mMode = 11; } offs.x = 0.0f; offs.y = 0.0f; @@ -240,14 +240,14 @@ calc_012: } if (i_this->mTimer[1] == 0) { i_this->mTimer[1] = 20.0f + cM_rndF(50.0f); - i_this->mState = 10; + i_this->mMode = 10; i_this->mTargetPos.x = i_this->mTargetPosHome.x + cM_rndFX(1000.0f); i_this->mTargetPos.z = i_this->mTargetPosHome.z + cM_rndFX(1000.0f); } calc_11: *r26 -= 5.0f; if (!i_this->mHitGround || dist_xz < (REG0_F(15) * 100.0f + 1500.0f)) { - i_this->mState = 0; + i_this->mMode = 0; i_this->mTimer[0] = 0; i_this->mLiftYTimer = 10.0f + cM_rndFX(10.0f); i_this->mTargetPosHome.y += 2000.0f; @@ -258,7 +258,7 @@ calc_11: } i_this->mHitGround = false; - if (i_this->mState >= 8) { + if (i_this->mMode >= 8) { Vec pos; pos.x = *r28; pos.y = *r26; diff --git a/src/d/actor/d_a_kytag00.cpp b/src/d/actor/d_a_kytag00.cpp index 2cdec50ff..8703a4363 100644 --- a/src/d/actor/d_a_kytag00.cpp +++ b/src/d/actor/d_a_kytag00.cpp @@ -151,9 +151,8 @@ void raincnt_set(f32 count) { s32 newCount = 0; if (dKy_checkEventNightStop()) { - s32 newCount2; - if (g_env_light.mRainCount < (newCount2 = (count * count * count) * 250.0f)) - newCount = newCount2; + if (g_env_light.mRainCount < (s32)((count * count * count) * 250.0f)) + newCount = (count * count * count) * 250.0f; } else { newCount = (count * count * count) * 250.0f; } diff --git a/src/d/actor/d_a_npc_bs1.cpp b/src/d/actor/d_a_npc_bs1.cpp index 80c5ba201..133910b97 100644 --- a/src/d/actor/d_a_npc_bs1.cpp +++ b/src/d/actor/d_a_npc_bs1.cpp @@ -980,206 +980,204 @@ u32 daNpc_Bs1_c::getMsg() { msgNo = m740; m740 = 0; } - else { - if(dComIfGp_event_chkTalkXY()) { - u8 itemNo = dComIfGp_event_getPreItemNo(); + else if(dComIfGp_event_chkTalkXY()) { + u8 itemNo = dComIfGp_event_getPreItemNo(); - if(mType == 0) { - if(isEmono(itemNo)) { - m840 = itemNo; - switch(itemNo) { - case dItem_BOKOBABA_SEED_e: - msgNo = 0xF78; + if(mType == 0) { + if(isEmono(itemNo)) { + m840 = itemNo; + switch(itemNo) { + case dItem_BOKOBABA_SEED_e: + msgNo = 0xF78; + break; + case dItem_SKULL_NECKLACE_e: + msgNo = 0xF80; + break; + case dItem_RED_JELLY_e: + msgNo = 0xF85; + break; + case dItem_GREEN_JELLY_e: + msgNo = 0xF8A; + break; + case dItem_BLUE_JELLY_e: + msgNo = 0xF8F; + break; + case dItem_JOY_PENDANT_e: + msgNo = 0xF94; + break; + case dItem_GOLDEN_FEATHER_e: + msgNo = 0xF99; + break; + default: + if(dComIfGs_getEventReg(0x7F0F) < 10) { + msgNo = 0xF9E; break; - case dItem_SKULL_NECKLACE_e: - msgNo = 0xF80; - break; - case dItem_RED_JELLY_e: - msgNo = 0xF85; - break; - case dItem_GREEN_JELLY_e: - msgNo = 0xF8A; - break; - case dItem_BLUE_JELLY_e: - msgNo = 0xF8F; - break; - case dItem_JOY_PENDANT_e: - msgNo = 0xF94; - break; - case dItem_GOLDEN_FEATHER_e: - msgNo = 0xF99; - break; - default: - if(dComIfGs_getEventReg(0x7F0F) < 10) { - msgNo = 0xF9E; - break; - } + } - msgNo = 0xFD4; - break; - } - } - else if(itemNo == KAISEN_PRESENT1) { - msgNo = 0xF6F; - } - else if(itemNo == KAISEN_PRESENT2) { - msgNo = 0xF73; - } - else { - msgNo = 0xF75; + msgNo = 0xFD4; + break; } } - else if(itemNo == KAISEN_PRESENT1 || itemNo == KAISEN_PRESENT2) { - msgNo = 0x2F56; + else if(itemNo == KAISEN_PRESENT1) { + msgNo = 0xF6F; } - else if(isEmono(itemNo)) { - msgNo = 0x2F79; + else if(itemNo == KAISEN_PRESENT2) { + msgNo = 0xF73; } else { - msgNo = 0x2F57; + msgNo = 0xF75; } } - else if(mType == 0) { - u8 points = dComIfGs_getEventReg(0x86FF); - if(mShopItems.isSoldOutItemAll()) { - msgNo = 0xF3D; - } - else if(dComIfGs_checkGetItem(dItem_BOMB_BAG_e) && !dComIfGs_isEventBit(0x1F20) && isSellBomb()) { - dComIfGs_onEventBit(0x1F20); - m837 = 1; - msgNo = 0xF55; - } - else if(m837) { - msgNo = 0xF58; - } - else if(points >= 60) { - if(m836) { - msgNo = 0xF5D; - } - else { - msgNo = 0xF5C; - m836 = 1; - } - } - else if(points != 0) { - if(m836) { - msgNo = 0xF5B; - } - else { - msgNo = 0xF5A; - m836 = 1; - } - } - else if(m836) { - msgNo = 0xF41; - } - else { - m836 = 1; - msgNo = 0xF3D; - } + else if(itemNo == KAISEN_PRESENT1 || itemNo == KAISEN_PRESENT2) { + msgNo = 0x2F56; } - else if(mShopItems.isSoldOutItemAll()) { - msgNo = 0x2F62; + else if(isEmono(itemNo)) { + msgNo = 0x2F79; + } + else { + msgNo = 0x2F57; + } + } + else if(mType == 0) { + u8 points = dComIfGs_getEventReg(0x86FF); + if(mShopItems.isSoldOutItemAll()) { + msgNo = 0xF3D; } else if(dComIfGs_checkGetItem(dItem_BOMB_BAG_e) && !dComIfGs_isEventBit(0x1F20) && isSellBomb()) { dComIfGs_onEventBit(0x1F20); m837 = 1; - msgNo = 0x2F64; + msgNo = 0xF55; } else if(m837) { - msgNo = 0x2F67; + msgNo = 0xF58; } - else if(dComIfGs_isEventBit(0x1F08)) { - if(dComIfGs_isEventBit(0x2040)) { - if(m838 == 1) { - msgNo = 0x2F60; - } - else { - msgNo = 0x2F61; - } + else if(points >= 60) { + if(m836) { + msgNo = 0xF5D; } else { - dComIfGs_onEventBit(0x2040); - msgNo = 0x2F5F; - m838 = 1; + msgNo = 0xF5C; + m836 = 1; + } + } + else if(points != 0) { + if(m836) { + msgNo = 0xF5B; + } + else { + msgNo = 0xF5A; + m836 = 1; + } + } + else if(m836) { + msgNo = 0xF41; + } + else { + m836 = 1; + msgNo = 0xF3D; + } + } + else if(mShopItems.isSoldOutItemAll()) { + msgNo = 0x2F62; + } + else if(dComIfGs_checkGetItem(dItem_BOMB_BAG_e) && !dComIfGs_isEventBit(0x1F20) && isSellBomb()) { + dComIfGs_onEventBit(0x1F20); + m837 = 1; + msgNo = 0x2F64; + } + else if(m837) { + msgNo = 0x2F67; + } + else if(dComIfGs_isEventBit(0x1F08)) { + if(dComIfGs_isEventBit(0x2040)) { + if(m838 == 1) { + msgNo = 0x2F60; + } + else { + msgNo = 0x2F61; } } else { - switch(dComIfGs_getEventReg(0xBB07)) { - case 0: - if(m836 || dComIfGs_isEventBit(0x1F10)) { - msgNo = 0x2F46; - break; - } - - dComIfGs_onEventBit(0x1F10); - msgNo = 0x2F45; - break; - case 1: - if(m836) { - msgNo = 0x2F46; - break; - } - - msgNo = 0x2F58; - break; - case 2: - if(m836) { - msgNo = 0x2F46; - break; - } - - msgNo = 0x2F59; - break; - case 3: - if(m836) { - msgNo = 0x2F46; - break; - } - - msgNo = 0x2F5A; - break; - case 4: - if(m836) { - msgNo = 0x2F46; - break; - } - - msgNo = 0x2F5B; - break; - case 5: - if(m836) { - msgNo = 0x2F46; - break; - } - - msgNo = 0x2F5C; - break; - case 6: - if(m836) { - msgNo = 0x2F69; - break; - } - - msgNo = 0x2F5D; - break; - case 7: - if(m836) { - msgNo = 0x2F6A; - break; - } - - msgNo = 0x2F5E; - break; - } - - if(dComIfGs_isEventBit(0x1F10)) { - dComIfGs_onEventBit(0x1F10); - } - - m836 = 1; + dComIfGs_onEventBit(0x2040); + msgNo = 0x2F5F; + m838 = 1; } } + else { + switch(dComIfGs_getEventReg(0xBB07)) { + case 0: + if(m836 || dComIfGs_isEventBit(0x1F10)) { + msgNo = 0x2F46; + break; + } + + dComIfGs_onEventBit(0x1F10); + msgNo = 0x2F45; + break; + case 1: + if(m836) { + msgNo = 0x2F46; + break; + } + + msgNo = 0x2F58; + break; + case 2: + if(m836) { + msgNo = 0x2F46; + break; + } + + msgNo = 0x2F59; + break; + case 3: + if(m836) { + msgNo = 0x2F46; + break; + } + + msgNo = 0x2F5A; + break; + case 4: + if(m836) { + msgNo = 0x2F46; + break; + } + + msgNo = 0x2F5B; + break; + case 5: + if(m836) { + msgNo = 0x2F46; + break; + } + + msgNo = 0x2F5C; + break; + case 6: + if(m836) { + msgNo = 0x2F69; + break; + } + + msgNo = 0x2F5D; + break; + case 7: + if(m836) { + msgNo = 0x2F6A; + break; + } + + msgNo = 0x2F5E; + break; + } + + if(dComIfGs_isEventBit(0x1F10)) { + dComIfGs_onEventBit(0x1F10); + } + + m836 = 1; + } return msgNo; } diff --git a/src/d/actor/d_a_npc_ji1.cpp b/src/d/actor/d_a_npc_ji1.cpp index 831fcc493..7ebed8b0a 100644 --- a/src/d/actor/d_a_npc_ji1.cpp +++ b/src/d/actor/d_a_npc_ji1.cpp @@ -2853,151 +2853,151 @@ BOOL daNpc_Ji1_c::setAnm(int param_1, f32 param_2, int param_3) { fopAcM_seStart(this, JA_SE_CM_JI_DEFENSE, 0); } - J3DAnmTransform* temp1; - s32 temp2; + J3DAnmTransform* bckAnm; + s32 loopMode; void* pSoundAnimRes; switch(param_1) { case 0: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_WAIT01)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_WAIT01)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_WAIT01); break; case 1: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_WAIT02)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_WAIT02)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_WAIT02); break; case 2: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TALK01)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TALK01)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_TALK01); break; case 3: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TALK02)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TALK02)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_TALK02); break; case 4: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_AKIRE)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_AKIRE)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_AKIRE); break; case 5: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_KAMAE)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_KAMAE)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_KAMAE); break; case 6: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_KROT)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_KROT)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_KROT); speed = l_HIO.field_0x48; break; case 7: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_INASI)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_INASI)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_INASI); speed = l_HIO.field_0x44; break; case 8: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TATEGUARD)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TATEGUARD)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_TATEGUARD); break; case 9: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_YKGUARD)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_YKGUARD)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_YKGUARD); break; case 10: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_JPGUARD)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_JPGUARD)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_JPGUARD); break; case 11: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TOKAMAE)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TOKAMAE)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_TOKAMAE); break; case 12: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_REI)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_REI)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_REI); break; case 13: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_WARAI)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_WARAI)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_WARAI); speed = l_HIO.field_0x4C; break; case 14: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_JPGUARD)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_JPGUARD)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_JPGUARD); speed = 2.0f; break; case 15: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_GUARD)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_GUARD)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_GUARD); speed = 2.0f; break; case 16: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_BTKAMASI)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_BTKAMASI)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_BTKAMASI); break; case 17: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_BTKAMAE)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_BTKAMAE)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_BTKAMAE); break; case 18: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_UDEGUMI)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_UDEGUMI)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_UDEGUMI); break; case 19: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TATEATTACK)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_TATEATTACK)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_TATEATTACK); break; case 20: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_YOKOATTACK)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_YOKOATTACK)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_YOKOATTACK); break; case 21: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_ODOROKU)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_ODOROKU)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_ODOROKU); break; case 22: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_BIBIRI)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_BIBIRI)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_BIBIRI); BackSlideInit(); @@ -3007,8 +3007,8 @@ BOOL daNpc_Ji1_c::setAnm(int param_1, f32 param_2, int param_3) { break; case 23: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_NAKU)); - temp2 = 2; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_NAKU)); + loopMode = J3DFrameCtrl::EMode_LOOP; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_NAKU); if(field_0x430 == 0) { @@ -3018,14 +3018,14 @@ BOOL daNpc_Ji1_c::setAnm(int param_1, f32 param_2, int param_3) { break; case 24: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_NUGUI)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_NUGUI)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_NUGUI); break; case 25: - temp1 = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_DAMAGE)); - temp2 = 0; + bckAnm = static_cast(dComIfG_getObjectRes("Ji", JI_BCK_JI_DAMAGE)); + loopMode = J3DFrameCtrl::EMode_NONE; pSoundAnimRes = dComIfG_getObjectRes("Ji", JI_BAS_JI_DAMAGE); break; @@ -3033,7 +3033,7 @@ BOOL daNpc_Ji1_c::setAnm(int param_1, f32 param_2, int param_3) { return 0; } - field_0x330->setAnm(temp1, temp2, param_2, speed, 0.0f, -1.0f, pSoundAnimRes); + field_0x330->setAnm(bckAnm, loopMode, param_2, speed, 0.0f, -1.0f, pSoundAnimRes); if(field_0xD64 == 0x13) { mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Ji", JI_BCK_JIYARI_TATEATTACK), J3DFrameCtrl::EMode_LOOP, 0.0f, 1.0f, 0.0f, -1.0f, NULL); } diff --git a/src/d/actor/d_a_pw.cpp b/src/d/actor/d_a_pw.cpp index b941743ec..6056148a8 100644 --- a/src/d/actor/d_a_pw.cpp +++ b/src/d/actor/d_a_pw.cpp @@ -174,11 +174,11 @@ void action_dousa(pw_class* i_this) { daPy_py_c* player = daPy_getPlayerActorClass(); camera_class* camera = dComIfGp_getCamera(0); cXyz camfwd; - switch (i_this->mState) { + switch (i_this->mMode) { case 0: anm_init(i_this, PW_BCK_WAIT1, 7.0, J3DFrameCtrl::EMode_LOOP, 1.0, -1); i_this->m346 = 0; - i_this->mState += 1; + i_this->mMode += 1; break; case 1: if (fopAcM_searchPlayerDistance(i_this) < 500.0f) { @@ -188,7 +188,7 @@ void action_dousa(pw_class* i_this) { i_this->shape_angle.y = i_this->m38C; i_this->m3A4 = -80.0f; i_this->m340 = 1; - i_this->mState += 1; + i_this->mMode += 1; } break; case 2: @@ -207,13 +207,13 @@ void action_dousa(pw_class* i_this) { particle->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(0x17)); // j_pw_item_r1 joint } i_this->attention_info.flags = 0; - i_this->mState = 0x0A; + i_this->mMode = 0x0A; } break; case 9: i_this->m39A = 0; i_this->m39C = 0; - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 10: if (i_this->mBehaviorType == InvisibleAtStart) { @@ -224,15 +224,15 @@ void action_dousa(pw_class* i_this) { i_this->m382 = 5; switch (i_this->mBehaviorType) { case InvisibleAtStart: - i_this->mState = 0xB; + i_this->mMode = 0xB; break; case OnlyLanternVisibleAtStart: i_this->m341 = 2; - i_this->mState = 8; + i_this->mMode = 8; break; default: i_this->m346 = 1; - i_this->mState = 0xD; + i_this->mMode = 0xD; break; } } @@ -256,7 +256,7 @@ void action_dousa(pw_class* i_this) { first_mode_change(i_this); i_this->m382 = 3; i_this->m346 = 1; - i_this->mState = 0xD; + i_this->mMode = 0xD; } } break; @@ -269,7 +269,7 @@ void action_dousa(pw_class* i_this) { i_this->mBehaviorType = VisibleFromStart; i_this->m346 = 1; first_mode_change(i_this); - i_this->mState = 0xD; + i_this->mMode = 0xD; } break; case 7: @@ -278,7 +278,7 @@ void action_dousa(pw_class* i_this) { i_this->current.angle.y = i_this->m38C; i_this->shape_angle.y = i_this->m38C; anm_init(i_this, PW_BCK_DERUB2, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mState = 6; + i_this->mMode = 6; } break; case 8: @@ -286,7 +286,7 @@ void action_dousa(pw_class* i_this) { i_this->m346 = 1; if (fopAcM_searchPlayerDistance(i_this) < i_this->m3AC) { anm_init(i_this, PW_BCK_DERUB1, 3.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); - i_this->mState = 7; + i_this->mMode = 7; } break; case 13: @@ -301,14 +301,14 @@ void action_dousa(pw_class* i_this) { } else if (i_this->mBckIdx != PW_BCK_WAIT2) { anm_init(i_this, PW_BCK_WAIT2, 7.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); } - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 14: cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); if (i_this->m378) { break; } - i_this->mState += 1; + i_this->mMode += 1; // Fall-through case 15: i_this->m378 = cM_rndF(120.0f) + 120.0f; @@ -323,9 +323,9 @@ void action_dousa(pw_class* i_this) { } i_this->m38C += (s16)cM_rndFX(16384.0f); if (i_this->mPathIndex != 0xFF && i_this->mpPath != NULL) { - i_this->mState = 0x14; + i_this->mMode = 0x14; } else { - i_this->mState = 0x10; + i_this->mMode = 0x10; } break; case 16: @@ -335,7 +335,7 @@ void action_dousa(pw_class* i_this) { if (Line_check(i_this, i_this->current.pos, 0) || hani_check(i_this)) { i_this->m37A = 10; } else if (i_this->m378 == 0) { - i_this->mState = 0xF; + i_this->mMode = 0xF; } } break; @@ -361,14 +361,14 @@ void action_dousa(pw_class* i_this) { i_this->m38C = fopAcM_searchPlayerAngleY(i_this); anm_init(i_this, PW_BCK_DAMAGE_K1, 9.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); i_this->speedF = -2.0f; - i_this->mState += 1; + i_this->mMode += 1; break; case 26: break; case 27: case 28: if (!fopAcM_CheckStatus(i_this, fopAcStts_HOOK_CARRY_e)) { - i_this->mState = 0x5A; + i_this->mMode = 0x5A; } break; case 101: @@ -385,12 +385,12 @@ void action_dousa(pw_class* i_this) { break; case 100: anm_init(i_this, PW_BCK_JITTAIKA1, 6.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mState += 1; + i_this->mMode += 1; break; case 110: anm_init(i_this, PW_BCK_ATTACK1, 7.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); // TODO - i_this->mState += 1; + i_this->mMode += 1; break; case 111: if (i_this->m5C4.getEmitter() != NULL) { @@ -404,30 +404,30 @@ void action_dousa(pw_class* i_this) { i_this->speed.setall(0.0f); i_this->gravity = 0.0f; anm_init(i_this, PW_BCK_SIRIMOTI1, 0.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); - i_this->mState += 1; + i_this->mMode += 1; case 112: // Fall-through if (i_this->mpMorf->isStop()) { - i_this->mState = 90; + i_this->mMode = 90; } break; } - if (i_this->mState <= 11) { + if (i_this->mMode <= 11) { return; } - if (i_this->m37C == 0 && i_this->mState < 90) { - if (i_this->mState == 14 || i_this->mState == 16 || i_this->mState == 20) { + if (i_this->m37C == 0 && i_this->mMode < 90) { + if (i_this->mMode == 14 || i_this->mMode == 16 || i_this->mMode == 20) { if (!hani_check(i_this) && fopAcM_searchPlayerDistance(i_this) < 500.0f && std::fabsf(i_this->current.pos.y - player->current.pos.y) < 100.0f) { if (!Line_check(i_this, i_this->current.pos, 1) && (i_this->m346 == 1 || !TORITUKI_ON)) { i_this->mAction = 1; - i_this->mState = 30; + i_this->mMode = 30; } } } } - if (i_this->mState >= 10 && i_this->mState < 90) { + if (i_this->mMode >= 10 && i_this->mMode < 90) { alpha_anime(i_this); } diff --git a/src/d/actor/d_a_rd.cpp b/src/d/actor/d_a_rd.cpp index dc593358e..adb0886d1 100644 --- a/src/d/actor/d_a_rd.cpp +++ b/src/d/actor/d_a_rd.cpp @@ -601,7 +601,7 @@ bool daRd_c::checkTgHit() { case AT_TYPE_FIRE: case AT_TYPE_UNK20000: r29 = false; - if (mEnemyFire.mState == 0) { + if (mEnemyFire.mMode == 0) { mEnemyFire.mFireDuration = l_HIO.m4C; } else { mHitType = 0xD; @@ -887,7 +887,7 @@ void daRd_c::modeMove() { temp = 0.1f; } f32 temp2 = l_HIO.m68; - if (mEnemyFire.mState != 0) { + if (mEnemyFire.mMode != 0) { temp2 *= 2.0f; } cLib_addCalc2(&speedF, temp2*temp, 0.1f, 0.1f + REG12_F(0)); @@ -943,7 +943,7 @@ void daRd_c::modeCry() { temp = 0.1f; } f32 temp2 = l_HIO.m68; - if (mEnemyFire.mState != 0) { + if (mEnemyFire.mMode != 0) { temp2 *= 2.0f; } cLib_addCalc2(&speedF, temp2*temp, 0.1f, 0.1f + REG12_F(0)); @@ -1592,7 +1592,7 @@ bool daRd_c::_execute() { } current.angle = shape_angle; - if (mEnemyFire.mState == 0) { // Not on fire (TODO enum) + if (mEnemyFire.mMode == 0) { // Not on fire (TODO enum) mCyl.SetAtType(0); m6D4 = l_HIO.m4E; } else {