"Generic VERBS file for
The ZORK Trilogy
started on 7/25/83 by SEM"
^L
"Verb Functions for Game Commands"
<GLOBAL VERBOSE <>>
<GLOBAL SUPER-BRIEF <>>
<ROUTINE V-VERBOSE ()
<TELL "Maximum verbosity." CR>>
<ROUTINE V-BRIEF ()
<TELL "Brief descriptions." CR>>
<ROUTINE V-SUPER-BRIEF ()
<TELL "Super-brief descriptions." CR>>
<ROUTINE V-INVENTORY ()
(T <TELL "You are empty-handed." CR>)>>
<ROUTINE V-QUIT ("OPTIONAL" (ASK? T) "AUX" SCOR)
<COND (<OR <AND .ASK?
<TELL
"Do you wish to leave the game? (Y is affirmative): ">
<NOT .ASK?>>
<QUIT>)
(ELSE <TELL "Ok." CR>)>>
<ROUTINE V-RESTART ()
<TELL "Do you wish to restart? (Y is affirmative): ">
<TELL "Restarting." CR>
<RESTART>
<TELL "Failed." CR>)>>
<ROUTINE V-RESTORE ()
<COND (<RESTORE>
<TELL "Ok." CR>
(T
<TELL "Failed." CR>)>>
<ROUTINE V-SAVE ()
<COND (<SAVE>
<TELL "Ok." CR>)
(T
<TELL "Failed." CR>)>>
<ROUTINE V-SCRIPT ()
<PUT 0 8 <BOR <GET 0 8> 1>>
<TELL "Here begins a transcript of interaction with" CR>
<RTRUE>>
<ROUTINE V-UNSCRIPT ()
<TELL "Here ends a transcript of interaction with" CR>
<PUT 0 8 <BAND <GET 0 8> -2>>
<RTRUE>>
Print the title, release, and serial number.
This function is shared between all three Zorks, which is why it has code to print all three titles. The passages meant for Zork 2 and 3 were ignored when compiling Zork 1. (Skipped code is shown in grey.)
<ROUTINE V-VERSION ("AUX" (CNT 17))
'<TELL "ZORK I: The Great Underground Empire|
Copyright (c) 1981, 1982, 1983 Infocom, Inc. ">)
(<==? ,ZORK-NUMBER 2>
'<TELL "ZORK II: The Wizard of Frobozz|
***RENOVATED VERSION***|
Copyright (c) 1981, 1982, 1983 Infocom, Inc. ">)
(T
'<TELL "ZORK III: The Dungeon Master|
Copyright (c) 1982, 1983 Infocom, Inc. ">)>
<TELL "All rights reserved." CR>
The TRS-80 interpreter set a special bit which told the game to change certain behavior for no-doubt-contractual reasons. For Zork 1, it adds the line “Licensed to Tandy Corporation”, and also skips mentioning Zork 2/3 at the end.
For a complete list of “Tandy bit” behavior changes in Infocom games, see this page.
<COND (<NOT <==? <BAND <GETB 0 1> 8> 0>>
<TELL "Licensed to Tandy Corporation." CR>)>
<TELL "ZORK is a registered trademark of Infocom, Inc.|
Revision ">
<PRINTN <BAND <GET 0 1> *3777*>>
<TELL " / Serial number ">
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> 23>
<RETURN>)
(T
<PRINTC <GETB 0 .CNT>>)>>
<CRLF>>
<ROUTINE V-VERIFY ()
<TELL "Verifying disk..." CR>
<COND (<VERIFY>
<TELL "The disk is correct." CR>)
(T
<TELL CR "** Disk Failure **" CR>)>>
^L
"Real Verb Functions"
<ROUTINE V-ADVENT ()
<TELL "A hollow voice says \"Fool.\"" CR>>
<ROUTINE V-AGAIN ("AUX" (OBJ <>))
<COND (<EQUAL? ,L-PRSA ,V?WALK>
(T
<COND (<OR <NOT <LOC ,L-PRSO>>
<COND (<OR <NOT <LOC ,L-PRSI>>
<COND (<AND .OBJ
<TELL "You can't see the " D .OBJ " anymore." CR>
<RFATAL>)
(T
<ROUTINE V-ALARM ()
<TELL "The " D ,PRSO " is rudely awakened." CR>
(T
'(<NULL-F> <RTRUE>))>
(T
<TELL
"He's wide awake, or haven't you noticed..." CR>)>)
(T
<TELL "The " D ,PRSO " isn't sleeping." CR>)>>
<ROUTINE V-ANSWER ()
<TELL "Nobody seems to be awaiting your answer." CR>
<RTRUE>>
<ROUTINE V-ATTACK ()
<TELL
"I've known strange people, but fighting a " D ,PRSO "?" CR>)
<TELL
"Trying to attack a " D ,PRSO " with your bare hands is suicidal." CR>)
<TELL "You aren't even holding the " D ,PRSI "." CR>)
<TELL
"Trying to attack the " D ,PRSO " with a " D ,PRSI " is suicidal." CR>)
(T
(T
'<TELL "You can't." CR>)>)>>
<ROUTINE V-BACK ()
<TELL "Sorry, my memory is poor. Please give a direction." CR>>
<ROUTINE V-BLAST ()
<TELL "You can't blast anything by using words." CR>>
<ROUTINE PRE-BOARD ("AUX" AV)
<COND %<COND (<==? ,ZORK-NUMBER 3>
'(<EQUAL? ,PRSO ,WATER-CHANNEL>
<RFALSE>))
(T
<TELL
"The " D ,PRSO " must be on the ground to be boarded." CR>)
<TELL "You are already in the " D .AV "!" CR>)
(T
<RFALSE>)>)
(T
<TELL
"You have a theory on how to board a " D ,PRSO ", perhaps?" CR>)>
<RFATAL>>
<ROUTINE V-BOARD ("AUX" AV)
<TELL "You are now in the " D ,PRSO "." CR>
<RTRUE>>
<ROUTINE V-BREATHE ()
<ROUTINE V-BRUSH ()
<TELL "If you wish, but heaven only knows why." CR>>
<ROUTINE V-BUG ()
<TELL
"Bug? Not in a flawless program like this! (Cough, cough)." CR>>
<ROUTINE PRE-BURN ()
<RFALSE>)
(T
<TELL "With a " D ,PRSI "??!?" CR>)>>
<ROUTINE V-BURN ()
<COND %<COND (<==? ,ZORK-NUMBER 2>
'(<EQUAL? <LOC ,PRSO> ,RECEPTACLE>
<BALLOON-BURN>
<RTRUE>))
(T
<TELL
" catches fire. Unfortunately, you were ">
<TELL "in">)
(T <TELL "holding">)>
(T
<TELL
"The " D ,PRSO " catches fire and is consumed." CR>)>)
(T
<TELL "You can't burn a " D ,PRSO "." CR>)>>
<ROUTINE V-CHOMP ()
<TELL "Preposterous!" CR>>
<ROUTINE V-CLIMB-FOO ()
<ROUTINE V-CLIMB-ON ()
<RTRUE>)
(T
<TELL "You can't climb onto the " D ,PRSO "." CR>)>>
<ROUTINE V-CLIMB-UP ("OPTIONAL" (DIR ,P?UP) (OBJ <>) "AUX" X TX)
<COND (<AND <NOT .OBJ> ,PRSO>
<COND (<SET TX <GETPT ,HERE .DIR>>
<COND (.OBJ
<SET X <PTSIZE .TX>>
<COND (<OR <EQUAL? .X ,NEXIT>
<TELL "The " D .OBJ " do">
<COND (<NOT <EQUAL? .OBJ ,STAIRS>>
<TELL "es">)>
<TELL "n't lead ">
<TELL "up">)
(T <TELL "down">)>
<TELL "ward." CR>
<RTRUE>)>)>
<RTRUE>)
(<NOT .OBJ>
<TELL "You can't go that way." CR>)
(<AND .OBJ
<TELL "Climbing the walls is to no avail." CR>)
(T
<TELL "You can't do that!" CR>)>>
<ROUTINE V-CLOSE ()
<TELL "You must tell me how to do that to a " D ,PRSO "." CR>)
<TELL "Closed." CR>
<TELL "It is now pitch black." CR>)>
<RTRUE>)
(T
<TELL "It is already closed." CR>)>)
<TELL "The " D ,PRSO " is now closed." CR>)
(T
<TELL "It is already closed." CR>)>)
(T
<TELL "You cannot close that." CR>)>>
<ROUTINE V-COMMAND ()
<TELL "The " D ,PRSO " pays no attention." CR>)
(T
<TELL "You cannot talk to that!" CR>)>>
<ROUTINE V-COUNT ()
<TELL "Well, for one, you are playing Zork..." CR>)
(T
<TELL "You have lost your mind." CR>)>>
<ROUTINE V-CROSS ()
<TELL "You can't cross that!" CR>>
<ROUTINE V-CURSES ()
<TELL "Insults of this nature won't help you." CR>)
(T
<TELL "What a loony!" CR>)>)
(T
<TELL
"Such language in a high-class establishment like this!" CR>)>>
<ROUTINE V-CUT ()
<TELL
"Not a bright idea, especially since you're in it." CR>
<RTRUE>)>
<TELL "Your skillful " D ,PRSI "smanship slices the " D ,PRSO
" into innumerable slivers which blow away." CR>)
<TELL
"The \"cutting edge\" of a " D ,PRSI " is hardly adequate." CR>)
(T
<TELL "Strange concept, cutting the " D ,PRSO "...." CR>)>>
<ROUTINE V-DEFLATE ()
<TELL "Come on, now!" CR>>
<ROUTINE V-DIG ()
<TELL "There's no reason to be digging here." CR>)
<TELL "Digging with the " D ,PRSI " is slow and tedious." CR>)
(T
<TELL "Digging with a " D ,PRSI " is silly." CR>)>>
<ROUTINE V-DISEMBARK ()
<TELL "You're not in that!" CR>
<RFATAL>)
<TELL "You are on your own feet again." CR>
(T
<TELL
"You realize that getting out here would be fatal." CR>
<RFATAL>)>>
<ROUTINE V-DISENCHANT ()
%<COND (<==? ,ZORK-NUMBER 2>
'<COND (<NOT <IN? ,PRSO ,HERE>>
<RTRUE>)
(<OR <EQUAL? ,SPELL-USED ,W?FEEBLE ,W?FUMBLE ,W?FEAR>
<EQUAL? ,SPELL-USED ,W?FREEZE ,W?FALL ,W?FERMENT>
<EQUAL? ,SPELL-USED ,W?FIERCE ,W?FENCE ,W?FANTASIZE>>
<COND (<FSET? ,PRSO ,ACTORBIT>
<COND (<EQUAL? ,SPELL-USED ,W?FEEBLE>
<TELL
"The " D ,PRSO " seems stronger now." CR>)
(<EQUAL? ,SPELL-USED ,W?FUMBLE>
<TELL
"The " D ,PRSO " no longer appears clumsy." CR>)
(<EQUAL? ,SPELL-USED ,W?FEAR>
<TELL
"The " D ,PRSO " no longer appears afraid." CR>)
(<EQUAL? ,SPELL-USED ,W?FREEZE>
<TELL
"The " D ,PRSO " moves again." CR>)
(<EQUAL? ,SPELL-USED ,W?FERMENT>
<TELL
"The " D ,PRSO " stops swaying." CR>)
(<EQUAL? ,SPELL-USED ,W?FIERCE>
<TELL
"The " D ,PRSO " appears more peaceful." CR>)>)>)
(<EQUAL? ,SPELL-USED ,W?FLOAT>
<TELL
"The " D ,PRSO " sinks to the ground." CR>)
(<EQUAL? ,SPELL-USED ,W?FUDGE>
<TELL "The sweet smell has dispersed." CR>)>)
(T
'<TELL "Nothing happens." CR>)>>
<ROUTINE V-DRINK ()
<ROUTINE V-DRINK-FROM ()
<TELL "How peculiar!" CR>>
<ROUTINE PRE-DROP ()
<RTRUE>)>>
<ROUTINE V-DROP ()
<TELL "Dropped." CR>)>>
<ROUTINE V-EAT ("AUX" (EAT? <>) (DRINK? <>) (NOBJ <>))
<TELL "You're not holding that." CR>)
(<VERB? DRINK>
<TELL "How can you drink that?">)
(T
<TELL "Thank you very much. It really hit the spot.">
<CRLF>)
<SET DRINK? T>
(<NOT .NOBJ>
<TELL
"You don't have any to drink." CR>)
<TELL
"You have to be holding the " D .NOBJ " first." CR>)
<TELL
"You'll have to open the " D .NOBJ " first." CR>)
(T
(<NOT <OR .EAT? .DRINK?>>
<TELL
"I don't think that the " D ,PRSO " would agree with you." CR>)>>
<ROUTINE HIT-SPOT ()
<TELL
"Thank you very much. I was rather thirsty (from all this talking,
probably)." CR>
<ROUTINE V-ECHO ("AUX" LST MAX (ECH 0) CNT)
#DECL ((LST) <PRIMTYPE VECTOR> (MAX CNT ECH) FIX)
<SET LST <REST
<SET MAX <- <+ <GETB .LST 0> <GETB .LST 1>> 1>>
<REPEAT ()
<COND (<G? <SET ECH <+ .ECH 1>> 2>
<TELL "..." CR>
<RETURN>)
(T
<SET CNT <- <GETB .LST 1> 1>>
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> .MAX>
<RETURN>)
(T
<TELL " ">)>>)
(T <TELL "echo echo ..." CR>)>)
(T
'<TELL "echo echo ..." CR>)>>
<ROUTINE V-ENCHANT ()
%<COND (<==? ,ZORK-NUMBER 2>
'<COND (,WAND-ON <SETG SPELL-VICTIM ,WAND-ON>)>)
(T
%<COND (<==? ,ZORK-NUMBER 2>
'<COND (,SPELL-VICTIM
<COND (<NOT ,SPELL-USED>
<TELL "You must be more specific." CR>
<RTRUE>)>
<COND (<OR <EQUAL? ,SPELL-USED ,W?FEEBLE ,W?FUMBLE ,W?FEAR>
<EQUAL? ,SPELL-USED ,W?FREEZE ,W?FALL ,W?FERMENT>
<EQUAL? ,SPELL-USED ,W?FIERCE ,W?FENCE ,W?FANTASIZE>>
<COND (<FSET? ,PRSO ,ACTORBIT>
<TELL
"The wand stops glowing, but there is no other obvious effect." CR>)
(T
<TELL
"That might have done something, but it's hard to tell with a " D ,PRSO "." CR>)>)
;(<EQUAL? ,SPELL-USED ,W?FIREPROOF>
<RTRUE>)
(<EQUAL? ,SPELL-USED ,W?FUDGE>
<TELL
"A strong odor of chocolate permeates the room." CR>)
(<EQUAL? ,SPELL-USED ,W?FLUORESCE>
<FSET ,PRSO ,LIGHTBIT>
<FSET ,PRSO ,ONBIT>
<SETG LIT T>
<TELL
"The " D ,PRSO " begins to glow." CR>)
(<EQUAL? ,SPELL-USED ,W?FILCH>
<SETG SPELL-HANDLED? T>
<COND (<FSET? ,PRSO ,TAKEBIT>
<MOVE ,PRSO ,WINNER>
<SCORE-OBJ ,PRSO>
<TELL "Filched!" CR>)
(ELSE
<TELL "You can't filch the " D ,PRSO "!" CR>)>)
(<AND <EQUAL? ,SPELL-USED ,W?FLOAT>
<FSET? ,PRSO ,TAKEBIT>>
<COND (<AND <EQUAL? ,SPELL-VICTIM ,COLLAR>
<IN? ,COLLAR ,CERBERUS>>
<SETG SPELL-VICTIM ,CERBERUS>)>
<TELL
"The " D ,PRSO " floats serenely in mid-air." CR>)
(<AND <EQUAL? ,SPELL-USED ,W?FRY>
<FSET? ,PRSO ,TAKEBIT>>
<SETG SPELL-HANDLED? T>
<REMOVE-CAREFULLY ,PRSO>
<TELL "The " D ,PRSO " goes up in a puff of smoke." CR>)
(ELSE
<SETG SPELL-VICTIM <>>
<TELL
"The wand stops glowing, but there is no other apparent effect." CR>)>)
(ELSE
<SETG SPELL-VICTIM <>>
<TELL "Nothing happens." CR>)>)
(T
<ROUTINE REMOVE-CAREFULLY (OBJ "AUX" OLIT)
<REMOVE .OBJ>
<COND (<AND .OLIT <NOT <EQUAL? .OLIT ,LIT>>>
<TELL "You are left in the dark..." CR>)>
T>
<ROUTINE V-ENTER ()
<ROUTINE V-EXAMINE ()
(T
<TELL "There's nothing special about the " D ,PRSO "." CR>)>>
<ROUTINE V-EXIT ()
<ROUTINE V-EXORCISE ()
<TELL "What a bizarre concept!" CR>>
<ROUTINE PRE-FILL ("AUX" TX)
<RFALSE>)
(T
<TELL "There is nothing to fill it with." CR>
<RTRUE>)>)>
<RTRUE>)>>
<ROUTINE V-FILL ()
<RTRUE>)
<RTRUE>)
(T
<TELL "There's nothing to fill it with." CR>)>)
(T
<TELL "You may know how to do that, but I don't." CR>)>>
<ROUTINE V-FIND ("AUX" (L <LOC ,PRSO>))
<TELL
"Within six feet of your head, assuming you haven't left that
somewhere." CR>)
<TELL "You're around here somewhere..." CR>)
<TELL "You find it." CR>)
<TELL "You have it." CR>)
<TELL "It's right here." CR>)
<TELL "The " D .L " has it." CR>)
<TELL "It's on the " D .L "." CR>)
<TELL "It's in the " D .L "." CR>)
(T
<TELL "Beats me." CR>)>>
<ROUTINE V-FOLLOW ()
<TELL "You're nuts!" CR>>
<ROUTINE V-FROBOZZ ()
<TELL
"The FROBOZZ Corporation created, owns, and operates this dungeon." CR>>
<ROUTINE PRE-GIVE ()
<TELL
"That's easy for you to say since you don't even have the " D ,PRSO "." CR>)>>
<ROUTINE V-GIVE ()
<TELL "You can't give a " D ,PRSO " to a " D ,PRSI "!" CR>)
(T
<TELL "The " D ,PRSI " refuses it politely." CR>)>>
<ROUTINE V-HATCH ()
<TELL "Bizarre!" CR>>
<GLOBAL HS 0>
<ROUTINE V-HELLO ()
<TELL
"The " D ,PRSO " bows his head to you in greeting." CR>)
(T
<TELL
"It's a well known fact that only schizophrenics say \"Hello\" to a "
(T
<ROUTINE V-INCANT ()
%<COND (<==? ,ZORK-NUMBER 2>
'<COND (,SPELL-USED
<TELL "Nothing happens." CR>)
(,WAND-ON
<SETG SPELL-VICTIM ,WAND-ON>
<SETG SPELL-USED <GET ,P-LEXV ,P-CONT>>
<TELL "The wand glows very brightly for a moment." CR>
<ENABLE <QUEUE I-SPELL <+ 10 <RANDOM 10>>>>
<SETG WAND-ON <>>
<PERFORM ,V?ENCHANT ,SPELL-VICTIM>)
(T
<TELL
"The incantation echoes back faintly, but nothing else happens." CR>)>)
(T
'<TELL
"The incantation echoes back faintly, but nothing else happens." CR>)>
<RTRUE>>
<ROUTINE V-INFLATE ()
<TELL "How can you inflate that?" CR>>
<ROUTINE V-IS-IN ()
<TELL "Yes, it is ">
<TELL "on">)
(T
<TELL "in">)>
<TELL " the " D ,PRSI "." CR>)
(T
<TELL "No, it isn't." CR>)>>
<ROUTINE V-KICK () <HACK-HACK "Kicking the ">>
<ROUTINE V-KISS ()
<TELL "I'd sooner kiss a pig." CR>>
<ROUTINE V-KNOCK ()
<TELL "Nobody's home." CR>)
(T
<TELL "Why knock on a " D ,PRSO "?" CR>)>>
<ROUTINE V-LAMP-OFF ()
<TELL "It is already off." CR>)
(T
<TELL "The " D ,PRSO " is now off." CR>
<TELL "It is now pitch black." CR>)>)>)
(T
<TELL "You can't turn that off." CR>)>
<RTRUE>>
<ROUTINE V-LAMP-ON ()
<TELL "It is already on." CR>)
(T
<TELL "The " D ,PRSO " is now on." CR>
<CRLF>
(T
<TELL "You can't turn that on." CR>)>
<RTRUE>>
<ROUTINE V-LAUNCH ()
<TELL "You can't launch that by saying \"launch\"!" CR>)
(T
<TELL "That's pretty weird." CR>)>>
<ROUTINE V-LEAN-ON ()
<TELL "Getting tired?" CR>>
<ROUTINE V-LEAP ("AUX" TX S)
<TELL
"The " D ,PRSO " is too big to jump over." CR>)
(T
(T
<TELL "That would be a good trick." CR>)>)
<SET S <PTSIZE .TX>>
<COND (<OR <EQUAL? .S 2>
<AND <EQUAL? .S 4>
<NOT <VALUE <GETB .TX 1>>>>>
<TELL
Jumping is fatal if the room has a down exit which is impassable (with a failure message). This makes sense for, say, EAST-OF-CHASM. It’s a bit odd in the KITCHEN or RESERVOIR.
"This was not a very safe place to try jumping." CR>
<TELL
"In a feat of unaccustomed daring, you manage to land on your feet without
killing yourself." CR CR>
<RTRUE>))
(T '(<NULL-F> T))>
(T
(T
<GLOBAL JUMPLOSS
<LTABLE 0
"You should have looked before you leaped."
"In the movies, your life would be passing before your eyes."
"Geronimo...">>
<ROUTINE V-LISTEN ()
<TELL "The " D ,PRSO " makes no sound." CR>>
<ROUTINE V-LOCK ()
<TELL "It doesn't seem to work." CR>>
<ROUTINE V-LOOK ()
<ROUTINE V-LOOK-BEHIND ()
<TELL "There is nothing behind the " D ,PRSO "." CR>>
<ROUTINE V-LOOK-INSIDE ()
<TELL
"The " D ,PRSO " is open, but I can't tell what's beyond it.">)
(T
<TELL "The " D ,PRSO " is closed.">)>
<CRLF>)
<TELL "There is nothing special to be seen." CR>)
<COND (<AND <FIRST? ,PRSO>
<RTRUE>)
(T
<TELL "The " D ,PRSO " is empty." CR>)>)
(T
<TELL "The " D ,PRSO " is closed." CR>)>)
(T
<TELL "You can't look inside a " D ,PRSO "." CR>)>>
<ROUTINE V-LOOK-ON ()
<RTRUE>)
(T
<TELL "Look on a " D ,PRSO "???" CR>)>>
<ROUTINE V-LOOK-UNDER ()
<TELL "There is nothing but dust there." CR>>
<ROUTINE V-LOWER () <HACK-HACK "Playing in this way with the ">>
<ROUTINE V-MAKE ()
<TELL "You can't do that." CR>>
<ROUTINE V-MELT ()
<TELL "It's not clear that a " D ,PRSO " can be melted." CR>>
<ROUTINE PRE-MOVE ()
<TELL "You aren't an accomplished enough juggler." CR>)>>
<ROUTINE V-MOVE ()
<TELL "Moving the " D ,PRSO " reveals nothing." CR>)
(T
<TELL "You can't move the " D ,PRSO "." CR>)>>
<ROUTINE V-MUMBLE ()
<TELL "You'll have to speak up if you expect me to hear you!" CR>>
<ROUTINE PRE-MUNG ()
<COND %<COND (<==? ,ZORK-NUMBER 3>
'(<EQUAL? ,PRSO ,BEAM>
<RFALSE>))
(T
<TELL "Trying to destroy the " D ,PRSO " with ">
<TELL "your bare hands">)
(T
<TELL " is futile." CR>)>>
<ROUTINE V-MUNG ()
<RTRUE>)
(T
<TELL "Nice try." CR>)>>
<ROUTINE V-ODYSSEUS ()
<TELL
"The cyclops, hearing the name of his father's deadly nemesis, flees the room
by knocking down the wall on the east of the room." CR>
(T
'(<NULL-F> T))>
(T
<TELL "Wasn't he a sailor?" CR>)>>
<ROUTINE V-OIL ()
<TELL "You probably put spinach in your gas tank, too." CR>>
<ROUTINE V-OPEN ("AUX" F STR)
<TELL "It is already open." CR>)
(T
<TELL "Opened." CR>)
(<AND <SET F <FIRST? ,PRSO>>
<NOT <NEXT? .F>>
<TELL "The " D ,PRSO " opens." CR>
<TELL .STR CR>)
(T
<TELL "Opening the " D ,PRSO " reveals ">
<TELL "." CR>)>)>)
<TELL "It is already open." CR>)
(T
<TELL "The " D ,PRSO " opens." CR>
(T
<TELL
"You must tell me how to do that to a " D ,PRSO "." CR>)>>
Why the TEETH check? Because of a sneaky grammar hack.
This routine has a rather silly bug. You can type THROW OBJECT OVERBOARD (if you’re sailing the boat), but nothing checks that the object is portable. So you can throw GRUE or HANDS or ADVENTURER overboard, with unfortunate effects on the game grammar.
(contrib: Torbjörn Andersson)
<ROUTINE V-OVERBOARD ("AUX" LOCN)
<TELL "Ahoy -- " D ,PRSO " overboard!" CR>)
(T
<TELL "You're not in anything!" CR>)>))
(T '(<NULL-F> T))>
(T
<TELL "Huh?" CR>)>>
<ROUTINE V-PICK () <TELL "You can't pick that." CR>>
<ROUTINE V-PLAY ()
<TELL "That's silly!" CR>>
<ROUTINE V-PLUG ()
<TELL "This has no effect." CR>>
<ROUTINE V-POUR-ON ()
<TELL "The " D ,PRSI " is extinguished." CR>
(T
<TELL
"The water spills over the " D ,PRSI ", to the floor, and evaporates." CR>)>)
(T
'(<NULL-F> <RTRUE>))>
(T
<TELL "You can't pour that." CR>)>>
<ROUTINE V-PRAY ()
(T
'(<NULL-F> <RTRUE>))>
(T
<TELL
"If you pray enough, your prayers may be answered." CR>)>>
<ROUTINE V-PUMP ()
<TELL "Pump it up with a " D ,PRSI "?" CR>))
(T
'(<NULL-F> <RTRUE>))>
(T
'(<NULL-F> <RTRUE>))>
(T
<TELL "It's really not clear how." CR>)>>
<ROUTINE V-PUSH () <HACK-HACK "Pushing the ">>
<ROUTINE V-PUSH-TO ()
<TELL "You can't push things to that." CR>>
<ROUTINE PRE-PUT ()
<COND %<COND (<==? ,ZORK-NUMBER 3>
'(<EQUAL? ,PRSO ,SHORT-POLE>
<RFALSE>))
(T
<RFALSE>))>
(T
<ROUTINE V-PUT ()
(T
<TELL "You can't do that." CR>
<RTRUE>)>
<TELL "The " D ,PRSI " isn't open." CR>
<TELL "How can you do that?" CR>)
<TELL "The " D ,PRSO " is already in the " D ,PRSI "." CR>)
<TELL "There's no room." CR>)
<TELL "You don't have the " D ,PRSO "." CR>
<RTRUE>)
<RTRUE>)
(T
<TELL "Done." CR>)>>
<ROUTINE V-PUT-BEHIND ()
<TELL "That hiding place is too obvious." CR>>
<ROUTINE V-PUT-ON ()
<RTRUE>)
(T
<TELL "There's no good surface on the " D ,PRSI "." CR>)>>
<ROUTINE V-PUT-UNDER ()
<TELL "You can't do that." CR>>
<ROUTINE V-RAISE ()
<ROUTINE V-RAPE ()
<TELL "What a (ahem!) strange idea." CR>>
<ROUTINE PRE-READ ()
<TELL "It is impossible to read in the dark." CR>)
<TELL "How does one look through a " D ,PRSI "?" CR>)>>
<ROUTINE V-READ ()
<TELL "How does one read a " D ,PRSO "?" CR>)
(T
<ROUTINE V-READ-PAGE ()
<RTRUE>>
<ROUTINE V-REPENT ()
<TELL "It could very well be too late!" CR>>
<ROUTINE V-REPLY ()
<TELL "It is hardly likely that the " D ,PRSO " is interested." CR>
<RTRUE>>
<ROUTINE V-RING ()
<TELL "How, exactly, can you ring that?" CR>>
<ROUTINE V-RUB () <HACK-HACK "Fiddling with the ">>
<ROUTINE V-SAY ("AUX" V)
%<COND (<==? ,ZORK-NUMBER 2>
'<COND (<OR ,SPELL-USED ,WAND-ON>
<PERFORM ,V?INCANT>
<RTRUE>)>)
(<==? ,ZORK-NUMBER 3>
'<COND (<AND <FSET? ,FRONT-DOOR ,TOUCHBIT>
<EQUAL? <GET ,P-LEXV ,P-CONT> ,W?FROTZ>
<EQUAL? <GET ,P-LEXV <+ ,P-CONT 2>> ,W?OZMOO>>
<SETG P-CONT <>>
<COND (<EQUAL? ,HERE ,MSTAIRS>
<CRLF>
<GOTO ,FRONT-DOOR>
<RTRUE>)
(T
<TELL "Nothing happens." CR>)>
<RTRUE>)>)
(T
<TELL "Say what?" CR>
<RTRUE>)>)>
<TELL "You must address the " D .V " directly." CR>
<TELL
"Talking to yourself is a sign of impending mental collapse." CR>)>
<RTRUE>>
<ROUTINE V-SEARCH ()
<TELL "You find nothing unusual." CR>>
<ROUTINE V-SEND ()
<TELL "Why would you send for the " D ,PRSO "?" CR>)
(T
<TELL "That doesn't make sends." CR>)>>
<ROUTINE PRE-SGIVE ()
<RTRUE>>
<ROUTINE V-SGIVE ()
<TELL "Foo!" CR>>
<ROUTINE V-SHAKE ()
<TELL "This seems to have no effect." CR>)
<TELL "You can't take it; thus, you can't shake it!" CR>)
<TELL "The contents of the " D, PRSO " spills ">
<TELL "out and disappears">)
(T
<TELL "to the ground">)>
<TELL "." CR>)
(T
<TELL "Shaken." CR>)>)
(T
<TELL
"It sounds like there is something inside the " D ,PRSO "." CR>)
(T
<TELL "The " D, PRSO " sounds empty." CR>)>)>)
(T
<TELL "Shaken." CR>)>>
<ROUTINE SHAKE-LOOP ("AUX" X)
<REPEAT ()
<COND (<SET X <FIRST? ,PRSO>>
<MOVE .X
(T
(<==? ,ZORK-NUMBER 2>
'<COND (<EQUAL? .X ,WATER>
,PSEUDO-OBJECT)
(<NOT <FSET? ,HERE ,RLANDBIT>>
,PSEUDO-OBJECT)
(T
,HERE)>)
(T
'<COND (<EQUAL? ,HERE ,ON-LAKE>
,IN-LAKE)
(T
,HERE)>)>>)
(T
<RETURN>)>>>
<ROUTINE V-SKIP ()
<GLOBAL WHEEEEE
<LTABLE 0 "Very good. Now you can go to the second grade."
"Are you enjoying yourself?"
"Wheeeeeeeeee!!!!!"
"Do you expect me to applaud?">>
<ROUTINE V-SMELL ()
<TELL "It smells like a " D ,PRSO "." CR>>
<ROUTINE V-SPIN ()
<TELL "You can't spin that!" CR>>
<ROUTINE V-SPRAY ()
<ROUTINE V-SQUEEZE ()
<TELL "The " D ,PRSO " does not understand this.">)
(T
<TELL "How singularly useless.">)>
<CRLF>>
<ROUTINE V-SSPRAY ()
<ROUTINE V-STAB ("AUX" W)
<RTRUE>)
(T
<TELL
"No doubt you propose to stab the " D ,PRSO " with your pinky?" CR>)>>
<ROUTINE V-STAND ()
<RTRUE>)
(T
<TELL "You are already standing, I think." CR>)>>
<ROUTINE V-STAY ()
<TELL "You will be lost without me!" CR>>
<ROUTINE V-STRIKE ()
<TELL
"Since you aren't versed in hand-to-hand combat, you'd better attack the "
D ,PRSO " with a weapon." CR>)
(T
<RTRUE>)>>
<ROUTINE V-SWIM ()
<TELL "Swimming isn't usually allowed in the ">
(T
<TELL "dungeon.">)>
<CRLF>))
(T
'(<EQUAL? ,HERE ,ON-LAKE ,IN-LAKE>
<TELL "What do you think you're doing?" CR>))>
%<COND (<==? ,ZORK-NUMBER 3>
'(<EQUAL? ,HERE ,FLATHEAD-OCEAN>
<TELL
"Between the rocks and waves, you wouldn't last a minute!" CR>))
(T
<RFALSE>))>
(T
<TELL "Go jump in a lake!" CR>)>>
<ROUTINE V-SWING ()
<TELL "Whoosh!" CR>)
(T
<ROUTINE PRE-TAKE ()
<TELL "You are already wearing it." CR>)
(T
<TELL "You already have that!" CR>)>)
<TELL
"You can't reach something that's inside a closed container." CR>
<RTRUE>)
<RFALSE>)
<TELL "The " D ,PRSO " isn't in the " D ,PRSI "." CR>)
(T
<RFALSE>)>)
<TELL "You're inside of it!" CR>)>>
<ROUTINE V-TAKE ()
<COND (<EQUAL? <ITAKE> T>
<TELL "You are now wearing the " D ,PRSO "." CR>)
(T
<TELL "Taken." CR>)>)>>
<ROUTINE V-TELL ()
(T
" pauses for a moment, perhaps thinking that you should re-read
the manual." CR>)>)
(T
<TELL "You can't talk to the " D ,PRSO "!" CR>
<RFATAL>)>>
<ROUTINE V-THROUGH ("OPTIONAL" (OBJ <>) "AUX" M)
#DECL ((OBJ) <OR OBJECT FALSE> (M) <PRIMTYPE VECTOR>)
<RTRUE>)
<RTRUE>)
<COND %<COND (<==? ,ZORK-NUMBER 2>
'(<AND ,SCOL-ROOM
<OR .OBJ <EQUAL? ,PRSO ,CURTAIN>>>
<SCOL-GO .OBJ>
<RTRUE>))
(T
%<COND (<==? ,ZORK-NUMBER 2>
'(<AND <EQUAL? ,HERE ,DEPOSITORY>
<EQUAL? ,PRSO ,SNWL>
,SCOL-ROOM>
<SCOL-GO .OBJ>
<RTRUE>))
(T
%<COND (<==? ,ZORK-NUMBER 2>
'(<AND <EQUAL? ,HERE ,SCOL-ACTIVE>
<EQUAL? ,PRSO
<GET <SET M <GET-WALL ,HERE>> 1>>>
<SETG SCOL-ROOM <GET .M 2>>
<SETG PRSO <GETP ,PRSO ,P?SIZE>>
<COND (.OBJ <SCOL-OBJ .OBJ 0 ,DEPOSITORY>)
(T
<SCOL-THROUGH 0 ,DEPOSITORY>)>
<RTRUE>))
(T
%<COND (<==? ,ZORK-NUMBER 2>
'(<EQUAL? ,PRSO ,CURTAIN>
<TELL
"You can't go more than part way through the curtain." CR>
<RTRUE>))
(T
(T
<TELL
"You hit your head against the " D ,PRSO " as you attempt this feat." CR>)>)
(.OBJ
<TELL "You can't do that!" CR>)
<TELL "That would involve quite a contortion!" CR>)
(T
<ROUTINE V-THROW ()
<TELL
"A terrific throw! The " D ,PRSO>
<JIGS-UP " hits you squarely in the head. Normally,
this wouldn't do much damage, but by incredible mischance, you fall over
backwards trying to duck, and break your neck, justice being swift and
merciful in the Great Underground Empire.">)
<TELL
"The " D ,PRSI " ducks as the " D ,PRSO " flies by and crashes to the ground."
CR>)
(T <TELL "Thrown." CR>)>)>>
<ROUTINE V-THROW-OFF ()
<TELL "You can't throw anything off of that!" CR>>
<ROUTINE V-TIE ()
<TELL "You can't tie anything to yourself." CR>)
(T
<TELL "You can't tie the " D ,PRSO " to that." CR>)>>
<ROUTINE V-TIE-UP ()
<TELL "You could certainly never tie it with that!" CR>>
(T
'(<NULL-F> <RTRUE>))>
(T
'(<NULL-F> <RTRUE>))>
(T
<TELL "Nothing happens." CR>)>>
<ROUTINE PRE-TURN ()
<TELL "You can't turn that!" CR>)>>
<ROUTINE V-TURN ()
<TELL "This has no effect." CR>>
<ROUTINE V-UNLOCK ()
<ROUTINE V-UNTIE ()
<TELL "This cannot be tied, so it cannot be untied!" CR>>
The WAIT command waits three full turns, including the “every turn” timers. But a timer can interrupt this – for example, if the thief shows up and robs you.
<ROUTINE V-WAIT ("OPTIONAL" (NUM 3))
<TELL "Time passes..." CR>
<REPEAT ()
<COND (<L? <SET NUM <- .NUM 1>> 0> <RETURN>)
<ROUTINE V-WALK ("AUX" PT PTS STR OBJ RM)
<RTRUE>)
<COND (<EQUAL? <SET PTS <PTSIZE .PT>> ,UEXIT>
<RFATAL>)
<COND (<SET RM <APPLY <GET .PT ,FEXITFCN>>>
%<COND (<==? ,ZORK-NUMBER 3>
'(<AND <EQUAL? ,HERE ,CP> ,CP-MOVED>
<RTRUE>))
(T
(T
<RFATAL>)>)
<TELL .STR CR>
<RFATAL>)
(T
<TELL "You can't go that way." CR>
<RFATAL>)>)
<TELL .STR CR>
<RFATAL>)
(T
<TELL "The " D .OBJ " is closed." CR>
<RFATAL>)>)>)
<PROB 80>
<TELL
"There are odd noises in the darkness, and there is no exit in that
direction." CR>
<RFATAL>)
%<COND (<==? ,ZORK-NUMBER 3>
'(<EQUAL? ,HERE ,DARK-1 ,DARK-2>
<JIGS-UP
"Oh, no! You have walked into a den of hungry grues and it's dinner time!">))
(T
<RFALSE>))>
(T
"Oh, no! You have walked into the slavering fangs of a lurking grue!">)>)
(T
<TELL "You can't go that way." CR>
<RFATAL>)>>
<ROUTINE V-WALK-AROUND ()
<TELL "Use compass directions for movement." CR>>
<ROUTINE V-WALK-TO ()
<TELL "It's here!" CR>)
(T
<TELL "You should supply a direction!" CR>)>>
<ROUTINE V-WAVE ()
<ROUTINE V-WEAR ()
<TELL "You can't wear the " D ,PRSO "." CR>)
(T
<RTRUE>)>>
<ROUTINE V-WIN ()
<TELL "Naturally!" CR>>
<ROUTINE V-WIND ()
<TELL "You cannot wind up a " D ,PRSO "." CR>>
<ROUTINE V-WISH ()
%<COND (<==? ,ZORK-NUMBER 2>
'<PERFORM ,V?MAKE ,WISH>)
(T
'<TELL "With luck, your wish will come true." CR>)>>
<ROUTINE V-YELL () <TELL "Aaaarrrrgggghhhh!" CR>>
<ROUTINE V-ZORK () <TELL "At your service!" CR>>
^L
"Verb-Associated Routines"
"Descriptions"
Whether the current location has light. Set by calling the LIT? routine.
<GLOBAL LIT <>>
Whether you’ve been sprayed with grue repellant. Sadly, the grue repellant is in Zork 2, so this will never be set.
<GLOBAL SPRAYED? <>>
<ROUTINE V-FIRST-LOOK ()
<ROUTINE DESCRIBE-ROOM ("OPTIONAL" (LOOK? <>) "AUX" V? STR AV)
<TELL "It is pitch black.">
<TELL " You are likely to be eaten by a grue.">)>
<CRLF>
%<COND (<==? ,ZORK-NUMBER 3>
'<COND (<EQUAL? ,HERE ,DARK-2>
<TELL
"The ground continues to slope upwards away from the lake. You can barely
detect a dim light from the east." CR>)>)
(T
<RETURN <>>)>
<SET V? T>)>
DESCRIBE-ROOM always marks MAZEBIT rooms as unvisited. This means that they are always described in full, even in BRIEF mode. You can’t “recognize” maze rooms you’ve already visited.
Unfortunately, this breaks the ROB-MAZE routine. The thief is supposed to move your possessions around the maze behind your back. But he doesn’t touch unvisited rooms, so this never happens!
(contrib: Torbjörn Andersson)
'<COND (<FSET? ,HERE ,MAZEBIT>
(T
'<NULL-F>)>
<TELL ", in the " D .AV>)>
<CRLF>)>
<RTRUE>)
<TELL .STR CR>)
(T
<COND (<AND <NOT <EQUAL? ,HERE .AV>> <FSET? .AV ,VEHBIT>>
T>
<ROUTINE DESCRIBE-OBJECTS ("OPTIONAL" (V? <>))
(T
<TELL "Only bats can see in the dark. And you're not one." CR>)>>
"DESCRIBE-OBJECT -- takes object and flag. if flag is true will print a
long description (fdesc or ldesc), otherwise will print short."
<GLOBAL DESC-OBJECT <>>
<ROUTINE DESCRIBE-OBJECT (OBJ V? LEVEL "AUX" (STR <>) AV)
<COND (<AND <0? .LEVEL>
<RTRUE>)
(<AND <0? .LEVEL>
<TELL .STR>)
(<0? .LEVEL>
<TELL "There is a " D .OBJ " here">
<COND (<FSET? .OBJ ,ONBIT>
<TELL " (providing light)">)>
<TELL ".">)
(T
<TELL "A " D .OBJ>
<COND (<FSET? .OBJ ,ONBIT>
<TELL " (providing light)">)
<TELL " (being worn)">)>)>
%<COND (<==? ,ZORK-NUMBER 2>
'<COND (<AND <EQUAL? .OBJ ,SPELL-VICTIM>
<EQUAL? ,SPELL-USED ,W?FLOAT>>
<TELL " (floating in midair)">)>)
(T
<COND (<AND <0? .LEVEL>
<TELL " (outside the " D .AV ")">)>
<CRLF>
<ROUTINE PRINT-CONTENTS (OBJ "AUX" F N (1ST? T) (IT? <>) (TWO? <>))
<COND (<SET F <FIRST? .OBJ>>
<REPEAT ()
<SET N <NEXT? .F>>
<COND (.1ST? <SET 1ST? <>>)
(ELSE
<TELL ", ">
<COND (<NOT .N> <TELL "and ">)>)>
<TELL "a " D .F>
<COND (<AND <NOT .IT?> <NOT .TWO?>>
<SET IT? .F>)
(ELSE
<SET TWO? T>
<SET IT? <>>)>
<SET F .N>
<COND (<NOT .F>
<COND (<AND .IT? <NOT .TWO?>>
<RTRUE>)>>)>>
<ROUTINE PRINT-CONT (OBJ "OPTIONAL" (V? <>) (LEVEL 0)
"AUX" Y 1ST? SHIT AV STR (PV? <>) (INV? <>))
<COND (<NOT <SET Y <FIRST? .OBJ>>> <RTRUE>)>
T)
(ELSE <SET AV <>>)>
<SET 1ST? T>
<SET SHIT T>
<COND (<EQUAL? ,WINNER .OBJ <LOC .OBJ>>
<SET INV? T>)
(ELSE
<REPEAT ()
<COND (<NOT .Y>
<RETURN>)
(<EQUAL? .Y .AV> <SET PV? T>)
<TELL .STR CR>
<SET SHIT <>>
)>
<FIRST? .Y>>
<COND (<PRINT-CONT .Y .V? 0>
<SET 1ST? <>>)>)>)>
<SET Y <NEXT? .Y>>>)>
<SET Y <FIRST? .OBJ>>
<REPEAT ()
<COND (<NOT .Y>
<COND (<AND .PV? .AV <FIRST? .AV>>
<SET LEVEL <+ .LEVEL 1>>
<PRINT-CONT .AV .V? .LEVEL>)>
<RETURN>)
<OR .INV?
<COND (.1ST?
<COND (<L? .LEVEL 0>
<SET LEVEL 0>)>)>
<SET LEVEL <+ 1 .LEVEL>>
<SET 1ST? <>>)>
<COND (<L? .LEVEL 0> <SET LEVEL 0>)>
<SET LEVEL <+ .LEVEL 1>>
<PRINT-CONT .Y .V? .LEVEL>)>)>
<SET Y <NEXT? .Y>>>
<COND (<AND .1ST? .SHIT> <RFALSE>) (T <RTRUE>)>>
<ROUTINE FIRSTER (OBJ LEVEL)
<TELL
"Your collection of treasures consists of:" CR>))
(T
'(<NULL-F> <RTRUE>))>
<TELL "You are carrying:" CR>)
<COND (<G? .LEVEL 0>
<TELL "Sitting on the " D .OBJ " is: " CR>)
<TELL "The " D .OBJ " is holding: " CR>)
(T
<TELL "The " D .OBJ " contains:" CR>)>)>>
<ROUTINE SEE-INSIDE? (OBJ)
"Scoring"
<GLOBAL MOVES 0>
<GLOBAL SCORE 0>
<GLOBAL BASE-SCORE 0>
This global is also defined in 1dungeon.zil. The compiler seems to have been okay with this.
<GLOBAL WON-FLAG <>>
Increases (or decreases) your score. Also checks whether you’ve reached 350, which sets WON-FLAG and unlocks the secret MAP and the STONE-BARROW.
(You can get your score up to 352 by exploiting a bug. Sadly, this routine only checks if your score is EQUAL? to 350. Going over will not end the game!)
<ROUTINE SCORE-UPD (NUM)
'<COND (<AND <EQUAL? ,SCORE 350>
<TELL
"An almost inaudible voice whispers in your ear, \"Look to your treasures
for the final secret.\"" CR>)>)
(T
'<NULL-F>)>
T>
<ROUTINE SCORE-OBJ (OBJ "AUX" TEMP)
<COND (<G? <SET TEMP <GETP .OBJ ,P?VALUE>> 0>
<ROUTINE FINISH ()
<QUIT>>
<ROUTINE YES? ()
<PRINTI ">">
<COND (<EQUAL? <GET ,P-LEXV 1> ,W?YES ,W?Y>
<RTRUE>)
(T
<RFALSE>)>>
"Death"
<GLOBAL DEAD <>>
<GLOBAL DEATHS 0>
Set false if you break a mirror. Yes, this hurts probability checks; see ZPROB.
Oddly, this global is defined in two places in the source. See 1actions.zil. (Don’t worry, T and 1 are the same value.)
<GLOBAL LUCKY 1>
"Object Manipulation"
<GLOBAL FUMBLE-PROB 8>
<ROUTINE ITAKE ("OPTIONAL" (VB T) "AUX" CNT OBJ)
#DECL ((VB) <OR ATOM FALSE> (CNT) FIX (OBJ) OBJECT)
<COND (.VB
<TELL
"Your hand passes through its object." CR>)>
<RFALSE>))
(T
'(<NULL-F>
<RFALSE>))>
<COND (.VB
<RFALSE>)
This “floating over your head” check has to do with the FLOAT spell in Zork 2. That code is not used in Zork 1; that’s why it’s greyed out.
%<COND (<==? ,ZORK-NUMBER 2>
'(<AND <EQUAL? ,PRSO ,SPELL-VICTIM>
<EQUAL? ,SPELL-USED ,W?FLOAT ,W?FREEZE>>
<COND (<EQUAL? ,SPELL-USED ,W?FLOAT>
<TELL
"You can't reach that. It's floating above your head." CR>)
(T
<TELL "It seems rooted to the spot." CR>)>
<RFALSE>))
(T
<RFALSE>))>
<RFALSE>)
<COND (.VB
<TELL "Your load is too heavy">
<TELL", especially in light of your condition.">)
(T
<TELL ".">)>
<CRLF>)>
<RFATAL>)
The “holding too many things” message is probabilistic. The more objects you have past seven, the greater the chance of failing to pick up another.
Note that there’s a separate check, a few lines up, for whether “your load is too heavy”. That one is not probabilistic.
I wrote a blog post about this a few years back.
(<AND <VERB? TAKE>
<TELL
"You're holding too many things already!" CR>
<RFALSE>)
(T
Another Zork 2 spell (FANTASIZE) which has no effect in Zork 1. See FLOAT, above.
(Turns out the spell has no effect in Zork 2 either!)
%<COND (<==? ,ZORK-NUMBER 2>
'<COND (<EQUAL? ,SPELL? ,S-FILCH>
<COND (<RIPOFF ,PRSO ,WIZARD-CASE>
<TELL
"When you touch the " D ,PRSO " it immediately disappears!" CR>
<RFALSE>)>)>)
(T
(T
'<NULL-F>)>
<RTRUE>)>>
<ROUTINE IDROP ()
<TELL "You're not carrying the " D ,PRSO "." CR>
<RFALSE>)
<TELL "The " D ,PRSO " is closed." CR>
<RFALSE>)
(T
<RTRUE>)>>
<ROUTINE CCOUNT (OBJ "AUX" (CNT 0) X)
<COND (<SET X <FIRST? .OBJ>>
<REPEAT ()
<SET CNT <+ .CNT 1>>)>
<COND (<NOT <SET X <NEXT? .X>>>
<RETURN>)>>)>
.CNT>
Measure the total SIZE of an object, including its contents. (There is no separate “weight” property; SIZE describes both weight and bulk.)
Anything the player is WEARing only counts as SIZE 1, regardless of contents. This simulates the fact that a backpack, for example, lets you carry more stuff. Sadly, Zork has no backpack, nor anything else you can WEAR.
<ROUTINE WEIGHT (OBJ "AUX" CONT (WT 0))
<COND (<SET CONT <FIRST? .OBJ>>
<REPEAT ()
<COND (<AND <EQUAL? .OBJ ,PLAYER>
<SET WT <+ .WT 1>>)
(T
<SET WT <+ .WT <WEIGHT .CONT>>>)>
<COND (<NOT <SET CONT <NEXT? .CONT>>> <RETURN>)>>)>
"Miscellaneous"
<CONSTANT REXIT 0>
<CONSTANT UEXIT 1>
<CONSTANT NEXIT 2>
<CONSTANT FEXIT 3>
<CONSTANT CEXIT 4>
<CONSTANT DEXIT 5>
<CONSTANT NEXITSTR 0>
<CONSTANT FEXITFCN 0>
<CONSTANT CEXITFLAG 1>
<CONSTANT CEXITSTR 1>
<CONSTANT DEXITOBJ 1>
<CONSTANT DEXITSTR 1>
<GLOBAL INDENTS
<TABLE ""
" "
" "
" "
" "
" ">>
<ROUTINE HACK-HACK (STR)
<VERB? WAVE RAISE LOWER>>
<TELL "The " D ,PRSO " isn't here!" CR>)
(T
<GLOBAL HO-HUM
<LTABLE
0
" doesn't seem to work."
" isn't notably helpful."
" has no effect.">>
<ROUTINE NO-GO-TELL (AV WLOC)
<COND (.AV
<TELL "You can't go there in a " D .WLOC ".">)
(T
<TELL "You can't go there without a vehicle.">)>
<CRLF>>
<ROUTINE GOTO (RM "OPTIONAL" (V? T)
(AV <>) OLIT)
<COND (<AND <NOT .LB>
<NOT .AV>>
<RFALSE>)
(<AND <NOT .LB>
<NOT <FSET? .RM .AV>>>
<RFALSE>)
.LB
.AV
<NOT <FSET? .RM .AV>>>
<RFALSE>)
<RFALSE>)
(T
<COND (<AND .LB
<TELL
"The " D .WLOC " comes to a rest on the shore." CR CR>)>
<COND (.AV
<MOVE .WLOC .RM>)
(T
<COND (<AND <NOT .OLIT>
<PROB 80>>
<TELL
"There are sinister gurgling noises in the darkness all around you!" CR>)
%<COND (<==? ,ZORK-NUMBER 3>
'(<EQUAL? ,HERE ,DARK-1 ,DARK-2>
<JIGS-UP
"Oh, no! Dozen of lurking grues attack and devour you! You must have
stumbled into an authentic grue lair!">))
(T
<RFALSE>))>
(T
<TELL
"Oh, no! A lurking grue slithered into the ">
(T <TELL "room">)>
<RTRUE>)>)>
<TELL "You have moved into a dark place." CR>
<COND (<NOT <EQUAL? ,HERE .RM>> <RTRUE>)
<TELL "The " D ,WINNER " leaves the room." CR>)
<RTRUE>)>>
<ROUTINE GO-NEXT (TBL "AUX" VAL)
<COND (<NOT <GOTO .VAL>> 2)
(T 1)>)>>
<ROUTINE LKP (ITM TBL "AUX" (CNT 0) (LEN <GET .TBL 0>))
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> .LEN>
<RFALSE>)
(<EQUAL? <GET .TBL .CNT> .ITM>
<COND (<EQUAL? .CNT .LEN> <RFALSE>)
(T
<RETURN <GET .TBL <+ .CNT 1>>>)>)>>>
<ROUTINE DO-WALK (DIR)
<ROUTINE WORD-TYPE (OBJ WORD "AUX" SYNS)
<- </ <PTSIZE .SYNS> 2> 1>>>
<ROUTINE GLOBAL-IN? (OBJ1 OBJ2 "AUX" TX)
<ZMEMQB .OBJ1 .TX <- <PTSIZE .TX> 1>>)>>
<ROUTINE FIND-IN (WHERE WHAT "AUX" W)
<SET W <FIRST? .WHERE>>
<COND (<NOT .W>
<RFALSE>)>
<REPEAT ()
<COND (<AND <FSET? .W .WHAT>
<RETURN .W>)
(<NOT <SET W <NEXT? .W>>>
<RETURN <>>)>>>
<ROUTINE IN-HERE? (OBJ)
<ROUTINE HELD? (CAN)
<REPEAT ()
<SET CAN <LOC .CAN>>
<COND (<NOT .CAN> <RFALSE>)
(<EQUAL? .CAN ,WINNER> <RTRUE>)>>>
<ROUTINE OTHER-SIDE (DOBJ "AUX" (P 0) TX)
<REPEAT ()
<COND (<L? <SET P <NEXTP ,HERE .P>> ,LOW-DIRECTION>
<RETURN <>>)
(ELSE
<SET TX <GETPT ,HERE .P>>
<COND (<AND <EQUAL? <PTSIZE .TX> ,DEXIT>
<RETURN .P>)>)>>>
<ROUTINE MUNG-ROOM (RM STR)
<ROUTINE THIS-IS-IT (OBJ)
<GLOBAL SWIMYUKS
<LTABLE 0 "You can't swim in the dungeon.">>
<GLOBAL HELLOS
<LTABLE 0 "Hello."
"Good day."
"Nice weather we've been having lately."
"Goodbye.">>
<GLOBAL YUKS
<LTABLE
0
"A valiant attempt."
"You can't be serious."
"An interesting idea..."
"What a concept!">>
<GLOBAL DUMMY
<LTABLE 0
"Look around."
"Too late for that."
"Have your eyes checked.">>