]> granicus.if.org Git - nethack/commitdiff
last? Sting
authorPatR <rankin@nethack.org>
Sun, 31 May 2015 08:24:19 +0000 (01:24 -0700)
committerPatR <rankin@nethack.org>
Sun, 31 May 2015 08:24:19 +0000 (01:24 -0700)
If Sting is glowing when blindness gets toggled, give a new "glowing"
message.

So instead of
  Sting glows blue! [...] You can't see! [...] Sting stops quivering.
if you're still blind when the last orc goes away, or
  Sting quivers slightly. [...] You can see again. [...] Sting stops
  glowing.
if you were blind when the first orc arrived, now you'll get an
intermediate message between the second and third ones.  'Sting is
quivering' for the first case, 'Sting is glowing' for the second.
No matter how many times blindness toggles back and forth, the final
"stops glowing" or "stops quivering" will be consistent with the most
recent "is glowing" or "is quivering".

src/artifact.c
src/potion.c

index 4928e755efc73db075f818122d49b341a846d636..0377c3ac866d09884eafe7f2754c4bf5df50f9a1 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 artifact.c      $NHDT-Date: 1433050876 2015/05/31 05:41:16 $  $NHDT-Branch: master $:$NHDT-Revision: 1.90 $ */
+/* NetHack 3.6 artifact.c      $NHDT-Date: 1433060653 2015/05/31 08:24:13 $  $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1834,26 +1834,26 @@ int arti_indx;
 /* use for warning "glow" for Sting, Orcrist, and Grimtooth */
 void
 Sting_effects(orc_count)
-int orc_count;
+int orc_count; /* new count (warn_obj_cnt is old count); -1 is a flag value */
 {
     if (uwep
         && (uwep->oartifact == ART_STING
             || uwep->oartifact == ART_ORCRIST
             || uwep->oartifact == ART_GRIMTOOTH)) {
-        /*
-         * Toggling blindness in between warning messages can result in
-         *   Sting glows light blue!  [...]  Sting stops quivering.
-         * or
-         *   Sting quivers slightly.  [...]  Sting stops glowing.
-         * but addressing that is far more trouble than it's worth.
-         */
-        if (orc_count > 0 && warn_obj_cnt == 0) {
+        if (orc_count == -1 && warn_obj_cnt > 0) {
+            /* -1 means that blindess has just been toggled; give a
+               'continue' message that eventual 'stop' message will match */
+            pline("%s is %s.", bare_artifactname(uwep),
+                  !Blind ? "glowing" : "quivering");
+        } else if (orc_count > 0 && warn_obj_cnt == 0) {
+            /* 'start' message */
             if (!Blind)
                 pline("%s %s %s!", bare_artifactname(uwep),
                       otense(uwep, "glow"), glow_color(uwep->oartifact));
             else
                 pline("%s quivers slightly.", bare_artifactname(uwep));
         } else if (orc_count == 0 && warn_obj_cnt > 0) {
+            /* 'stop' message */
             pline("%s stops %s.", bare_artifactname(uwep),
                   !Blind ? "glowing" : "quivering");
         }
index 7cee10f31db7c4713dd2c453fffacbca1c8977f0..661b30c472b1774229c559926675c7543a6e4b18 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 potion.c        $NHDT-Date: 1432512769 2015/05/25 00:12:49 $  $NHDT-Branch: master $:$NHDT-Revision: 1.115 $ */
+/* NetHack 3.6 potion.c        $NHDT-Date: 1433060654 2015/05/31 08:24:14 $  $NHDT-Branch: master $:$NHDT-Revision: 1.116 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -304,6 +304,14 @@ boolean talk;
         if (Blind_telepat || Infravision)
             see_monsters();
 
+        /* avoid either of the sequences
+           "Sting starts glowing", [become blind], "Sting stops quivering" or
+           "Sting starts quivering", [regain sight], "Sting stops glowing"
+           by giving "Sting is quivering" when becoming blind or
+           "Sting is glowing" when regaining sight so that the eventual
+           "stops" message matches */
+        if (warn_obj_cnt && uwep && (EWarn_of_mon & W_WEP) != 0L)
+            Sting_effects(-1);
         /* update dknown flag for inventory picked up while blind */
         if (can_see_now)
             learn_unseen_invent();