Don't allow Teeka's shots to hurt the player.

This commit is contained in:
Steve 2018-03-06 08:24:45 +00:00
parent 7b915a77a8
commit 1d033cf327
3 changed files with 36 additions and 24 deletions

View File

@ -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;
}
}

View File

@ -75,6 +75,7 @@ static void tick(void)
static void touch(Entity *other)
{
Bullet *b;
int canHit;
b = (Bullet*)self;
@ -95,7 +96,20 @@ 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
{
canHit = (
other != b->owner &&
(!(other->flags & EF_IGNORE_BULLETS)) &&
b->owner->type != other->type
);
if (b->owner->type == ET_TEEKA && other->type == ET_BOB)
{
canHit = 0;
}
if (canHit)
{
swapSelf(other);
other->applyDamage(b->damage);
@ -123,3 +137,4 @@ static void touch(Entity *other)
}
}
}
}

View File

@ -269,9 +269,7 @@ static void preFire(void)
u->attack();
u->shotsToFire--;
if (u->shotsToFire == 0)
if (--u->shotsToFire == 0)
{
u->action = u->walk;
}