Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fixes for power crouch stab to the Enhancements menu #874

Merged
merged 2 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libultraship/libultraship/ImGuiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,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();
}
Expand Down
32 changes: 26 additions & 6 deletions soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -7846,15 +7846,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) {
Expand Down