swallowed hero onto magic trap and was made tame by its effect; taming
no longer replaces monster
reduced message verbosity when re-entering a temple
+reduced message verbosity when monster with multiple attacks missed wildly
zapping a never seen wand while blinded won't make the wand a discovery
zapping an unID'd wand of teleportation at self will discover it (usually)
zapping unlocking magic at self while punished will remove attached chain
-/* SCCS Id: @(#)mhitu.c 3.5 2005/12/05 */
+/* SCCS Id: @(#)mhitu.c 3.5 2006/02/01 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* Might be attacking your image around the corner, or
* invisible, or you might be blind....
*/
-
+ boolean giveup = FALSE;
+ /* Are further attack attempts useless? */
+
if(!ranged) nomul(0);
if(mtmp->mhp <= 0 || (Underwater && !is_swimmer(mtmp->data)))
return(0);
sum[i] = hitmu(mtmp, mattk);
} else
missmu(mtmp, (tmp == j), mattk);
- } else
+ } else {
wildmiss(mtmp, mattk);
+ /* skip any remaining attacks unless this
+ monster might attempt undirected spell */
+ giveup = !attacktype(mtmp->data, AT_MAGC);
+ }
}
break;
/* KMH -- Don't accumulate to-hit bonuses */
if (otmp)
tmp -= hittmp;
- } else
+ } else {
wildmiss(mtmp, mattk);
+ /* skip any remaining attacks unless this
+ monster might attempt undirected spell */
+ giveup = !attacktype(mtmp->data, AT_MAGC);
+ }
}
break;
case AT_MAGC:
if (range2)
sum[i] = buzzmu(mtmp, mattk);
- else {
- if (foundyou)
- sum[i] = castmu(mtmp, mattk, TRUE, TRUE);
- else
- sum[i] = castmu(mtmp, mattk, TRUE, FALSE);
- }
+ else
+ sum[i] = castmu(mtmp, mattk, TRUE, foundyou);
break;
default: /* no attack */
if(sum[i] == 2) return 1; /* attacker dead */
if(sum[i] == 3) break; /* attacker teleported, no more attacks */
/* sum[i] == 0: unsuccessful attack */
+ if (giveup) break; /* skip any remaining attacks */
}
return(0);
}