Added new sound effects.

This commit is contained in:
Steve 2016-06-05 11:22:19 +01:00
parent 95e9d4d9a0
commit 0306e2bbea
11 changed files with 71 additions and 2 deletions

View File

@ -70,6 +70,11 @@ All other data files are CC BY-NC-SA 3.0, with the following attribution: Copyri
* 254174__kwahmah-02__s.ogg - s.wav, by kwahmah_02 (CC-0) - https://freesound.org/people/kwahmah_02/sounds/254174/ * 254174__kwahmah-02__s.ogg - s.wav, by kwahmah_02 (CC-0) - https://freesound.org/people/kwahmah_02/sounds/254174/
* 172870__escortmarius__carbidexplosion.ogg - carbidexplosion.wav, by escortmarius (CC-BY) - https://freesound.org/people/escortmarius/sounds/172870/ * 172870__escortmarius__carbidexplosion.ogg - carbidexplosion.wav, by escortmarius (CC-BY) - https://freesound.org/people/escortmarius/sounds/172870/
* 320181__dland__hint.ogg - hint.wav, by dland (CC-0) - https://freesound.org/people/dland/sounds/320181/ * 320181__dland__hint.ogg - hint.wav, by dland (CC-0) - https://freesound.org/people/dland/sounds/320181/
* 62491__benboncan__dslr-click.ogg - DSLR Click.wav, by Benboncan (CC-BY) - https://freesound.org/people/Benboncan/sounds/62491/
* 154934__klawykogut__empty-gun-shot.ogg - Empty Gun Shot, by KlawyKogut (CC-0) - https://freesound.org/people/KlawyKogut/sounds/154934/
* 107786__leviclaassen__beepbeep.ogg - beepbeep.wav, by leviclaassen (CC-BY) - https://freesound.org/people/leviclaassen/sounds/107786/
* 33785__jobro__4-beep-b.ogg - 4 beep b.wav, by jobro (CC-BY) - https://freesound.org/people/jobro/sounds/33785/
### MUSIC ### MUSIC

View File

@ -207,6 +207,22 @@
"0 24 hint.wav, by dland (CC-0)", "0 24 hint.wav, by dland (CC-0)",
"0 24 https://freesound.org/people/dland/sounds/320181/", "0 24 https://freesound.org/people/dland/sounds/320181/",
"30 24 62491__benboncan__dslr-click.ogg",
"0 24 DSLR Click.wav, by Benboncan (CC-BY)",
"0 24 https://freesound.org/people/Benboncan/sounds/62491/",
"30 24 154934__klawykogut__empty-gun-shot.ogg",
"0 24 Empty Gun Shot, by KlawyKogut (CC-0)",
"0 24 https://freesound.org/people/KlawyKogut/sounds/154934/",
"30 24 107786__leviclaassen__beepbeep.ogg",
"0 24 beepbeep.wav, by leviclaassen (CC-BY)",
"0 24 https://freesound.org/people/leviclaassen/sounds/107786/",
"30 24 33785__jobro__4-beep-b.ogg",
"0 24 4 beep b.wav, by jobro (CC-BY)",
"0 24 https://freesound.org/people/jobro/sounds/33785/",
"75 30 MUSIC", "75 30 MUSIC",
"30 24 Battle in the winter.mp3", "30 24 Battle in the winter.mp3",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -248,6 +248,9 @@ void activateObjectives(char *objectives)
{ {
char *token; char *token;
Objective *o; Objective *o;
int activated;
activated = 0;
token = strtok(objectives, ";"); token = strtok(objectives, ";");
@ -264,11 +267,18 @@ void activateObjectives(char *objectives)
{ {
updateObjective(o->targetName, o->targetType); updateObjective(o->targetName, o->targetType);
} }
activated = 1;
} }
} }
token = strtok(NULL, ";"); token = strtok(NULL, ";");
} }
if (activated)
{
playSound(SND_NEW_OBJECTIVE);
}
} }
void loadObjectives(cJSON *node) void loadObjectives(cJSON *node)

View File

@ -28,6 +28,7 @@ extern void failMission(void);
extern char *getTranslatedString(char *string); extern char *getTranslatedString(char *string);
extern int getJSONValue(cJSON *node, char *name, int defValue); extern int getJSONValue(cJSON *node, char *name, int defValue);
extern long lookup(char *name); extern long lookup(char *name);
extern void playSound(int id);
extern Battle battle; extern Battle battle;
extern Colors colors; extern Colors colors;

View File

@ -36,6 +36,7 @@ static void preFireMissile(void);
static void applyRestrictions(void); static void applyRestrictions(void);
static int isPriorityMissionTarget(Entity *e, int dist, int closest); static int isPriorityMissionTarget(Entity *e, int dist, int closest);
static int targetOutOfRange(void); static int targetOutOfRange(void);
static void rechargeBoostECM(void);
static void setPilotName(void); static void setPilotName(void);
static int selectedPlayerIndex; static int selectedPlayerIndex;
@ -119,8 +120,7 @@ static void setPilotName(void)
void doPlayer(void) void doPlayer(void)
{ {
battle.boostTimer = MIN(battle.boostTimer + 1, BOOST_RECHARGE_TIME); rechargeBoostECM();
battle.ecmTimer = MIN(battle.ecmTimer + 1, ECM_RECHARGE_TIME);
self = player; self = player;
@ -196,6 +196,25 @@ void doPlayer(void)
} }
} }
static void rechargeBoostECM(void)
{
int boostTimer, ecmTimer;
boostTimer = battle.boostTimer;
battle.boostTimer = MIN(battle.boostTimer + 1, BOOST_RECHARGE_TIME);
if (boostTimer < BOOST_RECHARGE_TIME && battle.boostTimer == BOOST_RECHARGE_TIME)
{
playSound(SND_RECHARGED);
}
ecmTimer = battle.ecmTimer;
battle.ecmTimer = MIN(battle.ecmTimer + 1, ECM_RECHARGE_TIME);
if (ecmTimer < ECM_RECHARGE_TIME && battle.ecmTimer == ECM_RECHARGE_TIME)
{
playSound(SND_RECHARGED);
}
}
static int targetOutOfRange(void) static int targetOutOfRange(void)
{ {
return (app.gameplay.autoSwitchPlayerTarget && getDistance(player->x, player->y, player->target->x, player->target->y) > SCREEN_WIDTH * 2); return (app.gameplay.autoSwitchPlayerTarget && getDistance(player->x, player->y, player->target->x, player->target->y) > SCREEN_WIDTH * 2);
@ -384,9 +403,17 @@ static void preFireMissile(void)
} }
else else
{ {
playSound(SND_GUI_DENIED);
addHudMessage(colors.white, _("Target not in range")); addHudMessage(colors.white, _("Target not in range"));
} }
} }
else if (!player->missiles)
{
addHudMessage(colors.white, _("Out of missiles"));
playSound(SND_NO_MISSILES);
}
} }
void initPlayerSelect(void) void initPlayerSelect(void)
@ -650,6 +677,8 @@ static int isPriorityMissionTarget(Entity *e, int dist, int closest)
static void cycleRadarZoom(void) static void cycleRadarZoom(void)
{ {
battle.radarRange = (battle.radarRange + 1) % 3; battle.radarRange = (battle.radarRange + 1) % 3;
playSound(SND_ZOOM);
} }
int playerHasGun(int type) int playerHasGun(int type)

View File

@ -279,6 +279,10 @@ enum
SND_GUI_SELECT, SND_GUI_SELECT,
SND_GUI_CLOSE, SND_GUI_CLOSE,
SND_GUI_DENIED, SND_GUI_DENIED,
SND_ZOOM,
SND_NEW_OBJECTIVE,
SND_NO_MISSILES,
SND_RECHARGED,
SND_MAX SND_MAX
}; };

View File

@ -122,6 +122,10 @@ static void loadSounds(void)
sounds[SND_MINE_WARNING] = loadSound("sound/254174__kwahmah-02__s.ogg"); sounds[SND_MINE_WARNING] = loadSound("sound/254174__kwahmah-02__s.ogg");
sounds[SND_TIME_WARNING] = loadSound("sound/320181__dland__hint.ogg"); sounds[SND_TIME_WARNING] = loadSound("sound/320181__dland__hint.ogg");
sounds[SND_CAP_DEATH] = loadSound("sound/000000_large_explosion.ogg"); sounds[SND_CAP_DEATH] = loadSound("sound/000000_large_explosion.ogg");
sounds[SND_ZOOM] = loadSound("sound/62491__benboncan__dslr-click.ogg");
sounds[SND_NO_MISSILES] = loadSound("sound/154934__klawykogut__empty-gun-shot.ogg");
sounds[SND_NEW_OBJECTIVE] = loadSound("sound/107786__leviclaassen__beepbeep.ogg");
sounds[SND_RECHARGED] = loadSound("sound/33785__jobro__4-beep-b.ogg");
sounds[SND_GUI_CLICK] = loadSound("sound/257786__xtrgamr__mouse-click.ogg"); sounds[SND_GUI_CLICK] = loadSound("sound/257786__xtrgamr__mouse-click.ogg");
sounds[SND_GUI_SELECT] = loadSound("sound/321104__nsstudios__blip2.ogg"); sounds[SND_GUI_SELECT] = loadSound("sound/321104__nsstudios__blip2.ogg");