Hopefully some medicine for the characters' sore throats from all that taunting

Also my editor ate some trailing whitespace.
This commit is contained in:
Sryder 2018-07-04 22:25:38 +01:00
parent d25f0b0d7e
commit da0c52330e

View file

@ -1241,6 +1241,26 @@ void K_KartMoveAnimation(player_t *player)
}
}
static void K_TauntVoiceTimers(player_t *player)
{
if (!player)
return;
player->kartstuff[k_tauntvoices] = 6*TICRATE;
player->kartstuff[k_voices] = 4*TICRATE;
}
static void K_RegularVoiceTimers(player_t *player)
{
if (!player)
return;
player->kartstuff[k_voices] = 3*TICRATE;
if (player->kartstuff[k_tauntvoices] < 4*TICRATE)
player->kartstuff[k_tauntvoices] = 4*TICRATE;
}
static void K_PlayTauntSound(mobj_t *source)
{
if (source->player && source->player->kartstuff[k_tauntvoices]) // Prevents taunt sounds from playing every time the button is pressed
@ -1248,11 +1268,7 @@ static void K_PlayTauntSound(mobj_t *source)
S_StartSound(source, sfx_taunt1+P_RandomKey(4));
if (source->player)
{
source->player->kartstuff[k_tauntvoices] = 6*TICRATE;
source->player->kartstuff[k_voices] = 3*TICRATE;
}
K_TauntVoiceTimers(source->player);
}
static void K_PlayOvertakeSound(mobj_t *source)
@ -1269,26 +1285,14 @@ static void K_PlayOvertakeSound(mobj_t *source)
S_StartSound(source, sfx_slow);
if (source->player)
{
source->player->kartstuff[k_voices] = 3*TICRATE;
if (source->player->kartstuff[k_tauntvoices] < 3*TICRATE)
source->player->kartstuff[k_tauntvoices] = 3*TICRATE;
}
K_RegularVoiceTimers(source->player);
}
static void K_PlayHitEmSound(mobj_t *source)
{
S_StartSound(source, sfx_hitem);
if (source->player)
{
source->player->kartstuff[k_voices] = 3*TICRATE;
if (source->player->kartstuff[k_tauntvoices] < 3*TICRATE)
source->player->kartstuff[k_tauntvoices] = 3*TICRATE;
}
K_RegularVoiceTimers(source->player);
}
void K_MomentumToFacing(player_t *player)
@ -3263,8 +3267,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (!player->exiting)
{
if (player->kartstuff[k_oldposition] <= player->kartstuff[k_position]) // But first, if you lost a place,
if (player->kartstuff[k_oldposition] < player->kartstuff[k_position]) // But first, if you lost a place,
{
player->kartstuff[k_oldposition] = player->kartstuff[k_position]; // then the other player taunts.
K_RegularVoiceTimers(player); // and you can't for a bit
}
else if (player->kartstuff[k_oldposition] > player->kartstuff[k_position]) // Otherwise,
{
K_PlayOvertakeSound(player->mo); // Say "YOU'RE TOO SLOW!"