ALIVE_ESCAPED entities invoke triggers, objective, and condition updates.

This commit is contained in:
Steve 2015-11-11 22:34:48 +00:00
parent 7a23a9b6b3
commit 93979c396f
1 changed files with 20 additions and 13 deletions

View File

@ -226,6 +226,25 @@ void doFighter(void)
}
}
if (self->alive == ALIVE_ESCAPED)
{
if (self->side != SIDE_ALLIES)
{
addHudMessage(colors.red, "Mission target has escaped.");
battle.stats[STAT_ENEMIES_ESCAPED]++;
}
else
{
battle.stats[STAT_ALLIES_ESCAPED]++;
}
updateObjective(self->name, TT_ESCAPED);
updateCondition(self->name, TT_ESCAPED);
checkTrigger("ESCAPE", TRIGGER_ESCAPES);
}
if (self->alive == ALIVE_DEAD)
{
if (self == player)
@ -471,18 +490,6 @@ static void checkHasFled(void)
if (distance > 5000)
{
if (self->side != SIDE_ALLIES)
{
addHudMessage(colors.red, "Mission target has escaped.");
battle.stats[STAT_ENEMIES_ESCAPED]++;
}
else
{
battle.stats[STAT_ALLIES_ESCAPED]++;
}
checkTrigger("ESCAPE", TRIGGER_ESCAPES);
self->alive = ALIVE_DEAD;
self->alive = ALIVE_ESCAPED;
}
}