]> granicus.if.org Git - nethack/commitdiff
scum bug
authornethack.rankin <nethack.rankin>
Thu, 7 Jul 2005 04:53:52 +0000 (04:53 +0000)
committernethack.rankin <nethack.rankin>
Thu, 7 Jul 2005 04:53:52 +0000 (04:53 +0000)
     Fix the reported bug about an inappropriate space in the message
  "For you, scum ; only N zorkmids for that foo."
when an angry shopkeeper quotes a price for an item which has just been
picked up.  Also, suppress "only" in that case; just include it when the shk
isn't angry.  And the word "zorkmids" was actually missing, so I added it.
I think the semi-colon should actually be a comma, but I've left that as is.

doc/fixes34.4
src/shk.c

index 268a38144305aa61529857dc4de6bf2ccf5794ba..cd3fd9081063b69192c650784849ad24bb22bac3 100644 (file)
@@ -133,6 +133,7 @@ protect hero from mind flayer's remote mental blast during successful prayer
 recognize if hero has already entered Gehennom by means other than usual route
        so that prompt can be skipped if Valley's stairs are subsequently used
 once you've passed the Valley, drawbridge tune is no longer a prayer reward
+fix up grammar and punctuation in variants of shopkeeper's price message
 
 
 Platform- and/or Interface-Specific Fixes
index 11cb465a744cf41c43960ace63c8bc01445d9a46..1792cdeb29feb608c58841dde3b0b38c2b128c8c 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)shk.c      3.5     2005/03/26      */
+/*     SCCS Id: @(#)shk.c      3.5     2005/07/06      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -2245,28 +2245,35 @@ boolean ininv, dummy, silent;
                                             the(xname(obj)));
                return;
            }
-           Strcpy(buf, "\"For you, ");
-           if (ANGRY(shkp)) Strcat(buf, "scum ");
-           else {
-               static const char *honored[5] = {
-                 "good", "honored", "most gracious", "esteemed",
-                 "most renowned and sacred"
+           if (!ininv) {
+               pline("%s will cost you %ld %s%s.",
+                     The(xname(obj)), ltmp, currency(ltmp),
+                     (obj->quan > 1L) ? " each" : "");
+           } else {
+               /* (chooses among [0]..[3] normally; [1]..[4] after the
+                  Wizard has been killed or invocation ritual performed) */
+               static const char * const honored[] = {
+                   "good", "honored", "most gracious", "esteemed",
+                   "most renowned and sacred"
                };
-               Strcat(buf, honored[rn2(4) + u.uevent.udemigod]);
-               if (!is_human(youmonst.data)) Strcat(buf, " creature");
-               else
-                   Strcat(buf, (flags.female) ? " lady" : " sir");
-           }
-           if(ininv) {
-               long quan = obj->quan;
+               long save_quan = obj->quan;
+
+               Strcpy(buf, "\"For you, ");
+               if (ANGRY(shkp)) {
+                   Strcat(buf, "scum;");
+               } else {
+                   int idx = rn2(SIZE(honored) - 1) + u.uevent.udemigod;
+
+                   Strcat(buf, honored[idx]);
+                   Strcat(buf, !is_human(youmonst.data) ? " creature" :
+                               (flags.female) ? " lady" : " sir");
+                   Strcat(buf, "; only");
+               }
                obj->quan = 1L; /* fool xname() into giving singular */
-               pline("%s; only %ld %s %s.\"", buf, ltmp,
-                       (quan > 1L) ? "per" : "for this", xname(obj));
-               obj->quan = quan;
-           } else
-               pline("%s will cost you %ld %s%s.",
-                       The(xname(obj)), ltmp, currency(ltmp),
-                       (obj->quan > 1L) ? " each" : "");
+               pline("%s %ld %s %s %s.\"", buf, ltmp, currency(ltmp),
+                     (save_quan > 1L) ? "per" : "for this", xname(obj));
+               obj->quan = save_quan;
+           }
        } else if(!silent) {
            if(ltmp) pline_The("list price of %s is %ld %s%s.",
                                   the(xname(obj)), ltmp, currency(ltmp),