]> granicus.if.org Git - nethack/commitdiff
fix #H6610 - completely burnt paper golem
authorPatR <rankin@nethack.org>
Fri, 15 Dec 2017 00:22:36 +0000 (16:22 -0800)
committerPatR <rankin@nethack.org>
Fri, 15 Dec 2017 00:22:36 +0000 (16:22 -0800)
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'.

doc/fixes36.1
include/mondata.h
src/explode.c
src/mhitm.c
src/mhitu.c
src/uhitm.c
src/zap.c

index b8dc231431b2fed4c307b1499e53c9fd8e4f8a49..a99a24fd096b67a73337eb7a32dd3db669122d09 100644 (file)
@@ -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
index 2b186dc62dc496cc8513eab6cc1556146e3efdfe..95153ce5dea61cd9945fb9e8e0207beb725b4d49 100644 (file)
@@ -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. */
 
 #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... */
index cb672c1b66c21e7c17d663326a5dbe073ce43cb1..86462a1895a3e63ebab8b3752b5049c02e03481c 100644 (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);
index b267a96b037691b5f96a4388359a9614eed53704..3427645fe96662f87b99c079b3f6d8c47fcc5dba 100644 (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)
index 7d07a87821655ed06c3db8504205d337eff761c3..fb483b8116c5c3dcefee093249cdf020a71cecaa 100644 (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;
index 97e49dbca31171aacde300c34923b81ba06b5f6b..df0645b96b61830b80d82d3314118505cb871fc4 100644 (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;
index 1a85709913b10e96abc212e1903387a61c582aa0..4ab138938e6babe9bbbca4c0842a7b80237d15cc 100644 (file)
--- 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 */