From b56426a67da6fe9972f0f6b57292295be058457f Mon Sep 17 00:00:00 2001 From: vaguerant Date: Tue, 21 Jun 2022 03:50:06 +1000 Subject: [PATCH] Skip first-time pickup messages for consumable items (#495) --- libultraship/libultraship/SohImGuiImpl.cpp | 2 ++ soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 6 +++--- soh/src/overlays/actors/ovl_player_actor/z_player.c | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 0120809b0..56b698c1a 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -901,6 +901,8 @@ namespace SohImGui { Tooltip("Disables the voice audio when Navi calls you"); EnhancementCheckbox("Fast Chests", "gFastChests"); Tooltip("Kick open every chest"); + EnhancementCheckbox("Fast Drops", "gFastDrops"); + Tooltip("Skip first-time pickup messages for consumable items"); EnhancementCheckbox("Better Owl", "gBetterOwl"); Tooltip("The default response to Kaepora Gaebora is always that you understood what he said"); EnhancementCheckbox("Link's Cow in Both Time Periods", "gCowOfTime"); diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index e76b258e3..d3167210a 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -452,7 +452,7 @@ s32 EnGirlA_CanBuy_DekuNuts(GlobalContext* globalCtx, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if (Item_CheckObtainability(ITEM_NUT) == ITEM_NONE) { + if ((Item_CheckObtainability(ITEM_NUT) == ITEM_NONE) && !CVar_GetS32("gFastDrops", 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; @@ -465,7 +465,7 @@ s32 EnGirlA_CanBuy_DekuSticks(GlobalContext* globalCtx, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if (Item_CheckObtainability(ITEM_STICK) == ITEM_NONE) { + if ((Item_CheckObtainability(ITEM_STICK) == ITEM_NONE) && !CVar_GetS32("gFastDrops", 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; @@ -652,7 +652,7 @@ s32 EnGirlA_CanBuy_DekuSeeds(GlobalContext* globalCtx, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if (Item_CheckObtainability(ITEM_SEEDS) == ITEM_NONE) { + if ((Item_CheckObtainability(ITEM_SEEDS) == ITEM_NONE) && !CVar_GetS32("gFastDrops", 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; 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 dfea49458..3e0af840c 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6157,7 +6157,12 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { iREG(67) = false; - if ((Item_CheckObtainability(giEntry->itemId) == ITEM_NONE) || (globalCtx->sceneNum == SCENE_BOWLING)) { + s32 drop = giEntry->objectId; + + if ((globalCtx->sceneNum == SCENE_BOWLING) || !(CVar_GetS32("gFastDrops", 0) && + ((drop == OBJECT_GI_BOMB_1) || (drop == OBJECT_GI_NUTS) || (drop == OBJECT_GI_STICK) || + (drop == OBJECT_GI_SEED) || (drop == OBJECT_GI_MAGICPOT) || (drop == OBJECT_GI_ARROW))) && + (Item_CheckObtainability(giEntry->itemId) == ITEM_NONE)) { func_808323B4(globalCtx, this); func_8083AE40(this, giEntry->objectId);