fix pull request #367 - mind flayer psychic blast

hitting a hidden monster didn't reveal that monster.  It stayed
hidden despite the feedback describing it as if it could be seen.

The pull request's two line fix handled a monster's blast hitting
another monster but left two related issues as-is:  monster's blast
hitting hidden poly'd hero left hero unrevealed and poly'd hero's
blast left hidden monster unrevealed.  Same code, different bug:
poly'd hero's blast affected mindless monsters.

This unhides an affected target before the message about it being
hit rather than after.  That would look better if preceded by a
message describing the object (mimic or hides-under) or furniture
(mimic) or empty spot (ceiling hider) as being or concealing a
monster but I didn't put in sufficient effort to accomplish that.

Fixes #367
Fixes #362
This commit is contained in:
PatR
2020-07-14 04:55:53 -07:00
parent 12498ffa44
commit a37975b625
4 changed files with 46 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1594630713 2020/07/13 08:58:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.339 $ */
/* NetHack 3.6 mon.c $NHDT-Date: 1594727746 2020/07/14 11:55:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.340 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3235,8 +3235,11 @@ register struct monst *mtmp;
boolean via_attack;
{
mtmp->msleeping = 0;
if (M_AP_TYPE(mtmp)) {
seemimic(mtmp);
if (M_AP_TYPE(mtmp) != M_AP_NOTHING) {
/* mimics come out of hiding, but disguised Wizard doesn't
have to lose his disguise */
if (M_AP_TYPE(mtmp) != M_AP_MONSTER)
seemimic(mtmp);
} else if (g.context.forcefight && !g.context.mon_moving
&& mtmp->mundetected) {
mtmp->mundetected = 0;