1
2
3
4
5
6 VALUAC(V)
7 IMPLICIT INTEGER (A-Z)
8 %include dparam
9 LOGICAL LIT,F,F1,TAKE,PUT,DROP,NOTHIS,NOHERE,QHERE,QBUNCH
10
11
12
13 NOTHIS(R)=((SAVEP.EQ.BUNOBJ).AND.QBUNCH(R)) .OR.
14 & ((OTVAL(R).LE.0).AND.((SAVEP.EQ.VALUA).OR.
15 & ((SAVEP.EQ.BUNOBJ).AND.(BUNSUB.EQ.VALUA)))) .OR.
16 & ((OADV(R).NE.WINNER).AND.((SAVEP.EQ.POSSE).OR.
17 & ((SAVEP.EQ.BUNOBJ).AND.(BUNSUB.EQ.POSSE))))
18
19 NOHERE(R)=((AV.EQ.0).AND..NOT.QHERE(R,HERE)) .OR.
20 & ((AV.NE.0).AND.(OCAN(R).NE.AV))
21
22
23
24
25 IF((PRSA.NE.COUNTW).OR.(PRSO.NE.POSSE)) GO TO 100
26 K=0
27 DO 50 J=1,OLNT
28 IF(OADV(J).EQ.WINNER) K=K+1
29 50 CONTINUE
30 IF(K.EQ.1) WRITE(OUTCH,60) K
31 IF(K.NE.1) WRITE(OUTCH,70) K
32 60 FORMAT(' You have ',I1,' possession.')
33 70 FORMAT(' You have ',I2,' possessions.')
34 TELFLG=.TRUE.
35 RETURN
36
37 100 IF((PRSA.NE.COUNTW).OR.(PRSO.NE.VALUA)) GO TO 200
38 K=0
39 L=0
40 DO 150 J=1,OLNT
41 IF((OADV(J).EQ.WINNER).AND.(OTVAL(J).GT.0)) K=K+1
42 IF((OCAN(J).EQ.TCASE).AND.(OTVAL(J).GT.0)) L=L+1
43 150 CONTINUE
44 IF(K.EQ.1) WRITE(OUTCH,160) K
45 IF(K.NE.1) WRITE(OUTCH,170) K
46 160 FORMAT(' You have ',I1,' valuable.')
47 170 FORMAT(' You have ',I2,' valuables.')
48 TELFLG=.TRUE.
49 IF(HERE.NE.LROOM) RETURN
50 IF(L.EQ.1) WRITE(OUTCH,180) L
51 IF(L.NE.1) WRITE(OUTCH,190) L
52 180 FORMAT(' Your adventure has netted ',I1,' treasure.')
53 190 FORMAT(' Your adventure has netted ',I2,' treasures.')
54 RETURN
55
56
57
58
59 200 SAVEP=PRSO
60 SAVEH=HERE
61 F=.TRUE.
62 I=579
63 AV=AVEHIC(WINNER)
64
65 IF(PRSA.NE.TAKEW) GO TO 1000
66 IF(.NOT.LIT(HERE)) GO TO 4500
67 IF((PRSO.NE.BUNOBJ).OR.(BUNSUB.NE.0)) GO TO 400
68 DO 300 I=1,BUNLNT
69 PRSO=BUNVEC(I)
70 F=.FALSE.
71 CALL RSPSUB(580,ODESC2(PRSO))
72 F1=TAKE(.TRUE.)
73 IF(SAVEH.NE.HERE) GO TO 4500
74 300 CONTINUE
75 GO TO 4000
76
77 400 DO 500 PRSO=1,OLNT
78
79
80
81
82
83 IF(((AND(OFLAG1(PRSO),TAKEBT).EQ.0).AND.
84 & (AND(OFLAG2(PRSO),TRYBT).EQ.0)).OR.
85 & (AND(OFLAG1(PRSO),VISIBT).EQ.0).OR.
86 & (AND(OFLAG2(PRSO),ACTRBT).NE.0).OR.
87 & NOTHIS(PRSO)) GO TO 500
88 IF(.NOT.NOHERE(PRSO)) GO TO 450
89 J=OCAN(PRSO)
90 IF((J.EQ.0).OR.(PRSO.EQ.WATER)) GO TO 500
91
92
93
94 IF((AND(OFLAG2(J),OPENBT).EQ.0).OR.
95 & (NOHERE(J).AND.(OADV(J).NE.WINNER)))
96 & GO TO 500
97
98 450 F=.FALSE.
99 CALL RSPSUB(580,ODESC2(PRSO))
100 F1=TAKE(.TRUE.)
101 IF(SAVEH.NE.HERE) GO TO 4500
102 500 CONTINUE
103 GO TO 4000
104
105
106
107
108 1000 IF(PRSA.NE.DROPW) GO TO 2000
109 IF((PRSO.NE.BUNOBJ).OR.(BUNSUB.NE.0)) GO TO 1400
110 DO 1300 I=1,BUNLNT
111 PRSO=BUNVEC(I)
112 F=.FALSE.
113 CALL RSPSUB(580,ODESC2(PRSO))
114 F1=DROP(.TRUE.)
115 IF(SAVEH.NE.HERE) GO TO 4500
116 1300 CONTINUE
117 GO TO 4000
118
119 1400 DO 1500 PRSO=1,OLNT
120 IF((OADV(PRSO).NE.WINNER).OR.NOTHIS(PRSO))
121 & GO TO 1500
122 F=.FALSE.
123 CALL RSPSUB(580,ODESC2(PRSO))
124 F1=DROP(.TRUE.)
125 IF(SAVEH.NE.HERE) GO TO 4500
126 1500 CONTINUE
127 GO TO 4000
128
129
130
131
132 2000 IF(PRSA.NE.PUTW) GO TO 3000
133 IF(.NOT.LIT(HERE)) GO TO 4500
134 IF((PRSO.NE.BUNOBJ).OR.(BUNSUB.NE.0)) GO TO 2400
135 DO 2300 I=1,BUNLNT
136 PRSO=BUNVEC(I)
137 F=.FALSE.
138 CALL RSPSUB(580,ODESC2(PRSO))
139 F1=PUT(.TRUE.)
140 IF(SAVEH.NE.HERE) GO TO 4500
141 2300 CONTINUE
142 GO TO 4000
143
144 2400 DO 2500 PRSO=1,OLNT
145
146
147
148
149
150
151 IF(((OADV(PRSO).NE.WINNER).AND.
152 & (NOHERE(PRSO).OR.
153 & ((AND(OFLAG1(PRSO),TAKEBT).EQ.0).AND.
154 & (AND(OFLAG2(PRSO),TRYBT).EQ.0)))) .OR.
155 & (PRSO.EQ.PRSI).OR.NOTHIS(PRSO).OR.
156 & (AND(OFLAG1(PRSO),VISIBT).EQ.0)) GO TO 2500
157 F=.FALSE.
158 CALL RSPSUB(580,ODESC2(PRSO))
159 F1=PUT(.TRUE.)
160 IF(SAVEH.NE.HERE) GO TO 4500
161 2500 CONTINUE
162 GO TO 4000
163
164
165
166 3000 I=677
167 GO TO 4500
168
169
170
171 4000 I=581
172 IF(SAVEP.EQ.VALUA) I=582
173 4500 IF(F) CALL RSPEAK(I)
174 PRSO=SAVEP
175 BUNSUB=0
176 RETURN
177
178
179
180
181
182
183 LOGICAL QBUNCH(OBJ)
184 IMPLICIT INTEGER (A-Z)
185 %include dparam
186
187 IF(BUNLNT.EQ.0) GO TO 200
188 QBUNCH=.TRUE.
189 DO 100 I=1,BUNLNT
190 IF(OBJ.EQ.BUNVEC(I)) RETURN
191 100 CONTINUE
192 200 QBUNCH=.FALSE.
193 RETURN
194
195
196
197
198
199
200
201 SAVEGM
202 IMPLICIT INTEGER (A-Z)
203 %include dparam
204
205 IF(SUBLNT.EQ.0) SUBBUF='DSAVE.DAT'
206
207
208 OPEN (UNIT=1,FILE=SUBBUF,ACCESS='SEQUENTIAL',
209 & STATUS='UNKNOWN',FORM='UNFORMATTED',ERR=100)
210
211 CALL GTTIME(I)
212 WRITE(1) VMAJ,VMIN
213 WRITE(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
214 & SWDACT,SWDSTA,CPVEC
215 WRITE(1) I,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
216 & LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
217 WRITE(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
218 & OSIZE,OCAPAC,OROOM,OADV,OCAN
219 WRITE(1) RDESC1,RVAL,RFLAG,TRAVEL
220 WRITE(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
221 WRITE(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK,CCNCEL
222
223 CALL RSPEAK(597)
224 CLOSE (UNIT=1)
225 RETURN
226
227 100 CALL RSPEAK(598)
228 RETURN
229
230
231
232
233
234
235 RSTRGM
236 IMPLICIT INTEGER (A-Z)
237 %include dparam
238
239 IF(SUBLNT.EQ.0) SUBBUF='DSAVE.DAT'
240
241
242 OPEN (UNIT=1,FILE=SUBBUF,ACCESS='SEQUENTIAL',
243 & STATUS='OLD',FORM='UNFORMATTED',ERR=100)
244
245 READ(1) I,J
246 IF((I.NE.VMAJ).OR.(J.NE.VMIN)) GO TO 200
247
248 READ(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
249 & SWDACT,SWDSTA,CPVEC
250 READ(1) PLTIME,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
251 & LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
252 READ(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
253 & OSIZE,OCAPAC,OROOM,OADV,OCAN
254 READ(1) RDESC1,RVAL,RFLAG,TRAVEL
255 READ(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
256 READ(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK,CCNCEL
257
258 CALL RSPEAK(599)
259 CLOSE (UNIT=1)
260 RETURN
261
262 100 CALL RSPEAK(598)
263 RETURN
264
265 200 CALL RSPEAK(600)
266 CLOSE (UNIT=1)
267 RETURN
268
269
270
271
272
273
274 LOGICAL WALK(X)
275 IMPLICIT INTEGER (A-Z)
276 %include dparam
277 LOGICAL FINDXT,QOPEN,LIT,PROB,MOVETO,RMDESC
278
279
280
281
282 QOPEN(O)=AND(OFLAG2(O),OPENBT).NE.0
283
284
285
286 WALK=.TRUE.
287 IF((WINNER.NE.PLAYER).OR.LIT(HERE).OR.PROB(25,25))
288 & GO TO 500
289 IF(.NOT.FINDXT(PRSO,HERE)) GO TO 450
290 GO TO (400,200,100,300),XTYPE
291 CALL BUG(9,XTYPE)
292
293 100 IF(CXAPPL(XACTIO).NE.0) GO TO 400
294 IF(FLAGS(XFLAG)) GO TO 400
295 200 CALL JIGSUP(523)
296 RETURN
297
298 300 IF(CXAPPL(XACTIO).NE.0) GO TO 400
299 IF(QOPEN(XOBJ)) GO TO 400
300 CALL JIGSUP(523)
301 RETURN
302
303 400 IF(LIT(XROOM1)) GO TO 900
304 450 CALL JIGSUP(522)
305 RETURN
306
307
308
309 500 IF(FINDXT(PRSO,HERE)) GO TO 550
310 525 XSTRNG=678
311 IF(PRSO.EQ.XUP) XSTRNG=679
312 IF(PRSO.EQ.XDOWN) XSTRNG=680
313
314
315 IF((AND(RFLAG(HERE),RNWALL).NE.0).AND.(WINNER.EQ.PLAYER))
316 & XSTRNG=524
317 CALL RSPEAK(XSTRNG)
318 PRSCON=0
319 RETURN
320
321 550 GO TO (900,600,700,800),XTYPE
322 CALL BUG(9,XTYPE)
323
324 700 IF(CXAPPL(XACTIO).NE.0) GO TO 900
325 IF(FLAGS(XFLAG)) GO TO 900
326 600 IF(XSTRNG.EQ.0) GO TO 525
327 CALL RSPEAK(XSTRNG)
328 PRSCON=0
329 RETURN
330
331 800 IF(CXAPPL(XACTIO).NE.0) GO TO 900
332 IF(QOPEN(XOBJ)) GO TO 900
333 IF(XSTRNG.EQ.0) XSTRNG=525
334 CALL RSPSUB(XSTRNG,ODESC2(XOBJ))
335 PRSCON=0
336 RETURN
337
338 900 WALK=MOVETO(XROOM1,WINNER)
339 IF(WALK) WALK=RMDESC(0)
340 RETURN
341