Fleeing fighters no longer count as flee when they go out of range of player.
This commit is contained in:
parent
345516814d
commit
b90ca0ea11
|
@ -27,7 +27,6 @@ static void spinDie(void);
|
||||||
static void straightDie(void);
|
static void straightDie(void);
|
||||||
static void randomizeDart(Entity *dart);
|
static void randomizeDart(Entity *dart);
|
||||||
static void randomizeDartGuns(Entity *dart);
|
static void randomizeDartGuns(Entity *dart);
|
||||||
static void checkHasFled(void);
|
|
||||||
|
|
||||||
Entity *spawnFighter(char *name, int x, int y, int side)
|
Entity *spawnFighter(char *name, int x, int y, int side)
|
||||||
{
|
{
|
||||||
|
@ -222,13 +221,6 @@ void doFighter(void)
|
||||||
battle.stats[STAT_DISABLED]++;
|
battle.stats[STAT_DISABLED]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (player != NULL && self->flags & EF_FLEEING && battle.stats[STAT_TIME] % FPS == 0)
|
|
||||||
{
|
|
||||||
checkHasFled();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->alive == ALIVE_ESCAPED)
|
if (self->alive == ALIVE_ESCAPED)
|
||||||
|
@ -496,13 +488,3 @@ static void straightDie(void)
|
||||||
playBattleSound(SND_EXPLOSION_1 + rand() % 4, self->x, self->y);
|
playBattleSound(SND_EXPLOSION_1 + rand() % 4, self->x, self->y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void checkHasFled(void)
|
|
||||||
{
|
|
||||||
long distance = getDistance(self->x, self->y, player->x, player->y);
|
|
||||||
|
|
||||||
if (distance > 5000)
|
|
||||||
{
|
|
||||||
self->alive = ALIVE_ESCAPED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue