]> granicus.if.org Git - nethack/commitdiff
show deafness indicator on status line
authornhmall <mjnh@persona.ca>
Wed, 13 Jan 2016 04:43:28 +0000 (23:43 -0500)
committernhmall <mjnh@persona.ca>
Wed, 13 Jan 2016 04:43:28 +0000 (23:43 -0500)
May as well show a deafness indicator.

include/botl.h
src/apply.c
src/botl.c
src/cmd.c
src/eat.c
src/music.c
src/potion.c
src/timeout.c
src/trap.c

index 8945fa2934360c36fd36ce3c77d3dcbfa76aab8c..994b41009ce222ed4ec6041b756ebf70c509a7b4 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6  botl.h  $NHDT-Date: 1433105378 2015/05/31 20:49:38 $  $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.14 $ */
+/* NetHack 3.6  botl.h  $NHDT-Date: 1452660165 2016/01/13 04:42:45 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */
 /* Copyright (c) Michael Allison, 2003                            */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -69,6 +69,7 @@ BL_EXP, BL_CONDITION };
 #define BL_MASK_HALLU           0x00000010L
 #define BL_MASK_STUNNED         0x00000020L
 #define BL_MASK_SLIMED          0x00000040L
+#define BL_MASK_DEAF            0x00000080L
 /* clang-format on */
 
 #define REASSESS_ONLY TRUE
index 0136421d3cd0a02802451eef9bf60b241d3e9c61..339f7f6d070744026faecd78c679981e84fe9ee0 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 apply.c $NHDT-Date: 1450582748 2015/12/20 03:39:08 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.217 $ */
+/* NetHack 3.6 apply.c $NHDT-Date: 1452660177 2016/01/13 04:42:57 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.219 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1780,6 +1780,7 @@ struct obj *obj;
             if (Deaf) /* make_deaf() won't give feedback when already deaf */
                 pline("Nothing seems to happen.");
             make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
+            context.botl = TRUE;
             break;
         }
         return;
index 422f6d4efc34bfe80bbb076d32c06ccc2546cc06..261686a8745d014c02ddf0008cb0835b827cdf2e 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 botl.c  $NHDT-Date: 1447978683 2015/11/20 00:18:03 $  $NHDT-Branch: master $:$NHDT-Revision: 1.69 $ */
+/* NetHack 3.6 botl.c  $NHDT-Date: 1452660188 2016/01/13 04:43:08 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -122,6 +122,8 @@ bot2()
         Sprintf(nb = eos(nb), " Hallu");
     if (Slimed)
         Sprintf(nb = eos(nb), " Slime");
+    if (Deaf)
+        Sprintf(nb = eos(nb), " Df");
     if (cap > UNENCUMBERED)
         Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
     curs(WIN_STATUS, 1, 1);
@@ -543,6 +545,11 @@ bot()
     else
         blstats[idx][BL_CONDITION].a.a_ulong &= ~BL_MASK_BLIND;
 
+    if (Deaf)
+        blstats[idx][BL_CONDITION].a.a_ulong |= BL_MASK_DEAF;
+    else
+        blstats[idx][BL_CONDITION].a.a_ulong &= ~BL_MASK_DEAF;
+
     if (Confusion)
         blstats[idx][BL_CONDITION].a.a_ulong |= BL_MASK_CONF;
     else
index ee1db860260189b3094f041207252007c6e9190a..47cdf8a2edbdb1a8bb3abcc0f2c3e572874b1630 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 cmd.c   $NHDT-Date: 1452123457 2016/01/06 23:37:37 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.216 $ */
+/* NetHack 3.6 cmd.c   $NHDT-Date: 1452660189 2016/01/13 04:43:09 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.219 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1140,6 +1140,7 @@ wiz_intrinsic(VOID_ARGS)
         if (!strcmp(intrinsics[i],"deafness")) {
             You("go deaf.");
             incr_itimeout(&HDeaf, 30);
+            context.botl = TRUE;
         }
     } else
         pline("Unavailable command '%s'.",
index 13a3944052b06720778182a2674464319c6de93f..265a868c3be01efefe4c873c7a5902fdaee2329f 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 eat.c   $NHDT-Date: 1451086430 2015/12/25 23:33:50 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.157 $ */
+/* NetHack 3.6 eat.c   $NHDT-Date: 1452660191 2016/01/13 04:43:11 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.161 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1479,8 +1479,10 @@ int
 Hear_again(VOID_ARGS)
 {
     /* Chance of deafness going away while fainted/sleeping/etc. */
