mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-31 09:31:26 -04:00
Cleans up and updates item fanfares.
This commit is contained in:
@@ -3892,28 +3892,33 @@ void Audio_ResetSfxChannelState(void) {
|
||||
|
||||
// Function to play "get-item" fanfares according to the type of item obtained (used in rando)
|
||||
// Longer fanfares for medallions/stones/songs are behind the Cvar
|
||||
void Audio_PlayFanfare_Rando(ItemID getItemId) {
|
||||
void Audio_PlayFanfare_Rando(GetItemEntry getItem) {
|
||||
s32 temp1;
|
||||
s16 getItemId = getItem.getItemId;
|
||||
|
||||
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;
|
||||
if (getItem.modIndex == MOD_NONE) {
|
||||
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 {
|
||||
temp1 = (getItemId == GI_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900;
|
||||
}
|
||||
// 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 ((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 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;
|
||||
}
|
||||
Audio_PlayFanfare(temp1);
|
||||
}
|
||||
} else if (getItem.modIndex == MOD_RANDOMIZER) {
|
||||
// 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
|
||||
|
||||
@@ -12578,67 +12578,38 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) {
|
||||
}
|
||||
Player_SetPendingFlag(this, globalCtx);
|
||||
|
||||
if (this->getItemEntry.objectId == OBJECT_INVALID) {
|
||||
// Use this if player does not have a getItemEntry
|
||||
if (giEntry.modIndex == MOD_NONE) {
|
||||
if (((this->getItemId >= GI_RUPEE_GREEN) && (this->getItemId <= GI_RUPEE_RED)) ||
|
||||
((this->getItemId >= GI_RUPEE_PURPLE) && (this->getItemId <= GI_RUPEE_GOLD)) ||
|
||||
((this->getItemId >= GI_RUPEE_GREEN_LOSE) && (this->getItemId <= GI_RUPEE_PURPLE_LOSE)) ||
|
||||
(this->getItemId == GI_HEART)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
} else {
|
||||
if ((this->getItemId == GI_HEART_CONTAINER_2) || (this->getItemId == GI_HEART_CONTAINER) ||
|
||||
((this->getItemId == GI_HEART_PIECE) &&
|
||||
((gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000))) {
|
||||
temp1 = NA_BGM_HEART_GET | 0x900;
|
||||
} else {
|
||||
temp1 = temp2 =
|
||||
(this->getItemId == GI_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900;
|
||||
}
|
||||
Audio_PlayFanfare(temp1);
|
||||
}
|
||||
} else if (giEntry.modIndex == MOD_RANDOMIZER) {
|
||||
if (this->getItemId == RG_DOUBLE_DEFENSE || this->getItemId == RG_MAGIC_SINGLE ||
|
||||
this->getItemId == RG_MAGIC_DOUBLE) {
|
||||
Audio_PlayFanfare(NA_BGM_HEART_GET | 0x900);
|
||||
} else {
|
||||
Audio_PlayFanfare(NA_BGM_ITEM_GET | 0x900);
|
||||
}
|
||||
// Use this if we do have a getItemEntry
|
||||
if (giEntry.modIndex == MOD_NONE) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Audio_PlayFanfare_Rando(this->getItemId);
|
||||
} else if (((giEntry.itemId >= ITEM_RUPEE_GREEN) && (giEntry.itemId <= ITEM_RUPEE_RED)) ||
|
||||
((giEntry.itemId >= ITEM_RUPEE_PURPLE) && (giEntry.itemId <= ITEM_RUPEE_GOLD)) ||
|
||||
(giEntry.itemId == ITEM_HEART)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
} else {
|
||||
if ((giEntry.itemId == ITEM_HEART_CONTAINER) ||
|
||||
((giEntry.itemId == ITEM_HEART_PIECE) &&
|
||||
((gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000))) {
|
||||
temp1 = NA_BGM_HEART_GET | 0x900;
|
||||
} else {
|
||||
temp1 = temp2 =
|
||||
(giEntry.itemId == ITEM_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900;
|
||||
}
|
||||
Audio_PlayFanfare(temp1);
|
||||
}
|
||||
} else if (giEntry.modIndex == MOD_RANDOMIZER) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Audio_PlayFanfare_Rando(this->getItemId);
|
||||
} else if (giEntry.itemId == RG_DOUBLE_DEFENSE || giEntry.itemId == RG_MAGIC_SINGLE ||
|
||||
giEntry.itemId == RG_MAGIC_DOUBLE) {
|
||||
Audio_PlayFanfare(NA_BGM_HEART_GET | 0x900);
|
||||
} else {
|
||||
// Just in case something weird happens with MOD_INDEX
|
||||
Audio_PlayFanfare(NA_BGM_ITEM_GET | 0x900);
|
||||
}
|
||||
} else {
|
||||
// Use this if we do have a getItemEntry
|
||||
if (giEntry.modIndex == MOD_NONE) {
|
||||
if (((giEntry.itemId >= ITEM_RUPEE_GREEN) && (giEntry.itemId <= ITEM_RUPEE_RED)) ||
|
||||
((giEntry.itemId >= ITEM_RUPEE_PURPLE) && (giEntry.itemId <= ITEM_RUPEE_GOLD)) ||
|
||||
(giEntry.itemId == ITEM_HEART)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
} else {
|
||||
if ((giEntry.itemId == ITEM_HEART_CONTAINER) ||
|
||||
((giEntry.itemId == ITEM_HEART_PIECE) &&
|
||||
((gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000))) {
|
||||
temp1 = NA_BGM_HEART_GET | 0x900;
|
||||
} else {
|
||||
temp1 = temp2 =
|
||||
(giEntry.itemId == ITEM_HEART_PIECE) ? NA_BGM_SMALL_ITEM_GET : NA_BGM_ITEM_GET | 0x900;
|
||||
}
|
||||
Audio_PlayFanfare(temp1);
|
||||
}
|
||||
} else if (giEntry.modIndex == MOD_RANDOMIZER) {
|
||||
if (giEntry.itemId == RG_DOUBLE_DEFENSE || giEntry.itemId == RG_MAGIC_SINGLE ||
|
||||
giEntry.itemId == RG_MAGIC_DOUBLE) {
|
||||
Audio_PlayFanfare(NA_BGM_HEART_GET | 0x900);
|
||||
} else {
|
||||
Audio_PlayFanfare(NA_BGM_ITEM_GET | 0x900);
|
||||
}
|
||||
} else {
|
||||
// Just in case something weird happens with modIndex.
|
||||
Audio_PlayFanfare(NA_BGM_ITEM_GET | 0x900);
|
||||
}
|
||||
// Just in case something weird happens with modIndex.
|
||||
Audio_PlayFanfare(NA_BGM_ITEM_GET | 0x900);
|
||||
}
|
||||
//this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
} else {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
|
||||
if (this->getItemId == GI_GAUNTLETS_SILVER && !gSaveContext.n64ddFlag) {
|
||||
|
||||
Reference in New Issue
Block a user