diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 44a499d78..31e2eeb0b 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -1194,6 +1194,14 @@ namespace SohImGui { Tooltip("Correctly centers the Navi text prompt on the HUD's C-Up button"); EnhancementCheckbox("Fix Anubis fireballs", "gAnubisFix"); Tooltip("Make Anubis fireballs do fire damage when reflected\nback at them with the Mirror Shield"); + EnhancementCheckbox("Fix Megaton Hammer crouch stab", "gCrouchStabHammerFix"); + Tooltip("Make the Megaton Hammer's crouch stab able to destroy\nrocks without first swinging it normally"); + if (CVar_GetS32("gCrouchStabHammerFix", 0) == 0) { + CVar_SetS32("gCrouchStabFix", 0); + } else { + EnhancementCheckbox("Remove power crouch stab", "gCrouchStabFix"); + Tooltip("Make crouch stabbing always do the same damage as a regular slash"); + } ImGui::EndMenu(); } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 2ab19a877..93a219a9e 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -7847,15 +7847,35 @@ s32 func_8084285C(Player* this, f32 arg1, f32 arg2, f32 arg3) { } s32 func_808428D8(Player* this, GlobalContext* globalCtx) { - if (!Player_IsChildWithHylianShield(this) && Player_GetSwordHeld(this) && D_80853614) { - func_80832264(globalCtx, this, &gPlayerAnim_002EC8); - this->unk_84F = 1; - this->swordAnimation = 0xC; - this->currentYaw = this->actor.shape.rot.y + this->unk_6BE; + if (Player_IsChildWithHylianShield(this) || !Player_GetSwordHeld(this) || !D_80853614) { + return 0; + } + + func_80832264(globalCtx, this, &gPlayerAnim_002EC8); + this->unk_84F = 1; + this->swordAnimation = 0xC; + this->currentYaw = this->actor.shape.rot.y + this->unk_6BE; + + if (!CVar_GetS32("gCrouchStabHammerFix", 0)) { return 1; } - return 0; + u32 swordId; + if (Player_HoldsBrokenKnife(this)) { + swordId = 1; + } else { + swordId = Player_GetSwordHeld(this) - 1; + } + + if (swordId != 4 && !CVar_GetS32("gCrouchStabFix", 0)) { // 4 = Megaton Hammer + return 1; + } + + u32 flags = D_80854488[swordId][0]; + func_80837918(this, 0, flags); + func_80837918(this, 1, flags); + + return 1; } s32 func_80842964(Player* this, GlobalContext* globalCtx) {