Added death match challenges.

This commit is contained in:
Steve 2016-05-12 09:34:09 +01:00
parent 65ef43754e
commit 2e17d68b47
3 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,11 @@ Entity *spawnFighter(char *name, int x, int y, int side)
e->action = doAI; e->action = doAI;
e->die = die; e->die = die;
if (game.currentMission->challengeData.isDeathMatch)
{
e->side = SDL_GetTicks();
}
return e; return e;
} }

View File

@ -116,6 +116,8 @@ void loadChallenge(Mission *mission, cJSON *node)
mission->challengeData.allowPlayerDeath = getJSONValue(node, "allowPlayerDeath", 0); mission->challengeData.allowPlayerDeath = getJSONValue(node, "allowPlayerDeath", 0);
mission->challengeData.clearWaypointEnemies = getJSONValue(node, "clearWaypointEnemies", 0); mission->challengeData.clearWaypointEnemies = getJSONValue(node, "clearWaypointEnemies", 0);
mission->challengeData.eliminateThreats = getJSONValue(node, "eliminateThreats", 0); mission->challengeData.eliminateThreats = getJSONValue(node, "eliminateThreats", 0);
mission->challengeData.isDeathMatch = getJSONValue(node, "isDeathMatch", 0);
mission->challengeData.isTeamDeathMatch = getJSONValue(node, "isTeamDeathMatch", 0);
node = cJSON_GetObjectItem(node, "challenges"); node = cJSON_GetObjectItem(node, "challenges");

View File

@ -265,6 +265,8 @@ typedef struct {
int allowPlayerDeath; int allowPlayerDeath;
int clearWaypointEnemies; int clearWaypointEnemies;
int eliminateThreats; int eliminateThreats;
int isDeathMatch;
int isTeamDeathMatch;
Challenge *challenges[MAX_CHALLENGES]; Challenge *challenges[MAX_CHALLENGES];
} ChallengeData; } ChallengeData;