From ec0a080956fd0277f776273b9bfe284f58014498 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 12 Jul 2022 22:08:25 -0700 Subject: [PATCH 1/4] Rando: Minor feature - quest item fanfares In rando, when we find a special quest item somewhere (e.g. a medallion, stone, or song), play that item's unique fanfare instead of the default "get item" fanfare Closes HarbourMasters/Shipwright#716 --- .../actors/ovl_player_actor/z_player.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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 1973a09a4..4e1b054df 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12675,6 +12675,33 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { else { 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 (gSaveContext.n64ddFlag) { + // If the item we're getting is a medallion, play the "get a medallion" fanfare + if ((this->getItemId == GI_MEDALLION_FOREST) || (this->getItemId == GI_MEDALLION_FIRE) || + (this->getItemId == GI_MEDALLION_WATER) || (this->getItemId == GI_MEDALLION_SHADOW) || + (this->getItemId == GI_MEDALLION_SPIRIT) || (this->getItemId == GI_MEDALLION_LIGHT)) { + 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_GORON) || + (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_SONG_OF_STORMS) || (this->getItemId == GI_SERENADE_OF_WATER) || + (this->getItemId == GI_EPONAS_SONG) || (this->getItemId == GI_SARIAS_SONG) || + (this->getItemId == GI_SUNS_SONG) || (this->getItemId == GI_SONG_OF_TIME) || + (this->getItemId == GI_PRELUDE_OF_LIGHT) || (this->getItemId == GI_MINUET_OF_FOREST) || + (this->getItemId == GI_BOLERO_OF_FIRE) || (this->getItemId == GI_NOCTURNE_OF_SHADOW) || + (this->getItemId == GI_REQUIEM_OF_SPIRIT) || (this->getItemId == GI_PRELUDE_OF_LIGHT)) { + temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; + } + } + // *************************************************************************************** + Audio_PlayFanfare(temp1); } } From d424ee6fa88658852d76f08a1915a2f7ae9fec27 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 12 Jul 2022 22:21:30 -0700 Subject: [PATCH 2/4] Fix Zelda's Lullaby Accidentally had prelude in there twice --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4e1b054df..b78a8cce3 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12696,7 +12696,7 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { (this->getItemId == GI_SUNS_SONG) || (this->getItemId == GI_SONG_OF_TIME) || (this->getItemId == GI_PRELUDE_OF_LIGHT) || (this->getItemId == GI_MINUET_OF_FOREST) || (this->getItemId == GI_BOLERO_OF_FIRE) || (this->getItemId == GI_NOCTURNE_OF_SHADOW) || - (this->getItemId == GI_REQUIEM_OF_SPIRIT) || (this->getItemId == GI_PRELUDE_OF_LIGHT)) { + (this->getItemId == GI_REQUIEM_OF_SPIRIT) || (this->getItemId == GI_ZELDAS_LULLABY)) { temp1 = NA_BGM_OCA_FAIRY_GET | 0x900; } } From dd761295fc7a6ba022684e417c96e5bcc352a8ba Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 13 Jul 2022 13:34:01 -0700 Subject: [PATCH 3/4] Add logic to also check for a toggle setting Added && for the gRandoFanfareByItemType to allow this to be a toggle setting --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b78a8cce3..073a25f0b 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12677,8 +12677,8 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { } // In Rando, if we get special quest items (medallions/stones/songs), play their respective unique fanfares - // instead of the default "get item" fanfare - if (gSaveContext.n64ddFlag) { + // instead of the default "get item" fanfare (if we have the setting toggled on) + if (gSaveContext.n64ddFlag && CVar_GetS32("gRandoFanfareByItemType", 0)) { // If the item we're getting is a medallion, play the "get a medallion" fanfare if ((this->getItemId == GI_MEDALLION_FOREST) || (this->getItemId == GI_MEDALLION_FIRE) || (this->getItemId == GI_MEDALLION_WATER) || (this->getItemId == GI_MEDALLION_SHADOW) || From fa1327553d4a37b6253def5874b71d0b802c1a6b Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Wed, 13 Jul 2022 15:12:44 -0700 Subject: [PATCH 4/4] Fix syntax I think the !=0 is needed --- soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 073a25f0b..f1d0fa6b4 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12678,7 +12678,7 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { // 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)) { + if (gSaveContext.n64ddFlag && CVar_GetS32("gRandoFanfareByItemType", 0) != 0) { // If the item we're getting is a medallion, play the "get a medallion" fanfare if ((this->getItemId == GI_MEDALLION_FOREST) || (this->getItemId == GI_MEDALLION_FIRE) || (this->getItemId == GI_MEDALLION_WATER) || (this->getItemId == GI_MEDALLION_SHADOW) ||