Added simple die, to prevent swarmers spreading debris everywhere.

This commit is contained in:
Steve 2016-03-16 06:53:07 +00:00
parent 13344ddc06
commit 09e676d713
4 changed files with 20 additions and 4 deletions

View File

@ -11,5 +11,7 @@
"y" : 0
}
],
"flags" : "EF_TAKES_DAMAGE"
"deathType" : "DT_SIMPLE",
"flags" : "EF_TAKES_DAMAGE",
"aiFlags" : "AIF_UNLIMITED_RANGE"
}

View File

@ -25,6 +25,7 @@ static void die(void);
static void immediateDie(void);
static void spinDie(void);
static void straightDie(void);
static void simpleDie(void);
static void randomizeDart(Entity *dart);
static void randomizeDartGuns(Entity *dart);
static void loadFighterDef(char *filename);
@ -495,6 +496,9 @@ static void die(void)
case DT_INSTANT:
n = 2;
break;
case DT_SIMPLE:
n = 3;
break;
}
if (self == player && battle.isEpic)
@ -507,14 +511,15 @@ static void die(void)
case 0:
self->action = spinDie;
break;
case 1:
self->action = straightDie;
break;
case 2:
self->action = immediateDie;
break;
case 3:
self->action = simpleDie;
break;
}
}
@ -572,6 +577,13 @@ static void straightDie(void)
}
}
static void simpleDie(void)
{
self->alive = ALIVE_DEAD;
addSmallExplosion();
playBattleSound(SND_EXPLOSION_1 + rand() % 4, self->x, self->y);
}
void retreatEnemies(void)
{
Entity *e;

View File

@ -199,7 +199,8 @@ enum
{
DT_ANY,
DT_NO_SPIN,
DT_INSTANT
DT_INSTANT,
DT_SIMPLE
};
enum

View File

@ -82,6 +82,7 @@ void initLookups(void)
addLookup("DT_ANY", DT_ANY);
addLookup("DT_NO_SPIN", DT_NO_SPIN);
addLookup("DT_INSTANT", DT_INSTANT);
addLookup("DT_SIMPLE", DT_SIMPLE);
addLookup("TT_DESTROY", TT_DESTROY);
addLookup("TT_DISABLE", TT_DISABLE);