multiple iron bars fixes

Can't push boulders through iron bars; traps can't roll such through either;
	likewise for objects thrown by monsters.
Thrown objects susceptible to breaking might do so when they hit iron bars.
Assorted monsters can pass through iron bars; ditto for polymorphed character.
Attempting to dig iron bars will wake nearby monsters instead of yielding
	"you swing your pick-axe through thin air".
Autodig won't accept iron bars as candidate location.
This commit is contained in:
nethack.rankin
2002-04-07 10:43:59 +00:00
parent b940ca0ee7
commit 812b53799d
12 changed files with 158 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)trap.c 3.4 20021/03/29 */
/* SCCS Id: @(#)trap.c 3.4 2002/04/06 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1330,6 +1330,16 @@ int style;
levl[bhitpos.x][bhitpos.y].doormask = D_BROKEN;
if (dist) unblock_point(bhitpos.x, bhitpos.y);
}
/* if about to hit iron bars, do so now */
if (dist > 0 && isok(bhitpos.x + dx,bhitpos.y + dy) &&
levl[bhitpos.x + dx][bhitpos.y + dy].typ == IRONBARS) {
x2 = bhitpos.x, y2 = bhitpos.y; /* object stops here */
if (hits_bars(&singleobj, x2, y2, !rn2(20), 0)) {
if (!singleobj) used_up = TRUE;
break;
}
}
}
tmp_at(DISP_END, 0);
if (!used_up) {
@@ -1340,6 +1350,7 @@ int style;
} else
return 2;
}
#endif /* OVL3 */
#ifdef OVLB