Make GOLDOBJ unconditional.

This commit is contained in:
Sean Hunt
2015-02-27 19:33:40 -05:00
parent 4f59f5c6fd
commit ac108cd365
58 changed files with 8 additions and 1196 deletions
-1
View File
@@ -443,7 +443,6 @@ typedef unsigned char uchar;
* bugs left here. * 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_VIA_WINDOWPORT /* re-work of the status line updating process */
#define STATUS_HILITES /* support hilites of status fields */ #define STATUS_HILITES /* support hilites of status fields */
/* #define WINCHAIN*/ /* stacked window systems */ /* #define WINCHAIN*/ /* stacked window systems */
-2
View File
@@ -180,9 +180,7 @@ E NEARDATA struct kinfo {
char name[BUFSZ]; /* actual killer name */ char name[BUFSZ]; /* actual killer name */
} killer; } killer;
#ifdef GOLDOBJ
E long done_money; E long done_money;
#endif
E const char *configfile; E const char *configfile;
E NEARDATA char plname[PL_NSIZ]; E NEARDATA char plname[PL_NSIZ];
E NEARDATA char dogname[]; E NEARDATA char dogname[];
-25
View File
@@ -803,9 +803,7 @@ E int FDECL(calc_capacity, (int));
E int NDECL(max_capacity); E int NDECL(max_capacity);
E boolean FDECL(check_capacity, (const char *)); E boolean FDECL(check_capacity, (const char *));
E int FDECL(inv_cnt, (BOOLEAN_P)); E int FDECL(inv_cnt, (BOOLEAN_P));
#ifdef GOLDOBJ
E long FDECL(money_cnt, (struct obj *)); E long FDECL(money_cnt, (struct obj *));
#endif
/* ### hacklib.c ### */ /* ### hacklib.c ### */
@@ -900,11 +898,6 @@ E boolean FDECL(obj_here, (struct obj *,int,int));
E boolean NDECL(wearing_armor); E boolean NDECL(wearing_armor);
E boolean FDECL(is_worn, (struct obj *)); E boolean FDECL(is_worn, (struct obj *));
E struct obj *FDECL(g_at, (int,int)); 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 struct obj *FDECL(getobj, (const char *,const char *));
E int FDECL(ggetobj, (const char *,int (*)(OBJ_P),int,BOOLEAN_P,unsigned *)); 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 int FDECL(askchain, (struct obj **,const char *,int,int (*)(OBJ_P),
@@ -1076,9 +1069,7 @@ E void FDECL(freemcorpsenm, (struct monst *));
E void FDECL(set_mimic_sym, (struct monst *)); E void FDECL(set_mimic_sym, (struct monst *));
E int FDECL(mbirth_limit, (int)); E int FDECL(mbirth_limit, (int));
E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P)); E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P));
#ifdef GOLDOBJ
E void FDECL(mkmonmoney, (struct monst *, long)); E void FDECL(mkmonmoney, (struct monst *, long));
#endif
E int FDECL(bagotricks, (struct obj *,BOOLEAN_P,int *)); E int FDECL(bagotricks, (struct obj *,BOOLEAN_P,int *));
E boolean FDECL(propagate, (int, BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(propagate, (int, BOOLEAN_P,BOOLEAN_P));
E boolean FDECL(usmellmon, (struct permonst *)); E boolean FDECL(usmellmon, (struct permonst *));
@@ -1679,13 +1670,8 @@ E void NDECL(getlock);
/* ### pickup.c ### */ /* ### pickup.c ### */
#ifdef GOLDOBJ
E int FDECL(collect_obj_classes, E int FDECL(collect_obj_classes,
(char *,struct obj *,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *)); (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 boolean FDECL(rider_corpse_revival, (struct obj *,BOOLEAN_P));
E void FDECL(add_valid_menu_class, (int)); E void FDECL(add_valid_menu_class, (int));
E boolean FDECL(allow_all, (struct obj *)); E boolean FDECL(allow_all, (struct obj *));
@@ -1926,9 +1912,6 @@ E int FDECL(validate, (int,const char *));
E void NDECL(reset_restpref); E void NDECL(reset_restpref);
E void FDECL(set_restpref, (const char *)); E void FDECL(set_restpref, (const char *));
E void FDECL(set_savepref, (const char *)); E void FDECL(set_savepref, (const char *));
#ifndef GOLDOBJ
E void FDECL(put_gold_back, (struct monst *));
#endif
/* ### rip.c ### */ /* ### rip.c ### */
@@ -2019,10 +2002,8 @@ E void FDECL(store_savefileinfo, (int));
/* ### shk.c ### */ /* ### shk.c ### */
#ifdef GOLDOBJ
E long FDECL(money2mon, (struct monst *, long)); E long FDECL(money2mon, (struct monst *, long));
E void FDECL(money2u, (struct monst *, long)); E void FDECL(money2u, (struct monst *, long));
#endif
E void FDECL(shkgone, (struct monst *)); E void FDECL(shkgone, (struct monst *));
E void FDECL(set_residency, (struct monst *,BOOLEAN_P)); E void FDECL(set_residency, (struct monst *,BOOLEAN_P));
E void FDECL(replshk, (struct monst *,struct monst *)); E void FDECL(replshk, (struct monst *,struct monst *));
@@ -2155,11 +2136,7 @@ E void FDECL(initialspell, (struct obj *));
#ifdef USE_TRAMPOLI #ifdef USE_TRAMPOLI
E int NDECL(stealarm); E int NDECL(stealarm);
#endif #endif
#ifdef GOLDOBJ
E long FDECL(somegold, (long)); E long FDECL(somegold, (long));
#else
E long NDECL(somegold);
#endif
E void FDECL(stealgold, (struct monst *)); E void FDECL(stealgold, (struct monst *));
E void FDECL(remove_worn_item, (struct obj *,BOOLEAN_P)); E void FDECL(remove_worn_item, (struct obj *,BOOLEAN_P));
E int FDECL(steal, (struct monst *, char *)); E int FDECL(steal, (struct monst *, char *));
@@ -2169,9 +2146,7 @@ E void FDECL(maybe_absorb_item, (struct monst *,struct obj *,int,int));
E void FDECL(mdrop_obj, (struct monst *,struct obj *,BOOLEAN_P)); E void FDECL(mdrop_obj, (struct monst *,struct obj *,BOOLEAN_P));
E void FDECL(mdrop_special_objs, (struct monst *)); E void FDECL(mdrop_special_objs, (struct monst *));
E void FDECL(relobj, (struct monst *,int,BOOLEAN_P)); E void FDECL(relobj, (struct monst *,int,BOOLEAN_P));
#ifdef GOLDOBJ
E struct obj *FDECL(findgold, (struct obj *)); E struct obj *FDECL(findgold, (struct obj *));
#endif
/* ### steed.c ### */ /* ### steed.c ### */
-3
View File
@@ -135,9 +135,6 @@ struct monst {
long mtrapseen; /* bitmap of traps we've been trapped in */ long mtrapseen; /* bitmap of traps we've been trapped in */
long mlstmv; /* for catching up with lost time */ long mlstmv; /* for catching up with lost time */
long mspare1; long mspare1;
#ifndef GOLDOBJ
#define mgold mspare1
#endif
struct obj *minvent; struct obj *minvent;
struct obj *mw; struct obj *mw;
-4
View File
@@ -339,10 +339,6 @@ struct you {
int ublessed, ublesscnt; /* blessing/duration from #pray */ int ublessed, ublesscnt; /* blessing/duration from #pray */
long umoney0; long umoney0;
long uspare1; long uspare1;
#ifndef GOLDOBJ
#define ugold uspare1
#define ugold0 umoney0
#endif
long uexp, urexp; long uexp, urexp;
long ucleansed; /* to record moves when player was cleansed */ long ucleansed; /* to record moves when player was cleansed */
long usleep; /* sleeping; monstermove you last started */ long usleep; /* sleeping; monstermove you last started */
-17
View File
@@ -2026,9 +2026,6 @@ struct obj *tstone;
static const char scritch[] = "\"scritch, scritch\""; static const char scritch[] = "\"scritch, scritch\"";
static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 }; static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 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 */ /* in case it was acquired while blinded */
if (!Blind) tstone->dknown = 1; if (!Blind) tstone->dknown = 1;
@@ -2039,17 +2036,6 @@ struct obj *tstone;
Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan)); Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan));
if ((obj = getobj(choices, stonebuf)) == 0) if ((obj = getobj(choices, stonebuf)) == 0)
return; 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) { if (obj == tstone && obj->quan == 1L) {
You_cant("rub %s on itself.", the(xname(obj))); You_cant("rub %s on itself.", the(xname(obj)));
@@ -2066,9 +2052,6 @@ struct obj *tstone;
else else
pline("A sharp crack shatters %s%s.", pline("A sharp crack shatters %s%s.",
(obj->quan > 1L) ? "one of " : "", the(xname(obj))); (obj->quan > 1L) ? "one of " : "", the(xname(obj)));
#ifndef GOLDOBJ
/* assert(obj != &goldobj); */
#endif
useup(obj); useup(obj);
return; return;
} }
-10
View File
@@ -229,16 +229,6 @@ int x, y;
else else
place_object(otmp, x, y); 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); if (cont) cont->owt = weight(cont);
} }
+1 -15
View File
@@ -159,13 +159,8 @@ botl_score()
long deepest = deepest_lev_reached(FALSE); long deepest = deepest_lev_reached(FALSE);
long utotal; long utotal;
#ifndef GOLDOBJ
utotal = u.ugold + hidden_gold();
if ((utotal -= u.ugold0) < 0L) utotal = 0L;
#else
utotal = money_cnt(invent) + hidden_gold(); utotal = money_cnt(invent) + hidden_gold();
if ((utotal -= u.umoney0) < 0L) utotal = 0L; if ((utotal -= u.umoney0) < 0L) utotal = 0L;
#endif
utotal += u.urexp + (50 * (deepest - 1)) + utotal += u.urexp + (50 * (deepest - 1)) +
(deepest > 30 ? 10000 : deepest > 20 ? 1000*(deepest - 20) : 0); (deepest > 30 ? 10000 : deepest > 20 ? 1000*(deepest - 20) : 0);
if (utotal < u.urexp) utotal = LONG_MAX; /* wrap around */ if (utotal < u.urexp) utotal = LONG_MAX; /* wrap around */
@@ -268,11 +263,7 @@ bot2()
Sprintf(nb = eos(newbot2), Sprintf(nb = eos(newbot2),
"%s:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", "%s:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d",
encglyph(objnum_to_glyph(GOLD_PIECE)), encglyph(objnum_to_glyph(GOLD_PIECE)),
#ifndef GOLDOBJ
u.ugold,
#else
money_cnt(invent), money_cnt(invent),
#endif
hp, hpmax, u.uen, u.uenmax, u.uac); hp, hpmax, u.uen, u.uenmax, u.uac);
if (Upolyd) if (Upolyd)
@@ -709,12 +700,7 @@ bot()
/* Gold */ /* Gold */
blstats[idx][BL_GOLD].a.a_long = blstats[idx][BL_GOLD].a.a_long = money_cnt(invent);
#ifndef GOLDOBJ
u.ugold;
#else
money_cnt(invent);
#endif
/* /*
* The tty port needs to display the current symbol for gold * The tty port needs to display the current symbol for gold
* as a field header, so to accomodate that we pass gold with * as a field header, so to accomodate that we pass gold with
-2
View File
@@ -49,9 +49,7 @@ NEARDATA int doorindex = 0;
NEARDATA char *save_cm = 0; NEARDATA char *save_cm = 0;
NEARDATA struct kinfo killer = DUMMY; NEARDATA struct kinfo killer = DUMMY;
#ifdef GOLDOBJ
NEARDATA long done_money = 0; NEARDATA long done_money = 0;
#endif
const char *nomovemsg = 0; const char *nomovemsg = 0;
NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */ NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */
NEARDATA char pl_character[PL_CSIZ] = DUMMY; NEARDATA char pl_character[PL_CSIZ] = DUMMY;
+2 -37
View File
@@ -91,12 +91,7 @@ unsigned material;
/* there's some object shown here */ /* there's some object shown here */
if (oclass == ALL_CLASSES) { if (oclass == ALL_CLASSES) {
return((boolean)( !(level.objects[x][y] || /* stale if nothing here */ return((boolean)( !(level.objects[x][y] || /* stale if nothing here */
((mtmp = m_at(x,y)) != 0 && ((mtmp = m_at(x,y)) != 0 && ( mtmp->minvent)))));
(
#ifndef GOLDOBJ
mtmp->mgold ||
#endif
mtmp->minvent)))));
} else { } else {
if (material && objects[glyph_to_obj(glyph)].oc_material == material) { if (material && objects[glyph_to_obj(glyph)].oc_material == material) {
/* the object shown here is of interest because material matches */ /* the object shown here is of interest because material matches */
@@ -115,19 +110,10 @@ unsigned material;
for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere) for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
if (o_in(otmp, oclass)) return FALSE; if (o_in(otmp, oclass)) return FALSE;
/* didn't find it; perhaps a monster is carrying it */ /* 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) { if ((mtmp = m_at(x,y)) != 0) {
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
if (o_in(otmp, oclass)) return FALSE; if (o_in(otmp, oclass)) return FALSE;
} }
#endif
/* detection indicates removal of this object from the map */ /* detection indicates removal of this object from the map */
return TRUE; return TRUE;
} }
@@ -176,11 +162,7 @@ register struct obj *sobj;
/* look for gold carried by monsters (might be in a container) */ /* look for gold carried by monsters (might be in a container) */
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) continue; /* probably not needed in this case but... */ 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) { if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
#endif
known = TRUE; known = TRUE;
goto outgoldmap; /* skip further searching */ goto outgoldmap; /* skip further searching */
} else for (obj = mtmp->minvent; obj; obj = obj->nobj) } else for (obj = mtmp->minvent; obj; obj = obj->nobj)
@@ -212,12 +194,7 @@ register struct obj *sobj;
if (youmonst.data == &mons[PM_GOLD_GOLEM]) { if (youmonst.data == &mons[PM_GOLD_GOLEM]) {
Sprintf(buf, "You feel like a million %s!", Sprintf(buf, "You feel like a million %s!",
currency(2L)); currency(2L));
} else if (hidden_gold() || } else if (hidden_gold() || money_cnt(invent))
#ifndef GOLDOBJ
u.ugold)
#else
money_cnt(invent))
#endif
Strcpy(buf, Strcpy(buf,
"You feel worried about your future financial situation."); "You feel worried about your future financial situation.");
else else
@@ -254,11 +231,7 @@ outgoldmap:
} }
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) continue; /* probably overkill here */ 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) { if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
#endif
struct obj gold; struct obj gold;
gold = zeroobj; /* ensure oextra is cleared too */ gold = zeroobj; /* ensure oextra is cleared too */
gold.otyp = GOLD_PIECE; gold.otyp = GOLD_PIECE;
@@ -460,11 +433,7 @@ int class; /* an object class, 0 for all */
} }
if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT && if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT &&
(!class || class == objects[mtmp->mappearance].oc_class)) || (!class || class == objects[mtmp->mappearance].oc_class)) ||
#ifndef GOLDOBJ
(mtmp->mgold && (!class || class == COIN_CLASS))) {
#else
(findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) { (findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) {
#endif
ct++; ct++;
break; break;
} }
@@ -546,11 +515,7 @@ int class; /* an object class, 0 for all */
temp.oy = mtmp->my; temp.oy = mtmp->my;
temp.corpsenm = PM_TENGU; /* if mimicing a corpse */ temp.corpsenm = PM_TENGU; /* if mimicing a corpse */
map_object(&temp, 1); map_object(&temp, 1);
#ifndef GOLDOBJ
} else if (mtmp->mgold && (!class || class == COIN_CLASS)) {
#else
} else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) { } else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) {
#endif
struct obj gold; struct obj gold;
gold = zeroobj; /* ensure oextra is cleared too */ gold = zeroobj; /* ensure oextra is cleared too */
gold.otyp = GOLD_PIECE; gold.otyp = GOLD_PIECE;
-28
View File
@@ -28,11 +28,7 @@ static NEARDATA const char drop_types[] =
int int
dodrop() dodrop()
{ {
#ifndef GOLDOBJ
int result, i = (invent || u.ugold) ? 0 : (SIZE(drop_types) - 1);
#else
int result, i = (invent) ? 0 : (SIZE(drop_types) - 1); int result, i = (invent) ? 0 : (SIZE(drop_types) - 1);
#endif
if (*u.ushops) sellobj_state(SELL_DELIBERATE); if (*u.ushops) sellobj_state(SELL_DELIBERATE);
result = drop(getobj(&drop_types[i], "drop")); result = drop(getobj(&drop_types[i], "drop"));
@@ -484,13 +480,9 @@ register struct obj *obj;
if (levhack) ELevitation = W_ART; /* other than W_ARTI */ if (levhack) ELevitation = W_ART; /* other than W_ARTI */
if(flags.verbose) You("drop %s.", doname(obj)); 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 */ /* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS) context.botl = 1; if (obj->oclass == COIN_CLASS) context.botl = 1;
freeinv(obj); freeinv(obj);
#endif
hitfloor(obj); hitfloor(obj);
if (levhack) float_down(I_SPECIAL|TIMEOUT, W_ARTI|W_ART); if (levhack) float_down(I_SPECIAL|TIMEOUT, W_ARTI|W_ART);
return(1); return(1);
@@ -509,13 +501,9 @@ void
dropx(obj) dropx(obj)
register struct obj *obj; register struct obj *obj;
{ {
#ifndef GOLDOBJ
if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
#else
/* Ensure update when we drop gold objects */ /* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS) context.botl = 1; if (obj->oclass == COIN_CLASS) context.botl = 1;
freeinv(obj); freeinv(obj);
#endif
if (!u.uswallow) { if (!u.uswallow) {
if (ship_object(obj, u.ux, u.uy, FALSE)) return; if (ship_object(obj, u.ux, u.uy, FALSE)) return;
if (IS_ALTAR(levl[u.ux][u.uy].typ)) if (IS_ALTAR(levl[u.ux][u.uy].typ))
@@ -653,17 +641,10 @@ int retry;
int n, i, n_dropped = 0; int n, i, n_dropped = 0;
long cnt; long cnt;
struct obj *otmp, *otmp2; struct obj *otmp, *otmp2;
#ifndef GOLDOBJ
struct obj *u_gold = 0;
#endif
menu_item *pick_list; menu_item *pick_list;
boolean all_categories = TRUE; boolean all_categories = TRUE;
boolean drop_everything = FALSE; 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) { if (retry) {
all_categories = (retry == -2); all_categories = (retry == -2);
} else if (flags.menu_style == MENU_FULL) { } else if (flags.menu_style == MENU_FULL) {
@@ -749,11 +730,6 @@ int retry;
/* same kludge as getobj(), for canletgo()'s use */ /* same kludge as getobj(), for canletgo()'s use */
otmp->corpsenm = (int) cnt; /* don't split */ otmp->corpsenm = (int) cnt; /* don't split */
} else { } else {
#ifndef GOLDOBJ
if (otmp->oclass == COIN_CLASS)
(void) splitobj(otmp, otmp->quan - cnt);
else
#endif
otmp = splitobj(otmp, cnt); otmp = splitobj(otmp, cnt);
} }
} }
@@ -765,10 +741,6 @@ int retry;
} }
drop_done: 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; return n_dropped;
} }
-9
View File
@@ -443,15 +443,6 @@ boolean with_you;
} }
corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data,
xlocale, ylocale, CORPSTAT_NONE); 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); mongone(mtmp);
} }
} }
-3
View File
@@ -26,9 +26,6 @@ struct monst *mon;
struct obj *obj, *wep, struct obj *obj, *wep,
dummy, *pickaxe, *unihorn, *key; dummy, *pickaxe, *unihorn, *key;
#ifndef GOLDOBJ
if (mon->mgold) return &zeroobj; /* pet has something to drop */
#endif
dummy = zeroobj; dummy = zeroobj;
dummy.otyp = GOLD_PIECE; /* not STRANGE_OBJECT or tools of interest */ dummy.otyp = GOLD_PIECE; /* not STRANGE_OBJECT or tools of interest */
dummy.oartifact = 1; /* so real artifact won't override "don't keep it" */ dummy.oartifact = 1; /* so real artifact won't override "don't keep it" */
-8
View File
@@ -322,11 +322,7 @@ register struct obj *gold;
verbalize("Thank you for your contribution."); verbalize("Thank you for your contribution.");
else verbalize("Thanks, scum!"); else verbalize("Thanks, scum!");
} else if (mtmp->isgd) { } else if (mtmp->isgd) {
#ifndef GOLDOBJ
umoney = u.ugold;
#else
umoney = money_cnt(invent); umoney = money_cnt(invent);
#endif
/* Some of these are iffy, because a hostile guard /* Some of these are iffy, because a hostile guard
won't become peaceful and resume leading hero won't become peaceful and resume leading hero
out of the vault. If he did do that, player out of the vault. If he did do that, player
@@ -352,11 +348,7 @@ register struct obj *gold;
goldreqd = 750L; goldreqd = 750L;
if (goldreqd) { if (goldreqd) {
#ifndef GOLDOBJ
umoney = u.ugold;
#else
umoney = money_cnt(invent); umoney = money_cnt(invent);
#endif
if (value > goldreqd + if (value > goldreqd +
(umoney + u.ulevel * rn2(5)) / ACURR(A_CHA)) (umoney + u.ulevel * rn2(5)) / ACURR(A_CHA))
mtmp->mpeaceful = TRUE; mtmp->mpeaceful = TRUE;
-29
View File
@@ -45,18 +45,6 @@ int shotlimit;
boolean twoweap, weakmultishot; boolean twoweap, weakmultishot;
/* ask "in what direction?" */ /* 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)) { if (!getdir((char *)0)) {
/* obj might need to be merged back into the singular gold object */ /* obj might need to be merged back into the singular gold object */
freeinv(obj); freeinv(obj);
@@ -73,7 +61,6 @@ int shotlimit;
possibly using a sling. possibly using a sling.
*/ */
if(obj->oclass == COIN_CLASS && obj != uquiver) return(throw_gold(obj)); if(obj->oclass == COIN_CLASS && obj != uquiver) return(throw_gold(obj));
#endif
if(!canletgo(obj,"throw")) if(!canletgo(obj,"throw"))
return(0); return(0);
@@ -1833,34 +1820,18 @@ throw_gold(obj)
struct obj *obj; struct obj *obj;
{ {
int range, odx, ody; int range, odx, ody;
#ifndef GOLDOBJ
long zorks = obj->quan;
#endif
register struct monst *mon; register struct monst *mon;
if(!u.dx && !u.dy && !u.dz) { 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."); You("cannot throw gold at yourself.");
return(0); return(0);
} }
#ifdef GOLDOBJ
freeinv(obj); freeinv(obj);
#endif
if(u.uswallow) { if(u.uswallow) {
pline(is_animal(u.ustuck->data) ? pline(is_animal(u.ustuck->data) ?
"%s in the %s's entrails." : "%s into %s.", "%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)); "The money disappears", mon_nam(u.ustuck));
add_to_minv(u.ustuck, obj); add_to_minv(u.ustuck, obj);
#endif
return(1); return(1);
} }
-5
View File
@@ -1985,13 +1985,8 @@ eatspecial() /* called after eating non-food */
context.victual.o_id = 0; context.victual.o_id = 0;
context.victual.eating = 0; context.victual.eating = 0;
if (otmp->oclass == COIN_CLASS) { if (otmp->oclass == COIN_CLASS) {
#ifdef GOLDOBJ
if (carried(otmp)) if (carried(otmp))
useupall(otmp); useupall(otmp);
#else
if (otmp->where == OBJ_FREE)
dealloc_obj(otmp);
#endif
else else
useupf(otmp, otmp->quan); useupf(otmp, otmp->quan);
vault_gd_watching(GD_EATGOLD); vault_gd_watching(GD_EATGOLD);
-9
View File
@@ -998,13 +998,8 @@ die:
{ {
int deepest = deepest_lev_reached(FALSE); int deepest = deepest_lev_reached(FALSE);
#ifndef GOLDOBJ
umoney = u.ugold;
tmp = u.ugold0;
#else
umoney = money_cnt(invent); umoney = money_cnt(invent);
tmp = u.umoney0; tmp = u.umoney0;
#endif
umoney += hidden_gold(); /* accumulate gold from containers */ umoney += hidden_gold(); /* accumulate gold from containers */
tmp = umoney - tmp; /* net gain */ tmp = umoney - tmp; /* net gain */
@@ -1046,11 +1041,7 @@ die:
/* update gold for the rip output, which can't use hidden_gold() /* update gold for the rip output, which can't use hidden_gold()
(containers will be gone by then if bones just got saved...) */ (containers will be gone by then if bones just got saved...) */
#ifndef GOLDOBJ
u.ugold = umoney;
#else
done_money = umoney; done_money = umoney;
#endif
/* clean up unneeded windows */ /* clean up unneeded windows */
if (have_windows) { if (have_windows) {
-9
View File
@@ -452,14 +452,6 @@ register struct obj *obj;
break; break;
case 28: /* Strange feeling */ case 28: /* Strange feeling */
pline("An urge to take a bath overwhelms you."); 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); long money = money_cnt(invent);
struct obj *otmp; struct obj *otmp;
@@ -479,7 +471,6 @@ register struct obj *obj;
exercise(A_WIS, FALSE); exercise(A_WIS, FALSE);
} }
} }
#endif
break; break;
case 29: /* You see coins */ case 29: /* You see coins */
+1 -15
View File
@@ -2540,22 +2540,10 @@ inv_weight()
register struct obj *otmp = invent; register struct obj *otmp = invent;
register int wt = 0; 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) { while (otmp) {
#ifndef GOLDOBJ
if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data))
#else
if (otmp->oclass == COIN_CLASS) if (otmp->oclass == COIN_CLASS)
wt += (int)(((long)otmp->quan + 50L) / 100L); wt += (int)(((long)otmp->quan + 50L) / 100L);
else if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data)) else if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data))
#endif
wt += otmp->owt; wt += otmp->owt;
otmp = otmp->nobj; otmp = otmp->nobj;
} }
@@ -2609,7 +2597,7 @@ const char *str;
int int
inv_cnt(incl_gold) inv_cnt(incl_gold)
boolean incl_gold; /* only meaningful for GOLDOBJ config */ boolean incl_gold;
{ {
register struct obj *otmp = invent; register struct obj *otmp = invent;
register int ct = 0; register int ct = 0;
@@ -2621,7 +2609,6 @@ boolean incl_gold; /* only meaningful for GOLDOBJ config */
return(ct); return(ct);
} }
#ifdef GOLDOBJ
/* Counts the money in an object chain. */ /* Counts the money in an object chain. */
/* Intended use is for your or some monsters inventory, */ /* Intended use is for your or some monsters inventory, */
/* now that u.gold/m.gold is gone.*/ /* now that u.gold/m.gold is gone.*/
@@ -2637,6 +2624,5 @@ struct obj *otmp;
} }
return 0L; return 0L;
} }
#endif /* GOLDOBJ */
/*hack.c*/ /*hack.c*/
-221
View File
@@ -168,9 +168,7 @@ struct obj **potmp, **pobj;
/ (otmp->quan + obj->quan); / (otmp->quan + obj->quan);
otmp->quan += obj->quan; otmp->quan += obj->quan;
#ifdef GOLDOBJ
/* temporary special case for gold objects!!!! */ /* temporary special case for gold objects!!!! */
#endif
if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp); if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp);
else otmp->owt += obj->owt; else otmp->owt += obj->owt;
if(!has_oname(otmp) && has_oname(obj)) if(!has_oname(otmp) && has_oname(obj))
@@ -238,11 +236,7 @@ addinv_core1(obj)
struct obj *obj; struct obj *obj;
{ {
if (obj->oclass == COIN_CLASS) { if (obj->oclass == COIN_CLASS) {
#ifndef GOLDOBJ
u.ugold += obj->quan;
#else
context.botl = 1; context.botl = 1;
#endif
} else if (obj->otyp == AMULET_OF_YENDOR) { } else if (obj->otyp == AMULET_OF_YENDOR) {
if (u.uhave.amulet) impossible("already have amulet?"); if (u.uhave.amulet) impossible("already have amulet?");
u.uhave.amulet = 1; u.uhave.amulet = 1;
@@ -305,11 +299,6 @@ struct obj *obj;
obj->was_thrown = 0; /* not meaningful for invent */ obj->was_thrown = 0; /* not meaningful for invent */
addinv_core1(obj); 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 /* merge with quiver in preference to any other inventory slot
in case quiver and wielded weapon are both eligible; adding in case quiver and wielded weapon are both eligible; adding
@@ -488,10 +477,6 @@ freeinv_core(obj)
struct obj *obj; struct obj *obj;
{ {
if (obj->oclass == COIN_CLASS) { if (obj->oclass == COIN_CLASS) {
#ifndef GOLDOBJ
u.ugold -= obj->quan;
obj->in_use = FALSE;
#endif
context.botl = 1; context.botl = 1;
return; return;
} else if (obj->otyp == AMULET_OF_YENDOR) { } else if (obj->otyp == AMULET_OF_YENDOR) {
@@ -679,60 +664,6 @@ register int x, y;
return((struct obj *)0); 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 STATIC_OVL void
compactify(buf) compactify(buf)
register char *buf; register char *buf;
@@ -802,10 +733,8 @@ const char *action;
* struct obj *xxx: object to do something with. * struct obj *xxx: object to do something with.
* (struct obj *) 0 error return: no object. * (struct obj *) 0 error return: no object.
* &zeroobj explicitly no object (as in w-). * &zeroobj explicitly no object (as in w-).
#ifdef GOLDOBJ
!!!! test if gold can be used in unusual ways (eaten etc.) !!!! test if gold can be used in unusual ways (eaten etc.)
!!!! may be able to remove "usegold" !!!! may be able to remove "usegold"
#endif
*/ */
struct obj * struct obj *
getobj(let,word) getobj(let,word)
@@ -819,10 +748,6 @@ register const char *let,*word;
register char *bp = buf; register char *bp = buf;
xchar allowcnt = 0; /* 0, 1 or 2 */ xchar allowcnt = 0; /* 0, 1 or 2 */
struct obj *firstobj = invent; 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 usegold = FALSE; /* can't use gold because its illegal */
boolean allowall = FALSE; boolean allowall = FALSE;
boolean allownone = FALSE; boolean allownone = FALSE;
@@ -833,22 +758,13 @@ register const char *let,*word;
long dummymask; long dummymask;
if(*let == ALLOW_COUNT) let++, allowcnt = 1; 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; if(*let == COIN_CLASS) let++, usegold = TRUE;
#endif
/* Equivalent of an "ugly check" for gold */ /* Equivalent of an "ugly check" for gold */
if (usegold && !strcmp(word, "eat") && if (usegold && !strcmp(word, "eat") &&
(!metallivorous(youmonst.data) (!metallivorous(youmonst.data)
|| youmonst.data == &mons[PM_RUST_MONSTER])) || youmonst.data == &mons[PM_RUST_MONSTER]))
#ifndef GOLDOBJ
usegold = allowgold = FALSE;
#else
usegold = FALSE; usegold = FALSE;
#endif
if(*let == ALL_CLASSES) let++, allowall = TRUE; if(*let == ALL_CLASSES) let++, allowall = TRUE;
if(*let == ALLOW_NONE) let++, allownone = TRUE; if(*let == ALLOW_NONE) let++, allownone = TRUE;
@@ -866,17 +782,6 @@ register const char *let,*word;
useboulder = TRUE; useboulder = TRUE;
if(allownone) *bp++ = '-'; 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++ = ' '; if(bp > buf && bp[-1] == '-') *bp++ = ' ';
ap = altlets; ap = altlets;
@@ -891,9 +796,7 @@ register const char *let,*word;
} }
if (!*let || index(let, otmp->oclass) if (!*let || index(let, otmp->oclass)
#ifdef GOLDOBJ
|| (usegold && otmp->invlet == GOLD_SYM) || (usegold && otmp->invlet == GOLD_SYM)
#endif
|| (useboulder && otmp->otyp == BOULDER) || (useboulder && otmp->otyp == BOULDER)
) { ) {
register int otyp = otmp->otyp; register int otyp = otmp->otyp;
@@ -1010,11 +913,7 @@ register const char *let,*word;
compactify(bp); compactify(bp);
*ap = '\0'; *ap = '\0';
#ifndef GOLDOBJ
if(!foo && !allowall && !allowgold && !allownone) {
#else
if(!foo && !allowall && !allownone) { if(!foo && !allowall && !allownone) {
#endif
You("don't have anything %sto %s.", You("don't have anything %sto %s.",
foox ? "else " : "", word); foox ? "else " : "", word);
return((struct obj *)0); return((struct obj *)0);
@@ -1070,11 +969,6 @@ register const char *let,*word;
if (!usegold) { if (!usegold) {
You("cannot %s gold.", word); You("cannot %s gold.", word);
return(struct obj *)0; 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 /* Historic note: early Nethack had a bug which was
* first reported for Larn, where trying to drop 2^32-n * first reported for Larn, where trying to drop 2^32-n
@@ -1089,15 +983,6 @@ register const char *let,*word;
return (struct obj *)0; 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 == '*') { if(ilet == '?' || ilet == '*') {
char *allowed_choices = (ilet == '?') ? lets : (char *)0; char *allowed_choices = (ilet == '?') ? lets : (char *)0;
@@ -1124,9 +1009,7 @@ register const char *let,*word;
/* permit counts for throwing gold, but don't accept /* permit counts for throwing gold, but don't accept
* counts for other things since the throw code will * counts for other things since the throw code will
* split off a single item anyway */ * split off a single item anyway */
#ifdef GOLDOBJ
if (ilet != def_oc_syms[COIN_CLASS].sym) if (ilet != def_oc_syms[COIN_CLASS].sym)
#endif
allowcnt = 1; allowcnt = 1;
if(cnt == 0 && prezero) return((struct obj *)0); if(cnt == 0 && prezero) return((struct obj *)0);
if(cnt > 1) { if(cnt > 1) {
@@ -1134,9 +1017,7 @@ register const char *let,*word;
continue; continue;
} }
} }
#ifdef GOLDOBJ
context.botl = 1; /* May have changed the amount of money */ context.botl = 1; /* May have changed the amount of money */
#endif
#ifdef REDO #ifdef REDO
savech(ilet); savech(ilet);
#endif #endif
@@ -1159,9 +1040,7 @@ register const char *let,*word;
break; break;
} }
if(!allowall && let && !index(let,otmp->oclass) if(!allowall && let && !index(let,otmp->oclass)
#ifdef GOLDOBJ
&& !(usegold && otmp->oclass == COIN_CLASS) && !(usegold && otmp->oclass == COIN_CLASS)
#endif
) { ) {
silly_thing(word, otmp); silly_thing(word, otmp);
return((struct obj *)0); return((struct obj *)0);
@@ -1289,25 +1168,14 @@ unsigned *resultflags;
boolean FDECL((*filter),(OBJ_P)) = (boolean FDECL((*),(OBJ_P))) 0; boolean FDECL((*filter),(OBJ_P)) = (boolean FDECL((*),(OBJ_P))) 0;
boolean takeoff, ident, allflag, m_seen; boolean takeoff, ident, allflag, m_seen;
int itemcount; int itemcount;
#ifndef GOLDOBJ
int oletct, iletct, allowgold, unpaid, oc_of_sym;
#else
int oletct, iletct, unpaid, oc_of_sym; int oletct, iletct, unpaid, oc_of_sym;
#endif
char sym, *ip, olets[MAXOCLASSES+5], ilets[MAXOCLASSES+5]; char sym, *ip, olets[MAXOCLASSES+5], ilets[MAXOCLASSES+5];
char extra_removeables[3+1]; /* uwep,uswapwep,uquiver */ char extra_removeables[3+1]; /* uwep,uswapwep,uquiver */
char buf[BUFSZ], qbuf[QBUFSZ]; char buf[BUFSZ], qbuf[QBUFSZ];
if (resultflags) *resultflags = 0; if (resultflags) *resultflags = 0;
#ifndef GOLDOBJ
allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0;
#endif
takeoff = ident = allflag = m_seen = FALSE; takeoff = ident = allflag = m_seen = FALSE;
#ifndef GOLDOBJ
if(!invent && !allowgold){
#else
if(!invent){ if(!invent){
#endif
You("have nothing to %s.", word); You("have nothing to %s.", word);
return(0); return(0);
} }
@@ -1322,9 +1190,6 @@ unsigned *resultflags;
iletct = collect_obj_classes(ilets, invent, iletct = collect_obj_classes(ilets, invent,
FALSE, FALSE,
#ifndef GOLDOBJ
(allowgold != 0),
#endif
filter, &itemcount); filter, &itemcount);
unpaid = count_unpaid(invent); unpaid = count_unpaid(invent);
@@ -1397,15 +1262,7 @@ unsigned *resultflags;
} }
if (oc_of_sym == COIN_CLASS && !combo) { 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; context.botl = 1;
#endif
} else if (sym == 'a') { } else if (sym == 'a') {
allflag = TRUE; allflag = TRUE;
} else if (sym == 'A') { } else if (sym == 'A') {
@@ -1442,16 +1299,10 @@ unsigned *resultflags;
return (allflag || (!oletct && ckfn != ckunpaid)) ? -2 : -3; return (allflag || (!oletct && ckfn != ckunpaid)) ? -2 : -3;
else if (flags.menu_style != MENU_TRADITIONAL && combo && !allflag) else if (flags.menu_style != MENU_TRADITIONAL && combo && !allflag)
return 0; 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) else /*!!!! if (allowgold == 2 && !oletct)
!!!! return 1; you dropped gold (or at least tried to) !!!! return 1; you dropped gold (or at least tried to)
!!!! test gold dropping !!!! test gold dropping
else*/ { else*/ {
#endif
int cnt = askchain(&invent, olets, allflag, fn, ckfn, mx, word); int cnt = askchain(&invent, olets, allflag, fn, ckfn, mx, word);
/* /*
* askchain() has already finished the job in this case * askchain() has already finished the job in this case
@@ -1728,10 +1579,6 @@ STATIC_OVL char
obj_to_let(obj) /* should of course only be called for things in invent */ obj_to_let(obj) /* should of course only be called for things in invent */
register struct obj *obj; register struct obj *obj;
{ {
#ifndef GOLDOBJ
if (obj->oclass == COIN_CLASS)
return GOLD_SYM;
#endif
if (!flags.invlet_constant) { if (!flags.invlet_constant) {
obj->invlet = NOINVSYM; obj->invlet = NOINVSYM;
reassign(); reassign();
@@ -1787,11 +1634,6 @@ long quan; /* if non-0, print this quantity, not obj->quan */
Sprintf(li, "%c - %-45s %6ld %s", Sprintf(li, "%c - %-45s %6ld %s",
(dot && use_invlet ? obj->invlet : let), (dot && use_invlet ? obj->invlet : let),
(txt ? txt : doname(obj)), cost, currency(cost)); (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 { } else {
/* ordinary inventory display or pickup message */ /* ordinary inventory display or pickup message */
Sprintf(li, "%c - %s%s", Sprintf(li, "%c - %s%s",
@@ -1885,11 +1727,7 @@ long* out_cnt;
to here is short circuited away. to here is short circuited away.
*/ */
if (!invent && !(flags.perm_invent && !lets && !want_reply)) { if (!invent && !(flags.perm_invent && !lets && !want_reply)) {
#ifndef GOLDOBJ
pline("Not carrying anything%s.", u.ugold ? " except gold" : "");
#else
pline("Not carrying anything."); pline("Not carrying anything.");
#endif
return 0; return 0;
} }
@@ -2219,11 +2057,7 @@ dotypeinv()
boolean traditional = TRUE; boolean traditional = TRUE;
const char *prompt = "What type of object do you want an inventory of?"; const char *prompt = "What type of object do you want an inventory of?";
#ifndef GOLDOBJ
if (!invent && !u.ugold && !billx) {
#else
if (!invent && !billx) { if (!invent && !billx) {
#endif
You("aren't carrying anything."); You("aren't carrying anything.");
return 0; return 0;
} }
@@ -2245,9 +2079,6 @@ dotypeinv()
types[0] = 0; types[0] = 0;
class_count = collect_obj_classes(types, invent, class_count = collect_obj_classes(types, invent,
FALSE, FALSE,
#ifndef GOLDOBJ
(u.ugold != 0),
#endif
(boolean FDECL((*),(OBJ_P))) 0, &itemcount); (boolean FDECL((*),(OBJ_P))) 0, &itemcount);
if (unpaid_count) { if (unpaid_count) {
Strcat(types, "u"); Strcat(types, "u");
@@ -2592,10 +2423,8 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */
{ {
int objnamelth = 0, otmpnamelth = 0; int objnamelth = 0, otmpnamelth = 0;
if (obj->otyp != otmp->otyp) return FALSE; if (obj->otyp != otmp->otyp) return FALSE;
#ifdef GOLDOBJ
/* coins of the same kind will always merge */ /* coins of the same kind will always merge */
if (obj->oclass == COIN_CLASS) return TRUE; if (obj->oclass == COIN_CLASS) return TRUE;
#endif
if (obj->unpaid != otmp->unpaid || if (obj->unpaid != otmp->unpaid ||
obj->spe != otmp->spe || obj->dknown != otmp->dknown || obj->spe != otmp->spe || obj->dknown != otmp->dknown ||
(obj->bknown != otmp->bknown && !Role_if(PM_PRIEST)) || (obj->bknown != otmp->bknown && !Role_if(PM_PRIEST)) ||
@@ -2676,18 +2505,11 @@ doprgold()
{ {
/* the messages used to refer to "carrying gold", but that didn't /* the messages used to refer to "carrying gold", but that didn't
take containers into account */ 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); long umoney = money_cnt(invent);
if(!umoney) if(!umoney)
Your("wallet is empty."); Your("wallet is empty.");
else else
Your("wallet contains %ld %s.", umoney, currency(umoney)); Your("wallet contains %ld %s.", umoney, currency(umoney));
#endif
shopper_financial_report(); shopper_financial_report();
return 0; return 0;
} }
@@ -2915,17 +2737,13 @@ reassign()
register struct obj *obj; register struct obj *obj;
for(obj = invent, i = 0; obj; obj = obj->nobj, i++) { for(obj = invent, i = 0; obj; obj = obj->nobj, i++) {
#ifdef GOLDOBJ
if (obj->oclass == COIN_CLASS && obj->invlet == GOLD_SYM) if (obj->oclass == COIN_CLASS && obj->invlet == GOLD_SYM)
--i; /* keep $ instead of using up i'th letter */ --i; /* keep $ instead of using up i'th letter */
else else
#endif
if (i < 52) if (i < 52)
obj->invlet = (i < 26) ? ('a'+i) : ('A'+i-26); obj->invlet = (i < 26) ? ('a'+i) : ('A'+i-26);
#ifdef GOLDOBJ
else if (obj->oclass == COIN_CLASS) else if (obj->oclass == COIN_CLASS)
obj->invlet = GOLD_SYM; obj->invlet = GOLD_SYM;
#endif
else else
obj->invlet = NOINVSYM; obj->invlet = NOINVSYM;
} }
@@ -2969,7 +2787,6 @@ doorganize() /* inventory organizer by Del Lamb */
const char *adj_type; const char *adj_type;
if (!invent) { if (!invent) {
/* (we don't need any !GOLDOBJ check for "except gold" here) */
You("aren't carrying anything to adjust."); You("aren't carrying anything to adjust.");
return 0; return 0;
} }
@@ -3178,20 +2995,12 @@ int dflags;
char *title; char *title;
{ {
struct obj *ret; struct obj *ret;
#ifndef GOLDOBJ
struct obj m_gold;
#endif
char tmp[QBUFSZ]; char tmp[QBUFSZ];
int n; int n;
menu_item *selected = 0; menu_item *selected = 0;
int do_all = (dflags & MINV_ALL) != 0, int do_all = (dflags & MINV_ALL) != 0,
incl_hero = (do_all && u.uswallow && mon == u.ustuck), 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), have_inv = (mon->minvent != 0),
#endif
have_any = (have_inv || incl_hero); have_any = (have_inv || incl_hero);
Sprintf(tmp,"%s %s:", s_suffix(noit_Monnam(mon)), Sprintf(tmp,"%s %s:", s_suffix(noit_Monnam(mon)),
@@ -3203,34 +3012,12 @@ char *title;
*/ */
youmonst.data = mon->data; 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, n = query_objlist(title ? title : tmp, mon->minvent,
INVORDER_SORT | (incl_hero ? INCLUDE_HERO : 0), INVORDER_SORT | (incl_hero ? INCLUDE_HERO : 0),
&selected, &selected,
(dflags & MINV_NOLET) ? PICK_NONE : PICK_ONE, (dflags & MINV_NOLET) ? PICK_NONE : PICK_ONE,
do_all ? allow_all : worn_wield_only); do_all ? allow_all : worn_wield_only);
#ifndef GOLDOBJ
if (do_gold) obj_extract_self(&m_gold);
#endif
set_uasmon(); set_uasmon();
} else { } else {
invdisp_nothing(title ? title : tmp, "(none)"); invdisp_nothing(title ? title : tmp, "(none)");
@@ -3240,14 +3027,6 @@ char *title;
if (n > 0) { if (n > 0) {
ret = selected[0].item.a_obj; ret = selected[0].item.a_obj;
free((genericptr_t)selected); 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 } else
ret = (struct obj *) 0; ret = (struct obj *) 0;
return ret; return ret;
-19
View File
@@ -454,7 +454,6 @@ register struct monst *mtmp;
(void) mongets(mtmp, rnd_offensive_item(mtmp)); (void) mongets(mtmp, rnd_offensive_item(mtmp));
} }
#ifdef GOLDOBJ
/* /*
* Makes up money for monster's inventory. * Makes up money for monster's inventory.
* This will change with silver & copper coins * This will change with silver & copper coins
@@ -468,7 +467,6 @@ long amount;
gold->quan = amount; gold->quan = amount;
add_to_minv(mtmp, gold); add_to_minv(mtmp, gold);
} }
#endif
STATIC_OVL void STATIC_OVL void
m_initinv(mtmp) m_initinv(mtmp)
@@ -555,11 +553,7 @@ register struct monst *mtmp;
rn2(3) ? CLOAK_OF_PROTECTION : rn2(3) ? CLOAK_OF_PROTECTION :
CLOAK_OF_MAGIC_RESISTANCE); CLOAK_OF_MAGIC_RESISTANCE);
(void) mongets(mtmp, SMALL_SHIELD); (void) mongets(mtmp, SMALL_SHIELD);
#ifndef GOLDOBJ
mtmp->mgold = (long)rn1(10,20);
#else
mkmonmoney(mtmp,(long)rn1(10,20)); mkmonmoney(mtmp,(long)rn1(10,20));
#endif
} else if (quest_mon_represents_role(ptr,PM_MONK)) { } else if (quest_mon_represents_role(ptr,PM_MONK)) {
(void) mongets(mtmp, rn2(11) ? ROBE : (void) mongets(mtmp, rn2(11) ? ROBE :
CLOAK_OF_MAGIC_RESISTANCE); CLOAK_OF_MAGIC_RESISTANCE);
@@ -613,11 +607,7 @@ register struct monst *mtmp;
} }
break; break;
case S_LEPRECHAUN: case S_LEPRECHAUN:
#ifndef GOLDOBJ
mtmp->mgold = (long) d(level_difficulty(), 30);
#else
mkmonmoney(mtmp, (long) d(level_difficulty(), 30)); mkmonmoney(mtmp, (long) d(level_difficulty(), 30));
#endif
break; break;
case S_DEMON: case S_DEMON:
/* moved here from m_initweap() because these don't /* moved here from m_initweap() because these don't
@@ -640,14 +630,8 @@ register struct monst *mtmp;
(void) mongets(mtmp, rnd_defensive_item(mtmp)); (void) mongets(mtmp, rnd_defensive_item(mtmp));
if ((int) mtmp->m_lev > rn2(100)) if ((int) mtmp->m_lev > rn2(100))
(void) mongets(mtmp, rnd_misc_item(mtmp)); (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)) if (likes_gold(ptr) && !findgold(mtmp->minvent) && !rn2(5))
mkmonmoney(mtmp, (long) d(level_difficulty(), mtmp->minvent ? 5 : 10)); mkmonmoney(mtmp, (long) d(level_difficulty(), mtmp->minvent ? 5 : 10));
#endif
} }
/* Note: for long worms, always call cutworm (cutworm calls clone_mon) */ /* Note: for long worms, always call cutworm (cutworm calls clone_mon) */
@@ -691,9 +675,6 @@ xchar x, y; /* clone's preferred location or 0 (near mon) */
m2->mcloned = 1; m2->mcloned = 1;
m2->minvent = (struct obj *) 0; /* objects don't clone */ m2->minvent = (struct obj *) 0; /* objects don't clone */
m2->mleashed = FALSE; m2->mleashed = FALSE;
#ifndef GOLDOBJ
m2->mgold = 0L;
#endif
/* Max HP the same, but current HP halved for both. The caller /* Max HP the same, but current HP halved for both. The caller
* might want to override this by halving the max HP also. * might want to override this by halving the max HP also.
* When current HP is odd, the original keeps the extra point. * When current HP is odd, the original keeps the extra point.
-9
View File
@@ -1050,14 +1050,6 @@ mdamagem(magr, mdef, mattk)
break; break;
case AD_SGLD: case AD_SGLD:
tmp = 0; 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; if (magr->mcan) break;
/* technically incorrect; no check for stealing gold from /* technically incorrect; no check for stealing gold from
* between mdef's feet... * between mdef's feet...
@@ -1068,7 +1060,6 @@ mdamagem(magr, mdef, mattk)
obj_extract_self(gold); obj_extract_self(gold);
add_to_minv(magr, gold); add_to_minv(magr, gold);
} }
#endif
mdef->mstrategy &= ~STRAT_WAITFORU; mdef->mstrategy &= ~STRAT_WAITFORU;
if (vis) { if (vis) {
Strcpy(buf, Monnam(magr)); Strcpy(buf, Monnam(magr));
-22
View File
@@ -2430,27 +2430,6 @@ register struct monst *mon;
pline("%s tries to take your money, but fails...", pline("%s tries to take your money, but fails...",
noit_Monnam(mon)); noit_Monnam(mon));
else { 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 cost;
long umoney = money_cnt(invent); long umoney = money_cnt(invent);
@@ -2470,7 +2449,6 @@ register struct monst *mon;
money2mon(mon, cost); money2mon(mon, cost);
context.botl = 1; context.botl = 1;
} }
#endif
} }
if (!rn2(25)) mon->mcan = 1; /* monster is worn out */ if (!rn2(25)) mon->mcan = 1; /* monster is worn out */
if (!tele_restrict(mon)) (void) rloc(mon, FALSE); if (!tele_restrict(mon)) (void) rloc(mon, FALSE);
-17
View File
@@ -236,11 +236,7 @@ register struct monst *mtmp;
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
return(1); return(1);
} }
#ifndef GOLDOBJ
cash = u.ugold;
#else
cash = money_cnt(invent); cash = money_cnt(invent);
#endif
demand = (cash * (rnd(80) + 20 * Athome)) / demand = (cash * (rnd(80) + 20 * Athome)) /
(100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp))));
@@ -281,9 +277,7 @@ struct monst *mtmp;
{ {
char buf[BUFSZ]; char buf[BUFSZ];
long offer; long offer;
#ifdef GOLDOBJ
long umoney = money_cnt(invent); long umoney = money_cnt(invent);
#endif
getlin("How much will you offer?", buf); getlin("How much will you offer?", buf);
if (sscanf(buf, "%ld", &offer) != 1) offer = 0L; if (sscanf(buf, "%ld", &offer) != 1) offer = 0L;
@@ -297,16 +291,6 @@ struct monst *mtmp;
} else if (offer == 0L) { } else if (offer == 0L) {
You("refuse."); You("refuse.");
return 0L; 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) { } else if (offer >= umoney) {
You("give %s all your gold.", mon_nam(mtmp)); You("give %s all your gold.", mon_nam(mtmp));
offer = umoney; offer = umoney;
@@ -314,7 +298,6 @@ struct monst *mtmp;
You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer));
} }
(void) money2mon(mtmp, offer); (void) money2mon(mtmp, offer);
#endif
context.botl = 1; context.botl = 1;
return(offer); return(offer);
} }
-8
View File
@@ -1037,9 +1037,7 @@ register struct obj *otmp;
{ {
int old_light = 0; int old_light = 0;
#ifdef GOLDOBJ
if (otmp->oclass == COIN_CLASS) return; if (otmp->oclass == COIN_CLASS) return;
#endif
if (otmp->lamplit) old_light = arti_light_radius(otmp); if (otmp->lamplit) old_light = arti_light_radius(otmp);
otmp->cursed = 0; otmp->cursed = 0;
otmp->blessed = 1; otmp->blessed = 1;
@@ -1074,9 +1072,7 @@ register struct obj *otmp;
{ {
int old_light = 0; int old_light = 0;
#ifdef GOLDOBJ
if (otmp->oclass == COIN_CLASS) return; if (otmp->oclass == COIN_CLASS) return;
#endif
if (otmp->lamplit) old_light = arti_light_radius(otmp); if (otmp->lamplit) old_light = arti_light_radius(otmp);
otmp->blessed = 0; otmp->blessed = 0;
otmp->cursed = 1; otmp->cursed = 1;
@@ -1351,10 +1347,6 @@ struct monst *mtmp;
mtmp2->data = (struct permonst *)0; mtmp2->data = (struct permonst *)0;
mtmp2->minvent = (struct obj *)0; mtmp2->minvent = (struct obj *)0;
if (mtmp->mextra) copy_mextra(mtmp2, mtmp); if (mtmp->mextra) copy_mextra(mtmp2, mtmp);
#ifndef GOLDOBJ
/* not a pointer but is discarded along with minvent */
mtmp2->mgold = 0L;
#endif
} }
return obj; return obj;
} }
-18
View File
@@ -826,13 +826,8 @@ mpickgold(mtmp)
if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) { if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) {
mat_idx = objects[gold->otyp].oc_material; mat_idx = objects[gold->otyp].oc_material;
#ifndef GOLDOBJ
mtmp->mgold += gold->quan;
delobj(gold);
#else
obj_extract_self(gold); obj_extract_self(gold);
add_to_minv(mtmp, gold); add_to_minv(mtmp, gold);
#endif
if (cansee(mtmp->mx, mtmp->my) ) { if (cansee(mtmp->mx, mtmp->my) ) {
if (flags.verbose && !mtmp->isgd) if (flags.verbose && !mtmp->isgd)
pline("%s picks up some %s.", Monnam(mtmp), pline("%s picks up some %s.", Monnam(mtmp),
@@ -1731,9 +1726,6 @@ register struct monst *mdef;
mdrop_special_objs(mdef); mdrop_special_objs(mdef);
/* release rest of monster's inventory--it is removed from game */ /* release rest of monster's inventory--it is removed from game */
discard_minvent(mdef); discard_minvent(mdef);
#ifndef GOLDOBJ
mdef->mgold = 0L;
#endif
m_detach(mdef, mdef->data); m_detach(mdef, mdef->data);
} }
@@ -1789,16 +1781,6 @@ register struct monst *mdef;
oldminvent = obj->nobj; oldminvent = obj->nobj;
(void) add_to_container(otmp, obj); (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 */ /* Archeologists should not break unique statues */
if (mdef->data->geno & G_UNIQ) if (mdef->data->geno & G_UNIQ)
otmp->spe = 1; otmp->spe = 1;
+1 -28
View File
@@ -477,13 +477,8 @@ toofar:
if(!nearby || mtmp->mflee || scared || if(!nearby || mtmp->mflee || scared ||
mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) || 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 && (mdat->mlet == S_LEPRECHAUN &&
!findgold(invent) && (findgold(mtmp->minvent) || rn2(2))) || !findgold(invent) && (findgold(mtmp->minvent) || rn2(2))) ||
#endif
(is_wanderer(mdat) && !rn2(4)) || (Conflict && !mtmp->iswiz) || (is_wanderer(mdat) && !rn2(4)) || (Conflict && !mtmp->iswiz) ||
(!mtmp->mcansee && !rn2(4)) || mtmp->mpeaceful) { (!mtmp->mcansee && !rn2(4)) || mtmp->mpeaceful) {
/* Possibly cast an undirected spell if not attacking you */ /* Possibly cast an undirected spell if not attacking you */
@@ -765,9 +760,7 @@ not_special:
if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck)) if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck))
appr = 0; appr = 0;
else { else {
#ifdef GOLDOBJ
struct obj *lepgold, *ygold; struct obj *lepgold, *ygold;
#endif
boolean should_see = (couldsee(omx, omy) && boolean should_see = (couldsee(omx, omy) &&
(levl[gx][gy].lit || (levl[gx][gy].lit ||
!levl[omx][omy].lit) && !levl[omx][omy].lit) &&
@@ -783,12 +776,8 @@ not_special:
appr = 0; appr = 0;
if(monsndx(ptr) == PM_LEPRECHAUN && (appr == 1) && if(monsndx(ptr) == PM_LEPRECHAUN && (appr == 1) &&
#ifndef GOLDOBJ
(mtmp->mgold > u.ugold))
#else
( (lepgold = findgold(mtmp->minvent)) && ( (lepgold = findgold(mtmp->minvent)) &&
(lepgold->quan > ((ygold = findgold(invent)) ? ygold->quan : 0L)) )) (lepgold->quan > ((ygold = findgold(invent)) ? ygold->quan : 0L)) ))
#endif
appr = -1; appr = -1;
if (!should_see && can_track(ptr)) { if (!should_see && can_track(ptr)) {
@@ -1320,9 +1309,7 @@ register struct monst *mtmp;
{ {
boolean notseen, gotu; boolean notseen, gotu;
register int disp, mx = mtmp->mux, my = mtmp->muy; register int disp, mx = mtmp->mux, my = mtmp->muy;
#ifdef GOLDOBJ
long umoney = money_cnt(invent); long umoney = money_cnt(invent);
#endif
/* /*
* do cheapest and/or most likely tests first * do cheapest and/or most likely tests first
@@ -1340,13 +1327,7 @@ register struct monst *mtmp;
if (notseen || Underwater) { if (notseen || Underwater) {
/* Xorns can smell quantities of valuable metal /* Xorns can smell quantities of valuable metal
like that in solid gold coins, treat as seen */ like that in solid gold coins, treat as seen */
if ((mtmp->data == &mons[PM_XORN]) && if ((mtmp->data == &mons[PM_XORN]) && umoney && !Underwater)
#ifndef GOLDOBJ
u.ugold
#else
umoney
#endif
&& !Underwater)
disp = 0; disp = 0;
else else
disp = 1; disp = 1;
@@ -1433,22 +1414,14 @@ struct monst *mtmp;
struct obj *chain, *obj; struct obj *chain, *obj;
if (mtmp == &youmonst) { if (mtmp == &youmonst) {
#ifndef GOLDOBJ
if (u.ugold > 100L) return TRUE;
#endif
chain = invent; chain = invent;
} else { } else {
#ifndef GOLDOBJ
if (mtmp->mgold > 100L) return TRUE;
#endif
chain = mtmp->minvent; chain = mtmp->minvent;
} }
for (obj = chain; obj; obj = obj->nobj) { for (obj = chain; obj; obj = obj->nobj) {
int typ = obj->otyp; int typ = obj->otyp;
#ifdef GOLDOBJ
if (typ == COIN_CLASS && obj->quan > 100L) return TRUE; if (typ == COIN_CLASS && obj->quan > 100L) return TRUE;
#endif
if (obj->oclass != GEM_CLASS && if (obj->oclass != GEM_CLASS &&
!(typ >= ARROW && typ <= BOOMERANG) && !(typ >= ARROW && typ <= BOOMERANG) &&
!(typ >= DAGGER && typ <= CRYSKNIFE) && !(typ >= DAGGER && typ <= CRYSKNIFE) &&
-4
View File
@@ -260,11 +260,7 @@ register boolean special;
(void)mongets(mtmp, rnd_class(DILITHIUM_CRYSTAL, JADE)); (void)mongets(mtmp, rnd_class(DILITHIUM_CRYSTAL, JADE));
/* To get the gold "right" would mean a player can double his */ /* To get the gold "right" would mean a player can double his */
/* gold supply by killing one mplayer. Not good. */ /* gold supply by killing one mplayer. Not good. */
#ifndef GOLDOBJ
mtmp->mgold = rn2(1000);
#else
mkmonmoney(mtmp, rn2(1000)); mkmonmoney(mtmp, rn2(1000));
#endif
quan = rn2(10); quan = rn2(10);
while(quan--) while(quan--)
(void) mpickobj(mtmp, mkobj(RANDOM_CLASS, FALSE)); (void) mpickobj(mtmp, mkobj(RANDOM_CLASS, FALSE));
-8
View File
@@ -930,10 +930,8 @@ boolean
not_fully_identified(otmp) not_fully_identified(otmp)
register struct obj *otmp; register struct obj *otmp;
{ {
#ifdef GOLDOBJ
/* gold doesn't have any interesting attributes [yet?] */ /* gold doesn't have any interesting attributes [yet?] */
if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */ if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */
#endif
/* check fundamental ID hallmarks first */ /* check fundamental ID hallmarks first */
if (!otmp->known || !otmp->dknown || if (!otmp->known || !otmp->dknown ||
#ifdef MAIL #ifdef MAIL
@@ -2592,15 +2590,9 @@ struct obj *no_wish;
!strcmpi(bp, "coin") || *bp == GOLD_SYM) { !strcmpi(bp, "coin") || *bp == GOLD_SYM) {
if (cnt > 5000 && !wizard) cnt = 5000; if (cnt > 5000 && !wizard) cnt = 5000;
else if (cnt < 1) cnt = 1; 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 = mksobj(GOLD_PIECE, FALSE, FALSE);
otmp->quan = (long) cnt; otmp->quan = (long) cnt;
otmp->owt = weight(otmp); otmp->owt = weight(otmp);
#endif
context.botl = 1; context.botl = 1;
return otmp; return otmp;
} }
-5
View File
@@ -909,12 +909,7 @@ char *op;
char *sp, buf[BUFSZ]; char *sp, buf[BUFSZ];
num = 0; num = 0;
#ifndef GOLDOBJ
if (!index(op, GOLD_SYM))
buf[num++] = COIN_CLASS;
#else
/* !!!! probably unnecessary with gold as normal inventory */ /* !!!! probably unnecessary with gold as normal inventory */
#endif
for (sp = op; *sp; sp++) { for (sp = op; *sp; sp++) {
oc_sym = def_char_to_objclass(*sp); oc_sym = def_char_to_objclass(*sp);
-128
View File
@@ -12,13 +12,8 @@
#define CONTAINED_SYM '>' /* from invent.c */ #define CONTAINED_SYM '>' /* from invent.c */
STATIC_DCL void FDECL(simple_look, (struct obj *,BOOLEAN_P)); 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 *, STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *,
const char *,struct obj *,BOOLEAN_P,int *)); const char *,struct obj *,BOOLEAN_P,int *));
#endif
STATIC_DCL boolean FDECL(fatal_corpse_mistake, (struct obj *,BOOLEAN_P)); STATIC_DCL boolean FDECL(fatal_corpse_mistake, (struct obj *,BOOLEAN_P));
STATIC_DCL void FDECL(check_here, (BOOLEAN_P)); STATIC_DCL void FDECL(check_here, (BOOLEAN_P));
STATIC_DCL boolean FDECL(n_or_more, (struct obj *)); STATIC_DCL boolean FDECL(n_or_more, (struct obj *));
@@ -101,15 +96,6 @@ boolean here; /* flag for type of obj list linkage */
} }
} }
#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 int
collect_obj_classes(ilets, otmp, here, filter, itemcount) collect_obj_classes(ilets, otmp, here, filter, itemcount)
char ilets[]; char ilets[];
@@ -117,16 +103,11 @@ register struct obj *otmp;
boolean here; boolean here;
boolean FDECL((*filter),(OBJ_P)); boolean FDECL((*filter),(OBJ_P));
int *itemcount; int *itemcount;
#endif
{ {
register int iletct = 0; register int iletct = 0;
register char c; register char c;
*itemcount = 0; *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 */ ilets[iletct] = '\0'; /* terminate ilets so that index() will work */
while (otmp) { while (otmp) {
c = def_oc_syms[(int)otmp->oclass].sym; c = def_oc_syms[(int)otmp->oclass].sym;
@@ -151,17 +132,6 @@ int *itemcount;
* "?/a" or "a?/" or "/a?",&c picks all '?' even though no '/' * "?/a" or "a?/" or "/a?",&c picks all '?' even though no '/'
* (ie, treated as if it had just been "?a"). * (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 STATIC_OVL boolean
query_classes(oclasses, one_at_a_time, everything, action, objs, query_classes(oclasses, one_at_a_time, everything, action, objs,
here, menu_on_demand) here, menu_on_demand)
@@ -171,7 +141,6 @@ const char *action;
struct obj *objs; struct obj *objs;
boolean here; boolean here;
int *menu_on_demand; int *menu_on_demand;
#endif
{ {
char ilets[20], inbuf[BUFSZ]; char ilets[20], inbuf[BUFSZ];
int iletct, oclassct; int iletct, oclassct;
@@ -183,9 +152,6 @@ int *menu_on_demand;
oclasses[oclassct = 0] = '\0'; oclasses[oclassct = 0] = '\0';
*one_at_a_time = *everything = m_seen = FALSE; *one_at_a_time = *everything = m_seen = FALSE;
iletct = collect_obj_classes(ilets, objs, here, iletct = collect_obj_classes(ilets, objs, here,
#ifndef GOLDOBJ
incl_gold,
#endif
(boolean FDECL((*),(OBJ_P))) 0, &itemcount); (boolean FDECL((*),(OBJ_P))) 0, &itemcount);
if (iletct == 0) { if (iletct == 0) {
return FALSE; return FALSE;
@@ -578,9 +544,6 @@ menu_pickup:
if (!query_classes(oclasses, &selective, &all_of_a_type, if (!query_classes(oclasses, &selective, &all_of_a_type,
"pick up", objchain, "pick up", objchain,
traverse_how == BY_NEXTHERE, traverse_how == BY_NEXTHERE,
#ifndef GOLDOBJ
FALSE,
#endif
&via_menu)) { &via_menu)) {
if (!via_menu) return (0); if (!via_menu) return (0);
n = query_objlist("Pick up what?", n = query_objlist("Pick up what?",
@@ -1096,11 +1059,7 @@ int *wt_before, *wt_after;
savequan = obj->quan; savequan = obj->quan;
saveowt = obj->owt; saveowt = obj->owt;
#ifndef GOLDOBJ
umoney = u.ugold;
#else
umoney = money_cnt(invent); umoney = money_cnt(invent);
#endif
iw = max_capacity(); iw = max_capacity();
if (count != savequan) { if (count != savequan) {
@@ -1324,53 +1283,6 @@ boolean telekinesis; /* not picking it up directly by hand */
return 0; return 0;
} else if (obj->oartifact && !touch_artifact(obj,&youmonst)) { } else if (obj->oartifact && !touch_artifact(obj,&youmonst)) {
return 0; 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) { } else if (obj->otyp == CORPSE) {
if (fatal_corpse_mistake(obj, telekinesis) || if (fatal_corpse_mistake(obj, telekinesis) ||
rider_corpse_revival(obj, telekinesis)) rider_corpse_revival(obj, telekinesis))
@@ -1395,10 +1307,8 @@ boolean telekinesis; /* not picking it up directly by hand */
if ((res = lift_object(obj, (struct obj *)0, &count, telekinesis)) <= 0) if ((res = lift_object(obj, (struct obj *)0, &count, telekinesis)) <= 0)
return res; return res;
#ifdef GOLDOBJ
/* Whats left of the special case for gold :-) */ /* Whats left of the special case for gold :-) */
if (obj->oclass == COIN_CLASS) context.botl = 1; if (obj->oclass == COIN_CLASS) context.botl = 1;
#endif
if (obj->quan != count && obj->otyp != LOADSTONE) if (obj->quan != count && obj->otyp != LOADSTONE)
obj = splitobj(obj, count); obj = splitobj(obj, count);
@@ -1417,8 +1327,6 @@ boolean telekinesis; /* not picking it up directly by hand */
* and putting it in the hero's inventory. Take care of billing. Return a * 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 * pointer to the object where otmp ends up. This may be different
* from otmp because of merging. * from otmp because of merging.
*
* Gold never reaches this routine unless GOLDOBJ is defined.
*/ */
struct obj * struct obj *
pick_obj(otmp) pick_obj(otmp)
@@ -1703,12 +1611,6 @@ reverse_loot()
return FALSE; 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 */ /* find a money object to mess with */
for (goldob = invent; goldob; goldob = goldob->nobj) for (goldob = invent; goldob; goldob = goldob->nobj)
if (goldob->oclass == COIN_CLASS) { if (goldob->oclass == COIN_CLASS) {
@@ -1717,7 +1619,6 @@ reverse_loot()
goldob = splitobj(goldob, contribution); goldob = splitobj(goldob, contribution);
break; break;
} }
#endif
if (!goldob) return FALSE; if (!goldob) return FALSE;
if (!IS_THRONE(levl[x][y].typ)) { if (!IS_THRONE(levl[x][y].typ)) {
@@ -1738,9 +1639,7 @@ reverse_loot()
if (coffers) { if (coffers) {
verbalize("Thank you for your contribution to reduce the debt."); verbalize("Thank you for your contribution to reduce the debt.");
#ifdef GOLDOBJ
freeinv(goldob); freeinv(goldob);
#endif
(void)add_to_container(coffers, goldob); (void)add_to_container(coffers, goldob);
coffers->owt = weight(coffers); coffers->owt = weight(coffers);
coffers->cknown = 0; coffers->cknown = 0;
@@ -1749,13 +1648,8 @@ reverse_loot()
(void)boxlock(coffers, &boxdummy); (void)boxlock(coffers, &boxdummy);
} }
} else if ((mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) { } else if ((mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
#ifndef GOLDOBJ
mon->mgold += goldob->quan;
delobj(goldob);
#else
freeinv(goldob); freeinv(goldob);
add_to_minv(mon, goldob); add_to_minv(mon, goldob);
#endif
pline("The exchequer accepts your contribution."); pline("The exchequer accepts your contribution.");
} else { } else {
You("drop %s.", doname(goldob)); You("drop %s.", doname(goldob));
@@ -2048,9 +1942,6 @@ register struct obj *obj;
otmp, count); otmp, count);
if (is_gold) { if (is_gold) {
#ifndef GOLDOBJ
dealloc_obj(obj);
#endif
bot(); /* update character's gold piece count immediately */ bot(); /* update character's gold piece count immediately */
} }
return 1; return 1;
@@ -2167,9 +2058,6 @@ struct obj **objp;
int held; int held;
{ {
struct obj *curr, *otmp, *obj = *objp; struct obj *curr, *otmp, *obj = *objp;
#ifndef GOLDOBJ
struct obj *u_gold = (struct obj *)0;
#endif
boolean quantum_cat, cursed_mbag, boolean quantum_cat, cursed_mbag,
loot_out, loot_in, loot_in_first, stash_one, loot_out, loot_in, loot_in_first, stash_one,
inokay, outokay, outmaybe; inokay, outokay, outmaybe;
@@ -2233,9 +2121,6 @@ int held;
} }
inokay = (invent != 0 && inokay = (invent != 0 &&
!(invent == current_container && !current_container->nobj)); !(invent == current_container && !current_container->nobj));
#ifndef GOLDOBJ
if (u.ugold) inokay = TRUE;
#endif
outokay = Has_contents(current_container); outokay = Has_contents(current_container);
if (!outokay) /* preformat the empty-container message */ if (!outokay) /* preformat the empty-container message */
Sprintf(emptymsg, "%s is %sempty.", Sprintf(emptymsg, "%s is %sempty.",
@@ -2330,11 +2215,6 @@ int held;
} }
} }
#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) && if ((loot_in || stash_one) &&
(!invent || (invent == current_container && !invent->nobj))) { (!invent || (invent == current_container && !invent->nobj))) {
You("don't have anything%s to %s.", You("don't have anything%s to %s.",
@@ -2370,11 +2250,6 @@ int held;
/* putting something in might have triggered magic bag explosion */ /* putting something in might have triggered magic bag explosion */
if (!current_container) loot_out = FALSE; 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 */ /* out after in */
if (loot_out && loot_in_first) { if (loot_out && loot_in_first) {
if (!Has_contents(current_container)) { if (!Has_contents(current_container)) {
@@ -2432,9 +2307,6 @@ boolean put_in;
if (query_classes(selection, &one_by_one, &allflag, if (query_classes(selection, &one_by_one, &allflag,
action, *objlist, FALSE, action, *objlist, FALSE,
#ifndef GOLDOBJ
put_in ? (boolean)(u.ugold != 0L) : FALSE,
#endif
&menu_on_request)) { &menu_on_request)) {
if (askchain(objlist, (one_by_one ? (char *)0 : selection), if (askchain(objlist, (one_by_one ? (char *)0 : selection),
allflag, actionfunc, checkfunc, 0, action)) allflag, actionfunc, checkfunc, 0, action))
-27
View File
@@ -539,20 +539,6 @@ register struct monst *priest;
priest->mpeaceful = 0; priest->mpeaceful = 0;
return; 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(!money_cnt(invent)) {
if(coaligned && !strayed) { if(coaligned && !strayed) {
long pmoney = money_cnt(priest->minvent); long pmoney = money_cnt(priest->minvent);
@@ -561,7 +547,6 @@ register struct monst *priest;
pline("%s gives you %s for an ale.", Monnam(priest), pline("%s gives you %s for an ale.", Monnam(priest),
(pmoney == 1L) ? "one bit" : "two bits"); (pmoney == 1L) ? "one bit" : "two bits");
money2u(priest, pmoney > 1L ? 2 : 1); money2u(priest, pmoney > 1L ? 2 : 1);
#endif
} else } else
pline("%s preaches the virtues of poverty.", Monnam(priest)); pline("%s preaches the virtues of poverty.", Monnam(priest));
exercise(A_WIS, TRUE); exercise(A_WIS, TRUE);
@@ -577,11 +562,7 @@ register struct monst *priest;
verbalize("Thou shalt regret thine action!"); verbalize("Thou shalt regret thine action!");
if(coaligned) adjalign(-1); if(coaligned) adjalign(-1);
} else if(offer < (u.ulevel * 200)) { } else if(offer < (u.ulevel * 200)) {
#ifndef GOLDOBJ
if(u.ugold > (offer * 2L)) verbalize("Cheapskate.");
#else
if(money_cnt(invent) > (offer * 2L)) verbalize("Cheapskate."); if(money_cnt(invent) > (offer * 2L)) verbalize("Cheapskate.");
#endif
else { else {
verbalize("I thank thee for thy contribution."); verbalize("I thank thee for thy contribution.");
/* give player some token */ /* give player some token */
@@ -589,11 +570,7 @@ register struct monst *priest;
} }
} else if(offer < (u.ulevel * 400)) { } else if(offer < (u.ulevel * 400)) {
verbalize("Thou art indeed a pious individual."); verbalize("Thou art indeed a pious individual.");
#ifndef GOLDOBJ
if(u.ugold < (offer * 2L)) {
#else
if(money_cnt(invent) < (offer * 2L)) { if(money_cnt(invent) < (offer * 2L)) {
#endif
if (coaligned && u.ualign.record <= ALGN_SINNED) if (coaligned && u.ualign.record <= ALGN_SINNED)
adjalign(1); adjalign(1);
verbalize("I bestow upon thee a blessing."); verbalize("I bestow upon thee a blessing.");
@@ -614,11 +591,7 @@ register struct monst *priest;
} else u.ublessed++; } else u.ublessed++;
} else { } else {
verbalize("Thy selfless generosity is deeply appreciated."); verbalize("Thy selfless generosity is deeply appreciated.");
#ifndef GOLDOBJ
if(u.ugold < (offer * 2L) && coaligned) {
#else
if(money_cnt(invent) < (offer * 2L) && coaligned) { if(money_cnt(invent) < (offer * 2L) && coaligned) {
#endif
if(strayed && (moves - u.ucleansed) > 5000L) { if(strayed && (moves - u.ucleansed) > 5000L) {
u.ualign.record = 0; /* cleanse thee */ u.ualign.record = 0; /* cleanse thee */
u.ucleansed = moves; u.ucleansed = moves;
-2
View File
@@ -992,10 +992,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
} else { } else {
for (obj = invent; obj; obj = obj->nobj) { for (obj = invent; obj; obj = obj->nobj) {
long wornmask; long wornmask;
#ifdef GOLDOBJ
/* gold isn't subject to cursing and blessing */ /* gold isn't subject to cursing and blessing */
if (obj->oclass == COIN_CLASS) continue; if (obj->oclass == COIN_CLASS) continue;
#endif
wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI)); wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI));
if (wornmask && !sblessed) { if (wornmask && !sblessed) {
/* handle a couple of special cases; we don't /* handle a couple of special cases; we don't
-42
View File
@@ -146,17 +146,6 @@ boolean quietly;
for (otmp = invent; otmp; otmp = otmp2) { for (otmp = invent; otmp; otmp = otmp2) {
otmp2 = otmp->nobj; 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 (otmp->in_use) {
if (!quietly) pline("Finishing off %s...", xname(otmp)); if (!quietly) pline("Finishing off %s...", xname(otmp));
useup(otmp); useup(otmp);
@@ -441,9 +430,6 @@ boolean ghostly;
/* restore monster back pointer */ /* restore monster back pointer */
for (obj = mtmp->minvent; obj; obj = obj->nobj) for (obj = mtmp->minvent; obj; obj = obj->nobj)
obj->ocarry = mtmp; obj->ocarry = mtmp;
#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
put_gold_back(mtmp);
#endif
} }
if (mtmp->mw) { if (mtmp->mw) {
struct obj *obj; struct obj *obj;
@@ -598,9 +584,6 @@ unsigned int *stuckid, *steedid;
restore_timers(fd, RANGE_GLOBAL, FALSE, 0L); restore_timers(fd, RANGE_GLOBAL, FALSE, 0L);
restore_light_sources(fd); restore_light_sources(fd);
invent = restobjchn(fd, FALSE, FALSE); 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 /* tmp_bc only gets set here if the ball & chain were orphaned
because you were swallowed; otherwise they will be on the floor because you were swallowed; otherwise they will be on the floor
or in your inventory */ or in your inventory */
@@ -1571,29 +1554,4 @@ register unsigned int len;
} }
} }
#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*/ /*restore.c*/
-4
View File
@@ -107,11 +107,7 @@ time_t when;
center(NAME_LINE, buf); center(NAME_LINE, buf);
/* Put $ on stone */ /* Put $ on stone */
#ifndef GOLDOBJ
Sprintf(buf, "%ld Au", u.ugold);
#else
Sprintf(buf, "%ld Au", done_money); Sprintf(buf, "%ld Au", done_money);
#endif
buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
center(GOLD_LINE, buf); center(GOLD_LINE, buf);
-9
View File
@@ -427,11 +427,7 @@ register struct monst *oracl;
char qbuf[QBUFSZ]; char qbuf[QBUFSZ];
multi = 0; multi = 0;
#ifndef GOLDOBJ
umoney = u.ugold;
#else
umoney = money_cnt(invent); umoney = money_cnt(invent);
#endif
if (!oracl) { if (!oracl) {
There("is no one here to consult."); There("is no one here to consult.");
@@ -468,12 +464,7 @@ register struct monst *oracl;
u_pay = (umoney < (long)major_cost) ? (int)umoney : major_cost; u_pay = (umoney < (long)major_cost) ? (int)umoney : major_cost;
break; break;
} }
#ifndef GOLDOBJ
u.ugold -= (long)u_pay;
oracl->mgold += (long)u_pay;
#else
money2mon(oracl, (long)u_pay); money2mon(oracl, (long)u_pay);
#endif
context.botl = 1; context.botl = 1;
add_xpts = 0; /* first oracle of each type gives experience points */ add_xpts = 0; /* first oracle of each type gives experience points */
if (u_pay == minor_cost) { if (u_pay == minor_cost) {
-18
View File
@@ -306,9 +306,6 @@ register int fd, mode;
bwrite(fd, (genericptr_t) &flags, sizeof(struct flag)); bwrite(fd, (genericptr_t) &flags, sizeof(struct flag));
#ifdef SYSFLAGS #ifdef SYSFLAGS
bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag));
#endif
#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
if (u.ugold) (void)insert_gold_into_invent(FALSE);
#endif #endif
bwrite(fd, (genericptr_t) &u, sizeof(struct you)); bwrite(fd, (genericptr_t) &u, sizeof(struct you));
bwrite(fd, yyyymmddhhmmss(ubirthday), 14); bwrite(fd, yyyymmddhhmmss(ubirthday), 14);
@@ -319,9 +316,6 @@ register int fd, mode;
save_light_sources(fd, mode, RANGE_GLOBAL); save_light_sources(fd, mode, RANGE_GLOBAL);
saveobjchn(fd, invent, mode); saveobjchn(fd, invent, mode);
#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
if (!release_data(mode)) remove_gold_from_invent();
#endif
if (BALL_IN_MON) { if (BALL_IN_MON) {
/* prevent loss of ball & chain when swallowed */ /* prevent loss of ball & chain when swallowed */
uball->nobj = uchain; uball->nobj = uchain;
@@ -1123,22 +1117,10 @@ register struct monst *mtmp;
if (perform_bwrite(mode)) { if (perform_bwrite(mode)) {
mtmp->mnum = monsndx(mtmp->data); mtmp->mnum = monsndx(mtmp->data);
if (mtmp->ispriest) forget_temple_entry(mtmp); /* EPRI() */ 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); savemon(fd, mtmp);
} }
if (mtmp->minvent) if (mtmp->minvent)
saveobjchn(fd,mtmp->minvent,mode); saveobjchn(fd,mtmp->minvent,mode);
#ifndef GOLDOBJ /* GOLDOBJ-compatibility */
if (!release_data(mode)) put_gold_back(mtmp);
#endif
if (release_data(mode)) if (release_data(mode))
dealloc_monst(mtmp); dealloc_monst(mtmp);
mtmp = mtmp2; mtmp = mtmp2;
-91
View File
@@ -78,7 +78,6 @@ STATIC_DCL const char *FDECL(cad, (BOOLEAN_P));
*/ */
#ifdef GOLDOBJ
/* /*
Transfer money from inventory to monster when paying Transfer money from inventory to monster when paying
shopkeepers, priests, oracle, succubus, & other demons. shopkeepers, priests, oracle, succubus, & other demons.
@@ -153,8 +152,6 @@ long amount;
} }
} }
#endif /* GOLDOBJ */
STATIC_OVL struct monst * STATIC_OVL struct monst *
next_shkp(shkp, withbill) next_shkp(shkp, withbill)
register struct monst *shkp; register struct monst *shkp;
@@ -903,13 +900,8 @@ register struct monst *shkp;
long robbed = ESHK(shkp)->robbed; long robbed = ESHK(shkp)->robbed;
long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp)); long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp));
#ifndef GOLDOBJ
u.ugold -= balance;
shkp->mgold += balance;
#else
if (balance > 0) money2mon(shkp, balance); if (balance > 0) money2mon(shkp, balance);
else if (balance < 0) money2u(shkp, -balance); else if (balance < 0) money2u(shkp, -balance);
#endif
context.botl = 1; context.botl = 1;
if(robbed) { if(robbed) {
robbed -= tmp; robbed -= tmp;
@@ -1235,11 +1227,7 @@ proceed:
} }
if(shkp != resident && NOTANGRY(shkp)) { if(shkp != resident && NOTANGRY(shkp)) {
#ifdef GOLDOBJ
umoney = money_cnt(invent); umoney = money_cnt(invent);
#else
umoney = u.ugold;
#endif
if(!ltmp) if(!ltmp)
You("do not owe %s anything.", mon_nam(shkp)); You("do not owe %s anything.", mon_nam(shkp));
else if(!umoney) { else if(!umoney) {
@@ -1268,11 +1256,7 @@ proceed:
/* ltmp is still eshkp->robbed here */ /* ltmp is still eshkp->robbed here */
if (!eshkp->billct && !eshkp->debit) { if (!eshkp->billct && !eshkp->debit) {
#ifdef GOLDOBJ
umoney = money_cnt(invent); umoney = money_cnt(invent);
#else
umoney = u.ugold;
#endif
if(!ltmp && NOTANGRY(shkp)) { if(!ltmp && NOTANGRY(shkp)) {
You("do not owe %s anything.", shkname(shkp)); You("do not owe %s anything.", shkname(shkp));
if (!umoney) if (!umoney)
@@ -1325,9 +1309,7 @@ proceed:
long dtmp = eshkp->debit; long dtmp = eshkp->debit;
long loan = eshkp->loan; long loan = eshkp->loan;
char sbuf[BUFSZ]; char sbuf[BUFSZ];
#ifdef GOLDOBJ
umoney = money_cnt(invent); umoney = money_cnt(invent);
#endif
Sprintf(sbuf, "You owe %s %ld %s ", Sprintf(sbuf, "You owe %s %ld %s ",
shkname(shkp), dtmp, currency(dtmp)); shkname(shkp), dtmp, currency(dtmp));
if(loan) { if(loan) {
@@ -1337,11 +1319,7 @@ proceed:
"for gold picked up and the use of merchandise."); "for gold picked up and the use of merchandise.");
} else Strcat(sbuf, "for the use of merchandise."); } else Strcat(sbuf, "for the use of merchandise.");
pline1(sbuf); pline1(sbuf);
#ifndef GOLDOBJ
if (u.ugold + eshkp->credit < dtmp) {
#else
if (umoney + eshkp->credit < dtmp) { if (umoney + eshkp->credit < dtmp) {
#endif
pline("But you don't%s have enough gold%s.", pline("But you don't%s have enough gold%s.",
stashed_gold ? " seem to" : "", stashed_gold ? " seem to" : "",
eshkp->credit ? " or credit" : ""); eshkp->credit ? " or credit" : "");
@@ -1353,12 +1331,7 @@ proceed:
eshkp->loan = 0L; eshkp->loan = 0L;
Your("debt is covered by your credit."); Your("debt is covered by your credit.");
} else if (!eshkp->credit) { } else if (!eshkp->credit) {
#ifndef GOLDOBJ
u.ugold -= dtmp;
shkp->mgold += dtmp;
#else
money2mon(shkp, dtmp); money2mon(shkp, dtmp);
#endif
eshkp->debit = 0L; eshkp->debit = 0L;
eshkp->loan = 0L; eshkp->loan = 0L;
You("pay that debt."); You("pay that debt.");
@@ -1366,12 +1339,7 @@ proceed:
} else { } else {
dtmp -= eshkp->credit; dtmp -= eshkp->credit;
eshkp->credit = 0L; eshkp->credit = 0L;
#ifndef GOLDOBJ
u.ugold -= dtmp;
shkp->mgold += dtmp;
#else
money2mon(shkp, dtmp); money2mon(shkp, dtmp);
#endif
eshkp->debit = 0L; eshkp->debit = 0L;
eshkp->loan = 0L; eshkp->loan = 0L;
pline("That debt is partially offset by your credit."); pline("That debt is partially offset by your credit.");
@@ -1384,22 +1352,14 @@ proceed:
/* now check items on bill */ /* now check items on bill */
if (eshkp->billct) { if (eshkp->billct) {
register boolean itemize; register boolean itemize;
#ifndef GOLDOBJ
if (!u.ugold && !eshkp->credit) {
#else
umoney = money_cnt(invent); umoney = money_cnt(invent);
if (!umoney && !eshkp->credit) { if (!umoney && !eshkp->credit) {
#endif
You("%shave no money or credit%s.", You("%shave no money or credit%s.",
stashed_gold ? "seem to " : "", stashed_gold ? "seem to " : "",
paid ? " left" : ""); paid ? " left" : "");
return(0); return(0);
} }
#ifndef GOLDOBJ
if ((u.ugold + eshkp->credit) < cheapest_item(shkp)) {
#else
if ((umoney + eshkp->credit) < cheapest_item(shkp)) { if ((umoney + eshkp->credit) < cheapest_item(shkp)) {
#endif
You("don't have enough money to buy%s the item%s you picked.", You("don't have enough money to buy%s the item%s you picked.",
eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct)); eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct));
if(stashed_gold) if(stashed_gold)
@@ -1483,11 +1443,7 @@ boolean itemize;
{ {
register struct obj *obj = *obj_p; register struct obj *obj = *obj_p;
long ltmp, quan, save_quan; long ltmp, quan, save_quan;
#ifdef GOLDOBJ
long umoney = money_cnt(invent); long umoney = money_cnt(invent);
#else
long umoney = u.ugold;
#endif
int buy; int buy;
boolean stashed_gold = (hidden_gold() > 0L), boolean stashed_gold = (hidden_gold() > 0L),
consumed = (which == 0); consumed = (which == 0);
@@ -1672,9 +1628,7 @@ int numsk;
int croaked; int croaked;
{ {
long loss = 0L; long loss = 0L;
#ifdef GOLDOBJ
long umoney; long umoney;
#endif
struct eshk *eshkp = ESHK(shkp); struct eshk *eshkp = ESHK(shkp);
boolean take = FALSE, taken = FALSE; boolean take = FALSE, taken = FALSE;
unsigned save_minvis = shkp->minvis; unsigned save_minvis = shkp->minvis;
@@ -1721,12 +1675,8 @@ int croaked;
} }
if (eshkp->following || ANGRY(shkp) || take) { if (eshkp->following || ANGRY(shkp) || take) {
#ifndef GOLDOBJ
if (!invent && !u.ugold) goto skip;
#else
if (!invent) goto skip; if (!invent) goto skip;
umoney = money_cnt(invent); umoney = money_cnt(invent);
#endif
takes[0] = '\0'; takes[0] = '\0';
if (!shkp->mcanmove || shkp->msleeping) if (!shkp->mcanmove || shkp->msleeping)
Strcat(takes, "wakes up and "); Strcat(takes, "wakes up and ");
@@ -1734,18 +1684,10 @@ int croaked;
Strcat(takes, "comes and "); Strcat(takes, "comes and ");
Strcat(takes, "takes"); 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) { if (loss > umoney || !loss || roomno == eshkp->shoproom) {
eshkp->robbed -= umoney; eshkp->robbed -= umoney;
if (eshkp->robbed < 0L) eshkp->robbed = 0L; if (eshkp->robbed < 0L) eshkp->robbed = 0L;
if (umoney > 0) money2mon(shkp, umoney); if (umoney > 0) money2mon(shkp, umoney);
#endif
context.botl = 1; context.botl = 1;
pline("%s %s all your possessions.", pline("%s %s all your possessions.",
shkname(shkp), takes); shkname(shkp), takes);
@@ -1753,12 +1695,7 @@ int croaked;
/* where to put player's invent (after disclosure) */ /* where to put player's invent (after disclosure) */
set_repo_loc(shkp); set_repo_loc(shkp);
} else { } else {
#ifndef GOLDOBJ
shkp->mgold += loss;
u.ugold -= loss;
#else
money2mon(shkp, loss); money2mon(shkp, loss);
#endif
context.botl = 1; context.botl = 1;
pline("%s %s the %ld %s %sowed %s.", pline("%s %s the %ld %s %sowed %s.",
Monnam(shkp), takes, Monnam(shkp), takes,
@@ -1827,14 +1764,9 @@ finish_paybill()
unleash_all(); unleash_all();
/* if hero has any gold left, take it into shopkeeper's possession */ /* if hero has any gold left, take it into shopkeeper's possession */
if (shkp) { if (shkp) {
#ifdef GOLDOBJ
long umoney = money_cnt(invent); long umoney = money_cnt(invent);
if (umoney) money2mon(shkp, umoney); 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 */ /* transfer rest of the character's inventory to the shop floor */
drop_upon_death((struct monst *)0, (struct obj *)0, ox, oy); drop_upon_death((struct monst *)0, (struct obj *)0, ox, oy);
@@ -2837,11 +2769,7 @@ xchar x, y;
return; return;
} }
#ifndef GOLDOBJ
shkmoney = shkp->mgold;
#else
shkmoney = money_cnt(shkp->minvent); shkmoney = money_cnt(shkp->minvent);
#endif
if (!shkmoney) { if (!shkmoney) {
char c, qbuf[BUFSZ]; char c, qbuf[BUFSZ];
long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L); long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L);
@@ -3779,11 +3707,7 @@ boolean cant_mollify;
} }
if((um_dist(x, y, 1) && !uinshp) || cant_mollify || 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 (money_cnt(invent) + ESHK(shkp)->credit) < cost_of_damage
#endif
|| !rn2(50)) { || !rn2(50)) {
getcad: getcad:
if (muteshk(shkp)) { if (muteshk(shkp)) {
@@ -3807,12 +3731,7 @@ boolean cant_mollify;
currency(cost_of_damage), !animal ? "\"" : ""); currency(cost_of_damage), !animal ? "\"" : "");
if(yn(qbuf) != 'n') { if(yn(qbuf) != 'n') {
cost_of_damage = check_credit(cost_of_damage, shkp); 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); money2mon(shkp, cost_of_damage);
#endif
context.botl = 1; context.botl = 1;
pline("Mollified, %s accepts your restitution.", pline("Mollified, %s accepts your restitution.",
shkname(shkp)); shkname(shkp));
@@ -3967,9 +3886,7 @@ shk_chat(shkp)
struct monst *shkp; struct monst *shkp;
{ {
struct eshk *eshk; struct eshk *eshk;
#ifdef GOLDOBJ
long shkmoney; long shkmoney;
#endif
if (!shkp->isshk) { if (!shkp->isshk) {
/* The monster type is shopkeeper, but this monster is /* The monster type is shopkeeper, but this monster is
not actually a shk, which could happen if someone not actually a shk, which could happen if someone
@@ -4010,17 +3927,9 @@ struct monst *shkp;
shkname(shkp), eshk->credit, currency(eshk->credit)); shkname(shkp), eshk->credit, currency(eshk->credit));
else if (eshk->robbed) else if (eshk->robbed)
pline("%s complains about a recent robbery.", shkname(shkp)); 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) else if ((shkmoney = money_cnt(shkp->minvent)) < 50)
#endif
pline("%s complains that business is bad.", shkname(shkp)); pline("%s complains that business is bad.", shkname(shkp));
#ifndef GOLDOBJ
else if (shkp->mgold > 4000)
#else
else if (shkmoney > 4000) else if (shkmoney > 4000)
#endif
pline("%s says that business is good.", shkname(shkp)); pline("%s says that business is good.", shkname(shkp));
else if (is_izchak(shkp, FALSE)) else if (is_izchak(shkp, FALSE))
pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))],shkname(shkp)); pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))],shkname(shkp));
-4
View File
@@ -552,11 +552,7 @@ struct mkroom *sroom;
eshkp->billct = eshkp->visitct = 0; eshkp->billct = eshkp->visitct = 0;
eshkp->bill_p = (struct bill_x *)0; eshkp->bill_p = (struct bill_x *)0;
eshkp->customer[0] = '\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 */ mkmonmoney(shk, 1000L + 30L*(long)rnd(100)); /* initial capital */
#endif
if (shp->shknms == shkrings) if (shp->shknms == shkrings)
(void) mongets(shk, TOUCHSTONE); (void) mongets(shk, TOUCHSTONE);
nameshk(shk, shp->shknms); nameshk(shk, shp->shknms);
-14
View File
@@ -9,15 +9,6 @@
void void
take_gold() 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; struct obj *otmp, *nobj;
int lost_money = 0; int lost_money = 0;
for (otmp = invent; otmp; otmp = nobj) { for (otmp = invent; otmp; otmp = nobj) {
@@ -33,7 +24,6 @@ take_gold()
You("notice you have no money!"); You("notice you have no money!");
context.botl = 1; context.botl = 1;
} }
#endif
} }
int int
@@ -324,10 +314,8 @@ rndcurse() /* curse a few inventory items at random! */
} }
for (otmp = invent; otmp; otmp = otmp->nobj) { for (otmp = invent; otmp; otmp = otmp->nobj) {
#ifdef GOLDOBJ
/* gold isn't subject to being cursed or blessed */ /* gold isn't subject to being cursed or blessed */
if (otmp->oclass == COIN_CLASS) continue; if (otmp->oclass == COIN_CLASS) continue;
#endif
nobj++; nobj++;
} }
if (nobj) { if (nobj) {
@@ -335,10 +323,8 @@ rndcurse() /* curse a few inventory items at random! */
cnt > 0; cnt--) { cnt > 0; cnt--) {
onum = rnd(nobj); onum = rnd(nobj);
for (otmp = invent; otmp; otmp = otmp->nobj) { for (otmp = invent; otmp; otmp = otmp->nobj) {
#ifdef GOLDOBJ
/* as above */ /* as above */
if (otmp->oclass == COIN_CLASS) continue; if (otmp->oclass == COIN_CLASS) continue;
#endif
if (--onum == 0) break; /* found the target */ if (--onum == 0) break; /* found the target */
} }
/* the !otmp case should never happen; picking an already /* the !otmp case should never happen; picking an already
-4
View File
@@ -874,11 +874,7 @@ register struct monst *mtmp;
else verbl_msg = "Relax, this won't hurt a bit."; else verbl_msg = "Relax, this won't hurt a bit.";
break; break;
case MS_GUARD: case MS_GUARD:
#ifndef GOLDOBJ
if (u.ugold)
#else
if (money_cnt(invent)) if (money_cnt(invent))
#endif
verbl_msg = "Please drop that gold and follow me."; verbl_msg = "Please drop that gold and follow me.";
else else
verbl_msg = "Please follow me."; verbl_msg = "Please follow me.";
+1 -97
View File
@@ -22,66 +22,6 @@ register struct obj *otmp;
"armor"); "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 */ long /* actually returns something that fits in an int */
somegold(umoney) somegold(umoney)
long umoney; long umoney;
@@ -167,7 +107,6 @@ register struct monst *mtmp;
context.botl = 1; context.botl = 1;
} }
} }
#endif /* GOLDOBJ */
/* steal armor after you finish taking it off */ /* steal armor after you finish taking it off */
unsigned int stealoid; /* object to be stolen */ unsigned int stealoid; /* object to be stolen */
@@ -257,7 +196,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */
/* Returns 1 when something was stolen (or at least, when N should flee now) /* Returns 1 when something was stolen (or at least, when N should flee now)
* Returns -1 if the monster died in the attempt * Returns -1 if the monster died in the attempt
* Avoid stealing the object stealoid * Avoid stealing the object stealoid
* GOLDOBJ: nymphs and monkeys won't steal coins * Nymphs and monkeys won't steal coins
*/ */
int int
steal(mtmp, objnambuf) steal(mtmp, objnambuf)
@@ -304,9 +243,7 @@ nothing_to_steal:
tmp = 0; tmp = 0;
for(otmp = invent; otmp; otmp = otmp->nobj) for(otmp = invent; otmp; otmp = otmp->nobj)
if ((!uarm || otmp != uarmc) && otmp != uskin if ((!uarm || otmp != uarmc) && otmp != uskin
#ifdef GOLDOBJ
&& otmp->oclass != COIN_CLASS && otmp->oclass != COIN_CLASS
#endif
#ifdef INVISIBLE_OBJECTS #ifdef INVISIBLE_OBJECTS
&& (!otmp->oinvis || perceives(mtmp->data)) && (!otmp->oinvis || perceives(mtmp->data))
#endif #endif
@@ -317,9 +254,7 @@ nothing_to_steal:
tmp = rn2(tmp); tmp = rn2(tmp);
for(otmp = invent; otmp; otmp = otmp->nobj) for(otmp = invent; otmp; otmp = otmp->nobj)
if ((!uarm || otmp != uarmc) && otmp != uskin if ((!uarm || otmp != uarmc) && otmp != uskin
#ifdef GOLDOBJ
&& otmp->oclass != COIN_CLASS && otmp->oclass != COIN_CLASS
#endif
#ifdef INVISIBLE_OBJECTS #ifdef INVISIBLE_OBJECTS
&& (!otmp->oinvis || perceives(mtmp->data)) && (!otmp->oinvis || perceives(mtmp->data))
#endif #endif
@@ -494,13 +429,6 @@ register struct obj *otmp;
or kicking code shouldn't continue to track and place it */ or kicking code shouldn't continue to track and place it */
if (otmp == thrownobj) thrownobj = 0; if (otmp == thrownobj) thrownobj = 0;
else if (otmp == kickedobj) kickedobj = 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; boolean snuff_otmp = FALSE;
/* don't want hidden light source inside the monster; assumes that /* don't want hidden light source inside the monster; assumes that
engulfers won't have external inventories; whirly monsters cause engulfers won't have external inventories; whirly monsters cause
@@ -523,9 +451,6 @@ register struct obj *otmp;
freed_otmp = add_to_minv(mtmp, otmp); freed_otmp = add_to_minv(mtmp, otmp);
/* and we had to defer this until object is in mtmp's inventory */ /* and we had to defer this until object is in mtmp's inventory */
if (snuff_otmp) snuff_light_source(mtmp->mx, mtmp->my); if (snuff_otmp) snuff_light_source(mtmp->mx, mtmp->my);
#ifndef GOLDOBJ
}
#endif
return freed_otmp; return freed_otmp;
} }
@@ -686,35 +611,14 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */
/* vault guard's gold goes away rather than be dropped... */ /* vault guard's gold goes away rather than be dropped... */
if (mtmp->isgd && if (mtmp->isgd &&
#ifdef GOLDOBJ
(otmp = findgold(mtmp->minvent)) != 0 (otmp = findgold(mtmp->minvent)) != 0
#else
mtmp->mgold != 0L
#endif
) { ) {
if (canspotmon(mtmp)) if (canspotmon(mtmp))
pline("%s gold %s.", s_suffix(Monnam(mtmp)), pline("%s gold %s.", s_suffix(Monnam(mtmp)),
canseemon(mtmp) ? "vanishes" : "seems to vanish"); canseemon(mtmp) ? "vanishes" : "seems to vanish");
#ifdef GOLDOBJ
obfree(otmp, (struct obj *)0); obfree(otmp, (struct obj *)0);
#else
mtmp->mgold = 0L;
#endif
} /* isgd && has gold */ } /* 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) { while ((otmp = (is_pet ? droppables(mtmp) : mtmp->minvent)) != 0) {
obj_extract_self(otmp); obj_extract_self(otmp);
mdrop_obj(mtmp, otmp, is_pet && flags.verbose); mdrop_obj(mtmp, otmp, is_pet && flags.verbose);
-23
View File
@@ -3176,30 +3176,7 @@ boolean *lostsome;
/* else continue */ /* 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! */ if (!otmp) return (FALSE); /* nothing to drop! */
#endif
if (otmp->owornmask) remove_worn_item(otmp, FALSE); if (otmp->owornmask) remove_worn_item(otmp, FALSE);
*lostsome = TRUE; *lostsome = TRUE;
dropx(otmp); dropx(otmp);
-22
View File
@@ -210,12 +210,10 @@ static struct trobj Wishing[] = {
{ WAN_WISHING, 3, WAND_CLASS, 1, 0 }, { WAN_WISHING, 3, WAND_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 } { 0, 0, 0, 0, 0 }
}; };
#ifdef GOLDOBJ
static struct trobj Money[] = { static struct trobj Money[] = {
{ GOLD_PIECE, 0 , COIN_CLASS, 1, 0 }, { GOLD_PIECE, 0 , COIN_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 } { 0, 0, 0, 0, 0 }
}; };
#endif
/* race-based substitutions for initial inventory; /* race-based substitutions for initial inventory;
the weaker cloak for elven rangers is intentional--they shoot better */ the weaker cloak for elven rangers is intentional--they shoot better */
@@ -597,11 +595,7 @@ u_init()
skill_init(Skill_C); skill_init(Skill_C);
break; break;
case PM_HEALER: case PM_HEALER:
#ifndef GOLDOBJ
u.ugold = u.ugold0 = rn1(1000, 1001);
#else
u.umoney0 = rn1(1000, 1001); u.umoney0 = rn1(1000, 1001);
#endif
ini_inv(Healer); ini_inv(Healer);
if(!rn2(25)) ini_inv(Lamp); if(!rn2(25)) ini_inv(Lamp);
knows_object(POT_FULL_HEALING); knows_object(POT_FULL_HEALING);
@@ -650,11 +644,7 @@ u_init()
break; break;
case PM_ROGUE: case PM_ROGUE:
Rogue[R_DAGGERS].trquan = rn1(10, 6); Rogue[R_DAGGERS].trquan = rn1(10, 6);
#ifndef GOLDOBJ
u.ugold = u.ugold0 = 0;
#else
u.umoney0 = 0; u.umoney0 = 0;
#endif
ini_inv(Rogue); ini_inv(Rogue);
if(!rn2(5)) ini_inv(Blindfold); if(!rn2(5)) ini_inv(Blindfold);
knows_object(SACK); knows_object(SACK);
@@ -670,11 +660,7 @@ u_init()
break; break;
case PM_TOURIST: case PM_TOURIST:
Tourist[T_DARTS].trquan = rn1(20, 21); Tourist[T_DARTS].trquan = rn1(20, 21);
#ifndef GOLDOBJ
u.ugold = u.ugold0 = rnd(1000);
#else
u.umoney0 = rnd(1000); u.umoney0 = rnd(1000);
#endif
ini_inv(Tourist); ini_inv(Tourist);
if(!rn2(25)) ini_inv(Tinopener); if(!rn2(25)) ini_inv(Tinopener);
else if(!rn2(25)) ini_inv(Leash); else if(!rn2(25)) ini_inv(Leash);
@@ -778,12 +764,8 @@ u_init()
if (wizard) if (wizard)
read_wizkit(); read_wizkit();
#ifndef GOLDOBJ
u.ugold0 += hidden_gold(); /* in case sack has gold in it */
#else
if (u.umoney0) ini_inv(Money); if (u.umoney0) ini_inv(Money);
u.umoney0 += hidden_gold(); /* in case sack has gold in it */ u.umoney0 += hidden_gold(); /* in case sack has gold in it */
#endif
find_ac(); /* get initial ac value */ find_ac(); /* get initial ac value */
init_attr(75); /* init attribute values */ init_attr(75); /* init attribute values */
@@ -939,12 +921,10 @@ register struct trobj *trop;
nocreate4 = otyp; nocreate4 = otyp;
} }
#ifdef GOLDOBJ
if (trop->trclass == COIN_CLASS) { if (trop->trclass == COIN_CLASS) {
/* no "blessed" or "identified" money */ /* no "blessed" or "identified" money */
obj->quan = u.umoney0; obj->quan = u.umoney0;
} else { } else {
#endif
if (objects[otyp].oc_uses_known) obj->known = 1; if (objects[otyp].oc_uses_known) obj->known = 1;
obj->dknown = obj->bknown = obj->rknown = 1; obj->dknown = obj->bknown = obj->rknown = 1;
if (Is_container(obj) || obj->otyp == STATUE) { if (Is_container(obj) || obj->otyp == STATUE) {
@@ -966,9 +946,7 @@ register struct trobj *trop;
obj->spe = trop->trspe; obj->spe = trop->trspe;
if (trop->trbless != UNDEF_BLESS) if (trop->trbless != UNDEF_BLESS)
obj->blessed = trop->trbless; obj->blessed = trop->trbless;
#ifdef GOLDOBJ
} }
#endif
/* defined after setting otyp+quan + blessedness */ /* defined after setting otyp+quan + blessedness */
obj->owt = weight(obj); obj->owt = weight(obj);
obj = addinv(obj); obj = addinv(obj);
-8
View File
@@ -1461,13 +1461,6 @@ register struct attack *mattk;
tmp = 0; tmp = 0;
break; break;
case AD_SGLD: 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 /* This you as a leprechaun, so steal
real gold only, no lesser coins */ real gold only, no lesser coins */
{ {
@@ -1484,7 +1477,6 @@ register struct attack *mattk;
} }
} }
} }
#endif
exercise(A_DEX, TRUE); exercise(A_DEX, TRUE);
tmp = 0; tmp = 0;
break; break;
-37
View File
@@ -366,11 +366,7 @@ fnd:
return; return;
} }
verbalize("I don't know you."); verbalize("I don't know you.");
#ifndef GOLDOBJ
umoney = u.ugold;
#else
umoney = money_cnt(invent); umoney = money_cnt(invent);
#endif
if (Deaf) { if (Deaf) {
; ;
} else if (!umoney && !hidden_gold()) { } else if (!umoney && !hidden_gold()) {
@@ -513,12 +509,8 @@ register struct monst *grd;
grd_in_vault = *in_rooms(grd->mx, grd->my, VAULT)? grd_in_vault = *in_rooms(grd->mx, grd->my, VAULT)?
TRUE : FALSE; TRUE : FALSE;
boolean disappear_msg_seen = FALSE, semi_dead = (grd->mhp <= 0); 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); long umoney = money_cnt(invent);
register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L); register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L);
#endif
boolean see_guard, newspot = FALSE; boolean see_guard, newspot = FALSE;
if(!on_level(&(egrd->gdlevel), &u.uz)) return(-1); if(!on_level(&(egrd->gdlevel), &u.uz)) return(-1);
@@ -560,15 +552,9 @@ register struct monst *grd;
if(egrd->warncnt == 3 && !Deaf) if(egrd->warncnt == 3 && !Deaf)
verbalize("I repeat, %sfollow me!", verbalize("I repeat, %sfollow me!",
u_carry_gold ? ( u_carry_gold ? (
#ifndef GOLDOBJ
!u.ugold ?
"drop that hidden gold and " :
"drop that gold and ") : "");
#else
!umoney ? !umoney ?
"drop that hidden money and " : "drop that hidden money and " :
"drop that money and ") : ""); "drop that money and ") : "");
#endif
if(egrd->warncnt == 7) { if(egrd->warncnt == 7) {
m = grd->mx; m = grd->mx;
n = grd->my; n = grd->my;
@@ -654,13 +640,8 @@ letknow:
if (m == u.ux && n == u.uy) { if (m == u.ux && n == u.uy) {
struct obj *gold = g_at(m,n); struct obj *gold = g_at(m,n);
/* Grab the gold from between the hero's feet. */ /* Grab the gold from between the hero's feet. */
#ifndef GOLDOBJ
grd->mgold += gold->quan;
delobj(gold);
#else
obj_extract_self(gold); obj_extract_self(gold);
add_to_minv(grd, gold); add_to_minv(grd, gold);
#endif
newsym(m,n); newsym(m,n);
} else if (m == x && n == y) { } else if (m == x && n == y) {
mpickgold(grd); /* does a newsym */ mpickgold(grd); /* does a newsym */
@@ -828,30 +809,17 @@ void
paygd() paygd()
{ {
register struct monst *grd = findgd(); register struct monst *grd = findgd();
#ifndef GOLDOBJ
struct obj *gold;
#else
long umoney = money_cnt(invent); long umoney = money_cnt(invent);
struct obj *coins, *nextcoins; struct obj *coins, *nextcoins;
#endif
int gx,gy; int gx,gy;
char buf[BUFSZ]; char buf[BUFSZ];
#ifndef GOLDOBJ
if (!u.ugold || !grd) return;
#else
if (!umoney || !grd) return; if (!umoney || !grd) return;
#endif
if (u.uinvault) { if (u.uinvault) {
Your("%ld %s goes into the Magic Memory Vault.", Your("%ld %s goes into the Magic Memory Vault.",
#ifndef GOLDOBJ
u.ugold,
currency(u.ugold));
#else
umoney, umoney,
currency(umoney)); currency(umoney));
#endif
gx = u.ux; gx = u.ux;
gy = u.uy; gy = u.uy;
} else { } else {
@@ -868,10 +836,6 @@ paygd()
plname, mons[u.umonster].mname); plname, mons[u.umonster].mname);
make_grave(gx, gy, buf); make_grave(gx, gy, buf);
} }
#ifndef GOLDOBJ
place_object(gold = mkgoldobj(u.ugold), gx, gy);
stackobj(gold);
#else
for (coins = invent; coins; coins = nextcoins) { for (coins = invent; coins; coins = nextcoins) {
nextcoins = coins->nobj; nextcoins = coins->nobj;
if (objects[coins->otyp].oc_class == COIN_CLASS) { if (objects[coins->otyp].oc_class == COIN_CLASS) {
@@ -880,7 +844,6 @@ paygd()
stackobj(coins); stackobj(coins);
} }
} }
#endif
mongone(grd); mongone(grd);
} }
-7
View File
@@ -238,17 +238,10 @@ register struct obj *obj;
static NEARDATA const char wield_objs[] = static NEARDATA const char wield_objs[] =
{ ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, TOOL_CLASS, 0 }; { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, TOOL_CLASS, 0 };
#ifdef GOLDOBJ
static NEARDATA const char ready_objs[] = static NEARDATA const char ready_objs[] =
{ COIN_CLASS, ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 }; { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 };
static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */ static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */
{ COIN_CLASS, ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 }; { 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 int
dowield() dowield()
-7
View File
@@ -436,11 +436,7 @@ struct monst *mtmp;
mstatusline(mtmp); mstatusline(mtmp);
if (notonhead) return; /* don't show minvent for long worm tail */ if (notonhead) return; /* don't show minvent for long worm tail */
#ifndef GOLDOBJ
if (mtmp->minvent || mtmp->mgold) {
#else
if (mtmp->minvent) { if (mtmp->minvent) {
#endif
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) { for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) {
otmp->dknown = 1; /* treat as "seen" */ otmp->dknown = 1; /* treat as "seen" */
if (Is_container(otmp) || otmp->otyp == STATUE) { if (Is_container(otmp) || otmp->otyp == STATUE) {
@@ -3661,9 +3657,6 @@ const char *fltxt;
obfree(otmp, (struct obj *)0); obfree(otmp, (struct obj *)0);
} }
} }
#ifndef GOLDOBJ
mon->mgold = 0L;
#endif
#undef oresist_disintegration #undef oresist_disintegration
+1 -6
View File
@@ -183,12 +183,7 @@ time_t when;
tomb_text(buf); tomb_text(buf);
/* Put $ on stone */ /* Put $ on stone */
Sprintf(buf, "%ld Au", Sprintf(buf, "%ld Au", done_money);
#ifndef GOLDOBJ
u.ugold);
#else
done_money);
#endif
buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
tomb_text(buf); tomb_text(buf);
-4
View File
@@ -233,11 +233,7 @@ void FormatStatusString(char* text, int format)
(void) describe_level(nb=eos(nb)); (void) describe_level(nb=eos(nb));
Sprintf(nb = eos(nb), Sprintf(nb = eos(nb),
"%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", showsyms[COIN_CLASS + SYM_OFF_O], "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", showsyms[COIN_CLASS + SYM_OFF_O],
#ifndef GOLDOBJ
u.ugold,
#else
money_cnt(invent), money_cnt(invent),
#endif
hp, hpmax, u.uen, u.uenmax, u.uac); hp, hpmax, u.uen, u.uenmax, u.uac);
if (Upolyd) if (Upolyd)
-7
View File
@@ -960,7 +960,6 @@ do_rumors()
* *
*/ */
#define IGNORED_FEATURES ( 0L \ #define IGNORED_FEATURES ( 0L \
| (1L << 12) /* GOLDOBJ */ \
| (1L << 19) /* EXP_ON_BOTL */ \ | (1L << 19) /* EXP_ON_BOTL */ \
| (1L << 20) /* SCORE_ON_BOTL */ \ | (1L << 20) /* SCORE_ON_BOTL */ \
| (1L << 27) /* ZEROCOMP */ \ | (1L << 27) /* ZEROCOMP */ \
@@ -993,9 +992,6 @@ make_version()
| (1L << 6) | (1L << 6)
#endif #endif
/* objects (10..14) */ /* objects (10..14) */
#ifdef GOLDOBJ
| (1L << 10)
#endif
/* flag bits and/or other global variables (15..26) */ /* flag bits and/or other global variables (15..26) */
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
| (1L << 17) | (1L << 17)
@@ -1239,9 +1235,6 @@ static const char *build_opts[] = {
#ifdef MFLOPPY #ifdef MFLOPPY
"floppy drive support", "floppy drive support",
#endif #endif
#ifdef GOLDOBJ
"gold object in inventories",
#endif
#ifdef INSURANCE #ifdef INSURANCE
"insurance files for recovering from crashes", "insurance files for recovering from crashes",
#endif #endif
-8
View File
@@ -2550,11 +2550,7 @@ void NetHackQtStatusWindow::updateStats()
dlevel.setLabel(buf,(long)depth(&u.uz)); dlevel.setLabel(buf,(long)depth(&u.uz));
} }
#ifndef GOLDOBJ
gold.setLabel("Au:", u.ugold);
#else
gold.setLabel("Au:", money_cnt(invent)); gold.setLabel("Au:", money_cnt(invent));
#endif
if (u.mtimedone) { if (u.mtimedone) {
// You're a monster! // You're a monster!
@@ -3296,11 +3292,7 @@ static char** rip_line=0;
Sprintf(rip_line[NAME_LINE], "%s", plname); Sprintf(rip_line[NAME_LINE], "%s", plname);
/* Put $ on stone */ /* Put $ on stone */
#ifndef GOLDOBJ
Sprintf(rip_line[GOLD_LINE], "%ld Au", u.ugold);
#else
Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money); Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money);
#endif
/* Put together death description */ /* Put together death description */
formatkiller(buf, sizeof buf, how); formatkiller(buf, sizeof buf, how);
-4
View File
@@ -600,11 +600,7 @@ update_fancy_status(wp)
case F_NAME: val = (long) 0L; break; /* special */ case F_NAME: val = (long) 0L; break; /* special */
case F_DLEVEL: 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; case F_GOLD: val = money_cnt(invent); break;
#endif
case F_HP: val = (long) (u.mtimedone ? case F_HP: val = (long) (u.mtimedone ?
(u.mh > 0 ? u.mh : 0): (u.mh > 0 ? u.mh : 0):
(u.uhp > 0 ? u.uhp : 0)); break; (u.uhp > 0 ? u.uhp : 0)); break;
-4
View File
@@ -469,11 +469,7 @@ calculate_rip_text(int how, time_t when)
/* Put $ on stone */ /* Put $ on stone */
Sprintf(rip_line[GOLD_LINE], "%ld Au", Sprintf(rip_line[GOLD_LINE], "%ld Au",
#ifndef GOLDOBJ
u.ugold);
#else
done_money); done_money);
#endif
/* Put together death description */ /* Put together death description */
formatkiller(buf, sizeof buf, how); formatkiller(buf, sizeof buf, how);
-4
View File
@@ -1088,11 +1088,7 @@ time_t when;
Sprintf(rip_line[NAME_LINE], "%s", plname); Sprintf(rip_line[NAME_LINE], "%s", plname);
/* Put $ on stone */ /* Put $ on stone */
Sprintf(rip_line[GOLD_LINE], "%ld Au", Sprintf(rip_line[GOLD_LINE], "%ld Au",
#ifndef GOLDOBJ
u.ugold);
#else
done_money); done_money);
#endif
/* Put together death description */ /* Put together death description */
formatkiller(buf, sizeof buf, how); formatkiller(buf, sizeof buf, how);
+1 -6
View File
@@ -1183,12 +1183,7 @@ void gnome_outrip(winid wid, int how, time_t when)
Strcat(ripString, buf); Strcat(ripString, buf);
/* Put $ on stone */ /* Put $ on stone */
Sprintf(buf, "%ld Au\n", Sprintf(buf, "%ld Au\n", done_money);
#ifndef GOLDOBJ
u.ugold);
#else
done_money);
#endif
Strcat(ripString, buf); Strcat(ripString, buf);
/* Put together death description */ /* Put together death description */
-15
View File
@@ -434,9 +434,7 @@ void ghack_status_window_update_stats()
const char* hung; const char* hung;
const char* enc; const char* enc;
static int firstTime=TRUE; static int firstTime=TRUE;
#ifdef GOLDOBJ
long umoney; long umoney;
#endif
/* First, fill in the player name and the dungeon level */ /* First, fill in the player name and the dungeon level */
strcpy(buf, plname); strcpy(buf, plname);
@@ -565,30 +563,17 @@ void ghack_status_window_update_stats()
gtk_label_set( GTK_LABEL( chaLabel), buf); gtk_label_set( GTK_LABEL( chaLabel), buf);
/* Now do the non-pixmaped stats (gold and such) */ /* 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); umoney = money_cnt(invent);
sprintf(buf,"Au:%ld", umoney); sprintf(buf,"Au:%ld", umoney);
if (lastAu < umoney && firstTime==FALSE) { if (lastAu < umoney && firstTime==FALSE) {
#endif
/* Ok, this changed so add it to the highlighing list */ /* Ok, this changed so add it to the highlighing list */
ghack_highlight_widget( goldLabel, normalStyle, greenStyle); ghack_highlight_widget( goldLabel, normalStyle, greenStyle);
} }
#ifndef GOLDOBJ
else if (lastAu > u.ugold && firstTime==FALSE) {
#else
else if (lastAu > umoney && firstTime==FALSE) { else if (lastAu > umoney && firstTime==FALSE) {
#endif
/* Ok, this changed so add it to the highlighing list */ /* Ok, this changed so add it to the highlighing list */
ghack_highlight_widget( goldLabel, normalStyle, redStyle); ghack_highlight_widget( goldLabel, normalStyle, redStyle);
} }
#ifndef GOLDOBJ
lastAu = u.ugold;
#else
lastAu = umoney; lastAu = umoney;
#endif
gtk_label_set( GTK_LABEL( goldLabel), buf); gtk_label_set( GTK_LABEL( goldLabel), buf);
if (u.mtimedone) { if (u.mtimedone) {
-4
View File
@@ -1796,11 +1796,7 @@ void mswin_outrip(winid wid, int how, time_t when)
putstr(wid, 0, buf); putstr(wid, 0, buf);
/* Put $ on stone */ /* Put $ on stone */
#ifndef GOLDOBJ
Sprintf(buf, "%ld Au", u.ugold);
#else
Sprintf(buf, "%ld Au", done_money); Sprintf(buf, "%ld Au", done_money);
#endif
buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
putstr(wid, 0, buf); putstr(wid, 0, buf);