From 721ca3e110e2d448627e809f1649e2bf88db704c Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 6 Mar 2016 17:13:34 +0000 Subject: [PATCH] Trophy updates. --- data/trophies/trophies.json | 14 +++++++++++--- src/game/trophies.c | 1 + src/game/trophies.h | 1 + src/structs.h | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/data/trophies/trophies.json b/data/trophies/trophies.json index 12d3e7e..71dfa0a 100644 --- a/data/trophies/trophies.json +++ b/data/trophies/trophies.json @@ -21,7 +21,8 @@ "id" : "CAMPAIGN_COYOTE", "title" : "Coyote Ugly", "description" : "Complete all missions at Coyote", - "value" : "TROPHY_BRONZE" + "value" : "TROPHY_BRONZE", + "hidden" : 1 }, { "id" : "PANDORAN_FIRST", @@ -54,9 +55,9 @@ "value" : "TROPHY_GOLD" }, { - "id" : "FIRE_10000", + "id" : "FIRE_100000", "title" : "Your name's on one of these!", - "description" : "Fire 10,000 shots", + "description" : "Fire 100,000 shots", "value" : "TROPHY_SILVER" }, { @@ -64,5 +65,12 @@ "title" : "Dodge this!", "description" : "Launch 1,000 missiles", "value" : "TROPHY_SILVER" + }, + { + "id" : "ATAF_DESTROYED", + "title" : "Almost indestructable. Almost.", + "description" : "Be destroyed while piloting an ATAF", + "value" : "TROPHY_BRONZE", + "hidden" : 1 } ] diff --git a/src/game/trophies.c b/src/game/trophies.c index 115d967..6c79e78 100644 --- a/src/game/trophies.c +++ b/src/game/trophies.c @@ -105,6 +105,7 @@ static void loadTrophyData(char *filename) STRNCPY(t->title, cJSON_GetObjectItem(node, "title")->valuestring, MAX_DESCRIPTION_LENGTH); STRNCPY(t->description, cJSON_GetObjectItem(node, "description")->valuestring, MAX_DESCRIPTION_LENGTH); t->value = lookup(cJSON_GetObjectItem(node, "value")->valuestring); + t->hidden = getJSONValue(node, "hidden", 0); tail->next = t; tail = t; diff --git a/src/game/trophies.h b/src/game/trophies.h index d696922..9a9c05a 100644 --- a/src/game/trophies.h +++ b/src/game/trophies.h @@ -25,5 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern long lookup(char *name); extern char *readFile(char *filename); +extern int getJSONValue(cJSON *node, char *name, int defValue); extern Game game; diff --git a/src/structs.h b/src/structs.h index c7dd012..b33f85d 100644 --- a/src/structs.h +++ b/src/structs.h @@ -346,6 +346,7 @@ struct Trophy { char title[MAX_DESCRIPTION_LENGTH]; char description[MAX_DESCRIPTION_LENGTH]; int value; + int hidden; int awarded; unsigned long awardDate; int notify;