Cheat: shield with two-handed weapons (#487)

This commit is contained in:
vaguerant 2022-06-17 11:08:32 +10:00 committed by GitHub
parent 93e69c924d
commit ac8acaeba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -1083,6 +1083,8 @@ namespace SohImGui {
Tooltip("Drops from enemies, grass, etc. don't disappear after a set amount of time"); Tooltip("Drops from enemies, grass, etc. don't disappear after a set amount of time");
EnhancementCheckbox("Fireproof Deku Shield", "gFireproofDekuShield"); EnhancementCheckbox("Fireproof Deku Shield", "gFireproofDekuShield");
Tooltip("Prevents the Deku Shield from burning on contact with fire"); 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(); ImGui::EndMenu();
} }

View File

@ -360,7 +360,8 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) {
void Player_SetModelsForHoldingShield(Player* this) { void Player_SetModelsForHoldingShield(Player* this) {
if ((this->stateFlags1 & 0x400000) && if ((this->stateFlags1 & 0x400000) &&
((this->itemActionParam < 0) || (this->itemActionParam == this->heldItemActionParam))) { ((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->rightHandType = 10;
this->rightHandDLists = &sPlayerDListGroups[10][(void)0, gSaveContext.linkAge]; this->rightHandDLists = &sPlayerDListGroups[10][(void)0, gSaveContext.linkAge];
if (this->sheathType == 18) { if (this->sheathType == 18) {

View File

@ -2106,10 +2106,10 @@ LinkAnimationHeader* func_808346C4(GlobalContext* globalCtx, Player* this) {
func_808323B4(globalCtx, this); func_808323B4(globalCtx, this);
if (this->unk_870 < 0.5f) { 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 { else {
return D_808543AC[Player_HoldsTwoHandedWeapon(this)]; return D_808543AC[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))];
} }
} }