Added death match challenges.
This commit is contained in:
parent
65ef43754e
commit
2e17d68b47
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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");
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue