#define GP_ALLOW_XY 0x080000L /* [actually used by enexto() to decide whether
* to make an extra call to goodpos()] */
#define GP_ALLOW_U 0x100000L /* don't reject hero's location */
+#define MM_NOEXCLAM 0x200000L /* more sedate "<mon> appears." mesg for ^G */
/* flags for make_corpse() and mkcorpstat(); 0..7 are recorded in obj->spe */
#define CORPSTAT_NONE 0x00
if (!g.in_mklev) {
newsym(mtmp->mx, mtmp->my); /* make sure the mon shows up */
- if (!(mmflags & MM_NOMSG)
- && ((canseemon(mtmp) && (M_AP_TYPE(mtmp) == M_AP_NOTHING
+ if (!(mmflags & MM_NOMSG)) {
+ char mbuf[BUFSZ], *what = 0;
+ /* MM_NOEXCLAM is used for #wizgenesis (^G) */
+ boolean exclaim = !(mmflags & MM_NOEXCLAM);
+
+ if ((canseemon(mtmp) && (M_AP_TYPE(mtmp) == M_AP_NOTHING
|| M_AP_TYPE(mtmp) == M_AP_MONSTER))
- || sensemon(mtmp)))
- pline("%s suddenly appears%s!", Amonnam(mtmp),
- distu(x, y) <= 2 ? " next to you"
- : (distu(x, y) <= (BOLT_LIM * BOLT_LIM)) ? " close by" : "");
+ || sensemon(mtmp)) {
+ what = Amonnam(mtmp);
+ if (M_AP_TYPE(mtmp) == M_AP_MONSTER)
+ exclaim = TRUE;
+ } else if (canseemon(mtmp)) {
+ /* mimic masquerading as furniture or object and not sensed */
+ mhidden_description(mtmp, FALSE, mbuf);
+ what = upstart(strsubst(mbuf, ", mimicking ", ""));
+ }
+ if (what)
+ Norep("%s%s appears%s%c", what,
+ exclaim ? " suddenly" : "",
+ distu(x, y) <= 2 ? " next to you"
+ : (distu(x, y) <= (BOLT_LIM * BOLT_LIM)) ? " close by"
+ : "",
+ exclaim ? '!' : '.');
+ }
/* TODO: unify with teleport appears msg */
}
/* describe a hidden monster; used for look_at during extended monster
detection and for probing; also when looking at self */
void
-mhidden_description(struct monst *mon,
- boolean altmon, /* for probing: if mimicking a monster,
- say so */
- char *outbuf)
+mhidden_description(
+ struct monst *mon,
+ boolean altmon, /* for probing: if mimicking a monster, say so */
+ char *outbuf)
{
struct obj *otmp;
boolean fakeobj, isyou = (mon == &g.youmonst);
if (!(mons[mndx].geno & G_UNIQ)
&& !(g.mvitals[mndx].mvflags & (G_GENOD | G_EXTINCT)))
for (i = rn1(3, 4); i > 0; i--) {
- if (!makemon(ptr, u.ux, u.uy, NO_MINVENT|MM_NOMSG))
+ if (!makemon(ptr, u.ux, u.uy, NO_MINVENT | MM_NOMSG))
break; /* couldn't make one */
++cnt;
if (g.mvitals[mndx].mvflags & G_EXTINCT)
if (d->genderconf == -1) {
/* no confict exists between explicit gender term and
the specified monster name */
- if (d->fem != -1
- && (!whichpm || (!is_male(whichpm) && !is_female(whichpm))))
+ if (d->fem != -1 && (!whichpm || (!is_male(whichpm)
+ && !is_female(whichpm))))
mmflags |= (d->fem == FEMALE) ? MM_FEMALE
: (d->fem == MALE) ? MM_MALE : 0;
+ /* no surprise; "<mon> appears." rather than "<mon> appears!" */
+ mmflags |= MM_NOEXCLAM;
} else {
/* conundrum alert: an explicit gender term conflicts with an
explicit gender-tied naming term (i.e. male cavewoman) */
commented out here */
/* d->fem = d->genderconf; */
- /* option chosen: let the explicit gender term (male or female)
- override the gender-tied naming term, so leave d->fem as-is */
+ /* option chosen: let the explicit gender term (male or female)
+ override the gender-tied naming term, so leave d->fem as-is */
- mmflags |= (d->fem == FEMALE) ? MM_FEMALE
- : (d->fem == MALE) ? MM_MALE : 0;
+ mmflags |= (d->fem == FEMALE) ? MM_FEMALE
+ : (d->fem == MALE) ? MM_MALE : 0;
/* another option would be to consider it a faulty specification
and reject the request completely and produce a random monster