Print stats when in debug mode at end of challenge.
This commit is contained in:
parent
c95b56728f
commit
e5c5315e62
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue