-
Notifications
You must be signed in to change notification settings - Fork 38
/
act3.mud
1538 lines (1388 loc) · 48.6 KB
/
act3.mud
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
; "SUBTITLE TOMB OF THE UNKNOWN IMPLEMENTER"
<DEFINE COKE-BOTTLES ()
<COND (<VERB? "THROW" "MUNG">
<TELL
"Congratulations! You've managed to break all those bottles.
Fortunately for your feet, they were made of magic glass and disappear
immediately." ,LONG-TELL1>
<COND (<==? <PRSI> <SFIND-OBJ "COKES">>
<REMOVE-OBJECT <PRSI>>
<TELL "Somehow, the " ,POST-CRLF <ODESC2 <PRSO>>
" managed to disappear as well.">)>
<REMOVE-OBJECT <PRSO>>)>>
<DEFINE HEAD-FUNCTION ("AUX" (NL ()) (LCASE <SFIND-OBJ "LCASE">))
#DECL ((NL) <LIST [REST OBJECT]> (LCASE) OBJECT)
<COND (<VERB? "HELLO">
<TELL "The implementers are dead; therefore they do not respond.">)
(<VERB? "DESTR" "KICK" "POKE" "ATTAC" "KILL" "RUB" "OPEN" "TAKE" "BURN">
<TELL ,HEADSTR1 ,LONG-TELL1>
<SET NL <ROB-ADV ,WINNER .NL>>
<SET NL <ROB-ROOM ,HERE .NL 100>>
<COND (<NOT <EMPTY? .NL>>
<OR <OROOM .LCASE> <INSERT-OBJECT .LCASE <SFIND-ROOM "LROOM">>>
<PUT .LCASE ,OCONTENTS (!<OCONTENTS .LCASE> !.NL)>)>
<JIGS-UP ,HEADSTR2>
T)>>
<SETG THEN 0>
\
;"SUBTITLE A DROP IN THE BUCKET"
<SETG BUCKET-TOP!-FLAG <>>
<DEFINE BUCKET ("OPTIONAL" (ARG <>)
"AUX" (W <SFIND-OBJ "WATER">) (BUCK <SFIND-OBJ "BUCKE">))
#DECL ((ARG) <OR FALSE ATOM> (W BUCK) OBJECT)
<COND (<==? .ARG READ-IN> <>)
(<AND <VERB? "C-INT">
<COND (<MEMQ .W <OCONTENTS .BUCK>>
<REMOVE-OBJECT .W>
<>)
(T)>>)
(<AND <VERB? "BURN">
<==? <PRSO> .BUCK>>
<TELL
"The bucket is fireproof, and won't burn.">)
(<VERB? "KICK">
<JIGS-UP "If you insist.">
T)
(<==? .ARG READ-OUT>
<COND (<AND <==? <OCAN .W> .BUCK> <NOT ,BUCKET-TOP!-FLAG>>
<TELL "The bucket rises and comes to a stop.">
<SETG BUCKET-TOP!-FLAG T>
<PASS-THE-BUCKET <SFIND-ROOM "TWELL"> .BUCK>
<CLOCK-INT ,BCKIN 100>
<>)
(<AND ,BUCKET-TOP!-FLAG <N==? <OCAN .W> .BUCK>>
<TELL "The bucket descends and comes to a stop.">
<SETG BUCKET-TOP!-FLAG <>>
<PASS-THE-BUCKET <SFIND-ROOM "BWELL"> .BUCK>)>)>>
<DEFINE PASS-THE-BUCKET (R B "AUX" (PRSO <PRSO>) (PRSVEC ,PRSVEC))
#DECL ((R) ROOM (B) OBJECT (PRSVEC) VECTOR (PRSO) OBJECT)
<PUT .PRSVEC 2 <>>
<REMOVE-OBJECT .B>
<INSERT-OBJECT .B .R>
<COND (<==? <AVEHICLE ,WINNER> .B>
<GOTO .R>
<ROOM-INFO>)>
<PUT .PRSVEC 2 .PRSO>>
\
;"SUBTITLE CHOMPERS IN WONDERLAND"
<DEFINE EATME-FUNCTION ("AUX" R C (HERE ,HERE))
#DECL ((C) OBJECT (HERE R) ROOM)
<COND (<AND <VERB? "EAT">
<==? <PRSO> <SET C <SFIND-OBJ "ECAKE">>>
<==? .HERE <SFIND-ROOM "ALICE">>>
<TELL
"Suddenly, the room appears to have become very large.">
<REMOVE-OBJECT .C>
<SET R <SFIND-ROOM "ALISM">>
<TRZ <SFIND-OBJ "ROBOT"> ,OVISON>
<PUT .R ,ROBJS <ROBJS .HERE>>
<MAPF <>
<FUNCTION (X) #DECL ((X) OBJECT)
<OSIZE .X <* 64 <OSIZE .X>>>
<PUT .X ,OROOM .R>>
<ROBJS .HERE>>
<GOTO .R>)>>
<DEFINE CAKE-FUNCTION ("AUX" (RICE <SFIND-OBJ "RDICE">) (OICE <SFIND-OBJ "ORICE">)
(BICE <SFIND-OBJ "BLICE">) (HERE ,HERE) R)
#DECL ((RICE OICE BICE) OBJECT (HERE R) ROOM)
<COND (<VERB? "READ">
<COND (<NOT <EMPTY? <PRSI>>>
<COND (<==? <PRSI> <SFIND-OBJ "BOTTL">>
<TELL
"The letters appear larger, but still are too small to be read.">)
(<==? <PRSI> <SFIND-OBJ "FLASK">>
<TELL "The icing, now visible, says '"
1
<COND (<==? <PRSO> .RICE> "Evaporate")
(<==? <PRSO> .OICE> "Explode")
("Enlarge")>
"'.">)
(<TELL "You can't see through that!">)>)
(<TELL
"The only writing legible is a capital E. The rest is too small to
be clearly visible.">)>)
(<AND <VERB? "EAT"> <MEMBER "ALI" <STRINGP <RID .HERE>>>>
<COND (<==? <PRSO> .OICE>
<REMOVE-OBJECT <PRSO>>
<ICEBOOM>)
(<==? <PRSO> .BICE>
<REMOVE-OBJECT <PRSO>>
<TELL "The room around you seems to be getting smaller.">
<COND (<==? .HERE <SFIND-ROOM "ALISM">>
<SET R <SFIND-ROOM "ALICE">>
<TRO <SFIND-OBJ "ROBOT"> ,OVISON>
<PUT .R ,ROBJS <ROBJS .HERE>>
<TRZ <SFIND-OBJ "POSTS"> ,OVISON>
<MAPF <>
<FUNCTION (X) #DECL ((X) OBJECT)
<PUT .X ,OROOM .R>
<OSIZE .X </ <OSIZE .X> 64>>>
<ROBJS .HERE>>
<GOTO .R>)
(<JIGS-UP ,CRUSHED>)>)>)
(<AND <VERB? "THROW">
<==? <PRSO> .OICE>
<MEMBER "ALI" <STRINGP <RID .HERE>>>>
<REMOVE-OBJECT <PRSO>>
<ICEBOOM>)
(<AND <VERB? "THROW">
<==? <PRSO> .RICE>
<==? <PRSI> <SFIND-OBJ "POOL">>>
<REMOVE-OBJECT <PRSI>>
<TELL
"The pool of water evaporates, revealing a tin of rare spices.">
<TRO <SFIND-OBJ "SAFFR"> ,OVISON>)>>
<DEFINE FLASK-FUNCTION ()
<COND (<VERB? "OPEN">
<MUNG-ROOM ,HERE "Noxious vapors prevent your entry.">
<JIGS-UP ,VAPORS>)
(<VERB? "MUNG" "THROW">
<TELL "The flask breaks into pieces.">
<TRZ <PRSO> ,OVISON>
<JIGS-UP ,VAPORS T>)>>
<DEFINE PLEAK ()
<COND (<VERB? "TAKE">
<TELL <PICK-ONE ,YUKS>>)
(<VERB? "PLUG">
<TELL "The leak is too high above you to reach.">)>>
<DEFINE ICEBOOM ()
<MUNG-ROOM ,HERE ,ICEMUNG>
<JIGS-UP ,ICEBLAST>>
<DEFINE MAGNET-ROOM ()
<COND (<VERB? "LOOK">
<TELL
"You are in a room with a low ceiling which is circular in shape.
There are exits to the east and the southeast.">)
(<AND <VERB? "GO-IN"> ,CAROUSEL-FLIP!-FLAG>
<COND (,CAROUSEL-ZOOM!-FLAG
<JIGS-UP <COND (<==? ,PLAYER ,WINNER> ,SPINDIZZY)
(ELSE ,SPINROBOT)>>)
(<TELL
"As you enter, your compass starts spinning wildly.">
<>)>)>>
<DEFINE MAGNET-ROOM-EXIT ("AUX" (PV ,PRSVEC) (DIR <2 .PV>))
#DECL ((DIR) DIRECTION (PV) <VECTOR [3 ANY]>)
<COND (,CAROUSEL-FLIP!-FLAG
<TELL "You cannot get your bearings...">
<COND (<PROB 50>
<SFIND-ROOM "CMACH">)
(<SFIND-ROOM "ALICE">)>)
(<==? .DIR <FIND-DIR "E">>
<SFIND-ROOM "CMACH">)
(<OR <==? .DIR <FIND-DIR "SE">>
<==? .DIR <FIND-DIR "OUT">>>
<SFIND-ROOM "ALICE">)>>
<DEFINE CMACH-ROOM ()
<COND (<VERB? "LOOK">
<TELL ,CMACH-DESC ,LONG-TELL1>)>>
<SETG CAROUSEL-ZOOM!-FLAG <>>
<SETG CAROUSEL-FLIP!-FLAG <>>
<DEFINE BUTTONS ("AUX" I)
#DECL ((I) OBJECT)
<COND (<VERB? "PUSH">
<COND (<==? ,WINNER ,PLAYER>
<JIGS-UP
"There is a giant spark and you are fried to a crisp.">)
(<==? <PRSO> <SFIND-OBJ "SQBUT">>
<COND (,CAROUSEL-ZOOM!-FLAG
<TELL "Nothing seems to happen.">)
(<SETG CAROUSEL-ZOOM!-FLAG T>
<TELL "The whirring increases in intensity slightly.">)>)
(<==? <PRSO> <SFIND-OBJ "RNBUT">>
<COND (,CAROUSEL-ZOOM!-FLAG
<SETG CAROUSEL-ZOOM!-FLAG <>>
<TELL "The whirring decreases in intensity slightly.">)
(<TELL "Nothing seems to happen.">)>)
(<==? <PRSO> <SFIND-OBJ "TRBUT">>
<SETG CAROUSEL-FLIP!-FLAG <NOT ,CAROUSEL-FLIP!-FLAG>>
<COND (<==? <OROOM <SET I <SFIND-OBJ "IRBOX">>>
<SFIND-ROOM "CAROU">>
<TELL
"A dull thump is heard in the distance.">
<TRC .I ,OVISON>
<COND (<TRNN .I ,OVISON>
<RTRZ <SFIND-ROOM "CAROU"> ,RSEENBIT>)>
T)
(<TELL "Click.">)>)>)>>
<SETG CAGE-SOLVE!-FLAG <>>
<DEFINE SPHERE-FUNCTION ("AUX" (R <SFIND-OBJ "ROBOT">) C FL RACT)
#DECL ((C) ROOM (R) OBJECT (FL) <OR ATOM FALSE> (RACT) ADV)
<SET FL <AND <NOT ,CAGE-SOLVE!-FLAG> <VERB? "TAKE">>>
<COND (<AND .FL <==? ,PLAYER ,WINNER>>
<TELL ,CAGESTR ,LONG-TELL1>
<COND (<==? <OROOM .R> ,HERE>
<GOTO <SET C <SFIND-ROOM "CAGED">>>
<REMOVE-OBJECT .R>
<INSERT-OBJECT .R .C>
<PUT <SET RACT <OACTOR .R>> ,AROOM .C>
<TRO .R ,NDESCBIT>
<SETG SPHERE-CLOCK <CLOCK-INT ,SPHIN 10>>
T)
(ELSE
<TRZ <SFIND-OBJ "SPHER"> ,OVISON>
<MUNG-ROOM <SFIND-ROOM "CAGER">
"You are stopped by a cloud of poisonous gas.">
<JIGS-UP ,POISON T>)>)
(.FL
<TRZ <SFIND-OBJ "SPHER"> ,OVISON>
<JIGS-UP ,ROBOT-CRUSH>
<REMOVE-OBJECT .R>
<TRZ <PRSO> ,OVISON>
<INSERT-OBJECT <SFIND-OBJ "RCAGE"> ,HERE>
T)
(<VERB? "C-INT">
<MUNG-ROOM <SFIND-ROOM "CAGER">
"You are stopped by a cloud of poisonous gas.">
<JIGS-UP ,POISON T>)
(<VERB? "LKIN">
<PALANTIR>)>>
<DEFINE CAGED-ROOM ()
<COND (,CAGE-SOLVE!-FLAG <SETG HERE <SFIND-ROOM "CAGER">>)>>
<GDECL (SPHERE-CLOCK) CEVENT (ROBOT-ACTIONS) <UVECTOR [REST VERB]>>
<DEFINE ROBOT-ACTOR ("AUX" C CAGE (R <SFIND-OBJ "ROBOT">) RACT)
#DECL ((C) ROOM (CAGE) OBJECT (R) OBJECT (RACT) ADV)
<COND (<AND <VERB? "RAISE"> <==? <PRSO> <SFIND-OBJ "CAGE">>>
<TELL "The cage shakes and is hurled across the room.">
<CLOCK-DISABLE ,SPHERE-CLOCK>
<SETG WINNER ,PLAYER>
<GOTO <SET C <SFIND-ROOM "CAGER">>>
<INSERT-OBJECT <SET CAGE <SFIND-OBJ "CAGE">> .C>
<TRO .CAGE ,TAKEBIT>
<TRZ .CAGE ,NDESCBIT>
<TRZ .R ,NDESCBIT>
<TRO <SFIND-OBJ "SPHER"> ,TAKEBIT>
<REMOVE-OBJECT .R>
<INSERT-OBJECT .R .C>
<PUT <SET RACT <OACTOR .R>> ,AROOM .C>
<SETG WINNER .RACT>
<SETG CAGE-SOLVE!-FLAG T>)
(<VERB? "EAT" "DRINK">
<TELL
"\"I am sorry but that action is difficult for a being with no mouth.\"">)
(<VERB? "READ">
<TELL
"\"My vision is not sufficiently acute to read such small type.\"">)
(<MEMQ <PRSA> ,ROBOT-ACTIONS> <TELL "\"Whirr, buzz, click!\""> <>)
(<TELL
"\"I am only a stupid robot and cannot perform that command.\"">)>>
<DEFINE CRETIN ("AUX" (ME ,PLAYER))
#DECL ((ME) ADV)
<COND (<AND <VERB? "GIVE"> <NOT <TRNN <PRSO> ,NO-CHECK-BIT>>>
<REMOVE-OBJECT <PRSO>>
<PUT .ME ,AOBJS (<PRSO> !<AOBJS .ME>)>
<TELL "Done.">)
(<VERB? "KILL" "MUNG">
<JIGS-UP
"If you insist.... Poof, you're dead!">)
(<VERB? "TAKE">
<TELL "How romantic!">)>>
<DEFINE ROBOT-FUNCTION ("AUX" AA RR)
#DECL ((AA) ADV (RR) OBJECT)
<COND (<VERB? "GIVE">
<SET AA <OACTOR <PRSI>>>
<REMOVE-OBJECT <PRSO>>
<PUT .AA ,AOBJS (<PRSO> !<AOBJS .AA>)>
<TELL "The robot gladly takes the "
1
<ODESC2 <PRSO>>
"
and nods his head-like appendage in thanks.">)
(<AND <VERB? "THROW" "MUNG">
<OR <==? <PRSI> <SET RR <FIND-OBJ "ROBOT">>>
<==? <PRSO> .RR>>>
<TELL ,ROBOTDIE ,LONG-TELL1>
<REMOVE-OBJECT <COND (<VERB? "THROW"> <PRSI>) (<PRSO>)>>)>>
\
;"SUBTITLE MORE RANDOM VERBS"
<DEFINE KNOCK ()
<COND (<OBJECT-ACTION>)
(<MEMQ <PSTRING "DOOR"> <ONAMES <PRSO>>>
<TELL "I don't think that anybody's home.">)
(<TELL "Why knock on a " 1 <ODESC2 <PRSO>> "?">)>>
<DEFINE CHOMP ()
<TELL "I don't know how to do that. I win in all cases!">>
<DEFINE FROBOZZ ()
<TELL "The FROBOZZ Corporation created, owns, and operates this dungeon.">>
<DEFINE WIN ()
<TELL "Naturally!">>
<DEFINE YELL ()
<TELL "Aaaarrrrrrrrgggggggggggggghhhhhhhhhhhhhh!">>
\
;"SUBTITLE BANK OF ZORK"
<GDECL (SCOL-ROOM SCOL-ACTIVE)
<OR FALSE ROOM>
(SCOL-ROOMS)
<VECTOR [REST DIRECTION ROOM]>
(SCOL-WALLS)
<VECTOR [REST ROOM OBJECT ROOM]>>
<SETG BANK-SOLVE!-FLAG <>>
<DEFINE BILLS-OBJECT ()
<SETG BANK-SOLVE!-FLAG T>
<COND (<VERB? "BURN">
<TELL "Nothing like having money to burn!">
<>)
(<VERB? "EAT">
<TELL "Talk about eating rich foods!">)>>
<DEFINE BKLEAVEE ("OPTIONAL" (RM <SFIND-ROOM "BKTE">))
#DECL ((RM) ROOM)
<COND (<OR <HELD? <SFIND-OBJ "BILLS">>
<HELD? <SFIND-OBJ "PORTR">>>
<>)
(.RM)>>
<DEFINE BKLEAVEW ()
<BKLEAVEE <SFIND-ROOM "BKTW">>>
<DEFINE BKBOX-ROOM ("AUX" M)
#DECL ((M) <VECTOR [REST DIRECTION ROOM]>)
<COND (<VERB? "GO-IN">
<SETG SCOL-ROOM <2 <SET M <MEMQ ,FROMDIR ,SCOL-ROOMS>>>>)>>
<DEFINE TELLER-ROOM ()
<COND (<VERB? "LOOK">
<TELL ,TELLER-DESC
1
<COND (<==? ,HERE <SFIND-ROOM "BKTW">>
"west")
("east")>
" side of room, above an open door, is a sign reading
BANK PERSONNEL ONLY
">)>>
<DEFINE SCOL-OBJECT ("OPTIONAL" (OBJ <>))
#DECL ((OBJ) <OR FALSE OBJECT>)
<COND (<VERB? "PUSH" "MOVE" "TAKE" "RUB">
<TELL "As you try, your hand seems to go through it.">)
(<VERB? "POKE" "ATTAC" "KILL">
<TELL "The " 1 <ODESC2 <PRSI>> " goes through it.">)
(<AND <VERB? "THROW">
<OR <==? <SFIND-OBJ "SCOL"> <PRSI>>
<==? .OBJ <PRSI>>>>
<THROUGH <PRSO>>)>>
<DEFINE GET-WALL (RM)
#DECL ((RM) ROOM)
<REPEAT ((W ,SCOL-WALLS))
#DECL ((W) <VECTOR [REST ROOM OBJECT ROOM]>)
<COND (<==? <1 .W> .RM>
<RETURN .W>)
(<SET W <REST .W 3>>)>>>
<DEFINE SCOLWALL ("AUX" (HERE ,HERE) M)
#DECL ((HERE) ROOM (M) <VECTOR [REST ROOM OBJECT ROOM]>)
<COND (<AND <==? .HERE ,SCOL-ACTIVE>
<==? <PRSO> <2 <SET M <GET-WALL .HERE>>>>>
<SCOL-OBJECT <PRSO>>)>>
<DEFINE ENTER ("AUX" (PV ,PRSVEC))
#DECL ((PV) VECTOR)
<PUT .PV 2 <FIND-DIR "ENTER">>
<PUT .PV 1 <FIND-VERB "WALK">>
<WALK>>
<DEFINE THROUGH ("OPTIONAL" (OBJ <>)
"AUX" (HERE ,HERE) (BOX <SFIND-ROOM "BKBOX">) (SCRM ,SCOL-ROOM)
M (PRSVEC ,PRSVEC))
#DECL ((HERE BOX) ROOM (SCRM) <OR FALSE ROOM>
(M) <VECTOR [REST ROOM OBJECT ROOM]> (OBJ) <OR OBJECT FALSE>)
<COND (<AND <NOT .OBJ>
<OBJECT-ACTION>>)
(<AND <NOT .OBJ>
<TRNN <PRSO> ,VEHBIT>>
<PERFORM BOARD <FIND-VERB "BOARD"> <PRSO>>)
(<OR <AND <OR .OBJ <==? <PRSO> <SFIND-OBJ "SCOL">>> .SCRM>
<AND <==? .HERE .BOX> <==? <PRSO> <SFIND-OBJ "WNORT">> .SCRM>>
<SETG SCOL-ACTIVE .SCRM>
<PUT .PRSVEC 2 <>>
<COND (.OBJ <SCOL-OBJ .OBJ 0 .SCRM>) (<SCOL-THROUGH 6 .SCRM>)>)
(<AND <==? .HERE ,SCOL-ACTIVE>
<==? <PRSO> <2 <SET M <GET-WALL .HERE>>>>>
<SETG SCOL-ROOM <3 .M>>
<PUT .PRSVEC 2 <CHTYPE <1 <OADJS <PRSO>>> DIRECTION>>
<COND (.OBJ <SCOL-OBJ .OBJ 0 .BOX>) (<SCOL-THROUGH 0 .BOX>)>)
(<AND <NOT .OBJ> <NOT <TRNN <PRSO> ,TAKEBIT>>>
<COND (<==? <PRSO> <SFIND-OBJ "SCOL">>
<TELL
"You can't go more than part way through the curtain.">)
(<OBJECT-ACTION>)
(<TELL "You hit your head against the "
1
<ODESC2 <PRSO>>
" as you attempt this feat.">)>)
(.OBJ <TELL "You can't do that!">)
(<NOT <OROOM <PRSO>>>
<TELL "That would involve quite a contortion!">)
(<TELL <PICK-ONE ,YUKS>>)>>
<DEFINE SCOL-OBJ (OBJ CINT RM)
#DECL ((OBJ) OBJECT (CINT) FIX (RM) ROOM)
<CLOCK-INT ,SCLIN .CINT>
<REMOVE-OBJECT .OBJ>
<INSERT-OBJECT .OBJ .RM>
<COND (<==? .RM <SFIND-ROOM "BKBOX">>
<TELL "The " 1 <ODESC2 .OBJ> " passes through the wall and vanishes.">)
(<TELL "The curtain dims slightly as the "
1
<ODESC2 .OBJ>
" passes through.">
<SETG SCOL-ROOM <>>
T)>>
<DEFINE SCOL-THROUGH (CINT RM)
#DECL ((CINT) FIX (RM) ROOM)
<CLOCK-INT ,SCLIN .CINT>
<GOTO .RM>
<TELL ,THROUGH-DESC>
<ROOM-INFO>>
<PSETG THROUGH-DESC "You feel somewhat disoriented as you pass through...">
<DEFINE SCOL-CLOCK ("AUX" (HERE ,HERE))
#DECL ((HERE) ROOM)
<SETG SCOL-ACTIVE <SFIND-ROOM "FCHMP">>
<COND (<==? .HERE <SFIND-ROOM "BKVAU">>
<JIGS-UP ,ALARM-VOICE>)
(<==? .HERE <SFIND-ROOM "BKTWI">>
<COND (,ZGNOME-FLAG!-FLAG)
(ELSE
<CLOCK-INT ,ZGNIN 5>
<SETG ZGNOME-FLAG!-FLAG T>)>)>>
<SETG ZGNOME-FLAG!-FLAG <>>
<DEFINE ZGNOME-INIT ()
<COND (<VERB? "C-INT">
<COND (<==? ,HERE <SFIND-ROOM "BKTWI">>
<CLOCK-INT ,ZGLIN 12>
<TELL ,ZGNOME-DESC ,LONG-TELL1>
<INSERT-OBJECT <SFIND-OBJ "ZGNOM"> ,HERE>)>)>>
<DEFINE ZGNOME-FUNCTION ("AUX" (GNOME <SFIND-OBJ "ZGNOM">) BRICK)
#DECL ((GNOME BRICK) OBJECT)
<COND (<VERB? "GIVE" "THROW">
<COND (<N==? <OTVAL <PRSO>> 0>
<TELL
"The gnome carefully places the " ,LONG-TELL1 <ODESC2 <PRSO>> " in the
deposit box. 'Let me show you the way out,' he says, making it clear
he will be pleased to see the last of you. Then, you are momentarily
disoriented, and when you recover you are back at the Bank Entrance.">
<REMOVE-OBJECT .GNOME>
<REMOVE-OBJECT <PRSO>>
<CLOCK-DISABLE ,ZGLIN>
<GOTO <SFIND-ROOM "BKENT">>)
(<BOMB? <PRSO>>
<REMOVE-OBJECT .GNOME>
<OR <OROOM <SET BRICK <SFIND-OBJ "BRICK">>>
<INSERT-OBJECT .BRICK ,HERE>>
<CLOCK-DISABLE ,ZGLIN>
<CLOCK-DISABLE ,ZGNIN>
<TELL ,ZGNOME-POP-1>)
(<TELL ,ZGNOME-POP>
<REMOVE-OBJECT <PRSO>>)>)
(<VERB? "C-INT">
<COND (<==? ,HERE <SFIND-ROOM "BKTWI">>
<TELL ,ZGNOME-BYE ,LONG-TELL1>)>
<REMOVE-OBJECT .GNOME>)
(<VERB? "KILL" "ATTAC" "POKE">
<TELL
"The gnome says 'Well, I never...' and disappears with a snap of his
fingers, leaving you alone.">
<REMOVE-OBJECT .GNOME>
<CLOCK-DISABLE ,ZGLIN>)
(<TELL
"The gnome appears increasingly impatient.">)>>
<DEFINE HELD? (OBJ "AUX" (CAN <OCAN .OBJ>))
#DECL ((OBJ) OBJECT (CAN) <OR FALSE OBJECT>)
<OR <MEMQ .OBJ <AOBJS ,WINNER>>
<AND .CAN <HELD? .CAN>>>>
\
;"SUBTITLE TOITY POIPLE BOIDS A CHOIPIN' AN' A BOIPIN' ... "
<DEFINE TREE-ROOM ("AUX" (HERE ,HERE) ROBJS EGG TTREE NEST
(FORE3 <SFIND-ROOM "FORE3">) (OUTCHAN ,OUTCHAN))
#DECL ((HERE) ROOM (ROBJS) <LIST [REST OBJECT]> (TTREE NEST EGG) OBJECT
(OUTCHAN) CHANNEL)
<COND (<VERB? "LOOK">
<TELL ,TREE-DESC>
<COND (<G? <LENGTH <ROBJS .FORE3>> 1>
<TELL "On the ground below you can see: " 0>
<REMOVE-OBJECT <SFIND-OBJ "FTREE">>
<MAPR <>
<FUNCTION (Y)
#DECL ((Y) <LIST [REST OBJECT]>)
<PRINC "a ">
<PRINC <ODESC2 <1 .Y>>>
<COND (<G? <LENGTH .Y> 2> <PRINC ", ">)
(<==? <LENGTH .Y> 2>
<PRINC ", and ">)>>
<ROBJS .FORE3>>
<TELL ".">
<INSERT-OBJECT <SFIND-OBJ "FTREE"> .FORE3>)>)
(<VERB? "GO-IN"> <CLOCK-ENABLE <CLOCK-INT ,FORIN -1>>)
(<AND <NOT <EMPTY? <SET ROBJS <ROBJS .HERE>>>> <VERB? "DROP">>
<SET TTREE <SFIND-OBJ "TTREE">>
<SET NEST <SFIND-OBJ "NEST">>
<SET EGG <SFIND-OBJ "EGG">>
<SET FORE3 <SFIND-ROOM "FORE3">>
<MAPF <>
<FUNCTION (X)
#DECL ((X) OBJECT)
<COND (<==? .X .EGG>
<REMOVE-OBJECT .EGG>
<SET EGG <SFIND-OBJ "BEGG">>
<TELL
"The egg falls to the ground, and is seriously damaged.">
<OTVAL <SFIND-OBJ "BCANA"> 1>
<OTVAL .EGG 2>
<INSERT-OBJECT .EGG .FORE3>)
(<OR <==? .X .TTREE> <==? .X .NEST>>)
(<REMOVE-OBJECT .X>
<INSERT-OBJECT .X .FORE3>
<TELL "The "
1
<ODESC2 .X>
" falls to the ground.">)>>
.ROBJS>)>>
<DEFINE EGG-OBJECT ("AUX" (BEGG <SFIND-OBJ "BEGG">) (EGG <SFIND-OBJ "EGG">))
#DECL ((BEGG) OBJECT)
<COND (<AND <VERB? "OPEN">
<==? <PRSO> .EGG>>
<COND (<TRNN <PRSO> ,OPENBIT> <TELL "The egg is already open.">)
(<EMPTY? <PRSI>>
<TELL "There is no obvious way to open the egg.">)
(<==? <PRSI> <SFIND-OBJ "HANDS">>
<TELL "I doubt you could do that without damaging it.">)
(<TRNN <PRSI> <+ ,WEAPONBIT ,TOOLBIT>>
<TELL
"The egg is now open, but the clumsiness of your attempt has seriously
compromised its esthetic appeal.">
<BAD-EGG .BEGG>)
(<TRNN <PRSO> ,FIGHTBIT>
<TELL "Not to say that using the "
1
<ODESC2 <PRSI>>
" isn't original too...">)
(<TELL "The concept of using a "
1
<ODESC2 <PRSI>>
" is certainly original.">
<TRO <PRSO> ,FIGHTBIT>)>)
(<VERB? "OPEN" "POKE" "MUNG">
<TELL
"Your rather indelicate handling of the egg has caused it some damage.
The egg is now open.">
<BAD-EGG .BEGG>)>>
<DEFINE BAD-EGG (BEGG "AUX" CAN (EGG <SFIND-OBJ "EGG">))
#DECL ((EGG BEGG) OBJECT (CAN) <OR FALSE OBJECT>)
<COND (<==? <OCAN <SFIND-OBJ "CANAR">> .EGG>
<TELL <ODESCO <SFIND-OBJ "BCANA">>>
<OTVAL <SFIND-OBJ "BCANA"> 1>)
(<REMOVE-OBJECT <SFIND-OBJ "BCANA">>)>
<OTVAL .BEGG 2>
<COND (<OROOM .EGG> <INSERT-OBJECT .BEGG ,HERE>)
(<SET CAN <OCAN .EGG>> <INSERT-INTO .CAN .BEGG>)
(<TAKE-OBJECT .BEGG>)>
<REMOVE-OBJECT .EGG>
T>
<DEFINE WIND ()
<COND (<OBJECT-ACTION>)
(<TELL "You cannot wind up a " 1 <ODESC2 <PRSO>> ".">)>>
<SETG SING-SONG!-FLAG <>>
<DEFINE CANARY-OBJECT ("AUX" (HERE ,HERE) (TREE <SFIND-ROOM "TREE">))
#DECL ((HERE TREE) ROOM)
<COND (<VERB? "WIND">
<COND (<==? <PRSO> <SFIND-OBJ "CANAR">>
<COND (<AND <NOT ,SING-SONG!-FLAG>
<OR <MEMBER "FORE" <STRINGP <RID .HERE>>>
<==? .HERE .TREE>>>
<TELL ,OPERA>
<SETG SING-SONG!-FLAG T>
<INSERT-OBJECT <SFIND-OBJ "BAUBL">
<COND (<==? .HERE .TREE>
<SFIND-ROOM "FORE3">)
(.HERE)>>)
(<TELL
"The canary chirps blithely, if somewhat tinnily, for a short time.">)>)
(<TELL
"There is an unpleasant grinding noise from inside the canary.">)>)>>
<DEFINE FOREST-ROOM ("AUX" (HERE ,HERE))
#DECL ((HERE) ROOM)
<COND (<VERB? "C-INT">
<COND (<NOT <OR <MEMBER "FORE" <STRINGP <RID .HERE>>>
<==? .HERE <SFIND-ROOM "TREE">>>>
<CLOCK-DISABLE ,FORIN>)
(<PROB 10>
<TELL
"You hear in the distance the chirping of a song bird.">)>)
(<VERB? "GO-IN"> <CLOCK-ENABLE <CLOCK-INT ,FORIN -1>>)>>
<DEFINE BIRD-OBJECT ()
<COND (<VERB? "EXAMI">
<TELL "I can't see any songbird here.">)
(<VERB? "FIND">
<TELL "The songbird is not here, but is probably nearby.">)>>
<DEFINE CLIMB-FOO ()
<CLIMB-UP <FIND-DIR "UP"> T>>
<DEFINE CLIMB-UP ("OPTIONAL" (DIR <FIND-DIR "UP">) (NOOBJ <>)
"AUX" (FLG <OR .NOOBJ <TRNN <PRSO> ,CLIMBBIT>>)
(PV ,PRSVEC) (HERE ,HERE))
#DECL ((PV) VECTOR (DIR) DIRECTION (HERE) ROOM (NOOBJ FLG) <OR FALSE ATOM>)
<COND (<OBJECT-ACTION>)
(<AND .FLG <MEMQ .DIR <REXITS .HERE>>>
<PUT .PV 2 .DIR>
<PUT .PV 1 <FIND-VERB "WALK">>
<WALK>)
(.FLG <TELL "You can't go that way.">)
(<MEMQ <PSTRING "WALL"> <ONAMES <PRSO>>>
<TELL "Climbing the walls is of no avail.">)
(<TELL "Bizarre!">)>>
<DEFINE CLIMB-DOWN () <CLIMB-UP <FIND-DIR "DOWN">>>
<DEFINE WCLIF-OBJECT ()
<COND (<VERB? "CLUP" "CLDN" "CLUDG">
<TELL "The cliff is too steep for climbing.">)>>
\
; "SUBTITLE CHINESE PUZZLE SECTION (COURTESY OF WILL WENG)"
<GDECL (CPHERE)
FIX
(CPOBJS)
<UVECTOR [REST LIST]>
(CPUVEC)
<UVECTOR [REST FIX]>
(CPWALLS)
<VECTOR [REST OBJECT FIX]>
(CPEXITS)
<VECTOR [REST DIRECTION FIX]>>
<DEFINE CPEXIT ("AUX" (DIR <2 ,PRSVEC>) (RM ,CPHERE) (UVEC ,CPUVEC) FX M)
#DECL ((DIR) DIRECTION (M) <VECTOR DIRECTION FIX> (FX RM) FIX
(UVEC) <UVECTOR [REST FIX]>)
<COND (<==? .DIR <FIND-DIR "UP">>
<COND (<==? .RM 10>
<COND (<==? <11 ,CPUVEC> -2>
<TELL "With the help of the ladder, you exit the puzzle.">
<GOTO <FIND-ROOM "CPANT">>)
(<TELL "The exit is too far above your head.">)>)
(<TELL "There is no way up.">)>)
(<AND <==? .RM 52>
<==? .DIR <FIND-DIR "WEST">>
,CPOUT!-FLAG>
<GOTO <FIND-ROOM "CPOUT">>
<RTRZ <FIND-ROOM "CP"> ,RSEENBIT>
<ROOM-INFO>)
(<AND <==? .RM 52>
<==? .DIR <FIND-DIR "WEST">>>
<TELL "The metal door bars the way.">)
(<AND <SET M <MEMQ .DIR ,CPEXITS>> <SET FX <2 .M>> <>>)
(<OR <MEMQ <ABS .FX> '![1 8!]>
<AND <G? .FX 0> ; "SW AND SE"
<OR <0? <NTH .UVEC <+ .RM 8>>>
<0? <NTH .UVEC <+ .RM <- .FX 8>>>>>>
<AND <L? .FX 0>
<OR <0? <NTH .UVEC <- .RM 8>>>
<0? <NTH .UVEC <+ .RM 8 .FX>>>>>>
<COND (<0? <NTH .UVEC <SET FX <+ .RM .FX>>>> <CPGOTO .FX>)
(<TELL "There is a wall there.">)>)
(<TELL "There is a wall there.">)>>
<DEFINE CPENTER ()
<COND (,CPBLOCK!-FLAG
<TELL "The way is blocked by sandstone.">
<>)
(<SETG CPHERE 10>
<GOTO <FIND-ROOM "CP">>
<ROOM-INFO>)>>
<DEFINE CPANT-ROOM ()
<COND (<VERB? "LOOK">
<TELL
"This is a small square room, in the middle of which is a recently
created hole " 0>
<TELL
<COND (,CPBLOCK!-FLAG
" which is blocked by smooth sandstone.")
(" through which you can barely discern the floor some ten
feet below. It doesn't seem likely you could climb back up.")>
0>
<TELL " There
are exits to the west and south.">)>>
<SETG CPPUSH!-FLAG <>>
<SETG CPSOLVE!-FLAG <>>
<DEFINE CPLADDER-OBJECT ("AUX" (FLG <>) (HERE ,CPHERE))
#DECL ((FLG) <OR FALSE ATOM> (HERE) FIX)
<COND (<OR <AND <==? <NTH ,CPUVEC <+ .HERE 1>> -2> <SET FLG T>>
<==? <NTH ,CPUVEC <- .HERE 1>> -3>>
<COND (<VERB? "CLUP" "CLUDG">
<COND (<AND .FLG <==? .HERE 10>>
<SETG CPSOLVE!-FLAG T>
<GO&LOOK <FIND-ROOM "CPANT">>)
(<TELL
"You hit your head on the ceiling and fall off the ladder.">)>)
(<TELL "Come, come!">)>)
(<TELL "I can't see any ladder here.">)>>
<DEFINE CPWALL-OBJECT ("AUX" (HERE ,CPHERE) (UVEC ,CPUVEC) WL NWL NXT NNXT)
#DECL ((HERE NXT WL NNXT NWL) FIX (UVEC) <UVECTOR [REST FIX]>)
<COND (<VERB? "PUSH">
<SET NXT <CPNEXT .HERE <PRSO>>>
<SET WL <NTH .UVEC .NXT>>
<COND (<0? .WL>
<TELL "There is only a passage in that direction.">)
(<OR <1? .WL>
<AND <SET NNXT <CPNEXT .NXT <PRSO>>>
<NOT <0? <SET NWL <NTH .UVEC .NNXT>>>>>>
<TELL "The wall does not budge.">)
(<TELL
"The wall slides forward and you follow it">
<TELL <COND (,CPPUSH!-FLAG
" to this position:")
(,COMPLEX-DESC)>>
<SETG CPPUSH!-FLAG T>
<PUT .UVEC .NXT 0>
<PUT .UVEC .NNXT .WL>
<AND <==? .NNXT 10> <SETG CPBLOCK!-FLAG T>>
<CPGOTO .NXT>)>)>>
; "Flag for blocking of main entrance"
<SETG CPBLOCK!-FLAG <>>
<DEFINE CPGOTO (FX "AUX" (HERE ,HERE))
#DECL ((FX) FIX (HERE) ROOM)
<RTRZ .HERE ,RSEENBIT>
<PUT ,CPOBJS ,CPHERE <ROBJS .HERE>>
<SETG CPHERE .FX>
<PUT .HERE ,ROBJS <NTH ,CPOBJS .FX>>
<PERFORM ROOM-DESC <FIND-VERB "LOOK">>>
<DEFINE CPNEXT (RM OBJ "AUX" M)
#DECL ((RM) FIX (OBJ) OBJECT (M) <VECTOR OBJECT FIX>)
<AND <SET M <MEMQ .OBJ ,CPWALLS>> <+ .RM <2 .M>>>>
<DEFINE CP-ROOM ()
<COND (<VERB? "GO-IN">
<SETG CPHERE
<COND (<==? ,FROMDIR <FIND-DIR "DOWN">> 10)
(52)>>)
(<VERB? "LOOK">
<COND (,CPPUSH!-FLAG <CPWHERE>)
(<TELL
"You are in a small square room bounded to the north and west with
marble walls and to the east and south with sandstone walls."
1
<COND (<TRNN <FIND-OBJ "WARNI"> ,TOUCHBIT>
" It
appears the thief was correct.")
("")>>)>)>>
<DEFINE CPWHERE ("EXTRA" (HERE ,CPHERE) (UVEC ,CPUVEC)
(N <NTH .UVEC <+ .HERE -8>>)
(S <NTH .UVEC <+ .HERE 8>>) (E <NTH .UVEC <+ .HERE 1>>)
(W <NTH .UVEC <+ .HERE -1>>))
#DECL ((HERE N S E W) FIX (UVEC) <UVECTOR [REST FIX]>)
<TELL " |" ,NO-CRLF> ;"Top Row"
<CP-CORNER <+ .HERE -9> .N .W>
<TELL " " ,NO-CRLF>
<CP-ORTHO .N>
<TELL " " ,NO-CRLF>
<CP-CORNER <+ .HERE -7> .N .E>
<TELL "|">
<TELL "West |" ,NO-CRLF> ;"Middle Row"
<CP-ORTHO .W>
<TELL " .. " ,NO-CRLF>
<CP-ORTHO .E>
<TELL "| East
|" ,NO-CRLF> ;"Bottom Row"
<CP-CORNER <+ .HERE 7> .S .W>
<TELL " " ,NO-CRLF>
<CP-ORTHO .S>
<TELL " " ,NO-CRLF>
<CP-CORNER <+ .HERE 9> .S .E>
<TELL "|">
<COND (<==? .HERE 10>
<TELL "In the ceiling above you is a large circular opening.">)
(<==? .HERE 37>
<TELL "The center of the floor here is noticeably depressed.">)
(<==? .HERE 52>
<TELL
"The west wall here has a large " 1 <COND (,CPOUT!-FLAG "opening")
("steel door")> " at its center. On one
side of the door is a small slit.">)>
<COND (<==? .E -2>
<TELL "There is a ladder here, firmly attached to the east wall.">)>
<COND (<==? .W -3>
<TELL "There is a ladder here, firmly attached to the west wall.">)>>
;"Show where the eight nearest neighbors are located"
<DEFINE CP-ORTHO (CONTENTS)
#DECL ((CONTENTS) FIX)
<TELL <COND (<0? .CONTENTS> " ") (<1? .CONTENTS> "MM") (ELSE "SS")>
,NO-CRLF>>
;"Show an orthogonal neighbor"
<DEFINE CP-CORNER (LOCN COL ROW)
#DECL ((LOCN COL ROW) FIX)
<TELL <COND (<AND <N==? .COL 0> <N==? .ROW 0>> "??")
(<0? <SET COL <NTH ,CPUVEC .LOCN>>> " ")
(<1? .COL> "MM")
(ELSE "SS")>
,NO-CRLF>>
<SETG CPOUT!-FLAG <>>
<DEFINE CPSLT-OBJECT ()
<COND (<VERB? "PUT">
<REMOVE-OBJECT <PRSO>>
<COND (<==? <PRSO> <SFIND-OBJ "GCARD">>
<SETG CPOUT!-FLAG T>
<TELL ,CONFISCATE>)
(<TRNN <PRSO> <+ ,VICBIT ,VILLAIN>>
<TELL <PICK-ONE ,YUKS>>)
(<TELL ,GIGO
1
<ODESC2 <PRSO>>
" (now atomized) through the slot.">)>)>>
<DEFINE CPOUT-ROOM ()
<COND (<VERB? "LOOK">
<TELL "You are in a room with an exit to the north and a "
1
<COND (,CPOUT!-FLAG
"passage")
("metal door")>
" to the east.">)>>
; "RANDOM"
<DEFINE SMELLER ()
<TELL "It smells like a " 1 <ODESC2 <PRSO>> ".">>
; "PALANTIRS, ETC."
<DEFINE PRM-ROOM ("AUX" RES)
#DECL ((RES) <OR ATOM FALSE>)
<SET RES
<COND (<VERB? "LOOK">
<TELL
"This is a tiny room, which has an exit to the east.">
<PDOOR "north" <SFIND-OBJ "PLID1"> <SFIND-OBJ "PKH1">>)>>
<PCHECK>
.RES>
<SETG PALAN-SOLVE!-FLAG <>>
<SETG SLIDE-SOLVE!-FLAG <>>
<DEFINE PALANTIR-ROOM ("AUX" RES)
#DECL ((RES) <OR ATOM FALSE>)
<SET RES
<COND (<VERB? "LOOK">
<TELL ,PAL-ROOM>
<PDOOR "south" <SFIND-OBJ "PLID2"> <SFIND-OBJ "PKH2">>)
(<VERB? "GO-IN">
<SETG PALAN-SOLVE!-FLAG T>)>>
<PCHECK>
.RES>
<DEFINE PCHECK ("AUX" (LID <PLID>) (MAT <SFIND-OBJ "MAT">) (OBJS ,PALOBJS))
#DECL ((LID MAT) OBJECT (OBJS) <UVECTOR [REST OBJECT]>)
<PROG ()
<OR <2 ,PRSVEC> <RETURN>>
<SETG PLOOK!-FLAG <>>
<COND (<AND <VERB? "TAKE">
<MEMQ <PRSO> .OBJS>
<TRNN .LID ,OPENBIT>>
<COND (,PTOUCH!-FLAG
<TELL "The lid falls to cover the keyhole.">
<TRZ .LID ,OPENBIT>)
(<SETG PTOUCH!-FLAG T>)>)>
<MAPF <>
<FUNCTION (OBJ)
#DECL ((OBJ) OBJECT)
<COND (<OR <MEMQ .OBJ <OCONTENTS <SFIND-OBJ "PKH1">>>
<MEMQ .OBJ <OCONTENTS <SFIND-OBJ "PKH2">>>>
<TRO .OBJ ,NDESCBIT>)
(<TRZ .OBJ ,NDESCBIT>)>>
.OBJS>
<COND (<OR <NOT <OROOM .MAT>>
<OCAN .MAT>>
<SETG MUD!-FLAG <>>)>
<COND (,MUD!-FLAG
<REMOVE-OBJECT .MAT>
<INSERT-OBJECT .MAT ,HERE>
<TRO .MAT ,NDESCBIT>)
(<TRZ .MAT ,NDESCBIT>)>>>
<DEFINE PDOOR PACT (STR LID KEYHOLE "AUX" (MATOBJ ,MATOBJ))
#DECL ((STR) STRING (LID KEYHOLE) OBJECT (PACT) ACTIVATION
(MATOBJ) <OR FALSE OBJECT>)
<AND ,PLOOK!-FLAG <RETURN <SETG PLOOK!-FLAG <>> .PACT>>
<TELL "On the "
1
.STR
,PAL-DOOR>
<COND (<NOT <TRNN .LID ,OPENBIT>>
<TELL "covered by a thin metal lid " 0>)>
<TELL "lies within the lock.">
<COND (<NOT <EMPTY? <OCONTENTS .KEYHOLE>>>
<TELL "A "
1
<ODESC2 <1 <OCONTENTS .KEYHOLE>>>
" is in place within the keyhole.">)>
<COND (,MUD!-FLAG
<TELL "The edge of a welcome mat is visible under the door.">
<COND (.MATOBJ
<TELL "Lying on the mat is a " 1 <ODESC2 .MATOBJ> ".">)>)>>
<DEFINE PLID ("OPTIONAL" (OBJ1 <SFIND-OBJ "PLID1">) (OBJ2 <SFIND-OBJ "PLID2">))
#DECL ((OBJ1 OBJ2) OBJECT)
<COND (<MEMQ .OBJ1 <ROBJS ,HERE>>
.OBJ1)