Don't show blood if blood is off.
This commit is contained in:
parent
5bc3747198
commit
0f768f593e
|
@ -293,19 +293,22 @@ static void die(void)
|
|||
|
||||
u->dx = (randF() - randF()) * 5;
|
||||
|
||||
switch (rand() % 3)
|
||||
if (app.config.blood)
|
||||
{
|
||||
case 0:
|
||||
playBattleSound(SND_DEATH_1, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
|
||||
break;
|
||||
switch (rand() % 3)
|
||||
{
|
||||
case 0:
|
||||
playBattleSound(SND_DEATH_1, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
playBattleSound(SND_DEATH_2, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
|
||||
break;
|
||||
case 1:
|
||||
playBattleSound(SND_DEATH_2, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
playBattleSound(SND_DEATH_3, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
|
||||
break;
|
||||
case 2:
|
||||
playBattleSound(SND_DEATH_3, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ extern int rrnd(int low, int high);
|
|||
extern void throwFleshChunks(float x, float y, int amount);
|
||||
extern void updateObjective(char *targetName);
|
||||
|
||||
extern App app;
|
||||
extern Dev dev;
|
||||
extern Entity *self;
|
||||
extern Game game;
|
||||
|
|
|
@ -38,18 +38,21 @@ void addSmallFleshChunk(float x, float y)
|
|||
{
|
||||
Decoration *chunk;
|
||||
|
||||
chunk = malloc(sizeof(Decoration));
|
||||
memset(chunk, 0, sizeof(Decoration));
|
||||
initFleshChunk(chunk);
|
||||
|
||||
chunk->x = x;
|
||||
chunk->y = y;
|
||||
chunk->health = FPS / 4;
|
||||
chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[0];
|
||||
|
||||
if (app.config.blood == 2)
|
||||
if (app.config.blood)
|
||||
{
|
||||
chunk->health = FPS * rrnd(2, 4);
|
||||
chunk = malloc(sizeof(Decoration));
|
||||
memset(chunk, 0, sizeof(Decoration));
|
||||
initFleshChunk(chunk);
|
||||
|
||||
chunk->x = x;
|
||||
chunk->y = y;
|
||||
chunk->health = FPS / 4;
|
||||
chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[0];
|
||||
|
||||
if (app.config.blood == 2)
|
||||
{
|
||||
chunk->health = FPS * rrnd(2, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ int isSolid(int x, int y)
|
|||
|
||||
void addBloodDecal(int x, int y)
|
||||
{
|
||||
if (isSolid(x, y) && world.map.decal[x][y] == 0)
|
||||
if (app.config.blood && isSolid(x, y) && world.map.decal[x][y] == 0)
|
||||
{
|
||||
world.map.decal[x][y] = (int) rrnd(1, 4);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ extern float limit(float i, float a, float b);
|
|||
extern char *readCompressedFile(const char *filename);
|
||||
extern int rrnd(int low, int high);
|
||||
|
||||
extern App app;
|
||||
extern Camera camera;
|
||||
extern World world;
|
||||
|
||||
|
|
Loading…
Reference in New Issue