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
+1 -1
View File
@@ -217,7 +217,7 @@ struct obj {
#define MAX_OIL_IN_FLASK 400 /* maximum amount of oil in a potion of oil */ #define MAX_OIL_IN_FLASK 400 /* maximum amount of oil in a potion of oil */
/* special stones */ /* special stones */
#define is_greystone(obj) ((obj)->otyp == LUCKSTONE || \ #define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \
(obj)->otyp == LOADSTONE || \ (obj)->otyp == LOADSTONE || \
(obj)->otyp == FLINT || \ (obj)->otyp == FLINT || \
(obj)->otyp == TOUCHSTONE) (obj)->otyp == TOUCHSTONE)
+6 -7
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 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); STATIC_DCL boolean NDECL(uhave_graystone);
#ifdef AMIGA #ifdef AMIGA
void FDECL( amii_speaker, ( struct obj *, char *, int ) ); void FDECL( amii_speaker, ( struct obj *, char *, int ) );
@@ -1154,8 +1154,7 @@ dorub()
struct obj *obj = getobj(cuddly, "rub"); struct obj *obj = getobj(cuddly, "rub");
if (obj && obj->oclass == GEM_CLASS) { if (obj && obj->oclass == GEM_CLASS) {
if (obj->otyp == FLINT || obj->otyp == LUCKSTONE || if (is_graystone(obj)) {
obj->otyp == LOADSTONE || obj->otyp == TOUCHSTONE) {
use_stone(obj); use_stone(obj);
return 1; return 1;
} else { } else {
@@ -1826,7 +1825,7 @@ struct obj *otmp;
material = objects[obj->otyp].oc_material; material = objects[obj->otyp].oc_material;
if (otmp->cursed && if (otmp->cursed &&
obj->oclass == GEM_CLASS && !is_greystone(obj) && !rn2(5)) { obj->oclass == GEM_CLASS && !is_graystone(obj) && !rn2(5)) {
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." :
@@ -2571,12 +2570,12 @@ do_break_wand(obj)
} }
STATIC_OVL boolean STATIC_OVL boolean
uhave_greystone() uhave_graystone()
{ {
register struct obj *otmp; register struct obj *otmp;
for(otmp = invent; otmp; otmp = otmp->nobj) for(otmp = invent; otmp; otmp = otmp->nobj)
if(is_greystone(otmp)) if(is_graystone(otmp))
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
@@ -2588,7 +2587,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) || uhave_greystone() obj = getobj(carrying(POT_OIL) || uhave_graystone()
? tools_too : tools, "use or apply"); ? tools_too : tools, "use or apply");
if(!obj) return 0; if(!obj) return 0;
+2 -4
View File
@@ -838,9 +838,7 @@ register const char *let,*word;
((otmp->oclass == TOOL_CLASS && ((otmp->oclass == TOOL_CLASS &&
otyp != OIL_LAMP && otyp != MAGIC_LAMP && otyp != OIL_LAMP && otyp != MAGIC_LAMP &&
otyp != BRASS_LANTERN) || otyp != BRASS_LANTERN) ||
(otmp->oclass == GEM_CLASS && (otmp->oclass == GEM_CLASS && !is_graystone(otmp))))
otyp != LUCKSTONE && otyp != LOADSTONE &&
otyp != TOUCHSTONE && otyp != FLINT)))
|| ((!strcmp(word, "use or apply") || || ((!strcmp(word, "use or apply") ||
!strcmp(word, "untrap with")) && !strcmp(word, "untrap with")) &&
/* Picks, axes, pole-weapons, bullwhips */ /* Picks, axes, pole-weapons, bullwhips */
@@ -851,7 +849,7 @@ register const char *let,*word;
be offered as a choice when already discovered */ be offered as a choice when already discovered */
(otyp != POT_OIL || !otmp->dknown || (otyp != POT_OIL || !otmp->dknown ||
!objects[POT_OIL].oc_name_known)) !objects[POT_OIL].oc_name_known))
|| (otmp->oclass == GEM_CLASS && !is_greystone(otmp)))) || (otmp->oclass == GEM_CLASS && !is_graystone(otmp))))
|| (!strcmp(word, "invoke") && || (!strcmp(word, "invoke") &&
(!otmp->oartifact && !objects[otyp].oc_unique && (!otmp->oartifact && !objects[otyp].oc_unique &&
(otyp != FAKE_AMULET_OF_YENDOR || otmp->known) && (otyp != FAKE_AMULET_OF_YENDOR || otmp->known) &&