-
Notifications
You must be signed in to change notification settings - Fork 27
/
jester.zil
1836 lines (1697 loc) · 52.3 KB
/
jester.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
"JESTER for
ZORK ZERO
(c) Copyright 1988 Infocom, Inc. All Rights Reserved."
<BEGIN-SEGMENT 0>
<OBJECT JESTER
(DESC "jester")
(DESCFCN JESTER-F)
(SYNONYM JESTER JESTERS JOKER MAN)
(FLAGS ACTORBIT SEARCHBIT CONTBIT OPENBIT ANIMATEDBIT)
(ACTION JESTER-F)>
<ROUTINE JESTER-F ("OPT" (ARG <>))
<COND (<EQUAL? .ARG ,M-OBJDESC?>
<RTRUE>)
(<EQUAL? .ARG ,M-OBJDESC>
<TELL " The jester ">
<COND (<IN? ,COOKPOT ,HERE>
<TELL "is here, " ,COOK-DESC>)
(<AND <EQUAL? ,HERE ,TAX-OFFICE>
<IN? ,ZORKMID-COIN ,LOCAL-GLOBALS>>
<TELL ,BOOKKEEPER-DESC>)
(,J-ON-RAFT
<TELL
"lies on an inner tube. His eyes twinkle at you behind his sunglasses.">)
(T
<TELL
"is nearby, watching you with great amusement.">)>)
(<EQUAL? .ARG ,M-WINNER>
<COND (<AND <VERB? SAY>
<EQUAL? ,HERE ,ENTRANCE-HALL>
<NOT <FSET? ,PORTCULLIS ,OPENBIT>>>
<RFALSE>)
(<AND <VERB? SAY>
<IN? ,EAST-KEY ,JESTER>>
<RFALSE>)
(<AND <VERB? SAY>
<EQUAL? ,HERE ,OUBLIETTE>>
<RFALSE>)
(T
<TELL
"\"Don't waste your breath, for I'd go to any length to avoid a
conversation with such depth as yours. Also, silence is the height
of fashion nowadays.\"" CR>
<STOP>)>)
(<VERB? EXAMINE>
<COND (,J-ON-RAFT
<TELL
"The jester is wearing dark glasses and floating around on an inner tube." CR>)
(<IN? ,COOKPOT ,HERE>
<TELL "The jester is " ,COOK-DESC CR>)
(<AND <EQUAL? ,HERE ,TAX-OFFICE>
<IN? ,ZORKMID-COIN ,LOCAL-GLOBALS>>
<TELL "The jester is " ,BOOKKEEPER-DESC CR>)
(<FSET? ,GOGGLES ,WORNBIT>
<TELL
,YOU-SEE " right through the jester's clothes as though they were
transparent! Embarassed, you turn away. (But not before noticing that
the jester has pink butterflies stitched onto his underwear.)" CR>)
(T
<TELL
"The jester is dressed in a green skin-tight suit, and is wearing a hat
with many pointy ends. From each end dangles a gaudy little bell. The
jester's eyes twinkle with mischievous energy." CR>)>)
(<AND <VERB? GIVE SHOW>
<EQUAL? ,HERE ,MARSH ,NICE-LUNCH-SPOT>
<PRSO? ,WORM ,ROOSTER ,FOX>>
<TELL
"\"Mon Dieu! I must have all zee ingredients together!\"" CR>)
(<AND <VERB? GIVE>
<PRSO? ,PIGEON>>
<COND (<EQUAL? <META-LOC ,PERCH> ,HERE>
<TELL
"The jester takes the pigeon, looks it over, shrugs, and hands it back." CR>)
(T
<TELL
"The jester recedes to a point and vanishes, a look of comical surprise
splattered across his wide face.">
<COND (<IN? ,SHELL-TABLE ,HERE>
<TELL
" The table and shells disappear as well.">)>
<CRLF>
<REMOVE-J>
<SETG J-DISPOSED ,MOVES>
<COND (<LOC ,PERCH>
<MOVE ,PIGEON <LOC ,PERCH>>)
(T
<REMOVE ,PIGEON>)>
<RFATAL>)>)
(<VERB? SHOW>
<COND (<PRSO? ,NUT>
<COND (,NUT-OPENED
<SETG NUT-SHOWN T>
<TELL
"\"True, no one has seen this 'ere me -- but thousands
may see it in years to be!\"" CR>)
(T
<TELL
"\"Uncertain and skeptical I must be; countless people
may have gazed upon this before me.\"" CR>)>)
(<PRSO? ,NUT-SHELL ,UNOPENED-NUT>
<TELL "The jester cocks one eyebrow">
<COND (<EQUAL? ,HERE ,WEST-WING>
<TELL
" and a smile dances at the corners of his mouth">)>
<TELL ,PERIOD-CR>)>)
(<AND <VERB? EAT KILL>
,ALLIGATOR>
<TELL
"The jester jumps nimbly away from your snapping jaws." CR>)
(<VERB? RESEARCH>
<PICTURED-ENTRY ,J-ILL <>>)>>
<BEGIN-SEGMENT CASTLE>
<ROUTINE J-ENTRY ()
<TELL
"\"Jesters employ physical, verbal, and magical trickery for the entertainment
of king and court. The most recent Royal Jester, the favorite of Lord Wurb
Flathead, is named Barbazzo " <GET ,MID-NAMES ,MID-NAME-NUM> " Fernap.\"" CR>>
<GLOBAL MID-NAME-NUM <>>
<CONSTANT MID-NAMES
<PTABLE "Hideoz"
"Bivotar"
"Urgwitz"
"Foofoonap"
"Elderbar"
"Goozums"
"Syovar"
"Buck"
"Spike"
"Zippy"
"Magglebar"
"Barfoo">>
<END-SEGMENT>
<BEGIN-SEGMENT 0>
<CONSTANT MID-NAME-WORDS
<PTABLE <VOC "HIDEOZ" NOUN>
<VOC "BIVOTAR" NOUN>
<VOC "URGWITZ" NOUN>
<VOC "FOOFOONAP" NOUN>
<VOC "ELDERBAR" NOUN>
<VOC "GOOZUMS" NOUN>
<VOC "SYOVAR" NOUN>
<VOC "BUCK" NOUN>
<VOC "SPIKE" NOUN>
<VOC "ZIPPY" NOUN>
<VOC "MAGGLEBAR" NOUN>
<VOC "BARFOO" NOUN>>>
<OBJECT MID-NAME
(LOC GLOBAL-OBJECTS)
(DESC "middle name")
(SYNONYM HIDEOZ BIVOTAR URGWITZ FOOFOONAP ELDERBAR GOOZUMS
SYOVAR BUCK SPIKE ZIPPY MAGGLEBAR BARFOO)
(ACTION MID-NAME-F)>
<ROUTINE MID-NAME-F ()
<COND (<AND <VISIBLE? ,JESTER>
<NOUN-USED? ,MID-NAME <GET ,MID-NAME-WORDS ,MID-NAME-NUM>>>
<PERFORM-PRSA ,JESTER>)
(<OR <HANDLE ,MID-NAME>
<VERB? FOLLOW>>
<TELL ,BY-THAT-NAME>
<STOP>)>>
<OBJECT OTHER-J-NAMES
(LOC GLOBAL-OBJECTS)
(DESC "jester's name")
(SYNONYM BARBAZZO FERNAP)
(ACTION OTHER-J-NAMES-F)>
<ROUTINE OTHER-J-NAMES-F ()
<COND (<VISIBLE? ,JESTER>
<PERFORM-PRSA ,JESTER>)
(<OR <HANDLE ,OTHER-J-NAMES>
<VERB? FOLLOW>>
<TELL ,BY-THAT-NAME>
<STOP>)>>
<OBJECT J-POCKET
(LOC JESTER)
(DESC "jester's pocket")
(SYNONYM POCKET)
(ADJECTIVE HIS JESTER\'S)
(OWNER JESTER)
(FLAGS NDESCBIT)
(ACTION J-GARMENT-F)>
<OBJECT J-HAT
(LOC JESTER)
(DESC "jester's hat")
(SYNONYM HAT BELL BELLS)
(ADJECTIVE HIS JESTER\'S SMALL GAUDY)
(OWNER JESTER)
(FLAGS NDESCBIT)
(GENERIC G-HAT-F)
(ACTION J-GARMENT-F)>
<OBJECT J-SHOE
(LOC JESTER)
(DESC "jester's shoe")
(SYNONYM SHOE)
(ADJECTIVE HIS JESTER\'S)
(OWNER JESTER)
(FLAGS NDESCBIT)
(ACTION J-GARMENT-F)>
<ROUTINE J-GARMENT-F ()
<COND (<AND <PRSO? ,J-HAT ,J-SHOE ,J-POCKET>
<TOUCHING? ,PRSO>>
<TELL "The jester dances spryly out of reach." CR>)
(<AND <VERB? EXAMINE LOOK-INSIDE LOOK-UNDER>
<IN? ,ZORKMID-BILL ,PRSO>
<FSET? ,GOGGLES ,WORNBIT>>
<TELL
,YOU-SEE " right through" T ,PRSO " as if it were made of glass -- and
sure enough, there's the zorkmid bill!" CR>)
(<AND <VERB? EXAMINE>
<PRSO? ,J-HAT>>
<TELL
"It has many floppy tips, with bells dangling from each one." CR>)
(<AND <VERB? POINT>
<EQUAL? ,HERE ,GAMING-ROOM>
<NOT <FSET? ,ZORKMID-BILL ,TOUCHBIT>>>
<COND (<IN? ,ZORKMID-BILL ,PRSO>
<MOVE ,ZORKMID-BILL ,PROTAGONIST>
<FSET ,ZORKMID-BILL ,TOUCHBIT>
<TELL
"The jester looks sheepish. He removes the bill and hands it to you.
\"You're pretty slick; you've discovered my trick.\"">
<J-EXITS>
<INC-SCORE 12>
<RTRUE>)
(T
<TELL "The jester howls with glee, and ">
<COND (<PRSO? ,J-POCKET>
<TELL "turns his pocket inside out">)
(<PRSO? ,J-HAT>
<TELL "removes his hat">)
(T
<TELL "removes his shoe">)>
<TELL ". Nothing. ">
<ANOTHER-SHELL-GAME>)>)>>
<OBJECT J-SUIT
(LOC JESTER)
(DESC "jester's suit")
(SYNONYM SUIT)
(ADJECTIVE GREEN SKIN-TIGHT)
(OWNER JESTER)
(FLAGS NDESCBIT)>
<ROUTINE I-JESTER ("OPTIONAL" (CALLED-BY-DOORBELL <>) "AUX" PLUR APPEAR-PROB)
<COND (,TIME-STOPPED
<DEQUEUE I-JESTER>
<RFALSE>)>
<SET APPEAR-PROB ,J-APPEAR-PROB>
<COND (<EQUAL? ,HERE ,FR-OFFICES ,OFFICES-WEST ,OFFICES-EAST
,OFFICES-NORTH ,OFFICES-SOUTH>
<SET APPEAR-PROB
</ .APPEAR-PROB </ <+ ,FLOOR-NUMBER 40> 40>>>)>
<QUEUE I-JESTER -1>
<COND (<OR <IN? ,PROTAGONIST ,DB>
<EQUAL? ,HERE ,INQUISITION ,PLAIN>
<AND <EQUAL? ,HERE ,ENTRANCE-HALL>
<NOT <FSET? ,PORTCULLIS ,OPENBIT>>
<NOT .CALLED-BY-DOORBELL>>>
<QUEUE I-JESTER <RANDOM 5>>
<RFALSE>)
(<NOT ,LIT>
<QUEUE I-JESTER <RANDOM 5>>
<RETURN-FROM-MAP>
<TELL
" You hear jingling bells and a familiar laugh in the darkness.">
<COND (<NOT <FSET? ,SECRET-PASSAGE ,TOUCHBIT>>
<TELL
" \"Trouble finding a light? I'm just the man to set you right! Tighten your
belt and pull up your socks and re-read the book from your ZORK ZERO box!
Or,\" the voice asks suspiciously, \"maybe you're one of those software
pirates? In that case, I hope you fall into a bottomless pit.\"">)>
<TELL CR>
<RTRUE>)
(<OR ,DO-J
<PROB .APPEAR-PROB>>
<SETG DO-J <>>)
(T
<SETG J-APPEAR-PROB <+ ,J-APPEAR-PROB 1>>
<RFALSE>)>
<DEQUEUE I-JESTER> ;"so he doesn't appear while he's already here"
<RETURN-FROM-MAP>
<TELL " ">
<COND (<IN? ,JESTER ,HERE> ;"example: going west from West Wing twice"
T)
(,TURNED-INTO
<REMOVE-J>
<TELL
"You suddenly notice another " D ,TURNED-INTO ", wearing a jester's costume.
Laughing, it says, \"I'd heard that there was a dauntless adventurer around,
but there's no one here but us ">
<COND (<SET PLUR <GETP ,TURNED-INTO ,P?PLURAL>>
<TELL .PLUR>)
(T
<TELL D ,TURNED-INTO "s">)>
<TELL
"!\" Still laughing, the jester/" D ,TURNED-INTO " vanishes." CR>
<RTRUE>)
(<VISIBLE? ,OTTO>
<TELL
"You spot a fly wearing a tiny floppy green hat with bells at the tips. Otto
spots the fly as well, and begins to salivate. In a high, thin imitation of
the jester's voice, the fly cries \"Help me!\" -- but Otto's tongue moves
before you can, and in a split-second the jester/fly is gonzo.">
<RTRUE>)
(<IN? ,PROTAGONIST ,YACHT>
<SETG J-ON-RAFT T>
<TELL
"You notice the jester, floating next to the yacht in an inner tube,
wearing sunglasses and lots of tanning lotion.">)
(<FSET? ,JESTER ,TOUCHBIT>
<TELL "The jester appears.">
<COND (<AND <EQUAL? ,HERE ,ICKY-CAVE>
<IN? ,SICKLY-WITCH ,HERE>>
<TELL ,WITCH-REMOVES-J>
<RTRUE>)
(<FSET? ,HERE ,BEYONDBIT>
<TELL " \"Hi! Small world, isn't it!\"">)>)
(T
<FSET ,JESTER ,TOUCHBIT>
<TELL
"You suddenly notice a wiry fellow with an outrageous costume and a
feral grin. \"I'm the jester of the castle, I may pester, I may hassle;
and I often speak in rhyme, for it helps to pass the time!\"">)>
<MOVE ,JESTER ,HERE>
<THIS-IS-IT ,JESTER>
<COND (<AND <VERB? TAKE>
<PRSO? ,EAST-KEY>
<FSET? ,EAST-KEY ,TRYTAKEBIT>>
<MOVE ,EAST-KEY ,JESTER>
<TELL " He snatches the key before you can take it.">)
(<AND <EQUAL? ,HERE ,PITS>
<FSET? ,LANTERN ,TRYTAKEBIT>>
<TELL
" He has an enormous slice of watermelon which he devours with juicy abandon,
rind and all, and then spits out a stream of pits, which land and turn into
even more bottomless pits. \"Don't you hate pits? I know I do!\"" CR>
<RTRUE>)>
<TELL CR " ">
<COND (<EQUAL? ,HERE ,ENTRANCE-HALL>
<COND (<FSET? ,PORTCULLIS ,OPENBIT>
<TELL
"The jester looks at the open portcullis. \"Oh, right! My memory is no
longer so great; I've already opened this gate!\"">
<J-EXITS>)
(T
<SETUP-ORPHAN "answer">
<TELL
"\"If you're quick as a fiddle, and answer this riddle, you'll get what
you're hopin' -- the gate will be open!\" The jester clears his throat. \""
<GETP ,HERE ,P?RIDDLE> CR>)>)
(<IN? ,EAST-KEY ,JESTER>
<SETUP-ORPHAN "answer">
<TELL
"\"Before you get this key, you must answer this riddle for me!\" The jester
poses theatrically. \"" <GETP ,SOLAR ,P?RIDDLE> CR>)
(<EQUAL? ,HERE ,OUBLIETTE>
<COND (<EQUAL? ,OUBLIETTE-SCORE 0>
<TELL
"\"Trapped again? Don't frown or fret! I'll help you leave the Oubliette! But
saving you is such a pain; please don't get stuck down here again!\"" CR CR>
<GOTO ,DUNGEON>)
(T
<SETUP-ORPHAN "answer">
<TELL
"\"Don't scream or shout, I'll get you out! But first my thirst for a
riddle must be twiddled!\" The jester coughs lightly and begins. \""
<GETP ,HERE ,P?RIDDLE> CR>)>)
(<AND <EQUAL? ,HERE ,WEST-WING>
<NOT ,NUT-EATEN>>
<TELL ,ERE-YOU-PASS>)
(<AND <EQUAL? ,HERE ,GAMING-ROOM>
<NOT <FSET? ,ZORKMID-BILL ,TOUCHBIT>>>
<MOVE ,SHELL-TABLE ,HERE>
<TELL
"\"Blackjack... Fanucci... all too tame; let's play the old shell game!\" From
thin air, the jester produces a small table, three shells, and a zorkmid bill
of high denomination. He arranges the shells in a row on the table and places
the bill under the center shell. With hands that move in a dizzying blur, he
shuffles the order of the shells. \"Demonstrate your visual skill -- point to
the location of the zorkmid bill!\" He motions toward the shells, left,
center, and right.">
<SEE-BILL?>
<CRLF>)
(<EQUAL? ,HERE ,FR-PENTHOUSE>
<TELL
"\"Your persistence will bring you wide renown; you've reached the four
hundredth floor! The hard part now is getting down -- I suggest that
you simply RESTORE!\"" CR>
<J-EXITS>)
(<AND <PROB ,SLATE-PROB>
<IN? ,SLATE ,LOCAL-GLOBALS>>
<MOVE ,SLATE ,PROTAGONIST>
<TELL
"\"While cleaning my attic, I found some old haddock, a hammer and nails,
some barrels and pails, an old garden gate, and this silly old slate!\" He
hands you the slate.">
<J-EXITS T>)
(<AND <PROB ,SCROLL-PROB>
<IN? ,SCROLL ,LOCAL-GLOBALS>>
<COND (<FSET? <LOC ,PROTAGONIST> ,DROPBIT>
<MOVE ,SCROLL <LOC ,PROTAGONIST>>)
(T
<MOVE ,SCROLL ,HERE>)>
<TELL
"\"I thought of no rhyme; my puzzle's on paper this time.\" He drops a
scroll by your feet.">
<J-EXITS T>)
(<AND <PROB 25>
<NOT <FSET? ,HERE ,BEYONDBIT>>>
<TELL
"\"I've learned from years of loyalty, spinning rhymes for this noble court,
that with the attention span of royalty, my poems must be short!\"">
<J-EXITS>)
(T
<TELL "The jester watches you with twinkling eyes." CR>)>
<SETG SLATE-PROB <+ ,SLATE-PROB 2>>
<SETG SCROLL-PROB <+ ,SCROLL-PROB 2>>>
;"('Appointment in Samaria'
'the lying tribesman and the truth-telling tribesman'
I just made up this puzzle as a variation on one of Lewis Carroll's,
and I want to make sure my own solution is correct and the only one.
Try solving it:
'I once knew three sisters named Amy, Liz, and Gayle. At one point, the
sum of Amy's age and Liz's age equalled Gayle's age. Several years later,
the sum of Amy's age and Liz's age equalled twice Gayle's age. When Gayle
was 21, how old was Amy?'
The only solution which satisfies both conditions is if the the three
sisters are triplets: the sums of Liz's and Amy's age would equal Gayle's
age at birth; later the sum of their ages would equal twice Gayle's age.
Therefore, when Gayle is 21, so is Amy.)"
<ROUTINE J-EXITS ("OPT" (JUST-DID-SLATE-OR-SCROLL <>)
"AUX" (DO-FUNNY-PAPER <>) (LIT? <>))
<REMOVE-J>
<COND (<AND <PROB ,FUNNY-PAPER-PROB>
<IN? ,FUNNY-PAPER ,LOCAL-GLOBALS>
<NOT .JUST-DID-SLATE-OR-SCROLL>>
<SET DO-FUNNY-PAPER T>)>
<COND (<AND <PROB 15>
<NOT .DO-FUNNY-PAPER>>
<TELL
" The jester winces at his rhyming, then shrugs. \"Oh, well, they can't all
be gems.\" In a wink, he is gone." CR>
<RTRUE>)
(<AND <PROB 20>
<IN? ,PROTAGONIST ,HERE>
<NOT <EQUAL? ,HERE ,TORTURE-CHAMBER>>
<NOT .DO-FUNNY-PAPER>>
<MOVE ,BEDBUG ,HERE>
<SETG P-CONT -1> ;<RFATAL>
<TELL
" The jester yawns and says, \"Think I'll catch some winks. Nighty night!
Don't let the bedbugs bite!\" As the jester vanishes, you hear the clicking
of giant mandibles." CR>
<RTRUE>)>
<TELL
" The jester gives a cheerful wave of farewell and vanishes, saying, \"">
<COND (.DO-FUNNY-PAPER
<QUEUE I-FUNNY-PAPER 2>
<SETG FUNNY-PAPER-PROB 0>
<TELL
"See you in the funny papers!\" A breeze begins picking up." CR>)
(<AND <PROB 20>
<NOT <FSET? ,HERE ,DESERTBIT>> ;"screws you"
<NOT <EQUAL? ,HERE ,LAKE-FLATHEAD ,UNDERWATER ,LAKE-BOTTOM
,HOLD ,GONDOLA>>
<NOT <EQUAL? <GETP ,HERE ,P?REGION> "Fenshire">>>
<TELL
"See you next week, same bat time, same bat channel!\" A moment later, you
hear a shrieking, \"Fweep! Fweep! Fweep!\" A large deranged bat swoops down,
snatches you up, and deposits you in" ,ELLIPSIS>
<MOVE ,PROTAGONIST ,HERE> ;"otherwise, bat takes camel too!"
<COND (<SET LIT? <FIND-IN ,PROTAGONIST ,ONBIT>>
T)
(<SET LIT? <FIND-IN ,HERE ,ONBIT>>
<MOVE .LIT? ,PROTAGONIST>)>
<GOTO <COND (<OR <BEYOND-LAKE?>
<AND .LIT?
<PROB 25>>>
,BATS-LAIR)
(<AND ,SECRET-PASSAGE-OPEN
.LIT?
<PROB 40>>
,PARAPET)
(<AND <FSET? ,DRAWBRIDGE ,OPENBIT>
<PROB 50>>
,OUTER-BAILEY)
(T
,ROOF)>>)
(<AND <PROB 33> ;"don't turn stump-jumping player to alligator"
<NOT <EQUAL? ,HERE ,UNDER-THE-WORLD ,HANGING-FROM-ROOTS
,SHOULDER ,EAR ,INNER-EAR>>
<EQUAL? ,HUNGER-COUNT 0>
<EQUAL? ,JUMP-X 99>
<EQUAL? ,JUMP-Y 99>>
<SETG ALLIGATOR T>
<QUEUE I-UNALLIGATOR 4>
<TELL "See you later, alligator!\" Your skin feels itchy">
<COND (<FIRST? ,PROTAGONIST>
<TELL " and you've dropped what you were holding">)>
<TELL ".">
<ROB ,PROTAGONIST
<COND (<FSET? <LOC ,PROTAGONIST> ,DROPBIT>
<LOC ,PROTAGONIST>)
(T
,HERE)>>
<SETG P-CONT -1> ;<RFATAL>
<CRLF>)
(<OR <PROB 50>
,ALLIGATOR
<FSET? ,CLOWN-NOSE ,WORNBIT>>
<TELL
"So long, and thanks for all the fish!\" Odd. You've never given the
jester any fish." CR>)
(T
<MOVE ,CLOWN-NOSE ,PROTAGONIST>
<FSET ,CLOWN-NOSE ,WORNBIT>
<QUEUE I-SUFFOCATE -1>
<SETG P-CONT -1> ;<RFATAL>
<TELL
"Catch you aroun', clown!\" You suddenly find yourself having a bit of
difficulty breathing." CR>)>
<SETG FUNNY-PAPER-PROB <+ ,FUNNY-PAPER-PROB 5>>>
<ROUTINE BEYOND-LAKE? ()
<COND (<FSET? ,HERE ,DESERTBIT>
<RTRUE>)
(<EQUAL? ,HERE ,STABLE ,GROTTO, SHRINE ,G-U-MOUNTAIN ,STREAM
,G-U-WOODS ,G-U-SAVANNAH ,EAST-SHORE ,SOUTH-SHORE
,RING-OF-DUNES ,BASE-OF-MOUNTAIN>
<RTRUE>)
(T
<RFALSE>)>>
<GLOBAL J-APPEAR-PROB 0>
<GLOBAL DO-J <>>
<ROUTINE REMOVE-J ()
<QUEUE I-JESTER 12>
<SETG J-APPEAR-PROB 0>
<SETG GUESSES <>>
<SETG J-ON-RAFT <>>
<COND (<IN? ,EAST-KEY ,JESTER>
<MOVE ,EAST-KEY ,SOLAR>)>
<COND (<NOT <FSET? ,ZORKMID-BILL ,TOUCHBIT>>
<MOVE ,ZORKMID-BILL ,LOCAL-GLOBALS>)>
<REMOVE ,SHELL-TABLE>
<REMOVE ,JESTER>>
<ROUTINE DONT-CRY ()
<SETG GUESSES <+ ,GUESSES 1>>
<TELL "\"Wrong, but don't ">
<COND (<EQUAL? ,GUESSES 3>
<SETG GUESSES 0>
<TELL
"get all a-twiddle; I'll repeat the riddle! " <GETP ,HERE ,P?RIDDLE>>)
(T
<TELL "cry -- give it another try.\"">)>
<CRLF>>
<GLOBAL J-INQ-SCENE <>>
<GLOBAL J-ON-RAFT <>>
<GLOBAL FUNNY-PAPER-PROB 20>
<GLOBAL SLATE-PROB 33>
<GLOBAL SCROLL-PROB 33>
<GLOBAL GUESSES 0>
<GLOBAL ALLIGATOR <>>
<ROUTINE I-UNALLIGATOR ()
<SETG ALLIGATOR <>>
<RETURN-FROM-MAP>
<TELL
" With a pop, your tail and snout shorten, and you are no longer a candidate
for being turned into a pair of expensive shoes." CR>>
<GLOBAL SUFFOCATE-COUNTER 0>
<ROUTINE I-SUFFOCATE ()
<COND (<NOT <FSET? ,CLOWN-NOSE ,WORNBIT>>
<SETG SUFFOCATE-COUNTER 0>
<DEQUEUE I-SUFFOCATE>
<RFALSE>)>
<SETG SUFFOCATE-COUNTER <+ ,SUFFOCATE-COUNTER 1>>
<COND (<EQUAL? ,SUFFOCATE-COUNTER 5>
<RETURN-FROM-MAP>
<TELL
" You're still having trouble breathing. It's probably due to the clown nose
that's clamped in the middle of your face." CR>)
(<EQUAL? ,SUFFOCATE-COUNTER 8>
<RETURN-FROM-MAP>
<TELL
" It's really getting tough to keep going without fresh air!" CR>)
(<EQUAL? ,SUFFOCATE-COUNTER 10>
<RETURN-FROM-MAP>
<TELL " You're getting lightheaded..." CR>)
(<EQUAL? ,SUFFOCATE-COUNTER 11>
<RETURN-FROM-MAP>
<JIGS-UP " You pass out from a shortage of air.">)
(T
<RFALSE>)>>
<ROUTINE I-FUNNY-PAPER ()
<MOVE ,FUNNY-PAPER <LOC ,PROTAGONIST>>
<QUEUE I-REMOVE-FUNNY-PAPER 1>
<THIS-IS-IT ,FUNNY-PAPER>
<RETURN-FROM-MAP>
<TELL
" The wind blows a colorful piece of newspaper into view. It's a funny
paper!" CR>>
<ROUTINE I-REMOVE-FUNNY-PAPER ("AUX" (TOLD <>))
<COND (<NOT <IN? ,FUNNY-PAPER ,PROTAGONIST>>
<COND (<VISIBLE? ,FUNNY-PAPER>
<SET TOLD T>
<RETURN-FROM-MAP>
<TELL
" The wind blows the funny paper out of sight." CR>)>
<MOVE ,FUNNY-PAPER ,LOCAL-GLOBALS>)>
<COND (.TOLD
<RTRUE>)
(T
<RFALSE>)>>
<OBJECT FUNNY-PAPER
(LOC LOCAL-GLOBALS)
(DESC "funny paper")
(SYNONYM PAPER PIECE NEWSPAPER COMICS)
(ADJECTIVE COLORFUL FUNNY)
(FLAGS TAKEBIT BURNBIT READBIT)
(SIZE 2)
(ACTION FUNNY-PAPER-F)>
<ROUTINE FUNNY-PAPER-F ()
<COND (<VERB? READ>
<TELL
"It's a comic strip entitled \"Me and the Jester.\" In the strip, a peasant
adventurer is bumbling around a mighty castle, alternately helped and
hindered by a playful jester. In one panel, the Jester suggests that the
adventurer look under the " D ,HOLEY-SLAB " in the Crypt." CR>)
(<VERB? FOLLOW>
<TELL "You've lost track of it." CR>)>>
<OBJECT BEDBUG
(DESC "giant bedbug")
(SYNONYM BUG BEDBUG)
(ADJECTIVE LARGE BED)
(ACTION BEDBUG-F)>
<ROUTINE BEDBUG-F ()
<COND (<VERB? EXAMINE>
<TELL
"It's quite larger than any bedbug you've ever seen before: about the size
of a small sheep. It looks as if it has just been roused from a deep sleep,
and isn't at all happy about the fact. With a mixture of weariness and anger,
it waves powerful pincers in your direction." CR>)
(<VERB? LEAP>
<IMPOSSIBLES>)
(<VERB? KILL BITE KICK>
<TELL
"This bedbug's chitinous shell is like battle armor." CR>)>>
<OBJECT CLOWN-NOSE
(DESC "red clown nose")
(SYNONYM NOSE)
(ADJECTIVE RED CLOWN)
(FLAGS WEARBIT TAKEBIT)
(SIZE 2)
(ACTION CLOWN-NOSE-F)>
<ROUTINE CLOWN-NOSE-F ()
<COND (<AND <VERB? WEAR>
<NOT <FSET? ,CLOWN-NOSE ,WORNBIT>>>
<FSET ,CLOWN-NOSE ,WORNBIT>
<QUEUE I-SUFFOCATE -1>
<TELL
"You don the nose, which makes breathing extremely difficult." CR>)>>
<OBJECT SLATE
(LOC LOCAL-GLOBALS)
(DESC "dusty slate")
(SYNONYM SLATE)
(ADJECTIVE DUSTY SMALL SILLY OLD)
(FLAGS READBIT TAKEBIT)
(ACTION SLATE-F)>
<GLOBAL STUMP-X 0>
<GLOBAL STUMP-Y 0>
<ROUTINE SLATE-F ()
<COND (<VERB? EXAMINE>
<TELL
"The small slate is set into a wooden frame. It looks to be at least
fifty if not a hundred years old. A shaky hand has inscribed something
onto the slate." CR>)
(<VERB? READ>
<COND (<EQUAL? ,STUMP-X 0>
<SETG STUMP-X <RANDOM 3>>
<COND (<PROB 50>
<SETG STUMP-X <* ,STUMP-X -1>>)>
<SETG STUMP-Y <RANDOM 3>>
<COND (<PROB 50>
<SETG STUMP-Y <* ,STUMP-Y -1>>)>
<TELL
"You shake enough dust off the slate to read it: ">)>
<TELL
"\"Stand at the oldest and mightiest elm around. Jump ">
<COND (<G? ,STUMP-Y 0>
<TELL "north ">)
(T
<TELL "south ">)>
<COND (<EQUAL? ,STUMP-Y 1 -1>
<TELL "once">)
(<EQUAL? ,STUMP-Y 2 -2>
<TELL "twice">)
(T
<TELL "thrice">)>
<TELL " then jump ">
<COND (<G? ,STUMP-X 0>
<TELL "east ">)
(T
<TELL "west ">)>
<COND (<EQUAL? ,STUMP-X 1 -1>
<TELL "once">)
(<EQUAL? ,STUMP-X 2 -2>
<TELL "twice">)
(T
<TELL "thrice">)>
<TELL ".\"" CR>)>>
<OBJECT SCROLL
(LOC LOCAL-GLOBALS)
(DESC "scroll")
(SYNONYM SCROLL PAPER)
(FLAGS READBIT TAKEBIT BURNBIT)
(SIZE 2)
(ACTION SCROLL-F)>
<ROUTINE SCROLL-F ()
<COND (<VERB? READ EXAMINE>
<TELL "The paper reads:" CR CR " ">
<HLIGHT ,H-ITALIC>
<TELL "RAM A NAG" CR CR>
<HLIGHT ,H-NORMAL>
<TELL "TREEN RIBARLY HENT HOCUT MORRA RICHET" CR>)>>
<END-SEGMENT>
<BEGIN-SEGMENT CASTLE>
<OBJECT SHELL-TABLE
(DESC "small table")
(SYNONYM TABLE)
(ADJECTIVE SMALL)
(FLAGS SURFACEBIT CONTBIT OPENBIT SEARCHBIT)>
<OBJECT LEFT-SHELL
(LOC SHELL-TABLE)
(DESC "left shell")
(SYNONYM SHELL)
(ADJECTIVE LEFT FIRST)
(ACTION SHELL-F)>
<OBJECT CENTER-SHELL
(LOC SHELL-TABLE)
(DESC "center shell")
(SYNONYM SHELL)
(ADJECTIVE CENTER MIDDLE SECOND)
(ACTION SHELL-F)>
<OBJECT RIGHT-SHELL
(LOC SHELL-TABLE)
(DESC "right shell")
(SYNONYM SHELL)
(ADJECTIVE RIGHT THIRD)
(ACTION SHELL-F)>
<ROUTINE SHELL-F ()
<COND (<VERB? POINT>
<TELL
"The jester lifts the shell. Empty. ">
<ANOTHER-SHELL-GAME>)
(<VERB? TOUCH LOOK-UNDER MOVE TAKE>
<TELL
"The jester stops you, saying, \"You deserve a beating for trying
such cheating!\"" CR>)
(<AND <VERB? LOOK-INSIDE EXAMINE>
<FSET? ,GOGGLES ,WORNBIT>>
<TELL
"Thanks to the goggles, you can see right through the shell as though it
were transparent! There's nothing under it." CR>)>>
<ROUTINE ANOTHER-SHELL-GAME ()
<TELL
"\"Don't be sore, let's try it once more!\" He reshuffles the shells.">
<MOVE ,ZORKMID-BILL ,LOCAL-GLOBALS>
<SEE-BILL?>
<CRLF>>
<ROUTINE SEE-BILL? ("AUX" BILL-LOC)
<COND (<FSET? ,GOGGLES ,WORNBIT>
<SET BILL-LOC <COND (<PROB 33> ,J-POCKET)
(<PROB 50> ,J-SHOE)
(T ,J-HAT)>>
<MOVE ,ZORKMID-BILL .BILL-LOC>
<TELL
" You find that you can see right through the shells -- and the zorkmid bill
isn't under any of them! Before you can say so, you notice the bill -- ">
<COND (<EQUAL? .BILL-LOC ,J-HAT>
<TELL "under">)
(T
<TELL "in">)>
<TELL
T .BILL-LOC "! After a moment, the vision fades, and" T .BILL-LOC " once
again appears opaque.">)>>
<OBJECT ZORKMID-BILL
(LOC LOCAL-GLOBALS)
(DESC "zorkmid bill")
(SYNONYM BILL MONEY)
(ADJECTIVE ZORKMID)
(FLAGS TAKEBIT BURNBIT READBIT MAGICBIT)
(SIZE 1)
(VALUE 0) ;"12 points given elsewhere"
(TEXT
"The denomination of the bill is 100,000 zorkmids. Only one such bill
was ever printed, and that was at the personal request of J. Pierpont
Flathead.")>
<ROOM JESTERS-QUARTERS
(LOC ROOMS)
(REGION "Flatheadia")
(DESC "Jester's Quarters")
(DOWN TO SERVANTS-QUARTERS)
(OUT TO SERVANTS-QUARTERS)
(NORTH TO WEIRD IF LARGE-DOOR IS OPEN)
(SOUTH PER SMALL-DOOR-ENTER-F)
(FLAGS RLANDBIT)
(SYNONYM QUARTERS)
(OWNER JESTER)
(GLOBAL STAIRS LARGE-DOOR SMALL-DOOR)
(MAP-LOC <PTABLE MAIN-MAP-NUM MAP-GEN-Y-4 MAP-GEN-X-10>)
(ICON J-QUARTER-ICON)
(ACTION JESTERS-QUARTERS-F)>
<ROUTINE JESTERS-QUARTERS-F ("OPT" (RARG <>))
<COND (<EQUAL? .RARG ,M-LOOK>
<TELL
"This is a small, spare room. The only features are a small louvered door on
the south wall, a larger arched door on the north wall, and a stair which
spirals downward. ">
<COND (<FSET? ,LARGE-DOOR ,OPENBIT>
<TELL "The large door is open but the small door is">)
(T
<TELL "Both doors are">)>
<TELL " closed.">)>>
<ROUTINE SMALL-DOOR-ENTER-F ("OPTIONAL" (RARG <>)) ;"called by NEXT-ROOM?"
<COND (<NOT .RARG>
<RETURN-FROM-MAP>
<DO-FIRST "open" ,SMALL-DOOR>
<THIS-IS-IT ,SMALL-DOOR>)>
<RFALSE>>
<OBJECT LARGE-DOOR
(LOC LOCAL-GLOBALS)
(DESC "large arched door")
(SYNONYM DOOR)
(ADJECTIVE LARGE ARCHED)
(FLAGS DOORBIT)
(GENERIC G-J-DOOR-F)
(ACTION LARGE-DOOR-F)>
<ROUTINE LARGE-DOOR-F ()
<COND (<AND <VERB? OPEN>
<NOT ,TOWER-BEATEN>>
<TELL
"Although there's no visible lock, the door refuses to budge." CR>)>>
<ROUTINE G-J-DOOR-F (TBL LEN)
<COND (<AND <VERB? OPEN>
<FSET? ,LARGE-DOOR ,OPENBIT>>
,SMALL-DOOR)
(<AND <VERB? CLOSE>
<FSET? ,LARGE-DOOR ,OPENBIT>>
,LARGE-DOOR)
(T
<RFALSE>)>>
<OBJECT SMALL-DOOR
(LOC LOCAL-GLOBALS) ;"so parser will which-print between the two doors"
(DESC "small louvered door")
(SYNONYM DOOR)
(ADJECTIVE SMALL SOUTH LOUVERED)
(FLAGS NDESCBIT)
(GENERIC G-J-DOOR-F)
(ACTION SMALL-DOOR-F)>
<ROUTINE SMALL-DOOR-F ("AUX" WEIGHT-CNT FUDGE)
<COND (<VERB? OPEN LOOK-BEHIND>
<PICINF-PLUS-ONE ,B-1-L-PIC-LOC>
<PUT ,B-Y-TBL 5 <GET ,PICINF-TBL 0>>
<PUT ,B-X-TBL 0 <GET ,PICINF-TBL 1>>
<PICINF-PLUS-ONE ,B-2-C-PIC-LOC>
<PUT ,B-Y-TBL 4 <GET ,PICINF-TBL 0>>
<PUT ,B-X-TBL 1 <GET ,PICINF-TBL 1>>
<PICINF-PLUS-ONE ,B-3-R-PIC-LOC>
<PUT ,B-Y-TBL 3 <GET ,PICINF-TBL 0>>
<PUT ,B-X-TBL 2 <GET ,PICINF-TBL 1>>
<PICINF-PLUS-ONE ,B-4-PIC-LOC>
<PUT ,B-Y-TBL 2 <GET ,PICINF-TBL 0>>
<PICINF-PLUS-ONE ,B-5-PIC-LOC>
<PUT ,B-Y-TBL 1 <GET ,PICINF-TBL 0>>
<PICINF-PLUS-ONE ,B-6-PIC-LOC>
<PUT ,B-Y-TBL 0 <GET ,PICINF-TBL 0>>
<FSET ,SMALL-DOOR ,OPENBIT>
<SETG TOWER-CHANGED <>>
<SPLIT-BY-PICTURE ,B-SPLIT T>
<ADJUST-TEXT-WINDOW ,B-BOTTOM>
<DRAW-TOWER>
<TELL
"Opening the door reveals a tiny nook containing a
Tower of Bozbar, consisting of 3 pegs and ">
<SET WEIGHT-CNT <+ <CCOUNT ,LEFT-PEG>
<CCOUNT ,RIGHT-PEG>
<CCOUNT ,CENTER-PEG>>>
<TELL N .WEIGHT-CNT>
<TELL " cylindrical weight">
<COND (<NOT <EQUAL? .WEIGHT-CNT 1>>
<TELL "s">)>
<COND (<EQUAL? .WEIGHT-CNT 6>
<TELL " ranging from a 1-ugh to a 6-ugh weight">)>
<TELL ,PERIOD-CR
" Type the number of the weight you want to move, followed by the peg
you want to move it to: L, C, or R. ">
<COND (,ACTIVE-MOUSE
<TELL
"Or, if you'd rather use your mouse, click on the weight you want to move,
then click on the peg you want to move it to. ">)>
<TELL "You can Undo your move by typing U">
<COND (,ACTIVE-MOUSE
<TELL " (or clicking on the UNDO spot)">)>
<COND (<0? <BAND <LOWCORE FLAGS> 8>> ;"system has no UNDO"
<TELL
" -- even though Undo doesn't normally work on your system!">)
(T
<TELL ".">)>
<TELL " Type X">
<COND (,ACTIVE-MOUSE
<TELL " (or click on the EXIT spot)">)>
<TELL " to exit.">
<TOWER-MODE>
<CRLF> <CRLF>
<HIT-ANY-KEY>
<INIT-SL-WITH-SPLIT ,TEXT-WINDOW-PIC-LOC>
<RTRUE>)
(<VERB? EXAMINE>
<TELL "The small door is closed." CR>)
(<VERB? CLOSE>
<TELL "It is!" CR>)>>
<OBJECT T-OF-B
(OWNER T-OF-B)
(DESC "Tower of Bozbar")
(SYNONYM TOWER BOZBAR)
(FLAGS CONTBIT OPENBIT SEARCHBIT)
(RESEARCH
"The Tower of Bozbar, an ancient game of unknown origin, consists of three pegs
and a pile of weights. The goal is to move the pile from one peg to another,
moving one weight at a time, with the constraint that no weight can ever be
placed atop a smaller weight. Many people say that the Tower of Bozbar is a
superb method of mental relaxation. [Obviously, none of these people have ever
played Zork Zero.]")>