diff --git a/src/challenges/challenges.c b/src/challenges/challenges.c index 64ecece..c9c8b10 100644 --- a/src/challenges/challenges.c +++ b/src/challenges/challenges.c @@ -31,6 +31,7 @@ static void failChallenge(void); static void updateChallenges(void); static char *getFormattedChallengeDescription(const char *format, ...); char *getChallengeDescription(Challenge *c); +static void printStats(void); static char descriptionBuffer[MAX_DESCRIPTION_LENGTH]; static const char *challengeDescription[CHALLENGE_MAX]; @@ -130,6 +131,31 @@ static void updateChallenges(void) } } } + + if (dev.debug) + { + printStats(); + } +} + +static void printStats(void) +{ + int i; + + for (i = 0 ; i < STAT_MAX ; i++) + { + if (battle.stats[i]) + { + if (i != STAT_TIME) + { + printf("DEBUG: %s=%d\n", getLookupName("STAT_", i), battle.stats[i]); + } + else + { + printf("DEBUG: %s=%s\n", getLookupName("STAT_", i), timeToString(battle.stats[i], 0)); + } + } + } } static void updateTimeChallenge(Challenge *c) diff --git a/src/challenges/challenges.h b/src/challenges/challenges.h index 178cba7..5211c9d 100644 --- a/src/challenges/challenges.h +++ b/src/challenges/challenges.h @@ -27,7 +27,10 @@ extern void retreatAllies(void); extern void retreatEnemies(void); extern char *getTranslatedString(char *string); extern char *getFileLocation(char *filename); +extern char *getLookupName(char *prefix, long num); +extern char *timeToString(long millis, int showHours); +extern Dev dev; extern Battle battle; extern Entity *player; extern Game game;