Newsgroups: rec.arts.int-fiction
Path: gmd.de!nntp.gmd.de!xlink.net!sol.ctr.columbia.edu!usenet.ucs.indiana.edu!xyplex4-1-9.ucs.indiana.edu!zbir
From: Zachery Bir <zbir@copper.ucs.indiana.edu>
Subject: TADS: Need help with the following code... 
Message-ID: <CrMtDE.393@usenet.ucs.indiana.edu>
X-Xxmessage-Id: <AA29538CD0011209@xyplex4-1-9.ucs.indiana.edu>
X-Xxdate: Sun, 19 Jun 94 07:44:44 GMT
Sender: news@usenet.ucs.indiana.edu (USENET News System)
Nntp-Posting-Host: xyplex4-1-9.ucs.indiana.edu
Organization: Holy Pope of X-Philes
X-Useragent: Version 1.1.3
Date: Sun, 19 Jun 1994 06:44:01 GMT
Lines: 117

Hello, all you programmers. I'm programming this in TADS 2.0 (I think),
and I need a little help implementing the following code. 

begin code:
------------------------------------------------------
/* I want this to eventually be opened 'with the letter opener'.
Currently, it works only if you _have_ the opener in your possession.
Basically, I want to change it from a simple openable to a keyedLockable
(of sorts) - I though of designating the opener as mykey, and modifying
the verbs to be 'open', but how exactly would I do this? Of course, it
would be neither closable nor lockable after it was opened, so I only
need the "You can close (lock) a slit envelope!" or some such. 
*/

envelope: openable
/* make this a keyedLockable eventually */
	isopen = nil
	sdesc = "moldy envelope"
	isopenable = nil
	ldesc =
	{	"This is a standard envelope that your employer
(Target) uses to hold your measly paychecks. You've lost it for
sometime, and the check inside may have expired. ";
	if ( self.isopen ) "It is open.";
	else "It is closed.";
	}
	verDoOpen( actor ) =
	{
		if ( self.isopen )
		{
		  	 caps(); self.thedesc; " is already open! ";
		}
	}
	doOpen( actor ) =
	{
		if (Me.isCarrying (letterOpener))
		{
			"The razor-sharp letter opener slices easily through the airplane glue
and three-week-old mold, allowing you access to an old paycheck.";
			self.isopen := true;
		}
		else "It seems as if Target is using airplane glue to keep their
employees' paychecks \"secure\". On top of that is a three-week growth of
a super-strain of mold. As a result, no human hand alone can open the
envelope.";
	}
	verDoClose( actor ) =
	{
		"Closing the envelope makes no sense!";
	}
	ioPutIn( actor, dobj ) = 
	{
		if ( dobj <> paycheck )
		{
			"Sorry. The envelope is perfectly (and solely) paycheck-sized, and
paychecks, as you well know are a completely different size than anything
else known to man. As "; dobj.thedesc; " is definitely not
paycheck-sized, it won't fit.";
		}
		else pass ioPutIn;
	}
	noun = 'envelope'
	adjective = 'moldy'
	location = startroom
;

paycheck: readable
	sdesc = "paycheck"
	ldesc = "It's a pretty pathetic check. What do you expect? You
call in sick all the time. Also, it expires today."
	readdesc = "Pay to the order of (They misspelled your name
again)... $25.12... Pathetic."
	noun = 'check' 'paycheck' 'money'
	location = envelope
;

letterOpener: item
	sdesc = "letter opener"
	noun = 'opener'
	adjective = 'letter'
	location = livingRoom
;

/* This also needs some help. Basically, I need to use the towel to wrap
it around my head specifically (ala Hitchhiker's Guide...) to get past a
particularly nasty smelling porch - like this: if you're not wearing it
(that's the easiest way I could get it to work for now), you can't get
off the porch (there's too much un-taken-care-of trash and the smell
creates a barrier). So I tried to come up with the verb Wrap, but I don't
know exactly what all I need to get the verb up and running.
*/

towel: clothingItem
	sdesc = "dirty, green towel"
	noun = 'towel'
	adjective = 'dirty' 'green'
	location = startroom
;

/* this needs work
wrapVerb: deepverb
	verb = 'wrap'
	sdec = "wrap"
	prepDefault = 	aroundPrep
	ioAction (aroundPrep) = 'WrapAround'
; */


----------------------------------------------------
end code

So, can anyone help me? Feel free to give me blatant help. E-mail or post
here, as I check both frequently.

Thanks,

Zac
