Article View: net.games.hack
Article #10Uninterested shopkeeper fix
From: Don Kneller%Langridge
Date: Fri, 13 Dec 1985 03:39
Date: Fri, 13 Dec 1985 03:39
100 lines
3469 bytes
3469 bytes
Someone asked for changes so that when you drop an object in
a shop, and the shopkeeper seems uninterested, you won't be
charged for that object when you pick it up again. The
following context diffs make these changes. As well, with
these changes, when a shopkeeper does not have enough money
to pay you for an object, you won't be charged when you pick
it up again.
*** def.obj.old Thu Dec 12 19:25:31 1985
--- def.obj.h Wed Dec 11 17:18:13 1985
***************
*** 22,27
Bitfield(cursed,1);
Bitfield(unpaid,1); /* on some bill */
Bitfield(rustfree,1);
Bitfield(onamelth,6);
long age; /* creation date */
long owornmask;
--- 22,28 -----
Bitfield(cursed,1);
Bitfield(unpaid,1); /* on some bill */
Bitfield(rustfree,1);
+ Bitfield(no_charge, 1); /* if shk shouldn't charge for this */
Bitfield(onamelth,6);
long age; /* creation date */
long owornmask;
*** hack.shk.old Thu Dec 12 19:25:03 1985
--- hack.shk.c Wed Dec 11 17:17:18 1985
***************
*** 517,522
pline("You got that for free!");
return;
}
bp = &bill[ESHK(shopkeeper)->billct];
bp->bo_id = obj->o_id;
bp->bquan = obj->quan;
--- 517,528 -----
pline("You got that for free!");
return;
}
+ /* To recognize objects the showkeeper is not interested in. -dgk
+ */
+ if (obj->no_charge) {
+ obj->no_charge = 0;
+ return;
+ }
bp = &bill[ESHK(shopkeeper)->billct];
bp->bo_id = obj->o_id;
bp->bquan = obj->quan;
***************
*** 595,600
((tmp = shtypes[rooms[ESHK(shopkeeper)->shoproom].rtype-8]) && tmp != obj->olet)
|| index("_0", obj->olet)) {
pline("%s seems not interested.", Monnam(shopkeeper));
return;
}
ltmp = getprice(obj) * obj->quan;
--- 602,608 -----
((tmp = shtypes[rooms[ESHK(shopkeeper)->shoproom].rtype-8]) && tmp != obj->olet)
|| index("_0", obj->olet)) {
pline("%s seems not interested.", Monnam(shopkeeper));
+ obj->no_charge = 1;
return;
}
ltmp = getprice(obj) * obj->quan;
***************
*** 611,620
if(ltmp > shopkeeper->mgold)
ltmp = shopkeeper->mgold;
pay(-ltmp, shopkeeper);
! if(!ltmp)
! pline("%s gladly accepts %s but cannot pay you at present.",
! Monnam(shopkeeper), doname(obj));
! else
pline("You sold %s and got %ld gold piece%s.", doname(obj), ltmp,
plur(ltmp));
}
--- 619,629 -----
if(ltmp > shopkeeper->mgold)
ltmp = shopkeeper->mgold;
pay(-ltmp, shopkeeper);
! if(!ltmp) {
! pline("%s gladly accepts %s but cannot pay you at present.",
! Monnam(shopkeeper), doname(obj));
! obj->no_charge = 1;
! } else
pline("You sold %s and got %ld gold piece%s.", doname(obj), ltmp,
plur(ltmp));
}
------
--
Don Kneller
UUCP: ...ucbvax!ucsfcgl!kneller
ARPA: kneller@ucsf-cgl.ARPA
BITNET: kneller@ucsfcgl.BITNET
Technical Details
Message-ID:
<725@ucsfcgl.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!ucsfcgl!knellerShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucsfcgl.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!ucsfcgl!kneller From: kneller@ucsfcgl.UUCP (Don Kneller%Langridge) Newsgroups: net.games.hack Subject: Uninterested shopkeeper fix Message-ID: <725@ucsfcgl.UUCP> Date: Thu, 12-Dec-85 22:39:58 EST Article-I.D.: ucsfcgl.725 Posted: Thu Dec 12 22:39:58 1985 Date-Received: Sat, 14-Dec-85 00:32:58 EST Reply-To: kneller@ucsfcgl.UUCP (Don Kneller) Organization: UCSF Computer Graphics Lab Lines: 100