Make GOLDOBJ unconditional.
This commit is contained in:
91
src/shk.c
91
src/shk.c
@@ -78,7 +78,6 @@ STATIC_DCL const char *FDECL(cad, (BOOLEAN_P));
|
||||
*/
|
||||
|
||||
|
||||
#ifdef GOLDOBJ
|
||||
/*
|
||||
Transfer money from inventory to monster when paying
|
||||
shopkeepers, priests, oracle, succubus, & other demons.
|
||||
@@ -153,8 +152,6 @@ long amount;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* GOLDOBJ */
|
||||
|
||||
STATIC_OVL struct monst *
|
||||
next_shkp(shkp, withbill)
|
||||
register struct monst *shkp;
|
||||
@@ -903,13 +900,8 @@ register struct monst *shkp;
|
||||
long robbed = ESHK(shkp)->robbed;
|
||||
long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp));
|
||||
|
||||
#ifndef GOLDOBJ
|
||||
u.ugold -= balance;
|
||||
shkp->mgold += balance;
|
||||
#else
|
||||
if (balance > 0) money2mon(shkp, balance);
|
||||
else if (balance < 0) money2u(shkp, -balance);
|
||||
#endif
|
||||
context.botl = 1;
|
||||
if(robbed) {
|
||||
robbed -= tmp;
|
||||
@@ -1235,11 +1227,7 @@ proceed:
|
||||
}
|
||||
|
||||
if(shkp != resident && NOTANGRY(shkp)) {
|
||||
#ifdef GOLDOBJ
|
||||
umoney = money_cnt(invent);
|
||||
#else
|
||||
umoney = u.ugold;
|
||||
#endif
|
||||
if(!ltmp)
|
||||
You("do not owe %s anything.", mon_nam(shkp));
|
||||
else if(!umoney) {
|
||||
@@ -1268,11 +1256,7 @@ proceed:
|
||||
|
||||
/* ltmp is still eshkp->robbed here */
|
||||
if (!eshkp->billct && !eshkp->debit) {
|
||||
#ifdef GOLDOBJ
|
||||
umoney = money_cnt(invent);
|
||||
#else
|
||||
umoney = u.ugold;
|
||||
#endif
|
||||
if(!ltmp && NOTANGRY(shkp)) {
|
||||
You("do not owe %s anything.", shkname(shkp));
|
||||
if (!umoney)
|
||||
@@ -1325,9 +1309,7 @@ proceed:
|
||||
long dtmp = eshkp->debit;
|
||||
long loan = eshkp->loan;
|
||||
char sbuf[BUFSZ];
|
||||
#ifdef GOLDOBJ
|
||||
umoney = money_cnt(invent);
|
||||
#endif
|
||||
Sprintf(sbuf, "You owe %s %ld %s ",
|
||||
shkname(shkp), dtmp, currency(dtmp));
|
||||
if(loan) {
|
||||
@@ -1337,11 +1319,7 @@ proceed:
|
||||
"for gold picked up and the use of merchandise.");
|
||||
} else Strcat(sbuf, "for the use of merchandise.");
|
||||
pline1(sbuf);
|
||||
#ifndef GOLDOBJ
|
||||
if (u.ugold + eshkp->credit < dtmp) {
|
||||
#else
|
||||
if (umoney + eshkp->credit < dtmp) {
|
||||
#endif
|
||||
pline("But you don't%s have enough gold%s.",
|
||||
stashed_gold ? " seem to" : "",
|
||||
eshkp->credit ? " or credit" : "");
|
||||
@@ -1353,12 +1331,7 @@ proceed:
|
||||
eshkp->loan = 0L;
|
||||
Your("debt is covered by your credit.");
|
||||
} else if (!eshkp->credit) {
|
||||
#ifndef GOLDOBJ
|
||||
u.ugold -= dtmp;
|
||||
shkp->mgold += dtmp;
|
||||
#else
|
||||
money2mon(shkp, dtmp);
|
||||
#endif
|
||||
eshkp->debit = 0L;
|
||||
eshkp->loan = 0L;
|
||||
You("pay that debt.");
|
||||
@@ -1366,12 +1339,7 @@ proceed:
|
||||
} else {
|
||||
dtmp -= eshkp->credit;
|
||||
eshkp->credit = 0L;
|
||||
#ifndef GOLDOBJ
|
||||
u.ugold -= dtmp;
|
||||
shkp->mgold += dtmp;
|
||||
#else
|
||||
money2mon(shkp, dtmp);
|
||||
#endif
|
||||
eshkp->debit = 0L;
|
||||
eshkp->loan = 0L;
|
||||
pline("That debt is partially offset by your credit.");
|
||||
@@ -1384,22 +1352,14 @@ proceed:
|
||||
/* now check items on bill */
|
||||
if (eshkp->billct) {
|
||||
register boolean itemize;
|
||||
#ifndef GOLDOBJ
|
||||
if (!u.ugold && !eshkp->credit) {
|
||||
#else
|
||||
umoney = money_cnt(invent);
|
||||
if (!umoney && !eshkp->credit) {
|
||||
#endif
|
||||
You("%shave no money or credit%s.",
|
||||
stashed_gold ? "seem to " : "",
|
||||
paid ? " left" : "");
|
||||
return(0);
|
||||
}
|
||||
#ifndef GOLDOBJ
|
||||
if ((u.ugold + eshkp->credit) < cheapest_item(shkp)) {
|
||||
#else
|
||||
if ((umoney + eshkp->credit) < cheapest_item(shkp)) {
|
||||
#endif
|
||||
You("don't have enough money to buy%s the item%s you picked.",
|
||||
eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct));
|
||||
if(stashed_gold)
|
||||
@@ -1483,11 +1443,7 @@ boolean itemize;
|
||||
{
|
||||
register struct obj *obj = *obj_p;
|
||||
long ltmp, quan, save_quan;
|
||||
#ifdef GOLDOBJ
|
||||
long umoney = money_cnt(invent);
|
||||
#else
|
||||
long umoney = u.ugold;
|
||||
#endif
|
||||
int buy;
|
||||
boolean stashed_gold = (hidden_gold() > 0L),
|
||||
consumed = (which == 0);
|
||||
@@ -1672,9 +1628,7 @@ int numsk;
|
||||
int croaked;
|
||||
{
|
||||
long loss = 0L;
|
||||
#ifdef GOLDOBJ
|
||||
long umoney;
|
||||
#endif
|
||||
struct eshk *eshkp = ESHK(shkp);
|
||||
boolean take = FALSE, taken = FALSE;
|
||||
unsigned save_minvis = shkp->minvis;
|
||||
@@ -1721,12 +1675,8 @@ int croaked;
|
||||
}
|
||||
|
||||
if (eshkp->following || ANGRY(shkp) || take) {
|
||||
#ifndef GOLDOBJ
|
||||
if (!invent && !u.ugold) goto skip;
|
||||
#else
|
||||
if (!invent) goto skip;
|
||||
umoney = money_cnt(invent);
|
||||
#endif
|
||||
takes[0] = '\0';
|
||||
if (!shkp->mcanmove || shkp->msleeping)
|
||||
Strcat(takes, "wakes up and ");
|
||||
@@ -1734,18 +1684,10 @@ int croaked;
|
||||
Strcat(takes, "comes and ");
|
||||
Strcat(takes, "takes");
|
||||
|
||||
#ifndef GOLDOBJ
|
||||
if (loss > u.ugold || !loss || roomno == eshkp->shoproom) {
|
||||
eshkp->robbed -= u.ugold;
|
||||
if (eshkp->robbed < 0L) eshkp->robbed = 0L;
|
||||
shkp->mgold += u.ugold;
|
||||
u.ugold = 0L;
|
||||
#else
|
||||
if (loss > umoney || !loss || roomno == eshkp->shoproom) {
|
||||
eshkp->robbed -= umoney;
|
||||
if (eshkp->robbed < 0L) eshkp->robbed = 0L;
|
||||
if (umoney > 0) money2mon(shkp, umoney);
|
||||
#endif
|
||||
context.botl = 1;
|
||||
pline("%s %s all your possessions.",
|
||||
shkname(shkp), takes);
|
||||
@@ -1753,12 +1695,7 @@ int croaked;
|
||||
/* where to put player's invent (after disclosure) */
|
||||
set_repo_loc(shkp);
|
||||
} else {
|
||||
#ifndef GOLDOBJ
|
||||
shkp->mgold += loss;
|
||||
u.ugold -= loss;
|
||||
#else
|
||||
money2mon(shkp, loss);
|
||||
#endif
|
||||
context.botl = 1;
|
||||
pline("%s %s the %ld %s %sowed %s.",
|
||||
Monnam(shkp), takes,
|
||||
@@ -1827,14 +1764,9 @@ finish_paybill()
|
||||
unleash_all();
|
||||
/* if hero has any gold left, take it into shopkeeper's possession */
|
||||
if (shkp) {
|
||||
#ifdef GOLDOBJ
|
||||
long umoney = money_cnt(invent);
|
||||
|
||||
if (umoney) money2mon(shkp, umoney);
|
||||
#else
|
||||
shkp->mgold += u.ugold;
|
||||
u.ugold = 0L;
|
||||
#endif
|
||||
}
|
||||
/* transfer rest of the character's inventory to the shop floor */
|
||||
drop_upon_death((struct monst *)0, (struct obj *)0, ox, oy);
|
||||
@@ -2837,11 +2769,7 @@ xchar x, y;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef GOLDOBJ
|
||||
shkmoney = shkp->mgold;
|
||||
#else
|
||||
shkmoney = money_cnt(shkp->minvent);
|
||||
#endif
|
||||
if (!shkmoney) {
|
||||
char c, qbuf[BUFSZ];
|
||||
long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L);
|
||||
@@ -3779,11 +3707,7 @@ boolean 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
|
||||
#endif
|
||||
|| !rn2(50)) {
|
||||
getcad:
|
||||
if (muteshk(shkp)) {
|
||||
@@ -3807,12 +3731,7 @@ boolean cant_mollify;
|
||||
currency(cost_of_damage), !animal ? "\"" : "");
|
||||
if(yn(qbuf) != 'n') {
|
||||
cost_of_damage = check_credit(cost_of_damage, shkp);
|
||||
#ifndef GOLDOBJ
|
||||
u.ugold -= cost_of_damage;
|
||||
shkp->mgold += cost_of_damage;
|
||||
#else
|
||||
money2mon(shkp, cost_of_damage);
|
||||
#endif
|
||||
context.botl = 1;
|
||||
pline("Mollified, %s accepts your restitution.",
|
||||
shkname(shkp));
|
||||
@@ -3967,9 +3886,7 @@ shk_chat(shkp)
|
||||
struct monst *shkp;
|
||||
{
|
||||
struct eshk *eshk;
|
||||
#ifdef GOLDOBJ
|
||||
long shkmoney;
|
||||
#endif
|
||||
if (!shkp->isshk) {
|
||||
/* The monster type is shopkeeper, but this monster is
|
||||
not actually a shk, which could happen if someone
|
||||
@@ -4010,17 +3927,9 @@ struct monst *shkp;
|
||||
shkname(shkp), eshk->credit, currency(eshk->credit));
|
||||
else if (eshk->robbed)
|
||||
pline("%s complains about a recent robbery.", shkname(shkp));
|
||||
#ifndef GOLDOBJ
|
||||
else if (shkp->mgold < 50)
|
||||
#else
|
||||
else if ((shkmoney = money_cnt(shkp->minvent)) < 50)
|
||||
#endif
|
||||
pline("%s complains that business is bad.", shkname(shkp));
|
||||
#ifndef GOLDOBJ
|
||||
else if (shkp->mgold > 4000)
|
||||
#else
|
||||
else if (shkmoney > 4000)
|
||||
#endif
|
||||
pline("%s says that business is good.", shkname(shkp));
|
||||
else if (is_izchak(shkp, FALSE))
|
||||
pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))],shkname(shkp));
|
||||
|
||||
Reference in New Issue
Block a user