From ff299714537b3b7923e6b115fc6be08cc59b5a81 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 11 Jul 2016 17:38:02 -0700 Subject: [PATCH] fix #H4426 - shapeshifted vampires vs stoning 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 | 2 ++ src/mhitm.c | 14 ++++++++++++++ src/mon.c | 12 +++++++----- src/uhitm.c | 16 ++++++++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index bac5863f3..f2faf576c 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/mhitm.c b/src/mhitm.c index 6f9281960..e92b6e287 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -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(). diff --git a/src/mon.c b/src/mon.c index 457313246..243ffbd6f 100644 --- 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 */ diff --git a/src/uhitm.c b/src/uhitm.c index 7c9bf3f5f..d377791c2 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -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 " is given later. + */ xkilled(mdef, XKILL_NOMSG | XKILL_NOCORPSE); if (mdef->mhp > 0) { /* monster lifesaved */ You("hurriedly regurgitate the sizzling in your %s.", -- 2.40.0