From 4f6721cba4d19808757643c7eae489c38480a979 Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 3 Mar 2016 11:31:32 +0000 Subject: [PATCH] Added 5th challenge mission. --- data/challenges/05.json | 64 +++++++++++++++++++++++++++++++++++++ src/challenges/challenges.c | 3 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 data/challenges/05.json diff --git a/data/challenges/05.json b/data/challenges/05.json new file mode 100644 index 0000000..7eccbef --- /dev/null +++ b/data/challenges/05.json @@ -0,0 +1,64 @@ +{ + "name" : "Disable all targets", + "description" : "Disable all targets", + "background" : "AUTO", + "planet" : "AUTO", + "music" : "", + "player" : { + "type" : "Hyena-A", + "side" : "SIDE_ALLIES", + "pilot" : "-", + "squadron" : "-", + "x" : 25, + "y" : 25 + }, + "objectives" : [ + { + "description" : "Do not destroy targets", + "targetName" : "TAF", + "targetValue" : 1, + "targetType" : "TT_DESTROY", + "isCondition" : 1 + } + ], + "challenge" : { + "timeLimit" : 90, + "killLimit" : 6, + "challenges" : [ + { + "type" : "CHALLENGE_TIME", + "value" : 90 + }, + { + "type" : "CHALLENGE_TIME", + "value" : 45 + }, + { + "type" : "CHALLENGE_DISABLE", + "value" : 6 + } + ] + }, + "fighters" : [ + { + "name" : "TAF", + "types" : "TAF", + "side" : "SIDE_REBEL", + "x" : 25, + "y" : 25, + "number" : 2, + "scatter" : 4000, + "flags" : "+EF_NO_KILL+EF_MUST_DISABLE+EF_MISSION_TARGET+EF_AI_LEADER" + }, + { + "name" : "Dart", + "types" : "Dart", + "side" : "SIDE_REBEL", + "x" : 25, + "y" : 25, + "number" : 4, + "scatter" : 4000, + "aiFlags" : "+AIF_MOVES_TO_LEADER" + } + ] +} diff --git a/src/challenges/challenges.c b/src/challenges/challenges.c index 9a5650e..83428c4 100644 --- a/src/challenges/challenges.c +++ b/src/challenges/challenges.c @@ -82,7 +82,8 @@ void doChallenges(void) failChallenge(); } - if (game.currentMission->challengeData.killLimit > 0 && battle.stats[STAT_ENEMIES_KILLED_PLAYER] >= game.currentMission->challengeData.killLimit) + /* disabled enemies count as killed during challenges - not player exclusive, but no need to worry about AI contributions here */ + if (game.currentMission->challengeData.killLimit > 0 && (battle.stats[STAT_ENEMIES_KILLED_PLAYER] + battle.stats[STAT_ENEMIES_DISABLED]) >= game.currentMission->challengeData.killLimit) { completeChallenge(); }