From 4792c6d971e1d08b1dbd2760bc6711704ed5becb Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 8 Apr 2016 11:03:50 +0100 Subject: [PATCH] Added TEAM_PLAYER trophy. --- data/trophies/trophies.json | 6 ++++++ src/battle/bullets.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/data/trophies/trophies.json b/data/trophies/trophies.json index db60bd0..b7a8d74 100644 --- a/data/trophies/trophies.json +++ b/data/trophies/trophies.json @@ -138,6 +138,12 @@ "description" : "Complete a mission using a Shuttle", "value" : "TROPHY_BRONZE" }, + { + "id" : "TEAM_PLAYER", + "title" : "Taking one for the Team", + "description" : "Be killed by a missile that was meant for someone else", + "value" : "TROPHY_SILVER" + }, { "id" : "CHALLENGE_25", "title" : "", diff --git a/src/battle/bullets.c b/src/battle/bullets.c index 8c2c3da..3be3712 100644 --- a/src/battle/bullets.c +++ b/src/battle/bullets.c @@ -214,6 +214,11 @@ static void checkCollisions(Bullet *b) } e->killedBy = b->owner; + + if (b->type == BT_MISSILE && e == player && b->target != player) + { + awardTrophy("TEAM_PLAYER"); + } } if (b->owner == player && b->type == BT_MISSILE)