diff --git a/src/battle/fighters.c b/src/battle/fighters.c index 795b666..05e8008 100644 --- a/src/battle/fighters.c +++ b/src/battle/fighters.c @@ -95,6 +95,11 @@ Entity *spawnFighter(char *name, int x, int y, int side) e->action = doAI; e->die = die; + + if (game.currentMission->challengeData.isDeathMatch) + { + e->side = SDL_GetTicks(); + } return e; } diff --git a/src/challenges/challenges.c b/src/challenges/challenges.c index 6d7cde0..13376af 100644 --- a/src/challenges/challenges.c +++ b/src/challenges/challenges.c @@ -116,6 +116,8 @@ void loadChallenge(Mission *mission, cJSON *node) mission->challengeData.allowPlayerDeath = getJSONValue(node, "allowPlayerDeath", 0); mission->challengeData.clearWaypointEnemies = getJSONValue(node, "clearWaypointEnemies", 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"); diff --git a/src/structs.h b/src/structs.h index 4b42513..ae2b3f3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -265,6 +265,8 @@ typedef struct { int allowPlayerDeath; int clearWaypointEnemies; int eliminateThreats; + int isDeathMatch; + int isTeamDeathMatch; Challenge *challenges[MAX_CHALLENGES]; } ChallengeData;