#define SCROLL_CLASS 9
#define SPBOOK_CLASS 10 /* actually SPELL-book */
#define WAND_CLASS 11
-#define GOLD_CLASS 12
+#define COIN_CLASS 12
#define GEM_CLASS 13
#define ROCK_CLASS 14
#define BALL_CLASS 15
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
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);
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
/* 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;
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) */
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 */
}
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;
}
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;
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);
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;
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;
#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
/* 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"));
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);
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;
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
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;
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);
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
/* 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;
}
/* 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;
}
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 */
/* 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);
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 */
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"))
/* 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 };
*/
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);
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);
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)
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();
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"),
case AMULET_CLASS:
case CHAIN_CLASS:
case POTION_CLASS:
- case GOLD_CLASS:
+ case COIN_CLASS:
break;
case RING_CLASS:
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);
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
{
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;
#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;
}
#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));
addinv_core1(obj)
struct obj *obj;
{
- if (obj->oclass == GOLD_CLASS) {
+ if (obj->oclass == COIN_CLASS) {
#ifndef GOLDOBJ
u.ugold += obj->quan;
#else
addinv_core1(obj);
#ifndef GOLDOBJ
/* if handed gold, we're done */
- if (obj->oclass == GOLD_CLASS)
+ if (obj->oclass == COIN_CLASS)
return obj;
#endif
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;
{
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);
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 */
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;
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;
* 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);
}
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);
}
}
- if (oc_of_sym == GOLD_CLASS && !combo) {
+ if (oc_of_sym == COIN_CLASS && !combo) {
#ifndef GOLDOBJ
if (allowgold == 1)
(*fn)(mkgoldobj(u.ugold));
*/
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++;
register struct obj *obj;
{
#ifndef GOLDOBJ
- if (obj->oclass == GOLD_CLASS)
+ if (obj->oclass == COIN_CLASS)
return GOLD_SYM;
#endif
if (!flags.invlet_constant) {
(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
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:
}
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.");
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
* 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... */
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,
};
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 {
#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;
}
{18, POTION_CLASS},
{18, SCROLL_CLASS},
{12, SPBOOK_CLASS},
-{ 7, GOLD_CLASS},
+{ 7, COIN_CLASS},
{ 6, WAND_CLASS},
{ 5, RING_CLASS},
{ 1, AMULET_CLASS}
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);
mkobj(SPBOOK_CLASS,FALSE));
}
break;
- case GOLD_CLASS:
+ case COIN_CLASS:
break; /* do nothing */
default:
impossible("impossible mkobj %d, sym '%c'.", otmp->otyp,
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 */
(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])))) ||
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) &&
/* 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!");
/* 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
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:
Sprintf(eos(buf), " of %s meat", mons[obj->corpsenm].mname);
}
break;
- case GOLD_CLASS:
+ case COIN_CLASS:
case CHAIN_CLASS:
Strcpy(buf, actualn);
break;
#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;
#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,
};
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
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 */
#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) {
(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;
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
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)) {
} 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);
#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);
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));
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;
}
#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;
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");
/* 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) &&
/* 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);
/* 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;
/* 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;
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)
return;
}
- if(obj->oclass == GOLD_CLASS) {
+ if(obj->oclass == COIN_CLASS) {
costly_gold(obj->ox, obj->oy, obj->quan);
return;
}
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);
/* 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) {
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);
}
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),
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))) ||
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)
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))
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);
}
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);
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;
};
#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
}
#ifdef GOLDOBJ
- if (trop->trclass == GOLD_CLASS) {
+ if (trop->trclass == COIN_CLASS) {
/* no "blessed" or "identified" money */
obj->quan = u.umoney0;
} else {
#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);
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)))) {