From 1922dd96eb3973b52ca082b66fadd239f4f51fea Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 11 Mar 2024 17:40:01 -0700 Subject: [PATCH] theme room vampire fix From a reddit thread: a 'mausoleum' theme room picked a vampire for its occupant and applied the wait-for-you strategy to it. Hero's ESP or monster detection showed a meditating vampire bat. Change monster creation by the special level loader (which also handles theme rooms) to force such a creature into its normal vampire form. That revealed an older bug which wouldn't have been exercized prior to theme rooms: a meditating vampire could and would shape change without ceasing meditation. Make it not shape change rather come out of its trance. --- src/mon.c | 2 +- src/sp_lev.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mon.c b/src/mon.c index c9c7540f9..f3bf3907a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -4476,7 +4476,7 @@ decide_to_shapeshift(struct monst *mon, int shiftflags) /* regular shapeshifter */ if (!rn2(6)) dochng = TRUE; - } else { + } else if (!(mon->mstrategy & STRAT_WAITFORU)) { /* The vampire has to be in good health (mhp) to maintain * its shifted form. * diff --git a/src/sp_lev.c b/src/sp_lev.c index df653678f..28648f8ac 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -2133,6 +2133,11 @@ create_monster(monster *m, struct mkroom *croom) } if (m->waiting) { mtmp->mstrategy |= STRAT_WAITFORU; + /* if this is a vampire that got created already shifted into + bat/fog/wolf form and the special level or theme room didn't + explicitly request that, shift back to vampire */ + if (vampshifted(mtmp) && m->appear != M_AP_MONSTER) + (void) newcham(mtmp, &mons[mtmp->cham], NO_NC_FLAGS); } if (m->has_invent) { discard_minvent(mtmp, TRUE);