forked from historicalsource/deadline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verbs.zil
1901 lines (1671 loc) · 53.2 KB
/
verbs.zil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"VERBS for
DEADLINE
Copyright 1982 Infocom, Inc. All rights reserved.
"
"SUBTITLE DESCRIBE THE UNIVERSE"
"SUBTITLE SETTINGS FOR VARIOUS LEVELS OF DESCRIPTION"
<GLOBAL VERBOSE <>>
<GLOBAL SUPER-BRIEF <>>
<GDECL (VERBOSE SUPER-BRIEF) <OR ATOM FALSE>>
<ROUTINE V-VERBOSE ()
<SETG VERBOSE T>
<SETG SUPER-BRIEF <>>
<TELL "OK, you will get verbose descriptions." CR>>
<ROUTINE V-BRIEF ()
<SETG VERBOSE <>>
<SETG SUPER-BRIEF <>>
<TELL "OK, you will get brief descriptions." CR>>
<ROUTINE V-SUPER-BRIEF ()
<SETG SUPER-BRIEF T>
<TELL
"OK, you will get super-brief descriptions. Remember that objects
and people are not mentioned; only the name of the place you are in." CR>>
\
"SUBTITLE DESCRIBERS"
<ROUTINE V-LOOK ()
<COND (<DESCRIBE-ROOM T>
<DESCRIBE-OBJECTS T>)>>
<ROUTINE V-FIRST-LOOK ()
<COND (<DESCRIBE-ROOM>
<COND (<NOT ,SUPER-BRIEF> <DESCRIBE-OBJECTS>)>)>>
<ROUTINE ROOM-CHECK ()
<COND (<IN? ,PRSO ,ROOMS>
<COND (<==? ,PRSO ,HERE>
<SETG PRSO ,GLOBAL-ROOM>
<RFALSE>)
(T
<TELL "You aren't in that room!" CR>
<RTRUE>)>)
(T <RFALSE>)>>
<ROUTINE PRE-SEARCH ()
<COND (<ROOM-CHECK> <RTRUE>)
(T <RFALSE>)>>
<ROUTINE PRE-EXAMINE ()
<COND (<ROOM-CHECK> <RTRUE>)
(<AND <==? ,P-ADVERB ,W?CAREFULLY>
<NOT <INT-WAIT 3>>>
<TELL
"You never got to finish looking over the " D ,PRSO "." CR>)>>
<ROUTINE V-EXAMINE ()
<COND (<IN? ,PRSO ,GLOBAL-OBJECTS>
<NOT-HERE ,PRSO>
<RTRUE>)
(<GETP ,PRSO ,P?TEXT>
<TELL <GETP ,PRSO ,P?TEXT> CR>)
(<OR <FSET? ,PRSO ,CONTBIT>
<FSET? ,PRSO ,DOORBIT>>
<V-LOOK-INSIDE>)
(<FSET? ,PRSO ,PERSON>
<TELL <GET ,CHARACTER-DESCS <GETP ,PRSO ,P?CHARACTER>> CR>)
(ELSE
<TELL "There's nothing special about the" PRSO "." CR>)>>
<GLOBAL LIT <>>
<ROUTINE DESCRIBE-ROOM ("OPTIONAL" (LOOK? <>) "AUX" V? STR)
<SET V? <OR .LOOK? ,VERBOSE>>
<COND (<NOT <FSET? ,HERE ,TOUCHBIT>>
<FSET ,HERE ,TOUCHBIT>
<SET V? T>)>
<COND (<IN? ,HERE ,ROOMS> <TELL D ,HERE CR>)>
<COND (<OR .LOOK? <NOT ,SUPER-BRIEF>>
<COND (<FSET? <LOC ,WINNER> ,VEHBIT>
<TELL "(You are ">
<COND (<FSET? <LOC ,WINNER> ,SURFACEBIT>
<TELL "sitting o">)
(T <TELL "standing i">)>
<TELL "n the " D <LOC ,WINNER> ".)" CR>)>
<COND (<AND .V? <APPLY <GETP ,HERE ,P?ACTION> ,M-LOOK>>
<RTRUE>)
(<AND .V? <SET STR <GETP ,HERE ,P?LDESC>>>
<TELL .STR CR>)
(T <APPLY <GETP ,HERE ,P?ACTION> ,M-FLASH>)>
<COND (<NOT <==? ,HERE <LOC ,WINNER>>>
<APPLY <GETP <LOC ,WINNER> ,P?ACTION> ,M-LOOK>)>)>
<COND (<GETP ,HERE ,P?CORRIDOR> <CORRIDOR-LOOK>)>
T>
<ROUTINE DESCRIBE-OBJECTS ("OPTIONAL" (V? <>))
<COND (,LIT
<COND (<FIRST? ,HERE>
<PRINT-CONT ,HERE <SET V? <OR .V? ,VERBOSE>> -1>)>)
(ELSE
<TELL "You can't see anything in the dark." CR>)>>
"DESCRIBE-OBJECT -- takes object and flag. if flag is true will print a
long description (fdesc or ldesc), otherwise will print short."
<ROUTINE DESCRIBE-OBJECT (OBJ V? LEVEL "AUX" (STR <>) AV)
<COND (<AND <0? .LEVEL>
<APPLY <GETP .OBJ ,P?DESCFCN> ,M-OBJDESC>>
<RTRUE>)
(<AND <0? .LEVEL>
<OR <AND <NOT <FSET? .OBJ ,TOUCHBIT>>
<SET STR <GETP .OBJ ,P?FDESC>>>
<SET STR <GETP .OBJ ,P?LDESC>>>>
<TELL .STR>)
(<0? .LEVEL>
<TELL "There is a " D .OBJ " here.">)
(ELSE
<TELL <GET ,INDENTS .LEVEL>>
<TELL "A " D .OBJ>)>
<COND (<AND <0? .LEVEL>
<SET AV <LOC ,WINNER>>
<FSET? .AV ,VEHBIT>>
<TELL " (outside the " D .AV ")">)>
<CRLF>
<COND (<AND <SEE-INSIDE? .OBJ> <FIRST? .OBJ>>
<PRINT-CONT .OBJ .V? .LEVEL>)>>
<ROUTINE PRINT-CONT (OBJ "OPTIONAL" (V? <>) (LEVEL 0)
"AUX" Y 1ST? AV STR (PV? <>) (INV? <>))
#DECL ((OBJ) OBJECT (LEVEL) FIX)
<COND (<NOT <SET Y <FIRST? .OBJ>>> <RTRUE>)>
<COND (<AND <SET AV <LOC ,WINNER>> <FSET? .AV ,VEHBIT>>
T)
(ELSE <SET AV <>>)>
<SET 1ST? T>
<COND (<EQUAL? ,WINNER .OBJ <LOC .OBJ>>
<SET INV? T>)
(ELSE
<REPEAT ()
<COND (<NOT .Y> <RETURN <NOT .1ST?>>)
(<==? .Y .AV> <SET PV? T>)
(<==? .Y ,WINNER>)
(<AND <NOT <FSET? .Y ,INVISIBLE>>
<NOT <FSET? .Y ,TOUCHBIT>>
<SET STR <GETP .Y ,P?FDESC>>>
<COND (<NOT <FSET? .Y ,NDESCBIT>>
<SET 1ST? <>>
<SET LEVEL 0>
<TELL .STR CR>)>
<COND (<AND <SEE-INSIDE? .Y>
<NOT <GETP <LOC .Y> ,P?DESCFCN>>
<FIRST? .Y>>
<PRINT-CONT .Y .V? 0>)>)>
<SET Y <NEXT? .Y>>>)>
<SET Y <FIRST? .OBJ>>
<REPEAT ()
<COND (<NOT .Y>
<COND (<AND .PV? .AV <FIRST? .AV>>
<PRINT-CONT .AV .V? .LEVEL>)>
<RETURN <NOT .1ST?>>)
(<EQUAL? .Y .AV ,PLAYER>)
(<AND <NOT <FSET? .Y ,INVISIBLE>>
<OR .INV?
<FSET? .Y ,TOUCHBIT>
<NOT <GETP .Y ,P?FDESC>>>>
<COND (<NOT <FSET? .Y ,NDESCBIT>>
<COND (.1ST?
<COND (<FIRSTER .OBJ .LEVEL>
<COND (<L? .LEVEL 0>
<SET LEVEL 0>)>)>
<SET LEVEL <+ 1 .LEVEL>>
<SET 1ST? <>>)>
<DESCRIBE-OBJECT .Y .V? .LEVEL>)
(<AND <FIRST? .Y> <SEE-INSIDE? .Y>>
<PRINT-CONT .Y .V? .LEVEL>)>)>
<SET Y <NEXT? .Y>>>>
<ROUTINE FIRSTER (OBJ LEVEL)
<COND (<==? .OBJ ,WINNER>
<TELL "You are carrying:" CR>)
(<NOT <IN? .OBJ ,ROOMS>>
<COND (<G? .LEVEL 0>
<TELL <GET ,INDENTS .LEVEL>>)>
<COND (<FSET? .OBJ ,SURFACEBIT>
<TELL "Sitting on the " D .OBJ
" is:" CR>)
(<FSET? .OBJ ,PERSON>
<TELL D .OBJ " is holding:" CR>)
(ELSE
<TELL "The " D .OBJ
" contains:" CR>)>)>>
\
"SUBTITLE SCORING"
<ROUTINE V-SCORE ("OPTIONAL" (ASK? T))
#DECL ((ASK?) <OR ATOM FALSE>)
<TELL
"You are an amateur inspector, at best." CR>>
<ROUTINE V-QUIT ("OPTIONAL" (ASK? T) "AUX" SCOR)
#DECL ((ASK?) <OR ATOM <PRIMTYPE LIST>> (SCOR) FIX)
<COND (<OR <AND .ASK?
<TELL
"Do you wish to stop your investigation (Y/N)">
<YES?>>
<NOT .ASK?>>
<QUIT>)
(ELSE <TELL "Ok." CR>)>>
<ROUTINE YES? ()
<PRINTI " >">
<READ ,P-INBUF ,P-LEXV>
<COND (<0? <GETB ,P-LEXV ,P-LEXWORDS>>
<RFALSE>)
(<EQUAL? <GET ,P-LEXV 1> ,W?YES ,W?Y>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE V-VERSION ("AUX" (CNT 17))
<TELL
"DEADLINE|
Infocom interactive fiction - a mystery story|
Copyright (c) 1982, 1983 by Infocom, Inc. All rights reserved.|
DEADLINE is a registered trademark of Infocom, Inc.|
Release ">
<PRINTN <BAND <GET 0 1> *3777*>>
<TELL " / Serial number ">
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> 23>
<RETURN>)
(T
<PRINTC <GETB 0 .CNT>>)>>
<CRLF>>
<ROUTINE V-AGAIN ("AUX" OBJ)
<SET OBJ
<COND (<AND ,L-PRSO <NOT <LOC ,L-PRSO>>>
,L-PRSO)
(<AND ,L-PRSI <NOT <LOC ,L-PRSI>>>
,L-PRSI)>>
<COND (.OBJ
<TELL "You can't see the " D .OBJ " any more." CR>
<RFATAL>)
(T
<PERFORM ,L-PRSA ,L-PRSO ,L-PRSI>)>>
\
"SUBTITLE DEATH AND TRANSFIGURATION"
<GLOBAL DEAD <>>
<ROUTINE V-RESTORE ()
<COND (<RESTORE>
<TELL "Ok." CR>
<V-FIRST-LOOK>)
(T
<TELL "Failed." CR>)>>
<ROUTINE V-SAVE ()
<COND (<SAVE>
<TELL "Ok." CR>)
(T
<TELL "Failed." CR>)>>
<ROUTINE V-RESTART ()
<TELL
"Do you wish to restart your investigation (Y/N)">
<COND (<YES?>
;<TELL CR "Not much like real life, eh? ... Restarting ..." CR>
<RESTART>
<TELL "Failed." CR>)>>
<CONSTANT REXIT 0>
<CONSTANT UEXIT 1>
<CONSTANT NEXIT 2>
<CONSTANT FEXIT 3>
<CONSTANT CEXIT 4>
<CONSTANT DEXIT 5>
<CONSTANT NEXITSTR 0>
<CONSTANT FEXITFCN 0>
<CONSTANT CEXITFLAG 1>
<CONSTANT CEXITSTR 1>
<CONSTANT DEXITOBJ 1>
<CONSTANT DEXITSTR 1>
<ROUTINE V-WALK-AROUND ()
<TELL "Use directions for movement here." CR>>
<ROUTINE GO-NEXT (TBL "AUX" VAL)
#DECL ((TBL) TABLE (VAL) ANY)
<COND (<SET VAL <LKP ,HERE .TBL>>
<GOTO .VAL>)>>
<ROUTINE LKP (ITM TBL "AUX" (CNT 0) (LEN <GET .TBL 0>))
#DECL ((ITM) ANY (TBL) TABLE (CNT LEN) FIX)
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> .LEN>
<RFALSE>)
(<==? <GET .TBL .CNT> .ITM>
<COND (<==? .CNT .LEN> <RFALSE>)
(T
<RETURN <GET .TBL <+ .CNT 1>>>)>)>>>
<ROUTINE V-WALK ("AUX" PT PTS STR OBJ RM)
#DECL ((PT) <OR FALSE TABLE> (PTS) FIX (STR) <OR STRING FALSE>
(OBJ) OBJECT (RM) <OR FALSE OBJECT>)
<COND (<==? ,PRSO ,GLOBAL-CALL>
<PRE-TURN>
<RTRUE>)
(<NOT ,PRSO> <TELL "You can't go that way." CR>)
(<SET PT <GETPT ,HERE ,PRSO>>
<COND (<==? <SET PTS <PTSIZE .PT>> ,UEXIT>
<SET RM <GETB .PT ,REXIT>>
<COND (<AND <EQUAL? ,STAIRS ,HERE .RM>
<EQUAL? ,P-ADVERB ,W?QUIETLY ,W?SLOWLY>>
<TELL
"The stairs are still quite noisy even when walking up very slowly." CR>)>
<GOTO .RM>)
(<==? .PTS ,NEXIT>
<TELL <GET .PT ,NEXITSTR> CR>
<RFATAL>)
(<==? .PTS ,FEXIT>
<COND (<SET RM <APPLY <GET .PT ,FEXITFCN>>>
<GOTO .RM>)
(T
<RFATAL>)>)
(<==? .PTS ,CEXIT>
<COND (<VALUE <GETB .PT ,CEXITFLAG>>
<GOTO <GETB .PT ,REXIT>>)
(<SET STR <GET .PT ,CEXITSTR>>
<TELL .STR CR>
<RFATAL>)
(T
<TELL "You can't go that way." CR>
<RFATAL>)>)
(<==? .PTS ,DEXIT>
<COND (<FSET? <SET OBJ <GETB .PT ,DEXITOBJ>> ,OPENBIT>
<GOTO <GETB .PT ,REXIT>>)
(<FSET? .OBJ ,INVISIBLE>
<TELL "You can't go that way." CR>)
(<SET STR <GET .PT ,DEXITSTR>>
<TELL .STR CR>
<RFATAL>)
(T
<TELL "The " D .OBJ " is closed." CR>
<SETG P-IT-LOC ,HERE>
<SETG P-IT-OBJECT .OBJ>
<RFATAL>)>)>)
(<==? ,PRSO ,P?IN>
<TELL "In which direction do you want to go?" CR>
<RFATAL>)
(T
<TELL "You can't go that way." CR>
<RFATAL>)>>
<ROUTINE V-INVENTORY ()
<COND (<FIRST? ,WINNER> <PRINT-CONT ,WINNER>)
(T <TELL "You are empty-handed." CR>)>>
<GLOBAL INDENTS
<TABLE ""
" "
" "
" "
" "
" ">>
\
<ROUTINE PRE-TAKE ()
<COND (<EQUAL? ,PRSO ,SECOND-SECTION
,GLOBAL-FINGERPRINTS ,GLOBAL-LADDER> <RFALSE>)
(<EQUAL? ,PRSO ,GLOBAL-WARRANT ,GLOBAL-RED-HERRINGS> <RFALSE>)
(<IN? ,PRSO ,GLOBAL-OBJECTS>
<NOT-HERE ,PRSO>)
(<IN? ,PRSO ,WINNER> <TELL "You already have it." CR>)
(<AND <FSET? <LOC ,PRSO> ,CONTBIT>
<NOT <FSET? <LOC ,PRSO> ,OPENBIT>>>
<TELL "You can't reach that." CR>
<RTRUE>)
(,PRSI
<COND (<==? ,PRSI ,BOOKSHELVES> <RFALSE>)
(<NOT <==? ,PRSI <LOC ,PRSO>>>
<TELL "It's not in that!" CR>)
(T
<SETG PRSI <>>
<RFALSE>)>)
(<==? ,PRSO <LOC ,WINNER>> <TELL "You are in it, loser!" CR>)>>
<ROUTINE V-TAKE ()
<COND (<==? <ITAKE> T>
<TELL "Taken." CR>)>>
<GLOBAL FUMBLE-NUMBER 7>
<GLOBAL FUMBLE-PROB 8>
<ROUTINE ITAKE ("OPTIONAL" (VB T) "AUX" CNT OBJ)
#DECL ((VB) <OR ATOM FALSE> (CNT) FIX (OBJ) OBJECT)
<COND (<NOT <FSET? ,PRSO ,TAKEBIT>>
<COND (.VB
<TELL <PICK-ONE ,YUKS> CR>)>
<RFALSE>)
(<AND <NOT <IN? <LOC ,PRSO> ,WINNER>>
<G? <+ <WEIGHT ,PRSO> <WEIGHT ,WINNER>> ,LOAD-ALLOWED>>
<COND (.VB
<TELL "Your load is too heavy">
<COND (<L? ,LOAD-ALLOWED ,LOAD-MAX>
<TELL ", especially in light of your condition.">)
(ELSE <TELL ".">)>
<CRLF>)>
<RFATAL>)
(<AND <G? <SET CNT <CCOUNT ,WINNER>> ,FUMBLE-NUMBER>
<PROB <* .CNT ,FUMBLE-PROB>>>
<SET OBJ <FIRST? ,WINNER>>
<SET OBJ <NEXT? .OBJ>>
;"This must go! Chomping compiler strikes again"
<TELL "Oh, no. The " D .OBJ
" slips from your arms while you are taking the "
D ,PRSO ",
and both tumble to the ground." CR>
<PERFORM ,V?DROP .OBJ>
<RFATAL>)
(T
<MOVE ,PRSO ,WINNER>
<FSET ,PRSO ,TOUCHBIT>
<RTRUE>)>>
<ROUTINE PRE-PUT ()
<COND (<OR <IN? ,PRSO ,GLOBAL-OBJECTS>
<NOT <FSET? ,PRSO ,TAKEBIT>>>
<TELL "Nice try." CR>)>>
<ROUTINE V-PUT ()
<COND (<OR <FSET? ,PRSI ,OPENBIT>
<OPENABLE? ,PRSI>
<FSET? ,PRSI ,VEHBIT>> T)
(T
<TELL "You can't do that." CR>
<RTRUE>)>
<COND (<NOT <FSET? ,PRSI ,OPENBIT>>
<TELL "The" PRSI " isn't open." CR>)
(<==? ,PRSI ,PRSO>
<TELL "How can you do that?" CR>)
(<IN? ,PRSO ,PRSI>
<TELL "The " D ,PRSO " is already in the " D ,PRSI "." CR>)
(<G? <- <+ <WEIGHT ,PRSI> <WEIGHT ,PRSO>>
<GETP ,PRSI ,P?SIZE>>
<GETP ,PRSI ,P?CAPACITY>>
<TELL "There's no room." CR>)
(<AND <NOT <HELD? ,PRSO>>
<NOT <ITAKE>>>
<RTRUE>)
(T
<MOVE ,PRSO ,PRSI>
<FSET ,PRSO ,TOUCHBIT>
<TELL "Done." CR>)>>
<ROUTINE HELD? (OBJ)
<REPEAT ()
<COND (<EQUAL? <LOC .OBJ> ,ROOMS ,GLOBAL-OBJECTS> <RFALSE>)
(<IN? .OBJ ,WINNER> <RTRUE>)
(T <SET OBJ <LOC .OBJ>>)>>>
<ROUTINE PRE-DROP ()
<COND (<==? ,PRSO <LOC ,WINNER>>
<PERFORM ,V?DISEMBARK ,PRSO>
<RTRUE>)>>
<ROUTINE PRE-GIVE ()
<COND (<AND <NOT <HELD? ,PRSO>> <NOT <EQUAL? ,PRSI ,PLAYER>>>
<TELL
"That's easy for you to say, since you don't even have it." CR>)>>
<ROUTINE PRE-SGIVE ()
<PERFORM ,V?GIVE ,PRSI ,PRSO>
<RTRUE>>
<ROUTINE V-GIVE ()
<COND (<NOT <FSET? ,PRSI ,PERSON>>
<TELL "You can't give a " D ,PRSO " to a " D ,PRSI "!" CR>)
(T <TELL D ,PRSI " refuses your offer." CR>)>>
<ROUTINE V-SGIVE ()
<TELL "FOOOO!!" CR>>
<ROUTINE V-DROP ()
<COND (<IDROP>
<TELL "The " D ,PRSO " is now on the ">
<COND (<==? <GETP ,HERE ,P?LINE> ,OUTSIDE-LINE-C>
<TELL "ground">)
(T <TELL "floor">)>
<TELL "." CR>)>>
<ROUTINE V-THROW () <COND (<IDROP> <TELL "Thrown." CR>)>>
<ROUTINE V-THROW-THROUGH ()
<COND (<NOT <FSET? ,PRSO ,PERSON>>
<TELL "Let's not resort to violence, please." CR>)
(T <V-THROW>)>>
<ROUTINE V-THROW-AT ()
<COND (<NOT <IDROP>> <RTRUE>)
(<FSET? ,PRSI ,PERSON>
<TELL D ,PRSI
", puzzled by your unorthodox methods, ducks as the "
D ,PRSO " flies by." CR>)
(T <TELL "Perhaps you aren't feeling well?" CR>)>>
<ROUTINE IDROP
()
<COND (<FSET? ,PRSO ,PERSON>
<TELL "It's not likely that " D ,PRSO " would enjoy that." CR>
<RFALSE>)
(<AND <NOT <IN? ,PRSO ,WINNER>> <NOT <IN? <LOC ,PRSO> ,WINNER>>>
<TELL "You're not carrying the" PRSO "." CR>
<RFALSE>)
(<AND <NOT <IN? ,PRSO ,WINNER>>
<NOT <FSET? <LOC ,PRSO> ,OPENBIT>>>
<TELL "The " D ,PRSO " is closed." CR>
<RFALSE>)
(T <MOVE ,PRSO <LOC ,WINNER>> <RTRUE>)>>
\
<ROUTINE V-OPEN ("AUX" F STR)
<COND (<NOT <FSET? ,PRSO ,CONTBIT>>
<TELL "You must be very clever to do that to the" PRSO "." CR>)
(<OR <FSET? ,PRSO ,DOORBIT>
<NOT <==? <GETP ,PRSO ,P?CAPACITY> 0>>>
<COND (<FSET? ,PRSO ,OPENBIT> <TELL "It is already open." CR>)
(T
<FSET ,PRSO ,OPENBIT>
<COND (<FSET? ,PRSO ,DOORBIT>
<TELL "The " D ,PRSO " is now open." CR>)
(<OR <NOT <FIRST? ,PRSO>> <FSET? ,PRSO ,TRANSBIT>>
<TELL "Opened." CR>)
(<AND <SET F <FIRST? ,PRSO>>
<NOT <NEXT? .F>>
<SET STR <GETP .F ,P?FDESC>>>
<TELL "The " D ,PRSO " opens." CR>
<TELL .STR CR>)
(T
<TELL "Opening the " D ,PRSO " reveals ">
<PRINT-CONTENTS ,PRSO>
<TELL "." CR>)>)>)
(T <TELL "The" PRSO " cannot be opened." CR>)>>
<ROUTINE PRINT-CONTENTS (OBJ "AUX" F N (1ST? T))
#DECL ((OBJ) OBJECT (F N) <OR FALSE OBJECT>)
<COND (<SET F <FIRST? .OBJ>>
<REPEAT ()
<SET N <NEXT? .F>>
<COND (.1ST? <SET 1ST? <>>)
(ELSE
<TELL ", ">
<COND (<NOT .N> <TELL "and ">)>)>
<TELL "a " D .F>
<SET F .N>
<COND (<NOT .F> <RETURN>)>>)>>
<ROUTINE V-CLOSE ()
<COND (<NOT <FSET? ,PRSO ,CONTBIT>>
<TELL "You must be very clever to do that to the" PRSO "." CR>)
(<FSET? ,PRSO ,DOORBIT>
<COND (<FSET? ,PRSO ,OPENBIT>
<TELL "The " D ,PRSO " is now closed." CR>
<FCLEAR ,PRSO ,OPENBIT>)
(T <TELL "It is already closed." CR>)>)
(<AND <NOT <FSET? ,PRSO ,SURFACEBIT>>
<NOT <==? <GETP ,PRSO ,P?CAPACITY> 0>>>
<COND (<FSET? ,PRSO ,OPENBIT>
<FCLEAR ,PRSO ,OPENBIT>
<TELL "Closed." CR>)
(T <TELL "It is already closed." CR>)>)
(ELSE
<TELL "You cannot close that." CR>)>>
<ROUTINE CCOUNT (OBJ "AUX" (CNT 0) X)
<COND (<SET X <FIRST? .OBJ>>
<REPEAT ()
<SET CNT <+ .CNT 1>>
<COND (<NOT <SET X <NEXT? .X>>>
<RETURN>)>>)>
.CNT>
"WEIGHT: Get sum of SIZEs of supplied object, recursing to the nth level."
<ROUTINE WEIGHT
(OBJ "AUX" CONT (WT 0))
#DECL ((OBJ) OBJECT (CONT) <OR FALSE OBJECT> (WT) FIX)
<COND (<SET CONT <FIRST? .OBJ>>
<REPEAT ()
<SET WT <+ .WT <WEIGHT .CONT>>>
<COND (<NOT <SET CONT <NEXT? .CONT>>> <RETURN>)>>)>
<+ .WT <GETP .OBJ ,P?SIZE>>>
<ROUTINE V-BUG ()
<TELL
"If there is a problem here, it is unintentional. You may report
your problem to the address provided in your documentation." CR>>
<GLOBAL COPR-NOTICE
" a transcript of interaction with DEADLINE.|
DEADLINE is a registered trademark of Infocom, Inc.|
Copyright (c) 1982 Infocom, Inc. All rights reserved.|
">
<ROUTINE V-SCRIPT ()
<PUT 0 8 <BOR <GET 0 8> 1>>
<TELL "Here begins" ,COPR-NOTICE CR>>
<ROUTINE V-UNSCRIPT ()
<TELL "Here ends" ,COPR-NOTICE CR>
<PUT 0 8 <BAND <GET 0 8> -2>>
<RTRUE>>
<ROUTINE PRE-MOVE ()
<COND (<HELD? ,PRSO>
<TELL "Juggling isn't one of your talents." CR>)>>
<ROUTINE V-MOVE ()
<COND (<FSET? ,PRSO ,TAKEBIT>
<TELL "Moving the" PRSO " reveals nothing." CR>)
(T <TELL "You can't move the" PRSO "." CR>)>>
<ROUTINE V-LAMP-ON ()
<COND (<FSET? ,PRSO ,PERSON>
<TELL
"Ahem! You may or may not realize this, but you are on a case. You
shouldn't be wasting your time attempting to flirt with the suspects.
In any event, it's unlikely that you are person enough to do it." CR>)
(T <TELL "You can't turn that on." CR>)>>
<ROUTINE V-LAMP-OFF ()
<COND (<FSET? ,PRSO ,PERSON>
<TELL "Your uncouth manner is certain to turn anyone off." CR>)
(T <TELL "You can't turn that off." CR>)>>
;"V-WAIT has three modes, depending on the arguments:
1) If only one argument is given, it will wait for that mnay moves
2) If a second argument is given, it will wait the least of the first
argument number of moves and the time at which the second argument
(an object) is in the room with the player.
3) If the third argument is given, the second should be FALSE. It will
wait <first argument> number of moves (or at least try to...). The
third argument means that an 'internal wait' is happening (e.g. for
a 'careful' search)."
<GLOBAL WHO-WAIT 0>
<ROUTINE V-WAIT ("OPTIONAL" (NUM 3) (WHO <>) (INT <>) "AUX" VAL)
#DECL ((NUM) FIX)
<SETG WHO-WAIT 0>
<COND (<NOT .INT> <TELL "Time passes..." CR>)>
<REPEAT ()
<COND (<L? <SET NUM <- .NUM 1>> 0> <RETURN>)
(<SET VAL <CLOCKER>>
<COND (<==? .VAL ,M-FATAL> <RETURN>)
(<AND <==? .WHO ,GLOBAL-DUFFY>
<NOT ,FINGERPRINT-OBJ>>
<RETURN>)
(<AND .WHO <IN? .WHO ,HERE>>
<TELL D .WHO
", for whom you are waiting, has arrived." CR>
<RETURN>)
(T
<SETG WHO-WAIT <+ ,WHO-WAIT 1>>
<COND (<NOT <==? <BAND <GETB 0 1> 16> 0>>
<TELL "(">
<TIME-PRINT ,PRESENT-TIME>
<TELL ") ">)>
<COND (.INT
<TELL
"Do you want to continue what you were doing? (Y/N)">)
(T
<TELL
"Do you want to keep waiting? (Y/N)">)>
<COND (<NOT <YES?>> <RETURN>)
(T <USL>)>)>)
(<AND <==? .WHO ,GLOBAL-DUFFY>
<NOT ,FINGERPRINT-OBJ>>
<RETURN>)
(<AND .WHO <IN? .WHO ,HERE>>
<TELL D .WHO
", for whom you are waiting, has arrived." CR>
<RETURN>)
(<AND .WHO <G? <SETG WHO-WAIT <+ ,WHO-WAIT 1>> 30>>
<TELL D .WHO
" still hasn't arrived. Do you want to keep waiting? (Y/N) ">
<COND (<NOT <YES?>> <RETURN>)>
<SETG WHO-WAIT 0>
<USL>)
(T <USL>)>>
<SETG CLOCK-WAIT T>
<COND (<NOT .INT> <V-TIME>)>
<RTRUE>>
<ROUTINE INT-WAIT (N "AUX" TIM REQ)
<SET TIM ,PRESENT-TIME>
<V-WAIT <SET REQ <RANDOM <* .N 2>>> <> T>
<COND (<NOT <L? <- ,PRESENT-TIME .TIM> .REQ>>
<RTRUE>)
(T <RFALSE>)>>
<ROUTINE V-WAIT-FOR ("AUX" WHO)
<COND (<==? ,PRSO ,INTNUM>
<COND (<G? ,P-NUMBER ,PRESENT-TIME> <V-WAIT-UNTIL> <RTRUE>)
(<G? ,P-NUMBER 180>
<TELL "That's too long to wait." CR>)
(T <V-WAIT ,P-NUMBER>)>)
(<==? ,PRSO ,NOON> <V-WAIT-UNTIL> <RTRUE>)
(<==? ,PRSO ,GLOBAL-DUFFY>
<COND (,FINGERPRINT-OBJ
<V-WAIT 10000 ,PRSO>)
(T
<TELL
"You would wait quite a while, since Sergeant Duffy is always
nearby, but never approaches you unless requested." CR>)>)
(<FSET? ,PRSO ,PERSON>
<SET WHO <GET ,CHARACTER-TABLE
<GETP ,PRSO ,P?CHARACTER>>>
<COND (<IN? .WHO ,HERE>
<TELL "That person is already here!" CR>)
(T <V-WAIT 10000 .WHO>)>)
(T <TELL "Not a good idea. You might wait all day." CR>)>>
<ROUTINE V-WAIT-UNTIL ()
<COND (<==? ,PRSO ,NOON>
<SETG P-NUMBER 720>
<SETG PRSO ,INTNUM>)
(<L? ,P-NUMBER 8>
<SETG P-NUMBER <* <+ ,P-NUMBER 12> 60>>)
(<L? ,P-NUMBER 13>
<SETG P-NUMBER <* ,P-NUMBER 60>>)>
<COND (<==? ,PRSO ,INTNUM>
<COND (<G? ,P-NUMBER ,PRESENT-TIME>
<V-WAIT <- ,P-NUMBER ,PRESENT-TIME>>)
(T <TELL
"You are clearly ahead of your time." CR>)>)
(T <TELL "Your sanity is coming into question." CR>)>>
;<ROUTINE PRE-BOARD
("AUX" AV)
<SET AV <LOC ,WINNER>>
<COND (<FSET? ,PRSO ,VEHBIT>
<COND (<NOT <IN? ,PRSO ,HERE>>
<TELL "The "
D
,PRSO
" must be on the ground to be boarded." CR>)
(<FSET? .AV ,VEHBIT>
<TELL "You are already in the " D .AV ", cretin!" CR>)
(T <RFALSE>)>)
(<FSET? ,PRSO ,FURNITURE>
<TELL
"You should be solving the case, not sitting down on the job!" CR>)
(T
<TELL "You no doubt have a theory on boarding a "
D
,PRSO
"." CR>)>
<RFATAL>>
;<ROUTINE V-BOARD
("AUX" AV)
#DECL ((AV) OBJECT)
<TELL "You are now in the " D ,PRSO "." CR>
<MOVE ,WINNER ,PRSO>
<APPLY <GETP ,PRSO ,P?ACTION> ,M-ENTER>
<RTRUE>>
<ROUTINE V-STAND ()
<COND (<OR <FSET? <LOC ,WINNER> ,SURFACEBIT>
<FSET? <LOC ,WINNER> ,FURNITURE>>
<TELL "You are on your own feet again." CR>
<MOVE ,WINNER ,HERE>)
(T
<TELL "You're already standing up!" CR>)>>
<ROUTINE V-DISEMBARK ()
<COND (<NOT <==? <LOC ,WINNER> ,PRSO>>
<TELL "You're not in that!" CR>
<RFATAL>)
(T ;<FSET? ,HERE ,RLANDBIT>
<TELL "You are on your own feet again." CR>
<MOVE ,WINNER ,HERE>)
;(T
<TELL
"You realize, just in time, that getting out here would probably be fatal." CR>
<RFATAL>)>>
<ROUTINE GOTO (RM "OPTIONAL" (V? T) "AUX" F WT)
#DECL ((RM) OBJECT)
<COND (<NOT <IN? <LOC ,WINNER> ,ROOMS>>
<TELL "You are seated, if you remember." CR>)
(T
<SET F <FIRST? ,HERE>>
<SET WT <GET ,WHERE-TABLES 0>>
<REPEAT ()
<COND (<NOT .F> <RETURN>)
(<AND <FSET? .F ,PERSON>
<NOT <==? .F ,PLAYER>>>
<PUT .WT <GETP .F ,P?CHARACTER> ,PRESENT-TIME>)>
<SET F <NEXT? .F>>>
<MOVE ,WINNER .RM>
<SETG HERE .RM>
<SETG LIT T>
<APPLY <GETP ,HERE ,P?ACTION> ,M-ENTER>
<COND (.V? <V-FIRST-LOOK>)>)>>
<ROUTINE PRE-POUR-ON ()
<TELL "You can't pour that on anything." CR>>
<ROUTINE V-POUR-ON
()
<REMOVE ,PRSO>
<COND (<FLAMING? ,PRSI>
<TELL "The " D ,PRSI " is extinguished." CR>)
(T
<TELL "The water spills over the "
D
,PRSI
" and to the floor where it evaporates." CR>)>>
<ROUTINE V-SQUEEZE
()
<COND (<FSET? ,PRSO ,PERSON>
<TELL "It's unclear how " D ,PRSO
" would take this, so you defer until after hours.">)
(ELSE <TELL "How singularly useless.">)>
<CRLF>>
<ROUTINE PRE-FILL ("AUX" TX)
<COND (<AND <NOT ,PRSI> <SET TX <GETPT ,HERE ,P?GLOBAL>>>
<COND (<ZMEMQB ,GLOBAL-WATER .TX <PTSIZE .TX>>
<SETG PRSI ,GLOBAL-WATER>
<RFALSE>)
(T
<TELL "There's nothing to fill it with." CR>
<RTRUE>)>)>
<COND (<NOT <EQUAL? ,PRSI ,GLOBAL-WATER>>
<PERFORM ,V?PUT ,PRSI ,PRSO>
<RTRUE>)>>
<ROUTINE V-FILL ()
<COND (<NOT ,PRSI>
<COND (<GLOBAL-IN? ,GLOBAL-WATER ,HERE>
<PERFORM ,V?FILL ,PRSO ,GLOBAL-WATER>)
(T
<TELL "There's nothing to fill it with." CR>)>)
(T <TELL "You can't do that." CR>)>>
<ROUTINE V-BRUSH ()
<TELL
"Cleanliness is next to Godliness, although in this case it seems to be
next to Uselessness." CR>>
<ROUTINE V-RING () <TELL "How, exactly, does one ring that?" CR>>
<ROUTINE V-DRINK ()
<V-EAT>>
<ROUTINE V-EAT ("AUX" (EAT? <>) (DRINK? <>) (NOBJ <>))
#DECL ((NOBJ) <OR OBJECT FALSE> (EAT? DRINK?) <OR ATOM FALSE>)
<COND (<AND <SET EAT? <FSET? ,PRSO ,FOODBIT>> <IN? ,PRSO ,WINNER>>
<COND (<VERB? DRINK> <TELL "How does one drink that?" CR>)
(ELSE
<TELL "Mmm. That really hit the spot." CR>
<REMOVE ,PRSO>)>
<CRLF>)
(<SET DRINK? <FSET? ,PRSO ,DRINKBIT>>
<COND (<OR <IN? ,PRSO ,GLOBAL-OBJECTS>
<AND <SET NOBJ <LOC ,PRSO>>
<IN? .NOBJ ,WINNER>
<FSET? .NOBJ ,OPENBIT>>>
<TELL
"Mmm. That really hit the spot." CR>
<REMOVE ,PRSO>)
(T <TELL "You can't get to it." CR>)>)
(<NOT <OR .EAT? .DRINK?>>
<TELL "The"
PRSO
" wouldn't agree with you." CR>)>>
<ROUTINE V-CURSES ()
<COND (,PRSO
<COND (<FSET? ,PRSO ,PERSON>
<TELL "Insults of this nature won't help you." CR>)
(T
<TELL "What a loony!" CR>)>)
(T
<TELL <PICK-ONE ,OFFENDED> CR>)>>
<ROUTINE V-LISTEN ()
<COND (<NOT <FSET? ,PRSO ,PERSON>>
<TELL "The ">)>
<TELL D ,PRSO " makes no sound." CR>>
<ROUTINE V-FOLLOW ("AUX" CN CHR COR PCOR L)
<SET CN <GETP ,PRSO ,P?CHARACTER>>
<SET CHR <GET ,CHARACTER-TABLE .CN>>
<SET L <LOC .CHR>>
<COND (<==? ,PRSO ,PLAYER>
<TELL
"It's not clear whom you are talking to." CR>)
(<NOT <FSET? ,PRSO ,PERSON>>
<TELL
"How tragic to see a formerly great detective stalking a " D ,PRSO "." CR>)
(<==? ,HERE .L>
<TELL
"You're in the same place as " D .CHR "!" CR>)
(<NOT .L>
<TELL D .CHR " has left the grounds." CR>)
(<==? <GET <GET ,WHERE-TABLES 0> .CN> ,PRESENT-TIME>
<GOTO .L>)
(<AND <SET COR <GETP ,HERE ,P?CORRIDOR>>
<SET PCOR <GETP .L ,P?CORRIDOR>>
<NOT <==? <BAND .COR .PCOR> 0>>>
<SETG PRSO <COR-DIR ,HERE .L>>
<V-WALK>)
(T <TELL "You seem to have lost track of " D .CHR "." CR>)>>
<GLOBAL OFFENDED
<LTABLE "You ought to be ashamed of yourself."
"One must try to avoid locker-room talk while working.">>
<ROUTINE V-LEAP ("AUX" TX S)
<COND (,PRSO
<COND (<IN? ,PRSO ,HERE>
<COND (<FSET? ,PRSO ,PERSON>
<TELL "The "
D
,PRSO
" is too big to jump over." CR>)
(T <V-SKIP>)>)
(T <TELL "That would be a good trick." CR>)>)
(<SET TX <GETPT ,HERE ,P?DOWN>>
<SET S <PTSIZE .TX>>
<COND (<OR <==? .S 2> ;NEXIT
<AND <==? .S 4> ;CEXIT
<NOT <VALUE <GETB .TX 1>>>>>
<TELL
"For a brief moment, you feel the exhilaration of free fall. A thought
hits you: the ground is moving toward me. It is your last thought." CR>
<QUIT>)
(T <V-SKIP>)>)
(ELSE <V-SKIP>)>>
<ROUTINE V-SKIP () <TELL "Wheeeeeeeeee!!!!!" CR>>
<ROUTINE V-LEAVE () <PERFORM ,V?WALK ,P?OUT>>
<ROUTINE V-GOODBYE () <V-HELLO <>>>
<ROUTINE V-HELLO ("OPTIONAL" (HELL T))
<COND (,PRSO
<COND (<FSET? ,PRSO ,PERSON>
<TELL D
,PRSO
" returns the salutation." CR>)
(ELSE
<TELL
"Only schizophrenics say \"">
<COND (.HELL "Hello") (T "Goodbye")>
<TELL "\" to a "
D
,PRSO
"." CR>)>)
(ELSE <TELL "Good day." CR>)>>
<ROUTINE NOT-HERE (OBJ)
<TELL "You can't see ">
<COND (<FSET? .OBJ ,PERSON>
<TELL D .OBJ>)
(T <TELL "that">)>
<TELL " here." CR>>
<ROUTINE PRE-READ ()
<COND (<NOT ,LIT> <TELL "It is impossible to read in the dark." CR>)
(<EQUAL? ,PRSO ,GLOBAL-ENDING ,SECOND-SECTION> <RFALSE>)
(<IN? ,PRSO ,GLOBAL-OBJECTS>
<NOT-HERE ,PRSO>)
(<FSET? ,PRSO ,DRUGBIT>
<TELL "You examine one of the handful of pills:" CR>
<RFALSE>)
(<AND ,PRSI
<NOT <FSET? ,PRSI ,TRANSBIT>>
<NOT <==? ,PRSI ,INTNUM>>>
<TELL "How does one look through the" PRSI "?" CR>)