Challenge 10 fixes.

This commit is contained in:
Steve 2016-07-29 09:56:27 +01:00
parent 0cc1c65628
commit e14cba3761
2 changed files with 14 additions and 0 deletions

View File

@ -15,6 +15,7 @@
"challenge" : {
"rescueLimit" : 8,
"timeLimit" : 300,
"allowPlayerDeath" : 1,
"challenges" : [
{
"type" : "CHALLENGE_RESCUE",

View File

@ -30,6 +30,7 @@ static void updateDisabledChallenge(Challenge *c);
static void updateItemsChallenge(Challenge *c);
static void updateSurrenderChallenge(Challenge *c);
static void updateWaypointChallenge(Challenge *c);
static void updateRescueChallenge(Challenge *c);
static void completeChallenge(void);
static void failChallenge(void);
static int updateChallenges(void);
@ -294,6 +295,10 @@ static int updateChallenges(void)
case CHALLENGE_WAYPOINTS:
updateWaypointChallenge(c);
break;
case CHALLENGE_RESCUE:
updateRescueChallenge(c);
break;
}
}
@ -446,6 +451,14 @@ static void updateWaypointChallenge(Challenge *c)
}
}
static void updateRescueChallenge(Challenge *c)
{
if (!c->passed)
{
c->passed = battle.stats[STAT_CIVILIANS_RESCUED] >= c->value;
}
}
char *getChallengeDescription(Challenge *c)
{
if (c->type == CHALLENGE_TIME)