-
Notifications
You must be signed in to change notification settings - Fork 27
/
verbs.zap
6085 lines (5352 loc) · 109 KB
/
verbs.zap
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
.FUNCT GOTO,WHERE,CR,WHO,X,L,OLIT
SET 'OLIT,LIT?
SET 'WHO,WINNER
LOC WINNER >L
EQUAL? L,SADDLE \?CCL3
IN? L,DACT \?CCL3
SET 'WHO,DACT
JUMP ?CND1
?CCL3: EQUAL? L,HERE /?CND1
FSET? L,VEHICLE \?CND1
CALL PERFORM,V?EXIT,L
EQUAL? STACK,M-FATAL \?CND9
SET 'P-WALK-DIR,FALSE-VALUE
RTRUE
?CND9: SET 'P-WALK-DIR,FALSE-VALUE
SET 'OLD-HERE,FALSE-VALUE
INC 'CR
?CND1: GETP HERE,P?ACTION
CALL STACK,M-EXIT >X
EQUAL? X,M-FATAL \?CCL13
SET 'P-WALK-DIR,FALSE-VALUE
RTRUE
?CCL13: ZERO? X /?CND11
ZERO? CR /?CND15
PRINT TAB
?CND15: INC 'CR
?CND11: EQUAL? WHO,WINNER \?CND17
IN? DACT,HERE \?CND17
FSET? DACT,LIVING \?CND17
FSET? DACT,MUNGED /?CND17
FSET? DACT,SLEEPING /?CND17
REMOVE DACT
EQUAL? WHERE,APLANE,DEATH /?CND17
ZERO? CR /?CND26
PRINT TAB
?CND26: INC 'CR
PRINTI "A shadow passes over "
PRINTD HEAD
PRINTI " as you leave."
CRLF
?CND17: ZERO? CR /?CND28
ZERO? VERBOSITY /?CND28
CRLF
?CND28: SET 'HERE,WHERE
MOVE WHO,WHERE
CALL1 IS-LIT? >LIT?
ZERO? OLIT \?CND32
ZERO? LIT? \?CND32
ZERO? CR /?CND36
PRINT TAB
?CND36: PRINT CYOU
CALL2 PICK-NEXT,DARK-WALKS
PRINT STACK
CALL1 GRUE-ROOM?
ZERO? STACK \?CND38
RANDOM 100
LESS? 50,STACK /?CND38
PRINTI ", straight into the jaws of a deadly presence lurking in the darkness"
ICALL1 JIGS-UP
RTRUE
?CND38: PRINT PERIOD
ZERO? VERBOSITY /?CND32
CRLF
?CND32: GETP HERE,P?ACTION
ICALL STACK,M-ENTERING
EQUAL? HERE,WHERE \TRUE
ZERO? LIT? \?CND45
ICALL1 MARK-DIR
?CND45: SET 'LAST-PSEUDO-LOC,FALSE-VALUE
FSET PSEUDO-OBJECT,NOARTICLE
FCLEAR PSEUDO-OBJECT,VOWEL
FCLEAR PSEUDO-OBJECT,TRYTAKE
SET 'LAST-MONSTER,FALSE-VALUE
SET 'LAST-MONSTER-DIR,FALSE-VALUE
SET 'P-IT-OBJECT,NOT-HERE-OBJECT
SET 'P-THEM-OBJECT,NOT-HERE-OBJECT
SET 'P-HIM-OBJECT,NOT-HERE-OBJECT
SET 'P-HER-OBJECT,NOT-HERE-OBJECT
ICALL2 V-LOOK,FALSE-VALUE
GETP HERE,P?ACTION
ICALL STACK,M-ENTERED
RTRUE
.FUNCT MARK-DIR,DIR,TBL,WRD,TYPE,LEN
ASSIGNED? 'DIR /?CND1
SET 'DIR,P-WALK-DIR
?CND1: LESS? DIR,P?DOWN /FALSE
SUB DIR,P?NORTH
SUB 0,STACK
GETB XPDIR-LIST,STACK
GETP HERE,STACK >TBL
ZERO? TBL /FALSE
GET TBL,XTYPE >WRD
BTST WRD,MARKBIT /TRUE
BAND WRD,65280 >TYPE
BAND WRD,127 >LEN
EQUAL? TYPE,CONNECT,SCONNECT,X-EXIT /?CCL10
EQUAL? TYPE,FCONNECT \?PRD13
ZERO? LEN \?CCL10
?PRD13: EQUAL? TYPE,DCONNECT \FALSE
GET TBL,XDATA
FSET? STACK,OPENED \FALSE
?CCL10: ADD WRD,MARKBIT
PUT TBL,XTYPE,STACK
RTRUE
.FUNCT DO-WALK,DIR1,DIR2,DIR3,X
SET 'P-WALK-DIR,DIR1
CALL PERFORM,V?WALK,DIR1 >X
EQUAL? X,M-FATAL \?CCL3
RETURN 2
?CCL3: ZERO? DIR2 /?CND1
CRLF
SET 'P-WALK-DIR,DIR2
CALL PERFORM,V?WALK,DIR2 >X
EQUAL? X,M-FATAL \?CCL9
RETURN 2
?CCL9: ZERO? DIR3 /?CND1
CRLF
SET 'P-WALK-DIR,DIR3
CALL PERFORM,V?WALK,DIR3 >X
?CND1: RETURN X
.FUNCT V-WALK,TBL,TYPE,DATA
ZERO? P-WALK-DIR \?CCL3
ZERO? PRSO /?CND4
PRINT STR?517
PRINTI "WALK TO "
ICALL1 THE-PRINT
PRINTC 46
PRINT BRACKET
ICALL PERFORM,V?WALK-TO,PRSO
RTRUE
?CND4: ICALL1 V-WALK-AROUND
RTRUE
?CCL3: IN? PLAYER,SADDLE \?CCL7
IN? SADDLE,DACT \?CCL7
CALL1 NEXT-SKY
RSTACK
?CCL7: EQUAL? HERE,APLANE \?CND1
CALL1 NEXT-APLANE
RSTACK
?CND1: GETP HERE,PRSO >TBL
ZERO? TBL \?CND11
ICALL1 NO-EXIT-THAT-WAY
RETURN 2
?CND11: GET TBL,XTYPE
BAND STACK,65280 >TYPE
EQUAL? TYPE,NO-EXIT,SHADOW-EXIT \?CND15
ICALL1 NO-EXIT-THAT-WAY
RETURN 2
?CND15: EQUAL? LAST-MONSTER,FALSE-VALUE,DORN,MAMA /?CND19
IN? LAST-MONSTER,HERE \?CND19
IN? WINNER,HERE \?CND19
FSET? LAST-MONSTER,LIVING \?CND19
FSET? LAST-MONSTER,SLEEPING /?CND19
EQUAL? LAST-MONSTER-DIR,P-WALK-DIR \?CND19
ZERO? LIT? /?CND19
ICALL2 CTHE-PRINT,LAST-MONSTER
PRINTI " block"
ZERO? LIT? /?CCL29
FSET? LAST-MONSTER,PLURAL /?CND28
?CCL29: PRINTC 115
?CND28: PRINTR " your path!"
?CND19: GET TBL,XROOM >DATA
EQUAL? TYPE,CONNECT,X-EXIT \?CCL34
ICALL2 GOTO,DATA
RTRUE
?CCL34: EQUAL? TYPE,SORRY-EXIT \?CCL36
PRINT DATA
CRLF
RETURN 2
?CCL36: EQUAL? TYPE,SCONNECT \?CCL40
GET TBL,XDATA
PRINT STACK
CRLF
ZERO? VERBOSITY /?CND41
CRLF
?CND41: ICALL2 GOTO,DATA
RTRUE
?CCL40: EQUAL? TYPE,FCONNECT \?CCL44
CALL DATA >DATA
ZERO? DATA /?PRG47
ICALL2 GOTO,DATA
RTRUE
?PRG47: RETURN 2
?CCL44: EQUAL? TYPE,DCONNECT \?PRG54
GET TBL,XDATA >TYPE
FSET? TYPE,OPENED \?CND50
ICALL2 GOTO,DATA
RTRUE
?CND50: ICALL2 ITS-CLOSED,TYPE
RETURN 2
?PRG54: RETURN 2
.FUNCT NO-EXIT-THAT-WAY,STR
GETP HERE,P?EXIT-STR >STR
EQUAL? P-WALK-DIR,FALSE-VALUE,P?UP,P?DOWN /?CND1
EQUAL? P-WALK-DIR,P?IN,P?OUT /?CND1
ZERO? STR /?CND1
PRINT STR
CRLF
RTRUE
?CND1: PRINTR "There's no exit that way."
.FUNCT NEXT-OVER,CNT,DIR,BITS,TBL,XTBL,TYPE,DATA
GET FLY-TABLES,ABOVE >XTBL
GETB XTBL,0 >BITS
SET 'DIR,I-NORTH
?PRG1: GETB PDIR-LIST,DIR
GETP HERE,STACK >TBL
SET 'DATA,0
GETB DBIT-LIST,DIR
BTST BITS,STACK \?CCL5
SET 'TYPE,649
INC 'CNT
GETB XTBL,CNT >DATA
EQUAL? HERE,IN-SKY \?CCL8
EQUAL? DATA,OPLAIN \?CCL8
SET 'TYPE,1161
JUMP ?CND3
?CCL8: EQUAL? HERE,APLANE \?CND3
EQUAL? DATA,OCAVES \?CND3
SET 'TYPE,NO-EXIT
SET 'DATA,0
JUMP ?CND3
?CCL5: EQUAL? HERE,IN-SKY \?CCL15
SET 'TYPE,1161
JUMP ?CND3
?CCL15: SET 'TYPE,NO-EXIT
?CND3: PUT TBL,XTYPE,TYPE
PUT TBL,XDATA,DATA
IGRTR? 'DIR,I-NW \?PRG1
RFALSE
.FUNCT NEXT-SKY,DIR,IDIR,D1,D2,D3,TBL,DATA,X
ZERO? DACT-SLEEP \?CCL2
FSET? DACT,SLEEPING /?CCL2
FSET? DACT,MUNGED /?CCL2
FSET? DACT,LIVING /?CND1
?CCL2: ICALL2 CTHE-PRINT,DACT
PRINTI " is in no condition to move around."
CRLF
RETURN 2
?CND1: SET 'DIR,P-WALK-DIR
SET 'P-WALK-DIR,FALSE-VALUE
EQUAL? DIR,P?UP \?CCL11
EQUAL? HERE,IN-SKY \?CND12
ICALL2 CTHE-PRINT,DACT
PRINTI " puffs and strains, but cannot lift you any higher."
CRLF
RETURN 2
?CND12: GETP HERE,P?FNUM >X
ZERO? X \?CND16
PRINT CANT
PRINTI "fly here."
CRLF
RETURN 2
?CND16: ICALL2 CTHE-PRINT,DACT
EQUAL? HERE,IN-GARDEN \?CND20
ZERO? PTIMER /?CND20
PRINTR " cocks his head, hesitating."
?CND20: PRINTI " spreads his leathery wings and "
IN? PARASOL,PLAYER \?CND24
FSET? PARASOL,OPENED \?CND24
PRINTI "tries to take off. But your open "
PRINTD PARASOL
PRINTR " seems to be dragging him down."
?CND24: SET 'ABOVE,X
PUTP IN-SKY,P?FNUM,ABOVE
PRINTI "rises into the sky."
CRLF
ZERO? VERBOSITY /?CND28
CRLF
?CND28: ICALL2 GOTO,IN-SKY
ICALL1 CHECK-BREEZE
RTRUE
?CCL11: EQUAL? DIR,P?DOWN \?CCL31
EQUAL? HERE,IN-SKY /?CND32
ICALL2 CTHE-PRINT,DACT
PRINTI " is already on "
ICALL2 THE-PRINT,GROUND
PRINT PERIOD
RETURN 2
?CND32: CALL1 DOWN-TO? >X
ZERO? X \?CND36
EQUAL? ABOVE,OTHRIFF \?PRG40
ICALL2 CTHE-PRINT,DACT
PRINTI " tries his best to land, but "
ICALL2 THE-PRINT,GROUND
PRINTI " below is completely choked with "
PRINTD XTREES
PRINT PERIOD
?PRG40: RETURN 2
?CND36: ICALL2 CTHE-PRINT,DACT
PRINTI " glides earthward."
CRLF
ZERO? VERBOSITY /?CND42
CRLF
?CND42: ICALL2 GOTO,X
RTRUE
?CCL31: EQUAL? DIR,FALSE-VALUE,P?IN,P?OUT \?CCL45
ICALL1 PUZZLED-DACT
RETURN 2
?CCL45: EQUAL? HERE,IN-SKY /?CND9
SET 'P-WALK-DIR,FALSE-VALUE
PRINTI "It's hard enough for a "
PRINTD DACT
PRINTI " to walk, even when there's not an adventurer riding his back."
CRLF
RETURN 2
?CND9: GETP HERE,DIR >TBL
GET TBL,XDATA >DATA
GET TBL,XTYPE
EQUAL? STACK,1161 \?CND51
PRINTI "The sky is filled with impenetrable "
EQUAL? DATA,OPLAIN \?CND53
PRINTI "funnel "
?CND53: PRINTI "clouds in that "
PRINTD INTDIR
PRINT PERIOD
RETURN 2
?CND51: ADD WINDIR,4 >D1
GRTR? D1,I-NW \?CND57
SUB D1,8 >D1
?CND57: ADD D1,1 >D2
GRTR? D2,I-NW \?CND59
SET 'D2,I-NORTH
?CND59: SUB D1,1 >D3
LESS? D3,I-NORTH \?CND61
SET 'D3,I-NW
?CND61: SUB DIR,P?NORTH
SUB 0,STACK >IDIR
EQUAL? IDIR,D1,D2,D3 \?CND63
FCLEAR BREEZE,SEEN
ICALL2 CTHE-PRINT,DACT
PRINTI " banks smoothly to the "
GET DIR-NAMES,IDIR
PRINTB STACK
PRINT PERIOD
ICALL2 FLYOVER,DATA
RTRUE
?CND63: FSET BREEZE,SEEN
SUB WINDIR,2 >D1
LESS? D1,I-NORTH \?CND65
ADD D1,8 >D1
?CND65: EQUAL? IDIR,D1 \?CND67
SUB WINDIR,3 >D2
LESS? D2,I-NORTH \?CND69
ADD D2,8 >D2
?CND69: CALL DO-CROSSWIND,IDIR,D2
RSTACK
?CND67: ADD WINDIR,2 >D1
GRTR? D1,I-NW \?CND71
SUB D1,8 >D1
?CND71: EQUAL? IDIR,D1 \?CND73
ADD WINDIR,3 >D2
GRTR? D2,I-NW \?CND75
SUB D2,8 >D2
?CND75: CALL DO-CROSSWIND,IDIR,D2
RSTACK
?CND73: ICALL2 CTHE-PRINT,DACT
PRINTI " does his best to fly into the wind, but fails."
CRLF
RETURN 2
.FUNCT DO-CROSSWIND,IDIR,D2,TBL,DATA
GETB PDIR-LIST,D2
GETP IN-SKY,STACK >TBL
GET TBL,XDATA >DATA
EQUAL? DATA,0,OPLAIN,OCAVES /?CCL2
GET TBL,XTYPE
EQUAL? STACK,1161 /?CCL2
RANDOM 100
LESS? 50,STACK /?CND1
?CCL2: PRINTI "A strong crosswind prevents "
ICALL2 THE-PRINT,DACT
PRINTI " from flying that way."
CRLF
RETURN 2
?CND1: ICALL2 CTHE-PRINT,DACT
PRINTI " banks to the "
GET DIR-NAMES,IDIR
PRINTB STACK
PRINTI ", but a strong crosswind blows him off course."
CRLF
ICALL2 FLYOVER,DATA
RTRUE
.FUNCT FLYOVER,DATA
SET 'ABOVE,DATA
PUTP IN-SKY,P?FNUM,ABOVE
ICALL1 NEXT-OVER
ICALL2 RELOOK,TRUE-VALUE
ICALL1 CHECK-BREEZE
RTRUE
.FUNCT CHECK-BREEZE
EQUAL? ABOVE,OTHRIFF \?PRD4
EQUAL? WINDIR,I-EAST,I-SE,I-SOUTH /?CCL2
?PRD4: EQUAL? ABOVE,OXROADS \FALSE
EQUAL? WINDIR,I-NORTH,I-NE,I-EAST \FALSE
?CCL2: CALL1 NEXT-WINDIR? >WINDIR
FSET BREEZE,SEEN
PRINT TAB
CALL2 PICK-NEXT,WIND-ALERTS
PRINT STACK
PRINT PERIOD
RFALSE
.FUNCT NEXT-APLANE,DIR,TBL,DATA,NEW,X
SET 'DIR,P-WALK-DIR
SET 'P-WALK-DIR,FALSE-VALUE
LOC PLAYER >X
EQUAL? DIR,P?UP,P?DOWN /?CTR2
EQUAL? DIR,P?IN,P?OUT \?CCL3
?CTR2: PRINTI "Such "
PRINTD INTDIR
PRINTI "s have no meaning here."
CRLF
RETURN 2
?CCL3: EQUAL? X,APLANE /?CND1
FSET? X,VEHICLE \?CND1
CALL PERFORM,V?EXIT,X
EQUAL? STACK,M-FATAL \?CND10
RETURN 2
?CND10: PRINT TAB
?CND1: GETP HERE,DIR >TBL
GET TBL,XTYPE >DATA
EQUAL? DATA,NO-EXIT \?CCL16
PRINTI "The local geometry does not extend in that "
PRINTD INTDIR
PRINT PERIOD
RETURN 2
?CCL16: EQUAL? ABOVE,OPLAIN \?CND14
ZERO? IMPSAY /?CND20
ICALL1 PERMISSION
RETURN 2
?CND20: ICALL1 EXIT-IMPS
?CND14: GET TBL,XDATA >NEW
EQUAL? NEW,OPLAIN \?CND24
FSET? SHAPE,LIVING \?CCL28
IN? SHAPE,APLANE /?CND29
BOR NEW-DBOX,SHOWING-ROOM >NEW-DBOX
MOVE SHAPE,APLANE
SET 'LAST-MONSTER,SHAPE
SET 'LAST-MONSTER-DIR,FALSE-VALUE
SET 'P-IT-OBJECT,SHAPE
PRINTI "The space before you flexes in on itself, twists sideways and reopens into "
ICALL2 PRINTA,SHAPE
PRINTI ", stretched across your path like the skin of a drum."
CRLF
RETURN 2
?CND29: ICALL2 CTHE-PRINT,SHAPE
PRINTI " stretches itself tighter across your path."
CRLF
RETURN 2
?CCL28: ZERO? IMPSAY \?CND24
ICALL1 KERBLAM
PRINTI "A bolt of "
PRINTB W?LIGHTNING
PRINTI " blocks your path."
CRLF
RETURN 2
?CND24: EQUAL? ABOVE,OACCARDI,OCITY,OMIZNIA \?CND38
REMOVE CURTAIN
?CND38: IN? SHAPE,APLANE \?CND40
REMOVE SHAPE
SET 'LAST-MONSTER,FALSE-VALUE
SET 'P-IT-OBJECT,NOT-HERE-OBJECT
ICALL2 CTHE-PRINT,SHAPE
PRINTI " disincorporates as you retreat."
CRLF
ZERO? VERBOSITY /?CND40
CRLF
?CND40: SET 'ABOVE,NEW
ICALL1 GET-APLANE-THINGS
ICALL1 NEXT-OVER
ICALL1 V-LOOK
RTRUE
.FUNCT PERMISSION
PRINTR """We didn't say you could leave yet,"" notes an Implementor dryly."
.FUNCT EXIT-IMPS
REMOVE IMPTAB
REMOVE IMPS
ICALL2 DEQUEUE,I-IMPS
RFALSE
.FUNCT GET-APLANE-THINGS
EQUAL? ABOVE,OCITY,OMIZNIA,OACCARDI \?CCL3
IN? CURTAIN,APLANE /TRUE
MOVE CURTAIN,APLANE
FCLEAR CURTAIN,NODESC
RTRUE
?CCL3: EQUAL? ABOVE,OPLAIN \FALSE
IN? IMPS,APLANE /FALSE
MOVE IMPTAB,APLANE
MOVE IMPS,APLANE
ICALL2 QUEUE,I-IMPS
RTRUE
.FUNCT ANY-TOUCHED?,TBL,EXCLUDED,LEN,RM,CNT
GETB TBL,0 >LEN
SET 'CNT,1
?PRG1: GETB TBL,LEN >RM
FSET? RM,TOUCHED \?CND3
ASSIGNED? 'EXCLUDED \?CCL4
FSET? RM,EXCLUDED /?CND3
?CCL4: INC 'CNT
PUT AUX-TABLE,CNT,RM
?CND3: DLESS? 'LEN,1 \?PRG1
EQUAL? CNT,1 /FALSE
EQUAL? CNT,2 \?CND11
GET AUX-TABLE,2
RSTACK
?CND11: PUT AUX-TABLE,0,CNT
PUT AUX-TABLE,1,0
CALL2 PICK-ONE,AUX-TABLE
RSTACK
.FUNCT DOWN-TO?,RM,X
EQUAL? ABOVE,ORUINS \?CCL3
CALL2 ANY-TOUCHED?,RUIN-ROOMS >RM
ZERO? RM /?PRD7
RETURN RM
?PRD7: CALL1 SETUP-RUINS?
ZERO? STACK /?CND4
CALL2 RANDOM-ROOM?,RUIN-ROOMS >RM
?CND4: RETURN RM
?CCL3: EQUAL? ABOVE,OBRIDGE \?CCL9
SET 'BRIDGE-DIR,0
SET 'ZTOP,1
SET 'ZBOT,2
RETURN ON-BRIDGE
?CCL9: EQUAL? ABOVE,OFOREST \?CCL11
CALL2 ANY-TOUCHED?,FOREST-ROOMS >RM
ZERO? RM /?PRD15
RETURN RM
?PRD15: CALL1 SETUP-FOREST?
ZERO? STACK /?CND12
CALL2 RANDOM-ROOM?,FOREST-ROOMS >RM
?CND12: RETURN RM
?CCL11: EQUAL? ABOVE,OACCARDI \?CCL17
SET 'RM,IN-ACCARDI
FSET? AT-GATE,TOUCHED /?PRD21
RETURN RM
?PRD21: RANDOM 100
LESS? 50,STACK /?CND18
SET 'RM,AT-GATE
?CND18: RETURN RM
?CCL17: EQUAL? ABOVE,OCITY \?CCL23
SET 'RM,IN-GURTH
FSET? AT-MAGICK,TOUCHED /?CCL25
RETURN RM
?CCL25: SET 'RM,AT-MAGICK
RETURN RM
?CCL23: EQUAL? ABOVE,OSHORE \?CCL27
CALL2 ANY-TOUCHED?,SHORE-ROOMS >RM
ZERO? RM /?CCL29
RETURN RM
?CCL29: SET 'RM,AT-LEDGE
RETURN RM
?CCL27: EQUAL? ABOVE,OXROADS \?CCL31
RETURN XROADS
?CCL31: EQUAL? ABOVE,OPLAIN /FALSE
EQUAL? ABOVE,OGRUBBO \?CCL35
RETURN HILLTOP
?CCL35: EQUAL? ABOVE,OCAVES \?CCL37
RETURN IN-GARDEN
?CCL37: EQUAL? ABOVE,OMOOR \?CCL39
CALL2 ANY-TOUCHED?,MOOR-ROOMS >RM
ZERO? RM /?PRD43
RETURN RM
?PRD43: CALL1 SETUP-MOOR?
ZERO? STACK /?CND40
CALL2 RANDOM-ROOM?,MOOR-ROOMS >RM
?CND40: RETURN RM
?CCL39: EQUAL? ABOVE,OJUNGLE \?CCL45
CALL2 ANY-TOUCHED?,JUNGLE-ROOMS >RM
ZERO? RM /?PRD49
RETURN RM
?PRD49: CALL1 SETUP-JUNGLE?
ZERO? STACK /?CND46
CALL2 RANDOM-ROOM?,JUNGLE-ROOMS >RM
?CND46: RETURN RM
?CCL45: EQUAL? ABOVE,OMIZNIA \?CCL51
CALL2 ANY-TOUCHED?,MIZNIA-ROOMS >RM
ZERO? RM /?CCL53
RETURN RM
?CCL53: SET 'RM,IN-PORT
RETURN RM
?CCL51: EQUAL? ABOVE,OTHRIFF \FALSE
SET 'RM,IN-THRIFF
FSET? IN-THRIFF,MUNGED /?CCL57
RETURN RM
?CCL57: SET 'RM,IN-PASTURE
RETURN RM
.FUNCT RANDOM-ROOM?,TBL,OHERE,RM,X
GETB TBL,0
RANDOM STACK
GETB TBL,STACK >RM
FSET? RM,TOUCHED /?CND1
SET 'OHERE,HERE
SET 'HERE,RM
GETP RM,P?ACTION
CALL STACK,M-ENTERING >X
SET 'HERE,OHERE
FSET RM,TOUCHED
?CND1: RETURN RM
.FUNCT PRE-TAKE,L,LL,WHO,X,X2
LOC PRSO >L
ZERO? L /?CND1
LOC L >LL
?CND1: ZERO? LIT? \?CCL5
EQUAL? WINNER,L,LL /?CCL5
ICALL1 TOO-DARK
RTRUE
?CCL5: EQUAL? L,GLOBAL-OBJECTS \?CCL9
ICALL1 IMPOSSIBLE
RTRUE
?CCL9: EQUAL? L,WINNER \?CCL11
ICALL2 THIS-IS-IT,PRSO
PRINT ALREADY
FSET? PRSO,WORN \?CCL14
PRINTB W?WEAR
JUMP ?CND12
?CCL14: PRINTB W?HOLD
?CND12: PRINTI "ing "
ICALL1 THE-PRINT
PRINT PERIOD
RTRUE
?CCL11: EQUAL? L,FALSE-VALUE,BROG /?CCL16
FSET? L,CONTAINER \?CCL16
FSET? L,TRANSPARENT \?CCL16
FSET? L,OPENED /?CCL16
ICALL2 CANT-REACH-INTO,L
RTRUE
?CCL16: EQUAL? LL,FALSE-VALUE,BROG /?CCL22
FSET? LL,CONTAINER \?CCL22
FSET? LL,TRANSPARENT \?CCL22
FSET? LL,OPENED /?CCL22
ICALL2 CANT-REACH-INTO,LL
RTRUE
?CCL22: ZERO? PRSI /?CCL28
EQUAL? PRSO,PRSI \?CCL31
GET P-NAMW,0 >X
GET P-ADJW,0 >X2
GET P-NAMW,1
EQUAL? X,STACK /?CCL33
GET P-ADJW,1
EQUAL? X2,STACK \FALSE
?CCL33: ICALL1 IMPOSSIBLE
RTRUE
?CCL31: EQUAL? PRSI,ME \?CCL37
EQUAL? WINNER,PLAYER \?CCL40
ICALL1 NOBODY-TO-ASK
RTRUE
?CCL40: EQUAL? L,WINNER /FALSE
ICALL2 CTHE-PRINT,WINNER
PRINTI " doesn't have "
ICALL1 THE-PRINT
PRINT PERIOD
RTRUE
?CCL37: EQUAL? L,PRSI /FALSE
EQUAL? L,ON-MCASE,ON-WCASE,ON-BCASE \?CND44
EQUAL? PRSI,MCASE,WCASE,BCASE /FALSE
?CND44: ICALL1 CTHE-PRINT
ICALL1 ISNT-ARENT
ICALL2 ON-IN,PRSI
PRINT PERIOD
RTRUE
?CCL28: LOC WINNER
EQUAL? PRSO,STACK \FALSE
EQUAL? PRSO,BUSH,POOL /FALSE
PRINTI "Difficult. You're"
ICALL1 ON-IN
PRINT PERIOD
RTRUE
.FUNCT CANT-REACH-INTO,L
PRINT CANT
PRINTI "reach into "
ICALL2 THE-PRINT,L
PRINTR ". It's closed."
.FUNCT V-TAKE,L
CALL1 ITAKE >L
ZERO? L /TRUE
CALL2 SPARK?,FALSE-VALUE
ZERO? STACK /?CND1
PRINT TAB
?CND1: ZERO? P-MULT? \?CTR6
EQUAL? L,UNDERUG,UNDERPEW,LAMPHOUSE /?CTR6
ZERO? STATIC /?CCL7
FSET? PRSO,FERRIC \?CCL7
?CTR6: ICALL1 TAKEN
RTRUE
?CCL7: FSET? L,CONTAINER /?CTR13
FSET? L,SURFACE /?CTR13
FSET? L,PERSON /?CTR13
FSET? L,LIVING \?CCL14
?CTR13: PRINTI "You take "
ICALL1 THE-PRINT
ICALL2 OUT-OF-LOC,L
PRINT PERIOD
RTRUE
?CCL14: RANDOM 100
LESS? 50,STACK /?CND5
ICALL1 TAKEN
RTRUE
?CND5: PRINT CYOU
EQUAL? P-PRSA-WORD,W?GRAB,W?SEIZE,W?SNATCH \?CCL22
PRINTB P-PRSA-WORD
JUMP ?CND20
?CCL22: RANDOM 100
LESS? 50,STACK /?CCL24
PRINTI "pick up"
JUMP ?CND20
?CCL24: PRINTB W?TAKE
?CND20: PRINTC SP
ICALL1 THE-PRINT
PRINT PERIOD
RTRUE
.FUNCT TAKEN
PRINTR "Taken."
.FUNCT FIRST-TAKE?
EQUAL? PRSA,V?TAKE \FALSE
FSET? PRSO,TOUCHED /FALSE
CALL1 ITAKE
ZERO? STACK /TRUE
PUTP PRSO,P?DESCFCN,0
ICALL1 TAKEN
RTRUE
.FUNCT ITAKE,VB,CNT,OBJ,L,X,MAX
ASSIGNED? 'VB /?CND1
SET 'VB,TRUE-VALUE
?CND1: ZERO? PRSO /?CCL4
LOC PRSO >L
ZERO? L \?CND3
?CCL4: ICALL1 CANT-SEE-ANY
RFALSE
?CND3: ICALL2 THIS-IS-IT,PRSO
FSET? PRSO,TAKEABLE /?CCL9
ZERO? VB /FALSE
ICALL1 IMPOSSIBLE
RFALSE
?CCL9: FSET? L,CONTAINER \?CND7
FSET? L,OPENABLE \?CND7
FSET? L,OPENED /?CND7
LOC WINNER
EQUAL? L,STACK /?CND7
ZERO? VB /FALSE
ICALL YOUD-HAVE-TO,STR?518,L
RFALSE
?CND7: EQUAL? WINNER,UNICORN \?CCL21
FIRST? WINNER >X \?CCL21
LOC WINNER
MOVE X,STACK
PRINTI "[putting down "
ICALL2 THE-PRINT,X
PRINTI " first"
PRINT BRACKET
JUMP ?CND19
?CCL21: EQUAL? WINNER,PLAYER \?CND19
IN? ONION,PLAYER \?CND25
ZERO? VB /FALSE
ICALL YOUD-HAVE-TO,STR?519,ONION
RFALSE
?CND25: CALL2 WEIGHT,PRSO >X
GET STATS,STRENGTH
DIV STACK,10
ADD LOAD-ALLOWED,STACK >MAX
IN? L,WINNER /?CND29
CALL2 WEIGHT,WINNER
ADD X,STACK
GRTR? STACK,MAX \?CND29
ZERO? VB /FALSE
FIRST? WINNER >X \?CCL37
PRINTI "Your load is "
JUMP ?CND35
?CCL37: ICALL1 CTHE-PRINT
ICALL1 IS-ARE
?CND35: PRINTI "too heavy."
CRLF
RFALSE
?CND29: FIRST? WINNER >OBJ \?CND38
?PRG40: FSET? OBJ,NODESC /?CND42
FSET? OBJ,WORN /?CND42
FSET? OBJ,TAKEABLE \?CND42
INC 'CNT
?CND42: NEXT? OBJ >OBJ /?PRG40
?CND38: GET STATS,DEXTERITY
DIV STACK,10
ADD FUMBLE-NUMBER,STACK >MAX
GRTR? CNT,MAX \?CND19
ZERO? VB /FALSE
PRINTI "Your hands are full."
CRLF
RFALSE
?CND19: BOR NEW-DBOX,SHOWING-ALL >NEW-DBOX
FSET PRSO,TOUCHED
FCLEAR PRSO,NODESC
FCLEAR PRSO,NOALL
MOVE PRSO,WINNER
RETURN L
.FUNCT WEIGHT,THING,WT,OBJ
FIRST? THING >OBJ \?CND1
?PRG3: EQUAL? THING,WINNER \?CCL7
FSET? OBJ,WORN \?CCL7
INC 'WT
JUMP ?CND5
?CCL7: CALL2 WEIGHT,OBJ
ADD WT,STACK >WT
?CND5: NEXT? OBJ >OBJ /?PRG3
?CND1: GETP THING,P?SIZE
ADD WT,STACK
RSTACK
.FUNCT V-WIELD,OBJ
FSET? PRSO,TAKEABLE /?CCL3
ICALL1 IMPOSSIBLE
RTRUE
?CCL3: IN? PRSO,WINNER /?CCL5
ICALL2 MUST-HOLD,PRSO
PRINTR " before you can wield it."
?CCL5: FSET? PRSO,WORN \?CCL7
ICALL YOUD-HAVE-TO,STR?520,PRSO
RTRUE
?CCL7: FSET? PRSO,WIELDED \?CND1
PRINT ALREADY
PRINTI "wielding "
ICALL1 THE-PRINT
PRINT PERIOD
RTRUE
?CND1: FIRST? WINNER >OBJ \?CND9
?PRG11: FSET? OBJ,WIELDED \?CND13
FCLEAR OBJ,WIELDED
PRINTI "[setting aside "
ICALL2 THE-PRINT,OBJ
PRINTI " first"
PRINT BRACKET
JUMP ?CND9
?CND13: NEXT? OBJ >OBJ /?PRG11
?CND9: BOR NEW-DBOX,SHOWING-INV >NEW-DBOX
FSET PRSO,WIELDED
PRINTI "You wield "
ICALL1 THE-PRINT
PRINT PERIOD
RTRUE
.FUNCT V-UNWIELD
FSET? PRSO,TAKEABLE /?CCL3
ICALL1 IMPOSSIBLE
RTRUE
?CCL3: FSET? PRSO,WIELDED /?CND1
PRINTI "You're not wielding "
ICALL1 THE-PRINT
PRINT PERIOD
RTRUE
?CND1: BOR NEW-DBOX,SHOWING-INV >NEW-DBOX
FCLEAR PRSO,WIELDED
PRINTI "You set aside "
ICALL1 THE-PRINT
PRINT PERIOD
RTRUE
.FUNCT SPARK?,INDENT,OBJ
ASSIGNED? 'INDENT /?CND1
SET 'INDENT,TRUE-VALUE
?CND1: ASSIGNED? 'OBJ /?CND3
SET 'OBJ,PRSO
?CND3: CALL2 NO-SPARK?,OBJ
ZERO? STACK \FALSE
ZERO? INDENT /?CND5
PRINT TAB
?CND5: ICALL2 ITALICIZE,STR?521
PRINTI "! You feel a "
GRTR? STATIC,2 \?CND9
PRINTI "painful "
?CND9: PRINTI "spark as you touch "
ICALL2 THE-PRINT,OBJ
PRINT PERIOD
SUB 0,STATIC
ICALL2 UPDATE-STAT,STACK
ICALL2 SPARK-OBJ,OBJ
RTRUE
.FUNCT SPARK-TO?,OBJ1,OBJ2
ASSIGNED? 'OBJ1 /?CND1
SET 'OBJ1,PRSO
?CND1: ASSIGNED? 'OBJ2 /?CND3
SET 'OBJ2,PRSI
?CND3: CALL2 NO-SPARK?,OBJ2
ZERO? STACK \FALSE
EQUAL? OBJ1,HANDS,FEET,ME /?CND5
FSET? OBJ1,FERRIC \FALSE
?CND5: ICALL1 SAY-SNAP
ICALL2 SAY-YOUR,OBJ1
PRINT AND
ICALL2 THE-PRINT,OBJ2
PRINTC 33
CRLF
FSET? OBJ1,FERRIC /?CND10
SUB 0,STATIC
ICALL2 UPDATE-STAT,STACK
?CND10: ICALL2 SPARK-OBJ,OBJ2
RTRUE
.FUNCT SAY-SNAP
ICALL2 ITALICIZE,STR?521
PRINTI "! A "
GRTR? STATIC,3 \?CND1
PRINTI "painful "
?CND1: PRINTI "spark leaps between "
RFALSE
.FUNCT NO-SPARK?,OBJ,L
ZERO? STATIC /TRUE
LOC OBJ >L
EQUAL? L,FALSE-VALUE,LOCAL-GLOBALS,GLOBAL-OBJECTS /TRUE
LOC L
EQUAL? PLAYER,L,STACK /TRUE
RFALSE
.FUNCT SPARK-OBJ,OBJ
FSET? OBJ,LIVING \?CND1
EQUAL? OBJ,DUST \?CCL4
ICALL2 VANISH,DUST
ICALL2 DEQUEUE,I-DUST
MOVE RING,HERE
SET 'P-IT-OBJECT,RING
SET 'P-THEM-OBJECT,NOT-HERE-OBJECT
PRINTI " A bright blue "
ICALL2 ITALICIZE,STR?522
PRINTI " of electricity lights the room! "
ICALL2 BLINK,DUST
PRINTI " draw"
EQUAL? BUNNIES,1 \?CCL7
PRINTI "s itself"
JUMP ?CND5
?CCL7: PRINTI " themselves"
?CND5: PRINTI " together into a hard ring of particles, which falls with a clatter to your feet."
CRLF
GETP DUST,P?VALUE
ICALL UPDATE-STAT,STACK,EXPERIENCE
JUMP ?CND1
?CCL4: FSET? OBJ,MONSTER \?CCL9
FSET OBJ,STRICKEN
GETP OBJ,P?ENDURANCE
SUB STACK,STATIC
PUTP OBJ,P?ENDURANCE,STACK
JUMP ?CND1
?CCL9: PRINT TAB
ICALL2 CTHE-PRINT,OBJ
PRINTI " looks at you reproachfully."
CRLF
EQUAL? OBJ,UNICORN \?CND1
ICALL UPDATE-STAT,-5,LUCK,TRUE-VALUE
?CND1: SET 'STATIC,0
RFALSE