1
2
3
4
5
6
7 bug
8
9
10
11
12
13
14
15
16 GAME
17 IMPLICIT INTEGER (A-Z)
18 %include dparam
19 LOGICAL RMDESC,VAPPLI,AAPPLI,OBJACT
20 LOGICAL F,PARSE,FINDXT,XVEHIC,LIT,PRVLIT
21
22
23
24
25
26 CALL RSPEAK(1)
27 F=RMDESC(3)
28
29
30
31 100 WINNER=PLAYER
32 TELFLG=.FALSE.
33 IF(PRSCON.LE.1) CALL RDLINE(INBUF,INLNT,1)
34
35 IF(INBUF(PRSCON:INLNT).NE.'GDT') GO TO 200
36 CALL GDT
37 PRSCON=1
38 GO TO 100
39
40 200 MOVES=MOVES+1
41 SUBLNT=0
42 PRVHER=HERE
43 PRVLIT=LIT(HERE)
44 PRSWON=PARSE(INBUF,INLNT,.TRUE.)
45 IF(.NOT.PRSWON) GO TO 400
46 IF(AAPPLI(AACTIO(WINNER))) GO TO 400
47 IF(XVEHIC(1)) GO TO 400
48
49 IF(PRSA.EQ.TELLW) GO TO 2000
50 300 IF((PRSO.EQ.VALUA).OR.(PRSO.EQ.EVERY).OR.(PRSO.EQ.POSSE)
51 & .OR.(PRSO.EQ.BUNOBJ)) GO TO 900
52 IF(.NOT.VAPPLI(PRSA)) GO TO 400
53 IF(.NOT.PRVLIT.AND.(HERE.EQ.PRVHER)
54 & .AND.LIT(HERE)) F=RMDESC(0)
55 350 IF(.NOT.(ECHOF.OR.DEADF).AND.(HERE.EQ.ECHOR)) GO TO 1000
56 CALL RAPPLI(RACTIO(HERE))
57
58 400 CALL XENDMV(TELFLG)
59 IF(.NOT.LIT(HERE)) PRSCON=1
60 GO TO 100
61
62 900 CALL VALUAC(PRSO)
63 GO TO 350
64
65
66
67
68
69
70 1000 CALL RDLINE(INBUF,INLNT,0)
71 MOVES=MOVES+1
72 IF(INBUF.NE.'ECHO') GO TO 1100
73
74 CALL RSPEAK(571)
75 ECHOF=.TRUE.
76
77 OFLAG2(BAR)=AND (OFLAG2(BAR), COMPL(SCRDBT))
78 PRSWON=.TRUE.
79 PRSCON=1
80 GO TO 400
81
82 1100 IF(INBUF.NE.'BUG') GO TO 1200 bug
83 CALL RSPEAK(913)
84 GO TO 1000
85
86 1200 IF(INBUF.NE.'FEATURE') GO TO 1300
87 CALL RSPEAK(914)
88 GO TO 1000
89
90 1300 PRSWON=PARSE(INBUF,INLNT,.FALSE.)
91 IF(.NOT.PRSWON .OR. (PRSA.NE.WALKW))
92 & GO TO 1400
93 IF(FINDXT(PRSO,HERE)) GO TO 300
94
95 1400 WRITE(OUTCH,1410) INBUF(1:INLNT)
96 1410 FORMAT(1X,A)
97 TELFLG=.TRUE.
98 GO TO 1000
99
100
101
102
103 Note
104
105 2000 IF(SUBLNT.NE.0) GO TO 2050
106 CALL RSPSUB(946,ODESC2(PRSO))
107 GO TO 2150
108
109 2050 IF(PRSO.NE.OPLAY) GO TO 2100
110 WRITE(OUTCH,2060) SUBBUF(1:SUBLNT)
111 2060 FORMAT(' Ok: "',A,'".')
112 TELFLG=.TRUE.
113 GO TO 2150
114
115 2100 IF(OBJACT(X)) GO TO 350
116
117 IF(AND (OFLAG2(PRSO),ACTRBT).NE.0) GO TO 2200
118 I=602
119
120 IF(AND (OFLAG1(PRSO),VICTBT).NE.0) I=888
121 CALL RSPSUB(I,ODESC2(PRSO))
122 2150 PRSCON=0
123 GO TO 350
124
125 2200 SVPRSC=PRSCON
126 SVPRSO=PRSO
127 PRSCON=1
128 2300 WINNER=OACTOR(SVPRSO)
129 HERE=AROOM(WINNER)
130 PRSWON=PARSE(SUBBUF,SUBLNT,.TRUE.)
131 IF(.NOT.PRSWON) GO TO 2600
132
133 IF(AAPPLI(AACTIO(WINNER))) GO TO 2400
134 IF(XVEHIC(1)) GO TO 2400
135 IF((PRSO.EQ.VALUA).OR.(PRSO.EQ.EVERY).OR.(PRSO.EQ.POSSE)
136 & .OR.(PRSO.EQ.BUNOBJ)) GO TO 2900
137 IF(.NOT.VAPPLI(PRSA)) GO TO 2400
138 2350 CALL RAPPLI(RACTIO(HERE))
139 2400 IF(PRSCON-1) 2700,2550,2500
140 2500 CALL XENDMV(TELFLG)
141 GO TO 2300
142
143 2550 PRSCON=SVPRSC
144 GO TO 2700
145
146 2600 IF(OFLAG.NE.0) CALL RSPEAK(604)
147 OFLAG=0
148 2700 WINNER=PLAYER
149 HERE=AROOM(WINNER)
150 GO TO 400
151
152 2900 CALL VALUAC(PRSO)
153 GO TO 2350
154
155
156
157
158
159
160
161 XENDMV(FLAG)
162 IMPLICIT INTEGER (A-Z)
163 %include dparam
164 LOGICAL F,CLOCKD,FLAG,XVEHIC
165
166 IF(.NOT.FLAG) CALL RSPEAK(341)
167 IF(THFACT) CALL THIEFD
168 IF(PRSWON.AND..NOT.DEADF) CALL FIGHTD
169 IF(SWDACT) CALL SWORDD
170 IF(PRSWON) F=CLOCKD(X)
171 IF(PRSWON) F=XVEHIC(2)
172 RETURN
173
174
175
176
177
178
179 LOGICAL XVEHIC(N)
180 IMPLICIT INTEGER (A-Z)
181 %include dparam
182 LOGICAL OAPPLI
183
184 XVEHIC=.FALSE.
185 AV=AVEHIC(WINNER)
186 IF(AV.NE.0) XVEHIC=OAPPLI(OACTIO(AV),N)
187 RETURN
188
189
190
191
192
193
194 LOGICAL INITFL(X)
195 IMPLICIT INTEGER (A-Z)
196 %include dparam
197 LOGICAL PROTCT
198 CHARACTER*1 KEDIT
199 external dtext_$dindx_path (descriptors)
200 CHARACTER*(168) DINDXP
201
202
203
204
205
206
207 INITFL=.FALSE.
208 IF(PROTCT(X)) GO TO 10000
209 WRITE(OUTCH,10100)
210 10100 FORMAT(
211 & ' There appears before you a threatening figure clad all'/
212 & ' over in heavy black armor. His legs seem like the massive'/
213 & ' trunk of the oak tree. His broad shoulders and helmeted'/
214 & ' head loom high over your own puny frame, and you realize'/
215 & ' that his powerful arms could easily crush the very life'/
216 & ' from your body. There hangs from his belt a veritable'/
217 & ' arsenal of deadly weapons: sword, mace, ball and chain'/
218 & ' dagger, lance, and trident. He speaks with a commanding'/
219 & ' voice:'//20X,'"You shall not pass."'//
220 & ' As he grabs you by the neck all grows dim about you.')
221 RETURN
222
223
224
225
226
227 10000 call dtext_$dindx_path (DINDXP)
228 OPEN (UNIT=1,FILE=DINDXP,STATUS='OLD',BLANK='NULL',
229 & FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)
230 READ(1,130) I,J
231 READ(1,125) KEDIT
232 IF((I.NE.VMAJ).OR.(J.NE.VMIN))
233 & GO TO 1925
234
235
236
237
238 call dtext_$open
239
240 READ(1,130) MXSCOR,STRBIT,EGMXSC
241 READ(1,130) RLNT,RDESC2,RDESC1,REXIT,RACTIO,RVAL,RFLAG
242 READ(1,130) XLNT,TRAVEL
243 READ(1,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
244 & OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,OREAD
245 READ(1,130) R2LNT,O2,R2
246 READ(1,130) CLNT,CTICK,CACTIO
247 READ(1,135) CFLAG,CCNCEL
248 READ(1,130) VLNT,VILLNS,VPROB,VOPPS,VBEST,VMELEE
249 READ(1,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
250 READ(1,130) MBASE,MLNT,RTEXT
251
252 CLOSE (UNIT=1)
253 GO TO 1025
254
255 125 FORMAT(A)
256 130 FORMAT(I8)
257 135 FORMAT(L4)
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274 1025 CONTINUe
275 CALL IDATE (CAC_Y, CAC_M, CAC_D)
276 I=(CAC_Y*64)+(CAC_M*8)+CAC_D
277 CALL ITIME(TMARRAY)
278 J=(TMARRAY(1)*64)+(TMARRAY(2)*8)+TMARRAY(3)
279 SHOUR = TMARRAY(1)
280 SMIN = TMARRAY(2)
281
282 CALL INIRND(I,J)
283
284 WINNER=PLAYER
285 THFPOS=OROOM(THIEF)
286 BLOC=OROOM(BALLO)
287 HERE=AROOM(WINNER)
288 LASTIT=AOBJ(PLAYER)
289
290 INITFL=.TRUE.
291 RETURN
292
293
294
295 1900 WRITE(OUTCH,910)
296 WRITE(OUTCH,980)
297 RETURN
298 1925 WRITE(OUTCH,920) I,J,KEDIT,VMAJ,VMIN,VEDIT
299 WRITE(OUTCH,980)
300 RETURN
301 1950 WRITE(OUTCH,960)
302 WRITE(OUTCH,980)
303 RETURN
304 910 FORMAT(' I can''t open "DINDX.DAT".')
305 920 FORMAT(' "DINDX.DAT" is version ',I1,'.',I1,A,'.'/
306 & ' I require version ',I1,'.',I1,A,'.')
307 960 FORMAT(' I can''t open "DTEXT.DAT".')
308 980 FORMAT(
309 & ' Suddenly a sinister, wraithlike figure appears before you'/
310 & ' seeming to float in the air. In a low, sorrowful voice he'/
311 & ' says, "Alas, the very nature of the world has changed, and'/
312 & ' the dungeon cannot be found. All must now pass away."'/
313 & ' Raising his oaken staff in farewell, he fades into the'/
314 & ' spreading darkness. In his place appears a tastefully'/
315 & ' lettered sign reading:'//20X,'INITIALIZATION FAILURE'//
316 & ' The darkness becomes all encompassing, and your vision fails.')
317
318
319
320
321
322
323
324
325
326
327 LOGICAL PROTCT(X)
328 IMPLICIT INTEGER (A-Z)
329
330 PROTCT=.TRUE.
331 RETURN
332