From: PatR Date: Sun, 24 Jan 2016 03:15:38 +0000 (-0800) Subject: another vampire shape-shifting bit X-Git-Tag: NetHack-3.6.1_RC01~987 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45ba0addf25a6a0f29b6de793524e5250a6c039a;p=nethack another vampire shape-shifting bit Chameleon impersonating a vampire and vampire subject to protection from shape changers weren't the only ways to have a vampire monster which isn't a vampshifter. One-shot polymorph could produce that too. --- diff --git a/src/mon.c b/src/mon.c index 8080fd044..2dce54e1b 100644 --- a/src/mon.c +++ b/src/mon.c @@ -3205,6 +3205,9 @@ boolean msg; /* "The oldmon turns into a newmon!" */ } else if (mvitals[monsndx(mdat)].mvflags & G_GENOD) return 0; /* passed in mdat is genocided */ + if (mdat == mtmp->data) + return 0; /* still the same monster */ + mgender_from_permonst(mtmp, mdat); if (In_endgame(&u.uz) && is_mplayer(olddata) && has_mname(mtmp)) { @@ -3220,9 +3223,6 @@ boolean msg; /* "The oldmon turns into a newmon!" */ *p = '\0'; } - if (mdat == mtmp->data) - return 0; /* still the same monster */ - if (mtmp->wormno) { /* throw tail away */ wormgone(mtmp); place_monster(mtmp, mtmp->mx, mtmp->my); @@ -3337,6 +3337,12 @@ boolean msg; /* "The oldmon turns into a newmon!" */ MNAME(mtmp) = save_mname; } + /* when polymorph trap/wand/potion produces a vampire, turn in into + a full-fledged vampshifter unless shape-changing is blocked */ + if (mtmp->cham == NON_PM && mdat->mlet == S_VAMPIRE + && !Protection_from_shape_changers) + mtmp->cham = pm_to_cham(monsndx(mdat)); + possibly_unwield(mtmp, polyspot); /* might lose use of weapon */ mon_break_armor(mtmp, polyspot); if (!(mtmp->misc_worn_check & W_ARMG))