-
Notifications
You must be signed in to change notification settings - Fork 23
/
terror.zil
873 lines (806 loc) · 22.5 KB
/
terror.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
"TERROR for
ENCHANTER
(c) Copyright 1983 Infocom, Inc. All Rights Reserved.
"
;"It even strikes fear in the hearts of implementers...."
<OBJECT TERROR
(IN T-I)
(DESC "lurking evil presence")
(SYNONYM TERROR PRESENCE FORCE)
(ADJECTIVE STALKING EVIL LURKING UNSEEN)
(FLAGS NDESCBIT)
(GLOBAL TERROR)
(ACTION TERROR-F)>
<ROUTINE TERROR-F ()
<COND (<VERB? ZIFMIA>
<TELL
"As you cast the zifmia spell, you are overpowered with such a sense of
malice that you cannot continue. All in all, a good thing probably." CR>)
(<VERB? VAXUM>
<TELL
"The terror may be friendlier, but with friends like that...." CR>)
(<VERB? GUNCHO>
<REMOVE ,TERROR>
<TELL
"The room fills with a horrible noise, darkens to pitch blackness, and
then lightens. The weight of fear lifts." CR>)>>
<OBJECT TMAP
(IN MAP-ROOM)
(DESC "map")
(FDESC
"Lying on the ground is an old parchment map.")
(SYNONYM MAP)
(ADJECTIVE OLD PARCHMENT)
(FLAGS TAKEBIT READBIT CONTBIT OPENBIT)
(CAPACITY 100)
(ACTION TMAP-F)>
<OBJECT PENCIL
(IN MAP-ROOM)
(DESC "badly worn pencil")
(FDESC
"In one corner of the room is a badly worn pencil, inscribed with runes.")
(SYNONYM PENCIL ERASER RUNES)
(ADJECTIVE BADLY WORN)
(FLAGS TAKEBIT READBIT)
(TEXT
"It says \"Frobozz Magic Pencil Company.\" Some sort of joke, probably.")
(ACTION PENCIL-F)>
<ROUTINE TMAP-F ()
<COND (<VERB? KULCAD>
<TELL
"At once, a maze of lines forms, connecting all of the spots on the map.
Suddenly, the world becomes still and cold." CR CR>
<END-OF-WORLD>
<RTRUE>)
(<VERB? OPEN CLOSE PUT>
<TELL "You can't do that." CR>)
(<VERB? DRAW-ON>
<COND (<IN? ,PENCIL ,WINNER>
<WRITE-HINT>
<RTRUE>)
(T
<TELL "You have nothing to draw with." CR>)>)
(<VERB? READ EXAMINE LOOK-INSIDE>
<TELL
"The map consists of a drawing with nine points, each represented by
a strange character, with interconnecting thin pencil lines. Using your
native alphabet, it looks like this:" CR>
<DRAW-TMAZE>)>>
<GLOBAL PENCIL-COUNT 2>
<GLOBAL ERASER-COUNT 2>
<GLOBAL PENCIL-TBL
<TABLE "gone" "very nearly gone" "nearly gone">>
<GLOBAL ERASER-TBL
<TABLE "not fit for use" "barely usable" "negligible">>
<ROUTINE PENCIL-F ()
<COND (<VERB? KULCAD>
<TELL
"As the pencil dissolves into nothingness, everything becomes still
and cold." CR CR>
<END-OF-WORLD>
<RTRUE>)
(<VERB? EXAMINE>
<TELL
"The pencil is very old and covered with finely inlaid runes. The point is
">
<TELL <GET ,PENCIL-TBL ,PENCIL-COUNT>
" and the attached eraser is "
<GET ,ERASER-TBL ,ERASER-COUNT>
"." CR>)>>
<OBJECT POINT-B
(IN TMAP)
(DESC "point B")
(SYNONYM B)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 1)>
<OBJECT POINT-R
(IN TMAP)
(DESC "point R")
(SYNONYM R)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 2)>
<OBJECT POINT-K
(IN TMAP)
(DESC "point K")
(SYNONYM K)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 3)>
<OBJECT POINT-H
(IN TMAP)
(DESC "point H")
(SYNONYM H)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 4)>
<OBJECT POINT-J
(IN TMAP)
(DESC "point J")
(SYNONYM J)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 5)>
<OBJECT POINT-M
(IN TMAP)
(DESC "point M")
(SYNONYM M)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 6)>
<OBJECT POINT-V
(IN TMAP)
(DESC "point V")
(SYNONYM V)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 7)>
<OBJECT POINT-F
(IN TMAP)
(DESC "point F")
(SYNONYM F)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 8)>
<OBJECT POINT-P
(IN TMAP)
(DESC "point P")
(SYNONYM P)
(ADJECTIVE POINT)
(FLAGS POINTBIT NDESCBIT)
(POINT 9)>
<CONSTANT T-NW 1>
<CONSTANT T-WEST 3>
<CONSTANT T-SW 5>
<CONSTANT T-SOUTH 7>
<CONSTANT T-SE 9>
<CONSTANT T-EAST 11>
<CONSTANT T-NE 13>
<CONSTANT T-NORTH 15>
<GLOBAL T-DIR-TABLE <TABLE 0 0 0 0 0 "/" 0 "!" 0 "\\">>
<ROOM T-A
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" 0 0 ;"WEST" 0 0 ;"SW" 0 0 ;"SOUTH" T-B 1
;"SE" T-C 0 ;"EAST" T-E 0 ;"NE" 0 0 ;"NORTH" 0 0 -1>)
(CAPACITY 1)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-B
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" 0 0 ;"WEST" 0 0 ;"SW" 0 0 ;"SOUTH" 0 0
;"SE" T-D 1 ;"EAST" T-F 1 ;"NE" T-C 0 ;"NORTH" T-A 1 -1>)
(CAPACITY 2)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-C
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" T-A 0 ;"WEST" 0 0 ;"SW" T-B 0 ;"SOUTH" T-D 0
;"SE" T-F 0 ;"EAST" T-G 0 ;"NE" T-E 1 ;"NORTH" 0 0 -1>)
(CAPACITY 3)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-D
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" T-B 1 ;"WEST" 0 0 ;"SW" 0 0 ;"SOUTH" 0 0
;"SE" 0 0 ;"EAST" T-I 0 ;"NE" T-F 1 ;"NORTH" T-C 0 -1>)
(CAPACITY 4)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-E
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" 0 0 ;"WEST" T-A 0 ;"SW" T-C 1 ;"SOUTH" T-F 0
;"SE" T-G 1 ;"EAST" 0 0 ;"NE" 0 0 ;"NORTH" 0 0 -1>)
(CAPACITY 5)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-F
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" T-C 0 ;"WEST" T-B 1 ;"SW" T-D 1 ;"SOUTH" 0 0
;"SE" T-I 0 ;"EAST" T-H 0 ;"NE" T-G 1 ;"NORTH" T-E 0 -1>)
(CAPACITY 6)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-G
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" T-E 1 ;"WEST" T-C 0 ;"SW" T-F 1 ;"SOUTH" T-I 0
;"SE" T-H 1 ;"EAST" 0 0 ;"NE" 0 0 ;"NORTH" 0 0 -1>)
(CAPACITY 7)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-H
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" T-G 1 ;"WEST" T-F 0 ;"SW" T-I 0 ;"SOUTH" 0 0
;"SE" 0 0 ;"EAST" 0 0 ;"NE" 0 0 ;"NORTH" 0 0 -1>)
(CAPACITY 8)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<ROOM T-I
(IN ROOMS)
(DESC "Translucent Room")
(FLAGS RLANDBIT)
(TMAZE <TABLE
;"NW" T-F 0 ;"WEST" T-D 0 ;"SW" 0 0 ;"SOUTH" 0 0
;"SE" 0 0 ;"EAST" 0 0 ;"NE" T-H 0 ;"NORTH" T-G 0 -1>)
(CAPACITY 9)
(GLOBAL BLACK-PASSAGE)
(ACTION TMAZE-F)>
<GLOBAL TMAZE-DIRS <TABLE "northwest" "west" "southwest" "south"
"southeast" "east" "northeast" "north">>
<OBJECT BLACK-PASSAGE
(IN LOCAL-GLOBALS)
(DESC "black passage")
(SYNONYM PASSAGE)
(ADJECTIVE BLACK)
(ACTION BLACK-PASSAGE-F)>
<ROUTINE BLACK-PASSAGE-F ()
<COND (<VERB? EXAMINE>
<TELL
"The passages are perfectly round and black; the walls seem to be made of
carbon." CR>)>>
<ROUTINE TMAZE-F (RARG "AUX" TBL (NEX 0) (FLG <>) (OFFS 0) (PLU <>))
<COND (<AND <IN? ,BANISH-SCROLL ,WINNER>
<EQUAL? ,HERE ,T-A>
,TERROR-TRAPPED
<G? ,TERROR-POINT 0>>
<TELL
"You hear a horrible anguished scream through the walls of the cavern as the
terror realizes that it is trapped and its scroll of power stolen!" CR CR>
<SETG SCORE <+ ,SCORE ,TERROR-POINT>>
<SETG TERROR-POINT 0>)>
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"This is a peculiar room, whose cream-colored walls are thin and
translucent." CR>
<SET TBL <GETP ,HERE ,P?TMAZE>>
<REPEAT ()
<COND (<EQUAL? <GET .TBL .OFFS> -1>
<RETURN>)
(<EQUAL? <GET .TBL <+ .OFFS 1>> 1>
<SET NEX <+ .NEX 1>>)>
<SET OFFS <+ .OFFS 2>>>
<COND (<EQUAL? .NEX 0>
<TELL
"There is not a single exit from this place." CR>
<RTRUE>)
(<EQUAL? .NEX 1>
<TELL
"An exit is">)
(T
<SET PLU T>
<TELL
"Passages go">)>
<TELL " to the ">
<SET OFFS 0>
<REPEAT ()
<COND (<EQUAL? <GET .TBL .OFFS> -1>
<RETURN>)
(<EQUAL? <GET .TBL <+ .OFFS 1>> 1>
<TELL <GET ,TMAZE-DIRS </ .OFFS 2>>>
<COND (<G? .NEX 2>
<SET FLG T>
<TELL ", ">)
(<EQUAL? .NEX 2>
<COND (.FLG <TELL ",">)>
<TELL " and ">)>
<SET NEX <- .NEX 1>>)>
<SET OFFS <+ .OFFS 2>>>
<TELL "
and ">
<COND (.PLU <TELL "they are">)
(T <TELL "it is">)>
<TELL
" very strange indeed, perfectly round and black as pitch." CR>)
(<EQUAL? .RARG ,M-BEG>
<COND (<IN? ,TERROR ,HERE>
<COND (<VERB? WALK>
<TELL
"Your feet are leaden with fear, and cold sweat runs down your back as you
make your way to the door, but you make no progress. Your mind tells you
you are running, but you aren't getting anywhere." CR>)>)
(<VERB? WALK>
<COND (<AND <EQUAL? ,HERE ,T-A>
<EQUAL? ,PRSO ,P?UP>>
<GOTO ,DUNGEON>
<RTRUE>)
(<AND <G? ,PRSO ,P?UP>
<EQUAL? <GET <SET TBL <GETP ,HERE ,P?TMAZE>>
<SET OFFS
<- <* <- ,PRSO
,P?UP>
2>
1>>>
1>>
<GOTO <GET .TBL <- .OFFS 1>>>
<COND (<IN? ,TERROR ,HERE>
<TELL
"An evil presence pervades the room, its source unseen. Fear seeps into
your mind, like fog. You look fearfully around. There is something
horrible here." CR>)
(<CONNECTED? ,HERE <LOC ,TERROR>>
<TELL
"You sense that near this place an evil presence lurks. It seems close by
and is moving." CR>)>
<RTRUE>)
(T
<TELL "You can't go that way." CR>)>)>)>>
<ROUTINE END-OF-WORLD ()
<TELL
"You suddenly feel weak and your knees buckle. Just as you collapse to the
ground, you find yourself in the presence of the Circle. They seem tense
and frightened and ask desperately about your recent doings. As you tell
your tale of the map and pencil, they recoil in horror. \"The Terror is
released!\" cries one. Belboz sinks into his throne. \"We are doomed!\"
he gasps. One by one, the wizards flee to prepare a hopeless defense." CR>
<SETG SCORE -10>
<FINISH>>
<ROUTINE DRAW-TMAZE ()
<FIXED-FONT-ON>
<TELL CR "B">
<ECN ,T-A ,T-H ;"Place holder">
<TELL "J" CR>
<CN ,T-A ,T-SOUTH>
<CN ,T-A ,T-SE>
<TELL " ">
<CN ,T-E ,T-SW>
<CN ,T-E ,T-SOUTH>
<CN ,T-E ,T-SE>
<CRLF>
<CN ,T-A ,T-SOUTH>
<TELL " ">
<CN ,T-A ,T-SE>
<TELL " ">
<CN ,T-E ,T-SW>
<TELL " ">
<CN ,T-E ,T-SOUTH>
<TELL " ">
<CN ,T-E ,T-SE>
<CRLF>
<CN ,T-A ,T-SOUTH>
<TELL " ">
<CN ,T-A ,T-SE>
<TELL " ">
<CN ,T-E ,T-SW>
<TELL " ">
<CN ,T-E ,T-SOUTH>
<TELL " ">
<CN ,T-E ,T-SE>
<CRLF>
<CN ,T-A ,T-SOUTH>
<TELL " K">
<ECN ,T-C ,T-E>
<TELL "V" CR>
<CN ,T-A ,T-SOUTH>
<TELL " ">
<CN ,T-C ,T-SW>
<CN ,T-C ,T-SOUTH>
<CN ,T-C ,T-SE>
<TELL " ">
<CN ,T-E ,T-SOUTH>
<TELL " ">
<CN ,T-G ,T-SW>
<CN ,T-G ,T-SOUTH>
<CN ,T-G ,T-SE>
<CRLF>
<CN ,T-A ,T-SOUTH>
<TELL " ">
<CN ,T-C ,T-SW>
<TELL " ">
<CN ,T-C ,T-SOUTH>
<TELL " ">
<CN ,T-C ,T-SE>
<TELL " ">
<CN ,T-E ,T-SOUTH>
<TELL " ">
<CN ,T-G ,T-SW>
<TELL " ">
<CN ,T-G ,T-SOUTH>
<TELL " ">
<CN ,T-G ,T-SE>
<CRLF>
<CN ,T-A ,T-SOUTH>
<CN ,T-C ,T-SW>
<TELL " ">
<CN ,T-C ,T-SOUTH>
<TELL " ">
<CN ,T-C ,T-SE>
<CN ,T-E ,T-SOUTH>
<CN ,T-G ,T-SW>
<TELL " ">
<CN ,T-G ,T-SOUTH>
<TELL " ">
<CN ,T-G ,T-SE>
<CRLF>
<TELL "R">
<ECN ,T-B ,T-C>
<TELL "M">
<ECN ,T-F ,T-G>
<TELL "F">
<TELL CR " ">
<CN ,T-B ,T-SE>
<TELL " ">
<CN ,T-C ,T-SOUTH>
<TELL " ">
<CN ,T-F ,T-SW>
<TELL " ">
<CN ,T-F ,T-SE>
<TELL " ">
<CN ,T-G ,T-SOUTH>
<TELL " ">
<CN ,T-H ,T-SW>
<TELL CR " ">
<CN ,T-B ,T-SE>
<TELL " ">
<CN ,T-C ,T-SOUTH>
<TELL " ">
<CN ,T-F ,T-SW>
<TELL " ">
<CN ,T-F ,T-SE>
<TELL " ">
<CN ,T-G ,T-SOUTH>
<TELL " ">
<CN ,T-H ,T-SW>
<TELL CR " ">
<CN ,T-B ,T-SE>
<CN ,T-C ,T-SOUTH>
<CN ,T-F ,T-SW>
<TELL " ">
<CN ,T-F ,T-SE>
<CN ,T-G ,T-SOUTH>
<CN ,T-H ,T-SW>
<TELL CR " H">
<ECN ,T-D ,T-H ;"Place holder">
<TELL "P" CR CR>
<FIXED-FONT-OFF>
<RTRUE>>
<ROUTINE FIXED-FONT-ON () <PUT 0 8 <BOR <GET 0 8> 2>>>
<ROUTINE FIXED-FONT-OFF() <PUT 0 8 <BAND <GET 0 8> -3>>>
<ROUTINE CN (L DIR)
<COND (<NOT <0? <GET <GETP .L ,P?TMAZE> .DIR>>>
<TELL <GET ,T-DIR-TABLE .DIR>>)
(T <TELL " ">)>>
<ROUTINE ECN (L DN "AUX" (FLG <>))
<COND (<NOT <0? <GET <GETP .L ,P?TMAZE> ,T-EAST>>>
<SET FLG T>
<TELL "---">)
(T <TELL " ">)>
<COND (<NOT <0? <GET <GETP .DN ,P?TMAZE> ,T-SOUTH>>>
<COND (.FLG <TELL "+">)
(T <TELL "!">)>)
(.FLG <TELL "-">)
(T <TELL " ">)>
<COND (.FLG <TELL "---">)
(T <TELL " ">)>>
<ROUTINE CONNECT (RM1 RM2 "OPTIONAL" (FLIP <>) "AUX" TBL RMX)
<SET TBL <GETP .RM1 ,P?TMAZE>>
<REPEAT ()
<COND (<EQUAL? <SET RMX <GET .TBL 0>> -1>
<TELL
"The pencil doesn't seem to allow that line to be drawn." CR>
<RTRUE>)
(<EQUAL? .RMX .RM2>
<COND (<0? <GET .TBL 1>>
<COND (<NOT .FLIP>
<CONNECT .RM2 .RM1 T>
<SETG PENCIL-COUNT
<- ,PENCIL-COUNT 1>>
<TELL
"A thin line now connects the two spots on the map, but the
pencil point is " <GET ,PENCIL-TBL ,PENCIL-COUNT> "." CR>
<COND (<EQUAL? ,HERE .RM1 .RM2>
<DESCRIBE-NEW-EXIT .RM1 .RM2>)>)>
<PUT .TBL 1 1>
<COND (<AND <LOC ,TERROR>
<TWALK <LOC ,TERROR>>>
<SETG TERROR-TRAPPED <>>
<ENABLE <QUEUE I-TERROR -1>>)>)
(T
<TELL
"There is already a line connecting those spots." CR>)>
<RTRUE>)>
<SET TBL <REST .TBL 4>>>>
<ROUTINE DISCONNECT (RM1 RM2 "OPTIONAL" (FLIP <>) "AUX" TBL RMX)
<SET TBL <GETP .RM1 ,P?TMAZE>>
<REPEAT ()
<COND (<EQUAL? <SET RMX <GET .TBL 0>> -1>
<TELL
"Those two spots aren't connected on the map." CR>
<RTRUE>)
(<EQUAL? .RMX .RM2>
<COND (<0? <GET .TBL 1>>
<TELL
"Those two spots aren't connected on the map." CR>)
(T
<COND (<NOT .FLIP>
<DISCONNECT .RM2 .RM1 T>
<SETG ERASER-COUNT
<- ,ERASER-COUNT 1>>
<TELL
"The line between the two spots is erased, leaving the eraser
" <GET ,ERASER-TBL ,ERASER-COUNT> "." CR>
<COND (<EQUAL? ,HERE .RM1 .RM2>
<DESCRIBE-NEW-EXIT .RM1
.RM2
<>>)>)>
<PUT .TBL 1 0>)>
<RTRUE>)>
<SET TBL <REST .TBL 4>>>>
<ROUTINE DESCRIBE-NEW-EXIT (RM1 RM2 "OPTIONAL" (MAKE? T)
"AUX" TMP TBL (OFFS 0))
<COND (<EQUAL? .RM2 ,HERE>
<SET TMP .RM1>
<SET RM1 .RM2>
<SET RM2 .TMP>)>
<SET TBL <GETP .RM1 ,P?TMAZE>>
<REPEAT ()
<COND (<EQUAL? <SET TMP <GET .TBL .OFFS>> .RM2>
<RETURN>)
(<EQUAL? .TMP -1>
<TELL "*ERROR* BAD-EXIT DESCRIBE-NEW-EXIT" CR>
<RETURN>)
(T
<SET OFFS <+ .OFFS 2>>)>>
<TELL "Suddenly, the ">
<COND (.MAKE? <TELL "wall">)
(T <TELL "black passage">)>
<TELL " to the ">
<TELL <GET ,TMAZE-DIRS </ .OFFS 2>>>
<COND (.MAKE?
<TELL " opens to form a perfectly round and black passage">)
(T
<TELL " closes off">)>
<TELL "!" CR>>
<ROUTINE CONNECTED? (RM1 RM2 "AUX" TBL RMX)
<SET TBL <GETP .RM1 ,P?TMAZE>>
<COND (<NOT .TBL> <RFALSE>)>
<REPEAT ()
<COND (<EQUAL? <SET RMX <GET .TBL 0>> -1>
<RFALSE>)
(<EQUAL? .RMX .RM2>
<COND (<0? <GET .TBL 1>>
<RFALSE>)
(T
<RTRUE>)>)>
<SET TBL <REST .TBL 4>>>>
;<GLOBAL TERROR-ROOM ,T-I>
<GLOBAL TWAIT 0>
<GLOBAL TERROR-ARRIVES
"An evil presence, borne on a cold blast of air, seems to move beside
you, weighing you down with emanations of malice and hatred. A cold fear
covers you like fog.">
<GLOBAL TERROR-MOVED <>>
<ROUTINE I-TERROR ("AUX" RM NRM (FLG <>))
<COND (,TERROR-TRAPPED
<SET RM <LOC ,TERROR>>
<COND (<CONNECTED? ,HERE .RM>
<MOVE ,TERROR ,HERE>
<TELL ,TERROR-ARRIVES CR>)>)
;(<PROB 5> <RFALSE>)
(<TWALK <SET RM <LOC ,TERROR>>>
<SETG TERROR-TRAPPED <>>
<SETG TWAIT 0>
<MOVE ,TERROR <SET NRM <GET ,TMAZE-ROOMS <GET ,PATH-TBL 2>>>>
<COND (<EQUAL? ,HERE .NRM>
<TELL ,TERROR-ARRIVES CR>
<SET FLG T>)
(<CONNECTED? ,HERE .NRM>
<TELL
"Somewhere near, an evil presence lurks, probing your mind. It
seems to be moving quickly." CR>
<SET FLG T>)
(<CONNECTED? ,HERE .RM>
<TELL
"You can no longer sense the evil presence nearby." CR>
<SET FLG T>)>
<COND (<NOT ,TERROR-MOVED>
<SETG TERROR-MOVED T>
<SETG LOSSAGE <+ ,LOSSAGE 1>>
<SET FLG T>
<TELL
"You feel that two powerful, evil forces are searching each other out.
As they meet, the air lightens. Belboz appears before you. \"Something
has disturbed the ancient Terror. Krill himself knows this and will try
to use it to his purposes. Already, they may have joined together. You
must not allow the Terror to escape, or we are all doomed!\" He fades into
the gloom." CR>)>
<COND (<EQUAL? .NRM ,T-A>
<END-OF-WORLD>
<COND (<EQUAL? ,HERE ,T-A>
<SET FLG T>
<TELL
"The presence seems to grow stronger each passing second,
beating you down with its awesome power." CR>)
(T
<SET FLG T>
<TELL
"At once, a strange and horrible feeling wells up inside of you.
An unseen yet awesomely powerful force, exuding pure evil, seems
to fill the very chamber." CR>)>)>
.FLG)
(<TNULL-F> <RTRUE>)
(<OR <G? <SETG TWAIT <+ ,TWAIT 1>> 6>
<NOT <SET RM <TWALK1>>>>
<RTRUE>)
(T
<SET NRM <LOC ,TERROR>>
<COND (<EQUAL? .NRM ,T-I> <RTRUE>)
(<CONNECTED? .NRM ,T-I>
<MOVE ,TERROR ,T-I>)
(<CONNECTED? .NRM ,T-F>
<MOVE ,TERROR ,T-F>)
;(T
<MOVE ,TERROR .RM>)>
<COND (<IN? ,TERROR ,HERE>
<TELL ,TERROR-ARRIVES CR>)
(T
<TELL
"From somewhere nearby, an unseen force probes you, and you are gripped
by a sickening feeling." CR>)>
<RTRUE>)>>
<GLOBAL TERROR-TRAPPED <>>
<GLOBAL TWALK-PATHS
<LTABLE ;A <LTABLE>
;B <LTABLE 1 3 4 6>
;C <LTABLE 1 2 5 6 7 4>
;D <LTABLE 2 3 6 9>
;E <LTABLE 1 3 6 7>
;F <LTABLE 3 5 2 4 7 8 9>
;G <LTABLE 5 3 6 8 9>
;H <LTABLE 6 7 9>
;I <LTABLE 4 6 7 8>>>
<GLOBAL TMAZE-ROOMS <LTABLE T-A T-B T-C T-D T-E T-F T-G T-H T-I>>
<ROUTINE TNULL-F ()
<SETG TERROR-TRAPPED T>
<RFALSE>>
<ROUTINE TWALK (RM)
<SETG TWALK-LEVEL 0>
<SETG TTRIES 0>
<SETG PSTART .RM>
<PATH-OUT? .RM>>
<GLOBAL TTRIES 0>
<GLOBAL PSTART <>>
<CONSTANT TWALK-MAX 5>
;<GLOBAL SLOW-TIMES <LTABLE
"You feel a passing wave of anger permeating the walls of the room."
"The feeling of anger from a moment before is greater now."
"An intense surge of anger fills the very air."
"This is a bug. Report it."
"This is a bug. Report it."
"This is a bug. Report it.">>
<GLOBAL PATH-TBL <TABLE 0 0 0 0 0 0 0>>
<GLOBAL TWALK-LEVEL 0>
<ROUTINE TWALK1 ("AUX" TBL RM NRM (OFFS 1) CNT)
<SET RM <LOC ,TERROR>>
<SET TBL <GET ,TWALK-PATHS <GETP .RM ,P?CAPACITY>>>
<SET CNT <GET .TBL 0>>
<REPEAT ()
<COND (<G? .OFFS .CNT>
<RFALSE>)
(<CONNECTED? .RM
<SET NRM <GET ,TMAZE-ROOMS
<GET .TBL .OFFS>>>>
<RETURN .NRM>)>
<SET OFFS <+ .OFFS 1>>>>
<ROUTINE PATH-OUT? (RM "AUX" (OFFS 1) TBL (CNT 0) NRM)
<SETG TTRIES <+ ,TTRIES 1>>
;<COND (<0? <MOD ,TTRIES 16>>
<TELL <GET ,SLOW-TIMES </ ,TTRIES 32>> CR>)>
<SETG TWALK-LEVEL <+ ,TWALK-LEVEL 1>>
<PUT ,PATH-TBL ,TWALK-LEVEL <GETP .RM ,P?CAPACITY>>
<COND (<EQUAL? .RM ,T-A>
<SETG TWALK-LEVEL <- ,TWALK-LEVEL 1>>
<RTRUE>)
(<G? ,TWALK-LEVEL ,TWALK-MAX>
<SETG TWALK-LEVEL <- ,TWALK-LEVEL 1>>
<RFALSE>)>
<SET TBL <GET ,TWALK-PATHS <GETP .RM ,P?CAPACITY>>>
<COND (<0? <SET CNT <GET .TBL 0>>>
<SETG TWALK-LEVEL <- ,TWALK-LEVEL 1>>
<RTRUE>)>
<REPEAT ()
<COND (<G? .OFFS .CNT>
<SETG TWALK-LEVEL <- ,TWALK-LEVEL 1>>
<RFALSE>)
(<AND <CONNECTED? .RM
<SET NRM <GET ,TMAZE-ROOMS
<GET .TBL .OFFS>>>>
<NOT <EQUAL? .NRM ,PSTART>>
<PATH-OUT? .NRM>>
<SETG TWALK-LEVEL <- ,TWALK-LEVEL 1>>
<RTRUE>)>
<SET OFFS <+ .OFFS 1>>>>
<OBJECT LEGEND-BOOK
(IN LIBRARY)
(DESC "dusty book")
(SYNONYM BOOK PAGE)
(ADJECTIVE OLD DUSTY FIRST LEGEND)
(FDESC
"Amid the tubes is an old and dusty book.")
(FLAGS TAKEBIT READBIT OPENBIT CONTBIT)
(SIZE 6)
(ACTION LEGEND-BOOK-F)>
<ROUTINE LEGEND-BOOK-F ()
<COND (<AND <VERB? CLOSE>
<FSET? ,PRSO ,OPENBIT>>
<FCLEAR ,PRSO ,OPENBIT>
<TELL
"Closed." CR>)
(<VERB? READ EXAMINE LOOK-INSIDE OPEN>
<FSET ,PRSO ,OPENBIT>
<TELL
"The first page of the book was the table of contents. Only two chapter names
can be read: The Legend of the Unseen Terror and The Legend of the Great
Implementers." CR>)
(<VERB? TURN>
<TELL
"Rather than turning pages, why don't you simply read the legends." CR>)>>
<OBJECT LEGEND-ONE
(IN LEGEND-BOOK)
(DESC "Legend of the Unseen Terror")
(SYNONYM LEGEND TERROR)
(ADJECTIVE UNSEEN)
(FLAGS READBIT NDESCBIT)
(GLOBAL TERROR)
(TEXT
"This legend, written in an ancient tongue, goes something like this:
At one time a shapeless and formless manifestation of evil was disturbed
from millenia of sleep. It was so powerful that it required the combined
wisdom of the leading enchanters of that age to conquer it. The legend tells
how the enchanters lured the Terror \"to a recess deep within the earth\" by
placing there a powerful spell scroll. When it had reached the scroll, the
enchanters trapped it there with a spell that encased it in the living
rock. The Terror was so horrible that none would dare speak of it. A comment
at the end of the narration indicates that the story is considered to be quite
fanciful; no other chronicles of the age mention the Terror in any form.")>
<OBJECT LEGEND-TWO
(IN LEGEND-BOOK)
(DESC "Legend of the Great Implementers" )
(SYNONYM LEGEND IMPLEMENTERS)
(ADJECTIVE GREAT)
(FLAGS READBIT NDESCBIT)
(TEXT
"This legend, written in an ancient tongue, speaks of the creation
of the world. A more absurd account can hardly be imagined. The universe,
it seems, was created by \"Implementers\" who directed the running of great
engines. These engines produced this world and others, strange and wondrous,
as a test or puzzle for others of their kind. It goes on to state that these
beings stand ready to aid those entrapped within their creation. The great
magician-philosopher Helfax notes that a creation of this kind is morally
and logically indefensible and discards the theory as \"colossal claptrap
and kludgery.\"")
(ACTION LEGEND-TWO-F)>
<ROUTINE LEGEND-TWO-F ()
<COND (<AND <VERB? ZIFMIA> <NOT ,IMP-SEEN>>
<SETG IMP-SEEN T>
<TELL
"The implementers of the world, Marc Blank and Dave Lebling, appear before
you, looking quite as confused as yourself. They speak:|
Dave: \"What's happening here?\"|
Marc: \"Uh, I dunno. YOU wrote this code, not me.\"|
Dave: \"Hmm. Another day, another bug. Let's see here...\"|
They disappear a moment later.|
Dave's voice: \"That should do it.\"" CR>)>>