Don't show blood if blood is off.

This commit is contained in:
Steve 2018-03-16 22:26:42 +00:00
parent 5bc3747198
commit 0f768f593e
5 changed files with 30 additions and 22 deletions

View File

@ -293,6 +293,8 @@ static void die(void)
u->dx = (randF() - randF()) * 5; u->dx = (randF() - randF()) * 5;
if (app.config.blood)
{
switch (rand() % 3) switch (rand() % 3)
{ {
case 0: case 0:
@ -307,6 +309,7 @@ static void die(void)
playBattleSound(SND_DEATH_3, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y); playBattleSound(SND_DEATH_3, u->uniqueId % MAX_SND_CHANNELS, u->x, u->y);
break; break;
} }
}
} }
static void animate(void) static void animate(void)

View File

@ -35,6 +35,7 @@ extern int rrnd(int low, int high);
extern void throwFleshChunks(float x, float y, int amount); extern void throwFleshChunks(float x, float y, int amount);
extern void updateObjective(char *targetName); extern void updateObjective(char *targetName);
extern App app;
extern Dev dev; extern Dev dev;
extern Entity *self; extern Entity *self;
extern Game game; extern Game game;

View File

@ -38,6 +38,8 @@ void addSmallFleshChunk(float x, float y)
{ {
Decoration *chunk; Decoration *chunk;
if (app.config.blood)
{
chunk = malloc(sizeof(Decoration)); chunk = malloc(sizeof(Decoration));
memset(chunk, 0, sizeof(Decoration)); memset(chunk, 0, sizeof(Decoration));
initFleshChunk(chunk); initFleshChunk(chunk);
@ -51,6 +53,7 @@ void addSmallFleshChunk(float x, float y)
{ {
chunk->health = FPS * rrnd(2, 4); chunk->health = FPS * rrnd(2, 4);
} }
}
} }
void throwFleshChunks(float x, float y, int amount) void throwFleshChunks(float x, float y, int amount)

View File

@ -144,7 +144,7 @@ int isSolid(int x, int y)
void addBloodDecal(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); world.map.decal[x][y] = (int) rrnd(1, 4);
} }

View File

@ -27,6 +27,7 @@ extern float limit(float i, float a, float b);
extern char *readCompressedFile(const char *filename); extern char *readCompressedFile(const char *filename);
extern int rrnd(int low, int high); extern int rrnd(int low, int high);
extern App app;
extern Camera camera; extern Camera camera;
extern World world; extern World world;