-
Notifications
You must be signed in to change notification settings - Fork 15
/
events.zil
1971 lines (1875 loc) · 70.8 KB
/
events.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
"EVENTS for WITNESS
Copyright (C) 1983 Infocom, Inc. All rights reserved."
"Ideas: insurance policy - fraud?
nosy neighbor?
fingerprint two-color picture"
<ROUTINE INTRO ()
<TELL
"Somewhere near Los Angeles. A cold Friday evening in February 1938. In
this climate, cold is anywhere below about fifty degrees. Storm clouds
are swimming across the sky, their bottoms glowing faintly from the city
lights in the distance. A search light pans slowly under the clouds,
heralding another film premiere. The air seems expectant, waiting for
the rain to begin, like a cat waiting for the ineffable moment to
ambush.|" CR "The taxi has just dropped you off at the entrance to the
Linders' driveway. The driver didn't seem to like venturing into this
maze of twisty streets any more than you did. But the house windows are
full of light, and radio music drifts toward you. Your favorite pistol,
a snub-nosed Colt .32, is snug in its holster. You just picked up a
match book off the curb. It might come in handy. Good thing you looked
up the police file on Mrs. Linder's death. Her suicide note and the
newspaper story told you all you know about the family. The long week is
finished, except for this appointment. But why does an ominous feeling
grip you?|" CR>>
<ROUTINE TIMES-UP ()
<TELL
"Police Chief Klutz walks up to you, from out of nowhere. \"I'm
sorry, Detective, but you can't spend any more time here. We need you at
the Coliseum for the all-day Police Department track-and-field meet. I
hope you had a restful night!\" He
escorts you to a waiting police car, and you go off into the sunrise." CR>
<COND (,TOO-LATE <TOO-LATE-F>)>
<QUIT>>
<OBJECT MIDNIGHT
(IN GLOBAL-OBJECTS)
(DESC "midnight")
(SYNONYM MIDNIGHT)>
<OBJECT SMALL-INTEGER
(IN GLOBAL-OBJECTS)
(SYNONYM TWO THREE FOUR FIVE)
(ACTION INTEGER-F)>
<OBJECT MEDIUM-INTEGER
(IN GLOBAL-OBJECTS)
(SYNONYM TEN FIFTEEN TWENTY THIRTY)
(ACTION INTEGER-F)>
<ROUTINE INTEGER-F ()
<TELL "(Use figures for numbers, for example \"10.\")" CR>>
<ROUTINE QUEUE-MAIN-EVENTS ()
<ENABLE <QUEUE I-LINDER-TO-OFFICE 52>>
<ENABLE <QUEUE I-LINDER-RETIRES 290>>
<ENABLE <QUEUE I-PHONG-RETIRES 320>>
<ENABLE <QUEUE I-STILES-ARRIVE 60>>
<ENABLE <QUEUE I-PROMPT-1 1>>
<ENABLE <QUEUE I-PROMPT-2 10>>
<ENABLE <QUEUE I-WEATHER 6>>
<ENABLE <QUEUE I-CHIMES 30>>>
"SCORE INDICATES HOURS / MOVES = MINUTES"
<GLOBAL SCORE 20>
<GLOBAL MOVES 0>
<GLOBAL SKY-DESC "There's dark, cloudy sky above you.">
<GLOBAL PRESENT-TIME 480> "8 PM"
<GLOBAL CLOUDS-GONE 525>
<GLOBAL MOONRISE 612> "from L.A. Times of 1938-02-18"
<GLOBAL SUNRISE 1117> "sun crosses horizon at Pasadena on 1938-02-19"
<GLOBAL I-WEATHER-NUM 0>
<GLOBAL GROUND-MUDDY <>>
<ROUTINE I-WEATHER ("AUX" (OUT? <==? <GETP ,HERE ,P?LINE> ,OUTSIDE-LINE-C>))
<SETG I-WEATHER-NUM <+ 1 ,I-WEATHER-NUM>>
<COND (<==? 1 ,I-WEATHER-NUM>
<TELL "Suddenly, a clap of thunder rolls across the hills">
<COND (.OUT? <TELL " nearby">)
(T <TELL " outside">)>
<TELL "." CR>
<ENABLE <QUEUE I-WEATHER 3>>)
(<==? 2 ,I-WEATHER-NUM>
<TELL "Without warning, lightning flashes">
<COND (.OUT? <TELL " above">)
(T <TELL " outside">)>
<TELL ", and a few seconds later thunder rattles the house." CR>
<ENABLE <QUEUE I-WEATHER 3>>)
(<==? 3 ,I-WEATHER-NUM>
<TELL "Rain begins to fall">
<COND (<NOT .OUT?> <TELL " outside">)>
<TELL " in a sprinkle." CR>
<ENABLE <QUEUE I-WEATHER 2>>)
(<==? 4 ,I-WEATHER-NUM>
<SETG GROUND-MUDDY T>
<TELL "The rain">
<COND (<NOT .OUT?> <TELL " outside">)>
<TELL " is falling heavily now." CR>
<ENABLE <QUEUE I-WEATHER 9>>)
(<==? 5 ,I-WEATHER-NUM>
<TELL "The rain">
<COND (<NOT .OUT?> <TELL " outside">)>
<TELL " begins to taper off." CR>
<ENABLE <QUEUE I-WEATHER 5>>)
(<==? 6 ,I-WEATHER-NUM>
<TELL "The rain storm">
<COND (<NOT .OUT?> <TELL " outside">)>
<TELL " has passed now." CR>
<ENABLE <QUEUE I-WEATHER <- ,CLOUDS-GONE ,PRESENT-TIME>>>)
(<==? 7 ,I-WEATHER-NUM>
<SETG SKY-DESC "The sky is clear now, with stars shining coldly.">
<ENABLE <QUEUE I-WEATHER <- ,MOONRISE ,PRESENT-TIME>>>)
(<==? 8 ,I-WEATHER-NUM>
<SETG SKY-DESC "The moon, just past full, lights up the whole yard.">
<ENABLE <QUEUE I-WEATHER <- ,SUNRISE ,PRESENT-TIME 15>>>)
(<==? 9 ,I-WEATHER-NUM>
<TELL "Suddenly it dawns on you that the sky is getting light">
<COND (<NOT .OUT?> <TELL " outside">)>
<TELL "." CR>
<SETG SKY-DESC "The morning sunshine lights up the whole yard.">
<ENABLE <QUEUE I-WEATHER 25>>)
(<==? 10 ,I-WEATHER-NUM>
<TELL "The sun has appeared over the hills">
<COND (<NOT .OUT?> <TELL " outside">)>
<TELL "." CR>)>
<RFALSE>>
<ROUTINE I-CHIMES ("AUX" HALF-HR HR)
<ENABLE <QUEUE I-CHIMES 30>>
<SET HALF-HR </ ,PRESENT-TIME 30>>
<SET HR </ .HALF-HR 2>>
<COND (<EQUAL? ,HERE ,OFFICE>
<COND (<==? .HALF-HR <* 2 .HR>>
<COND (<L? 12 .HR> <SET HR <- .HR 12>>)>
<TELL "The clock chimes ">
<COND (<==? 1 .HR> <TELL "once">)
(<==? 2 .HR> <TELL "twice">)
(T <TELL N .HR " times">)>
<TELL " to mark the hour." CR>)
(T
<TELL "The clock chimes once to mark the half hour." CR>)>)>
<RFALSE>>
<ROUTINE I-STILES-ARRIVE ()
<MOVE ,STILES ,OFFICE-PATH>
<FSET ,BACK-GATE ,LOCKED>
<ESTABLISH-GOAL ,STILES ,OFFICE-PORCH>
<COND (<EQUAL? ,HERE ,OFFICE-PATH>
<TELL
"Someone enters through the back gate and rushes past you." CR>)
(<AND <GETP ,HERE ,P?CORRIDOR>
<NOT <0? <BAND <GETP ,HERE ,P?CORRIDOR> 3>>>>
<TELL
"Someone enters the property through the back gate." CR>)>>
<GLOBAL DUFFY-WITH-STILES <>>
<ROUTINE I-DUFFY-ARRIVE ()
<COND (,WELCOMED
<ENABLE <QUEUE I-MEET-DUFFY? -1>>
<SETG DUFFY-WITH-STILES T>
<FCLEAR ,STILES ,INVISIBLE>
<ESTABLISH-GOAL ,STILES ,FRONT-PORCH>)
(T
<SETG SEEN-DUFFY? T>
<SETG MET-DUFFY? T>
<TELL
"Suddenly, your assistant, Sgt. Duffy, appears from out of nowhere.
\"Hello, Detective!"
" I thought I should come here on the streetcar, in case you needed help. "
"I'll be nearby if you want me.\" He disappears just as quickly." CR>)>
<RFALSE>>
<GLOBAL MET-STILES? <>>
<GLOBAL MET-DUFFY? <>>
<GLOBAL SEEN-DUFFY? <>>
<ROUTINE DUFFY-GREETING ()
<SETG MET-STILES? T>
<SETG SEEN-DUFFY? T>
<SETG MET-DUFFY? T>
<FSET ,STILES ,TOUCHBIT>
<TELL " \"Detective, I'm glad you're safe!">
<COND (,PLAYER-HIDING
<TELL " Don't worry, I won't tell anyone you're hiding.">)>
<TELL
" I thought I should come here on the streetcar, in case you needed help. "
"I'm familiar with the house, since I was here to help investigate
Mrs. Linder's death.
Just as I walked up tonight, I heard a shot! The next thing I knew, this man,
who calls himself Stiles, burst out of the woods behind the house.
Naturally, I put the nippers on him and brought him along.">>
<ROUTINE I-MEET-DUFFY? ("OPTIONAL" (ARG <>) "AUX" (L <LOC ,STILES>))
<COND (<AND ,WELCOMED
<NOT ,MET-DUFFY?>
<OR <==? .L ,HERE> ;"? or sees you thru door"
<NOT <0? <BAND <GETP .L ,P?CORRIDOR>
<GETP ,HERE ,P?CORRIDOR>>>>>>
<TELL "Your assistant, Sgt. Duffy, sees you.">
<DUFFY-GREETING>
<TELL
" I'll just stow him in the living room and stand by to help you.\"" CR>
<ESTABLISH-GOAL ,STILES ,LIVING-ROOM>
<DISABLE <INT I-MEET-DUFFY?>>
<RTRUE>)>>
"Object functions"
<GLOBAL ANALYSIS-GOAL <>>
<ROUTINE DO-FINGERPRINT ("OPTIONAL" (AN <>))
<COND (,DUFFY-AT-CORONER
<TELL
"Don't you remember? Duffy went in the ambulance to the Coroner's office. "
"You'll have to wait for him to return." CR>
<RTRUE>)
(,FINGERPRINT-OBJ
<TELL
"Sergeant Duffy ran off to the lab on an errand for you. "
"You'll have to wait for him to return." CR>
<RTRUE>)>
<COND (<NOT ,MET-DUFFY?>
<TELL
"You haven't met Sergeant Duffy yet tonight."
" You'll need his help to do that." CR>
<RTRUE>)>
<COND (<NOT .AN>
<TELL
"You look at the " D ,PRSO " closely. It appears to have good
fingerprints on it, so you call for Sergeant Duffy." CR>)>
<COND (<AND .AN ,PRSI>
<SETG ANALYSIS-GOAL ,PRSI>)
(T <SETG ANALYSIS-GOAL <>>)>
<SETG FINGERPRINT-OBJ ,PRSO>
<SETG ANALYSIS-OBJ .AN>
<ENABLE <QUEUE I-FINGERPRINT <+ 15 <RANDOM 15>>>>
<FSET ,PRSO ,TOUCHBIT>
<REMOVE ,PRSO>
<TELL
"Sergeant Duffy, quiet as a mouse, walks up and takes the
" D ,PRSO " from you. \"I'll return soon with the results,\" he
says, and leaves as silently as he came." CR>>
<GLOBAL ANALYSIS-OBJ <>>
<ROUTINE DO-ANALYZE ()
<COND (<EQUAL? ,PRSO ,PRSI>
<TELL
"Sergeant Duffy appears with a puzzled look on his face."
" \"I don't see how you expect the lab to analyze something for itself!\""
" He leaves, shaking his head slowly." CR>
<RTRUE>)>
<DO-FINGERPRINT T>>
<ROUTINE I-FINGERPRINT ()
<TELL "Suddenly, Sergeant Duffy ">
<COND (<PROB 30>
<TELL
"appears, holding the " D ,FINGERPRINT-OBJ
" carefully in his hands. His quiet efficiency is impressive. ">)
(<PROB 50>
<TELL
"seems to arrive from nowhere, holding the " D ,FINGERPRINT-OBJ
" in his hands. ">)
(T
<TELL
"returns with the " D ,FINGERPRINT-OBJ ". For a moment you muse on his almost
magical appearances. ">)>
<COND (,ANALYSIS-GOAL
<COND (<AND <EQUAL? ,FINGERPRINT-OBJ ,INSIDE-GUN ,OUTSIDE-GUN>
<EQUAL? ,ANALYSIS-GOAL ,POWDER ,CLOCK-POWDER>>
<TELL
"\"The gun has recently been fired, and it contains traces of cheap
gun powder">
<COND (,POWDER-ANALYZED
<TELL
", the same kind of powder that you found on the clock">)>
<TELL ".">)
(<AND <EQUAL? ,FINGERPRINT-OBJ ,MATCHBOOK ,THREAT-NOTE>
<EQUAL? ,ANALYSIS-GOAL ,HANDWRITING>>
<TELL
"\"The ink is ordinary Waterman blue-black. The lab can't tell much else
without a certified handwriting sample on file.">)
(<NOT <EQUAL? ,FINGERPRINT-OBJ ,ANALYSIS-GOAL>>
<TELL "\"The " D ,FINGERPRINT-OBJ
" doesn't contain any ">
<ANALYSIS-PRINT ,ANALYSIS-GOAL>)>)
(<OR <EQUAL? ,FINGERPRINT-OBJ ,PIECE-OF-WIRE ,SPOOL-OF-WIRE>
<EQUAL? ,FINGERPRINT-OBJ ,WHITE-WIRE ,BLACK-WIRE>>
<TELL "\"The wire is ordinary 16-gauge bell wire.">)
(<EQUAL? ,FINGERPRINT-OBJ ,PIECE-OF-PUTTY>
<TELL
"\"The putty contained traces of the explosive cordite.">)
(<EQUAL? ,FINGERPRINT-OBJ ,INSIDE-GUN ,OUTSIDE-GUN>
<TELL
"\"The gun has recently been fired, and it contains traces of cheap
gun powder">
;<COND (,POWDER-ANALYZED
<TELL
", the same kind of powder that you found on the clock">)>
<TELL ".">
<COND (<EQUAL? ,FINGERPRINT-OBJ ,INSIDE-GUN>
<TELL
" And the barrel has indeed been sawed off.">)>)
(<==? ,FINGERPRINT-OBJ ,CLOCK-POWDER>
<SETG POWDER-ANALYZED T>
<TELL
"\"The powder is gun powder, as I suspected. I put it in a cellophane
envelope for you.">)
(<EQUAL? ,FINGERPRINT-OBJ ,MATCHBOOK ,THREAT-NOTE>
<TELL
"\"The ink is ordinary Waterman blue-black. The lab can't tell much else
without a certified handwriting sample on file.">)
(<EQUAL? ,FINGERPRINT-OBJ ,STUB>
<TELL
"\"I took the ticket stub to the movie theater, where they told me
that it looked authentic to them, and the serial number proves that it
was bought tonight.">)
(<EQUAL? ,FINGERPRINT-OBJ ,MEDICAL-REPORT>
<SETG DUFFY-SAW-MEDICAL-REPORT T>
<TELL
"\"I tried to call the doctor, but there's no listing in the phone book.
The lab people couldn't see anything unusual about the report.">)
(T
<TELL
"\"I'm sorry,\" he begins, \"but the lab found nothing interesting.">)>
<TELL "\"
With that, he leaves, handing you the " D ,FINGERPRINT-OBJ
" as he whisks away." CR>
<MOVE ,FINGERPRINT-OBJ ,PLAYER>
<SETG FINGERPRINT-OBJ <>>
<RTRUE>>
<ROUTINE ANALYSIS-PRINT (OBJ)
<TELL D .OBJ ".">>
<ROUTINE TODAY-F ()
<COND (<VERB? WHAT>
<COND (<L? ,PRESENT-TIME 720>
<TELL "Today is Friday, February 18, 1938." CR>)
(T
<TELL "Today is Saturday, February 19, 1938." CR>)>)>>
<GLOBAL WELCOMED <>>
<GLOBAL TOO-LATE-KNOCKED 0>
<ROUTINE WELCOME ()
<COND (<==? 2 ,TOO-LATE-KNOCKED>
<TELL
"No one answers the door, but a police car races in the driveway and
stops. Two officers jump out, grab you roughly, and haul you off as a
trespasser." CR>
<TOO-LATE-F>
<QUIT>)>
<COND (,RADIO-ON
<TELL "Someone turns off the radio. ">
<SETG RADIO-ON <>>)>
<TELL "You hear footsteps inside the house. Then the door swings open." CR>
<COND (<1? ,TOO-LATE-KNOCKED>
<SETG TOO-LATE-KNOCKED 2>
<TELL
"The butler isn't smiling now. \"I told you Mr. Linder will be in touch.
Please leave before I call the police!\" He slams the door in your face." CR>)
(,TOO-LATE
<SETG TOO-LATE-KNOCKED 1>
;<FSET ,PHONG ,TOUCHBIT>
<TELL
"\"Good evening,\" says a smiling face, \"I am Phong. I'm sorry, but
you're too late arriving here. Mr. Linder has other business now. But he
thanks you for coming and says he'll be in touch. Good night!\" He
closes the door in your face." CR>)
(T
<COND (<==? ,HERE ,FRONT-PORCH>
<MOVE ,PHONG ,ENTRY>
<TELL
"\"Good evening,\" says a smiling face, \"I am Phong. Please come in.\"
He leads you into the house and closes the door behind you.|" CR>
<FCLEAR ,FRONT-DOOR ,OPENBIT>
<GOTO ,ENTRY>)
(T
<TELL
"\"I've been told that detectives are sneaky, but this is too much!\"" CR>)>
<ENABLE <QUEUE I-GOTO-LIVING-ROOM 2>>)>>
<ROUTINE I-GOTO-LIVING-ROOM ()
<TELL "Phong says, \"I believe ">
<COND (<IN? ,MONICA ,LIVING-ROOM> <TELL "the Linders are">)
(T <TELL "Mr. Linder is">)>
<TELL " in the living room. Please follow me.\"">
<COND (<0? <BAND 16 <GETP ,HERE ,P?CORRIDOR>>>
<FSET ,HALL-3 ,TOUCHBIT>
<TELL " He leads you into a hallway and turns left. "
<GETP ,HALL-3 ,P?LDESC>>)
(T <TELL " He leads you north along the hallway. ">)>
<COND (<IN? ,MONICA ,LIVING-ROOM>
<TELL
" As you get near the living room, you hear voices talking, half-loud
and fast.">)>
<CRLF> <CRLF>
<MOVE ,PHONG ,LIVING-ROOM>
<GOTO ,LIVING-ROOM>
<COND (<FIX-PHONG-MOVEMENT>
<ENABLE <QUEUE I-PHONG 1>>
<SETG WELCOMED T>)>
<I-LINDER-WELCOME>>
<ROUTINE I-LINDER-WELCOME ()
<TELL CR
"Linder turns to you and says, \"Detective, am I glad to see you! ">
<COND (,TOO-LATE
<TELL
"I was afraid you'd met with an accident. I'm afraid I don't have time
for you now, since I have another appointment. But thank you for
coming. I'll be in touch. Phong, please show the Detective out.\"">
<SAID-TO ,LINDER>
<ESTABLISH-GOAL ,LINDER ,OFFICE>
<DISABLE <INT I-LINDER-TO-OFFICE>>
<ENABLE <QUEUE I-PHONG-EJECTS 3>>)
(T
<ESTABLISH-GOAL ,PHONG ,KITCHEN>
<SETG OHERE ,HERE>
<SETG LINDER-FOLLOWS-YOU T>
<ENABLE <QUEUE I-LINDER-FOLLOWS-YOU -1>>
<COND (<IN? ,MONICA ,HERE>
<TELL "This is my daughter, Monica, and of course ">)
(T <TELL "I see ">)>
<TELL
"you've met Phong already.\" He looks at a wrist watch with a gleaming
silver bracelet. \"I see you're">
<SAID-TO ,LINDER>
<COND (<L? ,PRESENT-TIME 490>
<TELL " right on time.">
<ENABLE <QUEUE I-LINDER-TO-OFFICE 10>>)
(<L? ,PRESENT-TIME 500>
<TELL " a little late.">
<ENABLE <QUEUE I-LINDER-TO-OFFICE 5>>)
(T
<TELL " rather late.">
<ENABLE <QUEUE I-LINDER-TO-OFFICE 1>>)>
<TELL " I'll be with you as soon as I finish my drink.\"">)>
<CRLF>>
<ROUTINE I-PHONG-EJECTS ()
<FCLEAR ,FRONT-DOOR ,OPENBIT>
<FSET ,FRONT-DOOR ,LOCKED>
<TELL
"Phong grabs you by the arm and guides you to the front door. It's
obvious that you have no choice. \"Thank you for coming, Detective. Good
night!\" He closes the door in your face." CR>
<SETG TOO-LATE-KNOCKED 1>
<GOTO ,FRONT-PORCH>
<RTRUE>>
<GLOBAL OHERE <>>
<GLOBAL LINDER-FOLLOWS-YOU <>>
<ROUTINE I-LINDER-FOLLOWS-YOU ()
<COND (<NOT <==? ,OHERE ,HERE>>
<WHERE-UPDATE ,LINDER>
<MOVE ,LINDER ,HERE>
<TELL "Linder follows you ">
<COND (<AND <OR <EQUAL? ,OHERE ,HALL-1 ,HALL-2>
<EQUAL? ,OHERE ,HALL-3 ,HALL-4>>
<OR <EQUAL? ,HERE ,HALL-1 ,HALL-2>
<EQUAL? ,HERE ,HALL-3 ,HALL-4>>>
<TELL "along">)
(T
<TELL "into">)>
<THE? ,HERE>
<TELL " " D ,HERE ".">
<COND (<AND <PROB 50> <WINDOW-IN? ,HERE>>
<TELL " He looks out the window and checks the lock.">)>
<CRLF>
<SETG OHERE ,HERE>)>>
<ROUTINE I-LINDER-TO-OFFICE ("AUX" (VAL <>))
<DISABLE <INT I-LINDER-FOLLOWS-YOU>>
<COND (<OR <EQUAL? ,HERE ,WORKSHOP> <OUTSIDE? ,HERE>>
<MOVE ,LINDER ,CARVED-CHAIR>
<SETG TOO-LATE T>
<COND (<EQUAL? ,HERE ,BACK-YARD ,OFFICE-PORCH ,OFFICE-PATH>
<TELL "The lights go on in Linder's office." CR>)>
<RFALSE>)
(<NOT <EQUAL? ,OFFICE ,HERE <LOC ,PLAYER>>>
<SET VAL ,M-FATAL>
<TELL
"Linder gulps down the rest of his drink. \"Well, Detective,\" he says,
\"I'm anxious to get on with our business. Let's you and I go to my
office so we can talk undisturbed.\" ">
<COND (<FSET? <LOC ,PLAYER> ,FURNITURE>
<SETG WINNER ,PLAYER>
<PERFORM ,V?STAND>)>
<COND (<EQUAL? ,HERE ,HALL-4>
<TELL
"He takes you by the arm, opens a door to the east and leads you through it."
CR>)
(T <TELL
"He takes you by the arm and leads you through the hallway. Just south
of the entry, he opens a door to the east and leads you through it." CR>)>
<FSET ,OFFICE-DOOR ,OPENBIT>
<GOTO ,OFFICE>
<WHERE-UPDATE ,LINDER>
<SAID-TO ,LINDER>)>
<ENABLE <QUEUE I-LINDER-IN-OFFICE 1>>
<FSET ,LINDER ,NDESCBIT>
<MOVE ,LINDER ,CARVED-CHAIR>
<TELL "Linder sits down in the carved chair." CR>
.VAL>
<GLOBAL LINDER-ASKED-YOU-TO-SIT 0>
<ROUTINE I-LINDER-IN-OFFICE ()
<COND (,LINDER-EXPLAINED <>)
(<IN? <LOC ,PLAYER> ,ROOMS>
<ENABLE <QUEUE I-LINDER-IN-OFFICE 5>>
<SAID-TO ,LINDER>
<COND (<0? ,LINDER-ASKED-YOU-TO-SIT>
<TELL
"\"I" "f you'll just take a chair, I'll explain what this is all about.\""
CR>)
(T <TELL "Linder says, \"I repeat: i"
"f you'll just take a chair, I'll explain what this is all about.\""
CR>)>
<SETG LINDER-ASKED-YOU-TO-SIT <+ 1 ,LINDER-ASKED-YOU-TO-SIT>>)
(T <ENABLE <QUEUE I-LINDER-EXPLAIN 1>>)>>
<GLOBAL LINDER-EXPLAINED <>>
<ROUTINE I-LINDER-EXPLAIN ()
<COND (<NOT ,LINDER-EXPLAINED>
<SETG LINDER-EXPLAINED T>
<TELL
"Linder begins his story. \"My late wife, may she rest in peace, got
involved with a young man named Stiles. Naturally I tried to stop this
affair, but without much success. Since my wife passed away, this Stiles
fellow has gone off the deep end, I'm afraid, and blamed me for her
death. I tried my best to ignore him, but he seems to have lost his
senses. This morning I received this note and decided to ask your
help.\" He hands the note to you." CR>
<SAID-TO ,LINDER>
<THIS-IS-IT ,THREAT-NOTE>
<MOVE ,THREAT-NOTE ,PLAYER>
<FSET ,THREAT-NOTE ,TOUCHBIT>
<FCLEAR ,THREAT-NOTE ,INVISIBLE>)>>
<GLOBAL PLAYER-NEAR-SHOT <>>
<ROUTINE FIRE-SHOT ()
<TELL " Suddenly there is a flash of light and an explosion, and ">
<COND (<AND ,PLAYER-NEAR-SHOT
<G? 2 <- ,PRESENT-TIME ,PLAYER-NEAR-SHOT>>>
<TELL
"everything goes black. What a lousy way to step off, poking around like
a two-bit shamus!" CR>
<QUIT>)
(<AND <PROB 50>
<NOT ,PLAYER-HIDING>
<NOT <EQUAL? <LOC ,PLAYER> ,WOODEN-CHAIR ,LOUNGE>>>
<TELL
"mortal pain radiates from your heart. As blood fills your lungs and a
scream fills your brain, you feel sure of only one thing: you should
have taken a chair when Linder asked you to." CR>
<QUIT>)>
<TELL "the window falls into dozens of shiny shards.">
<TELL " The cat bolts and disappears somewhere.">
<REMOVE ,CAT>
<SETG SHOT-FIRED T>
<FCLEAR ,PIECE-OF-WIRE ,TRYTAKEBIT>
<FSET ,PIECE-OF-WIRE ,TAKEBIT>
<FCLEAR ,PIECE-OF-PUTTY ,TRYTAKEBIT>
<FSET ,PIECE-OF-PUTTY ,TAKEBIT>
<FCLEAR ,GLOBAL-SHOT ,INVISIBLE>
<FSET ,OFFICE-WINDOW ,RMUNGBIT>
<FCLEAR ,BROKEN-GLASS ,INVISIBLE>
;<COND (<0? ,DIFFICULTY> <MOVE ,BROKEN-GLASS ,OFFICE-PORCH>)
(<==? ,DIFFICULTY ,DIFFICULTY-MAX>
<MOVE ,BROKEN-GLASS ,OFFICE>)>>
<ROUTINE I-PHONG-RETIRES ()
<WHERE-UPDATE ,PHONG>
<MOVE ,PHONG ,BUTLER-ROOM>
<COND (<==? <GETP ,HERE ,P?LINE> ,OUTSIDE-LINE-C>
<TELL "The lights go out, one by one, all over the house." CR>)>>
<ROUTINE I-LINDER-RETIRES ()
<WHERE-UPDATE ,LINDER>
<MOVE ,LINDER ,LINDER-ROOM>
<COND (<EQUAL? ,HERE ,ROCK-GARDEN ,BACK-YARD ,OFFICE-PORCH>
<TELL
"The lights go off in Linder's office and then in the bedroom at the
other end of the house." CR>)>>
"Here is the code for goal motivation for the various characters.
Each character has a tendency to move from one place to another
at certain times. They all converge on the living room at about
noon."
"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."
<GLOBAL GOAL-TABLES
<TABLE <TABLE <> <> <> <> 1 <> <> I-FOLLOW 4 4>
<TABLE <> <> <> <> 1 <> <> I-PHONG 3 3>
<TABLE <> <> <> <> 1 <> <> I-LINDER 4 4>
<TABLE <> <> <> <> 1 <> <> I-STILES 9 9>
<TABLE <> <> <> <> 1 <> <> I-MONICA 2 2>
<TABLE <> <> <> <> 1 <> <> I-CAT 1 1>>>
<GLOBAL ATTENTION-TABLE <TABLE 0 0 0 0 0 0 0 0>>
"Offsets into GOAL-TABLEs"
<CONSTANT GOAL-F 0>
<CONSTANT GOAL-S 1>
<CONSTANT GOAL-I 2>
<CONSTANT GOAL-LDIR 3>
<CONSTANT GOAL-ENABLE 4>
<CONSTANT GOAL-PRIORITY 5>
<CONSTANT GOAL-QUEUED 6>
<CONSTANT GOAL-FUNCTION 7>
<CONSTANT ATTENTION-SPAN 8>
<CONSTANT ATTENTION 9>
"Goal-function constants, similar to M-xxx in MAIN"
<CONSTANT G-REACHED 1>
<CONSTANT G-ENROUTE 2>
"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 DUNGEON."
<GLOBAL MOVEMENT-GOALS <TABLE
;"PLAYER"
<TABLE 0 0 0>
;"PHONG"
<TABLE 0
50 1 OFFICE-PATH ;"8:50-9 PM"
;"Stiles arr. => Phong to front door, rings bell, then office."
70 10 KITCHEN ;"10-12 PM"
120 10 BUTLER-ROOM ;"12 PM ON"
0>
;"LINDER"
<TABLE 0
0
0>
;"STILES"
<TABLE 0 0
;"60 5 OFFICE-PATH ;arrives about 9:00
135 20 LIVING-ROOM"
0>
;"MONICA"
<TABLE 0
30 2 OFFICE ;"8:30"
;"5 0 GARAGE ;8:35 to movie: goal set in I-MONICA"
;"145 10 GARAGE ;11:00: ditto"
;"2 1 WORKSHOP ;to fix junction box: I-MONICA-RETURN"
161 1 OFFICE ;"? not used!"
;"15 5 TOILET-ROOM ;to vomit: I-MONICA"
15 5 MONICA-ROOM ;"to rest"
30 10 OFFICE ;"12:00 to hide evidence"
60 10 MONICA-ROOM ;"1:00 retires"
0>
;"CAT"
<TABLE 0 0 0>>>
<GLOBAL TOO-LATE <>>
<ROUTINE FIX-PHONG-MOVEMENT ("AUX" MG ELAPSED OT)
<SET MG <GET ,MOVEMENT-GOALS ,PHONG-C>>
<SET ELAPSED <- ,PRESENT-TIME 480>>
<REPEAT ()
<COND (<0? <SET OT <GET .MG ,MG-TIME>>>
<RTRUE>)>
<COND (<G? 1 <SET OT <- .OT .ELAPSED>>>
<SETG TOO-LATE T>
<RFALSE>)>
<PUT .MG ,MG-TIME .OT>
<SET MG <REST .MG ,MG-LENGTH>>>>
<ROUTINE IN-MOTION? (PERSON "AUX" GT)
<SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
<COND (<AND <GET .GT ,GOAL-ENABLE>
<GET .GT ,GOAL-S>
<NOT <==? <LOC .PERSON> <GET .GT ,GOAL-F>>>>
<RTRUE>)
(T <RFALSE>)>>
<ROUTINE START-MOVEMENT ()
<ENABLE <QUEUE I-MONICA 1>>
<ENABLE <QUEUE I-FOLLOW -1>>
<ENABLE <QUEUE I-ATTENTION -1>>>
"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-PRIORITY>
<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)
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> ,CHARACTER-MAX> <RETURN>)
(<==? <SET ATT <- <GET ,ATTENTION-TABLE .CNT> 1>> 1>
<COND (<IN? <GET ,CHARACTER-TABLE .CNT> ,HERE>
<COND (<AND <==? .CNT ,MONICA-C>
,MONICA-DASHED-OUT-DOOR>
<SETG MONICA-DASHED-OUT-DOOR <>>)
(T
<TELL D <GET ,CHARACTER-TABLE .CNT>
" is acting impatient." CR>)>
<SET FLG T>)>)
(<==? .ATT 0>
<PUT <GET ,GOAL-TABLES .CNT> ,GOAL-ENABLE T>)>
<PUT ,ATTENTION-TABLE .CNT .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 ,ATTENTION-TABLE .CHR <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."
<CONSTANT OUTSIDE-LINE-C 4>
<GLOBAL OUTSIDE-LINE
<PTABLE 0 FRONT-YARD P?SOUTH
P?NORTH FRONT-PORCH P?SOUTH
P?NORTH DRIVEWAY P?SOUTH
P?NORTH DRIVEWAY-ENTRANCE P?EAST
P?WEST SIDE-YARD P?EAST
P?WEST OFFICE-PATH P?NORTH
P?SOUTH OFFICE-PORCH P?NORTH
P?SOUTH BACK-YARD P?NORTH
P?SOUTH ROCK-GARDEN 0>>
<CONSTANT INSIDE-LINE-C 1>
<GLOBAL INSIDE-LINE
<PTABLE 0 LINDER-ROOM P?WEST
P?EAST LIVING-ROOM P?SOUTH
P?NORTH HALL-1 P?SOUTH
P?NORTH HALL-2 P?SOUTH
P?NORTH HALL-3 P?WEST
P?EAST ENTRY 0>>
<CONSTANT MONICA-LINE-C 3>
<GLOBAL MONICA-LINE
<PTABLE 0 BATHROOM P?SOUTH
P?NORTH MONICA-ROOM 0>>
<CONSTANT OFFICE-LINE-C 2>
<GLOBAL OFFICE-LINE
<PTABLE 0 OFFICE P?WEST
P?EAST HALL-4 P?SOUTH
P?NORTH GARAGE P?EAST
P?WEST WORKSHOP 0>>
<ROUTINE UNPRIORITIZE (PERSON "AUX" GT)
<SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
<PUT .GT ,GOAL-PRIORITY <>>
<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>)
<SET GT <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>>
<COND (.PRIORITY
<PUT .GT ,GOAL-ENABLE T>
<PUT .GT ,GOAL-PRIORITY T>
<PUT .GT ,GOAL-QUEUED .HERE>)>
<COND (<==? <SET HL <GETP .HERE ,P?LINE>>
<SET GL <GETP .GOAL ,P?LINE>>>
<PUT .GT ,GOAL-I <>>)
(<==? .HL ,OUTSIDE-LINE-C>
<PUT .GT ,GOAL-I ,FRONT-PORCH>)
(<==? .HL ,OFFICE-LINE-C>
<PUT .GT ,GOAL-I ,HALL-4>)
(<==? .HL ,MONICA-LINE-C>
<PUT .GT ,GOAL-I ,MONICA-ROOM>)
(<==? .GL ,OUTSIDE-LINE-C>
<PUT .GT ,GOAL-I ,ENTRY>)
(<==? .GL ,MONICA-LINE-C>
<PUT .GT ,GOAL-I ,HALL-2>)
(T
<PUT .GT ,GOAL-I ,HALL-3>)>
<PUT .GT
,GOAL-S
%<COND (<GASSIGNED? PREDGEN> '<GETP .GOAL ,P?STATION>)
(T ',<GETP .GOAL ,P?STATION>)>>
<PUT .GT ,GOAL-F .GOAL>
<LOC .PERSON>>
<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 IGOAL) <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 <==? .HERE
<SET LOC %<COND (<GASSIGNED? PREDGEN>
'<GETP .HERE ,P?STATION>)
(T
',<GETP .HERE ,P?STATION>)>>>>
<SET FLG <MOVE-PERSON .PERSON .LOC>>
<RETURN .FLG>)>
<COND (<SET GOAL <GET .GT ,GOAL-I>>
<SET IGOAL T>)
(T <SET GOAL <GET .GT ,GOAL-S>>)>
<COND (<NOT .GOAL> <RFALSE>)
(<==? .HERE .GOAL>
<COND (.IGOAL
<RETURN <TRANSFER .PERSON .GOAL <GET .GT ,GOAL-F>>>)
(<NOT <==? .HERE <GET .GT ,GOAL-F>>>
<SET FLG <MOVE-PERSON .PERSON <GET .GT ,GOAL-F>>>
<PUT .GT ,GOAL-S <>>
<RETURN .FLG>)
(T
<PUT .GT ,GOAL-S <>>
<RETURN <>>)>)>
<SET LN <GETP .GOAL ,P?LINE>>
<SET LINE
<COND (<==? .LN ,OUTSIDE-LINE-C> ,OUTSIDE-LINE)
(<==? .LN ,INSIDE-LINE-C> ,INSIDE-LINE)
(<==? .LN ,OFFICE-LINE-C> ,OFFICE-LINE)
(<==? .LN ,MONICA-LINE-C> ,MONICA-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 GOAL-REACHED (PERSON)
#DECL ((PERSON) OBJECT)
<APPLY <GET <GET ,GOAL-TABLES <GETP .PERSON ,P?CHARACTER>>
,GOAL-FUNCTION>
,G-REACHED>>
<ROUTINE MOVE-PERSON (PERSON WHERE "AUX" DIR GT OL COR PCOR CHR
(FLG <>) DR (VAL <>)
(STI <COND (,MET-STILES? "Stiles") (T "someone")>))
#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>>
<COND (<==? <PTSIZE <SET DR <GETPT .OL .DIR>>> ,DEXIT>
<SET DR <GETB .DR ,DEXITOBJ>>
<COND (<NOT <FSET? .DR ,OPENBIT>>
<COND (<NOT <FSET? .DR ,LOCKED>> <FSET .DR ,OPENBIT>)>)
(T <SET DR <>>)>)
(T <SET DR <>>)>
<PUT .GT ,GOAL-LDIR .DIR>
<COND (<AND <==? .OL ,HERE> <NOT <FSET? .PERSON ,INVISIBLE>>>
<SET FLG T>
<THIS-IS-S-HE .PERSON>
<COND (<AND <==? .PERSON ,STILES> ,DUFFY-WITH-STILES>
<SETG SEEN-DUFFY? T>
<TELL "Sgt. Duffy">)
(<NOT <FSET? .PERSON ,TOUCHBIT>> <TELL "Someone">)
(T <TELL D .PERSON>)>
<COND (<==? .DIR ,P?OUT>
<COND (<AND <==? .PERSON ,STILES> ,DUFFY-WITH-STILES>
<TELL " leads " .STI " out of the room." CR>)
(T <TELL " leaves the room." CR>)>)
(<==? .DIR ,P?IN>
<COND (<AND .DR <NOT <==? .PERSON ,STILES>>>
<TELL " opens the " D .DR " and">)>
<COND (<AND <==? .PERSON ,STILES> ,DUFFY-WITH-STILES>
<TELL " leads " .STI " into another room">)
(T <TELL " goes into another room">)>
<COND (<AND .DR
<FSET? .DR ,LOCKED>
<NOT <==? .PERSON ,STILES>>>
;<FCLEAR .DR ,OPENBIT>
<TELL ", locking the door again">)>
<TELL "." CR>)
(T
<COND (<AND .DR <NOT <==? .PERSON ,STILES>>>
<TELL " opens the " D .DR " and">)>
<COND (<AND <==? .PERSON ,STILES> ,DUFFY-WITH-STILES>
<TELL " leads " .STI " off to ">)
(T <TELL " heads off to ">)>
<DIR-PRINT .DIR>
<COND (<AND .DR
<FSET? .DR ,LOCKED>
<NOT <==? .PERSON ,STILES>>>
;<FCLEAR .DR ,OPENBIT>
<TELL ", locking the door again">)>
<TELL "." CR>)>)
(<AND <==? .WHERE ,HERE> <NOT <FSET? .PERSON ,INVISIBLE>>>
<SET FLG T>
<THIS-IS-S-HE .PERSON>
<COND (<NOT <==? ,HERE <GET .GT ,GOAL-F>>>
<COND (<AND <==? .PERSON ,STILES> ,DUFFY-WITH-STILES>
<SETG SEEN-DUFFY? T>
<TELL "Sgt. Duffy">
<TELL " leads " .STI " past you." CR>)
(<NOT <FSET? .PERSON ,TOUCHBIT>>
<TELL "Someone walks past you." CR>)
(T <TELL D .PERSON " walks past you." 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>
<THIS-IS-S-HE .PERSON>
<COND (<NOT <GETP .WHERE ,P?CORRIDOR>>
<COND (<AND <==? .PERSON ,STILES>
,DUFFY-WITH-STILES>
<SETG SEEN-DUFFY? T>
<TELL "Sgt. Duffy">)
(<NOT <FSET? .PERSON ,TOUCHBIT>>
<TELL "Someone">)
(T <TELL D .PERSON>)>
<TELL ", off to ">
<DIR-PRINT <COR-DIR ,HERE .OL>>
<TELL ",">
<COND (<AND .DR <NOT <==? .PERSON ,STILES>>>
<TELL " opens a door and">)>
<COND (<AND <==? .PERSON ,STILES>
,DUFFY-WITH-STILES>
<TELL " leads " .STI>)
(<OUTSIDE? ,HERE>
<TELL " leaves your view">)
(T
<TELL " ducks into a room">)>
<TELL " to ">
<DIR-PRINT <DIR-FROM .OL .WHERE>>
<COND (<AND .DR
<FSET? .DR ,LOCKED>
<NOT <==? .PERSON ,STILES>>>
;<FCLEAR .DR ,OPENBIT>
<TELL ", locking the door again">)>
<TELL "." CR>)
(<0? <BAND .COR <GETP .WHERE ,P?CORRIDOR>>>
<COND (<AND <==? .PERSON ,STILES>
,DUFFY-WITH-STILES>
<SETG SEEN-DUFFY? T>