-
Notifications
You must be signed in to change notification settings - Fork 27
/
globals.zil
2460 lines (2260 loc) · 71.1 KB
/
globals.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
"GLOBALS for
ZORK ZERO
(c) Copyright 1988 Infocom, Inc. All Rights Reserved."
;<BEGIN-SEGMENT 0>
<INCLUDE "BASEDEFS" "FIND" "PDEFS">
<ADJ-SYNONYM LARGE HUGE BIG GIANT GIGANTIC TREMENDOUS MIGHTY MASSIVE ENORMOUS
;"LARGER HUGER BIGGER MIGHTIER">
<ADJ-SYNONYM SMALL SMALLER TINY TINIER LITTLE PETITE TEENSY WEENSY>
;<ADJ-SYNONYM MY MINE> ;"screws up parsing of Iron Mine and Granola Mine"
<GLOBAL LIT T>
<GLOBAL MOVES 0>
<GLOBAL SCORE 0>
<GLOBAL HERE:OBJECT BANQUET-HALL>
<OBJECT GLOBAL-OBJECTS
;(SYNONYM ZZMGCK) ;"No, this synonym doesn't need to exist... sigh"
(DESC "it")
(FLAGS INVISIBLE TOUCHBIT SURFACEBIT TRYTAKEBIT OPENBIT SEARCHBIT
TRANSBIT WEARBIT ONBIT LIGHTBIT RLANDBIT WORNBIT INTEGRALBIT
VEHBIT OUTSIDEBIT CONTBIT VOWELBIT LOCKEDBIT NDESCBIT DOORBIT
ACTORBIT PARTBIT INBIT FEMALEBIT KLUDGEBIT DROPBIT BURNBIT
ORBBIT FLAMEBIT NALLBIT KEYBIT UNDERGROUNDBIT REDESCBIT)>
<OBJECT LOCAL-GLOBALS
(LOC GLOBAL-OBJECTS)
(DESC "it")
;(SYNONYM ZZMGCK)
;(DESCFCN 0)
;(GLOBAL GLOBAL-OBJECTS)
;(FDESC "F")
;(LDESC "F")
;(SIZE 0)
;(TEXT "")
;(CAPACITY 0)
;(GENERIC ME-F)>
<OBJECT ROOMS
;(IN TO ROOMS)
(DESC "it")>
<OBJECT INTNUM
(LOC GLOBAL-OBJECTS)
(DESC "number")
(SYNONYM NUMBER NUMBERS INT.NUM)
(ADJECTIVE INT.NUM INT.TIM)
(ACTION INTNUM-F)>
<BEGIN-SEGMENT 0>
<ROUTINE INTNUM-F ("AUX" X)
<COND (<AND <EQUAL? ,HERE ,CONSTRUCTION>
<NOUN-USED? ,INTNUM ,W?NUMBER>>
<TELL
"The number engraved on the wall is \"" N ,CONSTRUCTION-LOC ".\"" CR>)>>
<END-SEGMENT>
<OBJECT IT
(LOC GLOBAL-OBJECTS)
(SYNONYM IT ;THEM)
(DESC "it")
(FLAGS VOWELBIT NARTICLEBIT TOUCHBIT)>
<OBJECT HIM
(LOC GLOBAL-OBJECTS)
(SYNONYM HIM HIMSELF)
(DESC "him")
(FLAGS NARTICLEBIT TOUCHBIT)>
<OBJECT HER
(LOC GLOBAL-OBJECTS)
(SYNONYM HER HERSELF)
(DESC "her")
(FLAGS NARTICLEBIT TOUCHBIT)>
<OBJECT LEFT-RIGHT
(LOC GLOBAL-OBJECTS)
(DESC "that way")
(SYNONYM LEFT RIGHT)
(FLAGS NARTICLEBIT)
(ACTION LEFT-RIGHT-F)>
<BEGIN-SEGMENT 0>
<ROUTINE LEFT-RIGHT-F ()
<COND (<VERB? CHASTISE> ;"LOOK LEFT or LOOK RIGHT"
<TELL "You see nothing unusual." CR>)
(<VERB? WALK WALK-TO ENTER>
<COND (<AND <EQUAL? ,HERE ,WEIRD>
<NOUN-USED? ,LEFT-RIGHT ,W?LEFT>
<EQUAL? ,TOWER-BEATEN ,PYRAMID-L>>
<DO-WALK ,P?WEST>)
(<AND <EQUAL? ,HERE ,WEIRD>
<NOUN-USED? ,LEFT-RIGHT ,W?RIGHT>
<EQUAL? ,TOWER-BEATEN ,PYRAMID-R>>
<DO-WALK ,P?EAST>)
(<EQUAL? ,HERE ,TESTING-ROOM>
<PERFORM ,V?ENTER
<COND (<NOUN-USED? ,LEFT-RIGHT ,W?RIGHT>
,RIGHT-BOOTH)
(T
,LEFT-BOOTH)>>)
(T
<V-WALK-AROUND>)>)
(<VERB? SET>
<TELL "You turn ninety degrees, with little effect." CR>)>>
<END-SEGMENT>
<BEGIN-SEGMENT CASTLE>
<OBJECT GRUE
(LOC GLOBAL-OBJECTS)
(SYNONYM GRUE GRUES)
(ADJECTIVE LURKING SINISTER HUNGRY SILENT)
(DESC "lurking grue")
(RESEARCH
"\"The grue was once a sinister, lurking presence in the dark places of the
earth. Its favorite diet was adventurers, but its insatiable appetite was
tempered by its fear of light. No grue was ever seen by the light of day,
and few ever survived its fearsome jaws to tell the tale.\"|
The encyclopedia goes on to say, \"Grues were eradicated from the face of
the world during the time of Entharion, many by his own hand and his legendary
blade Grueslayer. Although it has now been many a century since the last grue
sighting, old hags still delight in scaring children by telling them that
grues still lurk in the bottomless pits of the Empire, and will one day lurk
forth again.\"")
(ACTION GRUE-F)>
<END-SEGMENT>
<BEGIN-SEGMENT 0>
<ROUTINE GRUE-F ()
<COND (<VERB? EXAMINE FIND>
<COND (<FSET? ,LANTERN ,TRYTAKEBIT>
<TELL
"Don't be silly! There haven't been grues around for centuries!" CR>)
(T
<TELL
"There is no grue here, but I'm sure there is at least one lurking
in the darkness nearby.">
<COND (<AND <FIND-IN ,PROTAGONIST ,ONBIT>
<NOT <FSET? ,HERE ,ONBIT>>>
<TELL
" I wouldn't let my light go out if I were you!" CR>)>)>)>>
<OBJECT SAILOR
(LOC GLOBAL-OBJECTS)
(DESC "sailor")
(SYNONYM SAILOR)
(ACTION SAILOR-F)>
<ROUTINE SAILOR-F ("OPT" (ARG <>))
<COND (<EQUAL? .ARG ,M-WINNER>
<COND (<VERB? HELLO>
<TELL "Nothing happens here." CR>)
(T
<CANT-SEE ,SAILOR>)>)
(<VERB? WAIT-FOR>
<TELL "You are liable to be waiting for several sequels." CR>)
(<AND <HANDLE ,SAILOR>
<NOT <VERB? TELL HELLO>>>
<CANT-SEE ,SAILOR>)>>
<OBJECT GLOBAL-SLEEP
(LOC GLOBAL-OBJECTS)
(DESC "sleep")
(SYNONYM SLEEP NAP SNOOZE)
(FLAGS NARTICLEBIT)
(ACTION GLOBAL-SLEEP-F)>
<ROUTINE GLOBAL-SLEEP-F ()
<COND (<VERB? WALK-TO TAKE>
<V-SLEEP>)
(<AND <VERB? PUT-TO>
<PRSI? ,GLOBAL-SLEEP>>
<COND (<PRSO? ,BEDBUG>
<TELL "You sing a brief lullaby. ">
<REMOVE-BEDBUG "hear">)
(T
<TELL "You're not a hypnotist." CR>)>)>>
<OBJECT LULLABY
(LOC GLOBAL-OBJECTS)
(DESC "lullaby")
(SYNONYM LULLABY LULLABYE SONG)
(ACTION LULLABY-F)>
<ROUTINE LULLABY-F ("AUX" ACTOR)
<COND (<VERB? SING>
<COND (<NOT ,PRSI>
<COND (<IN? ,BEDBUG ,HERE>
<SETG PRSI ,BEDBUG>)
(<SET ACTOR <FIND-IN ,HERE ,ACTORBIT>>
<SETG PRSI .ACTOR>)
(T
<TELL
"[If you put me to sleep, you'd have a heck of a time communicating with the
game! By the way, don't expect any offers from the Borphee Opera Company.]" CR>
<RTRUE>)>)>
<COND (<PRSI? ,BEDBUG>
<PERFORM ,V?PUT-TO ,BEDBUG ,GLOBAL-SLEEP>
<RTRUE>)
(<FSET? ,PRSI ,ACTORBIT>
<TELL
"Despite your best rendition," T ,PRSI " remains awake." CR>)
(T
<TELL
"Amazingly," T ,PRSI " is now motionless! You must have put
it right to sleep! Incredible! What a talent!" CR>)>)
(<VERB? PLAY>
<COND (<AND <IN? ,BEDBUG ,HERE>
<NOUN-USED? ,LULLABY ,W?LULLABY ,W?LULLABYE>>
<PERFORM ,V?PUT-TO ,BEDBUG ,GLOBAL-SLEEP>
<RTRUE>)
(<ULTIMATELY-IN? ,VIOLIN ,PROTAGONIST>
<TELL "[with" T ,VIOLIN "]" CR>
<PERFORM-PRSA ,VIOLIN>)
(<IN? ,HARMONICA ,PROTAGONIST>
<TELL "[with" T ,HARMONICA "]" CR>
<PERFORM-PRSA ,HARMONICA>)
(T
<TELL "You have no instrument to play it on." CR>)>)>>
<OBJECT GROUND
(LOC GLOBAL-OBJECTS)
(SYNONYM FLOOR GROUND SAND)
(SDESC "ground")
(ACTION GROUND-F)>
<ROUTINE GROUND-F ()
<SET-GROUND-DESC>
<COND (<VERB? EXAMINE>
<COND (<EQUAL? ,HERE ,OUBLIETTE>
<TELL "Mud. Squishy mud." CR>)
(<EQUAL? ,HERE ,PITS>
<PERFORM ,V?EXAMINE ,PITS-OBJECT>
<RTRUE>)
(<EQUAL? ,HERE ,TIGHT-SQUEEZE>
<TELL
"You see a man-sized opening through which cool air seems to flow." CR>)>)
(<VERB? LOOK-UNDER>
<IMPOSSIBLES>)
(<VERB? CLIMB-UP CLIMB-ON CLIMB ENTER>
<WASTES>)
(<VERB? LEAVE>
<DO-WALK ,P?UP>)>>
<ROUTINE SET-GROUND-DESC ()
<COND (<FSET? ,HERE ,OUTSIDEBIT>
<PUTP ,GROUND ,P?SDESC "ground">)
(<FSET? ,HERE ,DESERTBIT>
<PUTP ,GROUND ,P?SDESC "sand">)
(T
<PUTP ,GROUND ,P?SDESC "floor">)>>
<OBJECT GLOBAL-HOLE ;"exists entirely so player can type DIG HOLE"
(LOC GLOBAL-OBJECTS)
(DESC "hole")
(SYNONYM HOLE)
(ACTION GLOBAL-HOLE-F)>
<ROUTINE GLOBAL-HOLE-F ()
<COND (<AND <VERB? DIG>
<PRSO? ,GLOBAL-HOLE>>
<COND (,PRSI
<COND (<PRSI? ,SHOVEL>
<PERFORM-PRSA ,GROUND ,SHOVEL>)
(<ULTIMATELY-IN? ,SHOVEL>
<TELL "[with the shovel]" CR>
<PERFORM-PRSA ,PRSI ,SHOVEL>)
(T
<TELL "[with your hands]" CR>
<PERFORM-PRSA ,PRSI ,HANDS>)>)
(<ULTIMATELY-IN? ,SHOVEL>
<TELL "[with the shovel]" CR>
<PERFORM-PRSA ,GROUND ,SHOVEL>)
(T
<TELL "[with your hands]" CR>
<PERFORM-PRSA ,GROUND ,HANDS>)>)
(<HANDLE ,GLOBAL-HOLE>
<CANT-SEE ,GLOBAL-HOLE>)>>
<OBJECT WALL
(LOC GLOBAL-OBJECTS)
(DESC "wall")
(SYNONYM WALL WALLS)
(ADJECTIVE NORTH ;N ;NORTHEAST NE EAST ;E ;SOUTHEAST SE
SOUTH ;S ;SOUTHWEST SW WEST ;W ;NORTHWEST NW
REAR FAR)
(FLAGS NDESCBIT TOUCHBIT)
(ACTION WALL-F)>
<ROUTINE WALL-F ("AUX" (CNT 0))
<COND (<VERB? READ EXAMINE>
<COND (<EQUAL? ,HERE ,CHURCH>
<PERFORM ,V?READ ,TENET>
<RTRUE>)
(<AND <EQUAL? ,HERE ,CELL>
<IN? ,COBWEBS ,CELL>>
<TELL ,CELL-WALL-DESC CR>)>)
(<AND <VERB? CLEAN>
<EQUAL? ,HERE ,CELL>
<ADJ-USED? ,WALL ,W?REAR>
<IN? ,COBWEBS ,CELL>>
<PERFORM ,V?CLEAN ,COBWEBS>
<RTRUE>)
(<VERB? THROW-OVER>
<COND (<EQUAL? ,HERE ,PERIMETER-WALL>
<TELL
"Babe Flathead himself couldn't toss something over this towering wall!" CR>)
(T
<TELL "The wall joins the ceiling!" CR>)>)
(<AND <VERB? PUT PUT-ON>
<PRSO? ,N-S-PASSAGE ,NW-SE-PASSAGE>>
<COND (<ADJ-USED? ,WALL <>>
<SETG P-WON <>>
<TELL
"[You didn't specify which wall you meant: EAST WALL for example.]" CR>)
(<OR <AND <PRSO? ,N-S-PASSAGE>
<NOT <ADJ-USED? ,WALL ,W?NORTH ,W?N>>
<NOT <ADJ-USED? ,WALL ,W?SOUTH ,W?S>>>
<AND <PRSO? ,NW-SE-PASSAGE>
<NOT <ADJ-USED? ,WALL ,W?NORTHWEST ,W?NW>>
<NOT <ADJ-USED? ,WALL ,W?SOUTHEAST ,W?SE>>>>
<TELL
,YOU-CANT "install the passage on that wall--it's" AR ,PRSO>)
(<PASSAGE-THERE>
<RTRUE>)
(<OR <EQUAL? ,HERE ,GONDOLA ,HOLD>
<EQUAL? <LOC ,PROTAGONIST> ,YACHT ,DB>>
<TELL
"A built-in safety feature prevents the passage from being
installed in a vehicle." CR>)
(T
<MOVE ,PRSO ,HERE>
<FCLEAR ,PRSO ,TAKEBIT>
<SETG COMPASS-CHANGED T>
<PUTP ,PRSO ,P?OWNER ,WALL>
<TELL "There's now a passage leading ">
<COND (<PRSO? ,N-S-PASSAGE>
<COND (<EQUAL? ,HERE ,CONSTRUCTION>
<SETG N-S-PASSAGE-LOC ,CONSTRUCTION-LOC>)>
<COND (<ADJ-USED? ,WALL ,W?NORTH ,W?N>
<SETG N-S-PASSAGE-DIR ,P?NORTH>
<COND (<AND <EQUAL? ,HERE ,CONSTRUCTION>
<NOT <L? ,CONSTRUCTION-LOC 8>>>
;"second clause in predicate: can't go
north from the top Construction row"
<PUT ,NORTH-EXITS 0
<+ ,CONSTRUCTION-LOC 100>>
<REPEAT ()
;"passage appears in room at other end"
<COND (<EQUAL?
<GET ,STORAGE-TABLE .CNT> 0>
<PUT ,STORAGE-TABLE .CNT
<+ <- ,CONSTRUCTION-LOC 8>
,CONSTRUCTION-OFFSET>>
<PUT ,STORAGE-TABLE
<+ .CNT 1> ,N-S-PASSAGE>
<RETURN>)
(T
<SET CNT <+ .CNT 2>>)>>)>
<TELL "nor">)
(T
<SETG N-S-PASSAGE-DIR ,P?SOUTH>
<COND (<AND <EQUAL? ,HERE ,CONSTRUCTION>
<NOT <G? ,CONSTRUCTION-LOC 55>>>
;"last clause in predicate: you can't
go south from bottom Construction row"
<PUT ,NORTH-EXITS 0
<+ ,CONSTRUCTION-LOC 108>>
<REPEAT ()
;"passage appears in room at other end"
<COND (<EQUAL?
<GET ,STORAGE-TABLE .CNT> 0>
<PUT ,STORAGE-TABLE .CNT
<+ <+ ,CONSTRUCTION-LOC 8>
,CONSTRUCTION-OFFSET>>
<PUT ,STORAGE-TABLE
<+ .CNT 1> ,N-S-PASSAGE>
<RETURN>)
(T
<SET CNT <+ .CNT 2>>)>>)>
<TELL "sou">)>
<TELL "th from the room." CR>)
(T
<COND (<EQUAL? ,HERE ,CONSTRUCTION>
<SETG NW-SE-PASSAGE-LOC
,CONSTRUCTION-LOC>)>
<COND (<ADJ-USED? ,WALL ,W?NORTHWEST ,W?NW>
<SETG NW-SE-PASSAGE-DIR ,P?NW>
<COND (<AND <EQUAL? ,HERE ,CONSTRUCTION>
<NOT <OR <EQUAL?
<MOD ,CONSTRUCTION-LOC 8>
0>
<L? ,CONSTRUCTION-LOC 8>>>>
;"last predicate clause: you can't go NW
from top or west rows of Construction"
<PUT ,SE-EXITS 0
<+ ,CONSTRUCTION-LOC 91>>
<REPEAT ()
;"passage appears in room at other end"
<COND (<EQUAL?
<GET ,STORAGE-TABLE .CNT> 0>
<PUT ,STORAGE-TABLE .CNT
<+ <- ,CONSTRUCTION-LOC 9>
,CONSTRUCTION-OFFSET>>
<PUT ,STORAGE-TABLE
<+ .CNT 1> ,NW-SE-PASSAGE>
<RETURN>)
(T
<SET CNT <+ .CNT 2>>)>>)>
<TELL "northwe">)
(T
<SETG NW-SE-PASSAGE-DIR ,P?SE>
<COND (<AND <EQUAL? ,HERE ,CONSTRUCTION>
<NOT <OR <EQUAL?
<MOD ,CONSTRUCTION-LOC 8>
7>
<G? ,CONSTRUCTION-LOC 55>>>>
;"last predicate clause: you can't go SE
from bottom or east rows of Const site"
<PUT ,SE-EXITS 0
<+ ,CONSTRUCTION-LOC 100>>
<REPEAT ()
;"passage appears in room at other end"
<COND (<EQUAL?
<GET ,STORAGE-TABLE .CNT> 0>
<PUT ,STORAGE-TABLE .CNT
<+ <+ ,CONSTRUCTION-LOC 9>
,CONSTRUCTION-OFFSET>>
<PUT ,STORAGE-TABLE
<+ .CNT 1> ,NW-SE-PASSAGE>
<RETURN>)
(T
<SET CNT <+ .CNT 2>>)>>)>
<TELL "southea">)>
<TELL "st from the room." CR>)>)>)>>
<ROUTINE PASSAGE-THERE ("AUX" (PASSAGE? <>))
<COND (<ADJ-USED? ,WALL ,W?NORTH ,W?N>
<COND (<EQUAL? ,HERE ,PEG-ROOM>
<COND (<NOT ,PEG-PASSAGE-OPENED>
<REPELLED "north">
<SET PASSAGE? ,M-FATAL>)
(T
<SET PASSAGE? <>>)>)
(<EQUAL? ,HERE ,SECRET-PASSAGE>
<COND (<NOT ,SECRET-PASSAGE-OPEN>
<REPELLED "north">
<SET PASSAGE? ,M-FATAL>)
(T
<SET PASSAGE? <>>)>)
(<EQUAL? ,HERE ,CONSTRUCTION>
<COND (<INTBL? ,NORTH-EXITS ,CONSTRUCTION-LOC 11>
<SET PASSAGE? T>)>)
(<AND <EQUAL? ,HERE ,WEIRD>
<NOT <EQUAL? ,TOWER-BEATEN ,PYRAMID>>>
<REPELLED "north">
<SET PASSAGE? ,M-FATAL>)
(<EQUAL? ,HERE ,G-U-MOUNTAIN>
<COND (<IN? ,BOULDER ,HERE>
<REPELLED "north">
<SET PASSAGE? ,M-FATAL>)
(T
<SET PASSAGE? <>>)>)
(<GETPT ,HERE ,P?NORTH>
<SET PASSAGE? T>)>)
(<ADJ-USED? ,WALL ,W?SOUTH ,W?S>
<COND (<EQUAL? ,HERE ,CONSTRUCTION>
<COND (<INTBL? ,NORTH-EXITS <+ ,CONSTRUCTION-LOC 8> 11>
<SET PASSAGE? T>)>)
(<EQUAL? ,HERE ,THRONE-ROOM>
<COND (<NOT ,SECRET-PASSAGE-OPEN>
<REPELLED "south">
<SET PASSAGE? ,M-FATAL>)
(T
<SET PASSAGE? <>>)>)
(<GETPT ,HERE ,P?SOUTH>
<SET PASSAGE? T>)>)
(<ADJ-USED? ,WALL ,W?NORTHWEST ,W?NW>
<COND (<EQUAL? ,HERE ,CONSTRUCTION>
<COND (<INTBL? ,SE-EXITS <- ,CONSTRUCTION-LOC 9> 7>
<SET PASSAGE? T>)>)
(<EQUAL? ,HERE ,PERIMETER-WALL>
<SET PASSAGE? <>>)
(<GETPT ,HERE ,P?NW>
<SET PASSAGE? T>)>)
(<ADJ-USED? ,WALL ,W?SOUTHEAST ,W?SE>
<COND (<EQUAL? ,HERE ,CONSTRUCTION>
<COND (<INTBL? ,SE-EXITS ,CONSTRUCTION-LOC 7>
<SET PASSAGE? T>)>)
(<GETPT ,HERE ,P?SE>
<SET PASSAGE? T>)>)>
<COND (<EQUAL? .PASSAGE? ,M-FATAL> ;"handled earlier in routine"
<RTRUE>)
(.PASSAGE?
<TELL "There's already an exit in that direction!" CR>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE REPELLED (STRING)
<TELL
"Strangely, the passage seems repelled by the " .STRING " wall, as though
two inconsistent types of magic were at work in the same place." CR>>
<OBJECT GLOBAL-PASSAGE
(LOC GLOBAL-OBJECTS)
(DESC "passage")
(SYNONYM PASSAGE PASSAGEWAY TUNNEL)
(ADJECTIVE GLOOMY DARK SECRET HIDDEN WIDE NARROW LOW STEEP SLOPING
DUSTY UNEVEN WINDING FORBIDDING GRAVELLY HALF-BURIED
HIGHWAY POORLY-DUG)
(ACTION GLOBAL-PASSAGE-F)>
<ROUTINE GLOBAL-PASSAGE-F ()
<COND (<VERB? ENTER>
<V-WALK-AROUND>)>>
<OBJECT CEILING
(LOC GLOBAL-OBJECTS)
(FLAGS NDESCBIT TOUCHBIT)
(DESC "ceiling")
(SYNONYM CEILING ROOF)
(ADJECTIVE LOW HIGH)
(ACTION CEILING-F)>
<ROUTINE CEILING-F ()
<COND (<AND <NOUN-USED? ,CEILING ,W?ROOF>
<EQUAL? ,HERE ,ROOF ,PARAPET>>
<COND (<VERB? THROW-FROM>
<REMOVE ,PRSO>
<COND (<OR <PRSO? ,PERCH>
<ULTIMATELY-IN? ,PERCH ,PRSO>>
<SETG REMOVED-PERCH-LOC ,GROUND>)>
<TELL
"You hear a \"splat\" as" T ,PRSO " sinks into the ground far below." CR>)
(<PRSO? ,CEILING>
<PERFORM-PRSA ,GLOBAL-HERE ,PRSI>)
(T
<PERFORM-PRSA ,PRSO ,GLOBAL-HERE>)>)
(<AND <FSET? ,HERE ,OUTSIDEBIT>
<HANDLE ,CEILING>>
<CANT-SEE ,CEILING>)
(<VERB? EXAMINE>
<COND (<EQUAL? ,HERE ,BARBICAN>
<TELL
"It's too gloomy in here to make out any of the features of the ceiling." CR>)
(<EQUAL? ,HERE ,MEGABOZ-HUT>
<TELL ,MEGABOZ-CEILING-DESC CR>)>)
(<VERB? LOOK-UNDER>
<PERFORM ,V?LOOK>
<RTRUE>)>>
<OBJECT SLIME
(LOC LOCAL-GLOBALS)
(DESC "slime")
(SYNONYM SLIME)
(ADJECTIVE THICK BLACK)
(FLAGS NARTICLEBIT)
(ACTION SLIME-F)>
<ROUTINE SLIME-F ()
<COND (<VERB? TASTE TOUCH EAT>
<TELL "Mega-yucko!" CR>)>>
<OBJECT WATER
(LOC GLOBAL-OBJECTS)
(DESC "water")
(SYNONYM WATER WATERS GLOOP GLOOPS)
(ADJECTIVE ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE ;TEN INT.NUM)
(FLAGS NARTICLEBIT)
(GENERIC G-VIAL-WATER-F)
(OWNER <>) ;"set by GOTO"
(ACTION WATER-F)>
<ROUTINE WATER-F ("AUX" X)
<COND (<SET X <FIND-WATER>>
T)
(<AND <VISIBLE? ,LARGE-VIAL>
<VISIBLE? ,SMALL-VIAL>
<G? ,LARGE-VIAL-GLOOPS 0>
<G? ,SMALL-VIAL-GLOOPS 0>>
<TELL ,WHICH-WATER>
<RTRUE>)
(<AND <VISIBLE? ,LARGE-VIAL>
<G? ,LARGE-VIAL-GLOOPS 0>>
<SET X ,LARGE-VIAL>)
(<AND <VISIBLE? ,SMALL-VIAL>
<G? ,SMALL-VIAL-GLOOPS 0>>
<SET X ,SMALL-VIAL>)
(<NOT <HANDLE ,WATER>>
<RFALSE>)
(T
<TELL ,YOU-CANT-SEE-ANY "water here.]" CR>
<RTRUE>)>
<COND (<AND <VERB? COUNT>
<NOUN-USED? ,WATER ,W?GLOOPS>>
<COND (<VISIBLE? ,LARGE-VIAL>
<TELL "The large vial ">
<COND (<EQUAL? ,LARGE-VIAL-GLOOPS 0>
<TELL "is empty">)
(T
<TELL "contains " N ,LARGE-VIAL-GLOOPS " gloop">
<COND (<NOT <EQUAL? ,LARGE-VIAL-GLOOPS 1>>
<TELL "s">)>)>
<COND (<VISIBLE? ,SMALL-VIAL>
<TELL ". ">)
(T
<TELL ,PERIOD-CR>)>)>
<COND (<VISIBLE? ,SMALL-VIAL>
<TELL "The small vial ">
<COND (<EQUAL? ,SMALL-VIAL-GLOOPS 0>
<TELL "is empty">)
(T
<TELL "contains " N ,SMALL-VIAL-GLOOPS " gloop">
<COND (<NOT <EQUAL? ,SMALL-VIAL-GLOOPS 1>>
<TELL "s">)>)>
<TELL ,PERIOD-CR>)>)
(<AND <VERB? FILL>
<PRSI? ,WATER>>
<COND (<PRSO? ,SMALL-VIAL ,LARGE-VIAL>
<COND (<EQUAL? .X ,LARGE-VIAL>
<PERFORM ,V?FILL ,PRSO ,LARGE-VIAL>
<RTRUE>)
(<EQUAL? .X ,SMALL-VIAL>
<PERFORM ,V?FILL ,PRSO ,SMALL-VIAL>
<RTRUE>)
(T
<RFALSE> ;"handled by VIAL-F")>)
(<PRSO? ,CUP>
<TELL
"The water evaporates in a puff of smoke as soon as it touches the cup.
A strong magic is at work here!" CR>)
(T
<IMPOSSIBLES>)>)
(<AND <VERB? REMOVE EMPTY>
<NOT ,PRSI>
<NOUN-USED? ,WATER ,W?GLOOP ,W?GLOOPS>
<OR <VISIBLE? ,LARGE-VIAL>
<VISIBLE? ,SMALL-VIAL>>>
<COND (<AND <VISIBLE? ,LARGE-VIAL>
<VISIBLE? ,SMALL-VIAL>>
<COND (<AND ,LARGE-VIAL-GLOOPS
,SMALL-VIAL-GLOOPS>
<TELL "There's water in both vials." CR>
<RTRUE>)
(,LARGE-VIAL-GLOOPS
<SETG PRSI ,LARGE-VIAL>)
(,SMALL-VIAL-GLOOPS
<SETG PRSI ,SMALL-VIAL>)
(T
<TELL "Neither vial contains water!" CR>
<RTRUE>)>)
(<VISIBLE? ,LARGE-VIAL>
<SETG PRSI ,LARGE-VIAL>)
(T
<SETG PRSI ,SMALL-VIAL>)>
<PERFORM ,V?EMPTY-FROM ,WATER ,PRSI>
<RTRUE>)
(<VERB? DRINK>
<TELL "You're not thirsty." CR>)
(<VERB? LOOK-INSIDE LOOK-UNDER EXAMINE>
<TELL "You see nothing of interest." CR>)
(<VERB? REACH-IN TOUCH>
<TELL "Your hand is now wet">
<COND (<EQUAL? ,HERE ,OASIS>
<TELL " and cold">)>
<TELL ,PERIOD-CR>)
(<AND <VERB? PUT PUT-ON>
<PRSI? ,WATER>>
<COND (<IN? ,PROTAGONIST ,DB>
<TELL
"You can't reach the water -- the bathysphere is closed! (Fortunately.)" CR>
<RTRUE>)
(<EQUAL? ,HERE ,PARLOR>
<MOVE ,PRSO ,FISH-TANK>)
(<EQUAL? ,HERE ,LAKE-FLATHEAD>
<COND (<FSET? ,PRSO ,ANIMATEDBIT>
<REMOVE ,PRSO>)
(T
<MOVE ,PRSO ,LAKE-BOTTOM>)>)
(T
<COND (<OR <PRSO? ,PERCH>
<ULTIMATELY-IN? ,PERCH ,PRSO>>
<SETG REMOVED-PERCH-LOC ,WATER>)>
<REMOVE ,PRSO>)>
<TELL "With a \"p">
<COND (<AND <PRSO? ,CANDLE ,GUTTERING-TORCH ,FLICKERING-TORCH>
<FSET? ,PRSO ,ONBIT>>
<FCLEAR ,PRSO ,ONBIT>
<FCLEAR ,PRSO ,FLAMEBIT>
<COND (<PRSO? ,GUTTERING-TORCH>
<DEQUEUE I-GUTTERING-TORCH>)
(<PRSO? ,FLICKERING-TORCH>
<DEQUEUE I-FLICKERING-TORCH>)>
<TELL "ffft">)
(T
<TELL "lunk">)>
<TELL ",\"" T ,PRSO " sinks into the water">
<COND (<PRSO? ,ROOSTER ,FOX>
<TELL ", you heartless animal drowner, you">)>
<TELL ,PERIOD-CR>)
(<VERB? ENTER SWIM>
<COND (<EQUAL? .X ,SWAMP>
<TELL
"You're already ankle-deep in the swampy water, which is yucky enough." CR>)
(<EQUAL? .X ,FRIGID-RIVER>
<TELL
"The Frigid River is known for its unpredictable currents." CR>)
(<EQUAL? .X ,FLATHEAD-OCEAN>
<TELL
"The pounding surf would kill you in a moment." CR>)
(<EQUAL? .X ,LAKE-FLATHEAD>
<COND (,ALLIGATOR
<JIGS-UP
"The Loch Flatheadia Monster, usually dismissed as a fairy tale, wells
up from the depths of the lake and swallows you.">)
(T
<TELL
"These waters are known for their hungry denizens." CR>)>)
(<EQUAL? .X ,STREAM-OBJECT>
<DO-WALK ,P?WEST>)
(<EQUAL? .X ,OASIS-OBJECT>
<TELL
"Only a Polar Gumffbeast could swim in such cold water!" CR>)
(<EQUAL? .X ,FISH-TANK>
<COND (,DESCRIBED-TANK-AS-LARGE
<TELL
"There's no way you could fit into this fish tank! [All right, I'll admit
that I went a little overboard when I described the fish tank as \"bigger
than a swimming pool.\"]" CR>)
(T
<SETG DESCRIBED-TANK-AS-SMALL T>
<TELL
"What? Swim in an itsy-bitsy fish tank like this one?!?" CR>)>)
(<EQUAL? .X ,MOAT>
<COND (,ALLIGATOR
<JIGS-UP
"The much, much larger alligator who lives in the moat apparently considers
this a territorial invasion.">)
(T
<TELL
"Not recommended. Moats tend to be populated with big,
nasty alligators." CR>)>)>)
(<PRSO? ,WATER>
<PERFORM-PRSA .X ,PRSI>)
(T
<PERFORM-PRSA ,PRSO .X>)>>
<ROUTINE FIND-WATER ()
<COND (<GLOBAL-IN? ,MOAT ,HERE>
<RETURN ,MOAT>)
(<EQUAL? ,HERE ,STREAM>
<RETURN ,STREAM-OBJECT>)
(<EQUAL? ,HERE ,PARLOR>
<RETURN ,FISH-TANK>)
(<EQUAL? ,HERE ,RIVERS-END>
<RETURN ,FRIGID-RIVER>)
(<GLOBAL-IN? ,FLATHEAD-OCEAN ,HERE>
<RETURN ,FLATHEAD-OCEAN>)
(<OR <EQUAL? ,HERE ,LAKE-FLATHEAD>
<GLOBAL-IN? ,LAKE-FLATHEAD ,HERE>>
<RETURN ,LAKE-FLATHEAD>)
(<GLOBAL-IN? ,SWAMP ,HERE>
<RETURN ,SWAMP>)
(<GLOBAL-IN? ,FJORD ,HERE>
<RETURN ,FJORD>)
(<EQUAL? ,HERE ,OASIS>
<RETURN ,OASIS-OBJECT>)
(T
<RFALSE>)>>
<OBJECT SMALL-VIAL-WATER
(DESC "water in the small vial")
(SYNONYM WATER GLOOP GLOOPS)
(ADJECTIVE ONE TWO THREE FOUR INT.NUM)
(FLAGS NARTICLEBIT)
(GENERIC G-VIAL-WATER-F)
(ACTION VIAL-WATER-F)>
<OBJECT LARGE-VIAL-WATER
(DESC "water in the large vial")
(SYNONYM WATER GLOOP GLOOPS)
(ADJECTIVE ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE INT.NUM)
(FLAGS NARTICLEBIT)
(GENERIC G-VIAL-WATER-F)
(ACTION VIAL-WATER-F)>
<ROUTINE VIAL-WATER-F ()
<COND (<AND <VERB? TAKE>
<EQUAL? ,P-PRSA-WORD ,W?REMOVE>>
<PERFORM ,V?EMPTY-FROM ,WATER
<COND (<PRSO? ,LARGE-VIAL-WATER> ,LARGE-VIAL)
(T ,SMALL-VIAL)>>)>>
<ROUTINE G-VIAL-WATER-F (SR F "AUX" ADJ VB)
<COND (<SET ADJ <FIND-ADJS .F>>
<SET ADJ <CONVERT-NUMBER .ADJ>>)>
<COND (<L? ,LARGE-VIAL-GLOOPS .ADJ>
<COND (<L? ,SMALL-VIAL-GLOOPS .ADJ>
<RETURN <>>)
(T
<RETURN ,SMALL-VIAL-WATER>)>)
(T
<COND (<L? ,SMALL-VIAL-GLOOPS .ADJ>
<RETURN ,LARGE-VIAL-WATER>)
(T
<RETURN <>>)>)
;(<AND <EQUAL? <SET VB <PARSE-ACTION ,PARSE-RESULT>> ,V?POUR>
<PRSI? ,LARGE-VIAL>>
<RETURN ,SMALL-VIAL-WATER>)
;(<AND <EQUAL? .VB ,V?POUR>
<PRSI? ,SMALL-VIAL>>
<RETURN ,LARGE-VIAL-WATER>)
;(<AND <EQUAL? .VB ,V?EMPTY-FROM>
<PRSI? ,LARGE-VIAL>>
<RETURN ,LARGE-VIAL-WATER>)
;(<AND <EQUAL? .VB ,V?EMPTY-FROM>
<PRSI? ,SMALL-VIAL>>
<RETURN ,SMALL-VIAL-WATER>)
;(<GLOBAL-IN? ,WATER ,HERE>
<RETURN ,WATER>)
;(<AND <VISIBLE? ,SMALL-VIAL-WATER>
<VISIBLE? ,LARGE-VIAL-WATER>>
<TELL ,WHICH-WATER>
<RETURN ,ROOMS>)
;(T
<RETURN ,WATER>)>
;<RFALSE>>
;<OBJECT SKY
(LOC GLOBAL-OBJECTS)
(DESC "sky")
(SYNONYM SKY)
(ACTION SKY-F)>
;<ROUTINE SKY-F ()
<COND (<AND <NOT <FSET? ,HERE ,OUTSIDEBIT>>
<HANDLE ,SKY>>
<CANT-SEE ,SKY>)>>
<CONSTANT BODY-PART-OWNERS
<TABLE (PURE LENGTH) PROTAGONIST DIMWIT JESTER EXECUTIONER
SICKLY-WITCH PRICKLY-WITCH>>
<OBJECT HANDS
(LOC GLOBAL-OBJECTS)
(SYNONYM HANDS HAND PALM FINGER FINGERS)
(ADJECTIVE BARE YOUR)
(DESC ;"your " "hands")
(OWNER BODY-PART-OWNERS ;PROTAGONIST)
(FLAGS NDESCBIT PLURALBIT TOUCHBIT ;NARTICLEBIT PARTBIT)
(ACTION HANDS-F)>
<ROUTINE HANDS-F ("AUX" ACTOR)
<COND (<VERB? CLEAN>
<WASTES>)
(<VERB? SHAKE>
<COND (<SET ACTOR <FIND-IN ,HERE ,ACTORBIT "with">>
<PERFORM ,V?SHAKE-WITH ,HANDS .ACTOR>
<RTRUE>)
(T
<TELL "There's no one here to shake hands with." CR>)>)
(<VERB? COUNT>
<COND (<NOUN-USED? ,HANDS ,W?FINGER ,W?FINGERS>
<TELL "Ten">)
(T
<TELL "Two">)>
<TELL ", as usual." CR>)
(<AND <VERB? OPEN CLOSE>
,HAND-IN-WALDO>
<PERFORM-PRSA ,WALDO>
<RTRUE>)
(<VERB? REMOVE TAKE-OFF>
<COND (,HAND-IN-WALDO
<SETG HAND-IN-WALDO <>>
<TELL "You withdraw your hand." CR>)
(,FINGER-ON-STRAW
<SETG FINGER-ON-STRAW <>>
<SETG ELIXIR-TRAPPED <>>
<TELL
"You remove your finger from the end of the straw." CR>)
(T
<TELL
"To quote an old song, \"The hand bone's connected to the
wrist bone...\"" CR>)>)
(<AND <VERB? PUT-ON>
<PRSO? ,GLOVE>>
<PERFORM ,V?WEAR ,GLOVE>
<RTRUE>)
(<AND <VERB? TAKE-WITH>
<PRSI? ,HANDS>>
<PERFORM ,V?TAKE ,PRSO>
<RTRUE>)
(<AND <VERB? SNAP>
<NOUN-USED? ,HANDS ,W?FINGER ,W?FINGERS>
<NOT ,TIME-STOPPED>>
<COND (<IN? ,PROTAGONIST ,SMALL-THRONE>
<OPEN-SECRET-PASSAGE?>)
(T
<TELL "\"Snap!\"" CR>)>)
;(<AND <VERB? PUT-ON>
<PRSI? ,EYES>>
<PERFORM ,V?SPUT-ON ,EYES ,HANDS>
<RTRUE>)
;(<AND <VERB? PUT-ON PUT>
<PRSI? ,EARS>>
<PERFORM ,V?SPUT-ON ,EARS ,HANDS>
<RTRUE>)>>
<ROUTINE OPEN-SECRET-PASSAGE? ()
<COND (,SECRET-PASSAGE-OPEN
<SETG SECRET-PASSAGE-OPEN <>>
<SETG COMPASS-CHANGED T>
<TELL "The secret passage closes!" CR>)
(,SECRET-PASSAGE-DISCOVERED
<SETG SECRET-PASSAGE-OPEN T>
<SETG COMPASS-CHANGED T>
<TELL "The secret passage opens once again." CR>)
(T
<SETG SECRET-PASSAGE-OPEN T>
<SETG SECRET-PASSAGE-DISCOVERED T>
<SETG COMPASS-CHANGED T>
<TELL
"Behind the throne, accompanied by a puff of dust, a secret passage grinds
open, leading south into darkness!">
<COND (<IN? ,JESTER ,HERE>
<TELL
" The jester applauds you, howling with mysterious delight.">)>
<CRLF>
<INC-SCORE ,SECRET-PASSAGE-SCORE>
<SETG SECRET-PASSAGE-SCORE 0>
<RTRUE>)>>
<OBJECT FEET
(LOC GLOBAL-OBJECTS)
(SYNONYM FEET FOOT TOE TOES)
(ADJECTIVE YOUR)
(DESC ;"your " "feet")
(OWNER BODY-PART-OWNERS ;PROTAGONIST)
(FLAGS NDESCBIT PLURALBIT TOUCHBIT ;NARTICLEBIT PARTBIT)
(ACTION FEET-F)>
<ROUTINE FEET-F ()
<COND (<AND <VERB? ENTER> ;"input was GET ON FEET"
<EQUAL? ,P-PRSA-WORD ,W?GET>>
<SETG P-PRSA-WORD ,W?STAND>
<SETG PRSO <>>
<V-STAND>)>>
<OBJECT HEAD
(LOC GLOBAL-OBJECTS)
(DESC "head" ;"your head")
(SYNONYM HEAD)
(OWNER BODY-PART-OWNERS ;PROTAGONIST)
(FLAGS ;NARTICLEBIT PARTBIT)>
<OBJECT EYES
(LOC GLOBAL-OBJECTS)
(DESC ;"your " "eyes")
(SYNONYM EYE EYES)
(ADJECTIVE MY MINE ORACLE\'S AMULET\'S FIRST SECOND THIRD FOURTH
ONE TWO THREE FOUR)
(OWNER BODY-PART-OWNERS ;PROTAGONIST)
(FLAGS ;NARTICLEBIT PLURALBIT PARTBIT)
(ACTION EYES-F)>
<ROUTINE EYES-F ("AUX" WHOSE-EYE)
<COND (<ADJ-USED? ,EYES ,W?MY ,W?MINE>
<SET WHOSE-EYE ,PROTAGONIST>)
(<ADJ-USED? ,EYES ,W?ORACLE\'S>
<SET WHOSE-EYE ,ORACLE-OBJECT>)
(<ADJ-USED? ,EYES ,W?AMULET\'S>
<SET WHOSE-EYE ,AMULET>)
(<EQUAL? ,HERE ,ORACLE>
<SET WHOSE-EYE ,ORACLE-OBJECT>)
(<VISIBLE? ,AMULET>
<SET WHOSE-EYE ,AMULET>)
(T
<SET WHOSE-EYE ,PROTAGONIST>)>
<COND (<AND <OR <ADJ-USED? ,EYES ,W?THREE ,W?FOUR>
<ADJ-USED? ,EYES ,W?THIRD ,W?FOURTH>>
<EQUAL? .WHOSE-EYE ,PROTAGONIST>>
<CANT-SEE ,EYES>)
(<VERB? COUNT>
<COND (<EQUAL? .WHOSE-EYE ,PROTAGONIST>
<TELL
"Two, unless you've been careless with pointy sticks lately." CR>)