]> granicus.if.org Git - nethack/commitdiff
breaking blind-from-birth conduct
authorPatR <rankin@nethack.org>
Tue, 2 Jun 2015 23:57:42 +0000 (16:57 -0700)
committerPatR <rankin@nethack.org>
Tue, 2 Jun 2015 23:57:42 +0000 (16:57 -0700)
OPTIONS:blind starts the hero off blind, but putting on the Eyes of the
Overworld confers sight.  Make that break the blind-from-birth conduct.

Sight persists after removing the Eyes even though they aren't intended
to cure anything.  It doesn't make sense to restore the blind-from-birth
flag when taking the Eyes off, but we may want to add another flag, or
make u.uroleplay.blind into a bit mask that can track both can't-see-now
for play and could-never-see for conduct.  (Actually, u.uroleplay.blind
should track only the conduct, and starting the game with it enabled
should set one of the extra bits in u.uprops[BLINDED].intrinsic.  The
Eyes already override that, and taking them off would restore blindness
since the bit would still be set.  As a bonus, the expression in the
macro 'Blind' could be simplified.)

src/do_wear.c

index df039ec1f950122428bc7d249e738ba22997cae2..a790463193add562039d7ef82eb16b1794b5e9ef 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 do_wear.c       $NHDT-Date: 1432512763 2015/05/25 00:12:43 $  $NHDT-Branch: master $:$NHDT-Revision: 1.81 $ */
+/* NetHack 3.6 do_wear.c       $NHDT-Date: 1433289458 2015/06/02 23:57:38 $  $NHDT-Branch: master $:$NHDT-Revision: 1.82 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1084,7 +1084,14 @@ register struct obj *otmp;
     } else if (already_blind && !Blind) {
         changed = TRUE;
         /* "You are now wearing the Eyes of the Overworld." */
-        You("can see!");
+        if (u.uroleplay.blind) {
+            /* this can only happen by putting on the Eyes of the Overworld;
+               that shouldn't actually produce a permanent cure, but we
+               can't let the "blind from birth" conduct remain intact */
+            pline("For the first time in your life, you can see!");
+            u.uroleplay.blind = FALSE;
+        } else
+            You("can see!");
     }
     if (changed) {
         /* blindness has just been toggled */