monster ranged attacks (trunk only)
Newsgroup posts mention "boulder forts" from time to time, where the player surrounds the hero with boulders in order to prevent the majority of monsters from being able to attack. Since the hero can shoot or throw or zap over/around/through boulders, monsters ought to be able to do so too. This makes the test for whether a monster is lined up properly for its ranged attacks try harder when the original line-of-sight check fails. If there aren't any terrain obstacles found, it allows a chance to attack based on the number of locations in the path that contain any boulders. Giants and any monster carrying a boulder-destroying wand of striking get to ignore boulders, overriding the random chance.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)priest.c 3.5 2006/05/26 */
|
||||
/* SCCS Id: @(#)priest.c 3.5 2006/12/27 */
|
||||
/* Copyright (c) Izchak Miller, Steve Linhart, 1989. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -710,9 +710,8 @@ struct monst *priest;
|
||||
ay = y = EPRI(priest)->shrpos.y;
|
||||
troom = &rooms[roomno - ROOMOFFSET];
|
||||
|
||||
if((u.ux == x && u.uy == y) || !linedup(u.ux, u.uy, x, y)) {
|
||||
if ((u.ux == x && u.uy == y) || !linedup(u.ux, u.uy, x, y, 1)) {
|
||||
if(IS_DOOR(levl[u.ux][u.uy].typ)) {
|
||||
|
||||
if(u.ux == troom->lx - 1) {
|
||||
x = troom->hx;
|
||||
y = u.uy;
|
||||
@@ -734,7 +733,7 @@ struct monst *priest;
|
||||
default: x = troom->hx; y = u.uy; break;
|
||||
}
|
||||
}
|
||||
if(!linedup(u.ux, u.uy, x, y)) return;
|
||||
if (!linedup(u.ux, u.uy, x, y, 1)) return;
|
||||
}
|
||||
|
||||
switch(rn2(3)) {
|
||||
|
||||
Reference in New Issue
Block a user