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(); }