diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index aa67f1a20..a7d4271d8 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -115,7 +115,50 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { player->actor.freezeTimer = 20; } Message_StartTextbox(globalCtx, textId, NULL); - Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); + + // Restore appropriate item fanfares in rando when we're obtaining items outside of their + // normal contexts (this code more or less copied from z_player.c) + if (gSaveContext.n64ddFlag) { + s32 temp1; + + if (((getItemId >= GI_RUPEE_GREEN) && (getItemId <= GI_RUPEE_RED)) || + ((getItemId >= GI_RUPEE_PURPLE) && (getItemId <= GI_RUPEE_GOLD)) || + ((getItemId >= GI_RUPEE_GREEN_LOSE) && (getItemId <= GI_RUPEE_PURPLE_LOSE)) || + (getItemId == GI_HEART)) { + Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } else { + if ((getItemId == GI_HEART_CONTAINER_2) || (getItemId == GI_HEART_CONTAINER) || + ((getItemId == GI_HEART_PIECE) && + ((gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000))) { + temp1 = NA_BGM_HEART_GET | 0x900; + } else { + temp1 = (getItemId == GI_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900; + } + // If we get a skulltula token, play "get small item" + if (getItemId == GI_SKULL_TOKEN) { + temp1 = NA_BGM_SMALL_ITEM_GET | 0x900; + } + // If the setting is toggled on and we get special quest items (longer fanfares): + if (CVar_GetS32("gRandoFanfareByItemType", 0) != 0) { + // If we get a medallion, play the "get a medallion" fanfare + if ((getItemId >= GI_MEDALLION_LIGHT) && (getItemId <= GI_MEDALLION_SPIRIT)) { + temp1 = NA_BGM_MEDALLION_GET | 0x900; + } + // If it's a Spiritual Stone, play the "get a spiritual stone" fanfare + if ((getItemId >= GI_STONE_KOKIRI) && (getItemId <= GI_STONE_ZORA)) { + temp1 = NA_BGM_SPIRITUAL_STONE | 0x900; + } + // If the item we're getting is a song, play the "learned a song" fanfare + if ((getItemId >= GI_ZELDAS_LULLABY) && (getItemId <= GI_PRELUDE_OF_LIGHT)) { + temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; + } + } + Audio_PlayFanfare(temp1); + }// ********************************************* + } else { + Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); + } this->actionFunc = func_80AFB950; } else { Collider_UpdateCylinder(&this->actor, &this->collider); 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 c53be404f..8f2091bca 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12700,21 +12700,28 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { temp1 = temp2 = (this->getItemId == GI_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900; } - // In Rando, if we get special quest items (medallions/stones/songs), play their respective unique fanfares - // instead of the default "get item" fanfare (if we have the setting toggled on) - if (gSaveContext.n64ddFlag && CVar_GetS32("gRandoFanfareByItemType", 0) != 0) { - if ((this->getItemId >= GI_MEDALLION_LIGHT) && (this->getItemId <= GI_MEDALLION_SPIRIT)) { - temp1 = NA_BGM_MEDALLION_GET | 0x900; + // Restore appropriate item fanfares in rando when we're obtaining items outside of their normal contexts + if (gSaveContext.n64ddFlag) { + // If we get a skulltula token, play "get small item" (for tokensanity) + if (this->getItemId == GI_SKULL_TOKEN) { + temp1 = NA_BGM_SMALL_ITEM_GET | 0x900; + } + // If the setting is toggled on and we get special quest items (longer fanfares): + if (CVar_GetS32("gRandoFanfareByItemType", 0) != 0) { + // If we get a medallion, play the "get a medallion" fanfare + if ((this->getItemId >= GI_MEDALLION_LIGHT) && (this->getItemId <= GI_MEDALLION_SPIRIT)) { + temp1 = NA_BGM_MEDALLION_GET | 0x900; + } + // If it's a Spiritual Stone, play the "get a spiritual stone" fanfare + if ((this->getItemId >= GI_STONE_KOKIRI) && (this->getItemId <= GI_STONE_ZORA)) { + temp1 = NA_BGM_SPIRITUAL_STONE | 0x900; + } + // If the item we're getting is a song, play the "learned a song" fanfare + if ((this->getItemId >= GI_ZELDAS_LULLABY) && (this->getItemId <= GI_PRELUDE_OF_LIGHT)) { + temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; + } } - // If it's a Spiritual Stone, play the "get a spiritual stone" fanfare - if ((this->getItemId >= GI_STONE_KOKIRI) && (this->getItemId <= GI_STONE_ZORA)) { - temp1 = NA_BGM_SPIRITUAL_STONE | 0x900; - } - // If the item we're getting is a song, play the "learned a song" fanfare - if ((this->getItemId >= GI_ZELDAS_LULLABY) && (this->getItemId <= GI_PRELUDE_OF_LIGHT)) { - temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; - } - } // *************************************************************************************** + }// *************************************************************************************** Audio_PlayFanfare(temp1); }