avoid telling hero they missed a monster they aren't aware of

Resolves #1441
This commit is contained in:
nhmall
2025-09-04 22:13:07 -04:00
parent e4f0d1a3e2
commit fe357a6f04
4 changed files with 17 additions and 7 deletions
+2 -1
View File
@@ -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 passive_obj(struct monst *, struct obj *, struct attack *) NONNULLARG1;
extern void that_is_a_mimic(struct monst *, unsigned) NONNULLARG1; extern void that_is_a_mimic(struct monst *, unsigned) NONNULLARG1;
extern void stumble_onto_mimic(struct monst *) 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 int flash_hits_mon(struct monst *, struct obj *) NONNULLARG12;
extern void light_hits_gremlin(struct monst *, int) NONNULLARG1; 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 int burn_floor_objects(coordxy, coordxy, boolean, boolean);
extern void ubuzz(int, int); extern void ubuzz(int, int);
extern void buzz(int, int, coordxy, coordxy, 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 melt_ice(coordxy, coordxy, const char *) NO_NNARGS;
extern void start_melt_ice_timeout(coordxy, coordxy, long); extern void start_melt_ice_timeout(coordxy, coordxy, long);
extern void melt_ice_away(union any *, long) NONNULLARG1; extern void melt_ice_away(union any *, long) NONNULLARG1;
+1 -1
View File
@@ -1093,7 +1093,7 @@ breamm(struct monst *mtmp, struct attack *mattk, struct monst *mtarg)
Monnam(mtmp), breathwep_name(typ)); Monnam(mtmp), breathwep_name(typ));
gb.buzzer = mtmp; gb.buzzer = mtmp;
dobuzz(BZ_M_BREATH(BZ_OFS_AD(typ)), (int) mattk->damn, 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; gb.buzzer = 0;
nomul(0); nomul(0);
/* breath runs out sometimes. Also, give monster some /* breath runs out sometimes. Also, give monster some
+8
View File
@@ -6259,6 +6259,14 @@ stumble_onto_mimic(struct monst *mtmp)
map_invisible(mtmp->mx, mtmp->my); 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 staticfn void
nohandglow(struct monst *mon) nohandglow(struct monst *mon)
{ {
+6 -5
View File
@@ -4692,13 +4692,13 @@ disintegrate_mon(
void void
ubuzz(int type, int nd) 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 void
buzz(int type, int nd, coordxy sx, coordxy sy, int dx, int dy) 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') */ int nd, /* damage strength ('number of dice') */
coordxy sx, coordxy sy, /* starting point */ coordxy sx, coordxy sy, /* starting point */
int dx, int dy, /* direction delta */ 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; int range, fltyp = zaptype(type), damgtype = fltyp % 10;
coordxy lsx, lsy; coordxy lsx, lsy;
@@ -4865,7 +4865,7 @@ dobuzz(
} else { } else {
if (!otmp) { if (!otmp) {
/* normal non-fatal hit */ /* normal non-fatal hit */
if (say || canseemon(mon)) if (sayhit || canseemon(mon))
hit(flash_str(fltyp, FALSE), mon, exclam(tmp)); hit(flash_str(fltyp, FALSE), mon, exclam(tmp));
} else { } else {
/* some armor was destroyed; no damage done */ /* some armor was destroyed; no damage done */
@@ -4883,7 +4883,8 @@ dobuzz(
} }
range -= 2; range -= 2;
} else { } else {
if (say || canseemon(mon)) if (saymiss
|| (canseemon(mon) && !mimic_disguised_as_non_mon(mon)))
miss(flash_str(fltyp, FALSE), mon); miss(flash_str(fltyp, FALSE), mon);
} }
} else if (u_at(sx, sy) && range >= 0) { } else if (u_at(sx, sy) && range >= 0) {