]> granicus.if.org Git - nethack/commitdiff
touchstone use
authornethack.rankin <nethack.rankin>
Tue, 1 Oct 2002 07:23:10 +0000 (07:23 +0000)
committernethack.rankin <nethack.rankin>
Tue, 1 Oct 2002 07:23:10 +0000 (07:23 +0000)
     Make touchstones more convenient to use after they're identified
by only listing unknown gems as likely candidates.  This doesn't prevent
other stuff from being rubbed on them, just alters the prompt string and
the subset of inventory shown for '?'.

doc/fixes34.1
src/apply.c
src/invent.c

index 02ada2286aca846c8cb695b327157913b24c0a29..26e614b8de3fc6ebe26ad5da61c1cfc1e25f3b3f 100644 (file)
@@ -260,6 +260,7 @@ can no longer activate a figurine while engulfed
 can't use figurines to get too many erinyes or Nazgul
 include currently wielded weapon among the list of likely choices for 'w'
 likewise for currently quivered ammo among choices for 'Q'
+only include unknown gems as likely choices when applying known touchstone
 prevent mbodypart() from returning animal parts for lights
 removing a ring might relearn what it is after amnesia
 
index 0a277339a861f7a75ec68d10003e10a89d1b4d26..2b6ec335f3834e01b131b170338c667117535261 100644 (file)
@@ -1846,16 +1846,23 @@ struct obj *tstone;
 {
     struct obj *obj;
     boolean do_scratch;
-    const char *streak_color;
+    const char *streak_color, *choices;
     char stonebuf[QBUFSZ];
     static const char scritch[] = "\"scritch, scritch\"";
     static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
+    static const char justgems[3] = { ALLOW_NONE, GEM_CLASS, 0 };
 #ifndef GOLDOBJ
     struct obj goldobj;
 #endif
 
+    /* in case it was acquired while blinded */
+    if (!Blind) tstone->dknown = 1;
+    /* when the touchstone is fully known, don't bother listing extra
+       junk as likely candidates for rubbing */
+    choices = (tstone->otyp == TOUCHSTONE && tstone->dknown &&
+               objects[TOUCHSTONE].oc_name_known) ? justgems : allowall;
     Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan));
-    if ((obj = getobj(allowall, stonebuf)) == 0)
+    if ((obj = getobj(choices, stonebuf)) == 0)
        return;
 #ifndef GOLDOBJ
     if (obj->oclass == COIN_CLASS) {
index bf0a58c5e8cf37b0cdc875ef25d5e85c866e089f..b759667094ca3c12f4db2f0bae887db149b3a458 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)invent.c   3.4     2002/09/16      */
+/*     SCCS Id: @(#)invent.c   3.4     2002/09/30      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -863,6 +863,9 @@ register const char *let,*word;
                      otyp != OIL_LAMP && otyp != MAGIC_LAMP &&
                      otyp != BRASS_LANTERN) ||
                     (otmp->oclass == GEM_CLASS && !is_graystone(otmp))))
+               || (!strncmp(word, "rub on the stone", 16) &&
+                   *let == GEM_CLASS &&        /* using known touchstone */
+                   otmp->dknown && objects[otyp].oc_name_known)
                || ((!strcmp(word, "use or apply") ||
                        !strcmp(word, "untrap with")) &&
                     /* Picks, axes, pole-weapons, bullwhips */