-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathrarities.zil
2248 lines (2076 loc) · 56.3 KB
/
rarities.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
"RARITIES for Beyond Zork
Copyright (C)1987 Infocom, Inc. All rights reserved."
<OBJECT INTNUM
(LOC GLOBAL-OBJECTS)
(DESC "number")
(FLAGS NODESC)
(SDESC DESCRIBE-INTNUM)
(SYNONYM INTNUM)>
<ROUTINE DESCRIBE-INTNUM (OBJ)
<TELL 'INTNUM C ,SP N ,P-NUMBER>
<RTRUE>>
<OBJECT IT
(LOC GLOBAL-OBJECTS)
(DESC "it")
(FLAGS VOWEL NOARTICLE NODESC TOUCHED)
(SYNONYM IT THAT ITSELF THING SOMETHING)>
<ROUTINE BE-SPECIFIC ()
<TELL "[Be specific: what do you want to ">
<RTRUE>>
<ROUTINE TO-DO-THING-USE (STR1 STR2)
<TELL "[To " .STR1 C ,SP B ,W?SOMETHING ", use the command: "
.STR2 " THING.]" CR>
<RTRUE>>
<ROUTINE CANT-USE (PTR "AUX" BUF)
<SETG QUOTE-FLAG <>>
<SETG P-OFLAG <>>
<SET BUF <REST ,P-LEXV <* .PTR 2>>>
<TELL "[This story can't understand the word \"">
<WORD-PRINT <GETB .BUF 2> <GETB .BUF 3>>
<TELL "\" when you use it that way.]" CR>
<RTRUE>>
<ROUTINE DONT-UNDERSTAND ()
<TELL "[Please try to express that another way.]" CR>
<RTRUE>>
<ROUTINE NOT-IN-SENTENCE (STR)
<TELL "[There aren't " .STR " in that sentence.]" CR>
<RTRUE>>
<OBJECT WALLS
(LOC GLOBAL-OBJECTS)
(DESC "wall")
(FLAGS NODESC TOUCHED SURFACE)
(SYNONYM WALL WALLS)
(ACTION WALLS-F)>
<ROUTINE WALLS-F ()
<COND (<HERE? IN-GARDEN>)
(<NOT <IS? ,HERE ,INDOORS>>
<CANT-SEE-ANY ,WALLS>
<RFATAL>)>
<COND (<HANDLE-WALLS?>
<RTRUE>)>
<USELESS ,WALLS>
<RFATAL>>
<ROUTINE HANDLE-WALLS? ("AUX" X)
<COND (<THIS-PRSI?>
<COND (<SET X <PUTTING?>>
<PRSO-SLIDES-OFF-PRSI>
<RTRUE>)>
<RFALSE>)
(<OR <SET X <CLIMBING-ON?>>
<VERB? LOOK-BEHIND LOOK-UNDER>>
<COND (<HERE? IN-GARDEN>
<TELL CTHEO " is much too high." CR>
<RTRUE>)>
<IMPOSSIBLE>
<RTRUE>)
(<SET X <CLIMBING-OFF?>>
<NOT-ON>
<RTRUE>)
(<OR <SET X <HURTING?>>
<SET X <MOVING?>>>
<TELL CTHEO>
<TELL " isn't affected." CR>
<RTRUE>)
(<SET X <TALKING?>>
<TELL "Talking to walls">
<WONT-HELP>
<RFATAL>)
(T
<RFALSE>)>>
<OBJECT CEILING
(LOC GLOBAL-OBJECTS)
(FLAGS NODESC TOUCHED)
(DESC "ceiling")
(SYNONYM CEILING)
(ACTION CEILING-F)>
<ROUTINE CEILING-F ()
<COND (<NOT <IS? ,HERE ,INDOORS>>
<CANT-SEE-ANY ,CEILING>
<RFATAL>)
(<VERB? LOOK-UNDER>
<V-LOOK>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT HANDS
(LOC GLOBAL-OBJECTS)
(DESC "your hand")
(FLAGS TOOL MANUALLY WEAPON NODESC TOUCHED NOARTICLE)
(SYNONYM HAND HANDS FINGER FINGERS FIST ZZZP)
(ADJECTIVE MY OWN BARE ZZZP ZZZP)
(EFFECT 1)
(SIZE 5)
(ACTION HANDS-F)>
<ROUTINE HANDS-F ("AUX" X)
<COND (<THIS-PRSI?>
<COND (<AND <VERB? SCRAPE-ON>
<T? ,MOSS-TIMER>>
<DO-MOSS>
<RTRUE>)
(<VERB? TIE PUT PUT-ON EMPTY-INTO>
<WASTE-OF-TIME>
<RTRUE>)>
<RFALSE>)
(<VERB? EXAMINE LOOK-ON>
<COND (<T? ,MOSS-TIMER>
<DO-MOSS>
<RTRUE>)>
<TELL ,CYOUR>
<COND (<IS? ,PRSO ,MUNGED>
<TELL "long, slender ">)>
<TELL "fingers are still there." CR>
<RTRUE>)
(<VERB? COUNT>
<TELL "You still have ">
<COND (<NOUN-USED? ,W?FINGERS ,W?FINGER>
<TELL "ten">)
(T
<TELL "two">)>
<TELL " of them." CR>
<RTRUE>)
(<VERB? LOOK-INSIDE SEARCH>
<V-INVENTORY>
<RTRUE>)
(<VERB? PUT PUT-UNDER PUT-BEHIND>
<PERFORM ,V?REACH-IN ,PRSI>
<RTRUE>)
(<VERB? PUT-ON>
<PERFORM ,V?TOUCH ,PRSI>
<RTRUE>)
(<VERB? SCRATCH>
<COND (<T? ,MOSS-TIMER>
<DO-MOSS>
<RTRUE>)>
<TELL "Your hand isn't itchy" ,AT-MOMENT>
<RTRUE>)
(<SET X <MUST-HAVE?>>
<IMPOSSIBLE>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT FEET
(LOC GLOBAL-OBJECTS)
(DESC "your foot")
(FLAGS CLOTHING WORN NODESC NOARTICLE SURFACE)
(SYNONYM FOOT FEET TOE TOES SNEAKER SNEAKERS)
(ADJECTIVE MY OWN)
(EFFECT 1)
(SIZE 5)
(ACTION FEET-F)>
<ROUTINE FEET-F ("AUX" X)
<COND (<THIS-PRSI?>
<COND (<SET X <PUTTING?>>
<WASTE-OF-TIME>
<RTRUE>)>
<RFALSE>)
(<VERB? PUT-ON>
<PERFORM ,V?STAND-ON ,PRSI>
<RTRUE>)
(<SET X <MUST-HAVE?>>
<IMPOSSIBLE>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT MOUTH
(LOC GLOBAL-OBJECTS)
(DESC "your mouth")
(SYNONYM MOUTH)
(ADJECTIVE MY OWN)
(FLAGS NODESC NOARTICLE TOUCHED)
(ACTION MOUTH-F)>
<ROUTINE MOUTH-F ("AUX" X)
<COND (<THIS-PRSI?>
<COND (<VERB? PUT PUT-ON THROW>
<PERFORM ,V?EAT ,PRSO>
<RTRUE>)
(<VERB? TOUCH-TO>
<PERFORM ,V?TASTE ,PRSO>
<RTRUE>)>)
(<VERB? REACH-IN>
<TELL "How rude." CR>
<RTRUE>)
(<VERB? OPEN OPEN-WITH CLOSE>
<NO-NEED>
<RTRUE>)
(<VERB? RAPE KICK KISS>
<TELL "Good luck." CR>
<RTRUE>)
(<SET X <MUST-HAVE?>>
<IMPOSSIBLE>
<RTRUE>)>
<USELESS ,MOUTH>
<RFATAL>>
<OBJECT EYES
(LOC GLOBAL-OBJECTS)
(DESC "your eyes")
(FLAGS NODESC NOARTICLE TOUCHED)
(SYNONYM EYES)
(ADJECTIVE MY OWN)
(ACTION EYES-F)>
"SEEN = given PRE-DUMB-EXAMINE admonishment."
<ROUTINE EYES-F ("AUX" X)
<COND (<THIS-PRSI?>)
(<VERB? OPEN>
<TELL "They are." CR>
<RTRUE>)
(<VERB? CLOSE>
<COND (<AND <EQUAL? ,LAST-MONSTER ,DORN>
<NOT <IS? ,LAST-MONSTER ,MUNGED>>>
<TELL "Something about " THE ,LAST-MONSTER
"'s roving gaze forces your eyes to snap open." CR>
<RTRUE>)
(<T? ,LAST-MONSTER>
<TELL "That won't make " THE ,LAST-MONSTER
" go away." CR>
<RTRUE>)>
<V-SLEEP>
<RTRUE>)
(<SET X <MUST-HAVE?>>
<IMPOSSIBLE>
<RTRUE>)>
<USELESS ,EYES>
<RFATAL>>
<OBJECT HEAD
(LOC GLOBAL-OBJECTS)
(DESC "your head")
(FLAGS NODESC SURFACE TOUCHED NOARTICLE)
(SYNONYM HEAD NECK)
(ADJECTIVE MY OWN)
(ACTION HEAD-F)>
<ROUTINE HEAD-F ("AUX" X)
<COND (<AND <THIS-PRSI?>
<VERB? PUT-ON>>
<COND (<PRSO? HELM>
<PERFORM ,V?WEAR ,PRSO>
<RTRUE>)>
<WASTE-OF-TIME>
<RTRUE>)
(<SET X <MUST-HAVE?>>
<IMPOSSIBLE>
<RTRUE>)>
<USELESS ,HEAD>
<RFATAL>>
<OBJECT PLAYER
(SYNONYM PROTAGONIST)
(DESC "yourself")
; (SDESC SAY-CHARNAME)
(FLAGS TRANSPARENT NODESC NOARTICLE PROPER)
(SIZE 0)
(NAME-TABLE CHARNAME)
(CAPACITY 1000)>
<OBJECT ME
(LOC GLOBAL-OBJECTS)
(DESC "yourself")
(FLAGS PERSON LIVING TOUCHED NOARTICLE)
(SYNONYM I ME MYSELF SELF BODY)
(ADJECTIVE MY OWN)
(ACTION ME-F)>
<ROUTINE ME-F ("OPT" (CONTEXT <>) "AUX" (ANY <>) OBJ NXT X)
<COND (<THIS-PRSI?>
<COND (<VERB? THROW THROW-OVER>
<WASTE-OF-TIME>
<RTRUE>)
(<VERB? COVER>
<PERFORM ,V?STAND-ON ,PRSO>
<RTRUE>)
(<VERB? PUT-ON WRAP-AROUND>
<COND (<IS? ,PRSO ,CLOTHING>
<PERFORM ,V?WEAR ,PRSO>
<RTRUE>)>
<IMPOSSIBLE>
<RTRUE>)
(<VERB? PUT>
<PERFORM ,V?TASTE ,PRSO>
<RTRUE>)>
<RFALSE>)
(<VERB? EXAMINE LOOK-ON SEARCH>
<TELL "You're ">
<SET OBJ <FIRST? ,WINNER>>
<REPEAT ()
<COND (<ZERO? .OBJ>
<RETURN>)>
<SET NXT <NEXT? .OBJ>>
<COND (<IS? .OBJ ,WORN>
<SET ANY T>
<MOVE .OBJ ,DUMMY-OBJECT>)>
<SET OBJ .NXT>>
<COND (<ZERO? .ANY>
<TELL "not wearing anything special." CR>
<RTRUE>)>
<TELL "wearing ">
<CONTENTS ,DUMMY-OBJECT>
<PRINT ,PERIOD>
<MOVE-ALL ,DUMMY-OBJECT ,WINNER>
<RTRUE>)
(<VERB? NAME>
<TELL "You already have a name. It's ">
<PRINT-TABLE ,CHARNAME>
<TELL ,PERIOD>
<RFATAL>)
(<VERB? LISTEN SMELL>
<TELL ,CANT "help doing that." CR>
<RTRUE>)
(<VERB? FIND FOLLOW>
<PRINT "You're right here.|">
<RTRUE>)
(<VERB? RAPE KISS>
<TELL "Desperate?" CR>
<RTRUE>)
(<VERB? HIT>
<TELL "You're indispensable." CR>
<RTRUE>)
(<SET X <HURTING?>>
<TELL "Punishing ">
<COND (<EQUAL? ,WINNER ,PLAYER>
<TELL "your">)
(<IS? ,WINNER ,FEMALE>
<TELL "her">)
(<IS? ,WINNER ,PERSON>
<TELL "him">)
(T
<TELL "it">)>
<TELL "self that way">
<WONT-HELP>
<RTRUE>)
(<YOU-F>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT YOU
(LOC GLOBAL-OBJECTS)
(DESC "myself")
(SYNONYM YOU YOURSELF US)
(FLAGS NODESC NOARTICLE)
(ACTION YOU-F)>
<ROUTINE YOU-F ("AUX" X)
<COND (<VERB? WHO WHAT WHERE>
<TELL "Good question." CR>
<RTRUE>)
(<VERB? UNDRESS>
<INAPPROPRIATE>
<RTRUE>)
(<OR <VERB? EAT TASTE DRINK DRINK-FROM>
<SET X <MUST-HAVE?>>>
<IMPOSSIBLE>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE INAPPROPRIATE ()
<TELL "That would hardly be an appropriate thing to do." CR>
<RTRUE>>
<ROUTINE WONT-HELP ()
<TELL " isn't likely to help matters." CR>
<RTRUE>>
<OBJECT GLOBAL-ROOM
(LOC GLOBAL-OBJECTS)
(DESC "room")
(SYNONYM ROOM AREA PLACE LANDSCAPE HORIZON)
(ADJECTIVE OPENED THIS)
(ACTION GLOBAL-ROOM-F)>
<ROUTINE GLOBAL-ROOM-F ("AUX" X)
<COND (<AND <IS? ,HERE ,INDOORS>
<NOUN-USED? ,W?LANDSCAPE ,W?HORIZON>>
<CANT-SEE-MUCH>
<RTRUE>)
(<VERB? EXAMINE LOOK-ON LOOK-INSIDE>
<V-LOOK>
<RTRUE>)
(<OR <SET X <ENTERING?>>
<VERB? DROP EXIT>>
<V-WALK-AROUND>
<RFATAL>)
(<VERB? WALK-AROUND>
<TELL
"Walking around the area reveals nothing new" ,PTAB
"[If you want to go somewhere, simply indicate a " 'INTDIR ".]" CR>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE CANT-SEE-ANY ("OPT" (THING ,NOT-HERE-OBJECT) (STRING? <>))
<SETG CLOCK-WAIT? T>
<PCLEAR>
<THIS-IS-IT ,NOT-HERE-OBJECT>
<TELL ,CANT>
<COND (<VERB? LISTEN>
<TELL B ,W?HEAR>)
(<VERB? SMELL>
<TELL B ,W?SMELL>)
(T
<TELL B ,W?SEE>)>
<TELL C ,SP>
<COND (<T? .STRING?>
<TELL .THING>)
(T
<COND (<IS? .THING ,PROPER>
<TELL ,LTHE>)
(<NOT <IS? .THING ,NOARTICLE>>
<TELL "any ">)>
<TELL D .THING>)>
<TELL " here." CR>
<RTRUE>>
<ROUTINE HOW? ()
<TELL "A noble idea. How do you intend to do it?" CR>
<RTRUE>>
<ROUTINE NOT-LIKELY ("OPT" (OBJ ,PRSO))
<TELL "It" <PICK-NEXT ,LIKELIES> " that " THE .OBJ>
<RTRUE>>
<ROUTINE YOUD-HAVE-TO (STR "OPT" (OBJ ,PRSO))
<THIS-IS-IT .OBJ>
<COND (<EQUAL? ,WINNER ,PLAYER>
<TELL "You'd ">)
(T
<TELL CTHE ,WINNER " would ">)>
<TELL "have to " .STR C ,SP THE .OBJ " to do that." CR>
<RTRUE>>
<OBJECT HER
(LOC GLOBAL-OBJECTS)
(DESC "her")
(FLAGS NODESC NOARTICLE PERSON LIVING FEMALE)
(SYNONYM SHE HER HERSELF)>
<OBJECT HIM
(LOC GLOBAL-OBJECTS)
(DESC "him")
(FLAGS NODESC NOARTICLE PERSON LIVING)
(SYNONYM HE HIM HIMSELF)>
<OBJECT THEM
(LOC GLOBAL-OBJECTS)
(DESC "them")
(FLAGS NODESC NOARTICLE)
(SYNONYM THEY THEM THEMSELVES)>
<OBJECT INTDIR
(LOC GLOBAL-OBJECTS)
(DESC "direction")
(FLAGS NODESC)
(SYNONYM DIRECTION)
(ADJECTIVE NORTH EAST SOUTH WEST W NE NW SE SW UP DOWN)>
<OBJECT GROUND
(LOC GLOBAL-OBJECTS)
(DESC "ground")
(FLAGS NODESC)
(SYNONYM SURFACE GROUND GROUNDS EARTH ZZZP)
(ACTION GROUND-F)>
<ROUTINE GROUND-F ("AUX" OBJ NXT X)
<COND (<AND <HERE? IN-SKY>
<SET X <TOUCHING?>>>
<CANT-FROM-HERE>
<RTRUE>)
(<THIS-PRSI?>
<COND (<VERB? PUT-ON PUT THROW THROW-OVER>
<PERFORM ,V?DROP ,PRSO>
<RTRUE>)
(<VERB? WRITE-ON>
<COND (<NOT <PRSO? GLYPH GGLYPH>>
<IMPOSSIBLE>
<RTRUE>)>
<WRITE-GLYPH>
<RTRUE>)>
<RFALSE>)
(<VERB? EXAMINE LOOK-ON SEARCH>
<COND (<SET OBJ <FIRST? ,HERE>>
<REPEAT ()
<SET NXT <NEXT? .OBJ>>
<COND (<OR <IS? .OBJ ,NODESC>
<NOT <IS? .OBJ ,TAKEABLE>>>
<MOVE .OBJ ,C-OBJECT>)>
<SET OBJ .NXT>
<COND (<ZERO? .OBJ>
<RETURN>)>>)>
<TELL ,YOU-SEE>
<CONTENTS ,HERE>
<TELL " on the ">
<GROUND-WORD>
<TELL ,PERIOD>
<MOVE-ALL ,C-OBJECT ,HERE>
<RTRUE>)
(<VERB? CROSS>
<V-WALK-AROUND>
<RTRUE>)
(<VERB? LOOK-UNDER>
<TELL
"Unfortunately, you left your X-ray glasses at home." CR>
<RTRUE>)
(<VERB? DIG DIG-UNDER>
<TELL "You dig around with " THEI>
<BUT-FIND-NOTHING>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT FLOOR
(LOC GLOBAL-OBJECTS)
(DESC "floor")
(SYNONYM FLOOR)
(ACTION FLOOR-F)>
<ROUTINE FLOOR-F ("AUX" X)
<COND (<NOT <IS? ,HERE ,INDOORS>>
<CANT-SEE-ANY ,FLOOR>
<RFATAL>)>
<SET X <GETB ,CAVE-ROOMS 0>>
<COND (<SET X <INTBL? ,HERE <REST ,CAVE-ROOMS 1> .X 1>>)
(<HERE? IN-LAIR NE-CAVE SE-CAVE>)
(<VERB? DIG DIG-UNDER>
<TELL ,CANT "do that here." CR>
<RTRUE>)>
<RETURN <GROUND-F>>>
<ROUTINE NO-NEED ()
<TELL ,DONT "need to do that." CR>
<RTRUE>>
<ROUTINE NOT-IN ("OPT" (THING ,PRSO))
<THIS-IS-IT .THING>
<TELL "You're not in " THE .THING ,PERIOD>
<RTRUE>>
<ROUTINE NOT-ON ("OPT" (THING ,PRSO))
<THIS-IS-IT .THING>
<TELL "You're not on " THE .THING ,PERIOD>
<RTRUE>>
<ROUTINE ALREADY-IN ("OPT" (THING ,PRSO))
<THIS-IS-IT .THING>
<TELL ,ALREADY "in " THE .THING ,PERIOD>
<RTRUE>>
<ROUTINE ALREADY-ON ("OPT" (THING ,PRSO))
<THIS-IS-IT .THING>
<TELL ,ALREADY "on " THE .THING ,PERIOD>
<RTRUE>>
<ROUTINE ALREADY-AT-TOP ("OPT" (OBJ ,PRSO))
<ALREADY-AT "top" .OBJ>
<RTRUE>>
<ROUTINE ALREADY-AT-BOTTOM ("OPT" (OBJ ,PRSO))
<ALREADY-AT "bottom" .OBJ>
<RTRUE>>
<ROUTINE ALREADY-AT (STR "OPT" (OBJ ,PRSO))
<THIS-IS-IT .OBJ>
<TELL ,ALREADY "at the " .STR " of " THE .OBJ ,PERIOD>
<RTRUE>>
<ROUTINE CANT-SEE-MUCH ()
<PRINT "Little can be seen ">
<TELL "from here." CR>
<RTRUE>>
; <ROUTINE CANT-SEE-FROM-HERE ("OPT" (THING ,PRSO))
<TELL ,CANT "see " THE .THING " from here." CR>
<RTRUE>>
<ROUTINE NOT-A (STR)
<TELL "You're an adventurer, not a " .STR ,PERIOD>
<RTRUE>>
<ROUTINE OPEN-CLOSED ("OPT" (THING ,PRSO) (VOWEL <>))
<COND (<IS? .THING ,OPENED>
<COND (<T? .VOWEL>
<TELL "n">)>
<TELL " open ">)
(T
<TELL " closed ">)>
<TELL D .THING>
<RTRUE>>
<ROUTINE CANT-FROM-HERE ()
<TELL ,IMPOSSIBLY "do that">
<STANDING>
<RTRUE>>
<ROUTINE STANDING ("OPT" X)
<COND (<NOT <ASSIGNED? X>>
<TELL " from where you're ">)>
<COND (<EQUAL? <LOC ,PLAYER> ,SADDLE ,PEW>
<TELL "sitt">)
(T
<TELL B ,W?STAND>)>
<TELL "ing">
<COND (<NOT <ASSIGNED? X>>
<PRINT ,PERIOD>)>
<RTRUE>>
; <ROUTINE ITS-EMPTY ("OPT" (OBJ ,PRSO))
<TELL CTHE .OBJ>
<IS-ARE .OBJ>
<TELL B ,W?EMPTY ,PERIOD>
<RTRUE>>
<ROUTINE IS-ARE ("OPT" (THING ,PRSO))
<PRINTC ,SP>
<COND (<IS? .THING ,PLURAL>
<TELL "are ">
<RTRUE>)>
<TELL "is ">
<RTRUE>>
<ROUTINE ISNT-ARENT ("OPT" (THING ,PRSO))
<PRINTC ,SP>
<COND (<IS? .THING ,PLURAL>
<TELL "are">)
(T
<TELL "is">)>
<TELL "n't">
<RTRUE>>
; <ROUTINE WHICH-WAY (STR)
<TELL "[Which way do you want to go " .STR "?]" CR>
<RTRUE>>
<ROUTINE FIRMLY-ATTACHED (THING TO "OPT" (STR <>))
<COND (<ZERO? .STR>
<THIS-IS-IT .THING>
<TELL CTHE .THING>
<IS-ARE .THING>)
(T
<THIS-IS-IT .TO>
<TELL ,XTHE .THING ,SIS>)>
<TELL <PICK-NEXT ,FIRMS> "ly "
<PICK-NEXT ,ATTACHES> ,STO THE .TO ,PERIOD>
<RTRUE>>
<ROUTINE HERE-F ("AUX" X)
<COND (<THIS-PRSI?>
<COND (<SET X <PUTTING?>>
<PERFORM ,V?DROP ,PRSO>
<RTRUE>)>
<RFALSE>)
(<VERB? EXAMINE LOOK-ON LOOK-INSIDE SEARCH>
<V-LOOK>
<RTRUE>)
(<VERB? LOOK-BEHIND LOOK-OUTSIDE>
<CANT-SEE-MUCH>
<RTRUE>)
(<VERB? ENTER WALK-TO FIND>
<ALREADY-IN>
<RTRUE>)
(<OR <SET X <CLIMBING-ON?>>
<SET X <CLIMBING-OFF?>>>
<V-WALK-AROUND>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT GLOBAL-HOLE
(LOC GLOBAL-OBJECTS)
(DESC "hole")
(FLAGS NODESC)
(SYNONYM HOLE)
(ACTION GLOBAL-HOLE-F)>
<ROUTINE GLOBAL-HOLE-F ()
<COND (<VERB? DIG SDIG>
<WASTE-OF-TIME>
<RTRUE>)>
<TELL ,CANT "see any here." CR>
<RTRUE>>
<OBJECT SOUND
(LOC GLOBAL-OBJECTS)
(DESC "sound")
(FLAGS NODESC)
(SYNONYM SOUND SOUNDS NOISE NOISES)
(ACTION SOUND-F)>
<ROUTINE SOUND-F ("AUX" X)
<SET X <GETP ,HERE ,P?HEAR>>
<COND (<T? .X>
<COND (<THIS-PRSO?>
<PERFORM ,PRSA .X ,PRSI>
<RTRUE>)>
<PERFORM ,PRSA ,PRSO .X>
<RTRUE>)
(<OR <SET X <SEEING?>>
<SET X <TOUCHING?>>>
<IMPOSSIBLE>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT GCORNER
(LOC GLOBAL-OBJECTS)
(DESC "corner")
(FLAGS NODESC SURFACE)
(SYNONYM CORNER CORNERS)
(ACTION GCORNER-F)>
<ROUTINE GCORNER-F ("AUX" X)
<COND (<NOT <IS? ,HERE ,INDOORS>>
<CANT-SEE-ANY ,GCORNER>
<RFATAL>)
(<THIS-PRSI?>
<COND (<SET X <PUTTING?>>
<PERFORM ,V?DROP ,PRSO>
<RTRUE>)>
<RFALSE>)
(<VERB? EXAMINE LOOK-INSIDE LOOK-ON
SEARCH LOOK-BEHIND LOOK-UNDER>
<V-LOOK>
<RTRUE>)
(<SET X <ENTERING?>>
<TELL ,ALREADY "close enough to " THEO ,PERIOD>
<RTRUE>)
(<SET X <EXITING?>>
<V-WALK-AROUND>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT RIGHT
(LOC GLOBAL-OBJECTS)
(DESC "that direction")
(FLAGS NODESC NOARTICLE)
(SYNONYM RIGHT CLOCKWISE FORWARD AHEAD)
(ACTION RL-F)>
<OBJECT LEFT
(LOC GLOBAL-OBJECTS)
(DESC "that direction")
(FLAGS NODESC NOARTICLE)
(SYNONYM LEFT COUNTERCL BACKWARD BACKWARDS BACK)
(ACTION RL-F)>
<ROUTINE RL-F ("AUX" X)
<COND (<THIS-PRSI?>
<RFALSE>)
(<OR <SET X <CLIMBING-ON?>>
<SET X <CLIMBING-OFF?>>>
<V-WALK-AROUND>
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT GAME
(LOC GLOBAL-OBJECTS)
(DESC "this game")
(FLAGS NODESC NOARTICLE)
(SYNONYM ZORK GAME STORY)
(ACTION GAME-F)>
<ROUTINE GAME-F ()
<COND (<VERB? TOUCH READ EXAMINE>
<TELL "[That's what you're doing.]" CR>
<RFATAL>)>
<USELESS ,GAME>
<RFATAL>>
<CONSTANT YES-INBUF-LENGTH 14>
<CONSTANT YES-INBUF <ITABLE ,YES-INBUF-LENGTH (BYTE) 0>>
<CONSTANT YES-LEXV-LENGTH 10>
<CONSTANT YES-LEXV <ITABLE ,YES-LEXV-LENGTH (BYTE) 0>>
<ROUTINE READ-YES-LEXV ("AUX" KEY)
<COPYT ,YES-LEXV 0 ,YES-LEXV-LENGTH>
<PUTB ,YES-LEXV 0 2>
<COPYT ,YES-INBUF 0 ,YES-INBUF-LENGTH>
<PUTB ,YES-INBUF 0 <- ,YES-INBUF-LENGTH 2>>
<REPEAT ()
<COLOR ,INCOLOR ,BGND>
<SET KEY <READ ,YES-INBUF ,YES-LEXV>>
<COND (<EQUAL? .KEY ,EOL ,LF>
<COLOR ,FORE ,BGND>
<RFALSE>)>>>
<ROUTINE YES-WORD? (WORD)
<COND (<ZERO? .WORD>
<RFALSE>)
(<EQUAL? .WORD ,W?Y ,W?YES ,W?YUP>
<RTRUE>)
(<EQUAL? .WORD ,W?OKAY ,W?OK ,W?SURE>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE NO-WORD? (WORD)
<COND (<ZERO? .WORD>
<RFALSE>)
(<EQUAL? .WORD ,W?N ,W?NO ,W?NOPE>
<RTRUE>)
(<EQUAL? .WORD ,W?NEGATIVE ,W?NAY>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE YES? ("AUX" WORD TBL)
<COLOR ,FORE ,BGND>
<CRLF>
<REPEAT ()
<TELL CR "[Please type YES or NO.] >">
<READ-YES-LEXV>
<COND (<ZERO? <GETB ,YES-LEXV ,P-LEXWORDS>>
<AGAIN>)>
<SET WORD <GET ,YES-LEXV ,P-LEXSTART>>
<COND (<ZERO? .WORD>
<AGAIN>)
(<YES-WORD? .WORD>
<RTRUE>)
(<NO-WORD? .WORD>
<RFALSE>)>>>
"INITVARS must be called first!"
<GLOBAL VT100:FLAG <>>
<ROUTINE STARTUP ("AUX" X TBL CNT)
<COPYT ,VOCAB ,VOCAB2 <+ <GETB ,VOCAB 0> 2>> ; "Init VOCAB2."
<DEFAULT-SOFTS>
<SET TBL <GET ,MACHINE-COLORS ,HOST>>
<COND (<T? .TBL>
<SET TBL <GET .TBL 1>>
<SETG BGND <GETB .TBL 0>>
<SETG FORE <GETB .TBL 1>>
<SETG INCOLOR <GETB .TBL 2>>
<SETG GCOLOR <GETB .TBL 3>>)>
<COND (<EQUAL? ,HOST ,DEC-20>
<CLEAR -1>
<TELL CR "Is this a VT220?">
<COND (<NOT <YES?>>
<SETG VT100 T>
<SETUP-APPLE-MODE>)>)>
<COLOR ,FORE ,BGND>
<CLEAR -1>
<CRLF>
<PRINT "Copyright (C)1987 Infocom, Inc. All rights reserved.">
<CRLF>
<PRINT "|Do you want to ">
<TELL "begin a new game, restore a saved game, or quit?" CR CR>
<REPEAT ()
<COLOR ,FORE ,BGND>
<TELL "[Type BEGIN, RESTORE or QUIT.] >">
<READ-YES-LEXV>
<COND (<ZERO? <GETB ,YES-LEXV ,P-LEXWORDS>>
<AGAIN>)>
<SET X <GET ,YES-LEXV ,P-LEXSTART>>
<COND (<ZERO? .X>
<AGAIN>)
(<EQUAL? .X ,W?BEGIN ,W?B ,W?RESTART>
<PROLOGUE>
<CLEAR -1>
<RTRUE>)
(<EQUAL? .X ,W?RESTORE>
<V-RESTORE>
<CRLF>)
(<EQUAL? .X ,W?Q ,W?QUIT>
<CRLF>
<QUIT>
<RFALSE>)>>>
<ROUTINE SHOW-MENU-ITEM (LINE "OPT" (INV 0) "AUX" X)
<CENTER <+ .LINE 7> 35>
<COLOR ,GCOLOR ,BGND>
<HLIGHT ,H-NORMAL>
<COND (<T? .INV>
<COND (<AND <T? ,COLORS?>
<NOT <EQUAL? ,FORE ,GCOLOR>>>
<COLOR ,FORE ,BGND>)
(T
<HLIGHT ,H-INVERSE>)>)>
<TELL <GET ,MENU-LIST .LINE>>
<RFALSE>>
<ROUTINE SETUP-CHARACTER ("AUX" (LAST 0) X STAT)
<PUTB ,DBOX 0 ,SP>
<COPYT ,DBOX <REST ,DBOX 1> %<- 0 <- ,DBOX-LENGTH 1>>>
<REPEAT ()
<COLOR ,FORE ,BGND>
<CLEAR -1>
<SPLIT 14>
<COND (<IS? ,PLAYER ,NAMED>
<SHOW-RANK ,WIDTH>)>
<TO-TOP-WINDOW>
<COLOR ,FORE ,BGND>
<CENTER 5 15>
<TELL "Character Setup">
<SET STAT 0>
<REPEAT ()
<SHOW-MENU-ITEM .STAT>
<COND (<IGRTR? STAT 4>
<RETURN>)>>
<USE-ARROWS>
<PRINT
"highlight your selection.||Type [RETURN] to continue. >">
<SET STAT .LAST>
<REPEAT ()
<TO-TOP-WINDOW>
<SHOW-MENU-ITEM .STAT 1>
<TO-BOTTOM-WINDOW>
<SET X <DO-INPUT>>
<COND (<EQUAL? .X ,DOWN-ARROW ,SP ,UP-ARROW>
<TO-TOP-WINDOW>
<SHOW-MENU-ITEM .STAT>
<COND (<EQUAL? .X ,UP-ARROW>
<COND (<DLESS? STAT 0>
<SET STAT 4>)>
<AGAIN>)>
<COND (<IGRTR? STAT 4>
<SET STAT 0>)>
<AGAIN>)
(<EQUAL? .X ,EOL ,LF>
<COND (<ZERO? .STAT>
<QUICK-SETUP>
<RETURN>)
(<EQUAL? .STAT 1>
<PICK-A-CHAR>
<RETURN>)
(<EQUAL? .STAT 2>
<ROLL-YOUR-OWN>
<RETURN>)
(<EQUAL? .STAT 3>
<MANUAL>
<CRLF>
<COND (<T? ,POTENTIAL>
<TELL CR
"Your unused Potential has been evenly distributed." CR>)>
<RETURN>)>
<CRLF>
<CRLF>
<V-QUIT>
<TO-TOP-WINDOW>
<SHOW-MENU-ITEM .STAT>
<USE-ARROWS>
<PRINT
"highlight your selection.||Type [RETURN] to continue. >">
<SET STAT 0>
<AGAIN>)>
<SOUND 2>>
<TO-BOTTOM-WINDOW>
<CRLF>
<COND (<ZERO? .STAT>
<RETURN>)>
<SET LAST .STAT>
<PRINT "|Are you sure ">
<TELL "these are the attributes you want?">
<COND (<NOT <YES?>>
<AGAIN>)>
<GET-SEX>
<GET-NAME>
<MAKE ,PLAYER ,NAMED>
<SHOW-RANK ,WIDTH>
<PRINT "|Are you sure ">
<PRINT-TABLE ,CHARNAME>
<TELL " is the character you want?">
<COND (<YES?>
<RETURN>)>>
<SETG SAY-STAT T>