fix #H4035 - msg when wand zapped by mon explodes

Message given when you see a cursed wand explode while being zapped
by a monster got suppressed if hero was deaf, even though there's no
reference to sound in that message.  Change it to ignore deafness;
also, change the alternate message when not visible (which uses
You_hear so already gets suppressed when deaf without caller worrying
about it) use "nearby" or "in the distance" with same criteria as
hearing a wand being zapped, instead of always "in the distance".

I also changed the near/far criteria:  threshold to be considered
"far" shrinks from 9 steps to 5 when there's no direct line of sight.
This commit is contained in:
PatR
2015-12-10 18:11:12 -08:00
parent 1b0fb561d4
commit ef5b37a03a
+19 -12
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 muse.c $NHDT-Date: 1447987786 2015/11/20 02:49:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.68 $ */ /* NetHack 3.6 muse.c $NHDT-Date: 1449799863 2015/12/11 02:11:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.69 $ */
/* Copyright (C) 1990 by Ken Arromdee */ /* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -138,12 +138,19 @@ struct obj *obj;
&& !rn2(WAND_BACKFIRE_CHANCE)) { && !rn2(WAND_BACKFIRE_CHANCE)) {
int dam = d(obj->spe + 2, 6); int dam = d(obj->spe + 2, 6);
if (!Deaf) { /* 3.6.1: no Deaf filter; 'if' message doesn't warrant it, 'else'
if (vis) message doesn't need it since Your_hear() has one of its own */
pline("%s zaps %s, which suddenly explodes!", Monnam(mon), if (vis) {
an(xname(obj))); pline("%s zaps %s, which suddenly explodes!", Monnam(mon),
else an(xname(obj)));
You_hear("a zap and an explosion in the distance."); } else {
/* same near/far threshold as mzapmsg() */
int range = couldsee(mon->mx, mon->my) /* 9 or 5 */
? (BOLT_LIM + 1) : (BOLT_LIM - 3);
You_hear("a zap and an explosion %s.",
(distu(mon->mx, mon->my) <= range * range)
? "nearby" : "in the distance");
} }
m_useup(mon, obj); m_useup(mon, obj);
if (mon->mhp <= dam) { if (mon->mhp <= dam) {
@@ -164,11 +171,11 @@ struct obj *otmp;
boolean self; boolean self;
{ {
if (!canseemon(mtmp)) { if (!canseemon(mtmp)) {
if (!Deaf) int range = couldsee(mtmp->mx, mtmp->my) /* 9 or 5 */
You_hear("a %s zap.", (distu(mtmp->mx, mtmp->my) ? (BOLT_LIM + 1) : (BOLT_LIM - 3);
<= (BOLT_LIM + 1) * (BOLT_LIM + 1))
? "nearby" You_hear("a %s zap.", (distu(mtmp->mx, mtmp->my) <= range * range)
: "distant"); ? "nearby" : "distant");
} else if (self) { } else if (self) {
pline("%s zaps %sself with %s!", Monnam(mtmp), mhim(mtmp), pline("%s zaps %sself with %s!", Monnam(mtmp), mhim(mtmp),
doname(otmp)); doname(otmp));