using #monster to breath at self (trunk only)

When testing the monster-breath-at-self patch I noticed that trying
to cure green slime by having hero breathe at self didn't work.  The code
was calling buzz() with arguments that produced an attack directed against
the hero's location, but there was a chance for it to miss outright and
when it didn't, reflection would block it.  This makes breathing at
yourself with `#monster' comparable to zapping a wand or casting a spell
at yourself:  it always hits.
This commit is contained in:
nethack.rankin
2007-05-05 04:32:19 +00:00
parent 696eaefbb5
commit 6d33acd2af
4 changed files with 21 additions and 6 deletions

View File

@@ -848,6 +848,8 @@ dobreathe()
mattk = attacktype_fordmg(youmonst.data, AT_BREA, AD_ANY);
if (!mattk)
impossible("bad breath attack?"); /* mouthwash needed... */
else if (!u.dx && !u.dy && !u.dz)
ubreatheu(mattk);
else
buzz((int) (20 + mattk->adtyp-1), (int)mattk->damn,
u.ux, u.uy, u.dx, u.dy);