Updated Team Player, and Bodyguard trophies.

This commit is contained in:
Steve 2016-08-09 23:13:13 +01:00
parent b668b5051b
commit 6ff3fd47a4
2 changed files with 14 additions and 14 deletions

View File

@ -129,14 +129,14 @@
{ {
"id" : "TEAM_PLAYER", "id" : "TEAM_PLAYER",
"title" : "Taking one for the team", "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", "value" : "TROPHY_BRONZE",
"hidden" : 1 "hidden" : 1
}, },
{ {
"id" : "BODYGUARD", "id" : "BODYGUARD",
"title" : "The 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", "value" : "TROPHY_BRONZE",
"hidden" : 1 "hidden" : 1
}, },

View File

@ -220,23 +220,23 @@ static void checkCollisions(Bullet *b)
battle.stats[STAT_MISSILES_EVADED]++; 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 */ /* assuming that health <= 0 will always mean killed */
if (e->health <= 0) if (e->health <= 0)
{ {
e->killedBy = b->owner; 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) if (e == player)
{ {
battle.lastKilledPlayer = b->owner; battle.lastKilledPlayer = b->owner;