-
Notifications
You must be signed in to change notification settings - Fork 16
/
misc.zil
1151 lines (1008 loc) · 28.7 KB
/
misc.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
"MISC for
SHOGUN
(c) Copyright 1988 Infocom, Inc. All Rights Reserved."
<BEGIN-SEGMENT 0>
<PROPDEF SCENE <> (SCENE "MANY" S:FIX = <> "MANY" <BYTE .S>)>
<PROPDEF SCORE <> (SCORE N:FIX = 2 <BYTE 0> <BYTE .N>)>
;"tell macro and friends"
;"moved tell-tokens to DEFS"
<ROUTINE PRINT-HIM/HER (X)
<COND (<FSET? .X ,PLURAL>
<TELL "them">)
(<FSET? .X ,PERSON>
<COND (<EQUAL? .X ,ME ,WINNER>
<TELL "yourself">)
(<FSET? .X ,FEMALE>
<TELL "her">)
(ELSE <TELL "him">)>)
(ELSE <TELL "it">)>>
<ROUTINE CPRINT-HE/SHE (X)
<COND (<FSET? .X ,PLURAL>
<TELL "They">)
(<FSET? .X ,PERSON>
<COND (<EQUAL? .X ,ME ,WINNER>
<TELL "You">)
(<FSET? .X ,FEMALE>
<TELL "She">)
(ELSE <TELL "He">)>)
(ELSE <TELL "It">)>>
<ROUTINE PRINT-HE/SHE (X)
<COND (<FSET? .X ,PLURAL>
<TELL "they">)
(<FSET? .X ,PERSON>
<COND (<EQUAL? .X ,ME ,WINNER>
<TELL "yourself">)
(<FSET? .X ,FEMALE>
<TELL "she">)
(ELSE <TELL "he">)>)
(ELSE <TELL "it">)>>
<ROUTINE PRINT-HIS/HER (X)
<COND (<FSET? .X ,PLURAL>
<TELL "their">)
(<FSET? .X ,PERSON>
<COND (<EQUAL? .X ,ME ,WINNER>
<TELL "your">)
(<FSET? .X ,FEMALE>
<TELL "her">)
(ELSE <TELL "his">)>)
(ELSE <TELL "its">)>>
<ROUTINE PRINT-PLURAL (OBJ)
<COND (<NOT <FSET? .OBJ ,PLURAL>>
<TELL "s">)>>
<ROUTINE PRINTUNDER (X)
<HLIGHT ,H-UNDER>
<PRINT .X>
<HLIGHT ,H-NORMAL>>
<ROUTINE CTHE-PRINT-PRSO ()
<THE-PRINT ,PRSO T>>
<ROUTINE CTHE-PRINT-PRSI ()
<THE-PRINT ,PRSI T>>
<ROUTINE CTHE-PRINT (O)
<THE-PRINT .O T>>
<ROUTINE THE-PRINT-PRSO ()
<THE-PRINT ,PRSO>>
<ROUTINE THE-PRINT-PRSI ()
<THE-PRINT ,PRSI>>
<ROUTINE THE-PRINT (O "OPTIONAL" (CAP? <>))
<DPRINT .O .CAP? <NOT <FSET? .O ,NOTHEBIT>>>>
<ROUTINE CPRINTA-PRSO ()
<PRINTA ,PRSO T>>
;<ROUTINE CPRINTA-PRSI ()
<PRINTA ,PRSI T>>
;<ROUTINE CPRINTA (O)
<PRINTA .O T>>
<ROUTINE PRINTA-PRSO ()
<PRINTA ,PRSO>>
<ROUTINE PRINTA-PRSI ()
<PRINTA ,PRSI>>
<ROUTINE PRINTA (O "OPT" (CAP? <>))
<COND (<FSET? .O ,THE>
<COND (.CAP? <PRINTI "The ">)
(ELSE <PRINTI "the ">)>)
(<NOT <FSET? .O ,NOABIT>>
<COND (<FSET? .O ,AN>
<COND (.CAP? <PRINTI "An ">)
(ELSE <PRINTI "an ">)>)
(.CAP? <PRINTI "A ">)
(ELSE <PRINTI "a ">)>)>
<IPRINT .O>>
<ROUTINE DPRINT-PRSO ()
<DPRINT ,PRSO>>
<ROUTINE DPRINT-PRSI ()
<DPRINT ,PRSI>>
;<ROUTINE CDPRINT-PRSO ()
<DPRINT ,PRSO T>>
;<ROUTINE CDPRINT-PRSI ()
<DPRINT ,PRSI T>>
;<ROUTINE CDPRINT (O)
<DPRINT .O T>>
<ROUTINE DPRINT (O "OPTIONAL" (CAP? <>) (THE? <>) "AUX" S)
<COND (<EQUAL? .O ,PLAYER ,ME>
<COND (.CAP? <TELL "You">)
(ELSE <TELL "you">)>)
(<AND <EQUAL? .O ,RUTTER> .CAP?>
<TELL "Your rutter">)
(ELSE
<COND (<AND <SET S <GET-OWNER .O>>
<NOT <EQUAL? .S <GETP .O ,P?OWNER>>>>
<COND (<EQUAL? .S ,PLAYER>
<COND (.CAP? <TELL "Your ">)
(T <TELL "your ">)>)
(ELSE
<DPRINT .S .CAP? ;.THE?>
<TELL "'s ">)>)
(<OR .THE? <FSET? .O ,THE>>
<COND (.CAP? <PRINTI "The ">)
(T <PRINTI "the ">)>)>
<IPRINT .O>)>>
<ROUTINE IPRINT (O "AUX" TMP)
<COND ;(<AND <EQUAL? .O ,PSEUDO-OBJECT>
<NOT ,P-MERGED>
<EQUAL? .O ,PRSO ,PRSI>>
<THING-PRINT ,PSEUDO-PRSO ;"<EQUAL? .O ,PRSO>">)
(<SET TMP <GETP .O ,P?SDESC>>
<PRINT .TMP>)
(ELSE
<PRINTD .O>)>>
<COND (<GASSIGNED? ZILCH>
<DEFINE PE (F I)
<COND (<TYPE? .I LIST>
<FORM .F !.I>)
(ELSE
<FORM .F .I>)>>
<DEFMAC P? ('V "OPT" ('O '*) ('I '*) ('W '*) "AUX" (L ()))
<COND (<N==? .I '*>
<SET L (<PE PRSI? .I> !.L)>)>
<COND (<N==? .O '*>
<COND (<OR <==? .V 'WALK>
<==? .V ',V?WALK>>
<SET L (<PE DIR? .O> !.L)>)
(ELSE
<SET L (<PE PRSO? .O> !.L)>)>)>
<COND (<N==? .V '*>
<SET L (<PE VERB? .V> !.L)>)>
<COND (<N==? .W '*>
<SET L (<PE WINNER? .W> !.L)>)>
<COND (<EMPTY? <REST .L>>
<1 .L>)
(ELSE <FORM AND !.L>)>>
<DEFMAC NOT-SOLVED? ('OBJ)
<FORM FSET? .OBJ ',SCOREBIT>>
<DEFMAC SOLVED? ('OBJ)
<FORM NOT <FORM FSET? .OBJ ',SCOREBIT>>>
<DEFMAC VERB? ("ARGS" ATMS)
<MULTIFROB ',PRSA .ATMS>>
<DEFMAC SCENE? ("ARGS" ATMS)
<MULTIFROB ',SCENE .ATMS>>
<DEFMAC CONTEXT? ("ARGS" ATMS)
<MULTIFROB '.RARG .ATMS>>
<DEFMAC ADJ? ("ARGS" ATMS)
<MULTIFROB '<PARSE-ADJ ,PARSE-RESULT> .ATMS>>
<SETG RARG? ,CONTEXT?>
<DEFMAC WINNER? ("ARGS" ATMS)
<MULTIFROB ',WINNER .ATMS>>
<DEFMAC PRSO? ("ARGS" ATMS)
<MULTIFROB ',PRSO .ATMS>>
<DEFMAC DIR? ("ARGS" ATMS)
<MULTIFROB ',P-WALK-DIR .ATMS>>
<DEFMAC PRSI? ("ARGS" ATMS)
<MULTIFROB ',PRSI .ATMS>>
<DEFMAC HERE? ("ARGS" ATMS)
<MULTIFROB ',HERE .ATMS>>
<SETG ROOM? ,HERE?>
<DEFINE MULTIFROB (X ATMS "AUX" (OO (OR)) (O .OO) (L ()) ATM SP)
<REPEAT ()
<COND (<EMPTY? .ATMS>
<RETURN!- <COND (<LENGTH? .OO 1> <ERROR .X>)
(<LENGTH? .OO 2> <NTH .OO 2>)
(ELSE <CHTYPE .OO FORM>)>>)>
<REST
<PUTREST
.O
<SET O
(<REPEAT
((LL <FORM EQUAL? .X>)
(L <REST .LL>))
<COND (<OR <EMPTY? .ATMS>
<==? <LENGTH <REST .LL 2>> 3>>
<RETURN!- .LL>)>
<SET ATM <NTH .ATMS 1>>
<PUTREST
.L
<SET L
(<COND
(<TYPE? .ATM ATOM>
<SET SP <SPNAME .ATM>>
<MAKE-GVAL
<COND (<==? .X ',PRSA>
<PARSE <STRING "V?" .SP>>)
(<==? .X ',P-WALK-DIR>
<COND (<AND <G? <LENGTH .SP> 2>
<==? <1 .SP> !\P>
<==? <2 .SP> !\?>>
.ATM)
(ELSE
<PARSE
<STRING "P?" .SP>>)>)
(<==? .X '.RARG>
<COND (<AND <G? <LENGTH .SP> 2>
<==? <1 .SP> !\M>
<==? <2 .SP> !\->>
.ATM)
(ELSE
<PARSE
<STRING "M-" .SP>>)>)
(ELSE .ATM)>>)
(ELSE .ATM)>)>>
<SET ATMS <REST .ATMS>>>)>>>>>)
(ELSE
<DEFINE P? (V "OPT" (O '*) (I '*) (W '*) "AUX" (L <>))
<AND <OR <==? .W '*> <WINNER? .W>>
<OR <==? .V '*> <VERB? .V>>
<OR <==? .O '*> <PRSO? .O>>
<OR <==? .I '*> <PRSI? .I>>>>
<DEFINE VERB? ("TUPLE" ATMS)
<MAPF <>
<FUNCTION (A "AUX" ATM)
<COND (<TYPE? .A ATOM>
<COND (<SET ATM
<LOOKUP <STRING "V?" <SPNAME .A>>
<MOBLIST INITIAL>>>
<COND (<EQUAL? ,PRSA ,.ATM>
<MAPLEAVE T>)>)
(ELSE
<ERROR NOT-A-VERB? .A>)>)
(<EQUAL? ,PRSA .A>
<MAPLEAVE T>)>>
.ATMS>>
<DEFINE CONTEXT? ("TUPLE" ATMS)
<MAPF <>
<FUNCTION (A "AUX" ATM)
<COND (<TYPE? .A ATOM>
<COND (<AND <G? <LENGTH <SET ATM <SPNAME .A>>> 2>
<==? <1 .ATM> !\M>
<==? <2 .ATM> !\->>
<COND (<EQUAL? .RARG ,.ATM>
<MAPLEAVE T>)>)
(<SET ATM
<LOOKUP <STRING "M-" <SPNAME .A>>
<MOBLIST INITIAL>>>
<COND (<EQUAL? .RARG ,.ATM>
<MAPLEAVE T>)>)
(ELSE
<ERROR NOT-A-CONTEXT? .A>)>)
(<EQUAL? .RARG .A>
<MAPLEAVE T>)>>
.ATMS>>
<SETG RARG? ,CONTEXT?>
<DEFINE WINNER? ("TUPLE" ATMS)
<MULTIFROB ,WINNER .ATMS>>
<DEFINE PRSO? ("TUPLE" ATMS)
<MULTIFROB ,PRSO .ATMS>>
<DEFINE PRSI? ("TUPLE" ATMS)
<MULTIFROB ,PRSI .ATMS>>
<DEFINE HERE? ("TUPLE" ATMS)
<MULTIFROB HERE .ATMS>>
<SETG ROOM? ,HERE?>
<DEFINE MULTIFROB (X ATMS)
<MAPF <>
<FUNCTION (A)
<COND (<TYPE? .A ATOM> <SET A ,.A>)>
<COND (<EQUAL? .X .A>
<MAPLEAVE T>)>>
.ATMS>>)>
<COND (<GASSIGNED? ZILCH>
<DEFMAC BSET ('OBJ "ARGS" BITS)
<MULTIBITS FSET .OBJ .BITS>>
<DEFMAC BCLEAR ('OBJ "ARGS" BITS)
<MULTIBITS FCLEAR .OBJ .BITS>>
<DEFMAC BSET? ('OBJ "ARGS" BITS)
<MULTIBITS FSET? .OBJ .BITS>>
<DEFINE MULTIBITS (X OBJ ATMS
"AUX" (OT <COND (<==? .X FSET?> <FORM OR>)
(ELSE <FORM PROG ()>)>)
(OO <COND (<LENGTH? .OT 1> .OT)
(ELSE <REST .OT>)>)
(O .OO)
ATM)
<REPEAT ()
<COND (<EMPTY? .ATMS>
<RETURN!- .OT>)>
<SET ATM <NTH .ATMS 1>>
<SET ATMS <REST .ATMS>>
<PUTREST .O
<SET O
(<FORM .X
.OBJ
<COND (<TYPE? .ATM FORM> .ATM)
(ELSE <MAKE-GVAL .ATM>)>>)>>>>)
(ELSE
<DEFINE BSET (OBJ "TUPLE" BITS)
<MULTIBITS ,FSET .OBJ .BITS>>
<DEFINE BCLEAR (OBJ "TUPLE" BITS)
<MULTIBITS ,FCLEAR .OBJ .BITS>>
<DEFINE BSET? (OBJ "TUPLE" BITS)
<MAPF <>
<FUNCTION (A)
<COND (<FSET? .OBJ ,.A> <MAPLEAVE T>)>>
.BITS>>
<DEFINE MULTIBITS (X OBJ ATMS)
<MAPF <>
<FUNCTION (A)
<APPLY!- .X .OBJ ,.A>>
.ATMS>>)>
<DEFMAC RFATAL ()
'<RETURN ,M-FATAL>>
<COND (<GASSIGNED? ZILCH>
<DEFMAC PROB ('BASE?)
<FORM NOT <FORM L? .BASE? '<RANDOM 100>>>>)
(ELSE
<DEFINE PROB (BASE?)
<NOT <L? .BASE? <RANDOM 100>>>>)>
<ROUTINE PICK-ONE (FROB
"AUX" (L <GET .FROB 0>) (CNT <GET .FROB 1>) RND MSG RFROB)
<SET L <- .L 1>>
<SET FROB <REST .FROB 2>>
<SET RFROB <REST .FROB <* .CNT 2>>>
<SET RND <RANDOM <- .L .CNT>>>
<SET MSG <GET .RFROB .RND>>
<PUT .RFROB .RND <GET .RFROB 1>>
<PUT .RFROB 1 .MSG>
<SET CNT <+ .CNT 1>>
<COND (<==? .CNT .L> <SET CNT 0>)>
<PUT .FROB 0 .CNT>
.MSG>
;<ROUTINE RANDOM-ELEMENT (FROB)
<GET .FROB <RANDOM <GET .FROB 0>>>>
<DEFMAC APPLE? ()
'<EQUAL? ,MACHINE ,APPLE-2E ,APPLE-2C ,APPLE-2GS>>
;"former MAIN.ZIL stuff"
<GLOBAL P-WON <>>
<GLOBAL SCENE 0>
<ROUTINE SCENE-SELECT ("OPT" (FULL? <>) "AUX" TMP M WID WHICH L Y END)
<SET L <+ <GET ,PART-MENU ;.MEN 0> 1>>
<SET END <+ 1 <WINGET ,S-FULL ,WHIGH>>>
<COND (<APPLE?> <SET L <+ .L 2>>)>
<SET TMP <* .L ,FONT-Y>>
<SET Y <- .END .TMP>>
<COND (<APPLE?> <SET Y <- .Y <* 2 ,FONT-Y>>>)>
<WINDEF ,S-TEXT
.Y <WINGET ,S-TEXT ,WLEFT>
.TMP <WINGET ,S-TEXT ,WWIDE>>
<RESET-MARGIN>
<REPEAT ()
<CLEAR ,S-TEXT>
<SCREEN ,S-TEXT>
<SET WHICH
<GET-FROM-MENU "You may choose to: "
,PART-MENU
,SCENE-SELECT-F
1>>
<COND (.WHICH <RTRUE>)>>>
<ROUTINE SCENE-SELECT-F (TMP M)
<COND (<EQUAL? .TMP 1>
<SETUP-TEXT-AND-STATUS>
;<SPLIT <* ,FONT-Y ,STATUS-LINES>>
<SETG SCENE <GET ,SCENES 1>>)
(<EQUAL? .TMP 2>
<CLEAR ,S-TEXT>
<V-RESTORE>
<RESET-MARGIN>
<CLEAR ,S-TEXT>
<RFALSE>)
(<EQUAL? .TMP 3>
<CLEAR ,S-TEXT>
<V-QUIT T <>>
<RESET-MARGIN>
<CLEAR ,S-TEXT>
<RFALSE>)>>
"SCENES AND PARTS"
<CONSTANT PART-MENU
<LTABLE <TABLE (PURE STRING LENGTH) "START the game ">
<TABLE (PURE STRING LENGTH) "RESTORE a saved game ">
<TABLE (PURE STRING LENGTH) "QUIT the game ">>>
<CONSTANT SCENE-NAMES
<PLTABLE "Erasmus"
"Anjiro"
"Yabu"
"Pit" ;"omi & yabu"
"Rodrigues" ;"crew out of pit"
"Voyage to Osaka" ;"rod's advice"
"Toranaga" ;"ishido vs. t."
"Prison" ;"how to help"
"Mariko" ;"alvito & ferriera"
"Escape" ;"hatamoto"
"Earthquake" ;"zataki"
"Journey to Yedo" ;"delay, etc."
"Ochiba"
"Departure" ;"council"
"Seppuku"
"Ninja" ;"etsu's death"
"Yokohama"
"Aftermath"
"Epilogue">>
<DEFMAC SCENE-CONSTANTS ("TUPLE" SS "AUX" (CNT 0))
<MAPF ,PLTABLE
<FUNCTION (S)
<EVAL <FORM CONSTANT .S <SET CNT <+ .CNT 1>>>>>
.SS>>
<CONSTANT SCENES
<SCENE-CONSTANTS S-ERASMUS
S-ANJIRO
S-YABU
S-PIT
S-RODRIGUES
S-VOYAGE
S-TORANAGA
S-PRISON
S-MARIKO
S-ESCAPE
S-QUAKE
S-JOURNEY
S-OCHIBA
S-DEPARTURE
S-SEPPUKU
S-NINJA
S-YOKOHAMA
S-AFTERMATH
S-EPILOGUE>>
<CONSTANT SCENE-LOCS
<PLTABLE BRIDGE-OF-ERASMUS ;"S-ERASMUS"
MURA-HOUSE ;"S-ANJIRO"
VILLAGE-SQUARE ;"S-YABU"
PIT ;"S-PIT"
ANJIRO-WATERFRONT ;"S-RODRIGUES"
GALLEY ;"S-VOYAGE"
OUTER-CORRIDOR ;"S-TORANAGA"
PRISON ;"S-PRISON"
MAPLE-GLADE ;"S-MARIKO"
COURTYARD ;"S-ESCAPE"
PLATEAU ;"S-QUAKE"
YOKOSE-BATH-HOUSE ;"S-JOURNEY"
OCHIBA-ROOM ;"S-OCHIBA"
FORECOURT ;"S-DEPARTURE"
FORMAL-GARDEN ;"S-SEPPUKU"
PRIVATE-QUARTERS ;"S-NINJA"
YOKOHAMA ;"S-YOKOHAMA"
STABLE ;"S-AFTERMATH"
SEKIGAHARA ;"S-EPILOGUE">>
<CONSTANT SCENE-PICS
<TABLE (PURE BYTE LENGTH)
P-STORM ;"S-ERASMUS"
P-GARDEN ;"S-ANJIRO"
P-YABU-SEG ;"S-YABU"
P-PIT ;"S-PIT"
P-RODRIGUES-SEG ;"S-RODRIGUES"
P-CONFUSION ;"S-VOYAGE"
P-OSAKA ;"S-TORANAGA"
P-PRISON-SEG ;"S-PRISON"
P-MARIKO-SEG ;"S-MARIKO"
P-PROCESSION ;"S-ESCAPE"
P-QUAKE ;"S-QUAKE"
P-BATH ;"S-JOURNEY"
P-OCHIBA-SEG ;"S-OCHIBA"
P-DEPARTURE-SEG ;"S-DEPARTURE"
P-SEPPUKU ;"S-SEPPUKU"
P-NINJA ;"S-NINJA"
P-VINCK ;"S-YOKOHAMA"
P-AFTERMATH-SEG ;"S-AFTERMATH"
P-CREST ;"S-EPILOGUE">>
<GLOBAL MACHINE <>>
<GLOBAL WIDTH 0>
<END-SEGMENT ;"0">
<BEGIN-SEGMENT STARTUP>
<ROUTINE GO ()
<MOUSE-LIMIT -1>
<SETG MACHINE <LOWCORE INTID>>
<COND ;(<EQUAL? ,MACHINE ,AMIGA> ;"sigh, all Amiga colors are ugly"
<SETG FG-COLOR ,C-BLACK>
<SETG BG-COLOR 10 ;"light gray">
<COLOR ,FG-COLOR ,BG-COLOR>)
(ELSE
<SETG FG-COLOR <LOWCORE (CLRWRD 1)>>
<SETG BG-COLOR <LOWCORE (CLRWRD 0)>>)>
<COND (<APPLE?>
<SETG TEXT-MARGIN 0>
<COND (<PICINF ,P-BORDER ,YX-TBL>
<SETG BORDER-HEIGHT <GET ,YX-TBL 0>>)>)
(ELSE <SETG TEXT-MARGIN 2>)>
<SETG LIT T>
<SETG CLOCK-HAND <REST ,C-TABLE ,C-TABLELEN>>
<SETG PLAYER ,BLACKTHORNE>
<SETUP-FULL>
<TITLE-SCREEN>
<COND (,DEMO-VERSION?
<SLIDE-SHOW>
<AGAIN>)>
<SETUP-DISPLAY>
<SCENE-SELECT>
<GOTO-SCENE ,SCENE <>>
<MAIN-LOOP>>
<ROUTINE SLIDE-SHOW ()
<CLEAR -1>
<TELL
"This is a demonstration version of SHOGUN.|
|
First you will see a few samples of the graphic screens that await you
in SHOGUN.We've used graphics in surprising new ways to enhance the
story without detracting from Infocom's traditional richness and depth.|
Then you will be able to interact with a small section of
SHOGUN.Feel free to try the new friendlier parser, the optional mouse
interface, and the on-screen hints.|
SHOGUN is an adaptation of James Clavell's novel,
which has sold over 7 million copies and inspired the popular T.V.
mini-series.Dave Lebling, while collaborating with Clavell, has
incorporated the creative style and rich prose that have made his
earlier ZORK titles so popular.|
In SHOGUN you are transcended into the world of Clavell's saga, which
combines all of the mystery and action of a great adventure story with
the intensity and romance of a classic love story.Whether you find
yourself matching wits with tyrannical Japanese aristocrats or fighting
off attacks by Ninja assassins, you are sure to be both challenged and
entertained.Both the action and the intriguing, historical locale set
the stage for unparalleled fun and excitement.|
">
<TYPE-ANY-KEY>
<END-DEMO>>
<ROUTINE END-DEMO ()
<CLEAR -1>
<TELL "|
You have reached the end of this demonstration version of|">
<V-VERSION>
<TELL "||">
<TYPE-ANY-KEY>
<SCREEN ,S-TEXT>
;<DEFAULT-COLORS> ;"return to default before screen clears"
<RESTART>
<TELL ,FAILED>
<AGAIN>>
<END-SEGMENT ;"STARTUP">
<BEGIN-SEGMENT 0>
<CONSTANT S-FULL 7>
<ROUTINE SETUP-FULL ("AUX" (HIGH <LOWCORE VWRD>) (WIDE <LOWCORE HWRD>) X)
<WINDEF ,S-FULL 1 1 .HIGH .WIDE>
<SET X <WINGET ,S-TEXT ,WFSIZE>>
<SETG FONT-Y <HIGH-BYTE .X>>
<SETG FONT-X <LOW-BYTE .X>>>
<ROUTINE SETUP-DISPLAY ("AUX" (HIGH <LOWCORE VWRD>) (WIDE <LOWCORE HWRD>))
<MOUSE-LIMIT -1>
<SETUP-FULL>
<SETUP-TEXT-AND-STATUS>
<SET WIDE <WINGET ,S-TEXT ,WWIDE>>
<MARGIN ,TEXT-MARGIN ,TEXT-MARGIN ,S-TEXT>
<SET WIDE <- .WIDE <* 2 ,TEXT-MARGIN>>>
<SETG WIDTH <GETB ,P-INBUF 0>>
<SET WIDE </ .WIDE ,FONT-X>>
<COND (<L? .WIDE ,WIDTH>
<SETG WIDTH .WIDE>
<PUTB ,P-INBUF 0
<COND (<G? .WIDE ,INBUF-LENGTH>
,INBUF-LENGTH)
(T
.WIDE)>>)>>
<ROUTINE REPAINT-DISPLAY ("OPT" (NO-BORDER? <>))
<RESET-MARGIN>
<NORMAL-COLOR>
<SETUP-DISPLAY>
<COND (<OR <APPLE?> <NOT .NO-BORDER?>>
<DISPLAY-BORDER>)>
<INIT-STATUS-LINE T>
<COND (<HERE? ,MAZE>
<DISPLAY-MAZE>)>>
<ROUTINE GOTO-SCENE (SC "OPT" (OSC ,SCENE))
<CLEAR ,S-TEXT>
<COND (<AND <APPLE?> <NOT .OSC>>
<SCREEN ,S-STATUS>
<CLEAR ,S-STATUS>
<DISPLAY-BORDER ,P-EBORDER>)
(<NOT <EQUAL? ,CURRENT-BORDER ,P-BORDER>>
<DISPLAY-BORDER ,P-BORDER>)>
<END-QUOTE>
<RESET-MARGIN>
<DEQUEUE-ALL>
<SETG ORPHAN-ANSWER <>>
<SETG SCENE .SC>
<SETG HERE <GET ,SCENE-LOCS ,SCENE>>
<TOUCH-SEG <GETB ,SCENE-PICS ,SCENE>>
<FCLEAR ,HERE ,TOUCHBIT>
<SETG QCONTEXT <>>
<MOVE-ALL ,BLACKTHORNE>
<MOVE ,BLACKTHORNE ,HERE>
<FCLEAR ,BLACKTHORNE ,RMUNGBIT>
<SETG P-IT-OBJECT <>>
<SETG P-HIM-OBJECT <>>
<SETG P-HER-OBJECT <>>
<SETG P-THEM-OBJECT <>>
<B-STAND>
<SETG OPPONENT <>>
<APPLY <GETP ,HERE ,P?ACTION> ,M-SCENE-SETUP>
<SETG WINNER ,PLAYER>
<CLEAR ,S-TEXT>
<COND (<ZERO? .OSC>
<CLEAR ,S-STATUS>
<INIT-STATUS-LINE>)
(ELSE <UPDATE-STATUS-LINE T>)>
<GOTO ,HERE>
<COND (<ZERO? .OSC>
<CLOCKER> ;"simulate a previous move..."
<SETG MOVES 0>)>
<RTRUE>>
<ROUTINE TOUCH-SEG (S)
<COND (<OR <APPLE?> <EQUAL? ,MACHINE ,IBM>>
<PICINF .S ,YX-TBL>)>>
;<GLOBAL WAS-IT? <>>
;<GLOBAL WAS-THEM? <>>
;<GLOBAL WAS-HIM? <>>
;<GLOBAL WAS-HER? <>>
;<GLOBAL PERFORM-DEPTH 0> ;"number recursive calls to perform"
;<CONSTANT P-MATCHLEN 0>
;<ROUTINE OBJECT-SUBSTITUTE (OBJ VAR "AUX" (TMP <>) (CNT 0) ICNT OCNT)
<COND (<AND .VAR <ACCESSIBLE? .VAR>>
<SET ICNT <GET ,P-PRSI ,P-MATCHLEN>>
<SET OCNT <GET ,P-PRSO ,P-MATCHLEN>>
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> .ICNT>
<RETURN>)
(T
<COND (<EQUAL? <GET ,P-PRSI .CNT> .OBJ>
<PUT ,P-PRSI .CNT .VAR>
<SET TMP T>
<RETURN>)>)>>
<SET CNT 0>
<REPEAT ()
<COND (<G? <SET CNT <+ .CNT 1>> .OCNT>
<RETURN>)
(T
<COND (<EQUAL? <GET ,P-PRSO .CNT> .OBJ>
<PUT ,P-PRSO .CNT .VAR>
<SET TMP T>
<RETURN>)>)>>
.TMP)>>
;<GLOBAL PSEUDO-PRSO <>> ;"T IF ORIGINAL PRSO WAS PSEUDO-OBJECT"
<ROUTINE GAME-VERB? ()
<COND (<AND <VERB? TELL> ,P-CONT> <RTRUE>)
(<AND <VERB? HELP>
<NOT ,PRSO>>
<RTRUE>)
(<VERB? QUIT VERSION BRIEF SUPER-BRIEF VERBOSE COLOR
$VERIFY RESTART SAVE RESTORE SCRIPT UNSCRIPT UNDO
SCORE TIME DEFINE $REFRESH NOTIFY HINT HINTS-OFF
CREDITS>
<RTRUE>)
(<VERB? $RANDOM $COMMAND $RECORD $UNRECORD
;$SCENE ;$SHOW ;$W ;$P ;$D ;$I ;$G ;$X ;$M>
<RTRUE>)>>
"MULTIPLE-EXCEPTION? -- return true if an object found by all should not
be included when the crunch comes."
;<ROUTINE MULTIPLE-EXCEPTION? (OBJ1 "AUX" (L <LOC .OBJ1>))
<COND (<EQUAL? .OBJ1 ,NOT-HERE-OBJECT>
<SETG P-NOT-HERE <+ ,P-NOT-HERE 1>>
<RTRUE>)
(<AND <VERB? TAKE>
,PRSI
<NOT <IN? ,PRSO ,PRSI>>>
;"TAKE X FROM Y and x not in y"
<RTRUE>)
(<NOT <ACCESSIBLE? .OBJ1>>
;"can't get at object"
<RTRUE>)
(<EQUAL? ,P-GETFLAGS ,P-ALL>
;"cases for ALL"
<COND (<AND ,PRSI
<PRSO? ,PRSI>>
;"VERB ALL and prso = prsi"
<RTRUE>)
(<AND <VERB? TAKE> <NOT ,PRSI>>
<COND (<OR <AND <NOT <EQUAL? .L ,WINNER ,HERE ,PRSI>>
<NOT <EQUAL? .L <LOC ,WINNER>>>
<NOT <FSET? .L ,SURFACEBIT>>
<NOT <FSET? .L ,SEARCHBIT>>>
<AND <NOT <FSET? .OBJ1 ,TAKEBIT>>
<NOT <FSET? .OBJ1 ,TRYTAKEBIT>>>>
;"TAKE ALL and object not accessible or takeable"
<RTRUE>)
(<OR <FSET? .L ,PERSON>
<FSET? <LOC .L> ,PERSON>>
;"TAKE ALL held by a person (use TAKE ALL FROM)"
<RTRUE>)
(<HELD? ,PRSO>
;"TAKE ALL and one object has others in it"
<RTRUE>)>)
(<VERB? DROP GIVE>
<COND (<NOT <IN? .OBJ1 ,WINNER>>
;"GIVE/DROP ALL and object not held"
<RTRUE>)
(<FSET? .OBJ1 ,WEARBIT>
;"GIVE/DROP ALL and object worn"
<RTRUE>)>)
(<AND <VERB? PUT>
<NOT <IN? ,PRSO ,WINNER>>
<HELD? ,PRSO ,PRSI>>
;"PUT ALL IN X and object already in x"
<RTRUE>)>)>>
;<ROUTINE SAVE-INPUT (TBL "AUX" (OFFS 0) CNT TMP)
<SET CNT <+ <GETB ,P-LEXV <SET TMP <* 4 ,P-INPUT-WORDS>>>
<GETB ,P-LEXV <+ .TMP 1>>>>
<COND (<EQUAL? .CNT 0> ;"failed"
<RFALSE>)>
<SET CNT <- .CNT 1>>
<REPEAT ()
<COND (<EQUAL? .OFFS .CNT>
<PUTB .TBL .OFFS 0>
<RETURN>)
(T
<PUTB .TBL .OFFS <GETB ,P-INBUF <+ .OFFS 1>>>)>
<SET OFFS <+ .OFFS 1>>>
<RTRUE>>
;<ROUTINE RESTORE-INPUT (TBL "AUX" CHR)
<REPEAT ()
<COND (<EQUAL? <SET CHR <GETB .TBL 0>> 0>
<RETURN>)
(T
<PRINTC .CHR>
<SET TBL <REST .TBL>>)>>>
<GLOBAL P-MULT <>>
<GLOBAL P-NOT-HERE 0>
;<GLOBAL WHAT-DO-YOU-WANT-TO "What do you want to ">
;<ROUTINE FAKE-ORPHAN ("AUX" TMP)
<ORPHAN ,P-SYNTAX <>>
<TELL ,WHAT-DO-YOU-WANT-TO>
<SET TMP <GET ,P-OTBL ,P-VERBN>>
<COND (<EQUAL? .TMP 0>
<TELL "tell">)
(<ZERO? <GETB ,P-VTBL 2>>
<PRINTB <GET .TMP 0>>)
(T
<WORD-PRINT <GETB .TMP 2> <GETB .TMP 3>>
<PUTB ,P-VTBL 2 0>)>
<SETG P-OFLAG T>
<SETG P-WON <>>
<PREP-PRINT
<GETB ,P-SYNTAX ,P-SPREP1>>
<TELL "?" CR>>
<ROUTINE END-QUOTE ()
<SETG P-CONT <>>
<RFATAL>>
;"former CLOCK.ZIL stuff"
<GLOBAL CLOCK-WAIT <>>
<GLOBAL C-TABLE <ITABLE 13 <> <>>>
<CONSTANT C-INTLEN 4> ;"length of an interrupt entry in bytes"
<CONSTANT C-RTN 0> ;"word offset of routine name"
<CONSTANT C-TICK 1> ;"word offset of count"
<CONSTANT C-TABLELEN 52> ;"length of interrupt table in bytes"
<GLOBAL C-INTS 52> ;"start of queued interrupts in bytes"
<ROUTINE DEQUEUE (RTN "AUX" TIM)
<COND (<SET RTN <QUEUED? .RTN>>
<SET TIM <GET .RTN ,C-TICK>>
<PUT .RTN ,C-RTN 0>
.TIM)>>
<ROUTINE QUEUED? (RTN "AUX" C E)
<SET E <REST ,C-TABLE ,C-TABLELEN>>
<SET C <REST ,C-TABLE ,C-INTS>>
<REPEAT ()
<COND (<EQUAL? .C .E> <RFALSE>)
(<EQUAL? <GET .C ,C-RTN> .RTN>
<COND (<ZERO? <GET .C ,C-TICK>>
<RFALSE>)
(T <RETURN .C>)>)>
<SET C <REST .C ,C-INTLEN>>>>
"this version of QUEUE automatically enables as well"
"QUEUE routine when fresh?:t means only queue if not currently queued"
<ROUTINE QUEUE (RTN TICK "OPT" (I? <>) "AUX" C E (INT <>))
<SET E <REST ,C-TABLE ,C-TABLELEN>>
<SET C <REST ,C-TABLE ,C-INTS>>
<REPEAT ()
<COND (<EQUAL? .C .E>
<COND (.INT
<SET C .INT>)
(ELSE
<SETG C-INTS <- ,C-INTS ,C-INTLEN>>
<SET INT <REST ,C-TABLE ,C-INTS>>)>
<PUT .INT ,C-RTN .RTN>
<RETURN>)
(<EQUAL? <GET .C ,C-RTN> .RTN>
<COND (.I? <RFALSE>)
(ELSE
<SET INT .C>
<RETURN>)>)
(<ZERO? <GET .C ,C-RTN>>
<SET INT .C>)>
<SET C <REST .C ,C-INTLEN>>>
<COND (%<COND (<GASSIGNED? ZILCH>
'<G? .INT ,CLOCK-HAND>)
(ELSE
'<L=? <LENGTH .INT> <LENGTH ,CLOCK-HAND>>)>
<SET TICK <- <+ .TICK 3>>>)>
<PUT .INT ,C-TICK .TICK>
.INT>
<GLOBAL STATIONARY? <>> ;"winner not walking around?"
<GLOBAL STATIONARY-CNT <>> ;"and for how long"
<GLOBAL CLOCK-HAND <>>
<ROUTINE CLOCKER ("AUX" E TICK RTN (FLG <>) (Q? <>) OWINNER TMP)
<COND (,CLOCK-WAIT <SETG CLOCK-WAIT <>> <RFALSE>)>
<COND (<EQUAL? ,HERE ,STATIONARY?>
<SETG STATIONARY-CNT <+ ,STATIONARY-CNT 1>>)
(ELSE
<SETG STATIONARY? ,HERE>
<SETG STATIONARY-CNT 0>)>
<SETG CLOCK-HAND <REST ,C-TABLE ,C-INTS>>
<SET E <REST ,C-TABLE ,C-TABLELEN>>
<SET OWINNER ,WINNER>
<SETG WINNER ,PLAYER>
<REPEAT ()
<COND (,NEW-SCENE-NUMBER
<I-NEW-SCENE>
<SETG CLOCK-HAND <REST ,C-TABLE ,C-INTS>>
<SET FLG T>)>
<COND (<EQUAL? ,CLOCK-HAND .E>
<SETG MOVES <+ ,MOVES 1>>
<SETG WINNER .OWINNER>
<RETURN .FLG>)
(<NOT <ZERO? <GET ,CLOCK-HAND ,C-RTN>>>
<SET TICK <GET ,CLOCK-HAND ,C-TICK>>
<COND (<L? .TICK -1>
<PUT ,CLOCK-HAND ,C-TICK <- <- .TICK> 3>>
<SET Q? ,CLOCK-HAND>)
(<NOT <ZERO? .TICK>>
<COND (<G? .TICK 0>
<SET TICK <- .TICK 1>>
<PUT ,CLOCK-HAND ,C-TICK .TICK>)>
<COND (<NOT <ZERO? .TICK>>
<SET Q? ,CLOCK-HAND>)>
<COND (<NOT <G? .TICK 0>>
<SET RTN
%<COND (<GASSIGNED? ZILCH>
'<GET ,CLOCK-HAND ,C-RTN>)
(ELSE
'<NTH ,CLOCK-HAND
<+ <* ,C-RTN 2>
1>>)>>
<COND (<ZERO? .TICK>
<PUT ,CLOCK-HAND ,C-RTN 0>)>
<COND (<SET TMP <APPLY .RTN>>
<SET FLG .TMP>)>
<COND (<AND <NOT .Q?>
<NOT
<ZERO?
<GET ,CLOCK-HAND
,C-RTN>>>>
<SET Q? T>)>)>)>)>
<COND (,NEW-SCENE-NUMBER ;"new scene during int?"
<SETG CLOCK-HAND <REST ,C-TABLE ,C-INTS>>)
(<EQUAL? .FLG ,M-FATAL>
<SETG CLOCK-HAND .E>)
(<NOT <EQUAL? ,CLOCK-HAND .E>>
<SETG CLOCK-HAND <REST ,CLOCK-HAND ,C-INTLEN>>
<COND (<NOT .Q?>
<SETG C-INTS <+ ,C-INTS ,C-INTLEN>>)>)>>>
<ROUTINE DEQUEUE-ALL ("AUX" E TICK RTN (FLG <>) (Q? <>))
<COND (,CLOCK-WAIT <SETG CLOCK-WAIT <>> <RFALSE>)>
<SETG CLOCK-HAND <REST ,C-TABLE ,C-INTS>>
<SET E <REST ,C-TABLE ,C-TABLELEN>>
<REPEAT ()
<COND (<EQUAL? ,CLOCK-HAND .E>
<SETG CLOCK-HAND .E>
<RETURN>)
(ELSE
<PUT ,CLOCK-HAND ,C-TICK 0>
<PUT ,CLOCK-HAND ,C-RTN 0>)>
<SETG CLOCK-HAND <REST ,CLOCK-HAND ,C-INTLEN>>
<SETG C-INTS <+ ,C-INTS ,C-INTLEN>>>>
<DEFINE PSEUDO ("TUPLE" V)
<MAPF ,PLTABLE
<FUNCTION (OBJ)
<COND (<N==? <LENGTH .OBJ> 3>
<ERROR BAD-THING .OBJ>)>
<MAPRET <COND (<NTH .OBJ 1>
<VOC <SPNAME <NTH .OBJ 1>> ADJECTIVE>)>
<COND (<NTH .OBJ 2>
<VOC <SPNAME <NTH .OBJ 2>> NOUN>)>
;<3 .OBJ>>>
.V>>