From: PatR Date: Fri, 15 Dec 2017 00:22:36 +0000 (-0800) Subject: fix #H6610 - completely burnt paper golem X-Git-Tag: NetHack-3.6.1_RC01~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=892f210c1ef4fe6b5c4f5001e3374718ae8bcb79;p=nethack 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'. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index b8dc23143..a99a24fd0 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -486,6 +486,8 @@ when trying to swap places with a pet and failing due to pet being trapped trap triggering) executed even though hero didn't ultimately move being "dead inside" (self-genocide while polymorphed) conferred partial invulnerability--normal monster behavior stopped attacking hero +if a fiery monster, wand of fire, or fiery explosion burned up a paper golem, + it could still leave blank scrolls Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository diff --git a/include/mondata.h b/include/mondata.h index 2b186dc62..95153ce5d 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 mondata.h $NHDT-Date: 1513130015 2017/12/13 01:53:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.32 $ */ +/* NetHack 3.6 mondata.h $NHDT-Date: 1513297342 2017/12/15 00:22:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.33 $ */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -180,6 +180,10 @@ #define nonliving(ptr) \ (is_undead(ptr) || (ptr) == &mons[PM_MANES] || weirdnonliving(ptr)) +/* no corpse (ie, blank scrolls) if killed by fire */ +#define completelyburns(ptr) \ + ((ptr) == &mons[PM_PAPER_GOLEM] || (ptr) == &mons[PM_STRAW_GOLEM]) + /* Used for conduct with corpses, tins, and digestion attacks */ /* G_NOCORPSE monsters might still be swallowed as a purple worm */ /* Maybe someday this could be in mflags... */ diff --git a/src/explode.c b/src/explode.c index cb672c1b6..86462a189 100644 --- a/src/explode.c +++ b/src/explode.c @@ -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); diff --git a/src/mhitm.c b/src/mhitm.c index b267a96b0..3427645fe 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -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) diff --git a/src/mhitu.c b/src/mhitu.c index 7d07a8782..fb483b811 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -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; diff --git a/src/uhitm.c b/src/uhitm.c index 97e49dbca..df0645b96 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -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; diff --git a/src/zap.c b/src/zap.c index 1a8570991..4ab138938 100644 --- a/src/zap.c +++ b/src/zap.c @@ -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 */