sverbs.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. /* SVERBS- SIMPLE VERBS PROCESSOR */
  2. /* ALL VERBS IN THIS ROUTINE MUST BE INDEPENDANT */
  3. /* OF OBJECT ACTIONS */
  4. /*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/
  5. /* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */
  6. /* WRITTEN BY R. M. SUPNIK */
  7. #include <stdio.h>
  8. #include "funcs.h"
  9. #include "vars.h"
  10. logical sverbs_(ri)
  11. integer ri;
  12. {
  13. /* Initialized data */
  14. const integer mxnop = 39;
  15. const integer mxjoke = 64;
  16. static const integer jokes[25] = { 4,5,3,304,305,306,307,308,309,310,311,
  17. 312,313,5314,5319,324,325,883,884,120,120,0,0,0,0 };
  18. static const integer answer[14] = { 0,1,2,3,4,4,4,4,5,5,5,6,7,7};
  19. static const char * const ansstr[14] =
  20. { "TEMPLE", "FOREST", "30003", "FLASK", "RUB", "FONDLE",
  21. "CARRES", "TOUCH", "BONES", "BODY", "SKELE", "RUSTYKNIFE",
  22. "NONE", "NOWHER" };
  23. /* System generated locals */
  24. integer i__1, i__2;
  25. logical ret_val;
  26. /* Local variables */
  27. logical f;
  28. const char *z, *z2;
  29. integer i, j;
  30. integer k;
  31. integer l;
  32. char ch[1*6];
  33. integer cp, wp;
  34. char pp1[1*6], pp2[1*6];
  35. integer odi2 = 0, odo2 = 0;
  36. ret_val = TRUE_;
  37. /* !ASSUME WINS. */
  38. if (prsvec_1.prso != 0) {
  39. odo2 = objcts_1.odesc2[prsvec_1.prso - 1];
  40. }
  41. /* !SET UP DESCRIPTORS. */
  42. if (prsvec_1.prsi != 0) {
  43. odi2 = objcts_1.odesc2[prsvec_1.prsi - 1];
  44. }
  45. if (ri == 0) {
  46. bug_(7, ri);
  47. }
  48. /* !ZERO IS VERBOTEN. */
  49. if (ri <= mxnop) {
  50. return ret_val;
  51. }
  52. /* !NOP? */
  53. if (ri <= mxjoke) {
  54. goto L100;
  55. }
  56. /* !JOKE? */
  57. switch (ri - mxjoke) {
  58. case 1: goto L65000;
  59. case 2: goto L66000;
  60. case 3: goto L67000;
  61. case 4: goto L68000;
  62. case 5: goto L69000;
  63. case 6: goto L1000;
  64. case 7: goto L2000;
  65. case 8: goto L3000;
  66. case 9: goto L4000;
  67. case 10: goto L5000;
  68. case 11: goto L6000;
  69. case 12: goto L7000;
  70. case 13: goto L8000;
  71. case 14: goto L9000;
  72. case 15: goto L10000;
  73. case 16: goto L11000;
  74. case 17: goto L12000;
  75. case 18: goto L13000;
  76. case 19: goto L14000;
  77. case 20: goto L15000;
  78. case 21: goto L16000;
  79. case 22: goto L17000;
  80. case 23: goto L18000;
  81. case 24: goto L19000;
  82. case 25: goto L20000;
  83. case 26: goto L21000;
  84. case 27: goto L22000;
  85. case 28: goto L23000;
  86. case 29: goto L24000;
  87. case 30: goto L25000;
  88. case 31: goto L26000;
  89. case 32: goto L27000;
  90. }
  91. bug_(7, ri);
  92. /* ALL VERB PROCESSORS RETURN HERE TO DECLARE FAILURE. */
  93. /* L10: */
  94. ret_val = FALSE_;
  95. /* !LOSE. */
  96. return ret_val;
  97. /* JOKE PROCESSOR. */
  98. /* FIND PROPER ENTRY IN JOKES, USE IT TO SELECT STRING TO PRINT. */
  99. L100:
  100. i = jokes[ri - mxnop - 1];
  101. /* !GET TABLE ENTRY. */
  102. j = i / 1000;
  103. /* !ISOLATE # STRINGS. */
  104. if (j != 0) {
  105. i = i % 1000 + rnd_(j);
  106. }
  107. /* !IF RANDOM, CHOOSE. */
  108. rspeak_(i);
  109. /* !PRINT JOKE. */
  110. return ret_val;
  111. /* SVERBS, PAGE 2A */
  112. /* V65-- ROOM */
  113. L65000:
  114. ret_val = rmdesc_(2);
  115. /* !DESCRIBE ROOM ONLY. */
  116. return ret_val;
  117. /* V66-- OBJECTS */
  118. L66000:
  119. ret_val = rmdesc_(1);
  120. /* !DESCRIBE OBJ ONLY. */
  121. if (! play_1.telflg) {
  122. rspeak_(138);
  123. }
  124. /* !NO OBJECTS. */
  125. return ret_val;
  126. /* V67-- RNAME */
  127. L67000:
  128. i__1 = rooms_1.rdesc2[play_1.here - 1];
  129. rspeak_(i__1);
  130. /* !SHORT ROOM NAME. */
  131. return ret_val;
  132. /* V68-- RESERVED */
  133. L68000:
  134. return ret_val;
  135. /* V69-- RESERVED */
  136. L69000:
  137. return ret_val;
  138. /* SVERBS, PAGE 3 */
  139. /* V70-- BRIEF. SET FLAG. */
  140. L1000:
  141. findex_1.brieff = TRUE_;
  142. /* !BRIEF DESCRIPTIONS. */
  143. findex_1.superf = FALSE_;
  144. rspeak_(326);
  145. return ret_val;
  146. /* V71-- VERBOSE. CLEAR FLAGS. */
  147. L2000:
  148. findex_1.brieff = FALSE_;
  149. /* !LONG DESCRIPTIONS. */
  150. findex_1.superf = FALSE_;
  151. rspeak_(327);
  152. return ret_val;
  153. /* V72-- SUPERBRIEF. SET FLAG. */
  154. L3000:
  155. findex_1.superf = TRUE_;
  156. rspeak_(328);
  157. return ret_val;
  158. /* V73-- STAY (USED IN ENDGAME). */
  159. L4000:
  160. if (play_1.winner != aindex_1.amastr) {
  161. goto L4100;
  162. }
  163. /* !TELL MASTER, STAY. */
  164. rspeak_(781);
  165. /* !HE DOES. */
  166. cevent_1.ctick[cindex_1.cevfol - 1] = 0;
  167. /* !NOT FOLLOWING. */
  168. return ret_val;
  169. L4100:
  170. if (play_1.winner == aindex_1.player) {
  171. rspeak_(664);
  172. }
  173. /* !JOKE. */
  174. return ret_val;
  175. /* V74-- VERSION. PRINT INFO. */
  176. L5000:
  177. more_output(NULL);
  178. printf("V%1d.%1d%c\n", vers_1.vmaj, vers_1.vmin, vers_1.vedit);
  179. play_1.telflg = TRUE_;
  180. return ret_val;
  181. /* V75-- SWIM. ALWAYS A JOKE. */
  182. L6000:
  183. i = 330;
  184. /* !ASSUME WATER. */
  185. if ((rooms_1.rflag[play_1.here - 1] & RWATER + RFILL) ==
  186. 0) {
  187. i = rnd_(3) + 331;
  188. }
  189. rspeak_(i);
  190. return ret_val;
  191. /* V76-- GERONIMO. IF IN BARREL, FATAL, ELSE JOKE. */
  192. L7000:
  193. if (play_1.here == rindex_1.mbarr) {
  194. goto L7100;
  195. }
  196. /* !IN BARREL? */
  197. rspeak_(334);
  198. /* !NO, JOKE. */
  199. return ret_val;
  200. L7100:
  201. jigsup_(335);
  202. /* !OVER FALLS. */
  203. return ret_val;
  204. /* V77-- SINBAD ET AL. CHASE CYCLOPS, ELSE JOKE. */
  205. L8000:
  206. if (play_1.here == rindex_1.mcycl && qhere_(oindex_1.cyclo, play_1.here)
  207. ) {
  208. goto L8100;
  209. }
  210. rspeak_(336);
  211. /* !NOT HERE, JOKE. */
  212. return ret_val;
  213. L8100:
  214. newsta_(oindex_1.cyclo, 337, 0, 0, 0);
  215. /* !CYCLOPS FLEES. */
  216. findex_1.cyclof = TRUE_;
  217. /* !SET ALL FLAGS. */
  218. findex_1.magicf = TRUE_;
  219. objcts_1.oflag2[oindex_1.cyclo - 1] &= ~ FITEBT;
  220. return ret_val;
  221. /* V78-- WELL. OPEN DOOR, ELSE JOKE. */
  222. L9000:
  223. if (findex_1.riddlf || play_1.here != rindex_1.riddl) {
  224. goto L9100;
  225. }
  226. /* !IN RIDDLE ROOM? */
  227. findex_1.riddlf = TRUE_;
  228. /* !YES, SOLVED IT. */
  229. rspeak_(338);
  230. return ret_val;
  231. L9100:
  232. rspeak_(339);
  233. /* !WELL, WHAT? */
  234. return ret_val;
  235. /* V79-- PRAY. IF IN TEMP2, POOF */
  236. /* ! */
  237. L10000:
  238. if (play_1.here != rindex_1.temp2) {
  239. goto L10050;
  240. }
  241. /* !IN TEMPLE? */
  242. if (moveto_(rindex_1.fore1, play_1.winner)) {
  243. goto L10100;
  244. }
  245. /* !FORE1 STILL THERE? */
  246. L10050:
  247. rspeak_(340);
  248. /* !JOKE. */
  249. return ret_val;
  250. L10100:
  251. f = rmdesc_(3);
  252. /* !MOVED, DESCRIBE. */
  253. return ret_val;
  254. /* V80-- TREASURE. IF IN TEMP1, POOF */
  255. /* ! */
  256. L11000:
  257. if (play_1.here != rindex_1.temp1) {
  258. goto L11050;
  259. }
  260. /* !IN TEMPLE? */
  261. if (moveto_(rindex_1.treas, play_1.winner)) {
  262. goto L10100;
  263. }
  264. /* !TREASURE ROOM THERE? */
  265. L11050:
  266. rspeak_(341);
  267. /* !NOTHING HAPPENS. */
  268. return ret_val;
  269. /* V81-- TEMPLE. IF IN TREAS, POOF */
  270. /* ! */
  271. L12000:
  272. if (play_1.here != rindex_1.treas) {
  273. goto L12050;
  274. }
  275. /* !IN TREASURE? */
  276. if (moveto_(rindex_1.temp1, play_1.winner)) {
  277. goto L10100;
  278. }
  279. /* !TEMP1 STILL THERE? */
  280. L12050:
  281. rspeak_(341);
  282. /* !NOTHING HAPPENS. */
  283. return ret_val;
  284. /* V82-- BLAST. USUALLY A JOKE. */
  285. L13000:
  286. i = 342;
  287. /* !DONT UNDERSTAND. */
  288. if (prsvec_1.prso == oindex_1.safe) {
  289. i = 252;
  290. }
  291. /* !JOKE FOR SAFE. */
  292. rspeak_(i);
  293. return ret_val;
  294. /* V83-- SCORE. PRINT SCORE. */
  295. L14000:
  296. score_(0);
  297. return ret_val;
  298. /* V84-- QUIT. FINISH OUT THE GAME. */
  299. L15000:
  300. score_(1);
  301. /* !TELLL SCORE. */
  302. if (! yesno_(343, 0, 0)) {
  303. return ret_val;
  304. }
  305. /* !ASK FOR Y/N DECISION. */
  306. exit_();
  307. /* !BYE. */
  308. /* SVERBS, PAGE 4 */
  309. /* V85-- FOLLOW (USED IN ENDGAME) */
  310. L16000:
  311. if (play_1.winner != aindex_1.amastr) {
  312. return ret_val;
  313. }
  314. /* !TELL MASTER, FOLLOW. */
  315. rspeak_(782);
  316. cevent_1.ctick[cindex_1.cevfol - 1] = -1;
  317. /* !STARTS FOLLOWING. */
  318. return ret_val;
  319. /* V86-- WALK THROUGH */
  320. L17000:
  321. if (screen_1.scolrm == 0 || prsvec_1.prso != oindex_1.scol && (
  322. prsvec_1.prso != oindex_1.wnort || play_1.here != rindex_1.bkbox))
  323. {
  324. goto L17100;
  325. }
  326. screen_1.scolac = screen_1.scolrm;
  327. /* !WALKED THRU SCOL. */
  328. prsvec_1.prso = 0;
  329. /* !FAKE OUT FROMDR. */
  330. cevent_1.ctick[cindex_1.cevscl - 1] = 6;
  331. /* !START ALARM. */
  332. rspeak_(668);
  333. /* !DISORIENT HIM. */
  334. f = moveto_(screen_1.scolrm, play_1.winner);
  335. /* !INTO ROOM. */
  336. f = rmdesc_(3);
  337. /* !DESCRIBE. */
  338. return ret_val;
  339. L17100:
  340. if (play_1.here != screen_1.scolac) {
  341. goto L17300;
  342. }
  343. /* !ON OTHER SIDE OF SCOL? */
  344. for (i = 1; i <= 12; i += 3) {
  345. /* !WALK THRU PROPER WALL? */
  346. if (screen_1.scolwl[i - 1] == play_1.here && screen_1.scolwl[i] ==
  347. prsvec_1.prso) {
  348. goto L17500;
  349. }
  350. /* L17200: */
  351. }
  352. L17300:
  353. if ((objcts_1.oflag1[prsvec_1.prso - 1] & TAKEBT) != 0) {
  354. goto L17400;
  355. }
  356. i = 669;
  357. /* !NO, JOKE. */
  358. if (prsvec_1.prso == oindex_1.scol) {
  359. i = 670;
  360. }
  361. /* !SPECIAL JOKE FOR SCOL. */
  362. rspsub_(i, odo2);
  363. return ret_val;
  364. L17400:
  365. i = 671;
  366. /* !JOKE. */
  367. if (objcts_1.oroom[prsvec_1.prso - 1] != 0) {
  368. i = rnd_(5) + 552;
  369. }
  370. /* !SPECIAL JOKES IF CARRY. */
  371. rspeak_(i);
  372. return ret_val;
  373. L17500:
  374. prsvec_1.prso = screen_1.scolwl[i + 1];
  375. /* !THRU SCOL WALL... */
  376. for (i = 1; i <= 8; i += 2) {
  377. /* !FIND MATCHING ROOM. */
  378. if (prsvec_1.prso == screen_1.scoldr[i - 1]) {
  379. screen_1.scolrm = screen_1.scoldr[i];
  380. }
  381. /* L17600: */
  382. }
  383. /* !DECLARE NEW SCOLRM. */
  384. cevent_1.ctick[cindex_1.cevscl - 1] = 0;
  385. /* !CANCEL ALARM. */
  386. rspeak_(668);
  387. /* !DISORIENT HIM. */
  388. f = moveto_(rindex_1.bkbox, play_1.winner);
  389. /* !BACK IN BOX ROOM. */
  390. f = rmdesc_(3);
  391. return ret_val;
  392. /* V87-- RING. A JOKE. */
  393. L18000:
  394. i = 359;
  395. /* !CANT RING. */
  396. if (prsvec_1.prso == oindex_1.bell) {
  397. i = 360;
  398. }
  399. /* !DING, DONG. */
  400. rspeak_(i);
  401. /* !JOKE. */
  402. return ret_val;
  403. /* V88-- BRUSH. JOKE WITH OBSCURE TRAP. */
  404. L19000:
  405. if (prsvec_1.prso == oindex_1.teeth) {
  406. goto L19100;
  407. }
  408. /* !BRUSH TEETH? */
  409. rspeak_(362);
  410. /* !NO, JOKE. */
  411. return ret_val;
  412. L19100:
  413. if (prsvec_1.prsi != 0) {
  414. goto L19200;
  415. }
  416. /* !WITH SOMETHING? */
  417. rspeak_(363);
  418. /* !NO, JOKE. */
  419. return ret_val;
  420. L19200:
  421. if (prsvec_1.prsi == oindex_1.putty && objcts_1.oadv[oindex_1.putty - 1]
  422. == play_1.winner) {
  423. goto L19300;
  424. }
  425. rspsub_(364, odi2);
  426. /* !NO, JOKE. */
  427. return ret_val;
  428. L19300:
  429. jigsup_(365);
  430. /* !YES, DEAD */
  431. /* ! */
  432. /* ! */
  433. /* ! */
  434. /* ! */
  435. /* ! */
  436. return ret_val;
  437. /* SVERBS, PAGE 5 */
  438. /* V89-- DIG. UNLESS SHOVEL, A JOKE. */
  439. L20000:
  440. if (prsvec_1.prso == oindex_1.shove) {
  441. return ret_val;
  442. }
  443. /* !SHOVEL? */
  444. i = 392;
  445. /* !ASSUME TOOL. */
  446. if ((objcts_1.oflag1[prsvec_1.prso - 1] & TOOLBT) == 0) {
  447. i = 393;
  448. }
  449. rspsub_(i, odo2);
  450. return ret_val;
  451. /* V90-- TIME. PRINT OUT DURATION OF GAME. */
  452. L21000:
  453. gttime_(&k);
  454. /* !GET PLAY TIME. */
  455. i = k / 60;
  456. j = k % 60;
  457. more_output(NULL);
  458. printf("You have been playing Dungeon for ");
  459. if (i >= 1) {
  460. printf("%d hour", i);
  461. if (i >= 2)
  462. printf("s");
  463. printf(" and ");
  464. }
  465. printf("%d minute", j);
  466. if (j != 1)
  467. printf("s");
  468. printf(".\n");
  469. play_1.telflg = TRUE_;
  470. return ret_val;
  471. /* V91-- LEAP. USUALLY A JOKE, WITH A CATCH. */
  472. L22000:
  473. if (prsvec_1.prso == 0) {
  474. goto L22200;
  475. }
  476. /* !OVER SOMETHING? */
  477. if (qhere_(prsvec_1.prso, play_1.here)) {
  478. goto L22100;
  479. }
  480. /* !HERE? */
  481. rspeak_(447);
  482. /* !NO, JOKE. */
  483. return ret_val;
  484. L22100:
  485. if ((objcts_1.oflag2[prsvec_1.prso - 1] & VILLBT) == 0) {
  486. goto L22300;
  487. }
  488. rspsub_(448, odo2);
  489. /* !CANT JUMP VILLAIN. */
  490. return ret_val;
  491. L22200:
  492. if (! findxt_(xsrch_1.xdown, play_1.here)) {
  493. goto L22300;
  494. }
  495. /* !DOWN EXIT? */
  496. if (curxt_1.xtype == xpars_1.xno || curxt_1.xtype == xpars_1.xcond && !
  497. flags[*xflag - 1]) {
  498. goto L22400;
  499. }
  500. L22300:
  501. i__1 = rnd_(5) + 314;
  502. rspeak_(i__1);
  503. /* !WHEEEE */
  504. /* ! */
  505. return ret_val;
  506. L22400:
  507. i__1 = rnd_(4) + 449;
  508. jigsup_(i__1);
  509. /* !FATAL LEAP. */
  510. return ret_val;
  511. /* SVERBS, PAGE 6 */
  512. /* V92-- LOCK. */
  513. L23000:
  514. if (prsvec_1.prso == oindex_1.grate && play_1.here == rindex_1.mgrat) {
  515. goto L23200;
  516. }
  517. L23100:
  518. rspeak_(464);
  519. /* !NOT LOCK GRATE. */
  520. return ret_val;
  521. L23200:
  522. findex_1.grunlf = FALSE_;
  523. /* !GRATE NOW LOCKED. */
  524. rspeak_(214);
  525. exits_1.travel[rooms_1.rexit[play_1.here - 1]] = 214;
  526. /* !CHANGE EXIT STATUS. */
  527. return ret_val;
  528. /* V93-- UNLOCK */
  529. L24000:
  530. if (prsvec_1.prso != oindex_1.grate || play_1.here != rindex_1.mgrat) {
  531. goto L23100;
  532. }
  533. if (prsvec_1.prsi == oindex_1.keys) {
  534. goto L24200;
  535. }
  536. /* !GOT KEYS? */
  537. rspsub_(465, odi2);
  538. /* !NO, JOKE. */
  539. return ret_val;
  540. L24200:
  541. findex_1.grunlf = TRUE_;
  542. /* !UNLOCK GRATE. */
  543. rspeak_(217);
  544. exits_1.travel[rooms_1.rexit[play_1.here - 1]] = 217;
  545. /* !CHANGE EXIT STATUS. */
  546. return ret_val;
  547. /* V94-- DIAGNOSE. */
  548. L25000:
  549. i = fights_(play_1.winner, 0);
  550. /* !GET FIGHTS STRENGTH. */
  551. j = advs_1.astren[play_1.winner - 1];
  552. /* !GET HEALTH. */
  553. /* Computing MIN */
  554. i__1 = i + j;
  555. k = min(i__1,4);
  556. /* !GET STATE. */
  557. if (! cevent_1.cflag[cindex_1.cevcur - 1]) {
  558. j = 0;
  559. }
  560. /* !IF NO WOUNDS. */
  561. /* Computing MIN */
  562. i__1 = 4, i__2 = abs(j);
  563. l = min(i__1,i__2);
  564. /* !SCALE. */
  565. i__1 = l + 473;
  566. rspeak_(i__1);
  567. /* !DESCRIBE HEALTH. */
  568. i = (-j - 1) * 30 + cevent_1.ctick[cindex_1.cevcur - 1];
  569. /* !COMPUTE WAIT. */
  570. if (j != 0) {
  571. more_output(NULL);
  572. printf("You will be cured after %d moves.\n", i);
  573. }
  574. i__1 = k + 478;
  575. rspeak_(i__1);
  576. /* !HOW MUCH MORE? */
  577. if (state_1.deaths != 0) {
  578. i__1 = state_1.deaths + 482;
  579. rspeak_(i__1);
  580. }
  581. /* !HOW MANY DEATHS? */
  582. return ret_val;
  583. /* SVERBS, PAGE 7 */
  584. /* V95-- INCANT */
  585. L26000:
  586. for (i = 1; i <= 6; ++i) {
  587. /* !SET UP PARSE. */
  588. pp1[i - 1] = ' ';
  589. pp2[i - 1] = ' ';
  590. /* L26100: */
  591. }
  592. wp = 1;
  593. /* !WORD POINTER. */
  594. cp = 1;
  595. /* !CHAR POINTER. */
  596. if (prsvec_1.prscon <= 1) {
  597. goto L26300;
  598. }
  599. for (z = input_1.inbuf + prsvec_1.prscon - 1; *z != '\0'; ++z) {
  600. /* !PARSE INPUT */
  601. if (*z == ',')
  602. goto L26300;
  603. /* !END OF PHRASE? */
  604. if (*z != ' ')
  605. goto L26150;
  606. /* !SPACE? */
  607. if (cp != 1) {
  608. ++wp;
  609. }
  610. cp = 1;
  611. goto L26200;
  612. L26150:
  613. if (wp == 1) {
  614. pp1[cp - 1] = *z;
  615. }
  616. /* !STUFF INTO HOLDER. */
  617. if (wp == 2) {
  618. pp2[cp - 1] = *z;
  619. }
  620. /* Computing MIN */
  621. i__2 = cp + 1;
  622. cp = min(i__2,6);
  623. L26200:
  624. ;
  625. }
  626. L26300:
  627. prsvec_1.prscon = 1;
  628. /* !KILL REST OF LINE. */
  629. if (pp1[0] != ' ') {
  630. goto L26400;
  631. }
  632. /* !ANY INPUT? */
  633. rspeak_(856);
  634. /* !NO, HO HUM. */
  635. return ret_val;
  636. L26400:
  637. encryp_(pp1, ch);
  638. /* !COMPUTE RESPONSE. */
  639. if (pp2[0] != ' ') {
  640. goto L26600;
  641. }
  642. /* !TWO PHRASES? */
  643. if (findex_1.spellf) {
  644. goto L26550;
  645. }
  646. /* !HE'S TRYING TO LEARN. */
  647. if ((rooms_1.rflag[rindex_1.tstrs - 1] & RSEEN) == 0) {
  648. goto L26575;
  649. }
  650. findex_1.spellf = TRUE_;
  651. /* !TELL HIM. */
  652. play_1.telflg = TRUE_;
  653. more_output(NULL);
  654. printf("A hollow voice replies: \"%.6s %.6s\".\n", pp1, ch);
  655. return ret_val;
  656. L26550:
  657. rspeak_(857);
  658. /* !HE'S GOT ONE ALREADY. */
  659. return ret_val;
  660. L26575:
  661. rspeak_(858);
  662. /* !HE'S NOT IN ENDGAME. */
  663. return ret_val;
  664. L26600:
  665. if ((rooms_1.rflag[rindex_1.tstrs - 1] & RSEEN) != 0) {
  666. goto L26800;
  667. }
  668. for (i = 1; i <= 6; ++i) {
  669. if (pp2[i - 1] != ch[i - 1]) {
  670. goto L26575;
  671. }
  672. /* !WRONG. */
  673. /* L26700: */
  674. }
  675. findex_1.spellf = TRUE_;
  676. /* !IT WORKS. */
  677. rspeak_(859);
  678. cevent_1.ctick[cindex_1.cevste - 1] = 1;
  679. /* !FORCE START. */
  680. return ret_val;
  681. L26800:
  682. rspeak_(855);
  683. /* !TOO LATE. */
  684. return ret_val;
  685. /* SVERBS, PAGE 8 */
  686. /* V96-- ANSWER */
  687. L27000:
  688. if (prsvec_1.prscon > 1 && play_1.here == rindex_1.fdoor &&
  689. findex_1.inqstf) {
  690. goto L27100;
  691. }
  692. rspeak_(799);
  693. /* !NO ONE LISTENS. */
  694. prsvec_1.prscon = 1;
  695. return ret_val;
  696. L27100:
  697. for (j = 1; j <= 14; j ++) {
  698. /* !CHECK ANSWERS. */
  699. if (findex_1.quesno != answer[j - 1])
  700. goto L27300;
  701. /* !ONLY CHECK PROPER ANS. */
  702. z = ansstr[j - 1];
  703. z2 = input_1.inbuf + prsvec_1.prscon - 1;
  704. while (*z != '\0') {
  705. while (*z2 == ' ')
  706. z2++;
  707. /* !STRIP INPUT BLANKS. */
  708. if (*z++ != *z2++)
  709. goto L27300;
  710. }
  711. goto L27500;
  712. /* !RIGHT ANSWER. */
  713. L27300:
  714. ;
  715. }
  716. prsvec_1.prscon = 1;
  717. /* !KILL REST OF LINE. */
  718. ++findex_1.nqatt;
  719. /* !WRONG, CRETIN. */
  720. if (findex_1.nqatt >= 5) {
  721. goto L27400;
  722. }
  723. /* !TOO MANY WRONG? */
  724. i__1 = findex_1.nqatt + 800;
  725. rspeak_(i__1);
  726. /* !NO, TRY AGAIN. */
  727. return ret_val;
  728. L27400:
  729. rspeak_(826);
  730. /* !ALL OVER. */
  731. cevent_1.cflag[cindex_1.cevinq - 1] = FALSE_;
  732. /* !LOSE. */
  733. return ret_val;
  734. L27500:
  735. prsvec_1.prscon = 1;
  736. /* !KILL REST OF LINE. */
  737. ++findex_1.corrct;
  738. /* !GOT IT RIGHT. */
  739. rspeak_(800);
  740. /* !HOORAY. */
  741. if (findex_1.corrct >= 3) {
  742. goto L27600;
  743. }
  744. /* !WON TOTALLY? */
  745. cevent_1.ctick[cindex_1.cevinq - 1] = 2;
  746. /* !NO, START AGAIN. */
  747. findex_1.quesno = (findex_1.quesno + 3) % 8;
  748. findex_1.nqatt = 0;
  749. rspeak_(769);
  750. /* !ASK NEXT QUESTION. */
  751. i__1 = findex_1.quesno + 770;
  752. rspeak_(i__1);
  753. return ret_val;
  754. L27600:
  755. rspeak_(827);
  756. /* !QUIZ OVER, */
  757. cevent_1.cflag[cindex_1.cevinq - 1] = FALSE_;
  758. objcts_1.oflag2[oindex_1.qdoor - 1] |= OPENBT;
  759. return ret_val;
  760. } /* sverbs_ */