-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathinterrupts.zil
1402 lines (1313 loc) · 43.6 KB
/
interrupts.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
"INTERRUPTS for
MAGE
(c) Copyright 1985 Infocom, Inc. All Rights Reserved."
;"GENERICS"
<ROUTINE GENERIC-CUBE-F (TBL LEN
"AUX" F (CNT 1) (CONT <>) CUBE?)
<COND (<VERB? ASK-ABOUT TELL-ME-ABOUT COUNT>
<GET .TBL .CNT>)
(ELSE
<COND (<AND <VERB? TAKE>
<EQUAL? <GET ,P-ITBL ,P-PREP2> ,PR?FROM>
<EQUAL? <GET ,P-PRSI ,P-MATCHLEN> 1>>
<SET CONT <GET ,P-PRSI 1>>)>
<REPEAT ()
<COND (<G? .CNT .LEN>
<RFALSE>)>
<SET F <GET .TBL .CNT>>
<SET CUBE? <GETPT .F ,P?NAME>>
<COND (<AND .CUBE?
<OR <VISIBLE? .F>
<VERB? ASK-ABOUT TELL-ABOUT>>>
<COND (<ZERO? <GETP .F ,P?NAME>>
<COND (<OR <NOT .CONT>
<IN? .F .CONT>>
<RETURN .F>)>)>)>
<SET CNT <+ .CNT 1>>>)>>
<ROUTINE GENERIC-FISH-F (TBL LEN)
<COND (<VERB? DROP EAT SHOW GIVE> ,FISH)>>
<ROUTINE GENERIC-ROCK-F (TBL LEN)
<COND (<IN? ,PLAYER ,ROCK>
,ROCK)
(<IN? ,PLAYER ,OTHER-ROCK>
,OTHER-ROCK)
(<AND <EQUAL? ,YOU-LOC ,ROCK-LOC>
<EQUAL? ,YOU-LOC ,OTHER-ROCK-LOC>>
<RFALSE>)
(<EQUAL? ,YOU-LOC ,ROCK-LOC>
,ROCK)
(<EQUAL? ,YOU-LOC ,OTHER-ROCK-LOC>
,OTHER-ROCK)
(ELSE
<RFALSE>)>>
<ROUTINE GENERIC-CARPET-F (TBL LEN)
<COND (<VERB? EXAMINE> <RFALSE>)
(ELSE ,RANDOM-CARPET)>>
<ROUTINE GENERIC-HOLE-F (TBL LEN)
<COND (<OR <IN? ,OCTAGONAL-HOLE ,HERE>
<EQUAL? ,HERE ,MAZE-2>>
,OCTAGONAL-HOLE)
(ELSE ,GLOBAL-HOLE)>>
<ROUTINE GENERIC-RANDOM-F (TBL LEN)
<RFALSE>>
;"from GUILD.ZIL"
<ROUTINE I-ORATION ()
<SETG OCOUNT <+ ,OCOUNT 1>>
<CRLF>
<COND (<==? ,OCOUNT 1>
<SETG ORATOR ,SNEFFLE>
<TELL
'SNEFFLE " of the Guild of Bakers is addressing the gathering. \"Do you know what this is doing
to our business? Do you know how difficult it is to make those yummy butter
pastries by hand? When a simple 'gloth' spell would fold the dough 83 times
it was possible to make a profit, but now 'gloth' hardly works, and when it
does, it usually folds the dough too often and the butter melts, or it
doesn't come out the right size, or...\" He stops, apparently overwhelmed by
the prospect of a world where the pastries have to be hand-made. \"Can't you do
anything about this? You're supposed to know all about magic!\"">)
(<==? ,OCOUNT 2>
<SETG ORATOR ,HOOBLY>
<TELL
'HOOBLY " of the Guild of Brewers stands, gesturing at the floury baker. \"You don't know what
trouble is! Lately, what comes out of the vats, like as not, is cherry
flavored or worse. The last vat, I swear it, tasted as if grues had been
bathing in it. It takes magic to turn weird vegetables and water into
good Borphee beer. Well, without magic, there isn't going to be any
beer!\" This statement has a profound effect on portions of the
crowd. You can hear rumblings from the back concerning Enchanters. The
word \"traitors\" rises out of nowhere. Your fellow Enchanters are
looking at one another nervously.">)
(<==? ,OCOUNT 3>
<SETG ORATOR ,GZORNENPLATZ>
<TELL
"A tall, gruff fellow begins to speak. This is " 'GZORNENPLATZ " of the
Guild of Huntsmen. \"I'm a simple man, and I don't know much about
magic. But I do know that the wild beasts are kept out of the towns and
villages not just by the huntsmen, but by spells as well. Just
yesterday, one of my men was attacked and badly wounded by a troop of
rat-ants. They'd slipped the bounds set down by a 'fripple' spell
somehow. Are we going to let the sorcerers loose rat-ants on us, and
worse?\" He sits, glaring significantly at the now-angry clump of mages
around you.">)
(<==? ,OCOUNT 4>
<SETG ORATOR ,ARDIS>
<SETG CLEESHED? T>
<MOVE ,BLORPLE-SPELL ,SPELL-BOOK>
<TELL
"As the huntsman's accusations are being absorbed and discussed, "
'ARDIS " of the Guild of Poets takes the floor. He begins to talk about
magic rhyming and spelling aids, and their lack.|
|
In the midst of his
splendid peroration, just as he was sketching out an insulting
mythological allusion in iambic hexameter, the poet turns even greener
than usual. His chin elongates and his skin begins to look sort of
slimy. In the blink of an eye there stands at the podium, not the
orator, but rather a large orange newt. \"Breek! Co-ax! Co-ax!\" it
protests.|
|
As you look around the room in shock, you discover that
Ardis is not alone. Each and every guildmaster in the room has been
turned into a frog, salamander, or other amphibian! All but one, that
is: yourself!|
|
No! There is one other survivor. At the rear of the
room, a " 'SHADOW " in a dark cloak slips quietly out the door.">
<THIS-IS-IT ,SHADOW>
<FCLEAR ,SHADOW ,NDESCBIT>
<MOVE ,SHADOW ,GUILD-HALL>
<QUEUE I-SHADOW-GOES 1>
<DEQUEUE I-ORATION>)>
<CRLF>>
<GLOBAL OCOUNT 0>
<GLOBAL SAMARRA? <>>
<ROUTINE I-SAMARRA ()
<COND (<EQUAL? ,HERE ,BELWIT-SQUARE ,GUILD-HALL>
<TELL CR
"Out of the corner of your eye, you see the dark-cloaked figure. At
first oblivious to you, it straightens up, startled and surprised,
then vanishes." CR>)
(ELSE
<SETG SAMARRA? <>>)>>
<ROUTINE I-SHADOW-GOES ()
<COND (<IN? ,SHADOW ,GUILD-HALL>
<QUEUE I-SHADOW-GOES 1>
<MOVE ,SHADOW ,BELWIT-SQUARE>
<COND (<EQUAL? ,HERE ,GUILD-HALL>
<CRLF>
<TELL
CTHE ,SHADOW ", its cloak billowing, charges south into
Belwit Square." CR>)>)
(ELSE
<MOVE ,EARTH-CUBE ,BELWIT-SQUARE>
<MOVE ,SHADOW ,GLOBAL-OBJECTS>
<FCLEAR ,SHADOW ,TAKEBIT>
<FCLEAR ,SHADOW ,TRYTAKEBIT>
<FCLEAR ,CLOUD ,INVISIBLE>
<QUEUE I-CLOUD-GONE 20>
<COND (<EQUAL? ,HERE ,GUILD-HALL>
<CRLF>
<TELL
"Out in the square, there is a crashing noise like
an explosion, and then a wisp of orange smoke drifts in through the door." CR>)
(<EQUAL? ,HERE ,BELWIT-SQUARE>
<CRLF>
<TELL
"The sinister figure, its face hidden in the shadows of a dark cowl, turns to
face you. It nonchalantly jumps into the air, where it is engulfed
in a huge explosion. A thick and acrid
cloud of orange smoke fills the square. There is no sign of the figure."
CR>)>)>>
<ROUTINE I-CLOUD-GONE ()
<FSET ,CLOUD ,INVISIBLE>
<COND (<IN? ,EARTH-CUBE ,BELWIT-SQUARE>
<FCLEAR ,EARTH-CUBE ,INVISIBLE>
<THIS-IS-IT ,EARTH-CUBE>)>
<COND (<EQUAL? ,HERE ,BELWIT-SQUARE>
<CRLF>
<TELL
"The orange smoke dissipates almost as suddenly as it arrived">
<COND (<IN? ,EARTH-CUBE ,BELWIT-SQUARE>
<TELL
". Left behind on the cobblestones is a small " ,WHITE-CUBE>)>
<CLEVER-CONTENTS ,HERE ". Also revealed" ,EARTH-CUBE>
<TELL ,PERIOD>)>>
<ROUTINE I-SHADOW-ARRIVES ()
<COND (<EQUAL? ,HERE ,CASTLE>
<COND (<EQUAL? ,TIME-STOPPED? ,HERE>
<QUEUE I-SHADOW-ARRIVES 1>
<RFALSE>)>
<QUEUE I-SHADOW -1>
<MOVE ,SHADOW ,CASTLE>
<FCLEAR ,SHADOW ,TAKEBIT>
<FCLEAR ,SHADOW ,TRYTAKEBIT>
<CRLF>
<TELL
"Around the throne a dark mist begins to coalesce. It thickens
into the outline of a human figure sitting
nonchalantly on the throne. You can see the ghost of a cloak and
hood as well." CR>)>>
<GLOBAL SHADOW-COUNT 0>
<ROUTINE I-SHADOW ("AUX" (WON? <>) X)
<COND (<NOT <EQUAL? ,HERE ,CASTLE>>
<DEQUEUE I-SHADOW>
<RFALSE>)>
<COND (,SAMARRA?
<SETG SAMARRA? <>>
<TELL CR
"\"So glad to see you. I was surprised to find you in Borphee when I knew
we had an appointment here.\"" CR>
<RTRUE>)>
<COND (<EQUAL? ,TIME-STOPPED? ,HERE>
<RFALSE>)>
<SETG SHADOW-COUNT <+ ,SHADOW-COUNT 1>>
<CRLF>
<COND (<EQUAL? ,SHADOW-COUNT 1>
<TELL
"The figure speaks. \"It's been such a pleasure to follow your progress. ">
<COND (<G? ,DEATHS 0>
<TELL
"I'm so glad I could be of assistance when you had trouble. It made me
feel useful. ">)>
<TELL "Thank you for collecting the cubes.\"" CR>)
(<EQUAL? ,SHADOW-COUNT 2>
<MOVE ,HYPERCUBE ,HERE>
<TELL
"The figure waves its arms in the air. Before you, rolling and tumbling
in a bath of light, are four cubes.
\"When I gathered these and " THE ,EARTH-CUBE ", after searching old tomes and
questioning the wise about their whereabouts, I conceived my plan.
I could not gather the remainder of the cubes, but to achieve my
desire, they had to be brought together. Who better than you to act in
my stead?\"" CR>)
(<EQUAL? ,SHADOW-COUNT 3>
<TELL
"\"It was a simple matter to perturb the cubes I had to make your
simple magics flicker or fail. I knew this would set you on a quest.
For I know you well!\"
The four cubes disappear. The figure sits straight on its throne and
removes its hood. You are looking at a shadowy, dark and transparent
version of yourself!" CR CR
"\"Magic is a powerful force, the most powerful in the universe, but
its exercise has its price. Each time a great mage performs a spell, some
part of the power in that spell is lost in shadow. A great
mage ultimately creates a shadow-self that is dimly aware.\" The figure
grins. \"You have become the most powerful wizard of all, for I, your
shadow, have become very nearly as powerful as you!\"" CR>)
(<EQUAL? ,SHADOW-COUNT 4>
<TELL
"\"But why, you ask, am I collecting the elemental cubes? It's easy to
answer. I am not powerful enough. My existence is still but a shadow of
your own. My desires are unfulfilled. I wish power over all creation!
I wish to remold the universe in my own image, and rule it. In such a
universe, my merest whim would smash a star or slay a butterfly. You
have brought me the tools of the remaking!\"" CR CR>
<COND (<NOT ,FROZEN?>
<FREEZES-YOU T>
<CRLF>)>
<SHADOW-ACQUIRES ,EARTH-CUBE>
<TELL " sets it in the air between
you, where it hangs motionless." CR>)
(<EQUAL? ,SHADOW-COUNT 5>
<SHADOW-ACQUIRES ,AIR-CUBE>
<TELL
" places it next to " THE ,EARTH-CUBE ". They disappear into a glowing
line which appears between them. ">
<SHADOW-ACQUIRES <>>
<TELL
" places " THE ,FIRE-CUBE " and " THE ,WATER-CUBE " in the air,
creating a square of glowing light." CR>)
(<EQUAL? ,SHADOW-COUNT 6>
<TELL
"Four more cubes are placed above the square: " THE ,LIFE-CUBE ", "
THE ,DEATH-CUBE ", " THE ,LIGHT-CUBE " and " THE ,DARK-CUBE ". A
cube of light shimmers before you. The shadow is growing
more excited, hopping around the structure to place the cubes." CR>)
(<EQUAL? ,SHADOW-COUNT 7>
<TELL
"All the remaining cubes save one, " THE ,MAGIC-CUBE ", build another
square, then the shadow adds its own four cubes to make a second cube
of light, which hangs next to the first." CR>)
(<EQUAL? ,SHADOW-COUNT 8>
<TELL
"The shadow grabs the first cube of light, and twisting, chanting, squeezing,
the cube is compressed and thrust inside the second cube. The points of
the inner and outer cube connect, and it begins to tumble, seeming to
twist and distort as one face, then another, presents itself to you. The
figure capers madly in front of its construction, laughing and
giggling. It ignores you." CR>)
(<EQUAL? ,SHADOW-COUNT 9>
<COND (<ROB ,HYPERCUBE ,HERE ,MAGIC-CUBE>
<TELL
CTHE ,SHADOW " removes some detritus from " THE ,HYPERCUBE ". ">)>
<COND (<IN? ,MAGIC-CUBE ,HYPERCUBE>
<TELL
CTHE ,SHADOW " grins evilly at " THE ,MAGIC-CUBE " floating in">)
(ELSE
<SHADOW-ACQUIRES ,MAGIC-CUBE>
<MOVE ,MAGIC-CUBE ,HYPERCUBE>
<TELL
" raising it high, thrusts it into">)>
<TELL " the
center of the tesseract! Cascades of light pour forth, blindingly
bright, but you can still see " THE ,MAGIC-CUBE " at the center. The
shadow is growing more solid, no longer transparent and dark! Chortling
gleefully, it prepares to jump into the hypercube!" CR>)
(<EQUAL? ,SHADOW-COUNT 10>
<TELL
"The shadow, now as solid as a real person, performs a back flip into
the tesseract">
<COND (<IN? ,MAGIC-CUBE ,HYPERCUBE>
<SET WON? <>>
<TELL ", laughing triumphantly.">)
(<SET X <FIRST? ,HYPERCUBE>>
<COND (<NOT <MAGIC? .X>> <SET WON? 3>)
(ELSE <SET WON? 2>)>)
(ELSE
<SET WON? 1>)>
<COND (<EQUAL? .WON? 2>
<TELL
". \"Fool! Everything will be as it was!\"">)
(.WON?
<TELL
". \"No!\" It screams. \"Stop! Fool, you've destroyed me! You've destroyed ">
<COND (<EQUAL? .WON? 1>
<TELL "everything">)
(<EQUAL? .WON? 3>
<TELL "magic itself">)>
<TELL "! All my lovely plans!\"">)>
<TELL " Now glowing as brightly as the
construction it made, the figure approaches the center. ">
<COND (<EQUAL? .WON? 3>
<TELL
"It grows smaller and smaller, and just before it disappears, the hypercube
vanishes with a pop, and " THE ,MAGIC-CUBE " melts in your hand like an
ice cube." CR CR
"You find yourself back in Belwit Square, all the guildmasters and even
Belboz crowding around you. \"A new age begins today,\" says Belboz after
hearing your story. \"The age of magic is ended, as it must, for as magic
can confer absolute power, so it can also produce absolute evil. We may
defeat this evil when it appears, but if wizardry builds it anew, we can
never ultimately win. The new world will be strange, but in time it will
serve us better.\"" CR>
<SETG SCORE 600>
<FINISH>)
(ELSE
<END-OF-WORLD .WON?>
<CRLF>
<SETG SCORE -99>
<FINISH>)>)>>
<ROUTINE END-OF-WORLD (WON?)
<COND (<EQUAL? .WON? 2>
<TELL
"It returns in fury, retrieves the " 'MAGIC-CUBE ", and resumes
its quest. ">
<END-OF-WORLD <>>
<RTRUE>)>
<TELL
"It dwindles in size and grows in brightness at the same time, until">
<COND (<EQUAL? .WON? 1>
<TELL " it reaches the empty center.
Then you, it and all the world blink out like a spent match.">)
(ELSE
<TELL " you
are almost blinded by a light so bright it fills the world. A
voice like honey and ashes speaks in your mind. \"I am the All, I am
the Will, I am the Power. The universe is Mine! Begone, insect!\" You
and all you hold dear are abolished in an instant, and the reign of the
shadow begins.">)>>
<GLOBAL FROZEN? <>>
<ROUTINE FREEZES-YOU ("OPTIONAL" (PREC? <>))
<COND (<OR <NOT .PREC?> <NOT ,FROZEN?>>
<SETG FROZEN? 5>
<COND (<HELD? ,MAGIC-CUBE>
<QUEUE I-UNFREEZE 2>)>
<COND (.PREC?
<TELL
"\"Now for a small precaution.\"">)
(ELSE
<TELL
"The shadow notices you. \"You force me to take precautions.\"">)>
<TELL
" The shadow gestures, and you are frozen in
place, unable to move even your littlest finger." CR>)>>
"steal all but magic cube"
<ROUTINE STEAL-CUBES ("AUX" (CNT 0) (N 0) CUBE)
<REPEAT ()
<SET CUBE <GET ,CUBE-LIST <* .CNT 2>>>
<MOVE .CUBE ,HERE>
<FSET .CUBE ,NDESCBIT>
<COND (<IGRTR? CNT 11> <RETURN .N>)>>>
<ROUTINE SHADOW-ACQUIRES (OBJ)
<TELL CTHE ,SHADOW>
<COND (<NOT .OBJ> <STEAL-CUBES> ;"all but magic")
(ELSE
<COND (<HELD? .OBJ ,WINNER>
<TELL
" deftly takes " THE .OBJ " from ">
<COND (<IN? .OBJ ,WINNER>
<TELL "you">)
(ELSE
<TELL THE <LOC .OBJ>>)>)
(ELSE
<TELL " takes " THE .OBJ>)>
<TELL " and">
<FSET .OBJ ,NDESCBIT>
<MOVE .OBJ ,HERE>)>>
<ROUTINE I-UNFREEZE ()
<SETG FROZEN? <- ,FROZEN? 1>>
<QUEUE I-UNFREEZE 1>
<CRLF>
<COND (<EQUAL? ,FROZEN? 4>
<TELL
"Your little finger is full of pins and needles. You could move it if you
wanted." CR>)
(<EQUAL? ,FROZEN? 3>
<TELL
"Your feet and hands feel as if they've been asleep, but you can move
them." CR>)
(<EQUAL? ,FROZEN? 2>
<TELL
"Your arms and legs are free, but you still cannot speak or move your
head." CR>)
(<EQUAL? ,FROZEN? 1>
<TELL
"You feel almost thawed, but your mouth feels full of cotton." CR>)
(<ZERO? ,FROZEN?>
<DEQUEUE I-UNFREEZE>
<SETG FROZEN? <>>
<TELL
"The freeze has worn entirely off! Your contact with " THE ,MAGIC-CUBE
" must have weakened it." CR>)>>
;"from HUNGER"
<GLOBAL LOAD-MAX 150>
<GLOBAL LOAD-ALLOWED 150>
<GLOBAL AWAKE -1>
<ROUTINE I-TIRED ("AUX" (FORG <>))
<QUEUE I-TIRED 8>
<COND (<HELD? ,MAGIC-CUBE> <RTRUE>)>
<COND (<G? ,LOAD-ALLOWED 10>
<SETG LOAD-ALLOWED <- ,LOAD-ALLOWED 10>>)>
<COND (<G? ,FUMBLE-NUMBER 1>
<SETG FUMBLE-NUMBER <- ,FUMBLE-NUMBER 1>>)>
<COND (<G? ,SPELL-MAX 1>
<SETG SPELL-MAX <- ,SPELL-MAX 1>>
<COND (<G? ,SPELL-ROOM 0>
<SETG SPELL-ROOM <- ,SPELL-ROOM 1>>)>
<COND (<EQUAL? ,SPELL-ROOM 0>
<SET FORG T>)>)>
<SETG AWAKE <+ ,AWAKE 1>>
<COND (<G? ,AWAKE 8>
<TELL
"You are so exhausted you can't stay awake any longer." CR>
<CRLF>
<V-SLEEP T>
<RFATAL>)
(T
<TELL "You are " <GET ,TIRED-TELL ,AWAKE>>
<COND (.FORG
<TELL
", and the spells you've memorized are becoming confused">)>
<TELL ,PERIOD>)>>
;"from MAGIC"
<ROUTINE I-SNAVIG ("AUX" OCHANGE)
<COND (<NOT ,CHANGED?> <RFALSE>)>
<SET OCHANGE ,CHANGED?>
<SETG CHANGED? <>>
<TELL CR
"You have become yourself again.">
<COND (<EQUAL? .OCHANGE ,GRUE>
<SETG LIT <LIT? ,HERE>>
<COND (<EQUAL? ,HERE ,GRUE-CAVE>
<TELL
" You are immediately noticed by the startled grues. The one drawback of this
essentially light-free environment is that it is also adventurer-free. The
grues are overjoyed to find this deficiency remedied. You are probably less
so.">
<JIGS-UP>
<RFATAL>)>)
(<EQUAL? .OCHANGE ,ROC>
<COND (<FSET? ,HERE ,RAIRBIT>
<START-FALLING>
<TELL
" You begin to fall.">)>)
(<EQUAL? .OCHANGE ,GROUPER>
<COND (<EQUAL? ,HERE ,OCEAN-FLOOR>
<QUEUE I-DROWN 3>
<TELL
" Fortunately your gills have stored some oxygen, but you are in danger
of drowning.">)>
<COND (,ATE-AS-GROUPER?
<TELL
" You have a horrible stomachache. It must have been something you ate.">)>)>
<CRLF>>
<ROUTINE I-DROWN ()
<COND (<AND <EQUAL? ,HERE ,OCEAN-FLOOR>
<NOT <EQUAL? ,CHANGED? ,GROUPER>>>
<CRLF>
<JIGS-UP
"Your air has run out. You are still far underwater. You have drowned.">)>>
<ROUTINE I-GIRGOL ("AUX" TF?)
<COND (<NOT ,TIME-STOPPED?> <RFALSE>)
(<SET TF? <TIME-FROZEN?>>
<TELL CR "Time resumes its forward flight." CR>)>
<SETG TIME-STOPPED? <>>
<COND (,ROCK-FLAG
<SETG ROCK-FLAG <>>
<COND (<EQUAL? ,HERE ,HUT-ROOM ,MOUNTAIN-TOP ,CAVE-ENTRANCE>
<TELL CR
"You hear a gigantic rush of sound as an avalanche tumbles down the
mountain." CR>)
(<EQUAL? ,HERE ,BOULDER-1 ,BOULDER-2 ,BOULDER-3>
<CRLF>
<JIGS-UP
"Tons of rock and dirt continue towards their rendezvous with the valley
floor. Unfortunately, you are ground to nothingness when they arrive for
their appointment.">)
(<EQUAL? .TF?
,CLIFF-TOP ,CLIFF-MIDDLE ,CLIFF-BOTTOM>
<QUEUE I-AVALANCHE -1>
<TELL CR
"Tons of rock and dirt continue their downward plunge." CR>)>)>
<COND (<AND <EQUAL? .TF? ,OGRE-BEDROOM ,OGRE-CAVE>
<EQUAL? ,HERE ,OGRE-BEDROOM ,OGRE-CAVE>>
<I-OGRE-KILLS-YOU T>)>
<COND (<AND <EQUAL? .TF? ,PAST-RUINS-ROOM>
<EQUAL? ,HERE ,PAST-RUINS-ROOM>>
<QUEUE I-WATER-RISING 3>
<TELL CR
"The water begins to rise again." CR>)>
<COND (<AND <EQUAL? .TF? ,CASTLE>
<EQUAL? ,HERE ,CASTLE>>
<COND (<EQUAL? ,SHADOW-COUNT 8>
<TELL CR
"\"Fool!\" chortles the shadow." CR>)>
<RTRUE>)>>
<GLOBAL OGRE-MURDEROUS? <>>
<ROUTINE I-OGRE-KILLS-YOU ("OPTIONAL" (GIRGOL? <>))
<COND (<OR <TIME-FROZEN?>
,SNEEZY?
<EQUAL? ,ESPNIS? ,OGRE>>
<QUEUE I-OGRE-KILLS-YOU 2>
<RFALSE>)>
<COND (<EQUAL? ,HERE ,OGRE-CAVE ,OGRE-BEDROOM>
<COND (<IN? ,PLAYER ,ZIPPER>
<SETG OGRE-MURDEROUS? T>
<RTRUE>)>
<COND (<NOT .GIRGOL?> <CRLF>)>
<TELL
"The ogre, impatient with your presence and your impudent intrusion, ">
<COND (<EQUAL? ,HERE ,OGRE-BEDROOM>
<TELL "charges in and ">)>
<TELL "tramples you to a pulp.">
<JIGS-UP>)>>
<ROUTINE I-ESPNIS ()
<COND (<TIME-FROZEN?>
<QUEUE I-ESPNIS 2>)
(<NOT ,ESPNIS?> <RFALSE>)>
<COND (<IN? ,ESPNIS? ,HERE>
<TELL CR
CTHE ,ESPNIS? " awakes, looking sheepish.">
<COND (<AND <EQUAL? ,ESPNIS? ,OGRE>
<NOT ,SNEEZY?>>
<OGRE-MAD>)
(ELSE <CRLF>)>)>
<SETG ESPNIS? <>>>
<ROUTINE I-LISKON ("OPTIONAL" (NOCR? <>) "AUX" SF)
<COND (<NOT ,SHRINK-FLAG> <RFALSE>)>
<SET SF ,SHRINK-FLAG>
<SETG SHRINK-FLAG <>>
<COND (<NOT <EQUAL? .SF ,PLAYER>>
<COND (<AND <FSET? ,WEED ,RMUNGBIT>
<EQUAL? .SF ,WEED>>
<PUTP ,WEED ,P?SIZE 200>)>
<COND (<VISIBLE? .SF>
<COND (<NOT .NOCR?> <CRLF>)>
<COND (<EQUAL? .SF ,SNAKE>
<TELL
"The serpent slowly and jerkily returns to its former size, swallowing its
tail again in the process." CR>)
(ELSE
<TELL
"With a rather unsettling lack of uniformity, " THE .SF " returns
to its former size.">
<COND (<AND <EQUAL? .SF ,WEED>
<FSET? ,WEED ,RMUNGBIT>>
<COND (<IN? .SF ,WINNER>
<MOVE .SF ,HERE>
<TELL
" It's too heavy to carry.">)
(<EQUAL? <LOC .SF> ,BOTTLE>
<MOVE .SF <META-LOC ,BOTTLE>>
<REMOVE ,BOTTLE>
<TELL
" It bursts the bottle!">)
(<EQUAL? <LOC .SF>
,MAGIC-CARPET
,RANDOM-CARPET>
<MOVE .SF <META-LOC .SF>>)>)>
<CRLF>)>)>)
(ELSE
<SETG SMALL-FLAG <>>
<COND (<NOT .NOCR?> <CRLF>)>
<TELL
"You feel stretched, wrung out, and pulled in all directions. You
are growing." CR>
<COND (<EQUAL? <LOC ,PLAYER> ,CABINET ,PAST-CABINET>
<TOO-LARGE ,CABINET>)
(<IN? ,PLAYER ,ZIPPER>
<RFALSE>)
(<EQUAL? ,HERE ,IN-PIPE ,IN-PIPE-2 ,IN-SEWER>
<TOO-LARGE ,WATER-PIPE>
<RFATAL>)
(<EQUAL? ,HERE ,IN-CHANNEL>
<CRLF>
<GOTO ,OUBLIETTE>)
(<EQUAL? ,HERE ,RUINED-PIPE>
<CRLF>
<GOTO ,RUINS-ROOM>)>)>>
<ROUTINE TOO-LARGE (OBJ)
<TELL
"Unfortunately, you are rather too large for " THE .OBJ " you are in, and are
crushed by its sides as you try to resume your full size." CR>
<JIGS-UP>>
;"from C1"
<ROUTINE I-SNAKE ()
<COND (<EQUAL? ,HERE ,NORTH-SNAKE-ROOM ,SOUTH-SNAKE-ROOM>
<TELL CR
"The scaly wall begins to move, undulating back and forth in the
confined space. A musty odor permeates the air, and you hear
scales scraping on stone. Finally, an enormous head slides into view
from the east and stops with one monstrous eye staring coldly at you.
You notice something unusual about the huge serpent: the tail, which
trails out of the western hole, disappears into the gaping maw of the
creature. You realize that the monster must be huge enough to make a
complete loop!" CR>)>>
<ROUTINE I-UNMALYON-IDOL ()
<DEQUEUE I-IDOL>
<DEQUEUE I-FULL-YAWN>
<DEQUEUE I-IDOL-ASLEEP>
<FCLEAR ,IDOL ,PERSON>
<COND (<EQUAL? ,HERE ,TEMPLE-ROOM>
<CRLF>
<TELL
"The idol turns back into basalt.">
<COND (,IDOL-ASLEEP?
<TELL
" It is curled up comfortably asleep.">)
(,IDOL-YAWNING?
<TELL
" It has been caught in a cheek-stretching yawn.">)>
<CRLF>)>>
<ROUTINE I-IDOL ()
<QUEUE I-IDOL -1>
<COND (<EQUAL? ,HERE ,TEMPLE-ROOM>
<TELL CR
"The idol is ">
<COND (,IDOL-SLEEPED?
<TELL
"looking sleepy and tired.">)
(ELSE
<TELL-IDOL-ACTION>
<TELL
" around the room, searching for something. No doubt
it's you! It looks a little stiff, but for former basalt, it's pretty
supple.">)>
<CRLF>)>>
<ROUTINE TELL-IDOL-ACTION ()
<COND (<IN? ,OPAL ,IDOL> <TELL "looking">)
(ELSE <TELL "groping">)>>
<ROUTINE I-FULL-YAWN ()
<DEQUEUE I-IDOL>
<SETG IDOL-ASLEEP? <>>
<FSET ,MOUTH ,OPENBIT>
<SETG IDOL-YAWNING? T>
<COND (<EQUAL? ,HERE ,TEMPLE-ROOM>
<TELL CR
"The idol is yawning sleepily, its mouth gaping open." CR>)>>
<ROUTINE I-IDOL-ASLEEP ()
<SETG IDOL-YAWNING? <>>
<FCLEAR ,MOUTH ,OPENBIT>
<SETG IDOL-ASLEEP? T>
<COND (<EQUAL? ,HERE ,TEMPLE-ROOM>
<TELL CR
"The idol curls up comfortably and falls asleep on the floor." CR>)>>
<ROUTINE I-OPAL-SMASHES ()
<COND (<AND <IN? ,OPAL ,IDOL> ,OPAL-LOOSE?>
<REMOVE ,OPAL>
<SETG OPAL-LOOSE? <>>
<MOVE ,OPAL-SHARD ,HERE>
<COND (<EQUAL? ,HERE ,TEMPLE-ROOM>
<TELL
"The opal totters one last time and falls. You ">
<COND (<IN? ,PLAYER ,IDOL>
<TELL "grab for it frantically">)
(ELSE
<TELL "try to catch it">)>
<TELL ", but it
escapes your grip and smashes into a million pieces on the idol's
foot." CR>)>)>>
<GLOBAL SLIDE-PROB 10>
<ROUTINE I-AVALANCHE? ()
<COND (<NOT <EQUAL? ,HERE ,CLIFF-TOP>> <RFALSE>)
(<EQUAL? ,TIME-STOPPED? ,HERE> <RFALSE>)
(<PROB ,SLIDE-PROB>
<SETG ROCK-SLIDE-COUNT 0>
<DEQUEUE I-AVALANCHE?>
<QUEUE I-AVALANCHE -1>
<TELL CR
"Something you've done has disturbed the rocks above! Dirt and small stones
are trickling down. " ,IT-LOOKS-LIKE "the whole dike is about to give way!" CR>)
(ELSE
<SETG SLIDE-PROB <+ ,SLIDE-PROB 10>>)>>
<GLOBAL ROCK-SLIDE-COUNT 0>
<ROUTINE HEAR-AVALANCHE ()
<TELL
"You hear the tremendous sliding, deep-voiced roar of thousands of tons of
rock tumbling down the mountain">>
<ROUTINE I-AVALANCHE ()
<COND (,TIME-STOPPED? <RFALSE>)
(<G? ,ROCK-SLIDE-COUNT 3>
<SETG ROCK-SLIDE-COUNT 0>
<DEQUEUE I-AVALANCHE>
<RFALSE>)>
<SETG ROCK-SLIDE-COUNT <+ ,ROCK-SLIDE-COUNT 1>>
<COND (<EQUAL? ,HERE ,CAVE-ENTRANCE ,MOUNTAIN-TOP>
<CRLF>
<HEAR-AVALANCHE>
<COND (<EQUAL? ,HERE ,CAVE-ENTRANCE>
<TELL " to your east">)>
<TELL ,PERIOD>)
(<EQUAL? ,HERE ,CLIFF-TOP ,CLIFF-MIDDLE ,CLIFF-BOTTOM>
<CRLF>
<COND (<EQUAL? ,ROCK-SLIDE-COUNT 1>
<TELL
"Huge rocks and boulders are tumbling down, making an almost continuous
curtain above you. If you don't do something soon, you will die!" CR>)
(<OR <AND <EQUAL? ,HERE ,CLIFF-TOP>
<G? ,ROCK-SLIDE-COUNT 1>>
<AND <EQUAL? ,HERE ,CLIFF-MIDDLE>
<G? ,ROCK-SLIDE-COUNT 2>>
<AND <EQUAL? ,HERE ,CLIFF-BOTTOM>
<G? ,ROCK-SLIDE-COUNT 3>>>
<DEQUEUE I-AVALANCHE>
<SETG ROCK-SLIDE-COUNT 0>
<COND (<IN? ,PLAYER ,ZIPPER>
<TELL
"Although you can't see or feel it, y">)
(ELSE <TELL "Y">)>
<JIGS-UP
"ou are swept away down the cliff face by thousands of tons of rock.
A huge cloud of dust blowing away down the valley is your only memorial.">)
(<EQUAL? ,HERE ,CLIFF-TOP ,CLIFF-MIDDLE ,CLIFF-BOTTOM>
<ROCKS-TUMBLING>)>)>>
<ROUTINE ROCKS-TUMBLING ()
<TELL
"Thousands of tons of rock are tumbling down the mountainside!" CR>>
<ROUTINE I-OGRE ()
<COND (<EQUAL? ,TIME-STOPPED? ,OGRE-CAVE> <RFALSE>)
(<EQUAL? ,HERE ,CAVE-ENTRANCE ,OGRE-BEDROOM>
<COND (<EQUAL? ,ESPNIS? ,OGRE>
<CRLF>
<OGRE-NOISES>)
(,SNEEZY?
<TELL CR
"You hear explosive sneezing from the cave." CR>)
(<PROB 50>
<CRLF>
<OGRE-NOISES>)>)
(<EQUAL? ,HERE ,OGRE-CAVE>
<COND (<EQUAL? ,ESPNIS? ,OGRE>
<TELL CR
"The ogre snores loudly." CR>)
(,SNEEZY?
<TELL CR
"The ogre doubles over in a spectacular paroxysm of sneezing." CR>)
(<PROB 50>
<TELL CR
"The ogre sneezes." CR>)>)
(ELSE
<DEQUEUE I-OGRE>
<RFALSE>)>>
<ROUTINE OGRE-NOISES ()
<COND (<NOT <TIME-FROZEN?>>
<TELL
"You hear a noise from within the cave that sounds like ">
<COND (<EQUAL? ,ESPNIS? ,OGRE> <TELL "snoring">)
(T <TELL "a sneeze">)>
<TELL ,PERIOD>)>>
;"from C2"
<ROUTINE I-FLOTSAM ()
<SINK-STUFF ,OCEAN-ROOM>
<SINK-STUFF ,LOST-IN-OCEAN>>
<ROUTINE SINK-STUFF (RM "AUX" (F <FIRST? .RM>) N)
<REPEAT ()
<COND (<NOT .F> <RETURN>)>
<SET N <NEXT? .F>>
<COND (<EQUAL? .F ,PLAYER ,GROUPER> T)
(<AND <EQUAL? .F ,WATER-CUBE>
<QUEUED? I-CUBE-SINKS>>
T)
(<OR <EQUAL? .F ,ZIPPER>
<NOT <FSET? .F ,CONTBIT>>
<AND <FSET? .F ,OPENBIT>
<PROB 75>>>
<MOVE .F ,OCEAN-FLOOR>
<FCLEAR .F ,NDESCBIT>
<COND (<EQUAL? ,HERE .RM>
<TELL
CTHE .F " sinks beneath the waves." CR>)>)
(ELSE
<QUEUE I-FLOTSAM 2>)>
<SET F .N>>>
<ROUTINE I-GROUPER ("AUX" (SNACK <>))
<COND (<IN? ,FISH ,OCEAN-ROOM>
<SET SNACK ,FISH>)
(<IN? ,BREAD ,OCEAN-ROOM>
<SET SNACK ,BREAD>)
(<IN? ,WATER-CUBE ,OCEAN-ROOM>
<SET SNACK ,WATER-CUBE>)
(<IN? ,BOTTLE ,OCEAN-ROOM>
<SET SNACK ,BOTTLE>)>
<COND (.SNACK
<MOVE .SNACK ,GROUPER>
<QUEUE I-GROUPER-IN-NEST 2>
<COND (<EQUAL? ,HERE ,OCEAN-ROOM>
<TELL CR
"The grouper, nosing around for something tasty, swallows " THE .SNACK
" and starts to swim downward, temporarily sated." CR>)>)>>
<ROUTINE I-CUBE-SINKS ()
<COND (<IN? ,WATER-CUBE ,OCEAN-ROOM>
<MOVE ,WATER-CUBE ,OCEAN-FLOOR>
<FCLEAR ,WATER-CUBE ,NDESCBIT>
<COND (<EQUAL? ,HERE ,OCEAN-ROOM>
<TELL CR
CTHE ,WATER-CUBE " sinks out of sight." CR>)>)>>
<ROUTINE I-GROUPER-IN-NEST ()
<MOVE ,GROUPER ,OCEAN-FLOOR>
<COND (<EQUAL? ,HERE ,OCEAN-ROOM>
<TELL
"The grouper swims down out of sight." CR>)
(<EQUAL? ,HERE ,OCEAN-FLOOR>
<TELL
"The grouper approaches, its goggle eyes staring curiously." CR>)>>
<ROUTINE I-TINSOT ()
<SETG ICED-OBJECT <>>
<COND (<NOT <QUEUED? I-OUBLIETTE-EMPTIES>>
<SETG FREEZE-FLAG 0>)>
<RFALSE>>
<ROUTINE I-OUBLIETTE-FILLS ("AUX" (H <>))
<COND (<EQUAL? ,HERE ,OUBLIETTE> <SET H T>)>
<COND (<L? ,WATER-FLAG 3>
<ROB ,OUBLIETTE <> ,ICEBERG>
<SETG WATER-FLAG <+ ,WATER-FLAG 1>>
<COND (.H
<TELL CR
"The water level rises. The oubliette is "
<GET ,WATER-HEIGHTS ,WATER-FLAG> " full.">
<COND (<NOT <IN? ,PLAYER ,ICEBERG>>
<SOAK-PLAYER>)>
<NOT-SITTING>
<CRLF>)>)
(ELSE
<SETG WATER-FLAG 4>
<DEQUEUE I-OUBLIETTE-FILLS>
<QUEUE I-OUBLIETTE-EMPTIES 5>
<COND (.H
<TELL CR
"The oubliette is full. There is about four feet of space between the
water and the roof. The water must have reached its level, because it has
ceased to rise. You are ">
<COND (<IN? ,PLAYER ,ICEBERG>
<TELL
"floating serenely on a small ice floe.">)
(ELSE
<TELL
"splashing a tantalizing distance from the roof and trap door.">)>
<CRLF>)>)>>
<ROUTINE I-OUBLIETTE-EMPTIES ("AUX" (H <>))
<COND (<EQUAL? ,HERE ,OUBLIETTE> <SET H T>)>
<COND (<AND <EQUAL? ,WATER-FLAG 4>
<G? ,FREEZE-FLAG 0>>
<SETG FREEZE-FLAG 0>
<QUEUE I-OUBLIETTE-EMPTIES -1>
<COND (.H
<TELL CR
"The water level has begun to fall." CR>)>)
(ELSE
<SETG WATER-FLAG <- ,WATER-FLAG 1>>
<COND (<G? ,WATER-FLAG 0>
<COND (.H
<TELL CR
"The water level falls. The oubliette is "
<GET ,WATER-HEIGHTS ,WATER-FLAG> " full." CR>)>)
(ELSE
<DEQUEUE I-OUBLIETTE-EMPTIES>
<COND (<IN? ,PLAYER ,ICEBERG>
<MOVE ,WINNER ,HERE>)>
<ROB ,ICEBERG ,HERE>
<REMOVE ,ICEBERG>
<SETG ICED-OBJECT <>>
<COND (.H
<TELL CR
"The oubliette is empty again. All the ice has melted, and the pipes
are open again." CR>)>)>)>>
<ROUTINE I-DOWNSTREAM ("AUX" (RM <>))
<COND (<EQUAL? ,HERE ,IN-CHANNEL>
<SET RM ,IN-PIPE>)
(<EQUAL? ,HERE ,IN-PIPE>
<SET RM ,IN-PIPE-2>)
(<EQUAL? ,HERE ,IN-PIPE-2>
<SET RM ,RUINED-PIPE>)
(<EQUAL? ,HERE ,RUINED-PIPE>
<SET RM ,IN-SEWER>)>
<COND (.RM
<TELL CR
"The rushing water is forcing you downstream." CR CR>
<GOTO .RM>)>>
<GLOBAL ROC-COUNT 0>
<GLOBAL ROC-DESCS
<PTABLE
"tiny black dot silhouetted against the clouds."
"large object silhouetted against the clouds."
"large bird approaching."
"large bird circling the tower and eyeing you suspiciously.">>
<ROUTINE I-ROC ()
<COND (<EQUAL? ,HERE ,GUARD-TOWER>
<SETG ROC-COUNT <+ ,ROC-COUNT 1>>
<COND (<IN? ,PLAYER ,ZIPPER>
<RFALSE>)
(<G? ,ROC-COUNT 4>
<DEQUEUE I-ROC>
<ROC-GRABS-PLAYER>
<CRLF>
<GOTO ,MIDAIR>)
(<G? ,ROC-COUNT 0>
<THIS-IS-IT ,ROC>
<TELL CR "There is a ">
<DESCRIBE-ROC>)>)>>
<GLOBAL ROC-FLY-COUNT 0>
<ROUTINE I-ROC-FLY ()
<SETG ROC-FLY-COUNT <+ ,ROC-FLY-COUNT 1>>
<SETG EW-COUNT <- ,EW-COUNT 1>>