kneller@ucsfcgl.UUCP (Don Kneller%Langridge) (12/13/85)
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