-
Notifications
You must be signed in to change notification settings - Fork 18
/
globals.zil
1897 lines (1683 loc) · 49.7 KB
/
globals.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
"GLOBALS for
LEATHER GODDESSES OF PHOBOS
(c) Copyright 1986 Infocom, Inc. All Rights Reserved."
<CONSTANT S-TEXT 0>
<CONSTANT S-WINDOW 1>
<CONSTANT H-NORMAL 0>
<CONSTANT H-INVERSE 1>
<CONSTANT H-BOLD 2>
<CONSTANT H-ITALIC 4>
<CONSTANT D-SCREEN-ON 1>
<CONSTANT D-SCREEN-OFF -1>
<CONSTANT D-PRINTER-ON 2>
<CONSTANT D-PRINTER-OFF -2>
<CONSTANT D-TABLE-ON 3>
<CONSTANT D-TABLE-OFF -3>
<CONSTANT D-RECORD-ON 4>
<CONSTANT D-RECORD-OFF -4>
<GLOBAL HOST:NUMBER 0> "Host machine."
<GLOBAL WIDTH:NUMBER 0> "Width of screen in chars."
<ROUTINE INIT-STATUS-LINE ()
<COND (<L? ,WIDTH 38>
<TELL "[Screen too narrow.]" CR>
<QUIT>)>
<SETG OHERE <>>
<SETG OLD-LEN 0>
<SPLIT 1>
<SCREEN ,S-WINDOW>
<HLIGHT ,H-INVERSE>
<CURSET 1 1>
;<ERASE 1> ;"This semi by Jeff"
;<PRINT-SPACES <LOWCORE SCRH>>
<PRINT-SPACES ,WIDTH>
<COND (<G? ,WIDTH 74>
<CURSET 1 51>
<TELL "Score:">
<CURSET 1 64>
<TELL "Moves:">)>
<HLIGHT ,H-NORMAL>
<SCREEN ,S-TEXT>
<RTRUE>>
<CONSTANT SL-TABLE:TABLE <ITABLE NONE 80>> "status line constructed here"
<GLOBAL OHERE:OBJECT <>>
<GLOBAL OLD-LEN:NUMBER 0>
<ROUTINE UPDATE-STATUS-LINE ()
<SCREEN ,S-WINDOW>
;<BUFOUT <>>
<HLIGHT ,H-NORMAL>
<HLIGHT ,H-INVERSE>
<COND (<NOT <EQUAL? ,HERE ,OHERE>>
<SETG OHERE ,HERE>
;<DIROUT ,D-SCREEN-OFF> ; "Screen off."
<DIROUT ,D-TABLE-ON ,SL-TABLE> ; "Table on."
<SAY-HERE>
<DIROUT ,D-TABLE-OFF> ; "Table off."
;<DIROUT ,D-SCREEN-ON> ; "Screen on."
<CURSET 1 2>
<PRINT-SPACES ,OLD-LEN> ; "Erase old HERE desc"
<SETG OLD-LEN <GET ,SL-TABLE 0>> ;"Print new HERE desc."
<CURSET 1 2>
<SAY-HERE>)>
<COND (<G? ,WIDTH 74>
<CURSET 1 58>
<TELL N ,SCORE " "> ;"for 110 to 80 score bug"
<CURSET 1 71>
<TELL N ,MOVES>)
(T
<DIROUT ,D-TABLE-ON ,SL-TABLE>
<TELL N ,SCORE "/" N ,MOVES " ">
<DIROUT ,D-TABLE-OFF>
<CURSET 1 <- ,WIDTH <+ <GET ,SL-TABLE 0> 1>>>
<TELL N ,SCORE "/" N ,MOVES " ">)>
<HLIGHT ,H-NORMAL>
<SCREEN ,S-TEXT> ;"Back to main screen."
<RTRUE>>
<ROUTINE PRINT-SPACES (N "AUX" AMT)
<REPEAT ()
<COND (<G? .N ,BLANKS-LEN>
<SET AMT ,BLANKS-LEN>)
(T
<SET AMT .N>)>
<PRINTT ,BLANKS .AMT>
<COND (<L=? <SET N <- .N .AMT>> 0>
<RTRUE>)>>>
<CONSTANT BLANKS-LEN 10>
<CONSTANT BLANKS <ITABLE ,BLANKS-LEN (BYTE) !\ >>
;<ROUTINE PRINT-SPACES (CNT)
<REPEAT ()
<COND (<L? <SET CNT <- .CNT 1>> 0>
<RETURN>)
(T
<PRINTC 32>)>>>
<ROUTINE SAY-HERE ("AUX" NUM)
<COND (<ZERO? ,LIT?>
<TELL "Darkness">)
(T
<TELL D ,HERE>
<COND (<G? ,WIDTH 74>
<SET NUM <CANAL-LOC>>
<COND (<EQUAL? .NUM 10>
<TELL ", near the ">
<COND (<EQUAL? ,NEARER-DOCK ,MY-KIND-OF-DOCK>
<TELL "ea">)
(T
<TELL "we">)>
<TELL "st bank">)>
<COND (<AND <FSET? <LOC ,PROTAGONIST> ,VEHBIT>
<NOT ,DONT-PRINT-VEHICLE>>
<TELL ", ">
<COND (<FSET? <LOC ,PROTAGONIST> ,INBIT>
<TELL "i">)
(T
<TELL "o">)>
<TELL "n" T <LOC ,PROTAGONIST>>)>)>)>
<RTRUE>>
<ADJ-SYNONYM LARGE LARGER HUGE HUGER BIG BIGGER GIANT GIGANTIC TREMENDOUS
MIGHTY MIGHTIER MASSIVE>
<ADJ-SYNONYM WIDE BROAD>
<ADJ-SYNONYM SMALL SMALLER TINY TINIER LITTLE PETITE TEENSY WEENSY>
<ADJ-SYNONYM MY MINE>
<GLOBAL LIT T>
<GLOBAL RANK 0>
<GLOBAL MOVES 0>
<GLOBAL SCORE 0>
<GLOBAL HERE <>>
<GLOBAL INT-MAX 429> ;"sum of highest possible scores"
<GLOBAL EXT-MAX 9309> ;"what you tell player the maximum score is"
<ROUTINE INCREMENT-SCORE (BASE VAR "OPTIONAL" (INC-RANK <>) "AUX" CHANGE DIF)
<COND (.INC-RANK
<SETG RANK <+ ,RANK 1>>)>
<SET CHANGE <+ <RANDOM .VAR> .BASE>>
<SET DIF <- <+ .BASE .VAR> .CHANGE>>
<SETG INT-MAX <- ,INT-MAX .DIF>>
<SETG EXT-MAX <+ ,INT-MAX <RANDOM <- ,EXT-MAX ,INT-MAX>>>>
<SETG SCORE <+ ,SCORE .CHANGE>>>
<OBJECT GLOBAL-OBJECTS
(SYNONYM ZZMGCK) ;"No, this synonym doesn't need to exist... sigh"
(DESC "it")
(FLAGS INVISIBLE TOUCHBIT SURFACEBIT TRYTAKEBIT OPENBIT SEARCHBIT
TRANSBIT WEARBIT MUNGBIT ONBIT LIGHTBIT RLANDBIT WORNBIT
VEHBIT INDOORSBIT CONTBIT VOWELBIT LOCKEDBIT NDESCBIT DOORBIT
ACTORBIT SMELLEDBIT UNTEEDBIT)>
<OBJECT LOCAL-GLOBALS
(LOC GLOBAL-OBJECTS)
(DESC "it")
(SYNONYM ZZMGCK) ;"Yes, this synonym needs to exist... sigh"
;(DESCFCN 0)
;(GLOBAL GLOBAL-OBJECTS)
;(FDESC "F")
;(LDESC "F")
;(SIZE 0)
;(TEXT "")
;(CAPACITY 0)
;(THINGS <PSEUDO (ZZMGCK ZZMGCK ME-F)>)>
<OBJECT ROOMS
(IN TO ROOMS)
(DESC "it")>
<OBJECT INTDIR
(LOC GLOBAL-OBJECTS)
(DESC "direction")
(SYNONYM DIRECTION)
(ADJECTIVE NORTH SOUTH EAST WEST NW NE SW SE)
(ACTION INTDIR-F)>
<ROUTINE INTDIR-F ()
<COND (<AND <VERB? BOARD>
<EQUAL? ,P-PRSA-WORD ,W?RIDE>>
<COND (<IN? ,PROTAGONIST ,STALLION>
<DO-WALK ,P-DIRECTION>)
(<IN? ,STALLION ,HERE>
<DO-FIRST "mount">)
(T
<TELL ,THERES-NOTHING "to ride!" CR>)>)>>
<OBJECT INTNUM
(LOC GLOBAL-OBJECTS)
(DESC "number")
(SYNONYM NUMBER)
(ADJECTIVE WIFE HUSBAND \#) ;"for things like WIFE # 375"
(ACTION INTNUM-F)>
<ROUTINE INTNUM-F ()
<COND (<AND <ADJ-USED ,W?WIFE>
<OR <NOT <EQUAL? ,HERE ,INNER-HAREM>>
<NOT ,MALE>>
<NOT <PICKING-WIFE>>>
<SETG P-WON <>>
<TELL ,YOU-CANT-SEE-ANY "wife here!" CR>)
(<AND <ADJ-USED ,W?HUSBAND>
<OR <NOT <EQUAL? ,HERE ,INNER-HAREM>>
,MALE>
<NOT <PICKING-WIFE>>>
<SETG P-WON <>>
<TELL ,YOU-CANT-SEE-ANY "husband here!" CR>)
(<VERB? ANSWER-KLUDGE>
<PERFORM ,V?USE-QUOTES ,INTNUM>
<RTRUE>)
(<AND <EQUAL? ,P-NUMBER ,CHOICE-NUMBER>
<IN? ,SULTANS-WIFE ,HERE>>
<COND (<PRSO? ,INTNUM>
<PERFORM-PRSA ,SULTANS-WIFE ,PRSI>
<RTRUE>)
(T
<PERFORM-PRSA ,PRSO ,SULTANS-WIFE>
<RTRUE>)>)
(<OR <AND <VERB? ASK-NO-ONE-FOR PICK>
<IN? ,HAREM-GUARD ,HERE>>
<AND <VERB? ASK-FOR>
<PRSO? ,HAREM-GUARD>>>
<PICK-WIFE ,INTNUM>)
(<AND <EQUAL? ,HERE ,VIZICOMM-BOOTH>
<VERB? SET>>
<PERFORM-PRSA ,VIZICOMM>
<RTRUE>)>>
<ROUTINE PICKING-WIFE ()
<COND (<AND <VERB? ASK-NO-ONE-FOR PICK>
<IN? ,HAREM-GUARD ,HERE>>
<RTRUE>)
(<AND <VERB? ASK-FOR>
<PRSO? ,HAREM-GUARD>>
<RTRUE>)
(T
<RFALSE>)>>
;<OBJECT PSEUDO-OBJECT
(LOC LOCAL-GLOBALS)
(DESC "pseudo") ;"DESC must be 6 characters long! --pdl 3/4/86"
(ACTION ME-F)>
<OBJECT IT
(LOC GLOBAL-OBJECTS)
(SYNONYM IT THEM)
(DESC "it")
(FLAGS VOWELBIT NARTICLEBIT TOUCHBIT)>
<OBJECT HIM
(LOC GLOBAL-OBJECTS)
(SYNONYM HIM HIMSELF)
(DESC "him")
(FLAGS NARTICLEBIT TOUCHBIT)>
<OBJECT HER
(LOC GLOBAL-OBJECTS)
(SYNONYM HER HERSELF)
(DESC "her")
(FLAGS NARTICLEBIT TOUCHBIT)>
<OBJECT EACH-OTHER
(LOC GLOBAL-OBJECTS)
(DESC "it")
(SYNONYM OTHER ITSELF)
(ADJECTIVE EACH)
(ACTION EACH-OTHER-F)>
<ROUTINE EACH-OTHER-F ()
<COND (<PRSI? ,EACH-OTHER>
<PERFORM-PRSA ,PRSO ,PRSO>
<RTRUE>)
(<NOT <NOUN-USED ,W?ITSELF ,EACH-OTHER>>
<SETG P-WON <>>
<COND (<ADJ-USED ,W?EACH>
<CANT-USE ,W?EACH T>)
(T
<CANT-USE ,W?OTHER T>)>
<RTRUE>)>>
<OBJECT MAN-WOMAN
(LOC GLOBAL-OBJECTS)
(SDESC "")
(SYNONYM MAN WOMAN)
(ACTION MAN-WOMAN-F)>
<ROUTINE MAN-WOMAN-F ("AUX" PERSON)
<COND (<VERB? FOLLOW> ;"for YOUNG WOMAN"
<COND (<EQUAL? ,FOLLOW-FLAG 4>
<TELL ,DONT-WANT-TO>)
(<EQUAL? ,FOLLOW-FLAG 5>
<DO-WALK ,P?NORTH>)
(<EQUAL? ,FOLLOW-FLAG 6>
<DO-WALK ,P?EAST>)
(T
<V-WALK-AROUND>)>)
(<AND <EQUAL? <GET ,P-NAMW 0> ,W?MAN> ;"MAN is the PRSO"
<PRSO? ,MAN-WOMAN> ;"in case PRSI is also MAN or WOMAN">
<COND (<SET PERSON <FIND-MAN>>
<PERFORM-PRSA .PERSON ,PRSI>
<RTRUE>)
(T
<CANT-SEE ,MAN-WOMAN>)>)
(<AND <EQUAL? <GET ,P-NAMW 0> ,W?WOMAN> ;"WOMAN is the PRSO"
<PRSO? ,MAN-WOMAN> ;"in case PRSI is also MAN or WOMAN">
<COND (<SET PERSON <FIND-WOMAN>>
<PERFORM-PRSA .PERSON ,PRSI>
<RTRUE>)
(T
<CANT-SEE ,MAN-WOMAN>)>)
(<AND <EQUAL? <GET ,P-NAMW 1> ,W?MAN> ;"MAN is the PRSI"
<PRSI? ,MAN-WOMAN> ;"in case PRSO is also MAN or WOMAN">
<COND (<SET PERSON <FIND-MAN>>
<PERFORM-PRSA ,PRSO .PERSON>
<RTRUE>)
(T
<CANT-SEE ,MAN-WOMAN>)>)
(<AND <EQUAL? <GET ,P-NAMW 1> ,W?WOMAN> ;"WOMAN is the PRSI"
<PRSI? ,MAN-WOMAN> ;"in case PRSO is also MAN or WOMAN">
<COND (<SET PERSON <FIND-WOMAN>>
<PERFORM-PRSA ,PRSO .PERSON>
<RTRUE>)
(T
<CANT-SEE ,MAN-WOMAN>)>)>>
<ROUTINE FIND-MAN ()
<PUTP ,MAN-WOMAN ,P?SDESC "man">
<COND (<IN? ,SALESMAN ,HERE>
<RETURN ,SALESMAN>)
(<IN? ,MAD-SCIENTIST ,HERE>
<RETURN ,MAD-SCIENTIST>)
(<IN? ,MITRE ,HERE>
<RETURN ,MITRE>)
(<IN? ,PROPRIETOR ,HERE>
<RETURN ,PROPRIETOR>)
(<AND <IN? ,THORBAST ,HERE>
,MALE>
<RETURN ,THORBAST>)
(<AND <IN? ,YOUNG-WOMAN ,HERE>
<NOT ,MALE>>
<RETURN ,YOUNG-WOMAN>)
(<AND <IN? ,SULTAN ,HERE>
,MALE>
<RETURN ,SULTAN>)
(<AND <IN? ,SULTANS-WIFE ,HERE>
<NOT ,MALE>>
<RETURN ,SULTANS-WIFE>)
(<AND <VISIBLE? ,SIDEKICK>
,MALE>
<RETURN ,SIDEKICK>)
(T
<RFALSE>)>>
<ROUTINE FIND-WOMAN ()
<PUTP ,MAN-WOMAN ,P?SDESC "woman">
<COND (<AND <IN? ,THORBAST ,HERE>
<NOT ,MALE>>
<RETURN ,THORBAST>)
(<AND <IN? ,YOUNG-WOMAN ,HERE>
,MALE>
<RETURN ,YOUNG-WOMAN>)
(<AND <IN? ,THETA ,HERE>
<NOT <FSET? ,THETA ,MUNGBIT>>>
<RETURN ,THETA>)
(<IN? ,LGOP ,HERE>
<RETURN ,LGOP>)
(<AND <IN? ,SULTAN ,HERE>
<NOT ,MALE>>
<RETURN ,SULTAN>)
(<AND <IN? ,SULTANS-WIFE ,HERE>
,MALE>
<RETURN ,SULTANS-WIFE>)
(<AND <VISIBLE? ,SIDEKICK>
<NOT ,MALE>>
<RETURN ,SIDEKICK>)
(T
<RFALSE>)>>
<OBJECT NOT-HERE-OBJECT
(DESC "it")
(FLAGS NARTICLEBIT)
(ACTION NOT-HERE-OBJECT-F)>
<ROUTINE NOT-HERE-OBJECT-F ("AUX" TBL (PRSO? T) OBJ (X <>))
<COND (<AND <PRSO? ,NOT-HERE-OBJECT>
<PRSI? ,NOT-HERE-OBJECT>>
<TELL "Those things aren't here!" CR>
<RTRUE>)
(<AND <EQUAL? ,P-XNAM ,W?BODY>
<EQUAL? ,P-XADJ ,W?MY <>>>
<COND (<PRSO? ,NOT-HERE-OBJECT>
<SETG PRSO ,ME>)
(T
<SETG PRSI ,ME>)>
<RFALSE>)
(<AND <EQUAL? ,P-XNAM ,W?HAND ,W?HANDS>
<EQUAL? ,P-XADJ ,W?MITRE ,W?KING\'S>
<VERB? SHAKE TAKE>>
<PERFORM ,V?SHAKE-WITH ,HANDS ,MITRE>
<RTRUE>)
(<AND <OR <EQUAL? ,P-XNAM ,W?HANDS ,W?HAND ,W?PALM>
<EQUAL? ,P-XNAM ,W?FINGER ,W?EYE ,W?EYES>
<EQUAL? ,P-XNAM ,W?HEAD ,W?EARS ,W?EAR>
<EQUAL? ,P-XNAM ,W?LIP ,W?LIPS ,W?MOUTH>
<EQUAL? ,P-XNAM ,W?KNEECAP ,W?KNEECAPS ,W?KNEE>
<EQUAL? ,P-XNAM ,W?KNEES ,W?NOSE ,W?NOSTRIL>
<EQUAL? ,P-XNAM ,W?BALLS, W?PENIS ,W?COCK>
<EQUAL? ,P-XNAM ,W?ASS ,W?TITS ,W?BREAST>
<EQUAL? ,P-XNAM ,W?BOSOM ,W?CUNT ,W?VAGINA>
<EQUAL? ,P-XNAM ,W?PUSSY ,W?TIT ,W?BODY>>
<OR <EQUAL? ,P-XADJ ,W?TRENT\'S ,W?TIFFANY\'S ,W?TIFF\'S>
<EQUAL? ,P-XADJ ,W?GODDESSES ,W?SHAPE\'S ,W?COUCHMATE>
<EQUAL? ,P-XADJ ,W?THORBAST ,W?THORBALA ,W?ASSASSIN>
<EQUAL? ,P-XADJ ,W?SALESMAN ,W?SCIENTIST ,W?GORILLA\'S>
<EQUAL? ,P-XADJ ,W?MONKEY\'S ,W?KING\'S ,W?MITRE\'S>
<EQUAL? ,P-XADJ ,W?SULTAN\'S ,W?SULTANESS>
<EQUAL? ,P-XADJ ,W?PROPRIETOR ,W?OWNER\'S>
<EQUAL? ,P-XADJ ,W?GUARD\'S ,W?PRINCE\'S ,W?DAUGHTER>
<EQUAL? ,P-XADJ ,W?THETA\'S ,W?BARTENDER ,W?WIFE\'S>
<EQUAL? ,P-XADJ ,W?HUSBAND\'S ,W?ELYSIA\'S ,W?ELYSIUM\'S>
<EQUAL? ,P-XADJ ,W?WOMAN\'S ,W?ROBOT\'S ,W?BABY\'S>
<EQUAL? ,P-XADJ ,W?MAN\'S ,W?HIS ,W?HER>>>
<TELL
"[Sorry. Given limited space, we can't handle everything. Therefore, you can
only refer to characters in the story, not individual body parts. For example,
you can KISS IRWIN but you can't KISS IRWIN'S ELBOW.]" CR>
<RTRUE>)
(<PRSO? ,NOT-HERE-OBJECT>
<SET TBL ,P-PRSO>)
(T
<SET TBL ,P-PRSI>
<SET PRSO? <>>)>
<COND (<AND .PRSO?
<PRSO-MOBY-VERB?>>
<SET X T>)
(<AND <NOT .PRSO?>
<PRSI-MOBY-VERB?>>
<SET X T>)>
<COND (.X ;"the verb is a moby-find verb"
<COND (<SET OBJ <FIND-NOT-HERE .TBL .PRSO?>>
<COND (<NOT <EQUAL? .OBJ ,NOT-HERE-OBJECT>>
<RTRUE>)>)
(T
<RFALSE>)>
<COND (<VERB? WALK-TO FOLLOW>
<V-WALK-AROUND>)
(T
<TELL "[" ,YOULL-HAVE-TO "be more specific.]" CR>)>)
(T
<COND (<EQUAL? ,WINNER ,PROTAGONIST>
<TELL "You">)
(T
<TELL "Looking confused," T ,WINNER " says, \"I">)>
<TELL " can't ">
<COND (<EQUAL? ,P-XNAM ,W?ODOR ,W?SMELL ,W?SCENT>
<TELL "smell">)
(T
<TELL "see">)>
<COND (<OR <NOT <NAME? ,P-XNAM>>
<EQUAL? ,P-XNAM ,W?FORD>>
<TELL " any">)>
<NOT-HERE-PRINT .PRSO?>
<TELL " here!">
<COND (<NOT <EQUAL? ,WINNER ,PROTAGONIST>>
<TELL "\"">)>
<CRLF>)>
<STOP>>
<ROUTINE PRSO-MOBY-VERB? ()
<COND (<OR <EQUAL? ,PRSA ,V?WHAT ,V?WHERE>
<EQUAL? ,PRSA ,V?WAIT-FOR ,V?WALK-TO ,V?MAKE>
<EQUAL? ,PRSA ,V?BUY ,V?CALL ,V?SAY>
<EQUAL? ,PRSA ,V?FIND ,V?FOLLOW ,V?PHONE>
<EQUAL? ,PRSA ,V?USE-QUOTES ,V?ANSWER-KLUDGE>>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE PRSI-MOBY-VERB? ()
<COND (<EQUAL? ,PRSA ,V?ASK-ABOUT ,V?ASK-FOR ,V?TELL-ABOUT>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE FIND-NOT-HERE (TBL PRSO? "AUX" M-F OBJ)
;"Protocol: return T if case was handled and msg TELLed, NOT-HERE-OBJECT
if 'can't see' msg TELLed, <> if PRSO/PRSI ready to use"
;"Special-case code goes here. <MOBY-FIND .TBL> returns # of matches. If 1,
then P-MOBY-FOUND is it. You can treat the 0 and >1 cases alike or differently.
Always return RFALSE (not handled) if you have resolved the problem."
<SET M-F <MOBY-FIND .TBL>>
;<COND (,DEBUG
<TELL "[Found " N .M-F " obj]" CR>)>
<COND (<EQUAL? 1 .M-F>
;<COND (,DEBUG
<TELL "[Namely: " D ,P-MOBY-FOUND "]" CR>)>
<COND (.PRSO?
<SETG PRSO ,P-MOBY-FOUND>
<THIS-IS-IT ,PRSO>)
(T
<SETG PRSI ,P-MOBY-FOUND>)>
<RFALSE>)
(<AND <L? 1 .M-F>
<SET OBJ <APPLY <GETP <SET OBJ <GET .TBL 1>> ,P?GENERIC>>>>
;"Protocol: returns .OBJ if that's the one to use
,NOT-HERE-OBJECT if case was handled and msg TELLed
<> if WHICH-PRINT should be called"
;<COND (,DEBUG
<TELL "[Generic: " D .OBJ "]" CR>)>
<COND (<EQUAL? .OBJ ,NOT-HERE-OBJECT>
<RTRUE>)
(.PRSO?
<SETG PRSO .OBJ>
<THIS-IS-IT ,PRSO>)
(T
<SETG PRSI .OBJ>)>
<RFALSE>)
(T
,NOT-HERE-OBJECT)>>
<ROUTINE NOT-HERE-PRINT (PRSO?)
<COND (,P-OFLAG
<COND (,P-XADJ
<TELL " ">
<PRINTB ,P-XADJ>)>
<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> <>>)>>
<OBJECT LOVE ;"for MAKE LOVE TO someone"
(LOC GLOBAL-OBJECTS)
(DESC "love")
(SYNONYM LOVE)
(FLAGS NARTICLEBIT)
(ACTION LOVE-F)>
<ROUTINE LOVE-F ("AUX" LOVER)
<COND (<VERB? MAKE>
<COND (<SET LOVER <FIND-IN ,HERE ,ACTORBIT "to">>
<PERFORM ,V?FUCK .LOVER>
<RTRUE>)
(T
<TELL "Alone? How odd." CR>)>)>>
<OBJECT GLOBAL-SLEEP
(LOC GLOBAL-OBJECTS)
(DESC "sleep")
(SYNONYM SLEEP NAP SNOOZE)
(FLAGS NARTICLEBIT)
(ACTION GLOBAL-SLEEP-F)>
<ROUTINE GLOBAL-SLEEP-F ()
<COND (<VERB? WALK-TO TAKE>
<PERFORM ,V?SLEEP>
<RTRUE>)
(<AND <VERB? PUT-TO>
<PRSI? ,GLOBAL-SLEEP>>
<TELL "You're not a hypnotist." CR>)>>
<OBJECT GROUND
(LOC GLOBAL-OBJECTS)
(SYNONYM FLOOR GROUND)
(SDESC "ground")
(ACTION GROUND-F)>
<ROUTINE GROUND-F ()
<COND (<EQUAL? ,HERE ,IN-SPACE>
<CANT-SEE ,GROUND>
<RTRUE>)
(<OR <FSET? ,HERE ,INDOORSBIT>
<EQUAL? <LOC ,PROTAGONIST> ,BARGE>>
<PUTP ,GROUND ,P?SDESC "floor">)
(T
<PUTP ,GROUND ,P?SDESC "ground">)>
<COND (<VERB? EXAMINE>
<COND (<EQUAL? ,HERE ,SPAWNING-GROUND>
<TELL ,OOZY-WITH-SLIME CR>)
(<AND <GLOBAL-IN? ,HOLE ,HERE>
<NOT <HOLE-INVISIBLE>>>
<TELL "You notice" AR ,HOLE>)
(<EQUAL? ,HERE ,CELL>
<TELL "Soft. Cushiony." CR>)
(<EQUAL? ,HERE ,OTHER-CELL>
<TELL "Rock-hard." CR>)
(<AND <EQUAL? ,HERE ,HOLD>
<EQUAL? ,SIDEKICK-EXPLODED 1>>
<SPLATTERED-DESC>
<CRLF>)
(<IN-CATACOMBS>
<TELL ,CATACOMBS-WATER-DESC CR>)>)
(<AND <VERB? TOUCH>
<EQUAL? ,HERE ,CELL ,OTHER-CELL>>
<PERFORM ,V?EXAMINE ,GROUND>
<RTRUE>)
(<VERB? CLIMB-UP CLIMB-ON CLIMB BOARD>
<WASTES>)
(<VERB? LOOK-UNDER>
<IMPOSSIBLES>)
(<VERB? LEAVE>
<DO-WALK ,P?UP>)
(<AND <VERB? LEAP STAND-ON>
<EQUAL? ,HERE ,ROOF>>
<PERFORM ,V?LEAP ,ROOMS> ;"V-LEAP handles it"
<RTRUE>)>>
;<OBJECT WALLS
(LOC GLOBAL-OBJECTS)
(FLAGS NDESCBIT TOUCHBIT)
(DESC "wall")
(SYNONYM WALL WALLS)
(ACTION WALLS-F)>
;<ROUTINE WALLS-F ()
<COND (<AND <VERB? EXAMINE>
<EQUAL? ,HERE ,HOLD>
<EQUAL? ,SIDEKICK-EXPLODED 1>>
<SPLATTERED-DESC>
<CRLF>)>>
<OBJECT CEILING
(LOC GLOBAL-OBJECTS)
(FLAGS NDESCBIT TOUCHBIT)
(DESC "ceiling")
(SYNONYM CEILING ROOF)
(ADJECTIVE TOWERING)
(ACTION CEILING-F)>
<ROUTINE CEILING-F ()
<COND (<VERB? EXAMINE>
<COND (<AND <EQUAL? ,HERE ,HOLD>
<EQUAL? ,SIDEKICK-EXPLODED 1>>
<SPLATTERED-DESC>
<CRLF>)
(<AND <EQUAL? ,HERE ,CELL>
,HOLE-OPEN>
<TELL "There's a hole in the ceiling." CR>)
(<AND <EQUAL? ,HERE ,BEDROOM>
<FSET? ,BEDROOM ,MUNGBIT>>
<TELL "Most of the ceiling is now gone." CR>)>)
(<NOT <FSET? ,HERE ,INDOORSBIT>>
<CANT-SEE ,CEILING>)
(<AND <VERB? ENTER>
<EQUAL? ,HERE ,CELL>
,HOLE-OPEN>
<DO-WALK ,P?UP>)
(<VERB? LOOK-UNDER>
<PERFORM ,V?LOOK>
<RTRUE>)>>
<OBJECT ODOR
(LOC LOCAL-GLOBALS)
(DESC "odor")
(SYNONYM SMELL ODOR SCENT AROMA)
(ADJECTIVE STRONG FAMILIAR FOUL HEADY PLEASANT)
(FLAGS VOWELBIT)
(ACTION ODOR-F)>
<ROUTINE ODOR-F ()
<COND (<AND <EQUAL? ,HERE ,IN-SPACE>
<NOT <IN? ,THORBAST ,HERE>>>
<TELL ,CANT-SMELL>)
(<AND <EQUAL? ,HERE ,MENS-ROOM ,LADIES-ROOM>
<RUNNING? ,I-URGE>>
<TELL ,CANT-SMELL>)
(<AND <EQUAL? ,HERE ,PLAZA>
<L? ,PLAZA-COUNTER 9>>
<TELL ,CANT-SMELL> ;"the Plaza odor comes after final prompt")
(<OR <VERB? SMELL>
<AND <VERB? EXAMINE>
<EQUAL? ,P-PRSA-WORD ,W?DESCRIBE>>>
<COND (<GETP ,HERE ,P?ODOR>
<COND (<FSET? ,HERE ,SMELLEDBIT>
<TELL
"There is a strong odor of " <GETP ,HERE ,P?ODOR> " in the air." CR>)
(T
<FSET ,HERE ,SMELLEDBIT>
<SCRATCH-N-SNIFF>
<APPLY <GETP ,HERE ,P?ACTION> ,M-SMELL>
<CRLF>)>)
(<EQUAL? ,HERE ,INNER-HAREM>
<SETG HERE ,HAREM>
<PERFORM ,V?SMELL ,ODOR>
<SETG HERE ,INNER-HAREM>
<RTRUE>)
(<EQUAL? ,HERE ,GARDEN>
<NO-SCRATCH-N-SNIFF "fresh honeysuckle">)
(<AND <ACCESSIBLE? ,CHOCOLATE>
<NOT <FSET? ,CHOCOLATE ,UNTEEDBIT>>>
<TELL "[the " D ,CHOCOLATE "]" CR>
<PERFORM ,V?SMELL ,CHOCOLATE>
<RTRUE>)
(T
<TELL ,CANT-SMELL>)>)>>
<ROUTINE SCRATCH-N-SNIFF ("OPTIONAL" (NUM <>))
<TELL "[Scratch 'n' sniff spot number ">
<COND (.NUM
<PRINTN .NUM>)
(T
<PRINTN <GETP ,HERE ,P?ODOR-NUMBER>>)>
<TELL ,HIT-RETURN "continue.]">
<PUTB ,P-INBUF 1 0>
<READ ,P-INBUF ,P-LEXV>
<CRLF>>
<ROUTINE NO-SCRATCH-N-SNIFF (STRING)
<TELL
"[Too bad there's no scratch 'n' sniff for this one, huh?]|
|
Ahhh, the odor of " .STRING "!" CR>>
<OBJECT WATER
(LOC LOCAL-GLOBALS)
(DESC "water")
(SYNONYM WATER FOUNTAIN POOL OASIS)
(ADJECTIVE FRESH CANAL DARK BRACKISH STAGNANT WARM LARGE REFLECTING)
(FLAGS NARTICLEBIT)
(ACTION WATER-F)>
<ROUTINE WATER-F ()
<COND (<AND <EQUAL? ,HERE ,MINARET ,DUNETOP>
<TOUCHING? ,WATER>>
<CANT-REACH ,WATER>)
(<VERB? DRINK BUY>
<TELL "You're not thirsty." CR>)
(<VERB? LOOK-INSIDE LOOK-UNDER EXAMINE>
<TELL "The water is dark and murky." CR>)
(<VERB? PASS MAKE>
<V-PEE>)
(<VERB? REACH-IN>
<TELL "Your hand is now wet." CR>)
(<AND <VERB? PUT-ON>
<PRSI? ,WATER>>
<PERFORM ,V?PUT ,PRSO ,WATER>
<RTRUE>)
(<GLOBAL-IN? ,CANAL-OBJECT ,HERE>
<COND (<PRSO? ,WATER>
<PERFORM-PRSA ,CANAL-OBJECT ,PRSI>
<RTRUE>)
(T
<PERFORM-PRSA ,PRSO ,CANAL-OBJECT>
<RTRUE>)>)
(<AND <VERB? PUT>
<PRSI? ,WATER>>
<COND (<AND <PRSO? ,RAFT>
<EQUAL? ,HERE ,OASIS>>
<TELL "Next you'll be putting yachts in bathtubs!" CR>)
(<AND <PRSO? ,RAFT>
<IN-CATACOMBS>>
<PERFORM ,V?DROP ,RAFT>
<RTRUE>)
(T
<WASTES>)>)
(<AND <VERB? ON WALK> ;"for TURN ON WATER or RUN WATER"
<EQUAL? ,HERE ,MENS-ROOM ,LADIES-ROOM>>
<PERFORM ,V?FLUSH ,TOILET>
<RTRUE>)
(<VERB? BOARD ENTER CRAWL-UNDER>
<V-SWIM>)>>
;<OBJECT SKY
(LOC GLOBAL-OBJECTS)
(DESC "sky")
(SYNONYM SKY)
(ACTION SKY-F)>
;<ROUTINE SKY-F ()
<COND (<FSET? ,HERE ,INDOORSBIT>
<CANT-SEE ,SKY>)>>
<OBJECT HANDS
(LOC GLOBAL-OBJECTS)
(SYNONYM HANDS HAND PALM FINGER FINGERS)
(ADJECTIVE BARE MY YOUR)
(DESC "your hand")
(FLAGS NDESCBIT TOUCHBIT NARTICLEBIT PARTBIT)
(ACTION HANDS-F)>
<ROUTINE HANDS-F ("AUX" ACTOR)
<COND (<VERB? APPLAUD>
<SETG PRSO <>>
<V-APPLAUD>)
(<VERB? SHAKE>
<COND (<EQUAL? ,HERE ,THRONE-ROOM>
<PERFORM ,V?SHAKE-WITH ,HANDS ,MITRE>
<RTRUE>)
(<SET ACTOR <FIND-IN ,HERE ,ACTORBIT "with">>
<PERFORM ,V?SHAKE-WITH ,HANDS .ACTOR>
<RTRUE>)
(T
<TELL "Pleased to meet you." CR>)>)
(<VERB? COUNT>
<COND (<NOUN-USED ,W?FINGER ,HANDS>
<TELL "Ten">)
(T
<TELL "Two">)>
<TELL ", as usual." CR>)
(<VERB? CLEAN>
<TELL "Done." CR>)
(<AND <VERB? TAKE-WITH>
<PRSI? ,HANDS>>
<PERFORM ,V?TAKE ,PRSO>
<RTRUE>)
(<AND <VERB? PUT-ON>
<PRSI? ,EYES>>
<PERFORM ,V?SPUT-ON ,EYES ,HANDS>
<RTRUE>)
(<AND <VERB? PUT-ON PUT>
<PRSI? ,EARS>>
<PERFORM ,V?SPUT-ON ,EARS ,HANDS>
<RTRUE>)
(<AND <VERB? SPUT-ON>
<PRSO? ,EYES ,EARS, NOSE>>
<COND (,GONE-APE
<TELL ,DEXTERITY>)
(<G? <ITEMS-CARRIED> 0>
<TELL ,YOU-CANT "do that with " 'HANDS "s full!" CR>)
(T
<COND (,HAND-COVER
<TELL "You're already">)
(T
<SETG HAND-COVER ,PRSO>
<FSET ,PRSO ,MUNGBIT>
<COND (<EQUAL? ,HAND-COVER ,EARS>
<TELL ,MUFFLED "'re">)
(T
<TELL "Okay, you're now">)>)>
<TELL
" covering " D ,HAND-COVER " with " 'HANDS "s." CR>)>)>>
<ROUTINE ITEMS-CARRIED ("AUX" X (CNT 0))
<SET X <FIRST? ,PROTAGONIST>>
<REPEAT ()
<COND (<NOT .X>
<RETURN>)
(<AND <NOT <FSET? .X ,WORNBIT>>
<NOT <EQUAL? .X ,COMIC-BOOK>>>
<SET CNT <+ .CNT 1>>)>
<SET X <NEXT? .X>>>
<RETURN .CNT>>
<GLOBAL HAND-COVER <>>
<OBJECT HEAD
(LOC GLOBAL-OBJECTS)
(DESC "your head")
(SYNONYM HEAD)
(ADJECTIVE YOUR MY)
(FLAGS NARTICLEBIT PARTBIT)
(ACTION HEAD-F)>
<ROUTINE HEAD-F ()
<COND (<AND <VERB? PUT-ON>
<PRSO? ,BLANKET ,SHEET ,SACK>>
<SETG AWAITING-REPLY 2>
<QUEUE I-REPLY 2>
<TELL "Where do you think you are, Traal?" CR>)>>
<OBJECT EYES
(LOC GLOBAL-OBJECTS)
(DESC "your eyes")
(SYNONYM EYE EYES)
(ADJECTIVE YOUR MY)
(FLAGS NARTICLEBIT PLURALBIT PARTBIT)
(ACTION EYES-F)>
<ROUTINE EYES-F ()
<COND (<VERB? CLOSE>
<COND (,GONE-APE
<WASTES>)
(<FSET? ,EYES ,MUNGBIT>
<COND (<EQUAL? ,EYES ,HAND-COVER>
<TELL ,HANDS-OVER-EYES>)
(T
<TELL ,SENILITY-STRIKES>)>)
(T
<FSET ,EYES ,MUNGBIT>
<EYES-ARE-NOW "closed">)>)
(<VERB? OPEN>
<COND (<FSET? ,EYES ,MUNGBIT>
<COND (<EQUAL? ,EYES ,HAND-COVER>
<TELL ,HANDS-OVER-EYES>)
(T
<SENSE-AGAIN ,EYES>)>)
(T
<TELL "They are open!" CR>)>)>>
<ROUTINE EYES-ARE-NOW (STRING)
<TELL "Your eyes are now " .STRING ,PERIOD-CR>>
<ROUTINE OPEN-EYES-AND-REMOVE-HANDS ()
<FCLEAR ,EYES ,MUNGBIT>
<COND (,HAND-COVER
<FCLEAR ,HAND-COVER ,MUNGBIT>
<SETG HAND-COVER <>>)>>
<OBJECT EARS
(LOC GLOBAL-OBJECTS)
(DESC "your ears")
(SYNONYM EAR EARS)
(ADJECTIVE YOUR MY)
(FLAGS NARTICLEBIT PLURALBIT PARTBIT)
(ACTION EARS-F)>
<ROUTINE EARS-F ()
<COND (<AND <VERB? TAKE>
<EQUAL? ,P-PRSA-WORD ,W?HOLD>>
<PERFORM ,V?SPUT-ON ,EARS ,HANDS>
<RTRUE>)
(<AND <VERB? UNCOVER>
<FSET? ,COTTON-BALLS ,WORNBIT>
<NOT ,GONE-APE>>
<COND (<EQUAL? ,EARS ,HAND-COVER>
<SETG HAND-COVER <>>)>
<PERFORM ,V?REMOVE ,COTTON-BALLS>
<RTRUE>)>>
<OBJECT NOSE
(LOC GLOBAL-OBJECTS)
(DESC "your nose")
(SYNONYM NOSE NOSTRIL)
(ADJECTIVE YOUR MY)
(FLAGS NARTICLEBIT PARTBIT)
(ACTION NOSE-F)>
<ROUTINE NOSE-F ()
<COND (<VERB? BLOW PICK>
<TELL ,YECHH>)
(<AND <VERB? TAKE>
<EQUAL? ,P-PRSA-WORD ,W?HOLD>>
<PERFORM ,V?SPUT-ON ,NOSE ,HANDS>
<RTRUE>)
(<AND <VERB? UNCOVER>
<FSET? ,CLOTHES-PIN ,WORNBIT>
<NOT ,GONE-APE>>
<COND (<EQUAL? ,NOSE ,HAND-COVER>
<SETG HAND-COVER <>>)>
<PERFORM ,V?REMOVE ,CLOTHES-PIN>
<RTRUE>)>>
<OBJECT MOUTH
(LOC GLOBAL-OBJECTS)
(DESC "your mouth")
(SYNONYM MOUTH LIP LIPS)
(ADJECTIVE YOUR MY)
(FLAGS NARTICLEBIT PARTBIT)
(ACTION MOUTH-F)>
<ROUTINE MOUTH-F ()
<COND (<AND <VERB? CLEAN>
<FSET? ,LIP-BALM ,WORNBIT>>
<PERFORM ,V?REMOVE ,LIP-BALM>
<RTRUE>)
(<AND <VERB? EXAMINE>
<FSET? ,LIP-BALM ,WORNBIT>>
<ROB ,PROTAGONIST ,TOILET>
<MOVE ,LIP-BALM ,PROTAGONIST>
<V-INVENTORY> ;"should say YOU HAVE LIP BALM (SMEARED...)"
<ROB ,TOILET ,PROTAGONIST>)
(<AND <VERB? PUT>
<PRSI? ,MOUTH>>
<PERFORM ,V?EAT ,PRSO>
<RTRUE>)
(<VERB? OPEN>
<TELL "This fails to catch any flies." CR>)>>
<OBJECT KNEECAPS
(LOC GLOBAL-OBJECTS)
(DESC "your kneecaps")
(SYNONYM KNEECAP KNEECAPS KNEE KNEES)
(ADJECTIVE YOUR MY)
(FLAGS NARTICLEBIT PLURALBIT PARTBIT)>
<OBJECT COCK
(LOC GLOBAL-OBJECTS)
(DESC "your naughty bits")
(SYNONYM COCK PENIS BALLS ASS)
(ADJECTIVE YOUR MY)
(FLAGS NARTICLEBIT PARTBIT)
(ACTION NAUGHTY-BITS-F)>
<OBJECT CUNT