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,13 +52,16 @@ void drawMissionInfo(void)
|
|||
|
||||
case MS_COMPLETE:
|
||||
case MS_FAILED:
|
||||
if (battle.missionFinishedTimer <= -FPS)
|
||||
if (!battle.unwinnable)
|
||||
{
|
||||
drawMissionSummary(battle.status == MS_COMPLETE ? missionCompleteTexture : missionFailedTexture);
|
||||
|
||||
if (battle.missionFinishedTimer <= -(FPS * 2))
|
||||
if (battle.missionFinishedTimer <= -FPS)
|
||||
{
|
||||
drawWidgets(battle.status == MS_COMPLETE ? "battleWon" : "battleLost");
|
||||
drawMissionSummary(battle.status == MS_COMPLETE ? missionCompleteTexture : missionFailedTexture);
|
||||
|
||||
if (battle.missionFinishedTimer <= -(FPS * 2))
|
||||
{
|
||||
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