if (mtmp->cham >= LOW_PM)
decide_to_shapeshift(mtmp, (canspotmon(mtmp)
|| engulfing_u(mtmp))
- ? SHIFT_MSG : 0);
+ ? SHIFT_MSG : 0);
were_change(mtmp);
/* gradually time out temporary problems */
DISABLE_WARNING_FORMAT_NONLITERAL
void
-mondead(register struct monst* mtmp)
+mondead(struct monst *mtmp)
{
struct permonst *mptr;
boolean be_sad;
&& !(g.mvitals[mndx].mvflags & G_GENOD)) {
coord new_xy;
char buf[BUFSZ];
- boolean in_door = (amorphous(mtmp->data)
- && closed_door(mtmp->mx, mtmp->my)),
- /* alternate message phrasing for some monster types */
- spec_mon = (nonliving(mtmp->data)
- || noncorporeal(mtmp->data)
- || amorphous(mtmp->data)),
- spec_death = (g.disintegested /* disintegrated or digested */
- || noncorporeal(mtmp->data)
- || amorphous(mtmp->data));
+ /* alternate message phrasing for some monster types */
+ boolean spec_mon = (nonliving(mtmp->data)
+ || noncorporeal(mtmp->data)
+ || amorphous(mtmp->data)),
+ spec_death = (g.disintegested /* disintegrated/digested */
+ || noncorporeal(mtmp->data)
+ || amorphous(mtmp->data));
int x = mtmp->mx, y = mtmp->my;
/* construct a format string before transformation;
else
uunstick();
}
- if (in_door) {
+ /* if fog cloud is on a closed door space, move it to a more
+ appropriate spot for its intended new form */
+ if (amorphous(mtmp->data) && closed_door(mtmp->mx, mtmp->my)) {
if (enexto(&new_xy, mtmp->mx, mtmp->my, &mons[mndx]))
rloc_to(mtmp, new_xy.x, new_xy.y);
}
}
boolean
-vamp_stone(struct monst* mtmp)
+vamp_stone(struct monst *mtmp)
{
if (is_vampshifter(mtmp)) {
int mndx = mtmp->cham;
if (mndx >= LOW_PM && mndx != monsndx(mtmp->data)
&& !(g.mvitals[mndx].mvflags & G_GENOD)) {
char buf[BUFSZ];
- boolean in_door = (amorphous(mtmp->data)
- && closed_door(mtmp->mx, mtmp->my));
/* construct a format string before transformation */
Sprintf(buf, "The lapidifying %s %s %s",
amorphous(mtmp->data) ? "coalesces on the"
: is_flyer(mtmp->data) ? "drops to the"
: "writhes on the",
- surface(x,y));
+ surface(x, y));
mtmp->mcanmove = 1;
mtmp->mfrozen = 0;
set_mon_min_mhpmax(mtmp, 10); /* mtmp->mhpmax=max(m_lev+1,10) */
/* this can happen if previously a fog cloud */
if (engulfing_u(mtmp))
expels(mtmp, mtmp->data, FALSE);
- if (in_door) {
+ if (amorphous(mtmp->data) && closed_door(mtmp->mx, mtmp->my)) {
coord new_xy;
if (enexto(&new_xy, mtmp->mx, mtmp->my, &mons[mndx])) {
}
void
-decide_to_shapeshift(struct monst* mon, int shiftflags)
+decide_to_shapeshift(struct monst *mon, int shiftflags)
{
struct permonst *ptr = 0;
int mndx;
ptr = &mons[mon->cham];
dochng = TRUE;
} else if (mon->data == &mons[PM_FOG_CLOUD]
- && mon->mhp == mon->mhpmax && !rn2(4)
- && (!canseemon(mon)
- || distu(mon->mx, mon->my) > BOLT_LIM * BOLT_LIM)) {
+ && mon->mhp == mon->mhpmax && !rn2(4)
+ && (!canseemon(mon)
+ || distu(mon->mx, mon->my) > BOLT_LIM * BOLT_LIM)) {
/* if a fog cloud, maybe change to wolf or vampire bat;
those are more likely to take damage--at least when
tame--and then switch back to vampire; they'll also
dochng = (ptr != mon->data);
}
}
+ if (dochng && amorphous(mon->data)
+ && closed_door(mon->mx, mon->my)) {
+ coord new_xy;
+
+ if (enexto(&new_xy, mon->mx, mon->my, ptr)) {
+ rloc_to(mon, new_xy.x, new_xy.y);
+ }
+ }
} else {
if (mon->mhp >= 9 * mon->mhpmax / 10 && !rn2(6)
&& (!canseemon(mon)