From e235f29dfe0a642129c987673429610faa18443d Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 9 Jun 2023 18:39:00 +0100 Subject: [PATCH] Sounds for Roundqueue Board, which is what I've decided I'm calling the thing at the bottom of Intermission under roundqueue conditions now - Landing sound when doing a hop (uses a Knuckles Chaotix sound, maybe temporary) - Meter fill sound when checking Rank for Sealed Star - Stopping early when Rank is too low (same sound as Landing, potentially temporary if someone gets inspired) --- src/sounds.c | 1 + src/sounds.h | 1 + src/y_inter.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/src/sounds.c b/src/sounds.c index 85b111a50..9e2702a10 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1102,6 +1102,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"typri2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 final boss-type typewriting {"eggspr", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Sonic Unleashed Trap Spring {"achiev", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Achievement"}, + {"gpmetr", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // End of a "Tutorial Teleport" {"endwrp", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // End of a "Tutorial Teleport" // SRB2Kart - Drop target sounds diff --git a/src/sounds.h b/src/sounds.h index a2f786030..a3a72c6a7 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1169,6 +1169,7 @@ typedef enum sfx_typri2, sfx_eggspr, sfx_achiev, + sfx_gpmetr, sfx_endwrp, // SRB2Kart - Drop target sounds diff --git a/src/y_inter.c b/src/y_inter.c index e90ab6cd3..54e301db6 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1498,6 +1498,35 @@ void Y_Ticker(void) return; } + // Animation sounds for roundqueue, see Y_RoundQueueDrawer + if (roundqueue.size != 0 + && roundqueue.position != 0 + && (timer - 1) <= 2*TICRATE) + { + const INT32 through = ((2*TICRATE) - (timer - 1)); + + if (data.showrank == true + && roundqueue.position == roundqueue.size-1) + { + // Handle special entry on the end + if (through == data.linemeter && timer > 2) + { + S_StopSoundByID(NULL, sfx_gpmetr); + S_StartSound(NULL, sfx_kc50); + } + else if (through == 0) + { + S_StartSound(NULL, sfx_gpmetr); + } + } + else if (through == 9 + && roundqueue.position < roundqueue.size) + { + // Impactful landing + S_StartSound(NULL, sfx_kc50); + } + } + if (intertic < TICRATE || endtic != -1) { return;