Added PACIFIST trophy.

This commit is contained in:
Steve 2016-04-29 08:40:52 +01:00
parent ff9b35b0aa
commit 5de2356bec
3 changed files with 14 additions and 1 deletions

View File

@ -272,5 +272,11 @@
"description" : "Be destroyed while piloting an ATAF",
"value" : "TROPHY_BRONZE",
"hidden" : 1
},
{
"id" : "PACIFIST",
"title" : "Pacifist",
"description" : "Complete any fighter-based mission without firing",
"value" : "TROPHY_BRONZE"
}
]

View File

@ -238,7 +238,7 @@ void doTrophyAlerts(void)
}
else if (alertTrophy)
{
alertRect.x = MIN(alertRect.x + 16, -1);
alertRect.x = MIN(alertRect.x + 24, -1);
if (alertRect.x > -150)
{
@ -363,6 +363,7 @@ static void loadTrophyData(char *filename)
t->shortDescription[MAX_NAME_LENGTH - 1] = '.';
t->shortDescription[MAX_NAME_LENGTH - 2] = '.';
t->shortDescription[MAX_NAME_LENGTH - 3] = '.';
t->shortDescription[MAX_NAME_LENGTH - 4] = ' ';
}
t->stat = -1;
@ -459,6 +460,11 @@ void awardPostMissionTrophies(void)
awardTrophy("SURVIVOR");
}
}
if (player->guns[0].type && player->missiles && !game->starSystem->isSol && !battle.stats[STAT_SHOTS_FIRED] && !battle.stats[STAT_MISSILES_FIRED])
{
awardTrophy("PACIFIST");
}
}
/* the player is known as "Player", so we need to check the craft they were assigned to */

View File

@ -44,4 +44,5 @@ extern void textSize(char *text, int size, int *w, int *h);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Game game;