xref: /csrg-svn/contrib/dungeon/sverbs.F (revision 35973)
1*35973SbosticC SVERBS-	SIMPLE VERBS PROCESSOR
2*35973SbosticC	ALL VERBS IN THIS ROUTINE MUST BE INDEPENDANT
3*35973SbosticC	OF OBJECT ACTIONS
4*35973SbosticC
5*35973SbosticC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
6*35973SbosticC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
7*35973SbosticC WRITTEN BY R. M. SUPNIK
8*35973SbosticC
9*35973SbosticC DECLARATIONS
10*35973SbosticC
11*35973Sbostic	LOGICAL FUNCTION SVERBS(RI)
12*35973Sbostic	IMPLICIT INTEGER (A-Z)
13*35973Sbostic	LOGICAL MOVETO,YESNO
14*35973Sbostic	LOGICAL RMDESC
15*35973Sbostic	LOGICAL QOPEN
16*35973Sbostic	LOGICAL FINDXT,QHERE,F
17*35973Sbostic	INTEGER JOKES(25)
18*35973Sbostic	CHARACTER ANSSTR(78)
19*35973Sbostic	CHARACTER PP1(6),PP2(6),CH(6)
20*35973Sbostic	INTEGER ANSWER(28)
21*35973Sbostic#include "parser.h"
22*35973Sbostic#include "gamestate.h"
23*35973Sbostic#include "state.h"
24*35973Sbostic#include "screen.h"
25*35973SbosticC
26*35973SbosticC MISCELLANEOUS VARIABLES
27*35973SbosticC
28*35973Sbostic	CHARACTER VEDIT
29*35973Sbostic	COMMON /VERS/ VMAJ,VMIN,VEDIT
30*35973Sbostic#include "io.h"
31*35973Sbostic#include "rooms.h"
32*35973Sbostic#include "rflag.h"
33*35973Sbostic#include "rindex.h"
34*35973Sbostic#include "exits.h"
35*35973Sbostic#include "curxt.h"
36*35973Sbostic#include "xpars.h"
37*35973Sbostic#include "xsrch.h"
38*35973Sbostic#include "objects.h"
39*35973Sbostic#include "oflags.h"
40*35973Sbostic#include "oindex.h"
41*35973Sbostic#include "clock.h"
42*35973Sbostic
43*35973Sbostic#include "advers.h"
44*35973Sbostic#include "verbs.h"
45*35973Sbostic#include "flags.h"
46*35973SbosticC
47*35973SbosticC FUNCTIONS AND DATA
48*35973SbosticC
49*35973Sbostic	QOPEN(R)=and(OFLAG2(R),OPENBT).NE.0
50*35973Sbostic	DATA MXNOP/39/,MXJOKE/64/
51*35973Sbostic	DATA JOKES/4,5,3,304,305,306,307,308,309,310,311,312,
52*35973Sbostic&		313,5314,5319,324,325,883,884,120,120,0,0,0,0/
53*35973Sbostic	DATA ANSWER/0,6,1,6,2,5,3,5,4,3,4,6,4,6,4,5,
54*35973Sbostic&		5,5,5,4,5,6,6,10,7,4,7,6/
55*35973Sbostic	DATA ANSSTR/'T','E','M','P','L','E',
56*35973Sbostic&		'F','O','R','E','S','T',
57*35973Sbostic&		'3','0','0','0','3',
58*35973Sbostic&		'F','L','A','S','K',
59*35973Sbostic&		'R','U','B',
60*35973Sbostic&		'F','O','N','D','L','E',
61*35973Sbostic&		'C','A','R','R','E','S',
62*35973Sbostic&		'T','O','U','C','H',
63*35973Sbostic&		'B','O','N','E','S',
64*35973Sbostic&		'B','O','D','Y',
65*35973Sbostic&		'S','K','E','L','E','T',
66*35973Sbostic&		'R','U','S','T','Y','K','N','I','F','E',
67*35973Sbostic&		'N','O','N','E',
68*35973Sbostic&		'N','O','W','H','E','R','\0'/
69*35973SbosticC SVERBS, PAGE 2
70*35973SbosticC
71*35973Sbostic	SVERBS=.TRUE.
72*35973SbosticC						!ASSUME WINS.
73*35973Sbostic	IF(PRSO.NE.0) ODO2=ODESC2(PRSO)
74*35973SbosticC						!SET UP DESCRIPTORS.
75*35973Sbostic	IF(PRSI.NE.0) ODI2=ODESC2(PRSI)
76*35973SbosticC
77*35973Sbostic	IF(RI.EQ.0) CALL BUG(7,RI)
78*35973SbosticC						!ZERO IS VERBOTEN.
79*35973Sbostic	IF(RI.LE.MXNOP) RETURN
80*35973SbosticC						!NOP?
81*35973Sbostic	IF(RI.LE.MXJOKE) GO TO 100
82*35973SbosticC						!JOKE?
83*35973Sbostic	GO TO (65000,66000,67000,68000,69000,
84*35973Sbostic&	 1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,
85*35973Sbostic&	 11000,12000,13000,14000,15000,16000,17000,18000,19000,20000,
86*35973Sbostic&	 21000,22000,23000,24000,25000,26000,27000),
87*35973Sbostic&		(RI-MXJOKE)
88*35973Sbostic	CALL BUG(7,RI)
89*35973SbosticC
90*35973SbosticC ALL VERB PROCESSORS RETURN HERE TO DECLARE FAILURE.
91*35973SbosticC
92*35973Sbostic10	SVERBS=.FALSE.
93*35973SbosticC						!LOSE.
94*35973Sbostic	RETURN
95*35973SbosticC
96*35973SbosticC JOKE PROCESSOR.
97*35973SbosticC FIND PROPER ENTRY IN JOKES, USE IT TO SELECT STRING TO PRINT.
98*35973SbosticC
99*35973Sbostic100	I=JOKES(RI-MXNOP)
100*35973SbosticC						!GET TABLE ENTRY.
101*35973Sbostic	J=I/1000
102*35973SbosticC						!ISOLATE # STRINGS.
103*35973Sbostic	IF(J.NE.0) I=MOD(I,1000)+RND(J)
104*35973SbosticC						!IF RANDOM, CHOOSE.
105*35973Sbostic	CALL RSPEAK(I)
106*35973SbosticC						!PRINT JOKE.
107*35973Sbostic	RETURN
108*35973SbosticC SVERBS, PAGE 2A
109*35973SbosticC
110*35973SbosticC V65--	ROOM
111*35973SbosticC
112*35973Sbostic65000	SVERBS=RMDESC(2)
113*35973SbosticC						!DESCRIBE ROOM ONLY.
114*35973Sbostic	RETURN
115*35973SbosticC
116*35973SbosticC V66--	OBJECTS
117*35973SbosticC
118*35973Sbostic66000	SVERBS=RMDESC(1)
119*35973SbosticC						!DESCRIBE OBJ ONLY.
120*35973Sbostic	IF(.NOT.TELFLG) CALL RSPEAK(138)
121*35973SbosticC						!NO OBJECTS.
122*35973Sbostic	RETURN
123*35973SbosticC
124*35973SbosticC V67--	RNAME
125*35973SbosticC
126*35973Sbostic67000	CALL RSPEAK(RDESC2-HERE)
127*35973SbosticC						!SHORT ROOM NAME.
128*35973Sbostic	RETURN
129*35973SbosticC
130*35973SbosticC V68--	RESERVED
131*35973SbosticC
132*35973Sbostic68000	RETURN
133*35973SbosticC
134*35973SbosticC V69--	RESERVED
135*35973SbosticC
136*35973Sbostic69000	RETURN
137*35973SbosticC SVERBS, PAGE 3
138*35973SbosticC
139*35973SbosticC V70--	BRIEF.  SET FLAG.
140*35973SbosticC
141*35973Sbostic1000	BRIEFF=.TRUE.
142*35973SbosticC						!BRIEF DESCRIPTIONS.
143*35973Sbostic	SUPERF=.FALSE.
144*35973Sbostic	CALL RSPEAK(326)
145*35973Sbostic	RETURN
146*35973SbosticC
147*35973SbosticC V71--	VERBOSE.  CLEAR FLAGS.
148*35973SbosticC
149*35973Sbostic2000	BRIEFF=.FALSE.
150*35973SbosticC						!LONG DESCRIPTIONS.
151*35973Sbostic	SUPERF=.FALSE.
152*35973Sbostic	CALL RSPEAK(327)
153*35973Sbostic	RETURN
154*35973SbosticC
155*35973SbosticC V72--	SUPERBRIEF.  SET FLAG.
156*35973SbosticC
157*35973Sbostic3000	SUPERF=.TRUE.
158*35973Sbostic	CALL RSPEAK(328)
159*35973Sbostic	RETURN
160*35973SbosticC
161*35973SbosticC V73-- STAY (USED IN ENDGAME).
162*35973SbosticC
163*35973Sbostic4000	IF(WINNER.NE.AMASTR) GO TO 4100
164*35973SbosticC						!TELL MASTER, STAY.
165*35973Sbostic	CALL RSPEAK(781)
166*35973SbosticC						!HE DOES.
167*35973Sbostic	CTICK(CEVFOL)=0
168*35973SbosticC						!NOT FOLLOWING.
169*35973Sbostic	RETURN
170*35973SbosticC
171*35973Sbostic4100	IF(WINNER.EQ.PLAYER) CALL RSPEAK(664)
172*35973SbosticC						!JOKE.
173*35973Sbostic	RETURN
174*35973SbosticC
175*35973SbosticC V74--	VERSION.  PRINT INFO.
176*35973SbosticC
177*35973Sbostic#ifdef PDP
178*35973Sbostic5000	call prvers(vmaj,vmin,vedit)
179*35973Sbostic#else
180*35973Sbostic5000	WRITE(OUTCH,5010) VMAJ,VMIN,VEDIT
181*35973Sbostic#ifdef NOCC
182*35973Sbostic5010	FORMAT('V',I1,'.',I2,A1)
183*35973Sbostic#else NOCC
184*35973Sbostic5010	FORMAT(' V',I1,'.',I2,A1)
185*35973Sbostic#endif NOCC
186*35973Sbostic#endif PDP
187*35973Sbostic	TELFLG=.TRUE.
188*35973Sbostic	RETURN
189*35973SbosticC
190*35973SbosticC V75--	SWIM.  ALWAYS A JOKE.
191*35973SbosticC
192*35973Sbostic6000	I=330
193*35973SbosticC						!ASSUME WATER.
194*35973Sbostic	IF(and(RFLAG(HERE),(RWATER+RFILL)).EQ.0)
195*35973Sbostic&		I=331+RND(3)
196*35973Sbostic	CALL RSPEAK(I)
197*35973Sbostic	RETURN
198*35973SbosticC
199*35973SbosticC V76--	GERONIMO.  IF IN BARREL, FATAL, ELSE JOKE.
200*35973SbosticC
201*35973Sbostic7000	IF(HERE.EQ.MBARR) GO TO 7100
202*35973SbosticC						!IN BARREL?
203*35973Sbostic	CALL RSPEAK(334)
204*35973SbosticC						!NO, JOKE.
205*35973Sbostic	RETURN
206*35973SbosticC
207*35973Sbostic7100	CALL JIGSUP(335)
208*35973SbosticC						!OVER FALLS.
209*35973Sbostic	RETURN
210*35973SbosticC
211*35973SbosticC V77--	SINBAD ET AL.  CHASE CYCLOPS, ELSE JOKE.
212*35973SbosticC
213*35973Sbostic8000	IF((HERE.EQ.MCYCL).AND.QHERE(CYCLO,HERE)) GO TO 8100
214*35973Sbostic	CALL RSPEAK(336)
215*35973SbosticC						!NOT HERE, JOKE.
216*35973Sbostic	RETURN
217*35973SbosticC
218*35973Sbostic8100	CALL NEWSTA(CYCLO,337,0,0,0)
219*35973SbosticC						!CYCLOPS FLEES.
220*35973Sbostic	CYCLOF=.TRUE.
221*35973SbosticC						!SET ALL FLAGS.
222*35973Sbostic	MAGICF=.TRUE.
223*35973Sbostic	OFLAG2(CYCLO)=and(OFLAG2(CYCLO), not(FITEBT))
224*35973Sbostic	RETURN
225*35973SbosticC
226*35973SbosticC V78--	WELL.  OPEN DOOR, ELSE JOKE.
227*35973SbosticC
228*35973Sbostic9000	IF(RIDDLF.OR.(HERE.NE.RIDDL)) GO TO 9100
229*35973SbosticC						!IN RIDDLE ROOM?
230*35973Sbostic	RIDDLF=.TRUE.
231*35973SbosticC						!YES, SOLVED IT.
232*35973Sbostic	CALL RSPEAK(338)
233*35973Sbostic	RETURN
234*35973SbosticC
235*35973Sbostic9100	CALL RSPEAK(339)
236*35973SbosticC						!WELL, WHAT?
237*35973Sbostic	RETURN
238*35973SbosticC
239*35973SbosticC V79--	PRAY.  IF IN TEMP2, POOF
240*35973SbosticC						!
241*35973SbosticC
242*35973Sbostic10000	IF(HERE.NE.TEMP2) GO TO 10050
243*35973SbosticC						!IN TEMPLE?
244*35973Sbostic	IF(MOVETO(FORE1,WINNER)) GO TO 10100
245*35973SbosticC						!FORE1 STILL THERE?
246*35973Sbostic10050	CALL RSPEAK(340)
247*35973SbosticC						!JOKE.
248*35973Sbostic	RETURN
249*35973SbosticC
250*35973Sbostic10100	F=RMDESC(3)
251*35973SbosticC						!MOVED, DESCRIBE.
252*35973Sbostic	RETURN
253*35973SbosticC
254*35973SbosticC V80--	TREASURE.  IF IN TEMP1, POOF
255*35973SbosticC						!
256*35973SbosticC
257*35973Sbostic11000	IF(HERE.NE.TEMP1) GO TO 11050
258*35973SbosticC						!IN TEMPLE?
259*35973Sbostic	IF(MOVETO(TREAS,WINNER)) GO TO 10100
260*35973SbosticC						!TREASURE ROOM THERE?
261*35973Sbostic11050	CALL RSPEAK(341)
262*35973SbosticC						!NOTHING HAPPENS.
263*35973Sbostic	RETURN
264*35973SbosticC
265*35973SbosticC V81--	TEMPLE.  IF IN TREAS, POOF
266*35973SbosticC						!
267*35973SbosticC
268*35973Sbostic12000	IF(HERE.NE.TREAS) GO TO 12050
269*35973SbosticC						!IN TREASURE?
270*35973Sbostic	IF(MOVETO(TEMP1,WINNER)) GO TO 10100
271*35973SbosticC						!TEMP1 STILL THERE?
272*35973Sbostic12050	CALL RSPEAK(341)
273*35973SbosticC						!NOTHING HAPPENS.
274*35973Sbostic	RETURN
275*35973SbosticC
276*35973SbosticC V82--	BLAST.  USUALLY A JOKE.
277*35973SbosticC
278*35973Sbostic13000	I=342
279*35973SbosticC						!DONT UNDERSTAND.
280*35973Sbostic	IF(PRSO.EQ.SAFE) I=252
281*35973SbosticC						!JOKE FOR SAFE.
282*35973Sbostic	CALL RSPEAK(I)
283*35973Sbostic	RETURN
284*35973SbosticC
285*35973SbosticC V83--	SCORE.  PRINT SCORE.
286*35973SbosticC
287*35973Sbostic14000	CALL SCORE(.FALSE.)
288*35973Sbostic	RETURN
289*35973SbosticC
290*35973SbosticC V84--	QUIT.  FINISH OUT THE GAME.
291*35973SbosticC
292*35973Sbostic15000	CALL SCORE(.TRUE.)
293*35973SbosticC						!TELLL SCORE.
294*35973Sbostic	IF(.NOT.YESNO(343,0,0)) RETURN
295*35973SbosticC						!ASK FOR Y/N DECISION.
296*35973Sbostic#ifdef PDP
297*35973SbosticC	close routine moved to exit for pdp version
298*35973Sbostic#else
299*35973Sbostic	CLOSE (DBCH)
300*35973Sbostic#endif PDP
301*35973Sbostic	CALL EXIT
302*35973SbosticC						!BYE.
303*35973SbosticC SVERBS, PAGE 4
304*35973SbosticC
305*35973SbosticC V85--	FOLLOW (USED IN ENDGAME)
306*35973SbosticC
307*35973Sbostic16000	IF(WINNER.NE.AMASTR) RETURN
308*35973SbosticC						!TELL MASTER, FOLLOW.
309*35973Sbostic	CALL RSPEAK(782)
310*35973Sbostic	CTICK(CEVFOL)=-1
311*35973SbosticC						!STARTS FOLLOWING.
312*35973Sbostic	RETURN
313*35973SbosticC
314*35973SbosticC V86--	WALK THROUGH
315*35973SbosticC
316*35973Sbostic17000	IF((SCOLRM.EQ.0).OR.((PRSO.NE.SCOL).AND.
317*35973Sbostic&		((PRSO.NE.WNORT).OR.(HERE.NE.BKBOX)))) GO TO 17100
318*35973Sbostic	SCOLAC=SCOLRM
319*35973SbosticC						!WALKED THRU SCOL.
320*35973Sbostic	PRSO=0
321*35973SbosticC						!FAKE OUT FROMDR.
322*35973Sbostic	CTICK(CEVSCL)=6
323*35973SbosticC						!START ALARM.
324*35973Sbostic	CALL RSPEAK(668)
325*35973SbosticC						!DISORIENT HIM.
326*35973Sbostic	F=MOVETO(SCOLRM,WINNER)
327*35973SbosticC						!INTO ROOM.
328*35973Sbostic	F=RMDESC(3)
329*35973SbosticC						!DESCRIBE.
330*35973Sbostic	RETURN
331*35973SbosticC
332*35973Sbostic17100	IF(HERE.NE.SCOLAC) GO TO 17300
333*35973SbosticC						!ON OTHER SIDE OF SCOL?
334*35973Sbostic	DO 17200 I=1,12,3
335*35973SbosticC						!WALK THRU PROPER WALL?
336*35973Sbostic	  IF((SCOLWL(I).EQ.HERE).AND.(SCOLWL(I+1).EQ.PRSO))
337*35973Sbostic&		GO TO 17500
338*35973Sbostic17200	CONTINUE
339*35973SbosticC
340*35973Sbostic17300	IF(and(OFLAG1(PRSO),TAKEBT).NE.0) GO TO 17400
341*35973Sbostic	I=669
342*35973SbosticC						!NO, JOKE.
343*35973Sbostic	IF(PRSO.EQ.SCOL) I=670
344*35973SbosticC						!SPECIAL JOKE FOR SCOL.
345*35973Sbostic	CALL RSPSUB(I,ODO2)
346*35973Sbostic	RETURN
347*35973SbosticC
348*35973Sbostic17400	I=671
349*35973SbosticC						!JOKE.
350*35973Sbostic	IF(OROOM(PRSO).NE.0) I=552+RND(5)
351*35973SbosticC						!SPECIAL JOKES IF CARRY.
352*35973Sbostic	CALL RSPEAK(I)
353*35973Sbostic	RETURN
354*35973SbosticC
355*35973Sbostic17500	PRSO=SCOLWL(I+2)
356*35973SbosticC						!THRU SCOL WALL...
357*35973Sbostic	DO 17600 I=1,8,2
358*35973SbosticC						!FIND MATCHING ROOM.
359*35973Sbostic	  IF(PRSO.EQ.SCOLDR(I)) SCOLRM=SCOLDR(I+1)
360*35973Sbostic17600	CONTINUE
361*35973SbosticC						!DECLARE NEW SCOLRM.
362*35973Sbostic	CTICK(CEVSCL)=0
363*35973SbosticC						!CANCEL ALARM.
364*35973Sbostic	CALL RSPEAK(668)
365*35973SbosticC						!DISORIENT HIM.
366*35973Sbostic	F=MOVETO(BKBOX,WINNER)
367*35973SbosticC						!BACK IN BOX ROOM.
368*35973Sbostic	F=RMDESC(3)
369*35973Sbostic	RETURN
370*35973SbosticC
371*35973SbosticC V87--	RING.  A JOKE.
372*35973SbosticC
373*35973Sbostic18000	I=359
374*35973SbosticC						!CANT RING.
375*35973Sbostic	IF(PRSO.EQ.BELL) I=360
376*35973SbosticC						!DING, DONG.
377*35973Sbostic	CALL RSPEAK(I)
378*35973SbosticC						!JOKE.
379*35973Sbostic	RETURN
380*35973SbosticC
381*35973SbosticC V88--	BRUSH.  JOKE WITH OBSCURE TRAP.
382*35973SbosticC
383*35973Sbostic19000	IF(PRSO.EQ.TEETH) GO TO 19100
384*35973SbosticC						!BRUSH TEETH?
385*35973Sbostic	CALL RSPEAK(362)
386*35973SbosticC						!NO, JOKE.
387*35973Sbostic	RETURN
388*35973SbosticC
389*35973Sbostic19100	IF(PRSI.NE.0) GO TO 19200
390*35973SbosticC						!WITH SOMETHING?
391*35973Sbostic	CALL RSPEAK(363)
392*35973SbosticC						!NO, JOKE.
393*35973Sbostic	RETURN
394*35973SbosticC
395*35973Sbostic19200	IF((PRSI.EQ.PUTTY).AND.(OADV(PUTTY).EQ.WINNER))
396*35973Sbostic&		GO TO 19300
397*35973Sbostic	CALL RSPSUB(364,ODI2)
398*35973SbosticC						!NO, JOKE.
399*35973Sbostic	RETURN
400*35973SbosticC
401*35973Sbostic19300	CALL JIGSUP(365)
402*35973SbosticC						!YES, DEAD
403*35973SbosticC						!
404*35973SbosticC						!
405*35973SbosticC						!
406*35973SbosticC						!
407*35973SbosticC						!
408*35973Sbostic	RETURN
409*35973SbosticC SVERBS, PAGE 5
410*35973SbosticC
411*35973SbosticC V89--	DIG.  UNLESS SHOVEL, A JOKE.
412*35973SbosticC
413*35973Sbostic20000	IF(PRSO.EQ.SHOVE) RETURN
414*35973SbosticC						!SHOVEL?
415*35973Sbostic	I=392
416*35973SbosticC						!ASSUME TOOL.
417*35973Sbostic	IF(and(OFLAG1(PRSO),TOOLBT).EQ.0) I=393
418*35973Sbostic	CALL RSPSUB(I,ODO2)
419*35973Sbostic	RETURN
420*35973SbosticC
421*35973SbosticC V90--	TIME.  PRINT OUT DURATION OF GAME.
422*35973SbosticC
423*35973Sbostic#ifdef PDP
424*35973SbosticC	no duration time available for pdp version (removed
425*35973SbosticC	to make things fit)
426*35973Sbostic21000	TELFLG=.TRUE.
427*35973Sbostic	RETURN
428*35973Sbostic#else
429*35973Sbostic21000	CALL GTTIME(K)
430*35973SbosticC						!GET PLAY TIME.
431*35973Sbostic	I=K/60
432*35973Sbostic	J=MOD(K,60)
433*35973SbosticC
434*35973Sbostic#ifdef NOCC
435*35973Sbostic	IF(I.EQ.0.AND.J.EQ.1) WRITE(OUTCH,21010) J
436*35973Sbostic	IF(I.EQ.0.AND.J.NE.1) WRITE(OUTCH,21011) J
437*35973Sbostic	IF(I.EQ.1.AND.J.EQ.1) WRITE(OUTCH,21012) I,J
438*35973Sbostic	IF(I.EQ.1.AND.J.NE.1) WRITE(OUTCH,21013) I,J
439*35973Sbostic	IF(I.GE.2.AND.J.EQ.1) WRITE(OUTCH,21014) I,J
440*35973Sbostic	IF(I.GE.2.AND.J.NE.1) WRITE(OUTCH,21015) I,J
441*35973Sbostic	TELFLG=.TRUE.
442*35973Sbostic	RETURN
443*35973SbosticC
444*35973Sbostic21010	FORMAT('You have been playing Dungeon for ',I2,' minute.')
445*35973Sbostic21011	FORMAT('You have been playing Dungeon for ',I2,' minutes.')
446*35973Sbostic21012	FORMAT('You have been playing Dungeon for ',I3,' hour and ',
447*35973Sbostic&		I2,' minute.')
448*35973Sbostic21013	FORMAT('You have been playing Dungeon for ',I3,' hour and ',
449*35973Sbostic&		I2,' minutes.')
450*35973Sbostic21014	FORMAT('You have been playing Dungeon for ',I3,' hours and ',
451*35973Sbostic&		I2,' minute.')
452*35973Sbostic21015	FORMAT('You have been playing Dungeon for ',I3,' hours and ',
453*35973Sbostic&		I2,' minutes.')
454*35973Sbostic#else NOCC
455*35973Sbostic	WRITE(OUTCH,21010)
456*35973Sbostic	IF(I.NE.0) WRITE(OUTCH,21011) I
457*35973Sbostic	IF(I.GE.2) WRITE(OUTCH,21012)
458*35973Sbostic	IF(I.EQ.1) WRITE(OUTCH,21013)
459*35973Sbostic	IF(J.EQ.1) WRITE(OUTCH,21014) J
460*35973Sbostic	IF(J.NE.1) WRITE(OUTCH,21015) J
461*35973Sbostic	TELFLG=.TRUE.
462*35973Sbostic	RETURN
463*35973SbosticC
464*35973Sbostic21010	FORMAT(' You have been playing Dungeon for ',$)
465*35973Sbostic21011	FORMAT('+',I3,' hour',$)
466*35973Sbostic21012	FORMAT('+s and ',$)
467*35973Sbostic21013	FORMAT('+ and ',$)
468*35973Sbostic21014	FORMAT('+',I2,' minute.')
469*35973Sbostic21015	FORMAT('+',I2,' minutes.')
470*35973Sbostic#endif NOCC
471*35973Sbostic#endif PDP
472*35973SbosticC
473*35973SbosticC V91--	LEAP.  USUALLY A JOKE, WITH A CATCH.
474*35973SbosticC
475*35973Sbostic22000	IF(PRSO.EQ.0) GO TO 22200
476*35973SbosticC						!OVER SOMETHING?
477*35973Sbostic	IF(QHERE(PRSO,HERE)) GO TO 22100
478*35973SbosticC						!HERE?
479*35973Sbostic	CALL RSPEAK(447)
480*35973SbosticC						!NO, JOKE.
481*35973Sbostic	RETURN
482*35973SbosticC
483*35973Sbostic22100	IF(and(OFLAG2(PRSO),VILLBT).EQ.0) GO TO 22300
484*35973Sbostic	CALL RSPSUB(448,ODO2)
485*35973SbosticC						!CANT JUMP VILLAIN.
486*35973Sbostic	RETURN
487*35973SbosticC
488*35973Sbostic22200	IF(.NOT.FINDXT(XDOWN,HERE)) GO TO 22300
489*35973SbosticC						!DOWN EXIT?
490*35973Sbostic	IF((XTYPE.EQ.XNO).OR.((XTYPE.EQ.XCOND).AND.
491*35973Sbostic&		.NOT.FLAGS(XFLAG))) GO TO 22400
492*35973Sbostic22300	CALL RSPEAK(314+RND(5))
493*35973SbosticC						!WHEEEE
494*35973SbosticC						!
495*35973Sbostic	RETURN
496*35973SbosticC
497*35973Sbostic22400	CALL JIGSUP(449+RND(4))
498*35973SbosticC						!FATAL LEAP.
499*35973Sbostic	RETURN
500*35973SbosticC SVERBS, PAGE 6
501*35973SbosticC
502*35973SbosticC V92--	LOCK.
503*35973SbosticC
504*35973Sbostic23000	IF((PRSO.EQ.GRATE).AND.(HERE.EQ.MGRAT))
505*35973Sbostic&		GO TO 23200
506*35973Sbostic23100	CALL RSPEAK(464)
507*35973SbosticC						!NOT LOCK GRATE.
508*35973Sbostic	RETURN
509*35973SbosticC
510*35973Sbostic23200	GRUNLF=.FALSE.
511*35973SbosticC						!GRATE NOW LOCKED.
512*35973Sbostic	CALL RSPEAK(214)
513*35973Sbostic	TRAVEL(REXIT(HERE)+1)=214
514*35973SbosticC						!CHANGE EXIT STATUS.
515*35973Sbostic	RETURN
516*35973SbosticC
517*35973SbosticC V93--	UNLOCK
518*35973SbosticC
519*35973Sbostic24000	IF((PRSO.NE.GRATE).OR.(HERE.NE.MGRAT))
520*35973Sbostic&		GO TO 23100
521*35973Sbostic	IF(PRSI.EQ.KEYS) GO TO 24200
522*35973SbosticC						!GOT KEYS?
523*35973Sbostic	CALL RSPSUB(465,ODI2)
524*35973SbosticC						!NO, JOKE.
525*35973Sbostic	RETURN
526*35973SbosticC
527*35973Sbostic24200	GRUNLF=.TRUE.
528*35973SbosticC						!UNLOCK GRATE.
529*35973Sbostic	CALL RSPEAK(217)
530*35973Sbostic	TRAVEL(REXIT(HERE)+1)=217
531*35973SbosticC						!CHANGE EXIT STATUS.
532*35973Sbostic	RETURN
533*35973SbosticC
534*35973SbosticC V94--	DIAGNOSE.
535*35973SbosticC
536*35973Sbostic25000	I=FIGHTS(WINNER,.FALSE.)
537*35973SbosticC						!GET FIGHTS STRENGTH.
538*35973Sbostic	J=ASTREN(WINNER)
539*35973SbosticC						!GET HEALTH.
540*35973Sbostic	K=MIN0(I+J,4)
541*35973SbosticC						!GET STATE.
542*35973Sbostic	IF(.NOT.CFLAG(CEVCUR)) J=0
543*35973SbosticC						!IF NO WOUNDS.
544*35973Sbostic	L=MIN0(4,IABS(J))
545*35973SbosticC						!SCALE.
546*35973Sbostic	CALL RSPEAK(473+L)
547*35973SbosticC						!DESCRIBE HEALTH.
548*35973Sbostic	I=(30*(-J-1))+CTICK(CEVCUR)
549*35973SbosticC						!COMPUTE WAIT.
550*35973SbosticC
551*35973Sbostic#ifdef PDP
552*35973Sbostic	if(J .ne. 0) call cured(I)
553*35973Sbostic#else
554*35973Sbostic 	IF(J.NE.0) WRITE(OUTCH,25100) I
555*35973Sbostic#ifdef NOCC
556*35973Sbostic25100	FORMAT('You will be cured after ',I3,' moves.')
557*35973Sbostic#else NOCC
558*35973Sbostic25100	FORMAT(' You will be cured after ',I3,' moves.')
559*35973Sbostic#endif NOCC
560*35973Sbostic#endif PDP
561*35973SbosticC
562*35973Sbostic	CALL RSPEAK(478+K)
563*35973SbosticC						!HOW MUCH MORE?
564*35973Sbostic	IF(DEATHS.NE.0) CALL RSPEAK(482+DEATHS)
565*35973SbosticC						!HOW MANY DEATHS?
566*35973Sbostic	RETURN
567*35973SbosticC SVERBS, PAGE 7
568*35973SbosticC
569*35973SbosticC V95--	INCANT
570*35973SbosticC
571*35973Sbostic26000	DO 26100 I=1,6
572*35973SbosticC						!SET UP PARSE.
573*35973Sbostic	  PP1(I)=' '
574*35973Sbostic	  PP2(I)=' '
575*35973Sbostic26100	CONTINUE
576*35973Sbostic	WP=1
577*35973SbosticC						!WORD POINTER.
578*35973Sbostic	CP=1
579*35973SbosticC						!CHAR POINTER.
580*35973Sbostic	IF(PRSCON.LE.1) GO TO 26300
581*35973Sbostic	DO 26200 I=PRSCON,INLNT
582*35973SbosticC						!PARSE INPUT
583*35973Sbostic	  IF(INBUF(I).EQ.',') GO TO 26300
584*35973SbosticC						!END OF PHRASE?
585*35973Sbostic	  IF(INBUF(I).NE.' ') GO TO 26150
586*35973SbosticC						!SPACE?
587*35973Sbostic	  IF(CP.NE.1) WP=WP+1
588*35973Sbostic	  CP=1
589*35973Sbostic	  GO TO 26200
590*35973Sbostic26150	  IF(WP.EQ.1) PP1(CP)=INBUF(I)
591*35973SbosticC						!STUFF INTO HOLDER.
592*35973Sbostic	  IF(WP.EQ.2) PP2(CP)=INBUF(I)
593*35973Sbostic	  CP=MIN0(CP+1,6)
594*35973Sbostic26200	CONTINUE
595*35973SbosticC
596*35973Sbostic26300	PRSCON=1
597*35973SbosticC						!KILL REST OF LINE.
598*35973Sbostic	IF(PP1(1).NE.' ') GO TO 26400
599*35973SbosticC						!ANY INPUT?
600*35973Sbostic	CALL RSPEAK(856)
601*35973SbosticC						!NO, HO HUM.
602*35973Sbostic	RETURN
603*35973SbosticC
604*35973Sbostic26400	CALL ENCRYP(PP1,CH)
605*35973SbosticC						!COMPUTE RESPONSE.
606*35973Sbostic	IF(PP2(1).NE.' ') GO TO 26600
607*35973SbosticC						!TWO PHRASES?
608*35973SbosticC
609*35973Sbostic	IF(SPELLF) GO TO 26550
610*35973SbosticC						!HE'S TRYING TO LEARN.
611*35973Sbostic	IF(and(RFLAG(TSTRS),RSEEN).EQ.0) GO TO 26575
612*35973Sbostic	SPELLF=.TRUE.
613*35973SbosticC						!TELL HIM.
614*35973Sbostic	TELFLG=.TRUE.
615*35973Sbostic#ifdef PDP
616*35973Sbostic	call voice(PP1,CH)
617*35973Sbostic#else
618*35973Sbostic  	WRITE(OUTCH,26510) PP1,CH
619*35973Sbostic#ifdef NOCC
620*35973Sbostic26510	FORMAT('A hollow voice replies:  "',6A1,1X,6A1,'".')
621*35973Sbostic#else NOCC
622*35973Sbostic26510	FORMAT(' A hollow voice replies:  "',6A1,1X,6A1,'".')
623*35973Sbostic#endif NOCC
624*35973Sbostic#endif PDP
625*35973SbosticC
626*35973Sbostic	RETURN
627*35973SbosticC
628*35973Sbostic26550	CALL RSPEAK(857)
629*35973SbosticC						!HE'S GOT ONE ALREADY.
630*35973Sbostic	RETURN
631*35973SbosticC
632*35973Sbostic26575	CALL RSPEAK(858)
633*35973SbosticC						!HE'S NOT IN ENDGAME.
634*35973Sbostic	RETURN
635*35973SbosticC
636*35973Sbostic26600	IF(and(RFLAG(TSTRS),RSEEN).NE.0) GO TO 26800
637*35973Sbostic	DO 26700 I=1,6
638*35973Sbostic	  IF(PP2(I).NE.CH(I)) GO TO 26575
639*35973SbosticC						!WRONG.
640*35973Sbostic26700	CONTINUE
641*35973Sbostic	SPELLF=.TRUE.
642*35973SbosticC						!IT WORKS.
643*35973Sbostic	CALL RSPEAK(859)
644*35973Sbostic	CTICK(CEVSTE)=1
645*35973SbosticC						!FORCE START.
646*35973Sbostic	RETURN
647*35973SbosticC
648*35973Sbostic26800	CALL RSPEAK(855)
649*35973SbosticC						!TOO LATE.
650*35973Sbostic	RETURN
651*35973SbosticC SVERBS, PAGE 8
652*35973SbosticC
653*35973SbosticC V96--	ANSWER
654*35973SbosticC
655*35973Sbostic27000	IF((PRSCON.GT.1).AND.
656*35973Sbostic&		(HERE.EQ.FDOOR).AND.INQSTF)
657*35973Sbostic&		GO TO 27100
658*35973Sbostic	CALL RSPEAK(799)
659*35973SbosticC						!NO ONE LISTENS.
660*35973Sbostic	PRSCON=1
661*35973Sbostic	RETURN
662*35973SbosticC
663*35973Sbostic27100	K=1
664*35973SbosticC						!POINTER INTO ANSSTR.
665*35973Sbostic	DO 27300 J=1,28,2
666*35973SbosticC						!CHECK ANSWERS.
667*35973Sbostic	  NEWK=K+ANSWER(J+1)
668*35973SbosticC						!COMPUTE NEXT K.
669*35973Sbostic	  IF(QUESNO.NE.ANSWER(J)) GO TO 27300
670*35973SbosticC						!ONLY CHECK PROPER ANS.
671*35973Sbostic	  I=PRSCON-1
672*35973SbosticC						!SCAN ANSWER.
673*35973Sbostic	  DO 27200 L=K,NEWK-1
674*35973Sbostic27150	    I=I+1
675*35973SbosticC						!SKIP INPUT BLANKS.
676*35973Sbostic	    IF(I.GT.INLNT) GO TO 27300
677*35973SbosticC						!END OF INPUT? LOSE.
678*35973Sbostic	    IF(INBUF(I).EQ.' ') GO TO 27150
679*35973Sbostic	    IF(INBUF(I).NE.ANSSTR(L)) GO TO 27300
680*35973Sbostic27200	  CONTINUE
681*35973Sbostic	  GO TO 27500
682*35973SbosticC						!RIGHT ANSWER.
683*35973Sbostic27300	K=NEWK
684*35973SbosticC
685*35973Sbostic	PRSCON=1
686*35973SbosticC						!KILL REST OF LINE.
687*35973Sbostic	NQATT=NQATT+1
688*35973SbosticC						!WRONG, CRETIN.
689*35973Sbostic	IF(NQATT.GE.5) GO TO 27400
690*35973SbosticC						!TOO MANY WRONG?
691*35973Sbostic	CALL RSPEAK(800+NQATT)
692*35973SbosticC						!NO, TRY AGAIN.
693*35973Sbostic	RETURN
694*35973SbosticC
695*35973Sbostic27400	CALL RSPEAK(826)
696*35973SbosticC						!ALL OVER.
697*35973Sbostic	CFLAG(CEVINQ)=.FALSE.
698*35973SbosticC						!LOSE.
699*35973Sbostic	RETURN
700*35973SbosticC
701*35973Sbostic27500	PRSCON=1
702*35973SbosticC						!KILL REST OF LINE.
703*35973Sbostic	CORRCT=CORRCT+1
704*35973SbosticC						!GOT IT RIGHT.
705*35973Sbostic	CALL RSPEAK(800)
706*35973SbosticC						!HOORAY.
707*35973Sbostic	IF(CORRCT.GE.3) GO TO 27600
708*35973SbosticC						!WON TOTALLY?
709*35973Sbostic	CTICK(CEVINQ)=2
710*35973SbosticC						!NO, START AGAIN.
711*35973Sbostic	QUESNO=MOD(QUESNO+3,8)
712*35973Sbostic	NQATT=0
713*35973Sbostic	CALL RSPEAK(769)
714*35973SbosticC						!ASK NEXT QUESTION.
715*35973Sbostic	CALL RSPEAK(770+QUESNO)
716*35973Sbostic	RETURN
717*35973SbosticC
718*35973Sbostic27600	CALL RSPEAK(827)
719*35973SbosticC						!QUIZ OVER,
720*35973Sbostic	CFLAG(CEVINQ)=.FALSE.
721*35973Sbostic	OFLAG2(QDOOR)=or(OFLAG2(QDOOR),OPENBT)
722*35973Sbostic	RETURN
723*35973SbosticC
724*35973Sbostic	END
725