Start of lives restriction for epic battles.
This commit is contained in:
parent
b08006aea2
commit
27427a8637
|
@ -60,6 +60,7 @@ static char *OBJECTIVE_DIST_TEXT;
|
||||||
static char *JUMPGATE_DIST_TEXT;
|
static char *JUMPGATE_DIST_TEXT;
|
||||||
static char *NEW_FIGHTER_TEXT;
|
static char *NEW_FIGHTER_TEXT;
|
||||||
static char *SUSPICION_TEXT;
|
static char *SUSPICION_TEXT;
|
||||||
|
static char *REMAINING_PILOTS_TEXT;
|
||||||
|
|
||||||
void initHud(void)
|
void initHud(void)
|
||||||
{
|
{
|
||||||
|
@ -85,6 +86,7 @@ void initHud(void)
|
||||||
JUMPGATE_DIST_TEXT = _("Jumpgate: %.2fkm");
|
JUMPGATE_DIST_TEXT = _("Jumpgate: %.2fkm");
|
||||||
NEW_FIGHTER_TEXT = _("SELECT NEW FIGHTER");
|
NEW_FIGHTER_TEXT = _("SELECT NEW FIGHTER");
|
||||||
SUSPICION_TEXT = _("Suspicion");
|
SUSPICION_TEXT = _("Suspicion");
|
||||||
|
REMAINING_PILOTS_TEXT = _("Remaining Pilots: %d");
|
||||||
|
|
||||||
targetPointer = getTexture("gfx/hud/targetPointer.png");
|
targetPointer = getTexture("gfx/hud/targetPointer.png");
|
||||||
targetCircle = getTexture("gfx/hud/targetCircle.png");
|
targetCircle = getTexture("gfx/hud/targetCircle.png");
|
||||||
|
@ -459,6 +461,11 @@ static void drawObjectives(void)
|
||||||
{
|
{
|
||||||
blit(objectives, (SCREEN_WIDTH / 2) - 50, 14, 0);
|
blit(objectives, (SCREEN_WIDTH / 2) - 50, 14, 0);
|
||||||
drawText(SCREEN_WIDTH / 2, 10, 16, TA_CENTER, colors.white, "%d / %d", battle.numObjectivesComplete, (battle.numObjectivesTotal + battle.numConditions));
|
drawText(SCREEN_WIDTH / 2, 10, 16, TA_CENTER, colors.white, "%d / %d", battle.numObjectivesComplete, (battle.numObjectivesTotal + battle.numConditions));
|
||||||
|
|
||||||
|
if (battle.isEpic && battle.epicLives > 0)
|
||||||
|
{
|
||||||
|
drawText(SCREEN_WIDTH / 2, 35, 14, TA_CENTER, colors.white, REMAINING_PILOTS_TEXT, battle.epicLives);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -325,3 +325,24 @@ void loadObjectives(cJSON *node)
|
||||||
|
|
||||||
fireObjectivesComplete = 1;
|
fireObjectivesComplete = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addEpicLivesObjective(void)
|
||||||
|
{
|
||||||
|
Objective *o;
|
||||||
|
char id[MAX_DESCRIPTION_LENGTH];
|
||||||
|
|
||||||
|
o = malloc(sizeof(Objective));
|
||||||
|
memset(o, 0, sizeof(Objective));
|
||||||
|
battle.objectiveTail->next = o;
|
||||||
|
battle.objectiveTail = o;
|
||||||
|
|
||||||
|
sprintf(id, _("Do not lose more than %d pilots"), battle.epicLives);
|
||||||
|
|
||||||
|
STRNCPY(o->id, id, MAX_DESCRIPTION_LENGTH);
|
||||||
|
STRNCPY(o->description, id, MAX_DESCRIPTION_LENGTH);
|
||||||
|
STRNCPY(o->targetName, "PLAYER", MAX_NAME_LENGTH);
|
||||||
|
o->targetValue = battle.epicLives;
|
||||||
|
o->targetType = TT_DESTROY;
|
||||||
|
o->active = 1;
|
||||||
|
o->isCondition = 1;
|
||||||
|
}
|
||||||
|
|
|
@ -166,7 +166,12 @@ void doPlayer(void)
|
||||||
{
|
{
|
||||||
updateDeathStats();
|
updateDeathStats();
|
||||||
|
|
||||||
initPlayerSelect();
|
updateCondition("PLAYER", TT_DESTROY);
|
||||||
|
|
||||||
|
if (battle.status == MS_IN_PROGRESS)
|
||||||
|
{
|
||||||
|
initPlayerSelect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,11 +440,14 @@ void initPlayerSelect(void)
|
||||||
|
|
||||||
selectedPlayerIndex = 0;
|
selectedPlayerIndex = 0;
|
||||||
|
|
||||||
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
|
if (battle.epicLives > 0 && --battle.epicLives > 0)
|
||||||
{
|
{
|
||||||
if (e->active && e->type == ET_FIGHTER && e->health > 0 && e->side == SIDE_ALLIES && selectedPlayerIndex < MAX_SELECTABLE_PLAYERS)
|
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
|
||||||
{
|
{
|
||||||
availablePlayerUnits[selectedPlayerIndex++] = e;
|
if (e->active && e->type == ET_FIGHTER && e->health > 0 && e->side == SIDE_ALLIES && selectedPlayerIndex < MAX_SELECTABLE_PLAYERS)
|
||||||
|
{
|
||||||
|
availablePlayerUnits[selectedPlayerIndex++] = e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ extern int isAcceptControl(void);
|
||||||
extern void resetAcceptControls(void);
|
extern void resetAcceptControls(void);
|
||||||
extern void awardTrophy(char *id);
|
extern void awardTrophy(char *id);
|
||||||
extern long flagsToLong(char *flags, int *add);
|
extern long flagsToLong(char *flags, int *add);
|
||||||
|
extern void updateCondition(char *name, int type);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
|
@ -420,6 +420,12 @@ static void loadEpicData(cJSON *node)
|
||||||
|
|
||||||
battle.epicFighterLimit = cJSON_GetObjectItem(node, "fighterLimit")->valueint;
|
battle.epicFighterLimit = cJSON_GetObjectItem(node, "fighterLimit")->valueint;
|
||||||
battle.unlimitedEnemies = getJSONValue(node, "unlimitedEnemies", 0);
|
battle.unlimitedEnemies = getJSONValue(node, "unlimitedEnemies", 0);
|
||||||
|
battle.epicLives = getJSONValue(node, "lives", 0);
|
||||||
|
|
||||||
|
if (battle.epicLives > 0)
|
||||||
|
{
|
||||||
|
addEpicLivesObjective();
|
||||||
|
}
|
||||||
|
|
||||||
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
|
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,6 +64,7 @@ extern void awardStatsTrophies(void);
|
||||||
extern void awardPostMissionTrophies(void);
|
extern void awardPostMissionTrophies(void);
|
||||||
extern void awardCraftTrophy(void);
|
extern void awardCraftTrophy(void);
|
||||||
extern void setInitialPlayerAngle(void);
|
extern void setInitialPlayerAngle(void);
|
||||||
|
extern void addEpicLivesObjective(void);
|
||||||
|
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
extern Dev dev;
|
extern Dev dev;
|
||||||
|
|
|
@ -344,6 +344,7 @@ typedef struct {
|
||||||
int isEpic;
|
int isEpic;
|
||||||
int unlimitedEnemies;
|
int unlimitedEnemies;
|
||||||
int epicFighterLimit;
|
int epicFighterLimit;
|
||||||
|
int epicLives;
|
||||||
int playerSelect;
|
int playerSelect;
|
||||||
int manualComplete;
|
int manualComplete;
|
||||||
int unwinnable;
|
int unwinnable;
|
||||||
|
|
Loading…
Reference in New Issue