-/* NetHack 3.7 flag.h $NHDT-Date: 1580434522 2020/01/31 01:35:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.175 $ */
+/* NetHack 3.7 flag.h $NHDT-Date: 1581637124 2020/02/13 23:38:44 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.176 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
boolean defer_plname; /* X11 hack: askname() might not set g.plname */
boolean herecmd_menu; /* use menu when mouseclick on yourself */
boolean invis_goldsym; /* gold symbol is ' '? */
+ boolean sad_feeling; /* unseen pet is dying */
int at_midnight; /* only valid during end of game disclosure */
int at_night; /* also only valid during end of game disclosure */
int failing_untrap; /* move_into_trap() -> spoteffects() -> dotrap() */
-/* NetHack 3.6 mon.c $NHDT-Date: 1581322664 2020/02/10 08:17:44 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.321 $ */
+/* NetHack 3.6 mon.c $NHDT-Date: 1581637127 2020/02/13 23:38:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.322 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
static boolean FDECL(validspecmon, (struct monst *, int));
static struct permonst *FDECL(accept_newcham_form, (struct monst *, int));
static struct obj *FDECL(make_corpse, (struct monst *, unsigned));
+static int FDECL(minliquid_core, (struct monst *));
static void FDECL(m_detach, (struct monst *, struct permonst *));
static void FDECL(lifesaved_monster, (struct monst *));
static void FDECL(migrate_mon, (struct monst *, XCHAR_P, XCHAR_P));
}
free_mname(mtmp);
return obj;
- default_1:
default:
+ default_1:
if (g.mvitals[mndx].mvflags & G_NOCORPSE) {
return (struct obj *) 0;
} else {
/* check mtmp and water/lava for compatibility, 0 (survived), 1 (died) */
int
minliquid(mtmp)
-register struct monst *mtmp;
+struct monst *mtmp;
+{
+ int res;
+
+ /* set up flag for mondead() and xkilled() */
+ iflags.sad_feeling = (mtmp->mtame && !canseemon(mtmp));
+ res = minliquid_core(mtmp);
+ /* always clear the flag */
+ iflags.sad_feeling = FALSE;
+ return res;
+}
+
+/* guts of minliquid() */
+static int
+minliquid_core(mtmp)
+struct monst *mtmp;
{
boolean inpool, inlava, infountain;
register struct monst *mtmp;
{
struct permonst *mptr;
+ boolean be_sad;
int tmp;
+ /* potential pet message; always clear global flag */
+ be_sad = iflags.sad_feeling;
+ iflags.sad_feeling = FALSE;
+
mtmp->mhp = 0; /* in case caller hasn't done this */
lifesaved_monster(mtmp);
if (!DEADMONSTER(mtmp))
}
}
+ if (be_sad)
+ You("have a sad feeling for a moment, then it passes.");
+
/* dead vault guard is actually kept at coordinate <0,0> until
his temporary corridor to/from the vault has been removed;
need to do this after life-saving and before m_detach() */
const char *fltxt;
int how;
{
- boolean be_sad = FALSE; /* true if unseen pet is killed */
-
if ((mdef->wormno ? worm_known(mdef) : cansee(mdef->mx, mdef->my))
&& fltxt)
pline("%s is %s%s%s!", Monnam(mdef),
nonliving(mdef->data) ? "destroyed" : "killed",
*fltxt ? " by the " : "", fltxt);
else
- be_sad = (mdef->mtame != 0);
+ iflags.sad_feeling = (mdef->mtame != 0);
/* no corpses if digested or disintegrated */
g.disintegested = (how == AD_DGST || how == -AD_RBRE);
mondead(mdef);
else
mondied(mdef);
-
- if (be_sad && DEADMONSTER(mdef))
- You("have a sad feeling for a moment, then it passes.");
}
void
struct permonst *mdat;
struct obj *otmp;
struct trap *t;
+ boolean be_sad;
boolean wasinside = u.uswallow && (u.ustuck == mtmp),
burycorpse = FALSE,
nomsg = (xkill_flags & XKILL_NOMSG) != 0,
nocorpse = (xkill_flags & XKILL_NOCORPSE) != 0,
noconduct = (xkill_flags & XKILL_NOCONDUCT) != 0;
+ /* potential pet message; always clear global flag */
+ be_sad = iflags.sad_feeling;
+ iflags.sad_feeling = FALSE;
+
mtmp->mhp = 0; /* caller will usually have already done this */
if (!noconduct) /* KMH, conduct */
u.uconduct.killer++;
return;
}
+ if (be_sad)
+ You("have a sad feeling for a moment, then it passes.");
+
mdat = mtmp->data; /* note: mondead can change mtmp->data */
mndx = monsndx(mdat);