]> granicus.if.org Git - nethack/commitdiff
pull request #465 - explding hero waking monsters
authorPatR <rankin@nethack.org>
Mon, 29 Mar 2021 16:35:43 +0000 (09:35 -0700)
committerPatR <rankin@nethack.org>
Mon, 29 Mar 2021 16:35:43 +0000 (09:35 -0700)
A polymorphed hero who exploded when attacking thin air would use a
radius based on experience level rather than the fixed radius that
the monster form itself used.  When exploding at a monster it didn't
wake other monsters at all.

Fixes #465

doc/fixes37.0
src/hack.c
src/uhitm.c

index 867d924d63e80bac1a44d2dd94b1d70321c5eacb..fce516d0a89b9cf8659103db30b8545b149f853f 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.488 $ $NHDT-Date: 1617034646 2021/03/29 16:17:26 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.489 $ $NHDT-Date: 1617035736 2021/03/29 16:35:36 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -423,6 +423,9 @@ if player managed to get multiple $ items, all but the last could be moved to
 when a monster on the far side of a closed door opens it, sometimes the hero
        was told about the monster without it being displayed on the map
 also show extended command name when showing what a key does in help
+poly'd hero who exploded when attacking a monster didn't wake up other
+       monsters in the vicinity; when attacking thin air, hero's explosion
+       woke other monsters within different radius than same monster's would
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index abf492d89a5ff84c8b5c97bb2f44de28b300995f..4e1aa363aedcb0ebc78087b77a22f836039be8de 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 hack.c  $NHDT-Date: 1609442596 2020/12/31 19:23:16 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.276 $ */
+/* NetHack 3.7 hack.c  $NHDT-Date: 1617035736 2021/03/29 16:35:36 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.281 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1751,7 +1751,8 @@ domove_core(void)
 
         nomul(0);
         if (explo) {
-            wake_nearby();
+            /* no monster has been attacked so we have bypassed explum() */
+            wake_nearto(u.ux, u.uy, 7 * 7); /* same radius as explum() */
             u.mh = -1; /* dead in the current form */
             rehumanize();
         }
index f6718af89b0d6cccd0a4e4917f394439899039bb..ac55059b04f1d8af6a60e22b94e5c46eda6a6616 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 uhitm.c $NHDT-Date: 1614811212 2021/03/03 22:40:12 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.299 $ */
+/* NetHack 3.7 uhitm.c $NHDT-Date: 1617035737 2021/03/29 16:35:37 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.300 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -4063,16 +4063,18 @@ damageum(
     mdef->mstrategy &= ~STRAT_WAITFORU; /* in case player is very fast */
     mdef->mhp -= mhm.damage;
     if (DEADMONSTER(mdef)) {
+        /* (DEADMONSTER(mdef) and !mhm.damage => already killed) */
         if (mdef->mtame && !cansee(mdef->mx, mdef->my)) {
             You_feel("embarrassed for a moment.");
             if (mhm.damage)
-                xkilled(mdef, XKILL_NOMSG); /* !mhm.damage but hp<1: already killed */
+                xkilled(mdef, XKILL_NOMSG);
         } else if (!flags.verbose) {
             You("destroy it!");
             if (mhm.damage)
                 xkilled(mdef, XKILL_NOMSG);
-        } else if (mhm.damage)
-            killed(mdef);
+        } else if (mhm.damage) {
+            killed(mdef); /* regular "you kill <mdef>" message */
+        }
         return MM_DEF_DIED;
     }
     return MM_HIT;
@@ -4126,6 +4128,7 @@ explum(struct monst *mdef, struct attack *mattk)
     default:
         break;
     }
+    wake_nearto(u.ux, u.uy, 7 * 7); /* same radius as exploding monster */
     return MM_HIT;
 }
 
@@ -4746,7 +4749,8 @@ hmonas(struct monst *mon)
             (void) passive(mon, weapon, 1, 0, mattk->aatyp, FALSE);
             nsum = MM_MISS; /* return value below used to be 'nsum > 0' */
         } else {
-            (void) passive(mon, weapon, (sum[i] != MM_MISS), 1, mattk->aatyp, FALSE);
+            (void) passive(mon, weapon, (sum[i] != MM_MISS), 1,
+                           mattk->aatyp, FALSE);
             nsum |= sum[i];
         }