Play pop sound when no blood option selected.

This commit is contained in:
Steve 2018-03-21 07:29:04 +00:00
parent 09487a5eb9
commit 96949ec97c
6 changed files with 19 additions and 2 deletions

Binary file not shown.

View File

@ -322,6 +322,7 @@ enum
SND_ELECTRIC_HIT, SND_ELECTRIC_HIT,
SND_ITEM_PAD, SND_ITEM_PAD,
SND_POWER_POOL, SND_POWER_POOL,
SND_POP,
SND_MAX SND_MAX
}; };

View File

@ -368,7 +368,14 @@ static void doDying(void)
world.state = WS_GAME_OVER; world.state = WS_GAME_OVER;
playSound(SND_SPLAT, world.bob->uniqueId % MAX_SND_CHANNELS); if (app.config.blood)
{
playSound(SND_SPLAT, world.bob->uniqueId % MAX_SND_CHANNELS);
}
else
{
playSound(SND_POP, world.bob->uniqueId % MAX_SND_CHANNELS);
}
game.stats[STAT_DEATHS]++; game.stats[STAT_DEATHS]++;
} }

View File

@ -47,6 +47,7 @@ extern int rrnd(int low, int high);
extern void setGameplayMessage(int type, char *format, ...); extern void setGameplayMessage(int type, char *format, ...);
extern void throwFleshChunks(float x, float y, int amount); extern void throwFleshChunks(float x, float y, int amount);
extern App app;
extern Dev dev; extern Dev dev;
extern Game game; extern Game game;
extern World world; extern World world;

View File

@ -94,7 +94,14 @@ static void die2(void)
my = (int) (u->y / MAP_TILE_SIZE) + 1; my = (int) (u->y / MAP_TILE_SIZE) + 1;
addBloodDecal(mx, my); addBloodDecal(mx, my);
playBattleSound(SND_SPLAT, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); if (app.config.blood)
{
playBattleSound(SND_SPLAT, world.bob->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
}
else
{
playBattleSound(SND_POP, world.bob->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
}
} }
} }

View File

@ -174,6 +174,7 @@ static void loadSounds(void)
sounds[SND_ELECTRIC_HIT] = loadSound("sound/46501__phreaksaccount__welder1.ogg"); sounds[SND_ELECTRIC_HIT] = loadSound("sound/46501__phreaksaccount__welder1.ogg");
sounds[SND_ITEM_PAD] = loadSound("sound/319996__kenrt__ratchet.ogg"); sounds[SND_ITEM_PAD] = loadSound("sound/319996__kenrt__ratchet.ogg");
sounds[SND_POWER_POOL] = loadSound("sound/235737__copyc4t__tf-power-tools.ogg"); sounds[SND_POWER_POOL] = loadSound("sound/235737__copyc4t__tf-power-tools.ogg");
sounds[SND_POP] = loadSound("sound/83237__mlestn1__pop.ogg");
sounds[SND_MISSION_COMPLETE] = loadSound("sound/113989__kastenfrosch__gewonnen.ogg"); sounds[SND_MISSION_COMPLETE] = loadSound("sound/113989__kastenfrosch__gewonnen.ogg");
sounds[SND_TROPHY] = loadSound("sound/278142__ricemaster__effect-notify.ogg"); sounds[SND_TROPHY] = loadSound("sound/278142__ricemaster__effect-notify.ogg");