Revenge trophy requires player to kill the enemy that killed them last.

This commit is contained in:
Steve 2016-05-26 18:17:46 +01:00
parent 40695a3572
commit 4cd0c36b73
4 changed files with 4 additions and 4 deletions

View File

@ -310,7 +310,7 @@
{ {
"id" : "REVENGE", "id" : "REVENGE",
"title" : "Revenge", "title" : "Revenge",
"description" : "During an epic battle, kill an enemy that previously killed you", "description" : "During an epic battle, kill the enemy that just killed you",
"value" : "TROPHY_BRONZE" "value" : "TROPHY_BRONZE"
} }
] ]

View File

@ -233,10 +233,10 @@ static void checkCollisions(Bullet *b)
if (e == player) if (e == player)
{ {
b->owner->flags |= EF_KILLED_PLAYER; battle.lastKilledPlayer = b->owner;
} }
if (b->owner == player && e->flags & EF_KILLED_PLAYER) if (b->owner == player && e == battle.lastKilledPlayer)
{ {
awardTrophy("REVENGE"); awardTrophy("REVENGE");
} }

View File

@ -109,7 +109,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define EF_NO_THREAT (2 << 23) #define EF_NO_THREAT (2 << 23)
#define EF_DROPS_ITEMS (2 << 24) #define EF_DROPS_ITEMS (2 << 24)
#define EF_COMMON_FIGHTER (2 << 25) #define EF_COMMON_FIGHTER (2 << 25)
#define EF_KILLED_PLAYER (2 << 26)
#define AIF_NONE 0 #define AIF_NONE 0
#define AIF_FOLLOWS_PLAYER (2 << 0) #define AIF_FOLLOWS_PLAYER (2 << 0)

View File

@ -359,6 +359,7 @@ typedef struct {
Entity *missionTarget; Entity *missionTarget;
Entity *jumpgate; Entity *jumpgate;
Entity *messageSpeaker; Entity *messageSpeaker;
Entity *lastKilledPlayer;
SDL_Texture *background, *planetTexture; SDL_Texture *background, *planetTexture;
PointF planet; PointF planet;
int planetWidth, planetHeight; int planetWidth, planetHeight;