From ac8acaeba48987bb8f432e435a5a42f2872cb4a7 Mon Sep 17 00:00:00 2001 From: vaguerant Date: Fri, 17 Jun 2022 11:08:32 +1000 Subject: [PATCH] Cheat: shield with two-handed weapons (#487) --- libultraship/libultraship/SohImGuiImpl.cpp | 2 ++ soh/src/code/z_player_lib.c | 3 ++- soh/src/overlays/actors/ovl_player_actor/z_player.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index c8900fb3e..c59968891 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -1083,6 +1083,8 @@ namespace SohImGui { Tooltip("Drops from enemies, grass, etc. don't disappear after a set amount of time"); EnhancementCheckbox("Fireproof Deku Shield", "gFireproofDekuShield"); Tooltip("Prevents the Deku Shield from burning on contact with fire"); + EnhancementCheckbox("Shield with Two-Handed Weapons", "gShieldTwoHanded"); + Tooltip("Allows Link to shield normally with two-handed swords and the Megaton Hammer"); ImGui::EndMenu(); } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index cf7fbd51c..77c569951 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -360,7 +360,8 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) { void Player_SetModelsForHoldingShield(Player* this) { if ((this->stateFlags1 & 0x400000) && ((this->itemActionParam < 0) || (this->itemActionParam == this->heldItemActionParam))) { - if (!Player_HoldsTwoHandedWeapon(this) && !Player_IsChildWithHylianShield(this)) { + if ((CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK) || + !Player_HoldsTwoHandedWeapon(this)) && !Player_IsChildWithHylianShield(this)) { this->rightHandType = 10; this->rightHandDLists = &sPlayerDListGroups[10][(void)0, gSaveContext.linkAge]; if (this->sheathType == 18) { 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 cf1736cb9..dfea49458 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2106,10 +2106,10 @@ LinkAnimationHeader* func_808346C4(GlobalContext* globalCtx, Player* this) { func_808323B4(globalCtx, this); if (this->unk_870 < 0.5f) { - return D_808543A4[Player_HoldsTwoHandedWeapon(this)]; + return D_808543A4[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } else { - return D_808543AC[Player_HoldsTwoHandedWeapon(this)]; + return D_808543AC[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } }