fix U640 - Medusa bug

Described in the newsgroup a while back and recently reported:  if
you had reflection and were invisible and had esp and were blind, Medusa
would turn herself to stone by looking at you.  When you're invisible,
she shouldn't be able to see your source of reflection so shouldn't be
affected by the gaze; that's how things work when you aren't blind but
the relevant code was being skipped when you are.

     Now esp is irrelevant for this and she'll see her reflected gaze
only when she can see you, regardless of whether you see it happen.
This commit is contained in:
nethack.rankin
2003-09-11 02:45:55 +00:00
parent 3415b354ab
commit 951ca18e61
2 changed files with 27 additions and 25 deletions
+2
View File
@@ -13,6 +13,8 @@ fix inconsistency where you can't kick something out of a pit, but you can
the bottom of pit the bottom of pit
room cleanup, eg on Bustling Town, could incorrectly truncate room bounds room cleanup, eg on Bustling Town, could incorrectly truncate room bounds
for rooms that become L shared due to partial overlap with the MAP for rooms that become L shared due to partial overlap with the MAP
approaching Medusa while having reflection+invisibility+esp would cause her
to turn herself to stone if you happened to be at the time
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+25 -25
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)mhitu.c 3.4 2003/01/02 */ /* SCCS Id: @(#)mhitu.c 3.4 2003/09/09 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1861,33 +1861,33 @@ gazemu(mtmp, mattk) /* monster gazes at you */
switch(mattk->adtyp) { switch(mattk->adtyp) {
case AD_STON: case AD_STON:
if (mtmp->mcan || !mtmp->mcansee) { if (mtmp->mcan || !mtmp->mcansee) {
if (mtmp->data == &mons[PM_MEDUSA] && canseemon(mtmp)) { if (!canseemon(mtmp)) break; /* silently */
if (mtmp->mcan) { pline("%s %s.", Monnam(mtmp),
pline("%s doesn't look all that ugly.", (mtmp->data == &mons[PM_MEDUSA] && mtmp->mcan) ?
Monnam(mtmp)); "doesn't look all that ugly" :
break; "gazes ineffectually");
}
}
if (canseemon(mtmp))
pline("%s gazes ineffectually.", Monnam(mtmp));
break; break;
} }
if (Reflecting && canspotmon(mtmp) && if (Reflecting && couldsee(mtmp->mx, mtmp->my) &&
mtmp->data == &mons[PM_MEDUSA]) { mtmp->data == &mons[PM_MEDUSA]) {
if(!Blind) { /* hero has line of sight to Medusa and she's not blind */
(void) ureflects("%s gaze is reflected by your %s.", boolean useeit = canseemon(mtmp);
s_suffix(Monnam(mtmp)));
if (mon_reflects(mtmp, if (useeit)
"The gaze is reflected away by %s %s!")) (void) ureflects("%s gaze is reflected by your %s.",
break; s_suffix(Monnam(mtmp)));
if (!m_canseeu(mtmp)) { /* probably you're invisible */ if (mon_reflects(mtmp, !useeit ? (char *)0 :
pline("%s doesn't seem to notice that %s gaze was reflected.", "The gaze is reflected away by %s %s!"))
Monnam(mtmp), break;
mhis(mtmp)); if (!m_canseeu(mtmp)) { /* probably you're invisible */
break; if (useeit)
} pline(
pline("%s is turned to stone!", Monnam(mtmp)); "%s doesn't seem to notice that %s gaze was reflected.",
Monnam(mtmp), mhis(mtmp));
break;
} }
if (useeit)
pline("%s is turned to stone!", Monnam(mtmp));
stoned = TRUE; stoned = TRUE;
killed(mtmp); killed(mtmp);