touchstone use

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 '?'.
This commit is contained in:
nethack.rankin
2002-10-01 07:23:10 +00:00
parent db9f82bed4
commit c3a9637ba7
3 changed files with 14 additions and 3 deletions

View 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

View 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) {

View 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 */