change GOLD_CLASS to COIN_CLASS

This commit is contained in:
nethack.allison
2002-07-08 23:25:53 +00:00
parent 1c6535a655
commit 40940991bb
31 changed files with 115 additions and 115 deletions

View File

@@ -1837,7 +1837,7 @@ struct obj *tstone;
const char *streak_color;
char stonebuf[QBUFSZ];
static const char scritch[] = "\"scritch, scritch\"";
static char allowall[3] = { GOLD_CLASS, ALL_CLASSES, 0 };
static char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
#ifndef GOLDOBJ
struct obj goldobj;
#endif
@@ -1846,7 +1846,7 @@ struct obj *tstone;
if ((obj = getobj(allowall, stonebuf)) == 0)
return;
#ifndef GOLDOBJ
if (obj->oclass == GOLD_CLASS) {
if (obj->oclass == COIN_CLASS) {
u.ugold += obj->quan; /* keep botl up to date */
goldobj = *obj;
dealloc_obj(obj);

View File

@@ -254,7 +254,7 @@ bot2()
if(hp < 0) hp = 0;
(void) describe_level(newbot2);
Sprintf(nb = eos(newbot2),
"%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[GOLD_CLASS],
"%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS],
#ifndef GOLDOBJ
u.ugold,
#else

View File

@@ -115,7 +115,7 @@ unsigned material;
/* didn't find it; perhaps a monster is carrying it */
#ifndef GOLDOBJ
if ((mtmp = m_at(x,y)) != 0) {
if (oclass == GOLD_CLASS && mtmp->mgold)
if (oclass == COIN_CLASS && mtmp->mgold)
return FALSE;
else for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
if (o_in(otmp, oclass)) return FALSE;
@@ -169,7 +169,7 @@ register struct obj *sobj;
struct obj *temp;
boolean stale;
known = stale = clear_stale_map(GOLD_CLASS,
known = stale = clear_stale_map(COIN_CLASS,
(unsigned)(sobj->blessed ? GOLD : 0));
/* look for gold carried by monsters (might be in a container) */
@@ -186,7 +186,7 @@ register struct obj *sobj;
if (sobj->blessed && o_material(obj, GOLD)) {
known = TRUE;
goto outgoldmap;
} else if (o_in(obj, GOLD_CLASS)) {
} else if (o_in(obj, COIN_CLASS)) {
known = TRUE;
goto outgoldmap; /* skip further searching */
}
@@ -197,7 +197,7 @@ register struct obj *sobj;
if (sobj->blessed && o_material(obj, GOLD)) {
known = TRUE;
if (obj->ox != u.ux || obj->oy != u.uy) goto outgoldmap;
} else if (o_in(obj, GOLD_CLASS)) {
} else if (o_in(obj, COIN_CLASS)) {
known = TRUE;
if (obj->ox != u.ux || obj->oy != u.uy) goto outgoldmap;
}
@@ -242,7 +242,7 @@ outgoldmap:
temp->oy = obj->oy;
}
map_object(temp,1);
} else if ((temp = o_in(obj, GOLD_CLASS))) {
} else if ((temp = o_in(obj, COIN_CLASS))) {
if (temp != obj) {
temp->ox = obj->ox;
temp->oy = obj->oy;
@@ -269,7 +269,7 @@ outgoldmap:
temp->oy = mtmp->my;
map_object(temp,1);
break;
} else if ((temp = o_in(obj, GOLD_CLASS))) {
} else if ((temp = o_in(obj, COIN_CLASS))) {
temp->ox = mtmp->mx;
temp->oy = mtmp->my;
map_object(temp,1);
@@ -448,9 +448,9 @@ int class; /* an object class, 0 for all */
if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT &&
(!class || class == objects[mtmp->mappearance].oc_class)) ||
#ifndef GOLDOBJ
(mtmp->mgold && (!class || class == GOLD_CLASS))) {
(mtmp->mgold && (!class || class == COIN_CLASS))) {
#else
(findgold(mtmp->minvent) && (!class || class == GOLD_CLASS))) {
(findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) {
#endif
ct++;
break;
@@ -530,9 +530,9 @@ int class; /* an object class, 0 for all */
temp.corpsenm = PM_TENGU; /* if mimicing a corpse */
map_object(&temp, 1);
#ifndef GOLDOBJ
} else if (mtmp->mgold && (!class || class == GOLD_CLASS)) {
} else if (mtmp->mgold && (!class || class == COIN_CLASS)) {
#else
} else if (findgold(mtmp->minvent) && (!class || class == GOLD_CLASS)) {
} else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) {
#endif
struct obj gold;

View File

@@ -42,7 +42,7 @@ STATIC_DCL void NDECL(final_level);
#ifdef OVLB
static NEARDATA const char drop_types[] =
{ ALLOW_COUNT, GOLD_CLASS, ALL_CLASSES, 0 };
{ ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, 0 };
/* 'd' command: drop one inventory item */
int
@@ -224,7 +224,7 @@ doaltarobj(obj) /* obj is an object dropped on an altar */
/* KMH, conduct */
u.uconduct.gnostic++;
if ((obj->blessed || obj->cursed) && obj->oclass != GOLD_CLASS) {
if ((obj->blessed || obj->cursed) && obj->oclass != COIN_CLASS) {
There("is %s flash as %s %s the altar.",
an(hcolor(obj->blessed ? amber : Black)),
doname(obj), otense(obj, "hit"));
@@ -484,10 +484,10 @@ register struct obj *obj;
if (!can_reach_floor()) {
if(flags.verbose) You("drop %s.", doname(obj));
#ifndef GOLDOBJ
if (obj->oclass != GOLD_CLASS || obj == invent) freeinv(obj);
if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
#else
/* Ensure update when we drop gold objects */
if (obj->oclass == GOLD_CLASS) flags.botl = 1;
if (obj->oclass == COIN_CLASS) flags.botl = 1;
freeinv(obj);
#endif
hitfloor(obj);
@@ -509,10 +509,10 @@ dropx(obj)
register struct obj *obj;
{
#ifndef GOLDOBJ
if (obj->oclass != GOLD_CLASS || obj == invent) freeinv(obj);
if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
#else
/* Ensure update when we drop gold objects */
if (obj->oclass == GOLD_CLASS) flags.botl = 1;
if (obj->oclass == COIN_CLASS) flags.botl = 1;
freeinv(obj);
#endif
if (!u.uswallow && ship_object(obj, u.ux, u.uy, FALSE)) return;
@@ -671,7 +671,7 @@ int retry;
if (cnt < otmp->quan && !welded(otmp) &&
(!otmp->cursed || otmp->otyp != LOADSTONE)) {
#ifndef GOLDOBJ
if (otmp->oclass == GOLD_CLASS)
if (otmp->oclass == COIN_CLASS)
(void) splitobj(otmp, otmp->quan - cnt);
else
#endif
@@ -685,7 +685,7 @@ int retry;
drop_done:
#ifndef GOLDOBJ
if (u_gold && invent && invent->oclass == GOLD_CLASS) {
if (u_gold && invent && invent->oclass == COIN_CLASS) {
/* didn't drop [all of] it */
u_gold = invent;
invent = u_gold->nobj;

View File

@@ -100,7 +100,7 @@ struct obj *obj;
mtmp->meating = eaten_stat(mtmp->meating, obj);
nutrit = eaten_stat(nutrit, obj);
}
} else if (obj->oclass == GOLD_CLASS) {
} else if (obj->oclass == COIN_CLASS) {
mtmp->meating = (int)(obj->quan/2000) + 1;
if (mtmp->meating < 0) mtmp->meating = 1;
nutrit = (int)(obj->quan/20);

View File

@@ -507,7 +507,7 @@ xchar x, y;
return(1);
}
isgold = (kickobj->oclass == GOLD_CLASS);
isgold = (kickobj->oclass == COIN_CLASS);
/* too heavy to move. range is calculated as potential distance from
* player, so range == 2 means the object may move up to one square
@@ -1160,7 +1160,7 @@ xchar x, y, dlev;
/* set obj->no_charge to 0 */
if (Has_contents(obj))
picked_container(obj); /* does the right thing */
if (obj->oclass != GOLD_CLASS)
if (obj->oclass != COIN_CLASS)
obj->no_charge = 0;
}
@@ -1281,7 +1281,7 @@ boolean shop_floor_obj;
/* set otmp->no_charge to 0 */
if(container)
picked_container(otmp); /* happens to do the right thing */
if(otmp->oclass != GOLD_CLASS)
if(otmp->oclass != COIN_CLASS)
otmp->no_charge = 0;
}

View File

@@ -21,10 +21,10 @@ STATIC_DCL boolean FDECL(mhurtle_step, (genericptr_t,int,int));
static NEARDATA const char toss_objs[] =
{ ALLOW_COUNT, GOLD_CLASS, ALL_CLASSES, WEAPON_CLASS, 0 };
{ ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, WEAPON_CLASS, 0 };
/* different default choices when wielding a sling (gold must be included) */
static NEARDATA const char bullets[] =
{ ALLOW_COUNT, GOLD_CLASS, ALL_CLASSES, GEM_CLASS, 0 };
{ ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, GEM_CLASS, 0 };
extern boolean notonhead; /* for long worms */
@@ -44,7 +44,7 @@ int shotlimit;
/* ask "in what direction?" */
#ifndef GOLDOBJ
if (!getdir((char *)0)) {
if (obj->oclass == GOLD_CLASS) {
if (obj->oclass == COIN_CLASS) {
u.ugold += obj->quan;
flags.botl = 1;
dealloc_obj(obj);
@@ -52,7 +52,7 @@ int shotlimit;
return(0);
}
if(obj->oclass == GOLD_CLASS) return(throw_gold(obj));
if(obj->oclass == COIN_CLASS) return(throw_gold(obj));
#else
if (!getdir((char *)0)) {
/* obj might need to be merged back into the singular gold object */
@@ -69,7 +69,7 @@ int shotlimit;
If the money is in quiver, throw one coin at a time,
possibly using a sling.
*/
if(obj->oclass == GOLD_CLASS && obj != uquiver) return(throw_gold(obj));
if(obj->oclass == COIN_CLASS && obj != uquiver) return(throw_gold(obj));
#endif
if(!canletgo(obj,"throw"))

View File

@@ -70,7 +70,7 @@ STATIC_OVL NEARDATA const char comestibles[] = { FOOD_CLASS, 0 };
/* Gold must come first for getobj(). */
STATIC_OVL NEARDATA const char allobj[] = {
GOLD_CLASS, WEAPON_CLASS, ARMOR_CLASS, POTION_CLASS, SCROLL_CLASS,
COIN_CLASS, WEAPON_CLASS, ARMOR_CLASS, POTION_CLASS, SCROLL_CLASS,
WAND_CLASS, RING_CLASS, AMULET_CLASS, FOOD_CLASS, TOOL_CLASS,
GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, SPBOOK_CLASS, 0 };
@@ -253,7 +253,7 @@ choke(food) /* To a full belly all food is bad. (It.) */
*/
if(food) {
You("choke over your %s.", foodword(food));
if (food->oclass == GOLD_CLASS) {
if (food->oclass == COIN_CLASS) {
killer = "a very rich meal";
} else {
killer = food_xname(food, FALSE);
@@ -1515,7 +1515,7 @@ eatspecial() /* called after eating non-food */
lesshungry(victual.nmod);
victual.piece = (struct obj *)0;
victual.eating = 0;
if (otmp->oclass == GOLD_CLASS) {
if (otmp->oclass == COIN_CLASS) {
#ifdef GOLDOBJ
if (carried(otmp))
useupall(otmp);
@@ -1854,7 +1854,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
victual.canchoke = (u.uhs == SATIATED);
/* Note: gold weighs 1 pt. for each 1000 pieces (see */
/* pickup.c) so gold and non-gold is consistent. */
if (otmp->oclass == GOLD_CLASS)
if (otmp->oclass == COIN_CLASS)
basenutrit = ((otmp->quan > 200000L) ? 2000
: (int)(otmp->quan/100L));
else if(otmp->oclass == BALL_CLASS || otmp->oclass == CHAIN_CLASS)
@@ -1885,7 +1885,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
You("seem unaffected by the poison.");
} else if (!otmp->cursed)
pline("This %s is delicious!",
otmp->oclass == GOLD_CLASS ? foodword(otmp) :
otmp->oclass == COIN_CLASS ? foodword(otmp) :
singular(otmp, xname));
eatspecial();
@@ -2366,7 +2366,7 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */
for (otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) {
if(corpsecheck ?
(otmp->otyp==CORPSE && (corpsecheck == 1 || tinnable(otmp))) :
feeding ? (otmp->oclass != GOLD_CLASS && is_edible(otmp)) :
feeding ? (otmp->oclass != COIN_CLASS && is_edible(otmp)) :
otmp->oclass==FOOD_CLASS) {
Sprintf(qbuf, "There %s %s here; %s %s?",
otense(otmp, "are"),

View File

@@ -546,7 +546,7 @@ doengrave()
case AMULET_CLASS:
case CHAIN_CLASS:
case POTION_CLASS:
case GOLD_CLASS:
case COIN_CLASS:
break;
case RING_CLASS:

View File

@@ -455,7 +455,7 @@ register struct obj *obj;
if (money > 10) {
/* Amount to loose. Might get rounded up as fountains don't pay change... */
money = somegold(money) / 10;
for (otmp = invent; otmp && money > 0; otmp = otmp->nobj) if (otmp->oclass == GOLD_CLASS) {
for (otmp = invent; otmp && money > 0; otmp = otmp->nobj) if (otmp->oclass == COIN_CLASS) {
int denomination = objects[otmp->otyp].oc_cost;
long coin_loss = (money + denomination - 1) / denomination;
coin_loss = min(coin_loss, otmp->quan);

View File

@@ -2088,14 +2088,14 @@ inv_weight()
of invent for easier manipulation by askchain & co, but it's also
retained in u.ugold in order to keep the status line accurate; we
mustn't add its weight in twice under that circumstance */
wt = (otmp && otmp->oclass == GOLD_CLASS) ? 0 :
wt = (otmp && otmp->oclass == COIN_CLASS) ? 0 :
(int)((u.ugold + 50L) / 100L);
#endif
while (otmp) {
#ifndef GOLDOBJ
if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data))
#else
if (otmp->oclass == GOLD_CLASS)
if (otmp->oclass == COIN_CLASS)
wt += (int)(((long)otmp->quan + 50L) / 100L);
else if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data))
#endif
@@ -2176,7 +2176,7 @@ struct obj *otmp;
{
while(otmp) {
/* Must change when silver & copper is implemented: */
if (otmp->oclass == GOLD_CLASS) return otmp->quan;
if (otmp->oclass == COIN_CLASS) return otmp->quan;
otmp = otmp->nobj;
}
return 0;

View File

@@ -55,7 +55,7 @@ register struct obj *otmp;
#ifdef GOLDOBJ
/* There is only one of these in inventory... */
if (otmp->oclass == GOLD_CLASS) {
if (otmp->oclass == COIN_CLASS) {
otmp->invlet = GOLD_SYM;
return;
}
@@ -179,7 +179,7 @@ struct obj **potmp, **pobj;
#ifdef GOLDOBJ
/* temporary special case for gold objects!!!! */
#endif
if (otmp->oclass == GOLD_CLASS) otmp->owt = weight(otmp);
if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp);
else otmp->owt += obj->owt;
if(!otmp->onamelth && obj->onamelth)
otmp = *potmp = oname(otmp, ONAME(obj));
@@ -245,7 +245,7 @@ void
addinv_core1(obj)
struct obj *obj;
{
if (obj->oclass == GOLD_CLASS) {
if (obj->oclass == COIN_CLASS) {
#ifndef GOLDOBJ
u.ugold += obj->quan;
#else
@@ -312,7 +312,7 @@ struct obj *obj;
addinv_core1(obj);
#ifndef GOLDOBJ
/* if handed gold, we're done */
if (obj->oclass == GOLD_CLASS)
if (obj->oclass == COIN_CLASS)
return obj;
#endif
@@ -484,7 +484,7 @@ void
freeinv_core(obj)
struct obj *obj;
{
if (obj->oclass == GOLD_CLASS) {
if (obj->oclass == COIN_CLASS) {
#ifndef GOLDOBJ
u.ugold -= obj->quan;
obj->in_use = FALSE;
@@ -663,7 +663,7 @@ register int x, y;
{
register struct obj *obj = level.objects[x][y];
while(obj) {
if (obj->oclass == GOLD_CLASS) return obj;
if (obj->oclass == COIN_CLASS) return obj;
obj = obj->nexthere;
}
return((struct obj *)0);
@@ -770,10 +770,10 @@ register const char *let,*word;
if(*let == ALLOW_COUNT) let++, allowcnt = 1;
#ifndef GOLDOBJ
if(*let == GOLD_CLASS) let++,
if(*let == COIN_CLASS) let++,
usegold = TRUE, allowgold = (u.ugold ? TRUE : FALSE);
#else
if(*let == GOLD_CLASS) let++, usegold = TRUE;
if(*let == COIN_CLASS) let++, usegold = TRUE;
#endif
/* Equivalent of an "ugly check" for gold */
@@ -798,7 +798,7 @@ register const char *let,*word;
if(allownone) *bp++ = '-';
#ifndef GOLDOBJ
if(allowgold) *bp++ = def_oc_syms[GOLD_CLASS];
if(allowgold) *bp++ = def_oc_syms[COIN_CLASS];
#endif
if(bp > buf && bp[-1] == '-') *bp++ = ' ';
ap = altlets;
@@ -959,7 +959,7 @@ register const char *let,*word;
if(ilet == '-') {
return(allownone ? &zeroobj : (struct obj *) 0);
}
if(ilet == def_oc_syms[GOLD_CLASS]) {
if(ilet == def_oc_syms[COIN_CLASS]) {
if (!usegold) {
You("cannot %s gold.", word);
return(struct obj *)0;
@@ -1013,7 +1013,7 @@ register const char *let,*word;
* counts for other things since the throw code will
* split off a single item anyway */
#ifdef GOLDOBJ
if (ilet != def_oc_syms[GOLD_CLASS])
if (ilet != def_oc_syms[COIN_CLASS])
#endif
allowcnt = 1;
if(cnt == 0 && prezero) return((struct obj *)0);
@@ -1048,7 +1048,7 @@ register const char *let,*word;
}
if(!allowall && let && !index(let,otmp->oclass)
#ifdef GOLDOBJ
&& !(usegold && otmp->oclass == GOLD_CLASS)
&& !(usegold && otmp->oclass == COIN_CLASS)
#endif
) {
pline(silly_thing_to, word);
@@ -1220,7 +1220,7 @@ unsigned *resultflags;
}
}
if (oc_of_sym == GOLD_CLASS && !combo) {
if (oc_of_sym == COIN_CLASS && !combo) {
#ifndef GOLDOBJ
if (allowgold == 1)
(*fn)(mkgoldobj(u.ugold));
@@ -1320,7 +1320,7 @@ register int FDECL((*fn),(OBJ_P)), FDECL((*ckfn),(OBJ_P));
*/
nextclass:
ilet = 'a'-1;
if (*objchn && (*objchn)->oclass == GOLD_CLASS)
if (*objchn && (*objchn)->oclass == COIN_CLASS)
ilet--; /* extra iteration */
for (otmp = *objchn; otmp; otmp = otmp2) {
if(ilet == 'z') ilet = 'A'; else ilet++;
@@ -1493,7 +1493,7 @@ obj_to_let(obj) /* should of course only be called for things in invent */
register struct obj *obj;
{
#ifndef GOLDOBJ
if (obj->oclass == GOLD_CLASS)
if (obj->oclass == COIN_CLASS)
return GOLD_SYM;
#endif
if (!flags.invlet_constant) {
@@ -1555,7 +1555,7 @@ long quan; /* if non-0, print this quantity, not obj->quan */
(dot && use_invlet ? obj->invlet : let),
(txt ? txt : doname(obj)), cost, currency(cost));
#ifndef GOLDOBJ
} else if (obj && obj->oclass == GOLD_CLASS) {
} else if (obj && obj->oclass == COIN_CLASS) {
Sprintf(li, "%ld gold piece%s%s", obj->quan, plur(obj->quan),
(dot ? "." : ""));
#endif
@@ -1774,20 +1774,20 @@ count_buc(list, type)
if (Role_if(PM_PRIEST)) list->bknown = TRUE;
switch(type) {
case BUC_BLESSED:
if (list->oclass != GOLD_CLASS && list->bknown && list->blessed)
if (list->oclass != COIN_CLASS && list->bknown && list->blessed)
count++;
break;
case BUC_CURSED:
if (list->oclass != GOLD_CLASS && list->bknown && list->cursed)
if (list->oclass != COIN_CLASS && list->bknown && list->cursed)
count++;
break;
case BUC_UNCURSED:
if (list->oclass != GOLD_CLASS &&
if (list->oclass != COIN_CLASS &&
list->bknown && !list->blessed && !list->cursed)
count++;
break;
case BUC_UNKNOWN:
if (list->oclass != GOLD_CLASS && !list->bknown)
if (list->oclass != COIN_CLASS && !list->bknown)
count++;
break;
default:
@@ -1995,7 +1995,7 @@ dotypeinv()
}
if (traditional) {
oclass = def_char_to_objclass(c); /* change to object class */
if (oclass == GOLD_CLASS) {
if (oclass == COIN_CLASS) {
return doprgold();
} else if (index(types, c) > index(types, '\033')) {
You("have no such objects.");
@@ -2232,7 +2232,7 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */
if (obj->otyp != otmp->otyp) return FALSE;
/* Coins of the same kind will always merge. */
if (obj->oclass == GOLD_CLASS) return TRUE;
if (obj->oclass == COIN_CLASS) return TRUE;
if (obj->unpaid != otmp->unpaid ||
#endif
@@ -2722,7 +2722,7 @@ char *title;
* gold in their inventory, so it won't merge.
*/
m_gold = zeroobj;
m_gold.otyp = GOLD_PIECE; m_gold.oclass = GOLD_CLASS;
m_gold.otyp = GOLD_PIECE; m_gold.oclass = COIN_CLASS;
m_gold.quan = mon->mgold; m_gold.dknown = 1;
m_gold.where = OBJ_FREE;
/* we had better not merge and free this object... */

View File

@@ -1601,7 +1601,7 @@ struct monst *mtmp;
static NEARDATA char syms[] = {
MAXOCLASSES, MAXOCLASSES+1, RING_CLASS, WAND_CLASS, WEAPON_CLASS,
FOOD_CLASS, GOLD_CLASS, SCROLL_CLASS, POTION_CLASS, ARMOR_CLASS,
FOOD_CLASS, COIN_CLASS, SCROLL_CLASS, POTION_CLASS, ARMOR_CLASS,
AMULET_CLASS, TOOL_CLASS, ROCK_CLASS, GEM_CLASS, SPBOOK_CLASS,
S_MIMIC_DEF, S_MIMIC_DEF, S_MIMIC_DEF,
};
@@ -1696,7 +1696,7 @@ assign_sym:
if (s_sym >= MAXOCLASSES) {
ap_type = M_AP_FURNITURE;
appear = s_sym == MAXOCLASSES ? S_upstair : S_dnstair;
} else if (s_sym == GOLD_CLASS) {
} else if (s_sym == COIN_CLASS) {
ap_type = M_AP_OBJECT;
appear = GOLD_PIECE;
} else {

View File

@@ -126,7 +126,7 @@ unsigned *ospecial;
#ifdef ROGUE_COLOR
if (HAS_ROGUE_IBM_GRAPHICS && iflags.use_color) {
switch(objects[offset].oc_class) {
case GOLD_CLASS: color = CLR_YELLOW; break;
case COIN_CLASS: color = CLR_YELLOW; break;
case FOOD_CLASS: color = CLR_RED; break;
default: color = CLR_BRIGHT_BLUE; break;
}

View File

@@ -46,7 +46,7 @@ const struct icp boxiprobs[] = {
{18, POTION_CLASS},
{18, SCROLL_CLASS},
{12, SPBOOK_CLASS},
{ 7, GOLD_CLASS},
{ 7, COIN_CLASS},
{ 6, WAND_CLASS},
{ 5, RING_CLASS},
{ 1, AMULET_CLASS}
@@ -175,7 +175,7 @@ struct obj *box;
if (!(otmp = mkobj(iprobs->iclass, TRUE))) continue;
/* handle a couple of special cases */
if (otmp->oclass == GOLD_CLASS) {
if (otmp->oclass == COIN_CLASS) {
/* 2.5 x level's usual amount; weight adjusted below */
otmp->quan = (long)(rnd(level_difficulty()+2) * rnd(75));
otmp->owt = weight(otmp);
@@ -609,7 +609,7 @@ boolean artif;
mkobj(SPBOOK_CLASS,FALSE));
}
break;
case GOLD_CLASS:
case COIN_CLASS:
break; /* do nothing */
default:
impossible("impossible mkobj %d, sym '%c'.", otmp->otyp,
@@ -830,7 +830,7 @@ register struct obj *obj;
return wt;
} else if (obj->oclass == FOOD_CLASS && obj->oeaten) {
return eaten_stat((int)obj->quan * wt, obj);
} else if (obj->oclass == GOLD_CLASS)
} else if (obj->oclass == COIN_CLASS)
return (int)((obj->quan + 50L) / 100L);
else if (obj->otyp == HEAVY_IRON_BALL && obj->owt != 0)
return((int)(obj->owt)); /* kludge for "very" heavy iron ball */

View File

@@ -822,7 +822,7 @@ not_special:
(mtoo->mappearance && !mtoo->iswiz) ||
!mtoo->data->mmove)) continue;
if(((likegold && otmp->oclass == GOLD_CLASS) ||
if(((likegold && otmp->oclass == COIN_CLASS) ||
(likeobjs && index(practical, otmp->oclass) &&
(otmp->otyp != CORPSE || (ptr->mlet == S_NYMPH
&& !is_rider(&mons[otmp->corpsenm])))) ||
@@ -1317,7 +1317,7 @@ struct monst *mtmp;
int typ = obj->otyp;
#ifdef GOLDOBJ
if (typ == GOLD_CLASS && obj->quan > 100L) return FALSE;
if (typ == COIN_CLASS && obj->quan > 100L) return FALSE;
#endif
if (obj->oclass != GEM_CLASS &&
!(typ >= ARROW && typ <= BOOMERANG) &&

View File

@@ -826,7 +826,7 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */
/* breakage makes its own noises */
else if (obj_type == BOULDER || obj_type == HEAVY_IRON_BALL)
pline("Whang!");
else if (otmp->oclass == GOLD_CLASS ||
else if (otmp->oclass == COIN_CLASS ||
objects[obj_type].oc_material == GOLD ||
objects[obj_type].oc_material == SILVER)
pline("Clink!");

View File

@@ -875,7 +875,7 @@ WAND((char *)0, "jeweled", 0, 150, 1, 0, IRON, HI_MINERAL),
/* coins ... - so far, gold is all there is */
#define COIN(name,prob,metal,worth) OBJECT( \
OBJ(name,(char *)0), BITS(0,1,0,0,0,0,0,0,0,0,0,P_NONE,metal), 0, \
GOLD_CLASS, prob, 0, 1, worth, 0, 0, 0, 0, 0, HI_GOLD )
COIN_CLASS, prob, 0, 1, worth, 0, 0, 0, 0, 0, HI_GOLD )
COIN("gold piece", 1000, GOLD,1),
#undef COIN

View File

@@ -101,7 +101,7 @@ register int otyp;
if (Role_if(PM_SAMURAI) && Japanese_item_name(otyp))
actualn = Japanese_item_name(otyp);
switch(ocl->oc_class) {
case GOLD_CLASS:
case COIN_CLASS:
Strcpy(buf, "coin");
break;
case POTION_CLASS:
@@ -342,7 +342,7 @@ register struct obj *obj;
Sprintf(eos(buf), " of %s meat", mons[obj->corpsenm].mname);
}
break;
case GOLD_CLASS:
case COIN_CLASS:
case CHAIN_CLASS:
Strcpy(buf, actualn);
break;
@@ -572,7 +572,7 @@ register struct obj *obj;
#endif
if (obj->bknown &&
obj->oclass != GOLD_CLASS &&
obj->oclass != COIN_CLASS &&
(obj->otyp != POT_WATER || !objects[POT_WATER].oc_name_known
|| (!obj->cursed && !obj->blessed))) {
/* allow 'blessed clear potion' if we don't know it's holy water;

View File

@@ -329,7 +329,7 @@ extern char ttycolors[CLR_MAX]; /* in sys/msdos/video.c */
#endif
static char def_inv_order[MAXOCLASSES] = {
GOLD_CLASS, AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS,
COIN_CLASS, AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS,
SCROLL_CLASS, SPBOOK_CLASS, POTION_CLASS, RING_CLASS, WAND_CLASS,
TOOL_CLASS, GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, 0,
};
@@ -745,7 +745,7 @@ char *op;
num = 0;
#ifndef GOLDOBJ
if (!index(op, GOLD_SYM))
buf[num++] = GOLD_CLASS;
buf[num++] = COIN_CLASS;
#else
/* !!!! probably unnecessary with gold as normal inventory */
#endif

View File

@@ -212,7 +212,7 @@ lookat(x, y, buf, monbuf)
if (!otmp || otmp->otyp != glyph_to_obj(glyph)) {
if (glyph_to_obj(glyph) != STRANGE_OBJECT) {
otmp = mksobj(glyph_to_obj(glyph), FALSE, FALSE);
if (otmp->oclass == GOLD_CLASS)
if (otmp->oclass == COIN_CLASS)
otmp->quan = 2L; /* to force pluralization */
else if (otmp->otyp == SLIME_MOLD)
otmp->spe = current_fruit; /* give the fruit a type */

View File

@@ -106,7 +106,7 @@ boolean FDECL((*filter),(OBJ_P));
#ifndef GOLDOBJ
if (incl_gold)
ilets[iletct++] = def_oc_syms[GOLD_CLASS];
ilets[iletct++] = def_oc_syms[COIN_CLASS];
#endif
ilets[iletct] = '\0'; /* terminate ilets so that index() will work */
while (otmp) {
@@ -317,16 +317,16 @@ struct obj *obj;
(index(valid_menu_classes, obj->oclass) != (char *)0))
return TRUE;
else if (((index(valid_menu_classes,'U') != (char *)0) &&
(obj->oclass != GOLD_CLASS && obj->bknown && !obj->blessed && !obj->cursed)))
(obj->oclass != COIN_CLASS && obj->bknown && !obj->blessed && !obj->cursed)))
return TRUE;
else if (((index(valid_menu_classes,'B') != (char *)0) &&
(obj->oclass != GOLD_CLASS && obj->bknown && obj->blessed)))
(obj->oclass != COIN_CLASS && obj->bknown && obj->blessed)))
return TRUE;
else if (((index(valid_menu_classes,'C') != (char *)0) &&
(obj->oclass != GOLD_CLASS && obj->bknown && obj->cursed)))
(obj->oclass != COIN_CLASS && obj->bknown && obj->cursed)))
return TRUE;
else if (((index(valid_menu_classes,'X') != (char *)0) &&
(obj->oclass != GOLD_CLASS && !obj->bknown)))
(obj->oclass != COIN_CLASS && !obj->bknown)))
return TRUE;
else
return FALSE;
@@ -914,7 +914,7 @@ boolean telekinesis;
int *wt_before, *wt_after;
{
boolean adjust_wt = container && carried(container),
is_gold = obj->oclass == GOLD_CLASS;
is_gold = obj->oclass == COIN_CLASS;
int wt, iw, ow, oow;
long qq, savequan;
#ifdef GOLDOBJ
@@ -1091,7 +1091,7 @@ boolean telekinesis;
if (*cnt_p < 1L) {
result = -1; /* nothing lifted */
#ifndef GOLDOBJ
} else if (obj->oclass != GOLD_CLASS && inv_cnt() >= 52 &&
} else if (obj->oclass != COIN_CLASS && inv_cnt() >= 52 &&
!merge_choice(invent, obj)) {
#else
} else if (inv_cnt() >= 52 && !merge_choice(invent, obj)) {
@@ -1168,7 +1168,7 @@ boolean telekinesis; /* not picking it up directly by hand */
} else if (obj->oartifact && !touch_artifact(obj,&youmonst)) {
return 0;
#ifndef GOLDOBJ
} else if (obj->oclass == GOLD_CLASS) {
} else if (obj->oclass == COIN_CLASS) {
/* Special consideration for gold pieces... */
long iw = (long)max_capacity() - GOLD_WT(u.ugold);
long gold_capacity = GOLD_CAPACITY(iw, u.ugold);
@@ -1249,7 +1249,7 @@ boolean telekinesis; /* not picking it up directly by hand */
#ifdef GOLDOBJ
/* Whats left of the special case for gold :-) */
if (obj->oclass == GOLD_CLASS) flags.botl = 1;
if (obj->oclass == COIN_CLASS) flags.botl = 1;
#endif
if (obj->quan != count && obj->otyp != LOADSTONE)
obj = splitobj(obj, count);
@@ -1473,7 +1473,7 @@ lootcont:
struct obj *goldob;
/* Find a money object to mess with */
for (goldob = invent; goldob; goldob = goldob->nobj) {
if (goldob->oclass == GOLD_CLASS) break;
if (goldob->oclass == COIN_CLASS) break;
}
if (goldob){
long contribution = rnd((int)min(LARGEST_INT, goldob->quan));
@@ -1823,7 +1823,7 @@ out_container(obj)
register struct obj *obj;
{
register struct obj *otmp;
boolean is_gold = (obj->oclass == GOLD_CLASS);
boolean is_gold = (obj->oclass == COIN_CLASS);
int res, loadlev;
long count;
@@ -2115,7 +2115,7 @@ ask_again2:
}
#ifndef GOLDOBJ
if (u_gold && invent && invent->oclass == GOLD_CLASS) {
if (u_gold && invent && invent->oclass == COIN_CLASS) {
/* didn't stash [all of] it */
u_gold = invent;
invent = u_gold->nobj;

View File

@@ -107,7 +107,7 @@ boolean quietly;
for (otmp = invent; otmp; otmp = otmp2) {
otmp2 = otmp->nobj;
#ifndef GOLDOBJ
if (otmp->oclass == GOLD_CLASS) {
if (otmp->oclass == COIN_CLASS) {
/* in_use gold is created by some menu operations */
if (!otmp->in_use) {
impossible("inven_inuse: !in_use gold in inventory");

View File

@@ -1896,7 +1896,7 @@ register boolean unpaid_only;
/* the price of contained objects */
for (otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if (otmp->oclass == GOLD_CLASS) continue;
if (otmp->oclass == COIN_CLASS) continue;
/* the "top" container is evaluated by caller */
if (usell) {
if (saleable(shkp, otmp) &&
@@ -1926,7 +1926,7 @@ register struct obj *obj;
/* accumulate contained gold */
for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
if (otmp->oclass == GOLD_CLASS)
if (otmp->oclass == COIN_CLASS)
value += otmp->quan;
else if (Has_contents(otmp))
value += contained_gold(otmp);
@@ -1944,7 +1944,7 @@ register boolean sale;
/* the "top" container is treated in the calling fn */
for (otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if (otmp->oclass == GOLD_CLASS) continue;
if (otmp->oclass == COIN_CLASS) continue;
if (!otmp->unpaid && !(sale && saleable(shkp, otmp)))
otmp->no_charge = 1;
@@ -1962,7 +1962,7 @@ register struct obj *obj;
/* the "top" container is treated in the calling fn */
for (otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if (otmp->oclass == GOLD_CLASS) continue;
if (otmp->oclass == COIN_CLASS) continue;
if (otmp->no_charge)
otmp->no_charge = 0;
@@ -2097,7 +2097,7 @@ register struct monst *shkp;
register struct obj *otmp;
for (otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if (otmp->oclass == GOLD_CLASS) continue;
if (otmp->oclass == COIN_CLASS) continue;
/* the "top" box is added in addtobill() */
if (!otmp->no_charge)
@@ -2170,7 +2170,7 @@ register boolean ininv, dummy, silent;
return;
}
if(obj->oclass == GOLD_CLASS) {
if(obj->oclass == COIN_CLASS) {
costly_gold(obj->ox, obj->oy, obj->quan);
return;
}
@@ -2344,7 +2344,7 @@ register struct monst *shkp;
if (Has_contents(obj))
for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if(otmp->oclass == GOLD_CLASS) continue;
if(otmp->oclass == COIN_CLASS) continue;
if (Has_contents(otmp))
subfrombill(otmp, shkp);
@@ -2376,7 +2376,7 @@ register boolean ininv;
/* the price of contained objects, if any */
for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if(otmp->oclass == GOLD_CLASS) continue;
if(otmp->oclass == COIN_CLASS) continue;
if (!Has_contents(otmp)) {
if(ininv) {
@@ -2410,7 +2410,7 @@ register boolean peaceful, silent;
if (!shkp || !inhishop(shkp))
return (0L);
if(obj->oclass == GOLD_CLASS) {
if(obj->oclass == COIN_CLASS) {
gvalue += obj->quan;
} else if (Has_contents(obj)) {
register boolean ininv = !!count_unpaid(obj->cobj);
@@ -2443,7 +2443,7 @@ register boolean peaceful, silent;
}
still = "still ";
}
if(obj->oclass == GOLD_CLASS)
if(obj->oclass == COIN_CLASS)
You("%sowe %s %ld %s!", still, mon_nam(shkp), value, currency(value));
else You("%sowe %s %ld %s for %s!", still,
mon_nam(shkp),
@@ -2498,7 +2498,7 @@ xchar x, y;
register struct eshk *eshkp;
long ltmp = 0L, cltmp = 0L, gltmp = 0L, offer;
boolean saleitem, cgold = FALSE, container = Has_contents(obj);
boolean isgold = (obj->oclass == GOLD_CLASS);
boolean isgold = (obj->oclass == COIN_CLASS);
boolean only_partially_your_contents = FALSE;
if(!(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) ||
@@ -3592,7 +3592,7 @@ register xchar x, y;
return(struct obj *)0;
for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
if (otmp->oclass != GOLD_CLASS)
if (otmp->oclass != COIN_CLASS)
break;
/* note: otmp might have ->no_charge set, but that's ok */
return (otmp && costly_spot(x, y) && NOTANGRY(shkp)
@@ -3616,7 +3616,7 @@ register struct obj *first_obj;
putstr(tmpwin, 0, "Fine goods for sale:");
putstr(tmpwin, 0, "");
for (otmp = first_obj; otmp; otmp = otmp->nexthere) {
if (otmp->oclass == GOLD_CLASS) continue;
if (otmp->oclass == COIN_CLASS) continue;
cost = (otmp->no_charge || otmp == uball || otmp == uchain) ? 0L :
get_cost(otmp, (struct monst *)0);
if (Has_contents(otmp))

View File

@@ -20,7 +20,7 @@ take_gold()
struct obj *otmp;
int lost_money = 0;
for (otmp = invent; otmp; otmp = otmp->nobj) {
if (otmp->oclass == GOLD_CLASS) {
if (otmp->oclass == COIN_CLASS) {
lost_money = 1;
delobj(otmp);
}

View File

@@ -945,7 +945,7 @@ struct mkroom *croom;
panic("create_object: unexpected object class '%c'",c);
/* KMH -- Create piles of gold properly */
if (oclass == GOLD_CLASS)
if (oclass == COIN_CLASS)
otmp = mkgold(0L, x, y);
else
otmp = mkobj_at(oclass, x, y, !named);

View File

@@ -431,7 +431,7 @@ register struct obj *otmp;
int freed_otmp;
#ifndef GOLDOBJ
if (otmp->oclass == GOLD_CLASS) {
if (otmp->oclass == COIN_CLASS) {
mtmp->mgold += otmp->quan;
obfree(otmp, (struct obj *)0);
freed_otmp = 1;

View File

@@ -215,7 +215,7 @@ static struct trobj Wishing[] = {
};
#ifdef GOLDOBJ
static struct trobj Money[] = {
{ GOLD_PIECE, 0 , GOLD_CLASS, 1, 0 },
{ GOLD_PIECE, 0 , COIN_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 }
};
#endif
@@ -980,7 +980,7 @@ register struct trobj *trop;
}
#ifdef GOLDOBJ
if (trop->trclass == GOLD_CLASS) {
if (trop->trclass == COIN_CLASS) {
/* no "blessed" or "identified" money */
obj->quan = u.umoney0;
} else {

View File

@@ -802,7 +802,7 @@ paygd()
#else
for (coins = invent; coins; coins = nextcoins) {
nextcoins = coins->nobj;
if (objects[coins->otyp].oc_class == GOLD_CLASS) {
if (objects[coins->otyp].oc_class == COIN_CLASS) {
freeinv(coins);
place_object(coins, gx, gy);
stackobj(coins);

View File

@@ -2707,7 +2707,7 @@ struct obj *obj; /* object tossed/used */
range--;
} else {
if(weapon == KICKED_WEAPON &&
((obj->oclass == GOLD_CLASS &&
((obj->oclass == COIN_CLASS &&
OBJ_AT(bhitpos.x, bhitpos.y)) ||
ship_object(obj, bhitpos.x, bhitpos.y,
costly_spot(bhitpos.x, bhitpos.y)))) {