diff --git a/include/SSystem/SComponent/c_cc_d.h b/include/SSystem/SComponent/c_cc_d.h index 9252ad2048..f8802dfc25 100644 --- a/include/SSystem/SComponent/c_cc_d.h +++ b/include/SSystem/SComponent/c_cc_d.h @@ -379,6 +379,7 @@ public: void OnTgNoSlingHitInfSet() { mObjTg.OnSPrmBit(0x40); } void OnAtVsBitSet(u32 prm) { mObjAt.OnSPrmBit(prm); } void OffAtVsBitSet(u32 prm) { mObjAt.OffSPrmBit(prm); } + void OffTgNoAtHitInfSet() { mObjTg.OffSPrmBit(0x20); } }; // Size = 0x40 diff --git a/include/d/d_cc_d.h b/include/d/d_cc_d.h index d6bc45c1c0..8a8e07215d 100644 --- a/include/d/d_cc_d.h +++ b/include/d/d_cc_d.h @@ -417,7 +417,6 @@ public: bool ChkTgHookshotThrough() { return mGObjTg.ChkSPrm(0x80); } void OffTgHookShotNoHitMark() {mGObjTg.OffSPrm(0x400);} bool ChkTgShieldHit() { return mGObjTg.ChkRPrm(2); } - void OffTgNoAtHitInfSet() { mObjTg.OffSPrmBit(0x20); } bool ChkTgSpinnerReflect() { return mGObjTg.ChkSPrm(0x200); } static const Z2SoundID m_hitSeID[24]; diff --git a/include/d/d_event.h b/include/d/d_event.h index 309314b282..2d364fe004 100644 --- a/include/d/d_event.h +++ b/include/d/d_event.h @@ -128,7 +128,11 @@ public: u8 getMode() const { return mMode; } void onHindFlag(u16 flag) { mHindFlag |= flag; } + #ifdef DEBUG + void offHindFlag(u16 flag) { mHindFlag &= (u16)~flag; } + #else void offHindFlag(u16 flag) { mHindFlag &= ~flag; } + #endif u16 checkHind(u16 flag) { return flag & mHindFlag; } u8 checkCompulsory() { return mCompulsory; } diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index fe05200d8c..03d840ffd3 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -314,7 +314,7 @@ public: BOOL checkWolfBiteDamage() const { return mFlags & fopEn_flag_WolfBiteDamage; } bool checkWolfDownPullFlg() const { return mFlags & fopEn_flag_WolfDownPull; } bool checkDownFlg() { return mFlags & fopEn_flag_Down; } - bool checkCutDownHitFlg() const { return mFlags & fopEn_flag_CutDownHit; } + BOOL checkCutDownHitFlg() const { return mFlags & fopEn_flag_CutDownHit; } bool checkWolfDownStartFlg() const { return mFlags & fopEn_flag_WolfDownStart; } bool checkDeadFlg() const { return mFlags & fopEn_flag_Dead; } BOOL checkThrowMode(u8 param_1) const { return mThrowMode & param_1; } @@ -329,8 +329,13 @@ public: void onWolfDownStartFlg() { mFlags |= (fopEn_flag_WolfDownPull | fopEn_flag_WolfDownStart); } void onWolfDownPullEndFlg() { mFlags |= fopEn_flag_WolfDownPullEnd; } void onWolfNoLock() { mFlags |= (u16)fopEn_flag_WolfNoLock; } + #if DEBUG + void onDownFlg() { mFlags |= (u16)fopEn_flag_Down; } + void onHeadLockFlg() { mFlags |= (u16)fopEn_flag_HeadLock; } + #else void onDownFlg() { mFlags |= fopEn_flag_Down; } void onHeadLockFlg() { mFlags |= fopEn_flag_HeadLock; } + #endif #if DEBUG void offWolfBiteDamage() { mFlags &= (u16)~fopEn_flag_WolfBiteDamage; } @@ -339,16 +344,15 @@ public: #endif void offCutDownHitFlg() { mFlags &= ~fopEn_flag_CutDownHit; } void offWolfDownPullFlg() { mFlags &= ~fopEn_flag_WolfDownPull; } - void offDownFlg() { mFlags &= ~(fopEn_flag_WolfDownPull | fopEn_flag_WolfDownStart | fopEn_flag_CutDownHit | fopEn_flag_Down); } #if DEBUG + void offDownFlg() { mFlags &= (u16)~(fopEn_flag_WolfDownPull | fopEn_flag_WolfDownStart | fopEn_flag_CutDownHit | fopEn_flag_Down); } void offWolfNoLock() { mFlags &= (u16)~fopEn_flag_WolfNoLock; } - #else - void offWolfNoLock() { mFlags &= ~fopEn_flag_WolfNoLock; } - #endif - void offHeadLockFlg() { mFlags &= ~fopEn_flag_HeadLock; } - #if DEBUG + void offHeadLockFlg() { mFlags &= (u16)~fopEn_flag_HeadLock; } void offThrowMode(u8 throwMode) { mThrowMode &= (u8)~throwMode; } #else + void offDownFlg() { mFlags &= ~(fopEn_flag_WolfDownPull | fopEn_flag_WolfDownStart | fopEn_flag_CutDownHit | fopEn_flag_Down); } + void offWolfNoLock() { mFlags &= ~fopEn_flag_WolfNoLock; } + void offHeadLockFlg() { mFlags &= ~fopEn_flag_HeadLock; } void offThrowMode(u8 throwMode) { mThrowMode &= ~(throwMode & 0xFF); } #endif diff --git a/src/d/actor/d_a_npc_bans.cpp b/src/d/actor/d_a_npc_bans.cpp index ab60ad1c00..cfe52d1c7f 100644 --- a/src/d/actor/d_a_npc_bans.cpp +++ b/src/d/actor/d_a_npc_bans.cpp @@ -665,6 +665,7 @@ void daNpc_Bans_c::reset() { default: daNpcT_offTmpBit(57); // dSv_event_tmp_flag_c::T_0057 - Kakariko Village (inside) - Barnes bomb shop setAngle(angle); + break; } } diff --git a/src/d/actor/d_a_npc_kn.cpp b/src/d/actor/d_a_npc_kn.cpp index 5e653ea208..fd077d36ec 100644 --- a/src/d/actor/d_a_npc_kn.cpp +++ b/src/d/actor/d_a_npc_kn.cpp @@ -2537,7 +2537,6 @@ int daNpc_Kn_c::teach06_divideMove(void* param_0) { if (!dComIfGp_event_runCheck()) { mActionMode = 15; } - break; } case 3: default: @@ -2609,15 +2608,10 @@ int daNpc_Kn_c::teach06_superJumpWaitDivide(void* param_0) { parent_p->setTalkFlag(2); } - int spC; - s16 temp_r0_2 = fopAcM_searchPlayerAngleY(this) - current.angle.y; - if (temp_r0_2 < 0) { - spC = -temp_r0_2; - } else { - spC = temp_r0_2; - } + s16 srch_ply_angle = fopAcM_searchPlayerAngleY(this); + s16 angle = srch_ply_angle - current.angle.y; - if (spC < 0x4000) { + if ((angle < 0 ? -angle : angle) < 0x4000) { mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0); mMotionSeqMngr.setNo(0x12, -1.0f, 0, 0); setAngle(fopAcM_searchPlayerAngleY(this)); @@ -2673,10 +2667,13 @@ int daNpc_Kn_c::teach06_superJumpWaitDivide(void* param_0) { if (parent_p != NULL) { parent_p->setTalkFlag(1); parent_p->mFlowNodeNo = mFlowNodeNo; + } else { + break; } } else if (!daPy_getPlayerActorClass()->checkDamageImpact()) { BOOL is_lockon = FALSE; - if (dComIfGp_getAttention()->LockonTruth()) { + dAttention_c* attention_p = dComIfGp_getAttention(); + if (attention_p->LockonTruth()) { is_lockon = TRUE; } @@ -2810,15 +2807,10 @@ int daNpc_Kn_c::teach07_superTurnAttackWait(void* param_0) { mEvtNo = 0x18; } - int spC; - s16 temp_r0_2 = fopAcM_searchPlayerAngleY(this) - current.angle.y; - if (temp_r0_2 < 0) { - spC = -temp_r0_2; - } else { - spC = temp_r0_2; - } + s16 srch_ply_angle = fopAcM_searchPlayerAngleY(this); + s16 angle = srch_ply_angle - current.angle.y; - if (spC < 0x4000) { + if ((angle < 0 ? -angle : angle) < 0x4000) { mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0); mMotionSeqMngr.setNo(0x12, -1.0f, 0, 0); setAngle(fopAcM_searchPlayerAngleY(this)); @@ -2862,7 +2854,8 @@ int daNpc_Kn_c::teach07_superTurnAttackWait(void* param_0) { field_0x15bc = 0; BOOL is_lockon = FALSE; - if (dComIfGp_getAttention()->LockonTruth()) { + dAttention_c* attention_p = dComIfGp_getAttention(); + if (attention_p->LockonTruth()) { is_lockon = TRUE; } @@ -2923,7 +2916,6 @@ int daNpc_Kn_c::teach07_divideMove(void* param_0) { if (!dComIfGp_event_runCheck()) { mActionMode = 21; } - break; } case 3: default: @@ -2995,15 +2987,10 @@ int daNpc_Kn_c::teach07_superTurnAttackWaitDivide(void* param_0) { parent_p->setTalkFlag(2); } - int spC; - s16 temp_r0_2 = fopAcM_searchPlayerAngleY(this) - current.angle.y; - if (temp_r0_2 < 0) { - spC = -temp_r0_2; - } else { - spC = temp_r0_2; - } + s16 srch_ply_angle = fopAcM_searchPlayerAngleY(this); + s16 angle = srch_ply_angle - current.angle.y; - if (spC < 0x4000) { + if ((angle < 0 ? -angle : angle) < 0x4000) { mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0); mMotionSeqMngr.setNo(0x12, -1.0f, 0, 0); setAngle(fopAcM_searchPlayerAngleY(this)); @@ -3046,8 +3033,8 @@ int daNpc_Kn_c::teach07_superTurnAttackWaitDivide(void* param_0) { if (parent_p != NULL) { parent_p->setTalkFlag(1); } + break; } - break; } case 3: default: @@ -3117,10 +3104,12 @@ int daNpc_Kn_c::teach07_warpDelete(void* param_0) { int daNpc_Kn_c::ECut_secondEncount(int i_idx) { dEvent_manager_c* event_manager = &dComIfGp_getEventManager(); + daNpc_GWolf_c* gwolf_p = NULL; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -3132,14 +3121,14 @@ int daNpc_Kn_c::ECut_secondEncount(int i_idx) { mMotionSeqMngr.setNo(0, -1.0f, 0, 0); break; case 2: { - daNpc_GWolf_c* gwolf_p = (daNpc_GWolf_c*)fpcM_SearchByID(parentActorID); + gwolf_p = (daNpc_GWolf_c*)fpcM_SearchByID(parentActorID); if (fopAcM_GetName(gwolf_p) == PROC_NPC_GWOLF) { gwolf_p->setMotion(4, -1.0f, FALSE); } break; } case 5: { - daNpc_GWolf_c* gwolf_p = (daNpc_GWolf_c*)fpcM_SearchByID(parentActorID); + gwolf_p = (daNpc_GWolf_c*)fpcM_SearchByID(parentActorID); if (gwolf_p != NULL) { fopAcM_delete(gwolf_p); } @@ -3273,10 +3262,12 @@ int daNpc_Kn_c::ECut_secondEncount(int i_idx) { int daNpc_Kn_c::ECut_thirdSkillExplain(int i_idx) { dEvent_manager_c* event_manager = &dComIfGp_getEventManager(); + void* _ = NULL; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -3359,9 +3350,7 @@ int daNpc_Kn_c::ECut_thirdSkillExplain(int i_idx) { } break; case 6: - if (mCurAngle.y == fopAcM_searchPlayerAngleY(this)) { - rt = 1; - } else { + if (mCurAngle.y != fopAcM_searchPlayerAngleY(this)) { if (step(fopAcM_searchPlayerAngleY(this), 1, 0x20, 20, 0)) { rt = 1; mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0); @@ -3459,9 +3448,10 @@ int daNpc_Kn_c::ECut_thirdSkillGet(int i_idx) { int sp8 = 0; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -3594,9 +3584,10 @@ int daNpc_Kn_c::ECut_fourthSkillExplain(int i_idx) { int sp8 = 0; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -3647,6 +3638,7 @@ int daNpc_Kn_c::ECut_fourthSkillExplain(int i_idx) { mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0); mMotionSeqMngr.setNo(0, -1.0f, 1, 0); } + void(0); break; } case 30: @@ -3792,9 +3784,10 @@ int daNpc_Kn_c::ECut_fourthSkillGet(int i_idx) { int sp8 = 0; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -3928,9 +3921,10 @@ int daNpc_Kn_c::ECut_fifthSkillExplain(int i_idx) { int sp8 = 0; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -4090,7 +4084,7 @@ int daNpc_Kn_c::ECut_fifthSkillExplain(int i_idx) { sp34 += home.pos; setPos(sp34); - setAngle(home.angle.y); + setAngle((s16) home.angle.y); mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0); mMotionSeqMngr.setNo(7, -1.0f, 1, 0); } else if (mpModelMorf[0]->getFrame() >= 8.0f && mpModelMorf[0]->getFrame() < 9.0f) { @@ -4124,9 +4118,10 @@ int daNpc_Kn_c::ECut_fifthSkillGet(int i_idx) { int sp8 = 0; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -4260,9 +4255,10 @@ int daNpc_Kn_c::ECut_sixthSkillExplain(int i_idx) { int sp8 = 0; int rt = 0; + int* prm_p = NULL; int prm = -1; - int* prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); + prm_p = dComIfGp_evmng_getMyIntegerP(i_idx, "prm"); if (prm_p != NULL) { prm = *prm_p; } @@ -4416,7 +4412,7 @@ int daNpc_Kn_c::ECut_sixthSkillExplain(int i_idx) { sp34 += home.pos; setPos(sp34); - setAngle(home.angle.y); + setAngle((s16) home.angle.y); mFaceMotionSeqMngr.setNo(1, -1.0f, 0, 0); mMotionSeqMngr.setNo(0, 0.0f, 1, 0); } @@ -4984,14 +4980,22 @@ int daNpc_Kn_c::setSlipPrtcl() { mDoMtx_stack_c::multVecZero(&mParticleMngr[0].mPos); mParticleMngr[0].mPos.y -= 20.0f; mParticleMngr[0].mAngle = current.angle; + #ifdef DEBUG + mParticleMngr[0].mAngle.y -= (s16) 0x8000; + #else mParticleMngr[0].mAngle.y -= 0x8000; + #endif mParticleMngr[0].mpModel = true; mDoMtx_stack_c::copy(mpModelMorf[0]->getModel()->getAnmMtx(0x1b)); mDoMtx_stack_c::multVecZero(&mParticleMngr[1].mPos); mParticleMngr[1].mPos.y -= 20.0f; mParticleMngr[1].mAngle = current.angle; + #ifdef DEBUG + mParticleMngr[1].mAngle.y -= (s16) 0x8000; + #else mParticleMngr[1].mAngle.y -= 0x8000; + #endif mParticleMngr[1].mpModel = true; return 1; } diff --git a/src/d/actor/d_a_npc_kn_base.inc b/src/d/actor/d_a_npc_kn_base.inc index 392b65fa26..ed489e16c1 100644 --- a/src/d/actor/d_a_npc_kn_base.inc +++ b/src/d/actor/d_a_npc_kn_base.inc @@ -1009,7 +1009,7 @@ BOOL daNpc_Kn_c::srchPlayerActor() { } } - return mActorMngr1.getActorP() != NULL; + return NULL != mActorMngr1.getActorP(); } cXyz daNpc_Kn_c::getAttnPos(fopAc_ac_c* i_actor) { diff --git a/src/d/actor/d_a_npc_kn_teach01.inc b/src/d/actor/d_a_npc_kn_teach01.inc index 711d011846..47f38c9ea7 100644 --- a/src/d/actor/d_a_npc_kn_teach01.inc +++ b/src/d/actor/d_a_npc_kn_teach01.inc @@ -330,6 +330,7 @@ int daNpc_Kn_c::ctrlWarp() { field_0x16f4.set(1.0f, 1.0f, 1.0f); } } + void(0); break; } case 1: @@ -365,6 +366,7 @@ int daNpc_Kn_c::ctrlWarp() { field_0x170c = 2; field_0x170d = 0; } + void(0); break; case 2: sp28 = 1; @@ -405,7 +407,6 @@ int daNpc_Kn_c::ctrlWarp() { field_0x170c = 0; field_0x170d = 0; } - break; } return sp28;