Make Bob and enemies pop into white spheres when no blood option is selected.

This commit is contained in:
Steve 2018-03-21 07:43:54 +00:00
parent 96949ec97c
commit c36c36dd60
5 changed files with 40 additions and 2 deletions

View File

@ -364,7 +364,14 @@ static void doDying(void)
{
world.bob->flags |= EF_GONE;
if (app.config.blood)
{
throwFleshChunks(world.bob->x + world.bob->w / 2, world.bob->y + world.bob->h / 2, rrnd(3, 6));
}
else
{
addPopParticles(world.bob->x + world.bob->w / 2, world.bob->y + world.bob->h / 2);
}
world.state = WS_GAME_OVER;

View File

@ -46,6 +46,7 @@ extern double randF(void);
extern int rrnd(int low, int high);
extern void setGameplayMessage(int type, char *format, ...);
extern void throwFleshChunks(float x, float y, int amount);
extern void addPopParticles(float x, float y);
extern App app;
extern Dev dev;

View File

@ -70,7 +70,14 @@ static void die2(void)
u->alive = ALIVE_DEAD;
if (app.config.blood)
{
throwFleshChunks(u->x + u->w / 2, u->y + u->h / 2, rrnd(3, 6));
}
else
{
addPopParticles(u->x + u->w / 2, u->y + u->h / 2);
}
if (rand() % 100 < 35)
{

View File

@ -34,6 +34,7 @@ extern double randF(void);
extern int rrnd(int low, int high);
extern void throwFleshChunks(float x, float y, int amount);
extern void updateObjective(char *targetName);
extern void addPopParticles(float x, float y);
extern App app;
extern Dev dev;

View File

@ -200,6 +200,28 @@ void addExplosionParticles(float x, float y, float radius, int amount)
}
}
void addPopParticles(float x, float y)
{
int i;
Particle *p;
for (i = 0; i < 12; i++)
{
p = createParticle();
p->type = PT_TEXTURED;
p->x = x;
p->y = y;
p->dx = (randF() - randF()) * 12;
p->dx /= 5;
p->dy = (randF() - randF()) * 12;
p->dy /= 5;
p->health = rrnd(FPS / 4, FPS);
p->spriteTime = -1;
p->spriteFrame = 0;
p->sprite = smokeSprite;
}
}
void addTeleportStar(float x, float y)
{
Particle *p;