From 0fecf197897907403d1fe0ba9bee27585c8a09ff Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 26 Sep 2018 01:10:27 -0400 Subject: [PATCH] wand of polymorph engrave for blind writers 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 | 3 +++ src/engrave.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 23bde02da..0a384683f 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -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 diff --git a/src/engrave.c b/src/engrave.c index 48dc2bd40..05023c153 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -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*/ -- 2.40.0