From 6ff3fd47a4a1b737b6a4668cd4d5559653837b5e Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 9 Aug 2016 23:13:13 +0100 Subject: [PATCH] Updated Team Player, and Bodyguard trophies. --- data/trophies/trophies.json | 4 ++-- src/battle/bullets.c | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/data/trophies/trophies.json b/data/trophies/trophies.json index cb5a7b9..7414284 100644 --- a/data/trophies/trophies.json +++ b/data/trophies/trophies.json @@ -129,14 +129,14 @@ { "id" : "TEAM_PLAYER", "title" : "Taking one for the team", - "description" : "Be killed by a missile that was meant for someone else", + "description" : "Be hit by a missile that was meant for someone else", "value" : "TROPHY_BRONZE", "hidden" : 1 }, { "id" : "BODYGUARD", "title" : "The bodyguard", - "description" : "Kill an enemy with a missile intended for their wing leader", + "description" : "Hit an enemy with a missile intended for their wing leader", "value" : "TROPHY_BRONZE", "hidden" : 1 }, diff --git a/src/battle/bullets.c b/src/battle/bullets.c index 81884b4..3d7091b 100644 --- a/src/battle/bullets.c +++ b/src/battle/bullets.c @@ -220,23 +220,23 @@ static void checkCollisions(Bullet *b) battle.stats[STAT_MISSILES_EVADED]++; } + if (b->type == BT_MISSILE && b->target != e) + { + if (e == player) + { + awardTrophy("TEAM_PLAYER"); + } + else if (b->owner == player && (e->aiFlags & AIF_MOVES_TO_LEADER) && (b->target->flags & EF_AI_LEADER)) + { + awardTrophy("BODYGUARD"); + } + } + /* assuming that health <= 0 will always mean killed */ if (e->health <= 0) { e->killedBy = b->owner; - if (b->type == BT_MISSILE && b->target != e) - { - if (e == player) - { - awardTrophy("TEAM_PLAYER"); - } - else if (b->owner == player && (e->aiFlags & AIF_MOVES_TO_LEADER) && (b->target->flags & EF_AI_LEADER)) - { - awardTrophy("BODYGUARD"); - } - } - if (e == player) { battle.lastKilledPlayer = b->owner;