mind flayer vs headless target

When a mind flayer scores a hit against a headless target (or worm's
tail), there's a message that says that the attack hits and that the
target is unharmed.  Since an ordinary mind flayer has 3 such attacks
per turn and a master mind flayer has 5, it can become excessively
verbose.

This doesn't eliminate the attacks until a hit fails to do harm, so
ordinary misses still get repeated if they happen first.  Once a
successful hit doesn't do anything, any remaining AT_TENT+AD_DRIN
attacks are silently skipped.  That way feedback isn't as verbose
and mind flayers don't seem to be quite so stupid about using their
tentacles when those won't work.  Unfortunately they need to relearn
the lesson every turn they attack.
This commit is contained in:
PatR
2020-07-14 05:43:51 -07:00
parent a37975b625
commit ee7fbc4a61
4 changed files with 29 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 decl.c $NHDT-Date: 1593953345 2020/07/05 12:49:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.214 $ */
/* NetHack 3.6 decl.c $NHDT-Date: 1594730611 2020/07/14 12:43:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.215 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2009. */
/* NetHack may be freely redistributed. See license for details. */
@@ -461,9 +461,10 @@ const struct instance_globals g_init = {
/* makemon.c */
/* mhitm.c */
UNDEFINED_VALUE, /* vis */
UNDEFINED_VALUE, /* far_noise */
UNDEFINED_VALUE, /* noisetime */
0L, /* noisetime */
FALSE, /* far_noise */
FALSE, /* vis */
FALSE, /* skipdrin */
/* mhitu.c */
UNDEFINED_VALUE, /* mhitu_dieroll */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitm.c $NHDT-Date: 1593614973 2020/07/01 14:49:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.138 $ */
/* NetHack 3.6 mhitm.c $NHDT-Date: 1594730614 2020/07/14 12:43:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.139 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -345,12 +345,24 @@ register struct monst *magr, *mdef;
*/
magr->mlstmv = g.monstermoves;
/* controls whether a mind flayer uses all of its tentacle-for-DRIN
attacks; when fighting a headless monster, stop after the first
one because repeating the same failing hit (or even an ordinary
tentacle miss) is very verbose and makes the flayer look stupid */
g.skipdrin = FALSE;
/* Now perform all attacks for the monster. */
for (i = 0; i < NATTK; i++) {
res[i] = MM_MISS;
mattk = getmattk(magr, mdef, i, res, &alt_attk);
mwep = (struct obj *) 0;
attk = 1;
/* reduce verbosity for mind flayer attacking creature without a
head (or worm's tail); this is similar to monster with multiple
attacks after a wildmiss against displaced or invisible hero */
if (g.skipdrin && mattk->aatyp == AT_TENT && mattk->adtyp == AD_DRIN)
continue;
switch (mattk->aatyp) {
case AT_WEAP: /* "hand to hand" attacks */
if (distmin(magr->mx, magr->my, mdef->mx, mdef->my) > 1) {
@@ -1404,6 +1416,9 @@ int dieroll;
pline("%s doesn't seem harmed.", Monnam(mdef));
/* Not clear what to do for green slimes */
tmp = 0;
/* don't bother with additional DRIN attacks since they wouldn't
be able to hit target on head either */
g.skipdrin = TRUE; /* affects mattackm()'s attack loop */
break;
}
if ((mdef->misc_worn_check & W_ARMH) && rn2(8)) {