mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-18 19:41:29 +00:00
Rank num SFX tweak
- Add new sounds at various pitches depending on position - Don't play sound if a pass has just happened
This commit is contained in:
parent
dbb548d8ad
commit
1999cf0509
3 changed files with 45 additions and 2 deletions
11
src/k_kart.c
11
src/k_kart.c
|
|
@ -9916,10 +9916,17 @@ void K_KartUpdatePosition(player_t *player)
|
|||
|
||||
if (position != oldposition) // Changed places?
|
||||
{
|
||||
if (position < oldposition && P_IsDisplayPlayer(player) == true)
|
||||
if (player->positiondelay <= 0 && position < oldposition && P_IsDisplayPlayer(player) == true)
|
||||
{
|
||||
// Play sound when getting closer to 1st.
|
||||
S_StartSound(player->mo, sfx_mbs41);
|
||||
UINT32 soundpos = (max(0, position - 1) * MAXPLAYERS)/realplayers; // always 1-15 despite there being 16 players at max...
|
||||
#if MAXPLAYERS > 16
|
||||
if (soundpos < 15)
|
||||
{
|
||||
soundpos = 15;
|
||||
}
|
||||
#endif
|
||||
S_StartSound(player->mo, sfx_pass02 + soundpos); // ...which is why we can start at index 2 for a lower general pitch
|
||||
}
|
||||
|
||||
player->positiondelay = POS_DELAY_TIME + 4; // Position number growth
|
||||
|
|
|
|||
18
src/sounds.c
18
src/sounds.c
|
|
@ -1130,6 +1130,24 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"gate04", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"gate05", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
||||
// Passing sounds
|
||||
{"pass01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass02", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass03", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass04", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass05", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass06", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass07", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass08", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass09", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass10", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass11", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass12", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass13", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass14", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass15", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass16", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
||||
// SRB2Kart - Engine sounds
|
||||
// Engine class A
|
||||
{"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
|
|
|||
18
src/sounds.h
18
src/sounds.h
|
|
@ -1195,6 +1195,24 @@ typedef enum
|
|||
sfx_gate04,
|
||||
sfx_gate05,
|
||||
|
||||
// Passing sounds
|
||||
sfx_pass01,
|
||||
sfx_pass02,
|
||||
sfx_pass03,
|
||||
sfx_pass04,
|
||||
sfx_pass05,
|
||||
sfx_pass06,
|
||||
sfx_pass07,
|
||||
sfx_pass08,
|
||||
sfx_pass09,
|
||||
sfx_pass10,
|
||||
sfx_pass11,
|
||||
sfx_pass12,
|
||||
sfx_pass13,
|
||||
sfx_pass14,
|
||||
sfx_pass15,
|
||||
sfx_pass16,
|
||||
|
||||
// Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy...
|
||||
// Engine class A - Low Speed, Low Weight
|
||||
sfx_krta00,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue