diff --git a/sound/000000_tow-rope-attach.ogg b/sound/000000_tow-rope-attach.ogg new file mode 100644 index 0000000..ee9e7b8 Binary files /dev/null and b/sound/000000_tow-rope-attach.ogg differ diff --git a/sound/146311__jgeralyn__shortailenliketone2-lower.ogg b/sound/146311__jgeralyn__shortailenliketone2-lower.ogg new file mode 100644 index 0000000..2132314 Binary files /dev/null and b/sound/146311__jgeralyn__shortailenliketone2-lower.ogg differ diff --git a/sound/246420__oceanictrancer__game-sound-effect-menu.ogg b/sound/246420__oceanictrancer__game-sound-effect-menu.ogg new file mode 100644 index 0000000..f9e9c69 Binary files /dev/null and b/sound/246420__oceanictrancer__game-sound-effect-menu.ogg differ diff --git a/sound/255729__manholo__inception-stab-l.ogg b/sound/255729__manholo__inception-stab-l.ogg new file mode 100644 index 0000000..a72dada Binary files /dev/null and b/sound/255729__manholo__inception-stab-l.ogg differ diff --git a/src/battle/objectives.c b/src/battle/objectives.c index 43c7d38..791dde5 100644 --- a/src/battle/objectives.c +++ b/src/battle/objectives.c @@ -54,6 +54,8 @@ void doObjectives(void) o->status = OS_COMPLETE; runScriptFunction("OBJECTIVES_COMPLETE %d", battle.numObjectivesComplete + 1); + + playSound(SND_OBJECTIVE_COMPLETE); } } else @@ -140,6 +142,8 @@ void updateObjective(char *name, int type) o->status = OS_COMPLETE; runScriptFunction("OBJECTIVES_COMPLETE %d", ++completed); + + playSound(SND_OBJECTIVE_COMPLETE); } } } @@ -173,7 +177,10 @@ void adjustObjectiveTargetValue(char *name, int type, int amount) if (o->currentValue >= o->targetValue && o->targetValue > 0) { o->status = OS_COMPLETE; + addHudMessage(colors.green, _("%s - Objective Complete!"), o->description); + + playSound(SND_OBJECTIVE_COMPLETE); } } } @@ -195,6 +202,7 @@ void updateCondition(char *name, int type) { o->status = OS_FAILED; addHudMessage(colors.red, _("%s - Objective Failed!"), o->description); + playSound(SND_OBJECTIVE_FAILED); } else if (!o->hideNumbers) { diff --git a/src/battle/rope.c b/src/battle/rope.c index 2e577a2..558e9f6 100644 --- a/src/battle/rope.c +++ b/src/battle/rope.c @@ -52,6 +52,8 @@ void attachRope(void) battle.stats[STAT_NUM_TOWED]++; addHudMessage(colors.white, _("Tow rope attached")); } + + playBattleSound(SND_TOW_ROPE, e->x, e->y); } } } diff --git a/src/battle/rope.h b/src/battle/rope.h index c8dc18e..6129c07 100644 --- a/src/battle/rope.h +++ b/src/battle/rope.h @@ -28,6 +28,7 @@ extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore); extern void addHudMessage(SDL_Color c, char *format, ...); extern void runScriptFunction(char *format, ...); extern char *getTranslatedString(char *string); +extern void playBattleSound(int id, int x, int y); extern App app; extern Battle battle; diff --git a/src/battle/waypoints.c b/src/battle/waypoints.c index 5f5f346..b0d0154 100644 --- a/src/battle/waypoints.c +++ b/src/battle/waypoints.c @@ -81,6 +81,8 @@ static void think(void) } battle.stats[STAT_WAYPOINTS_VISITED]++; + + playSound(SND_WAYPOINT); } } } diff --git a/src/battle/waypoints.h b/src/battle/waypoints.h index 00cfd14..6c5de2e 100644 --- a/src/battle/waypoints.h +++ b/src/battle/waypoints.h @@ -27,6 +27,7 @@ extern Entity *spawnEntity(void); extern void updateObjective(char *name, int type); extern void runScriptFunction(char *format, ...); extern char *getTranslatedString(char *string); +extern void playSound(int id); extern Battle battle; extern Colors colors; diff --git a/src/defs.h b/src/defs.h index e817196..5f81eb7 100644 --- a/src/defs.h +++ b/src/defs.h @@ -283,6 +283,10 @@ enum SND_NEW_OBJECTIVE, SND_NO_MISSILES, SND_RECHARGED, + SND_TOW_ROPE, + SND_OBJECTIVE_COMPLETE, + SND_OBJECTIVE_FAILED, + SND_WAYPOINT, SND_MAX }; diff --git a/src/system/sound.c b/src/system/sound.c index d680c11..f16a578 100644 --- a/src/system/sound.c +++ b/src/system/sound.c @@ -124,8 +124,12 @@ static void loadSounds(void) 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_TOW_ROPE] = loadSound("sound/000000_tow-rope-attach.ogg"); + sounds[SND_NEW_OBJECTIVE] = loadSound("sound/246420__oceanictrancer__game-sound-effect-menu.ogg"); + sounds[SND_OBJECTIVE_COMPLETE] = loadSound("sound/107786__leviclaassen__beepbeep.ogg"); + sounds[SND_OBJECTIVE_FAILED] = loadSound("sound/255729__manholo__inception-stab-l.ogg"); + sounds[SND_WAYPOINT] = loadSound("sound/146311__jgeralyn__shortailenliketone2-lower.ogg"); sounds[SND_GUI_CLICK] = loadSound("sound/257786__xtrgamr__mouse-click.ogg"); sounds[SND_GUI_SELECT] = loadSound("sound/321104__nsstudios__blip2.ogg");