Added use of special music when Kline or the cloak fighter shows up.
This commit is contained in:
parent
a9e98145fa
commit
82ffaebbc5
Binary file not shown.
19
src/audio.c
19
src/audio.c
|
@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
|
|
||||||
|
#include "alien.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
@ -170,6 +171,14 @@ void audio_setMusicVolume(int volume)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void audio_setMusicPosition(double position)
|
||||||
|
{
|
||||||
|
#ifndef NOSOUND
|
||||||
|
if (engine.useMusic && engine.useAudio)
|
||||||
|
Mix_SetMusicPosition(position);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void audio_playMusic(const char *filename, int loops, int amplified)
|
void audio_playMusic(const char *filename, int loops, int amplified)
|
||||||
{
|
{
|
||||||
#ifndef NOSOUND
|
#ifndef NOSOUND
|
||||||
|
@ -225,7 +234,15 @@ void audio_playRandomTrack()
|
||||||
#ifndef OLD_MUSIC
|
#ifndef OLD_MUSIC
|
||||||
case MISN_START:
|
case MISN_START:
|
||||||
case MISN_INTERCEPTION:
|
case MISN_INTERCEPTION:
|
||||||
audio_playMusic("music/railjet_short.ogg", -1, 0);
|
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE)
|
||||||
|
&& aliens[ALIEN_KLINE].active)
|
||||||
|
audio_playMusic("music/last_cyber_dance.ogg", -1, 0);
|
||||||
|
else if ((game.system == SYSTEM_MORDOR)
|
||||||
|
&& (aliens[ALIEN_BOSS].classDef == CD_CLOAKFIGHTER)
|
||||||
|
&& aliens[ALIEN_BOSS].active)
|
||||||
|
audio_playMusic("music/space_dimensions.ogg", -1, 0);
|
||||||
|
else
|
||||||
|
audio_playMusic("music/railjet_short.ogg", -1, 0);
|
||||||
break;
|
break;
|
||||||
case MISN_HAIL:
|
case MISN_HAIL:
|
||||||
case MISN_JOLDAR:
|
case MISN_JOLDAR:
|
||||||
|
|
|
@ -29,6 +29,7 @@ void audio_haltMusic();
|
||||||
void audio_pauseMusic();
|
void audio_pauseMusic();
|
||||||
void audio_resumeMusic();
|
void audio_resumeMusic();
|
||||||
void audio_setMusicVolume(int volume);
|
void audio_setMusicVolume(int volume);
|
||||||
|
void audio_setMusicPosition(double position);
|
||||||
void audio_playMusic(const char *filename, int loops, int amplified);
|
void audio_playMusic(const char *filename, int loops, int amplified);
|
||||||
void audio_playRandomTrack();
|
void audio_playRandomTrack();
|
||||||
void audio_free();
|
void audio_free();
|
||||||
|
|
11
src/game.c
11
src/game.c
|
@ -2577,7 +2577,7 @@ int game_mainLoop()
|
||||||
// Some specifics for interception missions
|
// Some specifics for interception missions
|
||||||
if (game.area == MISN_INTERCEPTION)
|
if (game.area == MISN_INTERCEPTION)
|
||||||
{
|
{
|
||||||
if ((game.system > SYSTEM_EYANANTH) && ((rand() % 5) == 0))
|
if ((game.system > SYSTEM_EYANANTH) && CHANCE(1. / 5.))
|
||||||
{
|
{
|
||||||
aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
|
aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
|
||||||
aliens[ALIEN_KLINE].owner = &aliens[ALIEN_KLINE];
|
aliens[ALIEN_KLINE].owner = &aliens[ALIEN_KLINE];
|
||||||
|
@ -2590,7 +2590,7 @@ int game_mainLoop()
|
||||||
|
|
||||||
if ((game.system == SYSTEM_MORDOR) && (game.experimentalShield > 0))
|
if ((game.system == SYSTEM_MORDOR) && (game.experimentalShield > 0))
|
||||||
{
|
{
|
||||||
if ((rand() % 5) > 0)
|
if (CHANCE(4. / 5.))
|
||||||
{
|
{
|
||||||
aliens[ALIEN_BOSS] = alien_defs[CD_CLOAKFIGHTER];
|
aliens[ALIEN_BOSS] = alien_defs[CD_CLOAKFIGHTER];
|
||||||
aliens[ALIEN_BOSS].owner = &aliens[ALIEN_BOSS];
|
aliens[ALIEN_BOSS].owner = &aliens[ALIEN_BOSS];
|
||||||
|
@ -2603,6 +2603,13 @@ int game_mainLoop()
|
||||||
aliens[ALIEN_BOSS].shield = game.experimentalShield;
|
aliens[ALIEN_BOSS].shield = game.experimentalShield;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: music is started here only for interceptions. For
|
||||||
|
// regular missions, it is instead started by
|
||||||
|
// mission_showStartScreen(). This is necessary to ensure the
|
||||||
|
// proper music can be played when Kline or the cloak fighter
|
||||||
|
// are active.
|
||||||
|
audio_playRandomTrack();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.area == MISN_VENUS)
|
if (game.area == MISN_VENUS)
|
||||||
|
|
|
@ -1175,10 +1175,12 @@ void mission_showStartScreen()
|
||||||
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
||||||
audio_playRandomTrack();
|
|
||||||
|
|
||||||
if (game.area != MISN_INTERCEPTION)
|
if (game.area != MISN_INTERCEPTION)
|
||||||
{
|
{
|
||||||
|
// Note: music is started here only for regular missions. For
|
||||||
|
// interceptions, it is instead started by game_mainLoop().
|
||||||
|
audio_playRandomTrack();
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
player_flushInput();
|
player_flushInput();
|
||||||
|
|
Loading…
Reference in New Issue