]> granicus.if.org Git - nethack/commitdiff
spell learning feedback
authorPatR <rankin@nethack.org>
Mon, 14 Dec 2020 21:12:33 +0000 (13:12 -0800)
committerPatR <rankin@nethack.org>
Mon, 14 Dec 2020 21:12:33 +0000 (13:12 -0800)
Tell the player the spell casting letter when learning a new spell:
|You add "knock" to your repertoire, as 'e'.
Comparable to "k - ring mail" when picking up a suit of ring mail
puts it into inventory slot k.

src/spell.c

index 160a8ed5d6bcdd23b1f025360bb1502b608cf328..4c92437cc4ff0b3bd32985df93f53b76931dd4d1 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 spell.c $NHDT-Date: 1596498211 2020/08/03 23:43:31 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.107 $ */
+/* NetHack 3.7 spell.c $NHDT-Date: 1607980325 2020/12/14 21:12:05 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.110 $ */
 /*      Copyright (c) M. Stephenson 1988                          */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -416,7 +416,12 @@ learn(VOID_ARGS)
             g.spl_book[i].sp_lev = objects[booktype].oc_level;
             incrnknow(i, 1);
             book->spestudied++;
-            You(i > 0 ? "add %s to your repertoire." : "learn %s.", splname);
+            if (!i)
+                /* first is always 'a', so no need to mention the letter */
+                You("learn %s.", splname);
+            else
+                You("add %s to your repertoire, as '%c'.",
+                    splname, spellet(i));
         }
         makeknown((int) booktype);
     }