]> granicus.if.org Git - nethack/commitdiff
Gremlin wailing in agony should wake up nearby monsters
authorPasi Kallinen <paxed@alt.org>
Sun, 29 May 2016 06:35:51 +0000 (09:35 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 29 May 2016 06:35:55 +0000 (09:35 +0300)
Also allow wizmode ^G create sleeping monsters

src/read.c
src/uhitm.c

index 87b30ef1d714e36913fdd1a073bc5507bccfadb8..af8399037cb79672dd13b98242ca0a3afd5bcb3e 100644 (file)
@@ -2371,7 +2371,8 @@ create_particular()
     struct permonst *whichpm = NULL;
     struct monst *mtmp;
     boolean madeany = FALSE, randmonst = FALSE,
-            maketame, makepeaceful, makehostile, saddled, invisible;
+        maketame, makepeaceful, makehostile, saddled, invisible,
+        sleeping;
     int fem;
 
     tryct = 5;
@@ -2379,7 +2380,7 @@ create_particular()
         monclass = MAXMCLASSES;
         which = urole.malenum; /* an arbitrary index into mons[] */
         maketame = makepeaceful = makehostile = FALSE;
-        saddled = invisible = FALSE;
+        sleeping = saddled = invisible = FALSE;
         fem = -1; /* gender not specified */
         getlin("Create what kind of monster? [type the name or symbol]", buf);
         bufp = mungspaces(buf);
@@ -2389,6 +2390,10 @@ create_particular()
             saddled = TRUE;
             (void) memset(tmpp, ' ', sizeof "saddled " - 1);
         }
+        if ((tmpp = strstri(bufp, "sleeping ")) != 0) {
+            sleeping = TRUE;
+            (void) memset(tmpp, ' ', sizeof "sleeping " - 1);
+        }
         if ((tmpp = strstri(bufp, "invisible ")) != 0) {
             invisible = TRUE;
             (void) memset(tmpp, ' ', sizeof "invisible " - 1);
@@ -2478,6 +2483,8 @@ create_particular()
             }
             if (invisible)
                 mon_set_minvis(mtmp);
+            if (sleeping)
+                mtmp->msleeping = 1;
             madeany = TRUE;
             /* in case we got a doppelganger instead of what was asked
                for, make it start out looking like what was asked for */
index 0ca149785013329d723be53c14deb7f4b553a908..b45b4045312f5b6ec34f19caee2e9a218705a550 100644 (file)
@@ -2695,6 +2695,7 @@ int dmg;
     pline("%s %s!", Monnam(mon),
           (dmg > mon->mhp / 2) ? "wails in agony" : "cries out in pain");
     mon->mhp -= dmg;
+    wake_nearto(mon->mx, mon->my, 30);
     if (mon->mhp <= 0) {
         if (context.mon_moving)
             monkilled(mon, (char *) 0, AD_BLND);