Allow player to be disabled in Challenge mode.

This commit is contained in:
Steve 2016-05-08 08:43:16 +01:00
parent a8e447b870
commit 23e38a6313
2 changed files with 14 additions and 0 deletions

View File

@ -458,6 +458,10 @@ static void drawObjectives(void)
{
drawText(SCREEN_WIDTH / 2, 35, 14, TA_CENTER, colors.white, "%d / %d", battle.stats[STAT_CIVILIANS_RESCUED], game.currentMission->challengeData.rescueLimit);
}
else if (player->flags & EF_MUST_DISABLE)
{
drawText(SCREEN_WIDTH / 2, 35, 14, TA_CENTER, colors.white, _("System Power : %d%%"), player->systemPower);
}
}
}

View File

@ -143,6 +143,16 @@ void doPlayer(void)
}
}
/* really only used in challenge mode */
if (player->systemPower <= 0 && battle.status == MS_IN_PROGRESS)
{
if (game.currentMission->challengeData.isChallenge)
{
addHudMessage(colors.red, _("Challenge Failed!"));
failMission();
}
}
if (battle.status == MS_IN_PROGRESS)
{
selectMissionTarget();