From c6cd0f5e03610c0d8cf6d63aebf2db28a949e5b3 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Mon, 25 Jul 2022 12:43:36 -0700 Subject: [PATCH] Fix special case with the "WINNER" heart The "WINNER" heart is its own unique item rather than just another piece of heart, so it needed its own check to make it consistent with other pieces of heart --- soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 8 ++++++-- soh/src/overlays/actors/ovl_player_actor/z_player.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) 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 9c3ede3d3..1aba4fae3 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 @@ -180,10 +180,14 @@ void Audio_PlayFanfare_Rando() { } 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) { + // If we get a skulltula token or the "WINNER" heart, play "get small item" + if (getItemId == GI_SKULL_TOKEN || getItemId == GI_HEART_PIECE_WIN) { temp1 = NA_BGM_SMALL_ITEM_GET | 0x900; } + // But if the "WINNER" heart is the 4th heart piece collected, play "get heart container" + if (getItemId == GI_HEART_PIECE_WIN && ((gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000)) { + temp1 = NA_BGM_HEART_GET | 0x900; + } // If the setting is toggled on and we get special quest items (longer fanfares): if (CVar_GetS32("gRandoQuestItemFanfares", 0) != 0) { // If we get a medallion, play the "get a medallion" fanfare 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 c906eb162..cdc63422f 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12702,10 +12702,15 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { // 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) { + // If we get a skulltula token (in tokensanity) or the "WINNER" heart, play "get small item" + if (this->getItemId == GI_SKULL_TOKEN || this->getItemId == GI_HEART_PIECE_WIN) { temp1 = NA_BGM_SMALL_ITEM_GET | 0x900; - } + } + // But if the "WINNER" heart is the 4th heart piece collected, play "get heart container" + if (this->getItemId == GI_HEART_PIECE_WIN && + ((gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000)) { + temp1 = NA_BGM_HEART_GET | 0x900; + } // If the setting is toggled on and we get special quest items (longer fanfares): if (CVar_GetS32("gRandoQuestItemFanfares", 0) != 0) { // If we get a medallion, play the "get a medallion" fanfare