-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathamain.f
More file actions
1563 lines (1558 loc) · 43.2 KB
/
amain.f
File metadata and controls
1563 lines (1558 loc) · 43.2 KB
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 Adventure - main program
C
SUBROUTINE MAIN
IMPLICIT INTEGER (A-Z)
INCLUDE 'aparam.for'
LOGICAL YES,TOTING,HERE,AT,BITSET,DARK,WZDARK,YEA,VERBOSITY
LOGICAL FORCED
LOGICAL, DIMENSION(100) :: PCT
CHARACTER*8 WORD1,WORD2,OLDWORD1,OLDWORD2
C
C Statement functions
C
C TOTING(OBJ) = true if the OBJ is being carried
C HERE(OBJ) = true if the OBJ is at "LOC" (or is being carried)
C AT(OBJ) = true if on either side of two-placed OBJ
C LIQ(DUMMY) = object number of liquid in bottle
C LIQLOC(LOC) = object number of liquid (if any) at LOC
C BITSET(L,N) = true if COND(L) has bit N set (bit 0 is units bit)
C FORCED(LOC) = true if LOC moves without asking for input (COND=2)
C DARK(DUMMY) = true if location "LOC" is dark
C PCT(N) = true N% of the time (N integer from 0 to 100)
C
C WZDARK says whether the LOC he's leaving was dark
C LMWARN says whether he's been warned about lamp going dim
C CLOSNG says whether its closing time yet
C PANIC says whether he's found out he's trapped in the cave
C CLOSED says whether we're all the way closed
C GAVEUP says whether he exited via "QUIT"
C SCORNG indicates to the SCORE routine whether we're doing a "SCORE" command
C DEMO is true if this is a prime-time demonstration game
C YEA is random YES/NO reply
C
TOTING(OBJ)=PLACE(OBJ).EQ.-1
HERE(OBJ)=PLACE(OBJ).EQ.LOC.OR.TOTING(OBJ)
AT(OBJ)=PLACE(OBJ).EQ.LOC.OR.FIXED(OBJ).EQ.LOC
LIQ2(PBOTL)=(1-PBOTL)*WATER+(PBOTL/2)*(WATER+OIL)
LIQ(DUMMY)=LIQ2(MAX0(PROP(BOTTLE),-1-PROP(BOTTLE)))
LIQLOC(LOC)=LIQ2((MOD(COND(LOC)/2*2,8)-5)*MOD(COND(LOC)/4,2)+1)
BITSET(L,N)=IAND(COND(L),ISHFT(1,N)).NE.0
FORCED(LOC)=COND(LOC).EQ.2
DARK(DUMMY)=MOD(COND(LOC),2).EQ.0.AND.(PROP(LAMP).EQ.0.OR.
1 .NOT.HERE(LAMP))
PCT(N)=RND(100).LT.N
VERBOSITY=.FALSE.
OLDWORD1=''
C Start-up, dwarf stuff
C
1 I=RND(1)
HINTED(3)=YES(65,1,0)
NEWLOC=1
LOC = NEWLOC
LIMIT=330
IF(HINTED(3))LIMIT=1000
C
C Can't leave cave once it's closing (except by main office).
C
2 IF(NEWLOC.GE.9.OR.NEWLOC.EQ.0.OR..NOT.CLOSNG)GOTO 71
CALL RSPEAK(130)
NEWLOC=LOC
IF(.NOT.PANIC)CLOCK2=15
PANIC=.TRUE.
C
C See if a dwarf has seen him and has come from where he wants to go. If so,
C the dwarf's blocking his way. If coming from place forbidden to pirate
C (dwarves rooted in place) let him get out (and attacked).
C
71 IF(NEWLOC .EQ. LOC .OR. FORCED(LOC) .OR. BITSET(LOC,3)) GOTO 74
C 71 IF(NEWLOC.EQ.IOR(LOC,FORCED(LOC)).OR.BITSET(LOC,3))GOTO 74
DO 73 I=1,5
IF(ODLOC(I).NE.NEWLOC.OR..NOT.DSEEN(I))GOTO 73
NEWLOC=LOC
CALL RSPEAK(2)
GOTO 74
73 CONTINUE
74 LOC=NEWLOC
C
C Dwarf stuff. See earlier comments for description of variables. Remember
C sixth dwarf is pirate and is thus very different except for motion rules.
C
C First off, don't let the dwarves follow him into a pit or a wall. Activate
C the whole mess the first time he gets as far as the Hall of Mists (LOC 15).
C If NEWLOC is forbidden to pirate (in particular, if it's beyond the Troll
C Bridge), bypass dwarf stuff. That way pirate can't steal return toll, and
C dwarves can't meet the bear. Also means dwarves won't follow him into Dead
C End in Maze, but c'est la vie. They'll wait for him outside the Dead End.
C
IF(LOC.EQ.0.OR.FORCED(LOC).OR.BITSET(NEWLOC,3))GOTO 2000
IF(DFLAG.NE.0)GOTO 6000
IF(LOC.GE.15)DFLAG=1
GOTO 2000
C
C When we encounter the first dwarf, we kill 0, 1, or 2 of the 5 dwarves. If
C any of the survivors is at LOC, replace him with the alternate.
C
6000 IF(DFLAG.NE.1)GOTO 6010
IF(LOC.LT.15.OR.PCT(95))GOTO 2000
DFLAG=2
DO 6001 I=1,2
J=1+RND(DWFMAX-1)
6001 IF(PCT(50))DLOC(J)=0
DO 6002 I=1,5
IF(DLOC(I).EQ.LOC)DLOC(I)=DALTLC
6002 ODLOC(I)=DLOC(I)
CALL RSPEAK(3)
CALL DROP(AXE,LOC)
GOTO 2000
C
C Things are in full swing. Move each dwarf at random, except if he's seen us
C he sticks with us. Dwarves never go to LOCS <15. If wandering at random,
C they don't back up unless there's no alternative. If they don't have to
C move, they attack. And, of course, dead dwarves don't do much of anything.
C
6010 DTOTAL=0
ATTACK=0
STICK=0
DO 6030 I=1,DWFMAX
IF(DLOC(I).EQ.0)GOTO 6030
J=1
KK=DLOC(I)
KK=KEY(KK)
IF(KK.EQ.0)GOTO 6016
6012 NEWLOC=TRVLOC(KK)
IF(NEWLOC.GT.300.OR.NEWLOC.LT.15.OR.NEWLOC.EQ.ODLOC(I)
1 .OR.(J.GT.1.AND.NEWLOC.EQ.TK(J-1)).OR.J.GE.HNTSIZ
2 .OR.NEWLOC.EQ.DLOC(I).OR.FORCED(NEWLOC)
3 .OR.(I.EQ.DWFMAX.AND.BITSET(NEWLOC,3))
4 .OR.TRVCON(KK).EQ.100)GOTO 6014
TK(J)=NEWLOC
J=J+1
6014 KK=KK+1
IF(TRAVEL(KK-1).GE.0)GOTO 6012
6016 TK(J)=ODLOC(I)
IF(J.GE.2)J=J-1
J=1+RND(J)
ODLOC(I)=DLOC(I)
DLOC(I)=TK(J)
DSEEN(I)=(DSEEN(I).AND.LOC.GE.15)
1 .OR.(DLOC(I).EQ.LOC.OR.ODLOC(I).EQ.LOC)
IF(.NOT.DSEEN(I))GOTO 6030
DLOC(I)=LOC
IF(I.NE.DWFMAX)GOTO 6027
C
C The pirate's spotted him. He leaves him alone once we've found chest.
C K counts if a treasure is here. If not, and TALLY=TALLY2 plus one for
C an unseen chest, let the pirate be spotted.
C
IF(LOC.EQ.CHLOC.OR.PROP(CHEST).GE.0)GOTO 6030
K=0
DO 6020 J=50,MAXTRS
C
C Pirate won't take pyramid from Plover Room or Dark Room (too easy!).
C
IF(J.EQ.PYRAM.AND.(LOC.EQ.PLAC(PYRAM)
1 .OR.LOC.EQ.PLAC(EMRALD)))GOTO 6020
IF(TOTING(J))GOTO 6022
6020 IF(HERE(J))K=1
IF(TALLY.EQ.TALLY2+1.AND.K.EQ.0.AND.PLACE(CHEST).EQ.0
1 .AND.HERE(LAMP).AND.PROP(LAMP).EQ.1)GOTO 6025
IF(ODLOC(DWFMAX).NE.DLOC(DWFMAX).AND.PCT(20))CALL RSPEAK(127)
GOTO 6030
C
6022 CALL RSPEAK(128)
C
C Don't steal chest back from troll!
C
IF(PLACE(MESSAG).EQ.0)CALL MOVE(CHEST,CHLOC)
CALL MOVE(MESSAG,CHLOC2)
DO 6023 J=50,MAXTRS
IF(J.EQ.PYRAM.AND.(LOC.EQ.PLAC(PYRAM)
1 .OR.LOC.EQ.PLAC(EMRALD)))GOTO 6023
IF(AT(J).AND.FIXED(J).EQ.0)CALL CARRY(J,LOC)
IF(TOTING(J))CALL DROP(J,CHLOC)
6023 CONTINUE
6024 DLOC(DWFMAX)=CHLOC
ODLOC(DWFMAX)=CHLOC
DSEEN(DWFMAX)=.FALSE.
GOTO 6030
C
6025 CALL RSPEAK(186)
CALL MOVE(CHEST,CHLOC)
CALL MOVE(MESSAG,CHLOC2)
GOTO 6024
C
C This threatening little dwarf is in the room with him!
C
6027 DTOTAL=DTOTAL+1
IF(ODLOC(I).NE.DLOC(I))GOTO 6030
ATTACK=ATTACK+1
IF(KNFLOC.GE.0)KNFLOC=LOC
IF(RND(1000).LT.95*(DFLAG-2))STICK=STICK+1
6030 CONTINUE
C
C Now we know what's happening. Let's tell the poor sucker about it.
C
IF(DTOTAL.EQ.0)GOTO 2000
IF(DTOTAL.EQ.1)GOTO 75
67 FORMAT(' There are ',I1,' threatening little dwarves in the'
1 ,' room with you.')
PRINT 67, DTOTAL
GOTO 77
75 CALL RSPEAK(4)
77 IF(ATTACK.EQ.0)GOTO 2000
IF(DFLAG.EQ.2)DFLAG=3
IF(ATTACK.EQ.1)GOTO 79
PRINT 78,ATTACK
78 FORMAT(' ',I1,' of them throw knives at you!')
K=6
82 IF(STICK.GT.1)GOTO 83
CALL RSPEAK(K+STICK)
IF(STICK.EQ.0)GOTO 2000
GOTO 84
68 FORMAT(' ',I1,' of them get you!')
83 PRINT 68,STICK
84 OLDLC2=LOC
GOTO 99
C
79 CALL RSPEAK(5)
K=52
GOTO 82
C Describe the current location and (maybe) get next command.
C
C Print text for current LOC.
C
2000 IF(LOC.EQ.0)GOTO 99
KK=STEXT(LOC)
KENT=0
IF (ABBNUM.NE.0) KENT=MOD(ABB(LOC),ABBNUM)
IF (KENT.EQ.0.OR.KK.EQ.0.OR.VERBOSITY.EQV..TRUE.) KK=LTEXT(LOC)
IF(FORCED(LOC).OR..NOT.DARK(0))GOTO 2001
IF(WZDARK.AND.PCT(35))GOTO 90
KK=RTEXT(16)
2001 IF(TOTING(BEAR))CALL RSPEAK(141)
CALL SPEAK(KK)
K=1
IF(FORCED(LOC))GOTO 8
IF(LOC.EQ.33.AND.PCT(25).AND..NOT.CLOSNG)CALL RSPEAK(8)
C
C Print out descriptions of objects at this location. If not closing and
C property value is negative, tally off another treasure. Rug is special
C case; once seen, its PROP is 1 (dragon on it) till dragon is killed.
C Similarly for chain; PROP is initially 1 (locked to bear). These hacks
C are because PROP=0 is needed to get full score.
C
IF(DARK(0))GOTO 2012
ABB(LOC)=ABB(LOC)+1
C ATLOC is the subroutine that shows the objs at loc
I=ATLOC(LOC)
2004 IF(I.EQ.0)GOTO 2012
OBJ=I
IF(OBJ.GT.OBJMAX)OBJ=OBJ-OBJMAX
IF(OBJ.EQ.STEPS.AND.TOTING(NUGGET))GOTO 2008
IF(PROP(OBJ).GE.0)GOTO 2006
IF(CLOSED)GOTO 2008
PROP(OBJ)=0
IF(OBJ.EQ.RUG.OR.OBJ.EQ.CHAIN)PROP(OBJ)=1
TALLY=TALLY-1
C IF REMAINING TREASURES TOO ELUSIVE, ZAP HIS LAMP.
IF(TALLY.EQ.TALLY2.AND.TALLY.NE.0)LIMIT=MIN0(35,LIMIT)
2006 KK=PROP(OBJ)
IF(OBJ.EQ.STEPS.AND.LOC.EQ.FIXED(STEPS))KK=1
CALL PSPEAK(OBJ,KK)
2008 I=LINK(I)
GOTO 2004
C
2009 K=54
2010 SPK=K
2011 CALL RSPEAK(SPK)
C
2012 VERB=0
C Clearing OBJ keeps the hints from working.
C - Eric Dittman
C OBJ=0
C
C Check if this LOC is eligible for any hints. If been here long enough,
C branch to help section (on later page). Hints all come back here eventually
C to finish the loop. Ignore "HINTS" < 4 (special stuff, see database notes).
C
2600 DO 2602 HINT=4,HNTMAX
IF(HINTED(HINT))GOTO 2602
IF(.NOT.BITSET(LOC,HINT))HINTLC(HINT)=-1
HINTLC(HINT)=HINTLC(HINT)+1
IF(HINTLC(HINT).LT.HINTS(HINT,1))GOTO 2602
C
C The section below was moved from outside the loop to avoid warnings.
C - Eric Dittman
C
C HINTS
C
C Come here if he's been long enough at required LOC(S) for some unused hint.
C Hint number is in variable "HINT". Branch to quick test for additional
C conditions, then come back to do neat stuff. GOTO 40010 if conditions are
C met and we want to offer the hint. GOTO 40020 to clear HINTLC back to zero,
C 40030 to take no action yet.
C
40000 GOTO (40400,40500,40600,40700,40800,40900)(HINT-3)
C CAVE BIRD SNAKE MAZE DARK WITT
CALL BUG(27)
C
40010 HINTLC(HINT)=0
IF(.NOT.YES(HINTS(HINT,3),0,54))GOTO 2602
PRINT 40012,HINTS(HINT,2)
40012 FORMAT(' I am prepared to give you a hint, but it will cost you',
1 I2,' points.')
HINTED(HINT)=YES(175,HINTS(HINT,4),54)
IF(HINTED(HINT).AND.LIMIT.GT.30)LIMIT=LIMIT+30*HINTS(HINT,2)
40020 HINTLC(HINT)=0
40030 GOTO 2602
C
C Now for the quick tests. See database description for one-line notes.
C
40400 IF(PROP(GRATE).EQ.0.AND..NOT.HERE(KEYS))GOTO 40010
GOTO 40020
C
40500 IF(HERE(BIRD).AND.TOTING(ROD).AND.OBJ.EQ.BIRD)GOTO 40010
GOTO 40030
C
40600 IF(HERE(SNAKE).AND..NOT.HERE(BIRD))GOTO 40010
GOTO 40020
C
40700 IF(ATLOC(LOC).EQ.0.AND.ATLOC(OLDLOC).EQ.0
1 .AND.ATLOC(OLDLC2).EQ.0.AND.HOLDNG.GT.1)GOTO 40010
GOTO 40020
C
40800 IF(PROP(EMRALD).NE.-1.AND.PROP(PYRAM).EQ.-1)GOTO 40010
GOTO 40020
C
40900 GOTO 40010
C
2602 CONTINUE
C
C Kick the random number generator just to add variety to the chase. Also,
C if closing time, check for any objects being toted with PROP < 0 and set
C the PROP to -1-PROP. This way objects won't be described until they've
C been picked up and put down separate from their respective piles. Don't
C tick CLOCK1 unless well into cave (and not at Y2).
C
IF(.NOT.CLOSED)GOTO 2605
IF(PROP(OYSTER).LT.0.AND.TOTING(OYSTER))
1 CALL PSPEAK(OYSTER,1)
DO 2604 I=1,OBJMAX
2604 IF(TOTING(I).AND.PROP(I).LT.0)PROP(I)=-1-PROP(I)
2605 WZDARK=DARK(0)
IF(KNFLOC.GT.0.AND.KNFLOC.NE.LOC)KNFLOC=0
I=RND(1)
CALL GETIN(WORD1,WORD2)
IF(WORD1.EQ.'AGAIN')GOTO 2645
OLDWORD1=WORD1
OLDWORD2=WORD2
C
C Every input, check "FOOBAR" flag. If zero, nothing's going on. If pos,
C make neg. If neg, he skipped a word, so make it zero.
C
2608 FOOBAR=MIN0(0,-FOOBAR)
TURNS=TURNS+1
C IF(VERB.EQ.SAY .AND. WORD2.NE.' ')VERB=0
C IF(VERB.EQ.SAY)GOTO 4090
IF(TALLY.EQ.0.AND.LOC.GE.15.AND.LOC.NE.33)CLOCK1=CLOCK1-1
IF(CLOCK1.EQ.0)GOTO 10000
IF(CLOCK1.LT.0)CLOCK2=CLOCK2-1
IF(CLOCK2.EQ.0)GOTO 11000
IF(PROP(LAMP).EQ.1)LIMIT=LIMIT-1
IF(LIMIT.LE.30.AND.HERE(BATTER).AND.PROP(BATTER).EQ.0
1 .AND.HERE(LAMP))GOTO 12000
IF(LIMIT.EQ.0)GOTO 12400
IF(LIMIT.LT.0.AND.LOC.LE.8)GOTO 12600
IF(LIMIT.LE.30)GOTO 12200
19999 K=43
IF(LIQLOC(LOC).EQ.WATER)K=70
C
C Do preliminary analysis of sentence to find certain special
C cases, viz,
C
C ENTER <WATER,STREAM>
C ENTER <LOCATION>
C <WATER,OIL> <PLANT,DOOR>
C
CALL VOCAB(WORD1,-1,I)
CALL VOCAB(WORD2,-1,J)
IF(WORD1.NE.'ENTER') GO TO 2609
IF(J .EQ. (WATER+1000)
1 .OR. J .EQ. STREAM) GO TO 2010
IF(WORD2 .NE. ' ') GO TO 2800
2609 IF((I .NE. (WATER+1000) .AND. I .NE. (OIL+1000))
1 .OR. (J .NE. (PLANT+1000) .AND. J .NE. (DOOR+1000)))
2 GO TO 2610
WORD2='POUR'
2610 IF(WORD1 .EQ. 'WEST' .AND. PCT(10)) CALL RSPEAK(17)
2630 CALL VOCAB(WORD1,-1,I)
IF(I.EQ.-1) GOTO 3000
K=MOD(I,1000)
KQ=I/1000+1
IF(WORD1.EQ.'VERBOSE'.OR.WORD1.EQ.'VERBOSIT')GOTO 3100
2640 GOTO (8,5000,4000,2010) KQ
CALL BUG(22)
C
C do it again
C
2645 IF (OLDWORD1.EQ.'')GOTO 2647
WORD1=OLDWORD1
WORD2=OLDWORD2
C PRINT 2650,'SET OLDWORDS for again'
GOTO 2608
C
C You can't do something again if you haven't done anything yet.
C
2647 CALL RSPEAK(14)
GOTO 2012
C
2650 FORMAT('DEBUG: ',A)
C
C Get second word for analysis.
C
2800 WORD1=WORD2
WORD2=' '
GOTO 2610
C
C Gee, I don't understand.
C
3000 SPK=60
IF(PCT(20))SPK=61
IF(PCT(20))SPK=13
CALL RSPEAK(SPK)
GOTO 2600
C Maximum verbosity.
3100 IF(VERBOSITY.EQV..TRUE.)GOTO 3101
CALL RSPEAK(202)
VERBOSITY=.TRUE.
GOTO 2012
3101 CALL RSPEAK(203)
GOTO 2012
C
C Analyse a verb. Remember what it was, go back for object if second word
C unless verb is "SAY", which snarfs arbitrary second word.
C
4000 VERB=K
SPK=ACTSPK(VERB)
IF(WORD2.EQ.' ') GOTO 4080 ! any object?
IF(VERB.EQ.SAY) GOTO 4090 ! say?
GOTO 2800 ! go analyze object
C
C Analyse an intransitive verb (ie, no object given yet).
C
4080 GOTO(8010,8000,8000,8040,2009,8040,9070,9080,8000,8000,
1 2011,9120,9130,8140,9150,8000,8000,8180,8000,8200,
2 8000,9220,9230,8240,8250,8260,8270,8000,8000,8300,
3 8310,8320)VERB
C TAKE DROP SAY OPEN NOTH LOCK ON OFF WAVE CALM
C WALK KILL POUR EAT DRNK RUB TOSS QUIT FIND INVN
C FEED FILL BLST SCOR FOO BRF READ BREK WAKE SUSP
C HOUR RESU
CALL BUG(23)
C
C Analyse a transitive verb.
C
4090 GOTO(9010,9020,9030,9040,2009,9040,9070,9080,9090,2011,
1 2011,9120,9130,9140,9150,9160,9170,2011,9190,9190,
2 9210,9220,9230,2011,2011,2011,9270,9280,9290,2011,
3 2011,2011)VERB
C TAKE DROP SAY OPEN NOTH LOCK ON OFF WAVE CALM
C WALK KILL POUR EAT DRNK RUB TOSS QUIT FIND INVN
C FEED FILL BLST SCOR FOO BRF READ BREK WAKE SUSP
C HOUR RESU
CALL BUG(24)
C
C Analyse an object word. See if the thing is here, whether we've got a verb
C yet, and so on. Object must be here unless verb is "FIND" or "INVENT(ORY)"
C (and no new verb yet to be analysed). Water and oil are also funny, since
C they are never actually dropped at any location, but might be here inside
C the bottle or as a feature of the location.
C
5000 OBJ=K
IF(FIXED(K).NE.LOC.AND..NOT.HERE(K))GOTO 5100
5010 IF(WORD2.NE.' ')GOTO 2800
IF(VERB.NE.0)GOTO 4090
PRINT 5015, WORD1(1:NBLEN(WORD1))
5015 FORMAT(' What do you want to do with the ',A,'?')
GOTO 2600
C
5100 IF(K.NE.GRATE)GOTO 5110
IF(LOC.EQ.1.OR.LOC.EQ.4.OR.LOC.EQ.7)K=DPRSSN
IF(LOC.GT.9.AND.LOC.LT.15)K=ENTRNC
IF(K.NE.GRATE)GOTO 8
5110 IF(K.NE.DWARF)GOTO 5120
DO 5112 I=1,5
IF(DLOC(I).EQ.LOC.AND.DFLAG.GE.2)GOTO 5010
5112 CONTINUE
5120 IF((LIQ(0).EQ.K.AND.HERE(BOTTLE)).OR.K.EQ.LIQLOC(LOC))GOTO 5010
IF(OBJ.NE.PLANT.OR..NOT.AT(PLANT2).OR.PROP(PLANT2).EQ.0)GOTO 5130
OBJ=PLANT2
GOTO 5010
5130 IF(OBJ.NE.KNIFE.OR.KNFLOC.NE.LOC)GOTO 5140
KNFLOC=-1
SPK=116
GOTO 2011
5140 IF(OBJ.NE.ROD.OR..NOT.HERE(ROD2))GOTO 5190
OBJ=ROD2
GOTO 5010
5190 IF((VERB.EQ.FIND.OR.VERB.EQ.INVENT).AND.WORD2.EQ.' ')GOTO 5010
PRINT 5199, WORD1(1:NBLEN(WORD1))
5199 FORMAT(' I don''t see any ',A,'.')
GOTO 2012
C Figure out the new location
C
C Given the current location in "LOC", and a motion verb number in "K", put
C the new location in "NEWLOC". The current LOC is saved in "OLDLOC" in case
C he wants to retreat. The current OLDLOC is saved in OLDLC2, in case he
C dies. (If he does, NEWLOC will be limbo, and OLDLOC will be what killed
C him, so we need OLDLC2, which is the last place he was safe.)
C
8 KK=KEY(LOC)
NEWLOC=LOC
IF(KK.EQ.0)CALL BUG(26)
IF(K.EQ.NULL)GOTO 2
IF(K.EQ.BACK)GOTO 20
IF(K.EQ.LOOK)GOTO 30
IF(K.EQ.CAVE)GOTO 40
OLDLC2=OLDLOC
OLDLOC=LOC
C
9 LL=IABS(TRAVEL(KK))
IF(LL.EQ.1 .OR. LL.EQ.K)GOTO 10
IF(TRAVEL(KK).LT.0)GOTO 50
KK=KK+1
GOTO 9
C
10 NEWLOC=TRVCON(KK)
K=MOD(NEWLOC,OBJMAX)
IF(NEWLOC.LE.300)GOTO 13
IF(PROP(K).NE.NEWLOC/OBJMAX-3)GOTO 16
C
C Try next entry in travel table
C
12 IF(TRAVEL(KK).LT.0)CALL BUG(25)
KK=KK+1
C
C Make sure he doesn't go through same test again
C
IF(TRVCON(KK-1).EQ.TRVCON(KK) .AND. TRVLOC(KK-1).EQ.TRVLOC(KK))
1 GOTO 12
GO TO 10
C
13 IF(NEWLOC.LE.OBJMAX)GOTO 14
IF(TOTING(K).OR.(NEWLOC.GT.200.AND.AT(K)))GOTO 16
GOTO 12
C
14 IF(NEWLOC.NE.0.AND..NOT.PCT(NEWLOC))GOTO 12
16 NEWLOC=TRVLOC(KK)
IF(NEWLOC.LE.300)GOTO 2
IF(NEWLOC.LE.500)GOTO 30000
CALL RSPEAK(NEWLOC-500)
NEWLOC=LOC
GOTO 2
C
C Special motions come here. Labelling convention: statement numbers NNNXX
C (XX=00-99) ARE used for special case number NNN (NNN=301-500).
C
30000 NEWLOC=NEWLOC-300
GOTO (30100,30200,30300)NEWLOC
CALL BUG(20)
C
C Travel 301. Plover-Alcove passage. Can carry only emerald. Note: travel
C table must include "useless" entries going through passage, which can never
C be used for actual motion, but can be spotted by "go back".
C
30100 NEWLOC=99+100-LOC
IF(HOLDNG.EQ.0.OR.(HOLDNG.EQ.1.AND.TOTING(EMRALD)))GOTO 2
NEWLOC=LOC
CALL RSPEAK(117)
GOTO 2
C
C Travel 302. Plover transport. Drop the emerald (only use special travel if
C toting it), so he's forced to use the Plover-passage to get it out. Having
C dropped it, go back and pretend he wasn't carrying it after all.
C
30200 CALL DROP(EMRALD,LOC)
GOTO 12
C
C Travel 303. Troll Bridge. Must be done only as special motion so that
C dwarves won't wander across and encounter the bear. (They won't follow the
C player there because that region is forbidden to the pirate.) If
C PROP(TROLL)=1, he's crossed since paying, so step out and block him.
C (Standard travel entries check for PROP(TROLL)=0.) Special stuff for bear.
C
30300 IF(PROP(TROLL).NE.1)GOTO 30310
CALL PSPEAK(TROLL,1)
PROP(TROLL)=0
CALL MOVE(TROLL2,0)
CALL MOVE(TROLL2+OBJMAX,0)
CALL MOVE(TROLL,PLAC(TROLL))
CALL MOVE(TROLL+OBJMAX,FIXD(TROLL))
CALL JUGGLE(CHASM)
NEWLOC=LOC
GOTO 2
C
30310 NEWLOC=PLAC(TROLL)+FIXD(TROLL)-LOC
IF(PROP(TROLL).EQ.0)PROP(TROLL)=1
IF(.NOT.TOTING(BEAR))GOTO 2
CALL RSPEAK(162)
PROP(CHASM)=1
PROP(TROLL)=2
CALL DROP(BEAR,NEWLOC)
FIXED(BEAR)=-1
PROP(BEAR)=3
IF(PROP(SPICES).LT.0)TALLY2=TALLY2+1
OLDLC2=NEWLOC
GOTO 99
C
C End of specials.
C
C Handle "GO BACK". Look for verb which goes from LOC to OLDLOC, or to OLDLC2
C if OLDLOC HAS FORCED-MOTION. K2 saves entry -> forced LOC -> previous LOC.
C
20 K=OLDLOC
IF(FORCED(K))K=OLDLC2
OLDLC2=OLDLOC
OLDLOC=LOC
K2=0
IF(K.NE.LOC)GOTO 21
CALL RSPEAK(91)
GOTO 2
C
21 LL=TRVLOC(KK)
IF(LL.EQ.K)GOTO 25
IF(LL.GT.300)GOTO 22
J=KEY(LL)
IF(FORCED(LL).AND.TRVLOC(KK).EQ.K)K2=KK
22 IF(TRAVEL(KK).LT.0)GOTO 23
KK=KK+1
GOTO 21
C
23 KK=K2
IF(KK.NE.0)GOTO 25
CALL RSPEAK(140)
GOTO 2
C
25 K=IABS(TRAVEL(KK))
KK=KEY(LOC)
GOTO 9
C
C Look. Can't give more detail. Pretend it wasn't dark (though it may "now"
C be dark) so he won't fall into a pit while staring into the gloom.
C
30 IF(DETAIL.LT.3)CALL RSPEAK(15)
DETAIL=DETAIL+1
WZDARK=.FALSE.
ABB(LOC)=0
GOTO 2
C
C Cave. Different messages depending on whether above ground.
C
40 IF(LOC.LT.8)CALL RSPEAK(57)
IF(LOC.GE.8)CALL RSPEAK(58)
GOTO 2
C
C Non-applicable motion. Various messages depending on word given.
C
50 SPK=12
IF(K.GE.43.AND.K.LE.50)SPK=9
IF(K.EQ.29.OR.K.EQ.30)SPK=9
IF(K.EQ.7.OR.K.EQ.36.OR.K.EQ.37)SPK=10
IF(K.EQ.11.OR.K.EQ.19)SPK=11
IF(VERB.EQ.FIND.OR.VERB.EQ.INVENT)SPK=59
IF(K.EQ.62.OR.K.EQ.65)SPK=42
IF(K.EQ.17)SPK=80
CALL RSPEAK(SPK)
GOTO 2
C "You're dead, Jim."
C
C If the current LOC is zero, it means the clown got himself killed. We'll
C allow this MAXDIE times. MAXDIE is automatically set based on the number of
C snide messages available. Each death results in a message (81, 83, etc.)
C which offers reincarnation; if accepted, this results in message 82, 84,
C etc. The last time, if he wants another chance, he gets a snide remark as
C we exit. When reincarnated, all objects being carried get dropped at OLDLC2
C (presumably the last place prior to being killed) without change of PROPS.
C The loop runs backwards to assure that the bird is dropped before the cage.
C (This kluge could be changed once we're sure all references to bird and cage
C are done by keywords.) The lamp is a special case (it wouldn't do to leave
C it in the cave). It is turned off and left outside the building (only if he
C was carrying it, of course). He himself is left inside the building (and
C heaven help him if he tries to XYZZY back into the cave without the lamp!).
C OLDLOC is zapped so he can't just "RETREAT".
C
C The easiest way to get killed is to fall into a pit in pitch darkness.
C
90 CALL RSPEAK(23)
OLDLC2=LOC
C
C Okay, he's dead. Let's get on with it.
C
99 IF(CLOSNG)GOTO 95
YEA=YES(81+NUMDIE*2,82+NUMDIE*2,54)
NUMDIE=NUMDIE+1
IF(NUMDIE.EQ.MAXDIE.OR..NOT.YEA)GOTO 20000
PLACE(WATER)=0
PLACE(OIL)=0
IF(TOTING(LAMP))PROP(LAMP)=0
DO 98 J=1,OBJMAX
I=OBJMAX+1-J
IF(.NOT.TOTING(I))GOTO 98
K=OLDLC2
IF(I.EQ.LAMP)K=1
CALL DROP(I,K)
98 CONTINUE
LOC=3
OLDLOC=LOC
GOTO 2000
C
C He died during closing time. No resurrection. Tally up a death and exit.
C
95 CALL RSPEAK(131)
NUMDIE=NUMDIE+1
GOTO 20000
C Routines for performing the various action verbs
C
C Statement numbers in this section are 8000 for intransitive verbs, 9000 for
C transitive, plus ten times the verb number. Many intransitive verbs use the
C transitive code, and some verbs use code for other verbs, as noted below.
C
C Random intransitive verbs come here. Clear OBJ just in case (see "ATTACK").
C
8000 PRINT 8002, WORD1(1:NBLEN(WORD1))
8002 FORMAT(' I don''t understand "',A,'".')
OBJ=0
GOTO 2600
C
C Carry, no object given yet. Ok if only one object present.
C
8010 IF(ATLOC(LOC).EQ.0.OR.LINK(ATLOC(LOC)).NE.0)GOTO 8000
DO 8012 I=1,5
IF(DLOC(I).EQ.LOC.AND.DFLAG.GE.2)GOTO 8000
8012 CONTINUE
OBJ=ATLOC(LOC)
C
C Carry an object. Special cases for bird and cage (if bird in cage, can't
C take one without the other. Liquids also special, since they depend on
C status of bottle. Also various side effects, etc.
C
9010 IF(TOTING(OBJ))GOTO 2011
SPK=25
IF(OBJ.EQ.PLANT.AND.PROP(PLANT).LE.0)SPK=115
IF(OBJ.EQ.BEAR.AND.PROP(BEAR).EQ.1)SPK=169
IF(OBJ.EQ.CHAIN.AND.PROP(BEAR).NE.0)SPK=170
IF(FIXED(OBJ).NE.0)GOTO 2011
IF(OBJ.NE.WATER.AND.OBJ.NE.OIL)GOTO 9017
IF(HERE(BOTTLE).AND.LIQ(0).EQ.OBJ)GOTO 9018
OBJ=BOTTLE
IF(TOTING(BOTTLE).AND.PROP(BOTTLE).EQ.1)GOTO 9220
IF(PROP(BOTTLE).NE.1)SPK=105
IF(.NOT.TOTING(BOTTLE))SPK=104
GOTO 2011
9018 OBJ=BOTTLE
9017 IF(HOLDNG.LT.7)GOTO 9016
CALL RSPEAK(92)
GOTO 2012
9016 IF(OBJ.NE.BIRD)GOTO 9014
IF(PROP(BIRD).NE.0)GOTO 9014
IF(.NOT.TOTING(ROD))GOTO 9013
CALL RSPEAK(26)
GOTO 2012
9013 IF(TOTING(CAGE))GOTO 9015
CALL RSPEAK(27)
GOTO 2012
9015 PROP(BIRD)=1
9014 IF((OBJ.EQ.BIRD.OR.OBJ.EQ.CAGE).AND.PROP(BIRD).NE.0)
1 CALL CARRY(BIRD+CAGE-OBJ,LOC)
CALL CARRY(OBJ,LOC)
K=LIQ(0)
IF(OBJ.EQ.BOTTLE.AND.K.NE.0)PLACE(K)=-1
GOTO 2009
C
C Discard object. "THROW" also comes here for most objects. Special cases for
C bird (might attack snake or dragon) and cage (might contain bird) and vase.
C Drop coins at vending machine for extra batteries.
C
9020 IF(TOTING(ROD2).AND.OBJ.EQ.ROD.AND..NOT.TOTING(ROD))OBJ=ROD2
IF(.NOT.TOTING(OBJ))GOTO 2011
IF(OBJ.NE.BIRD.OR..NOT.HERE(SNAKE))GOTO 9024
CALL RSPEAK(30)
IF(CLOSED)GOTO 19000
CALL DSTROY(SNAKE)
C
C Set prop for use by travel options
C
PROP(SNAKE)=1
9021 K=LIQ(0)
IF(K.EQ.OBJ)OBJ=BOTTLE
IF(OBJ.EQ.BOTTLE.AND.K.NE.0)PLACE(K)=0
IF(OBJ.EQ.CAGE.AND.PROP(BIRD).NE.0)CALL DROP(BIRD,LOC)
IF(OBJ.EQ.BIRD)PROP(BIRD)=0
CALL DROP(OBJ,LOC)
GOTO 2012
C
9024 IF(OBJ.NE.COINS.OR..NOT.HERE(VEND))GOTO 9025
CALL DSTROY(COINS)
CALL DROP(BATTER,LOC)
CALL PSPEAK(BATTER,0)
GOTO 2012
C
9025 IF(OBJ.NE.BIRD.OR..NOT.AT(DRAGON).OR.PROP(DRAGON).NE.0)GOTO 9026
CALL RSPEAK(154)
CALL DSTROY(BIRD)
PROP(BIRD)=0
IF(PLACE(SNAKE).EQ.PLAC(SNAKE))TALLY2=TALLY2+1
GOTO 2012
C
9026 IF(OBJ.NE.BEAR.OR..NOT.AT(TROLL))GOTO 9027
CALL RSPEAK(163)
CALL MOVE(TROLL,0)
CALL MOVE(TROLL+OBJMAX,0)
CALL MOVE(TROLL2,PLAC(TROLL))
CALL MOVE(TROLL2+OBJMAX,FIXD(TROLL))
CALL JUGGLE(CHASM)
PROP(TROLL)=2
GOTO 9021
C
9027 IF(OBJ.EQ.VASE.AND.LOC.NE.PLAC(PILLOW))GOTO 9028
CALL RSPEAK(54)
GOTO 9021
C
9028 PROP(VASE)=2
IF(AT(PILLOW))PROP(VASE)=0
CALL PSPEAK(VASE,PROP(VASE)+1)
IF(PROP(VASE).NE.0)FIXED(VASE)=-1
GOTO 9021
C
C SAY. Echo WORD2 (or WORD1 if no WORD2 (SAY what?, etc.).)
C Magic words override.
C
9030 IF(WORD2.EQ.' ') GOTO 9031
WORD1=WORD2
9031 CALL VOCAB(WORD1,-1,I)
IF(I.EQ.62.OR.I.EQ.65.OR.I.EQ.71.OR.I.EQ.2025)GOTO 9035
PRINT 9032, WORD1(1:NBLEN(WORD1))
9032 FORMAT(' Okay, "',A,'".')
GOTO 2012
C
9035 WORD2=' '
OBJ=0
GOTO 2630
C
C LOCK, UNLOCK, no object given. Assume various things if present.
C
8040 SPK=28
IF(HERE(CLAM))OBJ=CLAM
IF(HERE(OYSTER))OBJ=OYSTER
IF(AT(DOOR))OBJ=DOOR
IF(AT(GRATE))OBJ=GRATE
IF(OBJ.NE.0.AND.HERE(CHAIN))GOTO 8000
IF(HERE(CHAIN))OBJ=CHAIN
IF(OBJ.EQ.0)GOTO 2011
C
C LOCK, UNLOCK object. Special stuff for opening clam/oyster and for chain.
C
9040 IF(OBJ.EQ.CLAM.OR.OBJ.EQ.OYSTER)GOTO 9046
IF(OBJ.EQ.DOOR)SPK=111
IF(OBJ.EQ.DOOR.AND.PROP(DOOR).EQ.1)SPK=54
IF(OBJ.EQ.CAGE)SPK=32
IF(OBJ.EQ.KEYS)SPK=55
IF(OBJ.EQ.GRATE.OR.OBJ.EQ.CHAIN)SPK=31
IF(SPK.NE.31.OR..NOT.HERE(KEYS))GOTO 2011
IF(OBJ.EQ.CHAIN)GOTO 9048
IF(.NOT.CLOSNG)GOTO 9043
K=130
IF(.NOT.PANIC)CLOCK2=15
PANIC=.TRUE.
GOTO 2010
C
9043 K=34+PROP(GRATE)
PROP(GRATE)=1
IF(VERB.EQ.LOCK)PROP(GRATE)=0
K=K+2*PROP(GRATE)
GOTO 2010
C
C Clam/oyster.
C
9046 K=0
IF(OBJ.EQ.OYSTER)K=1
SPK=124+K
IF(TOTING(OBJ))SPK=120+K
IF(.NOT.TOTING(TRIDNT))SPK=122+K
IF(VERB.EQ.LOCK)SPK=61
IF(SPK.NE.124)GOTO 2011
CALL DSTROY(CLAM)
CALL DROP(OYSTER,LOC)
CALL DROP(PEARL,105)
GOTO 2011
C
C Chain.
C
9048 IF(VERB.EQ.LOCK)GOTO 9049
SPK=171
IF(PROP(BEAR).EQ.0)SPK=41
IF(PROP(CHAIN).EQ.0)SPK=37
IF(SPK.NE.171)GOTO 2011
PROP(CHAIN)=0
FIXED(CHAIN)=0
IF(PROP(BEAR).NE.3)PROP(BEAR)=2
FIXED(BEAR)=2-PROP(BEAR)
GOTO 2011
C
9049 SPK=172
IF(PROP(CHAIN).NE.0)SPK=34
IF(LOC.NE.PLAC(CHAIN))SPK=173
IF(SPK.NE.172)GOTO 2011
PROP(CHAIN)=2
IF(TOTING(CHAIN))CALL DROP(CHAIN,LOC)
FIXED(CHAIN)=-1
GOTO 2011
C
C Light lamp
C
9070 IF(.NOT.HERE(LAMP))GOTO 2011
SPK=184
IF(LIMIT.LT.0)GOTO 2011
PROP(LAMP)=1
CALL RSPEAK(39)
IF(WZDARK)GOTO 2000
GOTO 2012
C
C Lamp off
C
9080 IF(.NOT.HERE(LAMP))GOTO 2011
PROP(LAMP)=0
CALL RSPEAK(40)
IF(DARK(0))CALL RSPEAK(16)
GOTO 2012
C
C Wave. No effect unless waving rod at fissure.
C
9090 IF((.NOT.TOTING(OBJ)).AND.(OBJ.NE.ROD.OR..NOT.TOTING(ROD2)))
1 SPK=29
IF(OBJ.NE.ROD.OR..NOT.AT(FISSUR).OR..NOT.TOTING(OBJ)
1 .OR.CLOSNG)GOTO 2011
PROP(FISSUR)=1-PROP(FISSUR)
CALL PSPEAK(FISSUR,2-PROP(FISSUR))
GOTO 2012
C
C Attack. Assume target if unambiguous. "THROW" also links here. Attackable
C objects fall into two categories: enemies (snake, dwarf, etc.) and others
C (bird, clam). Ambiguous if two enemies, or if no enemies but two others.
C
9120 DO 9121 I=1,5
IF(DLOC(I).EQ.LOC.AND.DFLAG.GE.2)GOTO 9122
9121 CONTINUE
I=0
9122 IF(OBJ.NE.0)GOTO 9124
IF(I.NE.0)OBJ=DWARF
IF(HERE(SNAKE))OBJ=OBJ*100+SNAKE
IF(AT(DRAGON).AND.PROP(DRAGON).EQ.0)OBJ=OBJ*100+DRAGON
IF(AT(TROLL))OBJ=OBJ*100+TROLL
IF(HERE(BEAR).AND.PROP(BEAR).EQ.0)OBJ=OBJ*100+BEAR
IF(OBJ.GT.100)GOTO 8000
IF(OBJ.NE.0)GOTO 9124
C
C Can't attack bird by throwing axe.
C
IF(HERE(BIRD).AND.VERB.NE.THROW)OBJ=BIRD
C
C Clam and oyster both treated as clam for intransitive case; no harm done.
C
IF(HERE(CLAM).OR.HERE(OYSTER))OBJ=100*OBJ+CLAM
IF(OBJ.GT.100)GOTO 8000
9124 IF(OBJ.NE.BIRD)GOTO 9125
SPK=137
IF(CLOSED)GOTO 2011
CALL DSTROY(BIRD)
PROP(BIRD)=0
IF(PLACE(SNAKE).EQ.PLAC(SNAKE))TALLY2=TALLY2+1
SPK=45
9125 IF(OBJ.EQ.0)SPK=44
IF(OBJ.EQ.CLAM.OR.OBJ.EQ.OYSTER)SPK=150
IF(OBJ.EQ.SNAKE)SPK=46
IF(OBJ.EQ.DWARF)SPK=49
IF(OBJ.EQ.DWARF.AND.CLOSED)GOTO 19000
IF(OBJ.EQ.DRAGON)SPK=167
IF(OBJ.EQ.TROLL)SPK=157
IF(OBJ.EQ.BEAR)SPK=165+(PROP(BEAR)+1)/2
IF(OBJ.NE.DRAGON.OR.PROP(DRAGON).NE.0)GOTO 2011
C
C Fun stuff for dragon. If he insists on attacking it, win! Set prop to dead,
C move dragon to central LOC (still fixed), move rug there (not fixed), and
C move him there, too. Then do a null motion to get new description.
C
CALL RSPEAK(49)
VERB=0
OBJ=0
CALL GETIN(WORD1,WORD2)
IF(WORD1.NE.'Y' .AND. WORD1.NE.'YE' .AND. WORD1.NE.'YES')
1 GOTO 2608
CALL PSPEAK(DRAGON,1)
PROP(DRAGON)=2
PROP(RUG)=0
K=(PLAC(DRAGON)+FIXD(DRAGON))/2
CALL MOVE(DRAGON+OBJMAX,-1)