muse wand/horn feedback

One of the claims in #H8849 was that a monster which zapped a wand
that the hero had fully identified made hero's knowledge of it revert
to "a wand".  That doesn't happen; it had to have been a different
wand which hadn't been seen up close yet.  But the hero should lose
track of known number of charges if a wand is zapped outside his/her
view.  When implementing that I noticed that a monster playing a fire
horn to burn away slime was using the routine that gives wand
feedback.  Add a separate, similar routine for magical horn feedback.

Half this diff is due to moving a naming support routine from mhitm.c
to do_name.c.
This commit is contained in:
PatR
2019-06-10 03:16:52 -07:00
parent 319dcf4746
commit 5d59b288c9
5 changed files with 87 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitm.c $NHDT-Date: 1555720096 2019/04/20 00:28:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.113 $ */
/* NetHack 3.6 mhitm.c $NHDT-Date: 1560161806 2019/06/10 10:16:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.116 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -15,7 +15,6 @@ static NEARDATA struct obj *otmp;
static const char brief_feeling[] =
"have a %s feeling for a moment, then it passes.";
STATIC_DCL char *FDECL(mon_nam_too, (char *, struct monst *, struct monst *));
STATIC_DCL int FDECL(hitmm, (struct monst *, struct monst *,
struct attack *));
STATIC_DCL int FDECL(gazemm, (struct monst *, struct monst *,
@@ -40,30 +39,6 @@ STATIC_DCL int FDECL(passivemm, (struct monst *, struct monst *,
*/
static int dieroll;
/* returns mon_nam(mon) relative to other_mon; normal name unless they're
the same, in which case the reference is to {him|her|it} self */
STATIC_OVL char *
mon_nam_too(outbuf, mon, other_mon)
char *outbuf;
struct monst *mon, *other_mon;
{
if (mon != other_mon)
Strcpy(outbuf, mon_nam(mon));
else
switch (pronoun_gender(mon, FALSE)) {
case 0:
Strcpy(outbuf, "himself");
break;
case 1:
Strcpy(outbuf, "herself");
break;
default:
Strcpy(outbuf, "itself");
break;
}
return outbuf;
}
STATIC_OVL void
noises(magr, mattk)
register struct monst *magr;
@@ -87,7 +62,7 @@ register struct monst *magr, *mdef;
struct attack *mattk;
{
const char *fmt;
char buf[BUFSZ], mdef_name[BUFSZ];
char buf[BUFSZ];
if (vis) {
if (!canspotmon(magr))
@@ -102,7 +77,7 @@ struct attack *mattk;
? "%s pretends to be friendly to"
: "%s misses";
Sprintf(buf, fmt, Monnam(magr));
pline("%s %s.", buf, mon_nam_too(mdef_name, mdef, magr));
pline("%s %s.", buf, mon_nam_too(mdef, magr));
} else
noises(magr, mattk);
}
@@ -539,7 +514,7 @@ struct attack *mattk;
{
if (vis) {
int compat;
char buf[BUFSZ], mdef_name[BUFSZ];
char buf[BUFSZ];
if (!canspotmon(magr))
map_invisible(magr->mx, magr->my);
@@ -583,7 +558,7 @@ struct attack *mattk;
default:
Sprintf(buf, "%s hits", magr_name);
}
pline("%s %s.", buf, mon_nam_too(mdef_name, mdef, magr));
pline("%s %s.", buf, mon_nam_too(mdef, magr));
}
} else
noises(magr, mattk);