Added "unwinnable" mission flag, to automatically continue the game when the player is defeated.
This commit is contained in:
parent
bf3de041c6
commit
a251459413
|
@ -169,6 +169,15 @@ static void doBattle(void)
|
|||
}
|
||||
|
||||
battle.stats[STAT_TIME]++;
|
||||
|
||||
if (battle.unwinnable && battle.missionFinishedTimer <= -FPS * 6)
|
||||
{
|
||||
postBattle();
|
||||
|
||||
destroyBattle();
|
||||
|
||||
initGalacticMap();
|
||||
}
|
||||
}
|
||||
|
||||
static void draw(void)
|
||||
|
|
|
@ -52,6 +52,8 @@ void drawMissionInfo(void)
|
|||
|
||||
case MS_COMPLETE:
|
||||
case MS_FAILED:
|
||||
if (!battle.unwinnable)
|
||||
{
|
||||
if (battle.missionFinishedTimer <= -FPS)
|
||||
{
|
||||
drawMissionSummary(battle.status == MS_COMPLETE ? missionCompleteTexture : missionFailedTexture);
|
||||
|
@ -61,6 +63,7 @@ void drawMissionInfo(void)
|
|||
drawWidgets(battle.status == MS_COMPLETE ? "battleWon" : "battleLost");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,11 @@ void loadMission(char *filename)
|
|||
loadEpicData(cJSON_GetObjectItem(root, "epic"));
|
||||
}
|
||||
|
||||
if (cJSON_GetObjectItem(root, "unwinnable"))
|
||||
{
|
||||
battle.unwinnable = cJSON_GetObjectItem(root, "unwinnable")->valueint;
|
||||
}
|
||||
|
||||
initScript(cJSON_GetObjectItem(root, "script"));
|
||||
|
||||
free(text);
|
||||
|
|
|
@ -278,6 +278,7 @@ typedef struct {
|
|||
int epic;
|
||||
int epicFighterLimit;
|
||||
int playerSelect;
|
||||
int unwinnable;
|
||||
int missionFinishedTimer;
|
||||
int boostTimer;
|
||||
int ecmTimer;
|
||||
|
|
Loading…
Reference in New Issue