fix #H6610 - completely burnt paper golem

When a monster killed a paper golem with a fire attack, the player was
told that the golem "burns completely" yet it might still leave some
blank scrolls as 'corpse'.  The fix for that was one-line, but several
other death-by-fire situations which didn't report "burns completely"
were also leaving scrolls:  fireball spell or scroll of fire or other
fire explosions (if any), also wand of fire.  Fire trap and poly'd
hero with fire attack were already suppressing 'corpse'.
This commit is contained in:
PatR
2017-12-14 16:22:36 -08:00
parent b4540086f8
commit 892f210c1e
7 changed files with 49 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 explode.c $NHDT-Date: 1511658058 2017/11/26 01:00:58 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.54 $ */
/* NetHack 3.6 explode.c $NHDT-Date: 1513297345 2017/12/15 00:22:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.55 $ */
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
@@ -443,8 +443,12 @@ int expltype;
mtmp->mhp -= (idamres + idamnonres);
}
if (mtmp->mhp <= 0) {
int xkflg = ((adtyp == AD_FIRE
&& completelyburns(mtmp->data))
? XKILL_NOCORPSE : 0);
if (!context.mon_moving) {
killed(mtmp);
xkilled(mtmp, XKILL_GIVEMSG | xkflg);
} else if (mdef && mtmp == mdef) {
/* 'mdef' killed self trying to cure being turned
* into slime due to some action by the player.
@@ -456,11 +460,15 @@ int expltype;
*/
if (cansee(mtmp->mx, mtmp->my) || canspotmon(mtmp))
pline("%s is %s!", Monnam(mtmp),
nonliving(mtmp->data) ? "destroyed"
: "killed");
xkilled(mtmp, XKILL_NOMSG | XKILL_NOCONDUCT);
} else
xkflg ? "burned completely"
: nonliving(mtmp->data) ? "destroyed"
: "killed");
xkilled(mtmp, XKILL_NOMSG | XKILL_NOCONDUCT | xkflg);
} else {
if (xkflg)
adtyp = AD_RBRE; /* no corpse */
monkilled(mtmp, "", (int) adtyp);
}
} else if (!context.mon_moving) {
/* all affected monsters, even if mdef is set */
setmangry(mtmp, TRUE);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitm.c $NHDT-Date: 1504999944 2017/09/09 23:32:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.98 $ */
/* NetHack 3.6 mhitm.c $NHDT-Date: 1513297346 2017/12/15 00:22:26 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.99 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -937,10 +937,10 @@ register struct attack *mattk;
}
if (vis && canseemon(mdef))
pline("%s is %s!", Monnam(mdef), on_fire(pd, mattk));
if (pd == &mons[PM_STRAW_GOLEM] || pd == &mons[PM_PAPER_GOLEM]) {
if (completelyburns(pd)) { /* paper golem or straw golem */
if (vis && canseemon(mdef))
pline("%s burns completely!", Monnam(mdef));
mondied(mdef);
mondead(mdef); /* was mondied() but that dropped paper scrolls */
if (mdef->mhp > 0)
return 0;
else if (mdef->mtame && !vis)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitu.c $NHDT-Date: 1512808564 2017/12/09 08:36:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.148 $ */
/* NetHack 3.6 mhitu.c $NHDT-Date: 1513297347 2017/12/15 00:22:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.149 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1030,9 +1030,8 @@ register struct attack *mattk;
hitmsg(mtmp, mattk);
if (uncancelled) {
pline("You're %s!", on_fire(youmonst.data, mattk));
if (youmonst.data == &mons[PM_STRAW_GOLEM]
|| youmonst.data == &mons[PM_PAPER_GOLEM]) {
You("roast!");
if (completelyburns(youmonst.data)) { /* paper or straw golem */
You("go up in flames!");
/* KMH -- this is okay with unchanging */
rehumanize();
break;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 uhitm.c $NHDT-Date: 1504999056 2017/09/09 23:17:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.167 $ */
/* NetHack 3.6 uhitm.c $NHDT-Date: 1513297347 2017/12/15 00:22:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.172 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1543,9 +1543,13 @@ register struct attack *mattk;
}
if (!Blind)
pline("%s is %s!", Monnam(mdef), on_fire(pd, mattk));
if (pd == &mons[PM_STRAW_GOLEM] || pd == &mons[PM_PAPER_GOLEM]) {
if (completelyburns(pd)) { /* paper golem or straw golem */
if (!Blind)
pline("%s burns completely!", Monnam(mdef));
else
You("smell burning%s.",
(pd == &mons[PM_PAPER_GOLEM]) ? " paper"
: (pd == &mons[PM_STRAW_GOLEM]) ? " straw" : "");
xkilled(mdef, XKILL_NOMSG | XKILL_NOCORPSE);
tmp = 0;
break;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 zap.c $NHDT-Date: 1505475171 2017/09/15 11:32:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.267 $ */
/* NetHack 3.6 zap.c $NHDT-Date: 1513297348 2017/12/15 00:22:28 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.270 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -4022,10 +4022,22 @@ boolean say; /* Announce out of sight hit/miss events if true */
if (tmp == MAGIC_COOKIE) { /* disintegration */
disintegrate_mon(mon, type, fltxt);
} else if (mon->mhp < 1) {
if (type < 0)
if (type < 0) {
/* mon has just been killed by another monster */
monkilled(mon, fltxt, AD_RBRE);
else
killed(mon);
} else {
int xkflags = XKILL_GIVEMSG; /* killed(mon); */
/* killed by hero; we know 'type' isn't negative;
if it's fire, highly flammable monsters leave
no corpse; don't bother reporting that they
"burn completely" -- unnecessary verbosity */
if ((type % 10 == ZT_FIRE)
/* paper golem or straw golem */
&& completelyburns(mon->data))
xkflags |= XKILL_NOCORPSE;
xkilled(mon, xkflags);
}
} else {
if (!otmp) {
/* normal non-fatal hit */