summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorPhilip Dubé <159546+serprex@users.noreply.github.com>2026-08-17 17:24:03 +0000
committerGitHub <noreply@github.com>2026-08-17 17:24:03 +0000
commitbd8a5825f94bf226680ce009ce5a50948aa48a78 (patch)
tree99d308c0604fa356f899d1f382519b0b6c548e22 /soh/src/code
parent172b373fb5eb02a0412a256cba2197e54138c69e (diff)
Hookify masks / timeless equipment (#7088)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_face_reaction.c9
-rw-r--r--soh/src/code/z_message_PAL.c4
-rw-r--r--soh/src/code/z_parameter.c15
-rw-r--r--soh/src/code/z_play.c20
-rw-r--r--soh/src/code/z_player_lib.c2
-rw-r--r--soh/src/code/z_sram.c4
6 files changed, 15 insertions, 39 deletions
diff --git a/soh/src/code/z_face_reaction.c b/soh/src/code/z_face_reaction.c
index 0ea94b119..b6f1c6949 100644
--- a/soh/src/code/z_face_reaction.c
+++ b/soh/src/code/z_face_reaction.c
@@ -1,5 +1,5 @@
#include "global.h"
-#include "soh/Enhancements/enhancementTypes.h"
+#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
u16 sReactionTextIds[][PLAYER_MASK_MAX] = {
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
@@ -67,10 +67,9 @@ u16 sReactionTextIds[][PLAYER_MASK_MAX] = {
u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet) {
u8 currentMask = Player_GetMask(play);
- if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA &&
- currentMask == PLAYER_MASK_BUNNY) {
+ if (!GameInteractor_Should(VB_NPC_REACT_TO_MASK, true, currentMask)) {
return 0;
- } else {
- return sReactionTextIds[reactionSet][currentMask];
}
+
+ return sReactionTextIds[reactionSet][currentMask];
}
diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c
index c6c2803b1..66a7baae2 100644
--- a/soh/src/code/z_message_PAL.c
+++ b/soh/src/code/z_message_PAL.c
@@ -2782,10 +2782,10 @@ void Message_OpenText(PlayState* play, u16 textId) {
// font->msgOffset), font->msgLength, __FILE__, __LINE__);
} else if (CVarGetInteger(CVAR_ENHANCEMENT("AskToEquip"), 0) &&
- (((LINK_IS_ADULT || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) &&
+ ((GameInteractor_Should(VB_PLAYER_MEETS_AGE_REQ, LINK_IS_ADULT, LINK_AGE_ADULT) &&
// 0C = Biggoron, 4B = Giant's, 4E = Mirror Shield, 50-51 = Tunics
(textId == 0x0C || textId == 0x4B || textId == 0x4E || textId == 0x50 || textId == 0x51)) ||
- ((!LINK_IS_ADULT || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) &&
+ (GameInteractor_Should(VB_PLAYER_MEETS_AGE_REQ, !LINK_IS_ADULT, LINK_AGE_CHILD) &&
// 4C = Deku Shield, A4 = Kokiri Sword
(textId == 0x4C || textId == 0xA4)) ||
// 4D == Hylian Shield
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 894a212a0..69fd6ded3 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -1143,13 +1143,14 @@ void func_80083108(PlayState* play) {
if (interfaceCtx->restrictions.tradeItems != 0) {
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
- if ((CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) !=
- BUNNY_HOOD_VANILLA) &&
- (gSaveContext.equips.buttonItems[i] >= ITEM_MASK_KEATON) &&
- (gSaveContext.equips.buttonItems[i] <= ITEM_MASK_TRUTH)) {
- gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
- } else if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) &&
- (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) {
+ if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) &&
+ (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) {
+ if (!GameInteractor_Should(VB_DISABLE_TRADE_ITEM_BUTTON, true,
+ gSaveContext.equips.buttonItems[i])) {
+ gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
+ continue;
+ }
+
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_ENABLED) {
sp28 = 1;
}
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index 4a92668c4..37fc299da 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -559,21 +559,6 @@ void Play_Init(GameState* thisx) {
Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL);
- // In order to keep masks equipped on first load, we need to pre-set the age reqs for the item and slot
- if (CVarGetInteger(CVAR_ENHANCEMENT("AdultMasks"), 0) || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) {
- for (int i = ITEM_MASK_KEATON; i <= ITEM_MASK_TRUTH; i += 1) {
- gItemAgeReqs[i] = AGE_REQ_NONE;
- }
- if (INV_CONTENT(ITEM_TRADE_CHILD) >= ITEM_MASK_KEATON && INV_CONTENT(ITEM_TRADE_CHILD) <= ITEM_MASK_TRUTH) {
- gSlotAgeReqs[SLOT_TRADE_CHILD] = AGE_REQ_NONE;
- }
- } else {
- for (int i = ITEM_MASK_KEATON; i <= ITEM_MASK_TRUTH; i += 1) {
- gItemAgeReqs[i] = AGE_REQ_CHILD;
- }
- gSlotAgeReqs[SLOT_TRADE_CHILD] = AGE_REQ_CHILD;
- }
-
// Handle Rocs Feather requirement
gItemAgeReqs[ITEM_ROCS_FEATHER] = AGE_REQ_NONE;
gSlotAgeReqs[SLOT_NAYRUS_LOVE] = AGE_REQ_NONE;
@@ -1150,11 +1135,6 @@ void Play_Update(PlayState* play) {
gSaveContext.ship.stats.playTimer++;
gSaveContext.ship.stats.sceneTimer++;
gSaveContext.ship.stats.roomTimer++;
-
- if (CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA &&
- Player_GetMask(play) == PLAYER_MASK_BUNNY) {
- gSaveContext.ship.stats.count[COUNT_TIME_BUNNY_HOOD]++;
- }
}
if (play->actorCtx.freezeFlashTimer && (play->actorCtx.freezeFlashTimer-- < 5)) {
diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c
index c9d5ba5d8..62b003c98 100644
--- a/soh/src/code/z_player_lib.c
+++ b/soh/src/code/z_player_lib.c
@@ -782,7 +782,7 @@ s32 Player_GetStrength(void) {
return PLAYER_STR_NONE;
}
- if (CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0) || LINK_IS_ADULT) {
+ if (GameInteractor_Should(VB_PLAYER_MEETS_AGE_REQ, LINK_IS_ADULT, LINK_AGE_ADULT)) {
return strengthUpgrade;
} else if (strengthUpgrade != 0) {
return PLAYER_STR_BRACELET;
diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c
index ac93b9358..97c0a6612 100644
--- a/soh/src/code/z_sram.c
+++ b/soh/src/code/z_sram.c
@@ -143,10 +143,6 @@ void Sram_OpenSave() {
break;
}
- if (!CVarGetInteger(CVAR_ENHANCEMENT("PersistentMasks"), 0)) {
- gSaveContext.ship.maskMemory = PLAYER_MASK_NONE;
- }
-
osSyncPrintf("scene_no = %d\n", gSaveContext.entranceIndex);
osSyncPrintf(VT_RST);