diff --git a/include/extern.h b/include/extern.h index c8180ec44..3fffc7ab8 100644 --- a/include/extern.h +++ b/include/extern.h @@ -3409,6 +3409,7 @@ extern int passive(struct monst *, struct obj *, boolean, boolean, uchar, extern void passive_obj(struct monst *, struct obj *, struct attack *) NONNULLARG1; extern void that_is_a_mimic(struct monst *, unsigned) NONNULLARG1; extern void stumble_onto_mimic(struct monst *) NONNULLARG1; +extern boolean mimic_disguised_as_non_mon(struct monst *) NONNULLARG1; extern int flash_hits_mon(struct monst *, struct obj *) NONNULLARG12; extern void light_hits_gremlin(struct monst *, int) NONNULLARG1; @@ -3938,7 +3939,7 @@ extern int zhitm(struct monst *, int, int, struct obj **) NONNULLPTRS; extern int burn_floor_objects(coordxy, coordxy, boolean, boolean); extern void ubuzz(int, int); extern void buzz(int, int, coordxy, coordxy, int, int); -extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean); +extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean, boolean); extern void melt_ice(coordxy, coordxy, const char *) NO_NNARGS; extern void start_melt_ice_timeout(coordxy, coordxy, long); extern void melt_ice_away(union any *, long) NONNULLARG1; diff --git a/src/mthrowu.c b/src/mthrowu.c index a52a678f2..7b2a23ca7 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1093,7 +1093,7 @@ breamm(struct monst *mtmp, struct attack *mattk, struct monst *mtarg) Monnam(mtmp), breathwep_name(typ)); gb.buzzer = mtmp; dobuzz(BZ_M_BREATH(BZ_OFS_AD(typ)), (int) mattk->damn, - mtmp->mx, mtmp->my, sgn(gt.tbx), sgn(gt.tby), utarget); + mtmp->mx, mtmp->my, sgn(gt.tbx), sgn(gt.tby), utarget, utarget); gb.buzzer = 0; nomul(0); /* breath runs out sometimes. Also, give monster some diff --git a/src/uhitm.c b/src/uhitm.c index 5f6e87d99..3e1b3a7d4 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -6259,6 +6259,14 @@ stumble_onto_mimic(struct monst *mtmp) map_invisible(mtmp->mx, mtmp->my); } +boolean +mimic_disguised_as_non_mon(struct monst *mtmp) +{ + return (!sensemon(mtmp) + && M_AP_TYPE(mtmp) + && M_AP_TYPE(mtmp) != M_AP_MONSTER); +} + staticfn void nohandglow(struct monst *mon) { diff --git a/src/zap.c b/src/zap.c index a1a5c3380..73666008f 100644 --- a/src/zap.c +++ b/src/zap.c @@ -4692,13 +4692,13 @@ disintegrate_mon( void ubuzz(int type, int nd) { - dobuzz(type, nd, u.ux, u.uy, u.dx, u.dy, TRUE); + dobuzz(type, nd, u.ux, u.uy, u.dx, u.dy, TRUE, FALSE); } void buzz(int type, int nd, coordxy sx, coordxy sy, int dx, int dy) { - dobuzz(type, nd, sx, sy, dx, dy, TRUE); + dobuzz(type, nd, sx, sy, dx, dy, TRUE, FALSE); } /* @@ -4716,7 +4716,7 @@ dobuzz( int nd, /* damage strength ('number of dice') */ coordxy sx, coordxy sy, /* starting point */ int dx, int dy, /* direction delta */ - boolean say) /* announce out of sight hit/miss events if true */ + boolean sayhit, boolean saymiss) /* announce out of sight hit/miss events if true */ { int range, fltyp = zaptype(type), damgtype = fltyp % 10; coordxy lsx, lsy; @@ -4865,7 +4865,7 @@ dobuzz( } else { if (!otmp) { /* normal non-fatal hit */ - if (say || canseemon(mon)) + if (sayhit || canseemon(mon)) hit(flash_str(fltyp, FALSE), mon, exclam(tmp)); } else { /* some armor was destroyed; no damage done */ @@ -4883,7 +4883,8 @@ dobuzz( } range -= 2; } else { - if (say || canseemon(mon)) + if (saymiss + || (canseemon(mon) && !mimic_disguised_as_non_mon(mon))) miss(flash_str(fltyp, FALSE), mon); } } else if (u_at(sx, sy) && range >= 0) {