Don't allow Teeka's shots to hurt the player.
This commit is contained in:
parent
7b915a77a8
commit
1d033cf327
|
@ -145,11 +145,10 @@ static void preFire(void)
|
|||
|
||||
attack();
|
||||
|
||||
u->shotsToFire--;
|
||||
|
||||
if (u->shotsToFire == 0)
|
||||
if (--u->shotsToFire <= 0)
|
||||
{
|
||||
u->thinkTime = FPS;
|
||||
u->action = lookForEnemies;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ static void tick(void)
|
|||
static void touch(Entity *other)
|
||||
{
|
||||
Bullet *b;
|
||||
int canHit;
|
||||
|
||||
b = (Bullet*)self;
|
||||
|
||||
|
@ -95,30 +96,44 @@ static void touch(Entity *other)
|
|||
playBattleSound(SND_RICO_2, b->uniqueId % MAX_SND_CHANNELS, b->x, b->y);
|
||||
}
|
||||
}
|
||||
else if (other != b->owner && (!(other->flags & EF_IGNORE_BULLETS)) && b->owner->type != other->type)
|
||||
else
|
||||
{
|
||||
swapSelf(other);
|
||||
other->applyDamage(b->damage);
|
||||
swapSelf(other);
|
||||
canHit = (
|
||||
other != b->owner &&
|
||||
(!(other->flags & EF_IGNORE_BULLETS)) &&
|
||||
b->owner->type != other->type
|
||||
);
|
||||
|
||||
if (other->flags & EF_EXPLODES)
|
||||
if (b->owner->type == ET_TEEKA && other->type == ET_BOB)
|
||||
{
|
||||
playBattleSound(SND_METAL_HIT, b->uniqueId % MAX_SND_CHANNELS, b->x, b->y);
|
||||
|
||||
addSparkParticles(b->x, b->y);
|
||||
}
|
||||
else
|
||||
{
|
||||
playBattleSound(SND_FLESH_HIT, b->uniqueId % MAX_SND_CHANNELS, b->x, b->y);
|
||||
|
||||
addSmallFleshChunk(b->x, b->y);
|
||||
canHit = 0;
|
||||
}
|
||||
|
||||
b->alive = ALIVE_DEAD;
|
||||
|
||||
if (b->owner->type == world.bob->type && (other->type == ET_ENEMY || other->type == ET_BOSS || other->type == ET_DESTRUCTABLE))
|
||||
if (canHit)
|
||||
{
|
||||
game.stats[STAT_SHOTS_HIT]++;
|
||||
swapSelf(other);
|
||||
other->applyDamage(b->damage);
|
||||
swapSelf(other);
|
||||
|
||||
if (other->flags & EF_EXPLODES)
|
||||
{
|
||||
playBattleSound(SND_METAL_HIT, b->uniqueId % MAX_SND_CHANNELS, b->x, b->y);
|
||||
|
||||
addSparkParticles(b->x, b->y);
|
||||
}
|
||||
else
|
||||
{
|
||||
playBattleSound(SND_FLESH_HIT, b->uniqueId % MAX_SND_CHANNELS, b->x, b->y);
|
||||
|
||||
addSmallFleshChunk(b->x, b->y);
|
||||
}
|
||||
|
||||
b->alive = ALIVE_DEAD;
|
||||
|
||||
if (b->owner->type == world.bob->type && (other->type == ET_ENEMY || other->type == ET_BOSS || other->type == ET_DESTRUCTABLE))
|
||||
{
|
||||
game.stats[STAT_SHOTS_HIT]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,9 +269,7 @@ static void preFire(void)
|
|||
|
||||
u->attack();
|
||||
|
||||
u->shotsToFire--;
|
||||
|
||||
if (u->shotsToFire == 0)
|
||||
if (--u->shotsToFire == 0)
|
||||
{
|
||||
u->action = u->walk;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue