Don't allow laser traps to keep victims alive indefinitely.

This commit is contained in:
Steve 2018-04-26 09:07:32 +01:00
parent 9bafce978f
commit c4efe60abd
1 changed files with 30 additions and 30 deletions

View File

@ -123,37 +123,37 @@ static void touch(Entity *other)
{ {
other->dx = rrnd(-12, 12); other->dx = rrnd(-12, 12);
other->dy = rrnd(-8, 0); other->dy = rrnd(-8, 0);
}
if (t->offTime != 0) if (t->offTime != 0)
{ {
swapSelf(other); swapSelf(other);
other->applyDamage((int) (other->healthMax / 4) + 1); other->applyDamage((int) (other->healthMax / 4) + 1);
swapSelf(other); swapSelf(other);
} }
else else
{ {
/* instant kill */ /* instant kill */
swapSelf(other); swapSelf(other);
other->applyDamage((int) other->healthMax + 1); other->applyDamage((int) other->healthMax + 1);
swapSelf(other); swapSelf(other);
} }
playBattleSound(SND_FLESH_HIT, other->uniqueId % MAX_SND_CHANNELS, other->x, other->y); playBattleSound(SND_FLESH_HIT, other->uniqueId % MAX_SND_CHANNELS, other->x, other->y);
playBattleSound(SND_ELECTRIC_HIT, self->uniqueId % MAX_SND_CHANNELS, self->x, self->y); playBattleSound(SND_ELECTRIC_HIT, self->uniqueId % MAX_SND_CHANNELS, self->x, self->y);
if (other->flags & EF_EXPLODES) if (other->flags & EF_EXPLODES)
{ {
addSparkParticles(t->x, t->y); addSparkParticles(t->x, t->y);
} }
else else
{ {
addSmallFleshChunk(t->x, t->y); addSmallFleshChunk(t->x, t->y);
} }
if (other == (Entity*)world.bob && world.bob->stunTimer == 0) if (other == (Entity*)world.bob && world.bob->stunTimer == 0)
{ {
stunBob(); stunBob();
}
} }
} }
} }