verbs.c 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344
  1. /* VAPPLI- MAIN VERB PROCESSING ROUTINE */
  2. /*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/
  3. /* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */
  4. /* WRITTEN BY R. M. SUPNIK */
  5. #include "funcs.h"
  6. #include "vars.h"
  7. logical vappli_(ri)
  8. integer ri;
  9. {
  10. /* Initialized data */
  11. const integer mxnop = 39;
  12. const integer mxsmp = 99;
  13. /* System generated locals */
  14. integer i__1;
  15. logical ret_val;
  16. /* Local variables */
  17. integer melee;
  18. logical f;
  19. integer i, j, av;
  20. integer rmk;
  21. integer odi2 = 0, odo2 = 0;
  22. ret_val = TRUE_;
  23. /* !ASSUME WINS. */
  24. if (prsvec_1.prso > 220) {
  25. goto L5;
  26. }
  27. if (prsvec_1.prso != 0) {
  28. odo2 = objcts_1.odesc2[prsvec_1.prso - 1];
  29. }
  30. /* !SET UP DESCRIPTORS. */
  31. L5:
  32. if (prsvec_1.prsi != 0) {
  33. odi2 = objcts_1.odesc2[prsvec_1.prsi - 1];
  34. }
  35. av = advs_1.avehic[play_1.winner - 1];
  36. rmk = rnd_(6) + 372;
  37. /* !REMARK FOR HACK-HACKS. */
  38. if (ri == 0) {
  39. goto L10;
  40. }
  41. /* !ZERO IS FALSE. */
  42. if (ri <= mxnop) {
  43. return ret_val;
  44. }
  45. /* !NOP? */
  46. if (ri <= mxsmp) {
  47. goto L100;
  48. }
  49. /* !SIMPLE VERB? */
  50. switch (ri - mxsmp) {
  51. case 1: goto L18000;
  52. case 2: goto L20000;
  53. case 3: goto L22000;
  54. case 4: goto L23000;
  55. case 5: goto L24000;
  56. case 6: goto L25000;
  57. case 7: goto L26000;
  58. case 8: goto L27000;
  59. case 9: goto L28000;
  60. case 10: goto L29000;
  61. case 11: goto L30000;
  62. case 12: goto L31000;
  63. case 13: goto L32000;
  64. case 14: goto L33000;
  65. case 15: goto L34000;
  66. case 16: goto L35000;
  67. case 17: goto L36000;
  68. case 18: goto L38000;
  69. case 19: goto L39000;
  70. case 20: goto L40000;
  71. case 21: goto L41000;
  72. case 22: goto L42000;
  73. case 23: goto L43000;
  74. case 24: goto L44000;
  75. case 25: goto L45000;
  76. case 26: goto L46000;
  77. case 27: goto L47000;
  78. case 28: goto L48000;
  79. case 29: goto L49000;
  80. case 30: goto L50000;
  81. case 31: goto L51000;
  82. case 32: goto L52000;
  83. case 33: goto L53000;
  84. case 34: goto L55000;
  85. case 35: goto L56000;
  86. case 36: goto L58000;
  87. case 37: goto L59000;
  88. case 38: goto L60000;
  89. case 39: goto L63000;
  90. case 40: goto L64000;
  91. case 41: goto L65000;
  92. case 42: goto L66000;
  93. case 43: goto L68000;
  94. case 44: goto L69000;
  95. case 45: goto L70000;
  96. case 46: goto L71000;
  97. case 47: goto L72000;
  98. case 48: goto L73000;
  99. case 49: goto L74000;
  100. case 50: goto L77000;
  101. case 51: goto L78000;
  102. case 52: goto L80000;
  103. case 53: goto L81000;
  104. case 54: goto L82000;
  105. case 55: goto L83000;
  106. case 56: goto L84000;
  107. case 57: goto L85000;
  108. case 58: goto L86000;
  109. case 59: goto L87000;
  110. case 60: goto L88000;
  111. }
  112. bug_(7, ri);
  113. /* ALL VERB PROCESSORS RETURN HERE TO DECLARE FAILURE. */
  114. L10:
  115. ret_val = FALSE_;
  116. /* !LOSE. */
  117. return ret_val;
  118. /* SIMPLE VERBS ARE HANDLED EXTERNALLY. */
  119. L100:
  120. ret_val = sverbs_(ri);
  121. return ret_val;
  122. /* VAPPLI, PAGE 3 */
  123. /* V100-- READ. OUR FIRST REAL VERB. */
  124. L18000:
  125. if (lit_(play_1.here)) {
  126. goto L18100;
  127. }
  128. /* !ROOM LIT? */
  129. rspeak_(356);
  130. /* !NO, CANT READ. */
  131. return ret_val;
  132. L18100:
  133. if (prsvec_1.prsi == 0) {
  134. goto L18200;
  135. }
  136. /* !READ THROUGH OBJ? */
  137. if ((objcts_1.oflag1[prsvec_1.prsi - 1] & TRANBT) != 0) {
  138. goto L18200;
  139. }
  140. rspsub_(357, odi2);
  141. /* !NOT TRANSPARENT. */
  142. return ret_val;
  143. L18200:
  144. if ((objcts_1.oflag1[prsvec_1.prso - 1] & READBT) != 0) {
  145. goto L18300;
  146. }
  147. rspsub_(358, odo2);
  148. /* !NOT READABLE. */
  149. return ret_val;
  150. L18300:
  151. if (! objact_()) {
  152. rspeak_(objcts_1.oread[prsvec_1.prso - 1]);
  153. }
  154. return ret_val;
  155. /* V101-- MELT. UNLESS OBJECT HANDLES, JOKE. */
  156. L20000:
  157. if (! objact_()) {
  158. rspsub_(361, odo2);
  159. }
  160. return ret_val;
  161. /* V102-- INFLATE. WORKS ONLY WITH BOATS. */
  162. L22000:
  163. if (! objact_()) {
  164. rspeak_(368);
  165. }
  166. /* !OBJ HANDLE? */
  167. return ret_val;
  168. /* V103-- DEFLATE. */
  169. L23000:
  170. if (! objact_()) {
  171. rspeak_(369);
  172. }
  173. /* !OBJ HANDLE? */
  174. return ret_val;
  175. /* VAPPLI, PAGE 4 */
  176. /* V104-- ALARM. IF SLEEPING, WAKE HIM UP. */
  177. L24000:
  178. if ((objcts_1.oflag2[prsvec_1.prso - 1] & SLEPBT) == 0) {
  179. goto L24100;
  180. }
  181. ret_val = objact_();
  182. /* !SLEEPING, LET OBJ DO. */
  183. return ret_val;
  184. L24100:
  185. rspsub_(370, odo2);
  186. /* !JOKE. */
  187. return ret_val;
  188. /* V105-- EXORCISE. OBJECTS HANDLE. */
  189. L25000:
  190. f = objact_();
  191. /* !OBJECTS HANDLE. */
  192. return ret_val;
  193. /* V106-- PLUG. LET OBJECTS HANDLE. */
  194. L26000:
  195. if (! objact_()) {
  196. rspeak_(371);
  197. }
  198. return ret_val;
  199. /* V107-- KICK. IF OBJECT IGNORES, JOKE. */
  200. L27000:
  201. if (! objact_()) {
  202. rspsb2_(378, odo2, rmk);
  203. }
  204. return ret_val;
  205. /* V108-- WAVE. SAME. */
  206. L28000:
  207. if (! objact_()) {
  208. rspsb2_(379, odo2, rmk);
  209. }
  210. return ret_val;
  211. /* V109,V110-- RAISE, LOWER. SAME. */
  212. L29000:
  213. L30000:
  214. if (! objact_()) {
  215. rspsb2_(380, odo2, rmk);
  216. }
  217. return ret_val;
  218. /* V111-- RUB. SAME. */
  219. L31000:
  220. if (! objact_()) {
  221. rspsb2_(381, odo2, rmk);
  222. }
  223. return ret_val;
  224. /* V112-- PUSH. SAME. */
  225. L32000:
  226. if (! objact_()) {
  227. rspsb2_(382, odo2, rmk);
  228. }
  229. return ret_val;
  230. /* VAPPLI, PAGE 5 */
  231. /* V113-- UNTIE. IF OBJECT IGNORES, JOKE. */
  232. L33000:
  233. if (objact_()) {
  234. return ret_val;
  235. }
  236. /* !OBJECT HANDLE? */
  237. i = 383;
  238. /* !NO, NOT TIED. */
  239. if ((objcts_1.oflag2[prsvec_1.prso - 1] & TIEBT) == 0) {
  240. i = 384;
  241. }
  242. rspeak_(i);
  243. return ret_val;
  244. /* V114-- TIE. NEVER REALLY WORKS. */
  245. L34000:
  246. if ((objcts_1.oflag2[prsvec_1.prso - 1] & TIEBT) != 0) {
  247. goto L34100;
  248. }
  249. rspeak_(385);
  250. /* !NOT TIEABLE. */
  251. return ret_val;
  252. L34100:
  253. if (! objact_()) {
  254. rspsub_(386, odo2);
  255. }
  256. /* !JOKE. */
  257. return ret_val;
  258. /* V115-- TIE UP. NEVER REALLY WORKS. */
  259. L35000:
  260. if ((objcts_1.oflag2[prsvec_1.prsi - 1] & TIEBT) != 0) {
  261. goto L35100;
  262. }
  263. rspsub_(387, odo2);
  264. /* !NOT TIEABLE. */
  265. return ret_val;
  266. L35100:
  267. i = 388;
  268. /* !ASSUME VILLAIN. */
  269. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VILLBT) == 0) {
  270. i = 389;
  271. }
  272. rspsub_(i, odo2);
  273. /* !JOKE. */
  274. return ret_val;
  275. /* V116-- TURN. OBJECT MUST HANDLE. */
  276. L36000:
  277. if ((objcts_1.oflag1[prsvec_1.prso - 1] & TURNBT) != 0) {
  278. goto L36100;
  279. }
  280. rspeak_(390);
  281. /* !NOT TURNABLE. */
  282. return ret_val;
  283. L36100:
  284. if ((objcts_1.oflag1[prsvec_1.prsi - 1] & TOOLBT) != 0) {
  285. goto L36200;
  286. }
  287. rspsub_(391, odi2);
  288. /* !NOT A TOOL. */
  289. return ret_val;
  290. L36200:
  291. ret_val = objact_();
  292. /* !LET OBJECT HANDLE. */
  293. return ret_val;
  294. /* V117-- BREATHE. BECOMES INFLATE WITH LUNGS. */
  295. L38000:
  296. prsvec_1.prsa = vindex_1.inflaw;
  297. prsvec_1.prsi = oindex_1.lungs;
  298. goto L22000;
  299. /* !HANDLE LIKE INFLATE. */
  300. /* V118-- KNOCK. MOSTLY JOKE. */
  301. L39000:
  302. if (objact_()) {
  303. return ret_val;
  304. }
  305. /* !OBJ HANDLE? */
  306. i = 394;
  307. /* !JOKE FOR DOOR. */
  308. if ((objcts_1.oflag1[prsvec_1.prso - 1] & DOORBT) == 0) {
  309. i = 395;
  310. }
  311. rspsub_(i, odo2);
  312. /* !JOKE FOR NONDOORS TOO. */
  313. return ret_val;
  314. /* V119-- LOOK. */
  315. L40000:
  316. if (prsvec_1.prso != 0) {
  317. goto L41500;
  318. }
  319. /* !SOMETHING TO LOOK AT? */
  320. ret_val = rmdesc_(3);
  321. /* !HANDLED BY RMDESC. */
  322. return ret_val;
  323. /* V120-- EXAMINE. */
  324. L41000:
  325. if (prsvec_1.prso != 0) {
  326. goto L41500;
  327. }
  328. /* !SOMETHING TO EXAMINE? */
  329. ret_val = rmdesc_(0);
  330. /* !HANDLED BY RMDESC. */
  331. return ret_val;
  332. L41500:
  333. if (objact_()) {
  334. return ret_val;
  335. }
  336. /* !OBJ HANDLE? */
  337. i = objcts_1.oread[prsvec_1.prso - 1];
  338. /* !GET READING MATERIAL. */
  339. if (i != 0) {
  340. rspeak_(i);
  341. }
  342. /* !OUTPUT IF THERE, */
  343. if (i == 0) {
  344. rspsub_(429, odo2);
  345. }
  346. /* !OTHERWISE DEFAULT. */
  347. prsvec_1.prsa = vindex_1.foow;
  348. /* !DEFUSE ROOM PROCESSORS. */
  349. return ret_val;
  350. /* V121-- SHAKE. IF HOLLOW OBJECT, SOME ACTION. */
  351. L42000:
  352. if (objact_()) {
  353. return ret_val;
  354. }
  355. /* !OBJECT HANDLE? */
  356. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VILLBT) == 0) {
  357. goto L42100;
  358. }
  359. rspeak_(371);
  360. /* !JOKE FOR VILLAINS. */
  361. return ret_val;
  362. L42100:
  363. if (qempty_(prsvec_1.prso) || (objcts_1.oflag1[prsvec_1.prso - 1] &
  364. TAKEBT) == 0) {
  365. goto L10;
  366. }
  367. if ((objcts_1.oflag2[prsvec_1.prso - 1] & OPENBT) != 0) {
  368. goto L42300;
  369. }
  370. /* !OPEN? SPILL. */
  371. rspsub_(396, odo2);
  372. /* !NO, DESCRIBE NOISE. */
  373. return ret_val;
  374. L42300:
  375. rspsub_(397, odo2);
  376. /* !SPILL THE WORKS. */
  377. i__1 = objcts_1.olnt;
  378. for (i = 1; i <= i__1; ++i) {
  379. /* !SPILL CONTENTS. */
  380. if (objcts_1.ocan[i - 1] != prsvec_1.prso) {
  381. goto L42500;
  382. }
  383. /* !INSIDE? */
  384. objcts_1.oflag2[i - 1] |= TCHBT;
  385. if (av == 0) {
  386. goto L42400;
  387. }
  388. /* !IN VEHICLE? */
  389. newsta_(i, 0, 0, av, 0);
  390. /* !YES, SPILL IN THERE. */
  391. goto L42500;
  392. L42400:
  393. newsta_(i, 0, play_1.here, 0, 0);
  394. /* !NO, SPILL ON FLOOR, */
  395. if (i == oindex_1.water) {
  396. newsta_(i, 133, 0, 0, 0);
  397. }
  398. /* !BUT WATER DISAPPEARS. */
  399. L42500:
  400. ;
  401. }
  402. return ret_val;
  403. /* V122-- MOVE. MOSTLY JOKES. */
  404. L43000:
  405. if (objact_()) {
  406. return ret_val;
  407. }
  408. /* !OBJ HANDLE? */
  409. i = 398;
  410. /* !ASSUME NOT HERE. */
  411. if (qhere_(prsvec_1.prso, play_1.here)) {
  412. i = 399;
  413. }
  414. rspsub_(i, odo2);
  415. /* !JOKE. */
  416. return ret_val;
  417. /* VAPPLI, PAGE 6 */
  418. /* V123-- TURN ON. */
  419. L44000:
  420. f = lit_(play_1.here);
  421. /* !RECORD IF LIT. */
  422. if (objact_()) {
  423. goto L44300;
  424. }
  425. /* !OBJ HANDLE? */
  426. if ((objcts_1.oflag1[prsvec_1.prso - 1] & LITEBT) != 0 &&
  427. objcts_1.oadv[prsvec_1.prso - 1] == play_1.winner) {
  428. goto L44100;
  429. }
  430. rspeak_(400);
  431. /* !CANT DO IT. */
  432. return ret_val;
  433. L44100:
  434. if ((objcts_1.oflag1[prsvec_1.prso - 1] & ONBT) == 0) {
  435. goto L44200;
  436. }
  437. rspeak_(401);
  438. /* !ALREADY ON. */
  439. return ret_val;
  440. L44200:
  441. objcts_1.oflag1[prsvec_1.prso - 1] |= ONBT;
  442. rspsub_(404, odo2);
  443. L44300:
  444. if (! f && lit_(play_1.here)) {
  445. f = rmdesc_(0);
  446. }
  447. /* !ROOM NEWLY LIT. */
  448. return ret_val;
  449. /* V124-- TURN OFF. */
  450. L45000:
  451. if (objact_()) {
  452. goto L45300;
  453. }
  454. /* !OBJ HANDLE? */
  455. if ((objcts_1.oflag1[prsvec_1.prso - 1] & LITEBT) != 0 &&
  456. objcts_1.oadv[prsvec_1.prso - 1] == play_1.winner) {
  457. goto L45100;
  458. }
  459. rspeak_(402);
  460. /* !CANT DO IT. */
  461. return ret_val;
  462. L45100:
  463. if ((objcts_1.oflag1[prsvec_1.prso - 1] & ONBT) != 0) {
  464. goto L45200;
  465. }
  466. rspeak_(403);
  467. /* !ALREADY OFF. */
  468. return ret_val;
  469. L45200:
  470. objcts_1.oflag1[prsvec_1.prso - 1] &= ~ ONBT;
  471. rspsub_(405, odo2);
  472. L45300:
  473. if (! lit_(play_1.here)) {
  474. rspeak_(406);
  475. }
  476. /* !MAY BE DARK. */
  477. return ret_val;
  478. /* V125-- OPEN. A FINE MESS. */
  479. L46000:
  480. if (objact_()) {
  481. return ret_val;
  482. }
  483. /* !OBJ HANDLE? */
  484. if ((objcts_1.oflag1[prsvec_1.prso - 1] & CONTBT) != 0) {
  485. goto L46100;
  486. }
  487. L46050:
  488. rspsub_(407, odo2);
  489. /* !NOT OPENABLE. */
  490. return ret_val;
  491. L46100:
  492. if (objcts_1.ocapac[prsvec_1.prso - 1] != 0) {
  493. goto L46200;
  494. }
  495. rspsub_(408, odo2);
  496. /* !NOT OPENABLE. */
  497. return ret_val;
  498. L46200:
  499. if (! ((objcts_1.oflag2[prsvec_1.prso - 1] & OPENBT) != 0)) {
  500. goto L46225;
  501. }
  502. rspeak_(412);
  503. /* !ALREADY OPEN. */
  504. return ret_val;
  505. L46225:
  506. objcts_1.oflag2[prsvec_1.prso - 1] |= OPENBT;
  507. if ((objcts_1.oflag1[prsvec_1.prso - 1] & TRANBT) != 0 ||
  508. qempty_(prsvec_1.prso)) {
  509. goto L46300;
  510. }
  511. princo_(prsvec_1.prso, 410);
  512. /* !PRINT CONTENTS. */
  513. return ret_val;
  514. L46300:
  515. rspeak_(409);
  516. /* !DONE */
  517. return ret_val;
  518. /* V126-- CLOSE. */
  519. L47000:
  520. if (objact_()) {
  521. return ret_val;
  522. }
  523. /* !OBJ HANDLE? */
  524. if ((objcts_1.oflag1[prsvec_1.prso - 1] & CONTBT) == 0) {
  525. goto L46050;
  526. }
  527. if (objcts_1.ocapac[prsvec_1.prso - 1] != 0) {
  528. goto L47100;
  529. }
  530. rspsub_(411, odo2);
  531. /* !NOT CLOSABLE. */
  532. return ret_val;
  533. L47100:
  534. if ((objcts_1.oflag2[prsvec_1.prso - 1] & OPENBT) != 0) {
  535. goto L47200;
  536. }
  537. /* !OPEN? */
  538. rspeak_(413);
  539. /* !NO, JOKE. */
  540. return ret_val;
  541. L47200:
  542. objcts_1.oflag2[prsvec_1.prso - 1] &= ~ OPENBT;
  543. rspeak_(414);
  544. /* !DONE. */
  545. return ret_val;
  546. /* VAPPLI, PAGE 7 */
  547. /* V127-- FIND. BIG MEGILLA. */
  548. L48000:
  549. if (objact_()) {
  550. return ret_val;
  551. }
  552. /* !OBJ HANDLE? */
  553. i = 415;
  554. /* !DEFAULT CASE. */
  555. if (qhere_(prsvec_1.prso, play_1.here)) {
  556. goto L48300;
  557. }
  558. /* !IN ROOM? */
  559. if (objcts_1.oadv[prsvec_1.prso - 1] == play_1.winner) {
  560. goto L48200;
  561. }
  562. /* !ON WINNER? */
  563. j = objcts_1.ocan[prsvec_1.prso - 1];
  564. /* !DOWN ONE LEVEL. */
  565. if (j == 0) {
  566. goto L10;
  567. }
  568. if ((objcts_1.oflag1[j - 1] & TRANBT) == 0 && (! ((
  569. objcts_1.oflag2[j - 1] & OPENBT) != 0) || (
  570. objcts_1.oflag1[j - 1] & DOORBT + CONTBT) == 0))
  571. {
  572. goto L10;
  573. }
  574. i = 417;
  575. /* !ASSUME IN ROOM. */
  576. if (qhere_(j, play_1.here)) {
  577. goto L48100;
  578. }
  579. if (objcts_1.oadv[j - 1] != play_1.winner) {
  580. goto L10;
  581. }
  582. /* !NOT HERE OR ON PERSON. */
  583. i = 418;
  584. L48100:
  585. rspsub_(i, objcts_1.odesc2[j - 1]);
  586. /* !DESCRIBE FINDINGS. */
  587. return ret_val;
  588. L48200:
  589. i = 416;
  590. L48300:
  591. rspsub_(i, odo2);
  592. /* !DESCRIBE FINDINGS. */
  593. return ret_val;
  594. /* V128-- WAIT. RUN CLOCK DEMON. */
  595. L49000:
  596. rspeak_(419);
  597. /* !TIME PASSES. */
  598. for (i = 1; i <= 3; ++i) {
  599. if (clockd_()) {
  600. return ret_val;
  601. }
  602. /* L49100: */
  603. }
  604. return ret_val;
  605. /* V129-- SPIN. */
  606. /* V159-- TURN TO. */
  607. L50000:
  608. L88000:
  609. if (! objact_()) {
  610. rspeak_(663);
  611. }
  612. /* !IF NOT OBJ, JOKE. */
  613. return ret_val;
  614. /* V130-- BOARD. WORKS WITH VEHICLES. */
  615. L51000:
  616. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VEHBT) != 0) {
  617. goto L51100;
  618. }
  619. rspsub_(421, odo2);
  620. /* !NOT VEHICLE, JOKE. */
  621. return ret_val;
  622. L51100:
  623. if (qhere_(prsvec_1.prso, play_1.here)) {
  624. goto L51200;
  625. }
  626. /* !HERE? */
  627. rspsub_(420, odo2);
  628. /* !NO, JOKE. */
  629. return ret_val;
  630. L51200:
  631. if (av == 0) {
  632. goto L51300;
  633. }
  634. /* !ALREADY GOT ONE? */
  635. rspsub_(422, odo2);
  636. /* !YES, JOKE. */
  637. return ret_val;
  638. L51300:
  639. if (objact_()) {
  640. return ret_val;
  641. }
  642. /* !OBJ HANDLE? */
  643. rspsub_(423, odo2);
  644. /* !DESCRIBE. */
  645. advs_1.avehic[play_1.winner - 1] = prsvec_1.prso;
  646. if (play_1.winner != aindex_1.player) {
  647. objcts_1.ocan[advs_1.aobj[play_1.winner - 1] - 1] = prsvec_1.prso;
  648. }
  649. return ret_val;
  650. /* V131-- DISEMBARK. */
  651. L52000:
  652. if (av == prsvec_1.prso) {
  653. goto L52100;
  654. }
  655. /* !FROM VEHICLE? */
  656. rspeak_(424);
  657. /* !NO, JOKE. */
  658. return ret_val;
  659. L52100:
  660. if (objact_()) {
  661. return ret_val;
  662. }
  663. /* !OBJ HANDLE? */
  664. if ((rooms_1.rflag[play_1.here - 1] & RLAND) != 0) {
  665. goto L52200;
  666. }
  667. rspeak_(425);
  668. /* !NOT ON LAND. */
  669. return ret_val;
  670. L52200:
  671. advs_1.avehic[play_1.winner - 1] = 0;
  672. rspeak_(426);
  673. if (play_1.winner != aindex_1.player) {
  674. newsta_(advs_1.aobj[play_1.winner - 1], 0, play_1.here, 0, 0);
  675. }
  676. return ret_val;
  677. /* V132-- TAKE. HANDLED EXTERNALLY. */
  678. L53000:
  679. ret_val = take_(1);
  680. return ret_val;
  681. /* V133-- INVENTORY. PROCESSED EXTERNALLY. */
  682. L55000:
  683. invent_(play_1.winner);
  684. return ret_val;
  685. /* VAPPLI, PAGE 8 */
  686. /* V134-- FILL. STRANGE DOINGS WITH WATER. */
  687. L56000:
  688. if (prsvec_1.prsi != 0) {
  689. goto L56050;
  690. }
  691. /* !ANY OBJ SPECIFIED? */
  692. if ((rooms_1.rflag[play_1.here - 1] & RWATER + RFILL) !=
  693. 0) {
  694. goto L56025;
  695. }
  696. rspeak_(516);
  697. /* !NOTHING TO FILL WITH. */
  698. prsvec_1.prswon = FALSE_;
  699. /* !YOU LOSE. */
  700. return ret_val;
  701. L56025:
  702. prsvec_1.prsi = oindex_1.gwate;
  703. /* !USE GLOBAL WATER. */
  704. L56050:
  705. if (objact_()) {
  706. return ret_val;
  707. }
  708. /* !OBJ HANDLE? */
  709. if (prsvec_1.prsi != oindex_1.gwate && prsvec_1.prsi != oindex_1.water) {
  710. rspsb2_(444, odi2, odo2);
  711. }
  712. return ret_val;
  713. /* V135,V136-- EAT/DRINK */
  714. L58000:
  715. L59000:
  716. if (objact_()) {
  717. return ret_val;
  718. }
  719. /* !OBJ HANDLE? */
  720. if (prsvec_1.prso == oindex_1.gwate) {
  721. goto L59500;
  722. }
  723. /* !DRINK GLOBAL WATER? */
  724. if (! ((objcts_1.oflag1[prsvec_1.prso - 1] & FOODBT) != 0)) {
  725. goto L59400;
  726. }
  727. /* !EDIBLE? */
  728. if (objcts_1.oadv[prsvec_1.prso - 1] == play_1.winner) {
  729. goto L59200;
  730. }
  731. /* !YES, ON WINNER? */
  732. L59100:
  733. rspsub_(454, odo2);
  734. /* !NOT ACCESSIBLE. */
  735. return ret_val;
  736. L59200:
  737. if (prsvec_1.prsa == vindex_1.drinkw) {
  738. goto L59300;
  739. }
  740. /* !DRINK FOOD? */
  741. newsta_(prsvec_1.prso, 455, 0, 0, 0);
  742. /* !NO, IT DISAPPEARS. */
  743. return ret_val;
  744. L59300:
  745. rspeak_(456);
  746. /* !YES, JOKE. */
  747. return ret_val;
  748. L59400:
  749. if (! ((objcts_1.oflag1[prsvec_1.prso - 1] & DRNKBT) != 0)) {
  750. goto L59600;
  751. }
  752. /* !DRINKABLE? */
  753. if (objcts_1.ocan[prsvec_1.prso - 1] == 0) {
  754. goto L59100;
  755. }
  756. /* !YES, IN SOMETHING? */
  757. if (objcts_1.oadv[objcts_1.ocan[prsvec_1.prso - 1] - 1] != play_1.winner)
  758. {
  759. goto L59100;
  760. }
  761. if ((objcts_1.oflag2[objcts_1.ocan[prsvec_1.prso - 1] - 1] &
  762. OPENBT) != 0) {
  763. goto L59500;
  764. }
  765. /* !CONT OPEN? */
  766. rspeak_(457);
  767. /* !NO, JOKE. */
  768. return ret_val;
  769. L59500:
  770. newsta_(prsvec_1.prso, 458, 0, 0, 0);
  771. /* !GONE. */
  772. return ret_val;
  773. L59600:
  774. rspsub_(453, odo2);
  775. /* !NOT FOOD OR DRINK. */
  776. return ret_val;
  777. /* V137-- BURN. COMPLICATED. */
  778. L60000:
  779. if ((objcts_1.oflag1[prsvec_1.prsi - 1] & FLAMBT +
  780. LITEBT + ONBT) != FLAMBT +
  781. LITEBT + ONBT) {
  782. goto L60400;
  783. }
  784. if (objact_()) {
  785. return ret_val;
  786. }
  787. /* !OBJ HANDLE? */
  788. if (objcts_1.ocan[prsvec_1.prso - 1] != oindex_1.recep) {
  789. goto L60050;
  790. }
  791. /* !BALLOON? */
  792. if (oappli_(objcts_1.oactio[oindex_1.ballo - 1], 0)) {
  793. return ret_val;
  794. }
  795. /* !DID IT HANDLE? */
  796. L60050:
  797. if ((objcts_1.oflag1[prsvec_1.prso - 1] & BURNBT) == 0) {
  798. goto L60300;
  799. }
  800. if (objcts_1.oadv[prsvec_1.prso - 1] != play_1.winner) {
  801. goto L60100;
  802. }
  803. /* !CARRYING IT? */
  804. rspsub_(459, odo2);
  805. jigsup_(460);
  806. return ret_val;
  807. L60100:
  808. j = objcts_1.ocan[prsvec_1.prso - 1];
  809. /* !GET CONTAINER. */
  810. if (qhere_(prsvec_1.prso, play_1.here) || av != 0 && j == av) {
  811. goto L60200;
  812. }
  813. if (j == 0) {
  814. goto L60150;
  815. }
  816. /* !INSIDE? */
  817. if (! ((objcts_1.oflag2[j - 1] & OPENBT) != 0)) {
  818. goto L60150;
  819. }
  820. /* !OPEN? */
  821. if (qhere_(j, play_1.here) || av != 0 && objcts_1.ocan[j - 1] == av) {
  822. goto L60200;
  823. }
  824. L60150:
  825. rspeak_(461);
  826. /* !CANT REACH IT. */
  827. return ret_val;
  828. L60200:
  829. rspsub_(462, odo2);
  830. /* !BURN IT. */
  831. newsta_(prsvec_1.prso, 0, 0, 0, 0);
  832. return ret_val;
  833. L60300:
  834. rspsub_(463, odo2);
  835. /* !CANT BURN IT. */
  836. return ret_val;
  837. L60400:
  838. rspsub_(301, odi2);
  839. /* !CANT BURN IT WITH THAT. */
  840. return ret_val;
  841. /* VAPPLI, PAGE 9 */
  842. /* V138-- MUNG. GO TO COMMON ATTACK CODE. */
  843. L63000:
  844. i = 466;
  845. /* !CHOOSE PHRASE. */
  846. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VILLBT) != 0) {
  847. goto L66100;
  848. }
  849. if (! objact_()) {
  850. rspsb2_(466, odo2, rmk);
  851. }
  852. return ret_val;
  853. /* V139-- KILL. GO TO COMMON ATTACK CODE. */
  854. L64000:
  855. i = 467;
  856. /* !CHOOSE PHRASE. */
  857. goto L66100;
  858. /* V140-- SWING. INVERT OBJECTS, FALL THRU TO ATTACK. */
  859. L65000:
  860. j = prsvec_1.prso;
  861. /* !INVERT. */
  862. prsvec_1.prso = prsvec_1.prsi;
  863. prsvec_1.prsi = j;
  864. j = odo2;
  865. odo2 = odi2;
  866. odi2 = j;
  867. prsvec_1.prsa = vindex_1.attacw;
  868. /* !FOR OBJACT. */
  869. /* V141-- ATTACK. FALL THRU TO ATTACK CODE. */
  870. L66000:
  871. i = 468;
  872. /* COMMON MUNG/ATTACK/SWING/KILL CODE. */
  873. L66100:
  874. if (prsvec_1.prso != 0) {
  875. goto L66200;
  876. }
  877. /* !ANYTHING? */
  878. rspeak_(469);
  879. /* !NO, JOKE. */
  880. return ret_val;
  881. L66200:
  882. if (objact_()) {
  883. return ret_val;
  884. }
  885. /* !OBJ HANDLE? */
  886. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VILLBT) != 0) {
  887. goto L66300;
  888. }
  889. if ((objcts_1.oflag1[prsvec_1.prso - 1] & VICTBT) == 0) {
  890. rspsub_(470, odo2);
  891. }
  892. return ret_val;
  893. L66300:
  894. j = 471;
  895. /* !ASSUME NO WEAPON. */
  896. if (prsvec_1.prsi == 0) {
  897. goto L66500;
  898. }
  899. if ((objcts_1.oflag2[prsvec_1.prsi - 1] & WEAPBT) == 0) {
  900. goto L66400;
  901. }
  902. melee = 1;
  903. /* !ASSUME SWORD. */
  904. if (prsvec_1.prsi != oindex_1.sword) {
  905. melee = 2;
  906. }
  907. /* !MUST BE KNIFE. */
  908. i = blow_(aindex_1.player, prsvec_1.prso, melee, 1, 0);
  909. /* !STRIKE BLOW. */
  910. return ret_val;
  911. L66400:
  912. j = 472;
  913. /* !NOT A WEAPON. */
  914. L66500:
  915. rspsb2_(i, odo2, j);
  916. /* !JOKE. */
  917. return ret_val;
  918. /* VAPPLI, PAGE 10 */
  919. /* V142-- WALK. PROCESSED EXTERNALLY. */
  920. L68000:
  921. ret_val = walk_();
  922. return ret_val;
  923. /* V143-- TELL. PROCESSED IN GAME. */
  924. L69000:
  925. rspeak_(603);
  926. return ret_val;
  927. /* V144-- PUT. PROCESSED EXTERNALLY. */
  928. L70000:
  929. ret_val = put_(1);
  930. return ret_val;
  931. /* V145,V146,V147,V148-- DROP/GIVE/POUR/THROW */
  932. L71000:
  933. L72000:
  934. L73000:
  935. L74000:
  936. ret_val = drop_(0);
  937. return ret_val;
  938. /* V149-- SAVE */
  939. L77000:
  940. if ((rooms_1.rflag[rindex_1.tstrs - 1] & RSEEN) == 0) {
  941. goto L77100;
  942. }
  943. rspeak_(828);
  944. /* !NO SAVES IN ENDGAME. */
  945. return ret_val;
  946. L77100:
  947. savegm_();
  948. return ret_val;
  949. /* V150-- RESTORE */
  950. L78000:
  951. if ((rooms_1.rflag[rindex_1.tstrs - 1] & RSEEN) == 0) {
  952. goto L78100;
  953. }
  954. rspeak_(829);
  955. /* !NO RESTORES IN ENDGAME. */
  956. return ret_val;
  957. L78100:
  958. rstrgm_();
  959. return ret_val;
  960. /* VAPPLI, PAGE 11 */
  961. /* V151-- HELLO */
  962. L80000:
  963. if (prsvec_1.prso != 0) {
  964. goto L80100;
  965. }
  966. /* !ANY OBJ? */
  967. i__1 = rnd_(4) + 346;
  968. rspeak_(i__1);
  969. /* !NO, VANILLA HELLO. */
  970. return ret_val;
  971. L80100:
  972. if (prsvec_1.prso != oindex_1.aviat) {
  973. goto L80200;
  974. }
  975. /* !HELLO AVIATOR? */
  976. rspeak_(350);
  977. /* !NOTHING HAPPENS. */
  978. return ret_val;
  979. L80200:
  980. if (prsvec_1.prso != oindex_1.sailo) {
  981. goto L80300;
  982. }
  983. /* !HELLO SAILOR? */
  984. ++state_1.hs;
  985. /* !COUNT. */
  986. i = 351;
  987. /* !GIVE NORMAL OR */
  988. if (state_1.hs % 10 == 0) {
  989. i = 352;
  990. }
  991. /* !RANDOM MESSAGE. */
  992. if (state_1.hs % 20 == 0) {
  993. i = 353;
  994. }
  995. rspeak_(i);
  996. /* !SPEAK UP. */
  997. return ret_val;
  998. L80300:
  999. if (objact_()) {
  1000. return ret_val;
  1001. }
  1002. /* !OBJ HANDLE? */
  1003. i = 354;
  1004. /* !ASSUME VILLAIN. */
  1005. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VILLBT +
  1006. ACTRBT) == 0) {
  1007. i = 355;
  1008. }
  1009. rspsub_(i, odo2);
  1010. /* !HELLO THERE */
  1011. /* ! */
  1012. return ret_val;
  1013. /* V152-- LOOK INTO */
  1014. L81000:
  1015. if (objact_()) {
  1016. return ret_val;
  1017. }
  1018. /* !OBJ HANDLE? */
  1019. if ((objcts_1.oflag1[prsvec_1.prso - 1] & DOORBT) == 0) {
  1020. goto L81300;
  1021. }
  1022. if (! ((objcts_1.oflag2[prsvec_1.prso - 1] & OPENBT) != 0)) {
  1023. goto L81200;
  1024. }
  1025. /* !OPEN? */
  1026. rspsub_(628, odo2);
  1027. /* !OPEN DOOR- UNINTERESTING. */
  1028. return ret_val;
  1029. L81200:
  1030. rspsub_(525, odo2);
  1031. /* !CLOSED DOOR- CANT SEE. */
  1032. return ret_val;
  1033. L81300:
  1034. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VEHBT) != 0) {
  1035. goto L81400;
  1036. }
  1037. if ((objcts_1.oflag2[prsvec_1.prso - 1] & OPENBT) != 0 || (
  1038. objcts_1.oflag1[prsvec_1.prso - 1] & TRANBT) != 0) {
  1039. goto L81400;
  1040. }
  1041. if ((objcts_1.oflag1[prsvec_1.prso - 1] & CONTBT) != 0) {
  1042. goto L81200;
  1043. }
  1044. rspsub_(630, odo2);
  1045. /* !CANT LOOK INSIDE. */
  1046. return ret_val;
  1047. L81400:
  1048. if (qempty_(prsvec_1.prso)) {
  1049. goto L81500;
  1050. }
  1051. /* !VEH OR SEE IN. EMPTY? */
  1052. princo_(prsvec_1.prso, 573);
  1053. /* !NO, LIST CONTENTS. */
  1054. return ret_val;
  1055. L81500:
  1056. rspsub_(629, odo2);
  1057. /* !EMPTY. */
  1058. return ret_val;
  1059. /* V153-- LOOK UNDER */
  1060. L82000:
  1061. if (! objact_()) {
  1062. rspeak_(631);
  1063. }
  1064. /* !OBJECT HANDLE? */
  1065. return ret_val;
  1066. /* VAPPLI, PAGE 12 */
  1067. /* V154-- PUMP */
  1068. L83000:
  1069. if (objcts_1.oroom[oindex_1.pump - 1] == play_1.here || objcts_1.oadv[
  1070. oindex_1.pump - 1] == play_1.winner) {
  1071. goto L83100;
  1072. }
  1073. rspeak_(632);
  1074. /* !NO. */
  1075. return ret_val;
  1076. L83100:
  1077. prsvec_1.prsi = oindex_1.pump;
  1078. /* !BECOMES INFLATE */
  1079. prsvec_1.prsa = vindex_1.inflaw;
  1080. /* !X WITH PUMP. */
  1081. goto L22000;
  1082. /* !DONE. */
  1083. /* V155-- WIND */
  1084. L84000:
  1085. if (! objact_()) {
  1086. rspsub_(634, odo2);
  1087. }
  1088. /* !OBJ HANDLE? */
  1089. return ret_val;
  1090. /* V156-- CLIMB */
  1091. /* V157-- CLIMB UP */
  1092. /* V158-- CLIMB DOWN */
  1093. L85000:
  1094. L86000:
  1095. L87000:
  1096. i = xsrch_1.xup;
  1097. /* !ASSUME UP. */
  1098. if (prsvec_1.prsa == vindex_1.clmbdw) {
  1099. i = xsrch_1.xdown;
  1100. }
  1101. /* !UNLESS CLIMB DN. */
  1102. f = (objcts_1.oflag2[prsvec_1.prso - 1] & CLMBBT) != 0;
  1103. if (f && findxt_(i, play_1.here)) {
  1104. goto L87500;
  1105. }
  1106. /* !ANYTHING TO CLIMB? */
  1107. if (objact_()) {
  1108. return ret_val;
  1109. }
  1110. /* !OBJ HANDLE? */
  1111. i = 657;
  1112. if (f) {
  1113. i = 524;
  1114. }
  1115. /* !VARIETY OF JOKES. */
  1116. if (! f && (prsvec_1.prso == oindex_1.wall || prsvec_1.prso >=
  1117. oindex_1.wnort && prsvec_1.prso <= oindex_1.wnort + 3)) {
  1118. i = 656;
  1119. }
  1120. rspeak_(i);
  1121. /* !JOKE. */
  1122. return ret_val;
  1123. L87500:
  1124. prsvec_1.prsa = vindex_1.walkw;
  1125. /* !WALK */
  1126. prsvec_1.prso = i;
  1127. /* !IN SPECIFIED DIR. */
  1128. ret_val = walk_();
  1129. return ret_val;
  1130. } /* vappli_ */
  1131. /* CLOCKD- CLOCK DEMON FOR INTERMOVE CLOCK EVENTS */
  1132. /* DECLARATIONS */
  1133. logical clockd_()
  1134. {
  1135. /* System generated locals */
  1136. integer i__1;
  1137. logical ret_val;
  1138. /* Local variables */
  1139. integer i;
  1140. ret_val = FALSE_;
  1141. /* !ASSUME NO ACTION. */
  1142. i__1 = cevent_1.clnt;
  1143. for (i = 1; i <= i__1; ++i) {
  1144. if (! cevent_1.cflag[i - 1] || cevent_1.ctick[i - 1] == 0) {
  1145. goto L100;
  1146. }
  1147. if (cevent_1.ctick[i - 1] < 0) {
  1148. goto L50;
  1149. }
  1150. /* !PERMANENT ENTRY? */
  1151. --cevent_1.ctick[i - 1];
  1152. if (cevent_1.ctick[i - 1] != 0) {
  1153. goto L100;
  1154. }
  1155. /* !TIMER EXPIRED? */
  1156. L50:
  1157. ret_val = TRUE_;
  1158. cevapp_(cevent_1.cactio[i - 1]);
  1159. /* !DO ACTION. */
  1160. L100:
  1161. ;
  1162. }
  1163. return ret_val;
  1164. } /* clockd_ */