Player will always be on the side of the Allies.

This commit is contained in:
Steve 2015-10-31 08:03:11 +00:00
parent c3d07ea5a2
commit 596069cebf
4 changed files with 22 additions and 27 deletions

View File

@ -57,7 +57,7 @@ void doAI(void)
if (self->target == NULL) if (self->target == NULL)
{ {
if (player != NULL && self->side == player->side) if (player != NULL && self->side == SIDE_ALLIES)
{ {
moveToPlayer(); moveToPlayer();
} }
@ -107,7 +107,7 @@ void doAI(void)
{ {
self->action = flee; self->action = flee;
self->aiActionTime = FPS * 3; self->aiActionTime = FPS * 3;
if (!(self->flags & EF_FLEEING) && (self->flags & EF_MISSION_TARGET) && self->side != player->side) if (!(self->flags & EF_FLEEING) && (self->flags & EF_MISSION_TARGET) && self->side != SIDE_ALLIES)
{ {
addHudMessage(colors.cyan, "Mission target is escaping!"); addHudMessage(colors.cyan, "Mission target is escaping!");
self->flags |= EF_FLEEING; self->flags |= EF_FLEEING;

View File

@ -81,16 +81,13 @@ void doEntities(void)
case ET_FIGHTER: case ET_FIGHTER:
doFighter(); doFighter();
if (player != NULL) if (self->side == SIDE_ALLIES)
{ {
if (self->side == player->side) numAllies++;
{ }
numAllies++; else
} {
else numEnemies++;
{
numEnemies++;
}
} }
break; break;
@ -144,20 +141,18 @@ void drawEntities(void)
for (e = battle.entityHead.next ; e != NULL ; e = e->next) for (e = battle.entityHead.next ; e != NULL ; e = e->next)
{ {
if (!e->active) if (e->active)
{ {
continue; switch (e->type)
} {
case ET_FIGHTER:
drawFighter(e);
break;
switch (e->type) default:
{ drawEntity(e);
case ET_FIGHTER: break;
drawFighter(e); }
break;
default:
drawEntity(e);
break;
} }
} }
} }

View File

@ -231,7 +231,7 @@ void doFighter(void)
{ {
if (player->alive == ALIVE_ALIVE) if (player->alive == ALIVE_ALIVE)
{ {
if (self->side != player->side) if (self->side != SIDE_ALLIES)
{ {
battle.stats[STAT_ENEMIES_KILLED]++; battle.stats[STAT_ENEMIES_KILLED]++;
} }
@ -486,7 +486,7 @@ static void checkHasFled(void)
if (distance > 5000) if (distance > 5000)
{ {
if (self->side != player->side) if (self->side != SIDE_ALLIES)
{ {
addHudMessage(colors.red, "Mission target has escaped."); addHudMessage(colors.red, "Mission target has escaped.");
battle.stats[STAT_ENEMIES_ESCAPED]++; battle.stats[STAT_ENEMIES_ESCAPED]++;

View File

@ -74,7 +74,7 @@ static int teamMatesClose(void)
for (e = battle.entityHead.next ; e != NULL ; e = e->next) for (e = battle.entityHead.next ; e != NULL ; e = e->next)
{ {
if (e->active && e->type == ET_FIGHTER && e->side == player->side) if (e->active && e->type == ET_FIGHTER && e->side == SIDE_ALLIES)
{ {
if (getDistance(player->x, player->y, e->x, e->y) > 350) if (getDistance(player->x, player->y, e->x, e->y) > 350)
{ {