fix #H1816 - polearm/grapnel/whip fixes (trunk only)

From a bug report, applying a polearm to make a
short-range ranged attack didn't scuff any engraving you were standing on,
unlike ordinary melee and throwing/shooting attacks.  Grappling hooks had
the same omission.  Fixing it led to several other minor bugs.  Attempting
to target an unseen monster's spot with polearm or grapnel would yield some
permutation of "wait, there's something there" but draw the 'I' glyph at
the wrong spot.  It used <u.ux+u.dx,u.uy+u.dy> instead of the actual target,
so put the 'I' one step in front of your most recent move (or throw or zap
or whatever last set u.dx and u.dy).  Giving ESC when prompted for target
spot failed to use up a turn even when the polearm or grappling hook had
just been auto-wielded for use.  Neither use_pole() nor use_grapple() set
`notonhead' for hmon() (called via thitmonst() in their cases; this was
academic since plain physical damage attacks don't actually care about it).
[The bad 'I' placement was a post-3.4.3 bug.]

     Applying a bullwhip to attack an adjacent monster didn't have any of
those issues but did have the possibility of targetting off the edge of
the map when standing at that edge while confused or stunned.

     Applying a polearm to target an 'I' would yield "nothing happens" if
the unseen monster wasn't there anymore, and it didn't bother to remove
that 'I' from the map.  After changing it to do so, the phrasing no longer
made any sense.  This led to a slightly bigger change than I intended:
since statues are now shown as gray monsters (does that work for tiles?)
instead of as chunks of stone, they are likely to be intentional targets
sometimes, so polearm attacks now handle them differently from other
non-monster locations.  [I hope that other attack forms don't need
similar handling.  Melee certainly doesn't, since walking onto the spot
is enough to distinguish statues from monsters.  Having the missile pass
right through a statue's location probably suffices for ranged attacks.]
This commit is contained in:
nethack.rankin
2009-02-23 01:20:32 +00:00
parent a2257ebb1a
commit e11c136bc9
3 changed files with 91 additions and 28 deletions

View File

@@ -310,6 +310,10 @@ poly'd or mimicking hero who was hidden from monsters would still be treated
as a normal target for their ranged attacks
hero would remain stuck to an adjacent monster after rehumanizing if he had
been attacked while hiding via #monster when poly'd into a small mimic
attacking via applied polearm never scuffed engraving underneath hero
auto-wielding a polearm took no time if ESC was used to cancel target choice
applying a bullwhip while at very edge of map could target beyond edge when
hero was stunned or confused, potentially leading to a panic or crash
Platform- and/or Interface-Specific Fixes