]> granicus.if.org Git - nethack/commitdiff
fix #H4426 - shapeshifted vampires vs stoning
authorPatR <rankin@nethack.org>
Tue, 12 Jul 2016 00:38:02 +0000 (17:38 -0700)
committerPatR <rankin@nethack.org>
Tue, 12 Jul 2016 00:38:02 +0000 (17:38 -0700)
and vs digestion.  minstapetrify() was previously changed to
explicitly revert a shape-shifted vampire back to vampire form
when it was turned to stone.  This does the same for monstone().
It also causes shape-shifted vampires to revert to vampire form
immediately when swallowed, so subsequent death via digestion or
engulfing damage doesn't have to deal with reverting changed shape.

I'm not convinced this is the right fix for either stoning or
being digested.  Unlike with ordinary damage, where multiple hits
are usually needed to kill a vampire after it reverts to 'V' form,
here the vampire will be killed by the next successful stoning or
digestion attack in one hit.  It ought to least try to flee.

doc/fixes36.1
src/mhitm.c
src/mon.c
src/uhitm.c

index bac5863f33ee477a0fc59d551f35f809c1a97acd..f2faf576c78d623db210e4fc9419a4d448de72ad 100644 (file)
@@ -318,6 +318,8 @@ if a visible monster becomes invisible, mark its spot with the 'remembered,
        unseen monster' glyph ('I' character or '?' tile)
 monsters can throw cockatrice eggs at hero, but there was no handling for eggs
        when the missile hit an intervening monster
+clarify that shape-shifted vampires revert to vampire form when petrified or
+       digested; when back in 'V' form, they're vulnerable to such damage
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
index 6f9281960bc76692216687d39e0459ae48a4d411..e92b6e2873f9f1026b8d0a6e00988ec0eee01b47 100644 (file)
@@ -677,12 +677,26 @@ register struct attack *mattk;
         return MM_MISS;
 
     if (vis) {
+        /* [this two-part formatting dates back to when only one x_monnam
+           result could be included in an expression because the next one
+           would overwrite first's result -- that's no longer the case] */
         Sprintf(buf, "%s swallows", Monnam(magr));
         pline("%s %s.", buf, mon_nam(mdef));
     }
     for (obj = mdef->minvent; obj; obj = obj->nobj)
         (void) snuff_lit(obj);
 
+    if (is_vampshifter(mdef)
+        && newcham(mdef, &mons[mdef->cham], FALSE, FALSE)) {
+        if (vis) {
+            /* 'it' -- previous form is no longer available and
+               using that would be excessively verbose */
+            pline("%s expels it.", Monnam(magr));
+            pline("It turns into %s.", a_monnam(mdef));
+        }
+        return MM_HIT; /* bypass mdamagem() */
+    }
+
     /*
      *  All of this manipulation is needed to keep the display correct.
      *  There is a flush at the next pline().
index 457313246253aef473cefe04cc0f9b71f8df36aa..243ffbd6f8303492a1e444d6376a989cb447e3b6 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -2043,6 +2043,9 @@ struct monst *mdef;
     xchar x = mdef->mx, y = mdef->my;
     boolean wasinside = FALSE;
 
+    if (!vamp_stone(mdef)) /* vampshifter reverts to vampire */
+        return;
+
     /* we have to make the statue before calling mondead, to be able to
      * put inventory in it, and we have to check for lifesaving before
      * making the statue....
@@ -2402,9 +2405,8 @@ struct monst *mtmp;
             /* construct a format string before transformation */
             Sprintf(buf, "The lapidifying %s %s %s",
                     x_monnam(mtmp, ARTICLE_NONE, (char *) 0,
-                             SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION
-                                 | SUPPRESS_INVISIBLE | SUPPRESS_IT,
-                             FALSE),
+                             (SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION
+                              | SUPPRESS_INVISIBLE | SUPPRESS_IT), FALSE),
                     amorphous(mtmp->data) ? "coalesces on the"
                        : is_flyer(mtmp->data) ? "drops to the"
                           : "writhes on the",
@@ -2434,8 +2436,8 @@ struct monst *mtmp;
             else
                 mtmp->cham = mndx;
             if (canspotmon(mtmp)) {
-                    pline("%s rises from the %s with renewed agility!",
-                            Amonnam(mtmp), surface(mtmp->mx, mtmp->my));
+                pline("%s rises from the %s with renewed agility!",
+                      Amonnam(mtmp), surface(mtmp->mx, mtmp->my));
             }
             newsym(mtmp->mx, mtmp->my);
             return FALSE;   /* didn't petrify */
index 7c9bf3f5f57454873280a0db0788b160cfa3945c..d377791c276eeada4c5be5417f34dc98e4375c96 100644 (file)
@@ -1894,6 +1894,18 @@ register struct attack *mattk;
         for (otmp = mdef->minvent; otmp; otmp = otmp->nobj)
             (void) snuff_lit(otmp);
 
+        /* force vampire in bat, cloud, or wolf form to revert back to
+           vampire form now instead of dealing with that when it dies */
+        if (is_vampshifter(mdef)
+            && newcham(mdef, &mons[mdef->cham], FALSE, FALSE)) {
+            You("engulf it, then expel it.");
+            if (canspotmon(mdef))
+                pline("It turns into %s.", a_monnam(mdef));
+            else
+                map_invisible(mdef->mx, mdef->my);
+            return 1;
+        }
+
         /* engulfing a cockatrice or digesting a Rider or Medusa */
         fatal_gulp = (touch_petrifies(pd) && !Stone_resistance)
                      || (mattk->adtyp == AD_DGST
@@ -1937,6 +1949,10 @@ register struct attack *mattk;
                     m_useup(mdef, otmp);
 
                 newuhs(FALSE);
+                /* Message sequencing BUG: if you gain a level here,
+                 * "welcome to level N+1" is given immediately and
+                 * then "you totally digest <foo>" is given later.
+                 */
                 xkilled(mdef, XKILL_NOMSG | XKILL_NOCORPSE);
                 if (mdef->mhp > 0) { /* monster lifesaved */
                     You("hurriedly regurgitate the sizzling in your %s.",