From 019a9df5d2da9e47b7eedb32d78c0e42e79831e6 Mon Sep 17 00:00:00 2001 From: David Meyer Date: Wed, 20 Mar 2024 16:51:29 +0900 Subject: [PATCH] Segregate score file into gold and XP sections; print XP in end results --- score.c | 70 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/score.c b/score.c index 4bcf4e3..d0cd490 100644 --- a/score.c +++ b/score.c @@ -107,7 +107,8 @@ killed_by(const object *monster, short other) mechanism = mechanism_buf; } snprintf(message_buf, sizeof(message_buf), - "%s with %ld gold", mechanism, rogue.gold); + "%s with %ld gold and %ld experience (level %d)", + mechanism, rogue.gold, rogue.exp_points, rogue.exp); if ((!other) && (!no_skull)) { clear(); @@ -336,6 +337,7 @@ void put_scores(const object *monster, short other) { short i, rank=-1, found_player = -1, numscores = 0; + short expscore, found_player_exp = -1; struct score_entry scores[NUM_SCORE_ENTRIES]; const char *name; FILE *fp; @@ -360,27 +362,57 @@ put_scores(const object *monster, short other) } } - /* Search the score list. */ - for (i=0; i