Some touchstone tuning...

If you have an unidentified gray stone in your pack,
you just had to use the 'a'pply command.  If it was
a touchstone, it would be included in the list,
otherwise it wouldn't.

This allows any stone to be included in the 'a'pply
command.

Also, adds missing punctuation to the use_stone()
messages.

Also prevents rubbing a stone on itself.
This commit is contained in:
nethack.allison
2002-01-18 19:00:09 +00:00
parent 7f41cece3b
commit c20a6f89f1
+31 -8
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)apply.c 3.3 2001/11/28 */ /* SCCS Id: @(#)apply.c 3.3 2002/01/18 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -37,6 +37,7 @@ STATIC_DCL int FDECL(use_grapple, (struct obj *));
STATIC_DCL int FDECL(do_break_wand, (struct obj *)); STATIC_DCL int FDECL(do_break_wand, (struct obj *));
STATIC_DCL boolean FDECL(figurine_location_checks, STATIC_DCL boolean FDECL(figurine_location_checks,
(struct obj *, coord *, BOOLEAN_P)); (struct obj *, coord *, BOOLEAN_P));
STATIC_DCL boolean NDECL(uhave_greystone);
#ifdef AMIGA #ifdef AMIGA
void FDECL( amii_speaker, ( struct obj *, char *, int ) ); void FDECL( amii_speaker, ( struct obj *, char *, int ) );
@@ -1771,18 +1772,24 @@ struct obj *otmp;
struct obj *obj; struct obj *obj;
char allowall[2]; char allowall[2];
const char *color = 0; const char *color = 0;
static const char *ambiguous = "You make scratch marks on the stone"; static const char *ambiguous = "You make scratch marks on the stone.";
const char *scritch = "\"scritch, scritch\"";
allowall[0] = ALL_CLASSES; allowall[0] = ALL_CLASSES;
allowall[1] = '\0'; allowall[1] = '\0';
if (!(obj = getobj(allowall, "rub on the stone"))) if (!(obj = getobj(allowall, "rub on the stone")))
return; return;
if (otmp == obj) {
You_cant("rub %s on itself.", the(xname(obj)));
return;
}
if (otmp->cursed && obj->oclass == GEM_CLASS && rnd(5) == 1) { if (otmp->cursed && obj->oclass == GEM_CLASS && rnd(5) == 1) {
pline( pline(
(Blind ? "You feel something shatter" : (Blind ? "You feel something shatter" :
(Hallucination ? "Oh, wow, look at the pretty shards" : (Hallucination ? "Oh, wow, look at the pretty shards." :
"A sharp crack shatters %s %s")), "A sharp crack shatters %s %s.")),
(obj->quan == 1 ? "the" : "a"), (obj->quan == 1 ? "the" : "a"),
lcase(makesingular(let_to_name(obj->oclass, FALSE)))); lcase(makesingular(let_to_name(obj->oclass, FALSE))));
useup(obj); useup(obj);
@@ -1790,7 +1797,7 @@ struct obj *otmp;
} }
if (Blind) { if (Blind) {
pline("\"scritch, scritch\""); pline(scritch);
return; return;
} }
@@ -1824,10 +1831,10 @@ struct obj *otmp;
color = c_obj_colors[objects[obj->otyp].oc_color]; color = c_obj_colors[objects[obj->otyp].oc_color];
break; break;
default: default:
pline("\"scritch, scritch\""); pline(scritch);
return; return;
} }
pline("You see %s streaks on the stone", color); pline("You see %s streaks on the stone.", color);
return; return;
} }
@@ -2479,6 +2486,19 @@ do_break_wand(obj)
return 1; return 1;
} }
boolean uhave_greystone()
{
register struct obj *otmp;
for(otmp = invent; otmp; otmp = otmp->nobj)
if(otmp->otyp == LOADSTONE ||
otmp->otyp == FLINT ||
otmp->otyp == LUCKSTONE ||
otmp->otyp == TOUCHSTONE)
return TRUE;
return FALSE;
}
int int
doapply() doapply()
{ {
@@ -2486,7 +2506,7 @@ doapply()
register int res = 1; register int res = 1;
if(check_capacity((char *)0)) return (0); if(check_capacity((char *)0)) return (0);
obj = getobj(carrying(POT_OIL) || carrying(TOUCHSTONE) obj = getobj(carrying(POT_OIL) || uhave_greystone()
? tools_too : tools, "use or apply"); ? tools_too : tools, "use or apply");
if(!obj) return 0; if(!obj) return 0;
@@ -2671,6 +2691,9 @@ doapply()
case BEARTRAP: case BEARTRAP:
use_trap(obj); use_trap(obj);
break; break;
case FLINT:
case LUCKSTONE:
case LOADSTONE:
case TOUCHSTONE: case TOUCHSTONE:
use_stone(obj); use_stone(obj);
break; break;