change is_greystone() to is_graystone()

-Rename is_greystone() to is_graystone() since I've
had one complaint about my choice of spelling for
the macro already.

-Change the recent "#rub touchstone" code to use
the macro which pre-existed under the other spelling
and was already used in the very same "if" statement
with that spelling in invent.c. :-)
This commit is contained in:
nethack.allison
2002-02-24 17:23:02 +00:00
parent f9244b56ad
commit 490ceaee6c
3 changed files with 9 additions and 12 deletions

View File

@@ -217,7 +217,7 @@ struct obj {
#define MAX_OIL_IN_FLASK 400 /* maximum amount of oil in a potion of oil */
/* special stones */
#define is_greystone(obj) ((obj)->otyp == LUCKSTONE || \
#define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \
(obj)->otyp == LOADSTONE || \
(obj)->otyp == FLINT || \
(obj)->otyp == TOUCHSTONE)

View File

@@ -38,7 +38,7 @@ STATIC_DCL int FDECL(use_grapple, (struct obj *));
STATIC_DCL int FDECL(do_break_wand, (struct obj *));
STATIC_DCL boolean FDECL(figurine_location_checks,
(struct obj *, coord *, BOOLEAN_P));
STATIC_DCL boolean NDECL(uhave_greystone);
STATIC_DCL boolean NDECL(uhave_graystone);
#ifdef AMIGA
void FDECL( amii_speaker, ( struct obj *, char *, int ) );
@@ -1154,8 +1154,7 @@ dorub()
struct obj *obj = getobj(cuddly, "rub");
if (obj && obj->oclass == GEM_CLASS) {
if (obj->otyp == FLINT || obj->otyp == LUCKSTONE ||
obj->otyp == LOADSTONE || obj->otyp == TOUCHSTONE) {
if (is_graystone(obj)) {
use_stone(obj);
return 1;
} else {
@@ -1826,7 +1825,7 @@ struct obj *otmp;
material = objects[obj->otyp].oc_material;
if (otmp->cursed &&
obj->oclass == GEM_CLASS && !is_greystone(obj) && !rn2(5)) {
obj->oclass == GEM_CLASS && !is_graystone(obj) && !rn2(5)) {
pline(
(Blind ? "You feel something shatter." :
(Hallucination ? "Oh, wow, look at the pretty shards." :
@@ -2571,12 +2570,12 @@ do_break_wand(obj)
}
STATIC_OVL boolean
uhave_greystone()
uhave_graystone()
{
register struct obj *otmp;
for(otmp = invent; otmp; otmp = otmp->nobj)
if(is_greystone(otmp))
if(is_graystone(otmp))
return TRUE;
return FALSE;
}
@@ -2588,7 +2587,7 @@ doapply()
register int res = 1;
if(check_capacity((char *)0)) return (0);
obj = getobj(carrying(POT_OIL) || uhave_greystone()
obj = getobj(carrying(POT_OIL) || uhave_graystone()
? tools_too : tools, "use or apply");
if(!obj) return 0;

View File

@@ -838,9 +838,7 @@ register const char *let,*word;
((otmp->oclass == TOOL_CLASS &&
otyp != OIL_LAMP && otyp != MAGIC_LAMP &&
otyp != BRASS_LANTERN) ||
(otmp->oclass == GEM_CLASS &&
otyp != LUCKSTONE && otyp != LOADSTONE &&
otyp != TOUCHSTONE && otyp != FLINT)))
(otmp->oclass == GEM_CLASS && !is_graystone(otmp))))
|| ((!strcmp(word, "use or apply") ||
!strcmp(word, "untrap with")) &&
/* Picks, axes, pole-weapons, bullwhips */
@@ -851,7 +849,7 @@ register const char *let,*word;
be offered as a choice when already discovered */
(otyp != POT_OIL || !otmp->dknown ||
!objects[POT_OIL].oc_name_known))
|| (otmp->oclass == GEM_CLASS && !is_greystone(otmp))))
|| (otmp->oclass == GEM_CLASS && !is_graystone(otmp))))
|| (!strcmp(word, "invoke") &&
(!otmp->oartifact && !objects[otyp].oc_unique &&
(otyp != FAKE_AMULET_OF_YENDOR || otmp->known) &&