/* the player has killed the monster mtmp */
void
-xkilled(mtmp, dest)
+xkilled(mtmp, dflags)
struct monst *mtmp;
-int dest; /* dest==1, normal; dest==0, don't print message; dest==2, don't
- drop corpse either; dest==3, message but no corpse */
+int dflags; /* disposition flags: 1 => give message, 2 => suppress corpse */
{
int tmp, mndx, x = mtmp->mx, y = mtmp->my;
struct permonst *mdat;
struct obj *otmp;
struct trap *t;
- boolean wasinside = u.uswallow && (u.ustuck == mtmp);
- boolean burycorpse = FALSE;
+ boolean wasinside = u.uswallow && (u.ustuck == mtmp), burycorpse = FALSE,
+ givemsg = (dflags & 1) != 0, nocorpse = (dflags & 2) != 0;
/* KMH, conduct */
u.uconduct.killer++;
- if (dest & 1) {
- const char *verb = nonliving(mtmp->data) ? "destroy" : "kill";
-
- if (!wasinside && !canspotmon(mtmp))
- You("%s it!", verb);
- else {
- You("%s %s!", verb,
- !mtmp->mtame
- ? mon_nam(mtmp)
- : x_monnam(mtmp,
- (has_mname(mtmp)) ? ARTICLE_NONE : ARTICLE_THE,
- "poor",
- (has_mname(mtmp)) ? SUPPRESS_SADDLE : 0,
- FALSE));
- }
- }
+ if (givemsg)
+ You("%s %s!",
+ nonliving(mtmp->data) ? "destroy" : "kill",
+ !(wasinside || canspotmon(mtmp)) ? "it"
+ : !mtmp->mtame ? mon_nam(mtmp)
+ : x_monnam(mtmp, has_mname(mtmp) ? ARTICLE_NONE : ARTICLE_THE,
+ "poor", has_mname(mtmp) ? SUPPRESS_SADDLE : 0,
+ FALSE));
if (mtmp->mtrapped && (t = t_at(x, y)) != 0
&& (t->ttyp == PIT || t->ttyp == SPIKED_PIT)) {
if (sobj_at(BOULDER, x, y))
- dest |= 2; /*
- * Prevent corpses/treasure being created "on top"
- * of the boulder that is about to fall in. This is
- * out of order, but cannot be helped unless this
- * whole routine is rearranged.
- */
+ nocorpse = TRUE; /* Prevent corpses/treasure being created
+ "on top" of boulder that is about to fall in.
+ This is out of order, but cannot be helped
+ unless this whole routine is rearranged. */
if (m_carrying(mtmp, BOULDER))
burycorpse = TRUE;
}
if (mtmp->mhp > 0) { /* monster lifesaved */
/* Cannot put the non-visible lifesaving message in
* lifesaved_monster() since the message appears only when you
- * kill it (as opposed to visible lifesaving which always
- * appears).
+ * kill it (as opposed to visible lifesaving which always appears).
*/
stoned = FALSE;
if (!cansee(x, y) && !vamp_rise_msg)
goto cleanup;
}
- if ((dest & 2) || LEVEL_SPECIFIC_NOCORPSE(mdat))
+ if (nocorpse || LEVEL_SPECIFIC_NOCORPSE(mdat))
goto cleanup;
#ifdef MAIL
/* oc_big is also oc_bimanual and oc_bulky */
&& (otmp->owt > 30 || objects[otyp].oc_big)) {
delobj(otmp);
- } else if (!flooreffects(otmp, x, y, (dest & 1) ? "fall" : "")) {
+ } else if (!flooreffects(otmp, x, y, givemsg ? "fall" : "")) {
place_object(otmp, x, y);
stackobj(otmp);
}
cadaver = make_corpse(mtmp, burycorpse ? CORPSTAT_BURIED
: CORPSTAT_NONE);
if (burycorpse && cadaver && cansee(x, y) && !mtmp->minvis
- && cadaver->where == OBJ_BURIED && (dest & 1)) {
+ && cadaver->where == OBJ_BURIED && givemsg) {
pline("%s corpse ends up buried.", s_suffix(Monnam(mtmp)));
}
}
cleanup:
/* punish bad behaviour */
- if (is_human(mdat) && (!always_hostile(mdat) && mtmp->malign <= 0)
+ if (is_human(mdat)
+ && (!always_hostile(mdat) && mtmp->malign <= 0)
&& (mndx < PM_ARCHEOLOGIST || mndx > PM_WIZARD)
&& u.ualign.type != A_CHAOTIC) {
HTelepat &= ~INTRINSIC;
}
}
-/* "I am sometimes shocked by... the nuns who never take a bath without
- * wearing a bathrobe all the time. When asked why, since no man can see
- * them,
+/* "I am sometimes shocked by... the nuns who never take a bath without
+ * wearing a bathrobe all the time. When asked why, since no man can see them,
* they reply 'Oh, but you forget the good God'. Apparently they conceive of
* the Deity as a Peeping Tom, whose omnipotence enables Him to see through
* bathroom walls, but who is foiled by bathrobes." --Bertrand Russell, 1943
god_zaps_you(resp_god)
aligntyp resp_god;
{
+ long oldkillcount = u.uconduct.killer;
+
if (u.uswallow) {
pline(
"Suddenly a bolt of lightning comes down at you from the heavens!");
pline("%s fries to a crisp!", Monnam(u.ustuck));
/* Yup, you get experience. It takes guts to successfully
* pull off this trick on your god, anyway.
+ * Other credit/blame applies (luck or alignment adjustments),
+ * but not direct kill count (pacifist conduct).
*/
xkilled(u.ustuck, 0);
+ u.uconduct.killer = oldkillcount;
} else
pline("%s seems unaffected.", Monnam(u.ustuck));
} else {
if (!resists_disint(u.ustuck)) {
pline("%s disintegrates into a pile of dust!", Monnam(u.ustuck));
xkilled(u.ustuck, 2); /* no corpse */
+ u.uconduct.killer = oldkillcount;
} else
pline("%s seems unaffected.", Monnam(u.ustuck));
} else {
(void) destroy_arm(uarm);
if (uarmu && !uarm && !uarmc)
(void) destroy_arm(uarmu);
- if (!Disint_resistance)
+ if (!Disint_resistance) {
fry_by_god(resp_god, TRUE);
- else {
+ } else {
You("bask in its %s glow for a minute...", NH_BLACK);
godvoice(resp_god, "I believe it not!");
}