Added new AI flags.

This commit is contained in:
Steve 2015-11-30 11:29:56 +00:00
parent 109e1c1788
commit e5906d5f5f
3 changed files with 14 additions and 0 deletions

View File

@ -78,6 +78,11 @@ Entity *spawnFighter(char *name, int x, int y, int side)
f->texture = getTexture("gfx/craft/civilian02.png");
}
if (f->aiFlags & AIF_AGGRESSIVE)
{
f->aiAggression = 4;
}
f->action = doAI;
f->die = die;
@ -459,6 +464,10 @@ static void die(void)
{
n = rand() % 2;
}
else if (self->aiFlags & AIF_INSTANT_DIE)
{
n = 2;
}
switch (n)
{

View File

@ -88,6 +88,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define AIF_AVOIDS_COMBAT (2 << 7)
#define AIF_DEFENSIVE (2 << 8)
#define AIF_MISSILE_BOAT (2 << 9)
#define AIF_AGGRESSIVE (2 << 10)
#define AIF_INSTANT_DIE (2 << 11)
/* player abilities */
#define BOOST_RECHARGE_TIME (FPS * 7)

View File

@ -42,6 +42,7 @@ void initLookups(void)
addLookup("EF_HAS_ROPE", EF_HAS_ROPE);
addLookup("EF_COLLECTS_ITEMS", EF_COLLECTS_ITEMS);
addLookup("EF_NO_EPIC", EF_NO_EPIC);
addLookup("EF_STATIC", EF_STATIC);
addLookup("AIF_NONE", AIF_NONE);
addLookup("AIF_MOVES_TO_PLAYER", AIF_MOVES_TO_PLAYER);
@ -54,6 +55,8 @@ void initLookups(void)
addLookup("AIF_AVOIDS_COMBAT", AIF_AVOIDS_COMBAT);
addLookup("AIF_DEFENSIVE", AIF_DEFENSIVE);
addLookup("AIF_MISSILE_BOAT", AIF_MISSILE_BOAT);
addLookup("AIF_AGGRESSIVE", AIF_AGGRESSIVE);
addLookup("AIF_INSTANT_DIE", AIF_INSTANT_DIE);
addLookup("TT_DESTROY", TT_DESTROY);
addLookup("TT_DISABLE", TT_DISABLE);