Skip to content

Commit

Permalink
Merge branch 'enhanced_iron_boots' into enhancement_mods
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Aug 5, 2023
2 parents 72ec72c + f5dfa38 commit a2ea6b9
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 @@ -837,6 +837,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 @@ -933,11 +933,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 ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) {
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
sp28 = 1;
}
if (CVarGetInteger("gEnhancedIronBoots", 0) && func_8008F2F8(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 @@ -950,7 +958,9 @@ void func_80083108(PlayState* play) {
gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
} else if (func_8008F2F8(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 @@ -3066,7 +3066,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_ActionToSword(actionParam) != 0) || (actionParam == PLAYER_IA_BOMBCHU))))) ||
((actionParam >= PLAYER_IA_SHIELD_DEKU) && (actionParam <= PLAYER_IA_BOOTS_HOVER))) {

if ((play->bombchuBowlingStatus == 0) &&
Expand Down Expand Up @@ -6510,7 +6512,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 @@ -9971,7 +9973,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 a2ea6b9

Please sign in to comment.