clockr.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. /* CEVAPP- CLOCK EVENT APPLICABLES */
  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. static void litint_ P((integer, integer *, integer, const integer *,
  8. integer));
  9. void cevapp_(ri)
  10. integer ri;
  11. {
  12. /* Initialized data */
  13. static const integer cndtck[10] = { 50,20,10,5,0,156,156,156,157,0 };
  14. static const integer lmptck[12] = { 50,30,20,10,4,0,154,154,154,154,155,0 };
  15. /* System generated locals */
  16. integer i__1, i__2;
  17. /* Local variables */
  18. logical f;
  19. integer i, j, bc, br;
  20. if (ri == 0) {
  21. return;
  22. }
  23. /* !IGNORE DISABLED. */
  24. switch (ri) {
  25. case 1: goto L1000;
  26. case 2: goto L2000;
  27. case 3: goto L3000;
  28. case 4: goto L4000;
  29. case 5: goto L5000;
  30. case 6: goto L6000;
  31. case 7: goto L7000;
  32. case 8: goto L8000;
  33. case 9: goto L9000;
  34. case 10: goto L10000;
  35. case 11: goto L11000;
  36. case 12: goto L12000;
  37. case 13: goto L13000;
  38. case 14: goto L14000;
  39. case 15: goto L15000;
  40. case 16: goto L16000;
  41. case 17: goto L17000;
  42. case 18: goto L18000;
  43. case 19: goto L19000;
  44. case 20: goto L20000;
  45. case 21: goto L21000;
  46. case 22: goto L22000;
  47. case 23: goto L23000;
  48. case 24: goto L24000;
  49. }
  50. bug_(3, ri);
  51. /* CEV1-- CURE CLOCK. LET PLAYER SLOWLY RECOVER. */
  52. L1000:
  53. /* Computing MIN */
  54. i__1 = 0, i__2 = advs_1.astren[aindex_1.player - 1] + 1;
  55. advs_1.astren[aindex_1.player - 1] = min(i__1,i__2);
  56. /* !RECOVER. */
  57. if (advs_1.astren[aindex_1.player - 1] >= 0) {
  58. return;
  59. }
  60. /* !FULLY RECOVERED? */
  61. cevent_1.ctick[cindex_1.cevcur - 1] = 30;
  62. /* !NO, WAIT SOME MORE. */
  63. return;
  64. /* CEV2-- MAINT-ROOM WITH LEAK. RAISE THE WATER LEVEL. */
  65. L2000:
  66. if (play_1.here == rindex_1.maint) {
  67. i__1 = findex_1.rvmnt / 2 + 71;
  68. rspeak_(i__1);
  69. }
  70. /* !DESCRIBE. */
  71. ++findex_1.rvmnt;
  72. /* !RAISE WATER LEVEL. */
  73. if (findex_1.rvmnt <= 16) {
  74. return;
  75. }
  76. /* !IF NOT FULL, EXIT. */
  77. cevent_1.ctick[cindex_1.cevmnt - 1] = 0;
  78. /* !FULL, DISABLE CLOCK. */
  79. rooms_1.rflag[rindex_1.maint - 1] |= RMUNG;
  80. rrand[rindex_1.maint - 1] = 80;
  81. /* !SAY IT IS FULL OF WATER. */
  82. if (play_1.here == rindex_1.maint) {
  83. jigsup_(81);
  84. }
  85. /* !DROWN HIM IF PRESENT. */
  86. return;
  87. /* CEV3-- LANTERN. DESCRIBE GROWING DIMNESS. */
  88. L3000:
  89. litint_(oindex_1.lamp, &findex_1.orlamp, cindex_1.cevlnt, lmptck, 12);
  90. /* !DO LIGHT INTERRUPT. */
  91. return;
  92. /* CEV4-- MATCH. OUT IT GOES. */
  93. L4000:
  94. rspeak_(153);
  95. /* !MATCH IS OUT. */
  96. objcts_1.oflag1[oindex_1.match - 1] &= ~ ONBT;
  97. return;
  98. /* CEV5-- CANDLE. DESCRIBE GROWING DIMNESS. */
  99. L5000:
  100. litint_(oindex_1.candl, &findex_1.orcand, cindex_1.cevcnd, cndtck, 10);
  101. /* !DO CANDLE INTERRUPT. */
  102. return;
  103. /* CEVAPP, PAGE 3 */
  104. /* CEV6-- BALLOON */
  105. L6000:
  106. cevent_1.ctick[cindex_1.cevbal - 1] = 3;
  107. /* !RESCHEDULE INTERRUPT. */
  108. f = advs_1.avehic[play_1.winner - 1] == oindex_1.ballo;
  109. /* !SEE IF IN BALLOON. */
  110. if (state_1.bloc == rindex_1.vlbot) {
  111. goto L6800;
  112. }
  113. /* !AT BOTTOM? */
  114. if (state_1.bloc == rindex_1.ledg2 || state_1.bloc == rindex_1.ledg3 ||
  115. state_1.bloc == rindex_1.ledg4 || state_1.bloc == rindex_1.vlbot)
  116. {
  117. goto L6700;
  118. }
  119. /* !ON LEDGE? */
  120. if ((objcts_1.oflag2[oindex_1.recep - 1] & OPENBT) != 0 &&
  121. findex_1.binff != 0) {
  122. goto L6500;
  123. }
  124. /* BALLOON IS IN MIDAIR AND IS DEFLATED (OR HAS RECEPTACLE CLOSED). */
  125. /* FALL TO NEXT ROOM. */
  126. if (state_1.bloc != rindex_1.vair1) {
  127. goto L6300;
  128. }
  129. /* !IN VAIR1? */
  130. state_1.bloc = rindex_1.vlbot;
  131. /* !YES, NOW AT VLBOT. */
  132. newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0);
  133. if (f) {
  134. goto L6200;
  135. }
  136. /* !IN BALLOON? */
  137. if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 ||
  138. play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) {
  139. rspeak_(530);
  140. }
  141. /* !ON LEDGE, DESCRIBE. */
  142. return;
  143. L6200:
  144. f = moveto_(state_1.bloc, play_1.winner);
  145. /* !MOVE HIM. */
  146. if (findex_1.binff == 0) {
  147. goto L6250;
  148. }
  149. /* !IN BALLOON. INFLATED? */
  150. rspeak_(531);
  151. /* !YES, LANDED. */
  152. f = rmdesc_(0);
  153. /* !DESCRIBE. */
  154. return;
  155. L6250:
  156. newsta_(oindex_1.ballo, 532, 0, 0, 0);
  157. /* !NO, BALLOON & CONTENTS DIE. */
  158. newsta_(oindex_1.dball, 0, state_1.bloc, 0, 0);
  159. /* !INSERT DEAD BALLOON. */
  160. advs_1.avehic[play_1.winner - 1] = 0;
  161. /* !NOT IN VEHICLE. */
  162. cevent_1.cflag[cindex_1.cevbal - 1] = FALSE_;
  163. /* !DISABLE INTERRUPTS. */
  164. cevent_1.cflag[cindex_1.cevbrn - 1] = FALSE_;
  165. findex_1.binff = 0;
  166. findex_1.btief = 0;
  167. return;
  168. L6300:
  169. --state_1.bloc;
  170. /* !NOT IN VAIR1, DESCEND. */
  171. newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0);
  172. if (f) {
  173. goto L6400;
  174. }
  175. /* !IS HE IN BALLOON? */
  176. if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 ||
  177. play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) {
  178. rspeak_(533);
  179. }
  180. /* !IF ON LEDGE, DESCRIBE. */
  181. return;
  182. L6400:
  183. f = moveto_(state_1.bloc, play_1.winner);
  184. /* !IN BALLOON, MOVE HIM. */
  185. rspeak_(534);
  186. /* !DESCRIBE. */
  187. f = rmdesc_(0);
  188. return;
  189. /* BALLOON IS IN MIDAIR AND IS INFLATED, UP-UP-AND-AWAY */
  190. /* ! */
  191. L6500:
  192. if (state_1.bloc != rindex_1.vair4) {
  193. goto L6600;
  194. }
  195. /* !AT VAIR4? */
  196. cevent_1.ctick[cindex_1.cevbrn - 1] = 0;
  197. cevent_1.ctick[cindex_1.cevbal - 1] = 0;
  198. findex_1.binff = 0;
  199. findex_1.btief = 0;
  200. state_1.bloc = rindex_1.vlbot;
  201. /* !FALL TO BOTTOM. */
  202. newsta_(oindex_1.ballo, 0, 0, 0, 0);
  203. /* !BALLOON & CONTENTS DIE. */
  204. newsta_(oindex_1.dball, 0, state_1.bloc, 0, 0);
  205. /* !SUBSTITUTE DEAD BALLOON. */
  206. if (f) {
  207. goto L6550;
  208. }
  209. /* !WAS HE IN IT? */
  210. if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 ||
  211. play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) {
  212. rspeak_(535);
  213. }
  214. /* !IF HE CAN SEE, DESCRIBE. */
  215. return;
  216. L6550:
  217. jigsup_(536);
  218. /* !IN BALLOON AT CRASH, DIE. */
  219. return;
  220. L6600:
  221. ++state_1.bloc;
  222. /* !NOT AT VAIR4, GO UP. */
  223. newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0);
  224. if (f) {
  225. goto L6650;
  226. }
  227. /* !IN BALLOON? */
  228. if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 ||
  229. play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) {
  230. rspeak_(537);
  231. }
  232. /* !CAN HE SEE IT? */
  233. return;
  234. L6650:
  235. f = moveto_(state_1.bloc, play_1.winner);
  236. /* !MOVE PLAYER. */
  237. rspeak_(538);
  238. /* !DESCRIBE. */
  239. f = rmdesc_(0);
  240. return;
  241. /* ON LEDGE, GOES TO MIDAIR ROOM WHETHER INFLATED OR NOT. */
  242. L6700:
  243. state_1.bloc += rindex_1.vair2 - rindex_1.ledg2;
  244. /* !MOVE TO MIDAIR. */
  245. newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0);
  246. if (f) {
  247. goto L6750;
  248. }
  249. /* !IN BALLOON? */
  250. if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 ||
  251. play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) {
  252. rspeak_(539);
  253. }
  254. /* !NO, STRANDED. */
  255. cevent_1.ctick[cindex_1.cevvlg - 1] = 10;
  256. /* !MATERIALIZE GNOME. */
  257. return;
  258. L6750:
  259. f = moveto_(state_1.bloc, play_1.winner);
  260. /* !MOVE TO NEW ROOM. */
  261. rspeak_(540);
  262. /* !DESCRIBE. */
  263. f = rmdesc_(0);
  264. return;
  265. /* AT BOTTOM, GO UP IF INFLATED, DO NOTHING IF DEFLATED. */
  266. L6800:
  267. if (findex_1.binff == 0 || ! ((objcts_1.oflag2[oindex_1.recep - 1] &
  268. OPENBT) != 0)) {
  269. return;
  270. }
  271. state_1.bloc = rindex_1.vair1;
  272. /* !INFLATED AND OPEN, */
  273. newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0);
  274. /* !GO UP TO VAIR1. */
  275. if (f) {
  276. goto L6850;
  277. }
  278. /* !IN BALLOON? */
  279. if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 ||
  280. play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) {
  281. rspeak_(541);
  282. }
  283. /* !IF CAN SEE, DESCRIBE. */
  284. return;
  285. L6850:
  286. f = moveto_(state_1.bloc, play_1.winner);
  287. /* !MOVE PLAYER. */
  288. rspeak_(542);
  289. f = rmdesc_(0);
  290. return;
  291. /* CEVAPP, PAGE 4 */
  292. /* CEV7-- BALLOON BURNUP */
  293. L7000:
  294. i__1 = objcts_1.olnt;
  295. for (i = 1; i <= i__1; ++i) {
  296. /* !FIND BURNING OBJECT */
  297. if (oindex_1.recep == objcts_1.ocan[i - 1] && (objcts_1.oflag1[i - 1]
  298. & FLAMBT) != 0) {
  299. goto L7200;
  300. }
  301. /* L7100: */
  302. }
  303. bug_(4, 0);
  304. L7200:
  305. newsta_(i, 0, 0, 0, 0);
  306. /* !VANISH OBJECT. */
  307. findex_1.binff = 0;
  308. /* !UNINFLATED. */
  309. if (play_1.here == state_1.bloc) {
  310. rspsub_(292, objcts_1.odesc2[i - 1]);
  311. }
  312. /* !DESCRIBE. */
  313. return;
  314. /* CEV8-- FUSE FUNCTION */
  315. L8000:
  316. if (objcts_1.ocan[oindex_1.fuse - 1] != oindex_1.brick) {
  317. goto L8500;
  318. }
  319. /* !IGNITED BRICK? */
  320. br = objcts_1.oroom[oindex_1.brick - 1];
  321. /* !GET BRICK ROOM. */
  322. bc = objcts_1.ocan[oindex_1.brick - 1];
  323. /* !GET CONTAINER. */
  324. if (br == 0 && bc != 0) {
  325. br = objcts_1.oroom[bc - 1];
  326. }
  327. newsta_(oindex_1.fuse, 0, 0, 0, 0);
  328. /* !KILL FUSE. */
  329. newsta_(oindex_1.brick, 0, 0, 0, 0);
  330. /* !KILL BRICK. */
  331. if (br != 0 && br != play_1.here) {
  332. goto L8100;
  333. }
  334. /* !BRICK ELSEWHERE? */
  335. rooms_1.rflag[play_1.here - 1] |= RMUNG;
  336. rrand[play_1.here - 1] = 114;
  337. /* !MUNG ROOM. */
  338. jigsup_(150);
  339. /* !DEAD. */
  340. return;
  341. L8100:
  342. rspeak_(151);
  343. /* !BOOM. */
  344. state_1.mungrm = br;
  345. /* !SAVE ROOM THAT BLEW. */
  346. cevent_1.ctick[cindex_1.cevsaf - 1] = 5;
  347. /* !SET SAFE INTERRUPT. */
  348. if (br != rindex_1.msafe) {
  349. goto L8200;
  350. }
  351. /* !BLEW SAFE ROOM? */
  352. if (bc != oindex_1.sslot) {
  353. return;
  354. }
  355. /* !WAS BRICK IN SAFE? */
  356. newsta_(oindex_1.sslot, 0, 0, 0, 0);
  357. /* !KILL SLOT. */
  358. objcts_1.oflag2[oindex_1.safe - 1] |= OPENBT;
  359. findex_1.safef = TRUE_;
  360. /* !INDICATE SAFE BLOWN. */
  361. return;
  362. L8200:
  363. i__1 = objcts_1.olnt;
  364. for (i = 1; i <= i__1; ++i) {
  365. /* !BLEW WRONG ROOM. */
  366. if (qhere_(i, br) && (objcts_1.oflag1[i - 1] & TAKEBT) !=
  367. 0) {
  368. newsta_(i, 0, 0, 0, 0);
  369. }
  370. /* L8250: */
  371. }
  372. if (br != rindex_1.lroom) {
  373. return;
  374. }
  375. /* !BLEW LIVING ROOM? */
  376. i__1 = objcts_1.olnt;
  377. for (i = 1; i <= i__1; ++i) {
  378. if (objcts_1.ocan[i - 1] == oindex_1.tcase) {
  379. newsta_(i, 0, 0, 0, 0);
  380. }
  381. /* !KILL TROPHY CASE. */
  382. /* L8300: */
  383. }
  384. return;
  385. L8500:
  386. if (qhere_(oindex_1.fuse, play_1.here) || objcts_1.oadv[oindex_1.fuse -
  387. 1] == play_1.winner) {
  388. rspeak_(152);
  389. }
  390. newsta_(oindex_1.fuse, 0, 0, 0, 0);
  391. /* !KILL FUSE. */
  392. return;
  393. /* CEVAPP, PAGE 5 */
  394. /* CEV9-- LEDGE MUNGE. */
  395. L9000:
  396. rooms_1.rflag[rindex_1.ledg4 - 1] |= RMUNG;
  397. rrand[rindex_1.ledg4 - 1] = 109;
  398. if (play_1.here == rindex_1.ledg4) {
  399. goto L9100;
  400. }
  401. /* !WAS HE THERE? */
  402. rspeak_(110);
  403. /* !NO, NARROW ESCAPE. */
  404. return;
  405. L9100:
  406. if (advs_1.avehic[play_1.winner - 1] != 0) {
  407. goto L9200;
  408. }
  409. /* !IN VEHICLE? */
  410. jigsup_(111);
  411. /* !NO, DEAD. */
  412. return;
  413. L9200:
  414. if (findex_1.btief != 0) {
  415. goto L9300;
  416. }
  417. /* !TIED TO LEDGE? */
  418. rspeak_(112);
  419. /* !NO, NO PLACE TO LAND. */
  420. return;
  421. L9300:
  422. state_1.bloc = rindex_1.vlbot;
  423. /* !YES, CRASH BALLOON. */
  424. newsta_(oindex_1.ballo, 0, 0, 0, 0);
  425. /* !BALLOON & CONTENTS DIE. */
  426. newsta_(oindex_1.dball, 0, state_1.bloc, 0, 0);
  427. /* !INSERT DEAD BALLOON. */
  428. findex_1.btief = 0;
  429. findex_1.binff = 0;
  430. cevent_1.cflag[cindex_1.cevbal - 1] = FALSE_;
  431. cevent_1.cflag[cindex_1.cevbrn - 1] = FALSE_;
  432. jigsup_(113);
  433. /* !DEAD */
  434. return;
  435. /* CEV10-- SAFE MUNG. */
  436. L10000:
  437. rooms_1.rflag[state_1.mungrm - 1] |= RMUNG;
  438. rrand[state_1.mungrm - 1] = 114;
  439. if (play_1.here == state_1.mungrm) {
  440. goto L10100;
  441. }
  442. /* !IS HE PRESENT? */
  443. rspeak_(115);
  444. /* !LET HIM KNOW. */
  445. if (state_1.mungrm == rindex_1.msafe) {
  446. cevent_1.ctick[cindex_1.cevled - 1] = 8;
  447. }
  448. /* !START LEDGE CLOCK. */
  449. return;
  450. L10100:
  451. i = 116;
  452. /* !HE'S DEAD, */
  453. if ((rooms_1.rflag[play_1.here - 1] & RHOUSE) != 0) {
  454. i = 117;
  455. }
  456. jigsup_(i);
  457. /* !LET HIM KNOW. */
  458. return;
  459. /* CEVAPP, PAGE 6 */
  460. /* CEV11-- VOLCANO GNOME */
  461. L11000:
  462. if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 ||
  463. play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) {
  464. goto L11100;
  465. }
  466. /* !IS HE ON LEDGE? */
  467. cevent_1.ctick[cindex_1.cevvlg - 1] = 1;
  468. /* !NO, WAIT A WHILE. */
  469. return;
  470. L11100:
  471. newsta_(oindex_1.gnome, 118, play_1.here, 0, 0);
  472. /* !YES, MATERIALIZE GNOME. */
  473. return;
  474. /* CEV12-- VOLCANO GNOME DISAPPEARS */
  475. L12000:
  476. newsta_(oindex_1.gnome, 149, 0, 0, 0);
  477. /* !DISAPPEAR THE GNOME. */
  478. return;
  479. /* CEV13-- BUCKET. */
  480. L13000:
  481. if (objcts_1.ocan[oindex_1.water - 1] == oindex_1.bucke) {
  482. newsta_(oindex_1.water, 0, 0, 0, 0);
  483. }
  484. return;
  485. /* CEV14-- SPHERE. IF EXPIRES, HE'S TRAPPED. */
  486. L14000:
  487. rooms_1.rflag[rindex_1.cager - 1] |= RMUNG;
  488. rrand[rindex_1.cager - 1] = 147;
  489. jigsup_(148);
  490. /* !MUNG PLAYER. */
  491. return;
  492. /* CEV15-- END GAME HERALD. */
  493. L15000:
  494. findex_1.endgmf = TRUE_;
  495. /* !WE'RE IN ENDGAME. */
  496. rspeak_(119);
  497. /* !INFORM OF ENDGAME. */
  498. return;
  499. /* CEVAPP, PAGE 7 */
  500. /* CEV16-- FOREST MURMURS */
  501. L16000:
  502. cevent_1.cflag[cindex_1.cevfor - 1] = play_1.here == rindex_1.mtree ||
  503. play_1.here >= rindex_1.fore1 && play_1.here < rindex_1.clear;
  504. if (cevent_1.cflag[cindex_1.cevfor - 1] && prob_(10, 10)) {
  505. rspeak_(635);
  506. }
  507. return;
  508. /* CEV17-- SCOL ALARM */
  509. L17000:
  510. if (play_1.here == rindex_1.bktwi) {
  511. cevent_1.cflag[cindex_1.cevzgi - 1] = TRUE_;
  512. }
  513. /* !IF IN TWI, GNOME. */
  514. if (play_1.here == rindex_1.bkvau) {
  515. jigsup_(636);
  516. }
  517. /* !IF IN VAU, DEAD. */
  518. return;
  519. /* CEV18-- ENTER GNOME OF ZURICH */
  520. L18000:
  521. cevent_1.cflag[cindex_1.cevzgo - 1] = TRUE_;
  522. /* !EXITS, TOO. */
  523. newsta_(oindex_1.zgnom, 0, rindex_1.bktwi, 0, 0);
  524. /* !PLACE IN TWI. */
  525. if (play_1.here == rindex_1.bktwi) {
  526. rspeak_(637);
  527. }
  528. /* !ANNOUNCE. */
  529. return;
  530. /* CEV19-- EXIT GNOME */
  531. L19000:
  532. newsta_(oindex_1.zgnom, 0, 0, 0, 0);
  533. /* !VANISH. */
  534. if (play_1.here == rindex_1.bktwi) {
  535. rspeak_(638);
  536. }
  537. /* !ANNOUNCE. */
  538. return;
  539. /* CEVAPP, PAGE 8 */
  540. /* CEV20-- START OF ENDGAME */
  541. L20000:
  542. if (findex_1.spellf) {
  543. goto L20200;
  544. }
  545. /* !SPELL HIS WAY IN? */
  546. if (play_1.here != rindex_1.crypt) {
  547. return;
  548. }
  549. /* !NO, STILL IN TOMB? */
  550. if (! lit_(play_1.here)) {
  551. goto L20100;
  552. }
  553. /* !LIGHTS OFF? */
  554. cevent_1.ctick[cindex_1.cevste - 1] = 3;
  555. /* !RESCHEDULE. */
  556. return;
  557. L20100:
  558. rspeak_(727);
  559. /* !ANNOUNCE. */
  560. L20200:
  561. i__1 = objcts_1.olnt;
  562. for (i = 1; i <= i__1; ++i) {
  563. /* !STRIP HIM OF OBJS. */
  564. newsta_(i, 0, objcts_1.oroom[i - 1], objcts_1.ocan[i - 1],
  565. 0);
  566. /* L20300: */
  567. }
  568. newsta_(oindex_1.lamp, 0, 0, 0, aindex_1.player);
  569. /* !GIVE HIM LAMP. */
  570. newsta_(oindex_1.sword, 0, 0, 0, aindex_1.player);
  571. /* !GIVE HIM SWORD. */
  572. objcts_1.oflag1[oindex_1.lamp - 1] = (objcts_1.oflag1[oindex_1.lamp - 1] |
  573. LITEBT) & ~ ONBT;
  574. objcts_1.oflag2[oindex_1.lamp - 1] |= TCHBT;
  575. cevent_1.cflag[cindex_1.cevlnt - 1] = FALSE_;
  576. /* !LAMP IS GOOD AS NEW. */
  577. cevent_1.ctick[cindex_1.cevlnt - 1] = 350;
  578. findex_1.orlamp = 0;
  579. objcts_1.oflag2[oindex_1.sword - 1] |= TCHBT;
  580. hack_1.swdact = TRUE_;
  581. hack_1.swdsta = 0;
  582. hack_1.thfact = FALSE_;
  583. /* !THIEF GONE. */
  584. findex_1.endgmf = TRUE_;
  585. /* !ENDGAME RUNNING. */
  586. cevent_1.cflag[cindex_1.cevmat - 1] = FALSE_;
  587. /* !MATCHES GONE, */
  588. cevent_1.cflag[cindex_1.cevcnd - 1] = FALSE_;
  589. /* !CANDLES GONE. */
  590. scrupd_(rooms_1.rval[rindex_1.crypt - 1]);
  591. /* !SCORE CRYPT, */
  592. rooms_1.rval[rindex_1.crypt - 1] = 0;
  593. /* !BUT ONLY ONCE. */
  594. f = moveto_(rindex_1.tstrs, play_1.winner);
  595. /* !TO TOP OF STAIRS, */
  596. f = rmdesc_(3);
  597. /* !AND DESCRIBE. */
  598. return;
  599. /* !BAM */
  600. /* ! */
  601. /* CEV21-- MIRROR CLOSES. */
  602. L21000:
  603. findex_1.mrpshf = FALSE_;
  604. /* !BUTTON IS OUT. */
  605. findex_1.mropnf = FALSE_;
  606. /* !MIRROR IS CLOSED. */
  607. if (play_1.here == rindex_1.mrant) {
  608. rspeak_(728);
  609. }
  610. /* !DESCRIBE BUTTON. */
  611. if (play_1.here == rindex_1.inmir || mrhere_(play_1.here) == 1) {
  612. rspeak_(729);
  613. }
  614. return;
  615. /* CEVAPP, PAGE 9 */
  616. /* CEV22-- DOOR CLOSES. */
  617. L22000:
  618. if (findex_1.wdopnf) {
  619. rspeak_(730);
  620. }
  621. /* !DESCRIBE. */
  622. findex_1.wdopnf = FALSE_;
  623. /* !CLOSED. */
  624. return;
  625. /* CEV23-- INQUISITOR'S QUESTION */
  626. L23000:
  627. if (advs_1.aroom[aindex_1.player - 1] != rindex_1.fdoor) {
  628. return;
  629. }
  630. /* !IF PLAYER LEFT, DIE. */
  631. rspeak_(769);
  632. i__1 = findex_1.quesno + 770;
  633. rspeak_(i__1);
  634. cevent_1.ctick[cindex_1.cevinq - 1] = 2;
  635. return;
  636. /* CEV24-- MASTER FOLLOWS */
  637. L24000:
  638. if (advs_1.aroom[aindex_1.amastr - 1] == play_1.here) {
  639. return;
  640. }
  641. /* !NO MOVEMENT, DONE. */
  642. if (play_1.here != rindex_1.cell && play_1.here != rindex_1.pcell) {
  643. goto L24100;
  644. }
  645. if (findex_1.follwf) {
  646. rspeak_(811);
  647. }
  648. /* !WONT GO TO CELLS. */
  649. findex_1.follwf = FALSE_;
  650. return;
  651. L24100:
  652. findex_1.follwf = TRUE_;
  653. /* !FOLLOWING. */
  654. i = 812;
  655. /* !ASSUME CATCHES UP. */
  656. i__1 = xsrch_1.xmax;
  657. i__2 = xsrch_1.xmin;
  658. for (j = xsrch_1.xmin; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) {
  659. if (findxt_(j, advs_1.aroom[aindex_1.amastr - 1]) && curxt_1.xroom1
  660. == play_1.here) {
  661. i = 813;
  662. }
  663. /* L24200: */
  664. }
  665. rspeak_(i);
  666. newsta_(oindex_1.master, 0, play_1.here, 0, 0);
  667. /* !MOVE MASTER OBJECT. */
  668. advs_1.aroom[aindex_1.amastr - 1] = play_1.here;
  669. /* !MOVE MASTER PLAYER. */
  670. return;
  671. } /* cevapp_ */
  672. /* LITINT- LIGHT INTERRUPT PROCESSOR */
  673. /* DECLARATIONS */
  674. static void litint_(obj, ctr, cev, ticks, tickln)
  675. integer obj;
  676. integer *ctr;
  677. integer cev;
  678. const integer *ticks;
  679. integer tickln;
  680. {
  681. /* Parameter adjustments */
  682. --ticks;
  683. /* Function Body */
  684. ++(*ctr);
  685. /* !ADVANCE STATE CNTR. */
  686. cevent_1.ctick[cev - 1] = ticks[*ctr];
  687. /* !RESET INTERRUPT. */
  688. if (cevent_1.ctick[cev - 1] != 0) {
  689. goto L100;
  690. }
  691. /* !EXPIRED? */
  692. objcts_1.oflag1[obj - 1] &= ~ (LITEBT + FLAMBT +
  693. ONBT);
  694. if (objcts_1.oroom[obj - 1] == play_1.here || objcts_1.oadv[obj - 1] ==
  695. play_1.winner) {
  696. rspsub_(293, objcts_1.odesc2[obj - 1]);
  697. }
  698. return;
  699. L100:
  700. if (objcts_1.oroom[obj - 1] == play_1.here || objcts_1.oadv[obj - 1] ==
  701. play_1.winner) {
  702. rspeak_(ticks[*ctr + tickln / 2]);
  703. }
  704. return;
  705. } /* litint_ */