Skip to content

Commit

Permalink
Enhanced Iron Boots
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Nov 23, 2024
1 parent 0bc6ca0 commit 58337cb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 2 additions & 0 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,8 @@ void DrawEnhancementsMenu() {
UIWidgets::Tooltip("Allows equipping the tunic and boots to c-buttons");
UIWidgets::PaddedEnhancementCheckbox("Equipment Toggle", "gEquipmentCanBeRemoved", true, false);
UIWidgets::Tooltip("Allows equipment to be removed by toggling it off on\nthe equipment subscreen.");
UIWidgets::PaddedEnhancementCheckbox("Extra Underwater Actions", "gEnhancedIronBoots", true, false);
UIWidgets::Tooltip("Allows opening chests and using your sword and Bombchus when underwater with Iron Boots");
UIWidgets::PaddedEnhancementCheckbox("Link's Cow in Both Time Periods", "gCowOfTime", true, false);
UIWidgets::Tooltip("Allows the Lon Lon Ranch obstacle course reward to be shared across time periods");
UIWidgets::PaddedEnhancementCheckbox("Enable visible guard vision", "gGuardVision", true, false);
Expand Down
20 changes: 15 additions & 5 deletions soh/src/code/z_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,19 @@ void func_80083108(PlayState* play) {
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] =
gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED;
} else if ((Player_GetEnvironmentalHazard(play) >= 2) && (Player_GetEnvironmentalHazard(play) < 5)) {
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
sp28 = 1;
}
if (CVarGetInteger("gEnhancedIronBoots", 0) && Player_GetEnvironmentalHazard(play) == 2) {
if (gSaveContext.buttonStatus[0] == BTN_DISABLED) {
sp28 = 1;
}

gSaveContext.buttonStatus[0] = BTN_ENABLED;
} else {
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
sp28 = 1;
}

gSaveContext.buttonStatus[0] = BTN_DISABLED;
gSaveContext.buttonStatus[0] = BTN_DISABLED;
}

for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
if ((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) &&
Expand All @@ -981,7 +989,9 @@ void func_80083108(PlayState* play) {
gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
} else if (Player_GetEnvironmentalHazard(play) == 2) {
if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) &&
(gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) {
(gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT) &&
(CVarGetInteger("gEnhancedIronBoots", 0)
&& gSaveContext.equips.buttonItems[i] != ITEM_BOMBCHU)) {
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_ENABLED) {
sp28 = 1;
}
Expand Down
9 changes: 6 additions & 3 deletions soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -2960,7 +2960,9 @@ void func_80835F44(PlayState* play, Player* this, s32 item) {

if ((actionParam == PLAYER_IA_NONE) || !(this->stateFlags1 & PLAYER_STATE1_IN_WATER) ||
((this->actor.bgCheckFlags & 1) &&
((actionParam == PLAYER_IA_HOOKSHOT) || (actionParam == PLAYER_IA_LONGSHOT))) ||
((actionParam == PLAYER_IA_HOOKSHOT) || (actionParam == PLAYER_IA_LONGSHOT) ||
(CVarGetInteger("gEnhancedIronBoots", 0) &&
((Player_ActionToMeleeWeapon(actionParam) != 0) || (actionParam == PLAYER_IA_BOMBCHU))))) ||
((actionParam >= PLAYER_IA_SHIELD_DEKU) && (actionParam <= PLAYER_IA_BOOTS_HOVER))) {

if ((play->bombchuBowlingStatus == 0) &&
Expand Down Expand Up @@ -6386,7 +6388,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) {
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
}
} else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD) &&
!(this->stateFlags2 & PLAYER_STATE2_UNDERWATER)) {
(CVarGetInteger("gEnhancedIronBoots", 0) || !(this->stateFlags2 & PLAYER_STATE2_UNDERWATER))) {
if (this->getItemId != GI_NONE) {
GetItemEntry giEntry;
if (this->getItemEntry.objectId == OBJECT_INVALID) {
Expand Down Expand Up @@ -9841,7 +9843,8 @@ void func_808473D4(PlayState* play, Player* this) {
} else if ((!(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD) || (heldActor == NULL)) &&
(interactRangeActor != NULL) &&
((!sp1C && (this->getItemId == GI_NONE)) ||
(this->getItemId < 0 && !(this->stateFlags1 & PLAYER_STATE1_IN_WATER)))) {
(this->getItemId < 0 && !(this->stateFlags1 & PLAYER_STATE1_IN_WATER)) ||
CVarGetInteger("gEnhancedIronBoots", 0) && this->stateFlags2 & PLAYER_STATE2_UNDERWATER)) {
if (this->getItemId < 0) {
doAction = DO_ACTION_OPEN;
} else if ((interactRangeActor->id == ACTOR_BG_TOKI_SWD) && LINK_IS_ADULT) {
Expand Down

0 comments on commit 58337cb

Please sign in to comment.