]> granicus.if.org Git - nethack/commitdiff
wand of polymorph engrave for blind writers
authornhmall <nhmall@nethack.org>
Wed, 26 Sep 2018 05:10:27 +0000 (01:10 -0400)
committernhmall <nhmall@nethack.org>
Wed, 26 Sep 2018 05:10:27 +0000 (01:10 -0400)
Don't provide any discerning feedback on the blind player's turn
but do allow the wand to exercise its magic in a manner reflective
of blind writers

doc/fixes36.2
src/engrave.c

index 23bde02da2de9b4d90ba94c3c48f3ede1e7ebd23..0a384683f6def6ebbea1f918095e83e5835ba3c2 100644 (file)
@@ -149,6 +149,9 @@ Samurai seeing items at a distance could have them be described by their
 wizard mode ^T shouldn't have been diminishing player power but it was
        and hilite_status:power settings really drew attention to that
 fix missing space in "would flyif you weren't levitating"
+a wand of polymorph lost its magical ability for the turn just because the
+       player using it to engrave happened to be blind, which didn't make
+       a much sense
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index 48dc2bd401d1bafab747d737890751dcd02039e3..05023c15383f6d900b8ca0636d9a8f981a996f31 100644 (file)
@@ -7,6 +7,7 @@
 #include "lev.h"
 
 STATIC_VAR NEARDATA struct engr *head_engr;
+STATIC_DCL const char *NDECL(blengr);
 
 char *
 random_engraving(outbuf)
@@ -472,6 +473,7 @@ doengrave()
     boolean teleengr = FALSE; /* TRUE if we move the old engraving */
     boolean zapwand = FALSE;  /* TRUE if we remove a wand charge */
     xchar type = DUST;        /* Type of engraving made */
+    xchar oetype = 0;         /* will be set to type of current engraving */
     char buf[BUFSZ];          /* Buffer for final/poly engraving text */
     char ebuf[BUFSZ];         /* Buffer for initial engraving text */
     char fbuf[BUFSZ];         /* Buffer for "your fingers" */
@@ -494,6 +496,8 @@ doengrave()
     ebuf[0] = (char) 0;
     post_engr_text[0] = (char) 0;
     maxelen = BUFSZ - 1;
+    if (oep)
+        oetype = oep->engr_type;
     if (is_demon(youmonst.data) || youmonst.data->mlet == S_VAMPIRE)
         type = ENGR_BLOOD;
 
@@ -676,9 +680,17 @@ doengrave()
                     if (!Blind) {
                         type = (xchar) 0; /* random */
                         (void) random_engraving(buf);
+                    } else {
+                        /* keep the same type so that feels don't
+                           change and only the text is altered,
+                           but you won't know anyway because
+                           you're a _blind writer_ */
+                        if (oetype)
+                            type = oetype;
+                        xcrypt(blengr(), buf);
                     }
                     dengr = TRUE;
-                }
+                } 
                 break;
             case WAN_NOTHING:
             case WAN_UNDEAD_TURNING:
@@ -890,7 +902,8 @@ doengrave()
     /* Something has changed the engraving here */
     if (*buf) {
         make_engr_at(u.ux, u.uy, buf, moves, type);
-        pline_The("engraving now reads: \"%s\".", buf);
+        if (!Blind)
+            pline_The("engraving now reads: \"%s\".", buf);
         ptext = FALSE;
     }
     if (zapwand && (otmp->spe < 0)) {
@@ -1286,4 +1299,33 @@ const char *str;
     return;
 }
 
+static const char blind_writing[][21] = {
+    {0x44, 0x66, 0x6d, 0x69, 0x62, 0x65, 0x22, 0x45, 0x7b, 0x71,
+     0x65, 0x6d, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+    {0x51, 0x67, 0x60, 0x7a, 0x7f, 0x21, 0x40, 0x71, 0x6b, 0x71,
+     0x6f, 0x67, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+    {0x49, 0x6d, 0x73, 0x69, 0x62, 0x65, 0x22, 0x4c, 0x61, 0x7c,
+     0x6d, 0x67, 0x24, 0x42, 0x7f, 0x69, 0x6c, 0x77, 0x67, 0x7e, 0x00},
+    {0x4b, 0x6d, 0x6c, 0x66, 0x30, 0x4c, 0x6b, 0x68, 0x7c, 0x7f,
+     0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+    {0x51, 0x67, 0x70, 0x7a, 0x7f, 0x6f, 0x67, 0x68, 0x64, 0x71,
+     0x21, 0x4f, 0x6b, 0x6d, 0x7e, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00},
+    {0x4c, 0x63, 0x76, 0x61, 0x71, 0x21, 0x48, 0x6b, 0x7b, 0x75,
+     0x67, 0x63, 0x24, 0x45, 0x65, 0x6b, 0x6b, 0x65, 0x00, 0x00, 0x00},
+    {0x4c, 0x67, 0x68, 0x6b, 0x78, 0x68, 0x6d, 0x76, 0x7a, 0x75,
+     0x21, 0x4f, 0x71, 0x7a, 0x75, 0x6f, 0x77, 0x00, 0x00, 0x00, 0x00},
+    {0x44, 0x66, 0x6d, 0x7c, 0x78, 0x21, 0x50, 0x65, 0x66, 0x65,
+     0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+    {0x44, 0x66, 0x73, 0x69, 0x62, 0x65, 0x22, 0x56, 0x7d, 0x63,
+     0x69, 0x76, 0x6b, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+    {0x52, 0x77, 0x61, 0x28, 0x44, 0x6e, 0x75, 0x6a, 0x7b, 0x75,
+     0x6f, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+};
+
+STATIC_OVL const char *
+blengr(VOID_ARGS)
+{
+    return blind_writing[rn2(SIZE(blind_writing))];
+}
+
 /*engrave.c*/