1*35973SbosticC VAPPLI- MAIN VERB PROCESSING ROUTINE 2*35973SbosticC 3*35973SbosticC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142 4*35973SbosticC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED 5*35973SbosticC WRITTEN BY R. M. SUPNIK 6*35973SbosticC 7*35973SbosticC DECLARATIONS 8*35973SbosticC 9*35973Sbostic LOGICAL FUNCTION VAPPLI(RI) 10*35973Sbostic IMPLICIT INTEGER (A-Z) 11*35973Sbostic LOGICAL LIT,OBJACT 12*35973Sbostic LOGICAL QEMPTY,RMDESC,CLOCKD 13*35973Sbostic LOGICAL QOPEN,EDIBLE,DRKBLE 14*35973Sbostic LOGICAL TAKE,PUT,DROP,WALK 15*35973Sbostic LOGICAL QHERE,SVERBS,FINDXT,OAPPLI,F 16*35973Sbostic#include "parser.h" 17*35973Sbostic#include "gamestate.h" 18*35973Sbostic#include "state.h" 19*35973SbosticC 20*35973Sbostic COMMON /STAR/ MBASE,STRBIT 21*35973Sbostic#include "rooms.h" 22*35973Sbostic#include "rflag.h" 23*35973Sbostic#include "rindex.h" 24*35973Sbostic#include "xsrch.h" 25*35973Sbostic#include "objects.h" 26*35973Sbostic#include "oflags.h" 27*35973Sbostic#include "oindex.h" 28*35973Sbostic#include "advers.h" 29*35973Sbostic#include "verbs.h" 30*35973SbosticC 31*35973SbosticC FUNCTIONS AND DATA 32*35973SbosticC 33*35973Sbostic QOPEN(R)=and(OFLAG2(R),OPENBT).NE.0 34*35973Sbostic EDIBLE(R)=and(OFLAG1(R),FOODBT).NE.0 35*35973Sbostic DRKBLE(R)=and(OFLAG1(R),DRNKBT).NE.0 36*35973Sbostic DATA MXNOP/39/,MXSMP/99/ 37*35973SbosticC VAPPLI, PAGE 2 38*35973SbosticC 39*35973Sbostic VAPPLI=.TRUE. 40*35973SbosticC !ASSUME WINS. 41*35973SbosticC 42*35973Sbostic IF(PRSO.GT.220) GO TO 5 43*35973SbosticC 44*35973Sbostic IF(PRSO.NE.0) ODO2=ODESC2(PRSO) 45*35973SbosticC !SET UP DESCRIPTORS. 46*35973Sbostic5 IF(PRSI.NE.0) ODI2=ODESC2(PRSI) 47*35973Sbostic AV=AVEHIC(WINNER) 48*35973Sbostic RMK=372+RND(6) 49*35973SbosticC !REMARK FOR HACK-HACKS. 50*35973SbosticC 51*35973Sbostic IF(RI.EQ.0) GO TO 10 52*35973SbosticC !ZERO IS FALSE. 53*35973Sbostic IF(RI.LE.MXNOP) RETURN 54*35973SbosticC !NOP? 55*35973Sbostic IF(RI.LE.MXSMP) GO TO 100 56*35973SbosticC !SIMPLE VERB? 57*35973Sbostic GO TO (18000,20000, 58*35973Sbostic& 22000,23000,24000,25000,26000,27000,28000,29000,30000, 59*35973Sbostic& 31000,32000,33000,34000,35000,36000, 38000,39000,40000, 60*35973Sbostic& 41000,42000,43000,44000,45000,46000,47000,48000,49000,50000, 61*35973Sbostic& 51000,52000,53000, 55000,56000, 58000,59000,60000, 62*35973Sbostic& 63000,64000,65000,66000, 68000,69000,70000, 63*35973Sbostic& 71000,72000,73000,74000, 77000,78000, 64*35973Sbostic& 80000,81000,82000,83000,84000,85000,86000,87000,88000), 65*35973Sbostic& (RI-MXSMP) 66*35973Sbostic CALL BUG(7,RI) 67*35973SbosticC 68*35973SbosticC ALL VERB PROCESSORS RETURN HERE TO DECLARE FAILURE. 69*35973SbosticC 70*35973Sbostic10 VAPPLI=.FALSE. 71*35973SbosticC !LOSE. 72*35973Sbostic RETURN 73*35973SbosticC 74*35973SbosticC SIMPLE VERBS ARE HANDLED EXTERNALLY. 75*35973SbosticC 76*35973Sbostic100 VAPPLI=SVERBS(RI) 77*35973Sbostic RETURN 78*35973SbosticC VAPPLI, PAGE 3 79*35973SbosticC 80*35973SbosticC V100-- READ. OUR FIRST REAL VERB. 81*35973SbosticC 82*35973Sbostic18000 IF(LIT(HERE)) GO TO 18100 83*35973SbosticC !ROOM LIT? 84*35973Sbostic CALL RSPEAK(356) 85*35973SbosticC !NO, CANT READ. 86*35973Sbostic RETURN 87*35973SbosticC 88*35973Sbostic18100 IF(PRSI.EQ.0) GO TO 18200 89*35973SbosticC !READ THROUGH OBJ? 90*35973Sbostic IF(and(OFLAG1(PRSI),TRANBT).NE.0) GO TO 18200 91*35973Sbostic CALL RSPSUB(357,ODI2) 92*35973SbosticC !NOT TRANSPARENT. 93*35973Sbostic RETURN 94*35973SbosticC 95*35973Sbostic18200 IF(and(OFLAG1(PRSO),READBT).NE.0) GO TO 18300 96*35973Sbostic CALL RSPSUB(358,ODO2) 97*35973SbosticC !NOT READABLE. 98*35973Sbostic RETURN 99*35973SbosticC 100*35973Sbostic18300 IF(.NOT.OBJACT(X)) CALL RSPEAK(OREAD(PRSO)) 101*35973Sbostic RETURN 102*35973SbosticC 103*35973SbosticC V101-- MELT. UNLESS OBJECT HANDLES, JOKE. 104*35973SbosticC 105*35973Sbostic20000 IF(.NOT.OBJACT(X)) CALL RSPSUB(361,ODO2) 106*35973Sbostic RETURN 107*35973SbosticC 108*35973SbosticC V102-- INFLATE. WORKS ONLY WITH BOATS. 109*35973SbosticC 110*35973Sbostic22000 IF(.NOT.OBJACT(X)) CALL RSPEAK(368) 111*35973SbosticC !OBJ HANDLE? 112*35973Sbostic RETURN 113*35973SbosticC 114*35973SbosticC V103-- DEFLATE. 115*35973SbosticC 116*35973Sbostic23000 IF(.NOT.OBJACT(X)) CALL RSPEAK(369) 117*35973SbosticC !OBJ HANDLE? 118*35973Sbostic RETURN 119*35973SbosticC VAPPLI, PAGE 4 120*35973SbosticC 121*35973SbosticC V104-- ALARM. IF SLEEPING, WAKE HIM UP. 122*35973SbosticC 123*35973Sbostic24000 IF(and(OFLAG2(PRSO),SLEPBT).EQ.0) GO TO 24100 124*35973Sbostic VAPPLI=OBJACT(X) 125*35973SbosticC !SLEEPING, LET OBJ DO. 126*35973Sbostic RETURN 127*35973SbosticC 128*35973Sbostic24100 CALL RSPSUB(370,ODO2) 129*35973SbosticC !JOKE. 130*35973Sbostic RETURN 131*35973SbosticC 132*35973SbosticC V105-- EXORCISE. OBJECTS HANDLE. 133*35973SbosticC 134*35973Sbostic25000 F=OBJACT(X) 135*35973SbosticC !OBJECTS HANDLE. 136*35973Sbostic RETURN 137*35973SbosticC 138*35973SbosticC V106-- PLUG. LET OBJECTS HANDLE. 139*35973SbosticC 140*35973Sbostic26000 IF(.NOT.OBJACT(X)) CALL RSPEAK(371) 141*35973Sbostic RETURN 142*35973SbosticC 143*35973SbosticC V107-- KICK. IF OBJECT IGNORES, JOKE. 144*35973SbosticC 145*35973Sbostic27000 IF(.NOT.OBJACT(X)) CALL RSPSB2(378,ODO2,RMK) 146*35973Sbostic RETURN 147*35973SbosticC 148*35973SbosticC V108-- WAVE. SAME. 149*35973SbosticC 150*35973Sbostic28000 IF(.NOT.OBJACT(X)) CALL RSPSB2(379,ODO2,RMK) 151*35973Sbostic RETURN 152*35973SbosticC 153*35973SbosticC V109,V110-- RAISE, LOWER. SAME. 154*35973SbosticC 155*35973Sbostic29000 CONTINUE 156*35973Sbostic30000 IF(.NOT.OBJACT(X)) CALL RSPSB2(380,ODO2,RMK) 157*35973Sbostic RETURN 158*35973SbosticC 159*35973SbosticC V111-- RUB. SAME. 160*35973SbosticC 161*35973Sbostic31000 IF(.NOT.OBJACT(X)) CALL RSPSB2(381,ODO2,RMK) 162*35973Sbostic RETURN 163*35973SbosticC 164*35973SbosticC V112-- PUSH. SAME. 165*35973SbosticC 166*35973Sbostic32000 IF(.NOT.OBJACT(X)) CALL RSPSB2(382,ODO2,RMK) 167*35973Sbostic RETURN 168*35973SbosticC VAPPLI, PAGE 5 169*35973SbosticC 170*35973SbosticC V113-- UNTIE. IF OBJECT IGNORES, JOKE. 171*35973SbosticC 172*35973Sbostic33000 IF(OBJACT(X)) RETURN 173*35973SbosticC !OBJECT HANDLE? 174*35973Sbostic I=383 175*35973SbosticC !NO, NOT TIED. 176*35973Sbostic IF(and(OFLAG2(PRSO),TIEBT).EQ.0) I=384 177*35973Sbostic CALL RSPEAK(I) 178*35973Sbostic RETURN 179*35973SbosticC 180*35973SbosticC V114-- TIE. NEVER REALLY WORKS. 181*35973SbosticC 182*35973Sbostic34000 IF(and(OFLAG2(PRSO),TIEBT).NE.0) GO TO 34100 183*35973Sbostic CALL RSPEAK(385) 184*35973SbosticC !NOT TIEABLE. 185*35973Sbostic RETURN 186*35973SbosticC 187*35973Sbostic34100 IF(.NOT.OBJACT(X)) CALL RSPSUB(386,ODO2) 188*35973SbosticC !JOKE. 189*35973Sbostic RETURN 190*35973SbosticC 191*35973SbosticC V115-- TIE UP. NEVER REALLY WORKS. 192*35973SbosticC 193*35973Sbostic35000 IF(and(OFLAG2(PRSI),TIEBT).NE.0) GO TO 35100 194*35973Sbostic CALL RSPSUB(387,ODO2) 195*35973SbosticC !NOT TIEABLE. 196*35973Sbostic RETURN 197*35973SbosticC 198*35973Sbostic35100 I=388 199*35973SbosticC !ASSUME VILLAIN. 200*35973Sbostic IF(and(OFLAG2(PRSO),VILLBT).EQ.0) I=389 201*35973Sbostic CALL RSPSUB(I,ODO2) 202*35973SbosticC !JOKE. 203*35973Sbostic RETURN 204*35973SbosticC 205*35973SbosticC V116-- TURN. OBJECT MUST HANDLE. 206*35973SbosticC 207*35973Sbostic36000 IF(and(OFLAG1(PRSO),TURNBT).NE.0) GO TO 36100 208*35973Sbostic CALL RSPEAK(390) 209*35973SbosticC !NOT TURNABLE. 210*35973Sbostic RETURN 211*35973SbosticC 212*35973Sbostic36100 IF(and(OFLAG1(PRSI),TOOLBT).NE.0) GO TO 36200 213*35973Sbostic CALL RSPSUB(391,ODI2) 214*35973SbosticC !NOT A TOOL. 215*35973Sbostic RETURN 216*35973SbosticC 217*35973Sbostic36200 VAPPLI=OBJACT(X) 218*35973SbosticC !LET OBJECT HANDLE. 219*35973Sbostic RETURN 220*35973SbosticC 221*35973SbosticC V117-- BREATHE. BECOMES INFLATE WITH LUNGS. 222*35973SbosticC 223*35973Sbostic38000 PRSA=INFLAW 224*35973Sbostic PRSI=LUNGS 225*35973Sbostic GO TO 22000 226*35973SbosticC !HANDLE LIKE INFLATE. 227*35973SbosticC 228*35973SbosticC V118-- KNOCK. MOSTLY JOKE. 229*35973SbosticC 230*35973Sbostic39000 IF(OBJACT(X)) RETURN 231*35973SbosticC !OBJ HANDLE? 232*35973Sbostic I=394 233*35973SbosticC !JOKE FOR DOOR. 234*35973Sbostic IF(and(OFLAG1(PRSO),DOORBT).EQ.0) I=395 235*35973Sbostic CALL RSPSUB(I,ODO2) 236*35973SbosticC !JOKE FOR NONDOORS TOO. 237*35973Sbostic RETURN 238*35973SbosticC 239*35973SbosticC V119-- LOOK. 240*35973SbosticC 241*35973Sbostic40000 IF(PRSO.NE.0) GO TO 41500 242*35973SbosticC !SOMETHING TO LOOK AT? 243*35973Sbostic VAPPLI=RMDESC(3) 244*35973SbosticC !HANDLED BY RMDESC. 245*35973Sbostic RETURN 246*35973SbosticC 247*35973SbosticC V120-- EXAMINE. 248*35973SbosticC 249*35973Sbostic41000 IF(PRSO.NE.0) GO TO 41500 250*35973SbosticC !SOMETHING TO EXAMINE? 251*35973Sbostic VAPPLI=RMDESC(0) 252*35973SbosticC !HANDLED BY RMDESC. 253*35973Sbostic RETURN 254*35973SbosticC 255*35973Sbostic41500 IF(OBJACT(X)) RETURN 256*35973SbosticC !OBJ HANDLE? 257*35973Sbostic I=OREAD(PRSO) 258*35973SbosticC !GET READING MATERIAL. 259*35973Sbostic IF(I.NE.0) CALL RSPEAK(I) 260*35973SbosticC !OUTPUT IF THERE, 261*35973Sbostic IF(I.EQ.0) CALL RSPSUB(429,ODO2) 262*35973SbosticC !OTHERWISE DEFAULT. 263*35973Sbostic PRSA=FOOW 264*35973SbosticC !DEFUSE ROOM PROCESSORS. 265*35973Sbostic RETURN 266*35973SbosticC 267*35973SbosticC V121-- SHAKE. IF HOLLOW OBJECT, SOME ACTION. 268*35973SbosticC 269*35973Sbostic42000 IF(OBJACT(X)) RETURN 270*35973SbosticC !OBJECT HANDLE? 271*35973Sbostic IF(and(OFLAG2(PRSO),VILLBT).EQ.0) GO TO 42100 272*35973Sbostic CALL RSPEAK(371) 273*35973SbosticC !JOKE FOR VILLAINS. 274*35973Sbostic RETURN 275*35973SbosticC 276*35973Sbostic42100 IF(QEMPTY(PRSO).OR.(and(OFLAG1(PRSO),TAKEBT).EQ.0)) 277*35973Sbostic& GO TO 10 278*35973Sbostic IF(QOPEN(PRSO)) GO TO 42300 279*35973SbosticC !OPEN? SPILL. 280*35973Sbostic CALL RSPSUB(396,ODO2) 281*35973SbosticC !NO, DESCRIBE NOISE. 282*35973Sbostic RETURN 283*35973SbosticC 284*35973Sbostic42300 CALL RSPSUB(397,ODO2) 285*35973SbosticC !SPILL THE WORKS. 286*35973Sbostic DO 42500 I=1,OLNT 287*35973SbosticC !SPILL CONTENTS. 288*35973Sbostic IF(OCAN(I).NE.PRSO) GO TO 42500 289*35973SbosticC !INSIDE? 290*35973Sbostic OFLAG2(I)=or(OFLAG2(I),TCHBT) 291*35973Sbostic IF(AV.EQ.0) GO TO 42400 292*35973SbosticC !IN VEHICLE? 293*35973Sbostic CALL NEWSTA(I,0,0,AV,0) 294*35973SbosticC !YES, SPILL IN THERE. 295*35973Sbostic GO TO 42500 296*35973SbosticC 297*35973Sbostic42400 CALL NEWSTA(I,0,HERE,0,0) 298*35973SbosticC !NO, SPILL ON FLOOR, 299*35973Sbostic IF(I.EQ.WATER) CALL NEWSTA(I,133,0,0,0) 300*35973SbosticC !BUT WATER DISAPPEARS. 301*35973Sbostic42500 CONTINUE 302*35973Sbostic RETURN 303*35973SbosticC 304*35973SbosticC V122-- MOVE. MOSTLY JOKES. 305*35973SbosticC 306*35973Sbostic43000 IF(OBJACT(X)) RETURN 307*35973SbosticC !OBJ HANDLE? 308*35973Sbostic I=398 309*35973SbosticC !ASSUME NOT HERE. 310*35973Sbostic IF(QHERE(PRSO,HERE)) I=399 311*35973Sbostic CALL RSPSUB(I,ODO2) 312*35973SbosticC !JOKE. 313*35973Sbostic RETURN 314*35973SbosticC VAPPLI, PAGE 6 315*35973SbosticC 316*35973SbosticC V123-- TURN ON. 317*35973SbosticC 318*35973Sbostic44000 F=LIT(HERE) 319*35973SbosticC !RECORD IF LIT. 320*35973Sbostic IF(OBJACT(X)) GO TO 44300 321*35973SbosticC !OBJ HANDLE? 322*35973Sbostic IF((and(OFLAG1(PRSO),LITEBT).NE.0).AND. 323*35973Sbostic& (OADV(PRSO).EQ.WINNER)) GO TO 44100 324*35973Sbostic CALL RSPEAK(400) 325*35973SbosticC !CANT DO IT. 326*35973Sbostic RETURN 327*35973SbosticC 328*35973Sbostic44100 IF(and(OFLAG1(PRSO),ONBT).EQ.0) GO TO 44200 329*35973Sbostic CALL RSPEAK(401) 330*35973SbosticC !ALREADY ON. 331*35973Sbostic RETURN 332*35973SbosticC 333*35973Sbostic44200 OFLAG1(PRSO)=or(OFLAG1(PRSO),ONBT) 334*35973Sbostic CALL RSPSUB(404,ODO2) 335*35973Sbostic44300 IF(.NOT.F .AND.LIT(HERE)) F=RMDESC(0) 336*35973SbosticC !ROOM NEWLY LIT. 337*35973Sbostic RETURN 338*35973SbosticC 339*35973SbosticC V124-- TURN OFF. 340*35973SbosticC 341*35973Sbostic45000 IF(OBJACT(X)) GO TO 45300 342*35973SbosticC !OBJ HANDLE? 343*35973Sbostic IF((and(OFLAG1(PRSO),LITEBT).NE.0).AND. 344*35973Sbostic& (OADV(PRSO).EQ.WINNER)) GO TO 45100 345*35973Sbostic CALL RSPEAK(402) 346*35973SbosticC !CANT DO IT. 347*35973Sbostic RETURN 348*35973SbosticC 349*35973Sbostic45100 IF(and(OFLAG1(PRSO),ONBT).NE.0) GO TO 45200 350*35973Sbostic CALL RSPEAK(403) 351*35973SbosticC !ALREADY OFF. 352*35973Sbostic RETURN 353*35973SbosticC 354*35973Sbostic45200 OFLAG1(PRSO)=and(OFLAG1(PRSO), not(ONBT)) 355*35973Sbostic CALL RSPSUB(405,ODO2) 356*35973Sbostic45300 IF(.NOT.LIT(HERE)) CALL RSPEAK(406) 357*35973SbosticC !MAY BE DARK. 358*35973Sbostic RETURN 359*35973SbosticC 360*35973SbosticC V125-- OPEN. A FINE MESS. 361*35973SbosticC 362*35973Sbostic46000 IF(OBJACT(X)) RETURN 363*35973SbosticC !OBJ HANDLE? 364*35973Sbostic IF(and(OFLAG1(PRSO),CONTBT).NE.0) GO TO 46100 365*35973Sbostic46050 CALL RSPSUB(407,ODO2) 366*35973SbosticC !NOT OPENABLE. 367*35973Sbostic RETURN 368*35973SbosticC 369*35973Sbostic46100 IF(OCAPAC(PRSO).NE.0) GO TO 46200 370*35973Sbostic CALL RSPSUB(408,ODO2) 371*35973SbosticC !NOT OPENABLE. 372*35973Sbostic RETURN 373*35973SbosticC 374*35973Sbostic46200 IF(.NOT.QOPEN(PRSO)) GO TO 46225 375*35973Sbostic CALL RSPEAK(412) 376*35973SbosticC !ALREADY OPEN. 377*35973Sbostic RETURN 378*35973SbosticC 379*35973Sbostic46225 OFLAG2(PRSO)=or(OFLAG2(PRSO),OPENBT) 380*35973Sbostic IF((and(OFLAG1(PRSO),TRANBT).NE.0).OR.QEMPTY(PRSO)) 381*35973Sbostic& GO TO 46300 382*35973Sbostic CALL PRINCO(PRSO,410) 383*35973SbosticC !PRINT CONTENTS. 384*35973Sbostic RETURN 385*35973SbosticC 386*35973Sbostic46300 CALL RSPEAK(409) 387*35973SbosticC !DONE 388*35973Sbostic RETURN 389*35973SbosticC 390*35973SbosticC V126-- CLOSE. 391*35973SbosticC 392*35973Sbostic47000 IF(OBJACT(X)) RETURN 393*35973SbosticC !OBJ HANDLE? 394*35973Sbostic IF(and(OFLAG1(PRSO),CONTBT).EQ.0) GO TO 46050 395*35973Sbostic IF(OCAPAC(PRSO).NE.0) GO TO 47100 396*35973Sbostic CALL RSPSUB(411,ODO2) 397*35973SbosticC !NOT CLOSABLE. 398*35973Sbostic RETURN 399*35973SbosticC 400*35973Sbostic47100 IF(QOPEN(PRSO)) GO TO 47200 401*35973SbosticC !OPEN? 402*35973Sbostic CALL RSPEAK(413) 403*35973SbosticC !NO, JOKE. 404*35973Sbostic RETURN 405*35973SbosticC 406*35973Sbostic47200 OFLAG2(PRSO)=and(OFLAG2(PRSO), not(OPENBT)) 407*35973Sbostic CALL RSPEAK(414) 408*35973SbosticC !DONE. 409*35973Sbostic RETURN 410*35973SbosticC VAPPLI, PAGE 7 411*35973SbosticC 412*35973SbosticC V127-- FIND. BIG MEGILLA. 413*35973SbosticC 414*35973Sbostic48000 IF(OBJACT(X)) RETURN 415*35973SbosticC !OBJ HANDLE? 416*35973Sbostic I=415 417*35973SbosticC !DEFAULT CASE. 418*35973Sbostic IF(QHERE(PRSO,HERE)) GO TO 48300 419*35973SbosticC !IN ROOM? 420*35973Sbostic IF(OADV(PRSO).EQ.WINNER) GO TO 48200 421*35973SbosticC !ON WINNER? 422*35973Sbostic J=OCAN(PRSO) 423*35973SbosticC !DOWN ONE LEVEL. 424*35973Sbostic IF(J.EQ.0) GO TO 10 425*35973Sbostic IF(((and(OFLAG1(J),TRANBT).EQ.0).AND. 426*35973Sbostic& (.NOT.QOPEN(J).OR.(and(OFLAG1(J),(DOORBT+CONTBT)).EQ.0)))) 427*35973Sbostic& GO TO 10 428*35973Sbostic I=417 429*35973SbosticC !ASSUME IN ROOM. 430*35973Sbostic IF(QHERE(J,HERE)) GO TO 48100 431*35973Sbostic IF(OADV(J).NE.WINNER) GO TO 10 432*35973SbosticC !NOT HERE OR ON PERSON. 433*35973Sbostic I=418 434*35973Sbostic48100 CALL RSPSUB(I,ODESC2(J)) 435*35973SbosticC !DESCRIBE FINDINGS. 436*35973Sbostic RETURN 437*35973SbosticC 438*35973Sbostic48200 I=416 439*35973Sbostic48300 CALL RSPSUB(I,ODO2) 440*35973SbosticC !DESCRIBE FINDINGS. 441*35973Sbostic RETURN 442*35973SbosticC 443*35973SbosticC V128-- WAIT. RUN CLOCK DEMON. 444*35973SbosticC 445*35973Sbostic49000 CALL RSPEAK(419) 446*35973SbosticC !TIME PASSES. 447*35973Sbostic DO 49100 I=1,3 448*35973Sbostic IF(CLOCKD(X)) RETURN 449*35973Sbostic49100 CONTINUE 450*35973Sbostic RETURN 451*35973SbosticC 452*35973SbosticC V129-- SPIN. 453*35973SbosticC V159-- TURN TO. 454*35973SbosticC 455*35973Sbostic50000 CONTINUE 456*35973Sbostic88000 IF(.NOT.OBJACT(X)) CALL RSPEAK(663) 457*35973SbosticC !IF NOT OBJ, JOKE. 458*35973Sbostic RETURN 459*35973SbosticC 460*35973SbosticC V130-- BOARD. WORKS WITH VEHICLES. 461*35973SbosticC 462*35973Sbostic51000 IF(and(OFLAG2(PRSO),VEHBT).NE.0) GO TO 51100 463*35973Sbostic CALL RSPSUB(421,ODO2) 464*35973SbosticC !NOT VEHICLE, JOKE. 465*35973Sbostic RETURN 466*35973SbosticC 467*35973Sbostic51100 IF(QHERE(PRSO,HERE)) GO TO 51200 468*35973SbosticC !HERE? 469*35973Sbostic CALL RSPSUB(420,ODO2) 470*35973SbosticC !NO, JOKE. 471*35973Sbostic RETURN 472*35973SbosticC 473*35973Sbostic51200 IF(AV.EQ.0) GO TO 51300 474*35973SbosticC !ALREADY GOT ONE? 475*35973Sbostic CALL RSPSUB(422,ODO2) 476*35973SbosticC !YES, JOKE. 477*35973Sbostic RETURN 478*35973SbosticC 479*35973Sbostic51300 IF(OBJACT(X)) RETURN 480*35973SbosticC !OBJ HANDLE? 481*35973Sbostic CALL RSPSUB(423,ODO2) 482*35973SbosticC !DESCRIBE. 483*35973Sbostic AVEHIC(WINNER)=PRSO 484*35973Sbostic IF(WINNER.NE.PLAYER) OCAN(AOBJ(WINNER))=PRSO 485*35973Sbostic RETURN 486*35973SbosticC 487*35973SbosticC V131-- DISEMBARK. 488*35973SbosticC 489*35973Sbostic52000 IF(AV.EQ.PRSO) GO TO 52100 490*35973SbosticC !FROM VEHICLE? 491*35973Sbostic CALL RSPEAK(424) 492*35973SbosticC !NO, JOKE. 493*35973Sbostic RETURN 494*35973SbosticC 495*35973Sbostic52100 IF(OBJACT(X)) RETURN 496*35973SbosticC !OBJ HANDLE? 497*35973Sbostic IF(and(RFLAG(HERE),RLAND).NE.0) GO TO 52200 498*35973Sbostic CALL RSPEAK(425) 499*35973SbosticC !NOT ON LAND. 500*35973Sbostic RETURN 501*35973SbosticC 502*35973Sbostic52200 AVEHIC(WINNER)=0 503*35973Sbostic CALL RSPEAK(426) 504*35973Sbostic IF(WINNER.NE.PLAYER) CALL NEWSTA(AOBJ(WINNER),0,HERE,0,0) 505*35973Sbostic RETURN 506*35973SbosticC 507*35973SbosticC V132-- TAKE. HANDLED EXTERNALLY. 508*35973SbosticC 509*35973Sbostic53000 VAPPLI=TAKE(.TRUE.) 510*35973Sbostic RETURN 511*35973SbosticC 512*35973SbosticC V133-- INVENTORY. PROCESSED EXTERNALLY. 513*35973SbosticC 514*35973Sbostic55000 CALL INVENT(WINNER) 515*35973Sbostic RETURN 516*35973SbosticC VAPPLI, PAGE 8 517*35973SbosticC 518*35973SbosticC V134-- FILL. STRANGE DOINGS WITH WATER. 519*35973SbosticC 520*35973Sbostic56000 IF(PRSI.NE.0) GO TO 56050 521*35973SbosticC !ANY OBJ SPECIFIED? 522*35973Sbostic IF(and(RFLAG(HERE),(RWATER+RFILL)).NE.0) GO TO 56025 523*35973Sbostic CALL RSPEAK(516) 524*35973SbosticC !NOTHING TO FILL WITH. 525*35973Sbostic PRSWON=.FALSE. 526*35973SbosticC !YOU LOSE. 527*35973Sbostic RETURN 528*35973SbosticC 529*35973Sbostic56025 PRSI=GWATE 530*35973SbosticC !USE GLOBAL WATER. 531*35973Sbostic56050 IF(OBJACT(X)) RETURN 532*35973SbosticC !OBJ HANDLE? 533*35973Sbostic IF((PRSI.NE.GWATE).AND.(PRSI.NE.WATER)) 534*35973Sbostic& CALL RSPSB2(444,ODI2,ODO2) 535*35973Sbostic RETURN 536*35973SbosticC 537*35973SbosticC V135,V136-- EAT/DRINK 538*35973SbosticC 539*35973Sbostic58000 CONTINUE 540*35973Sbostic59000 IF(OBJACT(X)) RETURN 541*35973SbosticC !OBJ HANDLE? 542*35973Sbostic IF(PRSO.EQ.GWATE) GO TO 59500 543*35973SbosticC !DRINK GLOBAL WATER? 544*35973Sbostic IF(.NOT.EDIBLE(PRSO)) GO TO 59400 545*35973SbosticC !EDIBLE? 546*35973Sbostic IF(OADV(PRSO).EQ.WINNER) GO TO 59200 547*35973SbosticC !YES, ON WINNER? 548*35973Sbostic59100 CALL RSPSUB(454,ODO2) 549*35973SbosticC !NOT ACCESSIBLE. 550*35973Sbostic RETURN 551*35973SbosticC 552*35973Sbostic59200 IF(PRSA.EQ.DRINKW) GO TO 59300 553*35973SbosticC !DRINK FOOD? 554*35973Sbostic CALL NEWSTA(PRSO,455,0,0,0) 555*35973SbosticC !NO, IT DISAPPEARS. 556*35973Sbostic RETURN 557*35973SbosticC 558*35973Sbostic59300 CALL RSPEAK(456) 559*35973SbosticC !YES, JOKE. 560*35973Sbostic RETURN 561*35973SbosticC 562*35973Sbostic59400 IF(.NOT.DRKBLE(PRSO)) GO TO 59600 563*35973SbosticC !DRINKABLE? 564*35973Sbostic IF(OCAN(PRSO).EQ.0) GO TO 59100 565*35973SbosticC !YES, IN SOMETHING? 566*35973Sbostic IF(OADV(OCAN(PRSO)).NE.WINNER) GO TO 59100 567*35973Sbostic IF(QOPEN(OCAN(PRSO))) GO TO 59500 568*35973SbosticC !CONT OPEN? 569*35973Sbostic CALL RSPEAK(457) 570*35973SbosticC !NO, JOKE. 571*35973Sbostic RETURN 572*35973SbosticC 573*35973Sbostic59500 CALL NEWSTA(PRSO,458,0,0,0) 574*35973SbosticC !GONE. 575*35973Sbostic RETURN 576*35973SbosticC 577*35973Sbostic59600 CALL RSPSUB(453,ODO2) 578*35973SbosticC !NOT FOOD OR DRINK. 579*35973Sbostic RETURN 580*35973SbosticC 581*35973SbosticC V137-- BURN. COMPLICATED. 582*35973SbosticC 583*35973Sbostic60000 IF(and(OFLAG1(PRSI),(FLAMBT+LITEBT+ONBT)).NE. 584*35973Sbostic& (FLAMBT+LITEBT+ONBT)) GO TO 60400 585*35973Sbostic IF(OBJACT(X)) RETURN 586*35973SbosticC !OBJ HANDLE? 587*35973Sbostic IF(OCAN(PRSO).NE.RECEP) GO TO 60050 588*35973SbosticC !BALLOON? 589*35973Sbostic IF(OAPPLI(OACTIO(BALLO),0)) RETURN 590*35973SbosticC !DID IT HANDLE? 591*35973Sbostic60050 IF(and(OFLAG1(PRSO),BURNBT).EQ.0) GO TO 60300 592*35973Sbostic IF(OADV(PRSO).NE.WINNER) GO TO 60100 593*35973SbosticC !CARRYING IT? 594*35973Sbostic CALL RSPSUB(459,ODO2) 595*35973Sbostic CALL JIGSUP(460) 596*35973Sbostic RETURN 597*35973SbosticC 598*35973Sbostic60100 J=OCAN(PRSO) 599*35973SbosticC !GET CONTAINER. 600*35973Sbostic IF(QHERE(PRSO,HERE).OR. ((AV.NE.0).AND.(J.EQ.AV))) 601*35973Sbostic& GO TO 60200 602*35973Sbostic IF(J.EQ.0) GO TO 60150 603*35973SbosticC !INSIDE? 604*35973Sbostic IF(.NOT.QOPEN(J)) GO TO 60150 605*35973SbosticC !OPEN? 606*35973Sbostic IF(QHERE(J,HERE).OR.((AV.NE.0).AND.(OCAN(J).EQ.AV))) 607*35973Sbostic& GO TO 60200 608*35973Sbostic60150 CALL RSPEAK(461) 609*35973SbosticC !CANT REACH IT. 610*35973Sbostic RETURN 611*35973SbosticC 612*35973Sbostic60200 CALL RSPSUB(462,ODO2) 613*35973SbosticC !BURN IT. 614*35973Sbostic CALL NEWSTA(PRSO,0,0,0,0) 615*35973Sbostic RETURN 616*35973SbosticC 617*35973Sbostic60300 CALL RSPSUB(463,ODO2) 618*35973SbosticC !CANT BURN IT. 619*35973Sbostic RETURN 620*35973SbosticC 621*35973Sbostic60400 CALL RSPSUB(301,ODI2) 622*35973SbosticC !CANT BURN IT WITH THAT. 623*35973Sbostic RETURN 624*35973SbosticC VAPPLI, PAGE 9 625*35973SbosticC 626*35973SbosticC V138-- MUNG. GO TO COMMON ATTACK CODE. 627*35973SbosticC 628*35973Sbostic63000 I=466 629*35973SbosticC !CHOOSE PHRASE. 630*35973Sbostic IF(and(OFLAG2(PRSO),VILLBT).NE.0) GO TO 66100 631*35973Sbostic IF(.NOT.OBJACT(X)) CALL RSPSB2(466,ODO2,RMK) 632*35973Sbostic RETURN 633*35973SbosticC 634*35973SbosticC V139-- KILL. GO TO COMMON ATTACK CODE. 635*35973SbosticC 636*35973Sbostic64000 I=467 637*35973SbosticC !CHOOSE PHRASE. 638*35973Sbostic GO TO 66100 639*35973SbosticC 640*35973SbosticC V140-- SWING. INVERT OBJECTS, FALL THRU TO ATTACK. 641*35973SbosticC 642*35973Sbostic65000 J=PRSO 643*35973SbosticC !INVERT. 644*35973Sbostic PRSO=PRSI 645*35973Sbostic PRSI=J 646*35973Sbostic J=ODO2 647*35973Sbostic ODO2=ODI2 648*35973Sbostic ODI2=J 649*35973Sbostic PRSA=ATTACW 650*35973SbosticC !FOR OBJACT. 651*35973SbosticC 652*35973SbosticC V141-- ATTACK. FALL THRU TO ATTACK CODE. 653*35973SbosticC 654*35973Sbostic66000 I=468 655*35973SbosticC 656*35973SbosticC COMMON MUNG/ATTACK/SWING/KILL CODE. 657*35973SbosticC 658*35973Sbostic66100 IF(PRSO.NE.0) GO TO 66200 659*35973SbosticC !ANYTHING? 660*35973Sbostic CALL RSPEAK(469) 661*35973SbosticC !NO, JOKE. 662*35973Sbostic RETURN 663*35973SbosticC 664*35973Sbostic66200 IF(OBJACT(X)) RETURN 665*35973SbosticC !OBJ HANDLE? 666*35973Sbostic IF(and(OFLAG2(PRSO),VILLBT).NE.0) GO TO 66300 667*35973Sbostic IF(and(OFLAG1(PRSO),VICTBT).EQ.0) 668*35973Sbostic& CALL RSPSUB(470,ODO2) 669*35973Sbostic RETURN 670*35973SbosticC 671*35973Sbostic66300 J=471 672*35973SbosticC !ASSUME NO WEAPON. 673*35973Sbostic IF(PRSI.EQ.0) GO TO 66500 674*35973Sbostic IF(and(OFLAG2(PRSI),WEAPBT).EQ.0) GO TO 66400 675*35973Sbostic MELEE=1 676*35973SbosticC !ASSUME SWORD. 677*35973Sbostic IF(PRSI.NE.SWORD) MELEE=2 678*35973SbosticC !MUST BE KNIFE. 679*35973Sbostic I=BLOW(PLAYER,PRSO,MELEE,.TRUE.,0) 680*35973SbosticC !STRIKE BLOW. 681*35973Sbostic RETURN 682*35973SbosticC 683*35973Sbostic66400 J=472 684*35973SbosticC !NOT A WEAPON. 685*35973Sbostic66500 CALL RSPSB2(I,ODO2,J) 686*35973SbosticC !JOKE. 687*35973Sbostic RETURN 688*35973SbosticC VAPPLI, PAGE 10 689*35973SbosticC 690*35973SbosticC V142-- WALK. PROCESSED EXTERNALLY. 691*35973SbosticC 692*35973Sbostic68000 VAPPLI=WALK(X) 693*35973Sbostic RETURN 694*35973SbosticC 695*35973SbosticC V143-- TELL. PROCESSED IN GAME. 696*35973SbosticC 697*35973Sbostic69000 CALL RSPEAK(603) 698*35973Sbostic RETURN 699*35973SbosticC 700*35973SbosticC V144-- PUT. PROCESSED EXTERNALLY. 701*35973SbosticC 702*35973Sbostic70000 VAPPLI=PUT(.TRUE.) 703*35973Sbostic RETURN 704*35973SbosticC 705*35973SbosticC V145,V146,V147,V148-- DROP/GIVE/POUR/THROW 706*35973SbosticC 707*35973Sbostic71000 CONTINUE 708*35973Sbostic72000 CONTINUE 709*35973Sbostic73000 CONTINUE 710*35973Sbostic74000 VAPPLI=DROP(.FALSE.) 711*35973Sbostic RETURN 712*35973SbosticC 713*35973SbosticC V149-- SAVE 714*35973SbosticC 715*35973Sbostic77000 IF(and(RFLAG(TSTRS),RSEEN).EQ.0) GO TO 77100 716*35973Sbostic CALL RSPEAK(828) 717*35973SbosticC !NO SAVES IN ENDGAME. 718*35973Sbostic RETURN 719*35973SbosticC 720*35973Sbostic77100 CALL SAVEGM 721*35973Sbostic RETURN 722*35973SbosticC 723*35973SbosticC V150-- RESTORE 724*35973SbosticC 725*35973Sbostic#ifdef PDP 726*35973Sbostic78000 call restor 727*35973Sbostic#else 728*35973Sbostic78000 IF(and(RFLAG(TSTRS),RSEEN).EQ.0) GO TO 78100 729*35973Sbostic CALL RSPEAK(829) 730*35973SbosticC !NO RESTORES IN ENDGAME. 731*35973Sbostic RETURN 732*35973SbosticC 733*35973Sbostic78100 CALL RSTRGM 734*35973Sbostic#endif PDP 735*35973Sbostic RETURN 736*35973SbosticC VAPPLI, PAGE 11 737*35973SbosticC 738*35973SbosticC V151-- HELLO 739*35973SbosticC 740*35973Sbostic80000 IF(PRSO.NE.0) GO TO 80100 741*35973SbosticC !ANY OBJ? 742*35973Sbostic CALL RSPEAK(346+RND(4)) 743*35973SbosticC !NO, VANILLA HELLO. 744*35973Sbostic RETURN 745*35973SbosticC 746*35973Sbostic80100 IF(PRSO.NE.AVIAT) GO TO 80200 747*35973SbosticC !HELLO AVIATOR? 748*35973Sbostic CALL RSPEAK(350) 749*35973SbosticC !NOTHING HAPPENS. 750*35973Sbostic RETURN 751*35973SbosticC 752*35973Sbostic80200 IF(PRSO.NE.SAILO) GO TO 80300 753*35973SbosticC !HELLO SAILOR? 754*35973Sbostic HS=HS+1 755*35973SbosticC !COUNT. 756*35973Sbostic I=351 757*35973SbosticC !GIVE NORMAL OR 758*35973Sbostic IF(MOD(HS,10).EQ.0) I=352 759*35973SbosticC !RANDOM MESSAGE. 760*35973Sbostic IF(MOD(HS,20).EQ.0) I=353 761*35973Sbostic CALL RSPEAK(I) 762*35973SbosticC !SPEAK UP. 763*35973Sbostic RETURN 764*35973SbosticC 765*35973Sbostic80300 IF(OBJACT(X)) RETURN 766*35973SbosticC !OBJ HANDLE? 767*35973Sbostic I=354 768*35973SbosticC !ASSUME VILLAIN. 769*35973Sbostic IF(and(OFLAG2(PRSO),(VILLBT+ACTRBT)).EQ.0) I=355 770*35973Sbostic CALL RSPSUB(I,ODO2) 771*35973SbosticC !HELLO THERE 772*35973SbosticC ! 773*35973Sbostic RETURN 774*35973SbosticC 775*35973SbosticC V152-- LOOK INTO 776*35973SbosticC 777*35973Sbostic81000 IF(OBJACT(X)) RETURN 778*35973SbosticC !OBJ HANDLE? 779*35973Sbostic IF(and(OFLAG1(PRSO),DOORBT).EQ.0) GO TO 81300 780*35973Sbostic IF(.NOT.QOPEN(PRSO)) GO TO 81200 781*35973SbosticC !OPEN? 782*35973Sbostic CALL RSPSUB(628,ODO2) 783*35973SbosticC !OPEN DOOR- UNINTERESTING. 784*35973Sbostic RETURN 785*35973SbosticC 786*35973Sbostic81200 CALL RSPSUB(525,ODO2) 787*35973SbosticC !CLOSED DOOR- CANT SEE. 788*35973Sbostic RETURN 789*35973SbosticC 790*35973Sbostic81300 IF(and(OFLAG2(PRSO),VEHBT).NE.0) GO TO 81400 791*35973Sbostic IF(QOPEN(PRSO).OR.(and(OFLAG1(PRSO),TRANBT).NE.0)) 792*35973Sbostic& GO TO 81400 793*35973Sbostic IF(and(OFLAG1(PRSO),CONTBT).NE.0) GO TO 81200 794*35973Sbostic CALL RSPSUB(630,ODO2) 795*35973SbosticC !CANT LOOK INSIDE. 796*35973Sbostic RETURN 797*35973SbosticC 798*35973Sbostic81400 IF(QEMPTY(PRSO)) GO TO 81500 799*35973SbosticC !VEH OR SEE IN. EMPTY? 800*35973Sbostic CALL PRINCO(PRSO,573) 801*35973SbosticC !NO, LIST CONTENTS. 802*35973Sbostic RETURN 803*35973SbosticC 804*35973Sbostic81500 CALL RSPSUB(629,ODO2) 805*35973SbosticC !EMPTY. 806*35973Sbostic RETURN 807*35973SbosticC 808*35973SbosticC V153-- LOOK UNDER 809*35973SbosticC 810*35973Sbostic82000 IF(.NOT.OBJACT(X)) CALL RSPEAK(631) 811*35973SbosticC !OBJECT HANDLE? 812*35973Sbostic RETURN 813*35973SbosticC VAPPLI, PAGE 12 814*35973SbosticC 815*35973SbosticC V154-- PUMP 816*35973SbosticC 817*35973Sbostic83000 IF((OROOM(PUMP).EQ.HERE).OR.(OADV(PUMP).EQ.WINNER)) 818*35973Sbostic& GO TO 83100 819*35973Sbostic CALL RSPEAK(632) 820*35973SbosticC !NO. 821*35973Sbostic RETURN 822*35973SbosticC 823*35973Sbostic83100 PRSI=PUMP 824*35973SbosticC !BECOMES INFLATE 825*35973Sbostic PRSA=INFLAW 826*35973SbosticC !X WITH PUMP. 827*35973Sbostic GO TO 22000 828*35973SbosticC !DONE. 829*35973SbosticC 830*35973SbosticC V155-- WIND 831*35973SbosticC 832*35973Sbostic84000 IF(.NOT.OBJACT(X)) CALL RSPSUB(634,ODO2) 833*35973SbosticC !OBJ HANDLE? 834*35973Sbostic RETURN 835*35973SbosticC 836*35973SbosticC V156-- CLIMB 837*35973SbosticC V157-- CLIMB UP 838*35973SbosticC V158-- CLIMB DOWN 839*35973SbosticC 840*35973Sbostic85000 CONTINUE 841*35973Sbostic86000 CONTINUE 842*35973Sbostic87000 I=XUP 843*35973SbosticC !ASSUME UP. 844*35973Sbostic IF(PRSA.EQ.CLMBDW) I=XDOWN 845*35973SbosticC !UNLESS CLIMB DN. 846*35973Sbostic F=(and(OFLAG2(PRSO),CLMBBT)).NE.0 847*35973Sbostic IF(F.AND.FINDXT(I,HERE)) GO TO 87500 848*35973SbosticC !ANYTHING TO CLIMB? 849*35973Sbostic IF(OBJACT(X)) RETURN 850*35973SbosticC !OBJ HANDLE? 851*35973Sbostic I=657 852*35973Sbostic IF(F) I=524 853*35973SbosticC !VARIETY OF JOKES. 854*35973Sbostic IF(.NOT.F .AND.((PRSO.EQ.WALL).OR. 855*35973Sbostic& ((PRSO.GE.WNORT).AND.(PRSO.LE.WNORT+3)))) 856*35973Sbostic& I=656 857*35973Sbostic CALL RSPEAK(I) 858*35973SbosticC !JOKE. 859*35973Sbostic RETURN 860*35973SbosticC 861*35973Sbostic87500 PRSA=WALKW 862*35973SbosticC !WALK 863*35973Sbostic PRSO=I 864*35973SbosticC !IN SPECIFIED DIR. 865*35973Sbostic VAPPLI=WALK(X) 866*35973Sbostic RETURN 867*35973SbosticC 868*35973Sbostic END 869*35973SbosticC CLOCKD- CLOCK DEMON FOR INTERMOVE CLOCK EVENTS 870*35973SbosticC 871*35973SbosticC DECLARATIONS 872*35973SbosticC 873*35973Sbostic LOGICAL FUNCTION CLOCKD(X) 874*35973Sbostic IMPLICIT INTEGER (A-Z) 875*35973SbosticC 876*35973SbosticC CLOCK INTERRUPTS 877*35973SbosticC 878*35973Sbostic#include "clock.h" 879*35973SbosticC 880*35973Sbostic CLOCKD=.FALSE. 881*35973SbosticC !ASSUME NO ACTION. 882*35973Sbostic DO 100 I=1,CLNT 883*35973Sbostic IF(.NOT.CFLAG(I) .OR.(CTICK(I).EQ.0)) GO TO 100 884*35973Sbostic IF(CTICK(I).LT.0) GO TO 50 885*35973SbosticC !PERMANENT ENTRY? 886*35973Sbostic CTICK(I)=CTICK(I)-1 887*35973Sbostic IF(CTICK(I).NE.0) GO TO 100 888*35973SbosticC !TIMER EXPIRED? 889*35973Sbostic50 CLOCKD=.TRUE. 890*35973Sbostic CALL CEVAPP(CACTIO(I)) 891*35973SbosticC !DO ACTION. 892*35973Sbostic100 CONTINUE 893*35973Sbostic RETURN 894*35973SbosticC 895*35973Sbostic END 896