Allow challenges to be completed even if the player is killed.
This commit is contained in:
parent
422901632f
commit
a64b41f851
|
@ -276,11 +276,7 @@ void doFighter(void)
|
|||
|
||||
if (self->alive == ALIVE_DEAD)
|
||||
{
|
||||
if (self == player)
|
||||
{
|
||||
battle.stats[STAT_PLAYER_KILLED]++;
|
||||
}
|
||||
else if (player != NULL)
|
||||
if (player != NULL && self == player)
|
||||
{
|
||||
if (player->alive == ALIVE_ALIVE)
|
||||
{
|
||||
|
|
|
@ -119,7 +119,16 @@ void doPlayer(void)
|
|||
|
||||
if (player->health <= 0 && battle.status == MS_IN_PROGRESS)
|
||||
{
|
||||
if (!battle.isEpic)
|
||||
battle.stats[STAT_PLAYER_KILLED]++;
|
||||
|
||||
if (game.currentMission->challengeData.isChallenge)
|
||||
{
|
||||
if (!game.currentMission->challengeData.allowPlayerDeath)
|
||||
{
|
||||
failMission();
|
||||
}
|
||||
}
|
||||
else if (!battle.isEpic)
|
||||
{
|
||||
failMission();
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ void doChallenges(void)
|
|||
{
|
||||
if (challengeFinished())
|
||||
{
|
||||
if (battle.stats[STAT_TIME] >= game.currentMission->challengeData.timeLimit)
|
||||
if (game.currentMission->challengeData.timeLimit && battle.stats[STAT_TIME] >= game.currentMission->challengeData.timeLimit)
|
||||
{
|
||||
failChallenge();
|
||||
}
|
||||
|
@ -139,6 +139,11 @@ static int challengeFinished(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (player->health <= 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,9 @@ Mission *loadMissionMeta(char *filename)
|
|||
mission->challengeData.noECM = getJSONValue(node, "noECM", 0);
|
||||
mission->challengeData.noBoost = getJSONValue(node, "noBoost", 0);
|
||||
mission->challengeData.noGuns = getJSONValue(node, "noGuns", 0);
|
||||
|
||||
/* misc */
|
||||
mission->challengeData.allowPlayerDeath = getJSONValue(node, "allowPlayerDeath", 0);
|
||||
|
||||
node = cJSON_GetObjectItem(node, "challenges");
|
||||
|
||||
|
|
|
@ -261,6 +261,7 @@ typedef struct {
|
|||
int noECM;
|
||||
int noGuns;
|
||||
int scriptedEnd;
|
||||
int allowPlayerDeath;
|
||||
Challenge *challenges[MAX_CHALLENGES];
|
||||
} ChallengeData;
|
||||
|
||||
|
|
Loading…
Reference in New Issue