diff --git a/include/d/actor/d_a_boko.h b/include/d/actor/d_a_boko.h index 006294e34..4f5015348 100644 --- a/include/d/actor/d_a_boko.h +++ b/include/d/actor/d_a_boko.h @@ -2,6 +2,7 @@ #define D_A_BOKO_H #include "f_op/f_op_actor.h" +#include "f_op/f_op_actor_mng.h" #include "d/d_cc_d.h" #include "d/d_bg_s_acch.h" #include "d/d_particle.h" @@ -24,14 +25,14 @@ public: static f32 m_blur_rate[6]; static u8 m_se_type[6]; - void getAtPoint() {} - void getAtType() {} + s32 getAtPoint() { return m_at_point[fopAcM_GetParam(this)]; } + u32 getAtType() { return m_at_type[fopAcM_GetParam(this)]; } void getBlurRate() {} - void getCpsR() {} + f32 getCpsR() { return m_cps_r[fopAcM_GetParam(this)]; } void getFlameTimer() {} void getJumpBlurRate() {} void getNowMode() {} - void getSeType() {} + u8 getSeType() { return m_se_type[fopAcM_GetParam(this)]; } void moveStateInit(f32 speedForward, f32 speedY, s16 angleY) { speed.y = speedY; speedF = speedForward; diff --git a/include/d/actor/d_a_player_main.h b/include/d/actor/d_a_player_main.h index cef725c06..0420792c9 100644 --- a/include/d/actor/d_a_player_main.h +++ b/include/d/actor/d_a_player_main.h @@ -507,13 +507,6 @@ public: daPyProc_DEMO_ICE_SLIP_e = 0xDA, }; - enum daPy_HEAP_TYPE { - HEAP_TYPE_UNDER_UPPER_e = 0, - HEAP_TYPE_TEXTURE_ANIME_e = 1, - HEAP_TYPE_TEXTURE_SCROLL_e = 2, - HEAP_TYPE_ITEM_ANIME_e = 3, - }; - enum daPy_ANM { ANM_WAITS = 0x00, ANM_WALK = 0x01, @@ -751,6 +744,13 @@ public: ANM_TAKTCHISIN = 0xE9, }; + enum daPy_HEAP_TYPE { + HEAP_TYPE_UNDER_UPPER_e = 0, + HEAP_TYPE_TEXTURE_ANIME_e = 1, + HEAP_TYPE_TEXTURE_SCROLL_e = 2, + HEAP_TYPE_ITEM_ANIME_e = 3, + }; + enum daPy_UNDER { UNDER_MOVE0_e = 0, UNDER_MOVE1_e = 1, @@ -1550,7 +1550,7 @@ public: BOOL procBottleSwing(); BOOL procBottleGet_init(); BOOL procBottleGet(); - void setEnemyWeaponAtParam(int); + void setEnemyWeaponAtParam(BOOL); BOOL procWeaponNormalSwing_init(); BOOL procWeaponNormalSwing(); BOOL procWeaponSideSwing_init(); diff --git a/include/d/d_cc_d.h b/include/d/d_cc_d.h index b0679947d..ba7afe12d 100644 --- a/include/d/d_cc_d.h +++ b/include/d/d_cc_d.h @@ -51,7 +51,11 @@ enum CcG_Tg_HitMark { /* 0xC */ G_TG_MARK_PURPLE_HIT = dPa_name::ID_COMMON_PURPLE_HIT, }; -enum dCcG_At_Spl {}; +enum dCcG_At_Spl { + /* 0x0 */ dCcG_At_Spl_UNK0 = 0, + /* 0x1 */ dCcG_At_Spl_UNK1 = 1, + /* 0xB */ dCcG_At_Spl_UNKB = 0xB, +}; enum dCcG_Tg_Spl {}; diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index 4bab1c9b6..a48f53c08 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -279,7 +279,7 @@ void daArrow_c::arrowShooting() { if (mArrowType == TYPE_LIGHT && !mbSetByZelda) { if (strcmp(dComIfGp_getStartStageName(), "GanonK") != 0) { // Not in Puppet Ganon's boss room. - mAtCps.SetAtSpl((dCcG_At_Spl)0xB); + mAtCps.SetAtSpl(dCcG_At_Spl_UNKB); } } @@ -1112,14 +1112,14 @@ BOOL daArrow_c::_execute() { if (mbSetByZelda) { if (!mbLinkReflect) { if (daPy_getPlayerLinkActorClass()->checkPlayerGuard()) { - mAtCps.SetAtSpl((dCcG_At_Spl)0); + mAtCps.SetAtSpl(dCcG_At_Spl_UNK0); mAtCps.SetAtType(AT_TYPE_NORMAL_ARROW); } else { - mAtCps.SetAtSpl((dCcG_At_Spl)0xB); + mAtCps.SetAtSpl(dCcG_At_Spl_UNKB); mAtCps.SetAtType(AT_TYPE_LIGHT_ARROW); } } else { - mAtCps.SetAtSpl((dCcG_At_Spl)0); + mAtCps.SetAtSpl(dCcG_At_Spl_UNK0); mAtCps.SetAtType(AT_TYPE_NORMAL_ARROW); } } diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 7b90c8f36..e60118716 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -1793,7 +1793,7 @@ BOOL daPy_lk_c::changeDamageProc() { r27 = mStts.GetAtSpl(); } } else { - r27 = (dCcG_At_Spl)0; + r27 = dCcG_At_Spl_UNK0; } if (checkModeFlg(ModeFlg_04000000)) { diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index df7f39d8a..8b9020b43 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -11,6 +11,7 @@ */ #include "d/actor/d_a_player_main.h" +#include "d/actor/d_a_player_hio.h" #include "JSystem/J3DGraphLoader/J3DAnmLoader.h" #include "JSystem/JKernel/JKRSolidHeap.h" @@ -153,28 +154,92 @@ void daPy_lk_c::getSwordBlurColor() { } /* 801555FC-80155694 .text setNormalCutAtParam__9daPy_lk_cFUc */ -void daPy_lk_c::setNormalCutAtParam(u8) { - /* Nonmatching */ +void daPy_lk_c::setNormalCutAtParam(u8 cutType) { + int atp; + f32 radius; + if (checkNormalSwordEquip()) { + atp = 1; + radius = daPy_HIO_cut_c0::m.field_0x3C; + m35FC = daPy_HIO_cut_c0::m.field_0x40; + } else { + atp = 2; + radius = daPy_HIO_cut_c0::m.field_0x44; + m35FC = daPy_HIO_cut_c0::m.field_0x48; + } + setAtParam(AT_TYPE_SWORD, atp, dCcG_At_Spl_UNK0, dCcD_SE_UNK1, G_AT_MARK_NORMAL_HIT, cutType, radius); } /* 80155694-8015572C .text setFinishCutAtParam__9daPy_lk_cFUc */ -void daPy_lk_c::setFinishCutAtParam(u8) { - /* Nonmatching */ +void daPy_lk_c::setFinishCutAtParam(u8 cutType) { + int atp; + f32 radius; + if (checkNormalSwordEquip()) { + atp = 2; + radius = daPy_HIO_cut_c0::m.field_0x3C; + m35FC = daPy_HIO_cut_c0::m.field_0x40; + } else { + atp = 4; + radius = daPy_HIO_cut_c0::m.field_0x44; + m35FC = daPy_HIO_cut_c0::m.field_0x48; + } + setAtParam(AT_TYPE_SWORD, atp, dCcG_At_Spl_UNK1, dCcD_SE_UNK1, G_AT_MARK_BIG_HIT, cutType, radius); } /* 8015572C-801557C4 .text setExtraCutAtParam__9daPy_lk_cFUc */ -void daPy_lk_c::setExtraCutAtParam(u8) { - /* Nonmatching */ +void daPy_lk_c::setExtraCutAtParam(u8 cutType) { + int atp; + f32 radius; + if (checkNormalSwordEquip()) { + atp = 1; + radius = daPy_HIO_cut_c0::m.field_0x5C; + m35FC = daPy_HIO_cut_c0::m.field_0x60; + } else { + atp = 2; + radius = daPy_HIO_cut_c0::m.field_0x64; + m35FC = daPy_HIO_cut_c0::m.field_0x68; + } + setAtParam(AT_TYPE_SWORD, atp, dCcG_At_Spl_UNK0, dCcD_SE_UNK1, G_AT_MARK_NORMAL_HIT, cutType, radius); } /* 801557C4-8015585C .text setExtraFinishCutAtParam__9daPy_lk_cFUc */ -void daPy_lk_c::setExtraFinishCutAtParam(u8) { - /* Nonmatching */ +void daPy_lk_c::setExtraFinishCutAtParam(u8 cutType) { + int atp; + f32 radius; + if (checkNormalSwordEquip()) { + atp = 2; + radius = daPy_HIO_cut_c0::m.field_0x5C; + m35FC = daPy_HIO_cut_c0::m.field_0x60; + } else { + atp = 4; + radius = daPy_HIO_cut_c0::m.field_0x64; + m35FC = daPy_HIO_cut_c0::m.field_0x68; + } + setAtParam(AT_TYPE_SWORD, atp, dCcG_At_Spl_UNK1, dCcD_SE_UNK1, G_AT_MARK_BIG_HIT, cutType, radius); } /* 8015585C-80155970 .text setJumpCutAtParam__9daPy_lk_cFv */ void daPy_lk_c::setJumpCutAtParam() { - /* Nonmatching */ + mCutCount = 0; + if (mHeldItemType == 0x103) { + int atp; + f32 radius; + if (checkNormalSwordEquip()) { + atp = 2; + radius = daPy_HIO_cut_c0::m.field_0x4C; + m35FC = daPy_HIO_cut_c0::m.field_0x50; + } else { + atp = 4; + radius = daPy_HIO_cut_c0::m.field_0x54; + m35FC = daPy_HIO_cut_c0::m.field_0x58; + } + setAtParam(AT_TYPE_SWORD, atp, dCcG_At_Spl_UNK1, dCcD_SE_UNK1, G_AT_MARK_BIG_HIT, 0xA, radius); + } else if (mHeldItemType == HUMMER) { + setAtParam(AT_TYPE_SKULL_HAMMER, 4, dCcG_At_Spl_UNK1, dCcD_SE_UNK5, G_AT_MARK_NORMAL_HIT, 0x13, 50.0f); + } else if (mActorKeepEquip.getActor()) { + setEnemyWeaponAtParam(TRUE); + } else { + setAtParam(AT_TYPE_MACHETE, 2, dCcG_At_Spl_UNK1, dCcD_SE_UNK1, G_AT_MARK_BIG_HIT, 0xE, 30.0f); + } } /* 80155970-801559F0 .text getCutDirection__9daPy_lk_cFv */ diff --git a/src/d/actor/d_a_player_weapon.inc b/src/d/actor/d_a_player_weapon.inc index 83562082b..272a692ad 100644 --- a/src/d/actor/d_a_player_weapon.inc +++ b/src/d/actor/d_a_player_weapon.inc @@ -11,10 +11,31 @@ */ #include "d/actor/d_a_player_main.h" +#include "d/actor/d_a_boko.h" /* 80153554-801535D8 .text setEnemyWeaponAtParam__9daPy_lk_cFi */ -void daPy_lk_c::setEnemyWeaponAtParam(int) { - /* Nonmatching */ +void daPy_lk_c::setEnemyWeaponAtParam(BOOL r4) { + static const u8 cut_type[] = { + 0x0B, + 0x0D, + 0x14, + 0x16, + 0x18, + 0x1C, + }; + daBoko_c* boko = (daBoko_c*)mActorKeepEquip.getActor(); + u8 cutType = cut_type[fopAcM_GetParam(boko)]; + dCcG_At_Spl spl; + u8 hitMark; + if (r4) { + spl = dCcG_At_Spl_UNK1; + hitMark = G_AT_MARK_BIG_HIT; + cutType++; + } else { + spl = dCcG_At_Spl_UNK0; + hitMark = G_AT_MARK_NORMAL_HIT; + } + setAtParam(boko->getAtType(), boko->getAtPoint(), spl, boko->getSeType(), hitMark, cutType, boko->getCpsR()); } /* 801535D8-8015372C .text procWeaponNormalSwing_init__9daPy_lk_cFv */ diff --git a/src/d/d_cc_s.cpp b/src/d/d_cc_s.cpp index 21a636608..f990ea9f2 100644 --- a/src/d/d_cc_s.cpp +++ b/src/d/d_cc_s.cpp @@ -340,7 +340,6 @@ void dCcS::SetAtTgGObjInf(bool i_setAt, bool i_setTg, cCcD_Obj* param_2, cCcD_Ob cCcD_GObjInf* i_atObjInf, cCcD_GObjInf* i_tgObjInf, cCcD_Stts* param_6, cCcD_Stts* param_7, cCcD_GStts* param_8, cCcD_GStts* param_9, cXyz* i_hitPos) { - /* Nonmatching */ dCcD_GObjInf* atObjInf = (dCcD_GObjInf*)i_atObjInf; dCcD_GObjInf* tgObjInf = (dCcD_GObjInf*)i_tgObjInf; dCcD_GStts* stts1 = (dCcD_GStts*)param_8;