-
Notifications
You must be signed in to change notification settings - Fork 27
/
verbs.zil
5372 lines (4919 loc) · 119 KB
/
verbs.zil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"VERBS for BEYOND ZORK:
Copyright (C)1987 Infocom, Inc. All Rights Reserved."
<ROUTINE GOTO (WHERE "AUX" (CR 0) WHO X L OLIT)
<SET OLIT ,LIT?>
<SET WHO ,WINNER>
<SET L <LOC ,WINNER>>
<COND (<AND <EQUAL? .L ,SADDLE>
<IN? .L ,DACT>>
<SET WHO ,DACT>)
(<AND <NOT <EQUAL? .L ,HERE>>
<IS? .L ,VEHICLE>>
<COND (<EQUAL? <PERFORM ,V?EXIT .L> ,M-FATAL>
<SETG P-WALK-DIR <>>
<RTRUE>)>
<SETG P-WALK-DIR <>>
<SETG OLD-HERE <>>
<INC CR>)>
<SET X <APPLY <GETP ,HERE ,P?ACTION> ,M-EXIT>>
<COND (<EQUAL? .X ,M-FATAL>
<SETG P-WALK-DIR <>>
<RTRUE>)
(<T? .X>
<COND (<T? .CR>
<TELL ,TAB>)>
<INC CR>)>
; <COND (<EQUAL? .WHERE ,APLANE ,DEATH>)
(<T? ,EXIT-LINE>
<COND (<T? .CR>
<TELL ,TAB>)>
<TELL ,EXIT-LINE CR>
<INC CR>)>
; <SETG EXIT-LINE <>>
<COND (<AND <EQUAL? .WHO ,WINNER>
<IN? ,DACT ,HERE>
<IS? ,DACT ,LIVING>
<NOT <IS? ,DACT ,MUNGED>>
<NOT <IS? ,DACT ,SLEEPING>>>
<REMOVE ,DACT>
<COND (<NOT <EQUAL? .WHERE ,APLANE ,DEATH>>
<COND (<T? .CR>
<TELL ,TAB>)>
<INC CR>
<TELL
"A shadow passes over " 'HEAD " as you leave." CR>)>)>
<COND (<AND <T? .CR>
<T? ,VERBOSITY>>
<CRLF>)>
<SETG HERE .WHERE>
<MOVE .WHO .WHERE>
<SETG LIT? <IS-LIT?>>
<COND (<AND <ZERO? .OLIT>
<ZERO? ,LIT?>>
<COND (<T? .CR>
<TELL ,TAB>)>
<TELL ,CYOU <PICK-NEXT ,DARK-WALKS>>
<COND (<GRUE-ROOM?>)
(<PROB 50>
<TELL
", straight into the jaws of a deadly presence lurking in the darkness">
<JIGS-UP>
<RTRUE>)>
<PRINT ,PERIOD>
<COND (<T? ,VERBOSITY>
<CRLF>)>)>
<APPLY <GETP ,HERE ,P?ACTION> ,M-ENTERING>
<COND (<NOT <EQUAL? ,HERE .WHERE>>
<RTRUE>)>
<COND (<ZERO? ,LIT?>
<MARK-DIR>)>
<SETG LAST-PSEUDO-LOC <>>
<MAKE ,PSEUDO-OBJECT ,NOARTICLE>
<UNMAKE ,PSEUDO-OBJECT ,VOWEL>
<UNMAKE ,PSEUDO-OBJECT ,TRYTAKE>
<SETG LAST-MONSTER <>>
<SETG LAST-MONSTER-DIR <>>
<SETG P-IT-OBJECT ,NOT-HERE-OBJECT>
<SETG P-THEM-OBJECT ,NOT-HERE-OBJECT>
<SETG P-HIM-OBJECT ,NOT-HERE-OBJECT>
<SETG P-HER-OBJECT ,NOT-HERE-OBJECT>
<V-LOOK <>>
<APPLY <GETP ,HERE ,P?ACTION> ,M-ENTERED>
<RTRUE>>
<ROUTINE MARK-DIR ("OPT" (DIR ,P-WALK-DIR) "AUX" TBL WRD TYPE LEN)
<COND (<L? .DIR ,P?DOWN>
<RFALSE>)>
<SET TBL <GETP ,HERE <GETB ,XPDIR-LIST <- 0 <- .DIR ,P?NORTH>>>>>
<COND (<ZERO? .TBL>
<RFALSE>)>
<SET WRD <GET .TBL ,XTYPE>>
<COND (<BTST .WRD ,MARKBIT>
<RTRUE>)>
<SET TYPE <MSB .WRD>>
<SET LEN <BAND .WRD 127>>
<COND (<OR <EQUAL? .TYPE ,CONNECT ,SCONNECT ,X-EXIT>
<AND <EQUAL? .TYPE ,FCONNECT>
<T? .LEN>>
<AND <EQUAL? .TYPE ,DCONNECT>
<IS? <GET .TBL ,XDATA> ,OPENED>>>
<PUT .TBL ,XTYPE <+ .WRD ,MARKBIT>>
<RTRUE>)>
<RFALSE>>
<ROUTINE DO-WALK (DIR1 "OPT" (DIR2 <>) (DIR3 <>) "AUX" X)
<SETG P-WALK-DIR .DIR1>
<SET X <PERFORM ,V?WALK .DIR1>>
<COND (<EQUAL? .X ,M-FATAL>
<RFATAL>)
(<T? .DIR2>
<CRLF>
<SETG P-WALK-DIR .DIR2>
<SET X <PERFORM ,V?WALK .DIR2>>
<COND (<EQUAL? .X ,M-FATAL>
<RFATAL>)
(<T? .DIR3>
<CRLF>
<SETG P-WALK-DIR .DIR3>
<SET X <PERFORM ,V?WALK .DIR3>>)>)>
<RETURN .X>>
<ROUTINE V-WALK ("AUX" TBL TYPE DATA)
<COND (<ZERO? ,P-WALK-DIR>
<COND (<T? ,PRSO>
<PRINT "[Presumably, you mean ">
<TELL "WALK TO " THEO>
<PRINTC %<ASCII !\.>>
<PRINT ,BRACKET>
<PERFORM ,V?WALK-TO ,PRSO>
<RTRUE>)>
<V-WALK-AROUND>
<RTRUE>)
(<AND <IN? ,PLAYER ,SADDLE>
<IN? ,SADDLE ,DACT>>
<RETURN <NEXT-SKY>>)
(<HERE? APLANE>
<RETURN <NEXT-APLANE>>)>
<SET TBL <GETP ,HERE ,PRSO>>
<COND (<ZERO? .TBL>
<NO-EXIT-THAT-WAY>
<RFATAL>)>
<SET TYPE <MSB <GET .TBL ,XTYPE>>>
<COND (<EQUAL? .TYPE ,NO-EXIT ,SHADOW-EXIT>
<NO-EXIT-THAT-WAY>
<RFATAL>)>
<COND (<AND <NOT <EQUAL? ,LAST-MONSTER <> ,DORN ,MAMA>>
<IN? ,LAST-MONSTER ,HERE>
<IN? ,WINNER ,HERE>
<IS? ,LAST-MONSTER ,LIVING>
<NOT <IS? ,LAST-MONSTER ,SLEEPING>>
<EQUAL? ,LAST-MONSTER-DIR ,P-WALK-DIR>
<T? ,LIT?>>
<TELL CTHE ,LAST-MONSTER " block">
<COND (<OR <ZERO? ,LIT?>
<NOT <IS? ,LAST-MONSTER ,PLURAL>>>
<TELL "s">)>
<TELL " your path!" CR>
<RTRUE>)>
<SET DATA <GET .TBL ,XROOM>>
<COND (<EQUAL? .TYPE ,CONNECT ,X-EXIT>
<GOTO .DATA>
<RTRUE>)
(<EQUAL? .TYPE ,SORRY-EXIT>
<TELL .DATA CR>
<RFATAL>)
; (<EQUAL? .TYPE ,FSORRY-EXIT>
<SET TYPE <GET .TBL ,XDATA>>
<COND (<ZERO? .TYPE>
<SET DATA <APPLY .DATA>>
<RFATAL>)>
<SET DATA <APPLY .DATA .TYPE>>
<RFATAL>)
(<EQUAL? .TYPE ,SCONNECT>
<TELL <GET .TBL ,XDATA> CR>
<COND (<T? ,VERBOSITY>
<CRLF>)>
<GOTO .DATA>
<RTRUE>)
(<EQUAL? .TYPE ,FCONNECT>
<SET DATA <APPLY .DATA>>
<COND (<T? .DATA>
<GOTO .DATA>
<RTRUE>)>
<RFATAL>)
(<EQUAL? .TYPE ,DCONNECT>
<SET TYPE <GET .TBL ,XDATA>>
<COND (<IS? .TYPE ,OPENED>
<GOTO .DATA>
<RTRUE>)>
<ITS-CLOSED .TYPE>
<RFATAL>)>
; <SAY-ERROR "V-WALK">
<RFATAL>>
<ROUTINE NO-EXIT-THAT-WAY ("AUX" STR)
<SET STR <GETP ,HERE ,P?EXIT-STR>>
<COND (<EQUAL? ,P-WALK-DIR <> ,P?UP ,P?DOWN>)
(<EQUAL? ,P-WALK-DIR ,P?IN ,P?OUT>)
(<T? .STR>
<TELL .STR CR>
<RTRUE>)>
<TELL "There's no exit that way." CR>
<RTRUE>>
<ROUTINE NEXT-OVER ("AUX" (CNT 0) DIR BITS TBL XTBL TYPE DATA)
<SET XTBL <GET ,FLY-TABLES ,ABOVE>>
<SET BITS <GETB .XTBL 0>>
<SET DIR ,I-NORTH>
<REPEAT ()
<SET TBL <GETP ,HERE <GETB ,PDIR-LIST .DIR>>>
<SET DATA 0>
<COND (<BTST .BITS <GETB ,DBIT-LIST .DIR>>
<SET TYPE %<+ ,CONNECT 9 ,MARKBIT>>
<INC CNT>
<SET DATA <GETB .XTBL .CNT>>
<COND (<AND <HERE? IN-SKY>
<EQUAL? .DATA ,OPLAIN>>
<SET TYPE %<+ ,FCONNECT 9 ,MARKBIT>>)
(<AND <HERE? APLANE>
<EQUAL? .DATA ,OCAVES>>
<SET TYPE ,NO-EXIT>
<SET DATA 0>)>)
(<HERE? IN-SKY>
<SET TYPE %<+ ,FCONNECT 9 ,MARKBIT>>)
(T
<SET TYPE ,NO-EXIT>)>
<PUT .TBL ,XTYPE .TYPE>
<PUT .TBL ,XDATA .DATA>
<COND (<IGRTR? DIR ,I-NW>
<RFALSE>)>>>
<ROUTINE NEXT-SKY ("AUX" DIR IDIR D1 D2 D3 TBL DATA X)
<COND (<OR <T? ,DACT-SLEEP>
<IS? ,DACT ,SLEEPING>
<IS? ,DACT ,MUNGED>
<NOT <IS? ,DACT ,LIVING>>>
<TELL CTHE ,DACT " is in no condition to move around." CR>
<RFATAL>)>
<SET DIR ,P-WALK-DIR>
<SETG P-WALK-DIR <>>
<COND (<EQUAL? .DIR ,P?UP>
<COND (<HERE? IN-SKY>
<TELL CTHE ,DACT
" puffs and strains, but cannot lift you any higher." CR>
<RFATAL>)>
<SET X <GETP ,HERE ,P?FNUM>>
<COND (<ZERO? .X>
<TELL ,CANT "fly here." CR>
<RFATAL>)>
<TELL CTHE ,DACT>
<COND (<AND <HERE? IN-GARDEN>
<T? ,PTIMER>>
<TELL " cocks his head, hesitating." CR>
<RTRUE>)>
<TELL " spreads his leathery wings and ">
<COND (<AND <IN? ,PARASOL ,PLAYER>
<IS? ,PARASOL ,OPENED>>
<TELL "tries to take off. But your open " 'PARASOL
" seems to be dragging him down." CR>
<RTRUE>)>
<SETG ABOVE .X>
<PUTP ,IN-SKY ,P?FNUM ,ABOVE>
<TELL "rises into the sky." CR>
<COND (<T? ,VERBOSITY>
<CRLF>)>
<GOTO ,IN-SKY>
<CHECK-BREEZE>
<RTRUE>)
(<EQUAL? .DIR ,P?DOWN>
<COND (<NOT <HERE? IN-SKY>>
<TELL CTHE ,DACT " is already on " THE ,GROUND
,PERIOD>
<RFATAL>)>
<SET X <DOWN-TO?>>
<COND (<ZERO? .X>
<COND (<EQUAL? ,ABOVE ,OTHRIFF>
<TELL CTHE ,DACT
" tries his best to land, but " THE ,GROUND
" below is completely choked with " 'XTREES ,PERIOD>)>
<RFATAL>)>
<TELL CTHE ,DACT " glides earthward." CR>
<COND (<T? ,VERBOSITY>
<CRLF>)>
<GOTO .X>
<RTRUE>)
(<EQUAL? .DIR <> ,P?IN ,P?OUT>
<PUZZLED-DACT>
<RFATAL>)
(<NOT <HERE? IN-SKY>>
<SETG P-WALK-DIR <>>
<TELL "It's hard enough for a " 'DACT
" to walk, even when there's not an adventurer riding his back." CR>
<RFATAL>)>
<SET TBL <GETP ,HERE .DIR>>
<SET DATA <GET .TBL ,XDATA>>
<COND (<EQUAL? <GET .TBL ,XTYPE> %<+ ,FCONNECT 9 ,MARKBIT>>
<TELL "The sky is filled with impenetrable ">
<COND (<EQUAL? .DATA ,OPLAIN>
<TELL "funnel ">)>
<TELL "clouds in that " 'INTDIR ,PERIOD>
<RFATAL>)>
; "D1-D3 are IDIRs favored by the wind."
<SET D1 <+ ,WINDIR 4>>
<COND (<G? .D1 ,I-NW>
<SET D1 <- .D1 8>>)>
<SET D2 <+ .D1 1>>
<COND (<G? .D2 ,I-NW>
<SET D2 ,I-NORTH>)>
<SET D3 <- .D1 1>>
<COND (<L? .D3 ,I-NORTH>
<SET D3 ,I-NW>)>
<SET IDIR <- 0 <- .DIR ,P?NORTH>>>
<COND (<EQUAL? .IDIR .D1 .D2 .D3>
<UNMAKE ,BREEZE ,SEEN>
<TELL CTHE ,DACT>
<TELL " banks smoothly to the "
B <GET ,DIR-NAMES .IDIR> ,PERIOD>
<FLYOVER .DATA>
<RTRUE>)>
; "Check for crosswinds."
<MAKE ,BREEZE ,SEEN>
<SET D1 <- ,WINDIR 2>>
<COND (<L? .D1 ,I-NORTH>
<SET D1 <+ .D1 8>>)>
<COND (<EQUAL? .IDIR .D1>
<SET D2 <- ,WINDIR 3>>
<COND (<L? .D2 ,I-NORTH>
<SET D2 <+ .D2 8>>)>
<RETURN <DO-CROSSWIND .IDIR .D2>>)>
<SET D1 <+ ,WINDIR 2>>
<COND (<G? .D1 ,I-NW>
<SET D1 <- .D1 8>>)>
<COND (<EQUAL? .IDIR .D1>
<SET D2 <+ ,WINDIR 3>>
<COND (<G? .D2 ,I-NW>
<SET D2 <- .D2 8>>)>
<RETURN <DO-CROSSWIND .IDIR .D2>>)>
<TELL CTHE ,DACT
" does his best to fly into the wind, but fails." CR>
<RFATAL>>
<ROUTINE DO-CROSSWIND (IDIR D2 "AUX" TBL DATA)
<SET TBL <GETP ,IN-SKY <GETB ,PDIR-LIST .D2>>>
<SET DATA <GET .TBL ,XDATA>>
<COND (<OR <EQUAL? .DATA 0 ,OPLAIN ,OCAVES>
<EQUAL? <GET .TBL ,XTYPE> %<+ ,FCONNECT 9 ,MARKBIT>>
<PROB 50>>
<TELL
"A strong crosswind prevents " THE ,DACT " from flying that way." CR>
<RFATAL>)>
<TELL CTHE ,DACT>
<TELL " banks to the " B <GET ,DIR-NAMES .IDIR>
", but a strong crosswind blows him off course." CR>
<FLYOVER .DATA>
<RTRUE>>
<ROUTINE FLYOVER (DATA)
<SETG ABOVE .DATA>
<PUTP ,IN-SKY ,P?FNUM ,ABOVE>
<NEXT-OVER>
<RELOOK T>
<CHECK-BREEZE>
<RTRUE>>
<ROUTINE CHECK-BREEZE ()
<COND (<OR <AND <EQUAL? ,ABOVE ,OTHRIFF>
<EQUAL? ,WINDIR ,I-EAST ,I-SE ,I-SOUTH>>
<AND <EQUAL? ,ABOVE ,OXROADS>
<EQUAL? ,WINDIR ,I-NORTH ,I-NE ,I-EAST>>>
<SETG WINDIR <NEXT-WINDIR?>>
<MAKE ,BREEZE ,SEEN>
<TELL ,TAB <PICK-NEXT ,WIND-ALERTS> ,PERIOD>)>
<RFALSE>>
<ROUTINE NEXT-APLANE ("AUX" DIR TBL DATA NEW X)
<SET DIR ,P-WALK-DIR>
<SETG P-WALK-DIR <>>
<SET X <LOC ,PLAYER>>
<COND (<OR <EQUAL? .DIR ,P?UP ,P?DOWN>
<EQUAL? .DIR ,P?IN ,P?OUT>>
<TELL "Such " 'INTDIR "s have no meaning here." CR>
<RFATAL>)
(<EQUAL? .X ,APLANE>)
(<IS? .X ,VEHICLE>
<COND (<EQUAL? <PERFORM ,V?EXIT .X> ,M-FATAL>
<RFATAL>)>
<TELL ,TAB>)>
<SET TBL <GETP ,HERE .DIR>>
<SET DATA <GET .TBL ,XTYPE>>
<COND (<EQUAL? .DATA ,NO-EXIT>
<TELL "The local geometry does not extend in that "
'INTDIR ,PERIOD>
<RFATAL>)
(<EQUAL? ,ABOVE ,OPLAIN>
<COND (<T? ,IMPSAY>
<PERMISSION>
<RFATAL>)>
<EXIT-IMPS>)>
<SET NEW <GET .TBL ,XDATA>>
<COND (<EQUAL? .NEW ,OPLAIN>
<COND (<IS? ,SHAPE ,LIVING>
<COND (<NOT <IN? ,SHAPE ,APLANE>>
<WINDOW ,SHOWING-ROOM>
<MOVE ,SHAPE ,APLANE>
<SETG LAST-MONSTER ,SHAPE>
<SETG LAST-MONSTER-DIR <>>
<SETG P-IT-OBJECT ,SHAPE>
<TELL
"The space before you flexes in on itself, twists sideways and reopens into "
A ,SHAPE ", stretched across your path like the skin of a drum." CR>
<RFATAL>)>
<TELL CTHE ,SHAPE
" stretches itself tighter across your path." CR>
<RFATAL>)
(<ZERO? ,IMPSAY>
<KERBLAM>
<TELL "A bolt of " B ,W?LIGHTNING
" blocks your path." CR>
<RFATAL>)>)>
<COND (<EQUAL? ,ABOVE ,OACCARDI ,OCITY ,OMIZNIA>
<REMOVE ,CURTAIN>)>
<COND (<IN? ,SHAPE ,APLANE>
<REMOVE ,SHAPE>
<SETG LAST-MONSTER <>>
<SETG P-IT-OBJECT ,NOT-HERE-OBJECT>
<TELL CTHE ,SHAPE " disincorporates as you retreat." CR>
<COND (<T? ,VERBOSITY>
<CRLF>)>)>
<SETG ABOVE .NEW>
<GET-APLANE-THINGS>
<NEXT-OVER>
<V-LOOK>
<RTRUE>>
<ROUTINE PERMISSION ()
<TELL
"\"We didn't say you could leave yet,\" notes an Implementor dryly." CR>
<RTRUE>>
<ROUTINE EXIT-IMPS ()
<REMOVE ,IMPTAB>
<REMOVE ,IMPS>
<DEQUEUE ,I-IMPS>
<RFALSE>>
<ROUTINE GET-APLANE-THINGS ()
<COND (<EQUAL? ,ABOVE ,OCITY ,OMIZNIA ,OACCARDI>
<COND (<NOT <IN? ,CURTAIN ,APLANE>>
<MOVE ,CURTAIN ,APLANE>
<UNMAKE ,CURTAIN ,NODESC>)>
<RTRUE>)
(<AND <EQUAL? ,ABOVE ,OPLAIN>
<NOT <IN? ,IMPS ,APLANE>>>
<MOVE ,IMPTAB ,APLANE>
<MOVE ,IMPS ,APLANE>
<QUEUE ,I-IMPS>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE ANY-TOUCHED? (TBL "OPT" EXCLUDED "AUX" LEN RM CNT)
<SET LEN <GETB .TBL 0>>
<SET CNT 1>
<REPEAT ()
<SET RM <GETB .TBL .LEN>>
<COND (<AND <IS? .RM ,TOUCHED>
<OR <NOT <ASSIGNED? EXCLUDED>>
<NOT <IS? .RM .EXCLUDED>>>>
<INC CNT>
<PUT ,AUX-TABLE .CNT .RM>)>
<COND (<DLESS? LEN 1>
<RETURN>)>>
<COND (<EQUAL? .CNT 1>
<RFALSE>)
(<EQUAL? .CNT 2>
<RETURN <GET ,AUX-TABLE 2>>)>
<PUT ,AUX-TABLE 0 .CNT>
<PUT ,AUX-TABLE 1 0>
<RETURN <PICK-ONE ,AUX-TABLE>>>
<ROUTINE DOWN-TO? ("AUX" (RM 0) X)
<COND (<EQUAL? ,ABOVE ,ORUINS>
<SET RM <ANY-TOUCHED? ,RUIN-ROOMS>>
<COND (<AND <ZERO? .RM>
<SETUP-RUINS?>>
<SET RM <RANDOM-ROOM? ,RUIN-ROOMS>>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OBRIDGE>
<SETG BRIDGE-DIR 0>
<SETG ZTOP 1>
<SETG ZBOT 2>
<RETURN ,ON-BRIDGE>)
(<EQUAL? ,ABOVE ,OFOREST>
<SET RM <ANY-TOUCHED? ,FOREST-ROOMS>>
<COND (<AND <ZERO? .RM>
<SETUP-FOREST?>>
<SET RM <RANDOM-ROOM? ,FOREST-ROOMS>>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OACCARDI>
<SET RM ,IN-ACCARDI>
<COND (<AND <IS? ,AT-GATE ,TOUCHED>
<PROB 50>>
<SET RM ,AT-GATE>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OCITY>
<SET RM ,IN-GURTH>
<COND (<IS? ,AT-MAGICK ,TOUCHED>
<SET RM ,AT-MAGICK>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OSHORE>
<SET RM <ANY-TOUCHED? ,SHORE-ROOMS>>
<COND (<ZERO? .RM>
<SET RM ,AT-LEDGE>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OXROADS>
<RETURN ,XROADS>)
(<EQUAL? ,ABOVE ,OPLAIN>
<RFALSE>)
(<EQUAL? ,ABOVE ,OGRUBBO>
<RETURN ,HILLTOP>)
(<EQUAL? ,ABOVE ,OCAVES>
<RETURN ,IN-GARDEN>)
(<EQUAL? ,ABOVE ,OMOOR>
<SET RM <ANY-TOUCHED? ,MOOR-ROOMS>>
<COND (<AND <ZERO? .RM>
<SETUP-MOOR?>>
<SET RM <RANDOM-ROOM? ,MOOR-ROOMS>>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OJUNGLE>
<SET RM <ANY-TOUCHED? ,JUNGLE-ROOMS>>
<COND (<AND <ZERO? .RM>
<SETUP-JUNGLE?>>
<SET RM <RANDOM-ROOM? ,JUNGLE-ROOMS>>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OMIZNIA>
<SET RM <ANY-TOUCHED? ,MIZNIA-ROOMS>>
<COND (<ZERO? .RM>
<SET RM ,IN-PORT>)>
<RETURN .RM>)
(<EQUAL? ,ABOVE ,OTHRIFF>
<SET RM ,IN-THRIFF>
<COND (<IS? ,IN-THRIFF ,MUNGED>
<SET RM ,IN-PASTURE>)>
<RETURN .RM>)
(T
; <SAY-ERROR "DOWN-TO?">
<RFALSE>)>>
<ROUTINE RANDOM-ROOM? (TBL "AUX" OHERE RM X)
<SET RM <GETB .TBL <RANDOM <GETB .TBL 0>>>>
<COND (<NOT <IS? .RM ,TOUCHED>>
<SET OHERE ,HERE>
<SETG HERE .RM>
<SET X <APPLY <GETP .RM ,P?ACTION> ,M-ENTERING>>
<SETG HERE .OHERE>
<MAKE .RM ,TOUCHED>)>
<RETURN .RM>>
<ROUTINE PRE-TAKE ("AUX" L LL WHO X X2)
<SET L <LOC ,PRSO>>
<COND (<T? .L>
<SET LL <LOC .L>>)>
<COND (<AND <ZERO? ,LIT?>
<NOT <EQUAL? ,WINNER .L .LL>>>
<TOO-DARK>
<RTRUE>)
(<EQUAL? .L ,GLOBAL-OBJECTS>
<IMPOSSIBLE>
<RTRUE>)
(<EQUAL? .L ,WINNER>
<THIS-IS-IT ,PRSO>
<TELL ,ALREADY>
<COND (<IS? ,PRSO ,WORN>
<TELL B ,W?WEAR>)
(T
<TELL B ,W?HOLD>)>
<TELL "ing " THEO ,PERIOD>
<RTRUE>)
(<AND <NOT <EQUAL? .L <> ,BROG>>
<IS? .L ,CONTAINER>
<IS? .L ,TRANSPARENT>
<NOT <IS? .L ,OPENED>>>
<CANT-REACH-INTO .L>
<RTRUE>)
(<AND <NOT <EQUAL? .LL <> ,BROG>>
<IS? .LL ,CONTAINER>
<IS? .LL ,TRANSPARENT>
<NOT <IS? .LL ,OPENED>>>
<CANT-REACH-INTO .LL>
<RTRUE>)
(<T? ,PRSI>
<COND (<PRSO? PRSI>
<SET X <GET ,P-NAMW 0>>
<SET X2 <GET ,P-ADJW 0>>
<COND (<OR <EQUAL? .X <GET ,P-NAMW 1>>
<EQUAL? .X2 <GET ,P-ADJW 1>>>
<IMPOSSIBLE>
<RTRUE>)>)
(<PRSI? ME>
<COND (<EQUAL? ,WINNER ,PLAYER>
<NOBODY-TO-ASK>
<RTRUE>)
(<NOT <EQUAL? .L ,WINNER>>
<TELL CTHE ,WINNER " doesn't have "
THEO ,PERIOD>
<RTRUE>)
(T
<RFALSE>)>)
(<NOT <EQUAL? .L ,PRSI>>
<COND (<AND <EQUAL? .L ,ON-MCASE ,ON-WCASE ,ON-BCASE>
<PRSI? MCASE WCASE BCASE>>
<RFALSE>)>
<TELL CTHEO>
<ISNT-ARENT>
<ON-IN ,PRSI>
<TELL ,PERIOD>
<RTRUE>)>
<RFALSE>)
(<EQUAL? ,PRSO <LOC ,WINNER>>
<COND (<PRSO? BUSH POOL>
<RFALSE>)>
<TELL "Difficult. You're">
<ON-IN>
<TELL ,PERIOD>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE CANT-REACH-INTO (L)
<TELL ,CANT "reach into " THE .L ". It's closed." CR>
<RTRUE>>
<ROUTINE V-TAKE ("AUX" L)
<SET L <ITAKE>>
<COND (<ZERO? .L>
<RTRUE>)
(<SPARK? <>>
<TELL ,TAB>)>
<COND (<OR <T? ,P-MULT?>
<EQUAL? .L ,UNDERUG ,UNDERPEW ,LAMPHOUSE>
<AND <T? ,STATIC>
<IS? ,PRSO ,FERRIC>>>
<TAKEN>
<RTRUE>)
(<OR <IS? .L ,CONTAINER>
<IS? .L ,SURFACE>
<IS? .L ,PERSON>
<IS? .L ,LIVING>>
<TELL "You take " THEO>
<OUT-OF-LOC .L>
<TELL ,PERIOD>
<RTRUE>)
(<PROB 50>
<TAKEN>
<RTRUE>)>
<TELL ,CYOU>
<COND (<EQUAL? ,P-PRSA-WORD ,W?GRAB ,W?SEIZE ,W?SNATCH>
<TELL B ,P-PRSA-WORD>)
(<PROB 50>
<TELL "pick up">)
(T
<TELL B ,W?TAKE>)>
<TELL C ,SP THEO ,PERIOD>
<RTRUE>>
<ROUTINE TAKEN ()
<TELL "Taken." CR>
<RTRUE>>
<ROUTINE FIRST-TAKE? ()
<COND (<AND <VERB? TAKE>
<NOT <IS? ,PRSO ,TOUCHED>>>
<COND (<ITAKE>
<PUTP ,PRSO ,P?DESCFCN 0>
<TAKEN>)>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE ITAKE ("OPT" (VB T) "AUX" (CNT 0) OBJ L X MAX)
<COND (<OR <ZERO? ,PRSO>
<NOT <SET L <LOC ,PRSO>>>>
<CANT-SEE-ANY>
<RFALSE>)>
<THIS-IS-IT ,PRSO>
<COND (<NOT <IS? ,PRSO ,TAKEABLE>>
<COND (<T? .VB>
<IMPOSSIBLE>)>
<RFALSE>)
(<AND <IS? .L ,CONTAINER>
<IS? .L ,OPENABLE>
<NOT <IS? .L ,OPENED>>
<NOT <EQUAL? .L <LOC ,WINNER>>>>
<COND (<T? .VB>
<YOUD-HAVE-TO "open" .L>)>
<RFALSE>)>
<COND (<AND <EQUAL? ,WINNER ,UNICORN>
<SET X <FIRST? ,WINNER>>>
<MOVE .X <LOC ,WINNER>>
<TELL "[putting down " THE .X " first" ,BRACKET>)
(<EQUAL? ,WINNER ,PLAYER>
<COND (<IN? ,ONION ,PLAYER>
<COND (<T? .VB>
<YOUD-HAVE-TO "put down" ,ONION>)>
<RFALSE>)>
<SET X <WEIGHT ,PRSO>>
<SET MAX <+ ,LOAD-ALLOWED </ <GET ,STATS ,STRENGTH> 10>>>
<COND (<AND <NOT <IN? .L ,WINNER>>
<G? <+ .X <WEIGHT ,WINNER>> .MAX>>
<COND (<T? .VB>
<COND (<SET X <FIRST? ,WINNER>>
<TELL "Your load is ">)
(T
<TELL CTHEO>
<IS-ARE>)>
<TELL "too heavy." CR>)>
<RFALSE>)>
<COND (<SET OBJ <FIRST? ,WINNER>>
<REPEAT ()
<COND (<IS? .OBJ ,NODESC>)
(<IS? .OBJ ,WORN>)
(<IS? .OBJ ,TAKEABLE>
<INC CNT>)>
<COND (<NOT <SET OBJ <NEXT? .OBJ>>>
<RETURN>)>>)>
<SET MAX <+ ,FUMBLE-NUMBER </ <GET ,STATS ,DEXTERITY> 10>>>
<COND (<G? .CNT .MAX>
<COND (<T? .VB>
<TELL "Your hands are full." CR>)>
<RFALSE>)>)>
<WINDOW ,SHOWING-ALL>
<MAKE ,PRSO ,TOUCHED>
<UNMAKE ,PRSO ,NODESC>
<UNMAKE ,PRSO ,NOALL>
<MOVE ,PRSO ,WINNER>
<RETURN .L>> "So that .L an be analyzed."
"Return total weight of objects in THING."
<ROUTINE WEIGHT (THING "AUX" (WT 0) OBJ)
<COND (<SET OBJ <FIRST? .THING>>
<REPEAT ()
<COND (<AND <EQUAL? .THING ,WINNER>
<IS? .OBJ ,WORN>>
<INC WT>)
(T
<SET WT <+ .WT <WEIGHT .OBJ>>>)>
<COND (<NOT <SET OBJ <NEXT? .OBJ>>>
<RETURN>)>>)>
<RETURN <+ .WT <GETP .THING ,P?SIZE>>>>
<ROUTINE V-WIELD ("AUX" OBJ)
<COND (<NOT <IS? ,PRSO ,TAKEABLE>>
<IMPOSSIBLE>
<RTRUE>)
(<NOT <IN? ,PRSO ,WINNER>>
<MUST-HOLD ,PRSO>
<TELL " before you can wield it." CR>
<RTRUE>)
(<IS? ,PRSO ,WORN>
<YOUD-HAVE-TO "take off" ,PRSO>
<RTRUE>)
(<IS? ,PRSO ,WIELDED>
<TELL ,ALREADY "wielding " THEO ,PERIOD>
<RTRUE>)>
<COND (<SET OBJ <FIRST? ,WINNER>>
<REPEAT ()
<COND (<IS? .OBJ ,WIELDED>
<UNMAKE .OBJ ,WIELDED>
<TELL "[setting aside " THE .OBJ " first" ,BRACKET>
<RETURN>)>
<COND (<NOT <SET OBJ <NEXT? .OBJ>>>
<RETURN>)>>)>
<WINDOW ,SHOWING-INV>
<MAKE ,PRSO ,WIELDED>
<TELL "You wield " THEO ,PERIOD>
<RTRUE>>
<ROUTINE V-UNWIELD ()
<COND (<NOT <IS? ,PRSO ,TAKEABLE>>
<IMPOSSIBLE>
<RTRUE>)
(<NOT <IS? ,PRSO ,WIELDED>>
<TELL "You're not wielding " THEO ,PERIOD>
<RTRUE>)>
<WINDOW ,SHOWING-INV>
<UNMAKE ,PRSO ,WIELDED>
<TELL "You set aside " THEO ,PERIOD>
<RTRUE>>
<ROUTINE SPARK? ("OPT" (INDENT T) (OBJ ,PRSO))
<COND (<NO-SPARK? .OBJ>
<RFALSE>)
(<T? .INDENT>
<TELL ,TAB>)>
<ITALICIZE "Snap">
<TELL "! You feel a ">
<COND (<G? ,STATIC 2>
<TELL "painful ">)>
<TELL "spark as you touch " THE .OBJ ,PERIOD>
<UPDATE-STAT <- 0 ,STATIC>>
<SPARK-OBJ .OBJ>
<RTRUE>>
<ROUTINE SPARK-TO? ("OPT" (OBJ1 ,PRSO) (OBJ2 ,PRSI))
<COND (<NO-SPARK? .OBJ2>
<RFALSE>)
(<EQUAL? .OBJ1 ,HANDS ,FEET ,ME>)
(<NOT <IS? .OBJ1 ,FERRIC>>
<RFALSE>)>
<SAY-SNAP>
<SAY-YOUR .OBJ1>
<TELL ,AND THE .OBJ2 "!" CR>
<COND (<NOT <IS? .OBJ1 ,FERRIC>>
<UPDATE-STAT <- 0 ,STATIC>>)>
<SPARK-OBJ .OBJ2>
<RTRUE>>
<ROUTINE SAY-SNAP ()
<ITALICIZE "Snap">
<TELL "! A ">
<COND (<G? ,STATIC 3>
<TELL "painful ">)>
<TELL "spark leaps between ">
<RFALSE>>
<ROUTINE NO-SPARK? (OBJ "AUX" L)
<COND (<ZERO? ,STATIC>
<RTRUE>)>
<SET L <LOC .OBJ>>
<COND (<EQUAL? .L <> ,LOCAL-GLOBALS ,GLOBAL-OBJECTS>
<RTRUE>)
(<EQUAL? ,PLAYER .L <LOC .L>>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE SPARK-OBJ (OBJ)
<COND (<NOT <IS? .OBJ ,LIVING>>)
(<EQUAL? .OBJ ,DUST>
<VANISH ,DUST>
<DEQUEUE ,I-DUST>
<MOVE ,RING ,HERE>
<SETG P-IT-OBJECT ,RING>
<SETG P-THEM-OBJECT ,NOT-HERE-OBJECT>
<TELL " A bright blue ">
<ITALICIZE "snap">
<TELL " of electricity lights the room! ">
<BLINK ,DUST>
<TELL " draw">
<COND (<EQUAL? ,BUNNIES 1>
<TELL "s itself">)
(T
<TELL " themselves">)>
<TELL
" together into a hard ring of particles, which falls with a clatter to your feet." CR>
<UPDATE-STAT <GETP ,DUST ,P?VALUE> ,EXPERIENCE>)
(<IS? .OBJ ,MONSTER>
<MAKE .OBJ ,STRICKEN>
<PUTP .OBJ ,P?ENDURANCE
<- <GETP .OBJ ,P?ENDURANCE> ,STATIC>>)
(T
<TELL ,TAB CTHE .OBJ " looks at you reproachfully." CR>
<COND (<EQUAL? .OBJ ,UNICORN>
<UPDATE-STAT -5 ,LUCK T>)>)>
<SETG STATIC 0>
<RFALSE>>
<ROUTINE BLINK (OBJ)
<TELL "In the blink of an eye, " THE .OBJ>
<RFALSE>>
"Takes monster OBJ and NEGATIVE damage, returns net damage."
<ROUTINE MSPARK? (OBJ DAMAGE "AUX" X)
<COND (<ZERO? ,STATIC>
<RETURN .DAMAGE>)>
<SET X <+ <GETP .OBJ ,P?ENDURANCE> .DAMAGE>>
<TELL ,TAB>
<SAY-SNAP>
<TELL "you and " THE .OBJ>
<COND (<L? .X 1>
<SET X 1>
<TELL ", leaving it nearly stunned">)>
<TELL ,PERIOD>
<PUTP .OBJ ,P?ENDURANCE .X>
<SET DAMAGE <- .DAMAGE ,STATIC>>
<SETG STATIC 0>
<RETURN .DAMAGE>>
<ROUTINE V-DROP ()
<COND (<IDROP>
<SAY-DROPPED>)>
<RTRUE>>
<ROUTINE SAY-DROPPED ()
<COND (<OR <T? ,P-MULT?>
<PROB 50>>
<TELL "Dropped." CR>
<RTRUE>)>
<TELL ,CYOU>
<COND (<PROB 50>
<TELL "drop ">)
(T
<TELL "put down ">)>
<TELL THEO ,PERIOD>
<RTRUE>>
<ROUTINE IDROP ("AUX" L)
<SET L <LOC ,PRSO>>
<COND (<OR <EQUAL? .L <> ,LOCAL-GLOBALS ,GLOBAL-OBJECTS>
<PRSO? WINNER ME>>
<IMPOSSIBLE>
<RFALSE>)
(<NOT <EQUAL? .L ,WINNER>>
<COND (<EQUAL? ,WINNER ,PLAYER>
<TELL "You'd ">)
(T
<TELL CTHE ,WINNER " would ">)>
<TELL "have to take " THEO>
<OUT-OF-LOC .L>
<TELL ,SFIRST>
<RFALSE>)
(<AND <IS? ,PRSO ,WORN>
<IN? ,PRSO ,WINNER>>
<COND (<TAKE-OFF-PRSO-FIRST?>
<RTRUE>)>)
(<PRSO? MINX>
<UNMAKE ,PRSO ,SEEN>
<UNMAKE ,PRSO ,TOUCHED>
<UNMAKE ,PRSO ,TRYTAKE>)
(<PRSO? TRUFFLE>
<UNMAKE ,MINX ,SEEN>)>
<UNMAKE ,PRSO ,WIELDED>
<WINDOW ,SHOWING-ALL>
<SET L <LOC ,WINNER>>
<COND (<OR <HERE? IN-SKY ON-BRIDGE APLANE>
<EQUAL? .L ,SADDLE>>
<TELL CTHEO C ,SP>
<FALLS>
<RFALSE>)>
<MOVE ,PRSO .L>
<RTRUE>>
<ROUTINE PRSO-SLIDES-OFF-PRSI ()
<TELL CTHEO " slide">
<COND (<NOT <IS? ,PRSO ,PLURAL>>
<TELL "s">)>
<TELL " off " THEI ,AND>
<FALLS>
<RTRUE>>
<ROUTINE FALLS ("OPT" (OBJ ,PRSO) (V T) "AUX" S L X)
<SET S "s ">
<COND (<IS? .OBJ ,PLURAL>
<SET S " ">)>
<SET L <LOC ,WINNER>>
<WINDOW ,SHOWING-ALL>
<UNMAKE .OBJ ,WIELDED>
<UNMAKE .OBJ ,WORN>
<COND (<HERE? ON-BRIDGE>
<VANISH .OBJ>
<COND (<T? .V>
<TELL "slip" .S B ,W?BETWEEN " the ropes and ">)>
<TELL "fall" .S "out of sight." CR>
<RTRUE>)
(<HERE? IN-SKY APLANE>
<SET X <DOWN-TO?>>
<COND (<ZERO? .X>
<REMOVE .OBJ>)
(T
<MOVE .OBJ .X>)>
<COND (<HERE? IN-SKY>
<TELL "fall" .S "out of sight." CR>
<RTRUE>)>
<COND (<EQUAL? .OBJ ,PHASE>
<MUNG-PHASE>)>
<TELL "disappear" .S "in a spectral flash." CR>
<RTRUE>)
(<EQUAL? .L ,SADDLE>
<SET X <LOC .L>>
<COND (<IS? .X ,VEHICLE>
<MOVE .OBJ <LOC .X>>)
(T
<MOVE .OBJ .X>)>
<COND (<T? .V>