]> granicus.if.org Git - nethack/commitdiff
Avoid "It turns into [Name]" on vamp engulf
authorMichael Meyer <me@entrez.cc>
Fri, 10 Feb 2023 19:07:49 +0000 (14:07 -0500)
committerPatR <rankin@nethack.org>
Mon, 20 Feb 2023 20:44:43 +0000 (12:44 -0800)
Apply a similar fix as a791b4b and f441696 ended up settling on for
normal vampire transformation to the vampire transformation that happens
when their shapeshifted form is engulfed.

src/mhitm.c
src/uhitm.c

index 2ee234a9c07d05fd0c8dce228f139014444f36aa..d49f527a57c508b146ee1f3a087f69d8a64fdfb7 100644 (file)
@@ -784,8 +784,13 @@ gulpmm(
                using that would be excessively verbose */
             pline("%s expels %s.", Monnam(magr),
                   canspotmon(mdef) ? "it" : something);
-            if (canspotmon(mdef))
-                pline("It turns into %s.", a_monnam(mdef));
+            if (canspotmon(mdef)) {
+                pline("It turns into %s.",
+                      x_monnam(mdef, ARTICLE_A, (char *) 0,
+                               (SUPPRESS_NAME | SUPPRESS_IT
+                                | SUPPRESS_INVISIBLE), FALSE));
+                
+            }
         }
         return MM_HIT; /* bypass mdamagem() */
     }
index 338542389dd3ce7aac5174b008a1254b963dfe60..d79c7bdcd8bb813521a9db2c90a3ca81bf51017d 100644 (file)
@@ -4587,10 +4587,17 @@ gulpum(struct monst *mdef, struct attack *mattk)
             && newcham(mdef, &mons[mdef->cham], NO_NC_FLAGS)) {
             You("%s it, then %s it.", u_digest ? "swallow" : "engulf",
                 expel_verb);
-            if (canspotmon(mdef))
-                pline("It turns into %s.", a_monnam(mdef));
-            else
+            if (canspotmon(mdef)) {
+                /* Avoiding a_monnam here: if the target is named, it gives us
+                   a sequence like "You bite Dracula.  You swallow it, then
+                   regurgitate it.  It turns into Dracula." */
+                pline("It turns into %s.",
+                      x_monnam(mdef, ARTICLE_A, (char *) 0,
+                               (SUPPRESS_NAME | SUPPRESS_IT
+                                | SUPPRESS_INVISIBLE), FALSE));
+            } else {
                 map_invisible(mdef->mx, mdef->my);
+            }
             return MM_HIT;
         }