Wizard of Yendor entering endgame

When entering the Plane of Earth (or level teleporting directly to
another endgame level in wizard mode), if the Wizard came off the
migrating_mons list instead being re-created from scratch, he would
be placed randomly on the level instead of next to the arrival point.
If his mstrategy field still had the STRAT_WAITFORU bit set and you
didn't move to where he could see you, he might never come after you,
at least until some future harassment event chose 'resurrect'.
This commit is contained in:
PatR
2022-08-05 14:22:27 -07:00
parent b01d81277e
commit 393283f05c
3 changed files with 25 additions and 5 deletions

View File

@@ -398,6 +398,9 @@ mon_arrive(struct monst *mtmp, int when)
else
mnexto(mtmp, RLOC_NOMSG);
return;
} else if (when == Wiz_arrive) {
/* resurrect() is bringing existing wizard to harass the hero */
xyloc = MIGR_WITH_HERO;
}
/*
* The monster arrived on this level independently of the player.
@@ -410,10 +413,9 @@ mon_arrive(struct monst *mtmp, int when)
long nmv = g.moves - 1L - mtmp->mlstmv;
mon_catchup_elapsed_time(mtmp, nmv);
mtmp->mlstmv = g.moves - 1L;
/* let monster move a bit on new level (see placement code below) */
wander = (xint16) min(nmv, 8);
wander = (xint16) min(nmv, 8L);
} else
wander = 0;
@@ -526,7 +528,7 @@ mon_arrive(struct monst *mtmp, int when)
if (when != Wiz_arrive)
/* losedogs() will deal with this */
relmon(mtmp, &failed_arrivals);
else
else /* when==Wiz_arrive => not being called by losedogs() */
m_into_limbo(mtmp);
}
}
@@ -629,6 +631,8 @@ mon_catchup_elapsed_time(
mtmp->mhp = mtmp->mhpmax;
else
mtmp->mhp += imv;
set_mon_lastmove(mtmp);
}
/* bookkeeping when mtmp is about to leave the current level;