-    if (!rn2(2))
+    if (!rn2(2)) {
         make_deaf(0L, FALSE);
+        context.botl = TRUE;
+    }
     return 0;
 }
 
@@ -1514,6 +1516,7 @@ struct obj *obj;
             where = (u.usteed) ? "saddle" : surface(u.ux, u.uy);
         pline_The("world spins and %s %s.", what, where);
         incr_itimeout(&HDeaf, duration);
+        context.botl = TRUE;
         nomul(-duration);
         multi_reason = "unconscious from rotten food";
         nomovemsg = "You are conscious again.";
@@ -2839,6 +2842,7 @@ boolean incr;
                 stop_occupation();
                 You("faint from lack of food.");
                 incr_itimeout(&HDeaf, duration);
+                context.botl = TRUE;
                 nomul(-duration);
                 multi_reason = "fainted from lack of food";
                 nomovemsg = "You regain consciousness.";
index 73b855bc13e0b302c217e5af93628ad82da00e1a..f21a1948352dbe02a17b617bc686cfc341ce1acb 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 music.c $NHDT-Date: 1446808448 2015/11/06 11:14:08 $  $NHDT-Branch: master $:$NHDT-Revision: 1.40 $ */
+/* NetHack 3.6 music.c $NHDT-Date: 1452660194 2016/01/13 04:43:14 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.42 $ */
 /*      Copyright (c) 1989 by Jean-Christophe Collet */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -567,6 +567,7 @@ struct obj *instr;
         awaken_monsters(u.ulevel * 40);
         incr_itimeout(&HDeaf, rn1(20, 30));
         exercise(A_WIS, FALSE);
+        context.botl = TRUE;
         break;
     default:
         impossible("What a weird instrument (%d)!", instr->otyp);
index c18c560b91ba239bdcf0fcd09714dd54648f0f82..2a54d5fa10a6709bd6b648180e680f4beaf8fdcc 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 potion.c        $NHDT-Date: 1450667491 2015/12/21 03:11:31 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.124 $ */
+/* NetHack 3.6 potion.c        $NHDT-Date: 1452660195 2016/01/13 04:43:15 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.126 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -410,8 +410,7 @@ boolean talk;
             You("are unable to hear anything.");
         toggled = TRUE;
     }
-    /* deafness isn't presently shown on status line, but
-       request a status update in case that changes someday */
+    /* request a status update */
     if (toggled)
         context.botl = TRUE;
 
index e50ae39b222030544330eed1b2d7b39122696746..7370b8b05c044e7f84a4d4f7915e0cc04d7426ce 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 timeout.c       $NHDT-Date: 1446861771 2015/11/07 02:02:51 $  $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */
+/* NetHack 3.6 timeout.c       $NHDT-Date: 1452660198 2016/01/13 04:43:18 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.64 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -345,6 +345,7 @@ nh_timeout()
             case DEAF:
                 set_itimeout(&HDeaf, 1L);
                 make_deaf(0L, TRUE);
+                context.botl = TRUE;
                 if (!Deaf)
                     stop_occupation();
                 break;
@@ -443,6 +444,7 @@ boolean wakeup_msg;
         /* caller can follow with a direct call to Hear_again() if
            there's a need to override this when wakeup_msg is true */
         incr_itimeout(&HDeaf, how_long);
+        context.botl = TRUE;
         afternmv = Hear_again; /* this won't give any messages */
     }
     /* early wakeup from combat won't be possible until next monster turn */
@@ -1288,6 +1290,7 @@ do_storms()
         /* Even if already deaf, we sense the thunder's vibrations. */
         pline("Kaboom!!!  Boom!!  Boom!!");
         incr_itimeout(&HDeaf, rn1(20, 30));
+        context.botl = TRUE;
         if (!u.uinvulnerable) {
             stop_occupation();
             nomul(-3);
index 71700c6c8b0d65035a8fae6a330935e70f4611b1..80f638e90886215c9b7046550923a41bfdc51cde 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 trap.c  $NHDT-Date: 1452039453 2016/01/06 00:17:33 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.253 $ */
+/* NetHack 3.6 trap.c  $NHDT-Date: 1452660199 2016/01/13 04:43:19 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.255 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -3066,10 +3066,12 @@ domagictrap()
         if (!Deaf) {
             You_hear("a deafening roar!");
             incr_itimeout(&HDeaf, rn1(20, 30));
+            context.botl = TRUE;
         } else {
             /* magic vibrations still hit you */
             You_feel("rankled.");
             incr_itimeout(&HDeaf, rn1(5, 15));
+            context.botl = TRUE;
         }
         while (cnt--)
             (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);