simplify touchstone object choosing
- remove special case code from getobj for touchstone - remove other hacks from getobj that resulted from earlier hack, solves the "rub on the gold stone" problem completely - pass correct letter list to getobj from use_stone, like other callers
This commit is contained in:
+4
-3
@@ -1808,14 +1808,15 @@ use_stone(otmp)
|
|||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
{
|
{
|
||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
char allowall[2];
|
char allowall[3];
|
||||||
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\"";
|
const char *scritch = "\"scritch, scritch\"";
|
||||||
unsigned material;
|
unsigned material;
|
||||||
|
|
||||||
allowall[0] = ALL_CLASSES;
|
allowall[0] = GOLD_CLASS;
|
||||||
allowall[1] = '\0';
|
allowall[1] = ALL_CLASSES;
|
||||||
|
allowall[2] = '\0';
|
||||||
if (!(obj = getobj(allowall, "rub on the stone")))
|
if (!(obj = getobj(allowall, "rub on the stone")))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
+1
-14
@@ -733,7 +733,6 @@ register const char *let,*word;
|
|||||||
boolean usegold = FALSE; /* can't use gold because its illegal */
|
boolean usegold = FALSE; /* can't use gold because its illegal */
|
||||||
boolean allowall = FALSE;
|
boolean allowall = FALSE;
|
||||||
boolean allownone = FALSE;
|
boolean allownone = FALSE;
|
||||||
boolean touchstone = FALSE;
|
|
||||||
xchar foox = 0;
|
xchar foox = 0;
|
||||||
long cnt;
|
long cnt;
|
||||||
boolean prezero = FALSE;
|
boolean prezero = FALSE;
|
||||||
@@ -746,15 +745,6 @@ register const char *let,*word;
|
|||||||
#else
|
#else
|
||||||
if(*let == GOLD_CLASS) let++, usegold = TRUE;
|
if(*let == GOLD_CLASS) let++, usegold = TRUE;
|
||||||
#endif
|
#endif
|
||||||
/* Ugly check for touchstone */
|
|
||||||
if (!strncmp(word, "rub on", 6)) {
|
|
||||||
touchstone = TRUE; /* avoid silly "stone gold" */
|
|
||||||
#ifndef GOLDOBJ
|
|
||||||
if(u.ugold) allowgold = usegold = TRUE;
|
|
||||||
#else
|
|
||||||
usegold = TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Equivalent of an "ugly check" for gold */
|
/* Equivalent of an "ugly check" for gold */
|
||||||
if (usegold && !strcmp(word, "eat") && !metallivorous(youmonst.data))
|
if (usegold && !strcmp(word, "eat") && !metallivorous(youmonst.data))
|
||||||
@@ -939,10 +929,7 @@ register const char *let,*word;
|
|||||||
}
|
}
|
||||||
if(ilet == def_oc_syms[GOLD_CLASS]) {
|
if(ilet == def_oc_syms[GOLD_CLASS]) {
|
||||||
if (!usegold) {
|
if (!usegold) {
|
||||||
if (touchstone)
|
You("cannot %s gold.", word);
|
||||||
You("cannot rub gold on the stone.");
|
|
||||||
else
|
|
||||||
You("cannot %s gold.", word);
|
|
||||||
return(struct obj *)0;
|
return(struct obj *)0;
|
||||||
#ifndef GOLDOBJ
|
#ifndef GOLDOBJ
|
||||||
} else if (!allowgold) {
|
} else if (!allowgold) {
|
||||||
|
|||||||
Reference in New Issue
Block a user