aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhistoricalsource <historicalsoftware@textfiles.com>2019-04-13 20:20:29 -0400
committerhistoricalsource <historicalsoftware@textfiles.com>2019-04-13 20:20:29 -0400
commit47fbe00ae6b65b82283e9712feed8b5e8e5f5f87 (patch)
treeb9dc735b2720a4e441c0b799824cd9d077782f3f
downloadcutthroats-47fbe00ae6b65b82283e9712feed8b5e8e5f5f87.tar.gz
cutthroats-47fbe00ae6b65b82283e9712feed8b5e8e5f5f87.tar.bz2
cutthroats-47fbe00ae6b65b82283e9712feed8b5e8e5f5f87.zip
Revision 23 (Original Source)
-rw-r--r--README.md1
-rw-r--r--boat.zap916
-rw-r--r--boat.zil1422
-rw-r--r--clock.zap98
-rw-r--r--clock.zil108
-rw-r--r--events.zap1392
-rw-r--r--events.zil1629
-rw-r--r--globals.zap1313
-rw-r--r--globals.zil1651
-rw-r--r--goal.zap528
-rw-r--r--goal.zil746
-rw-r--r--island.zap1670
-rw-r--r--island.zil2520
-rw-r--r--macros.zap33
-rw-r--r--macros.zil145
-rw-r--r--main.zap481
-rw-r--r--main.zil581
-rw-r--r--parser.zap1521
-rw-r--r--parser.zil1494
-rw-r--r--people.zap1905
-rw-r--r--people.zil2313
-rw-r--r--syntax.zap2
-rw-r--r--syntax.zil821
-rw-r--r--toa.xzap49
-rw-r--r--toa.zap46
-rw-r--r--toa.zil67
-rw-r--r--toa.zipbin0 -> 112558 bytes
-rw-r--r--toadat.zap14265
-rw-r--r--toafreq.xzap200
-rw-r--r--toastr.zap471
-rw-r--r--verbs.zap3557
-rw-r--r--verbs.zil3337
-rw-r--r--wrecks.zap1531
-rw-r--r--wrecks.zil1925
34 files changed, 48738 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7154115
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# cutthroats
diff --git a/boat.zap b/boat.zap
new file mode 100644
index 0000000..e39d9d8
--- /dev/null
+++ b/boat.zap
@@ -0,0 +1,916 @@
+
+
+ .FUNCT FERRY-F
+ EQUAL? PRSA,V?CLIMB-ON,V?THROUGH,V?BOARD \?ELS5
+ IN? FERRY,FERRY-LANDING \?ELS10
+ EQUAL? HERE,FERRY-LANDING \?ELS15
+ CALL TELL-CANT-BOARD
+ RSTACK
+?ELS15: CALL TELL-YOURE-NOT,STR?303
+ RSTACK
+?ELS10: PRINTR "It's not at the landing. Be patient."
+?ELS5: EQUAL? PRSA,V?WALK-TO \?ELS23
+ EQUAL? HERE,FERRY-LANDING /?ELS23
+ CALL TELL-SHD-DIR
+ RSTACK
+?ELS23: EQUAL? PRSA,V?LISTEN \FALSE
+ PRINTR "You hear its engines."
+
+
+ .FUNCT TELL-CANT-BOARD
+ CALL TELL-DONT-HAVE,STR?304
+ RSTACK
+
+
+ .FUNCT GLOBAL-FERRY-F
+ EQUAL? PRSA,V?FIND,V?TELL,V?ASK-ABOUT /FALSE
+ CALL GLOBAL-NOT-HERE-PRINT,GLOBAL-FERRY
+ RSTACK
+
+
+ .FUNCT MM-FORE-DECK-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ CALL TELL-FORE-END,SALVAGER
+ RSTACK
+
+
+ .FUNCT TELL-FORE-END,OBJ
+ PRINTI "You are at the fore end of the "
+ CALL DPRINT,OBJ
+ PRINTR ". You can see the ocean over the rail that runs around the deck. A ladder leads below deck, and the wheelhouse is aft of you. A chair is bolted to the deck."
+
+
+ .FUNCT DECK-CHAIR-F,RARG=0
+ EQUAL? RARG,M-OBJDESC \?ELS5
+ IN? PETE,DECK-CHAIR \TRUE
+ CALL TELL-IN-CHAIR,PETE
+ RTRUE
+?ELS5: ZERO? RARG \FALSE
+ EQUAL? PRSA,V?EXAMINE \?ELS15
+ PRINTI "This weatherbeaten chair is used by a lookout while standing watch. It faces forward and is bolted to the deck. "
+ IN? PETE,DECK-CHAIR \?CND18
+ CALL TELL-IN-CHAIR,PETE
+?CND18: CRLF
+ RTRUE
+?ELS15: EQUAL? PRSA,V?ASK-ABOUT \?ELS22
+ PRINTR """It's the lookout's chair."""
+?ELS22: EQUAL? PRSA,V?PUT-ON,V?PUT \?ELS26
+ EQUAL? PRSI,DECK-CHAIR \?ELS26
+ CALL IDROP
+ ZERO? STACK /TRUE
+ IN? PLAYER,DECK-CHAIR \?CND32
+ LOC DECK-CHAIR
+ MOVE PRSO,STACK
+?CND32: PRINTR "It slides off the chair and onto the deck."
+?ELS26: EQUAL? PRSA,V?BOARD \FALSE
+ IN? PETE,DECK-CHAIR \FALSE
+ CALL TELL-ALREADY,STR?305
+ RSTACK
+
+
+ .FUNCT TELL-IN-CHAIR,OCC
+ CALL START-SENTENCE,OCC
+ PRINTR " is sitting in the chair."
+
+
+ .FUNCT MM-PORT-DECK-F,RARG,DOCK?
+ EQUAL? RARG,M-ENTER \?ELS5
+ MOVE BUNK,MM-CREW-QTRS
+ MOVE UNDER-BUNK,MM-CREW-QTRS
+ MOVE STOVE,MM-GALLEY
+ MOVE DECK-CHAIR,MM-FORE-DECK
+ MOVE REDS-BUNK,MM-CAPT-CABIN
+ MOVE LOUNGE-CHAIR,MM-LOUNGE
+ IN? PETE,MM-GALLEY \?CND6
+ MOVE FOOD,STOVE
+ FSET FOOD,NDESCBIT
+?CND6: ZERO? WATER-DELIVERED /FALSE
+ EQUAL? SHIP-CHOSEN,SALVAGER \FALSE
+ MOVE DRINKING-WATER,MM-GALLEY
+ FSET DRINKING-WATER,NDESCBIT
+ RFALSE
+?ELS5: EQUAL? RARG,M-LOOK \FALSE
+ CALL TELL-FOO-SIDE,SALVAGER,STR?184,STR?183
+ RTRUE
+
+
+ .FUNCT TELL-FOO-SIDE,OBJ,SIDE,HOUSE,DOCK?
+ PRINTI "You are on the "
+ PRINT SIDE
+ PRINTI " side of the "
+ CALL DPRINT,OBJ
+ PRINTI ", a sturdy vessel designed for "
+ EQUAL? OBJ,TRAWLER \?ELS5
+ PRINTI "trawling"
+ JUMP ?CND3
+?ELS5: PRINTI "deep-sea salvaging"
+?CND3: PRINTI ". To "
+ PRINT HOUSE
+ PRINTI " is a small wheelhouse, while "
+ EQUAL? OBJ,TRAWLER \?ELS16
+ SET 'DOCK?,TRAWLER-DOCKED
+ JUMP ?CND14
+?ELS16: SET 'DOCK?,SALVAGER-DOCKED
+?CND14: ZERO? DOCK? /?ELS23
+ PRINTI "to "
+ PRINT SIDE
+ PRINTR " is the gangway leading to the dock. The gentle rocking of the boat in port reminds you of time spent on the open sea."
+?ELS23: PRINTI "the ocean, with its blue-green waves crashing, lies off the "
+ PRINT SIDE
+ PRINTR " rail."
+
+
+ .FUNCT TELL-AFT-DECK
+ PRINTI "The smell of diesel fuel is strong but reassuring here on the aft deck. A ladder leads below deck, while forward you can see the entrance to the command center of the boat, the wheelhouse."
+ RTRUE
+
+
+ .FUNCT MM-AFT-DECK-F,RARG
+ EQUAL? RARG,M-LOOK \?ELS5
+ CALL TELL-AFT-DECK
+ PRINTR " A huge air compressor is bolted to the deck by the aft rail."
+?ELS5: EQUAL? RARG,M-BEG \?ELS9
+ EQUAL? PRSA,V?WALK \FALSE
+ IN? AIR-HOSE,DEEP-SUIT \FALSE
+ IN? DEEP-SUIT,PLAYER \FALSE
+ PRINTI "You don't want to drag the "
+ CALL DPRINT,AIR-HOSE
+ PRINTR " around the boat."
+?ELS9: EQUAL? RARG,M-FLASH \FALSE
+ IN? WEASEL,MM-AFT-DECK \FALSE
+ ZERO? AT-SEA /FALSE
+ ZERO? WEASEL-APPREHENDED \FALSE
+ CALL QUEUED?,I-PENDULUM
+ ZERO? STACK \FALSE
+ CALL QUEUE,I-PENDULUM,-1
+ PUT STACK,0,1
+ CALL TELL-WEASEL-TOSSES
+ RSTACK
+
+
+ .FUNCT TELL-WEASEL-TOSSES
+ FCLEAR LINE-HACK,INVISIBLE
+ LOC WEASEL
+ MOVE LINE-HACK,STACK
+ PRINTI "The Weasel tosses a line over the side and says, "
+ PRINT LINE-STR
+ CRLF
+ RTRUE
+
+
+ .FUNCT LINE-HACK-F,HOLDER=0
+ LOC LINE-HACK
+ IN? WEASEL,STACK \?ELS3
+ SET 'HOLDER,WEASEL
+ JUMP ?CND1
+?ELS3: LOC LINE-HACK
+ IN? JOHNNY,STACK \?CND1
+ SET 'HOLDER,JOHNNY
+?CND1: EQUAL? PRSA,V?EXAMINE \?ELS10
+ ZERO? HOLDER /?ELS15
+ CALL START-SENTENCE,HOLDER
+ PRINTI " is holding one end of a weighted "
+ CALL DPRINT,LINE-HACK
+ PRINTR "."
+?ELS15: PRINTI "One end of "
+ CALL APRINT,LINE-HACK
+ PRINTR " is here. Leave it alone."
+?ELS10: EQUAL? PRSA,V?ASK-ABOUT,V?FIND /FALSE
+ ZERO? HOLDER /?ELS31
+ CALL START-SENTENCE,HOLDER
+ PRINTR " pulls it away. ""Don't mess with that!"""
+?ELS31: PRINTR "Leave it alone."
+
+
+ .FUNCT MM-COMPRESSOR-F,TICK
+ EQUAL? PRSA,V?CLOSE,V?OPEN \?ELS5
+ CALL TELL-NO-NO
+ RSTACK
+?ELS5: EQUAL? PRSA,V?PUT \?ELS7
+ EQUAL? PRSI,MM-COMPRESSOR \?ELS7
+ PRINTR "There's no place to put it."
+?ELS7: EQUAL? PRSA,V?EXAMINE \?ELS13
+ PRINTI "The large, gasoline-powered air compressor is "
+ FSET? MM-COMPRESSOR,ONBIT \?ELS18
+ PRINTI "on"
+ JUMP ?CND16
+?ELS18: PRINTI "off"
+?CND16: PRINTI ". You can quickly see it "
+ CALL INT,I-MM-COMPRESSOR
+ GET STACK,C-TICK >TICK
+ ZERO? TICK \?ELS29
+ PRINTI "is out of fuel"
+ JUMP ?CND27
+?ELS29: EQUAL? TICK,80 \?ELS36
+ PRINTI "has"
+ JUMP ?CND34
+?ELS36: PRINTI "started with"
+?CND34: PRINTI " fuel for an hour and a half's operation"
+?CND27: PRINTI ". A retractable "
+ CALL DPRINT,AIR-HOSE
+ PRINTR " is built in."
+?ELS13: EQUAL? PRSA,V?LAMP-ON \?ELS48
+ FSET? MM-COMPRESSOR,ONBIT \?ELS53
+ CALL TELL-ALREADY,STR?56
+ RSTACK
+?ELS53: CALL INT,I-MM-COMPRESSOR
+ PUT STACK,0,1
+ FSET MM-COMPRESSOR,ONBIT
+ PRINTR "Okay. The compressor is on."
+?ELS48: EQUAL? PRSA,V?LAMP-OFF \?ELS59
+ FSET? MM-COMPRESSOR,ONBIT \?ELS64
+ CALL INT,I-MM-COMPRESSOR
+ PUT STACK,0,0
+ FCLEAR MM-COMPRESSOR,ONBIT
+ CALL TELL-NOW,MM-COMPRESSOR,STR?264
+ RSTACK
+?ELS64: CALL TELL-ALREADY,STR?264
+ RSTACK
+?ELS59: EQUAL? PRSA,V?LISTEN \FALSE
+ FSET? MM-COMPRESSOR,ONBIT \FALSE
+ PRINTR "The compressor is making a steady loud noise."
+
+
+ .FUNCT AIR-HOSE-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ IN? AIR-HOSE,DEEP-SUIT \?ELS10
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS15
+ PRINTI "This "
+ CALL DPRINT,AIR-HOSE
+ PRINTI " goes from the aft deck of the "
+ CALL DPRINT,SALVAGER
+ PRINTR " and ends at your diving suit. Without it, you would find breathing impossible."
+?ELS15: PRINTI "It connects the "
+ CALL DPRINT,DEEP-SUIT
+ PRINTI " and the "
+ CALL DPRINT,MM-COMPRESSOR
+ PRINTI " "
+ EQUAL? HERE,MM-AFT-DECK \?ELS24
+ PRINTI "here"
+ JUMP ?CND22
+?ELS24: PRINTI "on the aft deck"
+?CND22: PRINTR "."
+?ELS10: PRINTI "It is designed to be connected to a "
+ CALL DPRINT,DEEP-SUIT
+ PRINTR " to provide air and is about 600 feet long."
+?ELS5: EQUAL? PRSA,V?TIE,V?PUT \?ELS38
+ EQUAL? PRSI,DEEP-SUIT /?THN41
+ EQUAL? PRSO,DEEP-SUIT \?ELS38
+?THN41: IN? AIR-HOSE,DEEP-SUIT \?ELS47
+ CALL TELL-ALREADY,STR?308
+ RSTACK
+?ELS47: MOVE AIR-HOSE,DEEP-SUIT
+ CALL TELL-NOW,AIR-HOSE,CONNECT-STR
+ RSTACK
+?ELS38: EQUAL? PRSA,V?TAKE \?ELS51
+ IN? AIR-HOSE,DEEP-SUIT \?ELS56
+ CALL TELL-ALREADY,CONNECT-STR
+ RSTACK
+?ELS56: PRINTI "Why drag it around? Just connect it to the "
+ CALL DPRINT,DEEP-SUIT
+ PRINTR "."
+?ELS51: EQUAL? PRSA,V?TIE \?ELS62
+ CALL TELL-YOU-CANT,STR?309
+ RSTACK
+?ELS62: EQUAL? PRSA,V?UNTIE \?ELS64
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS69
+ CALL JIGS-UP,STR?310
+ RSTACK
+?ELS69: MOVE AIR-HOSE,MM-COMPRESSOR
+ PRINTR "The hose retracts back to the compressor."
+?ELS64: EQUAL? PRSA,V?MOVE \?ELS75
+ PRINTR "That was fun."
+?ELS75: EQUAL? PRSA,V?CLIMB-FOO \FALSE
+ CALL TELL-YOU-CANT,STR?311
+ RSTACK
+
+
+ .FUNCT TELL-WHEELHOUSE,OBJ
+ PRINTI " Through the glass windows you see the "
+ ZERO? AT-SEA /?ELS7
+ PRINTR "ocean churning all around you."
+?ELS7: CALL DPRINT,OBJ
+ PRINTR " docked at the wharf, and the island stretching aft. Forward, you see the choppy waters of the bay."
+
+
+ .FUNCT MM-WHEELHOUSE-F,RARG
+ EQUAL? RARG,M-LOOK \?ELS5
+ PRINTI "You are in the wheelhouse with a passageway leading out onto the deck abaft. You can see the "
+ CALL DPRINT,MM-COMPRESSOR
+ PRINTI " sitting there, taking up most of the aft deck."
+ CALL TELL-WHEELHOUSE,TRAWLER
+ RTRUE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? OCEAN,PRSO,PRSI \FALSE
+ EQUAL? PRSA,V?EXAMINE \?ELS19
+ PRINTR "You see the ocean through the window."
+?ELS19: EQUAL? PRSA,V?ASK-ABOUT,V?FIND /FALSE
+ CALL TELL-YOU-CANT,STR?313
+ RSTACK
+
+
+ .FUNCT COMPRESSOR-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?314
+ RTRUE
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS7
+ CALL TELL-YOU-CANT,STR?315
+ RSTACK
+?ELS7: CALL TELL-CANT-REACH,STR?316
+ RSTACK
+
+
+ .FUNCT MM-LOCKER-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "You are in a relatively empty locker."
+ PRINT SPARE-PARTS-STR
+ CRLF
+ RTRUE
+
+
+ .FUNCT METAL-DETECTOR-F,TMP
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTI "The "
+ CALL DPRINT,METAL-DETECTOR
+ PRINTI "'s label is well-worn. It has a "
+ CALL DPRINT,DETECTOR-SWITCH
+ PRINTI " which is currently "
+ ZERO? DETECTOR-ON /?ELS10
+ PRINTI "on"
+ JUMP ?CND8
+?ELS10: PRINTI "off"
+?CND8: PRINTI ", and a compartment on the side which is "
+ FSET? DETECTOR-COMPARTMENT,OPENBIT \?ELS22
+ PRINTI "open"
+ FIRST? DETECTOR-COMPARTMENT >TMP \?CND20
+ PRINTI " and contains "
+ CALL APRINT,TMP
+ JUMP ?CND20
+?ELS22: PRINTI "closed"
+?CND20: PRINTR "."
+?ELS5: EQUAL? PRSA,V?LAMP-ON \?ELS37
+ SET 'DETECTOR-ON,TRUE-VALUE
+ CALL TELL-SWITCH,STR?56
+ RTRUE
+?ELS37: EQUAL? PRSA,V?LAMP-OFF \?ELS39
+ SET 'DETECTOR-ON,FALSE-VALUE
+ CALL TELL-SWITCH,STR?264
+ RTRUE
+?ELS39: EQUAL? PRSA,V?LISTEN \?ELS41
+ CALL DETECTOR-NOISE,TRUE-VALUE
+ RTRUE
+?ELS41: EQUAL? PRSA,V?PUT \?ELS43
+ EQUAL? PRSI,METAL-DETECTOR \?ELS43
+ CALL PERFORM,V?PUT,PRSO,DETECTOR-COMPARTMENT
+ RTRUE
+?ELS43: EQUAL? PRSA,V?EMPTY,V?CLOSE,V?OPEN \?ELS47
+ CALL PERFORM,PRSA,DETECTOR-COMPARTMENT
+ SET 'P-IT-OBJECT,METAL-DETECTOR
+ RTRUE
+?ELS47: EQUAL? PRSA,V?LOOK-INSIDE \?ELS49
+ CALL PERFORM,V?EXAMINE,DETECTOR-COMPARTMENT
+ SET 'P-IT-OBJECT,METAL-DETECTOR
+ RTRUE
+?ELS49: EQUAL? PRSA,V?SHAKE \FALSE
+ FSET? DETECTOR-COMPARTMENT,OPENBIT \?ELS54
+ FIRST? DETECTOR-COMPARTMENT \?ELS54
+ MOVE DRY-CELL,HERE
+ SET 'DETECTOR-POWERED,FALSE-VALUE
+ PRINTI "The "
+ CALL DPRINT,DRY-CELL
+ PRINTR " falls out of the machine."
+?ELS54: PRINTR "Nothing happens."
+
+
+ .FUNCT DETECTOR-LABEL-F
+ EQUAL? PRSA,V?TAKE \FALSE
+ PRINTR "You tug at it, but it can't be pulled off."
+
+
+ .FUNCT DETECTOR-SWITCH-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ ZERO? DETECTOR-ON /?ELS8
+ CALL TELL-SWITCH,STR?56
+ RTRUE
+?ELS8: CALL TELL-SWITCH,STR?264
+ RTRUE
+?ELS5: EQUAL? PRSA,V?LAMP-ON \?ELS13
+ CALL PERFORM,V?LAMP-ON,METAL-DETECTOR
+ SET 'P-IT-OBJECT,DETECTOR-SWITCH
+ RTRUE
+?ELS13: EQUAL? PRSA,V?LAMP-OFF \?ELS15
+ CALL PERFORM,V?LAMP-OFF,METAL-DETECTOR
+ SET 'P-IT-OBJECT,DETECTOR-SWITCH
+ RTRUE
+?ELS15: EQUAL? PRSA,V?THROW,V?MOVE,V?TURN \FALSE
+ ZERO? DETECTOR-ON /?ELS20
+ CALL PERFORM,V?LAMP-OFF,METAL-DETECTOR
+ JUMP ?CND18
+?ELS20: CALL PERFORM,V?LAMP-ON,METAL-DETECTOR
+?CND18: SET 'P-IT-OBJECT,DETECTOR-SWITCH
+ RTRUE
+
+
+ .FUNCT DETECTOR-COMPARTMENT-F,RARG=0
+ EQUAL? RARG,M-CONT \?ELS5
+ EQUAL? PRSA,V?TAKE \FALSE
+ EQUAL? PRSO,DRY-CELL \FALSE
+ CALL ITAKE
+ ZERO? STACK /TRUE
+ PRINTI "Taken."
+ CRLF
+ ZERO? DETECTOR-POWERED /TRUE
+ SET 'DETECTOR-POWERED,FALSE-VALUE
+ RTRUE
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE,V?EXAMINE \?ELS23
+ FSET? DETECTOR-COMPARTMENT,OPENBIT \?ELS26
+ PRINTI "The compartment is on the side of the machine. Inside "
+ FIRST? DETECTOR-COMPARTMENT \?ELS31
+ PRINTI "is a connected"
+ JUMP ?CND29
+?ELS31: PRINTI "are connections for a"
+?CND29: PRINTI " nine-volt "
+ CALL DPRINT,DRY-CELL
+ PRINTR "."
+?ELS26: CALL TELL-CLOSED,STR?319
+ RTRUE
+?ELS23: EQUAL? PRSA,V?PUT \?ELS43
+ EQUAL? PRSO,DETECTOR-COMPARTMENT /FALSE
+ FSET? DETECTOR-COMPARTMENT,OPENBIT /?ELS50
+ CALL TELL-CLOSED,STR?320
+ RSTACK
+?ELS50: EQUAL? PRSO,DRY-CELL \?ELS52
+ MOVE DRY-CELL,DETECTOR-COMPARTMENT
+ FSET? DRY-CELL,RMUNGBIT /?CND53
+ SET 'DETECTOR-POWERED,TRUE-VALUE
+?CND53: PRINTI "The "
+ CALL DPRINT,DRY-CELL
+ PRINTR " fits snugly inside."
+?ELS52: PRINTR "Unfortunately, it doesn't fit."
+?ELS43: EQUAL? PRSA,V?OPEN \?ELS63
+ IN? DRY-CELL,DETECTOR-COMPARTMENT \?ELS63
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS63
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK \?ELS63
+ FSET DRY-CELL,RMUNGBIT
+ SET 'DETECTOR-POWERED,FALSE-VALUE
+ RFALSE
+?ELS63: EQUAL? PRSA,V?EMPTY \FALSE
+ FSET? DETECTOR-COMPARTMENT,OPENBIT \FALSE
+ SET 'DETECTOR-POWERED,FALSE-VALUE
+ RFALSE
+
+
+ .FUNCT DEEP-SUIT-F
+ EQUAL? PRSA,V?CLOSE,V?OPEN \?ELS5
+ CALL TELL-NO-NO
+ RSTACK
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS7
+ PRINTI "This "
+ CALL DPRINT,DEEP-SUIT
+ PRINTR " is bulky on land, but underwater it will protect you to 500 feet. It has a hood with ""viewport"" and a connection for a compressor hose."
+?ELS7: EQUAL? PRSA,V?PUT \?ELS11
+ EQUAL? PRSI,DEEP-SUIT \?ELS11
+ EQUAL? PRSO,AIR-HOSE /?ELS11
+ CALL TELL-NO-NO
+ RSTACK
+?ELS11: EQUAL? PRSA,V?WEAR \?ELS15
+ FSET? WET-SUIT,WORNBIT \?ELS15
+ CALL TELL-NO-FIT,STR?321
+ RSTACK
+?ELS15: EQUAL? PRSA,V?DISEMBARK,V?THROW,V?DROP \FALSE
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \FALSE
+ CALL JIGS-UP,STR?322
+ RSTACK
+
+
+ .FUNCT MM-CREW-QTRS-F,RARG,W
+ EQUAL? RARG,M-LOOK \?ELS5
+ CALL TELL-CREW-QTRS
+ RTRUE
+?ELS5: EQUAL? RARG,M-ENTER \FALSE
+ CALL MOVE-SHARED-OBJECTS,MM-CREW-QTRS
+ RFALSE
+
+
+ .FUNCT BUNK-F,RARG=0,F
+ ZERO? RARG \FALSE
+ EQUAL? PRSA,V?SLEEP,V?BOARD \?ELS10
+ FIRST? BUNK >F \?ELS16
+ EQUAL? F,PLAYER \?THN13
+?ELS16: CALL WEARING-SOMETHING?
+ ZERO? STACK /?ELS10
+?THN13: CALL TELL-NOT-COMFORTABLE
+ RSTACK
+?ELS10: EQUAL? PRSA,V?HIDE-UNDER,V?PUT-UNDER \?ELS18
+ EQUAL? PRSO,GLOBAL-SELF,ME \?ELS23
+ PRINTR "You won't fit."
+?ELS23: GETP PRSO,P?SIZE
+ LESS? STACK,5 \?ELS27
+ FIRST? UNDER-BUNK \?ELS32
+ CALL TELL-NO-FIT
+ RSTACK
+?ELS32: MOVE PRSO,UNDER-BUNK
+ FSET PRSO,NDESCBIT
+ CALL TELL-NOW,PRSO,STR?323
+ RSTACK
+?ELS27: CALL TELL-NO-FIT
+ RSTACK
+?ELS18: EQUAL? PRSA,V?LOOK-UNDER \FALSE
+ FIRST? UNDER-BUNK >F \?ELS43
+ SET 'P-IT-OBJECT,F
+ PRINTI "There is "
+ CALL APRINT,F
+ PRINTR " under the mattress."
+?ELS43: PRINTR "Nobody's hidden his life savings there."
+
+
+ .FUNCT WEARING-SOMETHING?,F
+ FIRST? PLAYER >F /?KLU12
+?KLU12:
+?PRG1: ZERO? F /FALSE
+ FSET? F,WORNBIT \?ELS7
+ EQUAL? F,WATCH \TRUE
+?ELS7: NEXT? F >F /?KLU13
+?KLU13: JUMP ?PRG1
+
+
+ .FUNCT UNDER-BUNK-F,RARG=0
+ EQUAL? RARG,M-OBJDESC /TRUE
+ EQUAL? RARG,M-CONT \FALSE
+ EQUAL? PRSA,V?TAKE \FALSE
+ FCLEAR PRSO,NDESCBIT
+ RFALSE
+
+
+ .FUNCT BUNKS-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?324
+ RTRUE
+?ELS5: PRINTR "The only bunk you should worry about is your own."
+
+
+ .FUNCT MM-GALLEY-F,RARG
+ CALL GENERIC-GALLEY-F,RARG,MM-GALLEY
+ RSTACK
+
+
+ .FUNCT GENERIC-GALLEY-F,RARG,PLACE,?TMP1
+ EQUAL? RARG,M-ENTER \?ELS5
+ PUTP GLOBAL-SURFACE,P?SDESC,STR?36
+ CALL MOVE-SHARED-OBJECTS,PLACE
+ RFALSE
+?ELS5: EQUAL? RARG,M-LOOK \?ELS7
+ PRINTI "You are in the "
+ EQUAL? PLACE,MM-GALLEY \?ELS12
+ CALL DPRINT,SALVAGER
+ JUMP ?CND10
+?ELS12: CALL DPRINT,TRAWLER
+?CND10: PRINTI "'s galley. A stove and a small table are the fixtures here."
+ IN? FOOD,STOVE \?CND21
+ CALL TELL-STEW-ON
+?CND21: ZERO? WATER-DELIVERED /?CND24
+ GETP SHIP-CHOSEN,P?LINE >?TMP1
+ GETP PLACE,P?LINE
+ EQUAL? ?TMP1,STACK \?CND24
+ PRINTI " Water is available."
+?CND24: PRINTR " A ladder leads up through the deck to the wheelhouse for feeding the captain in rough weather."
+?ELS7: EQUAL? RARG,M-BEG \FALSE
+ CALL DOUBLE-DUTY-CHECK
+ ZERO? STACK \TRUE
+ RFALSE
+
+
+ .FUNCT DOUBLE-DUTY-CHECK
+ EQUAL? PRSA,V?ASK-FOR \FALSE
+ EQUAL? PRSO,PETE \FALSE
+ EQUAL? PRSI,FOOD \?ELS12
+ ZERO? SOUPS-ON /?ELS17
+ PRINTI """Take some "
+ CALL DPRINT,GLOBAL-SELF
+ PRINTR "."""
+?ELS17: PRINTR """Wait 'til it's ready."""
+?ELS12: EQUAL? PRSI,DRINKING-WATER \FALSE
+ PRINTI """Take it "
+ CALL DPRINT,GLOBAL-SELF
+ PRINTR "."""
+
+
+ .FUNCT TELL-STEW-ON,LEAD?=1
+ ZERO? LEAD? /?CND1
+ PRINTI " "
+?CND1: PRINTI "A pot of stew is simmering on the stove."
+ RTRUE
+
+
+ .FUNCT STOVE-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTI "The small stove rests on gimbals that keep it relatively level."
+ IN? FOOD,STOVE \?CND8
+ CALL TELL-STEW-ON
+?CND8: CRLF
+ RTRUE
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE \?ELS12
+ IN? FOOD,STOVE \?ELS12
+ CALL TELL-STEW-ON,FALSE-VALUE
+ CRLF
+ RTRUE
+?ELS12: EQUAL? PRSA,V?LAMP-OFF,V?LAMP-ON \FALSE
+ PRINTR "That's Pete's job."
+
+
+ .FUNCT MM-LOUNGE-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ PUTP GLOBAL-SURFACE,P?SDESC,STR?36
+ CALL MOVE-SHARED-OBJECTS,MM-LOUNGE
+ RFALSE
+
+
+ .FUNCT LOUNGE-CHAIR-F,RARG=0,F
+ EQUAL? PRSO,CHAIR \FALSE
+ EQUAL? PRSA,V?BOARD \FALSE
+ FIRST? CHAIR >F \FALSE
+ CALL TELL-NOT-COMFORTABLE
+ RSTACK
+
+
+ .FUNCT REDS-BUNK-F
+ EQUAL? PRSA,V?SIT,V?SLEEP,V?BOARD /?THN6
+ EQUAL? PRSA,V?HIDE-UNDER,V?PUT-UNDER,V?SIT-ON /?THN6
+ EQUAL? PRSA,V?PUT \?ELS5
+ EQUAL? PRSI,REDS-BUNK \?ELS5
+?THN6: PRINTR "You know better than to disturb the captain's bunk!"
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE \FALSE
+ PRINTR "It's shipshape."
+
+
+ .FUNCT MM-ENGINE-ROOM-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "You are in a tiny cabin with barely enough room to breathe. By your feet lie the huge diesel engines of the "
+ CALL DPRINT,SALVAGER
+ PRINTR "."
+
+
+ .FUNCT ENGINE-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?328
+ RTRUE
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS7
+ PRINTR "The engines are extremely complex and delicate pieces of machinery."
+?ELS7: EQUAL? PRSA,V?PLUG,V?LAMP-OFF,V?LAMP-ON \?ELS11
+ PRINTI "Leave the engines to "
+ CALL DPRINT,WEASEL
+ PRINTR " and he'll leave the diving to you."
+?ELS11: EQUAL? PRSA,V?ASK-ABOUT \?ELS15
+ EQUAL? PRSO,WEASEL \?ELS15
+ PRINTR """These are in pretty good shape."""
+?ELS15: EQUAL? PRSA,V?LISTEN \FALSE
+ ZERO? AT-SEA /FALSE
+ CALL TELL-YOU-CANT,STR?329
+ RSTACK
+
+
+ .FUNCT NW-FORE-DECK-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ CALL TELL-FORE-END,TRAWLER
+ RSTACK
+
+
+ .FUNCT NW-STARBOARD-DECK-F,RARG
+ EQUAL? RARG,M-ENTER \?ELS5
+ MOVE BUNK,NW-CREW-QTRS
+ MOVE UNDER-BUNK,NW-CREW-QTRS
+ MOVE STOVE,NW-GALLEY
+ MOVE DECK-CHAIR,NW-FORE-DECK
+ MOVE REDS-BUNK,NW-CAPT-CABIN
+ MOVE LOUNGE-CHAIR,NW-LOUNGE
+ IN? PETE,NW-GALLEY \?CND6
+ MOVE FOOD,STOVE
+ FSET FOOD,NDESCBIT
+?CND6: ZERO? WATER-DELIVERED /FALSE
+ EQUAL? TRAWLER,SHIP-CHOSEN \FALSE
+ MOVE DRINKING-WATER,NW-GALLEY
+ FSET DRINKING-WATER,NDESCBIT
+ RFALSE
+?ELS5: EQUAL? RARG,M-LOOK \FALSE
+ CALL TELL-FOO-SIDE,TRAWLER,STR?183,STR?184
+ RTRUE
+
+
+ .FUNCT NW-AFT-DECK-F,RARG
+ EQUAL? RARG,M-LOOK \?ELS5
+ CALL TELL-AFT-DECK
+ CRLF
+ RTRUE
+?ELS5: EQUAL? RARG,M-FLASH \FALSE
+ IN? WEASEL,NW-AFT-DECK \FALSE
+ ZERO? AT-SEA /FALSE
+ ZERO? WEASEL-APPREHENDED \FALSE
+ CALL QUEUED?,I-PENDULUM
+ ZERO? STACK \FALSE
+ CALL QUEUE,I-PENDULUM,-1
+ PUT STACK,0,1
+ CALL TELL-WEASEL-TOSSES
+ RSTACK
+
+
+ .FUNCT NW-WHEELHOUSE-F,RARG
+ EQUAL? RARG,M-LOOK \?ELS5
+ PRINTI "You are in the wheelhouse of the "
+ CALL DPRINT,TRAWLER
+ PRINTI ". The passageway leading out onto the deck lies abaft."
+ CALL TELL-WHEELHOUSE,SALVAGER
+ RTRUE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? OCEAN,PRSO,PRSI \FALSE
+ EQUAL? PRSA,V?EXAMINE \?ELS19
+ PRINTR "You see the ocean through the window."
+?ELS19: CALL TELL-YOU-CANT,STR?313
+ RSTACK
+
+
+ .FUNCT NW-LOCKER-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "You are in a fairly empty storage locker. It must have been cleaned out after its last trawling expedition."
+ PRINT SPARE-PARTS-STR
+ CRLF
+ RTRUE
+
+
+ .FUNCT TELL-SWITCH,STR
+ PRINTI "The switch is now in the """
+ PRINT STR
+ PRINTR """ position."
+
+
+ .FUNCT DRILL-F,RARG=0
+ EQUAL? RARG,M-CONT \?ELS5
+ EQUAL? PRSA,V?TAKE \FALSE
+ EQUAL? PRSO,BATTERY \FALSE
+ CALL ITAKE
+ ZERO? STACK /TRUE
+ PRINTI "Taken."
+ ZERO? DRILL-POWERED /?CND18
+ SET 'DRILL-POWERED,FALSE-VALUE
+ ZERO? DRILL-ON /?CND18
+ CALL INT,I-DRILL
+ PUT STACK,0,0
+ PRINTI " The drill bit winds to a halt."
+?CND18: CRLF
+ RTRUE
+?ELS5: EQUAL? PRSA,V?LAMP-ON \?ELS29
+ EQUAL? PRSO,DRILL \?ELS29
+ ZERO? DRILL-ON /?ELS36
+ CALL TELL-ALREADY,STR?56
+ RSTACK
+?ELS36: ZERO? DRILL-POWERED /?ELS39
+ SET 'DRILL-ON,TRUE-VALUE
+ CALL INT,I-DRILL
+ PUT STACK,0,1
+ PRINTR "The drill bit begins to spin."
+?ELS39: SET 'DRILL-ON,TRUE-VALUE
+ CALL TELL-SWITCH,STR?56
+ RSTACK
+?ELS29: EQUAL? PRSA,V?LAMP-OFF \?ELS46
+ EQUAL? PRSO,DRILL \?ELS46
+ ZERO? DRILL-ON \?ELS53
+ CALL TELL-ALREADY,STR?264
+ RSTACK
+?ELS53: ZERO? DRILL-POWERED /?ELS55
+ SET 'DRILL-ON,FALSE-VALUE
+ CALL INT,I-DRILL
+ PUT STACK,0,0
+ PRINTR "The drill bit stops spinning."
+?ELS55: SET 'DRILL-ON,FALSE-VALUE
+ CALL TELL-SWITCH,STR?264
+ RSTACK
+?ELS46: EQUAL? PRSA,V?EXAMINE \?ELS62
+ PRINTI "This waterproof wonder features a permanent bit"
+ CALL QUEUED?,I-DRILL
+ ZERO? STACK /?CND65
+ PRINTI " which is turning"
+?CND65: PRINTI ", a panel which is "
+ FSET? DRILL,OPENBIT \?ELS74
+ PRINTI "open"
+ ZERO? DRILL-POWERED /?ELS79
+ PRINTI " with a C battery inside"
+ JUMP ?CND72
+?ELS79: PRINTI ", revealing space for a C battery"
+ JUMP ?CND72
+?ELS74: PRINTI "closed"
+?CND72: PRINTI ", and a switch which is in the """
+ ZERO? DRILL-ON /?ELS95
+ PRINTI "on"
+ JUMP ?CND93
+?ELS95: PRINTI "off"
+?CND93: PRINTR """ position."
+?ELS62: EQUAL? PRSA,V?LOOK-INSIDE \?ELS106
+ CALL PERFORM,V?EXAMINE,DRILL
+ RTRUE
+?ELS106: EQUAL? PRSA,V?OPEN \?ELS108
+ IN? BATTERY,DRILL \?ELS108
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS108
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK \?ELS108
+ FSET BATTERY,RMUNGBIT
+ SET 'DRILL-POWERED,FALSE-VALUE
+ RFALSE
+?ELS108: EQUAL? PRSI,DRILL \FALSE
+ EQUAL? PRSA,V?PUT \?ELS117
+ FSET? DRILL,OPENBIT /?ELS122
+ SET 'P-IT-OBJECT,DRILL
+ CALL TELL-CLOSED,STR?320
+ RSTACK
+?ELS122: EQUAL? PRSO,BATTERY \?ELS124
+ MOVE BATTERY,DRILL
+ FSET? BATTERY,RMUNGBIT \?CND125
+ CALL TELL-NOW,BATTERY,STR?332
+ RTRUE
+?CND125: SET 'DRILL-POWERED,TRUE-VALUE
+ ZERO? DRILL-ON /?ELS132
+ CALL INT,I-DRILL
+ PUT STACK,0,1
+ PRINTR "The drill bit starts spinning."
+?ELS132: CALL TELL-NOW,BATTERY,STR?332
+ RSTACK
+?ELS124: CALL TELL-NO-FIT
+ RSTACK
+?ELS117: EQUAL? PRSA,V?TELL,V?ASK-ABOUT,V?TAKE /FALSE
+ EQUAL? PRSA,V?PUT-ON,V?PUT-AGAINST /FALSE
+ ZERO? DRILL-ON /?THN148
+ ZERO? DRILL-POWERED \FALSE
+?THN148: EQUAL? PRSO,GLOBAL-TIME /FALSE
+ SET 'P-IT-OBJECT,DRILL
+ PRINTI "The "
+ CALL DPRINT,DRILL
+ PRINTR " isn't running!"
+
+
+ .FUNCT GENERIC-HOLE-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTR "As holes go, it's very nice."
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE \?ELS9
+ PRINTR "You see nothing new."
+?ELS9: EQUAL? PRSA,V?REACH-IN \FALSE
+ PRINTR "It's not that big."
+
+
+ .FUNCT ADD-HOLE,OBJ,I
+ FSET? HOLE-1,INVISIBLE \?ELS3
+ FCLEAR HOLE-1,INVISIBLE
+ MOVE HOLE-1,OBJ
+ JUMP ?CND1
+?ELS3: FSET? HOLE-2,INVISIBLE \?ELS5
+ FCLEAR HOLE-2,INVISIBLE
+ PUTP HOLE-1,P?SDESC,STR?335
+ MOVE HOLE-2,OBJ
+ JUMP ?CND1
+?ELS5: PRINTI "The drill should be dead now."
+ CRLF
+?CND1: CALL INT,I-DRILL >I
+ GET I,C-TICK
+ SUB STACK,1
+ PUT I,C-TICK,STACK
+ GET I,C-TICK
+ ZERO? STACK \TRUE
+ CALL I-DRILL
+ RTRUE
+
+
+ .FUNCT TELL-CREW-QTRS
+ PRINTR "You are below deck in the crew's quarters. Narrow, uncomfortable bunks line the bulkheads, and you note the similarity between this area and a sardine can. Sleeping here is necessary but uninviting. A ladder leads up and out to the fore deck."
+
+
+ .FUNCT NW-CREW-QTRS-F,RARG,W
+ EQUAL? RARG,M-LOOK \?ELS5
+ CALL TELL-CREW-QTRS
+ RSTACK
+?ELS5: EQUAL? RARG,M-ENTER \FALSE
+ CALL MOVE-SHARED-OBJECTS,NW-CREW-QTRS
+ RFALSE
+
+
+ .FUNCT NW-GALLEY-F,RARG
+ CALL GENERIC-GALLEY-F,RARG,NW-GALLEY
+ RSTACK
+
+
+ .FUNCT NW-LOUNGE-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ PUTP GLOBAL-SURFACE,P?SDESC,STR?36
+ CALL MOVE-SHARED-OBJECTS,NW-LOUNGE
+ RFALSE
+
+
+ .FUNCT NW-ENGINE-ROOM-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "You are in a tiny, smelly space where it is difficult to breathe. By your feet lie the diesel engines of the "
+ CALL DPRINT,TRAWLER
+ PRINTR "."
+
+ .ENDI
diff --git a/boat.zil b/boat.zil
new file mode 100644
index 0000000..25bdbdb
--- /dev/null
+++ b/boat.zil
@@ -0,0 +1,1422 @@
+"BOAT ROOMS for TOA #2
+ Copyright (C) 1984 Infocom, Inc."
+
+<OBJECT FERRY
+ (IN LOCAL-GLOBALS)
+ (DESC "ferry")
+ (LDESC "The ferry for the mainland bobs up and down, its engines
+running.")
+ (TEXT "The ferry for the mainland bobs up and down, its engines
+running.")
+ (SYNONYM FERRY BOAT SHIP ENGINE)
+ (ADJECTIVE FERRY)
+ (FLAGS INVISIBLE VEHBIT)
+ (ACTION FERRY-F)>
+
+<ROUTINE FERRY-F ()
+ <COND (<VERB? BOARD THROUGH CLIMB-ON>
+ <COND (<IN? ,FERRY ,FERRY-LANDING>
+ <COND (<==? ,HERE ,FERRY-LANDING>
+ <TELL-CANT-BOARD>)
+ (T <TELL-YOURE-NOT "at the landing.">)>)
+ (T <TELL "It's not at the landing. Be patient." CR>)>)
+ (<AND <VERB? WALK-TO> <NOT <==? ,HERE ,FERRY-LANDING>>>
+ <TELL-SHD-DIR>)
+ (<VERB? LISTEN>
+ <TELL "You hear its engines." CR>)>>
+
+<ROUTINE TELL-CANT-BOARD ()
+ <TELL-DONT-HAVE "a ferry token">>
+
+<OBJECT GLOBAL-FERRY
+ (IN GLOBAL-OBJECTS)
+ (DESC "ferry")
+ (SYNONYM FERRY)
+ (FLAGS CONTBIT)
+ (ACTION GLOBAL-FERRY-F)>
+
+<ROUTINE GLOBAL-FERRY-F ()
+ <COND (<NOT <VERB? ASK-ABOUT TELL FIND>>
+ <GLOBAL-NOT-HERE-PRINT ,GLOBAL-FERRY>)>>
+
+<ROOM MM-FORE-DECK
+ (IN ROOMS)
+ (DESC "Fore Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (SE TO MM-STARBOARD-DECK)
+ (EAST TO MM-STARBOARD-DECK)
+ (SW TO MM-PORT-DECK)
+ (WEST TO MM-PORT-DECK)
+ (SOUTH "There's a wall in the way.")
+ (DOWN TO MM-CREW-QTRS)
+ (GLOBAL OCEAN DECK SALVAGER RAILING IN-WINDOW LADDER-TOP)
+ (LINE 5)
+ (STATION MM-FORE-DECK)
+ (PSEUDO "BOLT" BOLT-PSEUDO "BOLTS" BOLT-PSEUDO)
+ (ACTION MM-FORE-DECK-F)>
+
+<ROUTINE MM-FORE-DECK-F (RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL-FORE-END ,SALVAGER>)>>
+
+<ROUTINE TELL-FORE-END (OBJ)
+ <TELL
+"You are at the fore end of the " D .OBJ ". You can see the ocean over the
+rail that runs around the deck. A ladder leads below deck, and the wheelhouse
+is aft of you. A chair is bolted to the deck." CR>>
+
+<OBJECT DECK-CHAIR
+ (IN MM-FORE-DECK)
+ (DESC "chair")
+ (SYNONYM CHAIR SEAT ARMCHA)
+ (ADJECTIVE LOOKOU)
+ ;(LDESC
+"A chair facing forward is bolted to the deck. It has a button on each arm.")
+ (STATION 70) ;"metal content"
+ (DESCFCN DECK-CHAIR-F)
+ (FLAGS SURFACEBIT VEHBIT TRANSBIT)
+ (ACTION DECK-CHAIR-F)>
+
+<ROUTINE DECK-CHAIR-F ("OPTIONAL" (RARG <>))
+ <COND (<==? .RARG ,M-OBJDESC>
+ <COND (<IN? ,PETE ,DECK-CHAIR>
+ <TELL-IN-CHAIR ,PETE>)
+ ;(<IN? ,WEASEL ,DECK-CHAIR>
+ <TELL-IN-CHAIR ,WEASEL>)>
+ <RTRUE>)
+ (<NOT .RARG>
+ <COND (<VERB? EXAMINE>
+ <TELL
+"This weatherbeaten chair is used by a lookout while standing watch.
+It faces forward and is bolted to the deck. ">
+ <COND ;(<IN? ,WEASEL ,DECK-CHAIR>
+ <TELL "The Weasel is currently in the chair.">)
+ (<IN? ,PETE ,DECK-CHAIR>
+ <TELL-IN-CHAIR ,PETE>
+ ;<TELL
+D ,PETE " is in the chair, staring out to sea.">)>
+ <CRLF>)
+ (<VERB? ASK-ABOUT>
+ <TELL "\"It's the lookout's chair.\"" CR>)
+ (<AND <VERB? PUT PUT-ON>
+ <PRSI? ,DECK-CHAIR>>
+ <COND (<IDROP>
+ <COND (<IN? ,PLAYER ,DECK-CHAIR>
+ <MOVE ,PRSO <LOC ,DECK-CHAIR>>)>
+ <TELL
+"It slides off the chair and onto the deck." CR>)>
+ <RTRUE>)
+ (<AND <VERB? BOARD>
+ <IN? ,PETE ,DECK-CHAIR>>
+ <TELL-ALREADY "occupied">)>)>>
+
+<ROUTINE TELL-IN-CHAIR (OCC)
+ <START-SENTENCE .OCC>
+ <TELL " is sitting in the chair." CR>>
+
+;<OBJECT LEFT-BUTTON
+ (IN DECK-CHAIR)
+ (DESC "left button")
+ (SYNONYM BUTTON)
+ (ADJECTIVE LEFT WEST ;PORT)
+ (FLAGS NDESCBIT)
+ (ACTION BUTTON-F)>
+
+;<OBJECT RIGHT-BUTTON
+ (IN DECK-CHAIR)
+ (DESC "right button")
+ (SYNONYM BUTTON)
+ (ADJECTIVE RIGHT EAST)
+ (FLAGS NDESCBIT)
+ (ACTION BUTTON-F)>
+
+;<ROUTINE BUTTON-F ()
+ <COND (<VERB? PUSH>
+ <COND (<AND ,ON-WATCH
+ <NOT <EQUAL? ,ON-WATCH ,PLAYER>>>
+ <START-SENTENCE ,ON-WATCH>
+ <TELL " stops you. \"">
+ <COND (<G? ,O-CTR 0>
+ <TELL "Don't worry. I got it,\" he says.">)
+ (T <TELL
+"Haven't you ever heard of the kid who cried wolf?\" he asks.">)>
+ <CRLF>
+ <RTRUE>)
+ (<PRSO? ,LEFT-BUTTON>
+ <SETG BUTTON-PUSHED 1>)
+ (T <SETG BUTTON-PUSHED 2>)>
+ <COND (<==? ,O-CTR 0>
+ <ENABLE <QUEUE I-USELESS-TURN <+ 1 <RANDOM 2>>>>)>
+ <TELL "Pushed." CR>)>>
+
+;<OBJECT PROW-LIGHT
+ (IN MM-FORE-DECK)
+ (DESC "prow light")
+ (SYNONYM LIGHT)
+ (ADJECTIVE SEARCH PROW)
+ (FLAGS ONBIT TRYTAKEBIT NDESCBIT)
+ (TEXT
+"This light, affixed to the prow of the boat, shines into the ocean.")
+ (ACTION PROW-LIGHT-F)>
+
+;<ROUTINE PROW-LIGHT-F ()
+ <COND (<VERB? LAMP-ON>
+ <TELL-ALREADY "on">)
+ (<VERB? LAMP-OFF>
+ <TELL "It would be too dangerous." CR>)
+ (<VERB? TAKE>
+ <TELL "It's firmly attached to the prow." CR>)>>
+
+<ROOM MM-STARBOARD-DECK
+ (IN ROOMS)
+ (DESC "Starboard Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"The starboard side of the Mary Margaret has the wheelhouse to port.
+The deck is well-worn after many years of use, but still solid. The ocean
+is off to the other side of the rail.")
+ (NW TO MM-FORE-DECK)
+ (NORTH TO MM-FORE-DECK)
+ (SW TO MM-AFT-DECK)
+ (SOUTH TO MM-AFT-DECK)
+ (WEST "There's a wall in the way.")
+ (GLOBAL OCEAN DECK SALVAGER RAILING IN-WINDOW)
+ (LINE 5)
+ (STATION MM-STARBOARD-DECK)>
+
+<ROOM MM-PORT-DECK
+ (IN ROOMS)
+ (DESC "Port Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (NE TO MM-FORE-DECK)
+ (NORTH TO MM-FORE-DECK)
+ (SE TO MM-AFT-DECK)
+ (SOUTH TO MM-AFT-DECK)
+ (EAST "There's a wall in the way.")
+ (WEST TO WHARF IF SALVAGER-DOCKED ELSE "You're out to sea now.")
+ (OUT TO WHARF IF SALVAGER-DOCKED ELSE "You're out to sea now.")
+ (GLOBAL OCEAN DECK SALVAGER RAILING IN-WINDOW)
+ (LINE 5)
+ (STATION MM-PORT-DECK)
+ (ACTION MM-PORT-DECK-F)>
+
+<ROUTINE MM-PORT-DECK-F (RARG "AUX" DOCK?)
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <MOVE ,BUNK ,MM-CREW-QTRS>
+ <MOVE ,UNDER-BUNK ,MM-CREW-QTRS>
+ <MOVE ,STOVE ,MM-GALLEY>
+ ;<MOVE ,CUPBOARDS ,MM-GALLEY>
+ <MOVE ,DECK-CHAIR ,MM-FORE-DECK>
+ ;<MOVE ,REDS-LAMP ,MM-CAPT-CABIN>
+ <MOVE ,REDS-BUNK ,MM-CAPT-CABIN>
+ ;<MOVE ,PROW-LIGHT ,MM-FORE-DECK>
+ <MOVE ,LOUNGE-CHAIR ,MM-LOUNGE>
+ <COND (<IN? ,PETE ,MM-GALLEY>
+ <MOVE ,FOOD ,STOVE>
+ <FSET ,FOOD ,NDESCBIT>)>
+ <COND (<AND ,WATER-DELIVERED
+ <==? ,SHIP-CHOSEN ,SALVAGER>>
+ <MOVE ,DRINKING-WATER ,MM-GALLEY>
+ <FSET ,DRINKING-WATER ,NDESCBIT>)>
+ <RFALSE>)
+ (<EQUAL? .RARG ,M-LOOK>
+ <TELL-FOO-SIDE ,SALVAGER "port" "starboard">
+ <RTRUE>)>>
+
+<ROUTINE TELL-FOO-SIDE (OBJ SIDE HOUSE "AUX" DOCK?)
+ <TELL
+"You are on the ".SIDE" side of the " D .OBJ", a sturdy vessel designed for ">
+ <COND (<EQUAL? .OBJ ,TRAWLER> <TELL "trawling">)
+ (T <TELL "deep-sea salvaging">)>
+ <TELL ". To " .HOUSE " is a small wheelhouse, while ">
+ <COND (<EQUAL? .OBJ ,TRAWLER> <SET DOCK? ,TRAWLER-DOCKED>)
+ (T <SET DOCK? ,SALVAGER-DOCKED>)>
+ <COND (.DOCK?
+ <TELL
+"to " .SIDE " is the gangway leading to the dock. The gentle rocking of the
+boat in port reminds you of time spent on the open sea." CR>)
+ (T <TELL
+"the ocean, with its blue-green waves crashing, lies off the "
+.SIDE " rail." CR>)>>
+
+<ROOM MM-AFT-DECK
+ (IN ROOMS)
+ (DESC "Aft Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (NE TO MM-STARBOARD-DECK)
+ (EAST TO MM-STARBOARD-DECK)
+ (NW TO MM-PORT-DECK)
+ (WEST TO MM-PORT-DECK)
+ (NORTH TO MM-WHEELHOUSE)
+ (DOWN TO MM-LOUNGE)
+ (GLOBAL OCEAN DECK SALVAGER RAILING LADDER-TOP)
+ (LINE 5)
+ (STATION MM-AFT-DECK)
+ (PSEUDO "BOLT" BOLT-PSEUDO "BOLTS" BOLT-PSEUDO)
+ (ACTION MM-AFT-DECK-F)>
+
+<ROUTINE TELL-AFT-DECK ()
+ <TELL
+"The smell of diesel fuel is strong but reassuring here on the aft deck.
+A ladder leads below deck, while forward you can see the entrance to the
+command center of the boat, the wheelhouse.">>
+
+<ROUTINE MM-AFT-DECK-F (RARG)
+ <COND (<==? .RARG ,M-LOOK>
+ <TELL-AFT-DECK>
+ <TELL
+" A huge air compressor is bolted to the deck by the aft rail." CR>)
+ (<==? .RARG ,M-BEG>
+ <COND (<AND <VERB? WALK>
+ <IN? ,AIR-HOSE ,DEEP-SUIT>
+ <IN? ,DEEP-SUIT ,PLAYER>>
+ <TELL
+"You don't want to drag the " D ,AIR-HOSE " around the boat." CR>)>)
+ (<==? .RARG ,M-FLASH>
+ <COND (<AND <IN? ,WEASEL ,MM-AFT-DECK>
+ ,AT-SEA
+ <NOT ,WEASEL-APPREHENDED>
+ <NOT <QUEUED? I-PENDULUM>>>
+ <ENABLE <QUEUE I-PENDULUM -1>>
+ <TELL-WEASEL-TOSSES>)>)>>
+
+<ROUTINE TELL-WEASEL-TOSSES ()
+ <FCLEAR ,LINE-HACK ,INVISIBLE>
+ <MOVE ,LINE-HACK <LOC ,WEASEL>>
+ <TELL
+"The Weasel tosses a line over the side and says, " ,LINE-STR CR>>
+
+<OBJECT LINE-HACK ;"quick and dirty"
+ (IN LOCAL-GLOBALS)
+ (DESC "orange line")
+ (SYNONYM LINE ROPE)
+ (ADJECTIVE SAFETY WEIGHT FLOURE ORANGE)
+ (FLAGS TRYTAKEBIT INVISIBLE VOWELBIT NDESCBIT)
+ (ACTION LINE-HACK-F)>
+
+<ROUTINE LINE-HACK-F ("AUX" (HOLDER <>))
+ <COND (<IN? ,WEASEL <LOC ,LINE-HACK>>
+ <SET HOLDER ,WEASEL>)
+ (<IN? ,JOHNNY <LOC ,LINE-HACK>>
+ <SET HOLDER ,JOHNNY>)>
+ <COND (<VERB? EXAMINE>
+ <COND (.HOLDER
+ <START-SENTENCE .HOLDER>
+ <TELL " is holding one end of a weighted " D ,LINE-HACK "." CR>)
+ (T <TELL "One end of " A ,LINE-HACK " is here. Leave it alone." CR>)>)
+ (<VERB? FIND ASK-ABOUT>
+ <RFALSE>)
+ (T
+ <COND (.HOLDER
+ <START-SENTENCE .HOLDER>
+ <TELL " pulls it away. \"Don't mess with that!\"" CR>)
+ (T <TELL "Leave it alone." CR>)>)>>
+
+<OBJECT MM-COMPRESSOR
+ (IN MM-AFT-DECK)
+ (DESC "large air compressor")
+ (SYNONYM COMPRE SWITCH)
+ (ADJECTIVE LARGE AIR HUGE)
+ (FLAGS CONTBIT OPENBIT NDESCBIT)
+ (STATION 100) ;"metal content"
+ (ACTION MM-COMPRESSOR-F)>
+
+<ROUTINE MM-COMPRESSOR-F ("AUX" TICK)
+ <COND (<VERB? OPEN CLOSE>
+ <TELL-NO-NO>)
+ (<AND <VERB? PUT>
+ <PRSI? ,MM-COMPRESSOR>>
+ <TELL "There's no place to put it." CR>)
+ (<VERB? EXAMINE>
+ <TELL
+"The large, gasoline-powered air compressor is ">
+ <COND (<FSET? ,MM-COMPRESSOR ,ONBIT>
+ <TELL "on">)
+ (T <TELL "off">)>
+ <TELL ". You can quickly see it ">
+ <COND (<0? <SET TICK <GET <INT I-MM-COMPRESSOR> ,C-TICK>>>
+ <TELL "is out of fuel">)
+ (T
+ <COND (<==? .TICK 80>
+ <TELL "has">)
+ (T <TELL "started with">)>
+ <TELL " fuel for an hour and a half's operation">)>
+ <TELL ". A retractable " D ,AIR-HOSE " is built in." CR>)
+ (<VERB? LAMP-ON>
+ <COND (<FSET? ,MM-COMPRESSOR ,ONBIT>
+ <TELL-ALREADY "on">)
+ (T
+ <ENABLE <INT I-MM-COMPRESSOR>>
+ <FSET ,MM-COMPRESSOR ,ONBIT>
+ <TELL "Okay. The compressor is on." CR>)>)
+ (<VERB? LAMP-OFF>
+ <COND (<FSET? ,MM-COMPRESSOR ,ONBIT>
+ <DISABLE <INT I-MM-COMPRESSOR>>
+ <FCLEAR ,MM-COMPRESSOR ,ONBIT>
+ <TELL-NOW ,MM-COMPRESSOR "off">)
+ (T <TELL-ALREADY "off">)>)
+ (<AND <VERB? LISTEN>
+ <FSET? ,MM-COMPRESSOR ,ONBIT>>
+ <TELL "The compressor is making a steady loud noise." CR>)>>
+
+<OBJECT AIR-HOSE
+ (IN MM-COMPRESSOR)
+ (DESC "airhose")
+ (SYNONYM AIRHOSE HOSE)
+ (ADJECTIVE AIR RETRAC)
+ (FLAGS NDESCBIT TRYTAKEBIT VOWELBIT)
+ (ACTION AIR-HOSE-F)>
+
+<ROUTINE AIR-HOSE-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<IN? ,AIR-HOSE ,DEEP-SUIT>
+ <COND (<==? <GETP ,HERE ,P?LINE>
+ ,UNDERWATER-LINE-C>
+ <TELL
+"This " D ,AIR-HOSE " goes from the aft deck of the " D ,SALVAGER" and ends at
+your diving suit. Without it, you would find breathing impossible." CR>)
+ (T <TELL
+"It connects the " D ,DEEP-SUIT " and the " D ,MM-COMPRESSOR " ">
+ <COND (<EQUAL? ,HERE ,MM-AFT-DECK>
+ <TELL "here">)
+ (T <TELL "on the aft deck">)>
+ <TELL "." CR>)>)
+ (T <TELL
+"It is designed to be connected to a " D ,DEEP-SUIT " to provide air and
+is about 600 feet long." CR>)>)
+ (<AND <VERB? PUT TIE>
+ <OR <PRSI? ,DEEP-SUIT>
+ <PRSO? ,DEEP-SUIT>>>
+ <COND (<IN? ,AIR-HOSE ,DEEP-SUIT>
+ <TELL-ALREADY "connected">)
+ (T
+ <MOVE ,AIR-HOSE ,DEEP-SUIT>
+ <TELL-NOW ,AIR-HOSE ,CONNECT-STR>)>)
+ (<VERB? TAKE>
+ <COND (<IN? ,AIR-HOSE ,DEEP-SUIT>
+ <TELL-ALREADY ,CONNECT-STR>)
+ (T <TELL
+"Why drag it around? Just connect it to the " D ,DEEP-SUIT "." CR>)>)
+ (<VERB? TIE>
+ <TELL-YOU-CANT "connect the airhose to that!">)
+ (<VERB? UNTIE>
+ <COND (<EQUAL? <GETP ,HERE ,P?LINE>
+ ,UNDERWATER-LINE-C>
+ <JIGS-UP "Oops! So much for instantly growing gills.">)
+ (T
+ <MOVE ,AIR-HOSE ,MM-COMPRESSOR>
+ <TELL "The hose retracts back to the compressor." CR>)>)
+ (<VERB? MOVE>
+ <TELL "That was fun." CR>)
+ (<VERB? CLIMB-FOO>
+ <TELL-YOU-CANT "climb that!">)>>
+
+<GLOBAL CONNECT-STR "connected to the deep-sea diving suit">
+
+<ROOM MM-WHEELHOUSE
+ (IN ROOMS)
+ (DESC "Wheelhouse")
+ (FLAGS RLANDBIT ONBIT)
+ (SOUTH TO MM-AFT-DECK)
+ (DOWN TO MM-GALLEY)
+ (GLOBAL DECK SALVAGER TRAWLER LADDER-TOP WINDOW OCEAN)
+ (PSEUDO "WHEEL" WHEEL-PSEUDO "COMPRE" COMPRESSOR-PSEUDO)
+ (LINE 5)
+ (STATION MM-AFT-DECK)
+ (ACTION MM-WHEELHOUSE-F)>
+
+<ROUTINE TELL-WHEELHOUSE (OBJ)
+ <TELL " Through the glass windows you see the ">
+ <COND (,AT-SEA <TELL "ocean churning all around you." CR>)
+ (T <TELL
+D .OBJ " docked at the wharf, and the island stretching aft.
+Forward, you see the choppy waters of the bay." CR>)>>
+
+;<TELL
+"wharf and the island beyond, stretching out to the south. Forward, you
+see the choppy waters of the bay. To starboard you can see the salvager docked.">
+
+<ROUTINE MM-WHEELHOUSE-F (RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You are in the wheelhouse with a passageway leading out onto the deck abaft.
+You can see the " D ,MM-COMPRESSOR " sitting there, taking up most of the aft deck.">
+ <TELL-WHEELHOUSE ,TRAWLER>
+ <RTRUE>)
+ (<==? .RARG ,M-BEG>
+ <COND (<EQUAL? ,OCEAN ,PRSO ,PRSI>
+ <COND (<VERB? EXAMINE>
+ <TELL
+"You see the ocean through the window." CR>)
+ (<VERB? FIND ASK-ABOUT>
+ <RFALSE>)
+ (T <TELL-YOU-CANT "from here.">)>)>)>>
+
+<ROUTINE COMPRESSOR-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "large air compressor">)
+ (<VERB? EXAMINE>
+ <TELL-YOU-CANT "make out too many details from here.">)
+ (T <TELL-CANT-REACH "it from here">)>>
+
+;<ROOM MM-HEAD
+ (IN ROOMS)
+ (DESC "Head")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in the small head aboard the Mary Margaret. There's barely enough
+room to turn around and get out abaft.")
+ (SOUTH TO MM-LOCKER)
+ (GLOBAL DECK SALVAGER)
+ (LINE 5)
+ (STATION MM-LOCKER)>
+
+<ROOM MM-LOCKER
+ (IN ROOMS)
+ (DESC "Storage Locker")
+ (FLAGS RLANDBIT ONBIT)
+ ;(NORTH TO MM-HEAD)
+ (SOUTH TO MM-CREW-QTRS)
+ (GLOBAL DECK SALVAGER)
+ (LINE 5)
+ (PSEUDO "LOCKER" GLOBAL-ROOM-F)
+ (STATION MM-CREW-QTRS)
+ (ACTION MM-LOCKER-F)>
+
+<ROUTINE MM-LOCKER-F (RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You are in a relatively empty locker." ,SPARE-PARTS-STR CR>)>>
+
+<GLOBAL SPARE-PARTS-STR
+" There are spare parts for the engine and other equipment scattered about.">
+
+<OBJECT METAL-DETECTOR
+ (IN MM-LOCKER)
+ (DESC "small machine")
+ (SYNONYM MACHIN DETECT DEVICE)
+ (ADJECTIVE SMALL METAL ACME)
+ (FLAGS CONTBIT TRANSBIT SEARCHBIT TAKEBIT)
+ (ACTION METAL-DETECTOR-F)>
+
+<ROUTINE METAL-DETECTOR-F ("AUX" TMP)
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The " D ,METAL-DETECTOR "'s label is well-worn. It has a "
+D ,DETECTOR-SWITCH " which is currently ">
+ <COND (,DETECTOR-ON <TELL "on">)
+ (T <TELL "off">)>
+ <TELL ", and a compartment on the side which is ">
+ <COND (<FSET? ,DETECTOR-COMPARTMENT ,OPENBIT>
+ <TELL "open">
+ <COND (<SET TMP <FIRST? ,DETECTOR-COMPARTMENT>>
+ <TELL " and contains " A .TMP>)>)
+ (T <TELL "closed">)>
+ <TELL "." CR>
+ <RTRUE>)
+ (<VERB? LAMP-ON>
+ <SETG DETECTOR-ON T>
+ <TELL-SWITCH "on">
+ <RTRUE>)
+ (<VERB? LAMP-OFF>
+ <SETG DETECTOR-ON <>>
+ <TELL-SWITCH "off">
+ <RTRUE>)
+ (<VERB? LISTEN>
+ <DETECTOR-NOISE T>
+ <RTRUE>)
+ (<AND <VERB? PUT>
+ <PRSI? ,METAL-DETECTOR>>
+ <PERFORM ,V?PUT ,PRSO ,DETECTOR-COMPARTMENT>
+ <RTRUE>)
+ (<VERB? OPEN CLOSE EMPTY>
+ <PERFORM ,PRSA ,DETECTOR-COMPARTMENT>
+ <SETG P-IT-OBJECT ,METAL-DETECTOR>
+ <RTRUE>)
+ (<VERB? LOOK-INSIDE>
+ <PERFORM ,V?EXAMINE ,DETECTOR-COMPARTMENT>
+ <SETG P-IT-OBJECT ,METAL-DETECTOR>
+ <RTRUE>)
+ (<VERB? SHAKE>
+ <COND (<AND <FSET? ,DETECTOR-COMPARTMENT ,OPENBIT>
+ <FIRST? ,DETECTOR-COMPARTMENT>>
+ <MOVE ,DRY-CELL ,HERE>
+ <SETG DETECTOR-POWERED <>>
+ <TELL
+"The " D ,DRY-CELL " falls out of the machine." CR>)
+ (T <TELL "Nothing happens." CR>)>
+ <RTRUE>)>>
+
+<OBJECT DETECTOR-LABEL
+ (IN METAL-DETECTOR)
+ (DESC "machine label")
+ (SYNONYM LABEL TAG STICKE LOGO)
+ (ADJECTIVE WELL WORN WELL-W MACHIN DETECT METAL SMALL)
+ (TEXT
+"The label is worn, so all you can make out is a large \"ACME\" at the top.")
+ (FLAGS READBIT NDESCBIT)
+ (ACTION DETECTOR-LABEL-F)>
+
+<ROUTINE DETECTOR-LABEL-F ()
+ <COND (<VERB? TAKE>
+ <TELL "You tug at it, but it can't be pulled off." CR>
+ <RTRUE>)>>
+
+<OBJECT DETECTOR-SWITCH
+ (IN METAL-DETECTOR)
+ (DESC "machine switch")
+ (SYNONYM SWITCH)
+ (ADJECTIVE MACHIN DETECT METAL SMALL POWER ON-OFF ON/OFF)
+ (FLAGS NDESCBIT TURNBIT)
+ (ACTION DETECTOR-SWITCH-F)>
+
+<ROUTINE DETECTOR-SWITCH-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (,DETECTOR-ON
+ <TELL-SWITCH "on">)
+ (T <TELL-SWITCH "off">)>
+ <RTRUE>)
+ (<VERB? LAMP-ON>
+ <PERFORM ,V?LAMP-ON ,METAL-DETECTOR>
+ <SETG P-IT-OBJECT ,DETECTOR-SWITCH>
+ <RTRUE>)
+ (<VERB? LAMP-OFF>
+ <PERFORM ,V?LAMP-OFF ,METAL-DETECTOR>
+ <SETG P-IT-OBJECT ,DETECTOR-SWITCH>
+ <RTRUE>)
+ (<VERB? TURN MOVE THROW>
+ <COND (,DETECTOR-ON <PERFORM ,V?LAMP-OFF ,METAL-DETECTOR>)
+ (T <PERFORM ,V?LAMP-ON ,METAL-DETECTOR>)>
+ <SETG P-IT-OBJECT ,DETECTOR-SWITCH>
+ <RTRUE>)>>
+
+<OBJECT DETECTOR-COMPARTMENT
+ (IN METAL-DETECTOR)
+ (DESC "machine compartment")
+ (SYNONYM COMPAR RECESS PANEL)
+ (ADJECTIVE SMALL MACHIN METAL DETECT)
+ (CAPACITY 3)
+ (CONTFCN DETECTOR-COMPARTMENT-F)
+ (FLAGS CONTBIT NDESCBIT)
+ (ACTION DETECTOR-COMPARTMENT-F)>
+
+<ROUTINE DETECTOR-COMPARTMENT-F ("OPTIONAL" (RARG <>))
+ <COND (<==? .RARG ,M-CONT>
+ <COND (<AND <VERB? TAKE>
+ <PRSO? ,DRY-CELL>>
+ <COND (<ITAKE>
+ <TELL "Taken." CR>
+ <COND (,DETECTOR-POWERED
+ <SETG DETECTOR-POWERED <>>)>)>
+ <RTRUE>)>)
+ (<VERB? EXAMINE LOOK-INSIDE>
+ <COND (<FSET? ,DETECTOR-COMPARTMENT ,OPENBIT>
+ <TELL
+"The compartment is on the side of the machine. Inside ">
+ <COND (<FIRST? ,DETECTOR-COMPARTMENT>
+ <TELL "is a connected">)
+ (T <TELL "are connections for a">)>
+ <TELL " nine-volt " D ,DRY-CELL "." CR>)
+ (T
+ <TELL-CLOSED "small panel on the side of the machine">)>
+ <RTRUE>)
+ (<VERB? PUT>
+ <COND (<PRSO? ,DETECTOR-COMPARTMENT>
+ <RFALSE>)
+ (<NOT <FSET? ,DETECTOR-COMPARTMENT ,OPENBIT>>
+ <TELL-CLOSED "panel">)
+ (<PRSO? ,DRY-CELL>
+ <MOVE ,DRY-CELL ,DETECTOR-COMPARTMENT>
+ <COND (<NOT <FSET? ,DRY-CELL ,RMUNGBIT>>
+ <SETG DETECTOR-POWERED T>)>
+ <TELL "The " D ,DRY-CELL " fits snugly inside." CR>
+ <RTRUE>)
+ (T <TELL "Unfortunately, it doesn't fit." CR>)>)
+ (<AND <VERB? OPEN>
+ <IN? ,DRY-CELL ,DETECTOR-COMPARTMENT>
+ <==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <NOT <AIRTIGHT-ROOM?>>>
+ <FSET ,DRY-CELL ,RMUNGBIT>
+ <SETG DETECTOR-POWERED <>>
+ <RFALSE>)
+ (<AND <VERB? EMPTY>
+ <FSET? ,DETECTOR-COMPARTMENT ,OPENBIT>>
+ <SETG DETECTOR-POWERED <>>
+ <RFALSE>)>>
+
+<OBJECT DEEP-SUIT
+ (IN MM-LOCKER)
+ (DESC "deep-sea diving suit")
+ (SYNONYM SUIT HOOD)
+ (ADJECTIVE DEEP DEEP-S SEA DIVING BULKY)
+ (FLAGS TAKEBIT WEARBIT CONTBIT OPENBIT)
+ (ACTION DEEP-SUIT-F)>
+
+<ROUTINE DEEP-SUIT-F ()
+ <COND (<VERB? OPEN CLOSE>
+ <TELL-NO-NO>)
+ (<VERB? EXAMINE>
+ <TELL
+"This " D ,DEEP-SUIT " is bulky on land, but underwater it will
+protect you to 500 feet. It has a hood with \"viewport\" and a
+connection for a compressor hose." CR>)
+ (<AND <VERB? PUT>
+ <PRSI? ,DEEP-SUIT>
+ <NOT <PRSO? ,AIR-HOSE>>>
+ <TELL-NO-NO>)
+ (<AND <VERB? WEAR>
+ <FSET? ,WET-SUIT ,WORNBIT>>
+ <TELL-NO-FIT "over the wet suit">)
+ (<AND <VERB? DROP THROW DISEMBARK>
+ <==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>>
+ <JIGS-UP
+"You take the suit off and quickly realize you're not a dolphin. You realize
+this too late, though.">)>>
+
+<ROOM MM-CREW-QTRS
+ (IN ROOMS)
+ (DESC "Crew's Quarters")
+ (FLAGS RLANDBIT ONBIT)
+ (NORTH TO MM-LOCKER)
+ (SOUTH TO MM-GALLEY)
+ (UP TO MM-FORE-DECK)
+ (GLOBAL DECK SALVAGER LADDER-BOTTOM)
+ (LINE 5)
+ (STATION MM-CREW-QTRS)
+ (PSEUDO "BUNKS" BUNKS-PSEUDO)
+ (ACTION MM-CREW-QTRS-F)>
+
+<ROUTINE MM-CREW-QTRS-F (RARG "AUX" W)
+ <COND (<==? .RARG ,M-LOOK>
+ <TELL-CREW-QTRS>
+ <RTRUE>)
+ (<==? .RARG ,M-ENTER>
+ <MOVE-SHARED-OBJECTS ,MM-CREW-QTRS>
+ <RFALSE>)
+ ;(<==? .RARG ,M-BEG>
+ <COND (<AND <NOT ,GROGGIED>
+ ,AT-SEA
+ <SET W <W-KLUDGE>>>
+ <SETG GROGGIED T>
+ <START-SENTENCE .W>
+ <TELL " looks up groggily. ">
+ <RFALSE>)>)>>
+
+;<GLOBAL GROGGIED <>>
+
+;<ROUTINE W-KLUDGE ()
+ <COND (<EQUAL? ,WINNER ,WEASEL ,PETE>
+ <RETURN ,WINNER>)
+ (<VERB? ASK-ABOUT>
+ <RETURN ,PRSO>)
+ (T <RFALSE>)>>
+
+<OBJECT BUNK
+ (IN MM-CREW-QTRS)
+ (DESC "bunk")
+ (SYNONYM BUNK BED MATTRE)
+ (FLAGS VEHBIT SURFACEBIT CONTBIT OPENBIT TRANSBIT NDESCBIT)
+ (CAPACITY 25)
+ (STATION 30) ;"metal content"
+ (ACTION BUNK-F)>
+
+<ROUTINE BUNK-F ("OPTIONAL" (RARG <>) "AUX" F)
+ <COND (<NOT .RARG>
+ <COND (<AND <VERB? BOARD SLEEP>
+ <OR <AND <SET F <FIRST? ,BUNK>>
+ <NOT <==? .F ,PLAYER>>>
+ <WEARING-SOMETHING?>>>
+ <TELL-NOT-COMFORTABLE>)
+ (<VERB? PUT-UNDER HIDE-UNDER>
+ <COND (<PRSO? ,ME ,GLOBAL-SELF>
+ <TELL "You won't fit." CR>)
+ (<L? <GETP ,PRSO ,P?SIZE> 5>
+ <COND (<FIRST? ,UNDER-BUNK>
+ <TELL-NO-FIT>)
+ (T
+ <MOVE ,PRSO ,UNDER-BUNK>
+ <FSET ,PRSO ,NDESCBIT>
+ <TELL-NOW ,PRSO "hidden under the mattress">)>)
+ (T <TELL-NO-FIT>)>)
+ (<VERB? LOOK-UNDER>
+ <COND (<SET F <FIRST? ,UNDER-BUNK>>
+ <SETG P-IT-OBJECT .F>
+ <TELL "There is " A .F " under the mattress." CR>)
+ (T <TELL "Nobody's hidden his life savings there." CR>)>)>)>>
+
+<ROUTINE WEARING-SOMETHING? ("AUX" F)
+ <SET F <FIRST? ,PLAYER>>
+ <REPEAT ()
+ <COND (<NOT .F> <RFALSE>)
+ (<AND <FSET? .F ,WORNBIT>
+ <NOT <==? .F ,WATCH>>>
+ <RTRUE>)
+ (T <SET F <NEXT? .F>>)>>>
+
+<OBJECT UNDER-BUNK
+ (IN MM-CREW-QTRS)
+ (DESC "under the bunk")
+ (FLAGS CONTBIT NDESCBIT OPENBIT)
+ (CAPACITY 10)
+ (DESCFCN UNDER-BUNK-F)
+ (CONTFCN UNDER-BUNK-F)>
+
+<ROUTINE UNDER-BUNK-F ("OPTIONAL" (RARG <>))
+ <COND (<==? .RARG ,M-OBJDESC>
+ <RTRUE>)
+ (<==? .RARG ,M-CONT>
+ <COND (<VERB? TAKE>
+ <FCLEAR ,PRSO ,NDESCBIT>
+ <RFALSE>)>)>>
+
+<ROUTINE BUNKS-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "bunks">)
+ (T <TELL "The only bunk you should worry about is your own." CR>)>>
+
+<ROOM MM-GALLEY
+ (IN ROOMS)
+ (DESC "Galley")
+ (FLAGS RLANDBIT ONBIT)
+ (NORTH TO MM-CREW-QTRS)
+ (SOUTH TO MM-LOUNGE)
+ (UP TO MM-WHEELHOUSE)
+ (GLOBAL DECK SALVAGER LADDER-BOTTOM)
+ (LINE 5)
+ (STATION MM-GALLEY)
+ (ACTION MM-GALLEY-F)>
+
+<ROUTINE MM-GALLEY-F (RARG)
+ <GENERIC-GALLEY-F .RARG ,MM-GALLEY>>
+
+<ROUTINE GENERIC-GALLEY-F (RARG PLACE)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,GLOBAL-SURFACE ,P?SDESC "table">
+ <MOVE-SHARED-OBJECTS .PLACE>
+ <RFALSE>)
+ (<==? .RARG ,M-LOOK>
+ <TELL "You are in the ">
+ <COND (<==? .PLACE ,MM-GALLEY>
+ <TELL D ,SALVAGER>)
+ (T <TELL D ,TRAWLER>)>
+ <TELL
+"'s galley. A stove and a small table are the fixtures here.">
+ <COND (<IN? ,FOOD ,STOVE>
+ <TELL-STEW-ON>)>
+ <COND (<AND ,WATER-DELIVERED
+ <==? <GETP ,SHIP-CHOSEN ,P?LINE>
+ <GETP ,PLACE ,P?LINE>>>
+ <TELL " Water is available.">)>
+ <TELL
+" A ladder leads up through the deck to the wheelhouse for
+feeding the captain in rough weather." CR>)
+ (<==? .RARG ,M-BEG>
+ <COND (<DOUBLE-DUTY-CHECK>
+ <RTRUE>)>)>>
+
+<ROUTINE DOUBLE-DUTY-CHECK ()
+ <COND (<AND <VERB? ASK-FOR>
+ <PRSO? ,PETE>>
+ <COND (<PRSI? ,FOOD>
+ <COND (,SOUPS-ON
+ <TELL "\"Take some " D ,GLOBAL-SELF ".\"" CR>)
+ (T <TELL "\"Wait 'til it's ready.\"" CR>)>)
+ (<PRSI? ,DRINKING-WATER>
+ <TELL "\"Take it " D ,GLOBAL-SELF ".\"" CR>)>)>>
+
+<ROUTINE TELL-STEW-ON ("OPTIONAL" (LEAD? T))
+ <COND (.LEAD? <TELL " ">)>
+ <TELL "A pot of stew is simmering on the stove.">>
+
+<OBJECT STOVE
+ (IN MM-GALLEY)
+ (DESC "stove")
+ (SYNONYM STOVE RANGE GIMBAL)
+ (ADJECTIVE SMALL)
+ (FLAGS SURFACEBIT OPENBIT CONTBIT NDESCBIT)
+ (CAPACITY 5)
+ (ACTION STOVE-F)>
+
+<ROUTINE STOVE-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The small stove rests on gimbals that keep it relatively level.">
+ <COND (<IN? ,FOOD ,STOVE>
+ <TELL-STEW-ON>)>
+ <CRLF>)
+ (<AND <VERB? LOOK-INSIDE>
+ <IN? ,FOOD ,STOVE>>
+ <TELL-STEW-ON <>>
+ <CRLF>)
+ (<VERB? LAMP-ON LAMP-OFF>
+ <TELL "That's Pete's job." CR>)>>
+
+;<OBJECT CUPBOARDS
+ (IN MM-GALLEY)
+ (DESC "set of cupboards")
+ (SYNONYM CUPBOA CABINE SET)
+ (ADJECTIVE EMPTY BARE FEW STORAG)
+ (FLAGS NDESCBIT CONTBIT)
+ (CAPACITY 1)
+ (ACTION CUPBOARDS-F)>
+
+;<ROUTINE CUPBOARDS-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "There are a few ">
+ <COND (<FSET? ,CUPBOARDS ,OPENBIT>
+ <TELL "empty">)
+ (T <TELL "closed">)>
+ <TELL " storage cupboards here." CR>)
+ (<VERB? OPEN>
+ <COND (<FSET? ,CUPBOARDS ,OPENBIT>
+ <TELL "They're already open." CR>)
+ (T
+ <FSET ,CUPBOARDS ,OPENBIT>
+ <TELL
+"Opening them reveals nothing but empty cupboards." CR>)>)
+ (<VERB? CLOSE>
+ <COND (<FSET? ,CUPBOARDS ,OPENBIT>
+ <FCLEAR ,CUPBOARDS ,OPENBIT>
+ <TELL "Closed." CR>)
+ (T <TELL "They're already closed." CR>)>)
+ (<AND <VERB? PUT>
+ <PRSI? ,CUPBOARDS>>
+ <TELL "It would only make Pete mad." CR>)>>
+
+<ROOM MM-LOUNGE
+ (IN ROOMS)
+ (DESC "Lounge")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in a small, cramped cabin decorated with a table and a few chairs.
+To the aft is the captain's cabin, while the galley lies forward. A ladder
+leading down goes into the engine room.")
+ (NORTH TO MM-GALLEY)
+ (SOUTH TO MM-CAPT-CABIN)
+ (UP TO MM-AFT-DECK)
+ (DOWN TO MM-ENGINE-ROOM)
+ (GLOBAL DECK SALVAGER LADDER-BOTTOM LADDER-TOP)
+ (LINE 5)
+ (STATION MM-LOUNGE)
+ (ACTION MM-LOUNGE-F)>
+
+<ROUTINE MM-LOUNGE-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,GLOBAL-SURFACE ,P?SDESC "table">
+ <MOVE-SHARED-OBJECTS ,MM-LOUNGE>
+ <RFALSE>)>>
+
+<OBJECT LOUNGE-CHAIR
+ (IN MM-LOUNGE)
+ (DESC "chair")
+ (SYNONYM CHAIR CHAIRS SEAT)
+ (FLAGS NDESCBIT VEHBIT SURFACEBIT TRANSBIT OPENBIT)
+ (CAPACITY 10)
+ (ACTION LOUNGE-CHAIR-F)>
+
+<ROUTINE LOUNGE-CHAIR-F ("OPTIONAL" (RARG <>) "AUX" F)
+ <COND (<PRSO? ,CHAIR>
+ <COND (<VERB? BOARD>
+ <COND (<SET F <FIRST? ,CHAIR>>
+ <TELL-NOT-COMFORTABLE>)>)>)>>
+
+<ROOM MM-CAPT-CABIN
+ (IN ROOMS)
+ (DESC "Captain's Cabin")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in the captain's cabin. There is a large and
+comfortable-looking bunk here. The forward doorway leads to the
+crew's lounge.")
+ (NORTH TO MM-LOUNGE)
+ (GLOBAL DECK SALVAGER)
+ (LINE 5)
+ (STATION MM-LOUNGE)>
+
+;<OBJECT REDS-LAMP
+ (IN MM-CAPT-CABIN)
+ (DESC "reading lamp")
+ (SYNONYM LAMP LIGHT)
+ (ADJECTIVE READIN)
+ (FLAGS NDESCBIT)
+ (ACTION REDS-LAMP-F)>
+
+;<ROUTINE REDS-LAMP-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "The lamp is ">
+ <COND (<FSET? ,REDS-LAMP ,ONBIT>
+ <TELL "on">)
+ (T <TELL "off">)>
+ <TELL "." CR>)
+ (<VERB? LAMP-ON>
+ <COND (<FSET? ,REDS-LAMP ,ONBIT>
+ <TELL-ALREADY "on">)
+ (T
+ <FSET ,REDS-LAMP ,ONBIT>
+ <TELL-NOW ,REDS-LAMP "on">)>)
+ (<VERB? LAMP-OFF>
+ <COND (<FSET? ,REDS-LAMP ,ONBIT>
+ <FCLEAR ,REDS-LAMP ,ONBIT>
+ <TELL "The lamp is now off." CR>)
+ (T <TELL-ALREADY "off">)>)>>
+
+<OBJECT REDS-BUNK
+ (IN MM-CAPT-CABIN)
+ (DESC "large bunk")
+ (SYNONYM BUNK BED MATTRE)
+ (ADJECTIVE LARGE COMFOR LOOKIN CAPTAI)
+ (FLAGS NDESCBIT)
+ (TEXT "This large, comfortable-looking bunk is the captain's.")
+ (ACTION REDS-BUNK-F)>
+
+<ROUTINE REDS-BUNK-F ()
+ <COND (<OR <VERB? BOARD SLEEP SIT>
+ <VERB? SIT-ON PUT-UNDER HIDE-UNDER>
+ <AND <VERB? PUT>
+ <PRSI? ,REDS-BUNK>>>
+ <TELL "You know better than to disturb the captain's bunk!" CR>)
+ (<VERB? LOOK-INSIDE>
+ <TELL "It's shipshape." CR>)>>
+
+<ROOM MM-ENGINE-ROOM
+ (IN ROOMS)
+ (DESC "Engine Room")
+ (FLAGS RLANDBIT ONBIT)
+ (UP TO MM-LOUNGE)
+ (GLOBAL DECK SALVAGER LADDER-BOTTOM)
+ (LINE 5)
+ (DESCFCN 100) ;"metal content"
+ (PSEUDO "ENGINE" ENGINE-PSEUDO)
+ (STATION MM-LOUNGE)
+ (ACTION MM-ENGINE-ROOM-F)>
+
+<ROUTINE MM-ENGINE-ROOM-F (RARG)
+ <COND (<==? .RARG ,M-LOOK>
+ <TELL
+"You are in a tiny cabin with barely enough room to breathe. By your feet lie
+the huge diesel engines of the " D ,SALVAGER "." CR>)>>
+
+<ROUTINE ENGINE-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "diesel engine">)
+ (<VERB? EXAMINE>
+ <TELL
+"The engines are extremely complex and delicate pieces of machinery." CR>)
+ (<VERB? LAMP-ON LAMP-OFF PLUG>
+ <TELL
+"Leave the engines to " D ,WEASEL " and he'll leave the diving to you." CR>)
+ (<AND <VERB? ASK-ABOUT>
+ <PRSO? ,WEASEL>>
+ <TELL "\"These are in pretty good shape.\"" CR>)
+ (<AND <VERB? LISTEN>
+ ,AT-SEA>
+ <TELL-YOU-CANT "avoid it.">)>>
+
+<ROOM NW-FORE-DECK
+ (IN ROOMS)
+ (DESC "Fore Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (SE TO NW-STARBOARD-DECK)
+ (EAST TO NW-STARBOARD-DECK)
+ (SW TO NW-PORT-DECK)
+ (WEST TO NW-PORT-DECK)
+ (SOUTH "There's a wall in the way.")
+ (DOWN TO NW-CREW-QTRS)
+ (GLOBAL OCEAN DECK TRAWLER RAILING IN-WINDOW LADDER-TOP)
+ (LINE 4)
+ (STATION NW-FORE-DECK)
+ (PSEUDO "BOLT" BOLT-PSEUDO "BOLTS" BOLT-PSEUDO)
+ (ACTION NW-FORE-DECK-F)>
+
+<ROUTINE NW-FORE-DECK-F (RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL-FORE-END ,TRAWLER>)>>
+
+<ROOM NW-STARBOARD-DECK
+ (IN ROOMS)
+ (DESC "Starboard Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (EAST TO WHARF IF TRAWLER-DOCKED ELSE "You're out to sea now.")
+ (OUT TO WHARF IF TRAWLER-DOCKED ELSE "You're out to sea now.")
+ (NW TO NW-FORE-DECK)
+ (NORTH TO NW-FORE-DECK)
+ (SW TO NW-AFT-DECK)
+ (SOUTH TO NW-AFT-DECK)
+ (WEST "There's a bulkhead there.")
+ (GLOBAL OCEAN DECK TRAWLER RAILING IN-WINDOW)
+ (LINE 4)
+ (STATION NW-STARBOARD-DECK)
+ (ACTION NW-STARBOARD-DECK-F)>
+
+<ROUTINE NW-STARBOARD-DECK-F (RARG)
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <MOVE ,BUNK ,NW-CREW-QTRS>
+ <MOVE ,UNDER-BUNK ,NW-CREW-QTRS>
+ <MOVE ,STOVE ,NW-GALLEY>
+ ;<MOVE ,CUPBOARDS ,NW-GALLEY>
+ <MOVE ,DECK-CHAIR ,NW-FORE-DECK>
+ ;<MOVE ,REDS-LAMP ,NW-CAPT-CABIN>
+ <MOVE ,REDS-BUNK ,NW-CAPT-CABIN>
+ <MOVE ,LOUNGE-CHAIR ,NW-LOUNGE>
+ ;<MOVE ,PROW-LIGHT ,NW-FORE-DECK>
+ <COND (<IN? ,PETE ,NW-GALLEY>
+ <MOVE ,FOOD ,STOVE>
+ <FSET ,FOOD ,NDESCBIT>)>
+ <COND (<AND ,WATER-DELIVERED
+ <==? ,TRAWLER ,SHIP-CHOSEN>>
+ <MOVE ,DRINKING-WATER ,NW-GALLEY>
+ <FSET ,DRINKING-WATER ,NDESCBIT>)>
+ <RFALSE>)
+ (<EQUAL? .RARG ,M-LOOK>
+ <TELL-FOO-SIDE ,TRAWLER "starboard" "port">
+ <RTRUE>)>>
+
+<ROOM NW-PORT-DECK
+ (IN ROOMS)
+ (DESC "Port Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are on the port side of the Night Wind. The wheelhouse is to starboard.
+The teak deck is very well-kept. The ocean lies off to port.")
+ (NE TO NW-FORE-DECK)
+ (NORTH TO NW-FORE-DECK)
+ (SE TO NW-AFT-DECK)
+ (SOUTH TO NW-AFT-DECK)
+ (GLOBAL OCEAN DECK TRAWLER RAILING IN-WINDOW)
+ (LINE 4)
+ (STATION NW-PORT-DECK)>
+
+<ROOM NW-AFT-DECK
+ (IN ROOMS)
+ (DESC "Aft Deck")
+ (FLAGS RLANDBIT ONBIT)
+ (NE TO NW-STARBOARD-DECK)
+ (EAST TO NW-STARBOARD-DECK)
+ (NW TO NW-PORT-DECK)
+ (WEST TO NW-PORT-DECK)
+ (NORTH TO NW-WHEELHOUSE)
+ (DOWN TO NW-LOUNGE)
+ (GLOBAL OCEAN DECK TRAWLER RAILING LADDER-TOP)
+ (LINE 4)
+ (STATION NW-AFT-DECK)
+ (ACTION NW-AFT-DECK-F)>
+
+<ROUTINE NW-AFT-DECK-F (RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL-AFT-DECK>
+ <CRLF>)
+ (<EQUAL? .RARG ,M-FLASH>
+ <COND (<AND <IN? ,WEASEL ,NW-AFT-DECK>
+ ,AT-SEA
+ <NOT ,WEASEL-APPREHENDED>
+ <NOT <QUEUED? I-PENDULUM>>>
+ <ENABLE <QUEUE I-PENDULUM -1>>
+ <TELL-WEASEL-TOSSES>)>)>>
+
+<ROOM NW-WHEELHOUSE
+ (IN ROOMS)
+ (DESC "Wheelhouse")
+ (FLAGS RLANDBIT ONBIT)
+ (SOUTH TO NW-AFT-DECK)
+ (DOWN TO NW-GALLEY)
+ (GLOBAL DECK TRAWLER SALVAGER LADDER-TOP WINDOW OCEAN)
+ (LINE 4)
+ (STATION NW-AFT-DECK)
+ (PSEUDO "WHEEL" WHEEL-PSEUDO)
+ (ACTION NW-WHEELHOUSE-F)>
+
+<ROUTINE NW-WHEELHOUSE-F (RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You are in the wheelhouse of the " D ,TRAWLER ". The passageway leading
+out onto the deck lies abaft.">
+ <TELL-WHEELHOUSE ,SALVAGER>
+ <RTRUE>)
+ (<==? .RARG ,M-BEG>
+ <COND (<EQUAL? ,OCEAN ,PRSO ,PRSI>
+ <COND (<VERB? EXAMINE>
+ <TELL
+"You see the ocean through the window." CR>)
+ (T <TELL-YOU-CANT "from here.">)>)>)>>
+
+;<ROOM NW-HEAD
+ (IN ROOMS)
+ (DESC "Head")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in the small head on board the Night Wind. It's so small there's
+only enough room to turn around to get out aft.")
+ (SOUTH TO NW-LOCKER)
+ (GLOBAL DECK TRAWLER)
+ (LINE 4)
+ (STATION NW-LOCKER)>
+
+<ROOM NW-LOCKER
+ (IN ROOMS)
+ (DESC "Storage Locker")
+ (FLAGS RLANDBIT ONBIT)
+ ;(NORTH TO NW-HEAD)
+ (SOUTH TO NW-CREW-QTRS)
+ (GLOBAL DECK TRAWLER)
+ (LINE 4)
+ (PSEUDO "LOCKER" GLOBAL-ROOM-F)
+ (STATION NW-CREW-QTRS)
+ (ACTION NW-LOCKER-F)>
+
+<ROUTINE NW-LOCKER-F (RARG)
+ <COND (<EQUAL? .RARG ,M-LOOK>
+ <TELL
+"You are in a fairly empty storage locker. It must have been cleaned out
+after its last trawling expedition." ,SPARE-PARTS-STR CR>)>>
+
+<OBJECT DRILL
+ (IN NW-LOCKER)
+ (DESC "portable drill")
+ (SYNONYM DRILL BIT PANEL SWITCH)
+ (ADJECTIVE WATERP PORTAB ;BATTER ;OPERAT ;DRILL)
+ (FLAGS TAKEBIT CONTBIT TOOLBIT)
+ (CAPACITY 3)
+ (STATION 25) ;"metal content"
+ (CONTFCN DRILL-F)
+ (ACTION DRILL-F)>
+
+<ROUTINE TELL-SWITCH (STR)
+ <TELL "The switch is now in the \"" .STR "\" position." CR>>
+
+<ROUTINE DRILL-F ("OPTIONAL" (RARG <>))
+ <COND (<==? .RARG ,M-CONT>
+ <COND (<AND <VERB? TAKE>
+ <PRSO? ,BATTERY>>
+ <COND (<ITAKE>
+ <TELL "Taken.">
+ <COND (,DRILL-POWERED
+ <SETG DRILL-POWERED <>>
+ <COND (,DRILL-ON
+ <DISABLE <INT I-DRILL>>
+ <TELL
+ " The drill bit winds to a halt.">)>)>
+ <CRLF>)>
+ <RTRUE>)>)
+ (<AND <VERB? LAMP-ON>
+ <PRSO? ,DRILL>>
+ <COND (,DRILL-ON
+ <TELL-ALREADY "on">)
+ (,DRILL-POWERED
+ <SETG DRILL-ON T>
+ <ENABLE <INT I-DRILL>>
+ <TELL "The drill bit begins to spin." CR>)
+ (T
+ <SETG DRILL-ON T>
+ <TELL-SWITCH "on">)>)
+ (<AND <VERB? LAMP-OFF>
+ <PRSO? ,DRILL>>
+ <COND (<NOT ,DRILL-ON>
+ <TELL-ALREADY "off">)
+ (,DRILL-POWERED
+ <SETG DRILL-ON <>>
+ <DISABLE <INT I-DRILL>>
+ <TELL "The drill bit stops spinning." CR>)
+ (T
+ <SETG DRILL-ON <>>
+ <TELL-SWITCH "off">)>)
+ (<VERB? EXAMINE>
+ <TELL "This waterproof wonder features a permanent bit">
+ <COND (<QUEUED? I-DRILL>
+ <TELL " which is turning">)>
+ <TELL ", a panel which is ">
+ <COND (<FSET? ,DRILL ,OPENBIT>
+ <TELL "open">
+ <COND (,DRILL-POWERED
+ <TELL " with a C battery inside">)
+ (T <TELL ", revealing space for a C battery">)>)
+ (T <TELL "closed">)>
+ <TELL ", and a switch which is in the \"">
+ <COND (,DRILL-ON <TELL "on">) (T <TELL "off">)>
+ <TELL "\" position." CR>)
+ (<VERB? LOOK-INSIDE>
+ <PERFORM ,V?EXAMINE ,DRILL>
+ <RTRUE>)
+ (<AND <VERB? OPEN>
+ <IN? ,BATTERY ,DRILL>
+ <==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <NOT <AIRTIGHT-ROOM?>>>
+ <FSET ,BATTERY ,RMUNGBIT>
+ <SETG DRILL-POWERED <>>
+ <RFALSE>)
+ (<PRSI? ,DRILL>
+ <COND (<VERB? PUT>
+ <COND (<NOT <FSET? ,DRILL ,OPENBIT>>
+ <SETG P-IT-OBJECT ,DRILL>
+ <TELL-CLOSED "panel">)
+ (<PRSO? ,BATTERY>
+ <MOVE ,BATTERY ,DRILL>
+ <COND (<FSET? ,BATTERY ,RMUNGBIT>
+ <TELL-NOW ,BATTERY "in the drill">
+ <RTRUE>)>
+ <SETG DRILL-POWERED T>
+ <COND (,DRILL-ON
+ <ENABLE <INT I-DRILL>>
+ <TELL "The drill bit starts spinning." CR>)
+ (T
+ <TELL-NOW ,BATTERY "in the drill">)>)
+ (T <TELL-NO-FIT>)>)
+ (<VERB? TAKE ASK-ABOUT TELL PUT-AGAINST PUT-ON>
+ <RFALSE>)
+ (<AND <OR <NOT ,DRILL-ON>
+ <NOT ,DRILL-POWERED>>
+ <NOT <PRSO? ,GLOBAL-TIME>>>
+ <SETG P-IT-OBJECT ,DRILL>
+ <TELL "The " D ,DRILL " isn't running!" CR>)>)>>
+
+<GLOBAL DRILL-ON <>>
+<GLOBAL DRILL-POWERED <>>
+
+<OBJECT HOLE-1
+ (IN LOCAL-GLOBALS)
+ ;(DESC "hole")
+ (SDESC "hole you drilled")
+ (FLAGS INVISIBLE NDESCBIT)
+ (SYNONYM HOLE DRILLE)
+ (ADJECTIVE FIRST 1ST HOLE I)
+ (ACTION GENERIC-HOLE-F)>
+
+<OBJECT HOLE-2
+ (IN LOCAL-GLOBALS)
+ ;(DESC "hole")
+ (SDESC "second hole you drilled")
+ (FLAGS INVISIBLE NDESCBIT)
+ (SYNONYM HOLE DRILLE)
+ (ADJECTIVE SECOND 2ND HOLE I)
+ (ACTION GENERIC-HOLE-F)>
+
+<ROUTINE GENERIC-HOLE-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "As holes go, it's very nice." CR>)
+ (<VERB? LOOK-INSIDE>
+ <TELL "You see nothing new." CR>)
+ (<VERB? REACH-IN>
+ <TELL "It's not that big." CR>)>>
+
+<ROUTINE ADD-HOLE (OBJ "AUX" I)
+ <COND (<FSET? ,HOLE-1 ,INVISIBLE>
+ <FCLEAR ,HOLE-1 ,INVISIBLE>
+ <MOVE ,HOLE-1 .OBJ>)
+ (<FSET? ,HOLE-2 ,INVISIBLE>
+ <FCLEAR ,HOLE-2 ,INVISIBLE>
+ <PUTP ,HOLE-1 ,P?SDESC "first hole you drilled">
+ <MOVE ,HOLE-2 .OBJ>)
+ (T <TELL "The drill should be dead now." CR>)>
+ <SET I <INT I-DRILL>>
+ <PUT .I ,C-TICK <- <GET .I ,C-TICK> 1>>
+ <COND (<0? <GET .I ,C-TICK>>
+ <I-DRILL>)>
+ <RTRUE>>
+
+<ROOM NW-CREW-QTRS
+ (IN ROOMS)
+ (DESC "Crew's Quarters")
+ (FLAGS RLANDBIT ONBIT)
+ (NORTH TO NW-LOCKER)
+ (SOUTH TO NW-GALLEY)
+ (UP TO NW-FORE-DECK)
+ (GLOBAL DECK TRAWLER LADDER-BOTTOM)
+ (LINE 4)
+ (STATION NW-CREW-QTRS)
+ (PSEUDO "BUNKS" BUNKS-PSEUDO)
+ (ACTION NW-CREW-QTRS-F)>
+
+<ROUTINE TELL-CREW-QTRS ()
+ <TELL
+"You are below deck in the crew's quarters. Narrow, uncomfortable bunks
+line the bulkheads, and you note the similarity between this area and a
+sardine can. Sleeping here is necessary but uninviting. A ladder leads
+up and out to the fore deck." CR>>
+
+<ROUTINE NW-CREW-QTRS-F (RARG "AUX" W)
+ <COND (<==? .RARG ,M-LOOK>
+ <TELL-CREW-QTRS>)
+ (<==? .RARG ,M-ENTER>
+ <MOVE-SHARED-OBJECTS ,NW-CREW-QTRS>
+ <RFALSE>)
+ ;(<==? .RARG ,M-BEG>
+ <COND (<AND <NOT ,GROGGIED>
+ ,AT-SEA
+ <SET W <W-KLUDGE>>>
+ <SETG GROGGIED T>
+ <START-SENTENCE .W>
+ <TELL " looks up groggily. ">
+ <RFALSE>)>)>>
+
+<ROOM NW-GALLEY
+ (IN ROOMS)
+ (DESC "Galley")
+ (FLAGS RLANDBIT ONBIT)
+ ;(LDESC
+"You are in the Night Wind's tiny galley. A stove and a small
+table are all that are here. A ladder leads
+up through the deck overhead to the wheelhouse for feeding the captain
+in rough weather.")
+ (NORTH TO NW-CREW-QTRS)
+ (SOUTH TO NW-LOUNGE)
+ (UP TO NW-WHEELHOUSE)
+ (GLOBAL DECK TRAWLER LADDER-BOTTOM)
+ (LINE 4)
+ (STATION NW-GALLEY)
+ (ACTION NW-GALLEY-F)>
+
+<ROUTINE NW-GALLEY-F (RARG)
+ <GENERIC-GALLEY-F .RARG ,NW-GALLEY>>
+
+<ROOM NW-LOUNGE
+ (IN ROOMS)
+ (DESC "Lounge")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in the crew's lounge, a cramped cabin with little more than
+a table and a few chairs. To aft is the captain's cabin, while
+the galley lies forward. A ladder leads into the engine room.")
+ (NORTH TO NW-GALLEY)
+ (SOUTH TO NW-CAPT-CABIN)
+ (UP TO NW-AFT-DECK)
+ (DOWN TO NW-ENGINE-ROOM)
+ (GLOBAL DECK TRAWLER LADDER-BOTTOM LADDER-TOP)
+ (LINE 4)
+ (STATION NW-LOUNGE)
+ (ACTION NW-LOUNGE-F)>
+
+<ROUTINE NW-LOUNGE-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,GLOBAL-SURFACE ,P?SDESC "table">
+ <MOVE-SHARED-OBJECTS ,NW-LOUNGE>
+ <RFALSE>)>>
+
+<ROOM NW-CAPT-CABIN
+ (IN ROOMS)
+ (DESC "Captain's Cabin")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in the captain's cabin. A large and
+comfortable-looking bunk is one of the many comforts in the
+cabin. The forward doorway leads to the crew's lounge.")
+ (NORTH TO NW-LOUNGE)
+ (GLOBAL DECK TRAWLER)
+ (LINE 4)
+ (STATION NW-LOUNGE)>
+
+<ROOM NW-ENGINE-ROOM
+ (IN ROOMS)
+ (DESC "Engine Room")
+ (FLAGS RLANDBIT ONBIT)
+ (UP TO NW-LOUNGE)
+ (GLOBAL DECK TRAWLER LADDER-BOTTOM)
+ (LINE 4)
+ (DESCFCN 100) ;"metal content"
+ (PSEUDO "ENGINE" ENGINE-PSEUDO)
+ (STATION NW-LOUNGE)
+ (ACTION NW-ENGINE-ROOM-F)>
+
+<ROUTINE NW-ENGINE-ROOM-F (RARG)
+ <COND (<==? .RARG ,M-LOOK>
+ <TELL
+"You are in a tiny, smelly space where it is difficult to breathe.
+By your feet lie the diesel engines of the " D ,TRAWLER "." CR>)>> \ No newline at end of file
diff --git a/clock.zap b/clock.zap
new file mode 100644
index 0000000..d30f8c3
--- /dev/null
+++ b/clock.zap
@@ -0,0 +1,98 @@
+
+
+ .FUNCT QUEUE,RTN,TICK,CINT
+ CALL INT,RTN >CINT
+ PUT CINT,C-TICK,TICK
+ RETURN CINT
+
+
+ .FUNCT INT,RTN,E,C,INT
+ ADD C-TABLE,C-TABLELEN >E
+ ADD C-TABLE,C-INTS >C
+?PRG1: EQUAL? C,E \?ELS5
+ SUB C-INTS,C-INTLEN >C-INTS
+ ADD C-TABLE,C-INTS >INT
+ PUT INT,C-RTN,RTN
+ RETURN INT
+?ELS5: GET C,C-RTN
+ EQUAL? STACK,RTN \?CND3
+ RETURN C
+?CND3: ADD C,C-INTLEN >C
+ JUMP ?PRG1
+
+
+ .FUNCT ENABLED?,RTN,C,E
+ ADD C-TABLE,C-TABLELEN >E
+ ADD C-TABLE,C-INTS >C
+?PRG1: EQUAL? C,E /FALSE
+ GET C,C-RTN
+ EQUAL? STACK,RTN \?CND3
+ GET C,C-ENABLED?
+ ZERO? STACK \TRUE
+ RFALSE
+?CND3: ADD C,C-INTLEN >C
+ JUMP ?PRG1
+
+
+ .FUNCT QUEUED?,RTN,C,E
+ ADD C-TABLE,C-TABLELEN >E
+ ADD C-TABLE,C-INTS >C
+?PRG1: EQUAL? C,E /FALSE
+ GET C,C-RTN
+ EQUAL? STACK,RTN \?CND3
+ GET C,C-ENABLED?
+ ZERO? STACK /FALSE
+ GET C,C-TICK
+ ZERO? STACK \TRUE
+ RFALSE
+?CND3: ADD C,C-INTLEN >C
+ JUMP ?PRG1
+
+
+ .FUNCT CLOCKER,C,E,TICK,FLG=0,VAL
+ ZERO? CLOCK-WAIT /?CND1
+ SET 'CLOCK-WAIT,FALSE-VALUE
+ RFALSE
+?CND1: INC 'PRESENT-TIME
+ GRTR? PRESENT-TIME,1439 \?CND5
+ SUB PRESENT-TIME,1440 >PRESENT-TIME
+?CND5: ZERO? WATCH-WOUND /?CND8
+ IGRTR? 'WATCH-MOVES,59 \?CND8
+ SUB WATCH-MOVES,60 >WATCH-MOVES
+ IGRTR? 'WATCH-SCORE,11 \?CND12
+ SET 'WATCH-SCORE,0
+?CND12:
+?CND8: CALL WATCH-UPDATE
+ ADD C-TABLE,C-INTS >C
+ ADD C-TABLE,C-TABLELEN >E
+?PRG18: EQUAL? C,E \?ELS22
+ RETURN FLG
+?ELS22: GET C,C-ENABLED?
+ ZERO? STACK /?CND20
+ GET C,C-TICK >TICK
+ ZERO? TICK \?ELS27
+ JUMP ?CND20
+?ELS27: SUB TICK,1
+ PUT C,C-TICK,STACK
+ GRTR? TICK,1 /?CND25
+ GET C,C-RTN
+ CALL STACK >VAL
+ ZERO? VAL /?CND25
+ ZERO? FLG /?THN38
+ EQUAL? VAL,M-FATAL \?CND20
+?THN38: SET 'FLG,VAL
+?CND25:
+?CND20: ADD C,C-INTLEN >C
+ JUMP ?PRG18
+
+
+ .FUNCT WATCH-UPDATE
+ IN? WATCH,PLAYER \?ELS5
+ SET 'MOVES,WATCH-MOVES
+ SET 'SCORE,WATCH-SCORE
+ RETURN SCORE
+?ELS5: SET 'MOVES,99
+ SET 'SCORE,111
+ RETURN SCORE
+
+ .ENDI
diff --git a/clock.zil b/clock.zil
new file mode 100644
index 0000000..2997bcf
--- /dev/null
+++ b/clock.zil
@@ -0,0 +1,108 @@
+"CLOCK for TOA #2
+Copyright (C) 1984 Infocom, Inc. All rights reserved."
+
+<CONSTANT C-TABLELEN 246>
+
+<GLOBAL C-TABLE <ITABLE NONE %<COND (<GASSIGNED? PREDGEN> 123) (T 246)>>>
+
+;<GLOBAL C-DEMONS 300>
+
+<GLOBAL C-INTS 246>
+
+<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 "AUX" E C INT)
+ #DECL ((RTN) ATOM (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>>>>
+
+<ROUTINE ENABLED? (RTN "AUX" C E)
+ <SET E <REST ,C-TABLE ,C-TABLELEN>>
+ <SET C <REST ,C-TABLE ,C-INTS>>
+ <REPEAT ()
+ <COND (<==? .C .E> <RFALSE>)
+ (<EQUAL? <GET .C ,C-RTN> .RTN>
+ <COND (<0? <GET .C ,C-ENABLED?>> <RFALSE>)
+ (T <RTRUE>)>)>
+ <SET C <REST .C ,C-INTLEN>>>>
+
+<ROUTINE QUEUED? (RTN "AUX" C E)
+ <SET E <REST ,C-TABLE ,C-TABLELEN>>
+ <SET C <REST ,C-TABLE ,C-INTS>>
+ <REPEAT ()
+ <COND (<==? .C .E> <RFALSE>)
+ (<EQUAL? <GET .C ,C-RTN> .RTN>
+ <COND (<OR <0? <GET .C ,C-ENABLED?>>
+ <0? <GET .C ,C-TICK>>>
+ <RFALSE>)
+ (T <RTRUE>)>)>
+ <SET C <REST .C ,C-INTLEN>>>>
+
+<GLOBAL CLOCK-WAIT <>>
+
+<ROUTINE CLOCKER ("AUX" C E TICK (FLG <>) VAL)
+ #DECL ((C E) <PRIMTYPE VECTOR> (TICK) FIX ;(FLG) ;<OR FALSE ATOM>)
+ <COND (,CLOCK-WAIT <SETG CLOCK-WAIT <>> <RFALSE>)>
+ <SETG PRESENT-TIME <+ ,PRESENT-TIME 1>>
+ <COND (<G? ,PRESENT-TIME 1439>
+ <SETG PRESENT-TIME <- ,PRESENT-TIME 1440>>)>
+ ;<COND (<G? ,PRESENT-TIME 1019>
+ <SETG BUSINESS-HOURS? <>>)
+ (<G? ,PRESENT-TIME 539>
+ <SETG BUSINESS-HOURS? T>)>
+ <COND (,WATCH-WOUND
+ <COND (<G? <SETG WATCH-MOVES <+ ,WATCH-MOVES 1>> 59>
+ <SETG WATCH-MOVES <- ,WATCH-MOVES 60>>
+ <COND (<G? <SETG WATCH-SCORE <+ ,WATCH-SCORE 1>> 11>
+ <SETG WATCH-SCORE 0>)>)>)>
+ <WATCH-UPDATE>
+ <SET C <REST ,C-TABLE ,C-INTS ;<COND (,P-WON ,C-INTS) (T ,C-DEMONS)>>>
+ <SET E <REST ,C-TABLE ,C-TABLELEN>>
+ <REPEAT ()
+ <COND (<==? .C .E> <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>>
+ <SET VAL <APPLY <GET .C ,C-RTN>>>>
+ ;<COND (,DEBUG
+ <TELL "[Interrupt returning T.]" CR>)>
+ <COND (<OR <NOT .FLG>
+ <==? .VAL ,M-FATAL>>
+ <SET FLG .VAL>)>)>)>)>
+ <SET C <REST .C ,C-INTLEN>>>>
+
+<ROUTINE WATCH-UPDATE ()
+ <COND (<IN? ,WATCH ,PLAYER>
+ <SETG MOVES ,WATCH-MOVES>
+ <SETG SCORE ,WATCH-SCORE>)
+ (T
+ <SETG MOVES 99>
+ <SETG SCORE 111>)>>
diff --git a/events.zap b/events.zap
new file mode 100644
index 0000000..2b4c12a
--- /dev/null
+++ b/events.zap
@@ -0,0 +1,1392 @@
+
+
+ .FUNCT I-UNWOUND
+ SET 'WATCH-WOUND,FALSE-VALUE
+ RFALSE
+
+
+ .FUNCT I-BUSINESS-HOURS
+ ZERO? BUSINESS-HOURS? /?ELS5
+ SET 'BUSINESS-HOURS?,FALSE-VALUE
+ IN? PLAYER,MCGINTY-HQ \?ELS9
+ MOVE PLAYER,WHARF-ROAD-2
+ SET 'HERE,WHARF-ROAD-2
+ PRINTI """Closing time,"" says "
+ CALL DPRINT,MCGINTY
+ PRINTI " as he escorts you out to the street..."
+ CRLF
+ CRLF
+ CALL V-FIRST-LOOK
+ RTRUE
+?ELS9: IN? PLAYER,OUTFITTERS-HQ \?ELS13
+ MOVE PLAYER,WHARF-ROAD-4
+ SET 'HERE,WHARF-ROAD-4
+ PRINTI """Sorry, but it's closing time,"" the salesman says, then shows you out..."
+ CRLF
+ CRLF
+ CALL V-FIRST-LOOK
+ RTRUE
+?ELS13: IN? PLAYER,BANK \FALSE
+ MOVE PLAYER,SHORE-ROAD-2
+ SET 'HERE,SHORE-ROAD-2
+ PRINTI "The teller says, ""You'll have to leave. It's 5:00."" A guard escorts you out..."
+ CRLF
+ CRLF
+ CALL V-FIRST-LOOK
+ RTRUE
+?ELS5: SET 'BUSINESS-HOURS?,TRUE-VALUE
+ CALL QUEUE,I-BUSINESS-HOURS,480
+ PUT STACK,0,1
+ RFALSE
+
+
+ .FUNCT I-FERRY-APPROACHING
+ CALL QUEUE,I-FERRY-APPROACHING,-1
+ PUT STACK,0,1
+ FCLEAR FERRY,INVISIBLE
+ IN? WEASEL,GLOBAL-FERRY \?CND1
+ MOVE WEASEL,FERRY
+?CND1: EQUAL? HERE,FERRY-LANDING,SHORE-ROAD-1,SHORE-ROAD-2 \FALSE
+ PRINTR "The ferry approaches the landing."
+
+
+ .FUNCT I-FERRY,WEASEL-HERE?=0
+ CALL INT,I-FERRY-APPROACHING
+ PUT STACK,0,0
+ CALL QUEUE,I-FERRY-LEAVING,5
+ PUT STACK,0,1
+ CALL QUEUE,I-FERRY-GONE,8
+ PUT STACK,0,1
+ MOVE FERRY,FERRY-LANDING
+ IN? WEASEL,FERRY-LANDING \?ELS3
+ CALL QUEUED?,I-TRAITOR-MEETING
+ ZERO? STACK \?ELS3
+ SET 'WEASEL-HERE?,TRUE-VALUE
+ MOVE WEASEL,FERRY
+ JUMP ?CND1
+?ELS3: IN? WEASEL,FERRY \?CND1
+ MOVE WEASEL,FERRY-LANDING
+ IN? JOHNNY,FERRY-LANDING \?ELS10
+ ZERO? WEASEL-BLOWN /?ELS10
+ CALL ROUGH-JUSTICE
+ JUMP ?CND1
+?ELS10: EQUAL? SHIP-CHOSEN,TRAWLER \?ELS14
+ CALL ESTABLISH-GOAL,WEASEL,NW-CREW-QTRS
+ JUMP ?CND1
+?ELS14: EQUAL? SHIP-CHOSEN,SALVAGER \?CND1
+ CALL ESTABLISH-GOAL,WEASEL,MM-CREW-QTRS
+?CND1: EQUAL? HERE,FERRY-LANDING \?ELS21
+ PRINTI "The ferry arrives. Some passengers get off and others get on."
+ ZERO? WEASEL-HERE? /?ELS26
+ CALL TELL-FERRY-KLUDGE,STR?430
+ JUMP ?CND24
+?ELS26: IN? WEASEL,FERRY-LANDING \?CND24
+ CALL QUEUED?,I-TRAITOR-MEETING
+ ZERO? STACK \?CND24
+ CALL TELL-FERRY-KLUDGE,STR?431
+ IN? ENVELOPE,PLAYER \?CND24
+ CRLF
+ CALL WEASEL-BEATS-YOU
+?CND24: CRLF
+ RTRUE
+?ELS21: EQUAL? HERE,SHORE-ROAD-1,SHORE-ROAD-2 \FALSE
+ PRINTR "The ferry arrives at the landing."
+
+
+ .FUNCT TELL-FERRY-KLUDGE,STR
+ PRINTI " The Weasel "
+ PRINT STR
+ PRINTI "."
+ RTRUE
+
+
+ .FUNCT I-FERRY-LEAVING
+ CALL QUEUE,I-FERRY-LEAVING,-1
+ PUT STACK,0,1
+ MOVE FERRY,LOCAL-GLOBALS
+ IN? WEASEL,FERRY \?CND1
+ IN? PASSBOOK,WEASEL \?CND1
+ MOVE WEASEL,LOCAL-GLOBALS
+?CND1: EQUAL? HERE,FERRY-LANDING,SHORE-ROAD-1,SHORE-ROAD-2 \FALSE
+ PRINTR "The ferry pulls away, heading for the mainland."
+
+
+ .FUNCT I-FERRY-GONE
+ CALL INT,I-FERRY-LEAVING
+ PUT STACK,0,0
+ CALL QUEUE,I-FERRY-APPROACHING,109
+ PUT STACK,0,1
+ CALL QUEUE,I-FERRY,112
+ PUT STACK,0,1
+ FSET FERRY,INVISIBLE
+ IN? WEASEL,FERRY \FALSE
+ MOVE WEASEL,GLOBAL-FERRY
+ RFALSE
+
+
+ .FUNCT I-DISGUSTING-WEASEL-KLUDGE,WGT
+ IN? PASSBOOK,WEASEL /FALSE
+ GET GOAL-TABLES,WEASEL-C >WGT
+ GET WGT,GOAL-F
+ EQUAL? STACK,SHANTY /FALSE
+ PUT WGT,ATTENTION,0
+ CALL ESTABLISH-GOAL,WEASEL,SHANTY
+ RFALSE
+
+
+ .FUNCT I-FIRST-MEETING
+ EQUAL? FM-CTR,5 \?ELS5
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ RFALSE
+?ELS5: IN? JOHNNY,SHANTY \FALSE
+ IN? PETE,SHANTY \FALSE
+ CALL META-LOC,PLAYER
+ EQUAL? STACK,SHANTY \FALSE
+ ZERO? FM-CTR \?ELS14
+ GRTR? PRESENT-TIME,535 \?CND15
+ CALL I-PLOT-NEVER-STARTS
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ RFALSE
+?CND15: SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTI """Sit down and we'll talk,"" "
+ CALL DPRINT,JOHNNY
+ PRINTR " says."
+?ELS14: EQUAL? FM-CTR,1 \?ELS21
+ IN? WEASEL,SHANTY \?ELS26
+ SET 'FM-CTR,2
+ CALL I-FIRST-MEETING
+ RSTACK
+?ELS26: ZERO? WAITING-FOR-WEASEL /?ELS28
+ GRTR? PRESENT-TIME,525 \FALSE
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ CALL I-PLOT-NEVER-STARTS
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTI "Pete looks at Johnny and says, ""Weasel ain't gonna show.""
+""Guess not,"" replies Johnny. ""Without "
+ CALL DPRINT,WEASEL
+ PRINTR ", there's no deal. Who knows what that creep is up to?"""
+?ELS28: SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTI "Johnny says, ""When "
+ CALL DPRINT,WEASEL
+ PRINTI " shows, I'll tell ya what we got."""
+ CRLF
+ SET 'WAITING-FOR-WEASEL,TRUE-VALUE
+ RETURN WAITING-FOR-WEASEL
+?ELS21: GRTR? BLOOD-ALCOHOL,10 \?ELS42
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ CALL I-PLOT-NEVER-STARTS
+ PRINTR "Pete turns to Johnny and says, ""This joker's drunk!""
+""Yeah,"" Johnny says. He looks at you. ""Some diver! We'll find someone else."""
+?ELS42: EQUAL? FM-CTR,2 \?ELS46
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTI "At Pete's request, "
+ CALL DPRINT,WEASEL
+ PRINTI " joins you. Johnny then whispers that he's come across some sunken "
+ CALL DPRINT,GLOBAL-TREASURE
+ PRINTI "."
+ CRLF
+ SET 'FM-CTR,3
+ SET 'I-WAIT-RTN,I-FIRST-MEETING
+ SET 'I-WAIT-DURATION,2
+ RETURN I-WAIT-DURATION
+?ELS46: EQUAL? FM-CTR,3 \?ELS50
+ ZERO? I-WAIT-FLAG /?ELS55
+ PRINTI "Unfortunately, this interrupts Johnny's explanation of what the meeting is about."
+ CRLF
+ SET 'I-WAIT-DURATION,2
+ RETURN I-WAIT-DURATION
+?ELS55: GRTR? I-WAIT-DURATION,0 \?ELS60
+ EQUAL? I-WAIT-RTN,I-FIRST-MEETING /FALSE
+?ELS60: SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTI "Johnny explains that they need more money to get started. They chose you because they know you've salted some money away and you're a great diver. He asks if you're interested in the deal."
+ CRLF
+ SET 'FM-CTR,4
+ RETURN FM-CTR
+?ELS50: EQUAL? FM-CTR,4 \FALSE
+ GRTR? PRESENT-TIME,539 \?ELS73
+ EQUAL? PRSA,V?NO,V?YES /?ELS73
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ CALL I-PLOT-NEVER-STARTS
+ PRINTR "Pete turns to Johnny. ""We don't want anyone who can't decide.""
+""Right,"" says Johnny. ""We'll find someone else."" He turns to you. ""Say a word about this and you're history!"""
+?ELS73: SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR """Well, what is it? Yes or no?"" Pete asks anxiously."
+
+
+ .FUNCT SAMPLE-TREASURE-F
+ EQUAL? PRSA,V?TAKE /?THN6
+ EQUAL? PRSA,V?ASK-FOR \?ELS5
+ EQUAL? PRSO,JOHNNY \?ELS5
+?THN6: IN? MCGINTY,HERE \?ELS14
+ CALL PERFORM,V?TELL,MCGINTY,SAMPLE-TREASURE
+ RTRUE
+?ELS14: PRINTR "Red pulls it back. ""If we get the loot, there'll be plenty for all."""
+?ELS5: EQUAL? PRSA,V?TURN \FALSE
+ CALL DPRINT,JOHNNY
+ PRINTR " has it."
+
+
+ .FUNCT I-SECOND-MEETING
+ GRTR? PRESENT-TIME,585 \?CND1
+ LESS? SM-CTR,2 /?THN6
+ GRTR? HOW-HUNGRY,3 \?CND1
+?THN6: CALL ALL-GO-HOME
+ CALL I-PLOT-NEVER-STARTS
+ SET 'SM-CTR,4
+?CND1: EQUAL? SM-CTR,4 \?ELS12
+ CALL INT,I-SECOND-MEETING
+ PUT STACK,0,0
+ RTRUE
+?ELS12: EQUAL? HERE,WINDING-ROAD-1 /?ELS14
+ CALL INT,I-SECOND-MEETING
+ PUT STACK,0,0
+ RTRUE
+?ELS14: GRTR? SM-CTR,1 \?ELS16
+ IN? MCGINTY,WINDING-ROAD-1 /?THN19
+ IN? MCGINTY,WINDING-ROAD-2 \?ELS16
+?THN19: CALL JIGS-UP,STR?434
+ RSTACK
+?ELS16: LESS? SM-CTR,2 \?ELS22
+ IN? WEASEL,WINDING-ROAD-1 \?ELS27
+ IN? JOHNNY,WINDING-ROAD-1 \?ELS27
+ IN? PETE,WINDING-ROAD-1 \?ELS27
+ SET 'SM-CTR,2
+ CALL I-SECOND-MEETING
+ RTRUE
+?ELS27: ZERO? SM-CTR \FALSE
+ IN? JOHNNY,WINDING-ROAD-1 \FALSE
+ SET 'SM-CTR,1
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR "Johnny says, ""We'll start when everyone's here."""
+?ELS22: GRTR? BLOOD-ALCOHOL,10 \?ELS40
+ SET 'SM-CTR,4
+ CALL INT,I-SECOND-MEETING
+ PUT STACK,0,0
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ CALL ALL-GO-HOME
+ CALL I-PLOT-NEVER-STARTS
+ PRINTI """I won't risk everything on a drunk diver!"" "
+ CALL DPRINT,WEASEL
+ PRINTR " says.
+""You're right,"" says Johnny. ""We're calling this off."""
+?ELS40: EQUAL? SM-CTR,2 \?ELS44
+ RANDOM 2 >WRECK-FOUND
+ EQUAL? WRECK-FOUND,1 \?ELS47
+ SET 'SAMPLE-TREASURE,GOLD-COIN
+ JUMP ?CND45
+?ELS47: SET 'SAMPLE-TREASURE,DINNER-PLATE
+?CND45: PUTP SAMPLE-TREASURE,P?ACTION,SAMPLE-TREASURE-F
+ MOVE SAMPLE-TREASURE,JOHNNY
+ SET 'P-IT-OBJECT,SAMPLE-TREASURE
+ SET 'SM-CTR,3
+ SET 'I-WAIT-DURATION,6
+ SET 'I-WAIT-RTN,I-SECOND-MEETING
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTI "Johnny nods, then pulls out "
+ CALL APRINT,SAMPLE-TREASURE
+ PRINTR " he says he came across while on a shark hunt."
+?ELS44: EQUAL? SM-CTR,3 \FALSE
+ ZERO? I-WAIT-FLAG /?ELS58
+ PRINTI "This interrupts Johnny's explanation, which makes him angry."
+ CRLF
+ SET 'I-WAIT-DURATION,6
+ RETURN I-WAIT-DURATION
+?ELS58: GRTR? I-WAIT-DURATION,0 \?ELS63
+ EQUAL? I-WAIT-RTN,I-SECOND-MEETING /FALSE
+?ELS63: CALL INT,I-SECOND-MEETING
+ PUT STACK,0,0
+ SUB 705,PRESENT-TIME
+ CALL QUEUE,I-OTHERS-MEET,STACK
+ PUT STACK,0,1
+ SET 'SM-CTR,4
+ SET 'MEETINGS-COMPLETED,2
+ PUT MOVEMENT-GOALS,JOHNNY-C,JOHNNY-CONTINUES-TABLE
+ CALL IMOVEMENT,JOHNNY,I-JOHNNY
+ CALL RATING-UPD,20
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ CRLF
+ PRINTI """We're not sure which wreck to salvage,"" Johnny says. ""Since you're joining up, we're hoping you'll identify where the "
+ CALL DPRINT,SAMPLE-TREASURE
+ PRINTI " came from, and then do the dive for us. I'll captain, Pete will cook, and "
+ CALL DPRINT,WEASEL
+ PRINTI " will crew.
+
+Johnny winks at you. ""We'll need you to supply the minutes of longitude and latitude of the wreck. Get $500 and meet me at Point Lookout at 10:45. Then we'll provision the boat.""
+
+He turns to the others. ""We'll meet in "
+ CALL DPRINT,SHANTY
+ PRINTR " at 11:45 to discuss final arrangements.
+
+""We're all in this now,"" Johnny says to the group. ""I'm not gonna chance this operation if one of you doesn't show. We need everyone to pull this off. If anyone tries anything stupid, you won't live to regret it."""
+
+
+ .FUNCT I-THIRD-MEETING,JMG
+ EQUAL? HERE,POINT-LOOKOUT /?ELS3
+ CALL INT,I-THIRD-MEETING
+ PUT STACK,0,0
+ RFALSE
+?ELS3: IN? JOHNNY,POINT-LOOKOUT \FALSE
+ LESS? TM-CTR,6 \?CND1
+ INC 'TM-CTR
+?CND1: IN? MCGINTY,POINT-LOOKOUT \?ELS15
+ CALL JIGS-UP,STR?435
+ RSTACK
+?ELS15: IN? MCGINTY,OCEAN-ROAD-3 \?ELS17
+ CALL IN-MOTION?,MCGINTY
+ ZERO? STACK \?ELS17
+ CALL JIGS-UP,STR?436
+ RSTACK
+?ELS17: EQUAL? TM-CTR,1 \?ELS21
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR "Johnny turns toward you. ""Well? Did you bring the money?"""
+?ELS21: GRTR? BLOOD-ALCOHOL,10 \?ELS25
+ CALL JIGS-UP,STR?437
+ RSTACK
+?ELS25: EQUAL? TM-CTR,4 \?ELS27
+ PRINTR "Johnny glares at you as if you were a sea slug."
+?ELS27: EQUAL? TM-CTR,5 \?ELS31
+ CALL JIGS-UP,STR?438
+ RSTACK
+?ELS31: EQUAL? TM-CTR,6 \?ELS33
+ SET 'TM-CTR,7
+ CALL RATING-UPD,20
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ CRLF
+ PRINTI """Glad you're with us. Since you're okay, I'll level with you. Before Hevlin died, he told me he gave you the book. He also said you could handle this job. He's the one who gave me the "
+ CALL DPRINT,SAMPLE-TREASURE
+ PRINTI ". I didn't want to say anything in front of Pete and "
+ CALL DPRINT,WEASEL
+ PRINTI " just in case.
+
+""We're gonna need a boat, but I don't know which one. If you need deep-sea diving gear, it'll have to be the "
+ CALL DPRINT,SALVAGER
+ PRINTI ". Is the "
+ CALL DPRINT,GLOBAL-TREASURE
+ PRINTR " more than 200 feet deep?"""
+?ELS33: EQUAL? TM-CTR,7 \?ELS37
+ GRTR? PRESENT-TIME,675 \?CND38
+ CALL JIGS-UP,STR?439
+?CND38: SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR "Johnny looks impatient. ""Don't confuse things. A yes or no will do."""
+?ELS37: EQUAL? TM-CTR,8 \FALSE
+ CALL ESTABLISH-GOAL,JOHNNY,OUTFITTERS-HQ
+ PUT MOVEMENT-GOALS,JOHNNY-C,JOHNNY-COMPLETES-TABLE
+ GET MOVEMENT-GOALS,JOHNNY-C >JMG
+ SUB 838,PRESENT-TIME
+ PUT JMG,MG-TIME,STACK
+ CALL IMOVEMENT,JOHNNY,I-JOHNNY
+ CALL INT,I-THIRD-MEETING
+ PUT STACK,0,0
+ SET 'MEETINGS-COMPLETED,3
+ PRINTI """We'll rent the "
+ CALL DPRINT,SHIP-CHOSEN
+ PRINTR ". Let's go get what we need."""
+
+
+ .FUNCT I-EQUIP,MCG-GT,V=0
+ IN? PLAYER,OUTFITTERS-HQ \?ELS5
+ IN? MCGINTY,OUTFITTERS-HQ \?ELS10
+ INC 'WARNING-CTR
+ EQUAL? WARNING-CTR,7 \?CND11
+ PRINTI "Johnny leans over and whispers, ""Let's wait out McGinty. He should leave soon."""
+ CRLF
+ SET 'V,TRUE-VALUE
+?CND11: GRTR? I-WAIT-DURATION,0 \?ELS20
+ SET 'I-WAIT-DURATION,0
+ SET 'I-WAIT-RTN,FALSE-VALUE
+ PRINTI "Johnny ends his conversation, and "
+ CALL DPRINT,MCGINTY
+ PRINTR " asks the salesman some questions."
+?ELS20: GET GOAL-TABLES,MCGINTY-C >MCG-GT
+ GET MCG-GT,GOAL-ENABLE
+ ZERO? STACK /?ELS24
+ GET MCG-GT,GOAL-F
+ EQUAL? STACK,MCGINTY-HQ \?ELS24
+ ZERO? MCGINTY-KNOWS \?CND27
+ SET 'MCGINTY-MEETS-WEASEL,TRUE-VALUE
+?CND27: SET 'I-WAIT-DURATION,9
+ SET 'I-WAIT-RTN,I-EQUIP
+ RFALSE
+?ELS24: EQUAL? PRSA,V?RENT,V?BUY \?ELS31
+ EQUAL? PRSO,FERRY-TOKEN /?ELS31
+ SET 'MCGINTY-KNOWS,TRUE-VALUE
+ CALL INT,I-MCGINTY-FOLLOWS
+ PUT STACK,0,0
+ CALL INT,I-EQUIP
+ PUT STACK,0,0
+ MOVE MCGINTY,WHARF-ROAD-4
+ CALL ESTABLISH-GOAL,MCGINTY,MCGINTY-HQ
+ CALL DPRINT,MCGINTY
+ PRINTI " grins as he realizes what you're up to."
+ CALL SAY-MCGINTY-KNOWS
+ RSTACK
+?ELS31: GRTR? PRESENT-TIME,699 \?ELS37
+ IN? JOHNNY,OUTFITTERS-HQ \?ELS42
+ CALL ESTABLISH-GOAL,JOHNNY,SHANTY
+ PRINTI "Johnny glares at "
+ CALL DPRINT,MCGINTY
+ PRINTR " and then at his watch. ""There's no way."" He turns to you. ""Forget it. We can't get this done in time."""
+?ELS42: CALL INT,I-MCGINTY-FOLLOWS
+ PUT STACK,0,0
+ CALL ESTABLISH-GOAL,MCGINTY,MCGINTY-HQ
+ CALL INT,I-EQUIP
+ PUT STACK,0,0
+ CALL DPRINT,MCGINTY
+ PRINTR " turns to the salesman. ""I think... yeah! I will need that boat after all."" He turns to you and grins."
+?ELS37: EQUAL? PRSA,V?WAIT-FOR,V?WAIT /?ELS50
+ EQUAL? PRSA,V?WALK,V?LOOK /?ELS50
+ PRINTI "Johnny glances nervously at "
+ CALL DPRINT,MCGINTY
+ PRINTR "."
+?ELS50: RETURN V
+?ELS10: ZERO? MCGINTY-KNOWS /?ELS58
+ CALL INT,I-EQUIP
+ PUT STACK,0,0
+ RFALSE
+?ELS58: ZERO? I-WAIT-FLAG /?ELS61
+ PRINTI "Johnny seems unhappy to have his conversation interrupted."
+ CRLF
+ SET 'I-WAIT-DURATION,9
+ RETURN I-WAIT-DURATION
+?ELS61: EQUAL? I-WAIT-RTN,I-EQUIP \?ELS66
+ GRTR? I-WAIT-DURATION,0 /FALSE
+ CALL ESTABLISH-GOAL,JOHNNY,SHANTY
+ SUB 870,PRESENT-TIME
+ CALL QUEUE,I-SHOVE-OFF,STACK
+ PUT STACK,0,1
+ CALL INT,I-EQUIP
+ PUT STACK,0,0
+ EQUAL? SHIP-CHOSEN,TRAWLER \?ELS76
+ RANDOM 50
+ ADD 50,STACK >AMT-OWED
+ JUMP ?CND74
+?ELS76: RANDOM 50
+ ADD 400,STACK >AMT-OWED
+?CND74: SET 'JOHNNY-MADE-DEAL,TRUE-VALUE
+ CALL RATING-UPD,20
+ PRINTI "Johnny hands him a list and the salesman quotes a price. Johnny gives him the money he has, then says to you, ""You'll need to chip in $"
+ PRINTN AMT-OWED
+ PRINTI " plus the money for your stuff. We'll leave on the "
+ CALL DPRINT,SHIP-CHOSEN
+ PRINTI " at high tide.""
+
+He tells the "
+ CALL DPRINT,SPEAR-CARRIER
+ PRINTR ", ""Deliver the stuff half an hour before high tide."" He turns back to you. ""Better be on board then to watch the stuff."""
+?ELS66: IN? MCGINTY,WHARF-ROAD-4 /FALSE
+ SET 'I-WAIT-DURATION,9
+ SET 'I-WAIT-RTN,I-EQUIP
+ RFALSE
+?ELS5: SET 'I-WAIT-DURATION,0
+ CALL INT,I-EQUIP
+ GET STACK,C-TICK
+ LESS? STACK,-15 \FALSE
+ CALL INT,I-EQUIP
+ PUT STACK,0,0
+ IN? JOHNNY,OUTFITTERS-HQ \?CND90
+ CALL ESTABLISH-GOAL,JOHNNY,SHANTY
+?CND90: CALL I-PLOT-NEVER-STARTS
+ RFALSE
+
+
+ .FUNCT TELL-NEED-BOAT
+ PRINTR " ""We will need that boat after all,"" he says to the salesman as he leaves."
+
+
+ .FUNCT SAY-MCGINTY-KNOWS
+ CALL TELL-NEED-BOAT
+ MOVE JOHNNY,WHARF-ROAD-3
+ CALL ZERO-ATTENTION,JOHNNY
+ CALL ESTABLISH-GOAL,JOHNNY,SHANTY
+ CRLF
+ PRINTR "Johnny glares at you. ""That was stupid! Now he's stopped us from renting the boat we need."" He storms out. You can't help feeling fortunate that someone else happened to be here."
+
+
+ .FUNCT I-OTHERS-MEET,V=1
+ GRTR? PRESENT-TIME,720 \?ELS3
+ CALL INT,I-OTHERS-MEET
+ PUT STACK,0,0
+ CALL I-PLOT-NEVER-STARTS
+ IN? PLAYER,CHAIR \?ELS6
+ PRINTI "Johnny tells Pete the deal's off."
+ CRLF
+ RETURN V
+?ELS6: IN? PLAYER,SHANTY \?ELS10
+ PRINTI "Johnny says something to Pete."
+ CRLF
+ RETURN V
+?ELS10: SET 'V,FALSE-VALUE
+ RETURN V
+?ELS3: IN? JOHNNY,SHANTY \?THN17
+ IN? PETE,SHANTY \?THN17
+ IN? WEASEL,SHANTY /?ELS16
+?THN17: CALL QUEUE,I-OTHERS-MEET,1
+ PUT STACK,0,1
+ RFALSE
+?ELS16: ZERO? JOHNNY-MADE-DEAL \?CND1
+ CALL I-PLOT-NEVER-STARTS
+?CND1: IN? PLAYER,CHAIR \?ELS25
+ PRINTI "Johnny tells Pete and "
+ CALL DPRINT,WEASEL
+ PRINTI " the deal's "
+ ZERO? JOHNNY-MADE-DEAL /?ELS30
+ PRINTI "on and to be at the "
+ CALL DPRINT,SHIP-CHOSEN
+ PRINTI " at 2:30"
+ JUMP ?CND28
+?ELS30: PRINTI "off"
+?CND28: PRINTR "."
+?ELS25: IN? PLAYER,SHANTY \FALSE
+ PRINTI "Johnny, Pete, and "
+ CALL DPRINT,WEASEL
+ PRINTR " are talking at a corner table."
+
+
+ .FUNCT I-TRAITOR-MEETING,FERRY-HERE=0
+ IN? WEASEL,FERRY /?THN6
+ ZERO? MCGINTY-KNOWS \?THN6
+ IN? MCGINTY,FERRY-LANDING /?ELS5
+?THN6: CALL INT,I-TRAITOR-MEETING
+ PUT STACK,0,0
+ RFALSE
+?ELS5: IN? WEASEL,FERRY-LANDING \FALSE
+ IN? ID-CARD,WEASEL \?ELS11
+ IN? PASSBOOK,WEASEL \?ELS16
+ IN? FERRY,FERRY-LANDING \?CND17
+ MOVE WEASEL,FERRY
+ SET 'FERRY-HERE,TRUE-VALUE
+?CND17: CALL INT,I-TRAITOR-MEETING
+ PUT STACK,0,0
+ IN? PLAYER,FERRY-LANDING \FALSE
+ CALL TELL-CORNER,FERRY-HERE,STR?440
+ RSTACK
+?ELS16: MOVE ID-CARD,MCGINTY
+ IN? FERRY,FERRY-LANDING \?CND27
+ MOVE WEASEL,FERRY
+ SET 'FERRY-HERE,TRUE-VALUE
+?CND27: CALL INT,I-TRAITOR-MEETING
+ PUT STACK,0,0
+ IN? PLAYER,FERRY-LANDING \FALSE
+ CALL TELL-CORNER,FERRY-HERE,STR?441
+ RSTACK
+?ELS11: MOVE ID-CARD,WEASEL
+ SET 'MCGINTY-MEETS-WEASEL,FALSE-VALUE
+ IN? PLAYER,FERRY-LANDING \FALSE
+ CALL DPRINT,MCGINTY
+ PRINTI " takes "
+ CALL DPRINT,WEASEL
+ PRINTR " to a corner of the landing, where they talk."
+
+
+ .FUNCT TELL-CORNER,FERRY-HERE,STR
+ CALL DPRINT,MCGINTY
+ PRINTI " and "
+ CALL DPRINT,WEASEL
+ PRINTI " are talking in a corner. The Weasel "
+ PRINT STR
+ PRINTI " and "
+ ZERO? FERRY-HERE /?ELS5
+ PRINTI "then boards the ferry"
+ JUMP ?CND3
+?ELS5: PRINTI "they separate"
+?CND3: PRINTR "."
+
+
+ .FUNCT I-SHOVE-OFF,L,?TMP1
+ CALL ENABLED?,I-JOHNNY
+ ZERO? STACK /FALSE
+ CALL META-LOC,PLAYER
+ GETP STACK,P?LINE >?TMP1
+ GETP SHIP-CHOSEN,P?LINE
+ EQUAL? ?TMP1,STACK \?ELS7
+ GRTR? PRESENT-TIME,930 \?ELS10
+ ZERO? LATITUDE-SET \?ELS10
+ ZERO? LONGITUDE-SET \?ELS10
+ CALL ALL-GO-HOME
+ RFALSE
+?ELS10: CALL META-LOC,PLAYER
+ IN? JOHNNY,STACK \?ELS14
+ CALL DPRINT,JOHNNY
+ PRINTI " turns to"
+ JUMP ?CND8
+?ELS14: LOC JOHNNY >L
+ CALL META-LOC,PLAYER
+ MOVE JOHNNY,STACK
+ CALL ESTABLISH-GOAL,JOHNNY,L
+ CALL DPRINT,JOHNNY
+ PRINTI " walks up behind"
+?CND8: PRINTI " you and says, """
+ ZERO? DELIVERY-MADE \?ELS25
+ PRINTI "We're gonna have to forget it. Outfitters never delivered the stuff."
+ CRLF
+ CALL ALL-GO-HOME
+ RTRUE
+?ELS25: EQUAL? 0,LATITUDE-SET,LONGITUDE-SET \?ELS29
+ PRINTI "If we're gonna go, you have to tell me the minutes of "
+ ZERO? LATITUDE-SET \?CND32
+ PRINTI "latitude"
+ ZERO? LONGITUDE-SET \?CND32
+ PRINTI " and "
+?CND32: ZERO? LONGITUDE-SET \?CND42
+ PRINTI "longitude"
+?CND42: PRINTI "."""
+ CRLF
+ CALL GRAB-ATTENTION,JOHNNY
+ RANDOM 10
+ ADD 30,STACK
+ CALL QUEUE,I-SHOVE-OFF,STACK
+ PUT STACK,0,1
+ RTRUE
+?ELS29: PRINTI "We'll be leaving shortly. Get some sleep."""
+ CRLF
+?CND23: EQUAL? SHIP-CHOSEN,SALVAGER \?ELS55
+ CALL ESTABLISH-GOAL,JOHNNY,MM-WHEELHOUSE
+ JUMP ?CND53
+?ELS55: CALL ESTABLISH-GOAL,JOHNNY,NW-WHEELHOUSE
+?CND53: LOC WEASEL
+ EQUAL? STACK,FERRY,GLOBAL-FERRY,LOCAL-GLOBALS /?CND58
+ LOC DECK-CHAIR
+ CALL ESTABLISH-GOAL,WEASEL,STACK
+?CND58: ZERO? AMT-OWED \FALSE
+ CALL QUEUE,I-BOAT-TRIP,10
+ PUT STACK,0,1
+ RFALSE
+?ELS7: GRTR? PRESENT-TIME,900 \?ELS67
+ CALL ALL-GO-HOME
+ RFALSE
+?ELS67: RANDOM 10
+ ADD 30,STACK
+ CALL QUEUE,I-SHOVE-OFF,STACK
+ PUT STACK,0,1
+ RFALSE
+
+
+ .FUNCT ALL-GO-HOME
+ CALL ESTABLISH-GOAL,PETE,SHANTY
+ IN? WEASEL,FERRY /?CND1
+ IN? WEASEL,GLOBAL-FERRY /?CND1
+ IN? WEASEL,LOCAL-GLOBALS /?CND1
+ CALL ESTABLISH-GOAL,WEASEL,SHANTY
+?CND1: SET 'JOHNNY-SILENT,TRUE-VALUE
+ CALL ESTABLISH-GOAL,JOHNNY,SHANTY
+ RSTACK
+
+
+ .FUNCT I-BOAT-TRIP,BOAT,OT,EXCESS,?TMP1
+ ZERO? ASLEEP \FALSE
+ CALL META-LOC,PLAYER
+ GETP STACK,P?LINE >?TMP1
+ GETP SHIP-CHOSEN,P?LINE >BOAT
+ EQUAL? ?TMP1,BOAT \FALSE
+ LOC WEASEL
+ GETP STACK,P?LINE
+ EQUAL? STACK,BOAT /?ELS11
+ CALL TELL-COMES-UP,JOHNNY
+ PRINTI """The Weasel's not on board. The deal's off."""
+ CRLF
+ CALL FINISH
+ JUMP ?CND9
+?ELS11: LOC MCGINTY
+ GETP STACK,P?LINE
+ EQUAL? STACK,BOAT \?ELS15
+ CALL TELL-COMES-UP,WEASEL
+ CALL JIGS-UP,STR?442
+ JUMP ?CND9
+?ELS15: IN? ENVELOPE,JOHNNY \?CND9
+ LOC WEASEL
+ MOVE JOHNNY,STACK
+ CALL ROUGH-JUSTICE
+?CND9: CALL INT,I-MCGINTY-FOLLOWS
+ PUT STACK,0,0
+ SET 'SOUPS-ON,TRUE-VALUE
+ CALL RATING-UPD,20
+ EQUAL? LATITUDE-SET,20 \?CND18
+ EQUAL? LONGITUDE-SET,25 \?CND18
+ CALL TELL-COMES-UP,JOHNNY
+ CALL JIGS-UP,STR?443
+?CND18: CALL META-LOC,PLAYER
+ EQUAL? STACK,MM-GALLEY,NW-GALLEY \?CND23
+ PRINTI "Pete announces that the stew is ready."
+ CRLF
+?CND23: EQUAL? SHIP-CHOSEN,TRAWLER \?ELS30
+ SET 'TRAWLER-DOCKED,FALSE-VALUE
+ JUMP ?CND28
+?ELS30: SET 'SALVAGER-DOCKED,FALSE-VALUE
+?CND28: SET 'AT-SEA,TRUE-VALUE
+ IN? PLAYER,DECK-CHAIR \?CND33
+ LOC DECK-CHAIR
+ MOVE PLAYER,STACK
+?CND33: LOC PLAYER
+ CALL GLOBAL-IN?,RAILING,STACK
+ ZERO? STACK /?ELS38
+ PRINTI "As the engines roar to life, you go to the "
+ CALL DPRINT,RAILING
+ PRINTI " to watch the shoreline recede."
+ LOC PLAYER
+ IN? DECK-CHAIR,STACK \?CND41
+ CALL TELL-FERRY-KLUDGE,STR?444
+?CND41: PRINTI " As the boat leaves the wharf, y"
+ JUMP ?CND36
+?ELS38: PRINTI "The boat begins to move through the waves. Y"
+?CND36: PRINTI "ou feel the thrill of being out to sea once again."
+ CRLF
+ CRLF
+ IN? PLAYER,BUNK /?CND52
+ PRINTI "You "
+ LOC BUNK
+ IN? PLAYER,STACK /?CND57
+ LOC BUNK >HERE
+ CALL MOVE-SHARED-OBJECTS,HERE
+ IN? AIR-HOSE,DEEP-SUIT \?CND60
+ MOVE AIR-HOSE,MM-COMPRESSOR
+ PRINTI "disconnect the "
+ CALL DPRINT,AIR-HOSE
+ PRINTI ", "
+?CND60: PRINTI "go to the crew's quarters and "
+?CND57: MOVE PLAYER,BUNK
+ PRINTI "climb into your bunk"
+ CALL STRIP-EQUIPMENT
+ PRINTI ". "
+ CRLF
+?CND52: PRINTI "In no time, the rhythm of the ocean lulls you to sleep..."
+ CRLF
+ CRLF
+ MOVE PETE,DECK-CHAIR
+ MOVE JOHNNY,HERE
+ EQUAL? SHIP-CHOSEN,SALVAGER \?ELS75
+ MOVE WEASEL,MM-AFT-DECK
+ JUMP ?CND73
+?ELS75: MOVE WEASEL,NW-AFT-DECK
+?CND73: CALL META-LOC,ENVELOPE
+ GETP STACK,P?LINE
+ EQUAL? STACK,BOAT \?CND78
+ IN? ENVELOPE,UNDER-BUNK /?CND78
+ MOVE ENVELOPE,WEASEL
+?CND78: SET 'OT,PRESENT-TIME
+ RANDOM 15
+ ADD 345,STACK >PRESENT-TIME
+ ADD PRESENT-TIME,1440
+ SUB STACK,OT >EXCESS
+ CALL INTERRUPT-CHECK,EXCESS
+ ZERO? WATCH-WOUND /?CND83
+ MOD EXCESS,60
+ ADD WATCH-MOVES,STACK >WATCH-MOVES
+ GRTR? WATCH-MOVES,59 \?CND87
+ SUB WATCH-MOVES,60 >WATCH-MOVES
+ INC 'WATCH-SCORE
+?CND87: DIV EXCESS,60
+ ADD WATCH-SCORE,STACK >WATCH-SCORE
+?PRG90: GRTR? WATCH-SCORE,11 \?REP91
+ SUB WATCH-SCORE,12 >WATCH-SCORE
+ JUMP ?PRG90
+?REP91:
+?CND83: CALL WATCH-UPDATE
+ EQUAL? LATITUDE-SET,40 \?ELS99
+ EQUAL? LONGITUDE-SET,45 \?ELS99
+ SET 'WRECK-CHOSEN,1
+ SET 'OCEAN-BOTTOM,400
+ JUMP ?CND97
+?ELS99: EQUAL? LATITUDE-SET,25 \?ELS103
+ EQUAL? LONGITUDE-SET,25 \?ELS103
+ SET 'WRECK-CHOSEN,2
+ SET 'OCEAN-BOTTOM,150
+ JUMP ?CND97
+?ELS103: EQUAL? LATITUDE-SET,15 \?ELS107
+ EQUAL? LONGITUDE-SET,50 \?ELS107
+ SET 'WRECK-CHOSEN,3
+ SET 'OCEAN-BOTTOM,350
+ JUMP ?CND97
+?ELS107: CALL OCEAN-BOTTOM-FCN >OCEAN-BOTTOM
+ ZERO? OCEAN-BOTTOM \?CND97
+ CALL JIGS-UP,STR?445
+?CND97: SET 'HOW-TIRED,1
+ LESS? HOW-HUNGRY,2 \?CND112
+ SET 'HOW-HUNGRY,1
+?CND112: LESS? HOW-THIRSTY,2 \?CND115
+ SET 'HOW-THIRSTY,1
+?CND115: CALL QUEUE,I-HUNGER,10
+ PUT STACK,0,1
+ CALL QUEUE,I-THIRST,15
+ PUT STACK,0,1
+ CALL QUEUE,I-TIRED,869
+ PUT STACK,0,1
+ SUB 720,PRESENT-TIME
+ CALL QUEUE,I-ENDIT,STACK
+ PUT STACK,0,1
+ CALL DPRINT,JOHNNY
+ PRINTI " shakes your shoulder and wakes you. "
+ EQUAL? SHIP-CHOSEN,TRAWLER \?ELS122
+ CALL ESTABLISH-GOAL,JOHNNY,NW-CAPT-CABIN
+ JUMP ?CND120
+?ELS122: CALL ESTABLISH-GOAL,JOHNNY,MM-CAPT-CABIN
+?CND120: CALL INT,I-BOAT-TRIP
+ PUT STACK,0,0
+ PRINTR """We've arrived. You're up as soon as you're ready."""
+
+
+ .FUNCT STRIP-EQUIPMENT,F,N,V=0
+ FIRST? PLAYER >F /?KLU17
+?KLU17:
+?PRG1: ZERO? F \?CND3
+ JUMP ?REP2
+?CND3: NEXT? F >N /?KLU18
+?KLU18: EQUAL? F,WATCH /?CND6
+ LOC BUNK
+ MOVE F,STACK
+ FCLEAR F,WORNBIT
+ SET 'V,TRUE-VALUE
+?CND6: SET 'F,N
+ JUMP ?PRG1
+?REP2: ZERO? V /FALSE
+ PRINTI ", dropping your equipment"
+ RTRUE
+
+
+ .FUNCT INTERRUPT-CHECK,DUR,C,E,TICK,FOO,R
+ ADD C-TABLE,C-INTS >C
+ ADD C-TABLE,C-TABLELEN >E
+ SET 'ASLEEP,TRUE-VALUE
+?PRG1: EQUAL? C,E \?ELS5
+ JUMP ?REP2
+?ELS5: GET C,C-ENABLED?
+ ZERO? STACK /?CND3
+ GET C,C-TICK >TICK
+ ZERO? TICK \?ELS10
+ JUMP ?CND3
+?ELS10: SUB TICK,DUR >FOO
+ LESS? FOO,2 \?ELS15
+ GET C,C-RTN
+ CALL STACK
+ SUB TICK,1
+ PUT C,C-TICK,STACK
+ JUMP ?CND8
+?ELS15: PUT C,C-TICK,FOO
+?CND8:
+?CND3: ADD C,C-INTLEN >C
+ JUMP ?PRG1
+?REP2: SET 'ASLEEP,FALSE-VALUE
+ RETURN ASLEEP
+
+
+ .FUNCT LE?,LAT,LON,CNST,?TMP1
+ MUL LAT,LATITUDE-SET >?TMP1
+ MUL LON,LONGITUDE-SET
+ ADD ?TMP1,STACK
+ GRTR? STACK,CNST /FALSE
+ RTRUE
+
+
+ .FUNCT GE?,LAT,LON,CNST,?TMP1
+ MUL LAT,LATITUDE-SET >?TMP1
+ MUL LON,LONGITUDE-SET
+ ADD ?TMP1,STACK
+ LESS? STACK,CNST /FALSE
+ RTRUE
+
+
+ .FUNCT OCEAN-BOTTOM-FCN
+ LESS? LONGITUDE-SET,5 /?THN6
+ GRTR? LONGITUDE-SET,55 /?THN6
+ LESS? LATITUDE-SET,5 /?THN6
+ GRTR? LATITUDE-SET,45 \?ELS5
+?THN6: CALL JIGS-UP,STR?446
+ RSTACK
+?ELS5: GRTR? LATITUDE-SET,17 /?ELS9
+ CALL LE?,2,-5,-11
+ ZERO? STACK /?ELS9
+ CALL LE?,1,1,30
+ ZERO? STACK \FALSE
+?ELS9: GRTR? LATITUDE-SET,6 /?ELS13
+ GRTR? LONGITUDE-SET,36 /?ELS13
+ LESS? LONGITUDE-SET,34 \FALSE
+?ELS13: GRTR? LONGITUDE-SET,34 /?ELS17
+ GRTR? LATITUDE-SET,7 /?ELS17
+ CALL LE?,1,-1,-26
+ ZERO? STACK \FALSE
+?ELS17: CALL GE?,2,1,115
+ ZERO? STACK /?ELS21
+ RETURN 400
+?ELS21: CALL GE?,1,1,68
+ ZERO? STACK /?ELS23
+ CALL LE?,1,-2,-91
+ ZERO? STACK /?ELS23
+ RETURN 400
+?ELS23: LESS? LATITUDE-SET,40 \?THN32
+ CALL GE?,15,4,680
+ ZERO? STACK \?THN32
+ CALL GE?,2,1,107
+ ZERO? STACK \?THN32
+ CALL GE?,1,1,76
+ ZERO? STACK \?THN32
+ LESS? LONGITUDE-SET,44 /?ELS27
+ CALL GE?,2,1,70
+ ZERO? STACK /?ELS27
+ LESS? LONGITUDE-SET,52 \?THN32
+ CALL LE?,5,-3,-57
+ ZERO? STACK \?THN32
+ CALL LE?,1,-1,-31
+ ZERO? STACK /?ELS27
+?THN32: RETURN 350
+?ELS27: GRTR? LATITUDE-SET,37 /?THN40
+ CALL GE?,6,1,240
+ ZERO? STACK \?THN40
+ CALL GE?,13,6,635
+ ZERO? STACK \?THN40
+ CALL GE?,1,1,72
+ ZERO? STACK \?THN40
+ LESS? LONGITUDE-SET,41 /?ELS35
+ CALL GE?,13,8,497
+ ZERO? STACK /?ELS35
+ LESS? LONGITUDE-SET,49 \?THN40
+ CALL LE?,6,-5,-121
+ ZERO? STACK \?THN40
+ CALL LE?,2,-3,-103
+ ZERO? STACK /?ELS35
+?THN40: RETURN 300
+?ELS35: LESS? LATITUDE-SET,35 \?THN48
+ CALL GE?,2,-1,57
+ ZERO? STACK \?THN48
+ CALL GE?,44,15,1810
+ ZERO? STACK \?THN48
+ CALL GE?,4,3,230
+ ZERO? STACK \?THN48
+ LESS? LONGITUDE-SET,37 /?ELS43
+ CALL GE?,13,7,415
+ ZERO? STACK /?ELS43
+ LESS? LONGITUDE-SET,46 \?THN48
+ CALL LE?,3,-2,-32
+ ZERO? STACK /?ELS43
+?THN48: RETURN 250
+?ELS43: GRTR? LATITUDE-SET,19 /?ELS55
+ CALL LE?,5,3,131
+ ZERO? STACK /?ELS55
+ CALL LE?,7,6,214
+ ZERO? STACK \?THN52
+?ELS55: GRTR? LATITUDE-SET,7 /?ELS57
+ GRTR? LONGITUDE-SET,35 \?THN52
+?ELS57: GRTR? LATITUDE-SET,8 /?ELS51
+ CALL LE?,2,-1,-16
+ ZERO? STACK /?ELS51
+ CALL LE?,1,1,45
+ ZERO? STACK /?ELS51
+ CALL LE?,2,1,51
+ ZERO? STACK /?ELS51
+?THN52: RETURN 50
+?ELS51: GRTR? LATITUDE-SET,20 /?ELS65
+ CALL LE?,2,1,50
+ ZERO? STACK /?ELS65
+ CALL LE?,10,7,286
+ ZERO? STACK \?THN62
+?ELS65: GRTR? LATITUDE-SET,9 /?ELS61
+ CALL LE?,3,2,99
+ ZERO? STACK /?ELS61
+?THN62: RETURN 100
+?ELS61: GRTR? LATITUDE-SET,22 /?THN74
+ CALL LE?,5,3,140
+ ZERO? STACK \?THN74
+ CALL LE?,7,3,172
+ ZERO? STACK \?THN70
+?THN74: GRTR? LATITUDE-SET,10 /?ELS69
+ CALL LE?,9,5,270
+ ZERO? STACK /?ELS69
+?THN70: RETURN 150
+?ELS69: GRTR? LONGITUDE-SET,29 /?ELS79
+ LESS? LONGITUDE-SET,18 /?ELS79
+ GRTR? LATITUDE-SET,24 /?ELS79
+ LESS? LATITUDE-SET,19 /?ELS79
+ CALL LE?,9,4,296
+ ZERO? STACK /?ELS79
+ CALL GE?,4,1,102
+ ZERO? STACK /?ELS79
+ CALL GE?,2,1,62
+ ZERO? STACK /?ELS79
+ RETURN 50
+?ELS79: GRTR? LATITUDE-SET,28 /?ELS83
+ LESS? LATITUDE-SET,17 /?ELS83
+ GRTR? LONGITUDE-SET,34 /?ELS83
+ LESS? LONGITUDE-SET,15 /?ELS83
+ CALL LE?,1,-1,11
+ ZERO? STACK /?ELS83
+ CALL GE?,1,1,39
+ ZERO? STACK /?ELS83
+ CALL GE?,5,2,141
+ ZERO? STACK /?ELS83
+ CALL GE?,1,-1,-15
+ ZERO? STACK /?ELS83
+ CALL LE?,4,1,118
+ ZERO? STACK \?THN86
+ CALL LE?,6,5,268
+ ZERO? STACK /?ELS83
+?THN86: RETURN 100
+?ELS83: GRTR? LATITUDE-SET,32 /?ELS89
+ LESS? LATITUDE-SET,16 /?ELS89
+ GRTR? LONGITUDE-SET,38 /?ELS89
+ CALL GE?,5,-3,-19
+ ZERO? STACK /?ELS89
+ CALL GE?,7,3,196
+ ZERO? STACK /?ELS89
+ CALL GE?,3,7,164
+ ZERO? STACK /?ELS89
+ CALL LE?,1,-1,18
+ ZERO? STACK /?ELS89
+ CALL LE?,7,6,344
+ ZERO? STACK \?THN92
+ CALL LE?,11,4,394
+ ZERO? STACK /?ELS89
+?THN92: RETURN 150
+?ELS89: RETURN 200
+
+
+ .FUNCT I-HUNGER,N,?TMP1
+ ZERO? ASLEEP \FALSE
+ INC 'HOW-HUNGRY
+ EQUAL? HOW-HUNGRY,1 \?ELS9
+ CALL QUEUE,I-HUNGER,300
+ PUT STACK,0,1
+ RFALSE
+?ELS9: EQUAL? HOW-HUNGRY,2 \?ELS11
+ CALL QUEUE,I-HUNGER,20
+ PUT STACK,0,1
+ PRINTI "You begin to feel hungry."
+ CRLF
+ RFALSE
+?ELS11: EQUAL? HOW-HUNGRY,3 \?ELS15
+ CALL QUEUE,I-HUNGER,20
+ PUT STACK,0,1
+ PRINTI "Your stomach begins to bother you. Better "
+ CALL META-LOC,PLAYER >?TMP1
+ CALL META-LOC,FOOD
+ EQUAL? ?TMP1,STACK \?ELS20
+ PRINTI "do something about it"
+ JUMP ?CND18
+?ELS20: PRINTI "find some food"
+?CND18: PRINTI "!"
+ CRLF
+ RFALSE
+?ELS15: GRTR? HOW-HUNGRY,3 \FALSE
+ EQUAL? HERE,SHANTY \?ELS33
+ SET 'N,2
+ JUMP ?CND31
+?ELS33: SET 'N,6
+?CND31: CALL QUEUE,I-HUNGER,N
+ PUT STACK,0,1
+ PRINTI "Your stomach is growling loudly."
+ CRLF
+ RETURN 2
+
+
+ .FUNCT I-THIRST
+ ZERO? ASLEEP \FALSE
+ INC 'HOW-THIRSTY
+ EQUAL? HOW-THIRSTY,1 \?ELS9
+ CALL QUEUE,I-THIRST,110
+ PUT STACK,0,1
+ PRINTI "Your throat starts to feel dry."
+ CRLF
+ RFALSE
+?ELS9: EQUAL? HOW-THIRSTY,2 \?ELS13
+ CALL QUEUE,I-THIRST,115
+ PUT STACK,0,1
+ PRINTI "You feel fairly thirsty."
+ CRLF
+ RFALSE
+?ELS13: EQUAL? HOW-THIRSTY,3 \?ELS17
+ CALL QUEUE,I-THIRST,15
+ PUT STACK,0,1
+ CALL TELL-YOUD-BETTER,STR?447
+ RFALSE
+?ELS17: GRTR? HOW-THIRSTY,3 \FALSE
+ CALL QUEUE,I-THIRST,4
+ PUT STACK,0,1
+ PRINTI "You lick your lips and clear your throat."
+ CRLF
+ RETURN 2
+
+
+ .FUNCT I-TIRED
+ ZERO? ASLEEP \FALSE
+ LESS? HOW-TIRED,6 \?CND1
+ INC 'HOW-TIRED
+?CND1: EQUAL? HOW-TIRED,1 \?ELS11
+ CALL QUEUE,I-TIRED,479
+ PUT STACK,0,1
+ RFALSE
+?ELS11: EQUAL? HOW-TIRED,2 \?ELS13
+ CALL QUEUE,I-TIRED,1
+ PUT STACK,0,1
+ RFALSE
+?ELS13: EQUAL? HOW-TIRED,3 \?ELS15
+ CALL QUEUE,I-TIRED,30
+ PUT STACK,0,1
+ PRINTR "You yawn as you begin to feel drowsy."
+?ELS15: EQUAL? HOW-TIRED,4 \?ELS19
+ CALL QUEUE,I-TIRED,20
+ PUT STACK,0,1
+ PRINTI "You are starting to feel tired."
+ CRLF
+ RFALSE
+?ELS19: EQUAL? HOW-TIRED,5 \?ELS23
+ CALL QUEUE,I-TIRED,10
+ PUT STACK,0,1
+ PRINTR "You yawn and feel very tired. Think about going to bed."
+?ELS23: EQUAL? HOW-TIRED,6 \FALSE
+ PRINTI "Exhaustion overwhelms you. Keeping your eyes open is painful."
+ ZERO? AT-SEA \?ELS32
+ PRINTI " "
+ CALL V-SLEEP
+ RETURN 2
+?ELS32: CALL QUEUE,I-TIRED,6
+ PUT STACK,0,1
+ CRLF
+ RETURN 2
+
+
+ .FUNCT I-SQUID,L
+ LOC SQUID >L
+ CALL META-LOC,PLAYER
+ EQUAL? STACK,L \?ELS5
+ CALL JIGS-UP,STR?448
+ RSTACK
+?ELS5: CALL INT,I-SQUID
+ PUT STACK,0,0
+ RFALSE
+
+
+ .FUNCT I-SHARK
+ GETP HERE,P?LINE
+ LESS? STACK,UNDERWATER-LINE-C \?ELS5
+ CALL INT,I-SHARK
+ PUT STACK,0,0
+ MOVE SHARK,LOCAL-GLOBALS
+ FCLEAR SHARK,ONBIT
+ RFALSE
+?ELS5: IN? SHARK,UNDERWATER \?ELS7
+ IN? SHARK-REPELLENT,PLAYER \?ELS12
+ FSET? SHARK-REPELLENT,OPENBIT \?ELS12
+ MOVE SHARK,WINDING-ROAD-2
+ CALL INT,I-SHARK
+ PUT STACK,0,0
+ ZERO? LIT /FALSE
+ FSET? SHARK,ONBIT \?ELS19
+ PRINTI "The shark continues"
+ JUMP ?CND15
+?ELS19: PRINTI "A shark swims"
+?CND15: PRINTR " toward you, then stops. It turns and swims away."
+?ELS12: FSET? SHARK,ONBIT \?ELS32
+ PRINTI "The shark"
+ JUMP ?CND30
+?ELS32: ZERO? LIT /?ELS36
+ PRINTI "A shark"
+ JUMP ?CND30
+?ELS36: PRINTI "Something"
+?CND30: CALL JIGS-UP,STR?449
+ RSTACK
+?ELS7: MOVE SHARK,UNDERWATER
+ CALL QUEUE,I-SHARK,-1
+ PUT STACK,0,1
+ ZERO? LIT /FALSE
+ FSET SHARK,ONBIT
+ PRINTR "A shark swims toward you!"
+
+
+ .FUNCT I-PLUMMET
+ INC 'CRIMP-CTR
+ EQUAL? CRIMP-CTR,1 \?ELS5
+ CALL QUEUE,I-PLUMMET,-1
+ PUT STACK,0,1
+ CALL GLOBAL-IN?,FALLEN-BUNK,HERE
+ ZERO? STACK /FALSE
+ SET 'P-IT-OBJECT,FALLEN-BUNK
+ PRINTR "The row of bunks you moved starts to fall."
+?ELS5: EQUAL? CRIMP-CTR,2 \?ELS14
+ CALL GLOBAL-IN?,FALLEN-BUNK,HERE
+ ZERO? STACK /FALSE
+ SET 'P-IT-OBJECT,FALLEN-BUNK
+ PRINTI "The row of bunks falls toward the doorway"
+ EQUAL? HERE,WRECK-8 \?ELS24
+ PRINTI ", threatening to pinch your "
+ CALL DPRINT,AIR-HOSE
+ PRINTI "!"
+ JUMP ?CND22
+?ELS24: PRINTI "."
+?CND22: CRLF
+ RTRUE
+?ELS14: EQUAL? CRIMP-CTR,3 \FALSE
+ CALL GLOBAL-IN?,FALLEN-BUNK,HERE
+ ZERO? STACK /?ELS37
+ EQUAL? HERE,WRECK-8 \?ELS42
+ CALL JIGS-UP,STR?450
+ RSTACK
+?ELS42: SET 'BUNKS-MOVED,FALSE-VALUE
+ SET 'P-IT-OBJECT,FALLEN-BUNK
+ PRINTR "The bunks fall back into the doorway, blocking the passage."
+?ELS37: EQUAL? HERE,WRECK-1,WRECK-2,WRECK-3 /?THN49
+ EQUAL? HERE,WRECK-4,WRECK-5,WRECK-6 /?THN49
+ EQUAL? HERE,UNDERWATER \?ELS48
+?THN49: SET 'BUNKS-MOVED,FALSE-VALUE
+ RFALSE
+?ELS48: CALL JIGS-UP,STR?451
+ RSTACK
+
+
+ .FUNCT I-LIVER
+ GRTR? BLOOD-ALCOHOL,0 \?CND1
+ DEC 'BLOOD-ALCOHOL
+?CND1: GRTR? SLOSH-CTR,0 \?CND4
+ DEC 'SLOSH-CTR
+?CND4: CALL QUEUE,I-LIVER,10
+ PUT STACK,0,1
+ GRTR? BLOOD-ALCOHOL,15 \FALSE
+ PRINTI "Your head swims for a minute."
+ CRLF
+ RETURN 2
+
+
+ .FUNCT I-PENDULUM,DIR=0
+ CALL QUEUE,I-PENDULUM,-2
+ EQUAL? LINE-LOC,5 \?ELS3
+ SET 'LINE-LOC-INC,-1
+ JUMP ?CND1
+?ELS3: EQUAL? LINE-LOC,1 \?ELS5
+ SET 'LINE-LOC-INC,1
+ JUMP ?CND1
+?ELS5: CALL META-LOC,PLAYER
+ IN? SAFETY-LINE,STACK \?CND1
+ EQUAL? LINE-LOC-INC,1 \?ELS10
+ SET 'DIR,STR?170
+ JUMP ?CND1
+?ELS10: SET 'DIR,STR?171
+?CND1: ADD LINE-LOC,LINE-LOC-INC >LINE-LOC
+ EQUAL? LINE-LOC,2 \?ELS17
+ MOVE SAFETY-LINE,WEST-OF-WRECK-9
+ EQUAL? HERE,WEST-OF-WRECK-9 \FALSE
+ CALL TELL-LINE-SWINGS
+ RSTACK
+?ELS17: EQUAL? LINE-LOC,4 \?ELS24
+ MOVE SAFETY-LINE,WEST-OF-WRECK-11
+ EQUAL? HERE,WEST-OF-WRECK-11 \FALSE
+ CALL TELL-LINE-SWINGS
+ RSTACK
+?ELS24: MOVE SAFETY-LINE,LOCAL-GLOBALS
+ ZERO? DIR /FALSE
+ PRINTI "The line swings away to the "
+ PRINT DIR
+ PRINTR "."
+
+
+ .FUNCT TELL-LINE-SWINGS
+ PRINTI "The "
+ CALL DPRINT,SAFETY-LINE
+ PRINTI " from above swings in from the "
+ EQUAL? LINE-LOC-INC,1 \?ELS5
+ PRINTI "south"
+ JUMP ?CND3
+?ELS5: PRINTI "north"
+?CND3: PRINTR "."
+
+
+ .FUNCT I-CASE-LEAK,ALREADY=0
+ INC 'WATER-IN-CASE
+ GRTR? WATER-IN-CASE,9 \?CND1
+ FSET? STAMPS,RMUNGBIT \?CND4
+ SET 'ALREADY,TRUE-VALUE
+?CND4: FSET STAMPS,RMUNGBIT
+ CALL INT,I-CASE-LEAK
+ PUT STACK,0,0
+?CND1: IN? GLASS-CASE,PLAYER \FALSE
+ PRINTI "The water level in the "
+ CALL DPRINT,GLASS-CASE
+ PRINTI " rises."
+ FSET? STAMPS,RMUNGBIT \?CND14
+ ZERO? ALREADY \?CND14
+ PRINTI " As it reaches the stamps, it soaks them."
+?CND14: CRLF
+ RTRUE
+
+
+ .FUNCT I-DRILL
+ FSET BATTERY,RMUNGBIT
+ SET 'DRILL-POWERED,FALSE-VALUE
+ CALL INT,I-DRILL
+ PUT STACK,0,0
+ PRINTI "The "
+ CALL DPRINT,DRILL
+ PRINTR " sputters, and the bit stops turning."
+
+
+ .FUNCT I-AIR-SUPPLY
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \FALSE
+ IN? AIR-TANK,PLAYER \FALSE
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK \FALSE
+ ADD DEPTH,33
+ DIV STACK,44
+ SUB AIR-LEFT,STACK >AIR-LEFT
+ LESS? AIR-LEFT,1 \?ELS12
+ CALL JIGS-UP,STR?452
+ RSTACK
+?ELS12: LESS? AIR-LEFT,15 \FALSE
+ PRINTI "Your air supply is dangerously low."
+ CRLF
+ EQUAL? WAITED?,1 /TRUE
+ RETURN 2
+
+
+ .FUNCT I-MM-COMPRESSOR
+ CALL QUEUE,I-LAST-GASP,10
+ PUT STACK,0,1
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \FALSE
+ PRINTI "You have to breathe harder. Maybe you'd better surface."
+ CRLF
+ RETURN 2
+
+
+ .FUNCT I-LAST-GASP
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS5
+ CALL JIGS-UP,STR?453
+ RSTACK
+?ELS5: CALL QUEUE,I-LAST-GASP,1
+ PUT STACK,0,0
+ RTRUE
+
+
+ .FUNCT I-PLOT-NEVER-STARTS
+ CALL INT,I-JOHNNY
+ PUT STACK,0,0
+ CALL INT,I-PETE
+ PUT STACK,0,0
+ IN? WEASEL,SHANTY \?CND1
+ CALL INT,I-WEASEL
+ PUT STACK,0,0
+?CND1: SET 'FM-CTR,5
+ RFALSE
+
+
+ .FUNCT I-ENDIT
+ GETP HERE,P?LINE
+ LESS? STACK,UNDERWATER-LINE-C \FALSE
+ CALL JIGS-UP,STR?454
+ RSTACK
+
+ .ENDI
diff --git a/events.zil b/events.zil
new file mode 100644
index 0000000..dae51e1
--- /dev/null
+++ b/events.zil
@@ -0,0 +1,1629 @@
+" EVENTS for TOA2
+ Copyright (C) 1984 Infocom Inc.
+ All rights reserved."
+
+<ROUTINE I-UNWOUND ()
+ <SETG WATCH-WOUND <>>
+ <RFALSE>>
+
+<ROUTINE I-BUSINESS-HOURS ()
+ <COND (,BUSINESS-HOURS?
+ <SETG BUSINESS-HOURS? <>>
+ <COND (<IN? ,PLAYER ,MCGINTY-HQ>
+ <MOVE ,PLAYER ,WHARF-ROAD-2>
+ <SETG HERE ,WHARF-ROAD-2>
+ <TELL
+"\"Closing time,\" says " D ,MCGINTY " as he escorts you out to the
+street..." CR CR>
+ <V-FIRST-LOOK>)
+ (<IN? ,PLAYER ,OUTFITTERS-HQ>
+ <MOVE ,PLAYER ,WHARF-ROAD-4>
+ <SETG HERE ,WHARF-ROAD-4>
+ <TELL
+"\"Sorry, but it's closing time,\" the salesman says, then shows you out..." CR CR>
+ <V-FIRST-LOOK>)
+ (<IN? ,PLAYER ,BANK>
+ <MOVE ,PLAYER ,SHORE-ROAD-2>
+ <SETG HERE ,SHORE-ROAD-2>
+ <TELL
+"The teller says, \"You'll have to leave. It's 5:00.\" A guard escorts you
+out..." CR CR>
+ <V-FIRST-LOOK>)
+ (T <RFALSE>)>
+ <RTRUE>)
+ (T
+ <SETG BUSINESS-HOURS? T>
+ <ENABLE <QUEUE I-BUSINESS-HOURS 480>>
+ <RFALSE>)>>
+
+<ROUTINE I-FERRY-APPROACHING ()
+ <ENABLE <QUEUE I-FERRY-APPROACHING -1>>
+ <FCLEAR ,FERRY ,INVISIBLE>
+ <COND (<IN? ,WEASEL ,GLOBAL-FERRY>
+ <MOVE ,WEASEL ,FERRY>)>
+ <COND (<EQUAL? ,HERE ,FERRY-LANDING ,SHORE-ROAD-1 ,SHORE-ROAD-2>
+ <TELL
+"The ferry approaches the landing." CR>)>>
+
+<ROUTINE I-FERRY ("AUX" (WEASEL-HERE? <>))
+ <DISABLE <INT I-FERRY-APPROACHING>>
+ <ENABLE <QUEUE I-FERRY-LEAVING 5>>
+ <ENABLE <QUEUE I-FERRY-GONE 8>>
+ <MOVE ,FERRY ,FERRY-LANDING>
+ <COND (<AND <IN? ,WEASEL ,FERRY-LANDING>
+ <NOT <QUEUED? I-TRAITOR-MEETING>>>
+ <SET WEASEL-HERE? T>
+ <MOVE ,WEASEL ,FERRY>)
+ (<IN? ,WEASEL ,FERRY>
+ <MOVE ,WEASEL ,FERRY-LANDING>
+ <COND (<AND <IN? ,JOHNNY ,FERRY-LANDING>
+ ,WEASEL-BLOWN>
+ <ROUGH-JUSTICE>)
+ (<==? ,SHIP-CHOSEN ,TRAWLER>
+ <ESTABLISH-GOAL ,WEASEL ,NW-CREW-QTRS>)
+ (<==? ,SHIP-CHOSEN ,SALVAGER>
+ <ESTABLISH-GOAL ,WEASEL ,MM-CREW-QTRS>)>)>
+ <COND (<==? ,HERE ,FERRY-LANDING>
+ <TELL
+"The ferry arrives. Some passengers get off and others get on.">
+ <COND (.WEASEL-HERE?
+ <TELL-FERRY-KLUDGE "boards">)
+ (<AND <IN? ,WEASEL ,FERRY-LANDING>
+ <NOT <QUEUED? I-TRAITOR-MEETING>>>
+ <TELL-FERRY-KLUDGE "disembarks">
+ <COND (<IN? ,ENVELOPE ,PLAYER>
+ <CRLF>
+ <WEASEL-BEATS-YOU>)>)>
+ <CRLF>)
+ (<EQUAL? ,HERE ,SHORE-ROAD-1 ,SHORE-ROAD-2>
+ <TELL "The ferry arrives at the landing." CR>)>>
+
+<ROUTINE TELL-FERRY-KLUDGE (STR)
+ <TELL " The Weasel " .STR ".">>
+
+<ROUTINE I-FERRY-LEAVING ()
+ <ENABLE <QUEUE I-FERRY-LEAVING -1>>
+ <MOVE ,FERRY ,LOCAL-GLOBALS>
+ <COND (<AND <IN? ,WEASEL ,FERRY>
+ <IN? ,PASSBOOK ,WEASEL>>
+ <MOVE ,WEASEL ,LOCAL-GLOBALS>)>
+ <COND (<EQUAL? ,HERE ,FERRY-LANDING ,SHORE-ROAD-1 ,SHORE-ROAD-2>
+ <TELL
+"The ferry pulls away, heading for the mainland." CR>)>>
+
+<ROUTINE I-FERRY-GONE ()
+ <DISABLE <INT I-FERRY-LEAVING>>
+ <ENABLE <QUEUE I-FERRY-APPROACHING 109>>
+ <ENABLE <QUEUE I-FERRY 112>>
+ <FSET ,FERRY ,INVISIBLE>
+ <COND (<IN? ,WEASEL ,FERRY>
+ <MOVE ,WEASEL ,GLOBAL-FERRY>)>
+ <RFALSE>>
+
+<ROUTINE I-DISGUSTING-WEASEL-KLUDGE ("AUX" WGT);"make sure he goes to 1st mtg"
+ <COND (<AND <NOT <IN? ,PASSBOOK ,WEASEL>>
+ <NOT <==? <GET <SET WGT <GET ,GOAL-TABLES ,WEASEL-C>>
+ ,GOAL-F>
+ ,SHANTY>>>
+ <PUT .WGT ,ATTENTION 0>
+ <ESTABLISH-GOAL ,WEASEL ,SHANTY>
+ <RFALSE>)>>
+
+<ROUTINE I-FIRST-MEETING ()
+ <COND (<==? ,FM-CTR 5>
+ <DISABLE <INT I-FIRST-MEETING>>
+ <RFALSE>)
+ (<AND <IN? ,JOHNNY ,SHANTY>
+ <IN? ,PETE ,SHANTY>
+ <==? <META-LOC ,PLAYER> ,SHANTY>>
+ <COND (<==? ,FM-CTR 0>
+ <COND (<G? ,PRESENT-TIME 535>
+ <I-PLOT-NEVER-STARTS>
+ <DISABLE <INT I-FIRST-MEETING>>
+ <RFALSE>)>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"\"Sit down and we'll talk,\" " D ,JOHNNY " says." CR>)
+ (<==? ,FM-CTR 1>
+ <COND (<IN? ,WEASEL ,SHANTY>
+ <SETG FM-CTR 2>
+ <I-FIRST-MEETING>)
+ (,WAITING-FOR-WEASEL
+ <COND (<G? ,PRESENT-TIME 525>
+ <DISABLE <INT I-FIRST-MEETING>>
+ <I-PLOT-NEVER-STARTS>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"Pete looks at Johnny and says, \"Weasel ain't gonna show.\"|
+\"Guess not,\" replies Johnny. \"Without " D ,WEASEL ", there's
+no deal. Who knows what that creep is up to?\"" CR>)>)
+ (T
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"Johnny says, \"When " D ,WEASEL " shows, I'll tell ya what we got.\"" CR>
+ <SETG WAITING-FOR-WEASEL T>)>)
+ (<G? ,BLOOD-ALCOHOL 10>
+ <DISABLE <INT I-FIRST-MEETING>>
+ <I-PLOT-NEVER-STARTS>
+ <TELL
+"Pete turns to Johnny and says, \"This joker's drunk!\"|
+\"Yeah,\" Johnny says. He looks at you. \"Some diver! We'll find
+someone else.\"" CR>)
+ (<==? ,FM-CTR 2>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"At Pete's request, " D ,WEASEL " joins you. Johnny then whispers that he's
+come across some sunken " D ,GLOBAL-TREASURE "." CR>
+ <SETG FM-CTR 3>
+ <SETG I-WAIT-RTN ,I-FIRST-MEETING>
+ <SETG I-WAIT-DURATION 2>)
+ (<==? ,FM-CTR 3>
+ <COND (,I-WAIT-FLAG
+ <TELL
+"Unfortunately, this interrupts Johnny's explanation of what the meeting is
+about." CR>
+ <SETG I-WAIT-DURATION 2>)
+ (<AND <G? ,I-WAIT-DURATION 0>
+ <==? ,I-WAIT-RTN ,I-FIRST-MEETING>>
+ <RFALSE>)
+ (T
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"Johnny explains that they need more money to get started.
+They chose you because they know you've salted some money away and
+you're a great diver. He asks if you're interested in the deal."
+CR>
+ <SETG FM-CTR 4>)>)
+ (<==? ,FM-CTR 4>
+ <COND (<AND <G? ,PRESENT-TIME 539>
+ <NOT <VERB? YES NO>>>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <I-PLOT-NEVER-STARTS>
+ <TELL
+"Pete turns to Johnny. \"We don't want anyone who can't decide.\"|
+\"Right,\" says Johnny. \"We'll find someone else.\" He turns to
+you. \"Say a word about this and you're history!\"" CR>)
+ (T
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"\"Well, what is it? Yes or no?\" Pete asks anxiously." CR>)>)>)>>
+
+<GLOBAL WAITING-FOR-WEASEL <>>
+
+<GLOBAL I-WAIT-FLAG <>>
+
+<GLOBAL I-WAIT-DURATION 0>
+
+<GLOBAL I-WAIT-RTN <>>
+
+<GLOBAL FM-CTR 0> "counter for throughout first meeting:
+ 0-waiting for player to sit down
+ 1-waiting for the Weasel to show up
+ 2-Johnny mentions treasure
+ 3-Johnny pitches the deal
+ 4-waiting for player to accept
+ (handled in CHAIR-F, SHANTY-F)
+ 5-no meeting or meeting concluded"
+
+<GLOBAL SAMPLE-TREASURE <>>
+
+<OBJECT GOLD-COIN
+ (IN LOCAL-GLOBALS)
+ (SYNONYM COIN DOUBLO ESCUDO)
+ (ADJECTIVE GOLD PORTUG)
+ (DESC "gold coin")
+ (TEXT
+"It is dated 1680 and stamped with a portrait of King Peter II of Portugal.")
+ (FLAGS TRYTAKEBIT READBIT)
+ (ACTION RED-HERRING-F)>
+
+<OBJECT DINNER-PLATE
+ (IN LOCAL-GLOBALS)
+ (SYNONYM PLATE DISH)
+ (ADJECTIVE DINNER SUPPER)
+ (DESC "dinner plate")
+ (TEXT
+"It bears the Hollywood Cruise Lines markings.")
+ (FLAGS TRYTAKEBIT READBIT)
+ (ACTION RED-HERRING-F)>
+
+;<OBJECT DINNER-PLATE
+ (IN LOCAL-GLOBALS)
+ (SYNONYM TRAY ASHTRA)
+ (ADJECTIVE ASH)
+ (SDESC "ashtray")
+ (TEXT
+"This is an ashtray with the markings of the Hollywood Cruise Lines.")
+ (FLAGS TRYTAKEBIT VOWELBIT)
+ (ACTION SAMPLE-TREASURE-F)>
+
+;<OBJECT DINNER-PLATE
+ (IN LOCAL-GLOBALS)
+ (SYNONYM FORK)
+ (ADJECTIVE SILVER SALAD)
+ (SDESC "salad fork")
+ (TEXT
+"This is a salad fork with the markings of the Hollywood Cruise Lines.")
+ (FLAGS TRYTAKEBIT)
+ (ACTION SAMPLE-TREASURE-F)>
+
+;<OBJECT DINNER-PLATE
+ (IN LOCAL-GLOBALS)
+ (SYNONYM KNIFE)
+ (ADJECTIVE BUTTER SILVER)
+ (SDESC "dinner plate")
+ (TEXT
+"This is a butter knife with the markings of the Hollywood Cruise Lines.")
+ (FLAGS TRYTAKEBIT)
+ (ACTION SAMPLE-TREASURE-F)>
+
+;<OBJECT DINNER-PLATE
+ (IN LOCAL-GLOBALS)
+ (SYNONYM SPOON)
+ (ADJECTIVE SOUP SILVER)
+ (SDESC "soup spoon")
+ (TEXT
+"This is a soup spoon with the markings of the Hollywood Cruise Lines.")
+ (FLAGS TRYTAKEBIT)
+ (ACTION RED-HERRING-F)>
+
+<ROUTINE SAMPLE-TREASURE-F ()
+ <COND (<OR <VERB? TAKE>
+ <AND <VERB? ASK-FOR>
+ <PRSO? ,JOHNNY>>>
+ <COND (<IN? ,MCGINTY ,HERE>
+ <PERFORM ,V?TELL ,MCGINTY ,SAMPLE-TREASURE>
+ <RTRUE>)
+ (T <TELL
+"Red pulls it back. \"If we get the loot, there'll be plenty for all.\"" CR>)>)
+ (<VERB? TURN>
+ <TELL D ,JOHNNY " has it." CR>)>>
+
+<ROUTINE I-SECOND-MEETING ()
+ <COND (<AND <G? ,PRESENT-TIME 585>
+ <OR <L? ,SM-CTR 2>
+ <G? ,HOW-HUNGRY 3>>>
+ <ALL-GO-HOME>
+ <I-PLOT-NEVER-STARTS>
+ <SETG SM-CTR 4>)>
+ <COND (<==? ,SM-CTR 4>
+ <DISABLE <INT I-SECOND-MEETING>>)
+ (<NOT <==? ,HERE ,WINDING-ROAD-1>>
+ <DISABLE <INT I-SECOND-MEETING>>)
+ (<AND <G? ,SM-CTR 1>
+ <OR <IN? ,MCGINTY ,WINDING-ROAD-1>
+ <IN? ,MCGINTY ,WINDING-ROAD-2>>>
+ <JIGS-UP
+"Pete spots McGinty, who is near enough to overhear! While Johnny
+chases McGinty, Pete accuses you of bringing McGinty along. Before you
+respond, the Weasel plunges his knife into your heart.">)
+ (<L? ,SM-CTR 2>
+ <COND (<AND <IN? ,WEASEL ,WINDING-ROAD-1>
+ <IN? ,JOHNNY ,WINDING-ROAD-1>
+ <IN? ,PETE ,WINDING-ROAD-1>>
+ <SETG SM-CTR 2>
+ <I-SECOND-MEETING>
+ <RTRUE>)
+ (<==? ,SM-CTR 0>
+ <COND (<IN? ,JOHNNY ,WINDING-ROAD-1>
+ <SETG SM-CTR 1>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"Johnny says, \"We'll start when everyone's here.\"" CR>)>)>)
+ (<G? ,BLOOD-ALCOHOL 10>
+ <SETG SM-CTR 4>
+ <DISABLE <INT I-SECOND-MEETING>>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <ALL-GO-HOME>
+ <I-PLOT-NEVER-STARTS>
+ <TELL
+"\"I won't risk everything on a drunk diver!\" " D ,WEASEL " says.|
+\"You're right,\" says Johnny. \"We're calling this off.\"" CR>)
+ (<==? ,SM-CTR 2>
+ <SETG WRECK-FOUND <RANDOM 2>>
+ <COND (<==? ,WRECK-FOUND 1>
+ <SETG SAMPLE-TREASURE ,GOLD-COIN>)
+ (T <SETG SAMPLE-TREASURE ,DINNER-PLATE>)>
+ <PUTP ,SAMPLE-TREASURE ,P?ACTION SAMPLE-TREASURE-F>
+ <MOVE ,SAMPLE-TREASURE ,JOHNNY>
+ ;<FCLEAR ,SAMPLE-TREASURE ,INVISIBLE>
+ <SETG P-IT-OBJECT ,SAMPLE-TREASURE>
+ <SETG SM-CTR 3>
+ <SETG I-WAIT-DURATION 6>
+ <SETG I-WAIT-RTN ,I-SECOND-MEETING>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"Johnny nods, then pulls out " A ,SAMPLE-TREASURE " he says he came across
+while on a shark hunt." CR>)
+ (<==? ,SM-CTR 3>
+ <COND (,I-WAIT-FLAG
+ <TELL
+"This interrupts Johnny's explanation, which makes him angry." CR>
+ <SETG I-WAIT-DURATION 6>)
+ (<AND <G? ,I-WAIT-DURATION 0>
+ <==? ,I-WAIT-RTN ,I-SECOND-MEETING>>
+ <RFALSE>)
+ (T
+ <DISABLE <INT I-SECOND-MEETING>>
+ <ENABLE <QUEUE I-OTHERS-MEET <- 705 ,PRESENT-TIME>>>
+ <SETG SM-CTR 4>
+ <SETG MEETINGS-COMPLETED 2>
+ <PUT ,MOVEMENT-GOALS ,JOHNNY-C ,JOHNNY-CONTINUES-TABLE>
+ <IMOVEMENT ,JOHNNY I-JOHNNY>
+ <RATING-UPD 20>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <CRLF>
+ <TELL
+"\"We're not sure which wreck to salvage,\" Johnny says.
+\"Since you're joining up, we're hoping you'll identify where
+the " D ,SAMPLE-TREASURE " came from, and then do the dive for us. I'll
+captain, Pete will cook, and " D ,WEASEL " will crew.|
+|
+Johnny winks at you. \"We'll need you to supply the minutes of longitude and
+latitude of the wreck. Get $500 and meet me at Point Lookout at 10:45. Then
+we'll provision the boat.\"|
+|
+He turns to the others. \"We'll meet in " D ,SHANTY " at 11:45 to discuss final
+arrangements.|
+|
+\"We're all in this now,\" Johnny says to the group. \"I'm not gonna chance
+this operation if one of you doesn't show. We need everyone to pull this off.
+If anyone tries anything stupid, you won't live to regret it.\"" CR>)>)>>
+
+<GLOBAL SM-CTR 0> "counter for throughout second meeting:
+ 0-Johnny not here
+ 1-waiting for Weasel and/or Pete
+ 2-Johnny shows treasure
+ 3-Johnny shoots deal
+ 4-meeting's over"
+
+<ROUTINE I-THIRD-MEETING ("AUX" JMG)
+ <COND (<NOT <EQUAL? ,HERE ,POINT-LOOKOUT>>
+ <DISABLE <INT I-THIRD-MEETING>>
+ <RFALSE>)
+ (<IN? ,JOHNNY ,POINT-LOOKOUT>
+ <COND (<L? ,TM-CTR 6> <SETG TM-CTR <+ ,TM-CTR 1>>)>)
+ (T <RFALSE>)>
+ <COND (<IN? ,MCGINTY ,POINT-LOOKOUT>
+ <JIGS-UP
+"Johnny glares at McGinty. \"Trying to cash in on my work again,
+huh? You probably killed Hevlin, too!\" And with that, he pushes McGinty off
+the cliff.|
+|
+\"I can't leave witnesses,\" he mumbles.
+Before you can react, you're on your way down to join what's left of
+McGinty.">)
+ (<AND <IN? ,MCGINTY ,OCEAN-ROAD-3>
+ <NOT <IN-MOTION? ,MCGINTY>>>
+ <JIGS-UP
+"Johnny sees McGinty on the road. \"You brought McGinty, you traitor! You
+probably killed Hevlin, too!\" A moment later, you're falling
+down to the rocks.">)
+ (<==? ,TM-CTR 1>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"Johnny turns toward you. \"Well? Did you bring the money?\"" CR>)
+ (<G? ,BLOOD-ALCOHOL 10>
+ <JIGS-UP
+"Johnny stares at you in disgust. \"A drunk diving for us? You'll probably
+tell McGinty, too. I'll make sure you don't.\" He pushes you off the cliff.
+Although you feel no pain, your landing is fatal.">)
+ (<==? ,TM-CTR 4>
+ <TELL
+"Johnny glares at you as if you were a sea slug." CR>)
+ (<==? ,TM-CTR 5>
+ <JIGS-UP
+"Johnny looks disgusted. \"No money? You probably told McGinty already.
+Traitor!\" He pushes you off the cliff, and you scream as
+the pointy rocks rush up to meet you.">)
+ (<==? ,TM-CTR 6>
+ <SETG TM-CTR 7>
+ <RATING-UPD 20>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <CRLF>
+ <TELL
+"\"Glad you're with us. Since you're okay, I'll level with you. Before
+Hevlin died, he told me he gave you the book. He also said you could handle
+this job. He's the one who gave me the " D ,SAMPLE-TREASURE ". I didn't want
+to say anything in front of Pete and " D ,WEASEL " just in case.|
+|
+\"We're gonna need a boat, but I don't know which one. If
+you need deep-sea diving gear, it'll have to be
+the " D ,SALVAGER ". Is the " D ,GLOBAL-TREASURE " more than 200 feet deep?\""
+CR>)
+ (<==? ,TM-CTR 7>
+ <COND (<G? ,PRESENT-TIME 675>
+ <JIGS-UP
+"Johnny looks disgusted. \"I can't wait all day...\" You feel a shove and then
+find yourself on your way down to the rocks below.">)>
+ <SETG QCONTEXT ,JOHNNY>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <TELL
+"Johnny looks impatient. \"Don't confuse things. A yes or no will do.\""
+CR>)
+ (<==? ,TM-CTR 8>
+ <ESTABLISH-GOAL ,JOHNNY ,OUTFITTERS-HQ>
+ <PUT ,MOVEMENT-GOALS ,JOHNNY-C ,JOHNNY-COMPLETES-TABLE>
+ <SET JMG <GET ,MOVEMENT-GOALS ,JOHNNY-C>>
+ <PUT .JMG ,MG-TIME <- 838 ,PRESENT-TIME>>
+ <IMOVEMENT ,JOHNNY I-JOHNNY>
+ <DISABLE <INT I-THIRD-MEETING>>
+ <SETG MEETINGS-COMPLETED 3>
+ <TELL
+"\"We'll rent the " D ,SHIP-CHOSEN ". Let's go get what we need.\"" CR>)>>
+
+<GLOBAL TM-CTR 0> "Counter for third meeting (incremented every move thru 5):
+ 0 - no meeting yet
+ 1 - Johnny wants to see money
+ 2-5 - Johnny is waiting to see money
+ (on 5, he's waited long enough and kills you)
+ 6 - money shown; Johnny asks which ship to rent
+ 7 - waiting for answer about ship
+ 8 - meeting's over"
+
+<ROUTINE I-EQUIP ("AUX" MCG-GT (V <>))
+ <COND (<IN? ,PLAYER ,OUTFITTERS-HQ>
+ <COND (<IN? ,MCGINTY ,OUTFITTERS-HQ>
+ <SETG WARNING-CTR <+ ,WARNING-CTR 1>>
+ <COND (<==? ,WARNING-CTR 7>
+ <TELL
+"Johnny leans over and whispers, \"Let's wait out McGinty. He should leave soon.\"" CR>
+ <SET V T>)>
+ <COND (<G? ,I-WAIT-DURATION 0>
+ <SETG I-WAIT-DURATION 0>
+ <SETG I-WAIT-RTN <>>
+ <TELL
+"Johnny ends his conversation, and " D ,MCGINTY
+" asks the salesman some questions." CR>)
+ (<AND <GET <SET MCG-GT
+ <GET ,GOAL-TABLES ,MCGINTY-C>>
+ ,GOAL-ENABLE>
+ <==? <GET .MCG-GT ,GOAL-F> ,MCGINTY-HQ>>
+ <COND (<NOT ,MCGINTY-KNOWS>
+ <SETG MCGINTY-MEETS-WEASEL T>)>
+ <SETG I-WAIT-DURATION 9>
+ <SETG I-WAIT-RTN ,I-EQUIP>
+ <RFALSE>)
+ (<AND <VERB? BUY RENT>
+ <NOT <PRSO? ,FERRY-TOKEN>>>
+ <SETG MCGINTY-KNOWS T>
+ <DISABLE <INT I-MCGINTY-FOLLOWS>>
+ <DISABLE <INT I-EQUIP>>
+ <MOVE ,MCGINTY ,WHARF-ROAD-4>
+ ;<MOVE ,JOHNNY ,WHARF-ROAD-3>
+ ;<ESTABLISH-GOAL ,JOHNNY ,SHANTY>
+ <ESTABLISH-GOAL ,MCGINTY ,MCGINTY-HQ>
+ <TELL D ,MCGINTY
+" grins as he realizes what you're up to.">
+ <SAY-MCGINTY-KNOWS>)
+ (<G? ,PRESENT-TIME 699>
+ <COND (<IN? ,JOHNNY ,OUTFITTERS-HQ>
+ <ESTABLISH-GOAL ,JOHNNY ,SHANTY>
+ <TELL
+"Johnny glares at " D ,MCGINTY
+" and then at his watch. \"There's no way.\" He turns
+to you. \"Forget it. We can't get this done in time.\"" CR>)
+ (T
+ <DISABLE <INT I-MCGINTY-FOLLOWS>>
+ <ESTABLISH-GOAL ,MCGINTY ,MCGINTY-HQ>
+ <DISABLE <INT I-EQUIP>>
+ <TELL
+D ,MCGINTY
+" turns to the salesman. \"I think... yeah! I will need that boat after
+all.\" He turns to you and grins." CR>)>)
+ (<NOT <OR <VERB? WAIT WAIT-FOR>
+ <VERB? LOOK WALK>>>
+ <TELL
+"Johnny glances nervously at " D ,MCGINTY "." CR>)
+ (T <RETURN .V>)>)
+ (,MCGINTY-KNOWS
+ <DISABLE <INT I-EQUIP>>
+ <RFALSE>)
+ (,I-WAIT-FLAG
+ <TELL
+"Johnny seems unhappy to have his conversation interrupted." CR>
+ <SETG I-WAIT-DURATION 9>)
+ (<==? ,I-WAIT-RTN ,I-EQUIP>
+ <COND (<G? ,I-WAIT-DURATION 0>
+ <RFALSE>)
+ (T
+ <ESTABLISH-GOAL ,JOHNNY ,SHANTY>
+ <ENABLE <QUEUE I-SHOVE-OFF <- 870 ,PRESENT-TIME>>>
+ <DISABLE <INT I-EQUIP>>
+ <COND (<EQUAL? ,SHIP-CHOSEN ,TRAWLER>
+ <SETG AMT-OWED <+ 50 <RANDOM 50>>>)
+ (T <SETG AMT-OWED <+ 400 <RANDOM 50>>>)>
+ <SETG JOHNNY-MADE-DEAL T>
+ <RATING-UPD 20>
+ <TELL
+"Johnny hands him a list and the salesman quotes a price.
+Johnny gives him the money he has, then says to you, \"You'll need to chip
+in $" N ,AMT-OWED " plus the money for your stuff. We'll leave on the "
+D ,SHIP-CHOSEN " at high tide.\"|
+|
+He tells the " D ,SPEAR-CARRIER ", \"Deliver the stuff half an hour before high
+tide.\" He turns back to you. \"Better be on board then to watch
+the stuff.\"" CR>)>)
+ (<NOT <IN? ,MCGINTY ,WHARF-ROAD-4>>
+ <SETG I-WAIT-DURATION 9>
+ <SETG I-WAIT-RTN ,I-EQUIP>
+ <RFALSE>)>)
+ (T
+ <SETG I-WAIT-DURATION 0>
+ <COND (<L? <GET <INT I-EQUIP> ,C-TICK> -15>
+ <DISABLE <INT I-EQUIP>>
+ <COND (<IN? ,JOHNNY ,OUTFITTERS-HQ>
+ <ESTABLISH-GOAL ,JOHNNY ,SHANTY>)>
+ <I-PLOT-NEVER-STARTS>
+ <RFALSE>)>)>>
+
+<GLOBAL WARNING-CTR 0>
+
+<GLOBAL AMT-OWED 0>
+
+<GLOBAL MCGINTY-KNOWS <>>
+
+<GLOBAL JOHNNY-MADE-DEAL <>>
+
+<ROUTINE TELL-NEED-BOAT ()
+ <TELL
+" \"We will need that boat after all,\" he says to the salesman as he
+leaves." CR>>
+
+<ROUTINE SAY-MCGINTY-KNOWS ()
+ <TELL-NEED-BOAT>
+ <MOVE ,JOHNNY ,WHARF-ROAD-3>
+ <ZERO-ATTENTION ,JOHNNY>
+ <ESTABLISH-GOAL ,JOHNNY ,SHANTY>
+ <TELL CR
+"Johnny glares at you. \"That was stupid! Now he's stopped us from renting
+the boat we need.\" He storms out.
+You can't help feeling fortunate that someone else happened to be here." CR>>
+
+<ROUTINE I-OTHERS-MEET ("AUX" (V T))
+ <COND (<G? ,PRESENT-TIME 720>
+ <DISABLE <INT I-OTHERS-MEET>>
+ <I-PLOT-NEVER-STARTS>
+ <COND (<IN? ,PLAYER ,CHAIR>
+ <TELL "Johnny tells Pete the deal's off." CR>)
+ (<IN? ,PLAYER ,SHANTY>
+ <TELL "Johnny says something to Pete." CR>)
+ (T <SET V <>>)>
+ <RETURN .V>)
+ (<OR <NOT <IN? ,JOHNNY ,SHANTY>>
+ <NOT <IN? ,PETE ,SHANTY>>
+ <NOT <IN? ,WEASEL ,SHANTY>>>
+ <ENABLE <QUEUE I-OTHERS-MEET 1>>
+ <RFALSE>)
+ (<NOT ,JOHNNY-MADE-DEAL>
+ <I-PLOT-NEVER-STARTS>)>
+ <COND (<IN? ,PLAYER ,CHAIR>
+ <TELL "Johnny tells Pete and " D ,WEASEL " the deal's ">
+ <COND (,JOHNNY-MADE-DEAL
+ <TELL "on and to be at the " D ,SHIP-CHOSEN " at 2:30">)
+ (T <TELL "off">)>
+ <TELL "." CR>)
+ (<IN? ,PLAYER ,SHANTY>
+ <TELL
+"Johnny, Pete, and " D ,WEASEL " are talking at a corner table." CR>)>>
+
+<ROUTINE I-TRAITOR-MEETING ("AUX" (FERRY-HERE <>))
+ <COND (<OR <IN? ,WEASEL ,FERRY>
+ ,MCGINTY-KNOWS
+ <NOT <IN? ,MCGINTY ,FERRY-LANDING>>>
+ <DISABLE <INT I-TRAITOR-MEETING>>
+ <RFALSE>)
+ (<NOT <IN? ,WEASEL ,FERRY-LANDING>>
+ <RFALSE>)
+ (<IN? ,ID-CARD ,WEASEL>
+ <COND (<IN? ,PASSBOOK .WEASEL>
+ <COND (<IN? ,FERRY ,FERRY-LANDING>
+ <MOVE ,WEASEL ,FERRY>
+ <SET FERRY-HERE T>)>
+ <DISABLE <INT I-TRAITOR-MEETING>>
+ <COND (<IN? ,PLAYER ,FERRY-LANDING>
+ <TELL-CORNER .FERRY-HERE "shakes his head">)>)
+ (T
+ <MOVE ,ID-CARD ,MCGINTY>
+ <COND (<IN? ,FERRY ,FERRY-LANDING>
+ <MOVE ,WEASEL ,FERRY>
+ <SET FERRY-HERE T>)>
+ <DISABLE <INT I-TRAITOR-MEETING>>
+ <COND (<IN? ,PLAYER ,FERRY-LANDING>
+ <TELL-CORNER .FERRY-HERE
+ "hands something to McGinty">)>)>)
+ (T
+ <MOVE ,ID-CARD ,WEASEL>
+ <SETG MCGINTY-MEETS-WEASEL <>>
+ <COND (<IN? ,PLAYER ,FERRY-LANDING>
+ <TELL
+D ,MCGINTY " takes " D ,WEASEL
+" to a corner of the landing, where they talk." CR>)>)>>
+
+<ROUTINE TELL-CORNER (FERRY-HERE STR)
+ <TELL
+D ,MCGINTY " and " D ,WEASEL
+" are talking in a corner. The Weasel " .STR " and ">
+ <COND (.FERRY-HERE
+ <TELL "then boards the ferry">)
+ (T <TELL "they separate">)>
+ <TELL "." CR>>
+
+<ROUTINE I-SHOVE-OFF ("AUX" L)
+ <COND (<NOT <ENABLED? I-JOHNNY>>
+ <RFALSE>)
+ (<==? <GETP <META-LOC ,PLAYER> ,P?LINE>
+ <GETP ,SHIP-CHOSEN ,P?LINE>>
+ <COND (<AND <G? ,PRESENT-TIME 930>
+ <NOT ,LATITUDE-SET>
+ <NOT ,LONGITUDE-SET>>
+ <ALL-GO-HOME>
+ <RFALSE>)
+ (<IN? ,JOHNNY <META-LOC ,PLAYER>>
+ <TELL D ,JOHNNY " turns to">)
+ (T
+ <SET L <LOC ,JOHNNY>>
+ <MOVE ,JOHNNY <META-LOC ,PLAYER>>
+ <ESTABLISH-GOAL ,JOHNNY .L>
+ <TELL D ,JOHNNY " walks up behind">)>
+ <TELL " you and says, \"">
+ <COND (<NOT ,DELIVERY-MADE>
+ <TELL
+"We're gonna have to forget it. Outfitters never delivered the stuff." CR>
+ <ALL-GO-HOME>
+ <RTRUE>)
+ (<EQUAL? 0 ,LATITUDE-SET ,LONGITUDE-SET>
+ <TELL
+"If we're gonna go, you have to tell me the minutes of ">
+ <COND (<==? ,LATITUDE-SET 0>
+ <TELL "latitude">
+ <COND (<==? ,LONGITUDE-SET 0>
+ <TELL " and ">)>)>
+ <COND (<==? ,LONGITUDE-SET 0>
+ <TELL "longitude">)>
+ <TELL ".\"" CR>
+ <GRAB-ATTENTION ,JOHNNY>
+ <ENABLE <QUEUE I-SHOVE-OFF <+ 30 <RANDOM 10>>>>
+ <RTRUE>)
+ (T <TELL
+"We'll be leaving shortly. Get some sleep.\"" CR>)>
+ ;<COND (<AND <==? ,LATITUDE-SET
+ <GET ,LATITUDE-TABLE ,WRECK-FOUND>>
+ <==? ,LONGITUDE-SET
+ <GET ,LONGITUDE-TABLE ,WRECK-FOUND>>>
+ <SETG AT-WRECK? T>)>
+ <COND (<==? ,SHIP-CHOSEN ,SALVAGER>
+ <ESTABLISH-GOAL ,JOHNNY ,MM-WHEELHOUSE>)
+ (T
+ <ESTABLISH-GOAL ,JOHNNY ,NW-WHEELHOUSE>)>
+ <COND (<NOT <EQUAL? <LOC ,WEASEL>
+ ,FERRY ,GLOBAL-FERRY ,LOCAL-GLOBALS>>
+ <ESTABLISH-GOAL ,WEASEL <LOC ,DECK-CHAIR>>)>
+ <COND (<0? ,AMT-OWED>
+ <ENABLE <QUEUE I-BOAT-TRIP 10>>
+ <RFALSE>)>)
+ (<G? ,PRESENT-TIME 900>
+ <ALL-GO-HOME>
+ <RFALSE>)
+ (T <ENABLE <QUEUE I-SHOVE-OFF <+ 30 <RANDOM 10>>>>
+ <RFALSE>)>>
+
+<ROUTINE ALL-GO-HOME ()
+ <ESTABLISH-GOAL ,PETE ,SHANTY>
+ <COND (<AND <NOT <IN? ,WEASEL ,FERRY>>
+ <NOT <IN? ,WEASEL ,GLOBAL-FERRY>>
+ <NOT <IN? ,WEASEL ,LOCAL-GLOBALS>>>
+ <ESTABLISH-GOAL ,WEASEL ,SHANTY>)>
+ <SETG JOHNNY-SILENT T>
+ <ESTABLISH-GOAL ,JOHNNY ,SHANTY>>
+
+<ROUTINE I-BOAT-TRIP ("AUX" BOAT OT EXCESS)
+ <COND (,ASLEEP <RFALSE>)
+ (<EQUAL? <GETP <META-LOC ,PLAYER> ,P?LINE>
+ <SET BOAT <GETP ,SHIP-CHOSEN ,P?LINE>>>
+ <COND (<NOT <==? <GETP <LOC ,WEASEL> ,P?LINE> .BOAT>>
+ <TELL-COMES-UP ,JOHNNY>
+ <TELL
+"\"The Weasel's not on board. The deal's off.\"" CR>
+ <FINISH>)
+ (<==? <GETP <LOC ,MCGINTY> ,P?LINE> .BOAT>
+ <TELL-COMES-UP ,WEASEL>
+ <JIGS-UP
+"\"You brought McGinty!\" Next thing you know, your throat's been slit.">)
+ (<IN? ,ENVELOPE ,JOHNNY>
+ <MOVE ,JOHNNY <LOC ,WEASEL>>
+ <ROUGH-JUSTICE>)>
+ ;<ENABLE <QUEUE I-CHANGE-WATCH <- 1075 ,PRESENT-TIME>>>
+ ;<ENABLE <QUEUE I-OBSTACLES <RANDOM 90>>>
+ ;<SETG HOW-TIRED 2>
+ <DISABLE <INT I-MCGINTY-FOLLOWS>>
+ <SETG SOUPS-ON T>
+ <RATING-UPD 20>
+ <COND (<AND <==? ,LATITUDE-SET 20>
+ <==? ,LONGITUDE-SET 25>>
+ <TELL-COMES-UP ,JOHNNY>
+ <JIGS-UP
+"\"What kind of joke is this, giving me the coordinates of the island?\"">)>
+ <COND (<EQUAL? <META-LOC ,PLAYER> ,MM-GALLEY ,NW-GALLEY>
+ <TELL "Pete announces that the stew is ready." CR>)>
+ <COND (<EQUAL? ,SHIP-CHOSEN ,TRAWLER>
+ <SETG TRAWLER-DOCKED <>>)
+ (T <SETG SALVAGER-DOCKED <>>)>
+ <SETG AT-SEA T>
+ ;<SETG ON-WATCH ,WEASEL>
+ ;<SET-NEXT-WATCH>
+ <COND (<IN? ,PLAYER ,DECK-CHAIR>
+ <MOVE ,PLAYER <LOC ,DECK-CHAIR>>)>
+ ;<MOVE ,WEASEL ,DECK-CHAIR>
+ <COND (<GLOBAL-IN? ,RAILING <LOC ,PLAYER>>
+ <TELL
+"As the engines roar to life, you go to the " D ,RAILING
+" to watch the shoreline recede.">
+ <COND (<IN? ,DECK-CHAIR <LOC ,PLAYER>>
+ <TELL-FERRY-KLUDGE "sits down for his watch">)>
+ <TELL
+" As the boat leaves the wharf, y">)
+ (T <TELL
+"The boat begins to move through the waves. Y">)>
+ <TELL "ou feel the thrill of being out to sea once again." CR>
+ <CRLF>
+ <COND (<NOT <IN? ,PLAYER ,BUNK>>
+ <TELL "You ">
+ <COND (<NOT <IN? ,PLAYER <LOC ,BUNK>>>
+ <SETG HERE <LOC ,BUNK>>
+ <MOVE-SHARED-OBJECTS ,HERE>
+ <COND (<IN? ,AIR-HOSE ,DEEP-SUIT>
+ <MOVE ,AIR-HOSE ,MM-COMPRESSOR>
+ <TELL "disconnect the " D ,AIR-HOSE ", ">)>
+ <TELL "go to the crew's quarters and ">)>
+ <MOVE ,PLAYER ,BUNK>
+ <TELL "climb into your bunk">
+ <STRIP-EQUIPMENT>
+ <TELL ". " CR>)>
+ <TELL
+"In no time, the rhythm of the ocean lulls you to sleep..." CR CR>
+ <MOVE ,PETE ,DECK-CHAIR>
+ <MOVE ,JOHNNY ,HERE>
+ <COND (<==? ,SHIP-CHOSEN ,SALVAGER>
+ <MOVE ,WEASEL ,MM-AFT-DECK>)
+ (T <MOVE ,WEASEL ,NW-AFT-DECK>)>
+ <COND (<AND <==? <GETP <META-LOC ,ENVELOPE> ,P?LINE> .BOAT>
+ <NOT <IN? ,ENVELOPE ,UNDER-BUNK>>>
+ <MOVE ,ENVELOPE ,WEASEL>)>
+ <SET OT ,PRESENT-TIME>
+ <SETG PRESENT-TIME <+ 345 <RANDOM 15>>>
+ ;<DISABLE <INT I-FERRY>>
+ ;<DISABLE <INT I-FERRY-APPROACHING>>
+ ;<DISABLE <INT I-FERRY-LEAVING>>
+ ;<DISABLE <INT I-FERRY-GONE>>
+ <INTERRUPT-CHECK <SET EXCESS <- <+ ,PRESENT-TIME 1440> .OT>>>
+ <COND (,WATCH-WOUND
+ <SETG WATCH-MOVES <+ ,WATCH-MOVES <MOD .EXCESS 60>>>
+ <COND (<G? ,WATCH-MOVES 59>
+ <SETG WATCH-MOVES <- ,WATCH-MOVES 60>>
+ <SETG WATCH-SCORE <+ ,WATCH-SCORE 1>>)>
+ <SETG WATCH-SCORE <+ ,WATCH-SCORE </ .EXCESS 60>>>
+ <REPEAT ()
+ <COND (<G? ,WATCH-SCORE 11>
+ <SETG WATCH-SCORE <- ,WATCH-SCORE 12>>)
+ (T <RETURN>)>>)>
+ <WATCH-UPDATE>
+ <COND (<AND <==? ,LATITUDE-SET 40>
+ <==? ,LONGITUDE-SET 45>>
+ <SETG WRECK-CHOSEN 1>
+ <SETG OCEAN-BOTTOM 400>)
+ (<AND <==? ,LATITUDE-SET 25>
+ <==? ,LONGITUDE-SET 25>>
+ <SETG WRECK-CHOSEN 2>
+ <SETG OCEAN-BOTTOM 150>)
+ (<AND <==? ,LATITUDE-SET 15>
+ <==? ,LONGITUDE-SET 50>>
+ <SETG WRECK-CHOSEN 3>
+ <SETG OCEAN-BOTTOM 350>)
+ (<NOT <SETG OCEAN-BOTTOM <OCEAN-BOTTOM-FCN>>>
+ <JIGS-UP
+"You are awakened by what feels like your ship running aground. You are put
+back to a permanent sleep by the Weasel's knife.">)>
+ <SETG HOW-TIRED 1>
+ <COND (<L? ,HOW-HUNGRY 2>
+ <SETG HOW-HUNGRY 1>)>
+ <COND (<L? ,HOW-THIRSTY 2>
+ <SETG HOW-THIRSTY 1>)>
+ <ENABLE <QUEUE I-HUNGER 10>>
+ <ENABLE <QUEUE I-THIRST 15>>
+ <ENABLE <QUEUE I-TIRED 869>>
+ <ENABLE <QUEUE I-ENDIT <- 720 ,PRESENT-TIME>>>
+ <TELL D ,JOHNNY " shakes your shoulder and wakes you. ">
+ <COND (<EQUAL? ,SHIP-CHOSEN ,TRAWLER>
+ <ESTABLISH-GOAL ,JOHNNY ,NW-CAPT-CABIN>)
+ (T <ESTABLISH-GOAL ,JOHNNY ,MM-CAPT-CABIN>)>
+ ;<SETG MOMENT-OF-TRUTH T>
+ <DISABLE <INT I-BOAT-TRIP>>
+ <TELL "\"We've arrived. You're up as soon as you're ready.\"" CR>)>>
+
+<ROUTINE STRIP-EQUIPMENT ("AUX" F N (V <>))
+ <SET F <FIRST? ,PLAYER>>
+ <REPEAT ()
+ <COND (<NOT .F> <RETURN>)>
+ <SET N <NEXT? .F>>
+ <COND (<NOT <==? .F ,WATCH>>
+ <MOVE .F <LOC ,BUNK>>
+ <FCLEAR .F ,WORNBIT>
+ <SET V T>)>
+ <SET F .N>>
+ <COND (.V <TELL ", dropping your equipment">)>>
+
+<ROUTINE INTERRUPT-CHECK (DUR "AUX" C E TICK FOO R)
+ <SET C <REST ,C-TABLE ,C-INTS>>
+ <SET E <REST ,C-TABLE ,C-TABLELEN>>
+ <SETG ASLEEP T>
+ <REPEAT ()
+ <COND (<==? .C .E> <RETURN>)
+ (<NOT <0? <GET .C ,C-ENABLED?>>>
+ <SET TICK <GET .C ,C-TICK>>
+ <COND (<0? .TICK>)
+ (T
+ <SET FOO <- .TICK .DUR>>
+ <COND (<L? .FOO 2>
+ <APPLY <GET .C ,C-RTN>>
+ <PUT .C ,C-TICK <- .TICK 1>>)
+ (T <PUT .C ,C-TICK .FOO>)>
+ ;<COND (<AND <NOT <G? .TICK 1>>
+ <SET VAL <APPLY <GET .C ,C-RTN>>>>
+ <COND (,DEBUG
+ <TELL "[Interrupt returning T.]" CR>)>
+ <COND (<OR <NOT .FLG>
+ <==? .VAL ,M-FATAL>>
+ <SET FLG .VAL>)>)>)>)>
+ <SET C <REST .C ,C-INTLEN>>>
+ <SETG ASLEEP <>>>
+
+<GLOBAL ASLEEP <>>
+
+<ROUTINE LE? (LAT LON CNST)
+ <NOT <G? <+ <* .LAT ,LATITUDE-SET> <* .LON ,LONGITUDE-SET>> .CNST>>>
+
+<ROUTINE GE? (LAT LON CNST)
+ <NOT <L? <+ <* .LAT ,LATITUDE-SET> <* .LON ,LONGITUDE-SET>> .CNST>>>
+
+<ROUTINE OCEAN-BOTTOM-FCN ()
+ <COND (<OR <L? ,LONGITUDE-SET 5>
+ <G? ,LONGITUDE-SET 55>
+ <L? ,LATITUDE-SET 5>
+ <G? ,LATITUDE-SET 45>>
+ <JIGS-UP
+"Your boat is lost in a sudden squall while you sleep.">)
+ (<AND <NOT <G? ,LATITUDE-SET 17>>
+ <LE? 2 -5 -11>
+ <LE? 1 1 30>>
+ <RFALSE>)
+ (<AND <NOT <G? ,LATITUDE-SET 6>>
+ <NOT <G? ,LONGITUDE-SET 36>>
+ <NOT <L? ,LONGITUDE-SET 34>>>
+ <RFALSE>)
+ (<AND <NOT <G? ,LONGITUDE-SET 34>>
+ <NOT <G? ,LATITUDE-SET 7>>
+ <LE? 1 -1 -26>>
+ <RFALSE>)
+ (<GE? 2 1 115>
+ <RETURN 400>)
+ (<AND <GE? 1 1 68>
+ <LE? 1 -2 -91>>
+ <RETURN 400>)
+ (<OR <NOT <L? ,LATITUDE-SET 40>>
+ <GE? 15 4 680>
+ <GE? 2 1 107>
+ <GE? 1 1 76>
+ <AND <NOT <L? ,LONGITUDE-SET 44>>
+ <GE? 2 1 70>
+ <OR <NOT <L? ,LONGITUDE-SET 52>>
+ <LE? 5 -3 -57>
+ <LE? 1 -1 -31>>>>
+ <RETURN 350>)
+ (<OR <G? ,LATITUDE-SET 37>
+ <GE? 6 1 240>
+ <GE? 13 6 635>
+ <GE? 1 1 72>
+ <AND <NOT <L? ,LONGITUDE-SET 41>>
+ <GE? 13 8 497>
+ <OR <NOT <L? ,LONGITUDE-SET 49>>
+ <LE? 6 -5 -121>
+ <LE? 2 -3 -103>>>>
+ <RETURN 300>)
+ (<OR <NOT <L? ,LATITUDE-SET 35>>
+ <GE? 2 -1 57>
+ <GE? 44 15 1810>
+ <GE? 4 3 230>
+ <AND <NOT <L? ,LONGITUDE-SET 37>>
+ <GE? 13 7 415>
+ <OR <NOT <L? ,LONGITUDE-SET 46>>
+ <LE? 3 -2 -32>>>>
+ <RETURN 250>)
+ (<OR <AND <NOT <G? ,LATITUDE-SET 19>>
+ <LE? 5 3 131>
+ <LE? 7 6 214>>
+ <AND <NOT <G? ,LATITUDE-SET 7>>
+ <NOT <G? ,LONGITUDE-SET 35>>>
+ <AND <NOT <G? ,LATITUDE-SET 8>>
+ <LE? 2 -1 -16>
+ <LE? 1 1 45>
+ <LE? 2 1 51>>>
+ <RETURN 50>)
+ (<OR <AND <NOT <G? ,LATITUDE-SET 20>>
+ <LE? 2 1 50>
+ <LE? 10 7 286>>
+ <AND <NOT <G? ,LATITUDE-SET 9>>
+ <LE? 3 2 99>>>
+ <RETURN 100>)
+ (<OR <AND <NOT <G? ,LATITUDE-SET 22>>
+ <OR <LE? 5 3 140>
+ <LE? 7 3 172>>>
+ <AND <NOT <G? ,LATITUDE-SET 10>>
+ <LE? 9 5 270>>>
+ <RETURN 150>)
+ (<AND <NOT <G? ,LONGITUDE-SET 29>>
+ <NOT <L? ,LONGITUDE-SET 18>>
+ <NOT <G? ,LATITUDE-SET 24>>
+ <NOT <L? ,LATITUDE-SET 19>>
+ <LE? 9 4 296>
+ <GE? 4 1 102>
+ <GE? 2 1 62>>
+ <RETURN 50>)
+ (<AND <NOT <G? ,LATITUDE-SET 28>>
+ <NOT <L? ,LATITUDE-SET 17>>
+ <NOT <G? ,LONGITUDE-SET 34>>
+ <NOT <L? ,LONGITUDE-SET 15>>
+ <LE? 1 -1 11>
+ <GE? 1 1 39>
+ <GE? 5 2 141>
+ <GE? 1 -1 -15>
+ <OR <LE? 4 1 118>
+ <LE? 6 5 268>>>
+ <RETURN 100>)
+ (<AND <NOT <G? ,LATITUDE-SET 32>>
+ <NOT <L? ,LATITUDE-SET 16>>
+ <NOT <G? ,LONGITUDE-SET 38>>
+ <GE? 5 -3 -19>
+ <GE? 7 3 196>
+ <GE? 3 7 164>
+ <LE? 1 -1 18>
+ <OR <LE? 7 6 344>
+ <LE? 11 4 394>>>
+ <RETURN 150>)
+ (T <RETURN 200>)>>
+
+;<ROUTINE V-DEPTH-CHECK ("AUX" DEP LAT LON)
+ <SET LAT 5>
+ <SET LON 5>
+ <REPEAT ()
+ <TELL "Latitude:" N .LAT " Longitude:" N .LON " Depth:">
+ <SETG LATITUDE-SET .LAT>
+ <SETG LONGITUDE-SET .LON>
+ <COND (<SET DEP <OCEAN-BOTTOM-FCN>>
+ <TELL N .DEP>)
+ (T <TELL "0">)>
+ <CRLF>
+ <COND (<G? <SET LON <+ .LON 5>> 55>
+ <COND (<G? <SET LAT <+ .LAT 5>> 45>
+ <RETURN>)>
+ <SET LON 5>)>>>
+
+;<ROUTINE I-DIVETIME ()
+ <COND (<IN-MOTION? ,JOHNNY>
+ <COND (<NOT <EQUAL? <GET <GET ,GOAL-TABLES
+ <GETP ,JOHNNY ,P?CHARACTER>> ,GOAL-F>
+ <META-LOC ,PLAYER>>>
+ <ESTABLISH-GOAL ,JOHNNY <META-LOC ,PLAYER>>)>
+ <RFALSE>)>
+ <COND (<EQUAL? ,SHIP-CHOSEN ,TRAWLER>
+ <ESTABLISH-GOAL ,WEASEL ,NW-AFT-DECK>)
+ (T <ESTABLISH-GOAL ,WEASEL ,MM-AFT-DECK>)>
+ <DISABLE <INT I-OBSTACLES>>
+ <COND (<IN? ,JOHNNY <META-LOC ,PLAYER>>
+ <JOHNNY-SAYS-GO>
+ <RFATAL>)
+ (T
+ <ESTABLISH-GOAL ,JOHNNY <META-LOC ,PLAYER>>
+ <ENABLE <QUEUE I-DIVETIME -1>>
+ <RFALSE>)>>
+
+<GLOBAL AT-SEA <>>
+
+<ROUTINE I-HUNGER ("AUX" N)
+ <COND (,ASLEEP <RFALSE>)>
+ <SETG HOW-HUNGRY <+ ,HOW-HUNGRY 1>>
+ <COND (<==? ,HOW-HUNGRY 1>
+ <ENABLE <QUEUE I-HUNGER 300>>
+ <RFALSE>)
+ (<==? ,HOW-HUNGRY 2>
+ <ENABLE <QUEUE I-HUNGER 20>>
+ <TELL "You begin to feel hungry." CR>
+ <RFALSE>)
+ (<==? ,HOW-HUNGRY 3>
+ <ENABLE <QUEUE I-HUNGER 20>>
+ <TELL "Your stomach begins to bother you. Better ">
+ <COND (<EQUAL? <META-LOC ,PLAYER> <META-LOC ,FOOD>>
+ <TELL "do something about it">)
+ (T <TELL "find some food">)>
+ <TELL "!" CR>
+ <RFALSE>)
+ (<G? ,HOW-HUNGRY 3>
+ <COND (<==? ,HERE ,SHANTY>
+ <SET N 2>)
+ (T <SET N 6>)>
+ <ENABLE <QUEUE I-HUNGER .N>>
+ <TELL "Your stomach is growling loudly." CR>
+ <RFATAL>)>>
+
+<ROUTINE I-THIRST ()
+ <COND (,ASLEEP <RFALSE>)>
+ <SETG HOW-THIRSTY <+ ,HOW-THIRSTY 1>>
+ <COND (<==? ,HOW-THIRSTY 1>
+ <ENABLE <QUEUE I-THIRST 110>>
+ <TELL "Your throat starts to feel dry." CR>
+ <RFALSE>)
+ (<==? ,HOW-THIRSTY 2>
+ <ENABLE <QUEUE I-THIRST 115>>
+ <TELL "You feel fairly thirsty." CR>
+ <RFALSE>)
+ (<==? ,HOW-THIRSTY 3>
+ <ENABLE <QUEUE I-THIRST 15>>
+ <TELL-YOUD-BETTER "find something to drink soon!">
+ <RFALSE>)
+ (<G? ,HOW-THIRSTY 3>
+ <ENABLE <QUEUE I-THIRST 4>>
+ <TELL "You lick your lips and clear your throat." CR>
+ <RFATAL>)>>
+
+<GLOBAL HOW-THIRSTY 0>
+
+<ROUTINE I-TIRED ()
+ <COND (,ASLEEP <RFALSE>)
+ (<L? ,HOW-TIRED 6>
+ <SETG HOW-TIRED <+ ,HOW-TIRED 1>>)>
+ <COND (<==? ,HOW-TIRED 1>
+ <ENABLE <QUEUE I-TIRED 479>>
+ <RFALSE>)
+ (<==? ,HOW-TIRED 2>
+ <ENABLE <QUEUE I-TIRED 1>>
+ <RFALSE>)
+ (<==? ,HOW-TIRED 3>
+ <ENABLE <QUEUE I-TIRED 30>>
+ <TELL "You yawn as you begin to feel drowsy." CR>)
+ (<==? ,HOW-TIRED 4>
+ <ENABLE <QUEUE I-TIRED 20>>
+ <TELL "You are starting to feel tired." CR>
+ <RFALSE>)
+ (<==? ,HOW-TIRED 5>
+ <ENABLE <QUEUE I-TIRED 10>>
+ <TELL
+"You yawn and feel very tired. Think about going to bed." CR>)
+ (<==? ,HOW-TIRED 6>
+ <TELL
+"Exhaustion overwhelms you. Keeping your eyes open is painful.">
+ <COND (<NOT ,AT-SEA>
+ <TELL " ">
+ <V-SLEEP>)
+ (T
+ <ENABLE <QUEUE I-TIRED 6>>
+ <CRLF>)>
+ <RFATAL>)>>
+
+;<ROUTINE I-OBSTACLES ("AUX" (UPFRONT? <>))
+ <SETG O-CTR <+ ,O-CTR 1>>
+ <COND (<AND <EQUAL? <META-LOC ,PLAYER> ,MM-FORE-DECK ,NW-FORE-DECK>
+ <NOT ,ASLEEP?>>
+ <SET UPFRONT? T>)>;"Historical note: The compiler sucks."
+ <COND (<==? ,O-CTR 1>
+ <ENABLE <QUEUE I-OBSTACLES -1>>
+ <SETG O-NUM <RANDOM 3>>
+ <SETG O-SIDE <RANDOM 2>>
+ <COND (<QUEUED? I-USELESS-TURN>
+ <I-USELESS-TURN>)>
+ <COND (.UPFRONT?
+ <OPRINT>
+ <RFATAL>)>)
+ (<==? ,O-CTR 2>
+ <COND (.UPFRONT?
+ <OPRINT>
+ <COND (<AND ,ON-WATCH
+ <NOT <EQUAL? ,ON-WATCH ,PLAYER>>>
+ <SETG BUTTON-PUSHED ,O-SIDE>
+ <START-SENTENCE ,ON-WATCH>
+ <TELL " pushes the button to his ">
+ <COND (<==? ,O-SIDE 1>
+ <TELL "left">)
+ (T <TELL "right">)>
+ <TELL "." CR>)
+ (T <RFATAL>)>
+ <RTRUE>)
+ (<AND ,ON-WATCH
+ <NOT <EQUAL? ,ON-WATCH ,PLAYER>>>
+ <SETG BUTTON-PUSHED ,O-SIDE>
+ <COND (<AND <EQUAL? ,HERE ,MM-WHEELHOUSE ,NW-WHEELHOUSE>
+ <G? ,BUTTON-PUSHED 0>>
+ <TELL
+"A tone sounds. Johnny spins the wheel ">
+ <COND (<==? ,BUTTON-PUSHED 1> <TELL "right">)
+ (T <TELL "left">)>
+ <TELL "." CR>)>)>)
+ (<G? ,O-CTR 2>
+ <COND (.UPFRONT?
+ <COND (<==? ,BUTTON-PUSHED 0>
+ <TELL
+"You watch in horror as the " D ,SHIP-CHOSEN " collides with" <OPRINT> "! ">
+ <JIGS-UP
+"As the boat rapidly sinks, you see several sharks in the area. Mercifully,
+you black out before you meet your fate.">)
+ (T
+ <TELL "The boat veers to ">
+ <COND (<==? ,BUTTON-PUSHED 1> <TELL "starboard">)
+ (T <TELL "port">)>
+ <COND (<==? ,O-SIDE ,BUTTON-PUSHED>
+ <SETG BUTTON-PUSHED 0>
+ <TELL ", away from" <OPRINT> "." CR>
+ <SETG O-CTR 0>
+ <ENABLE <QUEUE I-OBSTACLES
+ <+ 15 <RANDOM 130>>>>
+ <RTRUE>)
+ (T <TELL
+". Unfortunately, this puts you directly on a collision course! ">
+ <SETG BUTTON-PUSHED 0>
+ <I-OBSTACLES>)>)>)
+ (<NOT <EQUAL? ,O-SIDE ,BUTTON-PUSHED>>
+ <TELL
+"You feel the boat list to ">
+ <COND (<==? ,O-SIDE 1> <TELL "port">)
+ (T <TELL "starboard">)>
+ <JIGS-UP
+", and then start to sink! The water rises before you can respond.">)
+ (T
+ <SETG O-CTR 0>
+ <SETG BUTTON-PUSHED 0>
+ <ENABLE <QUEUE I-OBSTACLES <+ 15 <RANDOM 130>>>>
+ <COND (<AND <NOT <EQUAL? ,ON-WATCH ,WEASEL>>
+ <0? ,WATCH-CHANGE-CTR>>
+ <COND (<EQUAL? ,SHIP-CHOSEN ,SALVAGER>
+ <COND (<IN? ,WEASEL ,MM-ENGINE-ROOM>
+ <ESTABLISH-GOAL ,WEASEL
+ ,MM-CREW-QTRS>)
+ (T <ESTABLISH-GOAL ,WEASEL
+ ,MM-ENGINE-ROOM>)>)
+ (T
+ <COND (<IN? ,WEASEL ,NW-ENGINE-ROOM>
+ <ESTABLISH-GOAL ,WEASEL
+ ,NW-CREW-QTRS>)
+ (T <ESTABLISH-GOAL ,WEASEL
+ ,NW-ENGINE-ROOM>)>)>)>
+ <COND (<AND <NOT <EQUAL? ,ON-WATCH ,PETE>>
+ <0? ,WATCH-CHANGE-CTR>>
+ <COND (<IN? ,PETE <LOC ,DRINKING-WATER>>
+ <ESTABLISH-GOAL ,PETE <LOC ,BUNK>>)
+ (T
+ <ESTABLISH-GOAL ,PETE <LOC ,DRINKING-WATER>>)>
+ ;<COND (<EQUAL? ,SHIP-CHOSEN ,SALVAGER>
+ <COND (<IN? ,PETE ,MM-GALLEY>
+ <ESTABLISH-GOAL ,PETE
+ ,MM-CREW-QTRS>)
+ (T <ESTABLISH-GOAL ,PETE
+ ,MM-GALLEY>)>)
+ (T
+ <COND (<IN? ,PETE ,NW-GALLEY>
+ <ESTABLISH-GOAL ,PETE
+ ,NW-CREW-QTRS>)
+ (T <ESTABLISH-GOAL ,PETE
+ ,NW-GALLEY>)>)>)>
+ <RFALSE>)>)>>
+
+;<ROUTINE OPRINT ("AUX" SIDE)
+ <COND (<==? ,O-SIDE 1> <SET SIDE "port">)
+ (T <SET SIDE "starboard">)>
+ <COND (<==? ,O-NUM 1>
+ <COND (<==? ,O-CTR 1>
+ <TELL
+"Some debris approaches the " .SIDE " bow of the boat!" CR>)
+ (<==? ,O-CTR 2>
+ <TELL
+"To " .SIDE ", some floating wreckage heads for the boat!" CR>)
+ (<VERB? WALK> <RETURN " some debris">)
+ (T <RETURN " the debris">)>)
+ (<==? ,O-NUM 2>
+ <COND (<==? ,O-CTR 1>
+ <TELL
+"You can see a coral reef ahead and off the " .SIDE " bow!" CR>)
+ (<==? ,O-CTR 2>
+ <TELL
+"A large, jagged coral reef looms ahead and to " .SIDE "!" CR>)
+ (<VERB? WALK> <RETURN " a coral reef">)
+ (T <RETURN " the coral reef">)>)
+ (<==? ,O-NUM 3>
+ <COND (<==? ,O-CTR 1>
+ <TELL
+"To " .SIDE ", a boat on a collision course approaches!" CR>)
+ (<==? ,O-CTR 2>
+ <TELL
+"A boat comes directly at your " .SIDE " bow!" CR>)
+ (<VERB? WALK> <RETURN " a boat">)
+ (T <RETURN " the boat">)>)>>
+
+;<GLOBAL ON-WATCH <>>
+
+;<GLOBAL O-NUM 0>
+
+;<GLOBAL O-SIDE 0>
+
+;<GLOBAL O-CTR 0>
+
+;<GLOBAL BUTTON-PUSHED 0>
+
+;<GLOBAL USELESS-TURNS 0>
+
+;<ROUTINE I-USELESS-TURN ("AUX" (V <>))
+ <COND (<NOT ,AT-SEA>
+ <SETG BUTTON-PUSHED 0>
+ <DISABLE <INT I-USELESS-TURN>>
+ <RFALSE>)>
+ <SETG USELESS-TURNS <+ ,USELESS-TURNS 1>>
+ <COND (<G? ,O-CTR 1>
+ <RFALSE>)
+ (<AND <VERB? PUSH>
+ <PRSO? ,LEFT-BUTTON ,RIGHT-BUTTON>>
+ T)
+ (T
+ <COND (<AND <EQUAL? <META-LOC ,PLAYER> ,MM-FORE-DECK
+ ,NW-FORE-DECK>
+ <NOT ,ASLEEP?>>
+ <TELL "The boat veers to ">
+ <COND (<==? ,BUTTON-PUSHED 1> <TELL "starboard">)
+ (T <TELL "port">)>
+ <TELL "." CR>
+ <SET V T>)>
+ <SETG BUTTON-PUSHED 0>)>
+ <DISABLE <INT I-USELESS-TURN>>
+ .V>
+
+;<ROUTINE I-CHANGE-WATCH ("AUX" NEXT-UP (V <>))
+ <COND (<AND <G? ,O-CTR 0>
+ ,ON-WATCH>
+ <COND (<NOT <QUEUED? I-CHANGE-WATCH>>
+ <ENABLE <QUEUE I-CHANGE-WATCH 1>>)>
+ <RFALSE>)>
+ <SET NEXT-UP <GET ,WATCH-TABLE ,WT-PERSON>>
+ <COND (<==? .NEXT-UP ,PLAYER>
+ <COND (<IN? ,PLAYER <LOC ,DECK-CHAIR>>
+ <COND (<AND ,ON-WATCH
+ <NOT <==? ,ON-WATCH ,PLAYER>>
+ <NOT ,SEARCHER>>
+ <SET V T>
+ <START-SENTENCE ,ON-WATCH>
+ <TELL
+" says to you, \"Your watch,\" stands, then goes down the ladder." CR>
+ <MOVE ,ON-WATCH <LOC ,BUNK>>)>
+ <SETG ON-WATCH ,PLAYER>
+ <COND (<NOT ,SEARCHER>
+ <SET-NEXT-WATCH>
+ <RETURN .V>)>)>
+ <SETG WATCH-CHANGE-CTR <+ ,WATCH-CHANGE-CTR 1>>
+ <COND (<==? ,WATCH-CHANGE-CTR 1>
+ <ENABLE <QUEUE I-CHANGE-WATCH -1>>
+ <COND (<EQUAL? <META-LOC ,PLAYER> ,MM-CREW-QTRS
+ ,NW-CREW-QTRS>
+ <COND (,ASLEEP?
+ <TELL "You are awakened by ">)
+ (T <TELL "You hear ">)>
+ <TELL
+D ,ON-WATCH " yelling down that it's your watch." CR>)
+ (<AND <GLOBAL-IN? ,RAILING ,HERE>
+ <NOT <IN? ,DECK-CHAIR ,HERE>>>
+ <TELL
+"You hear " D ,ON-WATCH " yelling that it's your watch." CR>)>)
+ (<==? ,WATCH-CHANGE-CTR 5>
+ <COND (<EQUAL? <META-LOC ,PLAYER> ,MM-CREW-QTRS
+ ,NW-CREW-QTRS>
+ <RFALSE>)>
+ <SETG SEARCHER ,ON-WATCH>
+ <SETG ON-WATCH <>>
+ <MOVE ,SEARCHER <LOC ,DECK-CHAIR>>
+ <ESTABLISH-GOAL ,SEARCHER <META-LOC ,PLAYER>>
+ <RFALSE>)
+ (<G? ,WATCH-CHANGE-CTR 5>
+ <COND (<EQUAL? ,ON-WATCH ,PETE ,WEASEL>
+ <MOVE ,ON-WATCH <META-LOC ,PLAYER>>
+ <SETG QCONTEXT ,ON-WATCH>
+ <SETG QCONTEXT-ROOM <META-LOC ,PLAYER>>
+ <COND (<IN? ,PLAYER ,BUNK>
+ <TELL
+"A hand shakes you. \"Get up and get topside!\" " D ,ON-WATCH " says.
+\"You're on watch!\"" CR>)
+ (T
+ <START-SENTENCE ,ON-WATCH>
+ <TELL
+" walks in. \"Get to the foredeck!\" he says. \"It's your watch!\"" CR>)>
+ <SETG ON-WATCH <>>
+ <RTRUE>)
+ (<NOT ,SEARCHER> <RFALSE>)
+ (<NOT <EQUAL? <GET <GET ,GOAL-TABLES
+ <GETP ,SEARCHER ,P?CHARACTER>>
+ ,GOAL-F>
+ <META-LOC ,PLAYER>>>
+ <ESTABLISH-GOAL ,SEARCHER <META-LOC ,PLAYER>>
+ <RFALSE>)>)>)
+ (T
+ <SETG WATCH-CHANGE-CTR <+ ,WATCH-CHANGE-CTR 1>>
+ <COND (<==? ,WATCH-CHANGE-CTR 1>
+ <ENABLE <QUEUE I-CHANGE-WATCH -1>>
+ <COND (<AND <EQUAL? <META-LOC ,PLAYER> ,MM-CREW-QTRS
+ ,NW-CREW-QTRS>
+ <NOT <EQUAL? ,ON-WATCH ,PLAYER>>>
+ <COND (,ASLEEP?
+ <TELL "You are awakened by ">)
+ (T <TELL "You hear ">)>
+ <TELL
+D ,ON-WATCH " yelling to " D .NEXT-UP " that it's his watch." CR>
+ <SET V T>)>
+ <ESTABLISH-GOAL .NEXT-UP <LOC ,DECK-CHAIR>>
+ .V)
+ (<IN? .NEXT-UP <LOC ,DECK-CHAIR>>
+ <COND (<==? ,ON-WATCH ,PLAYER>
+ <COND (<IN? ,PLAYER ,DECK-CHAIR>
+ <SETG QCONTEXT .NEXT-UP>
+ <SETG QCONTEXT-ROOM <LOC ,DECK-CHAIR>>
+ <TELL-COMES-UP .NEXT-UP>
+ <TELL "\"Get up and I'll relieve you.\"" CR>)
+ (T
+ <SETG ON-WATCH .NEXT-UP>
+ <MOVE ,ON-WATCH ,DECK-CHAIR>
+ <COND (<L? ,HOW-TIRED 2>
+ <SETG HOW-TIRED 2>)>
+ <SET-NEXT-WATCH>
+ <COND (<IN? ,PLAYER <LOC ,DECK-CHAIR>>
+ <START-SENTENCE ,ON-WATCH>
+ <TELL " sits in the chair." CR>)>)>)
+ (T
+ <COND (<IN? ,PLAYER <LOC ,DECK-CHAIR>>
+ <START-SENTENCE .NEXT-UP>
+ <TELL
+" comes up and says to " D ,ON-WATCH ", \"I'm here to stand watch.\" ">
+ <START-SENTENCE ,ON-WATCH>
+ <TELL
+" gets up and " D .NEXT-UP " sits in the lookout's chair." CR>
+ <SET V T>)>
+ <MOVE ,ON-WATCH <LOC ,DECK-CHAIR>>
+ <MOVE .NEXT-UP ,DECK-CHAIR>
+ <COND (<==? ,SHIP-CHOSEN ,SALVAGER>
+ <ESTABLISH-GOAL ,ON-WATCH ,MM-GALLEY>)
+ (T <ESTABLISH-GOAL ,ON-WATCH ,NW-GALLEY>)>
+ <SETG ON-WATCH .NEXT-UP>
+ <SET-NEXT-WATCH>
+ .V)>)>)>>
+
+;<ROUTINE SET-NEXT-WATCH ("AUX" NEXT-TIME)
+ <SETG WATCH-CHANGE-CTR 0>
+ <COND (<GET ,WATCH-TABLE ,WT-NEXT>
+ <COND (<L? <SET NEXT-TIME <GET ,WATCH-TABLE ,WT-TIME>>
+ ,PRESENT-TIME>
+ <SET NEXT-TIME <+ .NEXT-TIME 1440>>)>
+ <ENABLE <QUEUE I-CHANGE-WATCH <- .NEXT-TIME ,PRESENT-TIME>>>
+ <SETG WATCH-TABLE <REST ,WATCH-TABLE ,WT-REST>>)
+ (T
+ <DISABLE <INT I-CHANGE-WATCH>>
+ <ENABLE <QUEUE I-DIVETIME <+ 165 <RANDOM 15>>>>)>>
+
+;<GLOBAL SEARCHER <>>
+
+;<GLOBAL WATCH-CHANGE-CTR 0>
+
+;<GLOBAL WATCH-TABLE
+ <TABLE WEASEL 1075
+ PETE 1255
+ ADVENTURER 1435
+ WEASEL 175
+ PETE 355
+ 0>>
+
+;<CONSTANT WT-PERSON 0>
+;<CONSTANT WT-TIME 1>
+;<CONSTANT WT-REST 4>
+;<CONSTANT WT-NEXT 2>
+
+<ROUTINE I-SQUID ("AUX" (L <LOC ,SQUID>))
+ <COND (<==? <META-LOC ,PLAYER> .L>
+ <JIGS-UP
+"The giant squid stirs and sees what disturbed it. When the huge eyes spot
+you, it moves toward you and hugs you with its tentacles. You squirm in an
+attempt to get away, but more arms surround you and one disconnects your
+airhose.">)
+ (T
+ <DISABLE <INT I-SQUID>>
+ <RFALSE>)>>
+
+<ROUTINE I-SHARK ()
+ <COND (<L? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <DISABLE <INT I-SHARK>>
+ <MOVE ,SHARK ,LOCAL-GLOBALS>
+ <FCLEAR ,SHARK ,ONBIT>
+ <RFALSE>)
+ (<IN? ,SHARK ,UNDERWATER>
+ <COND (<AND <IN? ,SHARK-REPELLENT ,PLAYER>
+ <FSET? ,SHARK-REPELLENT ,OPENBIT>>
+ <MOVE ,SHARK ,WINDING-ROAD-2>;"now useless location"
+ <DISABLE <INT I-SHARK>>
+ <COND (<NOT ,LIT>
+ <RFALSE>)
+ (<FSET? ,SHARK ,ONBIT>
+ <TELL "The shark continues">)
+ (T <TELL "A shark swims">)>
+ <TELL
+" toward you, then stops. It turns and swims away." CR>)
+ (T
+ <COND (<FSET? ,SHARK ,ONBIT>
+ <TELL "The shark">)
+ (,LIT <TELL "A shark">)
+ (T <TELL "Something">)>
+ <JIGS-UP " swims up to you and starts nibbling.">)>)
+ (T
+ <MOVE ,SHARK ,UNDERWATER>
+ <ENABLE <QUEUE I-SHARK -1>>
+ <COND (,LIT
+ <FSET ,SHARK ,ONBIT>
+ <TELL "A shark swims toward you!" CR>)>)>>
+
+<ROUTINE I-PLUMMET ()
+ <SETG CRIMP-CTR <+ ,CRIMP-CTR 1>>
+ <COND (<==? ,CRIMP-CTR 1>
+ <ENABLE <QUEUE I-PLUMMET -1>>
+ <COND (<GLOBAL-IN? ,FALLEN-BUNK ,HERE>
+ <SETG P-IT-OBJECT ,FALLEN-BUNK>
+ <TELL
+"The row of bunks you moved starts to fall." CR>)>)
+ (<==? ,CRIMP-CTR 2>
+ <COND (<GLOBAL-IN? ,FALLEN-BUNK ,HERE>
+ <SETG P-IT-OBJECT ,FALLEN-BUNK>
+ <TELL "The row of bunks falls toward the doorway">
+ <COND (<EQUAL? ,HERE ,WRECK-8>
+ <TELL
+ ", threatening to pinch your " D ,AIR-HOSE "!">)
+ (T <TELL ".">)>
+ <CRLF>)>)
+ (<==? ,CRIMP-CTR 3>
+ <COND (<GLOBAL-IN? ,FALLEN-BUNK ,HERE>
+ <COND (<EQUAL? ,HERE ,WRECK-8>
+ <JIGS-UP
+"The row of fallen bunks pinches your airhose. A few moments later,
+it is impossible to breathe.">)
+ (T
+ <SETG BUNKS-MOVED <>>
+ <SETG P-IT-OBJECT ,FALLEN-BUNK>
+ <TELL
+"The bunks fall back into the doorway, blocking the passage." CR>)>)
+ (<OR <EQUAL? ,HERE ,WRECK-1 ,WRECK-2 ,WRECK-3>
+ <EQUAL? ,HERE ,WRECK-4 ,WRECK-5 ,WRECK-6>
+ <EQUAL? ,HERE ,UNDERWATER>>
+ <SETG BUNKS-MOVED <>>
+ <RFALSE>)
+ (T
+ <JIGS-UP
+"You find yourself gasping for air, but there's none to breathe!">)>)>>
+
+<GLOBAL CRIMP-CTR 0>
+
+<ROUTINE I-LIVER ()
+ <COND (<G? ,BLOOD-ALCOHOL 0>
+ <SETG BLOOD-ALCOHOL <- ,BLOOD-ALCOHOL 1>>)>
+ <COND (<G? ,SLOSH-CTR 0>
+ <SETG SLOSH-CTR <- ,SLOSH-CTR 1>>)>
+ <ENABLE <QUEUE I-LIVER 10>>
+ <COND (<G? ,BLOOD-ALCOHOL 15>
+ <TELL "Your head swims for a minute." CR>
+ <RFATAL>)>
+ <RFALSE>>
+
+<ROUTINE I-PENDULUM ("AUX" (DIR <>))
+ <QUEUE I-PENDULUM -2>
+ <COND (<==? ,LINE-LOC 5>
+ <SETG LINE-LOC-INC -1>)
+ (<==? ,LINE-LOC 1>
+ <SETG LINE-LOC-INC 1>)
+ (<IN? ,SAFETY-LINE <META-LOC ,PLAYER>>
+ <COND (<EQUAL? ,LINE-LOC-INC 1>
+ <SET DIR "north">)
+ (T <SET DIR "south">)>)>
+ <SETG LINE-LOC <+ ,LINE-LOC ,LINE-LOC-INC>>
+ <COND (<==? ,LINE-LOC 2>
+ <MOVE ,SAFETY-LINE ,WEST-OF-WRECK-9>
+ <COND (<==? ,HERE ,WEST-OF-WRECK-9>
+ <TELL-LINE-SWINGS>)>)
+ (<==? ,LINE-LOC 4>
+ <MOVE ,SAFETY-LINE ,WEST-OF-WRECK-11>
+ <COND (<==? ,HERE ,WEST-OF-WRECK-11>
+ <TELL-LINE-SWINGS>)>)
+ (T
+ <MOVE ,SAFETY-LINE ,LOCAL-GLOBALS>
+ <COND (.DIR
+ <TELL "The line swings away to the " .DIR "." CR>)>)>>
+
+<ROUTINE TELL-LINE-SWINGS ()
+ <TELL "The " D ,SAFETY-LINE " from above swings in from the ">
+ <COND (<EQUAL? ,LINE-LOC-INC 1>
+ <TELL "south">)
+ (T <TELL "north">)>
+ <TELL "." CR>>
+
+<GLOBAL LINE-LOC 1>
+<GLOBAL LINE-LOC-INC 1>
+
+<ROUTINE I-CASE-LEAK ("AUX" (ALREADY <>))
+ <SETG WATER-IN-CASE <+ ,WATER-IN-CASE 1>>
+ <COND (<G? ,WATER-IN-CASE 9>
+ <COND (<FSET? ,STAMPS ,RMUNGBIT>
+ <SET ALREADY T>)>
+ <FSET ,STAMPS ,RMUNGBIT>
+ <DISABLE <INT I-CASE-LEAK>>)>
+ <COND (<IN? ,GLASS-CASE ,PLAYER>
+ <TELL "The water level in the " D ,GLASS-CASE " rises.">
+ <COND (<AND <FSET? ,STAMPS ,RMUNGBIT>
+ <NOT .ALREADY>>
+ <TELL " As it reaches the stamps, it soaks them.">)>
+ <CRLF>)>>
+
+<GLOBAL WATER-IN-CASE 0>
+
+<ROUTINE I-DRILL ()
+ <FSET ,BATTERY ,RMUNGBIT>
+ <SETG DRILL-POWERED <>>
+ <DISABLE <INT I-DRILL>>
+ <TELL "The " D ,DRILL " sputters, and the bit stops turning." CR>>
+
+<ROUTINE I-AIR-SUPPLY ()
+ <COND (<AND <==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <IN? ,AIR-TANK ,PLAYER>
+ <NOT <AIRTIGHT-ROOM?>>>
+ <SETG AIR-LEFT <- ,AIR-LEFT </ <+ ,DEPTH 33> 44>>>
+ <COND (<L? ,AIR-LEFT 1>
+ <JIGS-UP "You've used all your air.">)
+ (<L? ,AIR-LEFT 15>
+ <TELL "Your air supply is dangerously low." CR>
+ <COND (<==? ,WAITED? 1>
+ <RTRUE>)
+ (T <RFATAL>)>)>)>>
+
+<ROUTINE I-MM-COMPRESSOR ()
+ <ENABLE <QUEUE I-LAST-GASP 10>>
+ <COND (<==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <TELL
+"You have to breathe harder. Maybe you'd better surface." CR>
+ <RFATAL>)>>
+
+<ROUTINE I-LAST-GASP ()
+ <COND (<==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <JIGS-UP
+"There's not enough air to breathe!">)
+ (T
+ <DISABLE <QUEUE I-LAST-GASP 1>>)>>
+
+<ROUTINE I-PLOT-NEVER-STARTS ()
+ <DISABLE <INT I-JOHNNY>>
+ <DISABLE <INT I-PETE>>
+ <COND (<IN? ,WEASEL ,SHANTY>
+ <DISABLE <INT I-WEASEL>>)>
+ <SETG FM-CTR 5>
+ <RFALSE>>
+
+<ROUTINE I-ENDIT ()
+ <COND (<L? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <JIGS-UP
+"You suddenly find Red's hands around your throat as he makes a comment
+about hating cowards and Hevlin being wrong.">)>> \ No newline at end of file
diff --git a/globals.zap b/globals.zap
new file mode 100644
index 0000000..1fcf99c
--- /dev/null
+++ b/globals.zap
@@ -0,0 +1,1313 @@
+
+
+ .FUNCT RED-HERRING-F
+ EQUAL? PRSA,V?ASK-ABOUT /FALSE
+ CALL GLOBAL-NOT-HERE-PRINT,RED-HERRING
+ RSTACK
+
+
+ .FUNCT INTNUM-F
+ EQUAL? PRSA,V?WITHDRAW,V?GIVE \?ELS5
+ ZERO? P-DOLLAR-FLAG \?ELS5
+ PRINTI "Next time, tell me what there's "
+ PRINTN P-NUMBER
+ PRINTI " of."
+ CRLF
+ SET 'CLOCK-WAIT,TRUE-VALUE
+ RETURN 2
+?ELS5: ZERO? P-DOLLAR-FLAG /FALSE
+ EQUAL? PRSA,V?ASK-FOR,V?TAKE,V?WITHDRAW /FALSE
+ EQUAL? WINNER,PLAYER \FALSE
+ GRTR? P-AMOUNT,POCKET-CHANGE \FALSE
+ CALL TELL-DONT-HAVE,STR?2
+ RSTACK
+
+
+ .FUNCT AIR-F
+ EQUAL? PRSA,V?TASTE,V?SMELL \?ELS5
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK /?ELS10
+ FSET? MASK,WORNBIT /?ELS10
+ PRINTR "The air is musty but breathable."
+?ELS10: EQUAL? HERE,MM-ENGINE-ROOM,NW-ENGINE-ROOM \?ELS16
+ PRINTR "The air is heavy with diesel fumes."
+?ELS16: GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS20
+ PRINTR "It feels a whole lot better than the water you could be breathing."
+?ELS20: PRINTR "You find nothing special about the air."
+?ELS5: EQUAL? PRSA,V?CLOSE,V?OPEN \?ELS28
+ PRINTR "I think you're an air head."
+?ELS28: EQUAL? PRSA,V?LOOK-INSIDE \?ELS32
+ CALL PERFORM,V?LOOK
+ RTRUE
+?ELS32: EQUAL? PRSI,AIR \FALSE
+ EQUAL? PRSA,V?DROP,V?THROW \FALSE
+ CALL PERFORM,PRSA,PRSO,GROUND
+ RTRUE
+
+
+ .FUNCT FLOOR-F
+ EQUAL? PRSA,V?PUT,V?PUT-ON \FALSE
+ EQUAL? PRSI,GROUND \FALSE
+ CALL PERFORM,V?DROP,PRSO
+ RTRUE
+
+
+ .FUNCT DECK-F
+ EQUAL? PRSA,V?WALK-TO \?ELS5
+ CALL TELL-SHD-DIR
+ RSTACK
+?ELS5: EQUAL? PRSA,V?PUT,V?PUT-ON \FALSE
+ EQUAL? PRSI,DECK \FALSE
+ CALL PERFORM,V?DROP,PRSO
+ RTRUE
+
+
+ .FUNCT FLOOR-HOLE-F
+ EQUAL? PRSA,V?THROUGH \?ELS5
+ CALL DO-WALK,P?DOWN
+ RTRUE
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE \?ELS7
+ CALL TELL-YOU-CANT,STR?6
+ RSTACK
+?ELS7: EQUAL? PRSA,V?EXAMINE \FALSE
+ EQUAL? HERE,WRECK-5 \?ELS14
+ ZERO? WRECK-5-FLOODED \?ELS14
+ PRINTR "There's water on the other side."
+?ELS14: CALL TELL-LOOKS-HOLE
+ RSTACK
+
+
+ .FUNCT TELL-LOOKS-HOLE
+ PRINTR "It looks a lot like a hole."
+
+
+ .FUNCT CEILING-HOLE-F
+ EQUAL? PRSA,V?THROUGH \?ELS5
+ CALL DO-WALK,P?UP
+ RTRUE
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE \?ELS7
+ CALL TELL-YOU-CANT,STR?6
+ RSTACK
+?ELS7: EQUAL? PRSA,V?EXAMINE \FALSE
+ CALL TELL-LOOKS-HOLE
+ RSTACK
+
+
+ .FUNCT HOLE-F
+ EQUAL? PRSA,V?DRILL /FALSE
+ CALL GLOBAL-NOT-HERE-PRINT,HOLE
+ RSTACK
+
+
+ .FUNCT MAST-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTI "There are several rotting masts here."
+ EQUAL? HERE,WRECK-1 \?CND8
+ PRINTI " The top of one has fallen into a hole at your feet."
+?CND8: CRLF
+ RTRUE
+?ELS5: EQUAL? PRSA,V?CLIMB-FOO \FALSE
+ PRINTR "None of the masts looks sturdy enough."
+
+
+ .FUNCT LIGHTHOUSE-F
+ EQUAL? HERE,WINDING-ROAD-1 \?ELS5
+ EQUAL? PRSA,V?OPEN,V?THROUGH \?ELS10
+ PRINTR "The door is locked."
+?ELS10: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTI "You can see the base of a "
+ CALL DPRINT,LIGHTHOUSE
+ PRINTI ". "
+ CALL TELL-CLOSED,STR?7
+ RTRUE
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS23
+ PRINTI "The "
+ CALL DPRINT,LIGHTHOUSE
+ PRINTI " towers over Hardscrabble Island from the island's northwest corner."
+ GRTR? PRESENT-TIME,1200 /?THN29
+ LESS? PRESENT-TIME,480 \?CND26
+?THN29: PRINTI " Its light provides a beacon for ships."
+?CND26: CRLF
+ RTRUE
+?ELS23: EQUAL? PRSA,V?WALK-TO \?ELS34
+ CALL TELL-SHD-DIR
+ RSTACK
+?ELS34: EQUAL? PRSA,V?FIND /FALSE
+ EQUAL? PRSA,V?ASK-ABOUT \?ELS38
+ FSET? PRSO,VICBIT \FALSE
+ PRINTR """It's been there forever."""
+?ELS38: PRINTR "That would be difficult from this distance."
+
+
+ .FUNCT GLOBAL-TREASURE-F
+ EQUAL? PRSA,V?TELL,V?ASK-CONTEXT-ABOUT,V?ASK-ABOUT /FALSE
+ EQUAL? PRSA,V?FIND \?ELS7
+ EQUAL? WINNER,PLAYER \?ELS12
+ CALL TELL-NOT-EASY
+ RSTACK
+?ELS12: PRINTR """I'd like to know where some is."""
+?ELS7: CALL GLOBAL-NOT-HERE-PRINT,GLOBAL-TREASURE
+ RSTACK
+
+
+ .FUNCT TRAWLER-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ GETP HERE,P?LINE
+ EQUAL? STACK,TRAWLER-LINE-C \?ELS10
+ PRINTI "The "
+ CALL DPRINT,TRAWLER
+ PRINTR " is in decent shape."
+?ELS10: EQUAL? HERE,MM-WHEELHOUSE \?ELS14
+ ZERO? AT-SEA /?ELS14
+ CALL GLOBAL-NOT-HERE-PRINT,TRAWLER
+ RSTACK
+?ELS14: PRINTI "The "
+ CALL DPRINT,TRAWLER
+ CALL TELL-BOAT-DESC
+ RSTACK
+?ELS5: EQUAL? PRSA,V?THROUGH,V?BOARD \?ELS22
+ EQUAL? HERE,WHARF \?ELS25
+ CALL DO-WALK,P?WEST
+ RTRUE
+?ELS25: EQUAL? HERE,UNDERWATER \?ELS27
+ EQUAL? DEPTH,50 \?ELS27
+ CALL DO-WALK,P?UP
+ RTRUE
+?ELS27: CALL TELL-YOU-CANT,STR?8
+ RTRUE
+?ELS22: EQUAL? PRSA,V?DISEMBARK \?ELS33
+ ZERO? AT-SEA /?ELS38
+ CALL GLOBAL-IN?,RAILING,HERE
+ ZERO? STACK /?ELS44
+ CALL PERFORM,V?DIVE
+ RTRUE
+?ELS44: CALL TELL-NO-EXIT
+ RSTACK
+?ELS38: EQUAL? HERE,NW-STARBOARD-DECK \?ELS48
+ CALL DO-WALK,P?EAST
+ RSTACK
+?ELS48: CALL TELL-NO-EXIT
+ RSTACK
+?ELS33: EQUAL? PRSA,V?LISTEN \?ELS52
+ ZERO? AT-SEA /?ELS52
+ CALL TELL-THRUM
+ RSTACK
+?ELS52: EQUAL? PRSA,V?LAUNCH \FALSE
+ CALL TELL-YOU-CANT,STR?9
+ RSTACK
+
+
+ .FUNCT TELL-NO-EXIT
+ CALL TELL-HOW-THAT,STR?10,STR?11
+ RSTACK
+
+
+ .FUNCT TELL-HOW-THAT,STR,LAST=0
+ PRINTI "How can you "
+ PRINT STR
+ PRINTI " that"
+ ZERO? LAST /?CND3
+ PRINTI " "
+ PRINT LAST
+?CND3: PRINTR "?"
+
+
+ .FUNCT TELL-BOAT-DESC
+ PRINTR " looks weathered but not aged."
+
+
+ .FUNCT TELL-THRUM
+ PRINTR "You hear the powerful thrum of diesel engines."
+
+
+ .FUNCT SALVAGER-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ GETP HERE,P?LINE
+ EQUAL? STACK,SALVAGER-LINE-C \?ELS10
+ PRINTI "The "
+ CALL DPRINT,SALVAGER
+ PRINTR " is shipshape."
+?ELS10: EQUAL? HERE,NW-WHEELHOUSE \?ELS14
+ ZERO? AT-SEA /?ELS14
+ CALL GLOBAL-NOT-HERE-PRINT,SALVAGER
+ RSTACK
+?ELS14: PRINTI "The "
+ CALL DPRINT,SALVAGER
+ PRINTI " is a medium-size boat that"
+ CALL TELL-BOAT-DESC
+ RSTACK
+?ELS5: EQUAL? PRSA,V?THROUGH,V?BOARD \?ELS22
+ EQUAL? HERE,WHARF \?ELS25
+ CALL DO-WALK,P?EAST
+ RTRUE
+?ELS25: EQUAL? HERE,UNDERWATER \?ELS27
+ EQUAL? DEPTH,50 \?ELS27
+ CALL DO-WALK,P?UP
+ RTRUE
+?ELS27: CALL TELL-YOU-CANT,STR?8
+ RTRUE
+?ELS22: EQUAL? PRSA,V?DISEMBARK \?ELS33
+ ZERO? AT-SEA /?ELS38
+ CALL GLOBAL-IN?,RAILING,HERE
+ ZERO? STACK /?ELS44
+ CALL PERFORM,V?DIVE
+ RTRUE
+?ELS44: CALL TELL-NO-EXIT
+ RSTACK
+?ELS38: EQUAL? HERE,MM-PORT-DECK \?ELS48
+ CALL DO-WALK,P?WEST
+ RSTACK
+?ELS48: CALL TELL-NO-EXIT
+ RSTACK
+?ELS33: EQUAL? PRSA,V?LISTEN \?ELS52
+ ZERO? AT-SEA /?ELS52
+ CALL TELL-THRUM
+ RSTACK
+?ELS52: EQUAL? PRSA,V?LAUNCH \FALSE
+ CALL TELL-YOU-CANT,STR?9
+ RSTACK
+
+
+ .FUNCT SHIPWRECK-F
+ EQUAL? PRSA,V?DISEMBARK \?ELS5
+ CALL TELL-NOT-EASY
+ RSTACK
+?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTI "It is what's left of a "
+ EQUAL? WRECK-CHOSEN,1,3 \?ELS12
+ PRINTI "wooden"
+ JUMP ?CND10
+?ELS12: PRINTI "steel"
+?CND10: PRINTR " ship."
+
+
+ .FUNCT GLOBAL-SLEEP-F
+ EQUAL? PRSA,V?WALK-TO \?ELS5
+ CALL PERFORM,V?SLEEP
+ RTRUE
+?ELS5: PRINTR "Huh? Wake up!"
+
+
+ .FUNCT FIELD-F
+ EQUAL? PRSA,V?THROUGH,V?BOARD \?ELS5
+ CALL TELL-YOU-CANT,STR?12
+ RSTACK
+?ELS5: EQUAL? PRSA,V?LOOK-BEHIND \?ELS7
+ CALL PICK-ONE,YUKS
+ PRINT STACK
+ CRLF
+ RTRUE
+?ELS7: EQUAL? PRSA,V?CUT \?ELS11
+ CALL TELL-DONT-HAVE,STR?13
+ RSTACK
+?ELS11: EQUAL? PRSA,V?PLAY \?ELS13
+ PRINTR "Sounds exciting."
+?ELS13: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "This field was once productive farmland but hasn't been tended for many years."
+
+
+ .FUNCT ROCKS-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTR "The rocks here are large, pointy, and impossible to get through."
+?ELS5: EQUAL? PRSA,V?THROUGH,V?BOARD \FALSE
+ CALL TELL-YOU-CANT,STR?14
+ RSTACK
+
+
+ .FUNCT POCKET-F
+ FSET? WET-SUIT,WORNBIT /?THN6
+ FSET? DEEP-SUIT,WORNBIT \?ELS5
+?THN6: PRINTR "Your diving gear is over the pocket."
+?ELS5: EQUAL? PRSA,V?TAKE \?ELS11
+ EQUAL? PRSO,RIDICULOUS-MONEY-KLUDGE,GLOBAL-MONEY \?ELS11
+ CALL TELL-FLASHING-CASH
+ RSTACK
+?ELS11: EQUAL? PRSA,V?LOOK-INSIDE \?ELS15
+ PRINTI "There is $"
+ PRINTN POCKET-CHANGE
+ PRINTR " in it."
+?ELS15: EQUAL? PRSA,V?EMPTY \?ELS19
+ PRINTR "You think better of the idea."
+?ELS19: EQUAL? PRSA,V?OPEN \?ELS23
+ PRINTR "It's open enough."
+?ELS23: EQUAL? PRSA,V?PUT \FALSE
+ EQUAL? PRSI,POCKET \FALSE
+ ZERO? P-DOLLAR-FLAG /?ELS34
+ EQUAL? PRSO,INTNUM \?ELS34
+ GRTR? P-AMOUNT,POCKET-CHANGE \?ELS34
+ CALL TELL-DONT-HAVE,STR?2
+ RSTACK
+?ELS34: EQUAL? PRSO,RIDICULOUS-MONEY-KLUDGE,GLOBAL-MONEY /?THN39
+ EQUAL? PRSO,INTNUM \?ELS38
+ ZERO? P-DOLLAR-FLAG /?ELS38
+?THN39: CALL TELL-ALREADY,STR?16
+ RSTACK
+?ELS38: CALL TELL-NO-FIT
+ RSTACK
+
+
+ .FUNCT TELL-NO-FIT,STR=0
+ PRINTI "It won't fit"
+ ZERO? STR /?CND3
+ PRINTI " "
+ PRINT STR
+?CND3: PRINTR "."
+
+
+ .FUNCT PEOPLE-F
+ EQUAL? HERE,SHANTY,FERRY-LANDING \?ELS5
+ PRINTR "Leave them alone. They're not bothering you."
+?ELS5: IN? HERE,WEASEL /?THN10
+ IN? HERE,JOHNNY /?THN10
+ IN? HERE,PETE /?THN10
+ IN? HERE,SPEAR-CARRIER /?THN10
+ IN? HERE,DELIVERY-BOY \?ELS9
+?THN10: CALL TELL-REFER-INDIVIDUAL,STR?17
+ RSTACK
+?ELS9: CALL GLOBAL-NOT-HERE-PRINT,PEOPLE
+ RSTACK
+
+
+ .FUNCT TELL-REFER-INDIVIDUAL,STR
+ PRINTI "Refer to individual"
+ PRINT STR
+ PRINTR "."
+
+
+ .FUNCT GLOBAL-SURFACE-F
+ EQUAL? PRSA,V?OPEN \FALSE
+ CALL PICK-ONE,YUKS
+ PRINT STACK
+ CRLF
+ RTRUE
+
+
+ .FUNCT MOVE-SHARED-OBJECTS,PLACE,CTR=0,SURFACE?=1,?TMP1
+ EQUAL? PLACE,LAST-S-O-T-PLACE /FALSE
+ EQUAL? LAST-S-O-T-PLACE,MM-CREW-QTRS,NW-CREW-QTRS \?ELS5
+ SET 'SURFACE?,FALSE-VALUE
+ CALL UNLOAD,UNDER-BUNK
+ CALL UNLOAD,BUNK
+ JUMP ?CND1
+?ELS5: EQUAL? LAST-S-O-T-PLACE,MM-GALLEY,NW-GALLEY \?ELS7
+ CALL UNLOAD,STOVE
+ JUMP ?CND1
+?ELS7: EQUAL? LAST-S-O-T-PLACE,MM-LOUNGE,NW-LOUNGE \?CND1
+ CALL UNLOAD,LOUNGE-CHAIR
+?CND1: ZERO? SURFACE? /?CND10
+ CALL UNLOAD,GLOBAL-SURFACE
+?CND10: EQUAL? PLACE,MM-CREW-QTRS,NW-CREW-QTRS /?CND14
+ MOVE GLOBAL-SURFACE,PLACE
+?CND14: SET 'LAST-S-O-T-PLACE,PLACE
+?PRG17: GRTR? CTR,44 /TRUE
+ ADD CTR,1
+ GET SHARED-OBJECT-TABLE,STACK
+ EQUAL? STACK,PLACE \?CND19
+ GET SHARED-OBJECT-TABLE,CTR >?TMP1
+ ADD CTR,2
+ GET SHARED-OBJECT-TABLE,STACK
+ MOVE ?TMP1,STACK
+ PUT SHARED-OBJECT-TABLE,CTR,0
+ ADD CTR,1
+ PUT SHARED-OBJECT-TABLE,STACK,0
+ ADD CTR,2
+ PUT SHARED-OBJECT-TABLE,STACK,0
+?CND19: ADD CTR,3 >CTR
+ JUMP ?PRG17
+
+
+ .FUNCT UNLOAD,OBJ,F,N
+ FIRST? OBJ >F \FALSE
+ NEXT? F >N /?KLU11
+?KLU11: CALL PUT-IN-TABLE,F,LAST-S-O-T-PLACE,OBJ
+?PRG6: ZERO? N /TRUE
+ SET 'F,N
+ NEXT? F >N /?KLU12
+?KLU12: CALL PUT-IN-TABLE,F,LAST-S-O-T-PLACE,OBJ
+ JUMP ?PRG6
+
+
+ .FUNCT PUT-IN-TABLE,OBJ,RM,SURF,CTR=0
+ EQUAL? OBJ,PLAYER /FALSE
+?PRG4: GRTR? CTR,44 \?ELS8
+ JUMP ?REP5
+?ELS8: GET SHARED-OBJECT-TABLE,CTR
+ ZERO? STACK \?ELS10
+ PUT SHARED-OBJECT-TABLE,CTR,OBJ
+ ADD CTR,1
+ PUT SHARED-OBJECT-TABLE,STACK,RM
+ ADD CTR,2
+ PUT SHARED-OBJECT-TABLE,STACK,SURF
+ MOVE OBJ,LOCAL-GLOBALS
+ RFALSE
+?ELS10: ADD CTR,3 >CTR
+ JUMP ?PRG4
+?REP5: PRINTR "[BUG: Too much on surfaces.]"
+
+
+ .FUNCT GLOBAL-BANK-F
+ EQUAL? HERE,BANK \?ELS5
+ EQUAL? PRSA,V?EXAMINE \?ELS10
+ CALL PERFORM,V?LOOK
+ SET 'P-IT-OBJECT,GLOBAL-BANK
+ RTRUE
+?ELS10: EQUAL? PRSA,V?ROB \?ELS12
+ CALL ROBBERY-ENDING
+ RSTACK
+?ELS12: EQUAL? PRSA,V?EXIT,V?DROP \?ELS14
+ CALL DO-WALK,P?OUT
+ RTRUE
+?ELS14: EQUAL? PRSA,V?MUNG \FALSE
+ PRINTR "This isn't Monte Carlo."
+?ELS5: EQUAL? HERE,SHORE-ROAD-2 \?ELS20
+ EQUAL? PRSA,V?THROUGH \?ELS25
+ CALL DO-WALK,P?IN
+ RTRUE
+?ELS25: EQUAL? PRSA,V?EXAMINE \?ELS27
+ PRINTI "The "
+ CALL DPRINT,BANK
+ PRINTR " is an imposing granite building."
+?ELS27: EQUAL? PRSA,V?ROB \FALSE
+ ZERO? BUSINESS-HOURS? /?ELS36
+ CALL ROBBERY-ENDING
+ RSTACK
+?ELS36: CALL ROBBERY-ENDING,FALSE-VALUE
+ RSTACK
+?ELS20: EQUAL? PRSA,V?ASK-ABOUT \?ELS45
+ EQUAL? PRSI,GLOBAL-BANK /FALSE
+?ELS45: EQUAL? PRSA,V?WALK-TO,V?FIND \?ELS41
+ EQUAL? PRSO,GLOBAL-BANK /FALSE
+?ELS41: CALL GLOBAL-NOT-HERE-PRINT,GLOBAL-BANK
+ RSTACK
+
+
+ .FUNCT ROBBERY-ENDING,INSIDE?=1
+ ZERO? INSIDE? /?ELS3
+ PRINTI "The teller trips the alarm, and policemen come and drag you away. As you contemplate a stretch in prison, you consider that crime might not pay."
+ CRLF
+ JUMP ?CND1
+?ELS3: PRINTI "You don't realize your attempts have set off a silent alarm until the police arrive. At that point, you can only wonder if attempted robbery wasn't such a bright idea."
+ CRLF
+?CND1: CRLF
+ CALL FINISH
+ RSTACK
+
+
+ .FUNCT GLOBAL-MONEY-F
+ EQUAL? PRSA,V?STEP,V?ASK-ABOUT,V?ASK-FOR /FALSE
+ EQUAL? PRSA,V?FOLLOW,V?WHAT /FALSE
+ EQUAL? PRSA,V?FIND \?ELS9
+ CALL TELL-NOT-EASY
+ RTRUE
+?ELS9: GRTR? POCKET-CHANGE,0 \?ELS11
+ FSET? WET-SUIT,WORNBIT /?THN17
+ FSET? DEEP-SUIT,WORNBIT \?ELS16
+?THN17: CALL TELL-CANT-REACH,STR?21
+ RSTACK
+?ELS16: EQUAL? PRSA,V?COUNT \?ELS20
+ PRINTI "You are carrying $"
+ PRINTN POCKET-CHANGE
+ PRINTR "."
+?ELS20: EQUAL? PRSA,V?EXAMINE \?ELS24
+ PRINTI "It looks a lot like $"
+ PRINTN POCKET-CHANGE
+ PRINTR "."
+?ELS24: EQUAL? PRSA,V?TAKE /FALSE
+ CALL TELL-FLASHING-CASH
+ RSTACK
+?ELS11: EQUAL? HERE,BANK \?ELS30
+ PRINTR "Not surprisingly, the money here is not easily accessible."
+?ELS30: CALL GLOBAL-NOT-HERE-PRINT,GLOBAL-MONEY
+ RSTACK
+
+
+ .FUNCT TELL-FLASHING-CASH
+ PRINTR "Flashing your bankroll is not a good idea."
+
+
+ .FUNCT FERRY-TOKEN-F
+ IN? SPEAR-CARRIER,HERE \?ELS5
+ EQUAL? PRSA,V?ASK-FOR,V?ASK-ABOUT \?ELS11
+ EQUAL? PRSO,SPEAR-CARRIER /?THN8
+?ELS11: EQUAL? PRSA,V?BUY \?ELS5
+?THN8: CALL NO-TOKENS,HERE
+ RSTACK
+?ELS5: EQUAL? PRSA,V?ASK-ABOUT \?ELS13
+ FSET? PRSO,PERSON \?ELS13
+ PRINTR """You need them for the ferry."""
+?ELS13: EQUAL? PRSA,V?ASK-FOR,V?FIND /FALSE
+ CALL GLOBAL-NOT-HERE-PRINT,FERRY-TOKEN
+ RSTACK
+
+
+ .FUNCT NO-TOKENS,PLACE
+ EQUAL? PLACE,BANK \?ELS3
+ PRINTI "The teller says, ""We're out. Try Outfitters."""
+ JUMP ?CND1
+?ELS3: PRINTI "The "
+ CALL DPRINT,SPEAR-CARRIER
+ PRINTI " checks and then says, ""I'm afraid we're out of tokens. Try "
+ CALL DPRINT,BANK
+ PRINTI "."""
+?CND1: CRLF
+ RTRUE
+
+
+ .FUNCT GLOBAL-TIME-F
+ EQUAL? PRSA,V?ASK-ABOUT,V?ASK-FOR \?ELS5
+ EQUAL? PRSO,SPEAR-CARRIER \?ELS10
+ PRINTI "The "
+ CALL DPRINT,PRSO
+ PRINTI " checks and tells you it's "
+ CALL TIME-PRINT,PRESENT-TIME
+ CRLF
+ RTRUE
+?ELS10: FSET? PRSO,PERSON \FALSE
+ PRINTR """I'm not sure."""
+?ELS5: EQUAL? PRSA,V?TELL \?ELS18
+ EQUAL? PRSO,GLOBAL-TIME \?ELS18
+ ZERO? PRSI \?ELS18
+ PRINTR "Didn't you learn that the little hand points to the hour and the big hand points to the minute?"
+?ELS18: EQUAL? PRSA,V?EXAMINE \?ELS24
+ CALL PERFORM,V?TIME
+ SET 'P-IT-OBJECT,GLOBAL-TIME
+ RTRUE
+?ELS24: EQUAL? PRSA,V?TELL \?ELS26
+ FSET? PRSO,VICBIT \?ELS26
+ EQUAL? PRSO,ME \FALSE
+?ELS26: PRINTR "If you want to know the time, check your watch."
+
+
+ .FUNCT GLOBAL-DAY-F
+ EQUAL? PRSA,V?ASK-ABOUT,V?ASK-FOR \?ELS9
+ FSET? PRSO,VICBIT /?THN6
+?ELS9: EQUAL? PRSA,V?WHAT \?ELS5
+ EQUAL? WINNER,PLAYER /?ELS5
+?THN6: PRINTR """Wednesday."""
+?ELS5: EQUAL? PRSA,V?WHAT \?ELS15
+ PRINTR "Ask somebody."
+?ELS15: CALL TELL-SERIOUS
+ RSTACK
+
+
+ .FUNCT TELL-SERIOUS
+ PRINTR "Be serious."
+
+
+ .FUNCT ADVENTURER-F
+ GRTR? BLOOD-ALCOHOL,25 \?ELS5
+ CALL JIGS-UP,STR?22
+ RSTACK
+?ELS5: GRTR? HOW-THIRSTY,3 /?THN8
+ GRTR? BLOOD-ALCOHOL,15 /?THN8
+ GRTR? HOW-HUNGRY,3 /?THN8
+ EQUAL? HOW-TIRED,6 /?THN8
+ EQUAL? P-ADVERB,W?SLOWLY \?ELS7
+?THN8: EQUAL? PRSA,V?WAIT,V?SLEEP /?THN15
+ EQUAL? PRSA,V?TELL \?ELS18
+ ZERO? PRSI /?THN15
+?ELS18: CALL GAME-COMMAND?
+ ZERO? STACK \?THN15
+ ZERO? WAITED? /?ELS14
+?THN15: SET 'WAITED?,2
+ EQUAL? PRSA,V?WALK \?ELS21
+ JUMP ?CND19
+?ELS21: ZERO? PRSO /?ELS23
+ CALL META-LOC,PRSO
+ EQUAL? STACK,HERE /?ELS23
+ IN? PRSO,GLOBAL-OBJECTS /?ELS23
+ SET 'PRSO,NOT-HERE-OBJECT
+ JUMP ?CND19
+?ELS23: ZERO? PRSI /?CND19
+ CALL META-LOC,PRSI
+ EQUAL? STACK,HERE /?CND19
+ IN? PRSI,GLOBAL-OBJECTS /?CND19
+ SET 'PRSI,NOT-HERE-OBJECT
+?CND19: EQUAL? NOT-HERE-OBJECT,PRSO,PRSI \FALSE
+ CALL NOT-HERE-OBJECT-F
+ RSTACK
+?ELS14: SET 'WAITED?,1
+ CALL CLOCKER
+ EQUAL? STACK,M-FATAL \?ELS43
+ SET 'CLOCK-WAIT,TRUE-VALUE
+ PRINTI "This interrupts what you're trying to do."
+ CRLF
+ RETURN 2
+?ELS43: EQUAL? PRSA,V?WALK \FALSE
+ IN? PLAYER,UNDERWATER /FALSE
+ IN? PLAYER,HERE \FALSE
+ GRTR? BLOOD-ALCOHOL,15 \?ELS61
+ CALL TELL-YOURE-NOT,STR?23
+ CRLF
+ CALL RANDOM-WALK
+ RSTACK
+?ELS61: RANDOM 100
+ GRTR? 40,STACK \FALSE
+ PRINTI "You stop to sit down for a bit and then struggle back to your feet."
+ CRLF
+ RETURN 2
+?ELS7: FSET? FLIPPERS,WORNBIT \FALSE
+ EQUAL? PRSA,V?WALK \FALSE
+ ZERO? AT-SEA \FALSE
+ GETP HERE,P?LINE
+ LESS? STACK,TRAWLER-LINE-C /?THN72
+ EQUAL? HERE,MM-PORT-DECK \?ELS75
+ EQUAL? P-WALK-DIR,P?WEST /?THN72
+?ELS75: EQUAL? HERE,NW-STARBOARD-DECK \FALSE
+ EQUAL? P-WALK-DIR,P?EAST \FALSE
+?THN72: PRINTR "You'd look silly walking around in flippers."
+
+
+ .FUNCT RANDOM-WALK,P,Z,L,S,D=0
+ SET 'P,0
+?PRG1: NEXTP HERE,P >P
+ LESS? P,LOW-DIRECTION \?ELS5
+ ZERO? D /TRUE
+ CALL DO-WALK,D
+ RTRUE
+?ELS5: GETPT HERE,P >Z
+ PTSIZE Z >L
+ EQUAL? L,UEXIT /?THN15
+ EQUAL? L,CEXIT \?ELS18
+ GETB Z,CEXITFLAG
+ VALUE STACK
+ ZERO? STACK \?THN15
+?ELS18: EQUAL? L,DEXIT \?PRG1
+ GETB Z,DEXITOBJ
+ FSET? STACK,OPENBIT \?PRG1
+?THN15: ZERO? D \?ELS23
+ SET 'D,P
+ JUMP ?PRG1
+?ELS23: RANDOM 100
+ GRTR? 50,STACK \?PRG1
+ SET 'D,P
+ JUMP ?PRG1
+
+
+ .FUNCT DETECTOR-NOISE,LISTENING?=0,C,H,P,Z,L,R,LAST-R=0,?TMP1
+ CALL META-LOC,PLAYER >H
+ ZERO? LISTENING? \?ELS5
+ EQUAL? PRSA,V?LISTEN \?ELS5
+ EQUAL? PRSO,METAL-DETECTOR /FALSE
+?ELS5: CALL META-LOC,METAL-DETECTOR
+ EQUAL? STACK,H \?ELS9
+ ZERO? DETECTOR-ON /?ELS9
+ ZERO? DETECTOR-POWERED /?ELS9
+ CALL COUNT-METAL,H >?TMP1
+ GETP H,P?DESCFCN
+ ADD ?TMP1,STACK >C
+ SET 'P,0
+?PRG12: NEXTP H,P >P
+ ZERO? P \?ELS16
+ JUMP ?REP13
+?ELS16: LESS? P,LOW-DIRECTION /?PRG12
+ GETPT H,P >Z
+ PTSIZE Z >L
+ EQUAL? L,UEXIT,CEXIT,DEXIT \?ELS21
+ GETB Z,0 >R
+ EQUAL? R,LAST-R /?PRG12
+ CALL COUNT-METAL,R
+ DIV STACK,2
+ ADD C,STACK
+ GETP R,P?DESCFCN
+ DIV STACK,2
+ ADD STACK,STACK >C >C
+ SET 'LAST-R,R
+ JUMP ?PRG12
+?ELS21: EQUAL? L,FEXIT \?PRG12
+ GET Z,0
+ CALL STACK,FALSE-VALUE >R
+ ZERO? R /?PRG12
+ EQUAL? R,LAST-R /?PRG12
+ CALL COUNT-METAL,R
+ DIV STACK,2
+ ADD C,STACK
+ GETP R,P?DESCFCN
+ DIV STACK,2
+ ADD STACK,STACK >C >C
+ SET 'LAST-R,R
+ JUMP ?PRG12
+?REP13: ZERO? C \?CND36
+ ZERO? LISTENING? /FALSE
+ PRINTI "The "
+ CALL DPRINT,METAL-DETECTOR
+ PRINTR " makes no noise."
+?CND36: PRINTI "The "
+ CALL DPRINT,METAL-DETECTOR
+ PRINTI " is clicking "
+ GRTR? C,100 \?ELS51
+ PRINTI "extremely fast"
+ JUMP ?CND49
+?ELS51: GRTR? C,75 \?ELS55
+ PRINTI "quickly"
+ JUMP ?CND49
+?ELS55: GRTR? C,50 \?ELS59
+ PRINTI "moderately"
+ JUMP ?CND49
+?ELS59: GRTR? C,25 \?ELS63
+ PRINTI "slowly"
+ JUMP ?CND49
+?ELS63: PRINTI "occasionally"
+?CND49: PRINTR "."
+?ELS9: ZERO? LISTENING? /FALSE
+ PRINTI "The "
+ CALL DPRINT,METAL-DETECTOR
+ PRINTR " makes no noise."
+
+
+ .FUNCT COUNT-METAL,R,F,V=0
+ FIRST? R >F /?KLU13
+?KLU13:
+?PRG1: ZERO? F \?ELS5
+ RETURN V
+?ELS5: FSET? F,INVISIBLE \?THN8
+ EQUAL? F,PLAYER \?CND3
+?THN8: GETP F,P?STATION
+ ADD V,STACK >V
+ FIRST? F \?CND3
+ CALL COUNT-METAL,F
+ ADD V,STACK >V
+?CND3: NEXT? F >F /?KLU14
+?KLU14: JUMP ?PRG1
+
+
+ .FUNCT CRETIN-F
+ EQUAL? PRSO,WINNER,ME \FALSE
+ EQUAL? PRSA,V?EAT \?ELS6
+ PRINTR "Stick to stew."
+?ELS6: EQUAL? PRSA,V?DRINK \?ELS10
+ PRINTR "Stick to grog."
+?ELS10: EQUAL? PRSA,V?ALARM \?ELS14
+ PRINTR "Good morning!"
+?ELS14: EQUAL? PRSA,V?KILL,V?ATTACK,V?MUNG \?ELS18
+ PRINTR "Although it's not hard, I can't make it that simple."
+?ELS18: EQUAL? PRSA,V?FIND \?ELS22
+ PRINTR "Have you tried asking the parrot?"
+?ELS22: EQUAL? PRSA,V?LAMP-ON,V?TAKE /?THN27
+ EQUAL? PRSA,V?GIVE \?ELS26
+ EQUAL? PRSO,ME \?ELS26
+?THN27: PRINTR "You romantic fool!"
+?ELS26: EQUAL? PRSA,V?EXAMINE \?ELS34
+ PRINTR "You look like a diver."
+?ELS34: EQUAL? PRSA,V?LOOK-UNDER \?ELS38
+ PRINTR "I think the center of the earth is down there somewhere."
+?ELS38: EQUAL? PRSA,V?RUB \?ELS42
+ PRINTR "You're starting to rub me the wrong way."
+?ELS42: EQUAL? PRSA,V?PLAY \?ELS46
+ PRINTR "Don't expect an Oscar."
+?ELS46: EQUAL? PRSA,V?THROUGH,V?BOARD,V?CLIMB-ON \?ELS50
+ PRINTR "I'm not impressed."
+?ELS50: EQUAL? PRSA,V?SHAKE,V?CROSS \?ELS54
+ PRINTR "I'm much too kind."
+?ELS54: EQUAL? PRSA,V?DROP \?ELS58
+ PRINTR "Like a hot potato."
+?ELS58: EQUAL? PRSA,V?FOLLOW \?ELS62
+ PRINTR "What makes you think you know where you're going?"
+?ELS62: EQUAL? PRSA,V?SEARCH \?ELS66
+ PRINTR "Okay. I found one empty head but a strong heart."
+?ELS66: EQUAL? PRSA,V?PUSH,V?SMELL \?ELS70
+ PRINTR "I'd rather not."
+?ELS70: EQUAL? PRSA,V?THROW \?ELS74
+ PRINTR "For a loop?"
+?ELS74: EQUAL? PRSA,V?ROB \FALSE
+ PRINTR "You wouldn't get much from anyone that stupid."
+
+
+ .FUNCT GLOBAL-SELF-F
+ EQUAL? WINNER,PLAYER \?CND1
+ EQUAL? PRSI,GLOBAL-SELF \?CND4
+ SET 'PRSI,ME
+?CND4: EQUAL? PRSO,GLOBAL-SELF \?CND1
+ SET 'PRSO,ME
+?CND1: CALL PERFORM,PRSA,PRSO,PRSI
+ RTRUE
+
+
+ .FUNCT GLOBAL-ROOM-F,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?24
+ RTRUE
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS7
+ CALL PERFORM,V?LOOK
+ SET 'P-IT-OBJECT,GLOBAL-ROOM
+ RTRUE
+?ELS7: EQUAL? PRSA,V?DISEMBARK,V?EXIT,V?DROP \?ELS9
+ CALL DO-WALK,P?OUT
+ RTRUE
+?ELS9: EQUAL? PRSA,V?THROUGH,V?ENTER \?ELS11
+ CALL DO-WALK,P?IN
+ RTRUE
+?ELS11: EQUAL? PRSA,V?ATTACK,V?MUNG \?ELS13
+ PRINTR "It's sturdier than you give it credit for."
+?ELS13: EQUAL? PRSA,V?UNLOCK \?ELS17
+ PRINTR "Please be more specific about what you want to unlock."
+?ELS17: EQUAL? PRSA,V?PUT \FALSE
+ CALL PERFORM,V?DROP,PRSO
+ RTRUE
+
+
+ .FUNCT WINDOW-F
+ EQUAL? HERE,BEDROOM \?ELS5
+ EQUAL? PRSA,V?LOOK-INSIDE \?ELS10
+ PRINTI "You see an "
+ CALL DPRINT,FIELD
+ PRINTR " beyond the alley where the terrible events of last night transpired."
+?ELS10: EQUAL? PRSA,V?CLOSE,V?OPEN \FALSE
+ PRINTR "It's stuck shut."
+?ELS5: EQUAL? HERE,BANK \?ELS18
+ EQUAL? PRSA,V?EXAMINE \?ELS23
+ PRINTR "It is a barred window about chest-high behind which the teller transacts his business."
+?ELS23: EQUAL? PRSA,V?LOOK-BEHIND,V?LOOK-INSIDE \FALSE
+ PRINTR "There is a teller there."
+?ELS18: EQUAL? HERE,MM-WHEELHOUSE,NW-WHEELHOUSE \FALSE
+ EQUAL? PRSA,V?LOOK-INSIDE \FALSE
+ PRINTR "You can see the ocean beyond the deck."
+
+
+ .FUNCT IN-WINDOW-F,L,?TMP1
+ EQUAL? PRSA,V?LOOK-INSIDE \FALSE
+ PRINTI "You see "
+ LOC JOHNNY >L
+ EQUAL? L,MM-WHEELHOUSE,NW-WHEELHOUSE \?CND8
+ GETP HERE,P?LINE >?TMP1
+ GETP L,P?LINE
+ EQUAL? ?TMP1,STACK \?CND8
+ PRINTI "Johnny in "
+?CND8: PRINTR "the wheelhouse."
+
+
+ .FUNCT BEDROOM-DOOR-F
+ EQUAL? PRSA,V?OPEN \?ELS5
+ FSET? BEDROOM-DOOR,OPENBIT \?ELS10
+ CALL TELL-ALREADY,STR?25
+ RTRUE
+?ELS10: EQUAL? HERE,UPSTAIRS-HALLWAY \?ELS12
+ ZERO? BEDROOM-DOOR-LOCKED /?ELS12
+ PRINTR "It's locked."
+?ELS12: FSET BEDROOM-DOOR,OPENBIT
+ SET 'BEDROOM-DOOR-LOCKED,FALSE-VALUE
+ IN? WEASEL,UPSTAIRS-HALLWAY \?ELS21
+ PRINTI "You open the door and see "
+ CALL DPRINT,WEASEL
+ PRINTI ". He says, ""Oh. Hi. I was just wonderin' if you were gonna be at the meetin' at "
+ CALL DPRINT,SHANTY
+ PRINTI "."" He turns and heads down the steps."
+ CRLF
+ CALL ESTABLISH-GOAL,WEASEL,SHANTY
+ CALL INT,I-WEASEL-TO-BEDROOM
+ PUT STACK,0,0
+ RTRUE
+?ELS21: CALL TELL-NOW,BEDROOM-DOOR,STR?25
+ RTRUE
+?ELS5: EQUAL? PRSA,V?CLOSE \?ELS27
+ FSET? BEDROOM-DOOR,OPENBIT /?ELS32
+ CALL TELL-ALREADY,STR?26
+ RTRUE
+?ELS32: FCLEAR BEDROOM-DOOR,OPENBIT
+ CALL TELL-NOW,BEDROOM-DOOR,STR?26
+ RTRUE
+?ELS27: EQUAL? PRSA,V?UNLOCK \FALSE
+ ZERO? BEDROOM-DOOR-LOCKED /?ELS41
+ IN? PLAYER,BEDROOM /?THN48
+ EQUAL? PRSI,KEY \?ELS47
+?THN48: SET 'BEDROOM-DOOR-LOCKED,FALSE-VALUE
+ CALL TELL-NOW,BEDROOM-DOOR,STR?27
+ RSTACK
+?ELS47: ZERO? PRSI /?ELS51
+ CALL TELL-YOU-CANT,STR?28
+ RSTACK
+?ELS51: PRINTR "Not without the key."
+?ELS41: CALL TELL-ALREADY,STR?27
+ RSTACK
+
+
+ .FUNCT OCEAN-F,L
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK /?ELS5
+ PRINTR "There's no water in here."
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS9
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS14
+ PRINTR "There is water all around you."
+?ELS14: PRINTI "The ocean looks choppy"
+ ZERO? AT-SEA /?ELS23
+ PRINTI ". Whitecaps rise and fall around the boat."
+ JUMP ?CND21
+?ELS23: PRINTI ", and you know about the dangerous currents here."
+?CND21: CRLF
+ RTRUE
+?ELS9: EQUAL? PRSA,V?LISTEN \?ELS32
+ PRINTR "You hear the crashing of the waves."
+?ELS32: EQUAL? PRSA,V?SWIM,V?THROUGH,V?BOARD \?ELS36
+ GETP HERE,P?LINE >L
+ EQUAL? L,UNDERWATER-LINE-C \?ELS41
+ PRINTR "You're already in it!"
+?ELS41: EQUAL? L,TRAWLER-LINE-C,SALVAGER-LINE-C /?THN46
+ EQUAL? HERE,WHARF,FERRY-LANDING \?ELS45
+?THN46: ZERO? AT-SEA /?ELS52
+ CALL PERFORM,V?DIVE
+ RTRUE
+?ELS52: CALL JIGS-UP,STR?29
+ RSTACK
+?ELS45: CALL TELL-NO-SHORELINE
+ RSTACK
+?ELS36: EQUAL? PRSA,V?THROW,V?DROP \?ELS59
+ EQUAL? PRSI,OCEAN \?ELS59
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS66
+ CALL PERFORM,V?DROP,PRSO
+ RTRUE
+?ELS66: CALL TELL-NO-LITTER
+ RSTACK
+?ELS59: EQUAL? PRSA,V?SMELL \?ELS70
+ PRINTR "It smells very salty, which is what you might expect from the sea."
+?ELS70: EQUAL? PRSA,V?TASTE,V?DRINK \?ELS74
+ GETP HERE,P?LINE
+ GRTR? STACK,BACK-ALLEY-LINE-C /?THN80
+ EQUAL? HERE,FERRY-LANDING,WHARF \?ELS79
+?THN80: PRINTR "Bleahhhh! You spit it out immediately!"
+?ELS79: CALL TELL-NO-SHORELINE
+ RSTACK
+?ELS74: EQUAL? PRSA,V?RUB \FALSE
+ GETP HERE,P?LINE
+ GRTR? STACK,BACK-ALLEY-LINE-C /?THN93
+ EQUAL? HERE,FERRY-LANDING,WHARF \?ELS92
+?THN93: PRINTR "It's wet."
+?ELS92: CALL TELL-NO-SHORELINE
+ RSTACK
+
+
+ .FUNCT TELL-NO-SHORELINE
+ CALL TELL-YOU-CANT,STR?30
+ RSTACK
+
+
+ .FUNCT TELL-NO-LITTER
+ PRINTR "It would spoil the beauty of the sea."
+
+
+ .FUNCT STAIRS-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTI "The carpeted stairway leads "
+ EQUAL? HERE,UPSTAIRS-HALLWAY \?ELS10
+ PRINTI "down"
+ JUMP ?CND8
+?ELS10: EQUAL? HERE,RED-BOAR-INN \?CND8
+ PRINTI "up"
+?CND8: PRINTR "."
+?ELS5: EQUAL? PRSA,V?CLIMB-FOO \FALSE
+ EQUAL? HERE,UPSTAIRS-HALLWAY \?ELS23
+ CALL V-CLIMB-UP,P?DOWN
+ RTRUE
+?ELS23: CALL V-CLIMB-UP
+ RTRUE
+
+
+ .FUNCT LADDER-TOP-F
+ EQUAL? PRSA,V?CLIMB-FOO \FALSE
+ CALL DO-WALK,P?DOWN
+ RTRUE
+
+
+ .FUNCT LADDER-BOTTOM-F
+ EQUAL? PRSA,V?CLIMB-FOO \FALSE
+ CALL DO-WALK,P?UP
+ RTRUE
+
+
+ .FUNCT RAILING-F
+ EQUAL? PRSA,V?CLIMB-FOO \?ELS5
+ PRINTR "You immediately climb back down."
+?ELS5: EQUAL? PRSA,V?LEAP,V?DISEMBARK \FALSE
+ CALL PERFORM,V?DIVE
+ RTRUE
+
+
+ .FUNCT BUNKS-F
+ EQUAL? PRSA,V?SLEEP,V?BOARD \?ELS5
+ CALL TELL-BAD-SHAPE
+ RSTACK
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS7
+ PRINTR "These stacks of bunks look as though they were never comfortable. The work of time and the sea have made them fairly decrepit, incapable of supporting much weight."
+?ELS7: EQUAL? PRSA,V?MUNG \FALSE
+ PRINTR "Some pieces fall away, but the structure holds together."
+
+
+ .FUNCT TELL-BAD-SHAPE
+ PRINTR "They don't look as if they could support your weight."
+
+
+ .FUNCT TIME-PRINT,NUM,HR,PM=0
+ DIV NUM,60 >HR
+ GRTR? HR,12 \?ELS3
+ SUB HR,12 >HR
+ SET 'PM,TRUE-VALUE
+ JUMP ?CND1
+?ELS3: EQUAL? HR,12 \?ELS5
+ SET 'PM,TRUE-VALUE
+ JUMP ?CND1
+?ELS5: ZERO? HR \?CND1
+ SET 'HR,12
+?CND1: PRINTN HR
+ PRINTI ":"
+ MOD NUM,60 >HR
+ LESS? HR,10 \?CND10
+ PRINTI "0"
+?CND10: PRINTN HR
+ PRINTI " "
+ ZERO? PM /?ELS23
+ PUSH STR?34
+ JUMP ?CND19
+?ELS23: PUSH STR?35
+?CND19: PRINT STACK
+ RTRUE
+
+
+ .FUNCT TABLE-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?36
+ RTRUE
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS7
+ PRINTR "The table has a variety of forms and brochures you find boring."
+?ELS7: EQUAL? PRSA,V?PUT-ON,V?PUT \FALSE
+ EQUAL? PRSI,PSEUDO-OBJECT \FALSE
+ PRINTI "A bank official scurries out, picks up the "
+ CALL DPRINT,PRSO
+ PRINTR ", and hands it to you, pointing out that the table is for bank business only."
+
+
+ .FUNCT LIGHTHOUSE-LOCK-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?37
+ RTRUE
+?ELS5: EQUAL? PRSA,V?PICK \?ELS7
+ PRINTR "You try for a while, but the lock won't give."
+?ELS7: EQUAL? PRSA,V?UNLOCK \?ELS11
+ CALL TELL-NO-KEY
+ RTRUE
+?ELS11: EQUAL? PRSA,V?MUNG \?ELS13
+ PRINTR "You find that the door and lock withstand your attempts."
+?ELS13: EQUAL? PRSA,V?LOCK \FALSE
+ CALL TELL-ALREADY,STR?38
+ RTRUE
+
+
+ .FUNCT WHEEL-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?39
+ RTRUE
+?ELS5: EQUAL? PRSA,V?SPIN,V?TURN \FALSE
+ IN? JOHNNY,HERE \?ELS12
+ CALL DPRINT,JOHNNY
+ PRINTR " glares at you. You decide to leave the piloting to the captain."
+?ELS12: PRINTR "The wheel spins."
+
+
+ .FUNCT BOLT-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?40
+ RTRUE
+?ELS5: PRINTR "The bolts are rusted firmly into place."
+
+
+ .FUNCT NOT-HERE-OBJECT-F,TBL,PRSO?=1,OBJ
+ EQUAL? PRSO,NOT-HERE-OBJECT \?ELS3
+ EQUAL? PRSI,NOT-HERE-OBJECT \?ELS3
+ PRINTR "Those things aren't here."
+?ELS3: EQUAL? PRSO,NOT-HERE-OBJECT \?ELS9
+ SET 'TBL,P-PRSO
+ JUMP ?CND1
+?ELS9: SET 'TBL,P-PRSI
+ SET 'PRSO?,FALSE-VALUE
+?CND1: ZERO? PRSO? /?ELS14
+ EQUAL? PRSA,V?CLIMB-UP,V?ASK-CONTEXT-FOR,V?ASK-CONTEXT-ABOUT /?THN19
+ EQUAL? PRSA,V?FOLLOW,V?FIND,V?EXAMINE /?THN19
+ EQUAL? PRSA,V?$CALL,V?WHAT,V?WAIT-FOR /?THN19
+ EQUAL? PRSA,V?THROUGH,V?MAKE,V?GIVE /?THN19
+ EQUAL? PRSA,V?WALK-TO \?CND12
+?THN19: CALL FIND-NOT-HERE,TBL,PRSO? >OBJ
+ ZERO? OBJ /FALSE
+ EQUAL? OBJ,NOT-HERE-OBJECT \TRUE
+ JUMP ?CND12
+?ELS14: EQUAL? PRSA,V?SGIVE,V?ASK-FOR,V?ASK-ABOUT /?THN34
+ EQUAL? PRSA,V?TELL \?CND12
+?THN34: CALL FIND-NOT-HERE,TBL,PRSO? >OBJ
+ ZERO? OBJ /FALSE
+ EQUAL? OBJ,NOT-HERE-OBJECT \TRUE
+?CND12: EQUAL? PRSA,V?$CALL \?ELS46
+ CALL V-CALL-LOSE
+ SET 'CLOCK-WAIT,FALSE-VALUE
+ JUMP ?CND44
+?ELS46: EQUAL? WINNER,ADVENTURER \?ELS48
+ CALL TELL-YOU-CANT,STR?41,FALSE-VALUE
+ CALL NOT-HERE-PRINT,PRSO?
+ PRINTI " here."
+ CRLF
+ JUMP ?CND44
+?ELS48: CALL START-SENTENCE,WINNER
+ PRINTI " seems confused. ""I don't see any"
+ CALL NOT-HERE-PRINT,PRSO?
+ PRINTI " here!"""
+ CRLF
+?CND44: SET 'P-MOBY-FOUND,FALSE-VALUE
+ SET 'PRSA,FALSE-VALUE
+ SET 'PRSO,FALSE-VALUE
+ SET 'PRSI,FALSE-VALUE
+ RETURN 2
+
+
+ .FUNCT FIND-NOT-HERE,TBL,PRSO?,M-F,OBJ,CTR,PER,?TMP1
+ CALL MOBY-FIND,TBL >M-F
+ GRTR? M-F,1 \?CND1
+ GET TBL,1
+ GETP STACK,P?GLOBAL >OBJ
+ ZERO? OBJ /?CND1
+ SET 'M-F,1
+ SET 'P-MOBY-FOUND,OBJ
+?CND1: EQUAL? 1,M-F \?ELS10
+ ZERO? PRSO? /?ELS13
+ EQUAL? PRSA,V?TELL \?ELS17
+ EQUAL? WINNER,PLAYER \?ELS17
+ FSET? P-MOBY-FOUND,VICBIT \?ELS17
+ SET 'P-CONT,FALSE-VALUE
+ CALL TELL-NOT-HERE-TALK
+ RTRUE
+?ELS17: EQUAL? PRSA,V?EXAMINE \?ELS21
+ FSET? P-MOBY-FOUND,PERSON \?ELS24
+ CALL META-LOC,PLAYER
+ GETP STACK,P?CORRIDOR >?TMP1
+ LOC P-MOBY-FOUND
+ GETP STACK,P?CORRIDOR
+ BAND ?TMP1,STACK
+ ZERO? STACK /?ELS24
+ PRINTI "You can see "
+ CALL DPRINT,P-MOBY-FOUND
+ PRINTR " in the distance."
+?ELS24: EQUAL? PRSO,MCGINTY \?ELS30
+ IN? PLAYER,BACK-ALLEY-2 \?ELS30
+ IN? MCGINTY,MCGINTY-HQ \?ELS30
+ PRINTI "Looking through the window, you see "
+ CALL DPRINT,MCGINTY
+ PRINTR " in his office."
+?ELS30: CALL GLOBAL-NOT-HERE-PRINT,PRSO
+ RTRUE
+?ELS21: SET 'PRSO,P-MOBY-FOUND
+ JUMP ?CND11
+?ELS13: SET 'PRSI,P-MOBY-FOUND
+?CND11: ZERO? P-XADJ /?ELS43
+ ZERO? P-XNAM \?ELS43
+ SET 'P-NONOUN,TRUE-VALUE
+ RFALSE
+?ELS43: SET 'P-NONOUN,FALSE-VALUE
+ RFALSE
+?ELS10: ZERO? PRSO? \?ELS49
+ EQUAL? PRSA,V?ASK-ABOUT /?THN55
+ EQUAL? PRSA,V?TELL \?ELS54
+ EQUAL? PRSO,ME \?ELS54
+?THN55: EQUAL? PRSO,ME \?ELS61
+ EQUAL? WINNER,PLAYER \?ELS64
+ ZERO? QCONTEXT /?ELS64
+ EQUAL? HERE,QCONTEXT-ROOM \?ELS64
+ SET 'PER,QCONTEXT
+ JUMP ?CND59
+?ELS64: SET 'PER,WINNER
+ JUMP ?CND59
+?ELS61: SET 'PER,PRSO
+?CND59: FSET? PER,VICBIT \?ELS73
+ CALL SAY-CONFUSED,PER,PRSO?
+ RTRUE
+?ELS73: CALL SUDDENLY-REALIZE-TALKING,PER
+ RTRUE
+?ELS54: FSET? PRSO,VICBIT \?ELS77
+ CALL SAY-CONFUSED,PRSO,PRSO?
+ RSTACK
+?ELS77: PRINTI "You wouldn't find any"
+ CALL NOT-HERE-PRINT,PRSO?
+ PRINTR " there."
+?ELS49: RETURN NOT-HERE-OBJECT
+
+
+ .FUNCT GLOBAL-NOT-HERE-PRINT,OBJ
+ ZERO? P-MULT /?ELS3
+ INC 'P-NOT-HERE
+ JUMP ?CND1
+?ELS3: CALL TELL-YOU-CANT,STR?41,FALSE-VALUE
+ EQUAL? OBJ,PRSO \?ELS9
+ CALL PRSO-PRINT
+ JUMP ?CND7
+?ELS9: CALL PRSI-PRINT
+?CND7: PRINTI " here."
+ CRLF
+?CND1: SET 'P-WON,FALSE-VALUE
+ RTRUE
+
+
+ .FUNCT SAY-CONFUSED,PER,PRSO?
+ CALL START-SENTENCE,PER
+ PRINTI " looks confused. ""I have no idea what"
+ CALL NOT-HERE-PRINT,PRSO?
+ PRINTR " you're talking about!"""
+
+
+ .FUNCT NOT-HERE-PRINT,PRSO?,?TMP1
+ ZERO? P-OFLAG /?ELS3
+ ZERO? P-XADJ /?CND5
+ PRINTI " "
+ PRINTB P-XADJN
+?CND5: ZERO? P-XNAM /?CND1
+ PRINTI " "
+ PRINTB P-XNAM
+ JUMP ?CND1
+?ELS3: ZERO? PRSO? /?ELS18
+ GET P-ITBL,P-NC1 >?TMP1
+ GET P-ITBL,P-NC1L
+ CALL BUFFER-PRINT,?TMP1,STACK,FALSE-VALUE
+ JUMP ?CND1
+?ELS18: GET P-ITBL,P-NC2 >?TMP1
+ GET P-ITBL,P-NC2L
+ CALL BUFFER-PRINT,?TMP1,STACK,FALSE-VALUE
+?CND1: SET 'P-WON,FALSE-VALUE
+ RETURN P-WON
+
+
+ .FUNCT TELL-YOU-CANT,STR,FINISH=1
+ PRINTI "You can't "
+ PRINT STR
+ ZERO? FINISH /FALSE
+ CRLF
+ RTRUE
+
+
+ .FUNCT TELL-ROPE-HIGH
+ CALL TELL-CANT-REACH,STR?42
+ RSTACK
+
+
+ .FUNCT TELL-CANT-REACH,STR
+ CALL TELL-YOU-CANT,STR?43,FALSE-VALUE
+ PRINT STR
+ PRINTR "."
+
+
+ .FUNCT TELL-NO-GO,PRINT?
+ ZERO? PRINT? /FALSE
+ CALL TELL-YOU-CANT,STR?44
+ RSTACK
+
+
+ .FUNCT TELL-NO-NO
+ CALL TELL-YOU-CANT,STR?45
+ RSTACK
+
+
+ .FUNCT TELL-NO-AFFORD
+ CALL TELL-YOU-CANT,STR?46
+ RSTACK
+
+
+ .FUNCT TELL-TOO-BIG
+ CALL TELL-YOU-CANT,STR?47
+ RSTACK
+
+ .ENDI
diff --git a/globals.zil b/globals.zil
new file mode 100644
index 0000000..55e221c
--- /dev/null
+++ b/globals.zil
@@ -0,0 +1,1651 @@
+"GLOBALS for
+ TOA #2
+ (c) Copyright 1984 Infocom, Inc. All Rights Reserved.
+"
+
+<DIRECTIONS NORTH EAST WEST SOUTH UP DOWN IN OUT SE SW NE NW>
+
+"SUBTITLE GLOBAL OBJECTS"
+
+
+<OBJECT GLOBAL-OBJECTS
+ (FLAGS RMUNGBIT INVISIBLE TOUCHBIT SURFACEBIT TRYTAKEBIT VICBIT DOORBIT
+ TURNBIT PERSON VOWELBIT OPENBIT SEARCHBIT TRANSBIT WEARBIT ONBIT
+ TOOLBIT RENTBIT PUSHBIT WORNBIT)
+ ;(FDESC "")
+ ;(LDESC "")
+ ;(TEXT "")
+ ;(SIZE 0)
+ ;(VALUE 0)
+ ;(CAPACITY 0)>
+
+<OBJECT LOCAL-GLOBALS
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM ZZMGCK)
+ ;(DESCFCN 0)
+ ;(GLOBAL GLOBAL-OBJECTS)
+ ;(PSEUDO "FOOBAR" V-WAIT)
+ ;(CONTFCN 0)
+ ;(SIZE 0)>
+;"Yes, this synonym for LOCAL-GLOBALS needs to exist... sigh"
+
+<OBJECT ROOMS>
+
+<OBJECT RED-HERRING
+ (IN LOCAL-GLOBALS)
+ (DESC "thingy")
+ (SYNONYM COMBIN)
+ (ACTION RED-HERRING-F)>
+
+<ROUTINE RED-HERRING-F ()
+ <COND (<VERB? ASK-ABOUT>
+ <RFALSE>)
+ (T <GLOBAL-NOT-HERE-PRINT ,RED-HERRING>)>>
+
+;<OBJECT FOO-TOOL
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM HAMMER CROWBA EXPLOS MACHET)
+ (DESC "such thing")>
+
+;<OBJECT FINGER
+ (IN GLOBAL-OBJECTS)
+ (FLAGS SURFACEBIT OPENBIT CONTBIT TOUCHBIT)
+ (CAPACITY 1)
+ (SYNONYM FINGER)
+ (DESC "finger")
+ ;(ACTION FINGER-FCN)>
+
+;<ROUTINE FINGER-FCN ()
+ <COND (<AND <VERB? PUT-ON>
+ <PRSI? ,FINGER>>
+ <PERFORM ,V?WEAR ,PRSO>
+ <RTRUE>)
+ (<VERB? EXAMINE LOOK-INSIDE>
+ <COND (<FSET? ,RING ,WEARBIT>
+ <TELL "Sitting on your finger is a ring." CR>
+ <RTRUE>)
+ (T
+ <TELL "It's part of your hands." CR>
+ <RTRUE>)>)>>
+
+<OBJECT INTNUM
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM INTNUM)
+ ;(DESC "number")
+ (SDESC "number")
+ (ACTION INTNUM-F)>
+
+<ROUTINE INTNUM-F ()
+ <COND (<AND <VERB? GIVE WITHDRAW>
+ <NOT ,P-DOLLAR-FLAG>>
+ <TELL "Next time, tell me what there's " N ,P-NUMBER " of." CR>
+ <SETG CLOCK-WAIT T>
+ <RFATAL>)
+ (<AND ,P-DOLLAR-FLAG
+ <NOT <VERB? WITHDRAW TAKE ASK-FOR>>
+ <==? ,WINNER ,PLAYER>
+ <G? ,P-AMOUNT ,POCKET-CHANGE>>
+ <TELL-DONT-HAVE "that much">)>>
+
+<OBJECT INTDIR
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM INTDIR)
+ (ADJECTIVE NORTH EAST SOUTH WEST NE NW SE SW)
+ ;(FLAGS TOOLBIT)
+ (DESC "direction")>
+
+<OBJECT PSEUDO-OBJECT
+ ;(DESC "pseudo")
+ (SDESC "bunch of clothes")
+ (DESCFCN 0)
+ (ACTION CRETIN-F)>
+
+<OBJECT IT
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM IT THAT HIM HER)
+ (DESC "random object")
+ (FLAGS NDESCBIT TOUCHBIT)>
+
+<OBJECT AIR
+ (IN GLOBAL-OBJECTS)
+ (DESC "air")
+ (FLAGS VOWELBIT CONTBIT OPENBIT)
+ (SYNONYM AIR OXYGEN)
+ (TEXT "Air being what it is, you can't see it.")
+ (ACTION AIR-F)>
+
+<ROUTINE AIR-F ()
+ <COND (<VERB? SMELL TASTE>
+ <COND (<AND <AIRTIGHT-ROOM?>
+ <NOT <FSET? ,MASK ,WORNBIT>>>
+ <TELL "The air is musty but breathable." CR>)
+ (<EQUAL? ,HERE ,MM-ENGINE-ROOM ,NW-ENGINE-ROOM>
+ <TELL "The air is heavy with diesel fumes." CR>)
+ (<==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <TELL
+"It feels a whole lot better than the water you could be breathing." CR>)
+ (T
+ <TELL "You find nothing special about the air." CR>)>)
+ (<VERB? OPEN CLOSE>
+ <TELL "I think you're an air head." CR>)
+ (<VERB? LOOK-INSIDE>
+ <PERFORM ,V?LOOK>
+ <RTRUE>)
+ (<AND <EQUAL? ,PRSI ,AIR>
+ <VERB? THROW DROP>>
+ <PERFORM ,PRSA ,PRSO ,GROUND>
+ <RTRUE>)>>
+
+<OBJECT GROUND ;"was GROUND"
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM FLOOR GROUND)
+ (ADJECTIVE OCEAN)
+ (DESC "floor")
+ (ACTION FLOOR-F)>
+
+<ROUTINE FLOOR-F ()
+ <COND (<AND <VERB? PUT-ON PUT>
+ <PRSI? ,GROUND>>
+ <PERFORM ,V?DROP ,PRSO>
+ <RTRUE>)>>
+
+<OBJECT DECK
+ (IN LOCAL-GLOBALS)
+ (SYNONYM DECK)
+ (ADJECTIVE NORTH SOUTH EAST WEST);"my fingers are crossed"
+ (DESC "deck")
+ (ACTION DECK-F)>
+
+<ROUTINE DECK-F ()
+ <COND (<VERB? WALK-TO>
+ <TELL-SHD-DIR>)
+ (<AND <VERB? PUT-ON PUT>
+ <PRSI? ,DECK>>
+ <PERFORM ,V?DROP ,PRSO>
+ <RTRUE>)>>
+
+<OBJECT FLOOR-HOLE-1
+ (IN LOCAL-GLOBALS)
+ (DESC "hole")
+ (SYNONYM HOLE HATCH HATCHW)
+ (ADJECTIVE BOTTOM LOWER)
+ (FLAGS INVISIBLE)
+ (ACTION FLOOR-HOLE-F)>
+
+<OBJECT FLOOR-HOLE-2
+ (IN LOCAL-GLOBALS)
+ ;(DESC "hole")
+ (SDESC "hole")
+ (SYNONYM HOLE HATCH HATCHW)
+ (ADJECTIVE BOTTOM LOWER)
+ (FLAGS INVISIBLE)
+ (ACTION FLOOR-HOLE-F)>
+
+<ROUTINE FLOOR-HOLE-F ()
+ <COND (<VERB? THROUGH>
+ <DO-WALK ,P?DOWN>
+ <RTRUE>)
+ (<VERB? LOOK-INSIDE ;LOOK-DOWN>
+ <TELL-YOU-CANT "make anything out on the other side.">)
+ (<VERB? EXAMINE>
+ <COND (<AND <==? ,HERE ,WRECK-5>
+ <NOT ,WRECK-5-FLOODED>>
+ <TELL "There's water on the other side." CR>)
+ (T <TELL-LOOKS-HOLE>)>)>>
+
+<ROUTINE TELL-LOOKS-HOLE ()
+ <TELL "It looks a lot like a hole." CR>>
+
+<OBJECT CEILING-HOLE-1
+ (IN LOCAL-GLOBALS)
+ (DESC "hole")
+ (SYNONYM HOLE HATCH HATCHW)
+ (ADJECTIVE TOP UPPER)
+ (FLAGS INVISIBLE)
+ (ACTION CEILING-HOLE-F)>
+
+<OBJECT CEILING-HOLE-2
+ (IN LOCAL-GLOBALS)
+ ;(DESC "hole")
+ (SDESC "hole")
+ (SYNONYM HOLE HATCH HATCHW)
+ (ADJECTIVE TOP UPPER)
+ (FLAGS INVISIBLE)
+ (ACTION CEILING-HOLE-F)>
+
+<ROUTINE CEILING-HOLE-F ()
+ <COND (<VERB? THROUGH>
+ <DO-WALK ,P?UP>
+ <RTRUE>)
+ (<VERB? LOOK-INSIDE ;LOOK-UP>
+ <TELL-YOU-CANT "make anything out on the other side.">)
+ (<VERB? EXAMINE>
+ <TELL-LOOKS-HOLE>)>>
+
+<OBJECT HOLE
+ (IN GLOBAL-OBJECTS)
+ (FLAGS NDESCBIT)
+ (DESC "hole")
+ (SYNONYM HOLE)
+ (ADJECTIVE SMALL)
+ (ACTION HOLE-F)>
+
+<ROUTINE HOLE-F ()
+ <COND (<VERB? DRILL>
+ <RFALSE>)
+ (T <GLOBAL-NOT-HERE-PRINT ,HOLE>)>>
+
+<OBJECT BULKHEADS
+ (IN GLOBAL-OBJECTS)
+ (FLAGS NDESCBIT TOUCHBIT)
+ (DESC "bulkhead")
+ (SYNONYM BULKHE)>
+
+<OBJECT WALLS
+ (IN GLOBAL-OBJECTS)
+ (FLAGS NDESCBIT TOUCHBIT)
+ (DESC "wall")
+ (SYNONYM WALL WALLS)>
+
+<OBJECT CEILING
+ (IN GLOBAL-OBJECTS)
+ (FLAGS NDESCBIT TOUCHBIT)
+ (DESC "ceiling")
+ (SYNONYM CEILIN)>
+
+<OBJECT MAST
+ (IN LOCAL-GLOBALS)
+ (DESC "mast")
+ (SYNONYM MAST MASTS)
+ (ADJECTIVE ROTTIN)
+ (FLAGS INVISIBLE)
+ (ACTION MAST-F)>
+
+<ROUTINE MAST-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "There are several rotting masts here.">
+ <COND (<==? ,HERE ,WRECK-1>
+ <TELL
+" The top of one has fallen into a hole at your feet.">)>
+ <CRLF>)
+ (<VERB? CLIMB-FOO>
+ <TELL "None of the masts looks sturdy enough." CR>)>>
+
+;<OBJECT HANDS
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM HAND HANDS PAIR ARMS)
+ (ADJECTIVE ARM)
+ (DESC "pair of hands")
+ (FLAGS NDESCBIT TOOLBIT WEAPONBIT TOUCHBIT)
+ ;(ACTION READ-PALMS-F)>
+
+;<ROUTINE READ-PALMS-F ()
+ <COND (<VERB? READ>
+ <TELL "I don't read palms." CR>
+ <RTRUE>)>>
+
+<OBJECT LIGHTHOUSE
+ (IN LOCAL-GLOBALS)
+ (SYNONYM LIGHTH BEACON)
+ (DESC "lighthouse")
+ (ACTION LIGHTHOUSE-F)>
+
+<ROUTINE LIGHTHOUSE-F ()
+ <COND (<EQUAL? ,HERE ,WINDING-ROAD-1>
+ <COND (<VERB? THROUGH OPEN>
+ <TELL "The door is locked." CR>
+ <RTRUE>)
+ (<VERB? EXAMINE>
+ <TELL
+"You can see the base of a " D ,LIGHTHOUSE ". ">
+ <TELL-CLOSED
+ "door, which has lettering stencilled on it,">
+ <RTRUE>)>)
+ (T
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The " D ,LIGHTHOUSE " towers over Hardscrabble Island from the
+island's northwest corner.">
+ <COND (<OR <G? ,PRESENT-TIME 1200>
+ <L? ,PRESENT-TIME 480>>
+ <TELL
+" Its light provides a beacon for ships.">)>
+ <CRLF>
+ <RTRUE>)
+ (<VERB? WALK-TO>
+ <TELL-SHD-DIR>
+ ;<TELL "You must supply a " D ,INTDIR "!" CR>)
+ (<VERB? FIND>
+ <RFALSE>)
+ (<VERB? ASK-ABOUT>
+ <COND (<FSET? ,PRSO ,VICBIT>
+ <TELL "\"It's been there forever.\"" CR>)>)
+ (T
+ <TELL "That would be difficult from this distance." CR>)>)>>
+
+<OBJECT GLOBAL-TREASURE
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM TREASU)
+ (DESC "treasure")
+ (ACTION GLOBAL-TREASURE-F)>
+
+<ROUTINE GLOBAL-TREASURE-F ()
+ <COND (<VERB? ASK-ABOUT ASK-CONTEXT-ABOUT TELL>
+ <RFALSE>)
+ (<VERB? FIND>
+ <COND (<==? ,WINNER ,PLAYER>
+ <TELL-NOT-EASY>)
+ (T <TELL "\"I'd like to know where some is.\"" CR>)>)
+ (T <GLOBAL-NOT-HERE-PRINT ,GLOBAL-TREASURE>)>>
+
+<OBJECT TRAWLER
+ (IN LOCAL-GLOBALS)
+ (DESC "Night Wind")
+ (SYNONYM TRAWLE WIND BOAT SHIP)
+ (ADJECTIVE NIGHT)
+ (FLAGS RENTBIT)
+ (LINE 4)
+ (ACTION TRAWLER-F)>
+
+<ROUTINE TRAWLER-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<==? <GETP ,HERE ,P?LINE> ,TRAWLER-LINE-C>
+ <TELL
+"The " D ,TRAWLER " is in decent shape." CR>)
+ (<AND <==? ,HERE ,MM-WHEELHOUSE>
+ ,AT-SEA>
+ <GLOBAL-NOT-HERE-PRINT ,TRAWLER>)
+ (T
+ <TELL "The " D ,TRAWLER>
+ <TELL-BOAT-DESC>)>)
+ (<VERB? BOARD THROUGH>
+ <COND (<==? ,HERE ,WHARF>
+ <DO-WALK ,P?WEST>)
+ (<AND <==? ,HERE ,UNDERWATER>
+ <==? ,DEPTH 50>>
+ <DO-WALK ,P?UP>)
+ (T <TELL-YOU-CANT "get there from here.">)>
+ <RTRUE>)
+ (<VERB? DISEMBARK>
+ <COND (,AT-SEA
+ <COND (<GLOBAL-IN? ,RAILING ,HERE>
+ <PERFORM ,V?DIVE>
+ <RTRUE>)
+ (T <TELL-NO-EXIT>)>)
+ (<==? ,HERE ,NW-STARBOARD-DECK>
+ <DO-WALK ,P?EAST>)
+ (T <TELL-NO-EXIT>)>)
+ (<AND <VERB? LISTEN>
+ ,AT-SEA>
+ <TELL-THRUM>)
+ (<VERB? LAUNCH>
+ <TELL-YOU-CANT "do it alone.">)>>
+
+<ROUTINE TELL-NO-EXIT ()
+ <TELL-HOW-THAT "do" "from here">>
+
+<ROUTINE TELL-HOW-THAT (STR "OPTIONAL" (LAST <>))
+ <TELL "How can you " .STR " that">
+ <COND (.LAST <TELL " " .LAST>)>
+ <TELL "?" CR>>
+
+<ROUTINE TELL-BOAT-DESC ()
+ <TELL " looks weathered but not aged." CR>>
+
+<ROUTINE TELL-THRUM ()
+ <TELL "You hear the powerful thrum of diesel engines." CR>>
+
+<OBJECT SALVAGER
+ (IN LOCAL-GLOBALS)
+ (DESC "Mary Margaret")
+ (SYNONYM SALVAG MARGAR SHIP BOAT)
+ (ADJECTIVE MARY)
+ (FLAGS RENTBIT)
+ (LINE 5)
+ (ACTION SALVAGER-F)>
+
+<ROUTINE SALVAGER-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<==? <GETP ,HERE ,P?LINE> ,SALVAGER-LINE-C>
+ <TELL
+"The " D ,SALVAGER " is shipshape." CR>)
+ (<AND <==? ,HERE ,NW-WHEELHOUSE>
+ ,AT-SEA>
+ <GLOBAL-NOT-HERE-PRINT ,SALVAGER>)
+ (T
+ <TELL "The " D ,SALVAGER " is a medium-size boat that">
+ <TELL-BOAT-DESC>)>)
+ (<VERB? BOARD THROUGH>
+ <COND (<==? ,HERE ,WHARF>
+ <DO-WALK ,P?EAST>)
+ (<AND <==? ,HERE ,UNDERWATER>
+ <==? ,DEPTH 50>>
+ <DO-WALK ,P?UP>)
+ (T <TELL-YOU-CANT "get there from here.">)>
+ <RTRUE>)
+ (<VERB? DISEMBARK>
+ <COND (,AT-SEA
+ <COND (<GLOBAL-IN? ,RAILING ,HERE>
+ <PERFORM ,V?DIVE>
+ <RTRUE>)
+ (T <TELL-NO-EXIT>)>)
+ (<==? ,HERE ,MM-PORT-DECK>
+ <DO-WALK ,P?WEST>)
+ (T <TELL-NO-EXIT>)>)
+ (<AND <VERB? LISTEN>
+ ,AT-SEA>
+ <TELL-THRUM>)
+ (<VERB? LAUNCH>
+ <TELL-YOU-CANT "do it alone.">)>>
+
+<OBJECT SHIPWRECK
+ (IN LOCAL-GLOBALS)
+ (DESC "shipwreck")
+ (SYNONYM WRECK SHIPWR SHIP)
+ (ADJECTIVE ROTTEN)
+ (ACTION SHIPWRECK-F)>
+
+<ROUTINE SHIPWRECK-F ()
+ <COND (<VERB? DISEMBARK>
+ <TELL-NOT-EASY>)
+ (<VERB? EXAMINE>
+ <TELL "It is what's left of a ">
+ <COND (<EQUAL? ,WRECK-CHOSEN 1 3>
+ <TELL "wooden">)
+ (T <TELL "steel">)>
+ <TELL " ship." CR>)>>
+
+<OBJECT GLOBAL-SLEEP
+ (IN GLOBAL-OBJECTS)
+ (DESC "sleep")
+ (SYNONYM SLEEP)
+ (ACTION GLOBAL-SLEEP-F)>
+
+<ROUTINE GLOBAL-SLEEP-F ()
+ <COND (<VERB? WALK-TO>
+ <PERFORM ,V?SLEEP>
+ <RTRUE>)
+ (T <TELL "Huh? Wake up!" CR>)>>
+
+;<OBJECT GLOBAL-MEETING
+ (IN GLOBAL-OBJECTS)
+ (DESC "meeting")
+ (SYNONYM MEETING)
+ (ACTION GLOBAL-MEETING-F)>
+
+;<ROUTINE GLOBAL-MEETING-F ()
+ <COND (<VERB? LAMP-ON>
+ <TELL-YOURE-NOT "Tip O'Neill.">)
+ (<VERB? EXAMINE>
+ <TELL "How do you propose I do that?" CR>)>>
+
+<OBJECT FIELD
+ (IN LOCAL-GLOBALS)
+ (DESC "abandoned field")
+ (SYNONYM FIELD WEEDS)
+ (ADJECTIVE ABANDO OVERGR)
+ (FLAGS VOWELBIT)
+ (ACTION FIELD-F)>
+
+<ROUTINE FIELD-F ()
+ <COND (<VERB? BOARD THROUGH>
+ <TELL-YOU-CANT "make your way through the growth.">)
+ (<VERB? LOOK-BEHIND>
+ <TELL <PICK-ONE ,YUKS> CR>)
+ (<VERB? CUT>
+ <TELL-DONT-HAVE "all week">)
+ (<VERB? PLAY>
+ <TELL "Sounds exciting." CR>)
+ (<VERB? EXAMINE>
+ <TELL
+"This field was once productive farmland but hasn't been tended for many
+years." CR>)>>
+
+<OBJECT ROCKS
+ (IN LOCAL-GLOBALS)
+ (DESC "rocky coastline")
+ (SYNONYM ROCKS COASTL)
+ (ADJECTIVE ROCKY)
+ (ACTION ROCKS-F)>
+
+<ROUTINE ROCKS-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The rocks here are large, pointy, and impossible to get through." CR>)
+ (<VERB? BOARD THROUGH>
+ <TELL-YOU-CANT "get through the rocks.">)>>
+
+<OBJECT POCKET
+ (IN GLOBAL-OBJECTS)
+ (DESC "pocket")
+ (SYNONYM POCKET)
+ (FLAGS CONTBIT OPENBIT)
+ (TEXT "You keep your money in it.")
+ (ACTION POCKET-F)>
+
+<ROUTINE POCKET-F ()
+ <COND (<OR <FSET? ,WET-SUIT ,WORNBIT>
+ <FSET? ,DEEP-SUIT ,WORNBIT>>
+ <TELL "Your diving gear is over the pocket." CR>)
+ (<AND <VERB? TAKE>
+ <PRSO? ,GLOBAL-MONEY ,RIDICULOUS-MONEY-KLUDGE>>
+ <TELL-FLASHING-CASH>)
+ (<VERB? LOOK-INSIDE>
+ <TELL "There is $" N ,POCKET-CHANGE " in it." CR>)
+ (<VERB? EMPTY>
+ <TELL "You think better of the idea." CR>)
+ (<VERB? OPEN>
+ <TELL "It's open enough." CR>)
+ (<AND <VERB? PUT>
+ <PRSI? ,POCKET>>
+ <COND (<AND ,P-DOLLAR-FLAG
+ <PRSO? ,INTNUM>
+ <G? ,P-AMOUNT ,POCKET-CHANGE>>
+ <TELL-DONT-HAVE "that much">)
+ (<OR <PRSO? ,GLOBAL-MONEY ,RIDICULOUS-MONEY-KLUDGE>
+ <AND <PRSO? ,INTNUM> ,P-DOLLAR-FLAG>>
+ <TELL-ALREADY "there">)
+ (T <TELL-NO-FIT>)>)>>
+
+<ROUTINE TELL-NO-FIT ("OPTIONAL" (STR <>))
+ <TELL "It won't fit">
+ <COND (.STR <TELL " " .STR>)>
+ <TELL "." CR>>
+
+<OBJECT PEOPLE
+ (IN GLOBAL-OBJECTS)
+ (DESC "bunch of people")
+ (SYNONYM PEOPLE)
+ (ACTION PEOPLE-F)>
+
+<ROUTINE PEOPLE-F ()
+ <COND (<EQUAL? ,HERE ,SHANTY ,FERRY-LANDING>
+ <TELL "Leave them alone. They're not bothering you." CR>)
+ (<OR <IN? ,HERE ,WEASEL>
+ <IN? ,HERE ,JOHNNY>
+ <IN? ,HERE ,PETE>
+ <IN? ,HERE ,SPEAR-CARRIER>
+ <IN? ,HERE ,DELIVERY-BOY>>
+ <TELL-REFER-INDIVIDUAL "s">)
+ (T <GLOBAL-NOT-HERE-PRINT ,PEOPLE>)>>
+
+<ROUTINE TELL-REFER-INDIVIDUAL (STR)
+ <TELL "Refer to individual" .STR "." CR>>
+
+<OBJECT WALLPAPER
+ (IN LOCAL-GLOBALS)
+ (DESC "wallpaper")
+ (SYNONYM WALLPA)
+ (ADJECTIVE FADED DRAB OFF-WH)
+ (TEXT "It's faded to a drab off-white.")>
+
+;<ROUTINE WALLPAPER-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "It's a drab off-white." CR>)>>
+
+<OBJECT CARPET
+ (IN LOCAL-GLOBALS)
+ (DESC "carpeting")
+ (SYNONYM CARPET RUG)
+ (ADJECTIVE DRAB WORN)
+ (TEXT "It's drab and worn.")>
+
+;<ROUTINE CARPET-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "It's drab and worn." CR>)>>
+
+<OBJECT GLOBAL-SURFACE ;"local that moves"
+ (IN RED-BOAR-INN)
+ ;(DESC "counter")
+ (SDESC "counter")
+ (SYNONYM TABLE DESK COUNTE DRAWER)
+ (FLAGS SURFACEBIT CONTBIT OPENBIT NDESCBIT)
+ (CAPACITY 10)
+ (ACTION GLOBAL-SURFACE-F)>
+
+<ROUTINE GLOBAL-SURFACE-F ()
+ <COND (<VERB? OPEN>
+ <TELL <PICK-ONE ,YUKS> CR>)>>
+
+<GLOBAL SHARED-OBJECT-TABLE
+ <TABLE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>>
+<GLOBAL LAST-S-O-T-PLACE <>>
+
+<ROUTINE MOVE-SHARED-OBJECTS (PLACE "AUX" (CTR 0) (SURFACE? T))
+ <COND (<==? .PLACE ,LAST-S-O-T-PLACE>
+ <RFALSE>)
+ (<EQUAL? ,LAST-S-O-T-PLACE ,MM-CREW-QTRS ,NW-CREW-QTRS>
+ <SET SURFACE? <>>
+ <UNLOAD ,UNDER-BUNK>
+ <UNLOAD ,BUNK>)
+ (<EQUAL? ,LAST-S-O-T-PLACE ,MM-GALLEY ,NW-GALLEY>
+ <UNLOAD ,STOVE>)
+ (<EQUAL? ,LAST-S-O-T-PLACE ,MM-LOUNGE ,NW-LOUNGE>
+ <UNLOAD ,LOUNGE-CHAIR>)>
+ <COND (.SURFACE?
+ <UNLOAD ,GLOBAL-SURFACE>)>
+ <COND (<NOT <EQUAL? .PLACE ,MM-CREW-QTRS ,NW-CREW-QTRS>>
+ <MOVE ,GLOBAL-SURFACE ,PLACE>)>
+ <SETG LAST-S-O-T-PLACE .PLACE>
+ <REPEAT ()
+ <COND (<G? .CTR 44> <RETURN>)
+ (<==? <GET ,SHARED-OBJECT-TABLE <+ .CTR 1>> .PLACE>
+ <MOVE <GET ,SHARED-OBJECT-TABLE .CTR>
+ <GET ,SHARED-OBJECT-TABLE <+ .CTR 2>>>
+ <PUT ,SHARED-OBJECT-TABLE .CTR 0>
+ <PUT ,SHARED-OBJECT-TABLE <+ .CTR 1> 0>
+ <PUT ,SHARED-OBJECT-TABLE <+ .CTR 2> 0>)>
+ <SET CTR <+ .CTR 3>>>>
+
+<ROUTINE UNLOAD (OBJ "AUX" F N)
+ <COND (<SET F <FIRST? .OBJ>>
+ <SET N <NEXT? .F>>
+ <PUT-IN-TABLE .F ,LAST-S-O-T-PLACE .OBJ>
+ <REPEAT ()
+ <COND (<NOT .N> <RETURN>)>
+ <SET F .N>
+ <SET N <NEXT? .F>>
+ <PUT-IN-TABLE .F ,LAST-S-O-T-PLACE .OBJ>>)>>
+
+<ROUTINE PUT-IN-TABLE (OBJ RM SURF "AUX" (CTR 0))
+ <COND (<==? .OBJ ,PLAYER> <RFALSE>)>
+ <REPEAT ()
+ <COND (<G? .CTR 44> <RETURN>)
+ (<==? <GET ,SHARED-OBJECT-TABLE .CTR> 0>
+ <PUT ,SHARED-OBJECT-TABLE .CTR .OBJ>
+ <PUT ,SHARED-OBJECT-TABLE <+ .CTR 1> .RM>
+ <PUT ,SHARED-OBJECT-TABLE <+ .CTR 2> .SURF>
+ <MOVE .OBJ ,LOCAL-GLOBALS>
+ <RFALSE>)
+ (T <SET CTR <+ .CTR 3>>)>>
+ <TELL "[BUG: Too much on surfaces.]" CR>>
+
+<OBJECT GLOBAL-BANK
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM BANK TRUST)
+ (ADJECTIVE MARINE TRUST)
+ (DESC "bank")
+ (ACTION GLOBAL-BANK-F)>
+
+<ROUTINE GLOBAL-BANK-F ()
+ <COND (<EQUAL? ,HERE ,BANK>
+ <COND (<VERB? EXAMINE>
+ <PERFORM ,V?LOOK>
+ <SETG P-IT-OBJECT ,GLOBAL-BANK>
+ <RTRUE>)
+ (<VERB? ROB>
+ <ROBBERY-ENDING>)
+ (<VERB? DROP EXIT>
+ <DO-WALK ,P?OUT>
+ <RTRUE>)
+ (<VERB? MUNG>
+ <TELL "This isn't Monte Carlo." CR>
+ <RTRUE>)>)
+ (<EQUAL? ,HERE ,SHORE-ROAD-2>
+ <COND (<VERB? THROUGH>
+ <DO-WALK ,P?IN>
+ <RTRUE>)
+ (<VERB? EXAMINE>
+ <TELL
+"The " D ,BANK " is an imposing granite building." CR>
+ <RTRUE>)
+ (<VERB? ROB>
+ <COND (,BUSINESS-HOURS?
+ <ROBBERY-ENDING>)
+ (T <ROBBERY-ENDING <>>)>)>)
+ (<OR <AND <VERB? ASK-ABOUT>
+ <PRSI? ,GLOBAL-BANK>>
+ <AND <VERB? FIND WALK-TO>
+ <PRSO? ,GLOBAL-BANK>>>
+ <RFALSE>)
+ (T <GLOBAL-NOT-HERE-PRINT ,GLOBAL-BANK>)>>
+
+<ROUTINE ROBBERY-ENDING ("OPTIONAL" (INSIDE? T))
+ <COND (.INSIDE?
+ <TELL
+"The teller trips the alarm, and policemen come and drag you away.
+As you contemplate a stretch in prison, you consider that
+crime might not pay." CR>)
+ (T
+ <TELL
+"You don't realize your attempts have set off a silent alarm
+until the police arrive. At that point, you can only wonder if
+attempted robbery wasn't such a bright idea." CR>)>
+ <CRLF>
+ <FINISH>>
+
+<OBJECT GLOBAL-MONEY
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM MONEY CASH \$)
+ (DESC "money")
+ (ACTION GLOBAL-MONEY-F)>
+
+<ROUTINE GLOBAL-MONEY-F ()
+ <COND (<VERB? ASK-FOR ASK-ABOUT STEP WHAT FOLLOW>
+ <RFALSE>)
+ (<VERB? FIND>
+ <TELL-NOT-EASY>
+ <RTRUE>)
+ (<G? ,POCKET-CHANGE 0>
+ <COND (<OR <FSET? ,WET-SUIT ,WORNBIT>
+ <FSET? ,DEEP-SUIT ,WORNBIT>>
+ <TELL-CANT-REACH "it">)
+ (<VERB? COUNT>
+ <TELL "You are carrying $" N ,POCKET-CHANGE "." CR>)
+ (<VERB? EXAMINE>
+ <TELL "It looks a lot like $" N ,POCKET-CHANGE "." CR>)
+ (<NOT <VERB? TAKE>>
+ <TELL-FLASHING-CASH>)>)
+ (<EQUAL? ,HERE ,BANK>
+ <TELL
+"Not surprisingly, the money here is not easily accessible." CR>
+ <RTRUE>)
+ (T <GLOBAL-NOT-HERE-PRINT ,GLOBAL-MONEY>)>>
+
+<ROUTINE TELL-FLASHING-CASH ()
+ <TELL "Flashing your bankroll is not a good idea." CR>>
+
+<OBJECT FERRY-TOKEN
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM TOKEN)
+ (ADJECTIVE FERRY)
+ (DESC "ferry token")
+ (ACTION FERRY-TOKEN-F)>
+
+<ROUTINE FERRY-TOKEN-F ()
+ <COND (<AND <IN? ,SPEAR-CARRIER ,HERE>
+ <OR <AND <VERB? ASK-ABOUT ASK-FOR>
+ <PRSO? ,SPEAR-CARRIER>>
+ <VERB? BUY>>>
+ <NO-TOKENS ,HERE>)
+ (<AND <VERB? ASK-ABOUT>
+ <FSET? ,PRSO ,PERSON>>
+ <TELL "\"You need them for the ferry.\"" CR>)
+ (<VERB? FIND ASK-FOR>
+ <RFALSE>)
+ (T <GLOBAL-NOT-HERE-PRINT ,FERRY-TOKEN>)>>
+
+<ROUTINE NO-TOKENS (PLACE)
+ <COND (<==? .PLACE ,BANK>
+ <TELL
+"The teller says, \"We're out. Try Outfitters.\"">)
+ (T <TELL
+"The " D ,SPEAR-CARRIER " checks and then says, \"I'm afraid we're
+out of tokens. Try " D ,BANK ".\"">)>
+ <CRLF>
+ <RTRUE>>
+
+<OBJECT GLOBAL-TIME
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM TIME)
+ (ADJECTIVE CORREC)
+ (DESC "time")
+ (FLAGS NDESCBIT)
+ (ACTION GLOBAL-TIME-F)>
+
+<ROUTINE GLOBAL-TIME-F ()
+ <COND (<VERB? ASK-FOR ASK-ABOUT>
+ <COND (<PRSO? ,SPEAR-CARRIER>
+ <TELL "The " D ,PRSO " checks and tells you it's ">
+ <TIME-PRINT ,PRESENT-TIME>
+ <CRLF>)
+ (<FSET? ,PRSO ,PERSON>
+ <TELL "\"I'm not sure.\"" CR>)>)
+ (<AND <VERB? TELL>
+ <PRSO? ,GLOBAL-TIME>
+ <NOT ,PRSI>>
+ <TELL
+"Didn't you learn that the little hand points to the hour and the big hand
+points to the minute?" CR>)
+ (<VERB? EXAMINE>
+ <PERFORM ,V?TIME>
+ <SETG P-IT-OBJECT ,GLOBAL-TIME>
+ <RTRUE>)
+ (<AND <VERB? TELL>
+ <FSET? ,PRSO ,VICBIT>
+ <NOT <PRSO? ,ME>>>
+ <RFALSE>)
+ (T <TELL "If you want to know the time, check your watch." CR>)>>
+
+<OBJECT GLOBAL-DAY ;"installed under protest"
+ (IN GLOBAL-OBJECTS)
+ (DESC "day")
+ (SYNONYM DAY)
+ (ACTION GLOBAL-DAY-F)>
+
+<ROUTINE GLOBAL-DAY-F ()
+ <COND (<OR <AND <VERB? ASK-FOR ASK-ABOUT>
+ <FSET? ,PRSO ,VICBIT>>
+ <AND <VERB? WHAT>
+ <NOT <==? ,WINNER ,PLAYER>>>>
+ <TELL "\"Wednesday.\"" CR>)
+ (<VERB? WHAT> ;"waste of valuable space"
+ <TELL "Ask somebody." CR>)
+ (T <TELL-SERIOUS>)>>
+
+<ROUTINE TELL-SERIOUS ()
+ <TELL "Be serious." CR>>
+
+<OBJECT ADVENTURER
+ (IN BEDROOM)
+ (SYNONYM PLAYER ADVENT CRETIN)
+ (DESC "cretin")
+ (CHARACTER 0)
+ (FLAGS PERSON VICBIT NDESCBIT INVISIBLE)
+ (ACTION ADVENTURER-F)>
+
+<ROUTINE ADVENTURER-F ()
+ <COND (<G? ,BLOOD-ALCOHOL 25>
+ <JIGS-UP
+"You pass out and never find that you've been mugged, rolled and killed.">)
+ (<OR <G? ,HOW-THIRSTY 3>
+ <G? ,BLOOD-ALCOHOL 15>
+ <G? ,HOW-HUNGRY 3>
+ <==? ,HOW-TIRED 6>
+ <==? ,P-ADVERB ,W?SLOWLY>>
+ <COND (<OR <VERB? SLEEP WAIT>
+ <AND <VERB? TELL> <NOT ,PRSI>>
+ <GAME-COMMAND?>
+ ,WAITED?>
+ <SETG WAITED? 2>
+ <COND (<VERB? WALK> T)
+ (<AND ,PRSO
+ <NOT <==? <META-LOC ,PRSO> ,HERE>>
+ <NOT <IN? ,PRSO ,GLOBAL-OBJECTS>>>
+ <SETG PRSO ,NOT-HERE-OBJECT>)
+ (<AND ,PRSI
+ <NOT <==? <META-LOC ,PRSI> ,HERE>>
+ <NOT <IN? ,PRSI ,GLOBAL-OBJECTS>>>
+ <SETG PRSI ,NOT-HERE-OBJECT>)>
+ <COND (<EQUAL? ,NOT-HERE-OBJECT ,PRSO ,PRSI>
+ <RETURN <NOT-HERE-OBJECT-F>>)
+ (T <RFALSE>)>)
+ (T
+ <SETG WAITED? 1>
+ <COND (<EQUAL? <CLOCKER> ,M-FATAL>
+ <SETG CLOCK-WAIT T>
+ <TELL "This interrupts what you're trying to do." CR>
+ <RFATAL>)
+ (<VERB? WALK>
+ <COND (<AND <NOT <IN? ,PLAYER ,UNDERWATER>>
+ <IN? ,PLAYER ,HERE>>
+ <COND (<G? ,BLOOD-ALCOHOL 15>
+ <TELL-YOURE-NOT
+"quite sure which direction is which...">
+ <CRLF>
+ <RANDOM-WALK>)
+ (<PROB 40>
+ <TELL
+"You stop to sit down for a bit and then struggle back to your feet." CR>
+ <RFATAL>)>)>)>)>)
+ (<AND <FSET? ,FLIPPERS ,WORNBIT>
+ <VERB? WALK>
+ <NOT ,AT-SEA>
+ <OR <L? <GETP ,HERE ,P?LINE> ,TRAWLER-LINE-C>
+ <AND <==? ,HERE ,MM-PORT-DECK>
+ <==? ,P-WALK-DIR ,P?WEST>>
+ <AND <==? ,HERE ,NW-STARBOARD-DECK>
+ <==? ,P-WALK-DIR ,P?EAST>>>>
+ <TELL "You'd look silly walking around in flippers." CR>)>>
+
+<GLOBAL WAITED? <>>
+
+<ROUTINE RANDOM-WALK ("AUX" P Z L S (D <>))
+ <SET P 0>
+ <REPEAT ()
+ <COND (<L? <SET P <NEXTP ,HERE .P>> ,LOW-DIRECTION>
+ <COND (.D
+ <DO-WALK .D>)>
+ <RETURN>)
+ (T
+ <SET Z <GETPT ,HERE .P>>
+ <SET L <PTSIZE .Z>>
+ <COND (<OR <EQUAL? .L ,UEXIT>
+ <AND <EQUAL? .L ,CEXIT>
+ <VALUE <GETB .Z ,CEXITFLAG>>>
+ <AND <EQUAL? .L ,DEXIT>
+ <FSET? <GETB .Z ,DEXITOBJ> ,OPENBIT>>>
+ <COND (<NOT .D> <SET D .P>)
+ (<PROB 50> <SET D .P>)>)>)>>>
+
+<ROUTINE DETECTOR-NOISE ("OPTIONAL" (LISTENING? <>) "AUX" C H P Z L R
+ (LAST-R <>))
+ <SET H <META-LOC ,PLAYER>>
+ <COND (<AND <NOT .LISTENING?>
+ <VERB? LISTEN>
+ <PRSO? ,METAL-DETECTOR>>
+ <RFALSE>)
+ (<AND <==? <META-LOC ,METAL-DETECTOR> .H>
+ ,DETECTOR-ON
+ ,DETECTOR-POWERED>
+ <SET C <+ <COUNT-METAL .H> <GETP .H ,P?DESCFCN>>>
+ <SET P 0>
+ <REPEAT ()
+ <COND (<0? <SET P <NEXTP .H .P>>>
+ <RETURN>)
+ (<NOT <L? .P ,LOW-DIRECTION>>
+ <SET Z <GETPT .H .P>>
+ <SET L <PTSIZE .Z>>
+ <COND (<EQUAL? .L ,UEXIT ,CEXIT ,DEXIT>
+ <SET R <GETB .Z 0>>
+ <COND (<NOT <==? .R .LAST-R>>
+ <SET C <+ .C </ <COUNT-METAL .R> 2>
+ </ <GETP .R ,P?DESCFCN> 2>>>
+ <SET LAST-R .R>)>)
+ (<EQUAL? .L ,FEXIT>
+ <SET R <APPLY <GET .Z 0> <>>>
+ <COND (<AND .R <NOT <==? .R .LAST-R>>>
+ <SET C <+
+ .C
+ </ <COUNT-METAL .R> 2>
+ </ <GETP .R ,P?DESCFCN> 2>
+ >>
+ <SET LAST-R .R>)>)>)>>
+ <COND (<EQUAL? .C 0>
+ <COND (.LISTENING?
+ <TELL
+"The " D ,METAL-DETECTOR " makes no noise." CR>
+ <RTRUE>)
+ (T <RFALSE>)>)>
+ <TELL "The " D ,METAL-DETECTOR " is clicking ">
+ <COND (<G? .C 100>
+ <TELL "extremely fast">)
+ (<G? .C 75>
+ <TELL "quickly">)
+ (<G? .C 50>
+ <TELL "moderately">)
+ (<G? .C 25>
+ <TELL "slowly">)
+ (T <TELL "occasionally">)>
+ <TELL "." CR>)
+ (.LISTENING?
+ <TELL "The " D ,METAL-DETECTOR " makes no noise." CR>)>>
+
+<ROUTINE COUNT-METAL (R "AUX" F (V 0))
+ <SET F <FIRST? .R>>
+ <REPEAT ()
+ <COND (<NOT .F> <RETURN .V>)
+ (<OR <NOT <FSET? .F ,INVISIBLE>>
+ <EQUAL? .F ,PLAYER>>
+ <SET V <+ .V <GETP .F ,P?STATION>>>
+ <COND (<FIRST? .F>
+ <SET V <+ .V <COUNT-METAL .F>>>)>)>
+ <SET F <NEXT? .F>>>>
+
+<OBJECT ME
+ (IN GLOBAL-OBJECTS)
+ (SYNONYM ME MYSELF)
+ (DESC "you")
+ (FLAGS PERSON VICBIT)
+ (ACTION CRETIN-F)>
+
+<ROUTINE CRETIN-F ()
+ <COND (<NOT <EQUAL? ,PRSO ,WINNER ,ME>>
+ <RFALSE>)>
+ <COND (<VERB? EAT>
+ <TELL "Stick to stew." CR>)
+ (<VERB? DRINK>
+ <TELL "Stick to grog." CR>)
+ (<VERB? ALARM>
+ <TELL "Good morning!" CR>)
+ (<VERB? MUNG ATTACK KILL>
+ <TELL
+"Although it's not hard, I can't make it that simple." CR>)
+ (<VERB? FIND>
+ <TELL "Have you tried asking the parrot?" CR>)
+ (<OR <VERB? TAKE LAMP-ON>
+ <AND <VERB? GIVE> <PRSO? ,ME>>>
+ <TELL "You romantic fool!" CR>)
+ (<VERB? EXAMINE>
+ <TELL "You look like a diver." CR>)
+ ;(<VERB? LOOK-INSIDE>
+ <TELL "I'm a computer, not a doctor!" CR>)
+ (<VERB? LOOK-UNDER>
+ <TELL
+"I think the center of the earth is down there somewhere." CR>)
+ (<VERB? RUB>
+ <TELL "You're starting to rub me the wrong way." CR>)
+ (<VERB? PLAY>
+ <TELL "Don't expect an Oscar." CR>)
+ (<VERB? CLIMB-ON BOARD THROUGH>
+ <TELL "I'm not impressed." CR>)
+ ;(<VERB? CLOSE>
+ <TELL
+"I've heard of zipping one's lip..." CR>)
+ (<VERB? CROSS SHAKE>
+ <TELL "I'm much too kind." CR>)
+ ;(<VERB? DISEMBARK>
+ <TELL "What makes you think you deserve it?" CR>)
+ (<VERB? DROP>
+ <TELL "Like a hot potato." CR>)
+ ;(<VERB? LEAN-ON OPEN>
+ <TELL "I think you've got enough troubles." CR>)
+ (<VERB? FOLLOW>
+ <TELL "What makes you think you know where you're going?" CR>)
+ ;(<VERB? LISTEN>
+ <TELL "Huh? Did you say something?" CR>)
+ (<VERB? SEARCH>
+ <TELL "Okay. I found one empty head but a strong heart." CR>)
+ ;(<VERB? MAKE>
+ <TELL "What an attitude!" CR>)
+ (<VERB? SMELL PUSH>
+ <TELL "I'd rather not." CR>)
+ (<VERB? THROW>
+ <TELL "For a loop?" CR>)
+ ;(<VERB? WEAR>
+ <TELL "Consider " D ,GLOBAL-SELF " worn. Happy?" CR>)
+ (<VERB? ROB>
+ <TELL "You wouldn't get much from anyone that stupid." CR>)
+ (T
+ <RFALSE>)>
+ <RTRUE>>
+
+<OBJECT GLOBAL-SELF
+ (IN GLOBAL-OBJECTS)
+ (DESC "yourself")
+ (SYNONYM SELF YOURSE)
+ (FLAGS VICBIT)
+ (ACTION GLOBAL-SELF-F)>
+
+<ROUTINE GLOBAL-SELF-F ()
+ <COND (<==? ,WINNER ,PLAYER>
+ <COND (<PRSI? ,GLOBAL-SELF>
+ <SETG PRSI ,ME>)>
+ <COND (<PRSO? ,GLOBAL-SELF>
+ <SETG PRSO ,ME>)>)>
+ <PERFORM ,PRSA ,PRSO ,PRSI>
+ <RTRUE>>
+
+<OBJECT GLOBAL-ROOM
+ (IN GLOBAL-OBJECTS)
+ (DESC "room")
+ (SYNONYM ROOM CABIN)
+ (ACTION GLOBAL-ROOM-F)>
+
+<ROUTINE GLOBAL-ROOM-F ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "room">)
+ (<VERB? EXAMINE>
+ <PERFORM ,V?LOOK>
+ <SETG P-IT-OBJECT ,GLOBAL-ROOM>
+ <RTRUE>)
+ (<VERB? DROP EXIT DISEMBARK>
+ <DO-WALK ,P?OUT>
+ <RTRUE>)
+ (<VERB? ENTER THROUGH>
+ <DO-WALK ,P?IN>
+ <RTRUE>)
+ (<VERB? MUNG ATTACK>
+ <TELL "It's sturdier than you give it credit for." CR>
+ <RTRUE>)
+ (<VERB? UNLOCK>
+ <TELL "Please be more specific about what you want to unlock." CR>)
+ (<VERB? PUT>
+ <PERFORM ,V?DROP ,PRSO>
+ <RTRUE>)>>
+
+;<OBJECT DOORWAY
+ (IN LOCAL-GLOBALS)
+ (FLAGS NDESCBIT CONTBIT OPENBIT)
+ (DESC "doorway")
+ (SYNONYM DOORWAY OPENIN)
+ (ADJECTIVE ARCHED TIMBER)
+ ;(ACTION DOORWAY-FCN)>
+
+;<ROUTINE DOORWAY-FCN ()
+ <COND (<VERB? EXAMINE LOOK-INSIDE>
+ <COND (<AND <EQUAL? ,HERE ,NORTH-ANTECHAMBER ,BURIAL-CHAMBER>
+ <EQUAL? ,BEAM-PLACED 4>>
+ <TELL
+"The mast is in the doorway, running from top to bottom." CR>
+ <RTRUE>)
+ (<AND <EQUAL? ,HERE ,SOUTH-ANTECHAMBER ,ANNEX>
+ <EQUAL? ,BEAM-PLACED 2 3>>
+ <TELL
+"The beam is wedged in the doorway from side to side." CR>
+ <RTRUE>)>)>>
+
+<OBJECT WINDOW
+ (IN LOCAL-GLOBALS)
+ (DESC "window")
+ (SYNONYM WINDOW)
+ (FLAGS TRANSBIT)
+ (ACTION WINDOW-F)>
+
+<ROUTINE WINDOW-F ()
+ <COND (<EQUAL? ,HERE ,BEDROOM>
+ <COND (<VERB? LOOK-INSIDE>
+ <TELL
+"You see an " D ,FIELD " beyond the alley where the terrible events of last
+night transpired." CR>)
+ (<VERB? OPEN CLOSE>
+ <TELL "It's stuck shut." CR>)>)
+ (<EQUAL? ,HERE ,BANK>
+ <COND (<VERB? EXAMINE>
+ <TELL
+"It is a barred window about chest-high behind which the teller transacts his
+business." CR>)
+ (<VERB? LOOK-INSIDE LOOK-BEHIND>
+ <TELL "There is a teller there." CR>)>)
+ (<EQUAL? ,HERE ,MM-WHEELHOUSE ,NW-WHEELHOUSE>
+ <COND (<VERB? LOOK-INSIDE>
+ <TELL "You can see the ocean beyond the deck." CR>)>)>>
+
+<OBJECT IN-WINDOW
+ (IN LOCAL-GLOBALS)
+ (DESC "window")
+ (SYNONYM WINDOW)
+ (FLAGS TRANSBIT)
+ (ACTION IN-WINDOW-F)>
+
+<ROUTINE IN-WINDOW-F ("AUX" L)
+ <COND (<VERB? LOOK-INSIDE>
+ <TELL "You see ">
+ <COND (<AND <EQUAL? <SET L <LOC ,JOHNNY>> ,MM-WHEELHOUSE
+ ,NW-WHEELHOUSE>
+ <==? <GETP ,HERE ,P?LINE> <GETP .L ,P?LINE>>>
+ <TELL "Johnny in ">)>
+ <TELL "the wheelhouse." CR>)>>
+
+<OBJECT BEDROOM-DOOR
+ (IN LOCAL-GLOBALS)
+ (DESC "bedroom door")
+ (SYNONYM DOOR)
+ (ADJECTIVE BEDROOM MY ROOM)
+ (FLAGS NDESCBIT DOORBIT)
+ (ACTION BEDROOM-DOOR-F)>
+
+<ROUTINE BEDROOM-DOOR-F ()
+ <COND (<VERB? OPEN>
+ <COND (<FSET? ,BEDROOM-DOOR ,OPENBIT>
+ <TELL-ALREADY "open">
+ <RTRUE>)
+ (<AND <EQUAL? ,HERE ,UPSTAIRS-HALLWAY>
+ ,BEDROOM-DOOR-LOCKED>
+ <TELL "It's locked." CR>
+ <RTRUE>)
+ (T
+ <FSET ,BEDROOM-DOOR ,OPENBIT>
+ <SETG BEDROOM-DOOR-LOCKED <>>
+ <COND (<IN? ,WEASEL ,UPSTAIRS-HALLWAY>
+ <TELL
+"You open the door and see " D ,WEASEL ". He says,
+\"Oh. Hi. I was just wonderin' if you were gonna be at the meetin'
+at " D ,SHANTY ".\" He turns and heads down the steps." CR>
+ <ESTABLISH-GOAL ,WEASEL ,SHANTY>
+ <DISABLE <INT I-WEASEL-TO-BEDROOM>>)
+ (T <TELL-NOW ,BEDROOM-DOOR "open">)>
+ <RTRUE>)>)
+ (<VERB? CLOSE>
+ <COND (<NOT <FSET? ,BEDROOM-DOOR ,OPENBIT>>
+ <TELL-ALREADY "closed">
+ <RTRUE>)
+ (T
+ <FCLEAR ,BEDROOM-DOOR ,OPENBIT>
+ <TELL-NOW ,BEDROOM-DOOR "closed">
+ <RTRUE>)>)
+ (<VERB? UNLOCK>
+ <COND (,BEDROOM-DOOR-LOCKED
+ <COND (<OR <IN? ,PLAYER ,BEDROOM>
+ <PRSI? ,KEY>>
+ <SETG BEDROOM-DOOR-LOCKED <>>
+ <TELL-NOW ,BEDROOM-DOOR "unlocked">)
+ (,PRSI
+ <TELL-YOU-CANT "unlock it with that!">)
+ (T <TELL "Not without the key." CR>)>)
+ (T <TELL-ALREADY "unlocked">)>)>>
+
+<OBJECT OCEAN
+ (IN LOCAL-GLOBALS)
+ (SYNONYM WATER OCEAN SEA WAVES)
+ (ADJECTIVE BRINE SEA OCEAN)
+ (DESC "ocean")
+ (FLAGS OPENBIT DRINKBIT VOWELBIT)
+ (ACTION OCEAN-F)>
+
+<ROUTINE OCEAN-F ("AUX" L)
+ <COND (<AIRTIGHT-ROOM?>
+ <TELL "There's no water in here." CR>)
+ (<VERB? EXAMINE>
+ <COND (<EQUAL? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <TELL "There is water all around you." CR>)
+ (T
+ <TELL "The ocean looks choppy">
+ <COND (,AT-SEA
+ <TELL ". Whitecaps rise and fall around the boat.">)
+ (T <TELL
+", and you know about the dangerous currents here.">)>
+ <CRLF>)>)
+ (<VERB? LISTEN>
+ <TELL "You hear the crashing of the waves." CR>)
+ (<VERB? BOARD THROUGH SWIM>
+ <COND (<EQUAL? <SET L <GETP ,HERE ,P?LINE>> ,UNDERWATER-LINE-C>
+ <TELL "You're already in it!" CR>)
+ (<OR <EQUAL? .L ,TRAWLER-LINE-C ,SALVAGER-LINE-C>
+ <EQUAL? ,HERE ,WHARF ,FERRY-LANDING>>
+ <COND (,AT-SEA
+ <PERFORM ,V?DIVE>
+ <RTRUE>)
+ (T
+ <JIGS-UP
+"The currents pull you in several conflicting directions, and you end up
+much the worse for it.">)>)
+ (T <TELL-NO-SHORELINE>)>)
+ (<AND <VERB? DROP THROW>
+ <PRSI? ,OCEAN>>
+ <COND (<==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <PERFORM ,V?DROP ,PRSO>
+ <RTRUE>)
+ (T <TELL-NO-LITTER>)>)
+ (<VERB? SMELL>
+ <TELL
+"It smells very salty, which is what you might expect from the sea." CR>)
+ (<VERB? DRINK TASTE>
+ <COND (<OR <G? <GETP ,HERE ,P?LINE> ,BACK-ALLEY-LINE-C>
+ <EQUAL? ,HERE ,FERRY-LANDING ,WHARF>>
+ <TELL "Bleahhhh! You spit it out immediately!" CR>)
+ (T <TELL-NO-SHORELINE>)>)
+ (<VERB? RUB>
+ <COND (<OR <G? <GETP ,HERE ,P?LINE> ,BACK-ALLEY-LINE-C>
+ <EQUAL? ,HERE ,FERRY-LANDING ,WHARF>>
+ <TELL "It's wet." CR>)
+ (T <TELL-NO-SHORELINE>)>)>>
+
+<ROUTINE TELL-NO-SHORELINE ()
+ <TELL-YOU-CANT "make your way to the shoreline.">>
+
+<ROUTINE TELL-NO-LITTER ()
+ <TELL "It would spoil the beauty of the sea." CR>>
+
+<OBJECT STAIRS
+ (IN LOCAL-GLOBALS)
+ (SYNONYM STAIRS STEPS STAIRW)
+ (DESC "stairs")
+ ;(FLAGS NDESCBIT CLIMBBIT TOUCHBIT)
+ (ACTION STAIRS-F)>
+
+<ROUTINE STAIRS-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The carpeted stairway leads ">
+ <COND (<EQUAL? ,HERE ,UPSTAIRS-HALLWAY>
+ <TELL "down">)
+ (<EQUAL? ,HERE ,RED-BOAR-INN>
+ <TELL "up">)>
+ <TELL "." CR>)
+ (<VERB? CLIMB-FOO>
+ <COND (<EQUAL? ,HERE ,UPSTAIRS-HALLWAY>
+ <V-CLIMB-UP ,P?DOWN>)
+ (T <V-CLIMB-UP>)>
+ <RTRUE>)>>
+
+<OBJECT LADDER-TOP
+ (IN LOCAL-GLOBALS)
+ (DESC "ladder top")
+ (SYNONYM LADDER TOP)
+ (ADJECTIVE LADDER TOP)
+ (TEXT "It's the top of a ladder that leads down.")
+ (ACTION LADDER-TOP-F)>
+
+<ROUTINE LADDER-TOP-F ()
+ <COND (<VERB? CLIMB-FOO>
+ <DO-WALK ,P?DOWN>
+ <RTRUE>)>>
+
+<OBJECT LADDER-BOTTOM
+ (IN LOCAL-GLOBALS)
+ (DESC "ladder bottom")
+ (SYNONYM LADDER BOTTOM)
+ (ADJECTIVE LADDER BOTTOM)
+ (TEXT "It's the bottom of a ladder that leads up.")
+ (ACTION LADDER-BOTTOM-F)>
+
+<ROUTINE LADDER-BOTTOM-F ()
+ <COND (<VERB? CLIMB-FOO>
+ <DO-WALK ,P?UP>
+ <RTRUE>)>>
+
+<OBJECT RAILING
+ (IN LOCAL-GLOBALS)
+ (DESC "railing")
+ (SYNONYM RAILIN RAIL)
+ (ADJECTIVE METAL STURDY)
+ (TEXT "The sturdy metal railing encircles the deck.")
+ (ACTION RAILING-F)>
+
+<ROUTINE RAILING-F ()
+ <COND (<VERB? CLIMB-FOO>
+ <TELL "You immediately climb back down." CR>)
+ (<VERB? DISEMBARK LEAP>
+ <PERFORM ,V?DIVE>
+ <RTRUE>)>>
+
+<OBJECT BUNKS
+ (IN LOCAL-GLOBALS)
+ (DESC "collection of decrepit bunks")
+ (SYNONYM BUNK BUNKS COLLEC BEDS)
+ (ADJECTIVE OLD DECREP ROTTIN ROTTEN)
+ (ACTION BUNKS-F)>
+
+<ROUTINE BUNKS-F ()
+ <COND (<VERB? BOARD SLEEP>
+ <TELL-BAD-SHAPE>)
+ (<VERB? EXAMINE>
+ <TELL
+"These stacks of bunks look as though they were never comfortable.
+The work of time and the sea have made them fairly
+decrepit, incapable of supporting much weight." CR>)
+ (<VERB? MUNG>
+ <TELL
+"Some pieces fall away, but the structure holds together." CR>)>>
+
+<ROUTINE TELL-BAD-SHAPE ()
+ <TELL "They don't look as if they could support your weight." CR>>
+
+<ROUTINE TIME-PRINT (NUM "AUX" HR (PM <>))
+ <COND (<G? <SET HR </ .NUM 60>> 12>
+ <SET HR <- .HR 12>>
+ <SET PM T>)
+ (<==? .HR 12> <SET PM T>)
+ (<==? .HR 0> <SET HR 12>)>
+ <PRINTN .HR>
+ <TELL ":">
+ <COND (<L? <SET HR <MOD .NUM 60>> 10>
+ <TELL "0">)>
+ <TELL N .HR " ">
+ <TELL <COND (.PM "p.m.") (T "a.m.")>>>
+
+;"GLOBAL VARIABLES"
+
+<GLOBAL HERE <>>
+
+<GLOBAL LOAD-ALLOWED 100>
+
+;<GLOBAL LOAD-MAX 0>
+
+<GLOBAL LIT T>
+
+;<GLOBAL DEBUG <>>
+
+<GLOBAL WATCH-SCORE 8>
+
+<GLOBAL WATCH-MOVES 0>
+
+<GLOBAL SCORE 8> ;"This is actually HOURS; STATUS-LINE stuff looks for SCORE.
+ Normal SCORE is RATING here; initialized in VERBS."
+
+<GLOBAL MOVES 0> ;"This is actually minutes. Moves themselves aren't counted."
+
+<GLOBAL PRESENT-TIME 480>
+
+<GLOBAL WATCH-WOUND T>
+
+<GLOBAL SET-HR 0>
+
+<GLOBAL SET-MIN 60>
+
+<GLOBAL DELIVERY-TABLE <TABLE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>>
+
+<GLOBAL DT-PTR 0>
+
+<GLOBAL QCONTEXT <>>
+
+<GLOBAL QCONTEXT-ROOM <>>
+
+<GLOBAL BEDROOM-MESSAGE <>>
+
+<GLOBAL MEETINGS-COMPLETED 0>
+
+<GLOBAL DETECTOR-POWERED <>>
+
+<GLOBAL DETECTOR-ON <>>
+
+<GLOBAL SOUPS-ON <>>
+
+<GLOBAL HOW-TIRED 1>
+
+<GLOBAL HOW-HUNGRY 1>
+
+<GLOBAL WRECK-FOUND 0>
+
+<GLOBAL WEASEL-PISSED <>>
+
+;<GLOBAL INDENTS
+ <TABLE ""
+ " "
+ " "
+ " "
+ " "
+ " ">>
+
+;"******************************************
+ Here come the pseudos
+********************************************"
+
+<ROUTINE TABLE-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "table">)
+ (<VERB? EXAMINE>
+ <TELL
+"The table has a variety of forms and brochures you find boring." CR>)
+ (<AND <VERB? PUT PUT-ON>
+ <PRSI? ,PSEUDO-OBJECT>>
+ <TELL
+"A bank official scurries out, picks up the " D ,PRSO ", and hands it
+to you, pointing out that the table is for bank business only." CR>
+ <RTRUE>)>>
+
+<ROUTINE LIGHTHOUSE-LOCK-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "lock">)
+ (<VERB? PICK>
+ <TELL "You try for a while, but the lock won't give." CR>
+ <RTRUE>)
+ (<VERB? UNLOCK>
+ <TELL-NO-KEY>
+ <RTRUE>)
+ (<VERB? MUNG>
+ <TELL
+"You find that the door and lock withstand your attempts." CR>
+ <RTRUE>)
+ (<VERB? LOCK>
+ <TELL-ALREADY "locked">
+ <RTRUE>)>>
+
+<ROUTINE WHEEL-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "wheel">)
+ (<VERB? TURN SPIN>
+ <COND (<IN? ,JOHNNY ,HERE>
+ <TELL
+D ,JOHNNY " glares at you. You decide to leave the piloting to the captain."
+CR>)
+ (T <TELL "The wheel spins." CR>)>)>>
+
+<ROUTINE BOLT-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "bolts">)
+ (T <TELL
+"The bolts are rusted firmly into place." CR>)>>
+
+;"Parser-related stuff"
+
+<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? <>>)>
+ <COND (.PRSO?
+ <COND (<VERB? ASK-CONTEXT-ABOUT ASK-CONTEXT-FOR CLIMB-UP
+ EXAMINE FIND FOLLOW WAIT-FOR
+ ;LOOK-INSIDE ;LOOK-OUTSIDE ;SEARCH WHAT
+ $CALL GIVE MAKE THROUGH WALK-TO ;TELL>
+ <COND (<SET OBJ <FIND-NOT-HERE .TBL .PRSO?>>
+ <COND (<NOT <==? .OBJ ,NOT-HERE-OBJECT>>
+ <RTRUE>)>)
+ (T
+ <RFALSE>)>)>)
+ (T
+ <COND (<VERB? ASK-ABOUT ASK-FOR
+ ;SEARCH-OBJECT-FOR SGIVE TELL>
+ <COND (<SET OBJ <FIND-NOT-HERE .TBL .PRSO?>>
+ <COND (<NOT <==? .OBJ ,NOT-HERE-OBJECT>>
+ <RTRUE>)>)
+ (T
+ <RFALSE>)>)>)>
+ ;"Here is the default 'cant see any' printer"
+ <COND (<VERB? $CALL>
+ <V-CALL-LOSE>
+ <SETG CLOCK-WAIT <>>)
+ (<EQUAL? ,WINNER ,ADVENTURER>
+ <TELL-YOU-CANT "see any" <>>
+ <NOT-HERE-PRINT .PRSO?>
+ <TELL " here." CR>)
+ (T
+ <START-SENTENCE ,WINNER>
+ <TELL " seems confused. \"I don't see any">
+ <NOT-HERE-PRINT .PRSO?>
+ <TELL " here!\"" CR>)>
+ <SETG P-MOBY-FOUND <>>
+ <SETG PRSA <>>
+ <SETG PRSO <>>
+ <SETG PRSI <>>
+ <RFATAL>>
+
+<ROUTINE FIND-NOT-HERE (TBL PRSO? "AUX" M-F OBJ CTR PER)
+ ;"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 (i.e.
+ come up with one object)."
+ <SET M-F <MOBY-FIND .TBL>>
+ <COND (<AND <G? .M-F 1>
+ <SET OBJ <GETP <1 .TBL> ,P?GLOBAL>>>
+ <SET M-F 1>
+ <SETG P-MOBY-FOUND .OBJ>)>
+ ;<COND (<AND ,DEBUG
+ <G? .M-F 0>>
+ <TELL "[MOBY-FOUND " N .M-F "; to wit:">
+ <SET CTR 1>
+ <REPEAT ()
+ <COND (<G? .CTR .M-F>
+ <TELL "]" CR>
+ <RETURN>)>
+ <TELL " " D <GET .TBL .CTR>>
+ <SET CTR <+ .CTR 1>>
+ <COND (<L? .CTR .M-F> <TELL ",">)>>)
+ (,DEBUG <TELL "[Nothing MOBY-FOUND.]" CR>)>
+ <COND (<==? 1 .M-F>
+ <COND (.PRSO?
+ <COND (<AND <VERB? TELL>
+ <==? ,WINNER ,PLAYER>
+ <FSET? ,P-MOBY-FOUND ,VICBIT>>
+ <SETG P-CONT <>>
+ <TELL-NOT-HERE-TALK>
+ <RTRUE>)
+ (<VERB? EXAMINE>
+ <COND (<AND <FSET? ,P-MOBY-FOUND ,PERSON>
+ <NOT <0? <BAND <GETP <META-LOC ,PLAYER>
+ ,P?CORRIDOR>
+ <GETP <LOC ,P-MOBY-FOUND>
+ ,P?CORRIDOR>>>>>
+ <TELL
+"You can see " D ,P-MOBY-FOUND " in the distance." CR>)
+ (<AND <PRSO? ,MCGINTY>
+ <IN? ,PLAYER ,BACK-ALLEY-2>
+ <IN? ,MCGINTY ,MCGINTY-HQ>>
+ <TELL
+"Looking through the window, you see " D ,MCGINTY " in his office." CR>)
+ (T
+ <GLOBAL-NOT-HERE-PRINT ,PRSO>)>
+ <RTRUE>)
+ (T <SETG PRSO ,P-MOBY-FOUND>)>)
+ (T <SETG PRSI ,P-MOBY-FOUND>)>
+ <COND (<AND ,P-XADJ <NOT ,P-XNAM>> <SETG P-NONOUN T>)
+ (T <SETG P-NONOUN <>>)>
+ <RFALSE>)
+ (<NOT .PRSO?>
+ <COND (<OR <VERB? ASK-ABOUT>
+ <AND <VERB? TELL>
+ <PRSO? ,ME>>>
+ <COND (<PRSO? ,ME>
+ <COND (<AND <==? ,WINNER ,PLAYER>
+ ,QCONTEXT
+ <==? ,HERE ,QCONTEXT-ROOM>>
+ <SET PER ,QCONTEXT>)
+ (T <SET PER ,WINNER>)>)
+ (T <SET PER ,PRSO>)>
+ <COND (<FSET? .PER ,VICBIT>
+ <SAY-CONFUSED .PER .PRSO?>)
+ (T <SUDDENLY-REALIZE-TALKING .PER>
+ ;<TELL
+"You realize you're talking to " A ,PRSO "." CR>)>
+ <RTRUE>)
+ (<FSET? ,PRSO ,VICBIT>
+ <SAY-CONFUSED ,PRSO .PRSO?>)
+ (T
+ <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>>)
+ (T
+ <TELL-YOU-CANT "see any" <>>
+ <COND (<EQUAL? .OBJ ,PRSO> <PRSO-PRINT>)
+ (T <PRSI-PRINT>)>
+ <TELL " here." CR>)>
+ <SETG P-WON <>>
+ <RTRUE>>
+
+<ROUTINE SAY-CONFUSED (PER PRSO?)
+ <START-SENTENCE .PER>
+ <TELL " looks confused. \"I have no idea what">
+ <NOT-HERE-PRINT .PRSO?>
+ <TELL " you're talking about!\"" 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> <>>)>
+ <SETG P-WON <>>>
+
+<ROUTINE TELL-YOU-CANT (STR "OPTIONAL" (FINISH T))
+ <TELL "You can't " .STR>
+ <COND (.FINISH <CRLF>)>>
+
+<ROUTINE TELL-ROPE-HIGH ()
+ <TELL-CANT-REACH "the rope">>
+
+<ROUTINE TELL-CANT-REACH (STR)
+ <TELL-YOU-CANT "reach " <>>
+ <TELL .STR "." CR>>
+
+<ROUTINE TELL-NO-GO (PRINT?)
+ <COND (.PRINT? <TELL-YOU-CANT "go that way.">)>>
+
+<ROUTINE TELL-NO-NO ()
+ <TELL-YOU-CANT "do that.">>
+
+<ROUTINE TELL-NO-AFFORD ()
+ <TELL-YOU-CANT "afford it.">>
+
+<ROUTINE TELL-TOO-BIG ()
+ <TELL-YOU-CANT "fit through the hole carrying the tank.">>
diff --git a/goal.zap b/goal.zap
new file mode 100644
index 0000000..495b08a
--- /dev/null
+++ b/goal.zap
@@ -0,0 +1,528 @@
+
+
+ .FUNCT DIR-PRINT,DIR,CNT=0,TBL,DRY=0
+ ZERO? DIR \?ELS3
+ PRINTI "out of view"
+ RTRUE
+?ELS3: GETP HERE,P?LINE
+ GRTR? STACK,BACK-ALLEY-LINE-C \?ELS7
+ SET 'TBL,NAUTICAL-DIR-STRINGS
+ JUMP ?CND1
+?ELS7: SET 'TBL,DIR-STRINGS
+ SET 'DRY,TRUE-VALUE
+?CND1:
+?PRG10: GET TBL,CNT
+ EQUAL? STACK,DIR \?CND12
+ ZERO? DRY /?CND15
+ EQUAL? DIR,P?UP,P?DOWN /?CND15
+ PRINTI "the "
+?CND15: ADD CNT,1
+ GET TBL,STACK
+ PRINT STACK
+ RTRUE
+?CND12: INC 'CNT
+ JUMP ?PRG10
+
+
+ .FUNCT FOLLOW-GOAL,PERSON,HERE,LINE,LN,RM,GT,GOAL,FLG,GOAL-FLAG=0,IGOAL=0,LOC,CNT=1,DIR
+ LOC PERSON >HERE
+ GETP PERSON,P?CHARACTER
+ GET GOAL-TABLES,STACK >GT
+ GET GT,GOAL-F
+ EQUAL? HERE,STACK \?ELS3
+ PUT GT,GOAL-S,FALSE-VALUE
+ RETURN FALSE-VALUE
+?ELS3: GET GT,GOAL-ENABLE
+ ZERO? STACK /FALSE
+?CND1: GETP HERE,P?STATION >LOC
+ EQUAL? LOC,HERE /?CND6
+ CALL MOVE-PERSON,PERSON,LOC
+ RSTACK
+?CND6: GET GT,GOAL-I >IGOAL
+ GET TRANSFER-TABLE,IGOAL >GOAL
+ ZERO? GOAL \?CND9
+ SET 'IGOAL,FALSE-VALUE
+ GET GT,GOAL-S >GOAL
+?CND9: ZERO? GOAL /FALSE
+ EQUAL? HERE,GOAL \?CND12
+ ZERO? IGOAL /?ELS19
+ ADD IGOAL,1
+ GET TRANSFER-TABLE,STACK
+ CALL MOVE-PERSON,PERSON,STACK >FLG
+ GET GT,GOAL-F
+ CALL ESTABLISH-GOAL,PERSON,STACK
+ RETURN FLG
+?ELS19: GET GT,GOAL-F
+ EQUAL? HERE,STACK /?ELS22
+ PUT GT,GOAL-S,FALSE-VALUE
+ GET GT,GOAL-F
+ CALL MOVE-PERSON,PERSON,STACK >FLG
+ RETURN FLG
+?ELS22: PUT GT,GOAL-S,FALSE-VALUE
+ RETURN FALSE-VALUE
+?CND12: GETP GOAL,P?LINE
+ CALL GET-LINE,STACK >LINE
+?PRG25: GET LINE,CNT >RM
+ EQUAL? RM,HERE \?ELS29
+ ZERO? GOAL-FLAG /?ELS32
+ SUB CNT,3
+ GET LINE,STACK >LOC
+ JUMP ?CND30
+?ELS32: ADD CNT,3
+ GET LINE,STACK >LOC
+?CND30: CALL MOVE-PERSON,PERSON,LOC
+ RETURN STACK
+?ELS29: EQUAL? RM,GOAL \?CND27
+ SET 'GOAL-FLAG,TRUE-VALUE
+?CND27: ADD CNT,3 >CNT
+ JUMP ?PRG25
+
+
+ .FUNCT COR-DIR,HERE,THERE,COR,RM,PAST=0,CNT=2,?TMP1
+ GETP THERE,P?CORRIDOR >?TMP1
+ GETP HERE,P?CORRIDOR
+ BAND ?TMP1,STACK
+ CALL GET-COR,STACK >COR
+?PRG1: GET COR,CNT >RM
+ EQUAL? RM,HERE \?ELS5
+ SET 'PAST,1
+ JUMP ?REP2
+?ELS5: EQUAL? RM,THERE \?CND3
+ JUMP ?REP2
+?CND3: INC 'CNT
+ JUMP ?PRG1
+?REP2: GET COR,PAST
+ RSTACK
+
+
+ .FUNCT GET-LINE,LN
+ ZERO? LN \?ELS5
+ RETURN ROAD-WHARF-LINE
+?ELS5: EQUAL? LN,1 \?ELS7
+ RETURN EAST-ROAD-LINE
+?ELS7: EQUAL? LN,2 \?ELS9
+ RETURN BEDROOM-LINE
+?ELS9: EQUAL? LN,3 \?ELS11
+ RETURN BACK-ALLEY-LINE
+?ELS11: EQUAL? LN,4 \?ELS13
+ RETURN TRAWLER-LINE
+?ELS13: EQUAL? LN,5 \FALSE
+ RETURN SALVAGER-LINE
+
+
+ .FUNCT GET-COR,NUM
+ EQUAL? NUM,1 \?ELS5
+ RETURN COR-1
+?ELS5: EQUAL? NUM,2 \?ELS7
+ RETURN COR-2
+?ELS7: EQUAL? NUM,4 \?ELS9
+ RETURN COR-4
+?ELS9: EQUAL? NUM,8 \?ELS11
+ RETURN COR-8
+?ELS11: EQUAL? NUM,16 \?ELS13
+ RETURN COR-16
+?ELS13: EQUAL? NUM,32 \?ELS15
+ RETURN COR-32
+?ELS15: EQUAL? NUM,64 \?ELS17
+ RETURN COR-64
+?ELS17: EQUAL? NUM,128 \?ELS19
+ RETURN COR-128
+?ELS19: EQUAL? NUM,256 \?ELS21
+ RETURN COR-256
+?ELS21: RETURN COR-512
+
+
+ .FUNCT CORRIDOR-LOOK,ITM=0,C,Z,COR,VAL,FOUND=0
+ GETP HERE,P?CORRIDOR >C
+ ZERO? C /FALSE
+?PRG6: SUB C,512 >Z
+ LESS? Z,0 /?ELS10
+ SET 'COR,COR-512
+ JUMP ?CND8
+?ELS10: SUB C,256 >Z
+ LESS? Z,0 /?ELS12
+ SET 'COR,COR-256
+ JUMP ?CND8
+?ELS12: SUB C,128 >Z
+ LESS? Z,0 /?ELS14
+ SET 'COR,COR-128
+ JUMP ?CND8
+?ELS14: SUB C,64 >Z
+ LESS? Z,0 /?ELS16
+ SET 'COR,COR-64
+ JUMP ?CND8
+?ELS16: SUB C,32 >Z
+ LESS? Z,0 /?ELS18
+ SET 'COR,COR-32
+ JUMP ?CND8
+?ELS18: SUB C,16 >Z
+ LESS? Z,0 /?ELS20
+ SET 'COR,COR-16
+ JUMP ?CND8
+?ELS20: SUB C,8 >Z
+ LESS? Z,0 /?ELS22
+ SET 'COR,COR-8
+ JUMP ?CND8
+?ELS22: SUB C,4 >Z
+ LESS? Z,0 /?ELS24
+ SET 'COR,COR-4
+ JUMP ?CND8
+?ELS24: SUB C,2 >Z
+ LESS? Z,0 /?ELS26
+ SET 'COR,COR-2
+ JUMP ?CND8
+?ELS26: SUB C,1 >Z
+ LESS? Z,0 /?REP7
+ SET 'COR,COR-1
+?CND8: CALL CORRIDOR-CHECK,COR,ITM >VAL
+ ZERO? FOUND \?CND31
+ SET 'FOUND,VAL
+?CND31: SET 'C,Z
+ JUMP ?PRG6
+?REP7: RETURN FOUND
+
+
+ .FUNCT CORRIDOR-CHECK,COR,ITM,CNT=2,PAST=0,FOUND=0,RM,OBJ
+?PRG1: GET COR,CNT >RM
+ ZERO? RM /FALSE
+ EQUAL? RM,HERE \?ELS7
+ SET 'PAST,1
+ JUMP ?CND3
+?ELS7: FIRST? RM >OBJ \?CND3
+?PRG10: ZERO? ITM /?ELS14
+ EQUAL? OBJ,ITM \?CND12
+ GET COR,PAST >FOUND
+ JUMP ?REP11
+?ELS14: GETP OBJ,P?CHARACTER
+ ZERO? STACK /?CND12
+ CALL IN-MOTION?,OBJ
+ ZERO? STACK \?CND12
+ EQUAL? OBJ,MCGINTY \?THN23
+ CALL QUEUED?,I-MCGINTY-FOLLOWS
+ ZERO? STACK /?THN23
+ EQUAL? PRSA,V?FOLLOW,V?WALK /?CND12
+?THN23: CALL START-SENTENCE,OBJ
+ PRINTI " is "
+ PRINTI "off to "
+ GET COR,PAST
+ CALL DIR-PRINT,STACK
+ PRINTI "."
+ CRLF
+?CND12: NEXT? OBJ >OBJ /?KLU38
+?KLU38: ZERO? OBJ \?PRG10
+?REP11: ZERO? FOUND /?CND3
+ RETURN FOUND
+?CND3: INC 'CNT
+ JUMP ?PRG1
+
+
+ .FUNCT IN-MOTION?,PERSON,GT,?TMP1
+ GETP PERSON,P?CHARACTER
+ GET GOAL-TABLES,STACK >GT
+ GET GT,GOAL-ENABLE
+ ZERO? STACK \?THN8
+ GET GT,ATTENTION
+ EQUAL? STACK,1 \FALSE
+?THN8: GET GT,GOAL-S
+ ZERO? STACK /FALSE
+ LOC PERSON >?TMP1
+ GET GT,GOAL-F
+ EQUAL? ?TMP1,STACK /FALSE
+ RTRUE
+
+
+ .FUNCT START-MOVEMENT
+ CALL QUEUE,I-MCGINTY,1
+ PUT STACK,0,1
+ CALL QUEUE,I-JOHNNY,1
+ PUT STACK,0,1
+ CALL QUEUE,I-PETE,1
+ PUT STACK,0,1
+ CALL QUEUE,I-WEASEL,1
+ PUT STACK,0,1
+ CALL QUEUE,I-DELIVERY-BOY,1
+ PUT STACK,0,1
+ CALL QUEUE,I-FOLLOW,-1
+ PUT STACK,0,1
+ CALL QUEUE,I-ATTENTION,-1
+ PUT STACK,0,1
+ CALL QUEUE,I-DISGUSTING-WEASEL-KLUDGE,35
+ PUT STACK,0,1
+ RTRUE
+
+
+ .FUNCT IMOVEMENT,PERSON,INT,TB,VAR,DIS,TIM,ID,RM,GT,?TMP1
+ GETP PERSON,P?CHARACTER >ID
+ GET MOVEMENT-GOALS,ID >TB
+ GET GOAL-TABLES,ID >GT
+ GET TB,MG-ROOM >RM
+ EQUAL? 0,RM /?CND1
+ GET GT,GOAL-QUEUED
+ ZERO? STACK /?ELS6
+ PUT GT,GOAL-QUEUED,RM
+ JUMP ?CND1
+?ELS6: CALL ESTABLISH-GOAL,PERSON,RM
+?CND1: GET TB,MG-TIME >TIM
+ EQUAL? 0,TIM /FALSE
+ GET TB,MG-VARIATION >VAR
+ MUL VAR,2
+ RANDOM STACK >DIS
+ SUB DIS,VAR
+ ADD TIM,STACK
+ CALL QUEUE,INT,STACK
+ ADD TB,MG-LENGTH
+ PUT MOVEMENT-GOALS,ID,STACK
+ GET TB,MG-NEXT
+ EQUAL? 0,STACK /FALSE
+ GET TB,MG-NEXT >?TMP1
+ SUB VAR,DIS
+ ADD ?TMP1,STACK
+ PUT TB,MG-NEXT,STACK
+ RFALSE
+
+
+ .FUNCT I-FOLLOW,FLG=0,CNT=0,GT,VAL
+?PRG1: IGRTR? 'CNT,CHARACTER-MAX \?ELS5
+ RETURN FLG
+?ELS5: GET GOAL-TABLES,CNT >GT
+ GET GT,GOAL-S
+ ZERO? STACK /?PRG1
+ GET GT,GOAL-ENABLE
+ ZERO? STACK \?THN10
+ GET GT,ATTENTION
+ ZERO? STACK \?PRG1
+?THN10: PUT GT,GOAL-ENABLE,TRUE-VALUE
+ GET CHARACTER-TABLE,CNT
+ CALL FOLLOW-GOAL,STACK >VAL
+ ZERO? VAL /?PRG1
+ EQUAL? FLG,M-FATAL /?PRG1
+ SET 'FLG,VAL
+ JUMP ?PRG1
+
+
+ .FUNCT I-ATTENTION,FLG=0,CNT=0,ATT,GT
+?PRG1: IGRTR? 'CNT,CHARACTER-MAX \?ELS5
+ RETURN FLG
+?ELS5: GET GOAL-TABLES,CNT >GT
+ GET GT,ATTENTION
+ SUB STACK,1 >ATT
+ ZERO? ATT \?CND3
+ PUT GT,GOAL-ENABLE,TRUE-VALUE
+?CND3: PUT GT,ATTENTION,ATT
+ JUMP ?PRG1
+
+
+ .FUNCT GRAB-ATTENTION,PERSON,CHR,GT,ATT
+ GETP PERSON,P?CHARACTER >CHR
+ GET GOAL-TABLES,CHR >GT
+ GET GT,GOAL-S
+ ZERO? STACK /?CND1
+ GET GT,ATTENTION-SPAN >ATT
+ PUT GT,ATTENTION,ATT
+ ZERO? ATT \?ELS6
+ PUT GT,GOAL-ENABLE,TRUE-VALUE
+ RFALSE
+?ELS6: GET GT,GOAL-ENABLE
+ ZERO? STACK /?CND1
+ PUT GT,GOAL-ENABLE,FALSE-VALUE
+?CND1: SET 'QCONTEXT,PERSON
+ SET 'QCONTEXT-ROOM,HERE
+ RTRUE
+
+
+ .FUNCT ESTABLISH-GOAL,PERSON,GOAL,PRIORITY=0,HERE,HL,GL,GT,?TMP1
+ LOC PERSON >HERE
+ GETP PERSON,P?CHARACTER
+ GET GOAL-TABLES,STACK >GT
+ ZERO? PRIORITY /?CND1
+ PUT GT,GOAL-ENABLE,TRUE-VALUE
+ PUT GT,GOAL-QUEUED,HERE
+?CND1: GETP HERE,P?LINE
+ MUL STACK,12 >?TMP1
+ GETP GOAL,P?LINE
+ MUL STACK,2
+ ADD ?TMP1,STACK
+ PUT GT,GOAL-I,STACK
+ GETP GOAL,P?STATION
+ PUT GT,GOAL-S,STACK
+ PUT GT,GOAL-F,GOAL
+ LOC PERSON
+ RSTACK
+
+
+ .FUNCT GOAL-REACHED,PERSON,GT
+ GETP PERSON,P?CHARACTER
+ GET GOAL-TABLES,STACK >GT
+ PUT GT,GOAL-S,FALSE-VALUE
+ GET GT,GOAL-FUNCTION
+ CALL STACK,G-REACHED
+ RSTACK
+
+
+ .FUNCT MOVE-PERSON,PERSON,WHERE,DIR,GT,OL,COR,PCOR,CHR,PUSHCART,FLG=0,VAL=0,DF,CD
+ GETP PERSON,P?CHARACTER >CHR
+ GET GOAL-TABLES,CHR >GT
+ LOC PERSON >OL
+ CALL DIR-FROM,OL,WHERE >DIR
+ SET 'PUSHCART,STR?187
+ EQUAL? OL,HERE \?ELS3
+ FSET? PERSON,INVISIBLE /?ELS3
+ SET 'FLG,TRUE-VALUE
+ CALL START-SENTENCE,PERSON
+ EQUAL? DIR,P?OUT \?ELS8
+ PRINTI " leaves the room"
+ EQUAL? PERSON,DELIVERY-BOY \?CND11
+ PRINT PUSHCART
+?CND11: PRINTI "."
+ CRLF
+ JUMP ?CND1
+?ELS8: EQUAL? DIR,P?IN \?ELS19
+ PRINTI " goes into another room"
+ PRINTI "."
+ CRLF
+ JUMP ?CND1
+?ELS19: PRINTI " heads "
+ GETP HERE,P?LINE
+ LESS? STACK,TRAWLER-LINE-C \?CND28
+ EQUAL? DIR,P?UP,P?DOWN /?CND28
+ PRINTI "off to "
+?CND28: CALL DIR-PRINT,DIR
+ EQUAL? PERSON,DELIVERY-BOY \?CND35
+ PRINT PUSHCART
+?CND35: PRINTI "."
+ CRLF
+ JUMP ?CND1
+?ELS3: EQUAL? WHERE,HERE \?ELS43
+ FSET? PERSON,INVISIBLE /?ELS43
+ SET 'FLG,M-FATAL
+ GET GT,GOAL-F
+ EQUAL? HERE,STACK /?CND1
+ CALL START-SENTENCE,PERSON
+ PRINTI " walks "
+ EQUAL? PRSA,V?WALK \?ELS53
+ EQUAL? WHERE,HERE \?ELS53
+ EQUAL? OL,LAST-PLAYER-LOC \?ELS53
+ PRINTI "along with"
+ JUMP ?CND51
+?ELS53: PRINTI "past"
+?CND51: PRINTI " you"
+ EQUAL? PERSON,DELIVERY-BOY \?CND64
+ PRINT PUSHCART
+?CND64: PRINTI "."
+ CRLF
+ JUMP ?CND1
+?ELS43: GETP HERE,P?CORRIDOR >COR
+ ZERO? COR /?CND1
+ FSET? PERSON,INVISIBLE /?CND1
+ GETP OL,P?CORRIDOR >PCOR
+ ZERO? PCOR /?ELS77
+ BAND COR,PCOR
+ ZERO? STACK /?ELS77
+ SET 'FLG,TRUE-VALUE
+ GETP WHERE,P?CORRIDOR
+ ZERO? STACK \?ELS82
+ CALL START-SENTENCE,PERSON
+ PRINTI ", off to "
+ CALL COR-DIR,HERE,OL
+ CALL DIR-PRINT,STACK
+ PRINTI ","
+ PRINTI " leaves your view"
+ PRINTI " to "
+ CALL DIR-FROM,OL,WHERE
+ CALL DIR-PRINT,STACK
+ EQUAL? PERSON,DELIVERY-BOY \?CND91
+ PRINT PUSHCART
+?CND91: PRINTI "."
+ CRLF
+ JUMP ?CND75
+?ELS82: GETP WHERE,P?CORRIDOR
+ BAND COR,STACK
+ ZERO? STACK \?ELS99
+ CALL START-SENTENCE,PERSON
+ PRINTI ", off to "
+ CALL COR-DIR,HERE,OL
+ CALL DIR-PRINT,STACK
+ PRINTI ", disappears from sight to "
+ CALL DIR-FROM,OL,WHERE >PCOR
+ CALL DIR-PRINT,PCOR
+ EQUAL? PERSON,DELIVERY-BOY \?CND104
+ PRINT PUSHCART
+?CND104: PRINTI "."
+ CRLF
+ JUMP ?CND75
+?ELS99: CALL START-SENTENCE,PERSON
+ PRINTI " is to "
+ CALL COR-DIR,HERE,WHERE >CD
+ CALL DIR-PRINT,CD
+ PRINTI ", heading "
+ CALL DIR-FROM,OL,WHERE >DF
+ EQUAL? CD,DF \?ELS119
+ PRINTI "away from you"
+ JUMP ?CND117
+?ELS119: PRINTI "toward "
+ CALL DIR-PRINT,DF
+?CND117: EQUAL? PERSON,DELIVERY-BOY \?CND126
+ PRINT PUSHCART
+?CND126: PRINTI "."
+ CRLF
+ JUMP ?CND75
+?ELS77: GETP WHERE,P?CORRIDOR >PCOR
+ ZERO? PCOR /?CND1
+ BAND COR,PCOR
+ ZERO? STACK /?CND1
+ SET 'FLG,TRUE-VALUE
+ PRINTI "To "
+ CALL COR-DIR,HERE,WHERE
+ CALL DIR-PRINT,STACK
+ PRINTI " "
+ CALL THE?,PERSON
+ CALL DPRINT,PERSON
+ PRINTI " comes into view from "
+ CALL DIR-FROM,WHERE,OL
+ CALL DIR-PRINT,STACK
+ EQUAL? PERSON,DELIVERY-BOY \?CND143
+ PRINT PUSHCART
+?CND143: PRINTI "."
+ CRLF
+?CND75:
+?CND1: MOVE PERSON,WHERE
+ GET GT,GOAL-F
+ EQUAL? STACK,WHERE \?ELS152
+ CALL GOAL-REACHED,PERSON >VAL
+ ZERO? VAL \?CND150
+ EQUAL? HERE,WHERE \?CND150
+ FSET? PERSON,INVISIBLE /?CND150
+ SET 'FLG,M-FATAL
+ CALL START-SENTENCE,PERSON
+ PRINTI " stops here."
+ CRLF
+ JUMP ?CND150
+?ELS152: GET GT,GOAL-FUNCTION
+ CALL STACK,G-ENROUTE
+?CND150: EQUAL? VAL,M-FATAL \?ELS166
+ RETURN VAL
+?ELS166: RETURN FLG
+
+
+ .FUNCT DIR-FROM,HERE,THERE,V=0,P=0,L,Z,O
+?PRG1: NEXTP HERE,P >P
+ ZERO? P \?ELS5
+ RETURN V
+?ELS5: EQUAL? P,P?IN,P?OUT \?ELS7
+ JUMP ?PRG1
+?ELS7: LESS? P,LOW-DIRECTION /?PRG1
+ GETPT HERE,P >Z
+ PTSIZE Z >L
+ EQUAL? L,DEXIT,UEXIT,CEXIT \?ELS12
+ GETB Z,REXIT
+ EQUAL? STACK,THERE \?ELS12
+ EQUAL? P,P?UP,P?DOWN \?ELS17
+ SET 'V,P
+ JUMP ?PRG1
+?ELS17: RETURN P
+?ELS12: ZERO? V \?PRG1
+ EQUAL? L,FEXIT \?PRG1
+ SET 'V,P
+ JUMP ?PRG1
+
+ .ENDI
diff --git a/goal.zil b/goal.zil
new file mode 100644
index 0000000..908090b
--- /dev/null
+++ b/goal.zil
@@ -0,0 +1,746 @@
+"GOAL for
+ TOA #2
+ Copyright 1984 Infocom, Inc. All rights reserved.
+"
+
+"This code is the local T system."
+
+<GLOBAL DIR-STRINGS
+ <PTABLE P?NORTH "north" P?SOUTH "south"
+ P?EAST "east" P?WEST "west"
+ P?NW "northwest" P?NE "northeast"
+ P?SW "southwest" P?SE "southeast"
+ P?DOWN "downstairs" P?UP "upstairs"
+ P?IN "in" P?OUT "out">>
+
+<GLOBAL NAUTICAL-DIR-STRINGS
+ <PTABLE P?NORTH "forward" P?SOUTH "aft"
+ P?EAST "starboard" P?WEST "port"
+ P?NW "northwest" P?NE "northeast"
+ P?SW "southwest" P?SE "southeast"
+ P?DOWN "below" P?UP "above"
+ P?IN "in" P?OUT "out">>
+
+<ROUTINE DIR-PRINT (DIR "AUX" (CNT 0) TBL (DRY <>))
+ #DECL ((DIR CNT) FIX)
+ <COND (<NOT .DIR>
+ <TELL "out of view">
+ <RTRUE>)
+ (<G? <GETP ,HERE ,P?LINE> ,BACK-ALLEY-LINE-C>
+ <SET TBL ,NAUTICAL-DIR-STRINGS>)
+ (T
+ <SET TBL ,DIR-STRINGS>
+ <SET DRY T>)>
+ <REPEAT ()
+ <COND (<==? <GET .TBL .CNT> .DIR>
+ <COND (<AND .DRY
+ <NOT <EQUAL? .DIR ,P?UP ,P?DOWN>>>
+ <TELL "the ">)>
+ <PRINT <GET .TBL <+ .CNT 1>>>
+ <RTRUE>)>
+ <SET CNT <+ .CNT 1>>>>
+
+"Rapid Transit Line Definitions and Identifiers"
+
+<CONSTANT ROAD-WHARF-LINE-C 0>
+<CONSTANT EAST-ROAD-LINE-C 1>
+<CONSTANT BEDROOM-LINE-C 2>
+<CONSTANT BACK-ALLEY-LINE-C 3>
+<CONSTANT TRAWLER-LINE-C 4>
+<CONSTANT SALVAGER-LINE-C 5>
+<CONSTANT UNDERWATER-LINE-C 6>
+
+<GLOBAL ROAD-WHARF-LINE
+ <PTABLE 0 WINDING-ROAD-1 P?SE
+ P?NW WINDING-ROAD-2 P?NE
+ P?SW WINDING-ROAD-3 P?NE
+ P?SW WHARF-ROAD-1 P?EAST
+ P?WEST WHARF-ROAD-2 P?EAST
+ P?WEST WHARF-ROAD-3 P?NORTH
+ P?SOUTH WHARF 0>>
+
+<GLOBAL EAST-ROAD-LINE
+ <PTABLE 0 WHARF-ROAD-4 P?EAST
+ P?WEST WHARF-ROAD-5 P?SE
+ P?NW OCEAN-ROAD-1 P?SOUTH
+ P?NORTH OCEAN-ROAD-2 P?SOUTH
+ P?NORTH OCEAN-ROAD-3 P?SW
+ P?NE SHORE-ROAD-2 P?WEST
+ P?EAST SHORE-ROAD-1 P?WEST
+ P?EAST FERRY-LANDING 0>>
+
+<GLOBAL BEDROOM-LINE
+ <PTABLE 0 RED-BOAR-INN P?UP
+ P?DOWN UPSTAIRS-HALLWAY P?SOUTH
+ P?NORTH BEDROOM 0>>
+
+<GLOBAL BACK-ALLEY-LINE
+ <PTABLE 0 BACK-ALLEY-1 P?EAST
+ P?WEST BACK-ALLEY-2 P?EAST
+ P?WEST BACK-ALLEY-3 P?EAST
+ P?WEST BACK-ALLEY-4 P?EAST
+ P?WEST BACK-ALLEY-5 0>>
+
+<GLOBAL TRAWLER-LINE
+ <PTABLE 0 NW-PORT-DECK P?NE
+ P?SW NW-FORE-DECK P?SE
+ P?NW NW-STARBOARD-DECK P?SW
+ P?NE NW-AFT-DECK P?DOWN
+ P?UP NW-LOUNGE P?NORTH
+ P?SOUTH NW-GALLEY P?NORTH
+ P?SOUTH NW-CREW-QTRS 0>>
+
+<GLOBAL SALVAGER-LINE
+ <PTABLE 0 MM-STARBOARD-DECK P?NW
+ P?SE MM-FORE-DECK P?SW
+ P?NE MM-PORT-DECK P?SE
+ P?NW MM-AFT-DECK P?DOWN
+ P?UP MM-LOUNGE P?NORTH
+ P?SOUTH MM-GALLEY P?NORTH
+ P?SOUTH MM-CREW-QTRS 0>>
+
+<GLOBAL TRANSFER-TABLE
+ <PTABLE 0 0
+ WHARF-ROAD-3 WHARF-ROAD-4
+ WHARF-ROAD-1 RED-BOAR-INN
+ WHARF-ROAD-3 WHARF-ROAD-4
+ WHARF NW-STARBOARD-DECK
+ WHARF MM-PORT-DECK
+
+ WHARF-ROAD-4 WHARF-ROAD-3
+ 0 0
+ WHARF-ROAD-4 WHARF-ROAD-3
+ OCEAN-ROAD-1 BACK-ALLEY-5
+ WHARF-ROAD-4 WHARF-ROAD-3
+ WHARF-ROAD-4 WHARF-ROAD-3
+
+ RED-BOAR-INN WHARF-ROAD-1
+ RED-BOAR-INN WHARF-ROAD-1
+ 0 0
+ RED-BOAR-INN WHARF-ROAD-1
+ RED-BOAR-INN WHARF-ROAD-1
+ RED-BOAR-INN WHARF-ROAD-1
+
+ BACK-ALLEY-5 OCEAN-ROAD-1
+ BACK-ALLEY-5 OCEAN-ROAD-1
+ BACK-ALLEY-5 OCEAN-ROAD-1
+ 0 0
+ BACK-ALLEY-5 OCEAN-ROAD-1
+ BACK-ALLEY-5 OCEAN-ROAD-1
+
+ NW-STARBOARD-DECK WHARF
+ NW-STARBOARD-DECK WHARF
+ NW-STARBOARD-DECK WHARF
+ NW-STARBOARD-DECK WHARF
+ 0 0
+ NW-STARBOARD-DECK WHARF
+
+ MM-PORT-DECK WHARF
+ MM-PORT-DECK WHARF
+ MM-PORT-DECK WHARF
+ MM-PORT-DECK WHARF
+ MM-PORT-DECK WHARF
+ 0 0>>
+
+<GLOBAL COR-1
+ <PTABLE P?NW P?SE
+ WINDING-ROAD-1 WINDING-ROAD-2 0>>
+
+<GLOBAL COR-2
+ <PTABLE P?SW P?NE
+ WINDING-ROAD-2 WINDING-ROAD-3 WHARF-ROAD-1 0>>
+
+<GLOBAL COR-4
+ <PTABLE P?WEST P?EAST
+ WHARF-ROAD-1 WHARF-ROAD-2 WHARF-ROAD-3 WHARF-ROAD-4
+ WHARF-ROAD-5 0>>
+
+<GLOBAL COR-8
+ <PTABLE P?NW P?SE
+ WHARF-ROAD-5 OCEAN-ROAD-1 0>>
+
+<GLOBAL COR-16
+ <PTABLE P?NORTH P?SOUTH
+ OCEAN-ROAD-1 OCEAN-ROAD-2 OCEAN-ROAD-3 0>>
+
+<GLOBAL COR-32
+ <PTABLE P?NW P?SE
+ OCEAN-ROAD-3 POINT-LOOKOUT 0>>
+
+<GLOBAL COR-64
+ <PTABLE P?SW P?NE
+ SHORE-ROAD-2 OCEAN-ROAD-3 0>>
+
+<GLOBAL COR-128
+ <PTABLE P?WEST P?EAST
+ FERRY-LANDING SHORE-ROAD-1 SHORE-ROAD-2 0>>
+
+<GLOBAL COR-256
+ <PTABLE P?NORTH P?SOUTH
+ WHARF WHARF-ROAD-3 VACANT-LOT BACK-ALLEY-3 0>>
+
+<GLOBAL COR-512
+ <PTABLE P?WEST P?EAST
+ BACK-ALLEY-1 BACK-ALLEY-2 BACK-ALLEY-3 BACK-ALLEY-4
+ BACK-ALLEY-5 0>>
+
+;"up to 16 corridors (65536)"
+
+"CODE"
+
+<ROUTINE FOLLOW-GOAL (PERSON "AUX" (HERE <LOC .PERSON>) LINE LN RM GT GOAL FLG
+ (GOAL-FLAG <>) (IGOAL <>) LOC (CNT 1) DIR)
+ #DECL ((PERSON HERE LOC RM) OBJECT (LN CNT) FIX
+ (GOAL-FLAG) <OR ATOM FALSE>)
+ <SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
+ <COND (<==? .HERE <GET .GT ,GOAL-F>>
+ <PUT .GT ,GOAL-S <>>
+ <RETURN <>>)
+ (<NOT <GET .GT ,GOAL-ENABLE>> <RFALSE>)>
+ <COND (<NOT <EQUAL? <SET LOC <GETP .HERE ,P?STATION>>
+ .HERE>>
+ <RETURN <MOVE-PERSON .PERSON .LOC>>)>
+ ;%<COND (<GASSIGNED? PREDGEN>
+ '<>)
+ (T
+ '<COND (<NOT <EQUAL? <SET LOC ,<GETP .HERE ,P?STATION>>
+ .HERE>>
+ <RETURN <MOVE-PERSON .PERSON .LOC>>)>)>
+ <COND (<==? <SET GOAL <GET ,TRANSFER-TABLE
+ <SET IGOAL <GET .GT ,GOAL-I>>>> 0>
+ <SET IGOAL <>>
+ <SET GOAL <GET .GT ,GOAL-S>>)>
+ <COND (<NOT .GOAL> <RFALSE>)
+ (<==? .HERE .GOAL>
+ <COND (.IGOAL
+ <SET FLG <MOVE-PERSON .PERSON
+ <GET ,TRANSFER-TABLE
+ <+ .IGOAL 1>>>>
+ <ESTABLISH-GOAL .PERSON <GET .GT ,GOAL-F>>
+ <RETURN .FLG>)
+ (<NOT <==? .HERE <GET .GT ,GOAL-F>>>
+ <PUT .GT ,GOAL-S <>>
+ <SET FLG <MOVE-PERSON .PERSON <GET .GT ,GOAL-F>>>
+ <RETURN .FLG>)
+ (T
+ <PUT .GT ,GOAL-S <>>
+ <RETURN <>>)>)>
+ <SET LINE <GET-LINE <GETP .GOAL ,P?LINE>>>
+ <REPEAT ()
+ <COND (<==? <SET RM <GET .LINE .CNT>> .HERE>
+ <COND (.GOAL-FLAG
+ <SET LOC <GET .LINE <- .CNT 3>>>)
+ (T
+ <SET LOC <GET .LINE <+ .CNT 3>>>)>
+ <RETURN <MOVE-PERSON .PERSON .LOC>>)
+ (<==? .RM .GOAL>
+ <SET GOAL-FLAG T>)>
+ <SET CNT <+ .CNT 3>>>>
+
+<ROUTINE COR-DIR (HERE THERE "AUX" COR RM (PAST 0) (CNT 2))
+ <SET COR <GET-COR <BAND <GETP .THERE ,P?CORRIDOR>
+ <GETP .HERE ,P?CORRIDOR>>>>
+ <REPEAT ()
+ <COND (<==? <SET RM <GET .COR .CNT>> .HERE>
+ <SET PAST 1>
+ <RETURN>)
+ (<==? .RM .THERE>
+ <RETURN>)>
+ <SET CNT <+ .CNT 1>>>
+ <GET .COR .PAST>>
+
+<ROUTINE GET-LINE (LN)
+ <COND (<==? .LN 0> ,ROAD-WHARF-LINE)
+ (<==? .LN 1> ,EAST-ROAD-LINE)
+ (<==? .LN 2> ,BEDROOM-LINE)
+ (<==? .LN 3> ,BACK-ALLEY-LINE)
+ (<==? .LN 4> ,TRAWLER-LINE)
+ (<==? .LN 5> ,SALVAGER-LINE)>>
+
+<ROUTINE GET-COR (NUM)
+ #DECL ((NUM) FIX)
+ <COND (<==? .NUM 1> ,COR-1)
+ (<==? .NUM 2> ,COR-2)
+ (<==? .NUM 4> ,COR-4)
+ (<==? .NUM 8> ,COR-8)
+ (<==? .NUM 16> ,COR-16)
+ (<==? .NUM 32> ,COR-32)
+ (<==? .NUM 64> ,COR-64)
+ (<==? .NUM 128> ,COR-128)
+ (<==? .NUM 256> ,COR-256)
+ (T ,COR-512)>>
+
+"Goal tables for the 4 characters (plus delivery boy), offset by a constant,
+which, for a given character, is the P?CHARACTER property of the object."
+
+<GLOBAL GOAL-TABLES
+ <TABLE <TABLE <> <> <> 1 <> I-FOLLOW 5 5>
+ <TABLE <> <> <> 1 <> I-MCGINTY 5 5>
+ <TABLE <> <> <> 1 <> I-JOHNNY 5 5>
+ <TABLE <> <> <> 1 <> I-PETE 5 5>
+ <TABLE <> <> <> 1 <> I-WEASEL 5 5>
+ <TABLE <> <> <> 1 <> I-DELIVERY-BOY 0 0>>>
+
+<CONSTANT CHARACTER-MAX 5>
+<CONSTANT MCGINTY-C 1>
+<CONSTANT JOHNNY-C 2>
+<CONSTANT PETE-C 3>
+<CONSTANT WEASEL-C 4>
+<CONSTANT DELIVERY-BOY-C 5>
+
+"Offsets into GOAL-TABLEs"
+
+<CONSTANT GOAL-F 0> ;"final goal"
+<CONSTANT GOAL-S 1> ;"station of final goal"
+<CONSTANT GOAL-I 2> ;"intermediate goal (transfer point)"
+<CONSTANT GOAL-ENABLE 3> ;"character can move; usually false only when he's
+ interrupted enroute"
+<CONSTANT GOAL-QUEUED 4> ;"secondary goal to go to when current, higher-
+ priority one has been reached"
+<CONSTANT GOAL-FUNCTION 5> ;"routine to apply on arrival"
+<CONSTANT ATTENTION-SPAN 6> ;"how long character will wait when interrupted"
+<CONSTANT ATTENTION 7> ;"used to count down from ATTENTION-SPAN to 0"
+
+"Goal-function constants, similar to M-xxx in MAIN"
+
+<CONSTANT G-REACHED 1>
+<CONSTANT G-ENROUTE 2>
+
+"Routines to do looking down corridors"
+
+<ROUTINE CORRIDOR-LOOK ("OPTIONAL" (ITM <>) "AUX" C Z COR VAL (FOUND <>))
+ <COND (<SET C <GETP ,HERE ,P?CORRIDOR>>
+ <REPEAT ()
+ <COND ;(<NOT <L? <SET Z <- .C 1024>> 0>>
+ <SET COR ,COR-1024>)
+ (<NOT <L? <SET Z <- .C 512>> 0>>
+ <SET COR ,COR-512>)
+ (<NOT <L? <SET Z <- .C 256>> 0>>
+ <SET COR ,COR-256>)
+ (<NOT <L? <SET Z <- .C 128>> 0>>
+ <SET COR ,COR-128>)
+ (<NOT <L? <SET Z <- .C 64>> 0>>
+ <SET COR ,COR-64>)
+ (<NOT <L? <SET Z <- .C 32>> 0>>
+ <SET COR ,COR-32>)
+ (<NOT <L? <SET Z <- .C 16>> 0>>
+ <SET COR ,COR-16>)
+ (<NOT <L? <SET Z <- .C 8>> 0>>
+ <SET COR ,COR-8>)
+ (<NOT <L? <SET Z <- .C 4>> 0>>
+ <SET COR ,COR-4>)
+ (<NOT <L? <SET Z <- .C 2>> 0>>
+ <SET COR ,COR-2>)
+ (<NOT <L? <SET Z <- .C 1>> 0>>
+ <SET COR ,COR-1>)
+ (T <RETURN>)>
+ <SET VAL <CORRIDOR-CHECK .COR .ITM>>
+ <COND (<NOT .FOUND> <SET FOUND .VAL>)>
+ <SET C .Z>>
+ .FOUND)>>
+
+<ROUTINE CORRIDOR-CHECK (COR ITM "AUX" (CNT 2) (PAST 0) (FOUND <>) RM OBJ)
+ <REPEAT ()
+ <COND (<==? <SET RM <GET .COR .CNT>> 0>
+ <RFALSE>)
+ (<==? .RM ,HERE> <SET PAST 1>)
+ (<SET OBJ <FIRST? .RM>>
+ <REPEAT ()
+ <COND (.ITM
+ <COND (<==? .OBJ .ITM>
+ <SET FOUND <GET .COR .PAST>>
+ <RETURN>)>)
+ (<AND <GETP .OBJ ,P?CHARACTER>
+ <NOT <IN-MOTION? .OBJ>>
+ <OR <NOT <==? .OBJ ,MCGINTY>>
+ <NOT <QUEUED?
+ I-MCGINTY-FOLLOWS>>
+ <NOT <VERB? WALK FOLLOW>>>>
+ <START-SENTENCE .OBJ>
+ <TELL " is ">
+ ;<COND (<IN-MOTION? .OBJ>
+ <TELL "in motion ">)>
+ <TELL "off to ">
+ <DIR-PRINT <GET .COR .PAST>>
+ <TELL ".">
+ <CRLF>)>
+ <SET OBJ <NEXT? .OBJ>>
+ <COND (<NOT .OBJ> <RETURN>)>>
+ <COND (.FOUND <RETURN .FOUND>)>)>
+ <SET CNT <+ .CNT 1>>>>
+
+<GLOBAL CHARACTER-TABLE <PTABLE PLAYER MCGINTY JOHNNY PETE WEASEL DELIVERY-BOY>>
+
+"Goal tables for the 6 characters (including PLAYER), offset
+by the preceding constants, which, for a given character,
+is the P?CHARACTER property of the object."
+
+"The ATTENTION-TABLE is now a thing of the past. ATTENTION
+in the GOAL-TABLES is used instead."
+
+"Here's how the movement goals are done: For each player is
+a table which consists of triplets, a number of minutes until
+the next movement (an clock interrupt number), a number of
+minutes allowed variation (for a bit of randomness), and a
+room toward which to start. All movement is controlled by
+the GOAL-ENABLE flag in the GOAL-TABLE for a character."
+
+"Time starts at 8AM. Characters are at that point in their
+starting positions, as reflected in PEOPLE."
+
+<GLOBAL MOVEMENT-GOALS <TABLE
+ ;"PLAYER"
+ <TABLE 0 0 0>
+ ;"MCGINTY"
+ <TABLE 0
+ 58 2 SHANTY
+ 15 1 MCGINTY-HQ
+ 65 2 BANK
+ 16 5 OUTFITTERS-HQ
+ 30 3 MCGINTY-HQ
+ 75 5 SHANTY
+ 30 5 MCGINTY-HQ
+ ;69 ;2 ;MM-FORE-DECK
+ 0>
+ ;"JOHNNY"
+ <TABLE 0
+ 61 2 WINDING-ROAD-1
+ 75 5 SHANTY
+ 0>
+ ;"PETE"
+ <TABLE 0
+ 72 2 WINDING-ROAD-1
+ 81 5 SHANTY
+ 197 5 MM-GALLEY
+ 0>
+ ;"WEASEL"
+ <TABLE 0
+ 8 5 UPSTAIRS-HALLWAY
+ 58 2 WINDING-ROAD-1
+ 78 5 UPSTAIRS-HALLWAY
+ 85 1 FERRY-LANDING
+ 0>
+ ;"DELIVERY-BOY"
+ <TABLE 0
+ 345 1 MM-LOCKER
+ 0>>>
+
+<GLOBAL WEASEL-RETIRES-TABLE
+ <TABLE 0
+ 5 1 BACK-ALLEY-5
+ 45 5 BANK
+ 10 5 FERRY-LANDING
+ 0>>
+
+<GLOBAL JOHNNY-CONTINUES-TABLE
+ <TABLE 0
+ 5 1 OUTFITTERS-HQ
+ 60 5 POINT-LOOKOUT
+ 25 1 SHANTY
+ 0>>
+
+<GLOBAL JOHNNY-COMPLETES-TABLE
+ <TABLE 0
+ 200 5 MM-CAPT-CABIN
+ 0>>
+
+<ROUTINE IN-MOTION? (PERSON "AUX" GT)
+ <SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
+ <COND (<AND <OR <GET .GT ,GOAL-ENABLE>
+ <==? <GET .GT ,ATTENTION> 1>>
+ <GET .GT ,GOAL-S>
+ <NOT <==? <LOC .PERSON> <GET .GT ,GOAL-F>>>>
+ <RTRUE>)
+ (T <RFALSE>)>>
+
+<ROUTINE START-MOVEMENT ()
+ <ENABLE <QUEUE I-MCGINTY 1>>
+ <ENABLE <QUEUE I-JOHNNY 1>>
+ <ENABLE <QUEUE I-PETE 1>>
+ <ENABLE <QUEUE I-WEASEL 1>>
+ <ENABLE <QUEUE I-DELIVERY-BOY 1>>
+ <ENABLE <QUEUE I-FOLLOW -1>>
+ <ENABLE <QUEUE I-ATTENTION -1>>
+ <ENABLE <QUEUE I-DISGUSTING-WEASEL-KLUDGE 35>>>
+
+"This routine does the interrupt-driven goal establishment
+for the various characters, using the MOVEMENT-GOALS table."
+
+<CONSTANT MG-ROOM 0>
+<CONSTANT MG-TIME 1>
+<CONSTANT MG-VARIATION 2>
+<CONSTANT MG-LENGTH <* 3 2>>
+<CONSTANT MG-NEXT 4>
+
+<ROUTINE IMOVEMENT (PERSON INT "AUX" TB VAR DIS TIM ID RM GT)
+ #DECL ((PERSON) OBJECT (TB) <PRIMTYPE VECTOR> (ID VAR DIS TIM) FIX)
+ <SET TB <GET ,MOVEMENT-GOALS <SET ID <GETP .PERSON ,P?CHARACTER>>>>
+ <SET GT <GET ,GOAL-TABLES .ID>>
+ <COND (<NOT <==? 0 <SET RM <GET .TB ,MG-ROOM>>>>
+ <COND (<GET .GT ,GOAL-QUEUED>
+ <PUT .GT ,GOAL-QUEUED .RM>)
+ (T
+ <ESTABLISH-GOAL .PERSON .RM>)>)>
+ <COND (<NOT <==? 0 <SET TIM <GET .TB ,MG-TIME>>>>
+ <SET VAR <GET .TB ,MG-VARIATION>>
+ <SET DIS <RANDOM <* .VAR 2>>>
+ <QUEUE .INT <+ .TIM <- .DIS .VAR>>>
+ <PUT ,MOVEMENT-GOALS .ID <REST .TB ,MG-LENGTH>>
+ <COND (<NOT <==? 0 <GET .TB ,MG-NEXT>>>
+ <PUT .TB
+ ,MG-NEXT
+ <+ <GET .TB ,MG-NEXT> <- .VAR .DIS>>>)>)>
+ <RFALSE>>
+
+<ROUTINE I-FOLLOW ("AUX" (FLG <>) (CNT 0) GT VAL)
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> ,CHARACTER-MAX>
+ <RETURN>)
+ (<AND <GET <SET GT <GET ,GOAL-TABLES .CNT>> ,GOAL-S>
+ <OR <GET .GT ,GOAL-ENABLE>
+ <0? <GET .GT ,ATTENTION>>>>
+ <PUT .GT ,GOAL-ENABLE T>
+ <COND (<SET VAL
+ <FOLLOW-GOAL <GET ,CHARACTER-TABLE .CNT>>>
+ <COND (<NOT <==? .FLG ,M-FATAL>>
+ <SET FLG .VAL>)>)>)>>
+ .FLG>
+
+<ROUTINE I-ATTENTION ("AUX" (FLG <>) (CNT 0) ATT GT)
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> ,CHARACTER-MAX> <RETURN>)
+ (<0? <SET ATT <- <GET
+ <SET GT <GET ,GOAL-TABLES .CNT>>
+ ,ATTENTION> 1>>>
+ <PUT .GT ,GOAL-ENABLE T>)
+ ;(<==? <SET ATT <- <GET
+ <SET GT <GET ,GOAL-TABLES .CNT>>
+ ,ATTENTION> 1>> 1>
+ <COND (<AND <IN? <GET ,CHARACTER-TABLE .CNT> ,HERE>
+ <NOT ,ASLEEP?>>
+ <START-SENTENCE <GET ,CHARACTER-TABLE .CNT>>
+ <TELL " is acting impatient." CR>
+ <SET FLG T>)>)
+ ;(<==? .ATT 0>
+ <PUT .GT ,GOAL-ENABLE T>)>
+ <PUT .GT ,ATTENTION .ATT>>
+ .FLG>
+
+<ROUTINE GRAB-ATTENTION (PERSON "AUX" (CHR<GETP .PERSON ,P?CHARACTER>) GT ATT)
+ #DECL ((PERSON) OBJECT (ATT) FIX)
+ <SET GT <GET ,GOAL-TABLES .CHR>>
+ <COND (<GET .GT ,GOAL-S>
+ <PUT .GT ,ATTENTION <SET ATT <GET .GT ,ATTENTION-SPAN>>>
+ <COND (<==? .ATT 0>
+ <PUT .GT ,GOAL-ENABLE T>
+ <RFALSE>)
+ (<GET .GT ,GOAL-ENABLE>
+ <PUT .GT ,GOAL-ENABLE <>>)>)>
+ <SETG QCONTEXT .PERSON>
+ <SETG QCONTEXT-ROOM ,HERE>
+ <RTRUE>>
+
+" Movement etc."
+
+;<ROUTINE UNPRIORITIZE (PERSON "AUX" GT)
+ <SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
+ <COND (<GET .GT ,GOAL-QUEUED>
+ <ESTABLISH-GOAL .PERSON <GET .GT ,GOAL-QUEUED>>
+ <PUT .GT ,GOAL-QUEUED <>>)>>
+
+<ROUTINE ESTABLISH-GOAL (PERSON GOAL "OPTIONAL" (PRIORITY <>)
+ "AUX" (HERE <LOC .PERSON>) HL GL GT)
+ #DECL ((PERSON GOAL HERE) OBJECT (HL GL) FIX
+ (PRIORITY) <OR FALSE ATOM>)
+ ;<COND (<==? .HERE .GOAL>
+ <RETURN .HERE>)>
+ <SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
+ <COND (.PRIORITY
+ <PUT .GT ,GOAL-ENABLE T>
+ <PUT .GT ,GOAL-QUEUED .HERE>)>
+ <PUT .GT ,GOAL-I <+ <* <GETP .HERE ,P?LINE> 12>
+ <* <GETP .GOAL ,P?LINE> 2>>>
+ <PUT .GT
+ ,GOAL-S
+ <GETP .GOAL ,P?STATION>
+ ;%<COND (<GASSIGNED? PREDGEN> '<>)
+ (T ',<GETP .GOAL ,P?STATION>)>>
+ <PUT .GT ,GOAL-F .GOAL>
+ <LOC .PERSON>>
+
+<ROUTINE GOAL-REACHED (PERSON "AUX" GT)
+ #DECL ((PERSON) OBJECT)
+ <PUT <SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
+ ,GOAL-S <>>
+ <APPLY <GET .GT ,GOAL-FUNCTION>
+ ,G-REACHED>>
+
+<ROUTINE MOVE-PERSON (PERSON WHERE "AUX" DIR GT OL COR PCOR CHR PUSHCART
+ (FLG <>) ;DR (VAL <>) DF CD)
+ #DECL ((PERSON WHERE) OBJECT)
+ <SET GT <GET ,GOAL-TABLES <SET CHR <GETP .PERSON ,P?CHARACTER>>>>
+ <SET OL <LOC .PERSON>>
+ <SET DIR <DIR-FROM .OL .WHERE>>
+ <SET PUSHCART ", pushing his cart">
+ ;<COND (<==? <PTSIZE <SET DR <GETPT .OL .DIR>>> ,DEXIT>
+ <SET DR <GETB .DR ,DEXITOBJ>>
+ <COND (<NOT <FSET? .DR ,OPENBIT>>
+ <FSET .DR ,OPENBIT>
+ ;<COND (<NOT <FSET? .DR ,LOCKED>> <FSET .DR ,OPENBIT>)>)
+ (T <SET DR <>>)>)
+ (T <SET DR <>>)>
+ <COND (<AND <==? .OL ,HERE>
+ <NOT <FSET? .PERSON ,INVISIBLE>>>
+ <SET FLG T>
+ <START-SENTENCE .PERSON>
+ <COND (<==? .DIR ,P?OUT>
+ <TELL " leaves the room">
+ <COND (<==? .PERSON ,DELIVERY-BOY> <TELL .PUSHCART>)>
+ <TELL "." CR>)
+ (<==? .DIR ,P?IN>
+ ;<COND (.DR
+ <TELL " opens the " D .DR " and">)>
+ <TELL " goes into another room">
+ ;<COND (<AND .DR
+ <FSET? .DR ,LOCKED>>
+ ;<FCLEAR .DR ,OPENBIT>
+ <TELL ", locking the door again">)>
+ <TELL "." CR>)
+ (T
+ ;<COND (.DR
+ <TELL " opens the " D .DR " and">)>
+ <TELL " heads ">
+ <COND (<AND <L? <GETP ,HERE ,P?LINE> ,TRAWLER-LINE-C>
+ <NOT <EQUAL? .DIR ,P?UP ,P?DOWN>>>
+ <TELL "off to ">)>
+ <DIR-PRINT .DIR>
+ ;<COND (<AND .DR
+ <FSET? .DR ,LOCKED>>
+ ;<FCLEAR .DR ,OPENBIT>
+ <TELL ", locking the door again">)>
+ <COND (<==? .PERSON ,DELIVERY-BOY> <TELL .PUSHCART>)>
+ <TELL "." CR>)>)
+ (<AND <==? .WHERE ,HERE>
+ <NOT <FSET? .PERSON ,INVISIBLE>>>
+ <SET FLG ,M-FATAL>
+ <COND (<NOT <==? ,HERE <GET .GT ,GOAL-F>>>
+ <START-SENTENCE .PERSON>
+ <TELL " walks ">
+ <COND (<AND <VERB? WALK>
+ <==? .WHERE ,HERE>
+ <==? .OL ,LAST-PLAYER-LOC>>
+ <TELL "along with">)
+ (T <TELL "past">)>
+ <TELL " you">
+ <COND (<==? .PERSON ,DELIVERY-BOY> <TELL .PUSHCART>)>
+ <TELL "." CR>)>)
+ (<AND <SET COR <GETP ,HERE ,P?CORRIDOR>>
+ <NOT <FSET? .PERSON ,INVISIBLE>>>
+ <COND (<AND <SET PCOR <GETP .OL ,P?CORRIDOR>>
+ <NOT <==? <BAND .COR .PCOR> 0>>>
+ <SET FLG T>
+ <COND (<NOT <GETP .WHERE ,P?CORRIDOR>>
+ <START-SENTENCE .PERSON>
+ <TELL ", off to ">
+ <DIR-PRINT <COR-DIR ,HERE .OL>>
+ <TELL ",">
+ ;<COND (.DR
+ <TELL " opens a door and">)>
+ <TELL " leaves your view">
+ <TELL " to ">
+ <DIR-PRINT <DIR-FROM .OL .WHERE>>
+ ;<COND (<AND .DR
+ <FSET? .DR ,LOCKED>>
+ ;<FCLEAR .DR ,OPENBIT>
+ <TELL ", locking the door again">)>
+ <COND (<==? .PERSON ,DELIVERY-BOY>
+ <TELL .PUSHCART>)>
+ <TELL "." CR>)
+ (<0? <BAND .COR <GETP .WHERE ,P?CORRIDOR>>>
+ <START-SENTENCE .PERSON>
+ <TELL ", off to ">
+ <DIR-PRINT <COR-DIR ,HERE .OL>>
+ <TELL ", disappears from sight to ">
+ <DIR-PRINT <SET PCOR <DIR-FROM .OL .WHERE>>>
+ <COND (<==? .PERSON ,DELIVERY-BOY>
+ <TELL .PUSHCART>)>
+ <TELL "." CR>)
+ (T
+ <START-SENTENCE .PERSON>
+ <TELL " is to ">
+ <DIR-PRINT <SET CD <COR-DIR ,HERE .WHERE>>>
+ <TELL ", heading ">
+ <COND (<==? .CD <SET DF <DIR-FROM .OL .WHERE>>>
+ <TELL "away from you">)
+ (T
+ <TELL "toward ">
+ <DIR-PRINT .DF>)>
+ <COND (<==? .PERSON ,DELIVERY-BOY>
+ <TELL .PUSHCART>)>
+ <TELL "." CR>)>)
+ (<AND <SET PCOR <GETP .WHERE ,P?CORRIDOR>>
+ <NOT <==? <BAND .COR .PCOR> 0>>>
+ <SET FLG T>
+ <TELL "To ">
+ <DIR-PRINT <COR-DIR ,HERE .WHERE>>
+ <TELL " ">
+ <THE? .PERSON>
+ <TELL D .PERSON " comes into view from ">
+ <DIR-PRINT <DIR-FROM .WHERE .OL>>
+ <COND (<==? .PERSON ,DELIVERY-BOY> <TELL .PUSHCART>)>
+ <TELL "." CR>)>)>
+ ;<WHERE-UPDATE .PERSON .FLG>
+ <MOVE .PERSON .WHERE>
+ <COND (<==? <GET .GT ,GOAL-F> .WHERE>
+ <COND (<AND <NOT <SET VAL <GOAL-REACHED .PERSON>>>
+ <==? ,HERE .WHERE>
+ <NOT <FSET? .PERSON ,INVISIBLE>>>
+ <SET FLG ,M-FATAL>
+ <START-SENTENCE .PERSON>
+ <TELL " stops here." CR>)>)
+ (T <APPLY <GET .GT ,GOAL-FUNCTION> ,G-ENROUTE>)>
+ ;<COND (,DEBUG
+ <TELL "[">
+ <START-SENTENCE .PERSON>
+ <TELL " just went into ">
+ <THE? .WHERE>
+ <TELL D .WHERE ".]" CR>)>
+ <COND (<==? .VAL ,M-FATAL> .VAL)
+ (T .FLG)>>
+
+<ROUTINE DIR-FROM (HERE THERE "AUX" (V <>) (P 0) L Z O)
+ #DECL ((HERE THERE O) OBJECT (P L) FIX)
+ <REPEAT ()
+ <COND (<0? <SET P <NEXTP .HERE .P>>>
+ <RETURN .V>)
+ (<EQUAL? .P ,P?IN ,P?OUT> T)
+ (<NOT <L? .P ,LOW-DIRECTION>>
+ <SET Z <GETPT .HERE .P>>
+ <SET L <PTSIZE .Z>>
+ <COND (<AND <EQUAL? .L ,DEXIT ,UEXIT ,CEXIT>
+ <==? <GETB .Z ,REXIT> .THERE>>
+ <COND (<EQUAL? .P ,P?UP ,P?DOWN>
+ <SET V .P>)
+ (T <RETURN .P>)>)
+ (<AND <NOT .V>
+ <EQUAL? .L ,FEXIT>>
+ <SET V .P>)>)>>>
+
+;<ROUTINE WHERE-UPDATE (PERSON "OPTIONAL" (FLG <>) "AUX" WT NC (CNT 0))
+ <SET NC <GETP .PERSON ,P?CHARACTER>>
+ <SET WT <GET ,WHERE-TABLES .NC>>
+ <REPEAT ()
+ <COND (<G? .CNT ,CHARACTER-MAX> <RETURN>)
+ (<==? .CNT .NC>)
+ (<OR <AND <0? .CNT> .FLG>
+ <IN? <GET ,CHARACTER-TABLE .CNT> <LOC .PERSON>>>
+ <PUT .WT .CNT ,PRESENT-TIME>
+ <PUT <GET ,WHERE-TABLES .CNT> .NC ,PRESENT-TIME>)>
+ <SET CNT <+ .CNT 1>>>>
+
+;<GLOBAL WHERE-TABLES
+ <TABLE <TABLE 0 0 0 0 0>
+ <TABLE 0 0 0 0 0>
+ <TABLE 0 0 0 0 0>
+ <TABLE 0 0 0 0 0>
+ <TABLE 0 0 0 0 0>>> \ No newline at end of file
diff --git a/island.zap b/island.zap
new file mode 100644
index 0000000..beb0120
--- /dev/null
+++ b/island.zap
@@ -0,0 +1,1670 @@
+
+
+ .FUNCT WINDING-ROAD-1-F,RARG
+ EQUAL? RARG,M-ENTER \?ELS5
+ PUTP LOCKED-DOOR,P?SDESC,STR?190
+ EQUAL? MEETINGS-COMPLETED,1 \FALSE
+ GRTR? PRESENT-TIME,585 \?ELS15
+ CALL ALL-GO-HOME
+ CALL I-PLOT-NEVER-STARTS
+ SET 'SM-CTR,4
+ RETURN SM-CTR
+?ELS15: CALL QUEUE,I-SECOND-MEETING,-1
+ PUT STACK,0,1
+ RTRUE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSA,V?WALK \FALSE
+ GRTR? SM-CTR,0 \FALSE
+ LESS? SM-CTR,4 \FALSE
+ GRTR? HOW-HUNGRY,3 \?ELS36
+ PRINTI "Johnny looks at you. ""If you can't keep in shape, we don't want you. One word to anyone and you're a goner."" He then lets you pass..."
+ CRLF
+ CRLF
+ SET 'SM-CTR,4
+ RFALSE
+?ELS36: PRINTR "Johnny blocks you. ""What's the hurry, matey?"""
+
+
+ .FUNCT WINDING-ROAD-2-F,RARG
+ EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSA,V?THROUGH,V?BOARD \FALSE
+ EQUAL? PRSO,PSEUDO-OBJECT \FALSE
+ PRINTR "After trying to get a foothold, you give up."
+
+
+ .FUNCT SWAMP-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?193
+ RTRUE
+?ELS5: EQUAL? PRSA,V?SMELL \FALSE
+ PRINTR "It smells awful."
+
+
+ .FUNCT WHARF-ROAD-2-S,PRINT?=1
+ ZERO? PRINT? /FALSE
+ ZERO? BUSINESS-HOURS? /?ELS7
+ IN? MCGINTY,MCGINTY-HQ \?ELS7
+ RETURN MCGINTY-HQ
+?ELS7: CALL DPRINT,MCGINTY
+ PRINTI "'s is closed."
+ CRLF
+ RFALSE
+
+
+ .FUNCT FRONT-DOOR-F,OPEN?=0
+ EQUAL? HERE,RED-BOAR-INN,WHARF-ROAD-1,WHARF-ROAD-5 /?THN4
+ EQUAL? HERE,SHANTY \?ELS3
+?THN4: SET 'OPEN?,TRUE-VALUE
+ JUMP ?CND1
+?ELS3: ZERO? BUSINESS-HOURS? /?CND1
+ EQUAL? HERE,WHARF-ROAD-4,OUTFITTERS-HQ,BANK /?THN12
+ EQUAL? HERE,SHORE-ROAD-2 \?ELS11
+?THN12: SET 'OPEN?,TRUE-VALUE
+ JUMP ?CND1
+?ELS11: IN? MCGINTY,MCGINTY-HQ \?CND1
+ SET 'OPEN?,TRUE-VALUE
+?CND1: EQUAL? PRSA,V?EXAMINE \?ELS20
+ PRINTI "The door is "
+ ZERO? OPEN? /?ELS25
+ PRINTI "open"
+ JUMP ?CND23
+?ELS25: PRINTI "closed"
+?CND23: PRINTR "."
+?ELS20: EQUAL? PRSA,V?OPEN \?ELS36
+ ZERO? OPEN? /?ELS41
+ CALL TELL-ALREADY,STR?25
+ RSTACK
+?ELS41: EQUAL? HERE,MCGINTY-HQ \?ELS44
+ CALL TELL-BLOWS,STR?26
+ RSTACK
+?ELS44: PRINTR "It's locked."
+?ELS36: EQUAL? PRSA,V?UNLOCK \?ELS50
+ EQUAL? HERE,MCGINTY-HQ,OUTFITTERS-HQ,SHANTY /?THN56
+ EQUAL? HERE,BANK,RED-BOAR-INN \?ELS55
+?THN56: CALL TELL-DONT-HAVE,STR?197
+ RSTACK
+?ELS55: CALL TELL-NO-KEY
+ RSTACK
+?ELS50: EQUAL? PRSA,V?CLOSE \FALSE
+ ZERO? OPEN? /?ELS66
+ CALL TELL-BLOWS,STR?25
+ RSTACK
+?ELS66: CALL TELL-ALREADY,STR?26
+ RSTACK
+
+
+ .FUNCT TELL-BLOWS,STR
+ PRINTI "It blows back "
+ PRINT STR
+ PRINTR "."
+
+
+ .FUNCT SHORE-ROAD-2-F,RARG
+ EQUAL? RARG,M-LOOK \FALSE
+ PRINTI "This is the east end of the "
+ CALL DPRINT,SHORE-ROAD-1
+ PRINTI ", an east/west road with a ferry landing at its west end. The "
+ CALL DPRINT,BANK
+ PRINTI ", the island's only bank, is off to the north. The "
+ CALL DPRINT,OCEAN-ROAD-1
+ PRINTR " starts up to the northeast."
+
+
+ .FUNCT BACK-ALLEY-1-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ PUTP LOCKED-DOOR,P?SDESC,STR?211
+ RTRUE
+
+
+ .FUNCT BACK-ALLEY-2-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ PUTP LOCKED-DOOR,P?SDESC,STR?211
+ RTRUE
+
+
+ .FUNCT BACK-ALLEY-2-N,PRINT?=1
+ ZERO? PRINT? /FALSE
+ FSET? BACK-WINDOW,OPENBIT \?ELS7
+ IN? MCGINTY,BACK-ALLEY-1 /?THN13
+ IN? MCGINTY,BACK-ALLEY-2 /?THN13
+ IN? MCGINTY,BACK-ALLEY-3 \?ELS12
+?THN13: CALL JIGS-UP,STR?213
+ RSTACK
+?ELS12: CALL TELL-THRU-WINDOW
+ IN? MCGINTY,MCGINTY-HQ \?CND17
+ SET 'MCGINTY-HQ-OCCUPIED,TRUE-VALUE
+ RETURN MCGINTY-HQ
+?CND17: RETURN MCGINTY-HQ
+?ELS7: PRINTI "The door is locked."
+ CRLF
+ RFALSE
+
+
+ .FUNCT BACK-WINDOW-F
+ EQUAL? PRSA,V?OPEN \?ELS5
+ IN? PLAYER,MCGINTY-HQ \?ELS10
+ CALL TELL-YOU-CANT,STR?214
+ RSTACK
+?ELS10: FSET? BACK-WINDOW,OPENBIT \?ELS12
+ CALL TELL-ALREADY,STR?25
+ RSTACK
+?ELS12: FSET BACK-WINDOW,OPENBIT
+ PRINTR "You open it enough to fit through it."
+?ELS5: EQUAL? PRSA,V?CLOSE \?ELS18
+ FSET? BACK-WINDOW,OPENBIT \?ELS23
+ FCLEAR BACK-WINDOW,OPENBIT
+ PRINTR "You close the window."
+?ELS23: CALL TELL-ALREADY,STR?26
+ RSTACK
+?ELS18: EQUAL? PRSA,V?BOARD,V?THROUGH \?ELS29
+ FSET? BACK-WINDOW,OPENBIT \?ELS32
+ IN? PLAYER,MCGINTY-HQ \?ELS35
+ CALL DO-WALK,P?SOUTH
+ RTRUE
+?ELS35: CALL DO-WALK,P?NORTH
+ RTRUE
+?ELS32: CALL TELL-CLOSED,STR?215
+ RTRUE
+?ELS29: EQUAL? PRSA,V?LOOK-INSIDE \?ELS41
+ PRINTI "You see "
+ IN? PLAYER,MCGINTY-HQ \?ELS46
+ PRINTI "the back alley"
+ JUMP ?CND44
+?ELS46: IN? MCGINTY,MCGINTY-HQ \?ELS50
+ CALL DPRINT,MCGINTY
+ PRINTI " sitting at his desk"
+ JUMP ?CND44
+?ELS50: CALL DPRINT,MCGINTY
+ PRINTI "'s office"
+?CND44: PRINTR "."
+?ELS41: EQUAL? PRSA,V?UNLOCK \FALSE
+ PRINTR "It doesn't seem to be locked."
+
+
+ .FUNCT LOCKED-DOOR-F,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?190
+ RTRUE
+?ELS5: EQUAL? PRSA,V?OPEN \?ELS7
+ PRINTR "It's locked."
+?ELS7: EQUAL? PRSA,V?UNLOCK \?ELS11
+ CALL TELL-NO-KEY
+ RSTACK
+?ELS11: EQUAL? PRSA,V?EXAMINE,V?READ \?ELS13
+ EQUAL? HERE,WINDING-ROAD-1 \?ELS18
+ PRINTI "The lettering on the door reads:
+"
+ CALL FIXED-FONT-ON
+ PRINTI " ""This "
+ CALL DPRINT,LIGHTHOUSE
+ PRINTI " is part of
+ CUTTHROATS
+ an Infocom Tale of Adventure
+ by Michael Berlyn and Jerry Wolper
+ (c)1984 Infocom, Inc."""
+ CRLF
+ CALL FIXED-FONT-OFF
+ RTRUE
+?ELS18: EQUAL? PRSA,V?READ \?ELS24
+ CALL V-READ
+ RSTACK
+?ELS24: CALL TELL-CLOSED,STR?216
+ RSTACK
+?ELS13: EQUAL? PRSA,V?MUNG \?ELS28
+ PRINTR "The door and lock withstand your attempts."
+?ELS28: EQUAL? PRSA,V?KNOCK \?ELS32
+ CALL TELL-NO-ANSWER
+ RSTACK
+?ELS32: EQUAL? PRSA,V?CLOSE \?ELS34
+ CALL TELL-ALREADY,STR?26
+ RSTACK
+?ELS34: EQUAL? PRSA,V?LOCK \FALSE
+ CALL TELL-ALREADY,STR?38
+ RSTACK
+
+
+ .FUNCT TELL-NO-ANSWER
+ PRINTR "You wait a minute, but there's no answer."
+
+
+ .FUNCT BACK-ALLEY-4-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ PUTP LOCKED-DOOR,P?SDESC,STR?211
+ RTRUE
+
+
+ .FUNCT BACK-ALLEY-5-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ PUTP LOCKED-DOOR,P?SDESC,STR?211
+ RTRUE
+
+
+ .FUNCT RED-BOAR-INN-F,RARG
+ EQUAL? RARG,M-ENTER \FALSE
+ MOVE SPEAR-CARRIER,RED-BOAR-INN
+ PUTP SPEAR-CARRIER,P?SDESC,STR?221
+ PUTP SPEAR-CARRIER,P?LDESC,STR?222
+ PUTP GLOBAL-SURFACE,P?SDESC,STR?20
+ CALL MOVE-SHARED-OBJECTS,RED-BOAR-INN
+ RFALSE
+
+
+ .FUNCT MAIL-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?223
+ RTRUE
+?ELS5: EQUAL? PRSA,V?ASK-CONTEXT-FOR,V?ASK-FOR /FALSE
+ CALL GLOBAL-NOT-HERE-PRINT,PSEUDO-OBJECT
+ RETURN 2
+
+
+ .FUNCT MESSAGE-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?224
+ RTRUE
+?ELS5: CALL MAIL-PSEUDO
+ RSTACK
+
+
+ .FUNCT BEDROOM-F,RARG
+ EQUAL? RARG,M-FLASH \?ELS5
+ IN? WEASEL,BEDROOM \?ELS10
+ EQUAL? PRSA,V?LOOK /?ELS10
+ CALL JIGS-UP,STR?228
+ RSTACK
+?ELS10: ZERO? BEDROOM-MESSAGE /FALSE
+ PRINT BEDROOM-MESSAGE
+ CRLF
+ SET 'BEDROOM-MESSAGE,FALSE-VALUE
+ RETURN BEDROOM-MESSAGE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSA,V?TAKE \FALSE
+ EQUAL? PRSO,PSEUDO-OBJECT \FALSE
+ CALL TELL-CLOTHES
+ RSTACK
+
+
+ .FUNCT BEDROOM-W,PRINT?=1
+ ZERO? PRINT? /FALSE
+ PRINTI "It's not a walk-in closet."
+ CRLF
+ RFALSE
+
+
+ .FUNCT BED-F,RARG=0
+ EQUAL? RARG,M-BEG \?ELS5
+ ZERO? PRSO /?ELS10
+ IN? PRSO,PLAYER /FALSE
+ IN? PRSO,BED /FALSE
+ EQUAL? PRSO,GLOBAL-ROOM /FALSE
+ EQUAL? PRSA,V?DROP \?ELS10
+ EQUAL? PRSO,BED /FALSE
+?ELS10: EQUAL? PRSA,V?EXAMINE \?ELS18
+ EQUAL? PRSO,CLOSET,BUREAU /FALSE
+?ELS18: CALL BED-VERB?
+ ZERO? STACK \FALSE
+ PRINTI "You should get out of bed first."
+ CRLF
+ RETURN 2
+?ELS5: ZERO? RARG \FALSE
+ EQUAL? PRSA,V?BOARD \FALSE
+ FIRST? BED /?THN36
+ CALL WEARING-SOMETHING?
+ ZERO? STACK /FALSE
+?THN36: CALL TELL-NOT-COMFORTABLE
+ RSTACK
+
+
+ .FUNCT BED-VERB?
+ EQUAL? PRSA,V?DIAGNOSE,V?SUPER-BRIEF,V?BRIEF /TRUE
+ EQUAL? PRSA,V?QUIT,V?INVENTORY,V?VERBOSE /TRUE
+ EQUAL? PRSA,V?SAVE,V?RESTORE,V?RESTART /TRUE
+ EQUAL? PRSA,V?VERSION,V?$VERIFY,V?SCORE /TRUE
+ EQUAL? PRSA,V?ASK-CONTEXT-ABOUT,V?ASK-ABOUT,V?AGAIN /TRUE
+ EQUAL? PRSA,V?BREATHE,V?ASK-CONTEXT-FOR,V?ASK-FOR /TRUE
+ EQUAL? PRSA,V?FIND,V?CALL,V?$CALL /TRUE
+ EQUAL? PRSA,V?CURSES,V?COUNT,V?CHOMP /TRUE
+ EQUAL? PRSA,V?HELLO,V?GOODBYE,V?DISEMBARK /TRUE
+ EQUAL? PRSA,V?LATITUDE,V?ALARM,V?HELP /TRUE
+ EQUAL? PRSA,V?LOOK,V?LISTEN,V?LONGITUDE /TRUE
+ EQUAL? PRSA,V?MAYBE,V?CHASTISE,V?LOOK-INSIDE /TRUE
+ EQUAL? PRSA,V?MUMBLE,V?NO,V?YES /TRUE
+ EQUAL? PRSA,V?SIT,V?SCRIPT,V?PRAY /TRUE
+ EQUAL? PRSA,V?SMELL,V?UNSCRIPT,V?SIT-ON /TRUE
+ EQUAL? PRSA,V?TELL,V?STAY,V?STAND /TRUE
+ EQUAL? PRSA,V?TIME,V?SLEEP,V?SAY /TRUE
+ EQUAL? PRSA,V?WAVE-AT,V?WAIT-FOR,V?WAIT /TRUE
+ EQUAL? PRSA,V?WHAT,V?YELL,V?WIN \FALSE
+ RTRUE
+
+
+ .FUNCT BUREAU-F
+ EQUAL? PRSA,V?OPEN \?ELS5
+ FSET? BUREAU,OPENBIT \?ELS10
+ CALL TELL-ALREADY,STR?25
+ RSTACK
+?ELS10: FSET BUREAU,OPENBIT
+ PRINTI "Opening the "
+ CALL DPRINT,BUREAU
+ PRINTI " reveals "
+ CALL TELL-BUREAU-CONTENTS
+ RSTACK
+?ELS5: EQUAL? PRSA,V?CLOSE \?ELS16
+ FSET? BUREAU,OPENBIT \?ELS21
+ FCLEAR BUREAU,OPENBIT
+ PRINTR "Closed."
+?ELS21: CALL TELL-ALREADY,STR?26
+ RSTACK
+?ELS16: EQUAL? PRSA,V?PUT-ON \?ELS27
+ EQUAL? PRSI,BUREAU \?ELS27
+ CALL IDROP
+ ZERO? STACK /TRUE
+ PRINTR "It slides off onto the floor."
+?ELS27: EQUAL? PRSA,V?EXAMINE \?ELS36
+ PRINTI "It's a tilted old wooden "
+ CALL DPRINT,BUREAU
+ FSET? BUREAU,OPENBIT \?ELS43
+ FIRST? BUREAU \?ELS48
+ PRINTI ". In addition to your clothes, you find "
+ CALL PRINT-CONTENTS,BUREAU
+ PRINTR " inside."
+?ELS48: PRINTR ". Your clothes are in it."
+?ELS43: PRINTR ", which is closed."
+?ELS36: EQUAL? PRSA,V?LOOK-INSIDE \FALSE
+ FSET? BUREAU,OPENBIT \FALSE
+ PRINTI "The "
+ CALL DPRINT,BUREAU
+ PRINTI " contains "
+ CALL TELL-BUREAU-CONTENTS
+ RSTACK
+
+
+ .FUNCT TELL-BUREAU-CONTENTS
+ FIRST? BUREAU \?ELS3
+ CALL PRINT-CONTENTS,BUREAU
+ PRINTI ", as well as"
+ JUMP ?CND1
+?ELS3: PRINTI "nothing but"
+?CND1: PRINTR " your clothes."
+
+
+ .FUNCT PASSBOOK-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ FSET? PASSBOOK,RMUNGBIT \?ELS10
+ CALL TELL-SOGGY
+ RSTACK
+?ELS10: PRINTI "This is a distinctive "
+ CALL DPRINT,BANK
+ PRINTI " passbook"
+ IN? PASSBOOK,MCGINTY /?CND15
+ IN? PASSBOOK,WEASEL /?CND15
+ PRINTI " which shows a balance of $"
+ PRINTN PASSBOOK-BALANCE
+ PRINTI ". The last date stamped in it is "
+ PRINT STUPID-PROBLEM-STRING
+?CND15: PRINTR "."
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE,V?OPEN,V?READ \?ELS25
+ IN? PASSBOOK,WEASEL /?THN31
+ IN? PASSBOOK,MCGINTY \?ELS30
+?THN31: LOC PASSBOOK
+ CALL START-SENTENCE,STACK
+ PRINTR " has it."
+?ELS30: CALL PERFORM,V?EXAMINE,PASSBOOK
+ RTRUE
+?ELS25: EQUAL? PRSA,V?CLOSE \FALSE
+ PRINTR "It's closed."
+
+
+ .FUNCT KEY-F
+ EQUAL? PRSA,V?LOCK \?ELS5
+ EQUAL? PRSO,BEDROOM-DOOR \?ELS5
+ ZERO? BEDROOM-DOOR-LOCKED /?ELS12
+ CALL TELL-ALREADY,STR?38
+ RTRUE
+?ELS12: FSET? BEDROOM-DOOR,OPENBIT \?ELS15
+ PRINTR "You should close it first."
+?ELS15: SET 'BEDROOM-DOOR-LOCKED,TRUE-VALUE
+ CALL TELL-NOW,BEDROOM-DOOR,STR?38
+ RTRUE
+?ELS5: EQUAL? PRSA,V?UNLOCK \?ELS21
+ EQUAL? PRSO,BEDROOM-DOOR \?ELS21
+ ZERO? BEDROOM-DOOR-LOCKED \?ELS28
+ CALL TELL-ALREADY,STR?27
+ RTRUE
+?ELS28: SET 'BEDROOM-DOOR-LOCKED,FALSE-VALUE
+ CALL TELL-NOW,BEDROOM-DOOR,STR?27
+ RTRUE
+?ELS21: EQUAL? PRSA,V?OPEN \FALSE
+ EQUAL? PRSO,BEDROOM-DOOR \FALSE
+ CALL PERFORM,V?UNLOCK,BEDROOM-DOOR,KEY
+ CALL PERFORM,V?OPEN,BEDROOM-DOOR
+ RTRUE
+
+
+ .FUNCT NOTE-F
+ EQUAL? PRSA,V?READ,V?EXAMINE \FALSE
+ FSET? NOTE,RMUNGBIT \FALSE
+ CALL TELL-SOGGY
+ RSTACK
+
+
+ .FUNCT BOOK-F
+ FSET? BOOK,RMUNGBIT \?ELS5
+ EQUAL? PRSA,V?EXAMINE,V?READ,V?OPEN \?ELS5
+ CALL TELL-SOGGY
+ RSTACK
+?ELS5: EQUAL? PRSA,V?CLOSE,V?OPEN \FALSE
+ CALL PERFORM,V?READ,BOOK
+ RTRUE
+
+
+ .FUNCT CLOTHES-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?3
+ RTRUE
+?ELS5: EQUAL? PRSA,V?DISEMBARK,V?WEAR \FALSE
+ CALL TELL-CLOTHES
+ RSTACK
+
+
+ .FUNCT TELL-CLOTHES
+ PRINTR "What you have on now is fine."
+
+
+ .FUNCT CLOSET-F,RARG=0
+ EQUAL? RARG,M-OBJDESC /TRUE
+ EQUAL? PRSA,V?CLOSE,V?OPEN \?ELS7
+ PRINTR "The closet has no door."
+?ELS7: EQUAL? PRSA,V?EXAMINE \?ELS11
+ PRINTI "It looks as if the door was torn off its hinges a long time ago. "
+ RFALSE
+?ELS11: EQUAL? PRSA,V?BOARD,V?THROUGH \FALSE
+ CALL BEDROOM-W
+ RTRUE
+
+
+ .FUNCT WET-SUIT-F
+ EQUAL? PRSA,V?DISEMBARK,V?THROW,V?DROP \?ELS5
+ FSET? AIR-TANK,WORNBIT /?THN8
+ FSET? FLIPPERS,WORNBIT /?THN8
+ FSET? MASK,WORNBIT \?ELS5
+?THN8: CALL TELL-YOU-CANT,STR?236
+ RSTACK
+?ELS5: EQUAL? PRSA,V?WEAR \FALSE
+ FSET? DEEP-SUIT,WORNBIT \FALSE
+ CALL TELL-YOU-CANT,STR?237,FALSE-VALUE
+ CALL DPRINT,DEEP-SUIT
+ PRINTR "."
+
+
+ .FUNCT FLIPPERS-F
+ EQUAL? PRSA,V?WEAR \FALSE
+ FSET? WET-SUIT,WORNBIT /FALSE
+ FSET? DEEP-SUIT,WORNBIT \?ELS12
+ PRINTI "They don't fit with the "
+ CALL DPRINT,DEEP-SUIT
+ PRINTR "."
+?ELS12: PRINTI "The "
+ CALL DPRINT,WET-SUIT
+ PRINTR " won't fit over them."
+
+
+ .FUNCT MASK-F
+ EQUAL? PRSA,V?WEAR \?ELS5
+ FSET? WET-SUIT,WORNBIT /FALSE
+ FSET? DEEP-SUIT,WORNBIT \?ELS12
+ PRINTI "It won't fit over the "
+ CALL DPRINT,DEEP-SUIT
+ PRINTR "'s hood."
+?ELS12: PRINTI "You couldn't fit the "
+ CALL DPRINT,WET-SUIT
+ PRINTR " over it."
+?ELS5: GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \FALSE
+ FSET? MASK,WORNBIT \FALSE
+ EQUAL? PRSA,V?DISEMBARK,V?THROW,V?DROP \FALSE
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK \FALSE
+ CALL JIGS-UP,STR?238
+ RSTACK
+
+
+ .FUNCT AIR-TANK-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTI "This double tank made of aluminum is designed to fit over a "
+ CALL DPRINT,WET-SUIT
+ PRINTI ". Its gauge is currently at "
+ GRTR? AIR-LEFT,150 \?ELS10
+ PRINTI "full"
+ JUMP ?CND8
+?ELS10: GRTR? AIR-LEFT,100 \?ELS14
+ PRINTI "fairly full"
+ JUMP ?CND8
+?ELS14: GRTR? AIR-LEFT,50 \?ELS18
+ PRINTI "medium"
+ JUMP ?CND8
+?ELS18: GRTR? AIR-LEFT,15 \?ELS22
+ PRINTI "almost empty"
+ JUMP ?CND8
+?ELS22: PRINTI "empty"
+?CND8: PRINTR "."
+?ELS5: EQUAL? PRSA,V?FILL \?ELS32
+ EQUAL? PRSI,COMPRESSOR /?THN38
+ EQUAL? PRSI,AIR \?ELS37
+ IN? COMPRESSOR,HERE \?ELS37
+?THN38: GETP COMPRESSOR,P?NORTH
+ GRTR? STACK,0 \?ELS46
+ PRINTR "The salesman tells you to rent the compressor first."
+?ELS46: FSET? AIR-TANK,WORNBIT \?ELS50
+ CALL TELL-CONTORT
+ RSTACK
+?ELS50: SET 'AIR-LEFT,160
+ CALL TELL-NOW,AIR-TANK,STR?239
+ RSTACK
+?ELS37: EQUAL? PRSI,MM-COMPRESSOR \?ELS54
+ PRINTR "There's no way to get air from this compressor to the tank."
+?ELS54: EQUAL? PRSI,AIR \FALSE
+ PRINTR "The right compressor would probably help."
+?ELS32: EQUAL? PRSA,V?EMPTY \?ELS62
+ GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \?ELS67
+ CALL JIGS-UP,STR?240
+ RSTACK
+?ELS67: ZERO? AIR-LEFT \?ELS69
+ CALL TELL-ALREADY,STR?131
+ RSTACK
+?ELS69: SET 'AIR-LEFT,0
+ CALL TELL-NOW,AIR-TANK,STR?131
+ RSTACK
+?ELS62: EQUAL? PRSA,V?WEAR \?ELS73
+ FSET? WET-SUIT,WORNBIT /FALSE
+ FSET? DEEP-SUIT,WORNBIT \?ELS80
+ PRINTI "This tank can't be worn with a "
+ CALL DPRINT,DEEP-SUIT
+ PRINTR "."
+?ELS80: PRINTI "This tank should be worn outside a "
+ CALL DPRINT,WET-SUIT
+ PRINTR "."
+?ELS73: GETP HERE,P?LINE
+ EQUAL? STACK,UNDERWATER-LINE-C \FALSE
+ EQUAL? PRSA,V?THROW,V?DROP \FALSE
+ FSET? DEEP-SUIT,WORNBIT /FALSE
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK \FALSE
+ CALL JIGS-UP,STR?241
+ RSTACK
+
+
+ .FUNCT MCGINTY-HQ-F,RARG,DEST
+ EQUAL? RARG,M-ENTER \?ELS5
+ PUTP LOCKED-DOOR,P?SDESC,STR?211
+ PUTP GLOBAL-SURFACE,P?SDESC,STR?243
+ CALL MOVE-SHARED-OBJECTS,MCGINTY-HQ
+ RFALSE
+?ELS5: EQUAL? RARG,M-FLASH \?ELS7
+ ZERO? MCGINTY-HQ-OCCUPIED /?ELS12
+ IN? PASSBOOK,PLAYER /?CND14
+ CALL MCGINTY-F,M-OBJDESC
+ CRLF
+?CND14: CALL JIGS-UP,STR?244
+ RSTACK
+?ELS12: IN? MCGINTY,MCGINTY-HQ \FALSE
+ GET GOAL-TABLES,MCGINTY-C
+ GET STACK,GOAL-S >DEST
+ ZERO? DEST /FALSE
+ EQUAL? DEST,WHARF-ROAD-2 /FALSE
+ CALL MCGINTY-ERRAND
+ RSTACK
+?ELS7: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSO,GLOBAL-SURFACE \FALSE
+ EQUAL? PRSA,V?OPEN \?ELS32
+ PRINTR "It's locked."
+?ELS32: EQUAL? PRSA,V?UNLOCK \?ELS36
+ CALL TELL-NO-KEY
+ RSTACK
+?ELS36: EQUAL? PRSA,V?CLOSE \FALSE
+ CALL TELL-ALREADY,STR?26
+ RSTACK
+
+
+ .FUNCT MCGINTY-HQ-S,PRINT?=1
+ FSET? BACK-WINDOW,OPENBIT \?ELS5
+ CALL TELL-THRU-WINDOW
+ RETURN BACK-ALLEY-2
+?ELS5: EQUAL? PRSO,WINDOW \?ELS7
+ ZERO? PRINT? /FALSE
+ CALL TELL-CLOSED,STR?215
+ RFALSE
+?ELS7: ZERO? PRINT? /FALSE
+ PRINTI "The door is locked."
+ CRLF
+ RFALSE
+
+
+ .FUNCT TELL-THRU-WINDOW
+ PRINTI "You climb through the open window..."
+ CRLF
+ CRLF
+ RTRUE
+
+
+ .FUNCT MCGINTY-CHAIR-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?245
+ RTRUE
+?ELS5: EQUAL? PRSA,V?PUT-ON \?ELS7
+ PRINTR "It's too lopsided."
+?ELS7: EQUAL? PRSA,V?SIT-ON,V?CLIMB-ON \?ELS11
+ CALL TELL-WHY-BOTHER
+ RSTACK
+?ELS11: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "It's an impressively beat-up chair."
+
+
+ .FUNCT STUBS-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTR "The floor is littered with stubs from cheap cigars."
+?ELS5: EQUAL? PRSA,V?SMELL \?ELS9
+ PRINTR "The aroma is reminiscent of burning tires."
+?ELS9: EQUAL? PRSA,V?TAKE \FALSE
+ PRINTR "You think twice and realize you don't want to carry a used cigar."
+
+
+ .FUNCT ENVELOPE-F,L
+ EQUAL? PRSA,V?LOOK-UNDER,V?TAKE,V?OPEN \?ELS5
+ EQUAL? HERE,MCGINTY-HQ \?ELS5
+ IN? MCGINTY,MCGINTY-HQ \?ELS5
+ IN? ENVELOPE,PLAYER /?ELS5
+ CALL DPRINT,MCGINTY
+ PRINTR " squeals angrily. ""Keep your hands off of my private papers!"""
+?ELS5: EQUAL? PRSA,V?TAKE \?ELS11
+ IN? WEASEL,HERE \?ELS11
+ CALL WEASEL-BEATS-YOU
+ RSTACK
+?ELS11: IN? ENVELOPE,UNDER-BUNK \?ELS15
+ EQUAL? PRSA,V?ASK-ABOUT,V?TELL,V?TAKE /?ELS15
+ PRINTR "It's hidden under the mattress."
+?ELS15: IN? ENVELOPE,PLAYER /?ELS21
+ LOC ENVELOPE >L
+ FSET? L,PERSON \?ELS21
+ EQUAL? PRSA,V?OPEN \?ELS21
+ CALL START-SENTENCE,L
+ PRINTR " tells you to keep your hands off it."
+?ELS21: FSET? ENVELOPE,RMUNGBIT \FALSE
+ EQUAL? PRSA,V?EXAMINE \?ELS32
+ PRINTI "It's a soggy "
+ CALL DPRINT,ENVELOPE
+ PRINTR "."
+?ELS32: EQUAL? PRSA,V?READ \FALSE
+ CALL TELL-SOGGY
+ RSTACK
+
+
+ .FUNCT OUTFITTERS-HQ-F,RARG
+ EQUAL? RARG,M-ENTER \?ELS5
+ MOVE SPEAR-CARRIER,OUTFITTERS-HQ
+ PUTP SPEAR-CARRIER,P?SDESC,STR?251
+ PUTP SPEAR-CARRIER,P?LDESC,STR?252
+ PUTP GLOBAL-SURFACE,P?SDESC,STR?20
+ CALL MOVE-SHARED-OBJECTS,OUTFITTERS-HQ
+ CALL QUEUED?,I-EQUIP
+ ZERO? STACK /FALSE
+ IN? MCGINTY,OUTFITTERS-HQ /FALSE
+ SET 'I-WAIT-DURATION,9
+ SET 'I-WAIT-RTN,I-EQUIP
+ RFALSE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PSEUDO-OBJECT,PRSO,PRSI \?ELS17
+ CALL MERCHANDISE-PSEUDO
+ RSTACK
+?ELS17: EQUAL? PRSO,SALVAGER,TRAWLER \?ELS19
+ EQUAL? PRSA,V?RENT \?ELS24
+ ZERO? JOHNNY-MADE-DEAL /?ELS29
+ EQUAL? SHIP-CHOSEN,PRSO \?ELS29
+ PRINTR """Johnny already took care of that."""
+?ELS29: CALL TELL-YOU-CANT,STR?253
+ RSTACK
+?ELS24: EQUAL? PRSA,V?ASK-ABOUT,V?FIND,V?BUY /FALSE
+ EQUAL? PRSA,V?ASK-CONTEXT-ABOUT /FALSE
+ CALL GLOBAL-NOT-HERE-PRINT,PRSO
+ RSTACK
+?ELS19: EQUAL? PRSI,SALVAGER,TRAWLER \?ELS43
+ EQUAL? PRSA,V?TELL,V?ASK-ABOUT /FALSE
+ CALL GLOBAL-NOT-HERE-PRINT,PRSI
+ RSTACK
+?ELS43: EQUAL? PRSA,V?RENT,V?BUY \?ELS52
+ ZERO? AMT-OWED /?ELS52
+ PRINTI "The salesman looks sorry. ""I can't sell you anything until you pay the $"
+ PRINTN AMT-OWED
+ PRINTI " of "
+ CALL DPRINT,JOHNNY
+ PRINTR "'s."""
+?ELS52: EQUAL? PRSA,V?TAKE \?ELS58
+ GETP PRSO,P?NORTH
+ EQUAL? STACK,-1 \?ELS58
+ ZERO? JOHNNY-MADE-DEAL /?ELS58
+ ZERO? DELIVERY-MADE \?ELS58
+ IN? PRSO,PLAYER /?ELS58
+ PRINTR "The salesman says, ""Don't bother. It'll be delivered to the ship."""
+?ELS58: EQUAL? PRSA,V?LAMP-ON,V?OPEN \FALSE
+ GETP PRSO,P?NORTH
+ GRTR? STACK,0 \FALSE
+ PRINTR "The salesman stops you. ""You want to play with it, you buy it."""
+
+
+ .FUNCT MERCHANDISE-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?254
+ RTRUE
+?ELS5: CALL TELL-REFER-INDIVIDUAL,STR?255
+ RETURN 2
+
+
+ .FUNCT OUT-OF-STOCK-F
+ EQUAL? PRSA,V?BUY \?ELS5
+ PRINTI "The salesman checks and says, "
+ CALL TELL-WERE-OUT
+ RSTACK
+?ELS5: EQUAL? PRSA,V?ASK-ABOUT \?ELS9
+ EQUAL? HERE,OUTFITTERS-HQ \FALSE
+ CALL TELL-WERE-OUT
+ RSTACK
+?ELS9: EQUAL? PRSO,SPEAR-GUN /?THN17
+ EQUAL? PRSI,SPEAR-GUN \?ELS16
+?THN17: CALL GLOBAL-NOT-HERE-PRINT,SPEAR-GUN
+ RSTACK
+?ELS16: EQUAL? PRSO,COMPASS /?THN21
+ EQUAL? PRSI,COMPASS \?ELS20
+?THN21: CALL GLOBAL-NOT-HERE-PRINT,COMPASS
+ RSTACK
+?ELS20: CALL GLOBAL-NOT-HERE-PRINT,WINCH
+ RSTACK
+
+
+ .FUNCT TELL-WERE-OUT
+ PRINTR """We're out of those. Try next week."""
+
+
+ .FUNCT DRY-CELL-F
+ EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTI "The "
+ FSET? DRY-CELL,RMUNGBIT \?CND8
+ PRINTI "corroded "
+?CND8: CALL DPRINT,DRY-CELL
+ PRINTI " reads "
+ RFALSE
+
+
+ .FUNCT NET-F
+ EQUAL? PRSA,V?THROW-OFF,V?PUT-ON \FALSE
+ EQUAL? PRSO,NET \FALSE
+ MOVE NET,HERE
+ PRINTR "It slides off."
+
+
+ .FUNCT BATTERY-F
+ EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTI "The "
+ FSET? BATTERY,RMUNGBIT \?ELS10
+ PRINTI "corroded"
+ JUMP ?CND8
+?ELS10: PRINTI "standard"
+?CND8: PRINTI " battery reads "
+ RFALSE
+
+
+ .FUNCT TUBE-F
+ EQUAL? PRSA,V?PUT \?ELS5
+ EQUAL? PRSI,TUBE \?ELS5
+ PRINTR "The tube refuses to accept anything."
+?ELS5: EQUAL? PRSA,V?PUT-ON,V?PUT \?ELS11
+ EQUAL? PRSI,GLASS-CASE \?ELS11
+ FSET? TUBE,OPENBIT \?ELS11
+ IN? PUTTY,TUBE \?ELS11
+ CALL PERFORM,V?PUT-ON,PUTTY,GLASS-CASE
+ RTRUE
+?ELS11: EQUAL? PRSA,V?SQUEEZE \FALSE
+ FSET? PRSO,OPENBIT \?ELS20
+ IN? PUTTY,PRSO \?ELS20
+ MOVE PUTTY,WINNER
+ PRINTR "You are now holding some putty."
+?ELS20: FSET? PRSO,OPENBIT \?ELS26
+ PRINTR "The tube is apparently empty."
+?ELS26: CALL TELL-CLOSED,STR?260
+ RSTACK
+
+
+ .FUNCT PUTTY-F
+ CALL COMPILER-SUCKS-EXP
+ ZERO? STACK /?ELS5
+ IN? PUTTY,GLASS-CASE \?ELS10
+ CALL TELL-IN-CRACK
+ RSTACK
+?ELS10: MOVE PUTTY,GLASS-CASE
+ CALL INT,I-CASE-LEAK
+ PUT STACK,0,0
+ PRINTI "The putty seals the crack"
+ IN? HOLE-1,GLASS-CASE /?THN18
+ IN? HOLE-2,GLASS-CASE \?ELS17
+?THN18: PRINTI " and hole"
+ JUMP ?CND15
+?ELS17: SET 'NO-HOLE-PLUGGED,TRUE-VALUE
+?CND15: PRINTI " in the "
+ CALL DPRINT,GLASS-CASE
+ PRINTR "."
+?ELS5: IN? PUTTY,GLASS-CASE \?ELS27
+ EQUAL? PRSA,V?FIND,V?EXAMINE /?ELS27
+ CALL TELL-IN-CRACK
+ RSTACK
+?ELS27: EQUAL? PRSA,V?OIL \?ELS35
+ EQUAL? PRSI,PUTTY /?THN32
+?ELS35: EQUAL? PRSA,V?PUT \FALSE
+ EQUAL? PRSO,PUTTY \FALSE
+?THN32: EQUAL? PRSI,TUBE \?ELS42
+ CALL TELL-YOU-CANT,STR?261
+ RSTACK
+?ELS42: PRINTR "It isn't a lubricant."
+
+
+ .FUNCT COMPILER-SUCKS-EXP
+ EQUAL? PRSA,V?PUT-ON,V?PUT \?ELS5
+ EQUAL? PRSI,GLASS-CASE /TRUE
+ EQUAL? PRSI,HOLE-1 \?ELS11
+ IN? HOLE-1,GLASS-CASE /TRUE
+?ELS11: EQUAL? PRSI,HOLE-2 \?ELS5
+ IN? HOLE-2,GLASS-CASE /TRUE
+?ELS5: EQUAL? PRSA,V?PLUG,V?FILL \FALSE
+ EQUAL? PRSO,GLASS-CASE /TRUE
+ EQUAL? PRSO,HOLE-1 \?ELS21
+ IN? HOLE-1,GLASS-CASE /TRUE
+?ELS21: EQUAL? PRSO,HOLE-2 \FALSE
+ IN? HOLE-2,GLASS-CASE \FALSE
+ RTRUE
+
+
+ .FUNCT TELL-IN-CRACK
+ PRINTR "The putty is already set in the crack."
+
+
+ .FUNCT INFIDEL-BOX-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ PRINTR "This is state-of-the-art electronic equipment that automatically determines longitude and latitude when its button is pressed."
+?ELS5: EQUAL? PRSA,V?PUSH \FALSE
+ PRINTR "Nothing happens, probably because you're indoors."
+
+
+ .FUNCT DIVING-BOOK-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ FSET? DIVING-BOOK,RMUNGBIT \?ELS10
+ CALL TELL-SOGGY
+ RSTACK
+?ELS10: PRINTR "This book is ""Everything About Diving"" by Fritz Zamboni."
+?ELS5: EQUAL? PRSA,V?OPEN,V?READ \FALSE
+ FSET? DIVING-BOOK,RMUNGBIT \?ELS21
+ CALL TELL-SOGGY
+ RSTACK
+?ELS21: PRINTR "It says nothing you don't already know."
+
+
+ .FUNCT TELL-SOGGY
+ PRINTR "It's too soggy."
+
+
+ .FUNCT MAGNET-F,RARG=0,F,N,OBJ
+ EQUAL? RARG,M-CONT \?ELS5
+ EQUAL? PRSA,V?WEAR,V?TAKE \?ELS10
+ EQUAL? PRSO,MINE /?ELS10
+ ZERO? MAGNET-ON /?ELS10
+ PRINTR "The magnet's stronger than you are."
+?ELS10: EQUAL? PRSA,V?THROW,V?DROP \FALSE
+ PRINTR "It's stuck to the magnet."
+?ELS5: EQUAL? RARG,M-OBJDESC \?ELS20
+ PRINTI "There is a "
+ CALL DPRINT,MAGNET
+ PRINTI " here."
+ CRLF
+ FIRST? MAGNET >F \TRUE
+ EQUAL? F,MINE /TRUE /?ELS30
+ PRINTI "Attached to the magnet "
+ NEXT? F \?ELS36
+ PRINTI "are"
+ JUMP ?CND34
+?ELS36: PRINTI "is"
+?CND34: PRINTI " "
+ CALL PRINT-CONTENTS,MAGNET
+ PRINTR "."
+?ELS30: CALL DESCRIBE-OBJECT,F,TRUE-VALUE,0
+ RTRUE
+?ELS20: EQUAL? PRSA,V?EXAMINE \?ELS50
+ ZERO? MAGNET-ON /?ELS55
+ FIRST? MAGNET \?ELS55
+ PRINTI "The "
+ CALL DPRINT,MAGNET
+ PRINTI " is on and has "
+ CALL PRINT-CONTENTS,MAGNET
+ PRINTI " attached to it."
+ CRLF
+ SET 'P-IT-OBJECT,MAGNET
+ RETURN P-IT-OBJECT
+?ELS55: PRINTI "The "
+ CALL DPRINT,MAGNET
+ PRINTI " has a switch which is currently "
+ ZERO? MAGNET-ON /?ELS68
+ PRINTI "on"
+ JUMP ?CND66
+?ELS68: PRINTI "off"
+?CND66: PRINTR "."
+?ELS50: EQUAL? PRSA,V?LAMP-ON \?ELS79
+ ZERO? MAGNET-ON /?ELS84
+ CALL TELL-ALREADY,STR?56
+ RSTACK
+?ELS84: SET 'MAGNET-ON,TRUE-VALUE
+ CALL TELL-NOW,MAGNET,STR?56
+ CALL ATTRACTION
+ RSTACK
+?ELS79: EQUAL? PRSA,V?LAMP-OFF \?ELS89
+ ZERO? MAGNET-ON /?ELS94
+ SET 'MAGNET-ON,FALSE-VALUE
+ CALL TELL-NOW,MAGNET,STR?263,FALSE-VALUE
+ FIRST? MAGNET >F \?CND96
+ CALL TELL-ALL-FALL
+?PRG99: ZERO? F \?CND101
+ JUMP ?CND96
+?CND101: NEXT? F >N /?KLU170
+?KLU170: MOVE F,HERE
+ EQUAL? F,MINE \?CND104
+ FSET MINE,RMUNGBIT
+ CRLF
+ PRINTI "The mine drifts harmlessly into a corner."
+?CND104: SET 'F,N
+ JUMP ?PRG99
+?CND96: CRLF
+ RTRUE
+?ELS94: CALL TELL-ALREADY,STR?264
+ RSTACK
+?ELS89: EQUAL? PRSA,V?THROW,V?DROP \?ELS112
+ IN? MINE,MAGNET \?ELS117
+ ZERO? MAGNET-ON /?ELS120
+ FSET MINE,RMUNGBIT
+ RFALSE
+?ELS120: MOVE MINE,HERE
+ RFALSE
+?ELS117: ZERO? MAGNET-ON \FALSE
+ CALL CLEAR-MAGNET
+ RFALSE
+?ELS112: EQUAL? PRSA,V?TAKE \?ELS127
+ EQUAL? PRSO,MAGNET \?ELS127
+ IN? MINE,MAGNET \FALSE
+ CALL BOOM
+ RSTACK
+?ELS127: EQUAL? PRSA,V?PUT-AGAINST,V?PUT-ON \?ELS140
+ EQUAL? PRSO,MAGNET \?ELS140
+ SET 'OBJ,PRSI
+ ZERO? OBJ \?THN137
+?ELS140: EQUAL? PRSA,V?RUB \FALSE
+ EQUAL? PRSI,MAGNET \FALSE
+ SET 'OBJ,PRSO
+ ZERO? OBJ /FALSE
+?THN137: FSET? OBJ,SURFACEBIT \?ELS147
+ CALL CLEAR-MAGNET
+ RFALSE
+?ELS147: ZERO? MAGNET-ON \?THN150
+ EQUAL? OBJ,ME /?THN150
+ GETP OBJ,P?CHARACTER
+ ZERO? STACK /?ELS149
+?THN150: CALL TELL-WHY-BOTHER
+ RSTACK
+?ELS149: IN? OBJ,PLAYER \?ELS153
+ PRINTI "The magnet is touching "
+ CALL THE?,PRSI
+ CALL DPRINT,PRSI
+ PRINTR "."
+?ELS153: FIRST? MAGNET >F \?CND160
+ MOVE F,HERE
+?CND160: LOC OBJ >N
+ ZERO? N /?CND163
+ EQUAL? N,GLOBAL-OBJECTS,LOCAL-GLOBALS /?CND163
+ MOVE OBJ,MAGNET
+?CND163: CALL TELL-NOW,MAGNET,STR?265,FALSE-VALUE
+ CALL THE?,OBJ
+ CALL DPRINT,OBJ
+ PRINTR "."
+
+
+ .FUNCT TELL-NOW,OBJ,STR,FINISH?=1
+ PRINTI "The "
+ CALL DPRINT,OBJ
+ PRINTI " is now "
+ PRINT STR
+ ZERO? FINISH? /FALSE
+ PRINTR "."
+
+
+ .FUNCT ATTRACTION,F,N
+ FIRST? HERE >F /?KLU30
+?KLU30: FIRST? MAGNET >N \?CND1
+ GETP N,P?STATION
+ ZERO? STACK /?THN6
+ FSET? N,TAKEBIT /?CND1
+?THN6: MOVE N,HERE
+?CND1:
+?PRG8: ZERO? F /TRUE
+ NEXT? F >N /?KLU31
+?KLU31: FSET? F,INVISIBLE /?CND13
+ GETP F,P?STATION
+ ZERO? STACK /?CND13
+ FSET? F,TAKEBIT \?CND13
+ EQUAL? F,MAGNET /?CND13
+ MOVE F,MAGNET
+ EQUAL? F,IRON-BAR \?CND18
+ EQUAL? HERE,WRECK-5 \?CND18
+ CALL JIGS-UP,STR?266
+?CND18: PRINTI "The "
+ CALL DPRINT,F
+ PRINTI " jumps to the magnet."
+ EQUAL? F,MINE \?CND25
+ PRINTI " Unfortunately, even though the spikes are spaced widely apart, one gets pushed..."
+ CRLF
+ CRLF
+ CALL BOOM
+?CND25: CRLF
+?CND13: SET 'F,N
+ JUMP ?PRG8
+
+
+ .FUNCT CLEAR-MAGNET,F,N
+ FIRST? MAGNET >F /?KLU6
+?KLU6:
+?PRG1: ZERO? F /TRUE
+ NEXT? F >N /?KLU7
+?KLU7: MOVE F,HERE
+ SET 'F,N
+ JUMP ?PRG1
+
+
+ .FUNCT FLASHLIGHT-F
+ EQUAL? PRSA,V?LAMP-ON \?ELS5
+ FSET? FLASHLIGHT,ONBIT \?ELS10
+ CALL TELL-ALREADY,STR?56
+ RSTACK
+?ELS10: FSET FLASHLIGHT,ONBIT
+ CALL TELL-NOW,FLASHLIGHT,STR?56
+ ZERO? LIT \TRUE
+ CALL LIT?,HERE >LIT
+ CRLF
+ CALL V-LOOK
+ RTRUE
+?ELS5: EQUAL? PRSA,V?LAMP-OFF \?ELS17
+ FSET? FLASHLIGHT,ONBIT \?ELS22
+ FCLEAR FLASHLIGHT,ONBIT
+ CALL LIT?,HERE >LIT
+ CALL TELL-NOW,FLASHLIGHT,STR?264
+ RSTACK
+?ELS22: CALL TELL-ALREADY,STR?264
+ RSTACK
+?ELS17: EQUAL? PRSA,V?EXAMINE \?ELS26
+ PRINTI "The sealed, waterproof "
+ CALL DPRINT,FLASHLIGHT
+ PRINTI " is "
+ FSET? FLASHLIGHT,ONBIT \?ELS31
+ PRINTI "on"
+ JUMP ?CND29
+?ELS31: PRINTI "off"
+?CND29: PRINTR "."
+?ELS26: EQUAL? PRSA,V?AIM \FALSE
+ EQUAL? PRSO,FLASHLIGHT \FALSE
+ FSET? FLASHLIGHT,ONBIT \FALSE
+ PRINTI "The "
+ CALL DPRINT,FLASHLIGHT
+ PRINTI " is shining on "
+ CALL THE?,PRSI
+ CALL DPRINT,PRSI
+ PRINTR "."
+
+
+ .FUNCT SHARK-REPELLENT-F
+ EQUAL? PRSA,V?OPEN \?ELS5
+ FSET? SHARK-REPELLENT,OPENBIT \?ELS10
+ CALL TELL-ALREADY,STR?25
+ RSTACK
+?ELS10: FSET SHARK-REPELLENT,OPENBIT
+ PRINTI "Opened."
+ GETP HERE,P?LINE
+ LESS? STACK,UNDERWATER-LINE-C /?THN18
+ CALL AIRTIGHT-ROOM?
+ ZERO? STACK /?CND15
+?THN18: CALL JIGS-UP,STR?267
+?CND15: CRLF
+ RTRUE
+?ELS5: EQUAL? PRSA,V?CLOSE \?ELS21
+ FSET? SHARK-REPELLENT,OPENBIT \?ELS26
+ PRINTR "It can't be closed."
+?ELS26: CALL TELL-ALREADY,STR?26
+ RSTACK
+?ELS21: EQUAL? PRSA,V?EXAMINE \?ELS32
+ PRINTI "The canister, which is "
+ FSET? SHARK-REPELLENT,OPENBIT \?ELS37
+ PRINTI "open"
+ JUMP ?CND35
+?ELS37: PRINTI "closed"
+?CND35: PRINTR ", has a label which says, ""IMPORTANT: read this label!"""
+?ELS32: EQUAL? PRSA,V?READ \FALSE
+ PRINTR "The label says: ""IMPORTANT: read this label!
+
+SWANZO BRAND SHARK REPELLENT
+
+This product will repel sharks, or your money back! Simply open the canister UNDERWATER. Works for 5 hours. WARNING: Fumes released in air may be hazardous to humans."""
+
+
+ .FUNCT SHANTY-F,RARG
+ EQUAL? RARG,M-ENTER \?ELS5
+ MOVE FOOD,SHANTY
+ FSET FOOD,NDESCBIT
+ SET 'SOUPS-ON,FALSE-VALUE
+ MOVE DRINKING-WATER,SHANTY
+ FSET DRINKING-WATER,NDESCBIT
+ MOVE DRINK-OBJECT,SHANTY
+ FSET DRINK-OBJECT,NDESCBIT
+ PUTP DRINKING-WATER,P?SDESC,STR?271
+ MOVE SPEAR-CARRIER,SHANTY
+ PUTP SPEAR-CARRIER,P?SDESC,STR?272
+ PUTP SPEAR-CARRIER,P?LDESC,STR?273
+ LESS? PRESENT-TIME,541 \?ELS10
+ CALL QUEUE,I-FIRST-MEETING,-1
+ PUT STACK,0,1
+ RTRUE
+?ELS10: SET 'FM-CTR,5
+ RETURN FM-CTR
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSA,V?YES \?ELS19
+ EQUAL? FM-CTR,4 \?ELS19
+ PRINT WARNING-STR
+ CRLF
+ SET 'FM-CTR,5
+ CALL RATING-UPD,20
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ SET 'MEETINGS-COMPLETED,1
+ RETURN MEETINGS-COMPLETED
+?ELS19: EQUAL? PRSA,V?NO \FALSE
+ EQUAL? FM-CTR,4 \FALSE
+ CALL TELL-NO-CONTINUE
+ CALL I-PLOT-NEVER-STARTS
+ SET 'JOHNNY-SILENT,TRUE-VALUE
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ RTRUE
+
+
+ .FUNCT TELL-NO-CONTINUE
+ PRINTI "The three men look at each other in disbelief. ""If you wanna ignore the chance of a lifetime, you're nuts,"" "
+ CALL DPRINT,WEASEL
+ PRINTR " states. Johnny says, ""We'll find someone else."" They then ignore you."
+
+
+ .FUNCT PARROT-F
+ EQUAL? WINNER,PARROT \?ELS5
+ SET 'P-CONT,FALSE-VALUE
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ EQUAL? PRSA,V?HELLO \?ELS8
+ CALL PICK-ONE,PARROTISMS
+ PRINT STACK
+ CRLF
+ RTRUE
+?ELS8: EQUAL? PRSA,V?FIND \?ELS12
+ EQUAL? PRSO,ME \?ELS12
+ PRINTR """You're right here."""
+?ELS12: PRINTR """An interesting concept, but I am incapable."""
+?ELS5: EQUAL? PRSA,V?TELL \?ELS22
+ ZERO? P-CONT \FALSE
+?ELS22: EQUAL? PRSA,V?FIND,V?EXAMINE /FALSE
+ EQUAL? HERE,SHANTY \FALSE
+ EQUAL? PRSA,V?LOOK-UNDER \?ELS30
+ CALL TELL-NOTHING,STR?276,TRUE-VALUE
+ RSTACK
+?ELS30: EQUAL? PRSA,V?ASK-ABOUT \?ELS32
+ EQUAL? PRSI,PARROT /FALSE
+?ELS32: CALL PICK-ONE,PARROTISMS
+ PRINT STACK
+ CRLF
+ RTRUE
+
+
+ .FUNCT PARROTS-PATCH-F
+ EQUAL? PRSA,V?DISEMBARK,V?ASK-FOR,V?LOOK-UNDER /?THN10
+ EQUAL? PRSA,V?MOVE /?THN10
+ EQUAL? PRSA,V?TAKE \?ELS5
+ ZERO? PRSI /?THN10
+ EQUAL? PRSI,PARROT \?ELS5
+?THN10: PRINTR "Mind your manners."
+?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "It's a small black eyepatch."
+
+
+ .FUNCT CHAIR-F,RARG=0,F
+ EQUAL? RARG,M-BEG \?ELS5
+ EQUAL? PRSA,V?DISEMBARK \?ELS10
+ EQUAL? PRSO,CHAIR \?ELS10
+ LESS? FM-CTR,5 \?ELS10
+ PRINTR "Johnny pushes you back. ""Can't you wait a few minutes?"""
+?ELS10: EQUAL? PRSA,V?YES \?ELS16
+ EQUAL? FM-CTR,4 \?ELS16
+ PRINT WARNING-STR
+ CRLF
+ SET 'FM-CTR,5
+ CALL RATING-UPD,20
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ SET 'MEETINGS-COMPLETED,1
+ RETURN MEETINGS-COMPLETED
+?ELS16: EQUAL? PRSA,V?NO \FALSE
+ EQUAL? FM-CTR,4 \FALSE
+ CALL TELL-NO-CONTINUE
+ CALL I-PLOT-NEVER-STARTS
+ CALL INT,I-FIRST-MEETING
+ PUT STACK,0,0
+ RTRUE
+?ELS5: EQUAL? PRSO,CHAIR \FALSE
+ EQUAL? PRSA,V?BOARD \FALSE
+ FIRST? CHAIR >F \?ELS36
+ CALL TELL-NOT-COMFORTABLE
+ RSTACK
+?ELS36: ZERO? FM-CTR \FALSE
+ SET 'FM-CTR,1
+ CALL INT,I-PLOT-NEVER-STARTS
+ PUT STACK,0,0
+ RFALSE
+
+
+ .FUNCT FURNITURE-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?283
+ RTRUE
+?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "There are a number of tables and chairs here."
+
+
+ .FUNCT BAR-F,F
+ EQUAL? PRSA,V?CLOSE,V?OPEN \?ELS5
+ PRINTR "Leave that to the management."
+?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS9
+ PRINTI "It is a worn wooden bar that has had more than its share of drinks on it. The parrot doesn't do it much good, either"
+ FIRST? BAR >F \?CND12
+ PRINTI ". Sitting on the bar "
+ NEXT? F \?ELS19
+ PRINTI "are "
+ JUMP ?CND17
+?ELS19: PRINTI "is "
+?CND17: CALL PRINT-CONTENTS,BAR
+?CND12: PRINTR "."
+?ELS9: EQUAL? PRSA,V?LOOK-BEHIND \FALSE
+ PRINTR "The bartender is there."
+
+
+ .FUNCT MIRROR-F
+ EQUAL? PRSA,V?EXAMINE,V?LOOK-INSIDE \?ELS5
+ PRINTR "You see grime rather than a reflection."
+?ELS5: EQUAL? PRSA,V?CLEAN \?ELS9
+ CALL TELL-CANT-REACH,STR?284
+ RSTACK
+?ELS9: EQUAL? PRSA,V?MUNG \FALSE
+ PRINTR "That would be unlucky."
+
+
+ .FUNCT FOOD-F
+ EQUAL? PRSA,V?FIND \?ELS5
+ ZERO? P-NONOUN /?ELS5
+ EQUAL? P-XADJN,W?BEEF \?ELS5
+ PRINTR "Gimme a break!"
+?ELS5: EQUAL? PRSA,V?BUY \?ELS11
+ GETP HERE,P?LINE
+ GRTR? STACK,BACK-ALLEY-LINE-C \?ELS16
+ PRINTR "Free food is a benefit of this job."
+?ELS16: ZERO? HOW-HUNGRY \?ELS20
+ CALL TELL-WAIT-HUNGRY
+ RSTACK
+?ELS20: ZERO? SOUPS-ON /?ELS22
+ PRINTR "You only need one meal at a time."
+?ELS22: LESS? POCKET-CHANGE,5 \?ELS27
+ CALL TELL-NO-AFFORD
+ RSTACK
+?ELS27: SUB POCKET-CHANGE,5 >POCKET-CHANGE
+ SET 'SOUPS-ON,TRUE-VALUE
+ MOVE FOOD,TABLE-OBJECT
+ FCLEAR FOOD,NDESCBIT
+ PRINTR "You have bought a meal for $5."
+?ELS11: EQUAL? PRSA,V?EAT \?ELS33
+ ZERO? SOUPS-ON /?ELS38
+ ZERO? HOW-HUNGRY \?CND40
+ CALL TELL-WAIT-HUNGRY
+ RTRUE
+?CND40: CALL QUEUE,I-HUNGER,150
+ PUT STACK,0,1
+ SET 'HOW-HUNGRY,0
+ EQUAL? HERE,SHANTY \?CND43
+ SET 'SOUPS-ON,FALSE-VALUE
+ FSET FOOD,NDESCBIT
+ MOVE FOOD,SHANTY
+?CND43: PRINTR "Not bad! It really hit the spot."
+?ELS38: EQUAL? HERE,SHANTY \?ELS49
+ PRINTR "You'll have to buy it before you can eat it."
+?ELS49: PRINTR "You'll have to wait for Pete to finish fixing it."
+?ELS33: EQUAL? PRSA,V?SMELL \?ELS57
+ PRINTR "It smells fairly tasty."
+?ELS57: EQUAL? PRSA,V?EXAMINE \?ELS61
+ GETP HERE,P?LINE
+ GRTR? STACK,BACK-ALLEY-LINE-C \?ELS66
+ PRINTR "It looks like a pretty standard stew."
+?ELS66: ZERO? SOUPS-ON /?ELS70
+ PRINTI "This stew is a staple of "
+ CALL DPRINT,SHANTY
+ PRINTR " and is edible."
+?ELS70: CALL GLOBAL-NOT-HERE-PRINT,PRSO
+ RSTACK
+?ELS61: EQUAL? PRSA,V?FIND \FALSE
+ IN? FOOD,TABLE-OBJECT \?ELS82
+ PRINTR "It's on the table."
+?ELS82: CALL META-LOC,PLAYER
+ EQUAL? STACK,SHANTY \FALSE
+ PRINTR "You can order food here."
+
+
+ .FUNCT TELL-WAIT-HUNGRY
+ PRINTR "Wait until you're a little hungrier."
+
+
+ .FUNCT DRINKING-WATER-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ IN? DRINKING-WATER,TABLE-OBJECT \?ELS10
+ PRINTR "It's a glass of water, what else?"
+?ELS10: EQUAL? HERE,MM-GALLEY,NW-GALLEY \?ELS14
+ PRINTR "There's a tap in the sink which dispenses bottled water."
+?ELS14: PRINTR "You can ask the bartender for a glass."
+?ELS5: EQUAL? PRSA,V?DRINK \?ELS22
+ IN? DRINKING-WATER,TABLE-OBJECT /?THN28
+ EQUAL? HERE,MM-GALLEY,NW-GALLEY \?ELS27
+?THN28: GRTR? SLOSH-CTR,4 \?ELS34
+ PRINTR "Are you trying to do an ocean imitation?"
+?ELS34: SET 'HOW-THIRSTY,0
+ INC 'SLOSH-CTR
+ CALL QUEUE,I-THIRST,180
+ PUT STACK,0,1
+ MOVE DRINKING-WATER,HERE
+ FSET DRINKING-WATER,NDESCBIT
+ PUTP DRINKING-WATER,P?SDESC,STR?271
+ PRINTR "You feel much refreshed."
+?ELS27: CALL META-LOC,PLAYER
+ EQUAL? STACK,SHANTY \FALSE
+ CALL TELL-ASK-FIRST
+ RSTACK
+?ELS22: EQUAL? PRSA,V?BUY \?ELS44
+ EQUAL? HERE,MM-GALLEY,NW-GALLEY \?ELS44
+ CALL TELL-JUST
+ RSTACK
+?ELS44: EQUAL? PRSA,V?TAKE \?ELS48
+ IN? DRINKING-WATER,SHANTY \?ELS53
+ CALL TELL-ASK-FIRST
+ RSTACK
+?ELS53: CALL TELL-JUST
+ RSTACK
+?ELS48: EQUAL? PRSA,V?FIND \FALSE
+ IN? DRINKING-WATER,TABLE-OBJECT \?ELS62
+ PRINTR "It's on the table."
+?ELS62: CALL META-LOC,PLAYER
+ EQUAL? STACK,SHANTY \FALSE
+ PRINTR "You can order water here."
+
+
+ .FUNCT TELL-ASK-FIRST
+ PRINTR "Ask the bartender for some water first."
+
+
+ .FUNCT TELL-JUST
+ PRINTR "Just drink it."
+
+
+ .FUNCT DRINK-OBJECT-F
+ EQUAL? PRSA,V?EXAMINE \?ELS5
+ IN? DRINK-OBJECT,TABLE-OBJECT \?ELS10
+ PRINTR "It's grog which has left many staggering."
+?ELS10: CALL TELL-BUY-FIRST
+ RSTACK
+?ELS5: EQUAL? PRSA,V?BUY \?ELS16
+ IN? DRINK-OBJECT,TABLE-OBJECT \?ELS21
+ CALL TELL-YOU-ALREADY,STR?285
+ RSTACK
+?ELS21: LESS? POCKET-CHANGE,2 \?ELS23
+ CALL TELL-NO-AFFORD
+ RSTACK
+?ELS23: MOVE DRINK-OBJECT,TABLE-OBJECT
+ FCLEAR DRINK-OBJECT,NDESCBIT
+ SUB POCKET-CHANGE,2 >POCKET-CHANGE
+ PRINTR "You have bought a drink for $2."
+?ELS16: EQUAL? PRSA,V?DRINK \?ELS29
+ IN? DRINK-OBJECT,TABLE-OBJECT \?ELS34
+ MOVE DRINK-OBJECT,SHANTY
+ CALL QUEUE,I-THIRST,90
+ PUT STACK,0,1
+ SET 'HOW-THIRSTY,0
+ FSET DRINK-OBJECT,NDESCBIT
+ ADD BLOOD-ALCOHOL,6 >BLOOD-ALCOHOL
+ PRINTR "It burns your throat on the way down."
+?ELS34: CALL TELL-BUY-FIRST
+ RSTACK
+?ELS29: EQUAL? PRSA,V?TASTE \?ELS40
+ IN? DRINK-OBJECT,TABLE-OBJECT /FALSE
+ CALL TELL-BUY-FIRST
+ RSTACK
+?ELS40: EQUAL? PRSA,V?FIND \FALSE
+ IN? DRINK-OBJECT,TABLE-OBJECT \?ELS52
+ PRINTR "It's on the table."
+?ELS52: CALL META-LOC,PLAYER
+ EQUAL? STACK,SHANTY \FALSE
+ PRINTR "You can order grog here."
+
+
+ .FUNCT TELL-BUY-FIRST
+ PRINTR "You'll have to order one first."
+
+
+ .FUNCT NON-DRINK-F
+ CALL TELL-YOUD-BETTER,STR?286
+ RSTACK
+
+
+ .FUNCT BANK-F,RARG
+ EQUAL? RARG,M-ENTER \?ELS5
+ MOVE SPEAR-CARRIER,BANK
+ PUTP SPEAR-CARRIER,P?SDESC,STR?288
+ PUTP SPEAR-CARRIER,P?LDESC,STR?289
+ RTRUE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSA,V?WITHDRAW \?ELS12
+ EQUAL? PRSO,INTNUM \FALSE
+ ZERO? P-DOLLAR-FLAG \?ELS19
+ CALL TELL-YOU-CANT,STR?290
+ RSTACK
+?ELS19: LESS? P-AMOUNT,1 \?ELS21
+ CALL TELL-SERIOUS
+ RSTACK
+?ELS21: IN? PASSBOOK,PLAYER /?ELS23
+ PRINTR "The teller points out that you don't have your passbook."
+?ELS23: GRTR? P-AMOUNT,PASSBOOK-BALANCE \?ELS27
+ PRINTR "The teller takes your passbook, checks the balance, tells you that there's not enough to cover your planned withdrawal, and returns it."
+?ELS27: SUB PASSBOOK-BALANCE,P-AMOUNT >PASSBOOK-BALANCE
+ ADD POCKET-CHANGE,P-AMOUNT >POCKET-CHANGE
+ SET 'STUPID-PROBLEM-STRING,STR?291
+ PRINTR "The teller takes your passbook, enters the withdrawal, hands you the money and your passbook, and says ""Have a good day."""
+?ELS12: EQUAL? PRSA,V?DEPOSIT \FALSE
+ ZERO? PRSI /?ELS40
+ EQUAL? PRSI,GLOBAL-BANK /?ELS40
+ CALL PERFORM,V?PUT,PRSO,PRSI
+ RTRUE
+?ELS40: ZERO? P-DOLLAR-FLAG /?THN45
+ EQUAL? PRSO,INTNUM /?ELS44
+?THN45: CALL HELD?,PRSO
+ ZERO? STACK \?ELS51
+ CALL TELL-DONT-HAVE,FALSE-VALUE
+ CALL THE?,PRSO
+ CALL DPRINT,PRSO
+ PRINTR "."
+?ELS51: PRINTI "The teller looks at the "
+ CALL DPRINT,PRSO
+ PRINTR " and returns it, pointing out that you don't have a safe deposit box."
+?ELS44: GRTR? P-AMOUNT,POCKET-CHANGE \?ELS59
+ CALL TELL-YOU-CANT,STR?292
+ RSTACK
+?ELS59: LESS? P-AMOUNT,1 \?ELS61
+ CALL TELL-SERIOUS
+ RSTACK
+?ELS61: IN? PASSBOOK,PLAYER /?ELS63
+ PRINTR "The teller points out that you need to have your passbook."
+?ELS63: ADD PASSBOOK-BALANCE,P-AMOUNT >PASSBOOK-BALANCE
+ SUB POCKET-CHANGE,P-AMOUNT >POCKET-CHANGE
+ SET 'STUPID-PROBLEM-STRING,STR?291
+ PRINTI "The teller takes your money and passbook, records the deposit, returns the passbook, and says ""Thank you for banking at "
+ CALL DPRINT,BANK
+ PRINTR "."""
+
+
+ .FUNCT RIDICULOUS-MONEY-KLUDGE-F
+ EQUAL? PRSA,V?ASK-ABOUT /FALSE
+ EQUAL? PRSA,V?COUNT,V?FIND \?ELS7
+ CALL PERFORM,PRSA,GLOBAL-MONEY
+ RTRUE
+?ELS7: PRINTR "You should specify an amount."
+
+
+ .FUNCT VAULT-F
+ EQUAL? PRSA,V?THROUGH \?ELS5
+ EQUAL? HERE,BANK /?ELS5
+ CALL GLOBAL-NOT-HERE-PRINT,SAFE
+ RSTACK
+?ELS5: EQUAL? PRSA,V?LOOK-INSIDE,V?EXAMINE \?ELS9
+ PRINTR "The safe is behind the teller's window and is mostly empty."
+?ELS9: EQUAL? PRSA,V?FIND,V?ASK-ABOUT /FALSE
+ PRINTR "There's no way you can get at the safe."
+
+
+ .FUNCT POINT-LOOKOUT-F,RARG
+ EQUAL? RARG,M-ENTER \?ELS5
+ EQUAL? MEETINGS-COMPLETED,2 \FALSE
+ LESS? PRESENT-TIME,660 \FALSE
+ CALL QUEUE,I-THIRD-MEETING,-1
+ PUT STACK,0,1
+ RTRUE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSA,V?LEAP \?ELS19
+ CALL JIGS-UP,STR?295
+ RSTACK
+?ELS19: GRTR? TM-CTR,0 \?ELS21
+ LESS? TM-CTR,6 \?ELS21
+ EQUAL? PRSA,V?YES \?ELS28
+ PRINTR """That's nice, but I'd like to see it."""
+?ELS28: EQUAL? PRSA,V?NO \?ELS32
+ SET 'TM-CTR,4
+ CALL I-THIRD-MEETING
+ RSTACK
+?ELS32: EQUAL? PRSA,V?WALK \?ELS34
+ PRINTR "Johnny puts a hand on your shoulder. ""Not so fast, matey."""
+?ELS34: EQUAL? PRSA,V?SHOW \?ELS38
+ EQUAL? PRSI,JOHNNY \?ELS38
+ EQUAL? PRSO,GLOBAL-MONEY /?ELS49
+ EQUAL? PRSO,INTNUM \?ELS49
+ ZERO? P-DOLLAR-FLAG /?CND41
+?ELS49: FSET? WET-SUIT,WORNBIT /?THN50
+ FSET? DEEP-SUIT,WORNBIT \?CND41
+?THN50: CALL TELL-CANT-REACH,STR?296
+ RTRUE
+?CND41: EQUAL? PRSO,GLOBAL-MONEY \?CND52
+ SET 'P-AMOUNT,0
+?CND52: EQUAL? PRSO,GLOBAL-MONEY \?ELS63
+ GRTR? POCKET-CHANGE,499 /?THN60
+?ELS63: EQUAL? PRSO,INTNUM \?ELS59
+ ZERO? P-DOLLAR-FLAG /?ELS59
+ GRTR? P-AMOUNT,499 \?ELS59
+ GRTR? P-AMOUNT,POCKET-CHANGE /?ELS59
+?THN60: SET 'TM-CTR,5
+ PRINTR "He smiles and flashes a wad that represents the contributions of your three partners."
+?ELS59: EQUAL? PRSO,GLOBAL-MONEY /?THN70
+ EQUAL? PRSO,INTNUM \FALSE
+ ZERO? P-DOLLAR-FLAG /FALSE
+?THN70: GRTR? P-AMOUNT,POCKET-CHANGE \?ELS78
+ PRINTR "You haven't got that much to show him."
+?ELS78: CALL JIGS-UP,STR?297
+ RSTACK
+?ELS38: EQUAL? PRSA,V?GIVE \FALSE
+ EQUAL? PRSI,JOHNNY \FALSE
+ EQUAL? PRSO,GLOBAL-MONEY \?CND87
+ SET 'P-AMOUNT,0
+?CND87: EQUAL? PRSO,GLOBAL-MONEY \?ELS96
+ GRTR? POCKET-CHANGE,499 /?THN93
+?ELS96: EQUAL? PRSO,INTNUM \?CND90
+ ZERO? P-DOLLAR-FLAG /?CND90
+ GRTR? P-AMOUNT,499 \?CND90
+ GRTR? P-AMOUNT,POCKET-CHANGE /?CND90
+?THN93: FSET? DEEP-SUIT,WORNBIT /?CND90
+ FSET? WET-SUIT,WORNBIT /?CND90
+ PRINTI "Johnny examines your money and returns it. ""You hold it. I needed to make sure you had it."" "
+?CND90: EQUAL? PRSO,GLOBAL-MONEY /?THN111
+ EQUAL? PRSO,INTNUM \FALSE
+ ZERO? P-DOLLAR-FLAG /FALSE
+?THN111: GRTR? P-AMOUNT,POCKET-CHANGE \?ELS119
+ CALL TELL-YOU-CANT,STR?298
+ RSTACK
+?ELS119: CALL PERFORM,V?SHOW,PRSO,JOHNNY
+ RTRUE
+?ELS21: EQUAL? TM-CTR,7 \FALSE
+ EQUAL? PRSA,V?YES \?ELS128
+ SET 'SHIP-CHOSEN,SALVAGER
+ SET 'TM-CTR,8
+ RTRUE
+?ELS128: EQUAL? PRSA,V?NO \?ELS130
+ SET 'SHIP-CHOSEN,TRAWLER
+ SET 'TM-CTR,8
+ RTRUE
+?ELS130: EQUAL? PRSA,V?MAYBE \?ELS132
+ PRINTI """A wise guy, huh?"" "
+ RTRUE
+?ELS132: EQUAL? PRSA,V?WALK \FALSE
+ PRINTI """Let's finish here first, huh?"" "
+ RTRUE
+
+
+ .FUNCT CLIFF-PSEUDO,PARG=0
+ EQUAL? PARG,M-NAME \?ELS5
+ PUTP PSEUDO-OBJECT,P?SDESC,STR?299
+ RTRUE
+?ELS5: EQUAL? PRSA,V?THROW-OFF \?ELS7
+ CALL PERFORM,V?THROW,PRSO,OCEAN
+ RTRUE
+?ELS7: EQUAL? PRSA,V?DISEMBARK \FALSE
+ CALL PERFORM,V?LEAP
+ RSTACK
+
+
+ .FUNCT WHARF-F,RARG
+ EQUAL? RARG,M-LOOK \?ELS5
+ PRINTI "You're on Hardscrabble Island's weatherbeaten wharf, north of the "
+ CALL DPRINT,WHARF-ROAD-1
+ PRINTI "."
+ ZERO? TRAWLER-DOCKED /?CND8
+ PRINTI " A trawler called the "
+ CALL DPRINT,TRAWLER
+ PRINTI " is berthed here to the west."
+?CND8: ZERO? SALVAGER-DOCKED /?CND14
+ PRINTI " The "
+ CALL DPRINT,SALVAGER
+ PRINTI " is moored to the east."
+?CND14: CRLF
+ RTRUE
+?ELS5: EQUAL? RARG,M-BEG \FALSE
+ EQUAL? PRSA,V?THROUGH,V?BOARD \FALSE
+ EQUAL? PRSO,TRAWLER \?ELS31
+ CALL DO-WALK,P?WEST
+ RTRUE
+?ELS31: EQUAL? PRSO,SALVAGER \FALSE
+ CALL DO-WALK,P?EAST
+ RTRUE
+
+ .ENDI
diff --git a/island.zil b/island.zil
new file mode 100644
index 0000000..f3fd954
--- /dev/null
+++ b/island.zil
@@ -0,0 +1,2520 @@
+"The island geography for TOA2.
+ Copyright (C) 1984 Infocom, Inc. All rights reserved."
+
+<GLOBAL BUSINESS-HOURS? <>>
+
+;<GLOBAL SHANTY-OPEN T>
+
+<GLOBAL TRAWLER-DOCKED T>
+
+<GLOBAL SALVAGER-DOCKED T>
+
+<GLOBAL BEDROOM-DOOR-LOCKED T>
+
+<GLOBAL PASSBOOK-BALANCE 603>
+
+<GLOBAL POCKET-CHANGE 20> ;"how much the player has on him"
+
+<ROOM WINDING-ROAD-1
+ (IN ROOMS)
+ (DESC "Winding Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"The road ends at the lighthouse to the north, and heads back to the southeast.
+You can see and hear the ocean pound the shoreline.")
+ (GLOBAL LIGHTHOUSE OCEAN LOCKED-DOOR)
+ (PSEUDO "LOCK" LIGHTHOUSE-LOCK-PSEUDO "LETTER" LOCKED-DOOR-F)
+ (SE TO WINDING-ROAD-2)
+ (NORTH "The lighthouse door is locked.")
+ (IN "The lighthouse door is locked.")
+ (CORRIDOR 1)
+ (LINE 0)
+ (STATION WINDING-ROAD-1)
+ (ACTION WINDING-ROAD-1-F)>
+
+<ROUTINE WINDING-ROAD-1-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,LOCKED-DOOR ,P?SDESC "lighthouse door">
+ <COND (<==? ,MEETINGS-COMPLETED 1>
+ <COND (<G? ,PRESENT-TIME 585>
+ <ALL-GO-HOME>
+ <I-PLOT-NEVER-STARTS>
+ <SETG SM-CTR 4>)
+ (T <ENABLE <QUEUE I-SECOND-MEETING -1>>)>)>)
+ (<==? .RARG ,M-BEG>
+ <COND (<VERB? WALK>
+ <COND (<AND <G? ,SM-CTR 0>
+ <L? ,SM-CTR 4>>
+ <COND (<G? ,HOW-HUNGRY 3>
+ <TELL
+"Johnny looks at you. \"If you can't keep in shape, we don't want
+you. One word to anyone and you're a goner.\" He then lets you
+pass..." CR CR>
+ <SETG SM-CTR 4>
+ <RFALSE>)
+ (T <TELL
+"Johnny blocks you. \"What's the hurry, matey?\"" CR>)>)>)>)>>
+
+<ROOM WINDING-ROAD-2
+ (IN ROOMS)
+ (DESC "Winding Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"The road branches to the northeast and northwest with the lighthouse off to
+the northwest. To the south is an impenetrable swamp.")
+ (GLOBAL LIGHTHOUSE)
+ (NW TO WINDING-ROAD-1)
+ (NE TO WINDING-ROAD-3)
+ (SOUTH "There's no way to get footing on the swamp.")
+ (CORRIDOR 3)
+ (LINE 0)
+ (PSEUDO "SWAMP" SWAMP-PSEUDO)
+ (STATION WINDING-ROAD-2)
+ (ACTION WINDING-ROAD-2-F)>
+
+<ROUTINE WINDING-ROAD-2-F (RARG)
+ <COND (<==? .RARG ,M-BEG>
+ <COND (<AND <VERB? BOARD THROUGH>
+ <PRSO? ,PSEUDO-OBJECT>>
+ <TELL "After trying to get a foothold, you give up." CR>)>)>>
+
+<ROUTINE SWAMP-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "swamp">)
+ (<VERB? SMELL>
+ <TELL "It smells awful." CR>)>>
+
+<ROOM WINDING-ROAD-3
+ (IN ROOMS)
+ (DESC "Winding Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"A winding road starts up here to the southwest. You can see the
+top of the lighthouse off to the northwest. The Wharf Road lies to the
+northeast.")
+ (GLOBAL LIGHTHOUSE)
+ (SW TO WINDING-ROAD-2)
+ (NE TO WHARF-ROAD-1)
+ (CORRIDOR 2)
+ (LINE 0)
+ (STATION WINDING-ROAD-3)>
+
+<ROOM WHARF-ROAD-1
+ (IN ROOMS)
+ (DESC "Wharf Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"This is the end of the Wharf Road, an east/west, two-lane road
+that's the island's main street. Off to the east, small businesses line
+the south side of the street. A winding road starts to the southwest,
+heading toward the lighthouse. The Red Boar Inn is to the south.")
+ (GLOBAL LIGHTHOUSE OCEAN FRONT-DOOR)
+ (EAST TO WHARF-ROAD-2)
+ (SW TO WINDING-ROAD-3)
+ (SOUTH TO RED-BOAR-INN)
+ (IN TO RED-BOAR-INN)
+ (CORRIDOR 6)
+ (LINE 0)
+ (STATION WHARF-ROAD-1)>
+
+<ROOM WHARF-ROAD-2
+ (IN ROOMS)
+ (DESC "Wharf Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are on the Wharf Road, with the McGinty Salvage office to the south. The
+ocean lies to the north, its brine smell strong and refreshing.")
+ (GLOBAL LIGHTHOUSE OCEAN FRONT-DOOR)
+ (WEST TO WHARF-ROAD-1)
+ (EAST TO WHARF-ROAD-3)
+ (SOUTH PER WHARF-ROAD-2-S)
+ (IN PER WHARF-ROAD-2-S)
+ (CORRIDOR 4)
+ (LINE 0)
+ (STATION WHARF-ROAD-2)>
+
+<ROUTINE WHARF-ROAD-2-S ("OPTIONAL" (PRINT? T))
+ <COND (<NOT .PRINT?>
+ <RFALSE>)
+ (<AND ,BUSINESS-HOURS?
+ <IN? ,MCGINTY ,MCGINTY-HQ>>
+ <RETURN ,MCGINTY-HQ>)
+ (T
+ <TELL D ,MCGINTY "'s is closed." CR>
+ <RFALSE>)>>
+
+<OBJECT FRONT-DOOR
+ (IN LOCAL-GLOBALS)
+ (DESC "front door")
+ (SYNONYM DOOR)
+ (ADJECTIVE FRONT)
+ (FLAGS DOORBIT)
+ (ACTION FRONT-DOOR-F)>
+
+<ROUTINE FRONT-DOOR-F ("AUX" (OPEN? <>))
+ <COND (<OR <EQUAL? ,HERE ,RED-BOAR-INN ,WHARF-ROAD-1 ,WHARF-ROAD-5>
+ <EQUAL? ,HERE ,SHANTY>>
+ <SET OPEN? T>)
+ (,BUSINESS-HOURS?
+ <COND (<OR <EQUAL? ,HERE ,WHARF-ROAD-4 ,OUTFITTERS-HQ ,BANK>
+ <EQUAL? ,HERE ,SHORE-ROAD-2>>
+ <SET OPEN? T>)
+ (<IN? ,MCGINTY ,MCGINTY-HQ>
+ <SET OPEN? T>)>)>
+ <COND (<VERB? EXAMINE>
+ <TELL "The door is ">
+ <COND (.OPEN? <TELL "open">)
+ (T <TELL "closed">)>
+ <TELL "." CR>)
+ (<VERB? OPEN>
+ <COND (.OPEN? <TELL-ALREADY "open">)
+ (<==? ,HERE ,MCGINTY-HQ>
+ <TELL-BLOWS "closed">)
+ (T <TELL "It's locked." CR>)>)
+ (<VERB? UNLOCK>
+ <COND (<OR <EQUAL? ,HERE ,MCGINTY-HQ ,OUTFITTERS-HQ ,SHANTY>
+ <EQUAL? ,HERE ,BANK ,RED-BOAR-INN>>
+ <TELL-DONT-HAVE "to from inside">)
+ (T <TELL-NO-KEY>)>)
+ (<VERB? CLOSE>
+ <COND (.OPEN? <TELL-BLOWS "open">)
+ (T <TELL-ALREADY "closed">)>)>>
+
+<ROUTINE TELL-BLOWS (STR)
+ <TELL "It blows back " .STR "." CR>>
+
+<ROOM WHARF-ROAD-3
+ (IN ROOMS)
+ (DESC "Wharf Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are on the Wharf Road where the wharf starts up to the north.
+The former site of Outfitters International's warehouse fronts the south
+side of the road.")
+ (GLOBAL LIGHTHOUSE OCEAN)
+ (NORTH TO WHARF)
+ (WEST TO WHARF-ROAD-2)
+ (EAST TO WHARF-ROAD-4)
+ (SOUTH TO VACANT-LOT)
+ (CORRIDOR 260)
+ (LINE 0)
+ (STATION WHARF-ROAD-3)>
+
+<ROOM WHARF-ROAD-4
+ (IN ROOMS)
+ (DESC "Wharf Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"The east/west Wharf Road continues, with Outfitters International,
+a store which supplies ocean-going vessels, to the south.")
+ (GLOBAL LIGHTHOUSE OCEAN FRONT-DOOR)
+ (WEST TO WHARF-ROAD-3)
+ (EAST TO WHARF-ROAD-5)
+ (SOUTH TO OUTFITTERS-HQ IF BUSINESS-HOURS? ELSE "Outfitters is closed.")
+ (IN TO OUTFITTERS-HQ IF BUSINESS-HOURS? ELSE "Outfitters is closed.")
+ (CORRIDOR 4)
+ (LINE 1)
+ (STATION WHARF-ROAD-4)>
+
+<ROOM WHARF-ROAD-5
+ (IN ROOMS)
+ (DESC "Wharf Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You're on the east end of Wharf Road. The Ocean Road starts here and
+parallels the island's east edge, heading to the southeast.
+The Shanty is to the south.")
+ (GLOBAL LIGHTHOUSE OCEAN FRONT-DOOR)
+ (WEST TO WHARF-ROAD-4)
+ (SOUTH TO SHANTY);(IF SHANTY-OPEN ELSE "It's after closing time.")
+ (IN TO SHANTY);(IF SHANTY-OPEN ELSE "It's after closing time.")
+ (SE TO OCEAN-ROAD-1)
+ (CORRIDOR 12)
+ (LINE 1)
+ (STATION WHARF-ROAD-5)>
+
+<ROOM OCEAN-ROAD-1
+ (IN ROOMS)
+ (DESC "Ocean Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are at the north end of the Ocean Road, a narrow north/south road
+on the east edge of the island. The Wharf Road starts
+to the northwest, and a back alley starts off to the southwest.")
+ (GLOBAL LIGHTHOUSE OCEAN ROCKS)
+ (NW TO WHARF-ROAD-5)
+ (SW TO BACK-ALLEY-5)
+ (SOUTH TO OCEAN-ROAD-2)
+ (EAST "The rocks are too sharp and dangerous.")
+ (CORRIDOR 24)
+ (LINE 1)
+ (STATION OCEAN-ROAD-1)>
+
+<ROOM OCEAN-ROAD-2
+ (IN ROOMS)
+ (DESC "Ocean Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are halfway along the Ocean Road, with the start of an
+alley off to the northwest. An empty field lies to your west,
+and the dangerous ocean shore lies off to your east.")
+ (GLOBAL LIGHTHOUSE OCEAN FIELD ROCKS)
+ (NORTH TO OCEAN-ROAD-1)
+ (NW TO BACK-ALLEY-5)
+ (SOUTH TO OCEAN-ROAD-3)
+ (WEST "You can't get through the weeds.")
+ (EAST "The rocks are too sharp and dangerous.")
+ (CORRIDOR 16)
+ (LINE 1)
+ (STATION OCEAN-ROAD-2)>
+
+<ROOM OCEAN-ROAD-3
+ (IN ROOMS)
+ (DESC "Ocean Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"This is the south end of the Ocean Road. To the southeast is a small path
+leading up to about 100 feet above sea level. The Ocean Road heads north,
+and the Shore Road starts to the southwest.")
+ (GLOBAL LIGHTHOUSE OCEAN ROCKS)
+ (NORTH TO OCEAN-ROAD-2)
+ (SW TO SHORE-ROAD-2)
+ (UP TO POINT-LOOKOUT)
+ (SE TO POINT-LOOKOUT)
+ (EAST "The rocks are too sharp and dangerous.")
+ (CORRIDOR 112)
+ (LINE 1)
+ (STATION OCEAN-ROAD-3)>
+
+<ROOM SHORE-ROAD-1
+ (IN ROOMS)
+ (DESC "Shore Road")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are at the west end of the east/west Shore Road, with the
+ferry landing to the west. To the north is an impenetrable field,
+while the south is bordered by the ocean. You can see the mainland in the
+distance.")
+ (GLOBAL LIGHTHOUSE FERRY OCEAN FIELD)
+ (WEST TO FERRY-LANDING)
+ (EAST TO SHORE-ROAD-2)
+ (NORTH "You can't get through the weeds.")
+ (CORRIDOR 128)
+ (LINE 1)
+ (STATION SHORE-ROAD-1)>
+
+<ROOM SHORE-ROAD-2
+ (IN ROOMS)
+ (DESC "Shore Road")
+ (FLAGS RLANDBIT ONBIT)
+ ;(LDESC
+"This is the east end of the Shore Road, before the ferry. The Mariners'
+Trust, the island's only bank, is off to the north. The Ocean Road starts
+to the northeast.")
+ (GLOBAL LIGHTHOUSE FERRY OCEAN FRONT-DOOR)
+ (NORTH TO BANK IF BUSINESS-HOURS? ELSE "The bank is closed.")
+ (IN TO BANK IF BUSINESS-HOURS? ELSE "The bank is closed.")
+ (WEST TO SHORE-ROAD-1)
+ (NE TO OCEAN-ROAD-3)
+ (CORRIDOR 192)
+ (LINE 1)
+ (STATION SHORE-ROAD-2)
+ (ACTION SHORE-ROAD-2-F)>
+
+<ROUTINE SHORE-ROAD-2-F (RARG)
+ <COND (<==? .RARG ,M-LOOK>
+ <TELL
+"This is the east end of the " D ,SHORE-ROAD-1 ", an east/west road with a ferry landing
+at its west end. The " D ,BANK ", the island's only bank, is off to the north.
+The " D ,OCEAN-ROAD-1 " starts up to the northeast." CR>)>>
+
+<ROOM BACK-ALLEY-1
+ (IN ROOMS)
+ (DESC "Back Alley")
+ (LDESC
+"You're at the west end of an east/west alley. The back
+entrance to the Red Boar Inn is to the north, and an overgrown field is to
+the south.")
+ (GLOBAL LOCKED-DOOR FIELD)
+ (EAST TO BACK-ALLEY-2)
+ (NORTH "The door is locked.")
+ (SOUTH "You can't get through the weeds.")
+ (FLAGS RLANDBIT ONBIT)
+ (LINE 3)
+ (CORRIDOR 512)
+ (STATION BACK-ALLEY-1)
+ (ACTION BACK-ALLEY-1-F)>
+
+<ROUTINE BACK-ALLEY-1-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,LOCKED-DOOR ,P?SDESC "back door">)>>
+
+<ROOM BACK-ALLEY-2
+ (IN ROOMS)
+ (DESC "Back Alley")
+ (LDESC
+"You are in a narrow alley. To the north is the back door of McGinty
+Salvage, as well as a small window. An overgrown field lies to the south.")
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL BACK-WINDOW LOCKED-DOOR FIELD)
+ (NORTH PER BACK-ALLEY-2-N)
+ (IN PER BACK-ALLEY-2-N)
+ (SOUTH "You can't get through the weeds.")
+ (WEST TO BACK-ALLEY-1)
+ (EAST TO BACK-ALLEY-3)
+ (LINE 3)
+ (CORRIDOR 512)
+ (STATION BACK-ALLEY-2)
+ (ACTION BACK-ALLEY-2-F)>
+
+<ROUTINE BACK-ALLEY-2-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,LOCKED-DOOR ,P?SDESC "back door">)>>
+
+<ROUTINE BACK-ALLEY-2-N ("OPTIONAL" (PRINT? T))
+ <COND (<NOT .PRINT?>
+ <RFALSE>)
+ (<FSET? ,BACK-WINDOW ,OPENBIT>
+ <COND (<OR <IN? ,MCGINTY ,BACK-ALLEY-1>
+ <IN? ,MCGINTY ,BACK-ALLEY-2>
+ <IN? ,MCGINTY ,BACK-ALLEY-3>>
+ <JIGS-UP
+"\"No, you don't!\" cries McGinty as he pulls out a gun and shoots you.">)
+ (T
+ <TELL-THRU-WINDOW>
+ <COND (<IN? ,MCGINTY ,MCGINTY-HQ>
+ <SETG MCGINTY-HQ-OCCUPIED T>)>
+ <RETURN ,MCGINTY-HQ>)>)
+ (T
+ <TELL "The door is locked." CR>
+ <RFALSE>)>>
+
+<GLOBAL MCGINTY-HQ-OCCUPIED <>>
+
+<OBJECT BACK-WINDOW
+ (IN LOCAL-GLOBALS)
+ (DESC "back window")
+ (SYNONYM WINDOW)
+ (ADJECTIVE SMALL BACK)
+ (ACTION BACK-WINDOW-F)>
+
+<ROUTINE BACK-WINDOW-F ()
+ <COND (<VERB? OPEN>
+ <COND (<IN? ,PLAYER ,MCGINTY-HQ>
+ <TELL-YOU-CANT "open it from this side.">)
+ (<FSET? ,BACK-WINDOW ,OPENBIT>
+ <TELL-ALREADY "open">)
+ (T
+ <FSET ,BACK-WINDOW ,OPENBIT>
+ <TELL
+"You open it enough to fit through it." CR>)>)
+ (<VERB? CLOSE>
+ <COND (<FSET? ,BACK-WINDOW ,OPENBIT>
+ <FCLEAR ,BACK-WINDOW ,OPENBIT>
+ <TELL "You close the window." CR>)
+ (T <TELL-ALREADY "closed">)>)
+ (<VERB? THROUGH BOARD>
+ <COND (<FSET? ,BACK-WINDOW ,OPENBIT>
+ <COND (<IN? ,PLAYER ,MCGINTY-HQ>
+ <DO-WALK ,P?SOUTH>)
+ (T <DO-WALK ,P?NORTH>)>)
+ (T <TELL-CLOSED "window">)>
+ <RTRUE>)
+ (<VERB? LOOK-INSIDE>
+ <TELL "You see ">
+ <COND (<IN? ,PLAYER ,MCGINTY-HQ>
+ <TELL "the back alley">)
+ (<IN? ,MCGINTY ,MCGINTY-HQ>
+ <TELL D ,MCGINTY " sitting at his desk">)
+ (T <TELL D ,MCGINTY "'s office">)>
+ <TELL "." CR>)
+ (<VERB? UNLOCK>
+ <TELL "It doesn't seem to be locked." CR>)>>
+
+<OBJECT LOCKED-DOOR
+ (IN LOCAL-GLOBALS)
+ ;(DESC "back door")
+ (SDESC "back door")
+ (SYNONYM DOOR)
+ (ADJECTIVE BACK LIGHTH)
+ (ACTION LOCKED-DOOR-F)>
+
+<ROUTINE LOCKED-DOOR-F ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "lighthouse door">)
+ (<VERB? OPEN>
+ <TELL "It's locked." CR>)
+ (<VERB? UNLOCK>
+ <TELL-NO-KEY>)
+ (<VERB? READ EXAMINE>
+ <COND (<EQUAL? ,HERE ,WINDING-ROAD-1>
+ <TELL
+"The lettering on the door reads:|
+">
+ <FIXED-FONT-ON>
+ <TELL
+" \"This " D ,LIGHTHOUSE " is part of|
+ CUTTHROATS|
+ an Infocom Tale of Adventure|
+ by Michael Berlyn and Jerry Wolper|
+ (c)1984 Infocom, Inc.\"" CR>
+ <FIXED-FONT-OFF>
+ <RTRUE>)
+ (<VERB? READ>
+ <V-READ>)
+ (T <TELL-CLOSED "door">)>)
+ (<VERB? MUNG>
+ <TELL "The door and lock withstand your attempts." CR>)
+ (<VERB? KNOCK>
+ <TELL-NO-ANSWER>)
+ (<VERB? CLOSE>
+ <TELL-ALREADY "closed">)
+ (<VERB? LOCK>
+ <TELL-ALREADY "locked">)>>
+
+<ROUTINE TELL-NO-ANSWER ()
+ <TELL "You wait a minute, but there's no answer." CR>>
+
+<ROOM BACK-ALLEY-3
+ (IN ROOMS)
+ (DESC "Back Alley")
+ (LDESC
+"You are in an east/west alley. To the north is a
+vacant lot, and an overgrown field lies to the south.")
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL FIELD)
+ (NORTH TO VACANT-LOT)
+ (SOUTH "You can't get through the weeds.")
+ (WEST TO BACK-ALLEY-2)
+ (EAST TO BACK-ALLEY-4)
+ (LINE 3)
+ (CORRIDOR 768)
+ (STATION BACK-ALLEY-3)>
+
+<ROOM BACK-ALLEY-4
+ (IN ROOMS)
+ (DESC "Back Alley")
+ (LDESC
+"You are in an alley behind Outfitters International. An abandoned
+field lies to the south.")
+ (GLOBAL LOCKED-DOOR FIELD)
+ (FLAGS RLANDBIT ONBIT)
+ (NORTH "The door is locked.")
+ (SOUTH "You can't get through the weeds.")
+ (WEST TO BACK-ALLEY-3)
+ (EAST TO BACK-ALLEY-5)
+ (LINE 3)
+ (CORRIDOR 512)
+ (STATION BACK-ALLEY-4)
+ (ACTION BACK-ALLEY-4-F)>
+
+<ROUTINE BACK-ALLEY-4-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,LOCKED-DOOR ,P?SDESC "back door">)>>
+
+<ROOM BACK-ALLEY-5
+ (IN ROOMS)
+ (DESC "Back Alley")
+ (LDESC
+"You're at the east end of an east/west alley. The back door of
+The Shanty is to the north, and an overgrown field is to the south.
+Narrow paths to the northeast and southeast lead to the Ocean Road.")
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL LOCKED-DOOR FIELD)
+ (NORTH "The door is locked.")
+ (SOUTH "You can't get through the weeds.")
+ (WEST TO BACK-ALLEY-4)
+ (NE TO OCEAN-ROAD-1)
+ (SE TO OCEAN-ROAD-2)
+ (LINE 3)
+ (CORRIDOR 512)
+ (STATION BACK-ALLEY-5)
+ (ACTION BACK-ALLEY-5-F)>
+
+<ROUTINE BACK-ALLEY-5-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,LOCKED-DOOR ,P?SDESC "back door">)>>
+
+<ROOM RED-BOAR-INN
+ (IN ROOMS)
+ (DESC "Red Boar Inn")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"This is the lobby of the Red Boar Inn, a place with the charm of a
+two-dollar flophouse. The Wharf Road is outside, to the north, and a
+stairway leads up to the rooms to the south.")
+ (GLOBAL STAIRS WALLPAPER CARPET FRONT-DOOR)
+ (NORTH TO WHARF-ROAD-1)
+ (OUT TO WHARF-ROAD-1)
+ (SOUTH TO UPSTAIRS-HALLWAY)
+ (UP TO UPSTAIRS-HALLWAY)
+ (LINE 2)
+ (STATION RED-BOAR-INN)
+ (PSEUDO "MAIL" MAIL-PSEUDO "MESSAG" MESSAGE-PSEUDO)
+ (ACTION RED-BOAR-INN-F)>
+
+<ROUTINE RED-BOAR-INN-F (RARG)
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <MOVE ,SPEAR-CARRIER ,RED-BOAR-INN>
+ <PUTP ,SPEAR-CARRIER ,P?SDESC "desk clerk">
+ <PUTP ,SPEAR-CARRIER ,P?LDESC
+"A desk clerk sits behind the counter.">
+ <PUTP ,GLOBAL-SURFACE ,P?SDESC "counter">
+ <MOVE-SHARED-OBJECTS ,RED-BOAR-INN>
+ <RFALSE>)>>
+
+<ROUTINE MAIL-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "mail">)
+ (<VERB? ASK-FOR ASK-CONTEXT-FOR>
+ <RFALSE>)
+ (T
+ <GLOBAL-NOT-HERE-PRINT ,PSEUDO-OBJECT>
+ <RFATAL>)>>
+
+<ROUTINE MESSAGE-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "message">)
+ (T <MAIL-PSEUDO>)>>
+
+<ROOM UPSTAIRS-HALLWAY
+ (IN ROOMS)
+ (DESC "Upstairs Hallway")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are at the top of the stairs in the Red Boar. Your room is to
+the south, and other rooms line the hall. The lighting in
+the hallway is dim and drab like the wallpaper and carpeting.")
+ (GLOBAL BEDROOM-DOOR STAIRS WALLPAPER CARPET)
+ (IN TO BEDROOM IF BEDROOM-DOOR IS OPEN)
+ (SOUTH TO BEDROOM IF BEDROOM-DOOR IS OPEN)
+ (EAST "The people in those rooms aren't interesting.")
+ (WEST "The people in those rooms aren't interesting.")
+ (DOWN TO RED-BOAR-INN)
+ (NORTH TO RED-BOAR-INN)
+ (LINE 2)
+ (STATION UPSTAIRS-HALLWAY)>
+
+<ROOM BEDROOM
+ (IN ROOMS)
+ (DESC "Your Room")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You're in your room in the Red Boar Inn. It's sparsely furnished, but
+comfortable enough. To the north is the door, and there's a closet without
+a door to the west.")
+ (GLOBAL BEDROOM-DOOR WALLPAPER CARPET WINDOW)
+ (OUT TO UPSTAIRS-HALLWAY IF BEDROOM-DOOR IS OPEN)
+ (NORTH TO UPSTAIRS-HALLWAY IF BEDROOM-DOOR IS OPEN)
+ (WEST PER BEDROOM-W)
+ (IN PER BEDROOM-W)
+ (PSEUDO "CLOTHE" CLOTHES-PSEUDO)
+ (LINE 2)
+ (STATION BEDROOM)
+ (ACTION BEDROOM-F)>
+
+<ROUTINE BEDROOM-F (RARG)
+ <COND (<EQUAL? .RARG ,M-FLASH>
+ <COND (<AND <IN? ,WEASEL ,BEDROOM>
+ <NOT <VERB? LOOK>>>
+ <JIGS-UP
+"The Weasel is rummaging through your stuff. He notices you, and
+before you have a chance to react, he smiles then cuts your throat.">)
+ (,BEDROOM-MESSAGE
+ <TELL ,BEDROOM-MESSAGE>
+ <CRLF>
+ <SETG BEDROOM-MESSAGE <>>)>)
+ (<==? .RARG ,M-BEG>
+ <COND (<AND <VERB? TAKE>
+ <PRSO? ,PSEUDO-OBJECT>>
+ <TELL-CLOTHES>)>)>>
+
+<ROUTINE BEDROOM-W ("OPTIONAL" (PRINT? T))
+ <COND (.PRINT? <TELL "It's not a walk-in closet." CR>)>
+ <RFALSE>>
+
+<OBJECT BED
+ (IN BEDROOM)
+ (DESC "bed")
+ (SYNONYM BED COT MATTRE)
+ (FLAGS VEHBIT SURFACEBIT CONTBIT OPENBIT TRANSBIT)
+ (LDESC "A comfortable bed sits along the wall.")
+ (CAPACITY 30)
+ (STATION 30) ;"metal content"
+ (ACTION BED-F)>
+
+<ROUTINE BED-F ("OPTIONAL" (RARG <>))
+ <COND (<EQUAL? .RARG ,M-BEG>
+ <COND (<AND ,PRSO
+ <OR <IN? ,PRSO ,PLAYER>
+ <IN? ,PRSO ,BED>
+ <PRSO? ,GLOBAL-ROOM>
+ <AND <VERB? DROP> <PRSO? ,BED>>>>
+ <RFALSE>)
+ (<AND <VERB? EXAMINE>
+ <PRSO? ,BUREAU ,CLOSET>>
+ <RFALSE>)
+ (<NOT <BED-VERB?>>
+ <TELL "You should get out of bed first." CR>
+ <RFATAL>)>)
+ (<NOT .RARG>
+ <COND (<AND <VERB? BOARD>
+ <OR <FIRST? ,BED>
+ <WEARING-SOMETHING?>>>
+ <TELL-NOT-COMFORTABLE>
+ ;<TELL "That would be uncomfortable." CR>)>)>>
+
+<ROUTINE BED-VERB? ()
+ <COND (<VERB? BRIEF SUPER-BRIEF DIAGNOSE VERBOSE INVENTORY QUIT
+ RESTART RESTORE SAVE SCORE $VERIFY VERSION AGAIN
+ ;ANSWER ;REPLY ASK-ABOUT ASK-CONTEXT-ABOUT ASK-FOR
+ ASK-CONTEXT-FOR BREATHE ;BUG $CALL CALL FIND CHOMP
+ COUNT CURSES DISEMBARK GOODBYE HELLO HELP
+ ALARM LATITUDE LONGITUDE LISTEN LOOK LOOK-INSIDE
+ CHASTISE MAYBE YES NO MUMBLE ;ADVENTURE PRAY SCRIPT SIT
+ SIT-ON UNSCRIPT SMELL STAND STAY TELL SAY SLEEP TIME
+ WAIT WAIT-FOR WAVE-AT WIN YELL ;ZORK WHAT>
+ <RTRUE>)
+ (T <RFALSE>)>>
+
+<OBJECT BUREAU
+ (IN BEDROOM)
+ (DESC "dresser")
+ (FDESC "In a corner of the room is a lopsided wooden dresser.")
+ (SYNONYM BUREAU DRESSE DRAWER)
+ (ADJECTIVE OLD WOODEN LOPSID TILTED)
+ (FLAGS CONTBIT)
+ (CAPACITY 20)
+ (ACTION BUREAU-F)>
+
+<ROUTINE BUREAU-F ()
+ <COND (<VERB? OPEN>
+ <COND (<FSET? ,BUREAU ,OPENBIT>
+ <TELL-ALREADY "open">)
+ (T
+ <FSET ,BUREAU ,OPENBIT>
+ <TELL "Opening the " D ,BUREAU " reveals ">
+ <TELL-BUREAU-CONTENTS>)>)
+ (<VERB? CLOSE>
+ <COND (<FSET? ,BUREAU ,OPENBIT>
+ <FCLEAR ,BUREAU ,OPENBIT>
+ <TELL "Closed." CR>)
+ (T <TELL-ALREADY "closed">)>)
+ (<AND <VERB? PUT-ON>
+ <PRSI? ,BUREAU>>
+ <COND (<IDROP>
+ <TELL "It slides off onto the floor." CR>)>
+ <RTRUE>)
+ (<VERB? EXAMINE>
+ <TELL "It's a tilted old wooden " D ,BUREAU>
+ <COND (<FSET? ,BUREAU ,OPENBIT>
+ <COND (<FIRST? ,BUREAU>
+ <TELL ". In addition to your clothes, you find ">
+ <PRINT-CONTENTS ,BUREAU>
+ <TELL " inside." CR>)
+ (T <TELL ". Your clothes are in it." CR>)>)
+ (T <TELL ", which is closed." CR>)>)
+ (<VERB? LOOK-INSIDE>
+ <COND (<FSET? ,BUREAU ,OPENBIT>
+ <TELL "The " D ,BUREAU " contains ">
+ <TELL-BUREAU-CONTENTS>)>)>>
+
+<ROUTINE TELL-BUREAU-CONTENTS ()
+ <COND (<FIRST? ,BUREAU>
+ <PRINT-CONTENTS ,BUREAU>
+ <TELL ", as well as">)
+ (T <TELL "nothing but">)>
+ <TELL " your clothes." CR>>
+
+<OBJECT PASSBOOK
+ (IN BUREAU)
+ (DESC "Mariners' Trust passbook")
+ (SYNONYM PASSBOOK BANKBOOK)
+ (ADJECTIVE BANK MARINE TRUST DISTIN)
+ (FLAGS TAKEBIT READBIT)
+ (SIZE 4)
+ (VALUE 10)
+ (ACTION PASSBOOK-F)>
+
+<ROUTINE PASSBOOK-F ()
+ <COND ;(<VERB? TAKE>
+ <COND (<ITAKE <>>
+ <TELL
+"Taken. You notice that it's a little too big to be carried inconspicuously."
+CR>)
+ (T <RFALSE>)>)
+ (<VERB? EXAMINE>
+ <COND (<FSET? ,PASSBOOK ,RMUNGBIT>
+ <TELL-SOGGY>)
+ (T
+ <TELL "This is a distinctive " D ,BANK " passbook">
+ <COND (<AND <NOT <IN? ,PASSBOOK ,MCGINTY>>
+ <NOT <IN? ,PASSBOOK ,WEASEL>>>
+ <TELL
+" which shows a balance of $" N ,PASSBOOK-BALANCE ". The last date stamped in
+it is " ,STUPID-PROBLEM-STRING>)>
+ <TELL "." CR>)>)
+ (<VERB? READ OPEN LOOK-INSIDE>
+ <COND (<OR <IN? ,PASSBOOK ,WEASEL>
+ <IN? ,PASSBOOK ,MCGINTY>>
+ <START-SENTENCE <LOC ,PASSBOOK>>
+ <TELL " has it." CR>)
+ (T
+ <PERFORM ,V?EXAMINE ,PASSBOOK>
+ <RTRUE>)>)
+ (<VERB? CLOSE>
+ <TELL "It's closed." CR>)>>
+
+<GLOBAL STUPID-PROBLEM-STRING "April 23">
+
+<OBJECT KEY
+ (IN BUREAU)
+ (DESC "room key")
+ (SYNONYM KEY)
+ (ADJECTIVE ROOM)
+ (TEXT "It's your room key.")
+ (FLAGS TAKEBIT TOOLBIT)
+ (SIZE 4)
+ (STATION 5) ;"metal content"
+ (ACTION KEY-F)>
+
+<ROUTINE KEY-F ()
+ <COND (<AND <VERB? LOCK>
+ <PRSO? ,BEDROOM-DOOR>>
+ <COND (,BEDROOM-DOOR-LOCKED
+ <TELL-ALREADY "locked">
+ <RTRUE>)
+ (<FSET? ,BEDROOM-DOOR ,OPENBIT>
+ <TELL "You should close it first." CR>
+ <RTRUE>)
+ (T
+ <SETG BEDROOM-DOOR-LOCKED T>
+ <TELL-NOW ,BEDROOM-DOOR "locked">
+ <RTRUE>)>)
+ (<AND <VERB? UNLOCK>
+ <PRSO? ,BEDROOM-DOOR>>
+ <COND (<NOT ,BEDROOM-DOOR-LOCKED>
+ <TELL-ALREADY "unlocked">
+ <RTRUE>)
+ (T
+ <SETG BEDROOM-DOOR-LOCKED <>>
+ <TELL-NOW ,BEDROOM-DOOR "unlocked">
+ <RTRUE>)>)
+ (<AND <VERB? OPEN>
+ <PRSO? ,BEDROOM-DOOR>>
+ <PERFORM ,V?UNLOCK ,BEDROOM-DOOR ,KEY>
+ <PERFORM ,V?OPEN ,BEDROOM-DOOR>
+ <RTRUE>)>>
+
+<OBJECT NOTE
+ (IN BEDROOM)
+ (DESC "note")
+ (SYNONYM NOTE)
+ (ADJECTIVE HANDWRITTEN)
+ (FDESC
+"On the floor is a note that must have been slipped under the
+door while you slept.")
+ (TEXT
+"The note is hastily scrawled:|
+|
+\"If you're interested in a big deal, be at The Shanty at 8:30 this
+morning.|
+ -Johnny\"")
+ (SIZE 4)
+ (FLAGS TAKEBIT READBIT)
+ (ACTION NOTE-F)>
+
+<ROUTINE NOTE-F ()
+ <COND (<AND <VERB? EXAMINE READ>
+ <FSET? ,NOTE ,RMUNGBIT>>
+ <TELL-SOGGY>)>>
+
+<OBJECT BOOK
+ (IN BUREAU)
+ (DESC "book of shipwrecks")
+ (SYNONYM BOOK TEXT SHIPWR)
+ (ADJECTIVE SHIPWR OCEAN MARINE NAUTIC HEVLIN)
+ (TEXT "This book is included in your Cutthroats package.")
+ (FLAGS TAKEBIT READBIT)
+ (ACTION BOOK-F)>
+
+<ROUTINE BOOK-F ()
+ <COND (<AND <FSET? ,BOOK ,RMUNGBIT>
+ <VERB? OPEN READ EXAMINE>>
+ <TELL-SOGGY>)
+ (<VERB? OPEN CLOSE>
+ <PERFORM ,V?READ ,BOOK>
+ <RTRUE>)>>
+
+<ROUTINE CLOTHES-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "bunch of clothes">)
+ (<VERB? WEAR DISEMBARK>
+ <TELL-CLOTHES>)>>
+
+<ROUTINE TELL-CLOTHES ()
+ <TELL "What you have on now is fine." CR>>
+
+<OBJECT CLOSET
+ (IN BEDROOM)
+ (DESC "closet")
+ (SYNONYM CLOSET)
+ (CAPACITY 40)
+ (FLAGS CONTBIT OPENBIT)
+ (DESCFCN CLOSET-F)
+ (ACTION CLOSET-F)>
+
+<ROUTINE CLOSET-F ("OPTIONAL" (RARG <>))
+ <COND (<==? .RARG ,M-OBJDESC>
+ <RTRUE>)
+ (<VERB? OPEN CLOSE>
+ <TELL "The closet has no door." CR>)
+ (<VERB? EXAMINE>
+ <TELL
+"It looks as if the door was torn off its hinges a long time ago. ">
+ <RFALSE>)
+ (<VERB? THROUGH BOARD>
+ <BEDROOM-W>
+ <RTRUE>)>>
+
+<OBJECT WET-SUIT
+ (IN CLOSET)
+ (DESC "wet suit")
+ (SYNONYM SUIT)
+ (ADJECTIVE WET SCUBA)
+ (FLAGS WEARBIT TAKEBIT)
+ (ACTION WET-SUIT-F)>
+
+<ROUTINE WET-SUIT-F ()
+ <COND (<AND <VERB? DROP THROW DISEMBARK>
+ <OR <FSET? ,AIR-TANK ,WORNBIT>
+ <FSET? ,FLIPPERS ,WORNBIT>
+ <FSET? ,MASK ,WORNBIT>>>
+ <TELL-YOU-CANT
+"get it over the other equipment you're wearing.">)
+ (<AND <VERB? WEAR>
+ <FSET? ,DEEP-SUIT ,WORNBIT>>
+ <TELL-YOU-CANT "fit that over the " <>>
+ <TELL D ,DEEP-SUIT "." CR>)>>
+
+<OBJECT FLIPPERS
+ (IN CLOSET)
+ (DESC "pair of flippers")
+ (SYNONYM FLIPPE PAIR FINS FIN)
+ (ADJECTIVE SWIM)
+ (FLAGS WEARBIT TAKEBIT)
+ (ACTION FLIPPERS-F)>
+
+<ROUTINE FLIPPERS-F ()
+ <COND (<VERB? WEAR>
+ <COND (<FSET? ,WET-SUIT ,WORNBIT>
+ <RFALSE>)
+ (<FSET? ,DEEP-SUIT ,WORNBIT>
+ <TELL "They don't fit with the " D ,DEEP-SUIT "." CR>)
+ (T
+ <TELL
+"The " D ,WET-SUIT " won't fit over them." CR>)>)>>
+
+<OBJECT MASK
+ (IN CLOSET)
+ (DESC "diving mask")
+ (SYNONYM MASK)
+ (ADJECTIVE DIVING DIVER DIVERS SCUBA)
+ (FLAGS WEARBIT TAKEBIT TRANSBIT)
+ (ACTION MASK-F)>
+
+<ROUTINE MASK-F ()
+ <COND (<VERB? WEAR>
+ <COND (<FSET? ,WET-SUIT ,WORNBIT>
+ <RFALSE>)
+ (<FSET? ,DEEP-SUIT ,WORNBIT>
+ <TELL "It won't fit over the " D ,DEEP-SUIT "'s hood." CR>)
+ (T <TELL
+"You couldn't fit the " D ,WET-SUIT " over it." CR>)>)
+ (<AND <EQUAL? <GETP ,HERE ,P?LINE>
+ ,UNDERWATER-LINE-C>
+ <FSET? ,MASK ,WORNBIT>
+ <VERB? DROP THROW DISEMBARK>
+ <NOT <AIRTIGHT-ROOM?>>>
+ <JIGS-UP
+"As you remove the mask, you find you can't breathe.">)>>
+
+<OBJECT AIR-TANK
+ (IN CLOSET)
+ (DESC "air tank")
+ (SYNONYM TANK GAUGE)
+ (ADJECTIVE AIR DOUBLE ALUMIN SCUBA)
+ (FLAGS TAKEBIT WEARBIT VOWELBIT)
+ (STATION 25) ;"metal content"
+ (ACTION AIR-TANK-F)>
+
+<ROUTINE AIR-TANK-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"This double tank made of aluminum is designed to fit over a
+" D ,WET-SUIT ". Its gauge is currently at ">
+ <COND (<G? ,AIR-LEFT 150>
+ <TELL "full">)
+ (<G? ,AIR-LEFT 100>
+ <TELL "fairly full">)
+ (<G? ,AIR-LEFT 50>
+ <TELL "medium">)
+ (<G? ,AIR-LEFT 15>
+ <TELL "almost empty">)
+ (T <TELL "empty">)>
+ <TELL "." CR>)
+ (<VERB? FILL>
+ <COND (<OR <PRSI? ,COMPRESSOR>
+ <AND <PRSI? ,AIR>
+ <IN? ,COMPRESSOR ,HERE>>>
+ <COND (<G? <GETP ,COMPRESSOR ,P?NORTH> 0>
+ <TELL
+"The salesman tells you to rent the compressor first." CR>)
+ (<FSET? ,AIR-TANK ,WORNBIT>
+ <TELL-CONTORT>)
+ (T
+ <SETG AIR-LEFT 160>
+ <TELL-NOW ,AIR-TANK "filled">)>)
+ (<PRSI? ,MM-COMPRESSOR>
+ <TELL
+"There's no way to get air from this compressor to the tank." CR>)
+ (<PRSI? ,AIR>
+ <TELL "The right compressor would probably help." CR>)>)
+ (<VERB? EMPTY>
+ <COND (<==? <GETP ,HERE ,P?LINE> ,UNDERWATER-LINE-C>
+ <JIGS-UP "Not a very good idea...">)
+ (<==? ,AIR-LEFT 0>
+ <TELL-ALREADY "empty">)
+ (T
+ <SETG AIR-LEFT 0>
+ <TELL-NOW ,AIR-TANK "empty">)>)
+ (<VERB? WEAR>
+ <COND (<FSET? ,WET-SUIT ,WORNBIT>
+ <RFALSE>)
+ (<FSET? ,DEEP-SUIT ,WORNBIT>
+ <TELL
+"This tank can't be worn with a " D ,DEEP-SUIT "." CR>)
+ (T <TELL
+"This tank should be worn outside a " D ,WET-SUIT "." CR>)>)
+ (<AND <EQUAL? <GETP ,HERE ,P?LINE>
+ ,UNDERWATER-LINE-C>
+ <VERB? DROP THROW>
+ <NOT <FSET? ,DEEP-SUIT ,WORNBIT>>
+ <NOT <AIRTIGHT-ROOM?>>>
+ <JIGS-UP
+"As the tank falls away, it pulls the airhose with it, making you
+regret your lack of gills.">)>>
+
+<GLOBAL AIR-LEFT 0>
+
+;<ROUTINE WHAT-FOO (OBJ)
+ <COND (<PRSO? .OBJ>
+ <TELL "What" PRSO "?" CR>)
+ (<PRSI? .OBJ>
+ <TELL "What" PRSI "?" CR>)>
+ <SETG P-IT-OBJECT <>>
+ <RTRUE>>
+
+<ROOM MCGINTY-HQ
+ (IN ROOMS)
+ (DESC "McGinty Salvage")
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL BACK-WINDOW FRONT-DOOR LOCKED-DOOR)
+ (LDESC
+"You are in the McGinty Salvage office, a concern whose main business is
+salvaging wrecks. The place is a mess, and the floor
+is littered with chewed-on cigar stubs. To the
+north lies the Wharf Road. You can't help feeling uncomfortable here.")
+ (NORTH TO WHARF-ROAD-2)
+ (OUT TO WHARF-ROAD-2)
+ (SOUTH PER MCGINTY-HQ-S)
+ (PSEUDO "CHAIR" MCGINTY-CHAIR-PSEUDO)
+ (LINE 0)
+ (STATION WHARF-ROAD-2)
+ (ACTION MCGINTY-HQ-F)>
+
+<ROUTINE MCGINTY-HQ-F (RARG "AUX" DEST)
+ <COND (<==? .RARG ,M-ENTER>
+ <PUTP ,LOCKED-DOOR ,P?SDESC "back door">
+ <PUTP ,GLOBAL-SURFACE ,P?SDESC "desk">
+ <MOVE-SHARED-OBJECTS ,MCGINTY-HQ>
+ <RFALSE>)
+ (<==? .RARG ,M-FLASH>
+ <COND (,MCGINTY-HQ-OCCUPIED
+ <COND (<NOT <IN? ,PASSBOOK ,PLAYER>>
+ <MCGINTY-F ,M-OBJDESC>
+ <CRLF>)>
+ <JIGS-UP
+"As McGinty sees someone climbing through the window, he pulls out a gun
+and fires. His aim is better than your luck.">)
+ (<AND <IN? ,MCGINTY ,MCGINTY-HQ>
+ <SET DEST <GET <GET ,GOAL-TABLES ,MCGINTY-C>
+ ,GOAL-S>>
+ <NOT <==? .DEST ,WHARF-ROAD-2>>>
+ <MCGINTY-ERRAND>)>)
+ (<==? .RARG ,M-BEG>
+ <COND (<PRSO? ,GLOBAL-SURFACE>
+ <COND (<VERB? OPEN>
+ <TELL "It's locked." CR>)
+ (<VERB? UNLOCK>
+ <TELL-NO-KEY>)
+ (<VERB? CLOSE>
+ <TELL-ALREADY "closed">)>)>)>>
+
+<ROUTINE MCGINTY-HQ-S ("OPTIONAL" (PRINT? T))
+ <COND (<FSET? ,BACK-WINDOW ,OPENBIT>
+ <TELL-THRU-WINDOW>
+ <RETURN ,BACK-ALLEY-2>)
+ (<PRSO? ,WINDOW>
+ <COND (.PRINT? <TELL-CLOSED "window">)>
+ <RFALSE>)
+ (T
+ <COND (.PRINT? <TELL "The door is locked." CR>)>
+ <RFALSE>)>>
+
+<ROUTINE TELL-THRU-WINDOW ()
+ <TELL "You climb through the open window..." CR CR>>
+
+<ROUTINE MCGINTY-CHAIR-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "chair">)
+ (<VERB? PUT-ON>
+ <TELL "It's too lopsided." CR>)
+ (<VERB? CLIMB-ON SIT-ON>
+ <TELL-WHY-BOTHER>)
+ (<VERB? EXAMINE>
+ <TELL "It's an impressively beat-up chair." CR>)>>
+
+;<OBJECT PAPERS
+ (IN MCGINTY-HQ)
+ (DESC "mess of old papers")
+ (SYNONYM MESS PAPER PAPERS)
+ (ADJECTIVE OLD CRUMPL)
+ (FLAGS TRYTAKEBIT NDESCBIT READBIT)
+ (ACTION PAPERS-F)>
+
+;<ROUTINE PAPERS-F ()
+ <COND (<VERB? EXAMINE READ>
+ <TELL
+"These are old papers relating to various deals of " D ,MCGINTY
+"'s. None of them
+pertain to you." CR>)
+ (<VERB? TAKE>
+ <COND (<AND <==? ,HERE ,MCGINTY-HQ>
+ <IN? ,MCGINTY ,MCGINTY-HQ>>
+ <TELL
+D ,MCGINTY " squeals angrily. \"Keep your hands off of my private papers!\""
+CR>)
+ (T <TELL "Why bother? They're not very interesting." CR>)>)>>
+
+<OBJECT STUBS
+ (IN MCGINTY-HQ)
+ (DESC "cigar stub")
+ (SYNONYM STUB STUBS BUTT BUTTS)
+ (ADJECTIVE OLD CHEWED CIGAR SMELLY CHEAP)
+ (FLAGS TRYTAKEBIT NDESCBIT)
+ (ACTION STUBS-F)>
+
+<ROUTINE STUBS-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"The floor is littered with stubs from cheap cigars." CR>)
+ (<VERB? SMELL>
+ <TELL "The aroma is reminiscent of burning tires." CR>)
+ (<VERB? TAKE>
+ <TELL
+"You think twice and realize you don't want to carry a used cigar." CR>)>>
+
+<OBJECT ENVELOPE
+ (IN LOCAL-GLOBALS)
+ (DESC "envelope")
+ (SYNONYM ENVELO WRITIN)
+ (ADJECTIVE BUSINE)
+ (FLAGS TAKEBIT READBIT CONTBIT VOWELBIT INVISIBLE)
+ (TEXT
+"The business envelope has the McGinty Salvage return address,
+and \"Weasel's Merchant Seaman's card - collateral for deal\" scribbled in
+McGinty's hand.")
+ (FDESC "An envelope with some writing on it sits on the desk.")
+ (SIZE 4)
+ (CAPACITY 2)
+ (ACTION ENVELOPE-F)>
+
+<ROUTINE ENVELOPE-F ("AUX" L)
+ <COND (<AND <VERB? OPEN TAKE LOOK-UNDER>
+ <==? ,HERE ,MCGINTY-HQ>
+ <IN? ,MCGINTY ,MCGINTY-HQ>
+ <NOT <IN? ,ENVELOPE ,PLAYER>>>
+ <TELL
+D ,MCGINTY " squeals angrily. \"Keep your hands off of my private papers!\""
+CR>)
+ (<AND <VERB? TAKE>
+ <IN? ,WEASEL ,HERE>>
+ <WEASEL-BEATS-YOU>)
+ (<AND <IN? ,ENVELOPE ,UNDER-BUNK>
+ <NOT <VERB? TAKE TELL ASK-ABOUT>>>
+ <TELL "It's hidden under the mattress." CR>)
+ (<AND <NOT <IN? ,ENVELOPE ,PLAYER>>
+ <FSET? <SET L <LOC ,ENVELOPE>> ,PERSON>
+ <VERB? OPEN>>
+ <START-SENTENCE .L>
+ <TELL " tells you to keep your hands off it." CR>)
+ (<FSET? ,ENVELOPE ,RMUNGBIT>
+ <COND (<VERB? EXAMINE>
+ <TELL "It's a soggy " D ,ENVELOPE "." CR>)
+ (<VERB? READ>
+ <TELL-SOGGY>)>)>>
+
+<ROOM VACANT-LOT
+ (IN ROOMS)
+ (DESC "Vacant Lot")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are standing on the former site of the Outfitters International warehouse,
+which burned down a few months back. To the north is the Wharf Road and an
+alley is to the south.")
+ (GLOBAL LIGHTHOUSE)
+ (NORTH TO WHARF-ROAD-3)
+ (SOUTH TO BACK-ALLEY-3)
+ (EAST "There's a wall in the way.")
+ (WEST "There's a wall in the way.")
+ (LINE 0)
+ (CORRIDOR 256)
+ (STATION WHARF-ROAD-3)>
+
+<ROOM OUTFITTERS-HQ
+ (IN ROOMS)
+ (DESC "Outfitters Int'l")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"This is Outfitters International, a store that specializes in marine supplies.
+There is a long, high counter separating the supplies and the front area. To
+the north is the Wharf Road.")
+ (GLOBAL TRAWLER SALVAGER FRONT-DOOR)
+ (NORTH TO WHARF-ROAD-4)
+ (OUT TO WHARF-ROAD-4)
+ (STATION WHARF-ROAD-4)
+ (LINE 1)
+ (PSEUDO "MERCHA" MERCHANDISE-PSEUDO)
+ (ACTION OUTFITTERS-HQ-F)>
+
+<ROUTINE OUTFITTERS-HQ-F (RARG)
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <MOVE ,SPEAR-CARRIER ,OUTFITTERS-HQ>
+ <PUTP ,SPEAR-CARRIER ,P?SDESC "salesman">
+ <PUTP ,SPEAR-CARRIER ,P?LDESC
+"A salesman stands behind the counter.">
+ <PUTP ,GLOBAL-SURFACE ,P?SDESC "counter">
+ <MOVE-SHARED-OBJECTS ,OUTFITTERS-HQ>
+ <COND (<AND <QUEUED? I-EQUIP>
+ <NOT <IN? ,MCGINTY ,OUTFITTERS-HQ>>>
+ <SETG I-WAIT-DURATION 9>
+ <SETG I-WAIT-RTN ,I-EQUIP>)>
+ <RFALSE>)
+ (<EQUAL? .RARG ,M-BEG>
+ <COND (<EQUAL? ,PSEUDO-OBJECT ,PRSO ,PRSI>
+ <MERCHANDISE-PSEUDO>)
+ (<PRSO? ,TRAWLER ,SALVAGER>
+ <COND (<VERB? RENT>
+ <COND (<AND ,JOHNNY-MADE-DEAL
+ <==? ,SHIP-CHOSEN ,PRSO>>
+ <TELL
+"\"Johnny already took care of that.\"" CR>)
+ (T <TELL-YOU-CANT "afford that.">)>)
+ (<VERB? BUY FIND ASK-ABOUT ASK-CONTEXT-ABOUT>
+ <RFALSE>)
+ (T <GLOBAL-NOT-HERE-PRINT ,PRSO>)>)
+ (<PRSI? ,TRAWLER ,SALVAGER>
+ <COND (<VERB? ASK-ABOUT TELL>
+ <RFALSE>)
+ (T <GLOBAL-NOT-HERE-PRINT ,PRSI>)>)
+ (<AND <VERB? BUY RENT>
+ ,AMT-OWED>
+ <TELL
+"The salesman looks sorry. \"I can't sell
+you anything until you pay the $" N ,AMT-OWED " of " D ,JOHNNY "'s.\"" CR>)
+ (<AND <VERB? TAKE>
+ <==? <GETP ,PRSO ,P?NORTH> -1>
+ ,JOHNNY-MADE-DEAL
+ <NOT ,DELIVERY-MADE>
+ <NOT <IN? ,PRSO ,PLAYER>>>
+ <TELL
+"The salesman says, \"Don't bother. It'll be delivered to the ship.\"" CR>)
+ (<AND <VERB? OPEN LAMP-ON>
+ <G? <GETP ,PRSO ,P?NORTH> 0>>
+ <TELL
+"The salesman stops you. \"You want to play with it, you buy it.\"" CR>)>)>>
+
+<ROUTINE MERCHANDISE-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "merchandise">)
+ (T
+ <TELL-REFER-INDIVIDUAL " items">
+ <RFATAL>)>>
+
+<OBJECT PRICE-LIST
+ (IN OUTFITTERS-HQ)
+ (DESC "price list")
+ (SYNONYM LIST LISTIN CATALO)
+ (ADJECTIVE PRICE COMPLE)
+ (FLAGS TAKEBIT READBIT)
+ (SIZE 4)
+ (TEXT "This price list is included in your Cutthroats package.")>
+
+;"May this code rest in peace."
+;<ROUTINE PRICE-LIST-F ("AUX" OBJ PRICE)
+ <COND (<VERB? EXAMINE READ>
+ <TELL
+" OUTFITTERS INTERNATIONAL|
+ CURRENT PRICE LIST|
+|
+ITEM (PRICE)" CR>
+ <SET OBJ <FIRST? ,OUTFITTERS-HQ>>
+ <REPEAT ()
+ <COND (<NOT .OBJ>
+ <RTRUE>)
+ (<G? <SET PRICE <GETP .OBJ ,P?NORTH>> 0>
+ <TELL D .OBJ " ($" N .PRICE>
+ <COND (<FSET? .OBJ ,RENTBIT>
+ <TELL " rental">)>
+ <TELL ")" CR>)>
+ <SET OBJ <NEXT? .OBJ>>>)>>
+
+<OBJECT SPEAR-GUN
+ (IN OUTFITTERS-HQ)
+ (DESC "spear gun")
+ (SYNONYM GUN)
+ (ADJECTIVE SPEAR)
+ (FLAGS NDESCBIT)
+ (NORTH 1);"price - placeholder here"
+ (ACTION OUT-OF-STOCK-F)>
+
+<ROUTINE OUT-OF-STOCK-F ()
+ <COND (<VERB? BUY>
+ <TELL "The salesman checks and says, ">
+ <TELL-WERE-OUT>)
+ (<VERB? ASK-ABOUT>
+ <COND (<==? ,HERE ,OUTFITTERS-HQ>
+ <TELL-WERE-OUT>)>)
+ (<OR <PRSO? ,SPEAR-GUN> <PRSI? ,SPEAR-GUN>>
+ <GLOBAL-NOT-HERE-PRINT ,SPEAR-GUN>)
+ (<OR <PRSO? ,COMPASS> <PRSI? ,COMPASS>>
+ <GLOBAL-NOT-HERE-PRINT ,COMPASS>)
+ (T <GLOBAL-NOT-HERE-PRINT ,WINCH>)>>
+
+<ROUTINE TELL-WERE-OUT ()
+ <TELL "\"We're out of those. Try next week.\"" CR>>
+
+<OBJECT COMPASS
+ (IN OUTFITTERS-HQ)
+ (DESC "compass")
+ (SYNONYM COMPAS)
+ (ADJECTIVE SPARE)
+ (FLAGS NDESCBIT)
+ (NORTH 1);"price - placeholder here"
+ (ACTION OUT-OF-STOCK-F)>
+
+<OBJECT WINCH
+ (IN OUTFITTERS-HQ)
+ (DESC "winch")
+ (SYNONYM WINCH)
+ (ADJECTIVE SPARE)
+ (FLAGS NDESCBIT)
+ (NORTH 1);"price - placeholder here"
+ (ACTION OUT-OF-STOCK-F)>
+
+<OBJECT DRY-CELL
+ (IN OUTFITTERS-HQ)
+ (DESC "dry cell")
+ (SYNONYM BATTER CELL)
+ (ADJECTIVE NINE VOLT DRY NINE-V AJAX POWER)
+ (FLAGS NDESCBIT READBIT)
+ (SIZE 3)
+ (NORTH 5) ;"price"
+ (TEXT "\"Ajax 9-volt dry cell.\"")
+ (ACTION DRY-CELL-F)>
+
+<ROUTINE DRY-CELL-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "The ">
+ <COND (<FSET? ,DRY-CELL ,RMUNGBIT>
+ <TELL "corroded ">)>
+ <TELL D ,DRY-CELL " reads ">
+ <RFALSE>)>>
+
+<OBJECT NET
+ (IN OUTFITTERS-HQ)
+ (DESC "net")
+ (SYNONYM NET)
+ (FLAGS NDESCBIT)
+ (NORTH 50) ;"price"
+ (SIZE 10)
+ (ACTION NET-F)>
+
+<ROUTINE NET-F ()
+ <COND (<AND <VERB? PUT-ON THROW-OFF>
+ <PRSO? ,NET>>
+ <MOVE ,NET ,HERE>
+ <TELL "It slides off." CR>)>>
+
+<OBJECT BATTERY
+ (IN OUTFITTERS-HQ)
+ (DESC "C battery")
+ (SYNONYM BATTER CELL)
+ (ADJECTIVE C POWER)
+ (FLAGS NDESCBIT READBIT)
+ (TEXT "\"Ajax C cell.\"")
+ (NORTH 1) ;"price"
+ (SIZE 3)
+ (ACTION BATTERY-F)>
+
+<ROUTINE BATTERY-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL "The ">
+ <COND (<FSET? ,BATTERY ,RMUNGBIT>
+ <TELL "corroded">)
+ (T <TELL "standard">)>
+ <TELL " battery reads ">
+ <RFALSE>)>>
+
+<OBJECT ANCHOR
+ (IN OUTFITTERS-HQ)
+ (DESC "anchor")
+ (SYNONYM ANCHOR)
+ (NORTH 50) ;"price"
+ (FLAGS NDESCBIT VOWELBIT)
+ (SIZE 80)>
+
+<OBJECT TUBE
+ (IN OUTFITTERS-HQ)
+ (DESC "tube of putty")
+ (SYNONYM TUBE PUTTY)
+ (ADJECTIVE TUBE)
+ (FLAGS NDESCBIT CONTBIT READBIT)
+ (CAPACITY 4)
+ (NORTH 15) ;"price"
+ (TEXT
+"The tube has \"Frobizz waterproof putty\" printed on the side.")
+ (ACTION TUBE-F)>
+
+<ROUTINE TUBE-F ()
+ <COND (<AND <VERB? PUT>
+ <EQUAL? ,PRSI ,TUBE>>
+ <TELL "The tube refuses to accept anything." CR>)
+ (<AND <VERB? PUT PUT-ON>
+ <PRSI? ,GLASS-CASE>
+ <FSET? ,TUBE ,OPENBIT>
+ <IN? ,PUTTY ,TUBE>>
+ <PERFORM ,V?PUT-ON ,PUTTY ,GLASS-CASE>
+ <RTRUE>)
+ (<VERB? SQUEEZE>
+ <COND (<AND <FSET? ,PRSO ,OPENBIT>
+ <IN? ,PUTTY ,PRSO>>
+ <MOVE ,PUTTY ,WINNER>
+ <TELL "You are now holding some putty." CR>)
+ (<FSET? ,PRSO ,OPENBIT>
+ <TELL "The tube is apparently empty." CR>)
+ (T
+ <TELL-CLOSED "tube">)>)>>
+
+<OBJECT PUTTY
+ (IN TUBE)
+ (DESC "glob of putty")
+ (SYNONYM PUTTY GUNK GLOB)
+ (ADJECTIVE GLOB)
+ (SIZE 4)
+ (FLAGS TAKEBIT)
+ (ACTION PUTTY-F)>
+
+<ROUTINE PUTTY-F ()
+ <COND (<COMPILER-SUCKS-EXP>
+ <COND (<IN? ,PUTTY ,GLASS-CASE>
+ <TELL-IN-CRACK>)
+ (T
+ <MOVE ,PUTTY ,GLASS-CASE>
+ <DISABLE <INT I-CASE-LEAK>>
+ <TELL "The putty seals the crack">
+ <COND (<OR <IN? ,HOLE-1 ,GLASS-CASE>
+ <IN? ,HOLE-2 ,GLASS-CASE>>
+ <TELL " and hole">)
+ (T <SETG NO-HOLE-PLUGGED T>)>
+ <TELL " in the " D ,GLASS-CASE "." CR>)>)
+ (<AND <IN? ,PUTTY ,GLASS-CASE>
+ <NOT <VERB? EXAMINE FIND>>>
+ <TELL-IN-CRACK>)
+ (<OR <AND <VERB? OIL>
+ <EQUAL? ,PRSI ,PUTTY>>
+ <AND <VERB? PUT>
+ <EQUAL? ,PRSO ,PUTTY>>>
+ <COND (<PRSI? ,TUBE>
+ <TELL-YOU-CANT "reverse entropy.">)
+ (T <TELL "It isn't a lubricant." CR>)>)>>
+
+<ROUTINE COMPILER-SUCKS-EXP ()
+ <COND (<AND <VERB? PUT PUT-ON>
+ <OR <PRSI? ,GLASS-CASE>
+ <AND <PRSI? ,HOLE-1>
+ <IN? ,HOLE-1 ,GLASS-CASE>>
+ <AND <PRSI? ,HOLE-2>
+ <IN? ,HOLE-2 ,GLASS-CASE>>>>
+ <RTRUE>)
+ (<AND <VERB? FILL PLUG>
+ <OR <PRSO? ,GLASS-CASE>
+ <AND <PRSO? ,HOLE-1>
+ <IN? ,HOLE-1 ,GLASS-CASE>>
+ <AND <PRSO? ,HOLE-2>
+ <IN? ,HOLE-2 ,GLASS-CASE>>>>
+ <RTRUE>)
+ (T <RFALSE>)>>
+
+<ROUTINE TELL-IN-CRACK ()
+ <TELL "The putty is already set in the crack." CR>>
+
+<GLOBAL NO-HOLE-PLUGGED <>>
+
+<OBJECT COMPRESSOR
+ (IN OUTFITTERS-HQ)
+ (DESC "small air compressor")
+ (SYNONYM COMPRE)
+ (ADJECTIVE AIR SMALL HEAVY SEMI-P)
+ (FLAGS NDESCBIT RENTBIT)
+ (TEXT
+"This heavy, semi-portable air compressor can fill scuba tanks.")
+ (SIZE 94)
+ (STATION 75) ;"metal content"
+ (NORTH 100) ;"price"
+ ;(ACTION COMPRESSOR-F)>
+
+;<ROUTINE COMPRESSOR-F ()
+ <COND (<VERB? TAKE>
+ <TELL "It's too heavy." CR>)>>
+
+<OBJECT INFIDEL-BOX
+ (IN OUTFITTERS-HQ)
+ (DESC "location box")
+ (SYNONYM BOX BUTTON)
+ (ADJECTIVE BLACK LOCATI DIRECT)
+ (FLAGS NDESCBIT)
+ (NORTH 1000) ;"price"
+ (ACTION INFIDEL-BOX-F)>
+
+<ROUTINE INFIDEL-BOX-F ()
+ <COND (<VERB? EXAMINE>
+ <TELL
+"This is state-of-the-art electronic equipment that automatically determines
+longitude and latitude when its button is pressed." CR>)
+ (<VERB? PUSH>
+ <TELL
+"Nothing happens, probably because you're indoors." CR>)>>
+
+<OBJECT DIVING-BOOK
+ (IN OUTFITTERS-HQ)
+ (DESC "diving book")
+ (SYNONYM BOOK)
+ (ADJECTIVE DIVING)
+ (FLAGS NDESCBIT READBIT)
+ (NORTH 20) ;"price"
+ (ACTION DIVING-BOOK-F)>
+
+<ROUTINE DIVING-BOOK-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<FSET? ,DIVING-BOOK ,RMUNGBIT>
+ <TELL-SOGGY>)
+ (T <TELL
+"This book is \"Everything About Diving\" by Fritz Zamboni." CR>)>)
+ (<VERB? READ OPEN>
+ <COND (<FSET? ,DIVING-BOOK ,RMUNGBIT>
+ <TELL-SOGGY>)
+ (T <TELL
+"It says nothing you don't already know." CR>)>)>>
+
+<ROUTINE TELL-SOGGY ()
+ <TELL "It's too soggy." CR>>
+
+<OBJECT MAGNET
+ (IN OUTFITTERS-HQ)
+ (DESC "portable electromagnet")
+ (SYNONYM ELECTR MAGNET)
+ (ADJECTIVE PORTAB ELECTR)
+ (FLAGS NDESCBIT TRANSBIT)
+ (CONTFCN MAGNET-F)
+ (DESCFCN MAGNET-F)
+ (NORTH 250) ;"price"
+ (STATION 20) ;"metal content"
+ (ACTION MAGNET-F)>
+
+<ROUTINE MAGNET-F ("OPTIONAL" (RARG <>) "AUX" F N OBJ)
+ <COND (<EQUAL? .RARG ,M-CONT>
+ <COND (<AND <VERB? TAKE WEAR>
+ <NOT <PRSO? ,MINE>>
+ ,MAGNET-ON>
+ <TELL "The magnet's stronger than you are." CR>)
+ (<VERB? DROP THROW>
+ <TELL "It's stuck to the magnet." CR>)>)
+ (<==? .RARG ,M-OBJDESC>
+ <TELL "There is a " D ,MAGNET " here." CR>
+ <COND (<SET F <FIRST? ,MAGNET>>
+ <COND (<==? .F ,MINE> T)
+ (,MAGNET-ON
+ <TELL "Attached to the magnet ">
+ <COND (<NEXT? .F>
+ <TELL "are">)
+ (T <TELL "is">)>
+ <TELL " ">
+ <PRINT-CONTENTS ,MAGNET>
+ <TELL "." CR>)
+ (T
+ <DESCRIBE-OBJECT .F T 0>)>)>
+ <RTRUE>)
+ (<VERB? EXAMINE>
+ <COND (<AND ,MAGNET-ON
+ <FIRST? ,MAGNET>>
+ <TELL "The " D ,MAGNET " is on and has ">
+ <PRINT-CONTENTS ,MAGNET>
+ <TELL " attached to it." CR>
+ <SETG P-IT-OBJECT ,MAGNET>)
+ (T <TELL
+"The " D ,MAGNET " has a switch which is currently ">
+ <COND (,MAGNET-ON <TELL "on">)
+ (T <TELL "off">)>
+ <TELL "." CR>)>)
+ (<VERB? LAMP-ON>
+ <COND (,MAGNET-ON
+ <TELL-ALREADY "on">)
+ (T
+ <SETG MAGNET-ON T>
+ <TELL-NOW ,MAGNET "on">
+ <ATTRACTION>)>)
+ (<VERB? LAMP-OFF>
+ <COND (,MAGNET-ON
+ <SETG MAGNET-ON <>>
+ <TELL-NOW ,MAGNET "off." <>>
+ <COND (<SET F <FIRST? ,MAGNET>>
+ <TELL-ALL-FALL>
+ <REPEAT ()
+ <COND (<NOT .F> <RETURN>)>
+ <SET N <NEXT? .F>>
+ <MOVE .F ,HERE>
+ <COND (<EQUAL? .F ,MINE>
+ <FSET ,MINE ,RMUNGBIT>
+ <TELL CR
+"The mine drifts harmlessly into a corner.">)>
+ <SET F .N>>)>
+ <CRLF>)
+ (T <TELL-ALREADY "off">)>)
+ (<VERB? DROP THROW>
+ <COND (<IN? ,MINE ,MAGNET>
+ <COND (,MAGNET-ON
+ <FSET ,MINE ,RMUNGBIT>)
+ (T <MOVE ,MINE ,HERE>)>
+ <RFALSE>)
+ (<NOT ,MAGNET-ON>
+ <CLEAR-MAGNET>
+ <RFALSE>)>)
+ (<AND <VERB? TAKE>
+ <PRSO? ,MAGNET>>
+ <COND (<IN? ,MINE ,MAGNET>
+ <BOOM>)>)
+ (<OR <AND <VERB? PUT-ON PUT-AGAINST>
+ <PRSO? ,MAGNET>
+ <SET OBJ ,PRSI>>
+ <AND <VERB? RUB>
+ <PRSI? ,MAGNET>
+ <SET OBJ ,PRSO>>>
+ <COND (<FSET? .OBJ ,SURFACEBIT>
+ <CLEAR-MAGNET>
+ <RFALSE>)
+ (<OR ,MAGNET-ON
+ <==? .OBJ ,ME>
+ <GETP .OBJ ,P?CHARACTER>>
+ <TELL-WHY-BOTHER>)
+ (<IN? .OBJ ,PLAYER>
+ <TELL "The magnet is touching ">
+ <THE? ,PRSI>
+ <TELL D ,PRSI "." CR>)
+ (T
+ <COND (<SET F <FIRST? ,MAGNET>>
+ <MOVE .F ,HERE>)>
+ <COND(<AND <SET N <LOC .OBJ>>
+ <NOT <EQUAL? .N ,GLOBAL-OBJECTS ,LOCAL-GLOBALS>>>
+ <MOVE .OBJ ,MAGNET>)>
+ <TELL-NOW ,MAGNET "touching " <>>
+ <THE? .OBJ>
+ <TELL D .OBJ "." CR>)>)>>
+
+<ROUTINE TELL-NOW (OBJ STR "OPTIONAL" (FINISH? T))
+ <TELL "The " D .OBJ " is now " .STR>
+ <COND (.FINISH? <TELL "." CR>)>>
+
+<GLOBAL MAGNET-ON <>>
+
+<ROUTINE ATTRACTION ("AUX" F N)
+ <SET F <FIRST? ,HERE>>
+ <COND (<AND <SET N <FIRST? ,MAGNET>>
+ <OR <NOT <GETP .N ,P?STATION>>
+ <NOT <FSET? .N ,TAKEBIT>>>>
+ <MOVE .N ,HERE>)>
+ <REPEAT ()
+ <COND (<NOT .F> <RETURN>)>
+ <SET N <NEXT? .F>>
+ <COND (<AND <NOT <FSET? .F ,INVISIBLE>>
+ <GETP .F ,P?STATION>
+ <FSET? .F ,TAKEBIT>
+ <NOT <==? .F ,MAGNET>>>
+ <MOVE .F ,MAGNET>
+ <COND (<AND <==? .F ,IRON-BAR>
+ <==? ,HERE ,WRECK-5>>
+ <JIGS-UP
+"As the spikes jump toward the magnet, one of them pierces your chest!">)>
+ <TELL "The " D .F " jumps to the magnet.">
+ <COND (<EQUAL? .F ,MINE>
+ <TELL
+" Unfortunately, even though the spikes are spaced widely apart, one gets
+pushed..." CR CR>
+ <BOOM>)>
+ <CRLF>)>
+ <SET F .N>>>
+
+<ROUTINE CLEAR-MAGNET ("AUX" F N)
+ <SET F <FIRST? ,MAGNET>>
+ <REPEAT ()
+ <COND (<NOT .F> <RETURN>)>
+ <SET N <NEXT? .F>>
+ <MOVE .F ,HERE>
+ <SET F .N>>>
+
+<OBJECT FLASHLIGHT
+ (IN OUTFITTERS-HQ)
+ (DESC "flashlight")
+ (SYNONYM FLASHL LIGHT LAMP LANTER)
+ (ADJECTIVE SEALED WATERP PORTAB ONE-PI)
+ (FLAGS NDESCBIT)
+ (NORTH 24) ;"price"
+ (ACTION FLASHLIGHT-F)>
+
+<ROUTINE FLASHLIGHT-F ()
+ <COND (<VERB? LAMP-ON>
+ <COND (<FSET? ,FLASHLIGHT ,ONBIT>
+ <TELL-ALREADY "on">)
+ (T
+ <FSET ,FLASHLIGHT ,ONBIT>
+ <TELL-NOW ,FLASHLIGHT "on">
+ <COND (<NOT ,LIT>
+ <SETG LIT <LIT? ,HERE>>
+ <CRLF>
+ <V-LOOK>)>
+ <RTRUE>)>)
+ (<VERB? LAMP-OFF>
+ <COND (<FSET? ,FLASHLIGHT ,ONBIT>
+ <FCLEAR ,FLASHLIGHT ,ONBIT>
+ <SETG LIT <LIT? ,HERE>>
+ <TELL-NOW ,FLASHLIGHT "off">)
+ (T <TELL-ALREADY "off">)>)
+ (<VERB? EXAMINE>
+ <TELL
+"The sealed, waterproof " D ,FLASHLIGHT " is ">
+ <COND (<FSET? ,FLASHLIGHT ,ONBIT>
+ <TELL "on">)
+ (T <TELL "off">)>
+ <TELL "." CR>)
+ (<AND <VERB? AIM>
+ <PRSO? ,FLASHLIGHT>
+ <FSET? ,FLASHLIGHT ,ONBIT>>
+ <TELL "The " D ,FLASHLIGHT " is shining on ">
+ <THE? ,PRSI>
+ <TELL D ,PRSI "." CR>)>>
+
+<OBJECT SHARK-REPELLENT
+ (IN OUTFITTERS-HQ)
+ (DESC "shark repellent canister")
+ (SYNONYM REPELL CAN CANIST LABEL ;LID)
+ (ADJECTIVE SHARK REPELL CANIST)
+ (FLAGS NDESCBIT)
+ (NORTH 20) ;"price"
+ (ACTION SHARK-REPELLENT-F)>
+
+<ROUTINE SHARK-REPELLENT-F ()
+ <COND (<VERB? OPEN>
+ <COND (<FSET? ,SHARK-REPELLENT ,OPENBIT>
+ <TELL-ALREADY "open">)
+ (T
+ <FSET ,SHARK-REPELLENT ,OPENBIT>
+ <TELL "Opened.">
+ <COND (<OR <L? <GETP ,HERE ,P?LINE>
+ ,UNDERWATER-LINE-C>
+ <AIRTIGHT-ROOM?>>
+ <JIGS-UP
+" The canister begins to emit noxious fumes. Before you can do anything
+about it, you lose consciousness.">)>
+ <CRLF>)>)
+ (<VERB? CLOSE>
+ <COND (<FSET? ,SHARK-REPELLENT ,OPENBIT>
+ <TELL "It can't be closed." CR>)
+ (T
+ <TELL-ALREADY "closed">)>)
+ (<VERB? EXAMINE>
+ <TELL "The canister, which is ">
+ <COND (<FSET? ,SHARK-REPELLENT ,OPENBIT>
+ <TELL "open">)
+ (T <TELL "closed">)>
+ <TELL
+", has a label which says, \"IMPORTANT: read this label!\"" CR>)
+ (<VERB? READ>
+ <TELL
+"The label says:
+\"IMPORTANT: read this label!|
+|
+SWANZO BRAND SHARK REPELLENT|
+|
+This product will repel sharks, or your money back! Simply
+open the canister UNDERWATER. Works for 5 hours. WARNING: Fumes
+released in air may be hazardous to humans.\"" CR>)>>
+
+;<OBJECT NEW-KNIFE
+ (IN OUTFITTERS-HQ)
+ (DESC "steel knife")
+ (SYNONYM KNIFE)
+ (ADJECTIVE NEW STEEL)
+ (FLAGS NDESCBIT)
+ (STATION 15) ;"metal content"
+ (NORTH 45) ;"price">
+
+<OBJECT CHARTS
+ (IN OUTFITTERS-HQ)
+ (DESC "set of nautical charts")
+ (SYNONYM CHARTS MAPS CHART SET)
+ (ADJECTIVE NAUTIC OCEAN SEA)
+ (FLAGS NDESCBIT READBIT)
+ (TEXT "These are charts for the Hardscrabble Island area.")
+ (NORTH 150) ;"price">
+
+<OBJECT CAGE
+ (IN OUTFITTERS-HQ)
+ (DESC "diving cage")
+ (SYNONYM CAGE)
+ (ADJECTIVE DIVING)
+ (FLAGS NDESCBIT RENTBIT)
+ (STATION 90) ;"metal content"
+ (NORTH 650) ;"price">
+
+<ROOM SHANTY
+ (IN ROOMS)
+ (DESC "The Shanty")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"This is The Shanty, a tavern which serves the locals. A wooden bar
+travels the length of the place, and behind it is a mirror so dirty,
+it offers no reflection. Round tables occupy the floor. The smell of
+cooking food permeates the place.")
+ (GLOBAL FRONT-DOOR)
+ (NORTH TO WHARF-ROAD-5)
+ (OUT TO WHARF-ROAD-5)
+ (STATION WHARF-ROAD-5)
+ (LINE 1)
+ (PSEUDO "TABLES" FURNITURE-PSEUDO "CHAIRS" FURNITURE-PSEUDO)
+ (ACTION SHANTY-F)>
+
+<GLOBAL WARNING-STR
+"Johnny looks around and says, \"This is no place to continue. If McGinty
+finds out about this, we're sunk. We better meet at the lighthouse at 9:30.
+Glad you're aboard.\"">
+
+<ROUTINE SHANTY-F (RARG)
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <MOVE ,FOOD ,SHANTY>
+ <FSET ,FOOD ,NDESCBIT>
+ <SETG SOUPS-ON <>>
+ <MOVE ,DRINKING-WATER ,SHANTY>
+ <FSET ,DRINKING-WATER ,NDESCBIT>
+ <MOVE ,DRINK-OBJECT ,SHANTY>
+ <FSET ,DRINK-OBJECT ,NDESCBIT>
+ <PUTP ,DRINKING-WATER ,P?SDESC "water">
+ <MOVE ,SPEAR-CARRIER ,SHANTY>
+ <PUTP ,SPEAR-CARRIER ,P?SDESC "bartender">
+ <PUTP ,SPEAR-CARRIER ,P?LDESC
+"A bartender behind the bar polishes glasses with a worn towel.">
+ <COND (<L? ,PRESENT-TIME 541>
+ <ENABLE <QUEUE I-FIRST-MEETING -1>>)
+ (T <SETG FM-CTR 5>)>)
+ (<EQUAL? .RARG ,M-BEG>
+ <COND (<AND <VERB? YES>
+ <==? ,FM-CTR 4>>
+ <TELL ,WARNING-STR CR>
+ <SETG FM-CTR 5>
+ <RATING-UPD 20>
+ <DISABLE <INT I-FIRST-MEETING>>
+ <SETG MEETINGS-COMPLETED 1>)
+ (<AND <VERB? NO>
+ <==? ,FM-CTR 4>>
+ <TELL-NO-CONTINUE>
+ <I-PLOT-NEVER-STARTS>
+ <SETG JOHNNY-SILENT T>
+ <DISABLE <INT I-FIRST-MEETING>>)>)>>
+
+<GLOBAL JOHNNY-SILENT <>>
+
+<ROUTINE TELL-NO-CONTINUE ()
+ <TELL
+"The three men look at each other in disbelief. \"If you wanna ignore
+the chance of a lifetime, you're nuts,\" " D ,WEASEL " states. Johnny says,
+\"We'll find someone else.\" They then ignore you." CR>>
+
+<OBJECT PARROT
+ (IN SHANTY)
+ (SYNONYM PARROT BIRD LEG)
+ (ADJECTIVE POLLY WOODEN)
+ (DESC "parrot")
+ (LDESC
+"A parrot with an eyepatch hobbles up and down the bar.")
+ (TEXT
+"It sports an eyepatch and wooden leg and has been here since the
+bartender bought it from a sailor. It's considered insane by the
+local patrons.")
+ (FLAGS VICBIT TRANSBIT)
+ (ACTION PARROT-F)>
+
+<ROUTINE PARROT-F ()
+ <COND (<EQUAL? ,WINNER ,PARROT>
+ <SETG P-CONT <>>
+ <SETG QUOTE-FLAG <>>
+ <COND (<VERB? HELLO>
+ <TELL <PICK-ONE ,PARROTISMS> CR>)
+ (<AND <VERB? FIND> <PRSO? ,ME>>
+ <TELL "\"You're right here.\"" CR>)
+ (T
+ <TELL
+"\"An interesting concept, but I am incapable.\"" CR>)>
+ <RTRUE>)
+ (<AND <VERB? TELL>
+ ,P-CONT>
+ <RFALSE>)
+ (<VERB? EXAMINE FIND>
+ <RFALSE>)
+ (<NOT <==? ,HERE ,SHANTY>>
+ <RFALSE>)
+ (<VERB? LOOK-UNDER>
+ <TELL-NOTHING "but claw prints there" T>)
+ (<AND <VERB? ASK-ABOUT>
+ <PRSI? ,PARROT>>
+ <RFALSE>)
+ (T
+ <TELL <PICK-ONE ,PARROTISMS> CR>)>>
+
+<GLOBAL PARROTISMS
+ <LTABLE
+"\"As my Pappy said, 'When you travel the highways of life, you do not
+always get to stop and look at a roadmap.'\""
+"\"I must admit that in my wide travels across this ball of wax, I have
+seen many human specimens, though none quite like you.\""
+"\"After due consideration, I find myself in an embarrassing position. I would
+gladly accept a hard biscuit today, if you would accept payment Tuesday.\""
+"\"Read any good books lately? I found 'Tropical Birds and their Native
+Habitats' quite engrossing.\""
+"\"Compared to salted biscuits, I like myself best.\""
+"\"Hello Sailor.\"">>
+
+<OBJECT PARROTS-PATCH
+ (IN PARROT)
+ (DESC "small eyepatch")
+ (SYNONYM PATCH EYEPAT)
+ (ADJECTIVE PARROT BLACK SMALL)
+ (FLAGS NDESCBIT TRYTAKEBIT)
+ (ACTION PARROTS-PATCH-F)>
+
+<ROUTINE PARROTS-PATCH-F ()
+ <COND (<OR <VERB? LOOK-UNDER ASK-FOR DISEMBARK>
+ <VERB? MOVE>
+ <AND <VERB? TAKE>
+ <OR <NOT ,PRSI>
+ <PRSI? ,PARROT>>>>
+ <TELL "Mind your manners." CR>)
+ (<VERB? EXAMINE>
+ <TELL "It's a small black eyepatch." CR>)>>
+
+<OBJECT TABLE-OBJECT
+ (IN SHANTY)
+ (DESC "table")
+ (SYNONYM TABLE)
+ (FLAGS NDESCBIT SURFACEBIT CONTBIT OPENBIT TRANSBIT)
+ (CAPACITY 15)>
+
+<OBJECT CHAIR
+ (IN SHANTY)
+ (DESC "chair")
+ (SYNONYM CHAIR SEAT)
+ (FLAGS NDESCBIT VEHBIT SURFACEBIT TRANSBIT OPENBIT)
+ (CAPACITY 10)
+ (ACTION CHAIR-F)>
+
+<ROUTINE CHAIR-F ("OPTIONAL" (RARG <>) "AUX" F)
+ <COND (<EQUAL? .RARG ,M-BEG>
+ <COND (<AND <VERB? DISEMBARK>
+ <PRSO? ,CHAIR>
+ <L? ,FM-CTR 5>>
+ <TELL
+"Johnny pushes you back. \"Can't you wait a few minutes?\"" CR>
+ <RTRUE>)
+ (<AND <VERB? YES>
+ <==? ,FM-CTR 4>>
+ <TELL ,WARNING-STR CR>
+ <SETG FM-CTR 5>
+ <RATING-UPD 20>
+ <DISABLE <INT I-FIRST-MEETING>>
+ <SETG MEETINGS-COMPLETED 1>)
+ (<AND <VERB? NO>
+ <==? ,FM-CTR 4>>
+ <TELL-NO-CONTINUE>
+ <I-PLOT-NEVER-STARTS>
+ <DISABLE <INT I-FIRST-MEETING>>)>)
+ (<PRSO? ,CHAIR>
+ <COND (<VERB? BOARD>
+ <COND (<SET F <FIRST? ,CHAIR>>
+ <TELL-NOT-COMFORTABLE>
+ ;<TELL "Sitting on ">
+ ;<THE? .F>
+ ;<TELL D .F " would be uncomfortable." CR>)
+ (<==? ,FM-CTR 0>
+ <SETG FM-CTR 1>
+ <DISABLE <INT I-PLOT-NEVER-STARTS>>
+ <RFALSE>)>)>)>>
+
+<ROUTINE FURNITURE-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "furniture">)
+ (<VERB? EXAMINE>
+ <TELL "There are a number of tables and chairs here." CR>)>>
+
+<OBJECT BAR
+ (IN SHANTY)
+ (DESC "bar")
+ (SYNONYM BAR SURFAC)
+ (ADJECTIVE AGED WOODEN OLD HUGE WORN)
+ (FLAGS SURFACEBIT CONTBIT NDESCBIT OPENBIT)
+ (CAPACITY 20)
+ (ACTION BAR-F)>
+
+<ROUTINE BAR-F ("AUX" F)
+ <COND (<VERB? OPEN CLOSE>
+ <TELL "Leave that to the management." CR>)
+ (<VERB? EXAMINE>
+ <TELL
+"It is a worn wooden bar that has had more than its share of drinks on it.
+The parrot doesn't do it much good, either">
+ <COND (<SET F <FIRST? ,BAR>>
+ <TELL ". Sitting on the bar ">
+ <COND (<NEXT? .F>
+ <TELL "are ">)
+ (T <TELL "is ">)>
+ <PRINT-CONTENTS ,BAR>)>
+ <TELL "." CR>
+ <RTRUE>)
+ (<VERB? LOOK-BEHIND>
+ <TELL "The bartender is there." CR>)>>
+
+<OBJECT MIRROR
+ (IN SHANTY)
+ (DESC "mirror")
+ (SYNONYM MIRROR)
+ (ADJECTIVE DUSTY DIRTY AGED GRIMY)
+ (FLAGS NDESCBIT)
+ (ACTION MIRROR-F)>
+
+<ROUTINE MIRROR-F ()
+ <COND (<VERB? LOOK-INSIDE EXAMINE>
+ <TELL "You see grime rather than a reflection." CR>)
+ (<VERB? CLEAN>
+ <TELL-CANT-REACH "it to clean it">)
+ (<VERB? MUNG>
+ <TELL "That would be unlucky." CR>)>>
+
+<OBJECT FOOD
+ (IN SHANTY)
+ (DESC "meal")
+ (SYNONYM FOOD MEAL STEW)
+ (ADJECTIVE BREAKF LUNCH DINNER BEEF)
+ (NORTH 5) ;"price"
+ (FLAGS NDESCBIT FOODBIT)
+ (ACTION FOOD-F)>
+
+<ROUTINE FOOD-F ()
+ <COND (<AND <VERB? FIND>
+ ,P-NONOUN
+ <==? ,P-XADJN ,W?BEEF>>
+ <TELL "Gimme a break!" CR>)
+ (<VERB? BUY>
+ <COND (<G? <GETP ,HERE ,P?LINE> ,BACK-ALLEY-LINE-C>
+ <TELL "Free food is a benefit of this job." CR>)
+ (<==? ,HOW-HUNGRY 0>
+ <TELL-WAIT-HUNGRY>)
+ (,SOUPS-ON
+ <TELL "You only need one meal at a time." CR>)
+ (<L? ,POCKET-CHANGE 5>
+ <TELL-NO-AFFORD>)
+ (T
+ <SETG POCKET-CHANGE <- ,POCKET-CHANGE 5>>
+ <SETG SOUPS-ON T>
+ <MOVE ,FOOD ,TABLE-OBJECT>
+ <FCLEAR ,FOOD ,NDESCBIT>
+ <TELL "You have bought a meal for $5." CR>)>)
+ (<VERB? EAT>
+ <COND (,SOUPS-ON
+ <COND (<0? ,HOW-HUNGRY>
+ <TELL-WAIT-HUNGRY>
+ <RTRUE>)>
+ <ENABLE <QUEUE I-HUNGER 150>>
+ <SETG HOW-HUNGRY 0>
+ <COND (<==? ,HERE ,SHANTY>
+ <SETG SOUPS-ON <>>
+ <FSET ,FOOD ,NDESCBIT>
+ <MOVE ,FOOD ,SHANTY>)>
+ <TELL "Not bad! It really hit the spot." CR>)
+ (<==? ,HERE ,SHANTY>
+ <TELL "You'll have to buy it before you can eat it." CR>)
+ (T <TELL
+"You'll have to wait for Pete to finish fixing it." CR>)>)
+ (<VERB? SMELL>
+ <TELL "It smells fairly tasty." CR>)
+ (<VERB? EXAMINE>
+ <COND (<G? <GETP ,HERE ,P?LINE> ,BACK-ALLEY-LINE-C>
+ <TELL "It looks like a pretty standard stew." CR>)
+ (,SOUPS-ON
+ <TELL
+"This stew is a staple of " D ,SHANTY " and is edible." CR>)
+ (T <GLOBAL-NOT-HERE-PRINT ,PRSO>)>)
+ (<VERB? FIND>
+ <COND (<IN? ,FOOD ,TABLE-OBJECT>
+ <TELL "It's on the table." CR>)
+ (<EQUAL? <META-LOC ,PLAYER> ,SHANTY>
+ <TELL "You can order food here." CR>)>)>>
+
+<ROUTINE TELL-WAIT-HUNGRY ()
+ <TELL "Wait until you're a little hungrier." CR>>
+
+<OBJECT DRINKING-WATER
+ (IN SHANTY)
+ ;(DESC "water")
+ (SDESC "water")
+ (SYNONYM WATER GLASS)
+ (ADJECTIVE DRINKI)
+ (FLAGS NDESCBIT DRINKBIT TRYTAKEBIT)
+ (ACTION DRINKING-WATER-F)>
+
+<ROUTINE DRINKING-WATER-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<IN? ,DRINKING-WATER ,TABLE-OBJECT>
+ <TELL "It's a glass of water, what else?" CR>)
+ (<EQUAL? ,HERE ,MM-GALLEY ,NW-GALLEY>
+ <TELL
+"There's a tap in the sink which dispenses bottled water." CR>)
+ (T <TELL
+"You can ask the bartender for a glass." CR>)>)
+ (<VERB? DRINK>
+ <COND (<OR <IN? ,DRINKING-WATER ,TABLE-OBJECT>
+ <EQUAL? ,HERE ,MM-GALLEY ,NW-GALLEY>>
+ <COND (<G? ,SLOSH-CTR 4>
+ <TELL "Are you trying to do an ocean imitation?" CR>)
+ (T
+ <SETG HOW-THIRSTY 0>
+ <SETG SLOSH-CTR <+ ,SLOSH-CTR 1>>
+ <ENABLE <QUEUE I-THIRST 180>>
+ <MOVE ,DRINKING-WATER ,HERE>
+ <FSET ,DRINKING-WATER ,NDESCBIT>
+ <PUTP ,DRINKING-WATER ,P?SDESC "water">
+ <TELL "You feel much refreshed." CR>)>)
+ (<EQUAL? <META-LOC ,PLAYER> ,SHANTY>
+ <TELL-ASK-FIRST>)>)
+ (<AND <VERB? BUY>
+ <EQUAL? ,HERE ,MM-GALLEY ,NW-GALLEY>>
+ <TELL-JUST>)
+ (<VERB? TAKE>
+ <COND (<IN? ,DRINKING-WATER ,SHANTY>
+ <TELL-ASK-FIRST>)
+ (T <TELL-JUST>)>)
+ (<VERB? FIND>
+ <COND (<IN? ,DRINKING-WATER ,TABLE-OBJECT>
+ <TELL "It's on the table." CR>)
+ (<EQUAL? <META-LOC ,PLAYER> ,SHANTY>
+ <TELL "You can order water here." CR>)>)>>
+
+<GLOBAL SLOSH-CTR 0>
+
+<ROUTINE TELL-ASK-FIRST ()
+ <TELL "Ask the bartender for some water first." CR>>
+
+<ROUTINE TELL-JUST ()
+ <TELL "Just drink it." CR>>
+
+<OBJECT DRINK-OBJECT
+ (IN SHANTY)
+ (DESC "drink")
+ (SYNONYM DRINK GROG LIQUOR BOOZE)
+ (ADJECTIVE ALCOHO)
+ (NORTH 2) ;"price"
+ (FLAGS NDESCBIT DRINKBIT)
+ (ACTION DRINK-OBJECT-F)>
+
+<ROUTINE DRINK-OBJECT-F ()
+ <COND (<VERB? EXAMINE>
+ <COND (<IN? ,DRINK-OBJECT ,TABLE-OBJECT>
+ <TELL
+"It's grog which has left many staggering." CR>)
+ (T <TELL-BUY-FIRST>)>)
+ (<VERB? BUY>
+ <COND (<IN? ,DRINK-OBJECT ,TABLE-OBJECT>
+ <TELL-YOU-ALREADY "have a drink.">)
+ (<L? ,POCKET-CHANGE 2>
+ <TELL-NO-AFFORD>)
+ (T
+ <MOVE ,DRINK-OBJECT ,TABLE-OBJECT>
+ <FCLEAR ,DRINK-OBJECT ,NDESCBIT>
+ <SETG POCKET-CHANGE <- ,POCKET-CHANGE 2>>
+ <TELL "You have bought a drink for $2." CR>)>)
+ (<VERB? DRINK>
+ <COND (<IN? ,DRINK-OBJECT ,TABLE-OBJECT>
+ <MOVE ,DRINK-OBJECT ,SHANTY>
+ <ENABLE <QUEUE I-THIRST 90>>
+ <SETG HOW-THIRSTY 0>
+ <FSET ,DRINK-OBJECT ,NDESCBIT>
+ <SETG BLOOD-ALCOHOL <+ ,BLOOD-ALCOHOL 6>>
+ <TELL "It burns your throat on the way down." CR>)
+ (T <TELL-BUY-FIRST>)>)
+ (<VERB? TASTE>
+ <COND (<NOT <IN? ,DRINK-OBJECT ,TABLE-OBJECT>>
+ <TELL-BUY-FIRST>)>)
+ (<VERB? FIND>
+ <COND (<IN? ,DRINK-OBJECT ,TABLE-OBJECT>
+ <TELL "It's on the table." CR>)
+ (<EQUAL? <META-LOC ,PLAYER> ,SHANTY>
+ <TELL "You can order grog here." CR>)>)>>
+
+<ROUTINE TELL-BUY-FIRST ()
+ <TELL "You'll have to order one first." CR>>
+
+<GLOBAL BLOOD-ALCOHOL 0>
+
+<OBJECT NON-DRINK
+ (IN SHANTY)
+ (DESC "liquor")
+ (SYNONYM WHISKY WHISKE BEER WINE)
+ (ADJECTIVE SCOTCH BOURBO DRAFT RUM COFFEE)
+ (FLAGS DRINKBIT NDESCBIT)
+ (ACTION NON-DRINK-F)>
+
+<ROUTINE NON-DRINK-F ()
+ <TELL-YOUD-BETTER "stick with grog.">>
+
+<ROOM BANK
+ (IN ROOMS)
+ (DESC "Mariners' Trust")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in Mariners' Trust, the Island's bank.
+In it are a table and a teller's window.
+You can see the safe beyond, and it looks pretty empty.")
+ (GLOBAL WINDOW FRONT-DOOR)
+ (SOUTH TO SHORE-ROAD-2)
+ (OUT TO SHORE-ROAD-2)
+ (PSEUDO "TABLE" TABLE-PSEUDO)
+ (LINE 1)
+ (STATION SHORE-ROAD-2)
+ (ACTION BANK-F)>
+
+<ROUTINE BANK-F (RARG)
+ <COND (<EQUAL? .RARG ,M-ENTER>
+ <MOVE ,SPEAR-CARRIER ,BANK>
+ <PUTP ,SPEAR-CARRIER ,P?SDESC "teller">
+ <PUTP ,SPEAR-CARRIER ,P?LDESC
+"A teller sits behind the window.">)
+ (<EQUAL? .RARG ,M-BEG>
+ <COND (<VERB? WITHDRAW>
+ <COND ;(<PRSO? ,RIDICULOUS-MONEY-KLUDGE>
+ <TELL "You should specify an amount." CR>)
+ (<NOT <PRSO? ,INTNUM>>
+ <RFALSE>)
+ (<NOT ,P-DOLLAR-FLAG>
+ <TELL-YOU-CANT "withdraw that!">)
+ (<L? ,P-AMOUNT 1>
+ <TELL-SERIOUS>)
+ (<NOT <IN? ,PASSBOOK ,PLAYER>>
+ <TELL
+"The teller points out that you don't have your passbook." CR>)
+ (<G? ,P-AMOUNT ,PASSBOOK-BALANCE>
+ <TELL
+"The teller takes your passbook, checks the balance, tells you that there's not
+enough to cover your planned withdrawal, and returns it." CR>)
+ (T
+ <SETG PASSBOOK-BALANCE <- ,PASSBOOK-BALANCE
+ ,P-AMOUNT>>
+ <SETG POCKET-CHANGE <+ ,POCKET-CHANGE ,P-AMOUNT>>
+ <SETG STUPID-PROBLEM-STRING "September 19">
+ <TELL
+"The teller takes your passbook, enters the withdrawal, hands you the
+money and your passbook, and says \"Have a good day.\"" CR>)>)
+ (<VERB? DEPOSIT>
+ <COND (<AND ,PRSI <NOT <PRSI? ,GLOBAL-BANK>>>
+ <PERFORM ,V?PUT ,PRSO ,PRSI>
+ <RTRUE>)
+ (<OR <NOT ,P-DOLLAR-FLAG>
+ <NOT <PRSO? ,INTNUM>>>
+ <COND (<NOT <HELD? ,PRSO>>
+ <TELL-DONT-HAVE <>>
+ <THE? ,PRSO>
+ <TELL D ,PRSO "." CR>)
+ (T <TELL
+"The teller looks at the " D ,PRSO " and returns it, pointing out
+that you don't have a safe deposit box." CR>)>)
+ (<G? ,P-AMOUNT ,POCKET-CHANGE>
+ <TELL-YOU-CANT "deposit more than you have.">)
+ (<L? ,P-AMOUNT 1>
+ <TELL-SERIOUS>)
+ (<NOT <IN? ,PASSBOOK ,PLAYER>>
+ <TELL
+"The teller points out that you need to have your passbook." CR>)
+ (T
+ <SETG PASSBOOK-BALANCE
+ <+ ,PASSBOOK-BALANCE ,P-AMOUNT>>
+ <SETG POCKET-CHANGE <- ,POCKET-CHANGE ,P-AMOUNT>>
+ <SETG STUPID-PROBLEM-STRING "September 19">
+ <TELL
+"The teller takes your money and passbook, records the deposit, returns
+the passbook, and says \"Thank you for banking at " D ,BANK ".\"" CR>)>)>)>>
+
+;<ROUTINE TELL-SERIOUS ()
+ <TELL "The teller fails to smile." CR>>
+
+<OBJECT RIDICULOUS-MONEY-KLUDGE
+ (IN BANK)
+ (SYNONYM MONEY CASH BILLS \$)
+ (DESC "money")
+ (FLAGS NDESCBIT)
+ (ACTION RIDICULOUS-MONEY-KLUDGE-F)>
+
+<ROUTINE RIDICULOUS-MONEY-KLUDGE-F ()
+ <COND (<VERB? ASK-ABOUT>
+ <RFALSE>)
+ (<VERB? FIND COUNT>
+ <PERFORM ,PRSA ,GLOBAL-MONEY>
+ <RTRUE>)
+ (T <TELL "You should specify an amount." CR>)>>
+
+<ROUTINE VAULT-F ();"SAFE object defined in WRECKS"
+ <COND (<AND <VERB? THROUGH>
+ <NOT <==? ,HERE ,BANK>>>
+ <GLOBAL-NOT-HERE-PRINT ,SAFE>)
+ (<VERB? EXAMINE LOOK-INSIDE>
+ <TELL
+"The safe is behind the teller's window and is mostly empty." CR>)
+ (<VERB? ASK-ABOUT FIND>
+ <RFALSE>)
+ (T <TELL "There's no way you can get at the safe." CR>)>>
+
+<ROOM POINT-LOOKOUT
+ (IN ROOMS)
+ (DESC "Point Lookout")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are at Point Lookout, a small, high cliff that affords a spectacular
+view of the sea. The cliff bottom is dangerous, so the only safe path is
+the northwest footpath back to the Ocean Road.")
+ (GLOBAL LIGHTHOUSE OCEAN ROCKS)
+ (NW TO OCEAN-ROAD-3)
+ (DOWN
+"If you really want to jump, say so, but do so at your own risk.")
+ (CORRIDOR 32)
+ (LINE 1)
+ (STATION OCEAN-ROAD-3)
+ (PSEUDO "CLIFF" CLIFF-PSEUDO)
+ (ACTION POINT-LOOKOUT-F)>
+
+<ROUTINE POINT-LOOKOUT-F (RARG)
+ <COND (<==? .RARG ,M-ENTER>
+ <COND (<AND <==? ,MEETINGS-COMPLETED 2>
+ <L? ,PRESENT-TIME 660>>
+ <ENABLE <QUEUE I-THIRD-MEETING -1>>)>)
+ (<==? .RARG ,M-BEG>
+ <COND (<VERB? LEAP>
+ <JIGS-UP
+"Your pleasant leap is interrupted as you find yourself impaled on the
+jagged rocks.">)
+ (<AND <G? ,TM-CTR 0>
+ <L? ,TM-CTR 6>>
+ <COND (<VERB? YES>
+ <TELL "\"That's nice, but I'd like to see it.\"" CR>)
+ (<VERB? NO>
+ <SETG TM-CTR 4>
+ <I-THIRD-MEETING>);"kills player"
+ (<VERB? WALK>
+ <TELL
+"Johnny puts a hand on your shoulder. \"Not so fast, matey.\"" CR>)
+ (<AND <VERB? SHOW>
+ <PRSI? ,JOHNNY>>
+ <COND (<AND <OR <PRSO? ,GLOBAL-MONEY>
+ <AND <PRSO? ,INTNUM>
+ ,P-DOLLAR-FLAG>>
+ <OR <FSET? ,WET-SUIT ,WORNBIT>
+ <FSET? ,DEEP-SUIT ,WORNBIT>>>
+ <TELL-CANT-REACH "your money">
+ <RTRUE>)>
+ <COND (<PRSO? ,GLOBAL-MONEY>
+ <SETG P-AMOUNT 0>)>
+ <COND (<OR <AND <PRSO? ,GLOBAL-MONEY>
+ <G? ,POCKET-CHANGE 499>>
+ <AND <PRSO? ,INTNUM>
+ ,P-DOLLAR-FLAG
+ <G? ,P-AMOUNT 499>
+ <NOT <G? ,P-AMOUNT ,POCKET-CHANGE>>>>
+ <SETG TM-CTR 5>
+ <TELL
+"He smiles and flashes a wad that represents the contributions of your
+three partners." CR>)
+ (<OR <PRSO? ,GLOBAL-MONEY>
+ <AND <PRSO? ,INTNUM>
+ ,P-DOLLAR-FLAG>>
+ <COND (<G? ,P-AMOUNT ,POCKET-CHANGE>
+ <TELL
+"You haven't got that much to show him." CR>)
+ (T <JIGS-UP
+"Johnny looks disappointed. \"We need at least $500
+from you. I hate to do this, but you might tell McGinty...\" Suddenly you
+feel a shove in the back and see the pointy rocks below rush up to meet your
+descent.">)>)>)
+ (<AND <VERB? GIVE>
+ <PRSI? ,JOHNNY>>
+ <COND (<PRSO? ,GLOBAL-MONEY>
+ <SETG P-AMOUNT 0>)>
+ <COND (<OR <AND <PRSO? ,GLOBAL-MONEY>
+ <G? ,POCKET-CHANGE 499>>
+ <AND <PRSO? ,INTNUM>
+ ,P-DOLLAR-FLAG
+ <G? ,P-AMOUNT 499>
+ <NOT <G? ,P-AMOUNT ,POCKET-CHANGE>>>>
+ <COND (<AND <NOT <FSET? ,DEEP-SUIT ,WORNBIT>>
+ <NOT <FSET? ,WET-SUIT ,WORNBIT>>>
+ <TELL
+"Johnny examines your money and returns it. \"You hold it. I needed
+to make sure you had it.\" ">)>)>
+ <COND (<OR <PRSO? ,GLOBAL-MONEY>
+ <AND <PRSO? ,INTNUM>
+ ,P-DOLLAR-FLAG>>
+ <COND (<G? ,P-AMOUNT ,POCKET-CHANGE>
+ <TELL-YOU-CANT
+ "give him more than you've got.">)
+ (T
+ <PERFORM ,V?SHOW ,PRSO ,JOHNNY>
+ <RTRUE>)>)>)>)
+ (<==? ,TM-CTR 7>
+ <COND (<VERB? YES>
+ <SETG SHIP-CHOSEN ,SALVAGER>
+ <SETG TM-CTR 8>
+ <RTRUE>)
+ (<VERB? NO>
+ <SETG SHIP-CHOSEN ,TRAWLER>
+ <SETG TM-CTR 8>
+ <RTRUE>)
+ (<VERB? MAYBE>
+ <TELL "\"A wise guy, huh?\" ">)
+ (<VERB? WALK>
+ <TELL "\"Let's finish here first, huh?\" ">)>)>)>>
+
+<GLOBAL SHIP-CHOSEN <>>
+
+<ROUTINE CLIFF-PSEUDO ("OPTIONAL" (PARG <>))
+ <COND (<==? .PARG ,M-NAME>
+ <PUTP ,PSEUDO-OBJECT ,P?SDESC "cliff">)
+ (<VERB? THROW-OFF>
+ <PERFORM ,V?THROW ,PRSO ,OCEAN>
+ <RTRUE>)
+ (<VERB? DISEMBARK>
+ <PERFORM ,V?LEAP>)>>
+
+<ROOM FERRY-LANDING
+ (IN ROOMS)
+ (DESC "Ferry Landing")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"The ferry to the mainland arrives here every two hours during the day.
+People are milling about. The Shore Road starts off to the east.")
+ (GLOBAL LIGHTHOUSE FERRY OCEAN)
+ (EAST TO SHORE-ROAD-1)
+ (CORRIDOR 128)
+ (LINE 1)
+ (STATION FERRY-LANDING)>
+
+;<ROOM WHARF-1
+ (IN ROOMS)
+ (DESC "Wharf")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are at the northern end of the wharf. There is a dock to the west.")
+ (GLOBAL LIGHTHOUSE OCEAN)
+ (WEST TO N-DOCK-2)
+ (SOUTH TO WHARF-2)
+ (CORRIDOR 768)
+ (LINE 1)
+ (STATION WHARF-1)>
+
+;<ROOM WHARF-2
+ (IN ROOMS)
+ (DESC "Wharf")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are on a deteriorating wharf which runs north/south.")
+ (GLOBAL LIGHTHOUSE OCEAN)
+ (NORTH TO WHARF-1)
+ (SOUTH TO WHARF-3)
+ (CORRIDOR 256)
+ (LINE 1)
+ (STATION WHARF-2)>
+
+;<ROOM WHARF-3
+ (IN ROOMS)
+ (DESC "Wharf")
+ (FLAGS RLANDBIT ONBIT)
+ (LDESC
+"You are in the middle of a wharf which travels north/south. There is an aging
+dock to the west.")
+ (GLOBAL LIGHTHOUSE OCEAN)
+ (NORTH TO WHARF-2)
+ (SOUTH TO WHARF-4)
+ (WEST TO S-DOCK-2)
+ (CORRIDOR 1280)
+ (LINE 2)
+ (STATION WHARF-3)>
+
+<ROOM WHARF
+ (IN ROOMS)
+ (DESC "Wharf")
+ (FLAGS RLANDBIT ONBIT)
+ (GLOBAL LIGHTHOUSE OCEAN SALVAGER TRAWLER)
+ (SOUTH TO WHARF-ROAD-3)
+ (WEST TO NW-STARBOARD-DECK IF TRAWLER-DOCKED ELSE
+"It would help if a ship were berthed. If you want to take a dip in the
+ocean, you'll have to say so.")
+ (EAST TO MM-PORT-DECK IF SALVAGER-DOCKED ELSE
+"It would help if a ship were berthed. If you want to take a dip in the
+ocean, you'll have to say so.")
+ (CORRIDOR 256)
+ (LINE 0)
+ (STATION WHARF)
+ (ACTION WHARF-F)>
+
+<ROUTINE WHARF-F (RARG)
+ <COND (<==? .RARG ,M-LOOK>
+ <TELL
+"You're on Hardscrabble Island's weatherbeaten wharf, north of the "
+D ,WHARF-ROAD-1 ".">
+ <COND (,TRAWLER-DOCKED
+ <TELL
+" A trawler called the " D ,TRAWLER " is berthed here to the west.">)>
+ <COND (,SALVAGER-DOCKED
+ <TELL
+" The " D ,SALVAGER " is moored to the east.">)>
+ <CRLF>)
+ (<==? .RARG ,M-BEG>
+ <COND (<VERB? BOARD THROUGH>
+ <COND (<PRSO? ,TRAWLER>
+ <DO-WALK ,P?WEST>
+ <RTRUE>)
+ (<PRSO? ,SALVAGER>
+ <DO-WALK ,P?EAST>
+ <RTRUE>)>)>)>>
diff --git a/macros.zap b/macros.zap
new file mode 100644
index 0000000..c9de8fe
--- /dev/null
+++ b/macros.zap
@@ -0,0 +1,33 @@
+
+
+ .FUNCT PICK-ONE,FROB
+ GET FROB,0
+ RANDOM STACK
+ GET FROB,STACK
+ RSTACK
+
+
+ .FUNCT DPRINT,OBJ
+ GETP OBJ,P?SDESC
+ ZERO? STACK /?ELS5
+ GETP OBJ,P?SDESC
+ PRINT STACK
+ RTRUE
+?ELS5: PRINTD OBJ
+ RTRUE
+
+
+ .FUNCT APRINT,OBJ
+ FSET? OBJ,PERSON /?THN6
+ EQUAL? OBJ,PETES-PATCH \?ELS5
+?THN6: CALL DPRINT,OBJ
+ RSTACK
+?ELS5: FSET? OBJ,VOWELBIT \?ELS11
+ PRINTI "an "
+ CALL DPRINT,OBJ
+ RSTACK
+?ELS11: PRINTI "a "
+ CALL DPRINT,OBJ
+ RSTACK
+
+ .ENDI
diff --git a/macros.zil b/macros.zil
new file mode 100644
index 0000000..6f87e97
--- /dev/null
+++ b/macros.zil
@@ -0,0 +1,145 @@
+"MACROS for
+ TOA #2
+ (c) Copyright 1984 Infocom, Inc. All Rights Reserved.
+"
+
+<COND (<NOT <GASSIGNED? ZSTR-ON>>
+ <SETG ZSTR-ON <SETG ZSTR-OFF ,TIME>>)>
+
+<SETG C-ENABLED? 0>
+;<SETG C-ENABLED 1>
+;<SETG C-DISABLED 0>
+
+<DEFMAC TELL ("ARGS" A)
+ <FORM PROG ()
+ !<MAPF ,LIST
+ <FUNCTION ("AUX" E P O)
+ <COND (<EMPTY? .A> <MAPSTOP>)
+ (<SET E <NTH .A 1>>
+ <SET A <REST .A>>)>
+ <COND (<TYPE? .E ATOM>
+ <COND (<OR <=? <SET P <SPNAME .E>>
+ "CRLF">
+ <=? .P "CR">>
+ <MAPRET '<CRLF>>)
+ (<=? .P "PRSO">
+ <MAPRET '<PRSO-PRINT>>)
+ (<=? .P "PRSI">
+ <MAPRET '<PRSI-PRINT>>)
+ ;(<=? .P "THE-PRSO">
+ <MAPRET '<THE-PRSO-PRINT>>)
+ ;(<=? .P "THE-PRSI">
+ <MAPRET '<THE-PRSI-PRINT>>)
+ (<EMPTY? .A>
+ <ERROR INDICATOR-AT-END? .E>)
+ (ELSE
+ <SET O <NTH .A 1>>
+ <SET A <REST .A>>
+ <COND (<OR <=? <SET P <SPNAME .E>>
+ "DESC">
+ <=? .P "D">
+ <=? .P "OBJ">
+ <=? .P "O">>
+ <MAPRET <FORM DPRINT .O>>)
+ (<OR <=? .P "A">
+ <=? .P "AN">>
+ <MAPRET <FORM APRINT .O>>)
+ (<OR <=? .P "NUM">
+ <=? .P "N">>
+ <MAPRET <FORM PRINTN .O>>)
+ (<OR <=? .P "CHAR">
+ <=? .P "CHR">
+ <=? .P "C">>
+ <MAPRET <FORM PRINTC .O>>)
+ (ELSE
+ <MAPRET
+ <FORM PRINT
+ <FORM GETP .O .E>>>)>)>)
+ (<TYPE? .E STRING ZSTRING>
+ <MAPRET <FORM PRINTI .E>>)
+ (<TYPE? .E FORM LVAL GVAL>
+ <MAPRET <FORM PRINT .E>>)
+ (<TYPE? .E FIX>
+ <MAPRET <FORM PRINTX .E>>)
+ (ELSE <ERROR UNKNOWN-TYPE .E>)>>>>>
+
+<DEFMAC VERB? ("ARGS" ATMS)
+ <MULTIFROB PRSA .ATMS>>
+
+<DEFMAC PRSO? ("ARGS" ATMS)
+ <MULTIFROB PRSO .ATMS>>
+
+<DEFMAC PRSI? ("ARGS" ATMS)
+ <MULTIFROB PRSI .ATMS>>
+
+<DEFMAC ROOM? ("ARGS" ATMS)
+ <MULTIFROB HERE .ATMS>>
+
+<ZSTR-OFF>
+
+<DEFINE MULTIFROB (X ATMS "AUX" (OO (OR)) (O .OO) (L ()) ATM)
+ <REPEAT ()
+ <COND (<EMPTY? .ATMS>
+ <RETURN!- <COND (<LENGTH? .OO 1> <ERROR .X>)
+ (<LENGTH? .OO 2> <NTH .OO 2>)
+ (ELSE <CHTYPE .OO FORM>)>>)>
+ <REPEAT ()
+ <COND (<EMPTY? .ATMS> <RETURN!->)>
+ <SET ATM <NTH .ATMS 1>>
+ <SET L
+ (<COND (<TYPE? .ATM ATOM>
+ <FORM GVAL
+ <COND (<==? .X PRSA>
+ <PARSE
+ <STRING "V?"
+ <SPNAME .ATM>>>)
+ (ELSE .ATM)>>)
+ (ELSE .ATM)>
+ !.L)>
+ <SET ATMS <REST .ATMS>>
+ <COND (<==? <LENGTH .L> 3> <RETURN!->)>>
+ <SET O <REST <PUTREST .O (<FORM EQUAL? <FORM GVAL .X> !.L>)>>>
+ <SET L ()>>>
+
+<ZSTR-ON>
+
+<DEFMAC RFATAL ()
+ '<PROG () <PUSH 2> <RSTACK>>>
+
+<DEFMAC PROB ('BASE?)
+ <FORM G? .BASE? '<RANDOM 100>>>
+
+;<ROUTINE ZPROB
+ (BASE)
+ <COND (,LUCKY <G? .BASE <RANDOM 100>>)
+ (ELSE <G? .BASE <RANDOM 300>>)>>
+
+<ROUTINE PICK-ONE (FROB)
+ <GET .FROB <RANDOM <GET .FROB 0>>>>
+
+<DEFMAC ENABLE ('INT) <FORM PUT .INT ,C-ENABLED? 1>>
+
+<DEFMAC DISABLE ('INT) <FORM PUT .INT ,C-ENABLED? 0>>
+
+<DEFMAC OPENABLE? ('OBJ)
+ <FORM OR <FORM FSET? .OBJ ',DOORBIT>
+ <FORM FSET? .OBJ ',CONTBIT>>>
+
+;<ROUTINE ABS (NUM)
+ <COND (<G? .NUM 0>
+ <RETURN .NUM>)
+ (ELSE
+ <RETURN <- 0 .NUM>>)>>
+
+<ROUTINE DPRINT (OBJ)
+ <COND (<GETP .OBJ ,P?SDESC>
+ <TELL <GETP .OBJ ,P?SDESC>>)
+ (T <PRINTD .OBJ>)>>
+
+<ROUTINE APRINT (OBJ)
+ <COND (<OR <FSET? .OBJ ,PERSON>
+ <==? .OBJ ,PETES-PATCH>>
+ <TELL D .OBJ>)
+ (<FSET? .OBJ ,VOWELBIT> <TELL "an " D .OBJ>)
+ (T <TELL "a " D .OBJ>)>>
+
diff --git a/main.zap b/main.zap
new file mode 100644
index 0000000..5edcb15
--- /dev/null
+++ b/main.zap
@@ -0,0 +1,481 @@
+
+
+ .FUNCT GO
+START::
+
+?FCN: CALL QUEUE,I-UNWOUND,20
+ PUT STACK,0,1
+ CALL QUEUE,I-BUSINESS-HOURS,60
+ PUT STACK,0,1
+ CALL QUEUE,I-FERRY-APPROACHING,117
+ PUT STACK,0,1
+ CALL QUEUE,I-FERRY,120
+ PUT STACK,0,1
+ CALL QUEUE,I-HUNGER,15
+ PUT STACK,0,1
+ CALL QUEUE,I-THIRST,25
+ PUT STACK,0,1
+ CALL QUEUE,I-TIRED,929
+ PUT STACK,0,1
+ CALL QUEUE,I-LIVER,10
+ PUT STACK,0,1
+ CALL QUEUE,I-DRILL,5
+ CALL QUEUE,I-MM-COMPRESSOR,80
+ CALL QUEUE,I-PLOT-NEVER-STARTS,60
+ PUT STACK,0,1
+ SET 'LIT,TRUE-VALUE
+ SET 'SCORE,8
+ SET 'WINNER,ADVENTURER
+ SET 'PLAYER,WINNER
+ SET 'SAMPLE-TREASURE,GLOBAL-OBJECTS
+ CALL PUT-IN-TABLE,ENVELOPE,MCGINTY-HQ,GLOBAL-SURFACE
+ SET 'HERE,BEDROOM
+ SET 'P-IT-OBJECT,FALSE-VALUE
+ FSET? HERE,TOUCHBIT /?CND1
+ CALL START-MOVEMENT
+ CALL TELL-START-STR
+ CRLF
+ CALL V-VERSION
+ CRLF
+?CND1: MOVE WINNER,BED
+ CALL V-LOOK
+ CALL MAIN-LOOP
+ JUMP ?FCN
+
+
+ .FUNCT MAIN-VERB-PRINT,TMP,?TMP1
+ GET P-ITBL,P-VERBN >TMP
+ ZERO? P-OFLAG /?ELS5
+ GET TMP,0
+ PRINTB STACK
+ RTRUE
+?ELS5: GETB TMP,2 >?TMP1
+ GETB TMP,3
+ CALL WORD-PRINT,?TMP1,STACK
+ RSTACK
+
+
+ .FUNCT MAIN-LOOP,ICNT,OCNT,NUM,CNT,OBJ,TBL,V,PTBL,OBJ1,TMP,PLACE
+?PRG1: SET 'CNT,0
+ SET 'OBJ,FALSE-VALUE
+ SET 'PTBL,TRUE-VALUE
+ SET 'WAITED?,FALSE-VALUE
+ SET 'P-WALK-DIR,FALSE-VALUE
+ EQUAL? HERE,QCONTEXT-ROOM /?CND3
+ SET 'QCONTEXT,FALSE-VALUE
+?CND3: CALL PARSER >P-WON
+ ZERO? P-WON /?ELS8
+ LOC PLAYER >LAST-PLAYER-LOC
+ GET P-PRSI,P-MATCHLEN >ICNT
+ GET P-PRSO,P-MATCHLEN >OCNT
+ ZERO? P-IT-OBJECT /?CND9
+ CALL ACCESSIBLE?,P-IT-OBJECT
+ ZERO? STACK /?CND9
+ SET 'TMP,FALSE-VALUE
+?PRG14: IGRTR? 'CNT,ICNT \?ELS18
+ JUMP ?REP15
+?ELS18: GET P-PRSI,CNT
+ EQUAL? STACK,IT \?PRG14
+ PUT P-PRSI,CNT,P-IT-OBJECT
+ SET 'TMP,TRUE-VALUE
+?REP15: ZERO? TMP \?CND24
+ SET 'CNT,0
+?PRG27: IGRTR? 'CNT,OCNT \?ELS31
+ JUMP ?CND24
+?ELS31: GET P-PRSO,CNT
+ EQUAL? STACK,IT \?PRG27
+ PUT P-PRSO,CNT,P-IT-OBJECT
+?CND24: SET 'CNT,0
+?CND9: ZERO? OCNT \?ELS41
+ PUSH OCNT
+ JUMP ?CND37
+?ELS41: GRTR? OCNT,1 \?ELS43
+ SET 'TBL,P-PRSO
+ ZERO? ICNT \?ELS46
+ SET 'OBJ,FALSE-VALUE
+ JUMP ?CND44
+?ELS46: GET P-PRSI,1 >OBJ
+?CND44: PUSH OCNT
+ JUMP ?CND37
+?ELS43: GRTR? ICNT,1 \?ELS50
+ SET 'PTBL,FALSE-VALUE
+ SET 'TBL,P-PRSI
+ GET P-PRSO,1 >OBJ
+ PUSH ICNT
+ JUMP ?CND37
+?ELS50: PUSH 1
+?CND37: SET 'NUM,STACK
+ ZERO? OBJ \?CND53
+ EQUAL? ICNT,1 \?CND53
+ GET P-PRSI,1 >OBJ
+?CND53: EQUAL? PRSA,V?WALK \?ELS60
+ ZERO? P-WALK-DIR /?ELS60
+ CALL PERFORM,PRSA,PRSO >V
+ JUMP ?CND58
+?ELS60: ZERO? NUM \?ELS64
+ GETB P-SYNTAX,P-SBITS
+ BAND STACK,P-SONUMS
+ ZERO? STACK \?ELS67
+ CALL PERFORM,PRSA >V
+ SET 'PRSO,FALSE-VALUE
+ JUMP ?CND58
+?ELS67: ZERO? LIT \?ELS69
+ CALL TELL-TOO-DARK
+ JUMP ?CND58
+?ELS69: ZERO? OBJ /?ELS74
+ EQUAL? OBJ,NOT-HERE-OBJECT \?ELS78
+ CALL GLOBAL-NOT-HERE-PRINT,OBJ
+ JUMP ?CND58
+?ELS78: LOC WINNER >PLACE
+ FSET? PLACE,VEHBIT \?ELS80
+ LOC OBJ
+ EQUAL? PLACE,STACK /?CND58
+ PRINTI "You should get "
+ FSET? PLACE,SURFACEBIT \?ELS88
+ PRINTI "off"
+ JUMP ?CND86
+?ELS88: PRINTI "out"
+?CND86: PRINTI " of "
+ CALL THE?,PLACE
+ CALL DPRINT,PLACE
+ PRINTI " first."
+ CRLF
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS80: EQUAL? PRSA,V?GIVE \?ELS100
+ CALL TELL-NOTHING,STR?48
+ CALL MAIN-VERB-PRINT
+ PRINTI "."
+ CRLF
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS100: FSET? OBJ,CONTBIT \?ELS104
+ FSET? OBJ,OPENBIT /?ELS104
+ PRINTI "Better open the "
+ CALL DPRINT,OBJ
+ PRINTI " first."
+ CRLF
+ SET 'P-IT-OBJECT,OBJ
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS104: FSET? OBJ,CONTBIT /?ELS110
+ CALL TELL-NOTHING,STR?49,TRUE-VALUE
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS110: PRINTI "It's not in that."
+ CRLF
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS74: EQUAL? PRSA,V?$CALL \?ELS116
+ CALL V-CALL-LOSE
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS116: ZERO? P-NONE /?ELS118
+ PRINTI "I can't find any here!"
+ CRLF
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS118: PRINTI "There isn't anything to "
+ CALL MAIN-VERB-PRINT
+ PRINTI " here!"
+ CRLF
+ SET 'V,FALSE-VALUE
+ JUMP ?CND58
+?ELS64: SET 'P-NOT-HERE,0
+ SET 'P-MULT,FALSE-VALUE
+ GRTR? NUM,1 \?CND130
+ SET 'P-MULT,TRUE-VALUE
+?CND130: SET 'TMP,FALSE-VALUE
+?PRG133: IGRTR? 'CNT,NUM \?ELS137
+ GRTR? P-NOT-HERE,0 \?ELS140
+ PRINTI "The "
+ EQUAL? P-NOT-HERE,NUM /?CND143
+ PRINTI "other "
+?CND143: PRINTI "object"
+ EQUAL? P-NOT-HERE,1 /?CND150
+ PRINTI "s"
+?CND150: PRINTI " that you mentioned "
+ EQUAL? P-NOT-HERE,1 /?ELS159
+ PRINTI "are"
+ JUMP ?CND157
+?ELS159: PRINTI "is"
+?CND157: PRINTI "n't here."
+ CRLF
+ JUMP ?REP134
+?ELS140: ZERO? TMP \?REP134
+ PRINTI "I don't know what you're referring to."
+ CRLF
+ JUMP ?REP134
+?ELS137: ZERO? PTBL /?ELS176
+ GET P-PRSO,CNT >OBJ1
+ JUMP ?CND174
+?ELS176: GET P-PRSI,CNT >OBJ1
+?CND174: ZERO? PTBL /?ELS184
+ PUSH OBJ1
+ JUMP ?CND180
+?ELS184: PUSH OBJ
+?CND180: SET 'PRSO,STACK
+ ZERO? PTBL /?ELS192
+ PUSH OBJ
+ JUMP ?CND188
+?ELS192: PUSH OBJ1
+?CND188: SET 'PRSI,STACK
+ GRTR? NUM,1 \?CND196
+ EQUAL? OBJ1,NOT-HERE-OBJECT \?ELS201
+ INC 'P-NOT-HERE
+ JUMP ?PRG133
+?ELS201: EQUAL? PRSA,V?TAKE \?ELS203
+ ZERO? PRSI /?ELS203
+ GET P-ITBL,P-NC1
+ GET STACK,0
+ EQUAL? STACK,W?ALL \?ELS203
+ IN? PRSO,PRSI /?ELS203
+ JUMP ?PRG133
+?ELS203: EQUAL? P-GETFLAGS,P-ALL \?ELS207
+ EQUAL? PRSA,V?TAKE \?ELS207
+ LOC OBJ1
+ EQUAL? STACK,WINNER,HERE /?ELS213
+ LOC OBJ1
+ FSET? STACK,TRANSBIT \?PRG133
+?ELS213: FSET? OBJ1,TAKEBIT /?ELS207
+ FSET? OBJ1,TRYTAKEBIT /?ELS207
+ JUMP ?PRG133
+?ELS207: EQUAL? P-GETFLAGS,P-ALL \?ELS217
+ EQUAL? PRSA,V?DROP \?ELS217
+ IN? OBJ1,WINNER /?ELS217
+ IN? P-IT-OBJECT,WINNER /?ELS217
+ JUMP ?PRG133
+?ELS217: EQUAL? OBJ1,IT \?ELS224
+ CALL DPRINT,P-IT-OBJECT
+ JUMP ?CND222
+?ELS224: CALL DPRINT,OBJ1
+?CND222: PRINTI ": "
+?CND196: ZERO? PTBL /?ELS233
+ PUSH OBJ1
+ JUMP ?CND229
+?ELS233: PUSH OBJ
+?CND229: CALL QCONTEXT-CHECK,STACK >V
+ SET 'TMP,TRUE-VALUE
+ CALL PERFORM,PRSA,PRSO,PRSI >V
+ EQUAL? V,M-FATAL \?PRG133
+ JUMP ?CND58
+?REP134:
+?CND58: EQUAL? V,M-FATAL /?CND240
+ LOC WINNER
+ GETP STACK,P?ACTION
+ CALL STACK,M-END >V
+?CND240: EQUAL? PRSA,V?FOLLOW,V?WALK,V?AGAIN /?CND243
+ EQUAL? PRSA,V?WAIT /?CND243
+ CALL GAME-COMMAND?
+ ZERO? STACK /?ELS245
+ JUMP ?CND243
+?ELS245: SET 'L-PRSA,PRSA
+ SET 'L-PRSO,PRSO
+ SET 'L-PRSI,PRSI
+ SET 'L-WALK-DIR,P-WALK-DIR
+ SET 'L-WINNER,WINNER
+?CND243: EQUAL? V,M-FATAL \?CND6
+ SET 'P-CONT,FALSE-VALUE
+ JUMP ?CND6
+?ELS8: SET 'P-CONT,FALSE-VALUE
+?CND6: ZERO? P-WON /?CND255
+ CALL GAME-COMMAND?
+ ZERO? STACK /?ELS261
+ JUMP ?CND255
+?ELS261: EQUAL? PRSA,V?TELL \?ELS263
+ ZERO? PRSI \?ELS263
+ JUMP ?CND255
+?ELS263: ZERO? CLOCK-WAIT \?THN268
+ ZERO? I-WAIT-DURATION \?ELS267
+?THN268: CALL CLOCKER >V
+ CALL DETECTOR-NOISE >V
+ JUMP ?CND255
+?ELS267: CALL V-WAIT,I-WAIT-DURATION,FALSE-VALUE >I-WAIT-FLAG
+ ZERO? I-WAIT-FLAG /?ELS274
+ CALL I-WAIT-RTN
+ SET 'I-WAIT-FLAG,FALSE-VALUE
+ JUMP ?CND272
+?ELS274: SET 'I-WAIT-DURATION,0
+ CALL CLOCKER >V
+?CND272: CALL DETECTOR-NOISE >V
+?CND255: SET 'PRSA,FALSE-VALUE
+ SET 'PRSO,FALSE-VALUE
+ SET 'PRSI,FALSE-VALUE
+ JUMP ?PRG1
+
+
+ .FUNCT GAME-COMMAND?
+ EQUAL? PRSA,V?VERBOSE,V?SUPER-BRIEF,V?BRIEF /TRUE
+ EQUAL? PRSA,V?RESTART,V?RESTORE,V?SAVE /TRUE
+ EQUAL? PRSA,V?UNSCRIPT,V?SCRIPT,V?QUIT /TRUE
+ EQUAL? PRSA,V?SCORE,V?VERSION,V?$VERIFY /TRUE
+ EQUAL? PRSA,V?TIME /TRUE
+ RFALSE
+
+
+ .FUNCT QCONTEXT-CHECK,PRSO,OTHER,WHO=0,N=0
+ EQUAL? PRSA,V?LONGITUDE,V?LATITUDE,V?HELP /?THN6
+ EQUAL? PRSA,V?GIVE,V?TELL,V?SHOW \FALSE
+ EQUAL? PRSO,PLAYER \FALSE
+?THN6: FIRST? HERE >OTHER /?KLU33
+?KLU33:
+?PRG10: ZERO? OTHER \?ELS14
+ JUMP ?REP11
+?ELS14: FSET? OTHER,PERSON \?CND12
+ EQUAL? OTHER,PLAYER /?CND12
+ INC 'N
+ SET 'WHO,OTHER
+?CND12: NEXT? OTHER >OTHER /?KLU34
+?KLU34: JUMP ?PRG10
+?REP11: EQUAL? 1,N \?CND19
+ ZERO? QCONTEXT \?CND19
+ CALL SAID-TO,WHO
+?CND19: ZERO? QCONTEXT /FALSE
+ IN? QCONTEXT,HERE \FALSE
+ EQUAL? QCONTEXT-ROOM,HERE \FALSE
+ EQUAL? WINNER,PLAYER \FALSE
+ SET 'WINNER,QCONTEXT
+ PRINTI "(said to "
+ CALL DPRINT,QCONTEXT
+ PRINTR ")"
+
+
+ .FUNCT SAID-TO,WHO
+ SET 'WINNER,WHO
+ SET 'QCONTEXT,WHO
+ SET 'QCONTEXT-ROOM,HERE
+ RETURN QCONTEXT-ROOM
+
+
+ .FUNCT PERFORM,A,O=0,I=0,V,OA,OO,OI
+ SET 'OA,PRSA
+ SET 'OO,PRSO
+ SET 'OI,PRSI
+ EQUAL? A,V?WALK /?CND1
+ EQUAL? IT,I,O \?CND1
+ PRINTI "I don't see what you are referring to."
+ CRLF
+ RETURN 2
+?CND1: SET 'PRSA,A
+ SET 'PRSO,O
+ ZERO? PRSO /?CND10
+ EQUAL? PRSI,IT /?CND10
+ EQUAL? PRSA,V?WALK /?CND10
+ SET 'P-IT-OBJECT,PRSO
+?CND10: SET 'PRSI,I
+ EQUAL? NOT-HERE-OBJECT,PRSO,PRSI \?ELS17
+ EQUAL? PRSA,V?WALK /?ELS17
+ CALL NOT-HERE-OBJECT-F >V
+ ZERO? V /?ELS17
+ SET 'P-WON,FALSE-VALUE
+ JUMP ?CND15
+?ELS17: SET 'O,PRSO
+ SET 'I,PRSI
+ GETP WINNER,P?ACTION
+ CALL STACK >V
+ ZERO? V /?ELS24
+ JUMP ?CND15
+?ELS24: LOC WINNER
+ GETP STACK,P?ACTION
+ CALL STACK,M-BEG >V
+ ZERO? V /?ELS26
+ JUMP ?CND15
+?ELS26: GET PREACTIONS,A
+ CALL STACK >V
+ ZERO? V /?ELS28
+ JUMP ?CND15
+?ELS28: SET 'I,PRSI
+ ZERO? I /?ELS30
+ ZERO? I /?ELS30
+ GETP I,P?ACTION
+ CALL STACK >V
+ ZERO? V /?ELS30
+ JUMP ?CND15
+?ELS30: ZERO? O /?ELS34
+ EQUAL? A,V?WALK /?ELS34
+ LOC O
+ ZERO? STACK /?ELS34
+ LOC O
+ GETP STACK,P?CONTFCN
+ CALL STACK,M-CONT >V
+ ZERO? V /?ELS34
+ JUMP ?CND15
+?ELS34: ZERO? O /?ELS38
+ EQUAL? A,V?WALK /?ELS38
+ GETP O,P?ACTION
+ CALL STACK >V
+ ZERO? V /?ELS38
+ JUMP ?CND15
+?ELS38: GET ACTIONS,A
+ CALL STACK >V
+ ZERO? V /?CND15
+?CND15: EQUAL? V,M-FATAL /?CND43
+ LOC WINNER
+ EQUAL? STACK,PRSO \?CND46
+ SET 'PRSO,FALSE-VALUE
+?CND46: LOC WINNER
+ GETP STACK,P?ACTION
+ CALL STACK,M-END >V
+?CND43: SET 'PRSA,OA
+ SET 'PRSO,OO
+ SET 'PRSI,OI
+ RETURN V
+
+
+ .FUNCT TELL-START-STR
+ PRINTR "Nights on Hardscrabble Island are lonely and cold when the lighthouse barely pierces the gloom. You sit on your bed, thinking of better times and far-off places. A knock on your door stirs you, and Hevlin, a shipmate you haven't seen for years, staggers in.
+
+""I'm in trouble,"" he says. ""I had a few too many at The Shanty. I was looking for Red, but he wasn't around, and I started talking about ... here,"" he says, handing you a slim volume that you recognize as a shipwreck book written years ago by the Historical Society.
+
+You smile. Every diver on the island has looked for those wrecks, without even an old boot to show for it. You open the door, hoping the drunken fool will leave. ""I know what you're thinkin',"" Hevlin scowls, ""but look!"" He points to the familiar map, and you see new locations marked for two of the wrecks.
+
+""Keep it for me,"" he says. ""Just for tonight. It'll be safe here with you. Don't let -- "" He stops and broods for a moment. ""I've got to go find Red!"" And with that, Hevlin leaves.
+
+You put the book in your dresser and think about following Hevlin. Then you hear a scuffle outside. You look through your window and see two men struggling. One falls to the ground in a heap. The other man bends down beside him, then turns as if startled and runs away. Another man then approaches the wounded figure. He kneels beside him for a long moment, then takes off after the other man.
+
+It isn't long before the police arrive to tell you that Hevlin's been murdered. You don't mention the book, and hours later, as you lie awake in your bed, you wonder if the book could really be what it seems."
+
+
+ .FUNCT ACCESSIBLE?,OBJ,L
+ LOC OBJ >L
+ FSET? OBJ,INVISIBLE /FALSE
+ EQUAL? OBJ,PSEUDO-OBJECT \?ELS7
+ GETP PSEUDO-OBJECT,P?DESCFCN
+ EQUAL? STACK,HERE \FALSE
+ RTRUE
+?ELS7: ZERO? L /FALSE
+ EQUAL? L,GLOBAL-OBJECTS /TRUE
+ EQUAL? L,LOCAL-GLOBALS \?ELS20
+ CALL GLOBAL-IN?,OBJ,HERE
+ ZERO? STACK \TRUE
+?ELS20: CALL META-LOC,OBJ
+ EQUAL? STACK,HERE \FALSE
+ EQUAL? L,WINNER,HERE /TRUE
+ FSET? L,OPENBIT /?THN31
+ FSET? L,PERSON \FALSE
+?THN31: CALL ACCESSIBLE?,L
+ ZERO? STACK /FALSE
+ RTRUE
+
+
+ .FUNCT VISIBLE?,OBJ,L
+ LOC OBJ >L
+ CALL ACCESSIBLE?,OBJ
+ ZERO? STACK \TRUE
+ CALL SEE-INSIDE?,L
+ ZERO? STACK /FALSE
+ CALL VISIBLE?,L
+ ZERO? STACK /FALSE
+ RTRUE
+
+
+ .FUNCT META-LOC,OBJ
+?PRG1: ZERO? OBJ /FALSE
+ EQUAL? OBJ,GLOBAL-OBJECTS,LOCAL-GLOBALS \?CND3
+ RETURN OBJ
+?CND3: IN? OBJ,ROOMS \?ELS10
+ RETURN OBJ
+?ELS10: LOC OBJ >OBJ
+ JUMP ?PRG1
+
+ .ENDI
diff --git a/main.zil b/main.zil
new file mode 100644
index 0000000..22b1789
--- /dev/null
+++ b/main.zil
@@ -0,0 +1,581 @@
+"MAIN for
+ TOA #2
+ Copyright (c) 1984 Infocom, Inc. All Rights Reserved.
+"
+
+<GLOBAL PLAYER <>>
+
+<GLOBAL P-WON <>>
+
+<CONSTANT M-FATAL 2>
+
+<CONSTANT M-HANDLED 1>
+
+<CONSTANT M-NOT-HANDLED <>>
+
+<CONSTANT M-OBJECT <>>
+
+<CONSTANT M-BEG 1>
+
+<CONSTANT M-END 6>
+
+<CONSTANT M-ENTER 2>
+
+<CONSTANT M-LOOK 3>
+
+<CONSTANT M-FLASH 4>
+
+<CONSTANT M-OBJDESC 5>
+
+<CONSTANT M-CONT 7>
+
+<CONSTANT M-NAME 8>
+
+<ROUTINE GO ()
+;"put interrupts on clock chain"
+ <ENABLE <QUEUE I-UNWOUND 20>>
+ <ENABLE <QUEUE I-BUSINESS-HOURS 60>>
+ <ENABLE <QUEUE I-FERRY-APPROACHING 117>>
+ <ENABLE <QUEUE I-FERRY 120>>
+ <ENABLE <QUEUE I-HUNGER 15>>
+ <ENABLE <QUEUE I-THIRST 25>>
+ <ENABLE <QUEUE I-TIRED 929>>
+ <ENABLE <QUEUE I-LIVER 10>>
+ <QUEUE I-DRILL 5>
+ <QUEUE I-MM-COMPRESSOR 80>
+ <ENABLE <QUEUE I-PLOT-NEVER-STARTS 60>>
+;"set up and go"
+ %<COND (<NOT <GASSIGNED? PREDGEN>>
+ '(;<SETG XTELLCHAN <OPEN "READB" ,XTELLFILE>>
+ <SETG LIT T>))
+ ('<SETG LIT T>)>
+ <SETG SCORE 8>
+ <SETG WINNER ,ADVENTURER>
+ <SETG PLAYER ,WINNER>
+ <SETG SAMPLE-TREASURE ,GLOBAL-OBJECTS>
+ <PUT-IN-TABLE ,ENVELOPE ,MCGINTY-HQ ,GLOBAL-SURFACE>
+ <SETG HERE ,BEDROOM>
+ ;<SETG P-IT-LOC ,HERE>
+ <SETG P-IT-OBJECT <>>
+ <COND (<NOT <FSET? ,HERE ,TOUCHBIT>>
+ <START-MOVEMENT>
+ <TELL-START-STR>
+ <CRLF>
+ <V-VERSION>
+ <CRLF>)>
+ <MOVE ,WINNER ,BED>
+ <V-LOOK>
+ ;<USL>
+ <MAIN-LOOP>
+ <AGAIN>>
+
+
+<ROUTINE MAIN-VERB-PRINT ("AUX" TMP)
+ <SET TMP <GET ,P-ITBL ,P-VERBN>>
+ <COND (,P-OFLAG
+ <PRINTB <GET .TMP 0>>)
+ (T
+ <WORD-PRINT <GETB .TMP 2>
+ <GETB .TMP 3>>)>>
+
+<ROUTINE MAIN-LOOP ("AUX" ICNT OCNT NUM CNT OBJ TBL V PTBL OBJ1 TMP PLACE)
+ #DECL ((CNT OCNT ICNT NUM) FIX (OBJ) <OR FALSE OBJECT>
+ (OBJ1) OBJECT (TBL) TABLE (PTBL) <OR FALSE ATOM>)
+ <REPEAT ()
+ <SET CNT 0>
+ <SET OBJ <>>
+ <SET PTBL T>
+ <SETG WAITED? <>>
+ <SETG P-WALK-DIR <>>
+ ;<SETG GROGGIED <>>
+ <COND (<NOT <==? ,HERE ,QCONTEXT-ROOM>>
+ <SETG QCONTEXT <>>)>
+ <COND (<SETG P-WON <PARSER>>
+ <SETG LAST-PLAYER-LOC <LOC ,PLAYER>>
+ <SET ICNT <GET ,P-PRSI ,P-MATCHLEN>>
+ <SET OCNT <GET ,P-PRSO ,P-MATCHLEN>>
+ <COND (<AND ,P-IT-OBJECT <ACCESSIBLE? ,P-IT-OBJECT>>
+ <SET TMP <>>
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> .ICNT>
+ <RETURN>)
+ (T
+ <COND (<EQUAL? <GET ,P-PRSI .CNT> ,IT>
+ <PUT ,P-PRSI .CNT ,P-IT-OBJECT>
+ <SET TMP T>
+ <RETURN>)>)>>
+ <COND (<NOT .TMP>
+ <SET CNT 0>
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> .OCNT>
+ <RETURN>)
+ (T
+ <COND (<EQUAL? <GET ,P-PRSO .CNT> ,IT>
+ <PUT ,P-PRSO .CNT ,P-IT-OBJECT>
+ <RETURN>)>)>>)>
+ <SET CNT 0>)>
+ <SET NUM
+ <COND (<0? .OCNT> .OCNT)
+ (<G? .OCNT 1>
+ <SET TBL ,P-PRSO>
+ <COND (<0? .ICNT> <SET OBJ <>>)
+ (T <SET OBJ <GET ,P-PRSI 1>>)>
+ .OCNT)
+ (<G? .ICNT 1>
+ <SET PTBL <>>
+ <SET TBL ,P-PRSI>
+ <SET OBJ <GET ,P-PRSO 1>>
+ .ICNT)
+ (T 1)>>
+ <COND (<AND <NOT .OBJ> <1? .ICNT>> <SET OBJ <GET ,P-PRSI 1>>)>
+ <COND (<AND <==? ,PRSA ,V?WALK> ,P-WALK-DIR>
+ <SET V <PERFORM ,PRSA ,PRSO>>)
+ (<0? .NUM>
+ <COND (<0? <BAND <GETB ,P-SYNTAX ,P-SBITS> ,P-SONUMS>>
+ <SET V <PERFORM ,PRSA>>
+ <SETG PRSO <>>)
+ (<NOT ,LIT>
+ <TELL-TOO-DARK>)
+ (T
+;"** M" <COND (.OBJ
+ <COND (<==? .OBJ ,NOT-HERE-OBJECT>
+ <GLOBAL-NOT-HERE-PRINT .OBJ>)
+ (<FSET?
+ <SET PLACE <LOC ,WINNER>>
+ ,VEHBIT>
+ <COND (<NOT <EQUAL? .PLACE
+ ;<LOC ,WINNER>
+ <LOC .OBJ>>>
+ <TELL "You should get ">
+ <COND (<FSET? .PLACE ,SURFACEBIT>
+ <TELL "off">)
+ (T <TELL "out">)>
+ <TELL " of ">
+ <THE? .PLACE>
+ <TELL D .PLACE " first." CR>
+ <SET V <>>)>)
+ (<VERB? GIVE>
+ <TELL-NOTHING "to ">
+ <MAIN-VERB-PRINT>
+ <TELL "." CR>
+ <SET V <>>)
+ (<AND <FSET? .OBJ ,CONTBIT>
+ <NOT <FSET? .OBJ ,OPENBIT>>>
+ <TELL "Better open the " D .OBJ
+ " first." CR>
+ <SETG P-IT-OBJECT .OBJ>
+ <SET V <>>)
+ (<NOT <FSET? .OBJ ,CONTBIT>>
+ <TELL-NOTHING "in that" T>
+ <SET V <>>)
+ (T
+ <TELL "It's not in that." CR>
+ <SET V <>>)>)
+ (<VERB? $CALL>
+ <V-CALL-LOSE>
+ <SET V <>>)
+ (,P-NONE
+ <TELL "I can't find any here!" CR>
+ <SET V <>>)
+ (T
+ <TELL "There isn't anything to ">
+ <MAIN-VERB-PRINT>
+ <TELL " here!" CR>
+ <SET V <>>)>)>)
+ (T
+ <SETG P-NOT-HERE 0>
+ <SETG P-MULT <>>
+ <COND (<G? .NUM 1> <SETG P-MULT T>)>
+ <SET TMP <>>
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> .NUM>
+ <COND (<G? ,P-NOT-HERE 0>
+ <TELL "The ">
+ <COND (<NOT <EQUAL? ,P-NOT-HERE .NUM>>
+ <TELL "other ">)>
+ <TELL "object">
+ <COND (<NOT <EQUAL? ,P-NOT-HERE 1>>
+ <TELL "s">)>
+ <TELL " that you mentioned ">
+ <COND (<NOT <EQUAL? ,P-NOT-HERE 1>>
+ <TELL "are">)
+ (T <TELL "is">)>
+ <TELL "n't here." CR>)
+ (<NOT .TMP>
+ <TELL
+"I don't know what you're referring to." CR>)>
+ <RETURN>)
+ (T
+ <COND (.PTBL <SET OBJ1 <GET ,P-PRSO .CNT>>)
+ (T <SET OBJ1 <GET ,P-PRSI .CNT>>)>
+ <SETG PRSO <COND (.PTBL .OBJ1) (T .OBJ)>>
+ <SETG PRSI <COND (.PTBL .OBJ) (T .OBJ1)>>
+ ;<COND (<EQUAL? ,HERE ,P-IT-LOC>
+ <COND (<EQUAL? ,PRSO ,IT>
+ <SETG PRSO ,P-IT-OBJECT>
+ <COND (.PTBL
+ <SET OBJ1 ,PRSO>
+ <PUT ,P-PRSO
+ .CNT ,PRSO>)
+ (T
+ <SET OBJ ,PRSO>
+ <PUT ,P-PRSO 1 ,PRSO>)>)
+ (<EQUAL? ,PRSI ,IT>
+ <SETG PRSI ,P-IT-OBJECT>
+ <COND (.PTBL
+ <SET OBJ ,PRSI>
+ <PUT ,P-PRSI 1 ,PRSI>)
+ (T
+ <SET OBJ1 ,PRSI>
+ <PUT ,P-PRSI
+ .CNT ,PRSI>)>)>)>
+ <COND ;(<VERB? COMPARE> T)
+ (<G? .NUM 1>
+ <COND (<EQUAL? .OBJ1
+ ,NOT-HERE-OBJECT>
+ <SETG P-NOT-HERE
+ <+ ,P-NOT-HERE 1>>
+ <AGAIN>)
+ (<AND <VERB? TAKE>
+ ,PRSI
+ <EQUAL? <GET <GET ,P-ITBL
+ ,P-NC1>
+ 0>
+ ,W?ALL>
+ <NOT <IN? ,PRSO ,PRSI>>>
+ <AGAIN>)
+ (<AND <EQUAL? ,P-GETFLAGS
+ ,P-ALL>
+ <VERB? TAKE>
+ <OR <AND <NOT <EQUAL?
+ <LOC .OBJ1>
+ ,WINNER
+ ,HERE>>
+ <NOT <FSET?
+ <LOC .OBJ1>
+ ,TRANSBIT>>>
+ <NOT <OR <FSET?
+ .OBJ1
+ ,TAKEBIT>
+ <FSET?
+ .OBJ1
+ ,TRYTAKEBIT>>>>>
+ <AGAIN>)
+ (<AND <EQUAL? ,P-GETFLAGS
+ ,P-ALL>
+ <VERB? DROP>
+ <NOT <IN? .OBJ1 ,WINNER>>
+ <NOT <IN? ,P-IT-OBJECT
+ ,WINNER>>>
+ <AGAIN>)
+ (T
+ <COND (<EQUAL? .OBJ1 ,IT>
+ <DPRINT ,P-IT-OBJECT>)
+ (T <DPRINT .OBJ1>)>
+ <TELL ": ">)>)>
+ <SET V <QCONTEXT-CHECK <COND (.PTBL .OBJ1)
+ (T .OBJ)>>>
+ <SET TMP T>
+ <SET V <PERFORM ,PRSA ,PRSO ,PRSI>>
+ <COND (<==? .V ,M-FATAL> <RETURN>)>)>>)>
+ <COND (<NOT <==? .V ,M-FATAL>>
+ ;<COND (<==? <LOC ,WINNER> ,PRSO>
+ <SETG PRSO <>>)>
+ ;"Removing this code should fix the problem that AGAIN
+ loses when in a vehicle and it is the PRSO."
+ <SET V <APPLY <GETP <LOC ,WINNER> ,P?ACTION> ,M-END>>)>
+ <COND (<OR <VERB? AGAIN WALK FOLLOW>
+ <VERB? WAIT>
+ <GAME-COMMAND?>>
+ T)
+ (T
+ <SETG L-PRSA ,PRSA>
+ <SETG L-PRSO ,PRSO>
+ <SETG L-PRSI ,PRSI>
+ <SETG L-WALK-DIR ,P-WALK-DIR>
+ <SETG L-WINNER ,WINNER>)>
+ <COND (<==? .V ,M-FATAL> <SETG P-CONT <>>)>)
+ (T
+ <SETG P-CONT <>>)>
+ <COND (,P-WON
+ <COND (<GAME-COMMAND?>
+ T)
+ (<AND <VERB? TELL>
+ <NOT ,PRSI>>
+ T)
+ (<OR ,CLOCK-WAIT <0? ,I-WAIT-DURATION>>
+ <SET V <CLOCKER>>
+ <SET V <DETECTOR-NOISE>>)
+ (T
+ <SETG I-WAIT-FLAG <V-WAIT ,I-WAIT-DURATION <>>>
+ <COND (,I-WAIT-FLAG
+ <APPLY ,I-WAIT-RTN>
+ <SETG I-WAIT-FLAG <>>)
+ (T <SETG I-WAIT-DURATION 0> <SET V <CLOCKER>>)>
+ <SET V <DETECTOR-NOISE>>)>)>
+ <SETG PRSA <>>
+ <SETG PRSO <>>
+ <SETG PRSI <>>>>
+
+<ROUTINE GAME-COMMAND? ()
+ <COND (<VERB? BRIEF SUPER-BRIEF VERBOSE SAVE RESTORE RESTART
+ QUIT SCRIPT UNSCRIPT $VERIFY VERSION SCORE TIME>
+ <RTRUE>)>>
+
+<ROUTINE QCONTEXT-CHECK (PRSO "AUX" OTHER (WHO <>) (N 0))
+ <COND (<OR <VERB? HELP LATITUDE LONGITUDE>
+ <AND <VERB? SHOW TELL GIVE> <==? .PRSO ,PLAYER>>> ;"? more?"
+ <SET OTHER <FIRST? ,HERE>>
+ <REPEAT ()
+ <COND (<NOT .OTHER> <RETURN>)
+ (<AND <FSET? .OTHER ,PERSON>
+ <NOT <==? .OTHER ,PLAYER>>>
+ <SET N <+ 1 .N>>
+ <SET WHO .OTHER>)>
+ <SET OTHER <NEXT? .OTHER>>>
+ <COND (<AND <==? 1 .N> <NOT ,QCONTEXT>>
+ <SAID-TO .WHO>)>
+ <COND (<AND ,QCONTEXT
+ <IN? ,QCONTEXT ,HERE>
+ <==? ,QCONTEXT-ROOM ,HERE>
+ <==? ,WINNER ,PLAYER>> ;"? more?"
+ <SETG WINNER ,QCONTEXT>
+ <TELL "(said to " D ,QCONTEXT ")" CR>)>)>>
+
+<ROUTINE SAID-TO (WHO)
+ <SETG WINNER .WHO>
+ <SETG QCONTEXT .WHO>
+ <SETG QCONTEXT-ROOM ,HERE>>
+
+<GLOBAL P-MULT <>>
+
+<GLOBAL P-NOT-HERE 0>
+
+<GLOBAL L-PRSA <>>
+
+<GLOBAL L-PRSO <>>
+
+<GLOBAL L-PRSI <>>
+
+<GLOBAL L-WINNER <>>
+
+<GLOBAL LAST-PLAYER-LOC <>>
+
+;"PERFORM without DEBUG"
+<ROUTINE PERFORM (A "OPTIONAL" (O <>) (I <>) "AUX" V OA OO OI)
+ #DECL ((A) FIX (O) <OR FALSE OBJECT FIX> (I) <OR FALSE OBJECT> (V) ANY)
+ <SET OA ,PRSA>
+ <SET OO ,PRSO>
+ <SET OI ,PRSI>
+ <COND (<AND <NOT <==? .A ,V?WALK>>
+ <EQUAL? ,IT .I .O>>
+ ;<AND <EQUAL? ,IT .I .O>
+ <NOT <EQUAL? ,P-IT-LOC ,HERE>>>
+ <TELL "I don't see what you are referring to." CR>
+ <RFATAL>)>
+ ;<COND (<==? .O ,IT> <SET O ,P-IT-OBJECT>)>
+ ;<COND (<==? .I ,IT> <SET I ,P-IT-OBJECT>)>
+ <SETG PRSA .A>
+ <SETG PRSO .O>
+ <COND (<AND ,PRSO <NOT <EQUAL? ,PRSI ,IT>> <NOT <VERB? WALK>>>
+ <SETG P-IT-OBJECT ,PRSO>
+ ;<SETG P-IT-LOC ,HERE>)>
+ <SETG PRSI .I>
+ <COND (<AND <EQUAL? ,NOT-HERE-OBJECT ,PRSO ,PRSI>
+ <NOT <VERB? WALK>>
+ <SET V <NOT-HERE-OBJECT-F>>>
+ <SETG P-WON <>>
+ .V)
+ (T
+ <SET O ,PRSO>
+ <SET I ,PRSI>
+ <COND
+ (<SET V <APPLY <GETP ,WINNER ,P?ACTION>>> .V)
+ (<SET V <APPLY <GETP <LOC ,WINNER> ,P?ACTION> ,M-BEG>> .V)
+ (<SET V <APPLY <GET ,PREACTIONS .A>>> .V)
+ (<AND <SET I ,PRSI> .I <SET V <APPLY <GETP .I ,P?ACTION>>>> .V)
+ (<AND .O
+ <NOT <==? .A ,V?WALK>>
+ <LOC .O>
+ <SET V <APPLY <GETP <LOC .O> ,P?CONTFCN> ,M-CONT>>>
+ .V)
+ (<AND .O
+ <NOT <==? .A ,V?WALK>>
+ <SET V <APPLY <GETP .O ,P?ACTION>>>>
+ .V)
+ (<SET V <APPLY <GET ,ACTIONS .A>>> .V)>)>
+ <COND (<NOT <==? .V ,M-FATAL>>
+ <COND (<==? <LOC ,WINNER> ,PRSO>
+ <SETG PRSO <>>)>
+ <SET V <APPLY <GETP <LOC ,WINNER> ,P?ACTION> ,M-END>>)>
+ <SETG PRSA .OA>
+ <SETG PRSO .OO>
+ <SETG PRSI .OI>
+ .V>
+
+;"PERFORM with DEBUG"
+;<ROUTINE PERFORM (A "OPTIONAL" (O <>) (I <>) "AUX" V OA OO OI)
+ #DECL ((A) FIX (O) <OR FALSE OBJECT FIX> (I) <OR FALSE OBJECT> (V) ANY)
+ <COND (,DEBUG
+ <TELL "** PERFORM: PRSA = ">
+ %<COND (<GASSIGNED? PREDGEN> '<TELL N .A>)
+ (T '<PRINC <NTH ,ACTIONS <+ <* .A 2> 1>>>)>
+ <COND (<AND .O <NOT <==? .A ,V?WALK>>>
+ <TELL "/PRSO = " D .O>)>
+ <COND (.I <TELL "/PRSI = " D .I>)>)>
+ <SET OA ,PRSA>
+ <SET OO ,PRSO>
+ <SET OI ,PRSI>
+ <COND (<AND <NOT <==? .A ,V?WALK>>
+ <EQUAL? ,IT .I .O>>
+ ;<AND <EQUAL? ,IT .I .O>
+ <NOT <EQUAL? ,P-IT-LOC ,HERE>>>
+ <TELL "I don't see what you are referring to." CR>
+ <RFATAL>)>
+ ;<COND (<==? .O ,IT> <SET O ,P-IT-OBJECT>)>
+ ;<COND (<==? .I ,IT> <SET I ,P-IT-OBJECT>)>
+ <SETG PRSA .A>
+ <SETG PRSO .O>
+ <COND (<AND ,PRSO <NOT <EQUAL? ,PRSI ,IT>> <NOT <VERB? WALK>>>
+ <SETG P-IT-OBJECT ,PRSO>
+ ;<SETG P-IT-LOC ,HERE>)>
+ <SETG PRSI .I>
+ <COND (<AND <EQUAL? ,NOT-HERE-OBJECT ,PRSO ,PRSI>
+ <NOT <VERB? WALK>>
+ <SET V <D-APPLY "Not Here" ,NOT-HERE-OBJECT-F>>>
+ <SETG P-WON <>>
+ .V)
+ (T
+ <SET O ,PRSO>
+ <SET I ,PRSI>
+ <COND (<SET V <DD-APPLY "Actor" ,WINNER
+ <GETP ,WINNER ,P?ACTION>>> .V)
+ (<SET V <D-APPLY "Room (M-BEG)"
+ <GETP <LOC ,WINNER> ,P?ACTION>
+ ,M-BEG>> .V)
+ (<SET V <D-APPLY "Preaction"
+ <GET ,PREACTIONS .A>>> .V)
+ (<AND <SET I ,PRSI> .I <SET V <D-APPLY "PRSI"
+ <GETP .I ,P?ACTION>>>> .V)
+ (<AND .O
+ <NOT <==? .A ,V?WALK>>
+ <LOC .O>
+ <GETP <LOC .O> ,P?CONTFCN>
+ <SET V <DD-APPLY "Container" <LOC .O>
+ <GETP <LOC .O> ,P?CONTFCN>>>>
+ .V)
+ (<AND .O
+ <NOT <==? .A ,V?WALK>>
+ <SET V <D-APPLY "PRSO"
+ <GETP .O ,P?ACTION>>>>
+ .V)
+ (<SET V <D-APPLY <>
+ <GET ,ACTIONS .A>>> .V)>)>
+ <COND (<NOT <==? .V ,M-FATAL>>
+ <COND (<==? <LOC ,WINNER> ,PRSO>
+ <SETG PRSO <>>)>
+ <SET V <D-APPLY "Room (M-END)"
+ <GETP <LOC ,WINNER> ,P?ACTION> ,M-END>>)>
+ <SETG PRSA .OA>
+ <SETG PRSO .OO>
+ <SETG PRSI .OI>
+ .V>
+
+;"Next 2 routines for use with DEBUG"
+;<ROUTINE DD-APPLY (STR OBJ FCN "OPTIONAL" (FOO <>))
+ <COND (,DEBUG <TELL "[" D .OBJ "=]">)>
+ <D-APPLY .STR .FCN .FOO>>
+
+;<ROUTINE D-APPLY (STR FCN "OPTIONAL" (FOO <>) "AUX" RES)
+ <COND (<NOT .FCN> <>)
+ (T
+ <COND (,DEBUG
+ <COND (<NOT .STR>
+ <TELL "[Action:]" CR>)
+ (T <TELL "[" .STR ": ">)>)>
+ <COND (<==? .STR "Container">
+ <SET FOO ,M-CONT>)>
+ <SET RES
+ <COND (.FOO <APPLY .FCN .FOO>)
+ (T <APPLY .FCN>)>>
+ <COND (<AND ,DEBUG .STR>
+ <COND (<==? .RES ,M-FATAL>
+ <TELL "Fatal]" CR>)
+ (<NOT .RES>
+ <TELL "Not handled]" CR>)
+ (T <TELL "Handled]" CR>)>)>
+ .RES)>>
+
+<ROUTINE TELL-START-STR () ;"submitted by a committee"
+ <TELL
+"Nights on Hardscrabble Island are lonely and cold when the lighthouse
+barely pierces the gloom. You sit on your bed, thinking of better times
+and far-off places. A knock on your door stirs you, and Hevlin, a shipmate
+you haven't seen for years, staggers in.|
+|
+\"I'm in trouble,\" he says. \"I had a few too many at The Shanty.
+I was looking for Red, but he wasn't around, and I started talking about ...
+here,\" he says, handing you a slim volume that you recognize
+as a shipwreck book written years ago by the Historical Society.|
+|
+You smile. Every diver on the island has looked for those wrecks,
+without even an old boot to show for it. You open the door, hoping the
+drunken fool will leave. \"I know what you're thinkin',\" Hevlin scowls,
+\"but look!\" He points to the familiar map, and you see new locations
+marked for two of the wrecks.|
+|
+\"Keep it for me,\" he says. \"Just for tonight. It'll be safe here with
+you. Don't let -- \" He stops and broods for a moment. \"I've got to go
+find Red!\" And with that, Hevlin leaves.|
+|
+You put the book in your dresser and think about following Hevlin. Then you
+hear a scuffle outside. You look through your window and see two men
+struggling. One falls to the ground in a heap. The other man bends
+down beside him, then turns as if startled and runs away. Another man then
+approaches the wounded figure. He kneels beside him for a long moment,
+then takes off after the other man.|
+|
+It isn't long before the police arrive to tell you that Hevlin's been
+murdered. You don't mention the book, and hours later, as you lie awake
+in your bed, you wonder if the book could really be what it seems." CR>>
+
+<ROUTINE ACCESSIBLE? (OBJ "AUX" (L <LOC .OBJ>)) ;"can player TOUCH object?"
+ ;"revised 5/2/84 by SEM and SWG"
+ <COND (<FSET? .OBJ ,INVISIBLE> <RFALSE>)
+ (<EQUAL? .OBJ ,PSEUDO-OBJECT>
+ <COND (<EQUAL? <GETP ,PSEUDO-OBJECT ,P?DESCFCN> ,HERE>
+ <RTRUE>)
+ (T
+ <RFALSE>)>)
+ (<NOT .L> <RFALSE>)
+ (<EQUAL? .L ,GLOBAL-OBJECTS> <RTRUE>)
+ (<AND <EQUAL? .L ,LOCAL-GLOBALS>
+ <GLOBAL-IN? .OBJ ,HERE>>
+ <RTRUE>)
+ (<NOT <EQUAL? <META-LOC .OBJ> ,HERE>> <RFALSE>)
+ (<EQUAL? .L ,WINNER ,HERE> <RTRUE>)
+ (<AND <OR <FSET? .L ,OPENBIT>
+ <FSET? .L ,PERSON>>
+ <ACCESSIBLE? .L>>
+ <RTRUE>)
+ (T <RFALSE>)>>
+
+<ROUTINE VISIBLE? (OBJ "AUX" (L <LOC .OBJ>)) ;"can player SEE object"
+ ;"revised 5/2/84 by SEM and SWG"
+ <COND (<ACCESSIBLE? .OBJ>
+ <RTRUE>)
+ (<AND <SEE-INSIDE? .L>
+ <VISIBLE? .L>>
+ <RTRUE>)
+ (T
+ <RFALSE>)>>
+
+<ROUTINE META-LOC (OBJ)
+ <REPEAT ()
+ <COND (<NOT .OBJ> <RFALSE>)
+ (<EQUAL? .OBJ ,GLOBAL-OBJECTS ,LOCAL-GLOBALS>
+ <RETURN .OBJ>)>
+ <COND (<IN? .OBJ ,ROOMS>
+ <RETURN .OBJ>)
+ (ELSE
+ <SET OBJ <LOC .OBJ>>)>>> \ No newline at end of file
diff --git a/parser.zap b/parser.zap
new file mode 100644
index 0000000..0648741
--- /dev/null
+++ b/parser.zap
@@ -0,0 +1,1521 @@
+
+
+ .FUNCT PARSER,PTR=P-LEXSTART,WORD,VAL=0,VERB=0,LEN,DIR=0,NW=0,LW=0,NUM,SCNT,CNT=-1
+?PRG1: IGRTR? 'CNT,P-ITBLLEN \?ELS5
+ JUMP ?REP2
+?ELS5: PUT P-ITBL,CNT,0
+ JUMP ?PRG1
+?REP2: SET 'P-NAM,FALSE-VALUE
+ SET 'P-ADJ,FALSE-VALUE
+ SET 'P-ADVERB,FALSE-VALUE
+ SET 'P-MERGED,FALSE-VALUE
+ SET 'P-NONE,FALSE-VALUE
+ PUT P-PRSO,P-MATCHLEN,0
+ PUT P-PRSI,P-MATCHLEN,0
+ PUT P-BUTS,P-MATCHLEN,0
+ ZERO? QUOTE-FLAG \?CND8
+ EQUAL? WINNER,PLAYER /?CND8
+ SET 'WINNER,PLAYER
+ LOC WINNER
+ FSET? STACK,VEHBIT /?CND8
+ LOC WINNER >HERE
+?CND8: ZERO? P-CONT /?ELS18
+ SET 'PTR,P-CONT
+ SET 'P-CONT,FALSE-VALUE
+ EQUAL? L-PRSA,V?TELL /?CND16
+ CRLF
+ JUMP ?CND16
+?ELS18: SET 'WINNER,PLAYER
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ LOC WINNER
+ FSET? STACK,VEHBIT /?CND25
+ LOC WINNER >HERE
+?CND25: PUTB P-LEXV,0,59
+ ZERO? SUPER-BRIEF \?CND28
+ CRLF
+?CND28: PRINTI ">"
+ READ P-INBUF,P-LEXV
+?CND16: GETB P-LEXV,P-LEXWORDS >P-LEN
+ ZERO? P-LEN \?ELS35
+ PRINTI "What?"
+ CRLF
+ RFALSE
+?ELS35: GET P-LEXV,PTR >WORD
+ EQUAL? WORD,W?WHY,W?HOW,W?WHEN /?THN40
+ EQUAL? WORD,W?IS,W?DID,W?ARE \?CND33
+?THN40: PRINTI "Sorry, but this program can't handle questions like that. You should stick to questions like ""WHAT IS ..."" and ""WHERE IS ...."" Maybe you'd like to reread the manual."
+ CRLF
+ RFALSE
+?CND33: SET 'LEN,P-LEN
+ SET 'P-DIR,FALSE-VALUE
+ SET 'P-NCN,0
+ SET 'P-GETFLAGS,0
+ PUT P-ITBL,P-VERBN,0
+?PRG44: DLESS? 'P-LEN,0 \?ELS48
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ JUMP ?REP45
+?ELS48: GET P-LEXV,PTR >WORD
+ ZERO? WORD \?THN51
+ CALL NUMBER?,PTR >WORD
+ ZERO? WORD /?ELS50
+?THN51: EQUAL? WORD,W?TO \?ELS55
+ EQUAL? VERB,ACT?TELL,ACT?ASK \?ELS55
+ SET 'WORD,W?QUOTE
+ JUMP ?CND53
+?ELS55: EQUAL? WORD,W?THEN \?CND53
+ ZERO? VERB \?CND53
+ PUT P-ITBL,P-VERB,ACT?TELL
+ PUT P-ITBL,P-VERBN,0
+ SET 'WORD,W?QUOTE
+?CND53: EQUAL? WORD,W?PERIOD \?ELS64
+ EQUAL? LW,W?MR \?ELS64
+ SET 'LW,0
+ JUMP ?CND46
+?ELS64: EQUAL? WORD,W?THEN,W?PERIOD,W?QUOTE \?ELS68
+ EQUAL? WORD,W?QUOTE \?CND69
+ ZERO? QUOTE-FLAG /?ELS74
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ JUMP ?CND69
+?ELS74: SET 'QUOTE-FLAG,TRUE-VALUE
+?CND69: ZERO? P-LEN /?THN78
+ ADD PTR,P-LEXELEN >P-CONT
+?THN78: PUTB P-LEXV,P-LEXWORDS,P-LEN
+ JUMP ?REP45
+?ELS68: CALL WT?,WORD,PS?DIRECTION,P1?DIRECTION >VAL
+ ZERO? VAL /?ELS81
+ EQUAL? VERB,FALSE-VALUE,ACT?WALK \?ELS81
+ EQUAL? LEN,1 /?THN84
+ EQUAL? LEN,2 \?ELS87
+ EQUAL? VERB,ACT?WALK /?THN84
+?ELS87: ADD PTR,P-LEXELEN
+ GET P-LEXV,STACK >NW
+ EQUAL? NW,W?THEN,W?QUOTE \?ELS89
+ GRTR? LEN,2 /?THN84
+?ELS89: EQUAL? NW,W?PERIOD \?ELS91
+ GRTR? LEN,1 /?THN84
+?ELS91: ZERO? QUOTE-FLAG /?ELS93
+ EQUAL? LEN,2 \?ELS93
+ EQUAL? NW,W?QUOTE /?THN84
+?ELS93: GRTR? LEN,2 \?ELS81
+ EQUAL? NW,W?COMMA,W?AND \?ELS81
+?THN84: SET 'DIR,VAL
+ EQUAL? NW,W?COMMA,W?AND \?CND96
+ ADD PTR,P-LEXELEN
+ PUT P-LEXV,STACK,W?THEN
+?CND96: GRTR? LEN,2 /?CND46
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ JUMP ?REP45
+?ELS81: CALL WT?,WORD,PS?VERB,P1?VERB >VAL
+ ZERO? VAL /?ELS103
+ ZERO? VERB \?ELS103
+ SET 'VERB,VAL
+ PUT P-ITBL,P-VERB,VAL
+ PUT P-ITBL,P-VERBN,P-VTBL
+ PUT P-VTBL,0,WORD
+ MUL PTR,2
+ ADD STACK,2 >NUM
+ GETB P-LEXV,NUM
+ PUTB P-VTBL,2,STACK
+ ADD NUM,1
+ GETB P-LEXV,STACK
+ PUTB P-VTBL,3,STACK
+ JUMP ?CND46
+?ELS103: CALL WT?,WORD,PS?PREPOSITION,0 >VAL
+ ZERO? VAL \?THN110
+ EQUAL? WORD,W?ALL,W?ONE,W?A /?THN114
+ CALL WT?,WORD,PS?ADJECTIVE
+ ZERO? STACK \?THN114
+ CALL WT?,WORD,PS?OBJECT
+ ZERO? STACK /?ELS109
+?THN114: SET 'VAL,0
+?THN110: GRTR? P-LEN,0 \?ELS118
+ ADD PTR,P-LEXELEN
+ GET P-LEXV,STACK
+ EQUAL? STACK,W?OF \?ELS118
+ EQUAL? VERB,ACT?MAKE /?ELS118
+ ZERO? VAL \?ELS118
+ EQUAL? WORD,W?ALL,W?ONE,W?A /?ELS118
+ JUMP ?CND46
+?ELS118: ZERO? VAL /?ELS122
+ ZERO? P-LEN /?THN125
+ ADD PTR,2
+ GET P-LEXV,STACK
+ EQUAL? STACK,W?THEN,W?PERIOD \?ELS122
+?THN125: LESS? P-NCN,2 \?CND46
+ PUT P-ITBL,P-PREP1,VAL
+ PUT P-ITBL,P-PREP1N,WORD
+ JUMP ?CND46
+?ELS122: EQUAL? P-NCN,2 \?ELS131
+ PRINTI "I found more than two nouns in that sentence!"
+ CRLF
+ RFALSE
+?ELS131: INC 'P-NCN
+ CALL CLAUSE,PTR,VAL,WORD >PTR
+ ZERO? PTR /FALSE
+ LESS? PTR,0 \?CND46
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ JUMP ?REP45
+?ELS109: EQUAL? WORD,W?QUIETLY /?THN143
+ EQUAL? WORD,W?SLOWLY,W?QUICKLY,W?BRIEFLY \?ELS142
+?THN143: SET 'P-ADVERB,WORD
+ JUMP ?CND46
+?ELS142: CALL WT?,WORD,PS?BUZZ-WORD
+ ZERO? STACK /?ELS146
+ JUMP ?CND46
+?ELS146: CALL CANT-USE,PTR
+ RFALSE
+?ELS50: CALL UNKNOWN-WORD,PTR
+ RFALSE
+?CND46: SET 'LW,WORD
+ ADD PTR,P-LEXELEN >PTR
+ JUMP ?PRG44
+?REP45: ZERO? DIR /?CND151
+ SET 'PRSA,V?WALK
+ SET 'PRSO,DIR
+ SET 'P-WALK-DIR,DIR
+ RETURN TRUE-VALUE
+?CND151: ZERO? P-OFLAG /?CND155
+ CALL ORPHAN-MERGE
+?CND155: GET P-ITBL,P-VERB
+ ZERO? STACK \?CND159
+ PUT P-ITBL,P-VERB,ACT?$CALL
+?CND159: CALL SYNTAX-CHECK
+ ZERO? STACK /FALSE
+ CALL SNARF-OBJECTS
+ ZERO? STACK /FALSE
+ CALL MANY-CHECK
+ ZERO? STACK /FALSE
+ CALL TAKE-CHECK
+ ZERO? STACK /FALSE
+ RTRUE
+
+
+ .FUNCT WT?,PTR,BIT,B1=5,OFFSET=P-P1OFF,TYP
+ GETB PTR,P-PSOFF >TYP
+ BTST TYP,BIT \FALSE
+ GRTR? B1,4 /TRUE
+ BAND TYP,P-P1BITS >TYP
+ EQUAL? TYP,B1 /?CND13
+ INC 'OFFSET
+?CND13: GETB PTR,OFFSET
+ RSTACK
+
+
+ .FUNCT CLAUSE,PTR,VAL,WORD,OFF,NUM,ANDFLG=0,FIRST??=1,NW,LW=0,?TMP1
+ SUB P-NCN,1
+ MUL STACK,2 >OFF
+ ZERO? VAL /?ELS3
+ ADD P-PREP1,OFF >NUM
+ PUT P-ITBL,NUM,VAL
+ ADD NUM,1
+ PUT P-ITBL,STACK,WORD
+ ADD PTR,P-LEXELEN >PTR
+ JUMP ?CND1
+?ELS3: INC 'P-LEN
+?CND1: ZERO? P-LEN \?CND6
+ DEC 'P-NCN
+ RETURN -1
+?CND6: ADD P-NC1,OFF >NUM
+ MUL PTR,2
+ ADD P-LEXV,STACK
+ PUT P-ITBL,NUM,STACK
+ GET P-LEXV,PTR
+ EQUAL? STACK,W?THE,W?A,W?AN \?CND9
+ GET P-ITBL,NUM
+ ADD STACK,4
+ PUT P-ITBL,NUM,STACK
+?CND9:
+?PRG12: DLESS? 'P-LEN,0 \?CND14
+ ADD NUM,1 >?TMP1
+ MUL PTR,2
+ ADD P-LEXV,STACK
+ PUT P-ITBL,?TMP1,STACK
+ RETURN -1
+?CND14: GET P-LEXV,PTR >WORD
+ ZERO? WORD \?THN20
+ CALL NUMBER?,PTR >WORD
+ ZERO? WORD /?ELS19
+?THN20: ZERO? P-LEN \?ELS24
+ SET 'NW,0
+ JUMP ?CND22
+?ELS24: ADD PTR,P-LEXELEN
+ GET P-LEXV,STACK >NW
+?CND22: EQUAL? WORD,W?OF \?CND27
+ GET P-ITBL,P-VERB
+ EQUAL? STACK,ACT?MAKE \?CND27
+ PUT P-LEXV,PTR,W?WITH
+ SET 'WORD,W?WITH
+?CND27: EQUAL? WORD,W?PERIOD \?ELS34
+ EQUAL? LW,W?MR \?ELS34
+ SET 'LW,0
+ JUMP ?CND17
+?ELS34: EQUAL? WORD,W?AND,W?COMMA \?ELS38
+ SET 'ANDFLG,TRUE-VALUE
+ JUMP ?CND17
+?ELS38: EQUAL? WORD,W?ALL,W?ONE \?ELS40
+ EQUAL? NW,W?OF \?CND17
+ DEC 'P-LEN
+ ADD PTR,P-LEXELEN >PTR
+ JUMP ?CND17
+?ELS40: EQUAL? WORD,W?THEN,W?PERIOD /?THN46
+ CALL WT?,WORD,PS?PREPOSITION
+ ZERO? STACK /?ELS45
+ ZERO? FIRST?? \?ELS45
+?THN46: INC 'P-LEN
+ ADD NUM,1 >?TMP1
+ MUL PTR,2
+ ADD P-LEXV,STACK
+ PUT P-ITBL,?TMP1,STACK
+ SUB PTR,P-LEXELEN
+ RETURN STACK
+?ELS45: ZERO? ANDFLG /?ELS51
+ GET P-ITBL,P-VERBN
+ ZERO? STACK /?THN54
+ CALL WT?,WORD,PS?DIRECTION
+ ZERO? STACK \?THN54
+ CALL WT?,WORD,PS?VERB
+ ZERO? STACK /?ELS51
+?THN54: SUB PTR,4 >PTR
+ ADD PTR,2
+ PUT P-LEXV,STACK,W?THEN
+ ADD P-LEN,2 >P-LEN
+ JUMP ?CND17
+?ELS51: CALL WT?,WORD,PS?OBJECT
+ ZERO? STACK /?ELS57
+ GRTR? P-LEN,0 \?ELS60
+ EQUAL? NW,W?OF \?ELS60
+ EQUAL? WORD,W?ALL,W?ONE /?ELS60
+ JUMP ?CND17
+?ELS60: CALL WT?,WORD,PS?ADJECTIVE,P1?ADJECTIVE
+ ZERO? STACK /?ELS64
+ ZERO? NW /?ELS64
+ CALL WT?,NW,PS?OBJECT
+ ZERO? STACK /?ELS64
+ JUMP ?CND17
+?ELS64: ZERO? ANDFLG \?ELS68
+ EQUAL? NW,W?BUT,W?EXCEPT /?ELS68
+ EQUAL? NW,W?AND,W?COMMA /?ELS68
+ ADD NUM,1 >?TMP1
+ ADD PTR,2
+ MUL STACK,2
+ ADD P-LEXV,STACK
+ PUT P-ITBL,?TMP1,STACK
+ RETURN PTR
+?ELS68: SET 'ANDFLG,FALSE-VALUE
+ JUMP ?CND17
+?ELS57: CALL WT?,WORD,PS?ADJECTIVE
+ ZERO? STACK /?ELS74
+ JUMP ?CND17
+?ELS74: CALL WT?,WORD,PS?BUZZ-WORD
+ ZERO? STACK /?ELS79
+ JUMP ?CND17
+?ELS79: CALL WT?,WORD,PS?PREPOSITION
+ ZERO? STACK /?ELS81
+ JUMP ?CND17
+?ELS81: CALL CANT-USE,PTR
+ RFALSE
+?ELS19: CALL UNKNOWN-WORD,PTR
+ RFALSE
+?CND17: SET 'LW,WORD
+ SET 'FIRST??,FALSE-VALUE
+ ADD PTR,P-LEXELEN >PTR
+ JUMP ?PRG12
+
+
+ .FUNCT NUMBER?,PTR,CNT,BPTR,CHR,SUM=0,TIM=0,?TMP1
+ MUL PTR,2
+ ADD P-LEXV,STACK
+ GETB STACK,2 >CNT
+ MUL PTR,2
+ ADD P-LEXV,STACK
+ GETB STACK,3 >BPTR
+ SET 'P-DOLLAR-FLAG,FALSE-VALUE
+?PRG1: DLESS? 'CNT,0 \?ELS5
+ JUMP ?REP2
+?ELS5: GETB P-INBUF,BPTR >CHR
+ EQUAL? CHR,58 \?ELS10
+ SET 'TIM,SUM
+ SET 'SUM,0
+ JUMP ?CND8
+?ELS10: GRTR? SUM,9999 /FALSE
+ LESS? CHR,58 \?ELS14
+ GRTR? CHR,47 \?ELS14
+ MUL SUM,10 >?TMP1
+ SUB CHR,48
+ ADD ?TMP1,STACK >SUM
+ JUMP ?CND8
+?ELS14: EQUAL? CHR,36 \FALSE
+ SET 'P-DOLLAR-FLAG,TRUE-VALUE
+?CND8: INC 'BPTR
+ JUMP ?PRG1
+?REP2: PUT P-LEXV,PTR,W?INTNUM
+ GRTR? SUM,9999 /FALSE
+ ZERO? TIM /?CND21
+ SET 'SET-HR,TIM
+ SET 'SET-MIN,SUM
+ GRTR? TIM,23 /FALSE
+ MUL TIM,60
+ ADD SUM,STACK >SUM
+?CND21: ZERO? P-DOLLAR-FLAG /?ELS32
+ GRTR? SUM,0 \?ELS32
+ SET 'P-AMOUNT,SUM
+ FSET INTNUM,VOWELBIT
+ PUTP INTNUM,P?SDESC,STR?50
+ RETURN W?INTNUM
+?ELS32: SET 'P-NUMBER,SUM
+ SET 'P-DOLLAR-FLAG,FALSE-VALUE
+ FCLEAR INTNUM,VOWELBIT
+ PUTP INTNUM,P?SDESC,STR?1
+ RETURN W?INTNUM
+
+
+ .FUNCT ORPHAN-MERGE,CNT=-1,TEMP,VERB,BEG,END,ADJ=0,WRD,?TMP1
+ SET 'P-OFLAG,FALSE-VALUE
+ GET P-ITBL,P-VERBN
+ GET STACK,0
+ CALL WT?,STACK,PS?ADJECTIVE,P1?ADJECTIVE
+ ZERO? STACK /?CND1
+ SET 'ADJ,TRUE-VALUE
+?CND1: GET P-ITBL,P-VERB >VERB
+ ZERO? VERB /?ELS6
+ ZERO? ADJ \?ELS6
+ GET P-OTBL,P-VERB
+ EQUAL? VERB,STACK \FALSE
+?ELS6: EQUAL? P-NCN,2 /FALSE
+ GET P-OTBL,P-NC1
+ EQUAL? STACK,1 \?ELS12
+ GET P-ITBL,P-PREP1 >TEMP
+ GET P-OTBL,P-PREP1
+ EQUAL? TEMP,STACK /?THN16
+ ZERO? TEMP \FALSE
+?THN16: ZERO? ADJ /?ELS20
+ ADD P-LEXV,2
+ PUT P-OTBL,P-NC1,STACK
+ ADD P-LEXV,6
+ PUT P-OTBL,P-NC1L,STACK
+ JUMP ?CND4
+?ELS20: GET P-ITBL,P-NC1
+ PUT P-OTBL,P-NC1,STACK
+ GET P-ITBL,P-NC1L
+ PUT P-OTBL,P-NC1L,STACK
+ JUMP ?CND4
+?ELS12: GET P-OTBL,P-NC2
+ EQUAL? STACK,1 \?ELS27
+ GET P-ITBL,P-PREP1 >TEMP
+ GET P-OTBL,P-PREP2
+ EQUAL? TEMP,STACK /?THN31
+ ZERO? TEMP \FALSE
+?THN31: ZERO? ADJ /?CND33
+ ADD P-LEXV,2
+ PUT P-ITBL,P-NC1,STACK
+ ADD P-LEXV,6
+ PUT P-ITBL,P-NC1L,STACK
+?CND33: GET P-ITBL,P-NC1
+ PUT P-OTBL,P-NC2,STACK
+ GET P-ITBL,P-NC1L
+ PUT P-OTBL,P-NC2L,STACK
+ SET 'P-NCN,2
+ JUMP ?CND4
+?ELS27: ZERO? P-ACLAUSE /?CND4
+ EQUAL? P-NCN,1 /?ELS44
+ ZERO? ADJ \?ELS44
+ SET 'P-ACLAUSE,FALSE-VALUE
+ RFALSE
+?ELS44: GET P-ITBL,P-NC1 >BEG
+ ZERO? ADJ /?CND49
+ ADD P-LEXV,2 >BEG
+ SET 'ADJ,FALSE-VALUE
+?CND49: GET P-ITBL,P-NC1L >END
+?PRG53: GET BEG,0 >WRD
+ EQUAL? BEG,END \?ELS57
+ ZERO? ADJ /?ELS60
+ CALL ACLAUSE-WIN,ADJ
+ JUMP ?CND42
+?ELS60: SET 'P-ACLAUSE,FALSE-VALUE
+ RFALSE
+?ELS57: ZERO? ADJ \?ELS65
+ GETB WRD,P-PSOFF
+ BTST STACK,PS?ADJECTIVE /?THN68
+ EQUAL? WRD,W?ALL,W?ONE \?ELS65
+?THN68: SET 'ADJ,WRD
+ JUMP ?CND55
+?ELS65: GETB WRD,P-PSOFF
+ BTST STACK,PS?OBJECT /?THN72
+ EQUAL? WRD,W?ONE \?CND55
+?THN72: EQUAL? WRD,P-ANAM,W?ONE \FALSE
+ CALL ACLAUSE-WIN,ADJ
+ JUMP ?CND42
+?CND55: ADD BEG,P-WORDLEN >BEG
+ ZERO? END \?PRG53
+ SET 'END,BEG
+ SET 'P-NCN,1
+ SUB BEG,4
+ PUT P-ITBL,P-NC1,STACK
+ PUT P-ITBL,P-NC1L,BEG
+ JUMP ?PRG53
+?CND42:
+?CND4:
+?PRG82: IGRTR? 'CNT,P-ITBLLEN \?ELS86
+ SET 'P-MERGED,TRUE-VALUE
+ RTRUE
+?ELS86: GET P-OTBL,CNT
+ PUT P-ITBL,CNT,STACK
+ JUMP ?PRG82
+
+
+ .FUNCT ACLAUSE-WIN,ADJ
+ GET P-OTBL,P-VERB
+ PUT P-ITBL,P-VERB,STACK
+ SET 'P-CCSRC,P-OTBL
+ ADD P-ACLAUSE,1
+ CALL CLAUSE-COPY,P-ACLAUSE,STACK,ADJ
+ GET P-OTBL,P-NC2
+ ZERO? STACK /?ELS2
+ SET 'P-NCN,2
+?ELS2: SET 'P-ACLAUSE,FALSE-VALUE
+ RTRUE
+
+
+ .FUNCT WORD-PRINT,CNT,BUF
+?PRG1: DLESS? 'CNT,0 /TRUE
+ GETB P-INBUF,BUF
+ PRINTC STACK
+ INC 'BUF
+ JUMP ?PRG1
+
+
+ .FUNCT UNKNOWN-WORD,PTR,BUF,MSG,?TMP1
+ PRINTI "I don't know the word """
+ MUL PTR,2 >BUF
+ ADD P-LEXV,BUF
+ GETB STACK,2 >?TMP1
+ ADD P-LEXV,BUF
+ GETB STACK,3
+ CALL WORD-PRINT,?TMP1,STACK
+ PRINTI """."
+ CRLF
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ SET 'P-OFLAG,FALSE-VALUE
+ RETURN P-OFLAG
+
+
+ .FUNCT CANT-USE,PTR,BUF,?TMP1
+ PRINTI "Sorry, but you can't use the word """
+ MUL PTR,2 >BUF
+ ADD P-LEXV,BUF
+ GETB STACK,2 >?TMP1
+ ADD P-LEXV,BUF
+ GETB STACK,3
+ CALL WORD-PRINT,?TMP1,STACK
+ PRINTI """ in that sense."
+ CRLF
+ SET 'QUOTE-FLAG,FALSE-VALUE
+ SET 'P-OFLAG,FALSE-VALUE
+ RETURN P-OFLAG
+
+
+ .FUNCT SYNTAX-CHECK,SYN,LEN,NUM,OBJ,DRIVE1=0,DRIVE2=0,PREP,VERB,?TMP2,?TMP1
+ GET P-ITBL,P-VERB >VERB
+ ZERO? VERB \?CND1
+ CALL TELL-COULDNT-FIND,STR?51
+ RFALSE
+?CND1: SUB 255,VERB
+ GET VERBS,STACK >SYN
+ GETB SYN,0 >LEN
+ ADD 1,SYN >SYN
+?PRG4: GETB SYN,P-SBITS
+ BAND STACK,P-SONUMS >NUM
+ GRTR? P-NCN,NUM \?ELS8
+ JUMP ?CND6
+?ELS8: LESS? NUM,1 /?ELS10
+ ZERO? P-NCN \?ELS10
+ GET P-ITBL,P-PREP1 >PREP
+ ZERO? PREP /?THN13
+ GETB SYN,P-SPREP1
+ EQUAL? PREP,STACK \?ELS10
+?THN13: SET 'DRIVE1,SYN
+ JUMP ?CND6
+?ELS10: GETB SYN,P-SPREP1 >?TMP1
+ GET P-ITBL,P-PREP1
+ EQUAL? ?TMP1,STACK \?CND6
+ EQUAL? NUM,2 \?ELS19
+ EQUAL? P-NCN,1 \?ELS19
+ SET 'DRIVE2,SYN
+ JUMP ?CND6
+?ELS19: GETB SYN,P-SPREP2 >?TMP1
+ GET P-ITBL,P-PREP2
+ EQUAL? ?TMP1,STACK \?CND6
+ CALL SYNTAX-FOUND,SYN
+ RTRUE
+?CND6: DLESS? 'LEN,1 \?ELS26
+ ZERO? DRIVE1 \?REP5
+ ZERO? DRIVE2 /?ELS29
+ JUMP ?REP5
+?ELS29: PRINTI "I don't understand that sentence."
+ CRLF
+ RFALSE
+?ELS26: ADD SYN,P-SYNLEN >SYN
+ JUMP ?PRG4
+?REP5: ZERO? DRIVE1 /?ELS42
+ GETB DRIVE1,P-SFWIM1 >?TMP2
+ GETB DRIVE1,P-SLOC1 >?TMP1
+ GETB DRIVE1,P-SPREP1
+ CALL GWIM,?TMP2,?TMP1,STACK >OBJ
+ ZERO? OBJ /?ELS42
+ PUT P-PRSO,P-MATCHLEN,1
+ PUT P-PRSO,1,OBJ
+ CALL SYNTAX-FOUND,DRIVE1
+ RSTACK
+?ELS42: ZERO? DRIVE2 /?ELS46
+ GETB DRIVE2,P-SFWIM2 >?TMP2
+ GETB DRIVE2,P-SLOC2 >?TMP1
+ GETB DRIVE2,P-SPREP2
+ CALL GWIM,?TMP2,?TMP1,STACK >OBJ
+ ZERO? OBJ /?ELS46
+ PUT P-PRSI,P-MATCHLEN,1
+ PUT P-PRSI,1,OBJ
+ CALL SYNTAX-FOUND,DRIVE2
+ RSTACK
+?ELS46: EQUAL? VERB,ACT?FIND \?ELS50
+ EQUAL? WINNER,PLAYER /?ELS53
+ PRINTI "You'll have to ask a more specific question."
+ CRLF
+ RFALSE
+?ELS53: PRINTI "Sorry, but I can't answer that question."
+ CRLF
+ RFALSE
+?ELS50: EQUAL? WINNER,PLAYER \?ELS64
+ CALL ORPHAN,DRIVE1,DRIVE2
+ EQUAL? VERB,ACT?WALK \?ELS67
+ PRINTI "Where"
+ JUMP ?CND65
+?ELS67: PRINTI "What"
+?CND65: PRINTI " do you want to "
+ JUMP ?CND62
+?ELS64: CALL REQUEST-INCOMPLETE
+ PRINTI "what you want "
+ CALL THE?,WINNER
+ CALL DPRINT,WINNER
+ PRINTI " to "
+?CND62: CALL VERB-PRINT
+ ZERO? DRIVE2 /?CND82
+ CALL CLAUSE-PRINT,P-NC1,P-NC1L
+?CND82: ZERO? DRIVE1 /?ELS90
+ GETB DRIVE1,P-SPREP1
+ JUMP ?CND86
+?ELS90: GETB DRIVE2,P-SPREP2
+?CND86: CALL PREP-PRINT,STACK
+ EQUAL? WINNER,PLAYER \?ELS96
+ SET 'P-OFLAG,TRUE-VALUE
+ PRINTI "?"
+ CRLF
+ RFALSE
+?ELS96: SET 'P-OFLAG,FALSE-VALUE
+ PRINTI "."
+ CRLF
+ RFALSE
+
+
+ .FUNCT REQUEST-INCOMPLETE
+ PRINTI "Your request was incomplete. Next time, say "
+ RTRUE
+
+
+ .FUNCT VERB-PRINT,TMP,?TMP1
+ GET P-ITBL,P-VERBN >TMP
+ ZERO? TMP \?ELS5
+ PRINTI "say"
+ RTRUE
+?ELS5: GETB P-VTBL,2
+ ZERO? STACK \?ELS9
+ GET TMP,0
+ PRINTB STACK
+ RTRUE
+?ELS9: GETB TMP,2 >?TMP1
+ GETB TMP,3
+ CALL WORD-PRINT,?TMP1,STACK
+ PUTB P-VTBL,2,0
+ RTRUE
+
+
+ .FUNCT ORPHAN,D1,D2,CNT=-1
+ PUT P-OCLAUSE,P-MATCHLEN,0
+ SET 'P-CCSRC,P-ITBL
+?PRG1: IGRTR? 'CNT,P-ITBLLEN \?ELS5
+ JUMP ?REP2
+?ELS5: GET P-ITBL,CNT
+ PUT P-OTBL,CNT,STACK
+ JUMP ?PRG1
+?REP2: EQUAL? P-NCN,2 \?CND8
+ CALL CLAUSE-COPY,P-NC2,P-NC2L
+?CND8: LESS? P-NCN,1 /?CND11
+ CALL CLAUSE-COPY,P-NC1,P-NC1L
+?CND11: ZERO? D1 /?ELS18
+ GETB D1,P-SPREP1
+ PUT P-OTBL,P-PREP1,STACK
+ PUT P-OTBL,P-NC1,1
+ RTRUE
+?ELS18: ZERO? D2 /FALSE
+ GETB D2,P-SPREP2
+ PUT P-OTBL,P-PREP2,STACK
+ PUT P-OTBL,P-NC2,1
+ RTRUE
+
+
+ .FUNCT CLAUSE-PRINT,BPTR,EPTR,THE?=1,?TMP1
+ GET P-ITBL,BPTR >?TMP1
+ GET P-ITBL,EPTR
+ CALL BUFFER-PRINT,?TMP1,STACK,THE?
+ RSTACK
+
+
+ .FUNCT BUFFER-PRINT,BEG,END,CP,NOSP=0,WRD,FIRST??=1,PN=0,?TMP1
+?PRG1: EQUAL? BEG,END /TRUE
+ ZERO? NOSP /?ELS10
+ SET 'NOSP,FALSE-VALUE
+ JUMP ?CND8
+?ELS10: PRINTI " "
+?CND8: GET BEG,0 >WRD
+ EQUAL? WRD,W?PERIOD \?ELS18
+ SET 'NOSP,TRUE-VALUE
+ JUMP ?CND3
+?ELS18: EQUAL? WRD,W?MR \?ELS20
+ PRINTI "Mr."
+ SET 'PN,TRUE-VALUE
+ JUMP ?CND3
+?ELS20: EQUAL? WRD,W?MCGINTY \?ELS24
+ PRINTI "McGinty"
+ SET 'PN,TRUE-VALUE
+ JUMP ?CND3
+?ELS24: EQUAL? WRD,W?ME \?ELS28
+ CALL DPRINT,GLOBAL-SELF
+ SET 'PN,TRUE-VALUE
+ JUMP ?CND3
+?ELS28: EQUAL? WRD,W?WEASEL,W?PETE,W?JOHN /?THN33
+ EQUAL? WRD,W?JOHNNY,W?RED,W?RAT /?THN33
+ EQUAL? WRD,W?MARY,W?MARGAR,W?FRANK /?THN33
+ EQUAL? WRD,W?WEBSTE,W?HEVLIN \?ELS32
+?THN33: CALL CAPITALIZE,BEG
+ SET 'PN,TRUE-VALUE
+ JUMP ?CND3
+?ELS32: ZERO? FIRST?? /?CND37
+ ZERO? PN \?CND37
+ ZERO? CP /?CND37
+ PRINTI "the "
+?CND37: ZERO? P-OFLAG \?THN47
+ ZERO? P-MERGED /?ELS46
+?THN47: EQUAL? WRD,W?INTNUM \?ELS51
+ CALL DPRINT,INTNUM
+ JUMP ?CND44
+?ELS51: PRINTB WRD
+ JUMP ?CND44
+?ELS46: EQUAL? WRD,W?IT,W?HIM \?ELS57
+ CALL ACCESSIBLE?,P-IT-OBJECT
+ ZERO? STACK /?ELS57
+ EQUAL? P-IT-OBJECT,PSEUDO-OBJECT /?ELS57
+ CALL DPRINT,P-IT-OBJECT
+ JUMP ?CND44
+?ELS57: GETB BEG,2 >?TMP1
+ GETB BEG,3
+ CALL WORD-PRINT,?TMP1,STACK
+?CND44: SET 'FIRST??,FALSE-VALUE
+?CND3: ADD BEG,P-WORDLEN >BEG
+ JUMP ?PRG1
+
+
+ .FUNCT CAPITALIZE,PTR,?TMP1
+ ZERO? P-OFLAG \?THN6
+ ZERO? P-MERGED /?ELS5
+?THN6: GET PTR,0
+ PRINTB STACK
+ RTRUE
+?ELS5: GETB PTR,3
+ GETB P-INBUF,STACK
+ SUB STACK,32
+ PRINTC STACK
+ GETB PTR,2
+ SUB STACK,1 >?TMP1
+ GETB PTR,3
+ ADD STACK,1
+ CALL WORD-PRINT,?TMP1,STACK
+ RSTACK
+
+
+ .FUNCT PREP-PRINT,PREP,SP?=1,WRD
+ ZERO? PREP /FALSE
+ ZERO? SP? /?CND6
+ PRINTI " "
+?CND6: CALL PREP-FIND,PREP >WRD
+ GET P-ITBL,P-VERBN
+ GET STACK,0
+ EQUAL? W?SIT,STACK \?ELS14
+ EQUAL? W?DOWN,WRD \?ELS14
+ PRINTI "on"
+ JUMP ?CND12
+?ELS14: EQUAL? WRD,W?AGAINST \?ELS20
+ PRINTI "against"
+ JUMP ?CND12
+?ELS20: PRINTB WRD
+?CND12: GET P-ITBL,P-VERBN
+ GET STACK,0
+ EQUAL? W?GET,STACK \TRUE
+ EQUAL? W?OUT,WRD \TRUE
+ PRINTI " of"
+ RTRUE
+
+
+ .FUNCT CLAUSE-COPY,BPTR,EPTR,INSERT=0,BEG,END
+ GET P-CCSRC,BPTR >BEG
+ GET P-CCSRC,EPTR >END
+ GET P-OCLAUSE,P-MATCHLEN
+ MUL STACK,P-LEXELEN
+ ADD STACK,2
+ ADD P-OCLAUSE,STACK
+ PUT P-OTBL,BPTR,STACK
+?PRG1: EQUAL? BEG,END \?ELS5
+ GET P-OCLAUSE,P-MATCHLEN
+ MUL STACK,P-LEXELEN
+ ADD STACK,2
+ ADD P-OCLAUSE,STACK
+ PUT P-OTBL,EPTR,STACK
+ RTRUE
+?ELS5: ZERO? INSERT /?CND8
+ GET BEG,0
+ EQUAL? P-ANAM,STACK \?CND8
+ CALL CLAUSE-ADD,INSERT
+?CND8: GET BEG,0
+ CALL CLAUSE-ADD,STACK
+?CND3: ADD BEG,P-WORDLEN >BEG
+ JUMP ?PRG1
+
+
+ .FUNCT CLAUSE-ADD,WRD,PTR
+ GET P-OCLAUSE,P-MATCHLEN
+ ADD STACK,2 >PTR
+ SUB PTR,1
+ PUT P-OCLAUSE,STACK,WRD
+ PUT P-OCLAUSE,PTR,0
+ PUT P-OCLAUSE,P-MATCHLEN,PTR
+ RTRUE
+
+
+ .FUNCT PREP-FIND,PREP,CNT=0,SIZE
+ GET PREPOSITIONS,0
+ MUL STACK,2 >SIZE
+?PRG1: IGRTR? 'CNT,SIZE /FALSE
+ GET PREPOSITIONS,CNT
+ EQUAL? STACK,PREP \?PRG1
+ SUB CNT,1
+ GET PREPOSITIONS,STACK
+ RETURN STACK
+
+
+ .FUNCT SYNTAX-FOUND,SYN
+ SET 'P-SYNTAX,SYN
+ GETB SYN,P-SACTION >PRSA
+ RETURN PRSA
+
+
+ .FUNCT GWIM,GBIT,LBIT,PREP,OBJ
+ EQUAL? GBIT,RMUNGBIT \?CND1
+ RETURN ROOMS
+?CND1: SET 'P-GWIMBIT,GBIT
+ SET 'P-SLOCBITS,LBIT
+ PUT P-MERGE,P-MATCHLEN,0
+ CALL GET-OBJECT,P-MERGE,FALSE-VALUE
+ ZERO? STACK /?ELS8
+ SET 'P-GWIMBIT,0
+ GET P-MERGE,P-MATCHLEN
+ EQUAL? STACK,1 \FALSE
+ GET P-MERGE,1 >OBJ
+ PRINTI "("
+ CALL PREP-PRINT,PREP,FALSE-VALUE
+ ZERO? STACK /?CND16
+ PRINTI " "
+ CALL THE?,OBJ
+?CND16: CALL DPRINT,OBJ
+ PRINTI ")"
+ CRLF
+ RETURN OBJ
+?ELS8: SET 'P-GWIMBIT,0
+ RFALSE
+
+
+ .FUNCT SNARF-OBJECTS,PTR
+ GET P-ITBL,P-NC1 >PTR
+ ZERO? PTR /?CND1
+ GETB P-SYNTAX,P-SLOC1 >P-SLOCBITS
+ GET P-ITBL,P-NC1L
+ CALL SNARFEM,PTR,STACK,P-PRSO
+ ZERO? STACK /FALSE
+ GET P-BUTS,P-MATCHLEN
+ ZERO? STACK /?CND1
+ CALL BUT-MERGE,P-PRSO >P-PRSO
+?CND1: GET P-ITBL,P-NC2 >PTR
+ ZERO? PTR /TRUE
+ GETB P-SYNTAX,P-SLOC2 >P-SLOCBITS
+ GET P-ITBL,P-NC2L
+ CALL SNARFEM,PTR,STACK,P-PRSI
+ ZERO? STACK /FALSE
+ GET P-BUTS,P-MATCHLEN
+ ZERO? STACK /TRUE
+ GET P-PRSI,P-MATCHLEN
+ EQUAL? STACK,1 \?ELS18
+ CALL BUT-MERGE,P-PRSO >P-PRSO
+ RTRUE
+?ELS18: CALL BUT-MERGE,P-PRSI >P-PRSI
+ RTRUE
+
+
+ .FUNCT BUT-MERGE,TBL,LEN,BUTLEN,CNT=1,MATCHES=0,OBJ,NTBL
+ GET TBL,P-MATCHLEN >LEN
+ PUT P-MERGE,P-MATCHLEN,0
+?PRG1: DLESS? 'LEN,0 \?ELS5
+ JUMP ?REP2
+?ELS5: GET TBL,CNT >OBJ
+ CALL ZMEMQ,OBJ,P-BUTS
+ ZERO? STACK /?ELS7
+ JUMP ?CND3
+?ELS7: ADD MATCHES,1
+ PUT P-MERGE,STACK,OBJ
+ INC 'MATCHES
+?CND3: INC 'CNT
+ JUMP ?PRG1
+?REP2: PUT P-MERGE,P-MATCHLEN,MATCHES
+ SET 'NTBL,P-MERGE
+ SET 'P-MERGE,TBL
+ RETURN NTBL
+
+
+ .FUNCT SNARFEM,PTR,EPTR,TBL,AND=0,BUT=0,LEN,WV,WORD,NW
+ SET 'P-AND,FALSE-VALUE
+ SET 'P-GETFLAGS,0
+ SET 'P-CSPTR,PTR
+ SET 'P-CEPTR,EPTR
+ PUT P-BUTS,P-MATCHLEN,0
+ PUT TBL,P-MATCHLEN,0
+ GET PTR,0 >WORD
+?PRG1: EQUAL? PTR,EPTR \?ELS5
+ ZERO? BUT /?ORP9
+ PUSH BUT
+ JUMP ?THN6
+?ORP9: PUSH TBL
+?THN6: CALL GET-OBJECT,STACK
+ RETURN STACK
+?ELS5: GET PTR,P-LEXELEN >NW
+ EQUAL? WORD,W?ALL \?ELS14
+ SET 'P-GETFLAGS,P-ALL
+ EQUAL? NW,W?OF \?CND12
+ ADD PTR,P-WORDLEN >PTR
+ JUMP ?CND12
+?ELS14: EQUAL? WORD,W?BUT,W?EXCEPT \?ELS19
+ ZERO? BUT /?ORP25
+ PUSH BUT
+ JUMP ?THN22
+?ORP25: PUSH TBL
+?THN22: CALL GET-OBJECT,STACK
+ ZERO? STACK /FALSE
+ SET 'BUT,P-BUTS
+ PUT BUT,P-MATCHLEN,0
+ JUMP ?CND3
+?ELS19: EQUAL? WORD,W?A,W?ONE \?ELS27
+ ZERO? P-ADJ \?ELS30
+ SET 'P-GETFLAGS,P-ONE
+ EQUAL? NW,W?OF \?CND3
+ ADD PTR,P-WORDLEN >PTR
+ JUMP ?CND3
+?ELS30: SET 'P-NAM,P-ONEOBJ
+ ZERO? BUT /?ORP41
+ PUSH BUT
+ JUMP ?THN38
+?ORP41: PUSH TBL
+?THN38: CALL GET-OBJECT,STACK
+ ZERO? STACK /FALSE
+ ZERO? NW /TRUE
+ JUMP ?CND3
+?ELS27: EQUAL? WORD,W?AND,W?COMMA \?ELS45
+ EQUAL? NW,W?AND,W?COMMA /?ELS45
+ SET 'P-AND,TRUE-VALUE
+ ZERO? BUT /?ORP53
+ PUSH BUT
+ JUMP ?THN50
+?ORP53: PUSH TBL
+?THN50: CALL GET-OBJECT,STACK
+ ZERO? STACK \?CND12
+ RFALSE
+?ELS45: CALL WT?,WORD,PS?BUZZ-WORD
+ ZERO? STACK /?ELS55
+ JUMP ?CND3
+?ELS55: EQUAL? WORD,W?AND,W?COMMA \?ELS57
+ JUMP ?CND3
+?ELS57: EQUAL? WORD,W?OF \?ELS59
+ ZERO? P-GETFLAGS \?CND12
+ SET 'P-GETFLAGS,P-INHIBIT
+ JUMP ?CND12
+?ELS59: CALL WT?,WORD,PS?ADJECTIVE,P1?ADJECTIVE >WV
+ ZERO? WV /?ELS64
+ ZERO? P-ADJ \?ELS64
+ SET 'P-ADJ,WV
+ SET 'P-ADJN,WORD
+ JUMP ?CND3
+?ELS64: CALL WT?,WORD,PS?OBJECT,P1?OBJECT
+ ZERO? STACK /?CND3
+ SET 'P-NAM,WORD
+ SET 'P-ONEOBJ,WORD
+?CND12:
+?CND3: EQUAL? PTR,EPTR /?PRG1
+ ADD PTR,P-WORDLEN >PTR
+ SET 'WORD,NW
+ JUMP ?PRG1
+
+
+ .FUNCT GET-OBJECT,TBL,VRB=1,BITS,LEN,XBITS,TLEN,GCHECK=0,OLEN=0,OBJ
+ SET 'XBITS,P-SLOCBITS
+ GET TBL,P-MATCHLEN >TLEN
+ BTST P-GETFLAGS,P-INHIBIT /TRUE
+ ZERO? P-NAM \?CND4
+ ZERO? P-ADJ /?CND4
+ CALL WT?,P-ADJN,PS?OBJECT,P1?OBJECT
+ ZERO? STACK /?ELS11
+ SET 'P-NAM,P-ADJN
+ SET 'P-ADJ,FALSE-VALUE
+ JUMP ?CND4
+?ELS11: CALL WT?,P-ADJN,PS?DIRECTION,P1?DIRECTION >BITS
+ ZERO? BITS /?CND4
+ SET 'P-ADJ,FALSE-VALUE
+ PUT TBL,P-MATCHLEN,1
+ PUT TBL,1,INTDIR
+ SET 'P-WALK-DIR,BITS
+ RTRUE
+?CND4: ZERO? P-NAM \?CND14
+ ZERO? P-ADJ \?CND14
+ EQUAL? P-GETFLAGS,P-ALL /?CND14
+ ZERO? P-GWIMBIT \?CND14
+ ZERO? VRB /FALSE
+ CALL TELL-COULDNT-FIND,STR?52
+ RFALSE
+?CND14: EQUAL? P-GETFLAGS,P-ALL \?THN26
+ ZERO? P-SLOCBITS \?CND23
+?THN26: SET 'P-SLOCBITS,-1
+?CND23: SET 'P-TABLE,TBL
+?PRG28: ZERO? GCHECK /?ELS32
+ CALL GLOBAL-CHECK,TBL
+ JUMP ?CND30
+?ELS32: ZERO? LIT /?CND36
+ FCLEAR PLAYER,TRANSBIT
+ CALL DO-SL,HERE,SOG,SIR
+ FSET PLAYER,TRANSBIT
+?CND36: CALL DO-SL,PLAYER,SH,SC
+?CND30: GET TBL,P-MATCHLEN
+ SUB STACK,TLEN >LEN
+ BTST P-GETFLAGS,P-ALL \?ELS42
+ ZERO? LEN \?CND40
+ ZERO? P-NAM /?CND40
+ SET 'P-NONE,TRUE-VALUE
+ JUMP ?CND40
+?ELS42: BTST P-GETFLAGS,P-ONE \?ELS49
+ ZERO? LEN /?ELS49
+ EQUAL? LEN,1 /?CND52
+ RANDOM LEN
+ GET TBL,STACK
+ PUT TBL,1,STACK
+ PRINTI "How about the "
+ GET TBL,1
+ CALL DPRINT,STACK
+ PRINTI "?"
+ CRLF
+?CND52: PUT TBL,P-MATCHLEN,1
+ JUMP ?CND40
+?ELS49: GRTR? LEN,1 /?THN61
+ ZERO? LEN \?ELS60
+ EQUAL? P-SLOCBITS,-1 /?ELS60
+?THN61: EQUAL? P-SLOCBITS,-1 \?ELS67
+ SET 'P-SLOCBITS,XBITS
+ SET 'OLEN,LEN
+ GET TBL,P-MATCHLEN
+ SUB STACK,LEN
+ PUT TBL,P-MATCHLEN,STACK
+ JUMP ?PRG28
+?ELS67: ZERO? LEN \?CND70
+ SET 'LEN,OLEN
+?CND70: ZERO? VRB /?ELS75
+ ZERO? P-NAM /?ELS75
+ EQUAL? WINNER,PLAYER \?ELS80
+ CALL WHICH-PRINT,TLEN,LEN,TBL
+ EQUAL? TBL,P-PRSO \?ELS85
+ PUSH P-NC1
+ JUMP ?CND81
+?ELS85: PUSH P-NC2
+?CND81: SET 'P-ACLAUSE,STACK
+ SET 'P-AADJ,P-ADJ
+ SET 'P-ANAM,P-NAM
+ CALL ORPHAN,FALSE-VALUE,FALSE-VALUE
+ SET 'P-OFLAG,TRUE-VALUE
+ JUMP ?CND73
+?ELS80: CALL REQUEST-INCOMPLETE
+ PRINTI "which"
+ CALL WHICH-PRINT-NOUN,TBL
+ PRINTI " you mean, "
+ CALL WHICH-PRINT-LIST,TLEN,LEN,TBL
+ SET 'P-OFLAG,FALSE-VALUE
+ PRINTI "."
+ CRLF
+ JUMP ?CND73
+?ELS75: ZERO? VRB /?CND73
+ CALL TELL-COULDNT-FIND,STR?52
+?CND73: SET 'P-NAM,FALSE-VALUE
+ SET 'P-ADJ,FALSE-VALUE
+ RFALSE
+?ELS60: ZERO? LEN \?ELS100
+ ZERO? GCHECK /?ELS100
+ ZERO? VRB /?CND103
+ ZERO? LIT /?ELS109
+ CALL OBJ-FOUND,NOT-HERE-OBJECT,TBL
+ SET 'P-XNAM,P-NAM
+ SET 'P-XADJ,P-ADJ
+ SET 'P-XADJN,P-ADJN
+ SET 'P-NAM,FALSE-VALUE
+ SET 'P-ADJ,FALSE-VALUE
+ SET 'P-ADJN,FALSE-VALUE
+ RTRUE
+?ELS109: CALL TELL-TOO-DARK
+?CND103: SET 'P-NAM,FALSE-VALUE
+ SET 'P-ADJ,FALSE-VALUE
+ RFALSE
+?ELS100: ZERO? LEN \?CND40
+ SET 'GCHECK,TRUE-VALUE
+ JUMP ?PRG28
+?CND40: ZERO? P-ADJ /?ELS117
+ ZERO? P-NAM \?ELS117
+ SET 'P-NONOUN,TRUE-VALUE
+ JUMP ?CND115
+?ELS117: SET 'P-NONOUN,FALSE-VALUE
+?CND115: SET 'P-SLOCBITS,XBITS
+ SET 'P-NAM,FALSE-VALUE
+ SET 'P-ADJ,FALSE-VALUE
+ RTRUE
+
+
+ .FUNCT TELL-COULDNT-FIND,STR
+ PRINTI "I couldn't find "
+ PRINT STR
+ PRINTR " in that sentence."
+
+
+ .FUNCT TELL-TOO-DARK
+ PRINTR "It's too dark to see!"
+
+
+ .FUNCT MOBY-FIND,TBL,FOO,LEN
+ SET 'P-MOBY-FLAG,TRUE-VALUE
+ SET 'P-SLOCBITS,-1
+ SET 'P-TABLE,TBL
+ SET 'P-NAM,P-XNAM
+ SET 'P-ADJ,P-XADJ
+ SET 'P-MOBY-FOUND,FALSE-VALUE
+ PUT TBL,P-MATCHLEN,0
+ FIRST? ROOMS >FOO /?KLU17
+?KLU17:
+?PRG1: ZERO? FOO \?ELS5
+ JUMP ?REP2
+?ELS5: CALL SEARCH-LIST,FOO,TBL,P-SRCALL
+ NEXT? FOO >FOO /?KLU18
+?KLU18: JUMP ?PRG1
+?REP2: GET TBL,P-MATCHLEN >LEN
+ ZERO? LEN \?CND8
+ CALL DO-SL,LOCAL-GLOBALS,1,1
+?CND8: GET TBL,P-MATCHLEN >LEN
+ ZERO? LEN \?CND11
+ CALL SEARCH-LIST,GLOBAL-FERRY,TBL,P-SRCTOP
+?CND11: GET TBL,P-MATCHLEN >LEN
+ EQUAL? LEN,1 \?CND14
+ GET TBL,1 >P-MOBY-FOUND
+?CND14: SET 'P-MOBY-FLAG,FALSE-VALUE
+ RETURN LEN
+
+
+ .FUNCT WHICH-PRINT,TLEN,LEN,TBL
+ PRINTI "Which"
+ CALL WHICH-PRINT-NOUN,TBL
+ PRINTI " do you mean, "
+ CALL WHICH-PRINT-LIST,TLEN,LEN,TBL
+ PRINTR "?"
+
+
+ .FUNCT WHICH-PRINT-NOUN,TBL
+ ZERO? P-OFLAG \?THN6
+ ZERO? P-MERGED \?THN6
+ ZERO? P-AND /?ELS5
+?THN6: PRINTI " "
+ EQUAL? P-NAM,W?INTNUM \?ELS14
+ CALL DPRINT,INTNUM
+ RSTACK
+?ELS14: PRINTB P-NAM
+ RTRUE
+?ELS5: EQUAL? TBL,P-PRSO \?ELS20
+ CALL CLAUSE-PRINT,P-NC1,P-NC1L,FALSE-VALUE
+ RSTACK
+?ELS20: CALL CLAUSE-PRINT,P-NC2,P-NC2L,FALSE-VALUE
+ RSTACK
+
+
+ .FUNCT WHICH-PRINT-LIST,TLEN,LEN,TBL,OBJ,RLEN
+ SET 'RLEN,LEN
+?PRG1: INC 'TLEN
+ GET TBL,TLEN >OBJ
+ CALL THE?,OBJ
+ CALL DPRINT,OBJ
+ EQUAL? LEN,2 \?ELS7
+ EQUAL? RLEN,2 /?CND8
+ PRINTI ", "
+?CND8: PRINTI " or "
+ JUMP ?CND5
+?ELS7: GRTR? LEN,2 \?CND5
+ PRINTI ", "
+?CND5: DLESS? 'LEN,1 \?PRG1
+ RTRUE
+
+
+ .FUNCT GLOBAL-CHECK,TBL,LEN,RMG,RMGL,CNT=0,OBJ,OBITS
+ GET TBL,P-MATCHLEN >LEN
+ SET 'OBITS,P-SLOCBITS
+ GETPT HERE,P?GLOBAL >RMG
+ ZERO? RMG /?CND1
+ PTSIZE RMG
+ SUB STACK,1 >RMGL
+?PRG4: GETB RMG,CNT >OBJ
+ CALL THIS-IT?,OBJ,TBL
+ ZERO? STACK /?CND6
+ CALL OBJ-FOUND,OBJ,TBL
+?CND6: FSET? OBJ,CONTBIT /?THN16
+ FSET? OBJ,SURFACEBIT \?THN16
+?THN16: FSET? OBJ,OPENBIT /?THN12
+ FSET? OBJ,TRANSBIT \?CND9
+?THN12: CALL SEARCH-LIST,OBJ,TBL,P-SRCTOP
+?CND9: IGRTR? 'CNT,RMGL \?PRG4
+?CND1: GETPT HERE,P?PSEUDO >RMG
+ ZERO? RMG /?CND21
+ PTSIZE RMG
+ DIV STACK,4
+ SUB STACK,1 >RMGL
+ SET 'CNT,0
+?PRG24: MUL CNT,2
+ GET RMG,STACK
+ EQUAL? P-NAM,STACK \?ELS28
+ MUL CNT,2
+ ADD STACK,1
+ GET RMG,STACK
+ PUTP PSEUDO-OBJECT,P?ACTION,STACK
+ PUTP PSEUDO-OBJECT,P?DESCFCN,HERE
+ GETP PSEUDO-OBJECT,P?ACTION
+ CALL STACK,M-NAME
+ CALL OBJ-FOUND,PSEUDO-OBJECT,TBL
+ JUMP ?CND21
+?ELS28: IGRTR? 'CNT,RMGL \?PRG24
+?CND21: GET TBL,P-MATCHLEN
+ EQUAL? STACK,LEN \FALSE
+ SET 'P-SLOCBITS,-1
+ SET 'P-TABLE,TBL
+ CALL DO-SL,GLOBAL-OBJECTS,1,1
+ SET 'P-SLOCBITS,OBITS
+ RETURN P-SLOCBITS
+
+
+ .FUNCT DO-SL,OBJ,BIT1,BIT2,BITS
+ ADD BIT1,BIT2
+ BTST P-SLOCBITS,STACK \?ELS5
+ CALL SEARCH-LIST,OBJ,P-TABLE,P-SRCALL
+ RSTACK
+?ELS5: BTST P-SLOCBITS,BIT1 \?ELS12
+ CALL SEARCH-LIST,OBJ,P-TABLE,P-SRCTOP
+ RSTACK
+?ELS12: BTST P-SLOCBITS,BIT2 \TRUE
+ CALL SEARCH-LIST,OBJ,P-TABLE,P-SRCBOT
+ RSTACK
+
+
+ .FUNCT SEARCH-LIST,OBJ,TBL,LVL,FLS,NOBJ
+ FIRST? OBJ >OBJ \FALSE
+?PRG6: EQUAL? LVL,P-SRCBOT /?CND8
+ GETPT OBJ,P?SYNONYM
+ ZERO? STACK /?CND8
+ CALL THIS-IT?,OBJ,TBL
+ ZERO? STACK /?CND8
+ CALL OBJ-FOUND,OBJ,TBL
+?CND8: EQUAL? LVL,P-SRCTOP \?THN18
+ FSET? OBJ,SEARCHBIT /?THN18
+ FSET? OBJ,SURFACEBIT \?CND13
+?THN18: FIRST? OBJ >NOBJ \?CND13
+ FSET? OBJ,OPENBIT /?THN20
+ FSET? OBJ,TRANSBIT /?THN20
+ ZERO? P-MOBY-FLAG \?THN20
+ FSET? OBJ,PERSON \?CND13
+ EQUAL? OBJ,PLAYER /?CND13
+?THN20: FSET? OBJ,SURFACEBIT \?ELS28
+ PUSH P-SRCALL
+ JUMP ?CND24
+?ELS28: FSET? OBJ,SEARCHBIT \?ELS30
+ PUSH P-SRCALL
+ JUMP ?CND24
+?ELS30: PUSH P-SRCTOP
+?CND24: CALL SEARCH-LIST,OBJ,TBL,STACK >FLS
+?CND13: NEXT? OBJ >OBJ /?PRG6
+ RTRUE
+
+
+ .FUNCT THIS-IT?,OBJ,TBL,SYNS,?TMP1
+ FSET? OBJ,INVISIBLE /FALSE
+ ZERO? P-NAM /?ELS5
+ GETPT OBJ,P?SYNONYM >SYNS
+ PTSIZE SYNS
+ DIV STACK,2
+ SUB STACK,1
+ CALL ZMEMQ,P-NAM,SYNS,STACK
+ ZERO? STACK /FALSE
+?ELS5: ZERO? P-ADJ /?ELS9
+ GETPT OBJ,P?ADJECTIVE >SYNS
+ ZERO? SYNS /FALSE
+ PTSIZE SYNS
+ SUB STACK,1
+ CALL ZMEMQB,P-ADJ,SYNS,STACK
+ ZERO? STACK /FALSE
+?ELS9: ZERO? P-GWIMBIT /TRUE
+ FSET? OBJ,P-GWIMBIT /TRUE
+ RFALSE
+
+
+ .FUNCT OBJ-FOUND,OBJ,TBL,PTR
+ GET TBL,P-MATCHLEN >PTR
+ ADD PTR,1
+ PUT TBL,STACK,OBJ
+ ADD PTR,1
+ PUT TBL,P-MATCHLEN,STACK
+ RTRUE
+
+
+ .FUNCT TAKE-CHECK
+ GETB P-SYNTAX,P-SLOC1
+ CALL ITAKE-CHECK,P-PRSO,STACK
+ ZERO? STACK /FALSE
+ GETB P-SYNTAX,P-SLOC2
+ CALL ITAKE-CHECK,P-PRSI,STACK
+ RSTACK
+
+
+ .FUNCT ITAKE-CHECK,TBL,BITS,PTR,OBJ,TAKEN
+ GET TBL,P-MATCHLEN >PTR
+ ZERO? PTR /TRUE
+ BTST BITS,SHAVE /?THN8
+ BTST BITS,STAKE \TRUE
+?THN8:
+?PRG10: DLESS? 'PTR,0 /TRUE
+ ADD PTR,1
+ GET TBL,STACK >OBJ
+ EQUAL? OBJ,IT \?CND17
+ SET 'OBJ,P-IT-OBJECT
+?CND17: CALL HELD?,OBJ
+ ZERO? STACK \?PRG10
+ SET 'PRSO,OBJ
+ FSET? OBJ,TRYTAKEBIT \?ELS25
+ SET 'TAKEN,TRUE-VALUE
+ JUMP ?CND23
+?ELS25: EQUAL? WINNER,PLAYER /?ELS27
+ SET 'TAKEN,FALSE-VALUE
+ JUMP ?CND23
+?ELS27: BTST BITS,STAKE \?ELS29
+ CALL ITAKE,FALSE-VALUE
+ EQUAL? STACK,TRUE-VALUE \?ELS29
+ SET 'TAKEN,FALSE-VALUE
+ JUMP ?CND23
+?ELS29: SET 'TAKEN,TRUE-VALUE
+?CND23: ZERO? TAKEN /?ELS36
+ BTST BITS,SHAVE \?ELS36
+ EQUAL? OBJ,GLOBAL-MONEY,RIDICULOUS-MONEY-KLUDGE /?THN42
+ EQUAL? OBJ,INTNUM \?ELS45
+ ZERO? P-DOLLAR-FLAG \?THN42
+?ELS45: EQUAL? OBJ,IT \?ELS41
+ EQUAL? P-IT-OBJECT,RIDICULOUS-MONEY-KLUDGE,INTNUM,GLOBAL-MONEY \?ELS41
+?THN42: CALL TELL-YOU-CANT,STR?53
+ RFALSE
+?ELS41: CALL TELL-DONT-HAVE,FALSE-VALUE
+ EQUAL? OBJ,NOT-HERE-OBJECT \?ELS52
+ PRINTI "that."
+ CRLF
+ RFALSE
+?ELS52: CALL THE?,OBJ
+ CALL DPRINT,OBJ
+ PRINTI "."
+ CRLF
+ RFALSE
+?ELS36: ZERO? TAKEN \?PRG10
+ EQUAL? WINNER,PLAYER \?PRG10
+ PRINTI "(taking "
+ GET P-PRSI,P-MATCHLEN
+ GRTR? STACK,0 /?THN68
+ GET TBL,P-MATCHLEN
+ GRTR? STACK,1 \?ELS67
+?THN68: CALL THE?,OBJ
+ CALL DPRINT,OBJ
+ JUMP ?CND65
+?ELS67: PRINTI "it"
+?CND65: PRINTI " first)"
+ CRLF
+ JUMP ?PRG10
+
+
+ .FUNCT MANY-CHECK,LOSS=0,TMP,?TMP1
+ GET P-PRSO,P-MATCHLEN
+ GRTR? STACK,1 \?ELS3
+ GETB P-SYNTAX,P-SLOC1
+ BTST STACK,SMANY /?ELS3
+ SET 'LOSS,1
+ JUMP ?CND1
+?ELS3: GET P-PRSI,P-MATCHLEN
+ GRTR? STACK,1 \?CND1
+ GETB P-SYNTAX,P-SLOC2
+ BTST STACK,SMANY /?CND1
+ SET 'LOSS,2
+?CND1: ZERO? LOSS /TRUE
+ CALL TELL-YOU-CANT,STR?54,FALSE-VALUE
+ EQUAL? LOSS,2 \?CND16
+ PRINTI "in"
+?CND16: PRINTI "direct objects with """
+ GET P-ITBL,P-VERBN >TMP
+ ZERO? TMP \?ELS25
+ PRINTI "tell"
+ JUMP ?CND23
+?ELS25: ZERO? P-OFLAG \?THN30
+ ZERO? P-MERGED /?ELS29
+?THN30: GET TMP,0
+ PRINTB STACK
+ JUMP ?CND23
+?ELS29: GETB TMP,2 >?TMP1
+ GETB TMP,3
+ CALL WORD-PRINT,?TMP1,STACK
+?CND23: PRINTI """."
+ CRLF
+ RFALSE
+
+
+ .FUNCT ZMEMQ,ITM,TBL,SIZE=-1,CNT=1
+ ZERO? TBL /FALSE
+ LESS? SIZE,0 /?ELS6
+ SET 'CNT,0
+ JUMP ?CND4
+?ELS6: GET TBL,0 >SIZE
+?CND4:
+?PRG9: GET TBL,CNT
+ EQUAL? ITM,STACK /TRUE
+ IGRTR? 'CNT,SIZE \?PRG9
+ RFALSE
+
+
+ .FUNCT ZMEMQB,ITM,TBL,SIZE,CNT=0
+?PRG1: GETB TBL,CNT
+ EQUAL? ITM,STACK /TRUE
+ IGRTR? 'CNT,SIZE \?PRG1
+ RFALSE
+
+
+ .FUNCT LIT?,RM,OHERE,LIT=0
+ SET 'P-GWIMBIT,ONBIT
+ SET 'OHERE,HERE
+ SET 'HERE,RM
+ FSET? RM,ONBIT \?ELS3
+ SET 'LIT,TRUE-VALUE
+ JUMP ?CND1
+?ELS3: PUT P-MERGE,P-MATCHLEN,0
+ SET 'P-TABLE,P-MERGE
+ SET 'P-SLOCBITS,-1
+ EQUAL? OHERE,RM \?CND6
+ CALL DO-SL,WINNER,1,1
+?CND6: CALL DO-SL,RM,1,1
+ GET P-TABLE,P-MATCHLEN
+ GRTR? STACK,0 \?CND1
+ SET 'LIT,TRUE-VALUE
+?CND1: SET 'HERE,OHERE
+ SET 'P-GWIMBIT,0
+ RETURN LIT
+
+
+ .FUNCT VPRINT,TMP,?TMP1
+ GET P-OTBL,P-VERBN >TMP
+ ZERO? TMP \?ELS5
+ PRINTI "say"
+ RTRUE
+?ELS5: GETB P-VTBL,2
+ ZERO? STACK \?ELS9
+ GET TMP,0
+ PRINTB STACK
+ RTRUE
+?ELS9: GETB TMP,2 >?TMP1
+ GETB TMP,3
+ CALL WORD-PRINT,?TMP1,STACK
+ RSTACK
+
+
+ .FUNCT PRSO-PRINT,PTR
+ GET P-PRSO,P-MATCHLEN
+ GRTR? STACK,1 /?THN6
+ ZERO? P-MERGED \?THN6
+ GET P-ITBL,P-NC1 >PTR
+ GET PTR,0
+ EQUAL? STACK,W?IT \?ELS5
+?THN6: PRINTI " "
+ CALL DPRINT,PRSO
+ RSTACK
+?ELS5: GET P-ITBL,P-NC1L
+ CALL BUFFER-PRINT,PTR,STACK,FALSE-VALUE
+ RSTACK
+
+
+ .FUNCT PRSI-PRINT,PTR
+ GET P-PRSI,P-MATCHLEN
+ GRTR? STACK,1 /?THN6
+ ZERO? P-MERGED \?THN6
+ GET P-ITBL,P-NC2 >PTR
+ GET PTR,0
+ EQUAL? STACK,W?IT \?ELS5
+?THN6: PRINTI " "
+ CALL DPRINT,PRSI
+ RSTACK
+?ELS5: GET P-ITBL,P-NC2L
+ CALL BUFFER-PRINT,PTR,STACK,FALSE-VALUE
+ RSTACK
+
+
+ .FUNCT THE?,OBJ
+ EQUAL? OBJ,NOT-HERE-OBJECT \?ELS5
+ PRINTI "any "
+ RTRUE
+?ELS5: FSET? OBJ,PERSON /FALSE
+ EQUAL? OBJ,PETES-PATCH /FALSE
+ PRINTI "the "
+ RTRUE
+
+
+ .FUNCT START-SENTENCE,OBJ
+ EQUAL? OBJ,WEASEL \?ELS5
+ PRINTI "The Weasel"
+ RTRUE
+?ELS5: FSET? OBJ,PERSON /?THN10
+ EQUAL? OBJ,PETES-PATCH \?ELS9
+?THN10: CALL DPRINT,OBJ
+ RSTACK
+?ELS9: PRINTI "The "
+ CALL DPRINT,OBJ
+ RSTACK
+
+
+ .FUNCT TELL-DONT-HAVE,STR
+ PRINTI "You don't have "
+ ZERO? STR /FALSE
+ PRINT STR
+ PRINTR "."
+
+
+ .FUNCT TELL-NO-KEY
+ CALL TELL-DONT-HAVE,STR?55
+ RSTACK
+
+ .ENDI
diff --git a/parser.zil b/parser.zil
new file mode 100644
index 0000000..16f16ca
--- /dev/null
+++ b/parser.zil
@@ -0,0 +1,1494 @@
+"PARSER for TOA2
+Copyright (C) 1984 Infocom, Inc. All rights reserved."
+
+;"
+4/27/83 - SYNTAX-CHECK doesn't catch too-many-noun-clauses (MARC)
+3/28/83 - GWIM prints XDESC, if any, for PERSON not yet touched. (SWG)
+3/25/83 - Two additions to fix 'ACTOR, <non-verb>' doing the wrong
+ thing. Example: 'PHONG, WHY WERE YOU ...' (MARC)
+3/16/83 - LINDER, HELP bug in which HELP was both noun and verb. (MARC)
+"
+
+"Parser global variable convention: All parser globals will
+ begin with 'P-'. Local variables are not restricted in any
+ way.
+"
+
+<SETG SIBREAKS ".,\"!?">
+
+;<GLOBAL ALWAYS-LIT <>> ;"was ORed in LIT? with <FSET? ,HERE ,ONBIT>"
+
+;<GLOBAL GWIM-DISABLE <>>
+
+<GLOBAL PRSA 0>
+
+<GLOBAL PRSI 0>
+
+<GLOBAL PRSO 0>
+
+<GLOBAL P-TABLE 0>
+
+<GLOBAL P-ONEOBJ 0>
+
+<GLOBAL P-SYNTAX 0>
+
+<GLOBAL P-CCSRC 0>
+
+<GLOBAL P-LEN 0>
+
+<GLOBAL P-DIR 0>
+
+<GLOBAL HERE 0>
+
+<GLOBAL WINNER 0>
+
+<GLOBAL P-WALK-DIR 0>
+
+<GLOBAL P-LEXV <ITABLE BYTE 120>>
+;"INBUF - Input buffer for READ"
+
+<GLOBAL P-INBUF <ITABLE BYTE 100>>
+;"Parse-cont variable"
+
+<GLOBAL P-CONT <>>
+
+<GLOBAL P-IT-OBJECT <>>
+;<GLOBAL P-IT-LOC <>>
+
+;<GLOBAL P-HIM-HER <>>
+;<GLOBAL P-HIM-HER-LOC <>>
+;<ROUTINE THIS-IS-S-HE (PERSON)
+ <SETG P-HIM-HER .PERSON>
+ <SETG P-HIM-HER-LOC <LOC .PERSON>>>
+
+;"Orphan flag"
+
+<GLOBAL P-OFLAG <>>
+
+<GLOBAL P-MERGED <>>
+
+<GLOBAL P-ACLAUSE <>>
+
+<GLOBAL P-ANAM <>>
+
+<GLOBAL P-AADJ <>>
+;"Parser variables and temporaries"
+
+<CONSTANT P-PHRLEN 3>
+
+<CONSTANT P-ORPHLEN 7>
+
+<CONSTANT P-RTLEN 3>
+;"Byte offset to # of entries in LEXV"
+
+<CONSTANT P-LEXWORDS 1>
+;"Word offset to start of LEXV entries"
+
+<CONSTANT P-LEXSTART 1>
+;"Number of words per LEXV entry"
+
+<CONSTANT P-LEXELEN 2>
+
+<CONSTANT P-WORDLEN 4>
+;"Offset to parts of speech byte"
+
+<CONSTANT P-PSOFF 4>
+;"Offset to first part of speech"
+
+<CONSTANT P-P1OFF 5>
+;"First part of speech bit mask in PSOFF byte"
+
+<CONSTANT P-P1BITS 3>
+
+<CONSTANT P-ITBLLEN 9>
+
+<GLOBAL P-ITBL <TABLE 0 0 0 0 0 0 0 0 0 0>>
+
+<GLOBAL P-OTBL <TABLE 0 0 0 0 0 0 0 0 0 0>>
+
+<GLOBAL P-VTBL <TABLE 0 0 0 0>>
+
+<GLOBAL P-NCN 0>
+
+<CONSTANT P-VERB 0>
+
+<CONSTANT P-VERBN 1>
+
+<CONSTANT P-PREP1 2>
+
+<CONSTANT P-PREP1N 3>
+
+<CONSTANT P-PREP2 4>
+
+<CONSTANT P-PREP2N 5>
+
+<CONSTANT P-NC1 6>
+
+<CONSTANT P-NC1L 7>
+
+<CONSTANT P-NC2 8>
+
+<CONSTANT P-NC2L 9>
+
+<GLOBAL QUOTE-FLAG <>>
+
+<GLOBAL P-NONE <>>
+
+<GLOBAL P-ADVERB <>>
+
+" Grovel down the input finding the verb, prepositions, and noun clauses.
+ If the input is <direction> or <walk> <direction>, fall out immediately
+ setting PRSA to ,V?WALK and PRSO to <direction>. Otherwise, perform
+ all required orphaning, syntax checking, and noun clause lookup."
+
+
+
+;<GLOBAL X-IS-LISTENING <>>
+<ROUTINE PARSER ("AUX" (PTR ,P-LEXSTART) WORD (VAL 0) (VERB <>)
+ LEN (DIR <>) (NW 0) (LW 0) NUM SCNT (CNT -1))
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> ,P-ITBLLEN> <RETURN>)
+ (T <PUT ,P-ITBL .CNT 0>)>>
+ <SETG P-NAM <>>
+ <SETG P-ADJ <>>
+ <SETG P-ADVERB <>>
+ <SETG P-MERGED <>>
+ <SETG P-NONE <>>
+ <PUT ,P-PRSO ,P-MATCHLEN 0>
+ <PUT ,P-PRSI ,P-MATCHLEN 0>
+ <PUT ,P-BUTS ,P-MATCHLEN 0>
+ <COND (<AND <NOT ,QUOTE-FLAG> <N==? ,WINNER ,PLAYER>>
+ <SETG WINNER ,PLAYER>
+ <COND (<NOT <FSET? <LOC ,WINNER> ,VEHBIT>>
+ <SETG HERE <LOC ,WINNER>>)>)>
+ ;<COND (<NOT ,P-OFLAG>
+ <SETG P-DOLLAR-FLAG <>>)>
+ <COND (,P-CONT
+ <SET PTR ,P-CONT>
+ <SETG P-CONT <>>
+ <COND (<NOT <==? ,L-PRSA ,V?TELL>> <CRLF>)>)
+ (T
+ <SETG WINNER ,PLAYER>
+ <SETG QUOTE-FLAG <>>
+ <COND (<NOT <FSET? <LOC ,WINNER> ,VEHBIT>>
+ <SETG HERE <LOC ,WINNER>>)>
+ <PUTB ,P-LEXV 0 59>
+ <COND (<NOT ,SUPER-BRIEF> <CRLF>)>
+ <TELL ">">
+ <READ ,P-INBUF ,P-LEXV>)>
+ <SETG P-LEN <GETB ,P-LEXV ,P-LEXWORDS>>
+ <COND (<0? ,P-LEN> <TELL "What?" CR> <RFALSE>)
+ (<OR <EQUAL? <SET WORD<GET ,P-LEXV .PTR>> ,W?WHY ,W?HOW ,W?WHEN>
+ <EQUAL? .WORD ,W?IS ,W?DID ,W?ARE>>
+ <TELL
+"Sorry, but this program can't handle questions like that.
+You should stick to questions like \"WHAT IS ...\" and \"WHERE IS ....\"
+Maybe you'd like to reread the manual."
+;"(Have you forgotten how to interrogate people in this story? You should
+review pages 2-3 of your manual again. Remember that the
+documents in the package contain the answers to all of the
+important questions that you can't ask directly.)" CR>
+ <RFALSE>)>
+ <SET LEN ,P-LEN>
+ <SETG P-DIR <>>
+ <SETG P-NCN 0>
+ <SETG P-GETFLAGS 0>
+ ;"3/25/83: Next statement added."
+ <PUT ,P-ITBL ,P-VERBN 0>
+ <REPEAT ()
+ <COND (<L? <SETG P-LEN <- ,P-LEN 1>> 0>
+ <SETG QUOTE-FLAG <>>
+ <RETURN>)
+ (<OR <SET WORD <GET ,P-LEXV .PTR>>
+ <SET WORD <NUMBER? .PTR>>>
+ <COND (<AND <==? .WORD ,W?TO>
+ <EQUAL? .VERB ,ACT?TELL ,ACT?ASK>>
+ <SET WORD ,W?QUOTE>)
+ (<AND <==? .WORD ,W?THEN>
+ <NOT .VERB>>
+ <PUT ,P-ITBL ,P-VERB ,ACT?TELL>
+ <PUT ,P-ITBL ,P-VERBN 0>
+ <SET WORD ,W?QUOTE>)>
+ <COND (<AND <EQUAL? .WORD ,W?PERIOD>
+ <EQUAL? .LW ;,W?MRS ,W?MR ;,W?MS>>
+ <SET LW 0>)
+ (<EQUAL? .WORD ,W?THEN ,W?PERIOD ,W?QUOTE>
+ <COND (<EQUAL? .WORD ,W?QUOTE>
+ <COND (,QUOTE-FLAG
+ <SETG QUOTE-FLAG <>>)
+ (T <SETG QUOTE-FLAG T>)>)>
+ <OR <0? ,P-LEN>
+ <SETG P-CONT <+ .PTR ,P-LEXELEN>>>
+ <PUTB ,P-LEXV ,P-LEXWORDS ,P-LEN>
+ <RETURN>)
+ (<AND <SET VAL
+ <WT? .WORD
+ ,PS?DIRECTION
+ ,P1?DIRECTION>>
+ <EQUAL? .VERB <> ,ACT?WALK>
+ <OR <==? .LEN 1>
+ <AND <==? .LEN 2>
+ <==? .VERB ,ACT?WALK>>
+ <AND <EQUAL? <SET NW
+ <GET ,P-LEXV
+ <+ .PTR ,P-LEXELEN>>>
+ ,W?THEN
+ ,W?QUOTE>
+ <G? .LEN 2>>
+ <AND <EQUAL? .NW ,W?PERIOD>
+ <G? .LEN 1>> ;"P-LEN?"
+ <AND ,QUOTE-FLAG
+ <==? .LEN 2>
+ <EQUAL? .NW ,W?QUOTE>>
+ <AND <G? .LEN 2>
+ <EQUAL? .NW ,W?COMMA ,W?AND>>>>
+ <SET DIR .VAL>
+ <COND (<EQUAL? .NW ,W?COMMA ,W?AND>
+ <PUT ,P-LEXV
+ <+ .PTR ,P-LEXELEN>
+ ,W?THEN>)>
+ <COND (<NOT <G? .LEN 2>>
+ <SETG QUOTE-FLAG <>>
+ <RETURN>)>)
+ (<AND <SET VAL <WT? .WORD ,PS?VERB ,P1?VERB>>
+ <OR <NOT .VERB>
+ ;<EQUAL? .VERB ,ACT?WHAT>>>
+ <SET VERB .VAL>
+ <PUT ,P-ITBL ,P-VERB .VAL>
+ <PUT ,P-ITBL ,P-VERBN ,P-VTBL>
+ <PUT ,P-VTBL 0 .WORD>
+ <PUTB ,P-VTBL 2 <GETB ,P-LEXV
+ <SET NUM
+ <+ <* .PTR 2> 2>>>>
+ <PUTB ,P-VTBL 3 <GETB ,P-LEXV <+ .NUM 1>>>)
+ (<OR <SET VAL <WT? .WORD ,PS?PREPOSITION 0>>
+ <AND <OR <EQUAL? .WORD ,W?ALL ,W?ONE ,W?A>
+ <WT? .WORD ,PS?ADJECTIVE>
+ <WT? .WORD ,PS?OBJECT>>
+ <SET VAL 0>>>
+ <COND (<AND <G? ,P-LEN 0>
+ <==? <GET ,P-LEXV
+ <+ .PTR ,P-LEXELEN>>
+ ,W?OF>
+ <NOT <EQUAL? .VERB
+ ;,ACT?ACCUSE
+ ,ACT?MAKE>>
+ <0? .VAL>
+ <NOT <EQUAL? .WORD
+ ,W?ALL ,W?ONE ,W?A>>>)
+ (<AND <NOT <0? .VAL>>
+ <OR <0? ,P-LEN>
+ <EQUAL? <GET ,P-LEXV <+ .PTR 2>>
+ ,W?THEN ,W?PERIOD>>>
+ <COND (<L? ,P-NCN 2>
+ <PUT ,P-ITBL ,P-PREP1 .VAL>
+ <PUT ,P-ITBL ,P-PREP1N .WORD>)>)
+ (<==? ,P-NCN 2>
+ <TELL
+"I found more than two nouns in that sentence!" CR>
+ <RFALSE>)
+ (T
+ <SETG P-NCN <+ ,P-NCN 1>>
+ <OR <SET PTR <CLAUSE .PTR .VAL .WORD>>
+ <RFALSE>>
+ <COND (<L? .PTR 0>
+ <SETG QUOTE-FLAG <>>
+ <RETURN>)>)>)
+ ;(<==? .WORD ,W?CLOSELY>
+ <SETG P-ADVERB ,W?CAREFULLY>)
+ (<OR <EQUAL? .WORD
+ ;,W?CAREFULLY ,W?QUIETLY>
+ <EQUAL? .WORD
+ ,W?SLOWLY ,W?QUICKLY ,W?BRIEFLY>>
+ <SETG P-ADVERB .WORD>)
+ (<WT? .WORD ,PS?BUZZ-WORD>)
+ (T
+ <CANT-USE .PTR>
+ <RFALSE>)>)
+ (T
+ <UNKNOWN-WORD .PTR>
+ <RFALSE>)>
+ <SET LW .WORD>
+ <SET PTR <+ .PTR ,P-LEXELEN>>>
+ <COND (.DIR
+ <SETG PRSA ,V?WALK>
+ <SETG PRSO .DIR>
+ <SETG P-WALK-DIR .DIR>
+ <RETURN T>)>
+ <COND (,P-OFLAG <ORPHAN-MERGE>)>
+ <COND (<==? <GET ,P-ITBL ,P-VERB> 0>
+ <PUT ,P-ITBL ,P-VERB ,ACT?$CALL>)>
+ <COND (<AND <SYNTAX-CHECK> <SNARF-OBJECTS> <MANY-CHECK> <TAKE-CHECK>>
+ T)>>
+;"Check whether word pointed at by PTR is the correct part of speech.
+ The second argument is the part of speech (,PS?<part of speech>). The
+ 3rd argument (,P1?<part of speech>), if given, causes the value
+ for that part of speech to be returned."
+
+<ROUTINE WT? (PTR BIT "OPTIONAL" (B1 5) "AUX" (OFFSET ,P-P1OFF) TYP)
+ <COND (<BTST <SET TYP <GETB .PTR ,P-PSOFF>> .BIT>
+ <COND (<G? .B1 4> <RTRUE>)
+ (T
+ <SET TYP <BAND .TYP ,P-P1BITS>>
+ <COND (<NOT <==? .TYP .B1>> <SET OFFSET <+ .OFFSET 1>>)>
+ <GETB .PTR .OFFSET>)>)>>
+;" Scan through a noun clause, leave a pointer to its starting location"
+
+<ROUTINE CLAUSE (PTR VAL WORD "AUX" OFF NUM (ANDFLG <>) (FIRST?? T) NW (LW 0))
+ #DECL ((PTR VAL OFF NUM) FIX (WORD NW) <OR FALSE FIX TABLE>
+ (ANDFLG FIRST??) <OR ATOM FALSE>)
+ <SET OFF <* <- ,P-NCN 1> 2>>
+ <COND (<NOT <==? .VAL 0>>
+ <PUT ,P-ITBL <SET NUM <+ ,P-PREP1 .OFF>> .VAL>
+ <PUT ,P-ITBL <+ .NUM 1> .WORD>
+ <SET PTR <+ .PTR ,P-LEXELEN>>)
+ (T <SETG P-LEN <+ ,P-LEN 1>>)>
+ <COND (<0? ,P-LEN> <SETG P-NCN <- ,P-NCN 1>> <RETURN -1>)>
+ <PUT ,P-ITBL <SET NUM <+ ,P-NC1 .OFF>> <REST ,P-LEXV <* .PTR 2>>>
+ <COND (<EQUAL? <GET ,P-LEXV .PTR> ,W?THE ,W?A ,W?AN>
+ <PUT ,P-ITBL .NUM <REST <GET ,P-ITBL .NUM> 4>>)>
+ <REPEAT ()
+ <COND (<L? <SETG P-LEN <- ,P-LEN 1>> 0>
+ <PUT ,P-ITBL <+ .NUM 1> <REST ,P-LEXV <* .PTR 2>>>
+ <RETURN -1>)>
+ <COND (<OR <SET WORD <GET ,P-LEXV .PTR>>
+ <SET WORD <NUMBER? .PTR>>>
+ <COND (<0? ,P-LEN> <SET NW 0>)
+ (T <SET NW <GET ,P-LEXV <+ .PTR ,P-LEXELEN>>>)>
+ <COND (<AND <==? .WORD ,W?OF>
+ <EQUAL? <GET ,P-ITBL ,P-VERB>
+ ;,ACT?ACCUSE ,ACT?MAKE>>
+ <PUT ,P-LEXV .PTR ,W?WITH>
+ <SET WORD ,W?WITH>)>
+ <COND (<AND <EQUAL? .WORD ,W?PERIOD>
+ <EQUAL? .LW ;,W?MRS ,W?MR ;,W?MS>>
+ <SET LW 0>)
+ (<EQUAL? .WORD ,W?AND ,W?COMMA> <SET ANDFLG T>)
+ (<EQUAL? .WORD ,W?ALL ,W?ONE>
+ <COND (<==? .NW ,W?OF>
+ <SETG P-LEN <- ,P-LEN 1>>
+ <SET PTR <+ .PTR ,P-LEXELEN>>)>)
+ (<OR <EQUAL? .WORD ,W?THEN ,W?PERIOD>
+ <AND <WT? .WORD ,PS?PREPOSITION>
+ <NOT .FIRST??>>>
+ <SETG P-LEN <+ ,P-LEN 1>>
+ <PUT ,P-ITBL
+ <+ .NUM 1>
+ <REST ,P-LEXV <* .PTR 2>>>
+ <RETURN <- .PTR ,P-LEXELEN>>)
+ ;"3/16/83: This clause used to be later."
+ (<AND .ANDFLG
+ <OR ;"3/25/83: next statement added."
+ <EQUAL? <GET ,P-ITBL ,P-VERBN> 0>
+ <WT? .WORD ,PS?DIRECTION>
+ <WT? .WORD ,PS?VERB>>>
+ <SET PTR <- .PTR 4>>
+ <PUT ,P-LEXV <+ .PTR 2> ,W?THEN>
+ <SETG P-LEN <+ ,P-LEN 2>>)
+ (<WT? .WORD ,PS?OBJECT>
+ <COND ;"First clause added 1/10/84 to fix
+ 'verb AT synonym OF synonym' bug"
+ (<AND <G? ,P-LEN 0>
+ <EQUAL? .NW ,W?OF>
+ <NOT <EQUAL? .WORD ,W?ALL ,W?ONE>>>
+ T)
+ (<AND <WT? .WORD
+ ,PS?ADJECTIVE
+ ,P1?ADJECTIVE>
+ <NOT <==? .NW 0>>
+ <WT? .NW ,PS?OBJECT>>)
+ (<AND <NOT .ANDFLG>
+ <NOT <EQUAL? .NW ,W?BUT ,W?EXCEPT>>
+ <NOT <EQUAL? .NW ,W?AND ,W?COMMA>>>
+ <PUT ,P-ITBL
+ <+ .NUM 1>
+ <REST ,P-LEXV <* <+ .PTR 2> 2>>>
+ <RETURN .PTR>)
+ (T <SET ANDFLG <>>)>)
+ (<WT? .WORD ,PS?ADJECTIVE>
+ <COND ;(<WT? .WORD ,PS?DIRECTION>
+ <SETG P-LEN <+ ,P-LEN 1>>
+ <PUT ,P-ITBL
+ <+ .NUM 1>
+ <REST ,P-LEXV <* .PTR 2>>>
+ <RETURN <- .PTR ,P-LEXELEN>>)
+ (T T)>)
+ (<WT? .WORD ,PS?BUZZ-WORD> T)
+ (<WT? .WORD ,PS?PREPOSITION> T)
+ (T
+ <CANT-USE .PTR>
+ <RFALSE>)>)
+ (T <UNKNOWN-WORD .PTR> <RFALSE>)>
+ <SET LW .WORD>
+ <SET FIRST?? <>>
+ <SET PTR <+ .PTR ,P-LEXELEN>>>>
+
+<GLOBAL P-DOLLAR-FLAG <>>
+<ROUTINE NUMBER? (PTR "AUX" CNT BPTR CHR (SUM 0) (TIM <>))
+ <SET CNT <GETB <REST ,P-LEXV <* .PTR 2>> 2>>
+ <SET BPTR <GETB <REST ,P-LEXV <* .PTR 2>> 3>>
+ <SETG P-DOLLAR-FLAG <>>
+ <REPEAT ()
+ <COND (<L? <SET CNT <- .CNT 1>> 0> <RETURN>)
+ (T
+ <SET CHR <GETB ,P-INBUF .BPTR>>
+ <COND (<==? .CHR 58>
+ <SET TIM .SUM>
+ <SET SUM 0>)
+ (<G? .SUM 9999> <RFALSE>)
+ (<AND <L? .CHR 58> <G? .CHR 47>>
+ <SET SUM <+ <* .SUM 10> <- .CHR 48>>>)
+ (<EQUAL? .CHR %<ASCII !\$>>
+ <SETG P-DOLLAR-FLAG T>)
+ (T <RFALSE>)>
+ <SET BPTR <+ .BPTR 1>>)>>
+ <PUT ,P-LEXV .PTR ,W?INTNUM>
+ <COND (<G? .SUM 9999> <RFALSE>)
+ (.TIM
+ <SETG SET-HR .TIM>
+ <SETG SET-MIN .SUM>
+ <COND (<G? .TIM 23> <RFALSE>)
+ ;(<G? .TIM 19> T)
+ ;(<G? .TIM 12> <RFALSE>)
+ ;(<G? .TIM 7> T)
+ ;(T <SET TIM <+ 12 .TIM>>)>
+ <SET SUM <+ .SUM <* .TIM 60>>>)>
+ <COND (<AND ,P-DOLLAR-FLAG <G? .SUM 0>>
+ <SETG P-AMOUNT .SUM>
+ <FSET ,INTNUM ,VOWELBIT>
+ <PUTP ,INTNUM ,P?SDESC "amount of money">)
+ (T
+ <SETG P-NUMBER .SUM>
+ <SETG P-DOLLAR-FLAG <>>
+ <FCLEAR ,INTNUM ,VOWELBIT>
+ <PUTP ,INTNUM ,P?SDESC "number">)>
+ ,W?INTNUM>
+
+<GLOBAL P-NUMBER 0>
+<GLOBAL P-AMOUNT 0>
+
+
+;"Improved ORPHAN-MERGE with both TRAP retrofixes 6/25/84"
+
+<ROUTINE ORPHAN-MERGE ("AUX" (CNT -1) TEMP VERB BEG END (ADJ <>) WRD)
+ <SETG P-OFLAG <>>
+ <COND (<WT? <GET <GET ,P-ITBL ,P-VERBN> 0> ,PS?ADJECTIVE ,P1?ADJECTIVE>
+ <SET ADJ T>)>
+ <COND (<AND <NOT <0? <SET VERB <GET ,P-ITBL ,P-VERB>>>>
+ <NOT .ADJ>
+ <NOT <==? .VERB <GET ,P-OTBL ,P-VERB>>>>
+ <RFALSE>)
+ (<==? ,P-NCN 2> <RFALSE>)
+ (<==? <GET ,P-OTBL ,P-NC1> 1>
+ <COND (<OR <==? <SET TEMP <GET ,P-ITBL ,P-PREP1>>
+ <GET ,P-OTBL ,P-PREP1>>
+ <0? .TEMP>>
+ <COND (.ADJ
+ <PUT ,P-OTBL ,P-NC1 <REST ,P-LEXV 2>>
+ <PUT ,P-OTBL ,P-NC1L <REST ,P-LEXV 6>>)
+ (T
+ <PUT ,P-OTBL ,P-NC1 <GET ,P-ITBL ,P-NC1>>
+ <PUT ,P-OTBL ,P-NC1L <GET ,P-ITBL ,P-NC1L>>)>)
+ (T <RFALSE>)>)
+ (<==? <GET ,P-OTBL ,P-NC2> 1>
+ <COND (<OR <==? <SET TEMP <GET ,P-ITBL ,P-PREP1>>
+ <GET ,P-OTBL ,P-PREP2>>
+ <0? .TEMP>>
+ <COND (.ADJ
+ <PUT ,P-ITBL ,P-NC1 <REST ,P-LEXV 2>>
+ <PUT ,P-ITBL ,P-NC1L <REST ,P-LEXV 6>>)>
+ <PUT ,P-OTBL ,P-NC2 <GET ,P-ITBL ,P-NC1>>
+ <PUT ,P-OTBL ,P-NC2L <GET ,P-ITBL ,P-NC1L>>
+ <SETG P-NCN 2>)
+ (T <RFALSE>)>)
+ (,P-ACLAUSE
+ <COND (<AND <NOT <==? ,P-NCN 1>> <NOT .ADJ>>
+ <SETG P-ACLAUSE <>>
+ <RFALSE>)
+ (T
+ <SET BEG <GET ,P-ITBL ,P-NC1>>
+ <COND (.ADJ <SET BEG <REST ,P-LEXV 2>> <SET ADJ <>>)>
+ <SET END <GET ,P-ITBL ,P-NC1L>>
+ <REPEAT ()
+ <SET WRD <GET .BEG 0>>
+ <COND (<==? .BEG .END>
+ <COND (.ADJ <ACLAUSE-WIN .ADJ> <RETURN>)
+ (T <SETG P-ACLAUSE <>> <RFALSE>)>)
+ (<AND <NOT .ADJ>
+ <OR <BTST <GETB .WRD ,P-PSOFF>
+ ,PS?ADJECTIVE>
+ <EQUAL? .WRD ,W?ALL ,W?ONE>>>
+ <SET ADJ .WRD>)
+ (<OR <BTST <GETB .WRD ,P-PSOFF> ,PS?OBJECT>
+ <==? .WRD ,W?ONE>>
+ <COND (<NOT <EQUAL? .WRD ,P-ANAM ,W?ONE>>
+ <RFALSE>)
+ (T <ACLAUSE-WIN .ADJ> <RETURN>)>)>
+ <SET BEG <REST .BEG ,P-WORDLEN>>
+ <COND (<EQUAL? .END 0>
+ <SET END .BEG>
+ <SETG P-NCN 1>
+ <PUT ,P-ITBL ,P-NC1 <BACK .BEG 4>>
+ <PUT ,P-ITBL ,P-NC1L .BEG>)>>)>)>
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> ,P-ITBLLEN>
+ <SETG P-MERGED T>
+ <RTRUE>)
+ (T <PUT ,P-ITBL .CNT <GET ,P-OTBL .CNT>>)>>
+ T>
+
+;"New ACLAUSE-WIN for TRAP retrofix 6/21/84"
+
+<ROUTINE ACLAUSE-WIN (ADJ)
+ <PUT ,P-ITBL ,P-VERB <GET ,P-OTBL ,P-VERB>>
+ <SETG P-CCSRC ,P-OTBL>
+ <CLAUSE-COPY ,P-ACLAUSE <+ ,P-ACLAUSE 1> .ADJ>
+ <AND <NOT <==? <GET ,P-OTBL ,P-NC2> 0>> <SETG P-NCN 2>>
+ <SETG P-ACLAUSE <>>
+ <RTRUE>>
+
+;<ROUTINE ORPHAN-MERGE ("AUX" (CNT -1) TEMP VERB BEG END (ADJ <>) WRD)
+ #DECL ((CNT TEMP VERB) FIX (BEG END) <PRIMTYPE VECTOR> (WRD) TABLE)
+ <SETG P-OFLAG <>>
+ <COND
+ (<AND <NOT <0? <SET VERB <GET ,P-ITBL ,P-VERB>>>>
+ <NOT <==? .VERB <GET ,P-OTBL ,P-VERB>>>>
+ <RFALSE>)
+ (<==? ,P-NCN 2>
+ <RFALSE>)
+ (<==? <GET ,P-OTBL ,P-NC1> 1>
+ <COND (<OR <==? <SET TEMP <GET ,P-ITBL ,P-PREP1>> <GET ,P-OTBL ,P-PREP1>>
+ <0? .TEMP>>
+ <PUT ,P-OTBL ,P-NC1 <GET ,P-ITBL ,P-NC1>>
+ <PUT ,P-OTBL ,P-NC1L <GET ,P-ITBL ,P-NC1L>>)
+ (T <RFALSE>)>)
+ (<==? <GET ,P-OTBL ,P-NC2> 1>
+ <COND (<OR <==? <SET TEMP <GET ,P-ITBL ,P-PREP1>> <GET ,P-OTBL ,P-PREP2>>
+ <0? .TEMP>>
+ <PUT ,P-OTBL ,P-NC2 <GET ,P-ITBL ,P-NC1>>
+ <PUT ,P-OTBL ,P-NC2L <GET ,P-ITBL ,P-NC1L>>
+ <SETG P-NCN 2>)
+ (T <RFALSE>)>)
+ (,P-ACLAUSE
+ <COND
+ (<NOT <==? ,P-NCN 1>> <SETG P-ACLAUSE <>> <RFALSE>)
+ (T
+ <SET BEG <GET ,P-ITBL ,P-NC1>>
+ <SET END <GET ,P-ITBL ,P-NC1L>>
+ <REPEAT ()
+ <COND (<==? .BEG .END>
+ <COND (.ADJ
+ <ACLAUSE-WIN .ADJ>
+ <RETURN>)
+ (T
+ <SETG P-ACLAUSE <>>
+ <RFALSE>)>)
+ (<AND <NOT .ADJ>
+ <BTST <GETB <SET WRD <GET .BEG 0>> ,P-PSOFF>
+ ,PS?ADJECTIVE>>
+ <SET ADJ .WRD>)
+ (<OR <BTST <GETB .WRD ,P-PSOFF> ,PS?OBJECT>
+ <==? .WRD ,W?ONE>>
+ <COND (<NOT <EQUAL? .WRD ,P-ANAM ,W?ONE>> <RFALSE>)
+ (T
+ <ACLAUSE-WIN .ADJ>
+ <RETURN>)>)>
+ <SET BEG <REST .BEG ,P-WORDLEN>>>)>)>
+ <REPEAT ()
+ <COND (<G? <SET CNT <+ .CNT 1>> ,P-ITBLLEN>
+ <SETG P-MERGED T>
+ <RTRUE>)
+ (T <PUT ,P-ITBL .CNT <GET ,P-OTBL .CNT>>)>>
+ T>
+
+;<ROUTINE ACLAUSE-WIN (ADJ)
+ <SETG P-CCSRC ,P-OTBL>
+ <CLAUSE-COPY ,P-ACLAUSE <+ ,P-ACLAUSE 1> .ADJ>
+ <AND <NOT <==? <GET ,P-OTBL ,P-NC2> 0>>
+ <SETG P-NCN 2>>
+ <SETG P-ACLAUSE <>>
+ <RTRUE>>
+
+;"Print undefined word in input.
+ PTR points to the unknown word in P-LEXV"
+
+<ROUTINE WORD-PRINT (CNT BUF)
+ <REPEAT ()
+ <COND (<DLESS? CNT 0> <RETURN>)
+ (ELSE
+ <PRINTC <GETB ,P-INBUF .BUF>>
+ <SET BUF <+ .BUF 1>>)>>>
+
+
+
+<ROUTINE UNKNOWN-WORD (PTR "AUX" BUF MSG)
+ #DECL ((PTR BUF) FIX)
+ <TELL "I don't know the word \"">
+ <WORD-PRINT <GETB <REST ,P-LEXV <SET BUF <* .PTR 2>>> 2>
+ <GETB <REST ,P-LEXV .BUF> 3>>
+ <TELL "\"." CR>
+ <SETG QUOTE-FLAG <>>
+ <SETG P-OFLAG <>>>
+
+<ROUTINE CANT-USE (PTR "AUX" BUF)
+ #DECL ((PTR BUF) FIX)
+ <TELL "Sorry, but you can't use the word \"">
+ <WORD-PRINT <GETB <REST ,P-LEXV <SET BUF <* .PTR 2>>> 2>
+ <GETB <REST ,P-LEXV .BUF> 3>>
+ <TELL "\" in that sense." CR>
+ <SETG QUOTE-FLAG <>>
+ <SETG P-OFLAG <>>>
+
+;" Perform syntax matching operations, using P-ITBL as the source of
+ the verb and adjectives for this input. Returns false if no
+ syntax matches, and does it's own orphaning. If return is true,
+ the syntax is saved in P-SYNTAX."
+
+<GLOBAL P-SLOCBITS 0>
+
+<CONSTANT P-SYNLEN 8>
+
+<CONSTANT P-SBITS 0>
+
+<CONSTANT P-SPREP1 1>
+
+<CONSTANT P-SPREP2 2>
+
+<CONSTANT P-SFWIM1 3>
+
+<CONSTANT P-SFWIM2 4>
+
+<CONSTANT P-SLOC1 5>
+
+<CONSTANT P-SLOC2 6>
+
+<CONSTANT P-SACTION 7>
+
+<CONSTANT P-SONUMS 3>
+
+<ROUTINE SYNTAX-CHECK ("AUX" SYN LEN NUM OBJ (DRIVE1 <>) (DRIVE2 <>)
+ PREP VERB)
+ #DECL ((DRIVE1 DRIVE2) <OR FALSE <PRIMTYPE VECTOR>>
+ (SYN) <PRIMTYPE VECTOR> (LEN NUM VERB PREP) FIX
+ (OBJ) <OR FALSE OBJECT>)
+ <COND (<0? <SET VERB <GET ,P-ITBL ,P-VERB>>>
+ <TELL-COULDNT-FIND "a verb">
+ <RFALSE>)>
+ <SET SYN <GET ,VERBS <- 255 .VERB>>>
+ <SET LEN <GETB .SYN 0>>
+ <SET SYN <REST .SYN>>
+ <REPEAT ()
+ <SET NUM <BAND <GETB .SYN ,P-SBITS> ,P-SONUMS>>
+ <COND (<G? ,P-NCN .NUM> T) ;"Added 4/27/83"
+ (<AND <NOT <L? .NUM 1>>
+ <0? ,P-NCN>
+ <OR <0? <SET PREP <GET ,P-ITBL ,P-PREP1>>>
+ <==? .PREP <GETB .SYN ,P-SPREP1>>>>
+ <SET DRIVE1 .SYN>)
+ (<==? <GETB .SYN ,P-SPREP1> <GET ,P-ITBL ,P-PREP1>>
+ <COND (<AND <==? .NUM 2> <==? ,P-NCN 1>>
+ <SET DRIVE2 .SYN>)
+ (<==? <GETB .SYN ,P-SPREP2>
+ <GET ,P-ITBL ,P-PREP2>>
+ <SYNTAX-FOUND .SYN>
+ <RTRUE>)>)>
+ <COND (<DLESS? LEN 1>
+ <COND (<OR .DRIVE1 .DRIVE2> <RETURN>)
+ (T
+ <TELL "I don't understand that sentence." CR>
+ <RFALSE>)>)
+ (T <SET SYN <REST .SYN ,P-SYNLEN>>)>>
+ <COND (<AND .DRIVE1
+ <SET OBJ
+ <GWIM <GETB .DRIVE1 ,P-SFWIM1>
+ <GETB .DRIVE1 ,P-SLOC1>
+ <GETB .DRIVE1 ,P-SPREP1>>>>
+ <PUT ,P-PRSO ,P-MATCHLEN 1>
+ <PUT ,P-PRSO 1 .OBJ>
+ <SYNTAX-FOUND .DRIVE1>)
+ (<AND .DRIVE2
+ <SET OBJ
+ <GWIM <GETB .DRIVE2 ,P-SFWIM2>
+ <GETB .DRIVE2 ,P-SLOC2>
+ <GETB .DRIVE2 ,P-SPREP2>>>>
+ <PUT ,P-PRSI ,P-MATCHLEN 1>
+ <PUT ,P-PRSI 1 .OBJ>
+ <SYNTAX-FOUND .DRIVE2>)
+ (<EQUAL? .VERB ,ACT?FIND ;,ACT?WHAT>
+ <COND (<NOT <==? ,WINNER ,PLAYER>>
+ <TELL "You'll have to ask a more specific question." CR>)
+ (T <TELL "Sorry, but I can't answer that question." CR>)>
+ <RFALSE>)
+ (T
+ <COND (<EQUAL? ,WINNER ,PLAYER>
+ <ORPHAN .DRIVE1 .DRIVE2>
+ <COND (<EQUAL? .VERB ,ACT?WALK> ;"This COND added by JW"
+ <TELL "Where">)
+ (T <TELL "What">)>
+ <TELL " do you want to ">)
+ (T
+ <REQUEST-INCOMPLETE>
+ <TELL "what you want ">
+ <THE? ,WINNER>
+ <TELL D ,WINNER " to ">)>
+ <VERB-PRINT>
+ <COND (.DRIVE2
+ <CLAUSE-PRINT ,P-NC1 ,P-NC1L>)>
+ <PREP-PRINT <COND (.DRIVE1 <GETB .DRIVE1 ,P-SPREP1>)
+ (T <GETB .DRIVE2 ,P-SPREP2>)>>
+ <COND (<EQUAL? ,WINNER ,PLAYER>
+ <SETG P-OFLAG T>
+ <TELL "?" CR>)
+ (T
+ <SETG P-OFLAG <>>
+ <TELL "." CR>)>
+ <RFALSE>)>>
+
+<ROUTINE REQUEST-INCOMPLETE ()
+ <TELL "Your request was incomplete. Next time, say ">>
+
+<ROUTINE VERB-PRINT ("AUX" TMP)
+ <SET TMP <GET ,P-ITBL ,P-VERBN>>
+ <COND (<==? .TMP 0> <TELL "say">)
+ (<0? <GETB ,P-VTBL 2>>
+ <PRINTB <GET .TMP 0>>)
+ (T
+ <WORD-PRINT <GETB .TMP 2> <GETB .TMP 3>>
+ <PUTB ,P-VTBL 2 0>)>>
+
+<ROUTINE ORPHAN (D1 D2 "AUX" (CNT -1))
+ #DECL ((D1 D2) <OR FALSE <PRIMTYPE VECTOR>>)
+ <PUT ,P-OCLAUSE ,P-MATCHLEN 0>
+ <SETG P-CCSRC ,P-ITBL>
+ <REPEAT ()
+ <COND (<IGRTR? CNT ,P-ITBLLEN> <RETURN>)
+ (T <PUT ,P-OTBL .CNT <GET ,P-ITBL .CNT>>)>>
+ <COND (<==? ,P-NCN 2> <CLAUSE-COPY ,P-NC2 ,P-NC2L>)>
+ <COND (<NOT <L? ,P-NCN 1>> <CLAUSE-COPY ,P-NC1 ,P-NC1L>)>
+ <COND (.D1
+ <PUT ,P-OTBL ,P-PREP1 <GETB .D1 ,P-SPREP1>>
+ <PUT ,P-OTBL ,P-NC1 1>)
+ (.D2
+ <PUT ,P-OTBL ,P-PREP2 <GETB .D2 ,P-SPREP2>>
+ <PUT ,P-OTBL ,P-NC2 1>)>>
+
+<ROUTINE CLAUSE-PRINT (BPTR EPTR "OPTIONAL" (THE? T))
+ <BUFFER-PRINT <GET ,P-ITBL .BPTR> <GET ,P-ITBL .EPTR> .THE?>>
+
+<ROUTINE BUFFER-PRINT (BEG END CP "AUX" (NOSP <>) WRD (FIRST?? T) (PN <>))
+ #DECL ((BEG END) <PRIMTYPE VECTOR> (CP) <OR FALSE ATOM>)
+ <REPEAT ()
+ <COND (<==? .BEG .END> <RETURN>)
+ (T
+ <COND (.NOSP <SET NOSP <>>)
+ (T <TELL " ">)>
+ <COND (<==? <SET WRD <GET .BEG 0>> ,W?PERIOD> <SET NOSP T>)
+ ;(<==? .WRD ,W?MRS> <TELL "Mrs."> <SET PN T>)
+ ;(<==? .WRD ,W?MS> <TELL "Ms."> <SET PN T>)
+ (<==? .WRD ,W?MR> <TELL "Mr."> <SET PN T>)
+ (<==? .WRD ,W?MCGINTY> <TELL "McGinty"> <SET PN T>)
+ (<==? .WRD ,W?ME> <TELL D ,GLOBAL-SELF> <SET PN T>)
+ (<OR <EQUAL? .WRD ,W?WEASEL ,W?PETE ,W?JOHN>
+ <EQUAL? .WRD ,W?JOHNNY ,W?RED ,W?RAT>
+ <EQUAL? .WRD ,W?MARY ,W?MARGAR ,W?FRANK>
+ <EQUAL? .WRD ,W?WEBSTE ,W?HEVLIN>>
+ <CAPITALIZE .BEG>
+ <SET PN T>)
+ (T
+ <COND (<AND .FIRST?? <NOT .PN> .CP>
+ <TELL "the ">)>
+ <COND (<OR ,P-OFLAG ,P-MERGED>
+ <COND (<==? .WRD ,W?INTNUM>
+ <TELL D ,INTNUM>)
+ (T <PRINTB .WRD>)>)
+ (<AND <EQUAL? .WRD ,W?IT ,W?HIM>
+ <ACCESSIBLE? ,P-IT-OBJECT>
+ <NOT <EQUAL? ,P-IT-OBJECT
+ ,PSEUDO-OBJECT>>>
+ <DPRINT ,P-IT-OBJECT>)
+ ;(<AND <EQUAL? .WRD ,W?HIM ;,W?HER>
+ <==? ,P-HIM-HER-LOC ,HERE>>
+ <DPRINT ,P-HIM-HER>)
+ (T
+ <WORD-PRINT <GETB .BEG 2>
+ <GETB .BEG 3>>)>
+ <SET FIRST?? <>>)>)>
+ <SET BEG <REST .BEG ,P-WORDLEN>>>>
+
+<ROUTINE CAPITALIZE (PTR)
+ <COND (<OR ,P-OFLAG ,P-MERGED> <PRINTB <GET .PTR 0>>)
+ (T
+ <PRINTC <- <GETB ,P-INBUF <GETB .PTR 3>> 32>>
+ <WORD-PRINT <- <GETB .PTR 2> 1> <+ <GETB .PTR 3> 1>>)>>
+
+<ROUTINE PREP-PRINT (PREP "OPTIONAL" (SP? T) "AUX" WRD)
+ #DECL ((PREP) FIX)
+ <COND (<NOT <0? .PREP>>
+ <COND (.SP? <TELL " ">)>
+ <SET WRD <PREP-FIND .PREP>>
+ <COND (<AND <==? ,W?SIT <GET <GET ,P-ITBL ,P-VERBN> 0>>
+ <==? ,W?DOWN .WRD>> ;"Will it ever work? --SWG"
+ <TELL "on">)
+ (<==? .WRD ,W?AGAINST> <TELL "against">)
+ (T <PRINTB .WRD>)>
+ <COND (<AND <==? ,W?GET <GET <GET ,P-ITBL ,P-VERBN> 0>>
+ <==? ,W?OUT .WRD>>
+ <TELL " of">)>
+ <RTRUE>)>>
+
+<ROUTINE CLAUSE-COPY (BPTR EPTR "OPTIONAL" (INSERT <>) "AUX" BEG END)
+ #DECL ((BPTR EPTR) FIX (BEG END) <PRIMTYPE VECTOR>
+ (INSERT) <OR FALSE TABLE>)
+ <SET BEG <GET ,P-CCSRC .BPTR>>
+ <SET END <GET ,P-CCSRC .EPTR>>
+ <PUT ,P-OTBL
+ .BPTR
+ <REST ,P-OCLAUSE
+ <+ <* <GET ,P-OCLAUSE ,P-MATCHLEN> ,P-LEXELEN> 2>>>
+ <REPEAT ()
+ <COND (<==? .BEG .END>
+ <PUT ,P-OTBL
+ .EPTR
+ <REST ,P-OCLAUSE
+ <+ <* <GET ,P-OCLAUSE ,P-MATCHLEN> ,P-LEXELEN>
+ 2>>>
+ <RETURN>)
+ (T
+ <COND (<AND .INSERT <==? ,P-ANAM <GET .BEG 0>>>
+ <CLAUSE-ADD .INSERT>)>
+ <CLAUSE-ADD <GET .BEG 0>>)>
+ <SET BEG <REST .BEG ,P-WORDLEN>>>>
+
+<ROUTINE CLAUSE-ADD (WRD "AUX" PTR)
+ #DECL ((WRD) TABLE (PTR) FIX)
+ <SET PTR <+ <GET ,P-OCLAUSE ,P-MATCHLEN> 2>>
+ <PUT ,P-OCLAUSE <- .PTR 1> .WRD>
+ <PUT ,P-OCLAUSE .PTR 0>
+ <PUT ,P-OCLAUSE ,P-MATCHLEN .PTR>>
+
+<ROUTINE PREP-FIND (PREP "AUX" (CNT 0) SIZE)
+ #DECL ((PREP CNT SIZE) FIX)
+ <SET SIZE <* <GET ,PREPOSITIONS 0> 2>>
+ <REPEAT ()
+ <COND (<IGRTR? CNT .SIZE> <RFALSE>)
+ (<==? <GET ,PREPOSITIONS .CNT> .PREP>
+ <RETURN <GET ,PREPOSITIONS <- .CNT 1>>>)>>>
+
+<ROUTINE SYNTAX-FOUND (SYN)
+ #DECL ((SYN) <PRIMTYPE VECTOR>)
+ <SETG P-SYNTAX .SYN>
+ <SETG PRSA <GETB .SYN ,P-SACTION>>>
+
+<GLOBAL P-GWIMBIT 0>
+
+<ROUTINE GWIM (GBIT LBIT PREP "AUX" OBJ)
+ #DECL ((GBIT LBIT) FIX (OBJ) OBJECT)
+ <COND (<==? .GBIT ,RMUNGBIT>
+ <RETURN ,ROOMS>)>
+ <SETG P-GWIMBIT .GBIT>
+ <SETG P-SLOCBITS .LBIT>
+ <PUT ,P-MERGE ,P-MATCHLEN 0>
+ <COND (<GET-OBJECT ,P-MERGE <>>
+ <SETG P-GWIMBIT 0>
+ <COND (<==? <GET ,P-MERGE ,P-MATCHLEN> 1>
+ <SET OBJ <GET ,P-MERGE 1>>
+ <TELL "(">
+ <COND (<PREP-PRINT .PREP <>>
+ ;<NOT <0? .PREP>>
+ ;<PRINTB <PREP-FIND .PREP>>
+ <TELL " ">
+ <THE? .OBJ>
+ ;<COND (<NOT <FSET? .OBJ ,PERSON>>
+ <TELL " the ">)
+ (T <TELL " ">)>)>
+ <COND ;(<AND <FSET? .OBJ ,PERSON>
+ <NOT <FSET? .OBJ ,TOUCHBIT>>
+ ;<GETP .OBJ ,P?DESCFCN>
+ <GETP .OBJ ,P?XDESC>>
+ <TELL "the " <GETP .OBJ ,P?XDESC> ")" CR>)
+ (T <TELL D .OBJ ")" CR>)>
+ .OBJ)>)
+ (T <SETG P-GWIMBIT 0> <RFALSE>)>>
+
+<ROUTINE SNARF-OBJECTS ("AUX" PTR)
+ #DECL ((PTR) <OR FIX <PRIMTYPE VECTOR>>)
+ <COND (<NOT <==? <SET PTR <GET ,P-ITBL ,P-NC1>> 0>>
+ <SETG P-SLOCBITS <GETB ,P-SYNTAX ,P-SLOC1>>
+ <OR <SNARFEM .PTR <GET ,P-ITBL ,P-NC1L> ,P-PRSO> <RFALSE>>
+ <OR <0? <GET ,P-BUTS ,P-MATCHLEN>>
+ <SETG P-PRSO <BUT-MERGE ,P-PRSO>>>)>
+ <COND (<NOT <==? <SET PTR <GET ,P-ITBL ,P-NC2>> 0>>
+ <SETG P-SLOCBITS <GETB ,P-SYNTAX ,P-SLOC2>>
+ <OR <SNARFEM .PTR <GET ,P-ITBL ,P-NC2L> ,P-PRSI> <RFALSE>>
+ <COND (<NOT <0? <GET ,P-BUTS ,P-MATCHLEN>>>
+ <COND (<==? <GET ,P-PRSI ,P-MATCHLEN> 1>
+ <SETG P-PRSO <BUT-MERGE ,P-PRSO>>)
+ (T <SETG P-PRSI <BUT-MERGE ,P-PRSI>>)>)>)>
+ <RTRUE>>
+
+<ROUTINE BUT-MERGE (TBL "AUX" LEN BUTLEN (CNT 1) (MATCHES 0) OBJ NTBL)
+ #DECL ((TBL NTBL) TABLE (LEN BUTLEN MATCHES) FIX (OBJ) OBJECT)
+ <SET LEN <GET .TBL ,P-MATCHLEN>>
+ <PUT ,P-MERGE ,P-MATCHLEN 0>
+ <REPEAT ()
+ <COND (<DLESS? LEN 0> <RETURN>)
+ (<ZMEMQ <SET OBJ <GET .TBL .CNT>> ,P-BUTS>)
+ (T
+ <PUT ,P-MERGE <+ .MATCHES 1> .OBJ>
+ <SET MATCHES <+ .MATCHES 1>>)>
+ <SET CNT <+ .CNT 1>>>
+ <PUT ,P-MERGE ,P-MATCHLEN .MATCHES>
+ <SET NTBL ,P-MERGE>
+ <SETG P-MERGE .TBL>
+ .NTBL>
+
+<GLOBAL P-NAM <>>
+
+<GLOBAL P-XNAM <>>
+
+<GLOBAL P-ADJ <>>
+
+<GLOBAL P-XADJ <>>
+
+<GLOBAL P-ADJN <>>
+
+<GLOBAL P-XADJN <>>
+
+<GLOBAL P-PRSO <ITABLE NONE 50>>
+
+<GLOBAL P-PRSI <ITABLE NONE 50>>
+
+<GLOBAL P-BUTS <ITABLE NONE 50>>
+
+<GLOBAL P-MERGE <ITABLE NONE 50>>
+
+<GLOBAL P-OCLAUSE <ITABLE NONE 50>>
+
+<GLOBAL P-MATCHLEN 0>
+
+<GLOBAL P-GETFLAGS 0>
+
+<CONSTANT P-ALL 1>
+
+<CONSTANT P-ONE 2>
+
+<CONSTANT P-INHIBIT 4>
+
+<GLOBAL P-CSPTR <>>
+<GLOBAL P-CEPTR <>>
+<GLOBAL P-AND <>>
+
+<ROUTINE SNARFEM (PTR EPTR TBL "AUX" (AND <>) (BUT <>) LEN WV WORD NW)
+ #DECL ((TBL) TABLE (PTR EPTR) <PRIMTYPE VECTOR> (AND) <OR ATOM FALSE>
+ (BUT) <OR FALSE TABLE> (WV) <OR FALSE FIX>)
+ <SETG P-AND <>>
+ <SETG P-GETFLAGS 0>
+ <SETG P-CSPTR .PTR>
+ <SETG P-CEPTR .EPTR>
+ <PUT ,P-BUTS ,P-MATCHLEN 0>
+ <PUT .TBL ,P-MATCHLEN 0>
+ <SET WORD <GET .PTR 0>>
+ <REPEAT ()
+ <COND (<==? .PTR .EPTR> <RETURN <GET-OBJECT <OR .BUT .TBL>>>)
+ (T
+ <SET NW <GET .PTR ,P-LEXELEN>>
+ <COND (<==? .WORD ,W?ALL>
+ <SETG P-GETFLAGS ,P-ALL>
+ <COND (<==? .NW ,W?OF>
+ <SET PTR <REST .PTR ,P-WORDLEN>>)>)
+ (<EQUAL? .WORD ,W?BUT ,W?EXCEPT>
+ <OR <GET-OBJECT <OR .BUT .TBL>> <RFALSE>>
+ <SET BUT ,P-BUTS>
+ <PUT .BUT ,P-MATCHLEN 0>)
+ (<EQUAL? .WORD ,W?A ,W?ONE>
+ <COND (<NOT ,P-ADJ>
+ <SETG P-GETFLAGS ,P-ONE>
+ <COND (<==? .NW ,W?OF>
+ <SET PTR <REST .PTR ,P-WORDLEN>>)>)
+ (T
+ <SETG P-NAM ,P-ONEOBJ>
+ <OR <GET-OBJECT <OR .BUT .TBL>> <RFALSE>>
+ <AND <0? .NW> <RTRUE>>)>)
+ (<AND <EQUAL? .WORD ,W?AND ,W?COMMA>
+ <NOT <EQUAL? .NW ,W?AND ,W?COMMA>>>
+ <SETG P-AND T>
+ <OR <GET-OBJECT <OR .BUT .TBL>> <RFALSE>>
+ T)
+ (<WT? .WORD ,PS?BUZZ-WORD>)
+ (<EQUAL? .WORD ,W?AND ,W?COMMA>)
+ (<==? .WORD ,W?OF>
+ <COND (<0? ,P-GETFLAGS>
+ <SETG P-GETFLAGS ,P-INHIBIT>)>)
+ (<AND <SET WV <WT? .WORD ,PS?ADJECTIVE ,P1?ADJECTIVE>>
+ <NOT ,P-ADJ>>
+ <SETG P-ADJ .WV>
+ <SETG P-ADJN .WORD>)
+ (<WT? .WORD ,PS?OBJECT ,P1?OBJECT>
+ <SETG P-NAM .WORD>
+ <SETG P-ONEOBJ .WORD>)>)>
+ <COND (<NOT <==? .PTR .EPTR>>
+ <SET PTR <REST .PTR ,P-WORDLEN>>
+ <SET WORD .NW>)>>>
+
+<CONSTANT SH 128>
+
+<CONSTANT SC 64>
+
+<CONSTANT SIR 32>
+
+<CONSTANT SOG 16>
+
+<CONSTANT STAKE 8>
+
+<CONSTANT SMANY 4>
+
+<CONSTANT SHAVE 2>
+
+<ROUTINE GET-OBJECT (TBL
+ "OPTIONAL" (VRB T)
+ "AUX" BITS LEN XBITS TLEN (GCHECK <>) (OLEN 0) OBJ)
+ #DECL ((TBL) TABLE (XBITS TLEN LEN) FIX (GWIM) <OR FALSE FIX>
+ (VRB GCHECK) <OR ATOM FALSE>)
+ <SET XBITS ,P-SLOCBITS>
+ <SET TLEN <GET .TBL ,P-MATCHLEN>>
+ <COND (<BTST ,P-GETFLAGS ,P-INHIBIT> <RTRUE>)>
+ <COND (<AND <NOT ,P-NAM> ,P-ADJ>
+ <COND (<WT? ,P-ADJN ,PS?OBJECT ,P1?OBJECT>
+ <SETG P-NAM ,P-ADJN>
+ <SETG P-ADJ <>>)
+ (<SET BITS <WT? ,P-ADJN ,PS?DIRECTION ,P1?DIRECTION>>
+ <SETG P-ADJ <>>
+ <PUT .TBL ,P-MATCHLEN 1>
+ <PUT .TBL 1 ,INTDIR>
+ <SETG P-WALK-DIR .BITS>
+ <RTRUE>)>)>
+ <COND (<AND <NOT ,P-NAM>
+ <NOT ,P-ADJ>
+ <NOT <==? ,P-GETFLAGS ,P-ALL>>
+ <0? ,P-GWIMBIT>>
+ <COND (.VRB
+ <TELL-COULDNT-FIND "enough nouns">)>
+ <RFALSE>)>
+ <COND (<OR <NOT <==? ,P-GETFLAGS ,P-ALL>> <0? ,P-SLOCBITS>>
+ <SETG P-SLOCBITS -1>)>
+ <SETG P-TABLE .TBL>
+ <PROG ()
+ <COND (.GCHECK <GLOBAL-CHECK .TBL>)
+ (T
+ <COND (,LIT
+ <FCLEAR ,PLAYER ,TRANSBIT>
+ <DO-SL ,HERE ,SOG ,SIR>
+ <FSET ,PLAYER ,TRANSBIT>)>
+ <DO-SL ,PLAYER ,SH ,SC>)>
+ <SET LEN <- <GET .TBL ,P-MATCHLEN> .TLEN>>
+ <COND (<BTST ,P-GETFLAGS ,P-ALL>
+ <COND (<AND <0? .LEN> ,P-NAM>
+ <SETG P-NONE T>)>)
+ (<AND <BTST ,P-GETFLAGS ,P-ONE>
+ <NOT <0? .LEN>>>
+ <COND (<NOT <==? .LEN 1>>
+ <PUT .TBL 1 <GET .TBL <RANDOM .LEN>>>
+ <TELL "How about the ">
+ <DPRINT <GET .TBL 1>>
+ <TELL "?" CR>)>
+ <PUT .TBL ,P-MATCHLEN 1>)
+ (<OR <G? .LEN 1>
+ <AND <0? .LEN> <NOT <==? ,P-SLOCBITS -1>>>>
+ <COND (<==? ,P-SLOCBITS -1>
+ <SETG P-SLOCBITS .XBITS>
+ <SET OLEN .LEN>
+ <PUT .TBL ,P-MATCHLEN <- <GET .TBL ,P-MATCHLEN> .LEN>>
+ <AGAIN>)
+ (T
+ <COND (<0? .LEN> <SET LEN .OLEN>)>
+ <COND ;(<AND ,P-NAM
+ <VERB? ASK-ABOUT ASK-CONTEXT-ABOUT TELL-ME WHAT
+ GIVE SGIVE ASK-FOR ASK-CONTEXT-FOR TAKE
+ FIND SEARCH ;SEARCH-OBJECT-FOR
+ MAKE DISEMBARK>
+ <SET OBJ <GET .TBL <+ .TLEN 1>>>
+ <SET OBJ <APPLY <GETP .OBJ ,P?GENERIC> .OBJ>>>
+ <COND (<==? .OBJ ,NOT-HERE-OBJECT> <RFALSE>)>
+ <PUT .TBL 1 .OBJ>
+ <PUT .TBL ,P-MATCHLEN 1>
+ <SETG P-NAM <>>
+ <SETG P-ADJ <>>
+ <RTRUE>)
+ (<AND .VRB ,P-NAM>
+ <COND (<EQUAL? ,WINNER ,PLAYER>
+ <WHICH-PRINT .TLEN .LEN .TBL>
+ <SETG P-ACLAUSE
+ <COND (<==? .TBL ,P-PRSO> ,P-NC1)
+ (T ,P-NC2)>>
+ <SETG P-AADJ ,P-ADJ>
+ <SETG P-ANAM ,P-NAM>
+ <ORPHAN <> <>>
+ <SETG P-OFLAG T>)
+ (T
+ <REQUEST-INCOMPLETE>
+ <TELL "which">
+ <WHICH-PRINT-NOUN .TBL>
+ <TELL " you mean, ">
+ <WHICH-PRINT-LIST .TLEN .LEN .TBL>
+ <SETG P-OFLAG <>>
+ <TELL "." CR>)>)
+ (.VRB
+ <TELL-COULDNT-FIND "enough nouns">)>
+ <SETG P-NAM <>>
+ <SETG P-ADJ <>>
+ <RFALSE>)>)
+ (<AND <0? .LEN> .GCHECK>
+ <COND (.VRB
+ <COND (,LIT
+ ;"Changed 6/10/83 - MARC"
+ <OBJ-FOUND ,NOT-HERE-OBJECT .TBL>
+ ;<PUT .TBL ,P-MATCHLEN 1>
+ ;<PUT .TBL 1 ,NOT-HERE-OBJECT>
+ <SETG P-XNAM ,P-NAM>
+ <SETG P-XADJ ,P-ADJ>
+ <SETG P-XADJN ,P-ADJN>
+ <SETG P-NAM <>>
+ <SETG P-ADJ <>>
+ <SETG P-ADJN <>>
+ <RTRUE>)
+ (T <TELL-TOO-DARK>)>)>
+ <SETG P-NAM <>>
+ <SETG P-ADJ <>>
+ <RFALSE>)
+ (<0? .LEN> <SET GCHECK T> <AGAIN>)>
+ <COND (<AND ,P-ADJ <NOT ,P-NAM>> <SETG P-NONOUN T>) (T <SETG P-NONOUN <>>)>
+ <SETG P-SLOCBITS .XBITS>
+ <SETG P-NAM <>>
+ <SETG P-ADJ <>>
+ <RTRUE>>>
+
+<ROUTINE TELL-COULDNT-FIND (STR)
+ <TELL "I couldn't find " .STR " in that sentence." CR>>
+
+<ROUTINE TELL-TOO-DARK ()
+ <TELL "It's too dark to see!" CR>>
+
+<GLOBAL P-NONOUN <>>
+
+<ROUTINE MOBY-FIND (TBL "AUX" FOO LEN)
+ <SETG P-MOBY-FLAG T>
+ <SETG P-SLOCBITS -1>
+ <SETG P-TABLE .TBL>
+ <SETG P-NAM ,P-XNAM>
+ <SETG P-ADJ ,P-XADJ>
+ <SETG P-MOBY-FOUND <>>
+ <PUT .TBL ,P-MATCHLEN 0>
+ <SET FOO <FIRST? ,ROOMS>>
+ <REPEAT ()
+ <COND (<NOT .FOO> <RETURN>)
+ (T
+ <SEARCH-LIST .FOO .TBL ,P-SRCALL>
+ <SET FOO <NEXT? .FOO>>)>>
+ <COND (<EQUAL? <SET LEN <GET .TBL ,P-MATCHLEN>> 0>
+ <DO-SL ,LOCAL-GLOBALS 1 1>)>
+ <COND (<EQUAL? <SET LEN <GET .TBL ,P-MATCHLEN>> 0>
+ <SEARCH-LIST ,GLOBAL-FERRY .TBL ,P-SRCTOP>)>
+ <COND (<EQUAL? <SET LEN <GET .TBL ,P-MATCHLEN>> 1>
+ <SETG P-MOBY-FOUND <GET .TBL 1>>)>
+ <SETG P-MOBY-FLAG <>>
+ .LEN>
+
+<GLOBAL P-MOBY-FOUND <>>
+<GLOBAL P-MOBY-FLAG <>>
+
+<ROUTINE WHICH-PRINT (TLEN LEN TBL)
+ <TELL "Which">
+ <WHICH-PRINT-NOUN .TBL>
+ <TELL " do you mean, ">
+ <WHICH-PRINT-LIST .TLEN .LEN .TBL>
+ <TELL "?" CR>>
+
+<ROUTINE WHICH-PRINT-NOUN (TBL)
+ <COND (<OR ,P-OFLAG ,P-MERGED ,P-AND>
+ <TELL " ">
+ <COND (<==? ,P-NAM ,W?INTNUM> <TELL D ,INTNUM>)
+ (T <PRINTB ,P-NAM>)>)
+ (<==? .TBL ,P-PRSO>
+ <CLAUSE-PRINT ,P-NC1 ,P-NC1L <>>)
+ (T <CLAUSE-PRINT ,P-NC2 ,P-NC2L <>>)>>
+
+<ROUTINE WHICH-PRINT-LIST (TLEN LEN TBL "AUX" OBJ RLEN)
+ <SET RLEN .LEN>
+ <REPEAT ()
+ <SET TLEN <+ .TLEN 1>>
+ <SET OBJ <GET .TBL .TLEN>>
+ <THE? .OBJ>
+ ;<COND (<NOT <FSET? .OBJ ,PERSON>> <TELL " the">)>
+ <TELL D .OBJ>
+ <COND (<==? .LEN 2>
+ <COND (<NOT <==? .RLEN 2>> <TELL ", ">)>
+ <TELL " or ">)
+ (<G? .LEN 2> <TELL ", ">)>
+ <COND (<L? <SET LEN <- .LEN 1>> 1>
+ <RETURN>)>>>
+
+<ROUTINE GLOBAL-CHECK (TBL "AUX" LEN RMG RMGL (CNT 0) OBJ OBITS)
+ #DECL ((TBL) TABLE (RMG) <OR FALSE TABLE> (RMGL CNT) FIX (OBJ) OBJECT)
+ <SET LEN <GET .TBL ,P-MATCHLEN>>
+ <SET OBITS ,P-SLOCBITS>
+ <COND (<SET RMG <GETPT ,HERE ,P?GLOBAL>>
+ <SET RMGL <- <PTSIZE .RMG> 1>>
+ <REPEAT ()
+ <COND (<THIS-IT? <SET OBJ <GETB .RMG .CNT>> .TBL>
+ <OBJ-FOUND .OBJ .TBL>)>
+ <COND (<OR <AND <OR <FSET? .OBJ ,CONTBIT>
+ <FSET? .OBJ ,SURFACEBIT>>
+ <FSET? .OBJ ,OPENBIT>>
+ <FSET? .OBJ ,TRANSBIT>>
+ <SEARCH-LIST .OBJ .TBL ,P-SRCTOP>)>
+ <COND (<IGRTR? CNT .RMGL> <RETURN>)>>)>
+ <COND (<SET RMG <GETPT ,HERE ,P?PSEUDO>>
+ <SET RMGL <- </ <PTSIZE .RMG> 4> 1>>
+ <SET CNT 0>
+ <REPEAT ()
+ <COND (<==? ,P-NAM <GET .RMG <* .CNT 2>>>
+ <PUTP ,PSEUDO-OBJECT
+ ,P?ACTION
+ <GET .RMG <+ <* .CNT 2> 1>>>
+ <PUTP ,PSEUDO-OBJECT ,P?DESCFCN ,HERE>
+ <APPLY <GETP ,PSEUDO-OBJECT ,P?ACTION> ,M-NAME>
+ <OBJ-FOUND ,PSEUDO-OBJECT .TBL>
+ <RETURN>)
+ (<IGRTR? CNT .RMGL> <RETURN>)>>)>
+ <COND (<==? <GET .TBL ,P-MATCHLEN> .LEN>
+ <SETG P-SLOCBITS -1>
+ <SETG P-TABLE .TBL>
+ <DO-SL ,GLOBAL-OBJECTS 1 1>
+ <SETG P-SLOCBITS .OBITS>)>>
+
+<ROUTINE DO-SL (OBJ BIT1 BIT2 "AUX" BITS)
+ #DECL ((OBJ) OBJECT (BIT1 BIT2 BITS) FIX)
+ <COND (<BTST ,P-SLOCBITS <+ .BIT1 .BIT2>>
+ <SEARCH-LIST .OBJ ,P-TABLE ,P-SRCALL>)
+ (T
+ <COND (<BTST ,P-SLOCBITS .BIT1>
+ <SEARCH-LIST .OBJ ,P-TABLE ,P-SRCTOP>)
+ (<BTST ,P-SLOCBITS .BIT2>
+ <SEARCH-LIST .OBJ ,P-TABLE ,P-SRCBOT>)
+ (T <RTRUE>)>)>>
+
+<CONSTANT P-SRCBOT 2>
+
+<CONSTANT P-SRCTOP 0>
+
+<CONSTANT P-SRCALL 1>
+
+<ROUTINE SEARCH-LIST (OBJ TBL LVL "AUX" FLS NOBJ)
+ #DECL ((OBJ NOBJ) <OR FALSE OBJECT> (TBL) TABLE (LVL) FIX (FLS) ANY)
+ <COND (<SET OBJ <FIRST? .OBJ>>
+ <REPEAT ()
+ <COND (<AND <NOT <==? .LVL ,P-SRCBOT>>
+ <GETPT .OBJ ,P?SYNONYM>
+ <THIS-IT? .OBJ .TBL>>
+ <OBJ-FOUND .OBJ .TBL>)>
+ <COND (<AND <OR <NOT <==? .LVL ,P-SRCTOP>>
+ <FSET? .OBJ ,SEARCHBIT>
+ <FSET? .OBJ ,SURFACEBIT>>
+ <SET NOBJ <FIRST? .OBJ>>
+ <OR <FSET? .OBJ ,OPENBIT>
+ <FSET? .OBJ ,TRANSBIT>
+ ,P-MOBY-FLAG
+ <AND <FSET? .OBJ ,PERSON>
+ <NOT <==? .OBJ ,PLAYER>>>>>
+ <SET FLS
+ <SEARCH-LIST .OBJ
+ .TBL
+ <COND (<FSET? .OBJ ,SURFACEBIT>
+ ,P-SRCALL)
+ (<FSET? .OBJ ,SEARCHBIT>
+ ,P-SRCALL)
+ (T ,P-SRCTOP)>>>)>
+ <COND (<SET OBJ <NEXT? .OBJ>>) (T <RETURN>)>>)>>
+
+<ROUTINE THIS-IT? (OBJ TBL "AUX" SYNS)
+ <COND (<FSET? .OBJ ,INVISIBLE> <RFALSE>)
+ (<AND ,P-NAM
+ <NOT <ZMEMQ ,P-NAM
+ <SET SYNS <GETPT .OBJ ,P?SYNONYM>>
+ <- </ <PTSIZE .SYNS> 2> 1>>>>
+ <RFALSE>)
+ (<AND ,P-ADJ
+ <OR <NOT <SET SYNS <GETPT .OBJ ,P?ADJECTIVE>>>
+ <NOT <ZMEMQB ,P-ADJ .SYNS <- <PTSIZE .SYNS> 1>>>>>
+ <RFALSE>)
+ (<AND <NOT <0? ,P-GWIMBIT>> <NOT <FSET? .OBJ ,P-GWIMBIT>>>
+ <RFALSE>)>
+ <RTRUE>>
+
+<ROUTINE OBJ-FOUND (OBJ TBL "AUX" PTR)
+ #DECL ((OBJ) OBJECT (TBL) TABLE (PTR) FIX)
+ <SET PTR <GET .TBL ,P-MATCHLEN>>
+ <PUT .TBL <+ .PTR 1> .OBJ>
+ <PUT .TBL ,P-MATCHLEN <+ .PTR 1>>>
+
+<ROUTINE TAKE-CHECK ()
+ <AND <ITAKE-CHECK ,P-PRSO <GETB ,P-SYNTAX ,P-SLOC1>>
+ <ITAKE-CHECK ,P-PRSI <GETB ,P-SYNTAX ,P-SLOC2>>>>
+
+<ROUTINE ITAKE-CHECK (TBL BITS "AUX" PTR OBJ TAKEN)
+ #DECL ((TBL) TABLE (BITS PTR) FIX (OBJ) OBJECT
+ (TAKEN) <OR FALSE FIX ATOM>)
+ <COND (<AND <SET PTR <GET .TBL ,P-MATCHLEN>>
+ <OR <BTST .BITS ,SHAVE>
+ <BTST .BITS ,STAKE>>>
+ <REPEAT ()
+ <COND (<L? <SET PTR <- .PTR 1>> 0> <RETURN>)
+ (T
+ <SET OBJ <GET .TBL <+ .PTR 1>>>
+ <COND (<==? .OBJ ,IT> <SET OBJ ,P-IT-OBJECT>)
+ ;(<==? .OBJ ,HIM-HER>
+ <SET OBJ ,P-HIM-HER>)>
+ <COND (<NOT <HELD? .OBJ>>
+ <SETG PRSO .OBJ>
+ <COND (<FSET? .OBJ ,TRYTAKEBIT>
+ <SET TAKEN T>)
+ (<NOT <==? ,WINNER ,PLAYER>>
+ <SET TAKEN <>>)
+ (<AND <BTST .BITS ,STAKE>
+ <==? <ITAKE <>> T>>
+ <SET TAKEN <>>)
+ (T <SET TAKEN T>)>
+ <COND (<AND .TAKEN <BTST .BITS ,SHAVE>>
+ <COND (<OR
+ <EQUAL? .OBJ ,GLOBAL-MONEY
+ ,RIDICULOUS-MONEY-KLUDGE>
+ <AND <==? .OBJ ,INTNUM>
+ ,P-DOLLAR-FLAG>
+ <AND <==? .OBJ ,IT>
+ <EQUAL? ,P-IT-OBJECT
+ ,RIDICULOUS-MONEY-KLUDGE
+ ,INTNUM ,GLOBAL-MONEY>>>
+ <TELL-YOU-CANT "afford to.">)
+ (T
+ <TELL-DONT-HAVE <>>
+ <COND (<EQUAL? .OBJ
+ ,NOT-HERE-OBJECT>
+ <TELL "that." CR>)
+ (T
+ <THE? .OBJ>
+ <TELL
+ D .OBJ "." CR>)>)>
+ <RFALSE>)
+ (<AND <NOT .TAKEN>
+ <==? ,WINNER ,PLAYER>>
+ <TELL "(taking ">
+ <COND (<OR <G?
+ <GET ,P-PRSI
+ ,P-MATCHLEN>
+ 0>
+ <G?
+ <GET .TBL ,P-MATCHLEN>
+ 1>>
+ <THE? .OBJ>
+ <TELL D .OBJ>)
+ (T <TELL "it">)>
+ <TELL " first)" CR>)>)>)>>)
+ (T)>>
+
+<ROUTINE MANY-CHECK ("AUX" (LOSS <>) TMP)
+ #DECL ((LOSS) <OR FALSE FIX>)
+ <COND (<AND <G? <GET ,P-PRSO ,P-MATCHLEN> 1>
+ <NOT <BTST <GETB ,P-SYNTAX ,P-SLOC1> ,SMANY>>>
+ <SET LOSS 1>)
+ (<AND <G? <GET ,P-PRSI ,P-MATCHLEN> 1>
+ <NOT <BTST <GETB ,P-SYNTAX ,P-SLOC2> ,SMANY>>>
+ <SET LOSS 2>)>
+ <COND (.LOSS
+ <TELL-YOU-CANT "use multiple " <>>
+ <COND (<==? .LOSS 2> <TELL "in">)>
+ <TELL "direct objects with \"">
+ <SET TMP <GET ,P-ITBL ,P-VERBN>>
+ <COND (<0? .TMP> <TELL "tell">)
+ (<OR ,P-OFLAG ,P-MERGED>
+ <PRINTB <GET .TMP 0>>)
+ (T
+ <WORD-PRINT <GETB .TMP 2> <GETB .TMP 3>>)>
+ <TELL "\"." CR>
+ <RFALSE>)
+ (T)>>
+
+<ROUTINE ZMEMQ (ITM TBL "OPTIONAL" (SIZE -1) "AUX" (CNT 1))
+ <COND (<NOT .TBL> <RFALSE>)>
+ <COND (<NOT <L? .SIZE 0>> <SET CNT 0>)
+ (ELSE <SET SIZE <GET .TBL 0>>)>
+ <REPEAT ()
+ <COND (<==? .ITM <GET .TBL .CNT>> <RTRUE>)
+ (<IGRTR? CNT .SIZE> <RFALSE>)>>>
+
+<ROUTINE ZMEMQB (ITM TBL SIZE "AUX" (CNT 0))
+ #DECL ((ITM) ANY (TBL) TABLE (SIZE CNT) FIX)
+ <REPEAT ()
+ <COND (<==? .ITM <GETB .TBL .CNT>> <RTRUE>)
+ (<IGRTR? CNT .SIZE> <RFALSE>)>>>
+
+;<SETG ALWAYS-LIT <>>
+
+<ROUTINE LIT? (RM "AUX" OHERE (LIT <>))
+ #DECL ((RM OHERE) OBJECT (LIT) <OR ATOM FALSE>)
+ <SETG P-GWIMBIT ,ONBIT>
+ <SET OHERE ,HERE>
+ <SETG HERE .RM>
+ <COND (<FSET? .RM ,ONBIT> <SET LIT T>)
+ (T
+ <PUT ,P-MERGE ,P-MATCHLEN 0>
+ <SETG P-TABLE ,P-MERGE>
+ <SETG P-SLOCBITS -1>
+ <COND (<==? .OHERE .RM> <DO-SL ,WINNER 1 1>)>
+ <DO-SL .RM 1 1>
+ <COND (<G? <GET ,P-TABLE ,P-MATCHLEN> 0> <SET LIT T>)>)>
+ <SETG HERE .OHERE>
+ <SETG P-GWIMBIT 0>
+ .LIT>
+
+<ROUTINE VPRINT ("AUX" TMP)
+ <SET TMP <GET ,P-OTBL ,P-VERBN>>
+ <COND (<==? .TMP 0> <TELL "say">)
+ (<0? <GETB ,P-VTBL 2>>
+ <PRINTB <GET .TMP 0>>)
+ (T
+ <WORD-PRINT <GETB .TMP 2> <GETB .TMP 3>>)>>
+
+<ROUTINE PRSO-PRINT ("AUX" PTR)
+ <COND (<OR <G? <GET ,P-PRSO ,P-MATCHLEN> 1>
+ ,P-MERGED
+ <==? <GET <SET PTR <GET ,P-ITBL ,P-NC1>> 0> ,W?IT>>
+ <TELL " " D ,PRSO>)
+ (T <BUFFER-PRINT .PTR <GET ,P-ITBL ,P-NC1L> <>>)>>
+
+;<ROUTINE THE-PRSO-PRINT () <THE? ,PRSO> <TELL PRSO>>
+
+<ROUTINE PRSI-PRINT ("AUX" PTR)
+ <COND (<OR <G? <GET ,P-PRSI ,P-MATCHLEN> 1>
+ ,P-MERGED
+ <==? <GET <SET PTR <GET ,P-ITBL ,P-NC2>> 0> ,W?IT>>
+ <TELL " " D ,PRSI>)
+ (T <BUFFER-PRINT .PTR <GET ,P-ITBL ,P-NC2L> <>>)>>
+
+;<ROUTINE THE-PRSI-PRINT () <THE? ,PRSI> <TELL PRSI>>
+
+<ROUTINE THE? (OBJ)
+ <COND (<==? .OBJ ,NOT-HERE-OBJECT>
+ <TELL "any ">)
+ (<AND <NOT <FSET? .OBJ ,PERSON>>
+ <NOT <==? .OBJ ,PETES-PATCH>>>
+ <TELL "the ">)>>
+
+<ROUTINE START-SENTENCE (OBJ)
+ <COND (<EQUAL? .OBJ ,WEASEL>
+ <TELL "The Weasel">)
+ (<OR <FSET? .OBJ ,PERSON>
+ <==? .OBJ ,PETES-PATCH>>
+ <TELL D .OBJ>)
+ (T <TELL "The " D .OBJ>)>>
+
+<ROUTINE TELL-DONT-HAVE (STR)
+ <TELL "You don't have ">
+ <COND (.STR <TELL .STR "." CR>)>>
+
+<ROUTINE TELL-NO-KEY ()
+ <TELL-DONT-HAVE "the right key">>
diff --git a/people.zap b/people.zap
new file mode 100644
index 0000000..1a6a6eb
--- /dev/null
+++ b/people.zap
@@ -0,0 +1,1905 @@
+
+
+ .FUNCT TELL-NEVER-KNEW
+ PRINTR """Never heard of him."""
+
+
+ .FUNCT MCGINTY-F,RARG=0,OBJ,PFLAG=0
+ EQUAL? RARG,M-OBJDESC \?ELS3
+ ZERO? MCGINTY-KNOWS /?ELS6
+ JUMP ?CND4
+?ELS6: IN? PASSBOOK,PLAYER \?ELS9
+ CALL QUEUED?,I-MCGINTY-FOLLOWS
+ ZERO? STACK \?ELS9
+ SET 'PFLAG,1
+ CALL MCGINTY-WILL-FOLLOW
+ JUMP ?CND4
+?ELS9: IN? PASSBOOK,HERE \?CND4
+ CALL MCGINTY-WILL-FOLLOW
+ MOVE PASSBOOK,MCGINTY
+ SET 'PFLAG,2
+?CND4: CALL IN-MOTION?,MCGINTY
+ ZERO? STACK \TRUE
+ CALL QUEUED?,I-MCGINTY-FOLLOWS
+ ZERO? STACK /?ELS20
+ EQUAL? PRSA,V?FOLLOW,V?WALK \?ELS20
+ LOC PLAYER
+ IN? MCGINTY,STACK \TRUE
+?ELS20: CALL TRAITOR-TIME?
+ ZERO? STACK \TRUE
+ FSET? MCGINTY,TOUCHBIT \?ELS22
+ CALL DPRINT,MCGINTY
+ PRINTI " is here, "
+ EQUAL? HERE,OUTFITTERS-HQ \?ELS27
+ PRINTI "talking with the salesman"
+ JUMP ?CND25
+?ELS27: PRINTI "smoking his cigar"
+?CND25: PRINTI "."
+ JUMP ?CND14
+?ELS22: CALL DPRINT,MCGINTY
+ PRINTI ", a small, nervous man, is "
+ IN? MCGINTY,MCGINTY-HQ \?ELS42
+ PRINTI "sitting behind a desk"
+ JUMP ?CND40
+?ELS42: PRINTI "standing nearby"
+?CND40: PRINTI ". His lips clamp around a cigar too large for his face."
+ FSET MCGINTY,TOUCHBIT
+?CND14: EQUAL? PFLAG,1 \?ELS53
+ CALL TELL-EYES-NARROW
+ JUMP ?CND51
+?ELS53: EQUAL? PFLAG,2 \?CND51
+ CALL TELL-TAKE-PASS,STR?403
+?CND51: CRLF
+ RTRUE
+?ELS3: EQUAL? RARG,M-CONT \?CND1
+ EQUAL? PRSA,V?TAKE \FALSE
+ FSET? PRSO,TAKEBIT \FALSE
+ CALL DPRINT,MCGINTY
+ PRINTR " pulls it back. ""I'm not gonna give that to you!"""
+?CND1: EQUAL? WINNER,MCGINTY \?CND67
+ CALL META-LOC,PLAYER
+ IN? MCGINTY,STACK /?ELS72
+ SET 'P-CONT,FALSE-VALUE
+ CALL TELL-NOT-HERE-TALK
+ RETURN 2
+?ELS72: CALL TRAITOR-TIME?
+ ZERO? STACK /?CND67
+ CALL TELL-IN-MEETING
+ RETURN 2
+?CND67: FSET MCGINTY,TOUCHBIT
+ EQUAL? PRSA,V?FOLLOW \?ELS81
+ EQUAL? PRSO,MCGINTY /FALSE
+?ELS81: EQUAL? PRSA,V?$CALL \?ELS85
+ CALL TRAITOR-TIME?
+ ZERO? STACK /?ELS85
+ CALL TELL-IN-MEETING
+ RTRUE
+?ELS85: EQUAL? PRSA,V?HELLO \?ELS89
+ SET 'QCONTEXT,MCGINTY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR """Howdy."""
+?ELS89: EQUAL? PRSA,V?GOODBYE \?ELS93
+ SET 'QCONTEXT,MCGINTY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR """So long."""
+?ELS93: EQUAL? PRSA,V?TAKE \?ELS101
+ EQUAL? PRSI,MCGINTY /?THN98
+?ELS101: EQUAL? PRSA,V?ASK-FOR \?ELS97
+ EQUAL? PRSO,MCGINTY \?ELS97
+?THN98: EQUAL? PRSO,MCGINTY \?ELS106
+ SET 'OBJ,PRSI
+ JUMP ?CND104
+?ELS106: SET 'OBJ,PRSO
+?CND104: IN? OBJ,MCGINTY \?ELS111
+ PRINTR """I'm not gonna give that to you."""
+?ELS111: PRINTR """I don't have that."""
+?ELS97: EQUAL? PRSA,V?BUY \?CND79
+ EQUAL? PRSO,FERRY-TOKEN \?CND79
+ PRINTR """I don't have one. Try the bank."""
+?CND79: EQUAL? PRSA,V?$CALL \?ELS127
+ EQUAL? WINNER,PLAYER /FALSE
+?ELS127: CALL GRAB-ATTENTION,MCGINTY
+ ZERO? STACK /TRUE
+ EQUAL? PRSA,V?TELL \?ELS134
+ EQUAL? PRSO,MCGINTY \?ELS134
+ EQUAL? PRSI,SAMPLE-TREASURE,GLOBAL-TREASURE \?CND132
+ CALL TRAITOR-TIME?
+ ZERO? STACK /?ELS142
+ CALL JIGS-UP,STR?404
+ RTRUE
+?ELS142: ZERO? MCGINTY-KNOWS /?ELS144
+ PRINTR """Thanks, but I already know about it."""
+?ELS144: IN? SPEAR-CARRIER,HERE /?THN153
+ IN? JOHNNY,HERE /?THN153
+ IN? PETE,HERE /?THN153
+ IN? WEASEL,HERE \?ELS152
+?THN153: SET 'MCGINTY-KNOWS,TRUE-VALUE
+ CALL ZERO-ATTENTION,MCGINTY
+ GET GOAL-TABLES,MCGINTY-C
+ PUT STACK,GOAL-ENABLE,TRUE-VALUE
+ CALL DPRINT,MCGINTY
+ PRINTI " looks delighted with the information."
+ IN? MCGINTY,OUTFITTERS-HQ \?ELS159
+ CALL ESTABLISH-GOAL,MCGINTY,MCGINTY-HQ
+ IN? JOHNNY,OUTFITTERS-HQ \?ELS162
+ CALL SAY-MCGINTY-KNOWS
+ RTRUE
+?ELS162: PRINTI " He thanks you."
+ CALL TELL-NEED-BOAT
+ RTRUE
+?ELS159: CALL ESTABLISH-GOAL,MCGINTY,OUTFITTERS-HQ
+ CALL ALL-GO-HOME
+ CALL I-PLOT-NEVER-STARTS
+ CALL INT,I-SHOVE-OFF
+ PUT STACK,0,0
+ PRINTR " ""Excuse me,"" he says. ""I have business to attend to."""
+?ELS152: CALL JIGS-UP,STR?405
+ RTRUE
+?ELS134: EQUAL? PRSA,V?SHOW \?ELS174
+ EQUAL? PRSO,BOOK,NOTE \?ELS174
+ EQUAL? PRSI,MCGINTY \?ELS174
+ CALL PERFORM,V?TELL,MCGINTY,GLOBAL-TREASURE
+ RTRUE
+?ELS174: EQUAL? PRSA,V?ASK-ABOUT \?CND132
+ EQUAL? PRSO,MCGINTY \?CND132
+ CALL TRAITOR-TIME?
+ ZERO? STACK /?ELS183
+ CALL TELL-IN-MEETING
+ RETURN 2
+?ELS183: EQUAL? PRSI,GLOBAL-TREASURE \?ELS187
+ PRINTI """I'm always looking for "
+ CALL DPRINT,GLOBAL-TREASURE
+ PRINTR ","" he says, grinning."
+?ELS187: EQUAL? PRSI,SPEAR-CARRIER \?ELS191
+ PRINTR """He does his job."""
+?ELS191: EQUAL? PRSI,PETES-PATCH \?ELS195
+ PRINTR """All I know is that Pete wears it."""
+?ELS195: EQUAL? PRSI,CIGAR \?ELS199
+ PRINTR """Yeah. That's my cigar."""
+?ELS199: EQUAL? PRSI,HEVLIN \?ELS203
+ CALL TELL-NEVER-KNEW
+ RTRUE
+?ELS203: EQUAL? PRSI,WEASEL,PETE,JOHNNY \?ELS205
+ PRINTR """He's worked for me. He's all right."""
+?ELS205: EQUAL? PRSI,ME \?ELS209
+ CALL TELL-YOURE-DIVER
+ RTRUE
+?ELS209: EQUAL? PRSI,MCGINTY \?ELS211
+ CALL TELL-KNOW-ME
+ RTRUE
+?ELS211: EQUAL? PRSI,PARROT \?ELS213
+ PRINTR """It's the queerest bird I've ever seen."""
+?ELS213: EQUAL? PRSI,SALVAGER,TRAWLER \FALSE
+ PRINTR """She's a nice boat."""
+?CND132: EQUAL? WINNER,MCGINTY \FALSE
+ EQUAL? PRSO,GLOBAL-SELF \?CND227
+ SET 'PRSO,MCGINTY
+?CND227: EQUAL? PRSI,GLOBAL-SELF \?CND230
+ SET 'PRSI,MCGINTY
+?CND230: EQUAL? PRSA,V?TELL \?ELS237
+ EQUAL? PRSO,ME /FALSE
+?ELS237: EQUAL? PRSA,V?$CALL \?ELS241
+ CALL TELL-SO-WHAT
+ RSTACK
+?ELS241: EQUAL? PRSA,V?LEAVE,V?DISEMBARK,V?WALK \?ELS243
+ PRINTR """I'll leave when I'm ready."""
+?ELS243: EQUAL? PRSA,V?SHOW \?ELS247
+ IN? PRSO,MCGINTY \?ELS247
+ EQUAL? PRSI,ME \?ELS247
+ SET 'WINNER,PLAYER
+ CALL PERFORM,V?EXAMINE,PRSO
+ SET 'WINNER,MCGINTY
+ RETURN WINNER
+?ELS247: EQUAL? PRSA,V?MAYBE,V?NO,V?YES /FALSE
+ EQUAL? PRSA,V?SSHOW,V?FIND,V?WHAT /FALSE
+ EQUAL? PRSA,V?ALARM /FALSE
+ PRINTI """I'd rather not."""
+ CRLF
+ RETURN 2
+
+
+ .FUNCT ZERO-ATTENTION,PER
+ GETP PER,P?CHARACTER
+ GET GOAL-TABLES,STACK
+ PUT STACK,ATTENTION,0
+ RTRUE
+
+
+ .FUNCT TELL-SO-WHAT
+ FSET? PRSO,VICBIT \?ELS5
+ PRINTR """What about him?"""
+?ELS5: CALL V-CALL-LOSE
+ RSTACK
+
+
+ .FUNCT TELL-TAKE-PASS,STR
+ PRINT STR
+ PRINTI " sees the passbook, picks it up, looks at it and then at you."
+ RTRUE
+
+
+ .FUNCT TRAITOR-TIME?
+ IN? ID-CARD,WEASEL \FALSE
+ CALL QUEUED?,I-TRAITOR-MEETING
+ ZERO? STACK \TRUE
+ RFALSE
+
+
+ .FUNCT TELL-IN-MEETING
+ PRINTR "He's too engrossed in his meeting to hear you."
+
+
+ .FUNCT MCGINTY-ERRAND
+ MOVE PLAYER,WHARF-ROAD-2
+ MOVE MCGINTY,WHARF-ROAD-2
+ SET 'HERE,WHARF-ROAD-2
+ PRINTI """I'm closing to run an errand,"" "
+ CALL DPRINT,MCGINTY
+ PRINTI " says, ushering you out..."
+ CRLF
+ CRLF
+ CALL V-FIRST-LOOK
+ RSTACK
+
+
+ .FUNCT I-MCGINTY,GARG=0,L,DEST,MMG,V=0
+ LOC MCGINTY >L
+ ZERO? GARG \?ELS5
+ GET MOVEMENT-GOALS,MCGINTY-C >MMG
+ IN? MCGINTY,MCGINTY-HQ \?CND6
+ IN? PLAYER,MCGINTY-HQ \?CND6
+ GET MMG,MG-ROOM
+ EQUAL? STACK,MCGINTY-HQ /?CND6
+ CALL MCGINTY-ERRAND
+ SET 'V,TRUE-VALUE
+?CND6: EQUAL? L,FERRY-LANDING \?CND11
+ SET 'MCGINTY-MEETS-WEASEL,FALSE-VALUE
+?CND11: CALL IMOVEMENT,MCGINTY,I-MCGINTY
+ RETURN V
+?ELS5: EQUAL? GARG,G-REACHED \?ELS15
+ EQUAL? L,MCGINTY-HQ \?ELS20
+ IN? PLAYER,L \?ELS23
+ CALL JIGS-UP,STR?406
+ JUMP ?CND21
+?ELS23: IN? PLAYER,WHARF-ROAD-2 \?ELS25
+ EQUAL? LAST-PLAYER-LOC,MCGINTY-HQ \?ELS25
+ CALL JIGS-UP,STR?407
+ JUMP ?CND21
+?ELS25: IN? ID-CARD,MCGINTY \?ELS29
+ MOVE ID-CARD,ENVELOPE
+ FSET ID-CARD,TAKEBIT
+ FCLEAR ENVELOPE,INVISIBLE
+ JUMP ?CND21
+?ELS29: ZERO? MCGINTY-KNOWS \?CND21
+ ZERO? MCGINTY-MEETS-WEASEL /?CND21
+ GET MOVEMENT-GOALS,MCGINTY-C
+ GET STACK,MG-ROOM
+ EQUAL? STACK,SHANTY \?CND21
+ PUT MOVEMENT-GOALS,MCGINTY-C,MCGINTY-MEETS-WEASEL-TABLE
+ CALL IMOVEMENT,MCGINTY,I-MCGINTY
+ RFALSE
+?CND21: IN? PLAYER,BACK-ALLEY-2 \FALSE
+ FSET? WINDOW,OPENBIT \FALSE
+ PRINTI "The window gets slammed shut."
+ CRLF
+ FCLEAR BACK-WINDOW,OPENBIT
+ RTRUE
+?ELS20: EQUAL? L,FERRY-LANDING \?ELS44
+ CALL QUEUE,I-TRAITOR-MEETING,-1
+ PUT STACK,0,1
+ IN? PLAYER,L \?CND45
+ CALL DPRINT,MCGINTY
+ PRINTI " wanders in, looking preoccupied."
+ CRLF
+ SET 'V,TRUE-VALUE
+?CND45: IN? WEASEL,L \?CND50
+ CALL I-TRAITOR-MEETING
+ RETURN V
+?CND50: RETURN V
+?ELS44: EQUAL? L,HERE \?ELS54
+ CALL DPRINT,MCGINTY
+ PRINTI " wanders in."
+ IN? PASSBOOK,PLAYER \?ELS59
+ ZERO? MCGINTY-KNOWS \?ELS59
+ CALL QUEUED?,I-MCGINTY-FOLLOWS
+ ZERO? STACK \?ELS59
+ CALL MCGINTY-WILL-FOLLOW
+ CALL TELL-EYES-NARROW
+ JUMP ?CND57
+?ELS59: IN? PASSBOOK,L \?CND57
+ SET 'MCGINTY-MEETS-WEASEL,TRUE-VALUE
+?CND57: CRLF
+ RETURN 2
+?ELS54: IN? PASSBOOK,L \FALSE
+ MOVE PASSBOOK,MCGINTY
+ SET 'MCGINTY-MEETS-WEASEL,TRUE-VALUE
+ RFALSE
+?ELS15: EQUAL? GARG,G-ENROUTE \FALSE
+ IN? PLAYER,L \?ELS74
+ IN? PASSBOOK,PLAYER \?ELS74
+ ZERO? MCGINTY-KNOWS \?ELS74
+ CALL QUEUED?,I-MCGINTY-FOLLOWS
+ ZERO? STACK \?ELS74
+ CALL MCGINTY-WILL-FOLLOW
+ CALL TELL-EYES-NARROW,FALSE-VALUE
+ CRLF
+ RTRUE
+?ELS74: IN? PASSBOOK,L \FALSE
+ ZERO? MCGINTY-KNOWS \FALSE
+ CALL META-LOC,PLAYER
+ IN? MCGINTY,STACK \?ELS85
+ CALL MCGINTY-WILL-FOLLOW
+ MOVE PASSBOOK,MCGINTY
+ CALL TELL-TAKE-PASS,STR?408
+ CRLF
+ RTRUE
+?ELS85: SET 'MCGINTY-MEETS-WEASEL,TRUE-VALUE
+ MOVE PASSBOOK,MCGINTY
+ RFALSE
+
+
+ .FUNCT TELL-EYES-NARROW,SPACE=1
+ ZERO? ALREADY-FOLLOWED \FALSE
+ ZERO? SPACE /?CND6
+ PRINTI " "
+?CND6: PRINTI "As he looks at you, he does a double take and stares intently at your possessions."
+ RTRUE
+
+
+ .FUNCT MCGINTY-WILL-FOLLOW,GT
+ ZERO? MCGINTY-KNOWS \FALSE
+ GET GOAL-TABLES,MCGINTY-C >GT
+ PUT GT,GOAL-ENABLE,FALSE-VALUE
+ PUT GT,GOAL-F,WRECK-13
+ PUT GT,ATTENTION,500
+ CALL INT,I-MCGINTY
+ PUT STACK,0,0
+ CALL QUEUE,I-MCGINTY-FOLLOWS,-1
+ PUT STACK,0,1
+ RTRUE
+
+
+ .FUNCT I-MCGINTY-FOLLOWS,GT,MCG-LOC
+ LOC MCGINTY >MCG-LOC
+ GRTR? PRESENT-TIME,810 \?CND1
+ ZERO? ALREADY-FOLLOWED \?CND1
+ CALL INT,I-MCGINTY-FOLLOWS
+ PUT STACK,0,0
+ GET GOAL-TABLES,MCGINTY-C >GT
+ PUT GT,ATTENTION,0
+ PUT GT,GOAL-ENABLE,TRUE-VALUE
+ SET 'ALREADY-FOLLOWED,TRUE-VALUE
+ CALL ESTABLISH-GOAL,MCGINTY,MCGINTY-HQ
+ RFALSE
+?CND1: GET GOAL-TABLES,MCGINTY-C
+ PUT STACK,ATTENTION,5
+ EQUAL? HERE,OUTFITTERS-HQ \?ELS10
+ EQUAL? MCG-LOC,WHARF-ROAD-4 \?ELS10
+ CALL MOVE-PERSON,MCGINTY,OUTFITTERS-HQ
+ RSTACK
+?ELS10: EQUAL? HERE,MCG-LOC,LAST-PLAYER-LOC /FALSE
+ EQUAL? MCG-LOC,LAST-PLAYER-LOC /FALSE
+ CALL META-LOC,LAST-PLAYER-LOC
+ EQUAL? LAST-PLAYER-LOC,STACK \FALSE
+ CALL MOVE-PERSON,MCGINTY,LAST-PLAYER-LOC
+ RSTACK
+
+
+ .FUNCT CIGAR-F
+ EQUAL? PRSA,V?TAKE \?ELS5
+ CALL DPRINT,MCGINTY
+ PRINTR " yanks it back, then tenderly clamps it between his teeth."
+?ELS5: EQUAL? PRSA,V?LAMP-ON \?ELS9
+ CALL TELL-ALREADY,STR?410
+ RSTACK
+?ELS9: EQUAL? PRSA,V?SMELL \FALSE
+ PRINTR "The cigar smells like a burning tire."
+
+
+ .FUNCT JOHNNY-F,RARG=0,TREAS,?TMP1
+ EQUAL? RARG,M-OBJDESC \?ELS3
+ CALL QUEUED?,I-PENDULUM
+ ZERO? STACK /?ELS6
+ CALL INT,I-PENDULUM
+ GET STACK,C-TICK
+ EQUAL? STACK,-1 /TRUE
+?ELS6: CALL IN-MOTION?,JOHNNY
+ ZERO? STACK \TRUE
+ EQUAL? HERE,MM-AFT-DECK,NW-AFT-DECK \?ELS12
+ ZERO? WEASEL-APPREHENDED /?ELS12
+ CALL QUEUED?,I-PENDULUM
+ ZERO? STACK \?ELS12
+ CALL I-JOHNNY,G-REACHED
+ RTRUE
+?ELS12: FSET? JOHNNY,TOUCHBIT \?ELS16
+ CALL DPRINT,JOHNNY
+ PRINTI " is here"
+ IN? SPEAR-CARRIER,HERE \?CND19
+ IN? MCGINTY,HERE \?ELS24
+ PRINTI ", glaring at "
+ CALL DPRINT,MCGINTY
+ JUMP ?CND19
+?ELS24: LESS? FM-CTR,2 /?THN31
+ GRTR? FM-CTR,4 \?CND19
+?THN31: EQUAL? PRESENT-TIME,704 /?CND19
+ PRINTI ", chatting with the "
+ CALL DPRINT,SPEAR-CARRIER
+?CND19: PRINTR "."
+?ELS16: CALL DPRINT,JOHNNY
+ PRINTI " is here. Red hair sprouts from his head and from beneath his flannel shirt."
+ CRLF
+ FSET JOHNNY,TOUCHBIT
+ RTRUE
+?ELS3: EQUAL? RARG,M-CONT \?CND1
+ EQUAL? PRSA,V?TAKE \?ELS45
+ FSET? PRSO,TAKEBIT \?ELS45
+ PRINTR "Johnny glares down at you. ""Get your hands off of that!"""
+?ELS45: EQUAL? KNIFE,PRSO,PRSI \FALSE
+ EQUAL? PRSA,V?ASK-ABOUT,V?FIND,V?EXAMINE /FALSE
+ EQUAL? PRSA,V?ASK-CONTEXT-ABOUT /FALSE
+ PRINTI "Johnny pulls it back. ""I'm not gonna let you give this to "
+ CALL DPRINT,WEASEL
+ PRINTR "."""
+?CND1: EQUAL? JOHNNY,WINNER \?CND60
+ CALL META-LOC,JOHNNY >?TMP1
+ CALL META-LOC,PLAYER
+ EQUAL? ?TMP1,STACK /?CND60
+ SET 'P-CONT,FALSE-VALUE
+ CALL TELL-NOT-HERE-TALK
+ RETURN 2
+?CND60: FSET JOHNNY,TOUCHBIT
+ EQUAL? PRSA,V?FOLLOW \?ELS69
+ EQUAL? PRSO,JOHNNY /FALSE
+?ELS69: EQUAL? PRSA,V?TELL \?ELS73
+ ZERO? PRSI /FALSE
+?ELS73: ZERO? MCGINTY-KNOWS \?THN78
+ ZERO? JOHNNY-SILENT /?ELS77
+?THN78: CALL DPRINT,JOHNNY
+ PRINTI " looks right through you."
+ CRLF
+ RETURN 2
+?ELS77: EQUAL? PRSA,V?GOODBYE,V?HELLO \?ELS85
+ SET 'QCONTEXT,JOHNNY
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR """Ahoy, matey."""
+?ELS85: EQUAL? PRSA,V?BUY \?CND67
+ EQUAL? PRSO,FERRY-TOKEN \?CND67
+ PRINTI """Try "
+ CALL DPRINT,BANK
+ PRINTR "."""
+?CND67: EQUAL? PRSA,V?$CALL \?ELS97
+ EQUAL? WINNER,PLAYER /FALSE
+?ELS97: CALL GRAB-ATTENTION,JOHNNY
+ ZERO? STACK /TRUE
+ EQUAL? PRSA,V?SHOW,V?GIVE \?ELS104
+ EQUAL? PRSO,CHARTS \?ELS104
+ PRINTR """No thanks. I have my own."""
+?ELS104: EQUAL? PRSA,V?SHOW \?ELS114
+ EQUAL? PRSO,NOTE /?THN111
+?ELS114: EQUAL? PRSA,V?ASK-ABOUT \?ELS110
+ EQUAL? PRSI,NOTE \?ELS110
+?THN111: PRINTR """Yeah. I wrote that."""
+?ELS110: EQUAL? PRSA,V?GIVE \?ELS120
+ EQUAL? PRSO,ENVELOPE /?THN123
+ EQUAL? PRSO,ID-CARD \?ELS120
+?THN123: IN? ID-CARD,ENVELOPE /?CND125
+ CALL TELL-RETURNS,JOHNNY
+?CND125: CALL PERFORM,V?SHOW,PRSO,JOHNNY
+ RTRUE
+?ELS120: EQUAL? PRSA,V?SHOW \?ELS129
+ EQUAL? PRSI,JOHNNY \?ELS129
+ IN? ID-CARD,ENVELOPE \?ELS134
+ EQUAL? PRSO,ENVELOPE /?THN137
+ EQUAL? PRSO,ID-CARD \?ELS134
+?THN137: PRINTI "Johnny takes the card and "
+ CALL DPRINT,ENVELOPE
+ PRINTI " and studies them. "
+ ZERO? WEASEL-APPREHENDED /?ELS143
+ CALL TELL-ALREADY-SHOWN
+ PRINTI ","" he says, handing the "
+ CALL DPRINT,ENVELOPE
+ PRINTI " back."
+ JUMP ?CND141
+?ELS143: ZERO? CLUMSILY-HANDLED /?ELS148
+ PRINTI """You trying to frame "
+ CALL DPRINT,WEASEL
+ PRINTI "?"" He returns the "
+ CALL DPRINT,ENVELOPE
+ PRINTI "."
+ JUMP ?CND141
+?ELS148: MOVE ENVELOPE,JOHNNY
+ PRINTI """So,"" he muses, """
+ CALL DPRINT,WEASEL
+ PRINTI " is working with "
+ CALL DPRINT,MCGINTY
+ PRINTI ". I'll take care of him."""
+ SET 'WEASEL-BLOWN,TRUE-VALUE
+ LOC JOHNNY
+ IN? WEASEL,STACK \?ELS158
+ CALL ROUGH-JUSTICE
+ JUMP ?CND141
+?ELS158: IN? WEASEL,FERRY /?THN161
+ IN? WEASEL,GLOBAL-FERRY \?ELS160
+?THN161: CALL ESTABLISH-GOAL,JOHNNY,FERRY-LANDING
+ JUMP ?CND141
+?ELS160: CALL META-LOC,WEASEL
+ CALL ESTABLISH-GOAL,JOHNNY,STACK
+?CND141: CRLF
+ RTRUE
+?ELS134: EQUAL? PRSO,ENVELOPE \?ELS166
+ ZERO? WEASEL-BLOWN /?ELS169
+ CALL TELL-ALREADY-SHOWN
+ JUMP ?CND167
+?ELS169: PRINTI """It's empty. It don't mean nothing"
+ SET 'CLUMSILY-HANDLED,TRUE-VALUE
+?CND167: PRINTR "."""
+?ELS166: EQUAL? PRSO,ID-CARD \?CND102
+ ZERO? WEASEL-BLOWN /?ELS181
+ CALL TELL-ALREADY-SHOWN
+ JUMP ?CND179
+?ELS181: PRINTI """That's "
+ CALL DPRINT,WEASEL
+ PRINTI "'s. He'll be glad you found it"
+ SET 'CLUMSILY-HANDLED,TRUE-VALUE
+?CND179: PRINTR "."""
+?ELS129: EQUAL? PRSA,V?ASK-ABOUT \?CND102
+ EQUAL? PRSO,JOHNNY \?CND102
+ EQUAL? PRSI,SHARK,SAMPLE-TREASURE,GLOBAL-TREASURE \?ELS195
+ IN? MCGINTY,HERE \?ELS198
+ CALL MCGINTY-AND-TREASURE,GLOBAL-TREASURE
+ RTRUE
+?ELS198: CALL ENABLED?,I-JOHNNY
+ ZERO? STACK /?THN201
+ ZERO? SAMPLE-TREASURE \?ELS200
+?THN201: PRINTI "Red scowls. ""What "
+ CALL DPRINT,GLOBAL-TREASURE
+ PRINTR "?"""
+?ELS200: LESS? SM-CTR,2 \?ELS206
+ PRINTR """All in good time."""
+?ELS206: LESS? TM-CTR,7 /?THN211
+ IN? WEASEL,HERE /?THN211
+ IN? PETE,HERE /?THN211
+ IN? SPEAR-CARRIER,HERE \?ELS210
+?THN211: PRINTI """I told you. I found a "
+ CALL DPRINT,SAMPLE-TREASURE
+ PRINTR " while I was cleaning a shark."""
+?ELS210: EQUAL? PRSI,SHARK \?ELS216
+ PRINTR """I made that up."""
+?ELS216: PRINTR """Hevlin gave it to me."""
+?ELS195: EQUAL? PRSI,BOOK \?ELS224
+ LESS? TM-CTR,7 /FALSE
+ IN? WEASEL,HERE /FALSE
+ IN? PETE,HERE /FALSE
+ IN? SPEAR-CARRIER,HERE /FALSE
+ PRINTR """That's the one Hevlin gave you."""
+?ELS224: EQUAL? PRSI,PETES-PATCH \?ELS235
+ PRINTR """Pete's worn it a long time."""
+?ELS235: EQUAL? PRSI,HEVLIN \?ELS239
+ PRINTR """He was an old friend of mine."""
+?ELS239: EQUAL? PRSI,SPEAR-CARRIER \?ELS243
+ PRINTR """You know him as well as I do."""
+?ELS243: EQUAL? PRSI,ME \?ELS247
+ CALL TELL-YOURE-DIVER
+ RTRUE
+?ELS247: EQUAL? PRSI,WEASEL \?ELS249
+ PRINTI """The Weasel? "
+ ZERO? WEASEL-BLOWN /?ELS254
+ PRINTI "Lower than a sea slug..."""
+ JUMP ?CND252
+?ELS254: IN? WEASEL,HERE \?ELS259
+ PRINTI "He's my pal."""
+ CALL TELL-FERRY-KLUDGE,STR?412
+ JUMP ?CND252
+?ELS259: PRINTI "I wouldn't trust him farther than I could throw a whale! But he's a great one-man crew."""
+?CND252: CRLF
+ RTRUE
+?ELS249: EQUAL? PRSI,MCGINTY \?ELS267
+ IN? MCGINTY,HERE \?ELS270
+ PRINTC 34
+ CALL DPRINT,MCGINTY
+ PRINTR "'s one of my favorite people to work for!"""
+?ELS270: PRINTR """That man would sell his mother for a profit!"""
+?ELS267: EQUAL? PRSI,PETE \?ELS278
+ IN? PETE,HERE \?CND279
+ PRINTI "Johnny leans over and mutters, "
+?CND279: PRINTR """Pete's no genius, but he's dependable. He got a bad name 'cause of what happened, him serving his mates rats for mess. But he'll never make that mistake again!"""
+?ELS278: EQUAL? PRSI,JOHNNY \?ELS287
+ CALL TELL-KNOW-ME
+ RTRUE
+?ELS287: EQUAL? PRSI,PARROT \?ELS289
+ PRINTI """It's what makes "
+ CALL DPRINT,SHANTY
+ PRINTR " what it is."""
+?ELS289: EQUAL? PRSI,SALVAGER,TRAWLER \?ELS293
+ PRINTR """It's one of Outfitters' boats."""
+?ELS293: EQUAL? PRSI,LINE-HACK \FALSE
+ PRINT LINE-STR
+ CRLF
+ RTRUE
+?CND102: EQUAL? WINNER,JOHNNY \FALSE
+ EQUAL? PRSO,GLOBAL-SELF \?CND307
+ SET 'PRSO,JOHNNY
+?CND307: EQUAL? PRSI,GLOBAL-SELF \?CND310
+ SET 'PRSI,JOHNNY
+?CND310: IN? MCGINTY,HERE \?CND313
+ EQUAL? PRSO,SAMPLE-TREASURE,GLOBAL-TREASURE \?ELS318
+ SET 'TREAS,PRSO
+ JUMP ?CND316
+?ELS318: EQUAL? PRSI,GLOBAL-TREASURE,SAMPLE-TREASURE \?CND316
+ SET 'TREAS,PRSI
+?CND316: ZERO? TREAS /?CND313
+ CALL MCGINTY-AND-TREASURE,TREAS
+ RTRUE
+?CND313: EQUAL? PRSA,V?TELL \?ELS329
+ EQUAL? PRSO,ME /FALSE
+?ELS329: EQUAL? PRSA,V?$CALL \?ELS333
+ CALL TELL-SO-WHAT
+ RSTACK
+?ELS333: EQUAL? PRSA,V?SHOW \?ELS335
+ IN? PRSO,JOHNNY \?ELS335
+ EQUAL? PRSI,ME \?ELS335
+ SET 'WINNER,PLAYER
+ CALL PERFORM,V?EXAMINE,PRSO
+ SET 'WINNER,JOHNNY
+ RETURN WINNER
+?ELS335: EQUAL? PRSA,V?MAYBE,V?NO,V?YES /FALSE
+ EQUAL? PRSA,V?WHAT,V?LONGITUDE,V?LATITUDE /FALSE
+ EQUAL? PRSA,V?ALARM,V?SSHOW,V?FIND /FALSE
+ PRINTI """I'll do what I want."""
+ CRLF
+ RETURN 2
+
+
+ .FUNCT MCGINTY-AND-TREASURE,TRE
+ CALL MCGINTY-WILL-FOLLOW
+ PRINTI "Johnny looks at "
+ CALL DPRINT,MCGINTY
+ PRINTI " and then at you. ""What "
+ CALL DPRINT,TRE
+ PRINTR "?"""
+
+
+ .FUNCT TELL-RETURNS,PER
+ CALL START-SENTENCE,PER
+ PRINTI " looks at the "
+ CALL DPRINT,PRSO
+ PRINTI " and hands it back to you. "
+ RTRUE
+
+
+ .FUNCT TELL-ALREADY-SHOWN
+ CALL TELL-YOU-ALREADY,STR?413,TRUE-VALUE,FALSE-VALUE
+ RSTACK
+
+
+ .FUNCT TELL-YOU-ALREADY,STR,QUOTE?=0,DONE=1
+ ZERO? QUOTE? /?CND1
+ PRINTI """"
+?CND1: PRINTI "You already "
+ PRINT STR
+ ZERO? DONE /FALSE
+ CRLF
+ RTRUE
+
+
+ .FUNCT I-JOHNNY,GARG=0,L,JMG,V,?TMP1
+ LOC JOHNNY >L
+ ZERO? GARG \?ELS5
+ ZERO? WEASEL-BLOWN \FALSE
+ GRTR? FM-CTR,1 \?ELS15
+ LESS? FM-CTR,5 /?THN12
+?ELS15: GRTR? TM-CTR,0 \?CND6
+ LESS? TM-CTR,8 \?CND6
+?THN12: CALL QUEUE,I-JOHNNY,1
+ PUT STACK,0,1
+ RFALSE
+?CND6: GET MOVEMENT-GOALS,JOHNNY-C >JMG
+ GET JMG,MG-ROOM
+ EQUAL? STACK,MM-CAPT-CABIN \?CND18
+ EQUAL? SHIP-CHOSEN,TRAWLER \?CND18
+ PUT JMG,MG-ROOM,NW-CAPT-CABIN
+?CND18: CALL IMOVEMENT,JOHNNY,I-JOHNNY
+ RSTACK
+?ELS5: EQUAL? GARG,G-REACHED \?ELS24
+ ZERO? WEASEL-APPREHENDED /?ELS27
+ EQUAL? L,MM-LOUNGE,NW-LOUNGE \?ELS31
+ LOC WEASEL
+ IN? PLAYER,STACK \?CND32
+ CALL TELL-JOHNNY-DRAGS
+?CND32: MOVE WEASEL,L
+ EQUAL? SHIP-CHOSEN,TRAWLER \?ELS37
+ CALL ESTABLISH-GOAL,JOHNNY,NW-AFT-DECK
+ JUMP ?CND35
+?ELS37: CALL ESTABLISH-GOAL,JOHNNY,MM-AFT-DECK
+?CND35: IN? PLAYER,L \TRUE
+ PRINTI "Johnny drags "
+ CALL DPRINT,WEASEL
+ PRINTR " in, ties him up, and throws him to the floor."
+?ELS31: EQUAL? L,MM-AFT-DECK,NW-AFT-DECK \?CND25
+ CALL QUEUED?,I-PENDULUM
+ ZERO? STACK \?CND25
+ IN? PLAYER,L \?CND25
+ CALL QUEUE,I-PENDULUM,-1
+ PUT STACK,0,1
+ FCLEAR LINE-HACK,INVISIBLE
+ MOVE LINE-HACK,L
+ PRINTI "Johnny approaches, throws a weighted "
+ CALL DPRINT,SAFETY-LINE
+ PRINTI " over the side, and says, "
+ PRINT LINE-STR
+ CRLF
+ RTRUE
+?ELS27: ZERO? WEASEL-BLOWN /?ELS55
+ CALL META-LOC,WEASEL
+ EQUAL? L,STACK \?ELS59
+ CALL ROUGH-JUSTICE
+ JUMP ?CND25
+?ELS59: IN? WEASEL,GLOBAL-FERRY /FALSE
+ IN? WEASEL,FERRY /FALSE
+ IN? WEASEL,LOCAL-GLOBALS /FALSE
+ GET GOAL-TABLES,JOHNNY-C
+ GET STACK,GOAL-F >?TMP1
+ CALL META-LOC,WEASEL
+ EQUAL? ?TMP1,STACK /?CND25
+ CALL META-LOC,WEASEL
+ CALL ESTABLISH-GOAL,JOHNNY,STACK
+ RFALSE
+?ELS55: EQUAL? L,OUTFITTERS-HQ \?CND25
+ EQUAL? MEETINGS-COMPLETED,3 \?CND25
+ CALL QUEUE,I-EQUIP,-1
+ PUT STACK,0,1
+?CND25: EQUAL? L,HERE \FALSE
+ CALL DPRINT,JOHNNY
+ PRINTI " appears, striding like a proud lion."
+ CRLF
+ CALL QUEUED?,I-THIRD-MEETING
+ ZERO? STACK /?CND82
+ CALL I-THIRD-MEETING
+?CND82: RETURN 2
+?ELS24: EQUAL? GARG,G-ENROUTE \FALSE
+ ZERO? WEASEL-BLOWN /FALSE
+ ZERO? WEASEL-APPREHENDED /?ELS99
+ LOC WEASEL
+ EQUAL? STACK,MM-LOUNGE,NW-LOUNGE /FALSE
+ IN? WEASEL,L \?CND106
+ SET 'V,TRUE-VALUE
+?CND106: MOVE WEASEL,L
+ ZERO? V \?THN114
+ IN? PLAYER,L \FALSE
+?THN114: CALL TELL-JOHNNY-DRAGS
+ RSTACK
+?ELS99: CALL META-LOC,WEASEL
+ EQUAL? L,STACK \?ELS122
+ CALL ROUGH-JUSTICE
+ RSTACK
+?ELS122: IN? WEASEL,GLOBAL-FERRY /FALSE
+ IN? WEASEL,FERRY /FALSE
+ IN? WEASEL,LOCAL-GLOBALS /FALSE
+ GET GOAL-TABLES,JOHNNY-C
+ GET STACK,GOAL-F >?TMP1
+ CALL META-LOC,WEASEL
+ EQUAL? ?TMP1,STACK /FALSE
+ CALL META-LOC,WEASEL
+ CALL ESTABLISH-GOAL,JOHNNY,STACK
+ RFALSE
+
+
+ .FUNCT TELL-JOHNNY-DRAGS
+ PRINTI "Johnny drags "
+ CALL DPRINT,WEASEL
+ PRINTR " along with him."
+
+
+ .FUNCT ROUGH-JUSTICE,PRINT?=0
+ LOC JOHNNY
+ IN? PLAYER,STACK \?CND1
+ SET 'PRINT?,TRUE-VALUE
+ CRLF
+ PRINTI "Johnny grabs "
+ CALL DPRINT,WEASEL
+ PRINTI " and his knife. ""All right, slime. Thought you and "
+ CALL DPRINT,MCGINTY
+ PRINTI " could rip us off, huh?"" Before he turns to lead "
+ CALL DPRINT,WEASEL
+ PRINTI " away, "
+?CND1: ZERO? AT-SEA /?ELS10
+ SET 'WEASEL-APPREHENDED,TRUE-VALUE
+ MOVE KNIFE,JOHNNY
+ LOC LOUNGE-CHAIR
+ CALL ESTABLISH-GOAL,JOHNNY,STACK
+ RSTACK
+?ELS10: ZERO? PRINT? /?ELS16
+ PRINTI "Johnny says, ""We'd have to find someone else to crew. I better call it off."" You head for "
+ CALL DPRINT,SHANTY
+ PRINTI ", wishing you had more to do today than drink."
+ CRLF
+ JUMP ?CND14
+?ELS16: CALL TELL-COMES-UP,JOHNNY
+ PRINTI """I've taken care of "
+ CALL DPRINT,WEASEL
+ PRINTI ", but we can't go out without a crew. Maybe next time."""
+ CRLF
+?CND14: CALL FINISH
+ RSTACK
+
+
+ .FUNCT TELL-COMES-UP,WHO
+ CALL START-SENTENCE,WHO
+ PRINTI " comes up to you and says, "
+ RTRUE
+
+
+ .FUNCT PETE-F,RARG=0,?TMP1
+ EQUAL? RARG,M-OBJDESC \?ELS3
+ CALL IN-MOTION?,PETE
+ ZERO? STACK \TRUE
+ LOC PETE
+ EQUAL? STACK,MM-GALLEY,NW-GALLEY \?ELS8
+ CALL DPRINT,PETE
+ PRINTR " is watching over his stew."
+?ELS8: GRTR? FM-CTR,1 \?ELS16
+ LESS? FM-CTR,5 /?THN13
+?ELS16: EQUAL? PRESENT-TIME,704 \?ELS12
+?THN13: CALL DPRINT,PETE
+ PRINTR " is sitting here, listening intently."
+?ELS12: FSET? PETE,TOUCHBIT \?ELS20
+ CALL DPRINT,PETE
+ PRINTR " fiddles with his eyepatch, shifting his weight from foot to foot."
+?ELS20: PRINTI "A man wearing an eyepatch, black turtleneck, and jeans is standing about. He is known as "
+ CALL DPRINT,PETE
+ PRINTI "."
+ CRLF
+ FSET PETE,TOUCHBIT
+ RTRUE
+?ELS3: EQUAL? RARG,M-CONT \?CND1
+ EQUAL? PRSA,V?TAKE \FALSE
+ FSET? PRSO,TAKEBIT \FALSE
+ PRINTR "Pete pulls it back. ""That's mine!"""
+?CND1: EQUAL? WINNER,PETE \?CND38
+ CALL META-LOC,PETE >?TMP1
+ CALL META-LOC,PLAYER
+ EQUAL? ?TMP1,STACK /?CND38
+ SET 'P-CONT,FALSE-VALUE
+ CALL TELL-NOT-HERE-TALK
+ RETURN 2
+?CND38: FSET PETE,TOUCHBIT
+ EQUAL? PRSA,V?FOLLOW \?ELS47
+ EQUAL? PRSO,PETE /FALSE
+?ELS47: EQUAL? PRSA,V?HELLO \?ELS51
+ SET 'QCONTEXT,PETE
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR """Hi."""
+?ELS51: EQUAL? PRSA,V?GOODBYE \?ELS55
+ SET 'QCONTEXT,PETE
+ SET 'QCONTEXT-ROOM,HERE
+ PRINTR """Bye."""
+?ELS55: EQUAL? PRSA,V?SMELL \?ELS59
+ PRINTR "Phew! Better stay upwind of him."
+?ELS59: EQUAL? PRSA,V?BUY \?CND45
+ EQUAL? PRSO,FERRY-TOKEN \?CND45
+ PRINTR "Pete checks his pockets, then holds out his empty hands."
+?CND45: EQUAL? PRSA,V?$CALL \?ELS71
+ EQUAL? WINNER,PLAYER /FALSE
+?ELS71: CALL GRAB-ATTENTION,PETE
+ ZERO? STACK /TRUE
+ EQUAL? PRSA,V?GIVE \?ELS78
+ EQUAL? PRSO,ENVELOPE /?THN81
+ EQUAL? PRSO,ID-CARD \?ELS78
+?THN81: IN? ID-CARD,ENVELOPE /?CND83
+ CALL TELL-RETURNS,PETE
+?CND83: CALL PERFORM,V?SHOW,PRSO,PETE
+ RTRUE
+?ELS78: EQUAL? PRSA,V?SHOW \?ELS87
+ EQUAL? PRSI,PETE \?ELS87
+ IN? ID-CARD,ENVELOPE \?ELS92
+ EQUAL? PRSO,ENVELOPE /?THN95
+ EQUAL? PRSO,ID-CARD \?ELS92
+?THN95: PRINTI "Pete takes the "
+ CALL DPRINT,ENVELOPE
+ PRINTI ", studies it, then returns it. ""Looks like "
+ CALL DPRINT,WEASEL
+ PRINTR "'s card to me,"" he says."
+?ELS92: EQUAL? PRSO,ENVELOPE \?ELS100
+ PRINTR """Looks like it's empty."""
+?ELS100: EQUAL? PRSO,ID-CARD \?CND76
+ PRINTI """Looks like "
+ CALL DPRINT,WEASEL
+ PRINTR "'s card. Better return it."""
+?ELS87: EQUAL? PRSA,V?ASK-ABOUT \?CND76
+ EQUAL? PRSO,PETE \?CND76
+ EQUAL? PRSI,GLOBAL-TREASURE \?ELS113
+ IN? MCGINTY,HERE \?CND114
+ CALL MCGINTY-WILL-FOLLOW
+?CND114: LESS? FM-CTR,3 \?ELS119
+ PRINTR """I think that's what Johnny wants to talk about."""
+?ELS119: GETP HERE,P?LINE
+ LESS? STACK,TRAWLER-LINE-C \?ELS123
+ PRINTR """Looks like Johnny found some."""
+?ELS123: PRINTR """That's what we're lookin' for."""
+?ELS113: EQUAL? PRSI,SAMPLE-TREASURE \?ELS131
+ IN? SAMPLE-TREASURE,JOHNNY \?ELS131
+ IN? MCGINTY,HERE \?CND134
+ CALL MCGINTY-WILL-FOLLOW
+?CND134: PRINTR """You saw it. You should know more about it than me."""
+?ELS131: EQUAL? PRSI,PETES-PATCH \?ELS140
+ PRINTR """That's my eyepatch. It covers my bad eye."""
+?ELS140: EQUAL? PRSI,STOVE \?ELS144
+ PRINTI """There's nothing special about the "
+ CALL DPRINT,STOVE
+ PRINTR "."""
+?ELS144: EQUAL? PRSI,SPEAR-CARRIER \?ELS148
+ PRINTR """He's a good guy."""
+?ELS148: EQUAL? PRSI,JOHNNY \?ELS152
+ PRINTR "Pete thinks for a second. ""Yeah, Red's a friend of mine."""
+?ELS152: EQUAL? PRSI,MCGINTY \?ELS156
+ PRINTR """I done work for him, but I don't like him."""
+?ELS156: EQUAL? PRSI,HEVLIN \?ELS160
+ CALL TELL-NEVER-KNEW
+ RTRUE
+?ELS160: EQUAL? PRSI,WEASEL \?ELS162
+ PRINTI "Pete frowns for a moment, then "
+ IN? WEASEL,HERE \?ELS167
+ PRINTI "leans over and whispers"
+ JUMP ?CND165
+?ELS167: PRINTI "says"
+?CND165: PRINTR ", ""The Weasel's a friend, but I don't trust him. He's awful quick with that knife."""
+?ELS162: EQUAL? PRSI,PETE \?ELS177
+ CALL TELL-KNOW-ME
+ RTRUE
+?ELS177: EQUAL? PRSI,ME \?ELS179
+ CALL TELL-YOURE-DIVER
+ RTRUE
+?ELS179: EQUAL? PRSI,PARROT \?ELS181
+ PRINTR """He's weird. He talks funny."""
+?ELS181: EQUAL? PRSI,FOOD \?ELS185
+ GETP HERE,P?LINE
+ GRTR? STACK,BACK-ALLEY-LINE-C \?ELS185
+ PRINTR """It's a beef stew. There's nothing wrong with it."""
+?ELS185: EQUAL? PRSI,TRAWLER,SALVAGER \FALSE
+ PRINTR """She's a boat."""
+?CND76: EQUAL? WINNER,PETE \FALSE
+ EQUAL? PRSO,GLOBAL-SELF \?CND201
+ SET 'PRSO,PETE
+?CND201: EQUAL? PRSI,GLOBAL-SELF \?CND204
+ SET 'PRSI,PETE
+?CND204: EQUAL? PRSA,V?TELL \?ELS211
+ EQUAL? PRSO,ME /FALSE
+?ELS211: EQUAL? PRSA,V?$CALL \?ELS215
+ CALL TELL-SO-WHAT
+ RSTACK
+?ELS215: EQUAL? PRSA,V?SHOW \?ELS217
+ IN? PRSO,PETE \?ELS217
+ EQUAL? PRSI,ME \?ELS217
+ SET 'WINNER,PLAYER
+ CALL PERFORM,V?EXAMINE,PRSO
+ SET 'WINNER,PETE
+ RETURN WINNER
+?ELS217: EQUAL? PRSA,V?MAYBE,V?NO,V?YES /FALSE
+ EQUAL? PRSA,V?WHAT,V?LONGITUDE,V?LATITUDE /FALSE
+ EQUAL? PRSA,V?ALARM,V?SSHOW,V?FIND /FALSE
+ PRINTI """I don't think I can do that."""
+ CRLF
+ RETURN 2
+
+
+ .FUNCT I-PETE,GARG=0,L,PMG,?TMP1
+ LOC PETE >L
+ ZERO? GARG \?ELS5
+ GRTR? FM-CTR,1 \?CND6
+ LESS? FM-CTR,5 \?CND6
+ CALL QUEUE,I-PETE,1
+ PUT STACK,0,1
+ RFALSE
+?CND6: GET MOVEMENT-GOALS,PETE-C >PMG
+ GET PMG,MG-ROOM
+ EQUAL? STACK,MM-GALLEY \?CND11
+ EQUAL? SHIP-CHOSEN,TRAWLER \?CND11
+ PUT PMG,MG-ROOM,NW-GALLEY
+?CND11: CALL IMOVEMENT,PETE,I-PETE
+ RSTACK
+?ELS5: EQUAL? GARG,G-REACHED \FALSE
+ EQUAL? L,MM-GALLEY,NW-GALLEY \?CND18
+ GETP L,P?LINE >?TMP1
+ CALL META-LOC,PLAYER
+ GETP STACK,P?LINE
+ EQUAL? ?TMP1,STACK \?CND18
+ FSET FOOD,NDESCBIT
+ MOVE FOOD,STOVE
+?CND18: EQUAL? HERE,L \FALSE
+ CALL DPRINT,PETE
+ PRINTI " arrives, quickly taking in the situation."
+ CRLF
+ RETURN 2
+
+
+ .FUNCT PETES-PATCH-F
+ EQUAL? PRSA,V?DISEMBARK,V?ASK-FOR,V?LOOK-UNDER /?THN10
+ EQUAL? PRSA,V?MOVE /?THN10
+ EQUAL? PRSA,V?TAKE \?ELS5
+ ZERO? PRSI /?THN10
+ EQUAL? PRSI,PETE \?ELS5
+?THN10: PRINTR "Mind your manners."
+?ELS5: EQUAL? PRSA,V?EXAMINE \FALSE
+ PRINTR "It's a standard black eyepatch."
+
+
+ .FUNCT WEASEL-F,RARG=0,?TMP1
+ EQUAL? RARG,M-OBJDESC \?ELS3
+ IN? ENVELOPE,PLAYER \?ELS6
+ CALL WEASEL-BEATS-YOU
+ ZERO? STACK \TRUE
+?ELS6: ZERO? WEASEL-APPREHENDED /?ELS10
+ EQUAL? HERE,MM-LOUNGE,NW-LOUNGE \?ELS14
+ CALL TELL-TIED
+ JUMP ?CND12
+?ELS14: PRINTI "The Weasel is firmly in Johnny's grasp."
+?CND12: CRLF