From 40940991bba373d47b57abdcbfa20aeeeb4796e2 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Mon, 8 Jul 2002 23:25:53 +0000 Subject: [PATCH] change GOLD_CLASS to COIN_CLASS --- include/objclass.h | 2 +- src/apply.c | 4 ++-- src/botl.c | 2 +- src/detect.c | 20 ++++++++++---------- src/do.c | 16 ++++++++-------- src/dogmove.c | 2 +- src/dokick.c | 6 +++--- src/dothrow.c | 10 +++++----- src/eat.c | 12 ++++++------ src/engrave.c | 2 +- src/fountain.c | 2 +- src/hack.c | 6 +++--- src/invent.c | 46 +++++++++++++++++++++++----------------------- src/makemon.c | 4 ++-- src/mapglyph.c | 2 +- src/mkobj.c | 8 ++++---- src/monmove.c | 4 ++-- src/mthrowu.c | 2 +- src/objects.c | 2 +- src/objnam.c | 6 +++--- src/options.c | 4 ++-- src/pager.c | 2 +- src/pickup.c | 24 ++++++++++++------------ src/restore.c | 2 +- src/shk.c | 26 +++++++++++++------------- src/sit.c | 2 +- src/sp_lev.c | 2 +- src/steal.c | 2 +- src/u_init.c | 4 ++-- src/vault.c | 2 +- src/zap.c | 2 +- 31 files changed, 115 insertions(+), 115 deletions(-) diff --git a/include/objclass.h b/include/objclass.h index c5cff4331..474845034 100644 --- a/include/objclass.h +++ b/include/objclass.h @@ -133,7 +133,7 @@ extern NEARDATA struct objdescr obj_descr[]; #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 diff --git a/src/apply.c b/src/apply.c index edbf6164e..8d9b53bf3 100644 --- a/src/apply.c +++ b/src/apply.c @@ -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); diff --git a/src/botl.c b/src/botl.c index 8c7ed2c04..1c2d7cd76 100644 --- a/src/botl.c +++ b/src/botl.c @@ -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 diff --git a/src/detect.c b/src/detect.c index 60eda7083..799f3eb4d 100644 --- a/src/detect.c +++ b/src/detect.c @@ -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; diff --git a/src/do.c b/src/do.c index 19cc6cb87..16409aa46 100644 --- a/src/do.c +++ b/src/do.c @@ -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; diff --git a/src/dogmove.c b/src/dogmove.c index 536092a6e..616fbe604 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -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); diff --git a/src/dokick.c b/src/dokick.c index a81023a58..5b3fabfb3 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -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; } diff --git a/src/dothrow.c b/src/dothrow.c index 34311ae54..0f6882e5c 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -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")) diff --git a/src/eat.c b/src/eat.c index 611d2aacd..0905e5de5 100644 --- a/src/eat.c +++ b/src/eat.c @@ -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"), diff --git a/src/engrave.c b/src/engrave.c index 5be718762..afdb7dce9 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -546,7 +546,7 @@ doengrave() case AMULET_CLASS: case CHAIN_CLASS: case POTION_CLASS: - case GOLD_CLASS: + case COIN_CLASS: break; case RING_CLASS: diff --git a/src/fountain.c b/src/fountain.c index 5b1c5325d..7eafc43f1 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -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); diff --git a/src/hack.c b/src/hack.c index bffcbdad0..136df1477 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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; diff --git a/src/invent.c b/src/invent.c index 5fa8fc2b3..9880e4646 100644 --- a/src/invent.c +++ b/src/invent.c @@ -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... */ diff --git a/src/makemon.c b/src/makemon.c index 38696148d..b1ff40e81 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -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 { diff --git a/src/mapglyph.c b/src/mapglyph.c index 6ea4d964b..b81a9f3f8 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -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; } diff --git a/src/mkobj.c b/src/mkobj.c index a0e8c4488..d1a564060 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -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 */ diff --git a/src/monmove.c b/src/monmove.c index ca61e287e..f2ac6e2c8 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -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) && diff --git a/src/mthrowu.c b/src/mthrowu.c index 896a6d899..dec7c2035 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -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!"); diff --git a/src/objects.c b/src/objects.c index 845e5a204..48b785889 100644 --- a/src/objects.c +++ b/src/objects.c @@ -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 diff --git a/src/objnam.c b/src/objnam.c index 856b25282..e02ae10f5 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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; diff --git a/src/options.c b/src/options.c index 261d1fd8a..2c80c3d5d 100644 --- a/src/options.c +++ b/src/options.c @@ -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 diff --git a/src/pager.c b/src/pager.c index 072334224..1d794754d 100644 --- a/src/pager.c +++ b/src/pager.c @@ -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 */ diff --git a/src/pickup.c b/src/pickup.c index 5fdf57ee3..3225a5d99 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -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; diff --git a/src/restore.c b/src/restore.c index d7c72c11b..826283077 100644 --- a/src/restore.c +++ b/src/restore.c @@ -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"); diff --git a/src/shk.c b/src/shk.c index 65ffe8752..96d115ebc 100644 --- a/src/shk.c +++ b/src/shk.c @@ -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)) diff --git a/src/sit.c b/src/sit.c index e11bd23d1..2ce19612d 100644 --- a/src/sit.c +++ b/src/sit.c @@ -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); } diff --git a/src/sp_lev.c b/src/sp_lev.c index 6224c0601..e86923d5b 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -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); diff --git a/src/steal.c b/src/steal.c index 9f5fed4a1..7d11a8a3f 100644 --- a/src/steal.c +++ b/src/steal.c @@ -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; diff --git a/src/u_init.c b/src/u_init.c index f3b9cfb3b..da6839a62 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -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 { diff --git a/src/vault.c b/src/vault.c index 0f380aa56..63fe7027c 100644 --- a/src/vault.c +++ b/src/vault.c @@ -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); diff --git a/src/zap.c b/src/zap.c index deee40c82..1d2c62eaf 100644 --- a/src/zap.c +++ b/src/zap.c @@ -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)))) {