Allow challenges to specify that all enemies must be defeated before activating waypoint.
This commit is contained in:
parent
9c9f456c6e
commit
6287e10746
|
@ -96,6 +96,13 @@ static int isCurrentObjective(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (game.currentMission->challengeData.isChallenge && game.currentMission->challengeData.clearWaypointEnemies && battle.numEnemies > 0)
|
||||
{
|
||||
addHudMessage(colors.cyan, _("Cannot activate waypoint - eliminate enemies first"));
|
||||
self->aiActionTime = FPS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,3 +32,4 @@ extern Battle battle;
|
|||
extern Colors colors;
|
||||
extern Entity *self;
|
||||
extern Entity *player;
|
||||
extern Game game;
|
||||
|
|
|
@ -113,6 +113,7 @@ void loadChallenge(Mission *mission, cJSON *node)
|
|||
|
||||
/* misc */
|
||||
mission->challengeData.allowPlayerDeath = getJSONValue(node, "allowPlayerDeath", 0);
|
||||
mission->challengeData.clearWaypointEnemies = getJSONValue(node, "clearWaypointEnemies", 0);
|
||||
|
||||
node = cJSON_GetObjectItem(node, "challenges");
|
||||
|
||||
|
|
|
@ -263,6 +263,7 @@ typedef struct {
|
|||
int noGuns;
|
||||
int scriptedEnd;
|
||||
int allowPlayerDeath;
|
||||
int clearWaypointEnemies;
|
||||
Challenge *challenges[MAX_CHALLENGES];
|
||||
} ChallengeData;
|
||||
|
||||
|
|
Loading…
Reference in New Issue