]> granicus.if.org Git - nethack/commitdiff
livelog tweaks
authorPatR <rankin@nethack.org>
Wed, 9 Feb 2022 22:25:32 +0000 (14:25 -0800)
committerPatR <rankin@nethack.org>
Wed, 9 Feb 2022 22:25:32 +0000 (14:25 -0800)
Log all level gains and loses.  For the existing logging of changes
in rank, mention the level number with the new title.  Classifying
level loss as "minor achievement" seems weird but I didn't see any
choice more appropriate.

Make '#chronicle' autocomplete.  That makes "#ch" ambiguous, but
better to have to type #cha to chat than to have to completely spell
out #chronicle.  (Changing it to #journal would make #j ambigious
but might still be an improvement.)

src/cmd.c
src/exper.c
src/insight.c

index bcafdd2bd25839ed97c2a737aed8512dfb83d242..d3048fb3ea4e00bcc0d19cd90794b813cd1380a0 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -2155,7 +2155,7 @@ struct ext_func_tab extcmdlist[] = {
     { M('a'), "adjust", "adjust inventory letters",
               doorganize, IFBURIED | AUTOCOMPLETE, NULL },
     { M('A'), "annotate", "name current level",
-              donamelevel, IFBURIED | AUTOCOMPLETE, NULL },
+              donamelevel, IFBURIED | AUTOCOMPLETE | GENERALCMD, NULL },
     { 'a',    "apply", "apply (use) a tool (pick-axe, key, lamp...)",
               doapply, CMD_M_PREFIX, NULL },
     { C('x'), "attributes", "show your attributes",
@@ -2169,11 +2169,11 @@ struct ext_func_tab extcmdlist[] = {
     { M('c'), "chat", "talk to someone",
               dotalk, IFBURIED | AUTOCOMPLETE, NULL },
     { '\0',   "chronicle", "show journal of major events",
-              do_gamelog, IFBURIED | GENERALCMD, NULL },
+              do_gamelog, IFBURIED | AUTOCOMPLETE | GENERALCMD, NULL },
     { 'c',    "close", "close a door",
               doclose, 0, NULL },
     { M('C'), "conduct", "list voluntary challenges you have maintained",
-              doconduct, IFBURIED | AUTOCOMPLETE, NULL },
+              doconduct, IFBURIED | AUTOCOMPLETE | GENERALCMD, NULL },
     { M('d'), "dip", "dip an object into something",
               dodip, AUTOCOMPLETE, NULL },
     { '>',    "down", "go down a staircase",
@@ -2248,7 +2248,7 @@ struct ext_func_tab extcmdlist[] = {
     /* #overview used to need autocomplete and has retained that even
        after being assigned to ^O [old wizard mode ^O is now #wizwhere] */
     { C('o'), "overview", "show a summary of the explored dungeon",
-              dooverview, IFBURIED | AUTOCOMPLETE, NULL },
+              dooverview, IFBURIED | AUTOCOMPLETE | GENERALCMD, NULL },
     /* [should #panic actually autocomplete?] */
     { '\0',   "panic", "test panic routine (fatal to game)",
               wiz_panic, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
index 5108ecaa8de62701d5cdf99c6f1e6331d4971e63..02c13a1d802711ebdee47baa8cb8599a0edc88af 100644 (file)
@@ -225,6 +225,7 @@ losexp(const char *drainer) /* cause of death, if drain should be fatal */
         u.ulevel -= 1;
         /* remove intrinsic abilities */
         adjabil(u.ulevel + 1, u.ulevel);
+        livelog_printf(LL_MINORAC, "lost experience level %d", u.ulevel);
     } else {
         if (drainer) {
             g.killer.format = KILLED_BY;
@@ -234,6 +235,7 @@ losexp(const char *drainer) /* cause of death, if drain should be fatal */
         }
         /* no drainer or lifesaved */
         u.uexp = 0;
+        livelog_printf(LL_MINORAC, "lost all experience");
     }
     num = (int) u.uhpinc[u.ulevel];
     u.uhpmax -= num;
@@ -333,6 +335,9 @@ pluslvl(boolean incr) /* true iff via incremental experience growth */
         newrank = xlev_to_rank(u.ulevel);
         if (newrank > oldrank)
             record_achievement(achieve_rank(newrank));
+        else
+            livelog_printf(LL_MINORAC, "gained experience level %d",
+                           u.ulevel);
     }
     g.context.botl = TRUE;
 }
index 077ef6b8328358d819d59146b87373ba8c6d2b76..a2612bc0c06809f99363e247d38003322bf7a0c3 100644 (file)
@@ -2282,11 +2282,14 @@ record_achievement(schar achidx)
     if (g.program_state.gameover)
         return; /* don't livelog achievements recorded at end of game */
     if (absidx >= ACH_RNK1 && absidx <= ACH_RNK8) {
-        livelog_printf(achieve_msg[absidx].llflag, "attained the rank of %s",
+        livelog_printf(achieve_msg[absidx].llflag,
+                       "attained the rank of %s (level %d)",
                        rank_of(rank_to_xlev(absidx - (ACH_RNK1 - 1)),
-                               Role_switch, (achidx < 0) ? TRUE : FALSE));
+                               Role_switch, (achidx < 0) ? TRUE : FALSE),
+                       u.ulevel);
     } else
-        livelog_printf(achieve_msg[absidx].llflag, "%s", achieve_msg[absidx].msg);
+        livelog_printf(achieve_msg[absidx].llflag, "%s",
+                       achieve_msg[absidx].msg);
 }
 
 /* discard a recorded achievement; return True if removed, False otherwise */