-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHIMAERA.f
4559 lines (4559 loc) · 141 KB
/
CHIMAERA.f
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
C*********************************************************************
C*
C* CHIMAERA
C*
C* An adventure program using automatic text generation
C* and with consistent but unpredictable moves generated
C* by an integer function in subroutine LOCATE.
C*
C* *****************************************
C* * *
C* * Written by Nicholas Perre-Wetherall *
C* * Copyright 1984 *
C* * All rights reserved *
C* * *
C* *****************************************
C*
C* Version 1.101 - 16th January 1984.
C*
C* *** Revision History ***
C*
C* Version 1.102 15th Mar 1984 New form of WHERE verb added.
C* 12th Apr 1984 Minor bug in KILL fixed.
C* 16th Apr 1984 TIME command added.
C*
C* Version 1.103 11th Sep 1984 ADVENTURE, CHASE/FOLLOW and EXAMINE
C* commands added. HELP command improved.
C* TIME value incremented automatically
C* if user response is slow.
C*
C* Version 1.104 13th Nov 1984 PLUGH routine made more friendly.
C*
C* Version 1.105 5th Dec 1984 Minor bugs in HELP and SLEEP fixed.
C*
C* Version 1.106 7th Jul 1985 Further bug in HELP fixed.
C* Experimental version warning removed.
C* Expletive handling improved.
C* Further amendment to PLUGH routine.
C* CHIMAERA_NEWS file inserted.
C*
C* Version 1.107 22nd Jul 1985 Improved handing of elixir in EAT.
C* Scores in EAT rationlaised.
C*
C* Version 1.108 20th Aug 1985 Minor bug in troll text fixed.
C* Minor amendment to snake coding
C* Minor amendment to dwarf coding
C* Amendments to code and scoring
C* in vampire (label 8180).
C* Give player score and remove snake
C* permanently after charming it.
C* Score incremented for stamping
C* out dwarves.
C*
C* Version 1.109 21st Aug 1985 Thirst handling improved and messages
C* added.
C*
C* Version 1.110 21st May 1986 Code added to stop players continually
C* relighting a flickering lamp.
C*
C* Version 1.111 18th Jun 1986 Minor bug in STAMP DWARF fixed.
C* LOCATE routine tidied up.
C*
C* Version 1.112 30th Jun 1986 Monster status in restored game
C* written out to log file.
C*
C* Version 1.113 30th Sep 1986 Bug in PUT routine ($1135) fixed.
C*
C* *****************************************************************
C*
SUBROUTINE MAIN
IMPLICIT INTEGER*2 (A-Z)
C*
C*
#include "KEYS.INS.f"
#include "ERRD.INS.f"
#include "G_KEYS.INS.f"
#include "CHIMAERA.INS.f"
C*
INTEGER*2 LINE(66), ! Input buffer
+ TIMBUF(28), ! TIMDAT buffer
+ BUFFER(10), ! Temporary text buffer
+ LEN, ! LINE length
+ TOKNO, ! Tokens on line
+ LITACT(8), ! Literal form of action verb
+ LITOBJ(8) ! Literal form of object noun
C*
REAL*8 DICACT(H$ACT), ! Action verbs
+ PSEUDO(H$PSEU) ! Pseudo objects (Camp, etc.)
C*
INTEGER*2 OBJLOC(H$OBJ), ! Object locations
+ POINTS(H$OBJ), ! Object scores
+ THINGS(20,H$OBJ), ! Object descriptions
+ IPT(H$OBJ) ! Pointers for random access
C*
INTEGER*2 VERBS(10,7), ! Text verbs
+ NOUNS(10,18), ! Text nouns
+ ADJONE(10,16), ! First adjective
+ ADJTWO(10,12), ! Second adjective
+ ROUTES(5,8) ! Direction text
C*
INTEGER*2 MDAYS(12), ! Days in month
+ MONTHS(5,12), ! Names of months
+ WEEKDY(5,7) ! Names of days
C*
INTEGER*2 COWS(5,7), ! Herbivours
+ CATS(5,4), ! Carnivours
+ BEASTS(4,H$MON) ! Monsters
C*
INTEGER*2 XINC(10),YINC(10),ZINC(10), ! Move increments
+ WAYBIT(10) ! Move bit screens
C*
INTEGER*2 MOVENO, ! Move number
+ SCORE ! Current score excluding objects in tent
C*
INTEGER*2 VALUES(H$VAL) ! Integer values
INTEGER*2 MONSTR(H$MON) ! Monster values
LOGICAL FLAGS(H$FLAG) ! Logical flags
C*
INTEGER*4 DELAY ! Delay period for SLEEP$
C*
REAL*4 DISTX, ! Distance east from tent
+ DISTY ! Distance north from tent
C*
REAL*8 EXPLET(H$EXP) ! Expletives
REAL*8 NUMBER(5) ! Text numbers 1 - 5
C*
REAL*8 ACTION, ! 8 char word for actions from user
+ OBJECT, ! 8 char word for objects from user
+ THING, ! 8 char UC word from object array
+ BLANK, ! Spacefilled 8 char word
+ TMPOBJ, ! Temporary 8 char store for object
+ TMPACT ! Temporary 8 char store for action
C*
LOGICAL START
LOGICAL COMEQV,YES
LOGICAL WAYS(15) ! Move directions
LOGICAL HITYOU
C*
LOGICAL OBHERE(H$OBJ) ! Objects (not) here.
LOGICAL ALLDUN(H$OBJ) ! Objects in tent.
LOGICAL GONE(H$OBJ) ! Objects vanished for ever.
C*
PARAMETER ( NORTH=1,
+ SOUTH=2,
+ EAST=3,
+ WEST=4,
+ SE=5,
+ SW=6,
+ NE=7,
+ NW=8,
+ UP=9,
+ DOWN=10,
+ IN=11,
+ OUT=12
C*
C* Paramters for VALUES array
C*
+)
PARAMETER ( BASE=6, ! Basecamp location
+ FIRSTX=7, ! Base X co-ordinate
+ FIRSTY=8, ! Base Y co-ordinate
+ LASTX=9, ! Last X co-ordinate
+ LASTY=10, ! Last Y co-ordinate
+ LASTZ=11, ! Last Z co-ordinate
+ LUCK=12, ! Players luck quota
+ TIME=13, ! Time of day
+ DAYLEN=14, ! Length of day
+ DUSK=15, ! Dusk pointer
+ HELD=16, ! Number of things he holds
+ LIGHT=17, ! Amount of light left in lamp
+ POOL=18, ! Water pool
+ MAGONE=19, ! Times he has used first magic word
+ DWFNUM=20, ! Total number of dwarves
+ DWFNOW=21, ! Number of active dwarves
+ MONCNT=22, ! Number of active monsters
+ GORLOC=23, ! Location of gorgon
+ SEED=24, ! Seed for RND(N)
+ BRKBOT=25, ! Broken glass from bottle
+ BRKVAS=26, ! Broken glass from vase
+ BRKGOB=27, ! Broken glass from goblet
+ BRKMIR=28, ! Broken glass from mirror
+ THIRST=29, ! Thirst rating
+ FLICK=30 ! Flickering lamp count
C*
+)
PARAMETER ( BATS=1,
+ DWARF=2,
+ SNAKE=3,
+ GORGON=4,
+ ELF=5,
+ TROLL=6,
+ DRAGON=7,
+ VAMPIR=8
C*
+)
PARAMETER ( MASTER=1, ! Master player flag
+ NIGHT=2, ! Night flag
+ DARK=3, ! Dark here flag
+ GLOW=4, ! Underground glow flag
+ LAMPON=5, ! Lamp on flag
+ WAVER=6, ! Glow (if any) wavers
+ FR13=7, ! Friday 13th flag
+ HALLOW=8, ! Halloween flag
+ LIFE=9 ! Life (or death) flag
C*
+)
PARAMETER ( BOXLOK=10, ! Box locked flag
+ DORLOK=11 ! Door locked flag
C*
+)
PARAMETER ( ROLING=12, ! Rolling grass desc. flag
+ HIGRAS=13, ! High grass flag
+ ANIMAL=14, ! Animals in sight flag
+ HERD=15, ! Herd of animals flag
+ CARNIV=16, ! Carnivores flag
+ SEEN=17 ! Seen by carnivores flag
C*
+)
PARAMETER ( DDOT=18, ! Full Stop flag
+ TREE=19, ! Tree in sight flag
+ NOTUP=20, ! Not up tree flag
+ HOLE=21, ! Hole in sight flag (Not used)
+ HOME=22, ! At base camp flag
+ INTENT=23 ! In the tent flag
C*
+)
PARAMETER ( SMALL=24, ! Small location flag
+ LARGE=25, ! Large location flag
+ SWITCH=26, ! Flip flop flag
+ LEAD=27 ! Lead(s/ing) flag
C*
+)
PARAMETER ( UNDEAD=28, ! Player undead flag
+ GENIE=29, ! Genie flag
+ ELIXIR=30, ! Drunk elixir of life
+ EMPTY=31, ! Water bottle empty flag
+ DRIP=32 ! Water drips
C*
+)
PARAMETER ( COPRNT=33, ! Flag for printing coordinates
+ SHAFT=34 ! Underground shaft flag
C*
+)
COMMON/INPUT/LINE,LEN,TOKNO,ACTION,LITACT,OBJECT,LITOBJ
COMMON/DICTON/DICACT,VERBS,NOUNS,ADJONE,ADJTWO
COMMON/DESCRP/THINGS,PSEUDO
COMMON/SCORES/SCORE,MOVENO,ALLDUN,POINTS
COMMON/DMPCOM/DUMP(40)
C*
DATA DUMP/2,'C_',1,'_ ',4,'MAGE',33*0/
C*
DATA MONTHS/'January December February November ',
+ 'March October April September ',
+ 'May August June July '/
C*
DATA WEEKDY/'Monday Tuesday Wednesday Thursday ',
+ 'Friday Saturday Sunday '/
C*
DATA COWS/'antelopes wildebeest',
+ 'zebras gazelles ',
+ 'deer elephants ',
+ 'buffalos '/
DATA CATS/'leopard tiger lion lynx '/
C*
DATA ROUTES/'north south east west ',
+ 'northeast northwest southeast southwest '/
C*
DATA EXPLET/'BLAST BUGGER DAMN SHIT SOD ',
+ 'HELL FUCK PISS WANKER BOLLOCKS',
+ 'CUNT ARSEHOLE '/
C*
DATA NUMBER/'one two three four five '/
C*
DATA BEASTS/'bat dwarf snake gorgon ',
+ 'elf troll dragon vampire '/
C*
DATA MDAYS/31,31,28,30,31,31,30,30,31,31,30,31/
DATA WAYBIT/8,8,16,16,32,64,64,32,128,128/
C*
DATA XINC/0,0,1,-1,1,-1,1,-1,0,0/
DATA YINC/1,-1,0,0,1,1,-1,-1,0,0/
DATA ZINC/0,0,0,0,0,0,0,0,-1,1/
C*
DATA MONSTR/H$MON*-1/ ! Initialise all monsters
C*
C* Initialise all VALUES to 0
C*
CALL ZFIL$R(VALUES,H$VAL)
C*
DELAY=2000
HELPNO=0
ADVNO=11
VALUES(THIRST)=0 ! Not thirsty yet
VALUES(BRKBOT)=-1 ! Location of smashed bottle
VALUES(BRKVAS)=-1 ! Location of smashed vase
VALUES(BRKGOB)=-1 ! Location of smashed goblet
VALUES(BRKMIR)=-1 ! Location of smashed mirror
VALUES(DWFNOW)=0 ! No dwarves active yet
VALUES(GORLOC)=-1 ! Gorgon has no location yet
VALUES(SEED)=-1 ! Initialise for use as flag first
VALUES(FLICK)=0 ! Lamp not flickering yet
C*
START=.TRUE.
FLAGS(MASTER)=.FALSE.
FLAGS(COPRNT)=.FALSE.
FLAGS(FR13)=.FALSE.
FLAGS(HALLOW)=.FALSE.
FLAGS(LIFE)=.TRUE.
FLAGS(HOME)=.TRUE.
FLAGS(DARK)=.FALSE.
FLAGS(NIGHT)=.FALSE.
FLAGS(LAMPON)=.FALSE.
FLAGS(INTENT)=.FALSE.
FLAGS(HIGRAS)=.FALSE.
FLAGS(ANIMAL)=.FALSE.
FLAGS(HERD)=.TRUE.
FLAGS(CARNIV)=.FALSE.
FLAGS(SEEN)=.FALSE.
FLAGS(BOXLOK)=.TRUE.
FLAGS(DORLOK)=.TRUE.
FLAGS(UNDEAD)=.FALSE.
FLAGS(GENIE)=.FALSE.
FLAGS(ELIXIR)=.FALSE.
FLAGS(EMPTY)=.TRUE.
FLAGS(GLOW)=.FALSE.
FLAGS(WAVER)=.FALSE.
FLAGS(SHAFT)=.FALSE.
C*
DO 5 I=1,H$OBJ
ALLDUN(I)=.FALSE.
GONE(I)=.FALSE.
OBHERE(I)=.FALSE.
5 CONTINUE
C*
BLANK=' '
TMPOBJ=BLANK
TMPACT=BLANK
C*
CALL TNOUA(BLANK,8)
CALL TONL
CALL TNOU(
+' *** Welcome to the world of CHIMAERA ***',58)
CALL TONL
CALL TNOU(
+' (Created by Nicholas Perre-Wetherall)',55)
CALL TONL
CALL TNOU(
C* 1--------1---------2---------3---------4---------5---------6
+' (GGR release 30th September 1986) ',55)
CALL TNOU(
+' Version : 1.113',43)
CALL TONL
CALL TNOU(
+' Command me and I will be your guide. There is treasure',58)
CALL TNOU(
+'to be found but also much danger. Few who venture here escape',61
+)
CALL TNOU(
+'unchanged but you may succeed where others have failed!!',56)
C*
CALL TONL
C*
CALL TIMDAT(TIMBUF,28)
I=MOD(TIMBUF(8),50)+1
IF (I.GT.4) GOTO 9999
C*
CALL TNOU(
+'==================================================',50)
CALL TONL
GOTO (9910,9920,9930,9940),I
C*
9910 CALL TNOU('Having trouble with space and time? If so use',45)
CALL TNOU('TIME and WHERE to get a fix!',28)
GOTO 9995
C*
9920 CALL TNOU('The dwarves seem more aggressive these days,',44)
CALL TNOU('you had better find out how to get rid of them!',47)
GOTO 9995
C*
9930 CALL TNOU('Flickering lamps can not be relit indefinitely,',47)
CALL TNOU('you must find a more permanent solution!',40)
GOTO 9995
C*
9940 CALL TNOU(
+'Help is precious, away from your camp you can only',50)
CALL TNOU(
+'use it twice. Save it for real emergencies only or you may ',59)
CALL TNOU(
+'get completely stuck underground. There is also a magic',55)
CALL TNOU(
+'word to assist you. Wonder if anybody has found it yet...',57)
C*
9995 CALL TNOU(
+'==================================================',50)
CALL TONL
C*
9999 CONTINUE
C*
C*********************************************************************
C*
CALL LEXICN ! Load dictionary
CALL WORTH ! Load object points array
SCORE=0
C*
CALL COMIN$(G$PRNT+G$JUST+G$UPPR,
+'Do you want instructions? ',26,LINE,132,LEN,TOKNO)
IF (LEN.EQ.0) GOTO 10
IF (COMEQV(LINE,'YES')) CALL INSTR(START)
10 CALL TONL
CALL TNOU(
+'There are eleven starting points, ten are standard',50)
CALL TNOU('and one (number 0) is random.',29)
CALL TONL
20 CALL COMIN$(G$PRNT+G$JUST+G$UPPR,'Choose one (0 - 10) > ',22,
+LINE,20,LEN,TOKNO)
IF (TOKNO.NE.1) GOTO 20
IF (COMP$R(8,LINE,'MASTER ').NE.0) GOTO 27
CALL STATUS(FLAGS(MASTER),SCORE)
IF (.NOT.FLAGS(MASTER)) GOTO 20
21 CALL TONL
CALL COMIN$(G$JUST+G$PRNT,
+'Seed for random numbers > ',26,LINE,132,LEN,TOKENS)
IF (TOKENS.EQ.0) GOTO 23
READ(UNIT=LINE,ERR=21) VALUES(SEED)
23 CALL TONL
CALL COMIN$(G$UPPR+G$JUST+G$PRNT,
+'Print co-ordinates? ',20,LINE,132,LEN,TOKENS)
IF (COMEQV(LINE,'YES')) FLAGS(COPRNT)=.TRUE.
GOTO 20
C*
27 READ(UNIT=LINE,ERR=20) ADVNO
IF (ADVNO.LT.0.OR.ADVNO.GT.10) GOTO 20
C*
C* Seed random number genarator
C*
CALL RND(10*ADVNO)
CALL LOCWUN(OBJLOC)
CALL TIMDAT(TIMBUF,28)
VALUES(SEED)=TIMBUF(4)+60.*TIMBUF(5)
CALL RND(VALUES(SEED))
C*
VALUES(DWFNUM)=RANDOM(4)+2 ! Initial dwarf population
VALUES(MONCNT)=0 ! No active monsters
MONTH=RANDOM(12)+1 ! Set the month
DAYNUM=MDAYS(MONTH)
DAY=RANDOM(DAYNUM)+1
CALL TONL
C*
C* Get date and day of month and print them
C*
WKDAY=RANDOM(7)+1
CALL TONL
CALL TNOUA('It is ',6)
RAND=RANDOM(20)
IF (RAND.EQ.13) FLAGS(FR13)=.TRUE.
IF (RAND.EQ.10) FLAGS(HALLOW)=.TRUE.
IF (FLAGS(FR13)) GOTO 60
CALL TNOUA(WEEKDY(1,WKDAY),LENGTH(WEEKDY(1,WKDAY),10))
CALL T1OU(160)
IF (FLAGS(HALLOW)) GOTO 80
CALL T1OU(160)
CALL TOVFIS(DAY,0)
IF (DAY.EQ.1.OR.DAY.EQ.21) GOTO 30
IF (DAY.EQ.2.OR.DAY.EQ.22) GOTO 40
IF (DAY.EQ.3.OR.DAY.EQ.23) GOTO 50
CALL TNOUA('th. ',4)
GOTO 70
30 CALL TNOUA('st. ',4)
GOTO 70
40 CALL TNOUA('nd. ',4)
GOTO 70
50 CALL TNOUA('rd. ',4)
GOTO 70
60 CALL TNOUA('Friday 13th. ',13)
70 CALL TNOUA(MONTHS(1,MONTH),LENGTH(MONTHS(1,MONTH),10))
GOTO 90
80 CALL TNOUA('31st. October (Halloween)',25)
MONTH=10
90 CALL T1OU(174)
CALL TONL
VALUES(DAYLEN)=MONTH*2+12 ! Range 14 - 36
CALL TNOU(
+'The sun shines blood red through the dawn!',42)
VALUES(TIME)=1
FLAGS(NIGHT)=.FALSE.
Z=1
IF (ADVNO.NE.11) GOTO 100
X=RANDOM(15)*15+15
Y=2000/X
GOTO 110
100 X=10*ADVNO
Y=1500/X
C*
C* First move, set the move counter and print the first
C* move text.
C*
110 MOVENO=-1
VALUES(FIRSTX)=X
VALUES(FIRSTY)=Y
VALUES(TIME)=1
VALUES(HELD)=0
VALUES(MAGONE)=0
VALUES(LIGHT)=100
COW=1
CAT=1
VALUES(DUSK)=VALUES(DAYLEN)-1
VALUES(LUCK)=RANDOM(40)
IF (FLAGS(FR13)) VALUES(LUCK)=RANDOM(10)
CALL MOVE$R(177,DICACT,273,DICACT,1)
CALL LOCATE(X,Y,Z,VALUES(BASE))
CALL TONL
CALL TNOUA(
+'You are standing on a wide grassy plain; far off the snow',57)
CALL TNOU(' clad',5)
CALL MOVE$R(548,DICACT,274,DICACT,1)
CALL TNOUA(
+'tops of distant mountains gleam in the rays of the rising',57)
CALL TNOU(' sun.',5)
CALL MOVE$R(18,DICACT,275,DICACT,1)
CALL TNOU(
+'Isolated trees are dotted about the landscape and groups',56)
CALL MOVE$R(81,DICACT,276,DICACT,1)
CALL TNOU(
+'of animals can dimly be seen moving about some way off.',55)
CALL MOVE$R(545,DICACT,277,DICACT,1)
C*
C* ***************************************
C* * *
C* * All set up, now for the main loop *
C* * *
C* ***************************************
C*
120 CALL LOCATE(X,Y,Z,HERE)
CHARS=0 ! Ensure display line length is zero for now.
DO 125 I=1,H$OBJ
OBHERE(I)=.FALSE. ! Unset all object here flags
125 CONTINUE
VALUES(TIME)=VALUES(TIME)+1
IF (OBJLOC(O$LAMP).NE.0) FLAGS(LAMPON)=.FALSE.
IF (FLAGS(LAMPON)) VALUES(LIGHT)=VALUES(LIGHT)-1
IF (FLAGS(LAMPON).AND.OBJLOC(O$LAMP).EQ.0) FLAGS(DARK)=.FALSE.
FLAGS(NIGHT)=.FALSE.
FLAGS(DRIP)=.FALSE.
FLAGS(SHAFT)=.FALSE.
VALUES(POOL)=-1 ! Unset this variable
IF (VALUES(TIME).GT.48) VALUES(TIME)=1
IF (VALUES(TIME).GT.VALUES(DAYLEN)) FLAGS(NIGHT)=.TRUE.
IF (.NOT.FLAGS(NIGHT).AND.FLAGS(UNDEAD)) GOTO 150
IF (FLAGS(NIGHT).AND.(.NOT.FLAGS(LAMPON))) FLAGS(DARK)=.TRUE.
IF (Z.GT.1.AND.(.NOT.FLAGS(LAMPON))) FLAGS(DARK)=.TRUE. ! Dark here
IF (FLAGS(UNDEAD)) FLAGS(DARK)=.FALSE. ! The undead can always see
MOVENO=MOVENO+1
IF (.NOT.FLAGS(UNDEAD)) VALUES(THIRST)=VALUES(THIRST)+1
GOTO 160
C*
C* Redistribute all the objects as at the start of the game.
C*
130 CALL TONL
CALL TNOU(
+'There is a blinding flash!!!!',29)
CALL SLEEP$(DELAY) ! Delay
CALL TONL
CALL TNOU(
+' and',19)
CALL SLEEP$(DELAY) ! Delay
CALL TONL
Z=1
X=10*ADVNO
Y=1500/X
FLAGS(ANIMAL)=.FALSE.
FLAGS(CARNIV)=.FALSE.
FLAGS(DARK)=.FALSE.
FLAGS(LAMPON)=.FALSE.
FLAGS(GLOW)=.FALSE.
FLAGS(WAVER)=.FALSE.
FLAGS(SHAFT)=.FALSE.
FLAGS(DRIP)=.FALSE.
FLAGS(NIGHT)=.FALSE.
IF (FLAGS(UNDEAD)) GOTO 120
C*
SCORE=SCORE-50
VALUES(TIME)=1
VALUES(HELD)=0
C*
C* Reposition objects, etc.
C*
CALL LOCWUN(OBJLOC) ! Randomise objects
C*
C* and reset those in tent and gone forever.
C*
DO 140 I=1,H$OBJ
IF (ALLDUN(I)) OBJLOC(I)=-1000
IF (GONE(I)) OBJLOC(I)=-2000
IF (OBJLOC(I).EQ.-2000) GONE(I)=.TRUE. ! Set by LOCWUN
140 CONTINUE
C*
C* Reinitialise all monsters that still exist, those
C* that don't remain at zero.
C*
DO 145 I=1,H$MON
IF (MONSTR(I).NE.0) MONSTR(I)=-1
145 CONTINUE
VALUES(DWFNOW)=0 ! Dwarves not active yet
C*
GOTO 120
C*
C* You have become a vampire yourself (undead) and must sleep
C* during the day.
C*
150 IF (Z.GT.1) GOTO 154
CALL TNOUA('T',1)
GOTO 156
154 CALL TNOUA('Outside t',9)
156 CALL TNOU(
+'he sun is rising and you fall into a deep slumber',49)
CALL TNOU(
+'from which you do not awake until after nightfall.',50)
VALUES(TIME)=VALUES(DAYLEN)+1
CALL SLEEP$(DELAY)
GOTO 120
C*
160 DO 170 I=1,15
WAYS(I)=.FALSE. ! All ways = .FALSE.
170 CONTINUE
IF (.NOT.FLAGS(COPRNT)) GOTO 175
CALL TODEC(X)
CALL T1OU(160)
CALL TODEC(Y)
CALL T1OU(160)
CALL TODEC(Z)
CALL TONL
175 IF (.NOT.FLAGS(INTENT)) GOTO 180
WAYS(OUT)=.TRUE. ! Only way is out.
CALL TNOUA(
+'You are in the tent, your possessions lie scattered',51)
CALL TNOU(' about on your camp bed.',24)
CALL TNOUA(
+'These include a few torn and useless clothes',44)
GOTO 4550
C*
180 IF (Z.GT.1) GOTO 185
IFLAG=0
C*
IF (MOVENO.GT.0.AND.VALUES(TIME).LE.2) IFLAG=1
IF (IFLAG.EQ.1) CALL TNOU('The sun is rising in the east.',30)
C*
IF (VALUES(TIME).LT.VALUES(DUSK).AND.
+VALUES(TIME).GE.VALUES(DUSK)-2) IFLAG=2
IF (IFLAG.EQ.2) CALL TNOU('The sun is getting low.',23)
C*
IF (.NOT.FLAGS(NIGHT).AND.VALUES(TIME).GE.VALUES(DUSK))
+IFLAG=3
IF (IFLAG.EQ.3) CALL TNOU('The sun is sinking in the west.',31)
C*
IF (VALUES(TIME).EQ.(VALUES(DAYLEN)+1)) IFLAG=4
IF (IFLAG.EQ.4) CALL TNOU(
+'The sun has just set, it is night!',34)
C*
185 IF (Z.NE.1) GOTO 330 ! Below ground or up tree
C*
C* *************************************************
C* * *
C* * On the plain, all horizontal moves possible *
C* * *
C* *************************************************
C*
IF (VALUES(TIME).EQ.1) FLAGS(DARK)=.FALSE.
DO 190 I=1,8
WAYS(I)=.TRUE.
190 CONTINUE
FLAGS(HOME)=.FALSE.
IF (HERE.EQ.VALUES(BASE)) FLAGS(HOME)=.TRUE.
IF (FLAGS(HOME)) WAYS(IN)=.TRUE.
C*
FLAGS(TREE)=.FALSE.
IF (MOVENO.EQ.0) GOTO 260 ! Skip calc. text.
C*
C* Find out if there is a hole or tree here.
C*
IF (AND(HERE,18).EQ.18) FLAGS(TREE)=.TRUE. ! Probability 1:8 overall
UNDER=Z+1
CALL LOCATE(X,Y,UNDER,BELOW)
DDOWN=WAYBIT(DOWN)
IF (AND(HERE,DDOWN).EQ.DDOWN) WAYS(DOWN)=.TRUE.
IF (FLAGS(HOME)) FLAGS(TREE)=.FALSE. ! No tree at camp.
IF (FLAGS(HOME)) WAYS(DOWN)=.FALSE. ! No hole at camp.
IF(WAYS(DOWN)) FLAGS(TREE)=.FALSE. ! No tree by a hole
IF (WAYS(DOWN).AND.FLAGS(DARK)) GOTO 327 ! Fallen down hole, kill.
IF (FLAGS(DARK)) GOTO 325
C*
C* Find out if you can get up again
C*
IF (.NOT.WAYS(DOWN)) GOTO 200 ! No hole
FLAGS(NOTUP)=.TRUE.
IF (AND(BELOW,DDOWN).EQ.DDOWN) FLAGS(NOTUP)=.FALSE.
C*
200 IF(FLAGS(TREE)) WAYS(UP)=.TRUE. ! Can climb tree
FLAGS(DDOT)=.TRUE.
IF (IFLAG.GT.0) CALL TONL
CALL TNOUA('You are standing on the plain',29)
CHARS=CHARS+29
IF (.NOT.FLAGS(NIGHT)) GOTO 205 ! No long view at night
CALL TNOUA('. It is night',13)
CHARS=CHARS+14
FLAGS(CARNIV)=RANDOM(5).EQ.1 !* ?? MLA
IF (.NOT.FLAGS(LAMPON)) CALL TNOUA('. ',2)
IF (.NOT.FLAGS(LAMPON)) GOTO 260
C*
IF (CHARS.GT.0) CALL T1OU(160)
CALL TNOUA('and you can ',12)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('see nothing ',12)
CHARS=CHARS+12
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('beyond the small ',17)
CHARS=CHARS+17
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('area illuminated ',17)
CHARS=CHARS+17
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('by the rays of ',15)
CHARS=CHARS+15
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('your lamp. ',11)
CHARS=CHARS+11
IF (CHARS.GE.58) CALL LNFEED(CHARS)
GOTO 260
C*
205 IF (RANDOM(8).EQ.5) FLAGS(ANIMAL)=.TRUE.
IF(FLAGS(ANIMAL)) FLAGS(DDOT)=.FALSE.
FLAGS(HERD)=.TRUE.
IF (RANDOM(4).EQ.2) FLAGS(HERD)=.FALSE.
FLAGS(ROLING)=.FALSE.
IF (AND(HERE,72).NE.72) FLAGS(ROLING)=.TRUE.
FLAGS(HIGRAS)=.FALSE.
IF (AND(HERE,40).EQ.40) FLAGS(HIGRAS)=.TRUE.
IF (FLAGS(ROLING)) FLAGS(DDOT)=.FALSE.
IF (FLAGS(HIGRAS)) FLAGS(DDOT)=.FALSE.
IF (FLAGS(DDOT)) CALL TNOUA('. ',2)
IF (.NOT.FLAGS(ROLING)) GOTO 210
CALL TNOUA(', rolling ',10)
CHARS=CHARS+10
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('grassland ',10)
CHARS=CHARS+10
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('stretches to ',13)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('the horizon. ',13)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
C*
210 IF (.NOT.FLAGS(ANIMAL)) COW=RANDOM(7)+1 ! Herbivore species
IF (.NOT.FLAGS(CARNIV)) CAT=RANDOM(4)+1 ! Carnivore species
IF (FLAGS(HIGRAS)) GOTO 240
IF (.NOT.FLAGS(ANIMAL)) GOTO 260
C*
IF (FLAGS(ROLING)) GOTO 220
IF (FLAGS(HERD)) CALL TNOUA(', h',3)
IF (.NOT.FLAGS(HERD)) CALL TNOUA(', i',3)
GOTO 230
220 IF (FLAGS(HERD)) CALL T1OU(200)
IF (.NOT.FLAGS(HERD)) CALL T1OU(201)
230 IF (FLAGS(HERD)) CALL TNOUA('erds of ',8)
IF (.NOT.FLAGS(HERD)) CALL TNOUA('solated ',8)
CHARS=CHARS+11
IF (CHARS.GE.58) CALL LNFEED(CHARS)
LEN=LENGTH(COWS(1,COW),10)
CALL TNOUA(COWS(1,COW),LEN)
CALL T1OU(160)
CHARS=CHARS+LEN+1
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('are roaming ',12)
CHARS=CHARS+12
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('about. ',7)
CHARS=CHARS+7
IF (CHARS.GE.58) CALL LNFEED(CHARS)
C*
IF (RANDOM(5).EQ.1) FLAGS(CARNIV)=.TRUE.
IF (RANDOM(8).EQ.3) FLAGS(CARNIV)=.FALSE.
IF (FLAGS(UNDEAD)) FLAGS(CARNIV)=.FALSE. ! No cats if undead
IF (RANDOM(4).EQ.2) FLAGS(ANIMAL)=.FALSE. ! Animals disappear
GOTO 260
C*
240 IF (FLAGS(ROLING)) GOTO 260
CALL TNOUA(', ',2)
CHARS=CHARS+2
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('the grass is very ',18)
CHARS=CHARS+18
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('high here',9)
CHARS=CHARS+9
IF (.NOT.FLAGS(CARNIV)) GOTO 250
CALL T1OU(160)
IF (CHARS.GE.58) CALL LNFEED(CHARS)
IF (CHARS.GT.0) CALL T1OU(160)
CALL TNOUA('and you can ',12)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('hear large ',11)
CHARS=CHARS+11
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('animals moving ',15)
CHARS=CHARS+15
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('about',5)
CHARS=CHARS+5
250 CALL TNOUA('. ',2)
CHARS=CHARS+2
IF (CHARS.GE.58) CALL LNFEED(CHARS)
C*
260 IF (.NOT.FLAGS(HOME)) GOTO 270
WAYS(UP)=.FALSE.
WAYS(DOWN)=.FALSE.
CALL TNOUA('You are at base ',16)
CHARS=CHARS+16
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('camp, your tent ',16)
CHARS=CHARS+16
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOU('stands close by.',16)
CHARS=0
IF (MOVENO.EQ.1) GOTO 450
C*
C* Text for hole in ground
C*
270 IF (.NOT.WAYS(DOWN)) GOTO 290
CALL TNOUA('There is a ',11)
CHARS=CHARS+11
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('deep hole ',10)
CHARS=CHARS+10
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('at your feet',12)
CHARS=CHARS+12
IF (.NOT.FLAGS(NOTUP)) GOTO 280
CALL TNOUA(', ',2)
CHARS=CHARS+2
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('if you go down it ',18)
CHARS=CHARS+18
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('you won''t be able ',18)
CHARS=CHARS+18
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('to get back up',14)
CHARS=CHARS+14
280 CALL TNOUA('. ',2)
CHARS=CHARS+2
IF (CHARS.GE.58) CALL LNFEED(CHARS)
C*
290 IF(.NOT.FLAGS(TREE)) GOTO 300 ! Get next instruction
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('There is a tall ',16)
CHARS=CHARS+16
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('tree standing ',14)
CHARS=CHARS+14
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('nearby. ',8)
CHARS=CHARS+8
IF (CHARS.GE.58) CALL LNFEED(CHARS)
C*
C* Attacks by carnivores
C*
300 IF (.NOT.FLAGS(CARNIV)) GOTO 450
IF (.NOT.FLAGS(HIGRAS)) GOTO 320
IF (.NOT.FLAGS(SEEN)) GOTO 450
IF (RANDOM(5).NE.1) GOTO 450 ! No attack
IF (CHARS.NE.0) CALL TONL ! Terminate previous text line
CALL TONL
CHARS=0
CALL TNOUA('A ',2)
LEN=LENGTH(CATS(1,CAT),10)
CALL TNOUA(CATS(1,CAT),LEN)
CALL T1OU(160)
CHARS=CHARS+LEN+3
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('leaps at you ',13)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('from amongst ',13)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('the long grass. ',16)
CHARS=CHARS+16
IF (CHARS.GE.58) CALL LNFEED(CHARS)
IF (VALUES(LUCK).GT.20) GOTO 310
IF (CAT.EQ.4) GOTO 310 ! Lynx
C*
CALL TONL
CALL TNOU('It gets you!!!',14)
CALL DEAD(FLAGS,VALUES(LUCK))
GOTO 130
C*
310 CALL TNOUA('You avoid it ',13)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('adroitly and ',13)
CHARS=CHARS+13
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOU('it slinks away.',15)
CHARS=0
VALUES(LUCK)=VALUES(LUCK)-5
CALL LUCKY(VALUES(LUCK))
FLAGS(CARNIV)=.FALSE.
GOTO 450
C*
C* Carnivore in open country
C*
320 IF (RANDOM(5).NE.2) GOTO 450
FLAGS(SEEN)=.TRUE.
CALL TNOUA('A ',2)
LEN=LENGTH(CATS(1,CAT),10)
CALL TNOUA(CATS(1,CAT),LEN)
CALL T1OU(160)
CHARS=CHARS+LEN+3
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('eyes you hungrily ',18)
CHARS=CHARS+18
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOUA('from some ',10)
CHARS=CHARS+10
IF (CHARS.GE.58) CALL LNFEED(CHARS)
CALL TNOU('long grass.',11)
CHARS=0
GOTO 450
C*
325 CALL TNOU(
+'It is very dark, if you move about you are likely',49)
CALL TNOU(
+'to fall into a pit.',19)
GOTO 450
C*
327 CALL TNOU(
+'Stumbling about in the dark, you have fallen into a deep',56)
CALL TNOU('hole and broken your neck!',26)
GOTO 337
C*
C* *********************************
C* * *
C* * End of ground level section *
C* * *
C* *********************************
C*
330 IF (Z.GT.0) GOTO 350 ! Below ground
C*
C* *************
C* * *
C* * Up tree *
C* * *
C* *************
C*
WAYS(DOWN)=.TRUE.
IF (VALUES(TIME).EQ.1) FLAGS(DARK)=.FALSE.
IF (FLAGS(DARK)) GOTO 325
IF (FLAGS(NIGHT)) GOTO 345
IF (IFLAG.GT.0) CALL TONL
CALL TNOU(
+'You are at the top of the tree, from here you can see miles',59)
CALL TNOU(
+'in every direction. The mountains are still a long way off',58)
CALL TNOU(
+'and there is no chance of reaching them before nightfall.',57)
C*
335 IF (.NOT.FLAGS(CARNIV)) GOTO 450
IF (.NOT.FLAGS(SEEN)) GOTO 450
CALL TONL
IF (CAT.NE.1) GOTO 340 ! Not leopard
CALL TNOU(
+'A leopard climbs up the tree after you. You try to escape',57)
CALL TNOU(
+'by crawling out along a branch but it is rotten and snaps.',58)
CALL TNOU(
+'You fall to the ground and break your neck!',43)
337 CALL DEAD(FLAGS,VALUES(LUCK))
GOTO 130
C*
340 FLAGS(CARNIV)=.FALSE.
SCORE=SCORE+1 ! For avoiding CAT
CALL TNOUA('The ',4)
CALL TNOUA(CATS(1,CAT),LENGTH(CATS(1,CAT),10))
CALL TNOU(
+' prowls by the foot of the tree without',39)
CALL TNOU(
+'seeing you. It eventually wanders off.',38)
GOTO 450
C*
C* Up tree at night with lamp on.
C*
345 CALL TNOU(
+'You are at the top of the tree but your lamp is not powerful',60)
CALL TNOUA(
+'enough for you to see anything except your immediate ',53)
CALL TNOU(
+'surroundings.',13)
CHARS=0