From 3a5304c49eea282ba02d8b2ba43b338a39e73dec Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 31 May 2015 01:24:19 -0700 Subject: [PATCH] last? Sting 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 | 20 ++++++++++---------- src/potion.c | 10 +++++++++- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index 4928e755e..0377c3ac8 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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"); } diff --git a/src/potion.c b/src/potion.c index 7cee10f31..661b30c47 100644 --- a/src/potion.c +++ b/src/potion.c @@ -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(); -- 2.40.0