]> granicus.if.org Git - nethack/commitdiff
newcham() feedback: "A <mon> turns into it!"
authorPatR <rankin@nethack.org>
Thu, 21 Apr 2016 23:45:19 +0000 (16:45 -0700)
committerPatR <rankin@nethack.org>
Thu, 21 Apr 2016 23:45:19 +0000 (16:45 -0700)
Silly shapechange message if <mon> is sensed via telepathy and takes
on a mindless form.  In the case I noticed, it was a doppelganger on
the far side of a maze wall who changed from something ordinary into
a mummy while the hero was wearing an amulet of esp.

3.6.0 could deliver this message, but I think changes since then have
increased the chance for newcham() to give shapechange feedback.

doc/fixes36.1
src/mon.c

index b0ae56088d72b5372a5a65787791135db4ecb26d..af6dc52101e202c6db3cfa1eb8dfdd3d61c7eb50 100644 (file)
@@ -214,6 +214,8 @@ for menustyles traditional or combination, 'A' (or object ID) followed by i
        displayed an inventory of everything rather than just worn items (or
        not fully identified items)
 exploding chest trap would destroy uchain while still worn if uball carried
+if monster shapechange message "<foo> turns into <bar>!" was given, <bar>
+       could be "it" (if <foo> sensed telepathically and <bar> is mindless)
 
 post-3.6.0: fix "object lost" panic during pickup caused by sortloot revamp
 post-3.6.0: more sortloot revisions
index d5ac2e0bb1bc6976c6e232d719fc0457e07f64c2..bf742ad2b7e96fed651cce37f4a616d631e3cc77 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 mon.c   $NHDT-Date: 1454528962 2016/02/03 19:49:22 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.210 $ */
+/* NetHack 3.6 mon.c   $NHDT-Date: 1461282107 2016/04/21 23:41:47 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.215 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -2421,7 +2421,7 @@ struct monst *mtmp;
             }
             newsym(mtmp->mx, mtmp->my);
             return FALSE;   /* didn't petrify */
-       }
+        }
     }
     return TRUE;
 }
@@ -3367,10 +3367,17 @@ boolean msg;      /* "The oldmon turns into a newmon!" */
                             ? "slime"
                             : x_monnam(mtmp, ARTICLE_A, (char *) 0,
                                        SUPPRESS_SADDLE, FALSE));
-        if (!strcmpi(oldname, "it") && !strcmpi(newname, "it"))
+        /* oldname was capitalized above; newname will be lower case */
+        if (!strcmpi(newname, "it")) { /* can't see or sense it now */
+            if (!!strcmpi(oldname, "it")) /* could see or sense it before */
+                pline("%s disappears!", oldname);
             (void) usmellmon(mdat);
-        else
-            pline("%s turns into %s!", oldname, newname);
+        } else { /* can see or sense it now */
+            if (!strcmpi(oldname, "it")) /* couldn't see or sense it before */
+                pline("%s appears!", upstart(newname));
+            else
+                pline("%s turns into %s!", oldname, newname);
+        }
         if (save_mname)
             MNAME(mtmp) = save_mname;
     }