In epic battles, spawned in entities (such as swarmers) don't count towards the epicLimit.

This commit is contained in:
Steve 2016-03-27 08:55:25 +01:00
parent 6ca888d775
commit d33bcf9414
3 changed files with 15 additions and 1 deletions

View File

@ -63,6 +63,7 @@ void doEntities(void)
{ {
int numAllies, numEnemies; int numAllies, numEnemies;
int numActiveAllies, numActiveEnemies; int numActiveAllies, numActiveEnemies;
int numSpawnedEnemies;
Entity *e, *prev; Entity *e, *prev;
prev = &battle.entityHead; prev = &battle.entityHead;
@ -217,6 +218,11 @@ void doEntities(void)
if (e->health > 0 && e->active) if (e->health > 0 && e->active)
{ {
numActiveEnemies++; numActiveEnemies++;
if (e->spawned)
{
numSpawnedEnemies++;
}
} }
} }
} }
@ -229,6 +235,8 @@ void doEntities(void)
if (battle.isEpic && battle.stats[STAT_TIME] % FPS == 0) if (battle.isEpic && battle.stats[STAT_TIME] % FPS == 0)
{ {
numActiveEnemies -= numSpawnedEnemies;
if (numAllies > battle.epicFighterLimit) if (numAllies > battle.epicFighterLimit)
{ {
activateEpicFighters(battle.epicFighterLimit - numActiveAllies, SIDE_ALLIES); activateEpicFighters(battle.epicFighterLimit - numActiveAllies, SIDE_ALLIES);

View File

@ -40,7 +40,10 @@ void doSpawners(void)
s->total -= num; s->total -= num;
} }
if (s->side != SIDE_ALLIES)
{
battle.numInitialEnemies += num; battle.numInitialEnemies += num;
}
for (i = 0 ; i < num ; i++) for (i = 0 ; i < num ; i++)
{ {
@ -48,6 +51,8 @@ void doSpawners(void)
e = spawnFighter(type, 0, 0, s->side); e = spawnFighter(type, 0, 0, s->side);
e->spawned = 1;
if (s->offscreen) if (s->offscreen)
{ {
e->x = player->x; e->x = player->x;

View File

@ -100,6 +100,7 @@ struct Entity {
char defName[MAX_NAME_LENGTH]; char defName[MAX_NAME_LENGTH];
char groupName[MAX_NAME_LENGTH]; char groupName[MAX_NAME_LENGTH];
int active; int active;
int spawned;
int id; int id;
int side; int side;
float x; float x;