🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Don Kneller%Langridge Fri, 13 Dec 1985 03:39
Uninterested shopkeeper fix
#10
Author: Don Kneller%Langridge
Date: Fri, 13 Dec 1985 03:39
100 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads