fix #1812 - ranged targetting of hidden hero (trunk only)
From a bug report, a hero who had eaten a mimic corpse and was stuck mimicking gold was hit by an approaching dragon's breath attack. Make monsters usually fail to notice that you're lined up for their ranged attack when/if you're hidden from them.
This commit is contained in:
@@ -306,6 +306,8 @@ attempting to move direction 'u' as a grid bug performed #untrap command;
|
||||
the other diagonals reported "unknown command" instead of "you can't"
|
||||
mimic posing as statue or corpse now picks and maintains particular monst type
|
||||
when levitating, don't show '>' as a likely direction for digging
|
||||
poly'd or mimicking hero who was hidden from monsters would still be treated
|
||||
as a normal target for their ranged attacks
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)mthrowu.c 3.5 2007/12/17 */
|
||||
/* SCCS Id: @(#)mthrowu.c 3.5 2009/02/17 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -753,9 +753,16 @@ boolean
|
||||
lined_up(mtmp) /* is mtmp in position to use ranged attack? */
|
||||
register struct monst *mtmp;
|
||||
{
|
||||
boolean ignore_boulders = (throws_rocks(mtmp->data) ||
|
||||
m_carrying(mtmp, WAN_STRIKING));
|
||||
boolean ignore_boulders;
|
||||
|
||||
/* hero concealment usually trumps monst awareness of being lined up */
|
||||
if (Upolyd && rn2(25) &&
|
||||
(u.uundetected || (youmonst.m_ap_type != M_AP_NOTHING &&
|
||||
youmonst.m_ap_type != M_AP_MONSTER)))
|
||||
return FALSE;
|
||||
|
||||
ignore_boulders = (throws_rocks(mtmp->data) ||
|
||||
m_carrying(mtmp, WAN_STRIKING));
|
||||
return linedup(mtmp->mux, mtmp->muy, mtmp->mx, mtmp->my,
|
||||
ignore_boulders ? 1 : 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user