* bugs left here.
*/
-/*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */
#define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */
#define STATUS_HILITES /* support hilites of status fields */
/* #define WINCHAIN*/ /* stacked window systems */
char name[BUFSZ]; /* actual killer name */
} killer;
-#ifdef GOLDOBJ
E long done_money;
-#endif
E const char *configfile;
E NEARDATA char plname[PL_NSIZ];
E NEARDATA char dogname[];
E int NDECL(max_capacity);
E boolean FDECL(check_capacity, (const char *));
E int FDECL(inv_cnt, (BOOLEAN_P));
-#ifdef GOLDOBJ
E long FDECL(money_cnt, (struct obj *));
-#endif
/* ### hacklib.c ### */
E boolean NDECL(wearing_armor);
E boolean FDECL(is_worn, (struct obj *));
E struct obj *FDECL(g_at, (int,int));
-#ifndef GOLDOBJ
-E struct obj *FDECL(mkgoldobj, (long));
-E struct obj *FDECL(insert_gold_into_invent, (BOOLEAN_P));
-E void NDECL(remove_gold_from_invent);
-#endif
E struct obj *FDECL(getobj, (const char *,const char *));
E int FDECL(ggetobj, (const char *,int (*)(OBJ_P),int,BOOLEAN_P,unsigned *));
E int FDECL(askchain, (struct obj **,const char *,int,int (*)(OBJ_P),
E void FDECL(set_mimic_sym, (struct monst *));
E int FDECL(mbirth_limit, (int));
E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P));
-#ifdef GOLDOBJ
E void FDECL(mkmonmoney, (struct monst *, long));
-#endif
E int FDECL(bagotricks, (struct obj *,BOOLEAN_P,int *));
E boolean FDECL(propagate, (int, BOOLEAN_P,BOOLEAN_P));
E boolean FDECL(usmellmon, (struct permonst *));
/* ### pickup.c ### */
-#ifdef GOLDOBJ
E int FDECL(collect_obj_classes,
(char *,struct obj *,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *));
-#else
-E int FDECL(collect_obj_classes,
- (char *,struct obj *,BOOLEAN_P,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *));
-#endif
E boolean FDECL(rider_corpse_revival, (struct obj *,BOOLEAN_P));
E void FDECL(add_valid_menu_class, (int));
E boolean FDECL(allow_all, (struct obj *));
E void NDECL(reset_restpref);
E void FDECL(set_restpref, (const char *));
E void FDECL(set_savepref, (const char *));
-#ifndef GOLDOBJ
-E void FDECL(put_gold_back, (struct monst *));
-#endif
/* ### rip.c ### */
/* ### shk.c ### */
-#ifdef GOLDOBJ
E long FDECL(money2mon, (struct monst *, long));
E void FDECL(money2u, (struct monst *, long));
-#endif
E void FDECL(shkgone, (struct monst *));
E void FDECL(set_residency, (struct monst *,BOOLEAN_P));
E void FDECL(replshk, (struct monst *,struct monst *));
#ifdef USE_TRAMPOLI
E int NDECL(stealarm);
#endif
-#ifdef GOLDOBJ
E long FDECL(somegold, (long));
-#else
-E long NDECL(somegold);
-#endif
E void FDECL(stealgold, (struct monst *));
E void FDECL(remove_worn_item, (struct obj *,BOOLEAN_P));
E int FDECL(steal, (struct monst *, char *));
E void FDECL(mdrop_obj, (struct monst *,struct obj *,BOOLEAN_P));
E void FDECL(mdrop_special_objs, (struct monst *));
E void FDECL(relobj, (struct monst *,int,BOOLEAN_P));
-#ifdef GOLDOBJ
E struct obj *FDECL(findgold, (struct obj *));
-#endif
/* ### steed.c ### */
long mtrapseen; /* bitmap of traps we've been trapped in */
long mlstmv; /* for catching up with lost time */
long mspare1;
-#ifndef GOLDOBJ
-#define mgold mspare1
-#endif
struct obj *minvent;
struct obj *mw;
int ublessed, ublesscnt; /* blessing/duration from #pray */
long umoney0;
long uspare1;
-#ifndef GOLDOBJ
-#define ugold uspare1
-#define ugold0 umoney0
-#endif
long uexp, urexp;
long ucleansed; /* to record moves when player was cleansed */
long usleep; /* sleeping; monstermove you last started */
static const char scritch[] = "\"scritch, scritch\"";
static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 };
-#ifndef GOLDOBJ
- struct obj goldobj;
-#endif
/* in case it was acquired while blinded */
if (!Blind) tstone->dknown = 1;
Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan));
if ((obj = getobj(choices, stonebuf)) == 0)
return;
-#ifndef GOLDOBJ
- if (obj->oclass == COIN_CLASS) {
- u.ugold += obj->quan; /* keep botl up to date */
- goldobj = *obj;
- goldobj.oextra = (struct oextra *)0; /* dealloc_obj(obj) will invalidate
- the target of this copied ptr
- here, so clear it out */
- dealloc_obj(obj);
- obj = &goldobj;
- }
-#endif
if (obj == tstone && obj->quan == 1L) {
You_cant("rub %s on itself.", the(xname(obj)));
else
pline("A sharp crack shatters %s%s.",
(obj->quan > 1L) ? "one of " : "", the(xname(obj)));
-#ifndef GOLDOBJ
- /* assert(obj != &goldobj); */
-#endif
useup(obj);
return;
}
else
place_object(otmp, x, y);
}
-#ifndef GOLDOBJ
- if(u.ugold) {
- long ugold = u.ugold;
-
- if (mtmp) mtmp->mgold = ugold;
- else if (cont) (void) add_to_container(cont, mkgoldobj(ugold));
- else (void)mkgold(ugold, x, y);
- u.ugold = ugold; /* undo mkgoldobj()'s removal */
- }
-#endif
if (cont) cont->owt = weight(cont);
}
long deepest = deepest_lev_reached(FALSE);
long utotal;
-#ifndef GOLDOBJ
- utotal = u.ugold + hidden_gold();
- if ((utotal -= u.ugold0) < 0L) utotal = 0L;
-#else
utotal = money_cnt(invent) + hidden_gold();
if ((utotal -= u.umoney0) < 0L) utotal = 0L;
-#endif
utotal += u.urexp + (50 * (deepest - 1)) +
(deepest > 30 ? 10000 : deepest > 20 ? 1000*(deepest - 20) : 0);
if (utotal < u.urexp) utotal = LONG_MAX; /* wrap around */
Sprintf(nb = eos(newbot2),
"%s:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d",
encglyph(objnum_to_glyph(GOLD_PIECE)),
-#ifndef GOLDOBJ
- u.ugold,
-#else
money_cnt(invent),
-#endif
hp, hpmax, u.uen, u.uenmax, u.uac);
if (Upolyd)
/* Gold */
- blstats[idx][BL_GOLD].a.a_long =
-#ifndef GOLDOBJ
- u.ugold;
-#else
- money_cnt(invent);
-#endif
+ blstats[idx][BL_GOLD].a.a_long = money_cnt(invent);
/*
* The tty port needs to display the current symbol for gold
* as a field header, so to accomodate that we pass gold with
NEARDATA char *save_cm = 0;
NEARDATA struct kinfo killer = DUMMY;
-#ifdef GOLDOBJ
NEARDATA long done_money = 0;
-#endif
const char *nomovemsg = 0;
NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */
NEARDATA char pl_character[PL_CSIZ] = DUMMY;
/* there's some object shown here */
if (oclass == ALL_CLASSES) {
return((boolean)( !(level.objects[x][y] || /* stale if nothing here */
- ((mtmp = m_at(x,y)) != 0 &&
- (
-#ifndef GOLDOBJ
- mtmp->mgold ||
-#endif
- mtmp->minvent)))));
+ ((mtmp = m_at(x,y)) != 0 && ( mtmp->minvent)))));
} else {
if (material && objects[glyph_to_obj(glyph)].oc_material == material) {
/* the object shown here is of interest because material matches */
for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
if (o_in(otmp, oclass)) return FALSE;
/* didn't find it; perhaps a monster is carrying it */
-#ifndef GOLDOBJ
- if ((mtmp = m_at(x,y)) != 0) {
- if (oclass == COIN_CLASS && mtmp->mgold)
- return FALSE;
- else for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
- if (o_in(otmp, oclass)) return FALSE;
- }
-#else
if ((mtmp = m_at(x,y)) != 0) {
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
if (o_in(otmp, oclass)) return FALSE;
}
-#endif
/* detection indicates removal of this object from the map */
return TRUE;
}
/* look for gold carried by monsters (might be in a container) */
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) continue; /* probably not needed in this case but... */
-#ifndef GOLDOBJ
- if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
-#else
if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
-#endif
known = TRUE;
goto outgoldmap; /* skip further searching */
} else for (obj = mtmp->minvent; obj; obj = obj->nobj)
if (youmonst.data == &mons[PM_GOLD_GOLEM]) {
Sprintf(buf, "You feel like a million %s!",
currency(2L));
- } else if (hidden_gold() ||
-#ifndef GOLDOBJ
- u.ugold)
-#else
- money_cnt(invent))
-#endif
+ } else if (hidden_gold() || money_cnt(invent))
Strcpy(buf,
"You feel worried about your future financial situation.");
else
}
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) continue; /* probably overkill here */
-#ifndef GOLDOBJ
- if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
-#else
if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
-#endif
struct obj gold;
gold = zeroobj; /* ensure oextra is cleared too */
gold.otyp = GOLD_PIECE;
}
if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT &&
(!class || class == objects[mtmp->mappearance].oc_class)) ||
-#ifndef GOLDOBJ
- (mtmp->mgold && (!class || class == COIN_CLASS))) {
-#else
(findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) {
-#endif
ct++;
break;
}
temp.oy = mtmp->my;
temp.corpsenm = PM_TENGU; /* if mimicing a corpse */
map_object(&temp, 1);
-#ifndef GOLDOBJ
- } else if (mtmp->mgold && (!class || class == COIN_CLASS)) {
-#else
} else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) {
-#endif
struct obj gold;
gold = zeroobj; /* ensure oextra is cleared too */
gold.otyp = GOLD_PIECE;
int
dodrop()
{
-#ifndef GOLDOBJ
- int result, i = (invent || u.ugold) ? 0 : (SIZE(drop_types) - 1);
-#else
int result, i = (invent) ? 0 : (SIZE(drop_types) - 1);
-#endif
if (*u.ushops) sellobj_state(SELL_DELIBERATE);
result = drop(getobj(&drop_types[i], "drop"));
if (levhack) ELevitation = W_ART; /* other than W_ARTI */
if(flags.verbose) You("drop %s.", doname(obj));
-#ifndef GOLDOBJ
- if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
-#else
/* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS) context.botl = 1;
freeinv(obj);
-#endif
hitfloor(obj);
if (levhack) float_down(I_SPECIAL|TIMEOUT, W_ARTI|W_ART);
return(1);
dropx(obj)
register struct obj *obj;
{
-#ifndef GOLDOBJ
- if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
-#else
/* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS) context.botl = 1;
freeinv(obj);
-#endif
if (!u.uswallow) {
if (ship_object(obj, u.ux, u.uy, FALSE)) return;
if (IS_ALTAR(levl[u.ux][u.uy].typ))
int n, i, n_dropped = 0;
long cnt;
struct obj *otmp, *otmp2;
-#ifndef GOLDOBJ
- struct obj *u_gold = 0;
-#endif
menu_item *pick_list;
boolean all_categories = TRUE;
boolean drop_everything = FALSE;
-#ifndef GOLDOBJ
- /* put gold where inventory traversal will see it */
- if (u.ugold) u_gold = insert_gold_into_invent(TRUE);
-#endif
if (retry) {
all_categories = (retry == -2);
} else if (flags.menu_style == MENU_FULL) {
/* same kludge as getobj(), for canletgo()'s use */
otmp->corpsenm = (int) cnt; /* don't split */
} else {
-#ifndef GOLDOBJ
- if (otmp->oclass == COIN_CLASS)
- (void) splitobj(otmp, otmp->quan - cnt);
- else
-#endif
otmp = splitobj(otmp, cnt);
}
}
}
drop_done:
-#ifndef GOLDOBJ
- /* if we put gold into inventory above, take it back out now */
- if (u_gold) remove_gold_from_invent();
-#endif
return n_dropped;
}
}
corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data,
xlocale, ylocale, CORPSTAT_NONE);
-#ifndef GOLDOBJ
- if (mtmp->mgold) {
- if (xlocale == 0 && ylocale == 0 && corpse) {
- (void) get_obj_location(corpse, &xlocale, &ylocale, 0);
- (void) mkgold(mtmp->mgold, xlocale, ylocale);
- }
- mtmp->mgold = 0L;
- }
-#endif
mongone(mtmp);
}
}
struct obj *obj, *wep,
dummy, *pickaxe, *unihorn, *key;
-#ifndef GOLDOBJ
- if (mon->mgold) return &zeroobj; /* pet has something to drop */
-#endif
dummy = zeroobj;
dummy.otyp = GOLD_PIECE; /* not STRANGE_OBJECT or tools of interest */
dummy.oartifact = 1; /* so real artifact won't override "don't keep it" */
verbalize("Thank you for your contribution.");
else verbalize("Thanks, scum!");
} else if (mtmp->isgd) {
-#ifndef GOLDOBJ
- umoney = u.ugold;
-#else
umoney = money_cnt(invent);
-#endif
/* Some of these are iffy, because a hostile guard
won't become peaceful and resume leading hero
out of the vault. If he did do that, player
goldreqd = 750L;
if (goldreqd) {
-#ifndef GOLDOBJ
- umoney = u.ugold;
-#else
umoney = money_cnt(invent);
-#endif
if (value > goldreqd +
(umoney + u.ulevel * rn2(5)) / ACURR(A_CHA))
mtmp->mpeaceful = TRUE;
boolean twoweap, weakmultishot;
/* ask "in what direction?" */
-#ifndef GOLDOBJ
- if (!getdir((char *)0)) {
- if (obj->oclass == COIN_CLASS) {
- u.ugold += obj->quan;
- context.botl = 1;
- dealloc_obj(obj);
- }
- return(0);
- }
-
- 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 */
freeinv(obj);
possibly using a sling.
*/
if(obj->oclass == COIN_CLASS && obj != uquiver) return(throw_gold(obj));
-#endif
if(!canletgo(obj,"throw"))
return(0);
struct obj *obj;
{
int range, odx, ody;
-#ifndef GOLDOBJ
- long zorks = obj->quan;
-#endif
register struct monst *mon;
if(!u.dx && !u.dy && !u.dz) {
-#ifndef GOLDOBJ
- u.ugold += obj->quan;
- context.botl = 1;
- dealloc_obj(obj);
-#endif
You("cannot throw gold at yourself.");
return(0);
}
-#ifdef GOLDOBJ
freeinv(obj);
-#endif
if(u.uswallow) {
pline(is_animal(u.ustuck->data) ?
"%s in the %s's entrails." : "%s into %s.",
-#ifndef GOLDOBJ
- "The gold disappears", mon_nam(u.ustuck));
- u.ustuck->mgold += zorks;
- dealloc_obj(obj);
-#else
"The money disappears", mon_nam(u.ustuck));
add_to_minv(u.ustuck, obj);
-#endif
return(1);
}
context.victual.o_id = 0;
context.victual.eating = 0;
if (otmp->oclass == COIN_CLASS) {
-#ifdef GOLDOBJ
if (carried(otmp))
useupall(otmp);
-#else
- if (otmp->where == OBJ_FREE)
- dealloc_obj(otmp);
-#endif
else
useupf(otmp, otmp->quan);
vault_gd_watching(GD_EATGOLD);
{
int deepest = deepest_lev_reached(FALSE);
-#ifndef GOLDOBJ
- umoney = u.ugold;
- tmp = u.ugold0;
-#else
umoney = money_cnt(invent);
tmp = u.umoney0;
-#endif
umoney += hidden_gold(); /* accumulate gold from containers */
tmp = umoney - tmp; /* net gain */
/* update gold for the rip output, which can't use hidden_gold()
(containers will be gone by then if bones just got saved...) */
-#ifndef GOLDOBJ
- u.ugold = umoney;
-#else
done_money = umoney;
-#endif
/* clean up unneeded windows */
if (have_windows) {
break;
case 28: /* Strange feeling */
pline("An urge to take a bath overwhelms you.");
-#ifndef GOLDOBJ
- if (u.ugold > 10) {
- u.ugold -= somegold() / 10;
- You("lost some of your gold in the fountain!");
- CLEAR_FOUNTAIN_LOOTED(u.ux,u.uy);
- exercise(A_WIS, FALSE);
- }
-#else
{
long money = money_cnt(invent);
struct obj *otmp;
exercise(A_WIS, FALSE);
}
}
-#endif
break;
case 29: /* You see coins */
register struct obj *otmp = invent;
register int wt = 0;
-#ifndef GOLDOBJ
- /* when putting stuff into containers, gold is inserted at the head
- 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 == 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 == COIN_CLASS)
wt += (int)(((long)otmp->quan + 50L) / 100L);
else if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data))
-#endif
wt += otmp->owt;
otmp = otmp->nobj;
}
int
inv_cnt(incl_gold)
-boolean incl_gold; /* only meaningful for GOLDOBJ config */
+boolean incl_gold;
{
register struct obj *otmp = invent;
register int ct = 0;
return(ct);
}
-#ifdef GOLDOBJ
/* Counts the money in an object chain. */
/* Intended use is for your or some monsters inventory, */
/* now that u.gold/m.gold is gone.*/
}
return 0L;
}
-#endif /* GOLDOBJ */
/*hack.c*/
/ (otmp->quan + obj->quan);
otmp->quan += obj->quan;
-#ifdef GOLDOBJ
/* temporary special case for gold objects!!!! */
-#endif
if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp);
else otmp->owt += obj->owt;
if(!has_oname(otmp) && has_oname(obj))
struct obj *obj;
{
if (obj->oclass == COIN_CLASS) {
-#ifndef GOLDOBJ
- u.ugold += obj->quan;
-#else
context.botl = 1;
-#endif
} else if (obj->otyp == AMULET_OF_YENDOR) {
if (u.uhave.amulet) impossible("already have amulet?");
u.uhave.amulet = 1;
obj->was_thrown = 0; /* not meaningful for invent */
addinv_core1(obj);
-#ifndef GOLDOBJ
- /* if handed gold, we're done */
- if (obj->oclass == COIN_CLASS)
- return obj;
-#endif
/* merge with quiver in preference to any other inventory slot
in case quiver and wielded weapon are both eligible; adding
struct obj *obj;
{
if (obj->oclass == COIN_CLASS) {
-#ifndef GOLDOBJ
- u.ugold -= obj->quan;
- obj->in_use = FALSE;
-#endif
context.botl = 1;
return;
} else if (obj->otyp == AMULET_OF_YENDOR) {
return((struct obj *)0);
}
-#ifndef GOLDOBJ
-/* Make a gold object from the hero's gold. */
-struct obj *
-mkgoldobj(q)
-register long q;
-{
- register struct obj *otmp;
-
- otmp = mksobj(GOLD_PIECE, FALSE, FALSE);
- u.ugold -= q;
- otmp->quan = q;
- otmp->owt = weight(otmp);
- context.botl = 1;
- return(otmp);
-}
-
-/* used for container apply/#loot and multi-item Drop */
-struct obj *
-insert_gold_into_invent(keep_on_status_line)
-boolean keep_on_status_line;
-{
- struct obj *u_gold = 0;
-
- if (u.ugold) {
- u_gold = mkgoldobj(u.ugold);
- if (keep_on_status_line) {
- u_gold->in_use = 1; /* in case of panic/hangup save */
- u.ugold = u_gold->quan; /* put back on status line */
- } /* else mkgoldobj() left status $:0 */
- assigninvlet(u_gold); /* should yield '$' */
- u_gold->where = OBJ_INVENT;
- u_gold->nobj = invent;
- invent = u_gold;
- }
- return u_gold;
-}
-
-/* undo insert_gold_into_invent; gold might have been used up though */
-void
-remove_gold_from_invent()
-{
- struct obj *u_gold = invent; /* we expect gold to be first */
-
- if (u_gold && u_gold->otyp != GOLD_PIECE)
- u_gold = carrying(GOLD_PIECE);
-
- if (u_gold) {
- extract_nobj(u_gold, &invent);
- if (!u_gold->in_use) u.ugold += u_gold->quan;
- dealloc_obj(u_gold);
- }
-}
-#endif /* !GOLDOBJ */
-
STATIC_OVL void
compactify(buf)
register char *buf;
* struct obj *xxx: object to do something with.
* (struct obj *) 0 error return: no object.
* &zeroobj explicitly no object (as in w-).
-#ifdef GOLDOBJ
!!!! test if gold can be used in unusual ways (eaten etc.)
!!!! may be able to remove "usegold"
-#endif
*/
struct obj *
getobj(let,word)
register char *bp = buf;
xchar allowcnt = 0; /* 0, 1 or 2 */
struct obj *firstobj = invent;
-#ifndef GOLDOBJ
- struct obj *u_gold = 0;
- boolean allowgold = FALSE; /* can't use gold because they don't have any */
-#endif
boolean usegold = FALSE; /* can't use gold because its illegal */
boolean allowall = FALSE;
boolean allownone = FALSE;
long dummymask;
if(*let == ALLOW_COUNT) let++, allowcnt = 1;
-#ifndef GOLDOBJ
- if(*let == COIN_CLASS) let++,
- usegold = TRUE, allowgold = (u.ugold ? TRUE : FALSE);
-#else
if(*let == COIN_CLASS) let++, usegold = TRUE;
-#endif
/* Equivalent of an "ugly check" for gold */
if (usegold && !strcmp(word, "eat") &&
(!metallivorous(youmonst.data)
|| youmonst.data == &mons[PM_RUST_MONSTER]))
-#ifndef GOLDOBJ
- usegold = allowgold = FALSE;
-#else
usegold = FALSE;
-#endif
if(*let == ALL_CLASSES) let++, allowall = TRUE;
if(*let == ALLOW_NONE) let++, allownone = TRUE;
useboulder = TRUE;
if(allownone) *bp++ = '-';
-#ifndef GOLDOBJ
- if(allowgold) {
- *bp++ = def_oc_syms[COIN_CLASS].sym;
- if (firstobj && firstobj->otyp == GOLD_PIECE) {
- /* gold has been inserted into inventory; skip it during
- inventory letter collection */
- u_gold = firstobj;
- firstobj = u_gold->nobj;
- }
- }
-#endif
if(bp > buf && bp[-1] == '-') *bp++ = ' ';
ap = altlets;
}
if (!*let || index(let, otmp->oclass)
-#ifdef GOLDOBJ
|| (usegold && otmp->invlet == GOLD_SYM)
-#endif
|| (useboulder && otmp->otyp == BOULDER)
) {
register int otyp = otmp->otyp;
compactify(bp);
*ap = '\0';
-#ifndef GOLDOBJ
- if(!foo && !allowall && !allowgold && !allownone) {
-#else
if(!foo && !allowall && !allownone) {
-#endif
You("don't have anything %sto %s.",
foox ? "else " : "", word);
return((struct obj *)0);
if (!usegold) {
You("cannot %s gold.", word);
return(struct obj *)0;
-#ifndef GOLDOBJ
- } else if (!allowgold) {
- You("are not carrying any gold.");
- return(struct obj *)0;
-#endif
}
/* Historic note: early Nethack had a bug which was
* first reported for Larn, where trying to drop 2^32-n
return (struct obj *)0;
}
-#ifndef GOLDOBJ
- if(!(allowcnt == 2 && cnt < u.ugold))
- cnt = u.ugold;
- if (!u_gold)
- u_gold = mkgoldobj(cnt);
- else if (cnt < u_gold->quan)
- u_gold = splitobj(u_gold, cnt);
- return u_gold;
-#endif
}
if(ilet == '?' || ilet == '*') {
char *allowed_choices = (ilet == '?') ? lets : (char *)0;
/* permit counts for throwing gold, but don't accept
* counts for other things since the throw code will
* split off a single item anyway */
-#ifdef GOLDOBJ
if (ilet != def_oc_syms[COIN_CLASS].sym)
-#endif
allowcnt = 1;
if(cnt == 0 && prezero) return((struct obj *)0);
if(cnt > 1) {
continue;
}
}
-#ifdef GOLDOBJ
context.botl = 1; /* May have changed the amount of money */
-#endif
#ifdef REDO
savech(ilet);
#endif
break;
}
if(!allowall && let && !index(let,otmp->oclass)
-#ifdef GOLDOBJ
&& !(usegold && otmp->oclass == COIN_CLASS)
-#endif
) {
silly_thing(word, otmp);
return((struct obj *)0);
boolean FDECL((*filter),(OBJ_P)) = (boolean FDECL((*),(OBJ_P))) 0;
boolean takeoff, ident, allflag, m_seen;
int itemcount;
-#ifndef GOLDOBJ
- int oletct, iletct, allowgold, unpaid, oc_of_sym;
-#else
int oletct, iletct, unpaid, oc_of_sym;
-#endif
char sym, *ip, olets[MAXOCLASSES+5], ilets[MAXOCLASSES+5];
char extra_removeables[3+1]; /* uwep,uswapwep,uquiver */
char buf[BUFSZ], qbuf[QBUFSZ];
if (resultflags) *resultflags = 0;
-#ifndef GOLDOBJ
- allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0;
-#endif
takeoff = ident = allflag = m_seen = FALSE;
-#ifndef GOLDOBJ
- if(!invent && !allowgold){
-#else
if(!invent){
-#endif
You("have nothing to %s.", word);
return(0);
}
iletct = collect_obj_classes(ilets, invent,
FALSE,
-#ifndef GOLDOBJ
- (allowgold != 0),
-#endif
filter, &itemcount);
unpaid = count_unpaid(invent);
}
if (oc_of_sym == COIN_CLASS && !combo) {
-#ifndef GOLDOBJ
- if (allowgold == 1)
- (*fn)(mkgoldobj(u.ugold));
- else if (!u.ugold)
- You("have no gold.");
- allowgold = 2;
-#else
context.botl = 1;
-#endif
} else if (sym == 'a') {
allflag = TRUE;
} else if (sym == 'A') {
return (allflag || (!oletct && ckfn != ckunpaid)) ? -2 : -3;
else if (flags.menu_style != MENU_TRADITIONAL && combo && !allflag)
return 0;
-#ifndef GOLDOBJ
- else if (allowgold == 2 && !oletct)
- return 1; /* you dropped gold (or at least tried to) */
- else {
-#else
else /*!!!! if (allowgold == 2 && !oletct)
!!!! return 1; you dropped gold (or at least tried to)
!!!! test gold dropping
else*/ {
-#endif
int cnt = askchain(&invent, olets, allflag, fn, ckfn, mx, word);
/*
* askchain() has already finished the job in this case
obj_to_let(obj) /* should of course only be called for things in invent */
register struct obj *obj;
{
-#ifndef GOLDOBJ
- if (obj->oclass == COIN_CLASS)
- return GOLD_SYM;
-#endif
if (!flags.invlet_constant) {
obj->invlet = NOINVSYM;
reassign();
Sprintf(li, "%c - %-45s %6ld %s",
(dot && use_invlet ? obj->invlet : let),
(txt ? txt : doname(obj)), cost, currency(cost));
-#ifndef GOLDOBJ
- } else if (obj && obj->oclass == COIN_CLASS) {
- Sprintf(li, "%ld gold piece%s%s", obj->quan, plur(obj->quan),
- (dot ? "." : ""));
-#endif
} else {
/* ordinary inventory display or pickup message */
Sprintf(li, "%c - %s%s",
to here is short circuited away.
*/
if (!invent && !(flags.perm_invent && !lets && !want_reply)) {
-#ifndef GOLDOBJ
- pline("Not carrying anything%s.", u.ugold ? " except gold" : "");
-#else
pline("Not carrying anything.");
-#endif
return 0;
}
boolean traditional = TRUE;
const char *prompt = "What type of object do you want an inventory of?";
-#ifndef GOLDOBJ
- if (!invent && !u.ugold && !billx) {
-#else
if (!invent && !billx) {
-#endif
You("aren't carrying anything.");
return 0;
}
types[0] = 0;
class_count = collect_obj_classes(types, invent,
FALSE,
-#ifndef GOLDOBJ
- (u.ugold != 0),
-#endif
(boolean FDECL((*),(OBJ_P))) 0, &itemcount);
if (unpaid_count) {
Strcat(types, "u");
{
int objnamelth = 0, otmpnamelth = 0;
if (obj->otyp != otmp->otyp) return FALSE;
-#ifdef GOLDOBJ
/* coins of the same kind will always merge */
if (obj->oclass == COIN_CLASS) return TRUE;
-#endif
if (obj->unpaid != otmp->unpaid ||
obj->spe != otmp->spe || obj->dknown != otmp->dknown ||
(obj->bknown != otmp->bknown && !Role_if(PM_PRIEST)) ||
{
/* the messages used to refer to "carrying gold", but that didn't
take containers into account */
-#ifndef GOLDOBJ
- if(!u.ugold)
- Your("wallet is empty.");
- else
- Your("wallet contains %ld gold piece%s.", u.ugold, plur(u.ugold));
-#else
long umoney = money_cnt(invent);
if(!umoney)
Your("wallet is empty.");
else
Your("wallet contains %ld %s.", umoney, currency(umoney));
-#endif
shopper_financial_report();
return 0;
}
register struct obj *obj;
for(obj = invent, i = 0; obj; obj = obj->nobj, i++) {
-#ifdef GOLDOBJ
if (obj->oclass == COIN_CLASS && obj->invlet == GOLD_SYM)
--i; /* keep $ instead of using up i'th letter */
else
-#endif
if (i < 52)
obj->invlet = (i < 26) ? ('a'+i) : ('A'+i-26);
-#ifdef GOLDOBJ
else if (obj->oclass == COIN_CLASS)
obj->invlet = GOLD_SYM;
-#endif
else
obj->invlet = NOINVSYM;
}
const char *adj_type;
if (!invent) {
- /* (we don't need any !GOLDOBJ check for "except gold" here) */
You("aren't carrying anything to adjust.");
return 0;
}
char *title;
{
struct obj *ret;
-#ifndef GOLDOBJ
- struct obj m_gold;
-#endif
char tmp[QBUFSZ];
int n;
menu_item *selected = 0;
int do_all = (dflags & MINV_ALL) != 0,
incl_hero = (do_all && u.uswallow && mon == u.ustuck),
-#ifndef GOLDOBJ
- do_gold = (do_all && mon->mgold),
- have_inv = (mon->minvent || do_gold),
-#else
have_inv = (mon->minvent != 0),
-#endif
have_any = (have_inv || incl_hero);
Sprintf(tmp,"%s %s:", s_suffix(noit_Monnam(mon)),
*/
youmonst.data = mon->data;
-#ifndef GOLDOBJ
- if (do_gold) {
- /*
- * Make temporary gold object and insert at the head of
- * the mon's inventory. We can get away with using a
- * stack variable object because monsters don't carry
- * gold in their inventory, so it won't merge.
- */
- m_gold = zeroobj;
- 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... */
- if (add_to_minv(mon, &m_gold))
- panic("display_minventory: static object freed.");
- }
-
-#endif
n = query_objlist(title ? title : tmp, mon->minvent,
INVORDER_SORT | (incl_hero ? INCLUDE_HERO : 0),
&selected,
(dflags & MINV_NOLET) ? PICK_NONE : PICK_ONE,
do_all ? allow_all : worn_wield_only);
-#ifndef GOLDOBJ
- if (do_gold) obj_extract_self(&m_gold);
-#endif
-
set_uasmon();
} else {
invdisp_nothing(title ? title : tmp, "(none)");
if (n > 0) {
ret = selected[0].item.a_obj;
free((genericptr_t)selected);
-#ifndef GOLDOBJ
- /*
- * Unfortunately, we can't return a pointer to our temporary
- * gold object. We'll have to work out a scheme where this
- * can happen. Maybe even put gold in the inventory list...
- */
- if (ret == &m_gold) ret = (struct obj *) 0;
-#endif
} else
ret = (struct obj *) 0;
return ret;
(void) mongets(mtmp, rnd_offensive_item(mtmp));
}
-#ifdef GOLDOBJ
/*
* Makes up money for monster's inventory.
* This will change with silver & copper coins
gold->quan = amount;
add_to_minv(mtmp, gold);
}
-#endif
STATIC_OVL void
m_initinv(mtmp)
rn2(3) ? CLOAK_OF_PROTECTION :
CLOAK_OF_MAGIC_RESISTANCE);
(void) mongets(mtmp, SMALL_SHIELD);
-#ifndef GOLDOBJ
- mtmp->mgold = (long)rn1(10,20);
-#else
mkmonmoney(mtmp,(long)rn1(10,20));
-#endif
} else if (quest_mon_represents_role(ptr,PM_MONK)) {
(void) mongets(mtmp, rn2(11) ? ROBE :
CLOAK_OF_MAGIC_RESISTANCE);
}
break;
case S_LEPRECHAUN:
-#ifndef GOLDOBJ
- mtmp->mgold = (long) d(level_difficulty(), 30);
-#else
mkmonmoney(mtmp, (long) d(level_difficulty(), 30));
-#endif
break;
case S_DEMON:
/* moved here from m_initweap() because these don't
(void) mongets(mtmp, rnd_defensive_item(mtmp));
if ((int) mtmp->m_lev > rn2(100))
(void) mongets(mtmp, rnd_misc_item(mtmp));
-#ifndef GOLDOBJ
- if (likes_gold(ptr) && !mtmp->mgold && !rn2(5))
- mtmp->mgold =
- (long) d(level_difficulty(), mtmp->minvent ? 5 : 10);
-#else
if (likes_gold(ptr) && !findgold(mtmp->minvent) && !rn2(5))
mkmonmoney(mtmp, (long) d(level_difficulty(), mtmp->minvent ? 5 : 10));
-#endif
}
/* Note: for long worms, always call cutworm (cutworm calls clone_mon) */
m2->mcloned = 1;
m2->minvent = (struct obj *) 0; /* objects don't clone */
m2->mleashed = FALSE;
-#ifndef GOLDOBJ
- m2->mgold = 0L;
-#endif
/* Max HP the same, but current HP halved for both. The caller
* might want to override this by halving the max HP also.
* When current HP is odd, the original keeps the extra point.
break;
case AD_SGLD:
tmp = 0;
-#ifndef GOLDOBJ
- if (magr->mcan || !mdef->mgold) break;
- /* technically incorrect; no check for stealing gold from
- * between mdef's feet...
- */
- magr->mgold += mdef->mgold;
- mdef->mgold = 0;
-#else
if (magr->mcan) break;
/* technically incorrect; no check for stealing gold from
* between mdef's feet...
obj_extract_self(gold);
add_to_minv(magr, gold);
}
-#endif
mdef->mstrategy &= ~STRAT_WAITFORU;
if (vis) {
Strcpy(buf, Monnam(magr));
pline("%s tries to take your money, but fails...",
noit_Monnam(mon));
else {
-#ifndef GOLDOBJ
- long cost;
-
- if (u.ugold > (long)LARGEST_INT - 10L)
- cost = (long) rnd(LARGEST_INT) + 500L;
- else
- cost = (long) rnd((int)u.ugold + 10) + 500L;
- if (mon->mpeaceful) {
- cost /= 5L;
- if (!cost) cost = 1L;
- }
- if (cost > u.ugold) cost = u.ugold;
- if (!cost) verbalize("It's on the house!");
- else {
- pline("%s takes %ld %s for services rendered!",
- noit_Monnam(mon), cost, currency(cost));
- u.ugold -= cost;
- mon->mgold += cost;
- context.botl = 1;
- }
-#else
long cost;
long umoney = money_cnt(invent);
money2mon(mon, cost);
context.botl = 1;
}
-#endif
}
if (!rn2(25)) mon->mcan = 1; /* monster is worn out */
if (!tele_restrict(mon)) (void) rloc(mon, FALSE);
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
return(1);
}
-#ifndef GOLDOBJ
- cash = u.ugold;
-#else
cash = money_cnt(invent);
-#endif
demand = (cash * (rnd(80) + 20 * Athome)) /
(100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp))));
{
char buf[BUFSZ];
long offer;
-#ifdef GOLDOBJ
long umoney = money_cnt(invent);
-#endif
getlin("How much will you offer?", buf);
if (sscanf(buf, "%ld", &offer) != 1) offer = 0L;
} else if (offer == 0L) {
You("refuse.");
return 0L;
-#ifndef GOLDOBJ
- } else if (offer >= u.ugold) {
- You("give %s all your gold.", mon_nam(mtmp));
- offer = u.ugold;
- } else {
- You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer));
- }
- u.ugold -= offer;
- mtmp->mgold += offer;
-#else
} else if (offer >= umoney) {
You("give %s all your gold.", mon_nam(mtmp));
offer = umoney;
You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer));
}
(void) money2mon(mtmp, offer);
-#endif
context.botl = 1;
return(offer);
}
{
int old_light = 0;
-#ifdef GOLDOBJ
if (otmp->oclass == COIN_CLASS) return;
-#endif
if (otmp->lamplit) old_light = arti_light_radius(otmp);
otmp->cursed = 0;
otmp->blessed = 1;
{
int old_light = 0;
-#ifdef GOLDOBJ
if (otmp->oclass == COIN_CLASS) return;
-#endif
if (otmp->lamplit) old_light = arti_light_radius(otmp);
otmp->blessed = 0;
otmp->cursed = 1;
mtmp2->data = (struct permonst *)0;
mtmp2->minvent = (struct obj *)0;
if (mtmp->mextra) copy_mextra(mtmp2, mtmp);
-#ifndef GOLDOBJ
- /* not a pointer but is discarded along with minvent */
- mtmp2->mgold = 0L;
-#endif
}
return obj;
}
if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) {
mat_idx = objects[gold->otyp].oc_material;
-#ifndef GOLDOBJ
- mtmp->mgold += gold->quan;
- delobj(gold);
-#else
obj_extract_self(gold);
add_to_minv(mtmp, gold);
-#endif
if (cansee(mtmp->mx, mtmp->my) ) {
if (flags.verbose && !mtmp->isgd)
pline("%s picks up some %s.", Monnam(mtmp),
mdrop_special_objs(mdef);
/* release rest of monster's inventory--it is removed from game */
discard_minvent(mdef);
-#ifndef GOLDOBJ
- mdef->mgold = 0L;
-#endif
m_detach(mdef, mdef->data);
}
oldminvent = obj->nobj;
(void) add_to_container(otmp, obj);
}
-#ifndef GOLDOBJ
- if (mdef->mgold) {
- struct obj *au;
- au = mksobj(GOLD_PIECE, FALSE, FALSE);
- au->quan = mdef->mgold;
- au->owt = weight(au);
- (void) add_to_container(otmp, au);
- mdef->mgold = 0;
- }
-#endif
/* Archeologists should not break unique statues */
if (mdef->data->geno & G_UNIQ)
otmp->spe = 1;
if(!nearby || mtmp->mflee || scared ||
mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) ||
-#ifndef GOLDOBJ
- (mdat->mlet == S_LEPRECHAUN &&
- !u.ugold && (mtmp->mgold || rn2(2))) ||
-#else
(mdat->mlet == S_LEPRECHAUN &&
!findgold(invent) && (findgold(mtmp->minvent) || rn2(2))) ||
-#endif
(is_wanderer(mdat) && !rn2(4)) || (Conflict && !mtmp->iswiz) ||
(!mtmp->mcansee && !rn2(4)) || mtmp->mpeaceful) {
/* Possibly cast an undirected spell if not attacking you */
if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck))
appr = 0;
else {
-#ifdef GOLDOBJ
struct obj *lepgold, *ygold;
-#endif
boolean should_see = (couldsee(omx, omy) &&
(levl[gx][gy].lit ||
!levl[omx][omy].lit) &&
appr = 0;
if(monsndx(ptr) == PM_LEPRECHAUN && (appr == 1) &&
-#ifndef GOLDOBJ
- (mtmp->mgold > u.ugold))
-#else
( (lepgold = findgold(mtmp->minvent)) &&
(lepgold->quan > ((ygold = findgold(invent)) ? ygold->quan : 0L)) ))
-#endif
appr = -1;
if (!should_see && can_track(ptr)) {
{
boolean notseen, gotu;
register int disp, mx = mtmp->mux, my = mtmp->muy;
-#ifdef GOLDOBJ
long umoney = money_cnt(invent);
-#endif
/*
* do cheapest and/or most likely tests first
if (notseen || Underwater) {
/* Xorns can smell quantities of valuable metal
like that in solid gold coins, treat as seen */
- if ((mtmp->data == &mons[PM_XORN]) &&
-#ifndef GOLDOBJ
- u.ugold
-#else
- umoney
-#endif
- && !Underwater)
+ if ((mtmp->data == &mons[PM_XORN]) && umoney && !Underwater)
disp = 0;
else
disp = 1;
struct obj *chain, *obj;
if (mtmp == &youmonst) {
-#ifndef GOLDOBJ
- if (u.ugold > 100L) return TRUE;
-#endif
chain = invent;
} else {
-#ifndef GOLDOBJ
- if (mtmp->mgold > 100L) return TRUE;
-#endif
chain = mtmp->minvent;
}
for (obj = chain; obj; obj = obj->nobj) {
int typ = obj->otyp;
-#ifdef GOLDOBJ
if (typ == COIN_CLASS && obj->quan > 100L) return TRUE;
-#endif
if (obj->oclass != GEM_CLASS &&
!(typ >= ARROW && typ <= BOOMERANG) &&
!(typ >= DAGGER && typ <= CRYSKNIFE) &&
(void)mongets(mtmp, rnd_class(DILITHIUM_CRYSTAL, JADE));
/* To get the gold "right" would mean a player can double his */
/* gold supply by killing one mplayer. Not good. */
-#ifndef GOLDOBJ
- mtmp->mgold = rn2(1000);
-#else
mkmonmoney(mtmp, rn2(1000));
-#endif
quan = rn2(10);
while(quan--)
(void) mpickobj(mtmp, mkobj(RANDOM_CLASS, FALSE));
not_fully_identified(otmp)
register struct obj *otmp;
{
-#ifdef GOLDOBJ
/* gold doesn't have any interesting attributes [yet?] */
if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */
-#endif
/* check fundamental ID hallmarks first */
if (!otmp->known || !otmp->dknown ||
#ifdef MAIL
!strcmpi(bp, "coin") || *bp == GOLD_SYM) {
if (cnt > 5000 && !wizard) cnt = 5000;
else if (cnt < 1) cnt = 1;
-#ifndef GOLDOBJ
- pline("%d gold piece%s.", cnt, plur(cnt));
- u.ugold += (long) cnt;
- otmp = &zeroobj; /* readobjnam()'s return value for gold */
-#else
otmp = mksobj(GOLD_PIECE, FALSE, FALSE);
otmp->quan = (long) cnt;
otmp->owt = weight(otmp);
-#endif
context.botl = 1;
return otmp;
}
char *sp, buf[BUFSZ];
num = 0;
-#ifndef GOLDOBJ
- if (!index(op, GOLD_SYM))
- buf[num++] = COIN_CLASS;
-#else
/* !!!! probably unnecessary with gold as normal inventory */
-#endif
for (sp = op; *sp; sp++) {
oc_sym = def_char_to_objclass(*sp);
#define CONTAINED_SYM '>' /* from invent.c */
STATIC_DCL void FDECL(simple_look, (struct obj *,BOOLEAN_P));
-#ifndef GOLDOBJ
-STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *,
- const char *,struct obj *,BOOLEAN_P,BOOLEAN_P,int *));
-#else
STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *,
const char *,struct obj *,BOOLEAN_P,int *));
-#endif
STATIC_DCL boolean FDECL(fatal_corpse_mistake, (struct obj *,BOOLEAN_P));
STATIC_DCL void FDECL(check_here, (BOOLEAN_P));
STATIC_DCL boolean FDECL(n_or_more, (struct obj *));
}
}
-#ifndef GOLDOBJ
-int
-collect_obj_classes(ilets, otmp, here, incl_gold, filter, itemcount)
-char ilets[];
-register struct obj *otmp;
-boolean here, incl_gold;
-boolean FDECL((*filter),(OBJ_P));
-int *itemcount;
-#else
int
collect_obj_classes(ilets, otmp, here, filter, itemcount)
char ilets[];
boolean here;
boolean FDECL((*filter),(OBJ_P));
int *itemcount;
-#endif
{
register int iletct = 0;
register char c;
*itemcount = 0;
-#ifndef GOLDOBJ
- if (incl_gold)
- ilets[iletct++] = def_oc_syms[COIN_CLASS].sym;
-#endif
ilets[iletct] = '\0'; /* terminate ilets so that index() will work */
while (otmp) {
c = def_oc_syms[(int)otmp->oclass].sym;
* "?/a" or "a?/" or "/a?",&c picks all '?' even though no '/'
* (ie, treated as if it had just been "?a").
*/
-#ifndef GOLDOBJ
-STATIC_OVL boolean
-query_classes(oclasses, one_at_a_time, everything, action, objs,
- here, incl_gold, menu_on_demand)
-char oclasses[];
-boolean *one_at_a_time, *everything;
-const char *action;
-struct obj *objs;
-boolean here, incl_gold;
-int *menu_on_demand;
-#else
STATIC_OVL boolean
query_classes(oclasses, one_at_a_time, everything, action, objs,
here, menu_on_demand)
struct obj *objs;
boolean here;
int *menu_on_demand;
-#endif
{
char ilets[20], inbuf[BUFSZ];
int iletct, oclassct;
oclasses[oclassct = 0] = '\0';
*one_at_a_time = *everything = m_seen = FALSE;
iletct = collect_obj_classes(ilets, objs, here,
-#ifndef GOLDOBJ
- incl_gold,
-#endif
(boolean FDECL((*),(OBJ_P))) 0, &itemcount);
if (iletct == 0) {
return FALSE;
if (!query_classes(oclasses, &selective, &all_of_a_type,
"pick up", objchain,
traverse_how == BY_NEXTHERE,
-#ifndef GOLDOBJ
- FALSE,
-#endif
&via_menu)) {
if (!via_menu) return (0);
n = query_objlist("Pick up what?",
savequan = obj->quan;
saveowt = obj->owt;
-#ifndef GOLDOBJ
- umoney = u.ugold;
-#else
umoney = money_cnt(invent);
-#endif
iw = max_capacity();
if (count != savequan) {
return 0;
} else if (obj->oartifact && !touch_artifact(obj,&youmonst)) {
return 0;
-#ifndef GOLDOBJ
- } 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);
- const char *where = (obj->ox == u.ux && obj->oy == u.uy) ?
- "here" : "there";
-
- if (gold_capacity <= 0L) {
- pline(
- "There %s %ld gold piece%s %s, but you cannot carry any more.",
- otense(obj, "are"),
- obj->quan, plur(obj->quan), where);
- return 0;
- } else if (gold_capacity < count) {
- You("can only %s %s of the %ld gold pieces lying %s.",
- telekinesis ? "acquire" : "carry",
- gold_capacity == 1L ? "one" : "some", obj->quan, where);
- pline("%s %ld gold piece%s.",
- nearloadmsg, gold_capacity, plur(gold_capacity));
- u.ugold += gold_capacity;
- obj->quan -= gold_capacity;
- costly_gold(obj->ox, obj->oy, gold_capacity);
- } else {
- u.ugold += count;
- if (count == obj->quan)
- /* costly_gold() can trigger --More-- prompt, so
- take gold off map before messages in order to
- prevent hangup save there from duplicating it */
- obj_extract_self(obj); /* remove from floor */
- else
- obj->quan -= count;
- if ((nearload = near_capacity()) != 0)
- pline("%s %ld gold piece%s.",
- nearload < MOD_ENCUMBER ?
- moderateloadmsg : nearloadmsg,
- count, plur(count));
- else
- prinv((char *) 0, obj, count);
- costly_gold(obj->ox, obj->oy, count);
- if (obj->where == OBJ_FREE)
- delobj(obj);
- }
- context.botl = 1;
- if (context.run) nomul(0);
- return 1;
-#endif
} else if (obj->otyp == CORPSE) {
if (fatal_corpse_mistake(obj, telekinesis) ||
rider_corpse_revival(obj, telekinesis))
if ((res = lift_object(obj, (struct obj *)0, &count, telekinesis)) <= 0)
return res;
-#ifdef GOLDOBJ
/* Whats left of the special case for gold :-) */
if (obj->oclass == COIN_CLASS) context.botl = 1;
-#endif
if (obj->quan != count && obj->otyp != LOADSTONE)
obj = splitobj(obj, count);
* and putting it in the hero's inventory. Take care of billing. Return a
* pointer to the object where otmp ends up. This may be different
* from otmp because of merging.
- *
- * Gold never reaches this routine unless GOLDOBJ is defined.
*/
struct obj *
pick_obj(otmp)
return FALSE;
}
-#ifndef GOLDOBJ
- if (u.ugold) {
- contribution = ((long)rnd(5) * u.ugold + 4L) / 5L;
- goldob = mkgoldobj(contribution);
- }
-#else
/* find a money object to mess with */
for (goldob = invent; goldob; goldob = goldob->nobj)
if (goldob->oclass == COIN_CLASS) {
goldob = splitobj(goldob, contribution);
break;
}
-#endif
if (!goldob) return FALSE;
if (!IS_THRONE(levl[x][y].typ)) {
if (coffers) {
verbalize("Thank you for your contribution to reduce the debt.");
-#ifdef GOLDOBJ
freeinv(goldob);
-#endif
(void)add_to_container(coffers, goldob);
coffers->owt = weight(coffers);
coffers->cknown = 0;
(void)boxlock(coffers, &boxdummy);
}
} else if ((mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
-#ifndef GOLDOBJ
- mon->mgold += goldob->quan;
- delobj(goldob);
-#else
freeinv(goldob);
add_to_minv(mon, goldob);
-#endif
pline("The exchequer accepts your contribution.");
} else {
You("drop %s.", doname(goldob));
otmp, count);
if (is_gold) {
-#ifndef GOLDOBJ
- dealloc_obj(obj);
-#endif
bot(); /* update character's gold piece count immediately */
}
return 1;
int held;
{
struct obj *curr, *otmp, *obj = *objp;
-#ifndef GOLDOBJ
- struct obj *u_gold = (struct obj *)0;
-#endif
boolean quantum_cat, cursed_mbag,
loot_out, loot_in, loot_in_first, stash_one,
inokay, outokay, outmaybe;
}
inokay = (invent != 0 &&
!(invent == current_container && !current_container->nobj));
-#ifndef GOLDOBJ
- if (u.ugold) inokay = TRUE;
-#endif
outokay = Has_contents(current_container);
if (!outokay) /* preformat the empty-container message */
Sprintf(emptymsg, "%s is %sempty.",
}
}
-#ifndef GOLDOBJ
- /* if putting in, place gold where inventory traversal will see it */
- if ((loot_in || stash_one) && u.ugold)
- u_gold = insert_gold_into_invent(TRUE);
-#endif
if ((loot_in || stash_one) &&
(!invent || (invent == current_container && !invent->nobj))) {
You("don't have anything%s to %s.",
/* putting something in might have triggered magic bag explosion */
if (!current_container) loot_out = FALSE;
-#ifndef GOLDOBJ
- /* if we put gold into inventory above, take it back out now */
- if (u_gold) remove_gold_from_invent();
-#endif
-
/* out after in */
if (loot_out && loot_in_first) {
if (!Has_contents(current_container)) {
if (query_classes(selection, &one_by_one, &allflag,
action, *objlist, FALSE,
-#ifndef GOLDOBJ
- put_in ? (boolean)(u.ugold != 0L) : FALSE,
-#endif
&menu_on_request)) {
if (askchain(objlist, (one_by_one ? (char *)0 : selection),
allflag, actionfunc, checkfunc, 0, action))
priest->mpeaceful = 0;
return;
}
-#ifndef GOLDOBJ
- if(!u.ugold) {
- if(coaligned && !strayed) {
- if (priest->mgold > 0L) {
- /* Note: two bits is actually 25 cents. Hmm. */
- pline("%s gives you %s for an ale.", Monnam(priest),
- (priest->mgold == 1L) ? "one bit" : "two bits");
- if (priest->mgold > 1L)
- u.ugold = 2L;
- else
- u.ugold = 1L;
- priest->mgold -= u.ugold;
- context.botl = 1;
-#else
if(!money_cnt(invent)) {
if(coaligned && !strayed) {
long pmoney = money_cnt(priest->minvent);
pline("%s gives you %s for an ale.", Monnam(priest),
(pmoney == 1L) ? "one bit" : "two bits");
money2u(priest, pmoney > 1L ? 2 : 1);
-#endif
} else
pline("%s preaches the virtues of poverty.", Monnam(priest));
exercise(A_WIS, TRUE);
verbalize("Thou shalt regret thine action!");
if(coaligned) adjalign(-1);
} else if(offer < (u.ulevel * 200)) {
-#ifndef GOLDOBJ
- if(u.ugold > (offer * 2L)) verbalize("Cheapskate.");
-#else
if(money_cnt(invent) > (offer * 2L)) verbalize("Cheapskate.");
-#endif
else {
verbalize("I thank thee for thy contribution.");
/* give player some token */
}
} else if(offer < (u.ulevel * 400)) {
verbalize("Thou art indeed a pious individual.");
-#ifndef GOLDOBJ
- if(u.ugold < (offer * 2L)) {
-#else
if(money_cnt(invent) < (offer * 2L)) {
-#endif
if (coaligned && u.ualign.record <= ALGN_SINNED)
adjalign(1);
verbalize("I bestow upon thee a blessing.");
} else u.ublessed++;
} else {
verbalize("Thy selfless generosity is deeply appreciated.");
-#ifndef GOLDOBJ
- if(u.ugold < (offer * 2L) && coaligned) {
-#else
if(money_cnt(invent) < (offer * 2L) && coaligned) {
-#endif
if(strayed && (moves - u.ucleansed) > 5000L) {
u.ualign.record = 0; /* cleanse thee */
u.ucleansed = moves;
} else {
for (obj = invent; obj; obj = obj->nobj) {
long wornmask;
-#ifdef GOLDOBJ
/* gold isn't subject to cursing and blessing */
if (obj->oclass == COIN_CLASS) continue;
-#endif
wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI));
if (wornmask && !sblessed) {
/* handle a couple of special cases; we don't
for (otmp = invent; otmp; otmp = otmp2) {
otmp2 = otmp->nobj;
-#ifndef GOLDOBJ
- 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");
- }
- extract_nobj(otmp, &invent);
- otmp->in_use = FALSE;
- dealloc_obj(otmp);
- } else
-#endif /* GOLDOBJ */
if (otmp->in_use) {
if (!quietly) pline("Finishing off %s...", xname(otmp));
useup(otmp);
/* restore monster back pointer */
for (obj = mtmp->minvent; obj; obj = obj->nobj)
obj->ocarry = mtmp;
-#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
- put_gold_back(mtmp);
-#endif
}
if (mtmp->mw) {
struct obj *obj;
restore_timers(fd, RANGE_GLOBAL, FALSE, 0L);
restore_light_sources(fd);
invent = restobjchn(fd, FALSE, FALSE);
-#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
- put_gold_back(&youmonst);
-#endif
/* tmp_bc only gets set here if the ball & chain were orphaned
because you were swallowed; otherwise they will be on the floor
or in your inventory */
}
}
-#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
-/* used to make save & bones files be compatible with GOLDOBJ config;
- takes all of the gold objects out of the invent or mtmp->minvent
- chain and puts it into either u.ugold or mtmp->mgold */
-void
-put_gold_back(mon)
-struct monst *mon;
-{
- struct obj *goldobj;
- boolean is_hero = (mon == &youmonst);
-
- /* there could be two gold objects in invent if a hangup save was
- performed while gold was in invent for Drop or container access */
- while ((goldobj = (is_hero ? carrying(GOLD_PIECE) :
- m_carrying(mon, GOLD_PIECE))) != 0) {
- extract_nobj(goldobj, is_hero ? &invent : &mon->minvent);
- if (!goldobj->in_use) {
- if (is_hero) u.ugold += goldobj->quan;
- else mon->mgold += goldobj->quan;
- }
- dealloc_obj(goldobj);
- }
-}
-#endif /*GOLDOBJ*/
-
/*restore.c*/
center(NAME_LINE, buf);
/* Put $ on stone */
-#ifndef GOLDOBJ
- Sprintf(buf, "%ld Au", u.ugold);
-#else
Sprintf(buf, "%ld Au", done_money);
-#endif
buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
center(GOLD_LINE, buf);
char qbuf[QBUFSZ];
multi = 0;
-#ifndef GOLDOBJ
- umoney = u.ugold;
-#else
umoney = money_cnt(invent);
-#endif
if (!oracl) {
There("is no one here to consult.");
u_pay = (umoney < (long)major_cost) ? (int)umoney : major_cost;
break;
}
-#ifndef GOLDOBJ
- u.ugold -= (long)u_pay;
- oracl->mgold += (long)u_pay;
-#else
money2mon(oracl, (long)u_pay);
-#endif
context.botl = 1;
add_xpts = 0; /* first oracle of each type gives experience points */
if (u_pay == minor_cost) {
bwrite(fd, (genericptr_t) &flags, sizeof(struct flag));
#ifdef SYSFLAGS
bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag));
-#endif
-#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
- if (u.ugold) (void)insert_gold_into_invent(FALSE);
#endif
bwrite(fd, (genericptr_t) &u, sizeof(struct you));
bwrite(fd, yyyymmddhhmmss(ubirthday), 14);
save_light_sources(fd, mode, RANGE_GLOBAL);
saveobjchn(fd, invent, mode);
-#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
- if (!release_data(mode)) remove_gold_from_invent();
-#endif
if (BALL_IN_MON) {
/* prevent loss of ball & chain when swallowed */
uball->nobj = uchain;
if (perform_bwrite(mode)) {
mtmp->mnum = monsndx(mtmp->data);
if (mtmp->ispriest) forget_temple_entry(mtmp); /* EPRI() */
-#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
- if (mtmp->mgold) {
- struct obj *goldobj = mksobj(GOLD_PIECE, FALSE, FALSE);
-
- goldobj->quan = mtmp->mgold;
- mtmp->mgold = 0L;
- add_to_minv(mtmp, goldobj);
- }
-#endif
savemon(fd, mtmp);
}
if (mtmp->minvent)
saveobjchn(fd,mtmp->minvent,mode);
-#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
- if (!release_data(mode)) put_gold_back(mtmp);
-#endif
if (release_data(mode))
dealloc_monst(mtmp);
mtmp = mtmp2;
*/
-#ifdef GOLDOBJ
/*
Transfer money from inventory to monster when paying
shopkeepers, priests, oracle, succubus, & other demons.
}
}
-#endif /* GOLDOBJ */
-
STATIC_OVL struct monst *
next_shkp(shkp, withbill)
register struct monst *shkp;
long robbed = ESHK(shkp)->robbed;
long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp));
-#ifndef GOLDOBJ
- u.ugold -= balance;
- shkp->mgold += balance;
-#else
if (balance > 0) money2mon(shkp, balance);
else if (balance < 0) money2u(shkp, -balance);
-#endif
context.botl = 1;
if(robbed) {
robbed -= tmp;
}
if(shkp != resident && NOTANGRY(shkp)) {
-#ifdef GOLDOBJ
umoney = money_cnt(invent);
-#else
- umoney = u.ugold;
-#endif
if(!ltmp)
You("do not owe %s anything.", mon_nam(shkp));
else if(!umoney) {
/* ltmp is still eshkp->robbed here */
if (!eshkp->billct && !eshkp->debit) {
-#ifdef GOLDOBJ
umoney = money_cnt(invent);
-#else
- umoney = u.ugold;
-#endif
if(!ltmp && NOTANGRY(shkp)) {
You("do not owe %s anything.", shkname(shkp));
if (!umoney)
long dtmp = eshkp->debit;
long loan = eshkp->loan;
char sbuf[BUFSZ];
-#ifdef GOLDOBJ
umoney = money_cnt(invent);
-#endif
Sprintf(sbuf, "You owe %s %ld %s ",
shkname(shkp), dtmp, currency(dtmp));
if(loan) {
"for gold picked up and the use of merchandise.");
} else Strcat(sbuf, "for the use of merchandise.");
pline1(sbuf);
-#ifndef GOLDOBJ
- if (u.ugold + eshkp->credit < dtmp) {
-#else
if (umoney + eshkp->credit < dtmp) {
-#endif
pline("But you don't%s have enough gold%s.",
stashed_gold ? " seem to" : "",
eshkp->credit ? " or credit" : "");
eshkp->loan = 0L;
Your("debt is covered by your credit.");
} else if (!eshkp->credit) {
-#ifndef GOLDOBJ
- u.ugold -= dtmp;
- shkp->mgold += dtmp;
-#else
money2mon(shkp, dtmp);
-#endif
eshkp->debit = 0L;
eshkp->loan = 0L;
You("pay that debt.");
} else {
dtmp -= eshkp->credit;
eshkp->credit = 0L;
-#ifndef GOLDOBJ
- u.ugold -= dtmp;
- shkp->mgold += dtmp;
-#else
money2mon(shkp, dtmp);
-#endif
eshkp->debit = 0L;
eshkp->loan = 0L;
pline("That debt is partially offset by your credit.");
/* now check items on bill */
if (eshkp->billct) {
register boolean itemize;
-#ifndef GOLDOBJ
- if (!u.ugold && !eshkp->credit) {
-#else
umoney = money_cnt(invent);
if (!umoney && !eshkp->credit) {
-#endif
You("%shave no money or credit%s.",
stashed_gold ? "seem to " : "",
paid ? " left" : "");
return(0);
}
-#ifndef GOLDOBJ
- if ((u.ugold + eshkp->credit) < cheapest_item(shkp)) {
-#else
if ((umoney + eshkp->credit) < cheapest_item(shkp)) {
-#endif
You("don't have enough money to buy%s the item%s you picked.",
eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct));
if(stashed_gold)
{
register struct obj *obj = *obj_p;
long ltmp, quan, save_quan;
-#ifdef GOLDOBJ
long umoney = money_cnt(invent);
-#else
- long umoney = u.ugold;
-#endif
int buy;
boolean stashed_gold = (hidden_gold() > 0L),
consumed = (which == 0);
int croaked;
{
long loss = 0L;
-#ifdef GOLDOBJ
long umoney;
-#endif
struct eshk *eshkp = ESHK(shkp);
boolean take = FALSE, taken = FALSE;
unsigned save_minvis = shkp->minvis;
}
if (eshkp->following || ANGRY(shkp) || take) {
-#ifndef GOLDOBJ
- if (!invent && !u.ugold) goto skip;
-#else
if (!invent) goto skip;
umoney = money_cnt(invent);
-#endif
takes[0] = '\0';
if (!shkp->mcanmove || shkp->msleeping)
Strcat(takes, "wakes up and ");
Strcat(takes, "comes and ");
Strcat(takes, "takes");
-#ifndef GOLDOBJ
- if (loss > u.ugold || !loss || roomno == eshkp->shoproom) {
- eshkp->robbed -= u.ugold;
- if (eshkp->robbed < 0L) eshkp->robbed = 0L;
- shkp->mgold += u.ugold;
- u.ugold = 0L;
-#else
if (loss > umoney || !loss || roomno == eshkp->shoproom) {
eshkp->robbed -= umoney;
if (eshkp->robbed < 0L) eshkp->robbed = 0L;
if (umoney > 0) money2mon(shkp, umoney);
-#endif
context.botl = 1;
pline("%s %s all your possessions.",
shkname(shkp), takes);
/* where to put player's invent (after disclosure) */
set_repo_loc(shkp);
} else {
-#ifndef GOLDOBJ
- shkp->mgold += loss;
- u.ugold -= loss;
-#else
money2mon(shkp, loss);
-#endif
context.botl = 1;
pline("%s %s the %ld %s %sowed %s.",
Monnam(shkp), takes,
unleash_all();
/* if hero has any gold left, take it into shopkeeper's possession */
if (shkp) {
-#ifdef GOLDOBJ
long umoney = money_cnt(invent);
if (umoney) money2mon(shkp, umoney);
-#else
- shkp->mgold += u.ugold;
- u.ugold = 0L;
-#endif
}
/* transfer rest of the character's inventory to the shop floor */
drop_upon_death((struct monst *)0, (struct obj *)0, ox, oy);
return;
}
-#ifndef GOLDOBJ
- shkmoney = shkp->mgold;
-#else
shkmoney = money_cnt(shkp->minvent);
-#endif
if (!shkmoney) {
char c, qbuf[BUFSZ];
long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L);
}
if((um_dist(x, y, 1) && !uinshp) || cant_mollify ||
-#ifndef GOLDOBJ
- (u.ugold + ESHK(shkp)->credit) < cost_of_damage
-#else
(money_cnt(invent) + ESHK(shkp)->credit) < cost_of_damage
-#endif
|| !rn2(50)) {
getcad:
if (muteshk(shkp)) {
currency(cost_of_damage), !animal ? "\"" : "");
if(yn(qbuf) != 'n') {
cost_of_damage = check_credit(cost_of_damage, shkp);
-#ifndef GOLDOBJ
- u.ugold -= cost_of_damage;
- shkp->mgold += cost_of_damage;
-#else
money2mon(shkp, cost_of_damage);
-#endif
context.botl = 1;
pline("Mollified, %s accepts your restitution.",
shkname(shkp));
struct monst *shkp;
{
struct eshk *eshk;
-#ifdef GOLDOBJ
long shkmoney;
-#endif
if (!shkp->isshk) {
/* The monster type is shopkeeper, but this monster is
not actually a shk, which could happen if someone
shkname(shkp), eshk->credit, currency(eshk->credit));
else if (eshk->robbed)
pline("%s complains about a recent robbery.", shkname(shkp));
-#ifndef GOLDOBJ
- else if (shkp->mgold < 50)
-#else
else if ((shkmoney = money_cnt(shkp->minvent)) < 50)
-#endif
pline("%s complains that business is bad.", shkname(shkp));
-#ifndef GOLDOBJ
- else if (shkp->mgold > 4000)
-#else
else if (shkmoney > 4000)
-#endif
pline("%s says that business is good.", shkname(shkp));
else if (is_izchak(shkp, FALSE))
pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))],shkname(shkp));
eshkp->billct = eshkp->visitct = 0;
eshkp->bill_p = (struct bill_x *)0;
eshkp->customer[0] = '\0';
-#ifndef GOLDOBJ
- shk->mgold = 1000L + 30L*(long)rnd(100); /* initial capital */
-#else
mkmonmoney(shk, 1000L + 30L*(long)rnd(100)); /* initial capital */
-#endif
if (shp->shknms == shkrings)
(void) mongets(shk, TOUCHSTONE);
nameshk(shk, shp->shknms);
void
take_gold()
{
-#ifndef GOLDOBJ
- if (u.ugold <= 0) {
- You_feel("a strange sensation.");
- } else {
- You("notice you have no gold!");
- u.ugold = 0;
- context.botl = 1;
- }
-#else
struct obj *otmp, *nobj;
int lost_money = 0;
for (otmp = invent; otmp; otmp = nobj) {
You("notice you have no money!");
context.botl = 1;
}
-#endif
}
int
}
for (otmp = invent; otmp; otmp = otmp->nobj) {
-#ifdef GOLDOBJ
/* gold isn't subject to being cursed or blessed */
if (otmp->oclass == COIN_CLASS) continue;
-#endif
nobj++;
}
if (nobj) {
cnt > 0; cnt--) {
onum = rnd(nobj);
for (otmp = invent; otmp; otmp = otmp->nobj) {
-#ifdef GOLDOBJ
/* as above */
if (otmp->oclass == COIN_CLASS) continue;
-#endif
if (--onum == 0) break; /* found the target */
}
/* the !otmp case should never happen; picking an already
else verbl_msg = "Relax, this won't hurt a bit.";
break;
case MS_GUARD:
-#ifndef GOLDOBJ
- if (u.ugold)
-#else
if (money_cnt(invent))
-#endif
verbl_msg = "Please drop that gold and follow me.";
else
verbl_msg = "Please follow me.";
"armor");
}
-#ifndef GOLDOBJ
-long /* actually returns something that fits in an int */
-somegold()
-{
-#ifdef LINT /* long conv. ok */
- return(0L);
-#else
- return (long)( (u.ugold < 100) ? u.ugold :
- (u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold) );
-#endif
-}
-
-void
-stealgold(mtmp)
-register struct monst *mtmp;
-{
- register struct obj *gold = g_at(u.ux, u.uy);
- register long tmp;
- struct monst *who;
- const char *whose, *what;
-
- if (gold && (!u.ugold || gold->quan > u.ugold || !rn2(5))) {
- mtmp->mgold += gold->quan;
- delobj(gold);
- newsym(u.ux, u.uy);
- if (u.usteed) {
- who = u.usteed;
- whose = s_suffix(y_monnam(who));
- what = makeplural(mbodypart(who, FOOT));
- } else {
- who = &youmonst;
- whose = "your";
- what = makeplural(body_part(FOOT));
- }
- /* [ avoid "between your rear regions" :-] */
- if (slithy(who->data)) what = "coils";
- /* reduce "rear hooves/claws" to "hooves/claws" */
- if (!strncmp(what, "rear ", 5)) what += 5;
- pline("%s quickly snatches some gold from %s %s %s!",
- Monnam(mtmp),
- (Levitation || Flying) ? "beneath" : "between",
- whose, what);
- if(!u.ugold || !rn2(5)) {
- if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
- /* do not set mtmp->mavenge here; gold on the floor is fair game */
- monflee(mtmp, 0, FALSE, FALSE);
- }
- } else if(u.ugold) {
- u.ugold -= (tmp = somegold());
- Your("purse feels lighter.");
- mtmp->mgold += tmp;
- if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
- mtmp->mavenge = 1;
- monflee(mtmp, 0, FALSE, FALSE);
- context.botl = 1;
- }
-}
-
-#else /* !GOLDOBJ */
-
long /* actually returns something that fits in an int */
somegold(umoney)
long umoney;
context.botl = 1;
}
}
-#endif /* GOLDOBJ */
/* steal armor after you finish taking it off */
unsigned int stealoid; /* object to be stolen */
/* Returns 1 when something was stolen (or at least, when N should flee now)
* Returns -1 if the monster died in the attempt
* Avoid stealing the object stealoid
- * GOLDOBJ: nymphs and monkeys won't steal coins
+ * Nymphs and monkeys won't steal coins
*/
int
steal(mtmp, objnambuf)
tmp = 0;
for(otmp = invent; otmp; otmp = otmp->nobj)
if ((!uarm || otmp != uarmc) && otmp != uskin
-#ifdef GOLDOBJ
&& otmp->oclass != COIN_CLASS
-#endif
#ifdef INVISIBLE_OBJECTS
&& (!otmp->oinvis || perceives(mtmp->data))
#endif
tmp = rn2(tmp);
for(otmp = invent; otmp; otmp = otmp->nobj)
if ((!uarm || otmp != uarmc) && otmp != uskin
-#ifdef GOLDOBJ
&& otmp->oclass != COIN_CLASS
-#endif
#ifdef INVISIBLE_OBJECTS
&& (!otmp->oinvis || perceives(mtmp->data))
#endif
or kicking code shouldn't continue to track and place it */
if (otmp == thrownobj) thrownobj = 0;
else if (otmp == kickedobj) kickedobj = 0;
-#ifndef GOLDOBJ
- if (otmp->oclass == COIN_CLASS) {
- mtmp->mgold += otmp->quan;
- obfree(otmp, (struct obj *)0);
- freed_otmp = 1;
- } else {
-#endif
boolean snuff_otmp = FALSE;
/* don't want hidden light source inside the monster; assumes that
engulfers won't have external inventories; whirly monsters cause
freed_otmp = add_to_minv(mtmp, otmp);
/* and we had to defer this until object is in mtmp's inventory */
if (snuff_otmp) snuff_light_source(mtmp->mx, mtmp->my);
-#ifndef GOLDOBJ
- }
-#endif
return freed_otmp;
}
/* vault guard's gold goes away rather than be dropped... */
if (mtmp->isgd &&
-#ifdef GOLDOBJ
(otmp = findgold(mtmp->minvent)) != 0
-#else
- mtmp->mgold != 0L
-#endif
) {
if (canspotmon(mtmp))
pline("%s gold %s.", s_suffix(Monnam(mtmp)),
canseemon(mtmp) ? "vanishes" : "seems to vanish");
-#ifdef GOLDOBJ
obfree(otmp, (struct obj *)0);
-#else
- mtmp->mgold = 0L;
-#endif
} /* isgd && has gold */
-#ifndef GOLDOBJ
- /* handle gold first since droppables() would get stuck on it */
- if (mtmp->mgold) {
- long g = mtmp->mgold;
-
- (void) mkgold(g, omx, omy);
- if (is_pet && cansee(omx, omy) && flags.verbose)
- pline("%s drops %ld gold piece%s.", Monnam(mtmp),
- g, plur(g));
- mtmp->mgold = 0L;
- }
-#endif
-
while ((otmp = (is_pet ? droppables(mtmp) : mtmp->minvent)) != 0) {
obj_extract_self(otmp);
mdrop_obj(mtmp, otmp, is_pet && flags.verbose);
/* else continue */
}
}
-#ifndef GOLDOBJ
- if (!otmp) {
- /* Nothing available left to drop; try gold */
- if (u.ugold) {
- pline("In desperation, you drop your purse.");
- /* Hack: gold is not in the inventory, so make a gold object
- * and put it at the head of the inventory list.
- */
- obj = mkgoldobj(u.ugold); /* removes from u.ugold */
- obj->in_use = TRUE;
- u.ugold = obj->quan; /* put the gold back */
- assigninvlet(obj); /* might end up as NOINVSYM */
- obj->nobj = invent;
- invent = obj;
- *lostsome = TRUE;
- dropx(obj);
- continue; /* Try again */
- }
- /* We can't even drop gold! */
- return (FALSE);
- }
-#else
if (!otmp) return (FALSE); /* nothing to drop! */
-#endif
if (otmp->owornmask) remove_worn_item(otmp, FALSE);
*lostsome = TRUE;
dropx(otmp);
{ WAN_WISHING, 3, WAND_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 }
};
-#ifdef GOLDOBJ
static struct trobj Money[] = {
{ GOLD_PIECE, 0 , COIN_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 }
};
-#endif
/* race-based substitutions for initial inventory;
the weaker cloak for elven rangers is intentional--they shoot better */
skill_init(Skill_C);
break;
case PM_HEALER:
-#ifndef GOLDOBJ
- u.ugold = u.ugold0 = rn1(1000, 1001);
-#else
u.umoney0 = rn1(1000, 1001);
-#endif
ini_inv(Healer);
if(!rn2(25)) ini_inv(Lamp);
knows_object(POT_FULL_HEALING);
break;
case PM_ROGUE:
Rogue[R_DAGGERS].trquan = rn1(10, 6);
-#ifndef GOLDOBJ
- u.ugold = u.ugold0 = 0;
-#else
u.umoney0 = 0;
-#endif
ini_inv(Rogue);
if(!rn2(5)) ini_inv(Blindfold);
knows_object(SACK);
break;
case PM_TOURIST:
Tourist[T_DARTS].trquan = rn1(20, 21);
-#ifndef GOLDOBJ
- u.ugold = u.ugold0 = rnd(1000);
-#else
u.umoney0 = rnd(1000);
-#endif
ini_inv(Tourist);
if(!rn2(25)) ini_inv(Tinopener);
else if(!rn2(25)) ini_inv(Leash);
if (wizard)
read_wizkit();
-#ifndef GOLDOBJ
- u.ugold0 += hidden_gold(); /* in case sack has gold in it */
-#else
if (u.umoney0) ini_inv(Money);
u.umoney0 += hidden_gold(); /* in case sack has gold in it */
-#endif
find_ac(); /* get initial ac value */
init_attr(75); /* init attribute values */
nocreate4 = otyp;
}
-#ifdef GOLDOBJ
if (trop->trclass == COIN_CLASS) {
/* no "blessed" or "identified" money */
obj->quan = u.umoney0;
} else {
-#endif
if (objects[otyp].oc_uses_known) obj->known = 1;
obj->dknown = obj->bknown = obj->rknown = 1;
if (Is_container(obj) || obj->otyp == STATUE) {
obj->spe = trop->trspe;
if (trop->trbless != UNDEF_BLESS)
obj->blessed = trop->trbless;
-#ifdef GOLDOBJ
}
-#endif
/* defined after setting otyp+quan + blessedness */
obj->owt = weight(obj);
obj = addinv(obj);
tmp = 0;
break;
case AD_SGLD:
-#ifndef GOLDOBJ
- if (mdef->mgold) {
- u.ugold += mdef->mgold;
- mdef->mgold = 0;
- Your("purse feels heavier.");
- }
-#else
/* This you as a leprechaun, so steal
real gold only, no lesser coins */
{
}
}
}
-#endif
exercise(A_DEX, TRUE);
tmp = 0;
break;
return;
}
verbalize("I don't know you.");
-#ifndef GOLDOBJ
- umoney = u.ugold;
-#else
umoney = money_cnt(invent);
-#endif
if (Deaf) {
;
} else if (!umoney && !hidden_gold()) {
grd_in_vault = *in_rooms(grd->mx, grd->my, VAULT)?
TRUE : FALSE;
boolean disappear_msg_seen = FALSE, semi_dead = (grd->mhp <= 0);
-#ifndef GOLDOBJ
- register boolean u_carry_gold = ((u.ugold + hidden_gold()) > 0L);
-#else
long umoney = money_cnt(invent);
register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L);
-#endif
boolean see_guard, newspot = FALSE;
if(!on_level(&(egrd->gdlevel), &u.uz)) return(-1);
if(egrd->warncnt == 3 && !Deaf)
verbalize("I repeat, %sfollow me!",
u_carry_gold ? (
-#ifndef GOLDOBJ
- !u.ugold ?
- "drop that hidden gold and " :
- "drop that gold and ") : "");
-#else
!umoney ?
"drop that hidden money and " :
"drop that money and ") : "");
-#endif
if(egrd->warncnt == 7) {
m = grd->mx;
n = grd->my;
if (m == u.ux && n == u.uy) {
struct obj *gold = g_at(m,n);
/* Grab the gold from between the hero's feet. */
-#ifndef GOLDOBJ
- grd->mgold += gold->quan;
- delobj(gold);
-#else
obj_extract_self(gold);
add_to_minv(grd, gold);
-#endif
newsym(m,n);
} else if (m == x && n == y) {
mpickgold(grd); /* does a newsym */
paygd()
{
register struct monst *grd = findgd();
-#ifndef GOLDOBJ
- struct obj *gold;
-#else
long umoney = money_cnt(invent);
struct obj *coins, *nextcoins;
-#endif
int gx,gy;
char buf[BUFSZ];
-#ifndef GOLDOBJ
- if (!u.ugold || !grd) return;
-#else
if (!umoney || !grd) return;
-#endif
if (u.uinvault) {
Your("%ld %s goes into the Magic Memory Vault.",
-#ifndef GOLDOBJ
- u.ugold,
- currency(u.ugold));
-#else
umoney,
currency(umoney));
-#endif
gx = u.ux;
gy = u.uy;
} else {
plname, mons[u.umonster].mname);
make_grave(gx, gy, buf);
}
-#ifndef GOLDOBJ
- place_object(gold = mkgoldobj(u.ugold), gx, gy);
- stackobj(gold);
-#else
for (coins = invent; coins; coins = nextcoins) {
nextcoins = coins->nobj;
if (objects[coins->otyp].oc_class == COIN_CLASS) {
stackobj(coins);
}
}
-#endif
mongone(grd);
}
static NEARDATA const char wield_objs[] =
{ ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, TOOL_CLASS, 0 };
-#ifdef GOLDOBJ
static NEARDATA const char ready_objs[] =
{ COIN_CLASS, ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 };
static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */
{ COIN_CLASS, ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 };
-#else
-static NEARDATA const char ready_objs[] =
- { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 };
-static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */
- { ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 };
-#endif
int
dowield()
mstatusline(mtmp);
if (notonhead) return; /* don't show minvent for long worm tail */
-#ifndef GOLDOBJ
- if (mtmp->minvent || mtmp->mgold) {
-#else
if (mtmp->minvent) {
-#endif
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) {
otmp->dknown = 1; /* treat as "seen" */
if (Is_container(otmp) || otmp->otyp == STATUE) {
obfree(otmp, (struct obj *)0);
}
}
-#ifndef GOLDOBJ
- mon->mgold = 0L;
-#endif
#undef oresist_disintegration
tomb_text(buf);
/* Put $ on stone */
- Sprintf(buf, "%ld Au",
-#ifndef GOLDOBJ
- u.ugold);
-#else
- done_money);
-#endif
+ Sprintf(buf, "%ld Au", done_money);
buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
tomb_text(buf);
(void) describe_level(nb=eos(nb));
Sprintf(nb = eos(nb),
"%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", showsyms[COIN_CLASS + SYM_OFF_O],
-#ifndef GOLDOBJ
- u.ugold,
-#else
money_cnt(invent),
-#endif
hp, hpmax, u.uen, u.uenmax, u.uac);
if (Upolyd)
*
*/
#define IGNORED_FEATURES ( 0L \
- | (1L << 12) /* GOLDOBJ */ \
| (1L << 19) /* EXP_ON_BOTL */ \
| (1L << 20) /* SCORE_ON_BOTL */ \
| (1L << 27) /* ZEROCOMP */ \
| (1L << 6)
#endif
/* objects (10..14) */
-#ifdef GOLDOBJ
- | (1L << 10)
-#endif
/* flag bits and/or other global variables (15..26) */
#ifdef TEXTCOLOR
| (1L << 17)
#ifdef MFLOPPY
"floppy drive support",
#endif
-#ifdef GOLDOBJ
- "gold object in inventories",
-#endif
#ifdef INSURANCE
"insurance files for recovering from crashes",
#endif
dlevel.setLabel(buf,(long)depth(&u.uz));
}
-#ifndef GOLDOBJ
- gold.setLabel("Au:", u.ugold);
-#else
gold.setLabel("Au:", money_cnt(invent));
-#endif
if (u.mtimedone) {
// You're a monster!
Sprintf(rip_line[NAME_LINE], "%s", plname);
/* Put $ on stone */
-#ifndef GOLDOBJ
- Sprintf(rip_line[GOLD_LINE], "%ld Au", u.ugold);
-#else
Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money);
-#endif
/* Put together death description */
formatkiller(buf, sizeof buf, how);
case F_NAME: val = (long) 0L; break; /* special */
case F_DLEVEL: val = (long) 0L; break; /* special */
-#ifndef GOLDOBJ
- case F_GOLD: val = (long) u.ugold; break;
-#else
case F_GOLD: val = money_cnt(invent); break;
-#endif
case F_HP: val = (long) (u.mtimedone ?
(u.mh > 0 ? u.mh : 0):
(u.uhp > 0 ? u.uhp : 0)); break;
/* Put $ on stone */
Sprintf(rip_line[GOLD_LINE], "%ld Au",
-#ifndef GOLDOBJ
- u.ugold);
-#else
done_money);
-#endif
/* Put together death description */
formatkiller(buf, sizeof buf, how);
Sprintf(rip_line[NAME_LINE], "%s", plname);
/* Put $ on stone */
Sprintf(rip_line[GOLD_LINE], "%ld Au",
-#ifndef GOLDOBJ
- u.ugold);
-#else
done_money);
-#endif
/* Put together death description */
formatkiller(buf, sizeof buf, how);
Strcat(ripString, buf);
/* Put $ on stone */
- Sprintf(buf, "%ld Au\n",
-#ifndef GOLDOBJ
- u.ugold);
-#else
- done_money);
-#endif
+ Sprintf(buf, "%ld Au\n", done_money);
Strcat(ripString, buf);
/* Put together death description */
const char* hung;
const char* enc;
static int firstTime=TRUE;
-#ifdef GOLDOBJ
long umoney;
-#endif
/* First, fill in the player name and the dungeon level */
strcpy(buf, plname);
gtk_label_set( GTK_LABEL( chaLabel), buf);
/* Now do the non-pixmaped stats (gold and such) */
-#ifndef GOLDOBJ
- sprintf(buf,"Au:%ld", u.ugold);
- if (lastAu < u.ugold && firstTime==FALSE) {
-#else
umoney = money_cnt(invent);
sprintf(buf,"Au:%ld", umoney);
if (lastAu < umoney && firstTime==FALSE) {
-#endif
/* Ok, this changed so add it to the highlighing list */
ghack_highlight_widget( goldLabel, normalStyle, greenStyle);
}
-#ifndef GOLDOBJ
- else if (lastAu > u.ugold && firstTime==FALSE) {
-#else
else if (lastAu > umoney && firstTime==FALSE) {
-#endif
/* Ok, this changed so add it to the highlighing list */
ghack_highlight_widget( goldLabel, normalStyle, redStyle);
}
-#ifndef GOLDOBJ
- lastAu = u.ugold;
-#else
lastAu = umoney;
-#endif
gtk_label_set( GTK_LABEL( goldLabel), buf);
if (u.mtimedone) {
putstr(wid, 0, buf);
/* Put $ on stone */
-#ifndef GOLDOBJ
- Sprintf(buf, "%ld Au", u.ugold);
-#else
Sprintf(buf, "%ld Au", done_money);
-#endif
buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
putstr(wid, 0, buf);