]> granicus.if.org Git - nethack/commitdiff
more sleeping monster
authorPatR <rankin@nethack.org>
Tue, 22 Feb 2022 20:12:13 +0000 (12:12 -0800)
committerPatR <rankin@nethack.org>
Tue, 22 Feb 2022 20:12:13 +0000 (12:12 -0800)
Extend the PR#660 change that shows whether a monster is asleep when
examined by farlook/quicklook/autodescribe to monsters that aren't
moving due to timed sleep as well as those that are asleep for an
unspecified amount of time.  Unfortunately 'mfrozen' isn't specific
about why a monster can't move so the phrasing is less than ideal.

doc/fixes3-7-0.txt
src/insight.c
src/pager.c

index 8f8e61952943615cda74947f3fc2cc794d5e1e18..a7f94ed945fcada3f85694de7fe63dde342fce04 100644 (file)
@@ -1458,6 +1458,9 @@ added a chronicle of major events, and optional live logging of those
 paranoid:swim to prevent accidental dunking into dangerous liquids
 looking at a monster will indicate whether it is asleep, and waking up a
        monster yields a message
+extend farlook's "<mon>, asleep" to "<mon>, can't move (paralyzed or sleeping
+       or busy)" for timed sleep and also "<mon>, meditating" for monster
+       that is waiting for hero to approach
 
 
 Platform- and/or Interface-Specific New Features
index d1414fc06143588e11cf5fd25e983a5800f6830c..10bd74dd2b84b5b0e9973be5a5b213a8cfddb05a 100644 (file)
@@ -2882,8 +2882,8 @@ mstatusline(struct monst *mtmp)
         Strcat(info, ", stunned");
     if (mtmp->msleeping)
         Strcat(info, ", asleep");
-#if 0 /* unfortunately mfrozen covers temporary sleep and being busy \
-         (donning armor, for instance) as well as paralysis */
+#if 0 /* unfortunately mfrozen covers temporary sleep and being busy
+       * (donning armor, for instance) as well as paralysis */
     else if (mtmp->mfrozen)
         Strcat(info, ", paralyzed");
 #else
@@ -2924,6 +2924,8 @@ mstatusline(struct monst *mtmp)
             Sprintf(eos(info), ", injured %s", what);
         }
     }
+    if (mtmp->mleashed)
+        Strcat(info, ", leashed");
 
     /* avoid "Status of the invisible newt ..., invisible" */
     /* and unlike a normal mon_nam, use "saddled" even if it has a name */
index 88f83888362eca2f0e2e550f2ae84ea7ba086f02..89ad90e627b02be05d663197150fbf82066d8f31 100644 (file)
@@ -359,11 +359,22 @@ look_at_monster(char *buf,
             Strcat(buf, (Upolyd && sticks(g.youmonst.data))
                           ? ", being held" : ", holding you");
     }
-    if (mtmp->msleeping)
+    /* if mtmp isn't able to move (other than because it is a type of
+       monster that never moves), say so [excerpt from mstatusline() for
+       stethoscope or wand of probing] */
+    if (mtmp->mfrozen)
+        /* unfortunately mfrozen covers temporary sleep and being busy
+           (donning armor, for instance) as well as paralysis */
+        Strcat(buf, ", can't move (paralyzed or sleeping or busy)");
+    else if (mtmp->msleeping)
+        /* sleeping for an indeterminate duration */
         Strcat(buf, ", asleep");
+    else if ((mtmp->mstrategy & STRAT_WAITMASK) != 0)
+        /* arbitrary reason why it isn't moving */
+        Strcat(buf, ", meditating");
+
     if (mtmp->mleashed)
         Strcat(buf, ", leashed to you");
-
     if (mtmp->mtrapped && cansee(mtmp->mx, mtmp->my)) {
         struct trap *t = t_at(mtmp->mx, mtmp->my);
         int tt = t ? t->ttyp : NO_TRAP;