assorted mirror fixes--mainly visibility issues
some monsters can't be strangled; self-polymorph can stop/restart strangulation
re-adjust gem generation probabilities when revisiting existing dungeon levels
+kick evasion shouldn't move monsters through walls
+kick evasion and jousting/staggering blows shouldn't move grid bugs diagonally
Platform- and/or Interface-Specific Fixes
E void FDECL(xkilled, (struct monst *,int));
E void FDECL(mon_to_stone, (struct monst*));
E void FDECL(mnexto, (struct monst *));
+E void FDECL(maybe_mnexto, (struct monst *));
E boolean FDECL(mnearto, (struct monst *,XCHAR_P,XCHAR_P,BOOLEAN_P));
E void FDECL(m_respond, (struct monst *));
E void FDECL(setmangry, (struct monst *));
(void) passive(mon, FALSE, 1, AT_KICK, FALSE);
return;
} else {
- mnexto(mon);
+ maybe_mnexto(mon);
if(mon->mx != x || mon->my != y) {
if(glyph_is_invisible(levl[x][y].glyph)) {
unmap_object(x, y);
dx = sgn(dx);
dy = sgn(dy);
if(!range || (!dx && !dy)) return; /* paranoia */
+ /* don't let grid bugs be hurtled diagonally */
+ if (dx && dy && NODIAG(monsndx(mon->data))) return;
/* Send the monster along the path */
mc.x = mon->mx;
impossible("Can't polystone %s!", a_monnam(mtmp));
}
+/* might place monst on far side of a wall or boulder */
void
mnexto(mtmp) /* Make monster mtmp next to you (if possible) */
struct monst *mtmp;
return;
}
+/* like mnexto() but requires destination to be directly accessible */
+void
+maybe_mnexto(mtmp)
+struct monst *mtmp;
+{
+ coord mm;
+ struct permonst *ptr = mtmp->data;
+ boolean diagok = !NODIAG(ptr - mons);
+ int tryct = 20;
+
+ do {
+ if (!enexto(&mm, u.ux, u.uy, ptr)) return;
+ if (couldsee(mm.x, mm.y) &&
+ /* don't move grid bugs diagonally */
+ (diagok || mm.x == mtmp->mx || mm.y == mtmp->my)) {
+ rloc_to(mtmp, mm.x, mm.y);
+ return;
+ }
+ } while (--tryct > 0);
+}
+
/* mnearto()
* Put monster near (or at) location if possible.
* Returns: