Renamed FLEE flags to RETREAT.

This commit is contained in:
Steve 2015-11-21 17:32:39 +00:00
parent fe42f5153d
commit a82f8b6f2c
7 changed files with 13 additions and 8 deletions

View File

@ -6,6 +6,6 @@
"reloadTime" : 0,
"shieldRechargeRate" : 0,
"textureName" : "gfx/craft/civilian01.png",
"flags" : "EF_MISSION_TARGET+EF_FLEEING",
"flags" : "EF_MISSION_TARGET+EF_RETREATING",
"aiFlags" : "AIF_GOAL_EXTRACTION+AIF_AVOIDS_COMBAT"
}

View File

@ -60,7 +60,7 @@ static void handleFleeingEntities(void)
for (i = 0, e = candidates[i] ; e != NULL ; e = candidates[++i])
{
if (e->health > 0 && e->flags & EF_FLEEING && getDistance(self->x, self->y, e->x, e->y) <= 64)
if (e->health > 0 && e->flags & EF_RETREATING && getDistance(self->x, self->y, e->x, e->y) <= 64)
{
e->alive = ALIVE_ESCAPED;
}

View File

@ -538,7 +538,7 @@ static void straightDie(void)
}
}
void fleeAllEnemies(void)
void retreatEnemies(void)
{
Entity *e;
@ -559,7 +559,7 @@ void retreatAllies(void)
{
if (e->type == ET_FIGHTER && e->side == SIDE_ALLIES)
{
e->flags |= EF_FLEEING;
e->flags |= EF_RETREATING;
e->aiFlags |= AIF_AVOIDS_COMBAT;
e->aiFlags |= AIF_UNLIMITED_RANGE;

View File

@ -72,7 +72,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define EF_HAS_ROPE (2 << 5)
#define EF_COLLECTS_ITEMS (2 << 6)
#define EF_MUST_DISABLE (2 << 7)
#define EF_FLEEING (2 << 8)
#define EF_RETREATING (2 << 8)
#define EF_NO_EPIC (2 << 9)
#define AIF_NONE 0

View File

@ -112,7 +112,7 @@ void completeMission(void)
game.stats[STAT_MISSIONS_COMPLETED]++;
fleeAllEnemies();
retreatEnemies();
}
}
@ -249,6 +249,11 @@ static void loadFighters(cJSON *node)
f->flags = flagsToLong(cJSON_GetObjectItem(node, "flags")->valuestring);
}
if (cJSON_GetObjectItem(node, "aiFlags"))
{
f->aiFlags = flagsToLong(cJSON_GetObjectItem(node, "aiFlags")->valuestring);
}
if (cJSON_GetObjectItem(node, "active"))
{
f->active = cJSON_GetObjectItem(node, "active")->valueint;

View File

@ -41,7 +41,7 @@ extern void selectWidget(const char *name, const char *group);
extern Entity *spawnExtractionPoint(void);
extern Entity *spawnItem(char *type);
extern void failIncompleteObjectives(void);
extern void fleeAllEnemies(void);
extern void retreatEnemies(void);
extern Battle battle;
extern Entity *player;

View File

@ -38,7 +38,7 @@ void initLookups(void)
addLookup("EF_MUST_DISABLE", EF_MUST_DISABLE);
addLookup("EF_IMMORTAL", EF_IMMORTAL);
addLookup("EF_MISSION_TARGET", EF_MISSION_TARGET);
addLookup("EF_FLEEING", EF_FLEEING);
addLookup("EF_RETREATING", EF_RETREATING);
addLookup("EF_HAS_ROPE", EF_HAS_ROPE);
addLookup("EF_COLLECTS_ITEMS", EF_COLLECTS_ITEMS);
addLookup("EF_NO_EPIC", EF_NO_EPIC);