-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 34cc828
Showing
12 changed files
with
11,526 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# zork1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
"GCLOCK for | ||
The Zork Trilogy | ||
(c) Copyright 1983 Infocom, Inc. All Rights Reserved" | ||
|
||
<CONSTANT C-TABLELEN 180> | ||
|
||
<GLOBAL C-TABLE <ITABLE NONE 180>> | ||
|
||
<GLOBAL C-DEMONS 180> | ||
|
||
<GLOBAL C-INTS 180> | ||
|
||
<CONSTANT C-INTLEN 6> | ||
|
||
<CONSTANT C-ENABLED? 0> | ||
|
||
<CONSTANT C-TICK 1> | ||
|
||
<CONSTANT C-RTN 2> | ||
|
||
<ROUTINE DEMON (RTN TICK "AUX" CINT) | ||
#DECL ((RTN) ATOM (TICK) FIX (CINT) <PRIMTYPE VECTOR>) | ||
<PUT <SET CINT <INT .RTN T>> ,C-TICK .TICK> | ||
.CINT> | ||
|
||
<ROUTINE QUEUE (RTN TICK "AUX" CINT) | ||
#DECL ((RTN) ATOM (TICK) FIX (CINT) <PRIMTYPE VECTOR>) | ||
<PUT <SET CINT <INT .RTN>> ,C-TICK .TICK> | ||
.CINT> | ||
|
||
<ROUTINE INT (RTN "OPTIONAL" (DEMON <>) E C INT) | ||
#DECL ((RTN) ATOM (DEMON) <OR ATOM FALSE> (E C INT) <PRIMTYPE | ||
VECTOR>) | ||
<SET E <REST ,C-TABLE ,C-TABLELEN>> | ||
<SET C <REST ,C-TABLE ,C-INTS>> | ||
<REPEAT () | ||
<COND (<==? .C .E> | ||
<SETG C-INTS <- ,C-INTS ,C-INTLEN>> | ||
<AND .DEMON <SETG C-DEMONS <- ,C-DEMONS ,C-INTLEN>>> | ||
<SET INT <REST ,C-TABLE ,C-INTS>> | ||
<PUT .INT ,C-RTN .RTN> | ||
<RETURN .INT>) | ||
(<EQUAL? <GET .C ,C-RTN> .RTN> <RETURN .C>)> | ||
<SET C <REST .C ,C-INTLEN>>>> | ||
|
||
<GLOBAL CLOCK-WAIT <>> | ||
|
||
<ROUTINE CLOCKER ("AUX" C E TICK (FLG <>)) | ||
#DECL ((C E) <PRIMTYPE VECTOR> (TICK) FIX (FLG) <OR FALSE ATOM>) | ||
<COND (,CLOCK-WAIT <SETG CLOCK-WAIT <>> <RFALSE>)> | ||
<SET C <REST ,C-TABLE <COND (,P-WON ,C-INTS) (T ,C-DEMONS)>>> | ||
<SET E <REST ,C-TABLE ,C-TABLELEN>> | ||
<REPEAT () | ||
<COND (<==? .C .E> | ||
<COND (<G? <SETG MOVES <+ ,MOVES 1>> 999> | ||
<SETG MOVES 0>)> | ||
<RETURN .FLG>) | ||
(<NOT <0? <GET .C ,C-ENABLED?>>> | ||
<SET TICK <GET .C ,C-TICK>> | ||
<COND (<0? .TICK>) | ||
(T | ||
<PUT .C ,C-TICK <- .TICK 1>> | ||
<COND (<AND <NOT <G? .TICK 1>> | ||
<APPLY <GET .C ,C-RTN>>> | ||
<SET FLG T>)>)>)> | ||
<SET C <REST .C ,C-INTLEN>>>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,316 @@ | ||
"Generic GLOBALS file for | ||
The ZORK Trilogy | ||
started on 7/28/83 by MARC" | ||
|
||
"SUBTITLE GLOBAL OBJECTS" | ||
|
||
<OBJECT GLOBAL-OBJECTS | ||
(FLAGS RMUNGBIT INVISIBLE TOUCHBIT SURFACEBIT TRYTAKEBIT | ||
OPENBIT SEARCHBIT TRANSBIT ONBIT RLANDBIT FIGHTBIT | ||
STAGGERED WEARBIT)> | ||
|
||
<OBJECT LOCAL-GLOBALS | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM ZZMGCK) | ||
(DESCFCN PATH-OBJECT) | ||
(GLOBAL GLOBAL-OBJECTS) | ||
(ADVFCN 0) | ||
(FDESC "F") | ||
(LDESC "F") | ||
(PSEUDO "FOOBAR" V-WALK) | ||
(CONTFCN 0) | ||
(VTYPE 1) | ||
(SIZE 0) | ||
(CAPACITY 0)> | ||
|
||
;"Yes, this synonym for LOCAL-GLOBALS needs to exist... sigh" | ||
|
||
<OBJECT ROOMS | ||
(IN TO ROOMS)> | ||
|
||
<OBJECT INTNUM | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM INTNUM) | ||
(FLAGS TOOLBIT) | ||
(DESC "number")> | ||
|
||
<OBJECT PSEUDO-OBJECT | ||
(IN LOCAL-GLOBALS) | ||
(DESC "pseudo") | ||
(ACTION CRETIN-FCN)> | ||
|
||
<OBJECT IT | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM IT THEM HER HIM) | ||
(DESC "random object") | ||
(FLAGS NDESCBIT TOUCHBIT)> | ||
|
||
<OBJECT NOT-HERE-OBJECT | ||
(DESC "such thing" ;"[not here]") | ||
(ACTION NOT-HERE-OBJECT-F)> | ||
|
||
<ROUTINE NOT-HERE-OBJECT-F ("AUX" TBL (PRSO? T) OBJ) | ||
;"This COND is game independent (except the TELL)" | ||
<COND (<AND <EQUAL? ,PRSO ,NOT-HERE-OBJECT> | ||
<EQUAL? ,PRSI ,NOT-HERE-OBJECT>> | ||
<TELL "Those things aren't here!" CR> | ||
<RTRUE>) | ||
(<EQUAL? ,PRSO ,NOT-HERE-OBJECT> | ||
<SET TBL ,P-PRSO>) | ||
(T | ||
<SET TBL ,P-PRSI> | ||
<SET PRSO? <>>)> | ||
;"Here is the default 'cant see any' printer" | ||
<SETG P-CONT <>> | ||
<SETG QUOTE-FLAG <>> | ||
<COND (<EQUAL? ,WINNER ,PLAYER> | ||
<TELL "You can't see any"> | ||
<NOT-HERE-PRINT .PRSO?> | ||
<TELL " here!" CR>) | ||
(T | ||
<TELL "The " D ,WINNER " seems confused. \"I don't see any"> | ||
<NOT-HERE-PRINT .PRSO?> | ||
<TELL " here!\"" CR>)> | ||
<RTRUE>> | ||
|
||
<ROUTINE FIND-NOT-HERE (TBL PRSO? "AUX" M-F OBJ) | ||
;"Here is where special-case code goes. <MOBY-FIND .TBL> returns | ||
number of matches. If 1, then P-MOBY-FOUND is it. One may treat | ||
the 0 and >1 cases alike or different. It doesn't matter. Always | ||
return RFALSE (not handled) if you have resolved the problem." | ||
<SET M-F <MOBY-FIND .TBL>> | ||
;<COND (,DEBUG | ||
<TELL "[Moby-found " N .M-F " objects" "]" CR>)> | ||
<COND (<AND <G? .M-F 1> | ||
<SET OBJ <GETP <1 .TBL> ,P?GLOBAL>>> | ||
<SET M-F 1> | ||
<SETG P-MOBY-FOUND .OBJ>)> | ||
<COND (<==? 1 .M-F> | ||
;<COND (,DEBUG <TELL "[Namely: " D ,P-MOBY-FOUND "]" CR>)> | ||
<COND (.PRSO? <SETG PRSO ,P-MOBY-FOUND>) | ||
(T <SETG PRSI ,P-MOBY-FOUND>)> | ||
<RFALSE>) | ||
(<NOT .PRSO?> | ||
<TELL "You wouldn't find any"> | ||
<NOT-HERE-PRINT .PRSO?> | ||
<TELL " there." CR> | ||
<RTRUE>) | ||
(T ,NOT-HERE-OBJECT)>> | ||
|
||
<ROUTINE GLOBAL-NOT-HERE-PRINT (OBJ) | ||
;<COND (,P-MULT <SETG P-NOT-HERE <+ ,P-NOT-HERE 1>>)> | ||
<SETG P-CONT <>> | ||
<SETG QUOTE-FLAG <>> | ||
<TELL "You can't see any"> | ||
<COND (<EQUAL? .OBJ ,PRSO> <PRSO-PRINT>) | ||
(T <PRSI-PRINT>)> | ||
<TELL " here." CR>> | ||
|
||
<ROUTINE NOT-HERE-PRINT (PRSO?) | ||
<COND (,P-OFLAG | ||
<COND (,P-XADJ <TELL " "> <PRINTB ,P-XADJN>)> | ||
<COND (,P-XNAM <TELL " "> <PRINTB ,P-XNAM>)>) | ||
(.PRSO? | ||
<BUFFER-PRINT <GET ,P-ITBL ,P-NC1> <GET ,P-ITBL ,P-NC1L> <>>) | ||
(T | ||
<BUFFER-PRINT <GET ,P-ITBL ,P-NC2> <GET ,P-ITBL ,P-NC2L> <>>)>> | ||
|
||
<ROUTINE NULL-F ("OPTIONAL" A1 A2) | ||
<RFALSE>> | ||
|
||
/^L | ||
|
||
"Objects shared by all three Zorks go here" | ||
|
||
<GLOBAL LOAD-MAX 100> | ||
|
||
<GLOBAL LOAD-ALLOWED 100> | ||
|
||
<OBJECT BLESSINGS | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM BLESSINGS GRACES) | ||
(DESC "blessings") | ||
(FLAGS NDESCBIT)> | ||
|
||
<OBJECT STAIRS | ||
(IN LOCAL-GLOBALS) | ||
(SYNONYM STAIRS STEPS STAIRCASE STAIRWAY) | ||
(ADJECTIVE STONE DARK MARBLE FORBIDDING STEEP) | ||
(DESC "stairs") | ||
(FLAGS NDESCBIT CLIMBBIT) | ||
(ACTION STAIRS-F)> | ||
|
||
<ROUTINE STAIRS-F () | ||
<COND (<VERB? THROUGH> | ||
<TELL | ||
"You should say whether you want to go up or down." CR>)>> | ||
|
||
<OBJECT SAILOR | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM SAILOR FOOTPAD AVIATOR) | ||
(DESC "sailor") | ||
(FLAGS NDESCBIT) | ||
(ACTION SAILOR-FCN)> | ||
|
||
<ROUTINE SAILOR-FCN () | ||
<COND (<VERB? HELLO> | ||
<SETG HS <+ ,HS 1>> | ||
%<COND (<==? ,ZORK-NUMBER 3> | ||
'<COND (<NOT <FSET? ,VIKING-SHIP ,INVISIBLE>> | ||
<TELL | ||
"The seaman looks up and maneuvers the boat toward shore. He cries out \"I | ||
have waited three ages for someone to say those words and save me from | ||
sailing this endless ocean. Please accept this gift. You may find it | ||
useful!\" He throws something which falls near you in the sand, then sails | ||
off toward the west, singing a lively, but somewhat uncouth, sailor song." CR> | ||
<FSET ,VIKING-SHIP ,INVISIBLE> | ||
<MOVE ,VIAL ,HERE>) | ||
(<==? ,HERE ,FLATHEAD-OCEAN> | ||
<COND (,SHIP-GONE | ||
<TELL "Nothing happens anymore." CR>) | ||
(T | ||
<TELL "Nothing happens yet." CR>)>)>) | ||
(T | ||
'<NULL-F>)> | ||
<COND (<0? <MOD ,HS 20>> | ||
<TELL "You seem to be repeating yourself." CR>) | ||
(<0? <MOD ,HS 10>> | ||
<TELL | ||
"I think that phrase is getting a bit worn out." CR>) | ||
(T | ||
<TELL "Nothing happens here." CR>)>)>> | ||
|
||
<OBJECT GROUND | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM GROUND SAND DIRT FLOOR) | ||
(DESC "ground") | ||
(ACTION GROUND-FUNCTION)> | ||
|
||
<ROUTINE GROUND-FUNCTION () | ||
<COND (<AND <VERB? PUT PUT-ON> | ||
<EQUAL? ,PRSI ,GROUND>> | ||
<PERFORM ,V?DROP ,PRSO> | ||
<RTRUE>) | ||
%<COND (<==? ,ZORK-NUMBER 1> | ||
'(<EQUAL? ,HERE ,SANDY-CAVE> | ||
<SAND-FUNCTION>)) | ||
(T | ||
'(<NULL-F> | ||
<RFALSE>))> | ||
(<VERB? DIG> | ||
<TELL "The ground is too hard for digging here." CR>)>> | ||
|
||
<OBJECT GRUE | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM GRUE) | ||
(ADJECTIVE LURKING SINISTER HUNGRY SILENT) | ||
(DESC "lurking grue") | ||
(ACTION GRUE-FUNCTION)> | ||
|
||
<ROUTINE GRUE-FUNCTION () | ||
<COND (<VERB? EXAMINE> | ||
<TELL | ||
"The grue is a sinister, lurking presence in the dark places of the | ||
earth. Its favorite diet is adventurers, but its insatiable | ||
appetite is tempered by its fear of light. No grue has ever been | ||
seen by the light of day, and few have survived its fearsome jaws | ||
to tell the tale." CR>) | ||
(<VERB? FIND> | ||
<TELL | ||
"There is no grue here, but I'm sure there is at least one lurking | ||
in the darkness nearby. I wouldn't let my light go out if I were | ||
you!" CR>) | ||
(<VERB? LISTEN> | ||
<TELL | ||
"It makes no sound but is always lurking in the darkness nearby." CR>)>> | ||
|
||
<OBJECT LUNGS | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM LUNGS AIR MOUTH BREATH) | ||
(DESC "blast of air") | ||
(FLAGS NDESCBIT)> | ||
|
||
<OBJECT ME | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM ME MYSELF SELF CRETIN) | ||
(DESC "you") | ||
(FLAGS ACTORBIT) | ||
(ACTION CRETIN-FCN)> | ||
|
||
<ROUTINE CRETIN-FCN () | ||
<COND (<VERB? TELL> | ||
<SETG P-CONT <>> | ||
<SETG QUOTE-FLAG <>> | ||
<TELL | ||
"Talking to yourself is said to be a sign of impending mental collapse." CR>) | ||
(<AND <VERB? GIVE> | ||
<EQUAL? ,PRSI ,ME>> | ||
<PERFORM ,V?TAKE ,PRSO> | ||
<RTRUE>) | ||
(<VERB? MAKE> | ||
<TELL "Only you can do that." CR>) | ||
(<VERB? DISEMBARK> | ||
<TELL "You'll have to do that on your own." CR>) | ||
(<VERB? EAT> | ||
<TELL "Auto-cannibalism is not the answer." CR>) | ||
(<VERB? ATTACK MUNG> | ||
<COND (<AND ,PRSI <FSET? ,PRSI ,WEAPONBIT>> | ||
<JIGS-UP "If you insist.... Poof, you're dead!">) | ||
(T | ||
<TELL "Suicide is not the answer." CR>)>) | ||
(<VERB? TAKE> | ||
<TELL "How romantic!" CR>) | ||
(<VERB? EXAMINE> | ||
<COND %<COND (<==? ,ZORK-NUMBER 1> | ||
'(<EQUAL? ,HERE <LOC ,MIRROR-1> <LOC ,MIRROR-2>> | ||
<TELL | ||
"Your image in the mirror looks tired." CR>)) | ||
(T | ||
'(<NULL-F> <RTRUE>))> | ||
(T | ||
<TELL | ||
"That's difficult unless your eyes are prehensile." CR>)>)>> | ||
|
||
<OBJECT ADVENTURER | ||
(SYNONYM ADVENTURER) | ||
(DESC "cretin") | ||
(FLAGS NDESCBIT INVISIBLE SACREDBIT ACTORBIT) | ||
(STRENGTH 0) | ||
(ACTION 0)> | ||
|
||
<OBJECT PATHOBJ | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM PASSAGE CRAWLWAY TRAIL PATH) | ||
(ADJECTIVE FOREST NARROW LONG WINDING) | ||
(DESC "way") | ||
(FLAGS NDESCBIT) | ||
(ACTION PATH-OBJECT)> | ||
|
||
<ROUTINE PATH-OBJECT () | ||
<COND (<VERB? TAKE FOLLOW> | ||
<TELL "You must specify a direction to go." CR>) | ||
(<VERB? FIND> | ||
<TELL "I can't help you there...." CR>) | ||
(<VERB? DIG> | ||
<TELL "Not a chance." CR>)>> | ||
|
||
<OBJECT ZORKMID | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM ZORKMID) | ||
(DESC "zorkmid") | ||
(ACTION ZORKMID-FUNCTION)> | ||
|
||
<ROUTINE ZORKMID-FUNCTION () | ||
<COND (<VERB? EXAMINE> | ||
<TELL | ||
"The zorkmid is the unit of currency of the Great Underground Empire." CR>) | ||
(<VERB? FIND> | ||
<TELL | ||
"The best way to find zorkmids is to go out and look for them." CR>)>> | ||
|
||
<OBJECT HANDS | ||
(IN GLOBAL-OBJECTS) | ||
(SYNONYM PAIR HANDS HAND) | ||
(ADJECTIVE BARE) | ||
(DESC "pair of hands") | ||
(FLAGS NDESCBIT TOOLBIT)> |
Oops, something went wrong.