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