mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
Battle: Overtime music
- Fade out level music for 1.5 seconds when "Hurry up!" plays. - Play SHWDWN when level music finishes fading out. - Switch to SHWDN2 when there are 2 players left and the Overtime Barrier has reached its smallest size. - Plays a loud noise to mask the transition.
This commit is contained in:
parent
b7c9c92749
commit
c192e57426
2 changed files with 46 additions and 3 deletions
|
|
@ -21,6 +21,10 @@
|
||||||
#include "p_spec.h"
|
#include "p_spec.h"
|
||||||
#include "k_objects.h"
|
#include "k_objects.h"
|
||||||
#include "k_rank.h"
|
#include "k_rank.h"
|
||||||
|
#include "music.h"
|
||||||
|
#include "hu_stuff.h"
|
||||||
|
|
||||||
|
#define BARRIER_MIN_RADIUS (768 * mapobjectscale)
|
||||||
|
|
||||||
// Battle overtime info
|
// Battle overtime info
|
||||||
struct battleovertime battleovertime;
|
struct battleovertime battleovertime;
|
||||||
|
|
@ -142,6 +146,12 @@ void K_CheckBumpers(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (numingame <= 2 && battleovertime.enabled && battleovertime.radius <= BARRIER_MIN_RADIUS)
|
||||||
|
{
|
||||||
|
Music_Stop("battle_overtime");
|
||||||
|
S_StartSound(NULL, sfx_kc4b); // Loud noise helps mask transition
|
||||||
|
}
|
||||||
|
|
||||||
if (K_Cooperative())
|
if (K_Cooperative())
|
||||||
{
|
{
|
||||||
if (nobumpers > 0 && nobumpers >= numingame)
|
if (nobumpers > 0 && nobumpers >= numingame)
|
||||||
|
|
@ -678,19 +688,36 @@ void K_RunBattleOvertime(void)
|
||||||
{
|
{
|
||||||
battleovertime.enabled++;
|
battleovertime.enabled++;
|
||||||
if (battleovertime.enabled == TICRATE)
|
if (battleovertime.enabled == TICRATE)
|
||||||
|
{
|
||||||
S_StartSound(NULL, sfx_bhurry);
|
S_StartSound(NULL, sfx_bhurry);
|
||||||
if (battleovertime.enabled == 10*TICRATE)
|
Music_DelayEnd("level", 0);
|
||||||
|
}
|
||||||
|
else if (battleovertime.enabled == 10*TICRATE)
|
||||||
S_StartSound(NULL, sfx_kc40);
|
S_StartSound(NULL, sfx_kc40);
|
||||||
|
|
||||||
|
if (!Music_Playing("level") && !Music_Playing("battle_overtime"))
|
||||||
|
{
|
||||||
|
Music_Play("battle_overtime");
|
||||||
|
Music_Play("battle_overtime_stress");
|
||||||
|
|
||||||
|
// Sync approximately with looping section of
|
||||||
|
// battle_overtime. (This is file dependant.)
|
||||||
|
Music_Seek("battle_overtime_stress", 1756);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (battleovertime.radius > 0)
|
else if (battleovertime.radius > 0)
|
||||||
{
|
{
|
||||||
const fixed_t minradius = 768 * mapobjectscale;
|
const fixed_t minradius = BARRIER_MIN_RADIUS;
|
||||||
|
const fixed_t oldradius = battleovertime.radius;
|
||||||
|
|
||||||
if (battleovertime.radius > minradius)
|
if (battleovertime.radius > minradius)
|
||||||
battleovertime.radius -= (battleovertime.initial_radius / (30*TICRATE));
|
battleovertime.radius -= (battleovertime.initial_radius / (30*TICRATE));
|
||||||
|
|
||||||
if (battleovertime.radius < minradius)
|
if (battleovertime.radius <= minradius && oldradius > minradius)
|
||||||
|
{
|
||||||
battleovertime.radius = minradius;
|
battleovertime.radius = minradius;
|
||||||
|
K_CheckBumpers();
|
||||||
|
}
|
||||||
|
|
||||||
// Subtract the 10 second grace period of the barrier
|
// Subtract the 10 second grace period of the barrier
|
||||||
if (battleovertime.enabled < 25*TICRATE)
|
if (battleovertime.enabled < 25*TICRATE)
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ void Music_Init(void)
|
||||||
Tune& tune = g_tunes.insert("level");
|
Tune& tune = g_tunes.insert("level");
|
||||||
|
|
||||||
tune.priority = 1;
|
tune.priority = 1;
|
||||||
|
tune.fade_out = 1500;
|
||||||
|
tune.fade_out_inclusive = false;
|
||||||
tune.resume_fade_in = 750;
|
tune.resume_fade_in = 750;
|
||||||
tune.sync = true;
|
tune.sync = true;
|
||||||
tune.credit = true;
|
tune.credit = true;
|
||||||
|
|
@ -48,6 +50,20 @@ void Music_Init(void)
|
||||||
tune.fade_out = 3500;
|
tune.fade_out = 3500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Tune& tune = g_tunes.insert("battle_overtime", g_tunes.find("level"));
|
||||||
|
|
||||||
|
tune.song = "shwdwn";
|
||||||
|
tune.priority = 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Tune& tune = g_tunes.insert("battle_overtime_stress", g_tunes.find("battle_overtime"));
|
||||||
|
|
||||||
|
tune.song = "shwdn2";
|
||||||
|
tune.priority = 10;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Tune& tune = g_tunes.insert("grow");
|
Tune& tune = g_tunes.insert("grow");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue