Stats for capital ships.

This commit is contained in:
Steve 2015-12-19 16:15:57 +00:00
parent 4bf78f0138
commit 1c81be3168
4 changed files with 16 additions and 1 deletions

View File

@ -92,6 +92,15 @@ void doCapitalShip(void)
{
battle.missionTarget = NULL;
}
if (self->side == SIDE_ALLIES)
{
battle.stats[STAT_CAPITAL_SHIPS_LOST]++;
}
else
{
battle.stats[STAT_CAPITAL_SHIPS_DESTROYED]++;
}
}
}
}
@ -345,7 +354,7 @@ static void loadCapitalShipDef(char *filename)
e->die = die;
SDL_QueryTexture(e->texture, NULL, NULL, &e->w, &e->h);
e->separationRadius = MAX(e->w, e->h) * 3;
e->separationRadius = MAX(e->w, e->h);
SDL_QueryTexture(e->texture, NULL, NULL, &e->w, &e->h);

View File

@ -265,6 +265,8 @@ enum
STAT_NUM_TOWED,
STAT_ITEMS_COLLECTED,
STAT_EPIC_KILL_STREAK,
STAT_CAPITAL_SHIPS_DESTROYED,
STAT_CAPITAL_SHIPS_LOST,
/* add stats before here, so as not to mess up the stats screen */
STAT_TIME,
STAT_MAX

View File

@ -47,6 +47,8 @@ static char *statDescription[] = {
"Craft Towed",
"Items Collected",
"Longest Epic Kill Streak",
"Capital Ships Destroyed",
"Capital Ships Lost",
"STAT_TIME"
};

View File

@ -136,6 +136,8 @@ void initLookups(void)
addLookup("STAT_NUM_TOWED", STAT_NUM_TOWED);
addLookup("STAT_ITEMS_COLLECTED", STAT_ITEMS_COLLECTED);
addLookup("STAT_EPIC_KILL_STREAK", STAT_EPIC_KILL_STREAK);
addLookup("STAT_CAPITAL_SHIPS_DESTROYED", STAT_CAPITAL_SHIPS_DESTROYED);
addLookup("STAT_CAPITAL_SHIPS_LOST", STAT_CAPITAL_SHIPS_LOST);
addLookup("STAT_TIME", STAT_TIME);
}