billr@saab.CNA.TEK.COM (Bill Randle) (05/15/91)
Submitted-by: ian@airs.COM Posting-number: Volume 12, Issue 75 Archive-name: cdungeon/Part08 Environment: Unix, MS-DOS #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 8 (of 12)." # Contents: clockr.c rooms.c villns.c # Wrapped by billr@saab on Tue May 14 16:27:41 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'clockr.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'clockr.c'\" else echo shar: Extracting \"'clockr.c'\" \(18847 characters\) sed "s/^X//" >'clockr.c' <<'END_OF_FILE' X/* CEVAPP- CLOCK EVENT APPLICABLES */ X X/*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/ X/* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */ X/* WRITTEN BY R. M. SUPNIK */ X X#include "funcs.h" X#include "vars.h" X Xstatic void litint_ P((integer, integer *, integer, const integer *, X integer)); X Xvoid cevapp_(ri) Xinteger ri; X{ X /* Initialized data */ X X static const integer cndtck[10] = { 50,20,10,5,0,156,156,156,157,0 }; X static const integer lmptck[12] = { 50,30,20,10,4,0,154,154,154,154,155,0 }; X X /* System generated locals */ X integer i__1, i__2; X X /* Local variables */ X logical f; X integer i, j, bc, br; X X if (ri == 0) { X return; X } X/* !IGNORE DISABLED. */ X switch (ri) { X case 1: goto L1000; X case 2: goto L2000; X case 3: goto L3000; X case 4: goto L4000; X case 5: goto L5000; X case 6: goto L6000; X case 7: goto L7000; X case 8: goto L8000; X case 9: goto L9000; X case 10: goto L10000; X case 11: goto L11000; X case 12: goto L12000; X case 13: goto L13000; X case 14: goto L14000; X case 15: goto L15000; X case 16: goto L16000; X case 17: goto L17000; X case 18: goto L18000; X case 19: goto L19000; X case 20: goto L20000; X case 21: goto L21000; X case 22: goto L22000; X case 23: goto L23000; X case 24: goto L24000; X } X bug_(3, ri); X X/* CEV1-- CURE CLOCK. LET PLAYER SLOWLY RECOVER. */ X XL1000: X/* Computing MIN */ X i__1 = 0, i__2 = advs_1.astren[aindex_1.player - 1] + 1; X advs_1.astren[aindex_1.player - 1] = min(i__1,i__2); X/* !RECOVER. */ X if (advs_1.astren[aindex_1.player - 1] >= 0) { X return; X } X/* !FULLY RECOVERED? */ X cevent_1.ctick[cindex_1.cevcur - 1] = 30; X/* !NO, WAIT SOME MORE. */ X return; X X/* CEV2-- MAINT-ROOM WITH LEAK. RAISE THE WATER LEVEL. */ X XL2000: X if (play_1.here == rindex_1.maint) { X i__1 = findex_1.rvmnt / 2 + 71; X rspeak_(i__1); X } X/* !DESCRIBE. */ X ++findex_1.rvmnt; X/* !RAISE WATER LEVEL. */ X if (findex_1.rvmnt <= 16) { X return; X } X/* !IF NOT FULL, EXIT. */ X cevent_1.ctick[cindex_1.cevmnt - 1] = 0; X/* !FULL, DISABLE CLOCK. */ X rooms_1.rflag[rindex_1.maint - 1] |= RMUNG; X rrand[rindex_1.maint - 1] = 80; X/* !SAY IT IS FULL OF WATER. */ X if (play_1.here == rindex_1.maint) { X jigsup_(81); X } X/* !DROWN HIM IF PRESENT. */ X return; X X/* CEV3-- LANTERN. DESCRIBE GROWING DIMNESS. */ X XL3000: X litint_(oindex_1.lamp, &findex_1.orlamp, cindex_1.cevlnt, lmptck, 12); X/* !DO LIGHT INTERRUPT. */ X return; X X/* CEV4-- MATCH. OUT IT GOES. */ X XL4000: X rspeak_(153); X/* !MATCH IS OUT. */ X objcts_1.oflag1[oindex_1.match - 1] &= ~ ONBT; X return; X X/* CEV5-- CANDLE. DESCRIBE GROWING DIMNESS. */ X XL5000: X litint_(oindex_1.candl, &findex_1.orcand, cindex_1.cevcnd, cndtck, 10); X/* !DO CANDLE INTERRUPT. */ X return; X/* CEVAPP, PAGE 3 */ X X/* CEV6-- BALLOON */ X XL6000: X cevent_1.ctick[cindex_1.cevbal - 1] = 3; X/* !RESCHEDULE INTERRUPT. */ X f = advs_1.avehic[play_1.winner - 1] == oindex_1.ballo; X/* !SEE IF IN BALLOON. */ X if (state_1.bloc == rindex_1.vlbot) { X goto L6800; X } X/* !AT BOTTOM? */ X if (state_1.bloc == rindex_1.ledg2 || state_1.bloc == rindex_1.ledg3 || X state_1.bloc == rindex_1.ledg4 || state_1.bloc == rindex_1.vlbot) X { X goto L6700; X } X/* !ON LEDGE? */ X if ((objcts_1.oflag2[oindex_1.recep - 1] & OPENBT) != 0 && X findex_1.binff != 0) { X goto L6500; X } X X/* BALLOON IS IN MIDAIR AND IS DEFLATED (OR HAS RECEPTACLE CLOSED). */ X/* FALL TO NEXT ROOM. */ X X if (state_1.bloc != rindex_1.vair1) { X goto L6300; X } X/* !IN VAIR1? */ X state_1.bloc = rindex_1.vlbot; X/* !YES, NOW AT VLBOT. */ X newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0); X if (f) { X goto L6200; X } X/* !IN BALLOON? */ X if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 || X play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) { X rspeak_(530); X } X/* !ON LEDGE, DESCRIBE. */ X return; X XL6200: X f = moveto_(state_1.bloc, play_1.winner); X/* !MOVE HIM. */ X if (findex_1.binff == 0) { X goto L6250; X } X/* !IN BALLOON. INFLATED? */ X rspeak_(531); X/* !YES, LANDED. */ X f = rmdesc_(0); X/* !DESCRIBE. */ X return; X XL6250: X newsta_(oindex_1.ballo, 532, 0, 0, 0); X/* !NO, BALLOON & CONTENTS DIE. */ X newsta_(oindex_1.dball, 0, state_1.bloc, 0, 0); X/* !INSERT DEAD BALLOON. */ X advs_1.avehic[play_1.winner - 1] = 0; X/* !NOT IN VEHICLE. */ X cevent_1.cflag[cindex_1.cevbal - 1] = FALSE_; X/* !DISABLE INTERRUPTS. */ X cevent_1.cflag[cindex_1.cevbrn - 1] = FALSE_; X findex_1.binff = 0; X findex_1.btief = 0; X return; X XL6300: X --state_1.bloc; X/* !NOT IN VAIR1, DESCEND. */ X newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0); X if (f) { X goto L6400; X } X/* !IS HE IN BALLOON? */ X if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 || X play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) { X rspeak_(533); X } X/* !IF ON LEDGE, DESCRIBE. */ X return; X XL6400: X f = moveto_(state_1.bloc, play_1.winner); X/* !IN BALLOON, MOVE HIM. */ X rspeak_(534); X/* !DESCRIBE. */ X f = rmdesc_(0); X return; X X/* BALLOON IS IN MIDAIR AND IS INFLATED, UP-UP-AND-AWAY */ X/* ! */ X XL6500: X if (state_1.bloc != rindex_1.vair4) { X goto L6600; X } X/* !AT VAIR4? */ X cevent_1.ctick[cindex_1.cevbrn - 1] = 0; X cevent_1.ctick[cindex_1.cevbal - 1] = 0; X findex_1.binff = 0; X findex_1.btief = 0; X state_1.bloc = rindex_1.vlbot; X/* !FALL TO BOTTOM. */ X newsta_(oindex_1.ballo, 0, 0, 0, 0); X/* !BALLOON & CONTENTS DIE. */ X newsta_(oindex_1.dball, 0, state_1.bloc, 0, 0); X/* !SUBSTITUTE DEAD BALLOON. */ X if (f) { X goto L6550; X } X/* !WAS HE IN IT? */ X if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 || X play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) { X rspeak_(535); X } X/* !IF HE CAN SEE, DESCRIBE. */ X return; X XL6550: X jigsup_(536); X/* !IN BALLOON AT CRASH, DIE. */ X return; X XL6600: X ++state_1.bloc; X/* !NOT AT VAIR4, GO UP. */ X newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0); X if (f) { X goto L6650; X } X/* !IN BALLOON? */ X if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 || X play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) { X rspeak_(537); X } X/* !CAN HE SEE IT? */ X return; X XL6650: X f = moveto_(state_1.bloc, play_1.winner); X/* !MOVE PLAYER. */ X rspeak_(538); X/* !DESCRIBE. */ X f = rmdesc_(0); X return; X X/* ON LEDGE, GOES TO MIDAIR ROOM WHETHER INFLATED OR NOT. */ X XL6700: X state_1.bloc += rindex_1.vair2 - rindex_1.ledg2; X/* !MOVE TO MIDAIR. */ X newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0); X if (f) { X goto L6750; X } X/* !IN BALLOON? */ X if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 || X play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) { X rspeak_(539); X } X/* !NO, STRANDED. */ X cevent_1.ctick[cindex_1.cevvlg - 1] = 10; X/* !MATERIALIZE GNOME. */ X return; X XL6750: X f = moveto_(state_1.bloc, play_1.winner); X/* !MOVE TO NEW ROOM. */ X rspeak_(540); X/* !DESCRIBE. */ X f = rmdesc_(0); X return; X X/* AT BOTTOM, GO UP IF INFLATED, DO NOTHING IF DEFLATED. */ X XL6800: X if (findex_1.binff == 0 || ! ((objcts_1.oflag2[oindex_1.recep - 1] & X OPENBT) != 0)) { X return; X } X state_1.bloc = rindex_1.vair1; X/* !INFLATED AND OPEN, */ X newsta_(oindex_1.ballo, 0, state_1.bloc, 0, 0); X/* !GO UP TO VAIR1. */ X if (f) { X goto L6850; X } X/* !IN BALLOON? */ X if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 || X play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) { X rspeak_(541); X } X/* !IF CAN SEE, DESCRIBE. */ X return; X XL6850: X f = moveto_(state_1.bloc, play_1.winner); X/* !MOVE PLAYER. */ X rspeak_(542); X f = rmdesc_(0); X return; X/* CEVAPP, PAGE 4 */ X X/* CEV7-- BALLOON BURNUP */ X XL7000: X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X/* !FIND BURNING OBJECT */ X if (oindex_1.recep == objcts_1.ocan[i - 1] && (objcts_1.oflag1[i - 1] X & FLAMBT) != 0) { X goto L7200; X } X/* L7100: */ X } X bug_(4, 0); X XL7200: X newsta_(i, 0, 0, 0, 0); X/* !VANISH OBJECT. */ X findex_1.binff = 0; X/* !UNINFLATED. */ X if (play_1.here == state_1.bloc) { X rspsub_(292, objcts_1.odesc2[i - 1]); X } X/* !DESCRIBE. */ X return; X X/* CEV8-- FUSE FUNCTION */ X XL8000: X if (objcts_1.ocan[oindex_1.fuse - 1] != oindex_1.brick) { X goto L8500; X } X/* !IGNITED BRICK? */ X br = objcts_1.oroom[oindex_1.brick - 1]; X/* !GET BRICK ROOM. */ X bc = objcts_1.ocan[oindex_1.brick - 1]; X/* !GET CONTAINER. */ X if (br == 0 && bc != 0) { X br = objcts_1.oroom[bc - 1]; X } X newsta_(oindex_1.fuse, 0, 0, 0, 0); X/* !KILL FUSE. */ X newsta_(oindex_1.brick, 0, 0, 0, 0); X/* !KILL BRICK. */ X if (br != 0 && br != play_1.here) { X goto L8100; X } X/* !BRICK ELSEWHERE? */ X X rooms_1.rflag[play_1.here - 1] |= RMUNG; X rrand[play_1.here - 1] = 114; X/* !MUNG ROOM. */ X jigsup_(150); X/* !DEAD. */ X return; X XL8100: X rspeak_(151); X/* !BOOM. */ X state_1.mungrm = br; X/* !SAVE ROOM THAT BLEW. */ X cevent_1.ctick[cindex_1.cevsaf - 1] = 5; X/* !SET SAFE INTERRUPT. */ X if (br != rindex_1.msafe) { X goto L8200; X } X/* !BLEW SAFE ROOM? */ X if (bc != oindex_1.sslot) { X return; X } X/* !WAS BRICK IN SAFE? */ X newsta_(oindex_1.sslot, 0, 0, 0, 0); X/* !KILL SLOT. */ X objcts_1.oflag2[oindex_1.safe - 1] |= OPENBT; X findex_1.safef = TRUE_; X/* !INDICATE SAFE BLOWN. */ X return; X XL8200: X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X/* !BLEW WRONG ROOM. */ X if (qhere_(i, br) && (objcts_1.oflag1[i - 1] & TAKEBT) != X 0) { X newsta_(i, 0, 0, 0, 0); X } X/* L8250: */ X } X if (br != rindex_1.lroom) { X return; X } X/* !BLEW LIVING ROOM? */ X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X if (objcts_1.ocan[i - 1] == oindex_1.tcase) { X newsta_(i, 0, 0, 0, 0); X } X/* !KILL TROPHY CASE. */ X/* L8300: */ X } X return; X XL8500: X if (qhere_(oindex_1.fuse, play_1.here) || objcts_1.oadv[oindex_1.fuse - X 1] == play_1.winner) { X rspeak_(152); X } X newsta_(oindex_1.fuse, 0, 0, 0, 0); X/* !KILL FUSE. */ X return; X/* CEVAPP, PAGE 5 */ X X/* CEV9-- LEDGE MUNGE. */ X XL9000: X rooms_1.rflag[rindex_1.ledg4 - 1] |= RMUNG; X rrand[rindex_1.ledg4 - 1] = 109; X if (play_1.here == rindex_1.ledg4) { X goto L9100; X } X/* !WAS HE THERE? */ X rspeak_(110); X/* !NO, NARROW ESCAPE. */ X return; X XL9100: X if (advs_1.avehic[play_1.winner - 1] != 0) { X goto L9200; X } X/* !IN VEHICLE? */ X jigsup_(111); X/* !NO, DEAD. */ X return; X XL9200: X if (findex_1.btief != 0) { X goto L9300; X } X/* !TIED TO LEDGE? */ X rspeak_(112); X/* !NO, NO PLACE TO LAND. */ X return; X XL9300: X state_1.bloc = rindex_1.vlbot; X/* !YES, CRASH BALLOON. */ X newsta_(oindex_1.ballo, 0, 0, 0, 0); X/* !BALLOON & CONTENTS DIE. */ X newsta_(oindex_1.dball, 0, state_1.bloc, 0, 0); X/* !INSERT DEAD BALLOON. */ X findex_1.btief = 0; X findex_1.binff = 0; X cevent_1.cflag[cindex_1.cevbal - 1] = FALSE_; X cevent_1.cflag[cindex_1.cevbrn - 1] = FALSE_; X jigsup_(113); X/* !DEAD */ X return; X X/* CEV10-- SAFE MUNG. */ X XL10000: X rooms_1.rflag[state_1.mungrm - 1] |= RMUNG; X rrand[state_1.mungrm - 1] = 114; X if (play_1.here == state_1.mungrm) { X goto L10100; X } X/* !IS HE PRESENT? */ X rspeak_(115); X/* !LET HIM KNOW. */ X if (state_1.mungrm == rindex_1.msafe) { X cevent_1.ctick[cindex_1.cevled - 1] = 8; X } X/* !START LEDGE CLOCK. */ X return; X XL10100: X i = 116; X/* !HE'S DEAD, */ X if ((rooms_1.rflag[play_1.here - 1] & RHOUSE) != 0) { X i = 117; X } X jigsup_(i); X/* !LET HIM KNOW. */ X return; X/* CEVAPP, PAGE 6 */ X X/* CEV11-- VOLCANO GNOME */ X XL11000: X if (play_1.here == rindex_1.ledg2 || play_1.here == rindex_1.ledg3 || X play_1.here == rindex_1.ledg4 || play_1.here == rindex_1.vlbot) { X goto L11100; X } X/* !IS HE ON LEDGE? */ X cevent_1.ctick[cindex_1.cevvlg - 1] = 1; X/* !NO, WAIT A WHILE. */ X return; X XL11100: X newsta_(oindex_1.gnome, 118, play_1.here, 0, 0); X/* !YES, MATERIALIZE GNOME. */ X return; X X/* CEV12-- VOLCANO GNOME DISAPPEARS */ X XL12000: X newsta_(oindex_1.gnome, 149, 0, 0, 0); X/* !DISAPPEAR THE GNOME. */ X return; X X/* CEV13-- BUCKET. */ X XL13000: X if (objcts_1.ocan[oindex_1.water - 1] == oindex_1.bucke) { X newsta_(oindex_1.water, 0, 0, 0, 0); X } X return; X X/* CEV14-- SPHERE. IF EXPIRES, HE'S TRAPPED. */ X XL14000: X rooms_1.rflag[rindex_1.cager - 1] |= RMUNG; X rrand[rindex_1.cager - 1] = 147; X jigsup_(148); X/* !MUNG PLAYER. */ X return; X X/* CEV15-- END GAME HERALD. */ X XL15000: X findex_1.endgmf = TRUE_; X/* !WE'RE IN ENDGAME. */ X rspeak_(119); X/* !INFORM OF ENDGAME. */ X return; X/* CEVAPP, PAGE 7 */ X X/* CEV16-- FOREST MURMURS */ X XL16000: X cevent_1.cflag[cindex_1.cevfor - 1] = play_1.here == rindex_1.mtree || X play_1.here >= rindex_1.fore1 && play_1.here < rindex_1.clear; X if (cevent_1.cflag[cindex_1.cevfor - 1] && prob_(10, 10)) { X rspeak_(635); X } X return; X X/* CEV17-- SCOL ALARM */ X XL17000: X if (play_1.here == rindex_1.bktwi) { X cevent_1.cflag[cindex_1.cevzgi - 1] = TRUE_; X } X/* !IF IN TWI, GNOME. */ X if (play_1.here == rindex_1.bkvau) { X jigsup_(636); X } X/* !IF IN VAU, DEAD. */ X return; X X/* CEV18-- ENTER GNOME OF ZURICH */ X XL18000: X cevent_1.cflag[cindex_1.cevzgo - 1] = TRUE_; X/* !EXITS, TOO. */ X newsta_(oindex_1.zgnom, 0, rindex_1.bktwi, 0, 0); X/* !PLACE IN TWI. */ X if (play_1.here == rindex_1.bktwi) { X rspeak_(637); X } X/* !ANNOUNCE. */ X return; X X/* CEV19-- EXIT GNOME */ X XL19000: X newsta_(oindex_1.zgnom, 0, 0, 0, 0); X/* !VANISH. */ X if (play_1.here == rindex_1.bktwi) { X rspeak_(638); X } X/* !ANNOUNCE. */ X return; X/* CEVAPP, PAGE 8 */ X X/* CEV20-- START OF ENDGAME */ X XL20000: X if (findex_1.spellf) { X goto L20200; X } X/* !SPELL HIS WAY IN? */ X if (play_1.here != rindex_1.crypt) { X return; X } X/* !NO, STILL IN TOMB? */ X if (! lit_(play_1.here)) { X goto L20100; X } X/* !LIGHTS OFF? */ X cevent_1.ctick[cindex_1.cevste - 1] = 3; X/* !RESCHEDULE. */ X return; X XL20100: X rspeak_(727); X/* !ANNOUNCE. */ XL20200: X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X/* !STRIP HIM OF OBJS. */ X newsta_(i, 0, objcts_1.oroom[i - 1], objcts_1.ocan[i - 1], X 0); X/* L20300: */ X } X newsta_(oindex_1.lamp, 0, 0, 0, aindex_1.player); X/* !GIVE HIM LAMP. */ X newsta_(oindex_1.sword, 0, 0, 0, aindex_1.player); X/* !GIVE HIM SWORD. */ X X objcts_1.oflag1[oindex_1.lamp - 1] = (objcts_1.oflag1[oindex_1.lamp - 1] | X LITEBT) & ~ ONBT; X objcts_1.oflag2[oindex_1.lamp - 1] |= TCHBT; X cevent_1.cflag[cindex_1.cevlnt - 1] = FALSE_; X/* !LAMP IS GOOD AS NEW. */ X cevent_1.ctick[cindex_1.cevlnt - 1] = 350; X findex_1.orlamp = 0; X objcts_1.oflag2[oindex_1.sword - 1] |= TCHBT; X hack_1.swdact = TRUE_; X hack_1.swdsta = 0; X X hack_1.thfact = FALSE_; X/* !THIEF GONE. */ X findex_1.endgmf = TRUE_; X/* !ENDGAME RUNNING. */ X cevent_1.cflag[cindex_1.cevmat - 1] = FALSE_; X/* !MATCHES GONE, */ X cevent_1.cflag[cindex_1.cevcnd - 1] = FALSE_; X/* !CANDLES GONE. */ X X scrupd_(rooms_1.rval[rindex_1.crypt - 1]); X/* !SCORE CRYPT, */ X rooms_1.rval[rindex_1.crypt - 1] = 0; X/* !BUT ONLY ONCE. */ X f = moveto_(rindex_1.tstrs, play_1.winner); X/* !TO TOP OF STAIRS, */ X f = rmdesc_(3); X/* !AND DESCRIBE. */ X return; X/* !BAM */ X/* ! */ X X/* CEV21-- MIRROR CLOSES. */ X XL21000: X findex_1.mrpshf = FALSE_; X/* !BUTTON IS OUT. */ X findex_1.mropnf = FALSE_; X/* !MIRROR IS CLOSED. */ X if (play_1.here == rindex_1.mrant) { X rspeak_(728); X } X/* !DESCRIBE BUTTON. */ X if (play_1.here == rindex_1.inmir || mrhere_(play_1.here) == 1) { X rspeak_(729); X } X return; X/* CEVAPP, PAGE 9 */ X X/* CEV22-- DOOR CLOSES. */ X XL22000: X if (findex_1.wdopnf) { X rspeak_(730); X } X/* !DESCRIBE. */ X findex_1.wdopnf = FALSE_; X/* !CLOSED. */ X return; X X/* CEV23-- INQUISITOR'S QUESTION */ X XL23000: X if (advs_1.aroom[aindex_1.player - 1] != rindex_1.fdoor) { X return; X } X/* !IF PLAYER LEFT, DIE. */ X rspeak_(769); X i__1 = findex_1.quesno + 770; X rspeak_(i__1); X cevent_1.ctick[cindex_1.cevinq - 1] = 2; X return; X X/* CEV24-- MASTER FOLLOWS */ X XL24000: X if (advs_1.aroom[aindex_1.amastr - 1] == play_1.here) { X return; X } X/* !NO MOVEMENT, DONE. */ X if (play_1.here != rindex_1.cell && play_1.here != rindex_1.pcell) { X goto L24100; X } X if (findex_1.follwf) { X rspeak_(811); X } X/* !WONT GO TO CELLS. */ X findex_1.follwf = FALSE_; X return; X XL24100: X findex_1.follwf = TRUE_; X/* !FOLLOWING. */ X i = 812; X/* !ASSUME CATCHES UP. */ X i__1 = xsrch_1.xmax; X i__2 = xsrch_1.xmin; X for (j = xsrch_1.xmin; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) { X if (findxt_(j, advs_1.aroom[aindex_1.amastr - 1]) && curxt_1.xroom1 X == play_1.here) { X i = 813; X } X/* L24200: */ X } X rspeak_(i); X newsta_(oindex_1.master, 0, play_1.here, 0, 0); X/* !MOVE MASTER OBJECT. */ X advs_1.aroom[aindex_1.amastr - 1] = play_1.here; X/* !MOVE MASTER PLAYER. */ X return; X X} /* cevapp_ */ X X/* LITINT- LIGHT INTERRUPT PROCESSOR */ X X/* DECLARATIONS */ X Xstatic void litint_(obj, ctr, cev, ticks, tickln) Xinteger obj; Xinteger *ctr; Xinteger cev; Xconst integer *ticks; Xinteger tickln; X{ X /* Parameter adjustments */ X --ticks; X X /* Function Body */ X ++(*ctr); X/* !ADVANCE STATE CNTR. */ X cevent_1.ctick[cev - 1] = ticks[*ctr]; X/* !RESET INTERRUPT. */ X if (cevent_1.ctick[cev - 1] != 0) { X goto L100; X } X/* !EXPIRED? */ X objcts_1.oflag1[obj - 1] &= ~ (LITEBT + FLAMBT + X ONBT); X if (objcts_1.oroom[obj - 1] == play_1.here || objcts_1.oadv[obj - 1] == X play_1.winner) { X rspsub_(293, objcts_1.odesc2[obj - 1]); X } X return; X XL100: X if (objcts_1.oroom[obj - 1] == play_1.here || objcts_1.oadv[obj - 1] == X play_1.winner) { X rspeak_(ticks[*ctr + tickln / 2]); X } X return; X X} /* litint_ */ END_OF_FILE if test 18847 -ne `wc -c <'clockr.c'`; then echo shar: \"'clockr.c'\" unpacked with wrong size! fi # end of 'clockr.c' fi if test -f 'rooms.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'rooms.c'\" else echo shar: Extracting \"'rooms.c'\" \(20108 characters\) sed "s/^X//" >'rooms.c' <<'END_OF_FILE' X/* RAPPL1- SPECIAL PURPOSE ROOM ROUTINES, PART 1 */ X X/*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/ X/* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */ X/* WRITTEN BY R. M. SUPNIK */ X X#include "funcs.h" X#include "vars.h" X Xlogical rappl1_(ri) Xinteger ri; X{ X /* System generated locals */ X integer i__1, i__2; X logical ret_val; X X /* Local variables */ X logical f; X integer i; X integer j; X X ret_val = TRUE_; X/* !USUALLY IGNORED. */ X if (ri == 0) { X return ret_val; X } X/* !RETURN IF NAUGHT. */ X X/* !SET TO FALSE FOR */ X X/* !NEW DESC NEEDED. */ X switch (ri) { X case 1: goto L1000; X case 2: goto L2000; X case 3: goto L3000; X case 4: goto L4000; X case 5: goto L5000; X case 6: goto L6000; X case 7: goto L7000; X case 8: goto L8000; X case 9: goto L9000; X case 10: goto L10000; X case 11: goto L11000; X case 12: goto L12000; X case 13: goto L13000; X case 14: goto L14000; X case 15: goto L15000; X case 16: goto L16000; X case 17: goto L17000; X case 18: goto L18000; X case 19: goto L19000; X case 20: goto L20000; X case 21: goto L21000; X case 22: goto L22000; X case 23: goto L23000; X case 24: goto L24000; X case 25: goto L25000; X case 26: goto L26000; X case 27: goto L27000; X case 28: goto L28000; X case 29: goto L29000; X case 30: goto L30000; X case 31: goto L31000; X case 32: goto L32000; X case 33: goto L33000; X case 34: goto L34000; X case 35: goto L35000; X case 36: goto L36000; X case 37: goto L37000; X } X bug_(1, ri); X X/* R1-- EAST OF HOUSE. DESCRIPTION DEPENDS ON STATE OF WINDOW */ X XL1000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X i = 13; X/* !ASSUME CLOSED. */ X if ((objcts_1.oflag2[oindex_1.windo - 1] & OPENBT) != 0) { X i = 12; X } X/* !IF OPEN, AJAR. */ X rspsub_(11, i); X/* !DESCRIBE. */ X return ret_val; X X/* R2-- KITCHEN. SAME VIEW FROM INSIDE. */ X XL2000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X i = 13; X/* !ASSUME CLOSED. */ X if ((objcts_1.oflag2[oindex_1.windo - 1] & OPENBT) != 0) { X i = 12; X } X/* !IF OPEN, AJAR. */ X rspsub_(14, i); X/* !DESCRIBE. */ X return ret_val; X X/* R3-- LIVING ROOM. DESCRIPTION DEPENDS ON MAGICF (STATE OF */ X/* DOOR TO CYCLOPS ROOM), RUG (MOVED OR NOT), DOOR (OPEN OR CLOSED) */ X XL3000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L3500; X } X/* !LOOK? */ X i = 15; X/* !ASSUME NO HOLE. */ X if (findex_1.magicf) { X i = 16; X } X/* !IF MAGICF, CYCLOPS HOLE. */ X rspeak_(i); X/* !DESCRIBE. */ X i = findex_1.orrug + 17; X/* !ASSUME INITIAL STATE. */ X if ((objcts_1.oflag2[oindex_1.door - 1] & OPENBT) != 0) { X i += 2; X } X/* !DOOR OPEN? */ X rspeak_(i); X/* !DESCRIBE. */ X return ret_val; X X/* NOT A LOOK WORD. REEVALUATE TROPHY CASE. */ X XL3500: X if (prsvec_1.prsa != vindex_1.takew && (prsvec_1.prsa != vindex_1.putw || X prsvec_1.prsi != oindex_1.tcase)) { X return ret_val; X } X advs_1.ascore[play_1.winner - 1] = state_1.rwscor; X/* !SCORE TROPHY CASE. */ X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X/* !RETAIN RAW SCORE AS WELL. */ X j = i; X/* !FIND OUT IF IN CASE. */ XL3550: X j = objcts_1.ocan[j - 1]; X/* !TRACE OWNERSHIP. */ X if (j == 0) { X goto L3600; X } X if (j != oindex_1.tcase) { X goto L3550; X } X/* !DO ALL LEVELS. */ X advs_1.ascore[play_1.winner - 1] += objcts_1.otval[i - 1]; XL3600: X ; X } X scrupd_(0); X/* !SEE IF ENDGAME TRIG. */ X return ret_val; X/* RAPPL1, PAGE 3 */ X X/* R4-- CELLAR. SHUT DOOR AND BAR IT IF HE JUST WALKED IN. */ X XL4000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L4500; X } X/* !LOOK? */ X rspeak_(21); X/* !DESCRIBE CELLAR. */ X return ret_val; X XL4500: X if (prsvec_1.prsa != vindex_1.walkiw) { X return ret_val; X } X/* !WALKIN? */ X if ((objcts_1.oflag2[oindex_1.door - 1] & OPENBT + X TCHBT) != OPENBT) { X return ret_val; X } X objcts_1.oflag2[oindex_1.door - 1] = (objcts_1.oflag2[oindex_1.door - 1] | X TCHBT) & ~ OPENBT; X rspeak_(22); X/* !SLAM AND BOLT DOOR. */ X return ret_val; X X/* R5-- MAZE11. DESCRIBE STATE OF GRATING. */ X XL5000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(23); X/* !DESCRIBE. */ X i = 24; X/* !ASSUME LOCKED. */ X if (findex_1.grunlf) { X i = 26; X } X/* !UNLOCKED? */ X if ((objcts_1.oflag2[oindex_1.grate - 1] & OPENBT) != 0) { X i = 25; X } X/* !OPEN? */ X rspeak_(i); X/* !DESCRIBE GRATE. */ X return ret_val; X X/* R6-- CLEARING. DESCRIBE CLEARING, MOVE LEAVES. */ X XL6000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L6500; X } X/* !LOOK? */ X rspeak_(27); X/* !DESCRIBE. */ X if (findex_1.rvclr == 0) { X return ret_val; X } X/* !LEAVES MOVED? */ X i = 28; X/* !YES, ASSUME GRATE CLOSED. */ X if ((objcts_1.oflag2[oindex_1.grate - 1] & OPENBT) != 0) { X i = 29; X } X/* !OPEN? */ X rspeak_(i); X/* !DESCRIBE GRATE. */ X return ret_val; X XL6500: X if (findex_1.rvclr != 0 || qhere_(oindex_1.leave, rindex_1.clear) && ( X prsvec_1.prsa != vindex_1.movew || prsvec_1.prso != X oindex_1.leave)) { X return ret_val; X } X rspeak_(30); X/* !MOVE LEAVES, REVEAL GRATE. */ X findex_1.rvclr = 1; X/* !INDICATE LEAVES MOVED. */ X return ret_val; X/* RAPPL1, PAGE 4 */ X X/* R7-- RESERVOIR SOUTH. DESCRIPTION DEPENDS ON LOW TIDE FLAG. */ X XL7000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X i = 31; X/* !ASSUME FULL. */ X if (findex_1.lwtidf) { X i = 32; X } X/* !IF LOW TIDE, EMPTY. */ X rspeak_(i); X/* !DESCRIBE. */ X rspeak_(33); X/* !DESCRIBE EXITS. */ X return ret_val; X X/* R8-- RESERVOIR. STATE DEPENDS ON LOW TIDE FLAG. */ X XL8000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X i = 34; X/* !ASSUME FULL. */ X if (findex_1.lwtidf) { X i = 35; X } X/* !IF LOW TIDE, EMTPY. */ X rspeak_(i); X/* !DESCRIBE. */ X return ret_val; X X/* R9-- RESERVOIR NORTH. ALSO DEPENDS ON LOW TIDE FLAG. */ X XL9000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X i = 36; X/* !YOU GET THE IDEA. */ X if (findex_1.lwtidf) { X i = 37; X } X rspeak_(i); X rspeak_(38); X return ret_val; X X/* R10-- GLACIER ROOM. STATE DEPENDS ON MELTED, VANISHED FLAGS. */ X XL10000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(39); X/* !BASIC DESCRIPTION. */ X i = 0; X/* !ASSUME NO CHANGES. */ X if (findex_1.glacmf) { X i = 40; X } X/* !PARTIAL MELT? */ X if (findex_1.glacrf) { X i = 41; X } X/* !COMPLETE MELT? */ X rspeak_(i); X/* !DESCRIBE. */ X return ret_val; X X/* R11-- FOREST ROOM */ X XL11000: X if (prsvec_1.prsa == vindex_1.walkiw) { X cevent_1.cflag[cindex_1.cevfor - 1] = TRUE_; X } X/* !IF WALK IN, BIRDIE. */ X return ret_val; X X/* R12-- MIRROR ROOM. STATE DEPENDS ON MIRROR INTACT. */ X XL12000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(42); X/* !DESCRIBE. */ X if (findex_1.mirrmf) { X rspeak_(43); X } X/* !IF BROKEN, NASTY REMARK. */ X return ret_val; X/* RAPPL1, PAGE 5 */ X X/* R13-- CAVE2 ROOM. BLOW OUT CANDLES WITH 50% PROBABILITY. */ X XL13000: X if (prsvec_1.prsa != vindex_1.walkiw) { X return ret_val; X } X/* !WALKIN? */ X if (prob_(50, 50) || objcts_1.oadv[oindex_1.candl - 1] != X play_1.winner || ! ((objcts_1.oflag1[oindex_1.candl - 1] & X ONBT) != 0)) { X return ret_val; X } X objcts_1.oflag1[oindex_1.candl - 1] &= ~ ONBT; X rspeak_(47); X/* !TELL OF WINDS. */ X cevent_1.cflag[cindex_1.cevcnd - 1] = FALSE_; X/* !HALT CANDLE COUNTDOWN. */ X return ret_val; X X/* R14-- BOOM ROOM. BLOW HIM UP IF CARRYING FLAMING OBJECT. */ X XL14000: X j = objcts_1.odesc2[oindex_1.candl - 1]; X/* !ASSUME CANDLE. */ X if (objcts_1.oadv[oindex_1.candl - 1] == play_1.winner && ( X objcts_1.oflag1[oindex_1.candl - 1] & ONBT) != 0) { X goto L14100; X } X j = objcts_1.odesc2[oindex_1.torch - 1]; X/* !ASSUME TORCH. */ X if (objcts_1.oadv[oindex_1.torch - 1] == play_1.winner && ( X objcts_1.oflag1[oindex_1.torch - 1] & ONBT) != 0) { X goto L14100; X } X j = objcts_1.odesc2[oindex_1.match - 1]; X if (objcts_1.oadv[oindex_1.match - 1] == play_1.winner && ( X objcts_1.oflag1[oindex_1.match - 1] & ONBT) != 0) { X goto L14100; X } X return ret_val; X/* !SAFE */ X XL14100: X if (prsvec_1.prsa != vindex_1.trnonw) { X goto L14200; X } X/* !TURN ON? */ X rspsub_(294, j); X/* !BOOM */ X/* ! */ X jigsup_(44); X return ret_val; X XL14200: X if (prsvec_1.prsa != vindex_1.walkiw) { X return ret_val; X } X/* !WALKIN? */ X rspsub_(295, j); X/* !BOOM */ X/* ! */ X jigsup_(44); X return ret_val; X X/* R15-- NO-OBJS. SEE IF EMPTY HANDED, SCORE LIGHT SHAFT. */ X XL15000: X findex_1.empthf = TRUE_; X/* !ASSUME TRUE. */ X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X/* !SEE IF CARRYING. */ X if (objcts_1.oadv[i - 1] == play_1.winner) { X findex_1.empthf = FALSE_; X } X/* L15100: */ X } X X if (play_1.here != rindex_1.bshaf || ! lit_(play_1.here)) { X return ret_val; X } X scrupd_(state_1.ltshft); X/* !SCORE LIGHT SHAFT. */ X state_1.ltshft = 0; X/* !NEVER AGAIN. */ X return ret_val; X/* RAPPL1, PAGE 6 */ X X/* R16-- MACHINE ROOM. DESCRIBE MACHINE. */ X XL16000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X i = 46; X/* !ASSUME LID CLOSED. */ X if ((objcts_1.oflag2[oindex_1.machi - 1] & OPENBT) != 0) { X i = 12; X } X/* !IF OPEN, OPEN. */ X rspsub_(45, i); X/* !DESCRIBE. */ X return ret_val; X X/* R17-- BAT ROOM. UNLESS CARRYING GARLIC, FLY AWAY WITH ME... */ X XL17000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L17500; X } X/* !LOOK? */ X rspeak_(48); X/* !DESCRIBE ROOM. */ X if (objcts_1.oadv[oindex_1.garli - 1] == play_1.winner) { X rspeak_(49); X } X/* !BAT HOLDS NOSE. */ X return ret_val; X XL17500: X if (prsvec_1.prsa != vindex_1.walkiw || objcts_1.oadv[oindex_1.garli - 1] X == play_1.winner) { X return ret_val; X } X rspeak_(50); X/* !TIME TO FLY, JACK. */ X f = moveto_(bats_1.batdrp[rnd_(9)], play_1.winner); X/* !SELECT RANDOM DEST. */ X ret_val = FALSE_; X/* !INDICATE NEW DESC NEEDED. */ X return ret_val; X X/* R18-- DOME ROOM. STATE DEPENDS ON WHETHER ROPE TIED TO RAILING. */ X XL18000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L18500; X } X/* !LOOK? */ X rspeak_(51); X/* !DESCRIBE. */ X if (findex_1.domef) { X rspeak_(52); X } X/* !IF ROPE, DESCRIBE. */ X return ret_val; X XL18500: X if (prsvec_1.prsa == vindex_1.leapw) { X jigsup_(53); X } X/* !DID HE JUMP??? */ X return ret_val; X X/* R19-- TORCH ROOM. ALSO DEPENDS ON WHETHER ROPE TIED TO RAILING. */ X XL19000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(54); X/* !DESCRIBE. */ X if (findex_1.domef) { X rspeak_(55); X } X/* !IF ROPE, DESCRIBE. */ X return ret_val; X X/* R20-- CAROUSEL ROOM. SPIN HIM OR KILL HIM. */ X XL20000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L20500; X } X/* !LOOK? */ X rspeak_(56); X/* !DESCRIBE. */ X if (! findex_1.caroff) { X rspeak_(57); X } X/* !IF NOT FLIPPED, SPIN. */ X return ret_val; X XL20500: X if (prsvec_1.prsa == vindex_1.walkiw && findex_1.carozf) { X jigsup_(58); X } X/* !WALKED IN. */ X return ret_val; X/* RAPPL1, PAGE 7 */ X X/* R21-- LLD ROOM. HANDLE EXORCISE, DESCRIPTIONS. */ X XL21000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L21500; X } X/* !LOOK? */ X rspeak_(59); X/* !DESCRIBE. */ X if (! findex_1.lldf) { X rspeak_(60); X } X/* !IF NOT VANISHED, GHOSTS. */ X return ret_val; X XL21500: X if (prsvec_1.prsa != vindex_1.exorcw) { X return ret_val; X } X/* !EXORCISE? */ X if (objcts_1.oadv[oindex_1.bell - 1] == play_1.winner && objcts_1.oadv[ X oindex_1.book - 1] == play_1.winner && objcts_1.oadv[ X oindex_1.candl - 1] == play_1.winner && (objcts_1.oflag1[ X oindex_1.candl - 1] & ONBT) != 0) { X goto L21600; X } X rspeak_(62); X/* !NOT EQUIPPED. */ X return ret_val; X XL21600: X if (qhere_(oindex_1.ghost, play_1.here)) { X goto L21700; X } X/* !GHOST HERE? */ X jigsup_(61); X/* !NOPE, EXORCISE YOU. */ X return ret_val; X XL21700: X newsta_(oindex_1.ghost, 63, 0, 0, 0); X/* !VANISH GHOST. */ X findex_1.lldf = TRUE_; X/* !OPEN GATE. */ X return ret_val; X X/* R22-- LLD2-ROOM. IS HIS HEAD ON A POLE? */ X XL22000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(64); X/* !DESCRIBE. */ X if (findex_1.onpolf) { X rspeak_(65); X } X/* !ON POLE? */ X return ret_val; X X/* R23-- DAM ROOM. DESCRIBE RESERVOIR, PANEL. */ X XL23000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(66); X/* !DESCRIBE. */ X i = 67; X if (findex_1.lwtidf) { X i = 68; X } X rspeak_(i); X/* !DESCRIBE RESERVOIR. */ X rspeak_(69); X/* !DESCRIBE PANEL. */ X if (findex_1.gatef) { X rspeak_(70); X } X/* !BUBBLE IS GLOWING. */ X return ret_val; X X/* R24-- TREE ROOM */ X XL24000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(660); X/* !DESCRIBE. */ X i = 661; X/* !SET FLAG FOR BELOW. */ X i__1 = objcts_1.olnt; X for (j = 1; j <= i__1; ++j) { X/* !DESCRIBE OBJ IN FORE3. */ X if (! qhere_(j, rindex_1.fore3) || j == oindex_1.ftree) { X goto L24200; X } X rspeak_(i); X/* !SET STAGE, */ X i = 0; X rspsub_(502, objcts_1.odesc2[j - 1]); X/* !DESCRIBE. */ XL24200: X ; X } X return ret_val; X/* RAPPL1, PAGE 8 */ X X/* R25-- CYCLOPS-ROOM. DEPENDS ON CYCLOPS STATE, ASLEEP FLAG, MAGIC FLAG. X */ X XL25000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(606); X/* !DESCRIBE. */ X i = 607; X/* !ASSUME BASIC STATE. */ X if (findex_1.rvcyc > 0) { X i = 608; X } X/* !>0? HUNGRY. */ X if (findex_1.rvcyc < 0) { X i = 609; X } X/* !<0? THIRSTY. */ X if (findex_1.cyclof) { X i = 610; X } X/* !ASLEEP? */ X if (findex_1.magicf) { X i = 611; X } X/* !GONE? */ X rspeak_(i); X/* !DESCRIBE. */ X if (! findex_1.cyclof && findex_1.rvcyc != 0) { X i__1 = abs(findex_1.rvcyc) + 193; X rspeak_(i__1); X } X return ret_val; X X/* R26-- BANK BOX ROOM. */ X XL26000: X if (prsvec_1.prsa != vindex_1.walkiw) { X return ret_val; X } X/* !SURPRISE HIM. */ X for (i = 1; i <= 8; i += 2) { X/* !SCOLRM DEPENDS ON */ X if (screen_1.fromdr == screen_1.scoldr[i - 1]) { X screen_1.scolrm = screen_1.scoldr[i]; X } X/* L26100: */ X } X/* !ENTRY DIRECTION. */ X return ret_val; X X/* R27-- TREASURE ROOM. */ X XL27000: X if (prsvec_1.prsa != vindex_1.walkiw || ! hack_1.thfact) { X return ret_val; X } X if (objcts_1.oroom[oindex_1.thief - 1] != play_1.here) { X newsta_(oindex_1.thief, 82, play_1.here, 0, 0); X } X hack_1.thfpos = play_1.here; X/* !RESET SEARCH PATTERN. */ X objcts_1.oflag2[oindex_1.thief - 1] |= FITEBT; X if (objcts_1.oroom[oindex_1.chali - 1] == play_1.here) { X objcts_1.oflag1[oindex_1.chali - 1] &= ~ TAKEBT; X } X X/* VANISH EVERYTHING IN ROOM */ X X j = 0; X/* !ASSUME NOTHING TO VANISH. */ X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X if (i == oindex_1.chali || i == oindex_1.thief || ! qhere_(i, X play_1.here)) { X goto L27200; X } X j = 83; X/* !FLAG BYEBYE. */ X objcts_1.oflag1[i - 1] &= ~ VISIBT; XL27200: X ; X } X rspeak_(j); X/* !DESCRIBE. */ X return ret_val; X X/* R28-- CLIFF FUNCTION. SEE IF CARRYING INFLATED BOAT. */ X XL28000: X findex_1.deflaf = objcts_1.oadv[oindex_1.rboat - 1] != play_1.winner; X/* !TRUE IF NOT CARRYING. */ X return ret_val; X/* RAPPL1, PAGE 9 */ X X/* R29-- RIVR4 ROOM. PLAY WITH BUOY. */ X XL29000: X if (! findex_1.buoyf || objcts_1.oadv[oindex_1.buoy - 1] != play_1.winner) X { X return ret_val; X } X rspeak_(84); X/* !GIVE HINT, */ X findex_1.buoyf = FALSE_; X/* !THEN DISABLE. */ X return ret_val; X X/* R30-- OVERFALLS. DOOM. */ X XL30000: X if (prsvec_1.prsa != vindex_1.lookw) { X jigsup_(85); X } X/* !OVER YOU GO. */ X return ret_val; X X/* R31-- BEACH ROOM. DIG A HOLE. */ X XL31000: X if (prsvec_1.prsa != vindex_1.digw || prsvec_1.prso != oindex_1.shove) { X return ret_val; X } X ++findex_1.rvsnd; X/* !INCREMENT DIG STATE. */ X switch (findex_1.rvsnd) { X case 1: goto L31100; X case 2: goto L31100; X case 3: goto L31100; X case 4: goto L31400; X case 5: goto L31500; X } X/* !PROCESS STATE. */ X bug_(2, findex_1.rvsnd); X XL31100: X i__1 = findex_1.rvsnd + 85; X rspeak_(i__1); X/* !1-3... DISCOURAGE HIM. */ X return ret_val; X XL31400: X i = 89; X/* !ASSUME DISCOVERY. */ X if ((objcts_1.oflag1[oindex_1.statu - 1] & VISIBT) != 0) { X i = 88; X } X rspeak_(i); X objcts_1.oflag1[oindex_1.statu - 1] |= VISIBT; X return ret_val; X XL31500: X findex_1.rvsnd = 0; X/* !5... SAND COLLAPSES */ X jigsup_(90); X/* !AND SO DOES HE. */ X return ret_val; X X/* R32-- TCAVE ROOM. DIG A HOLE IN GUANO. */ X XL32000: X if (prsvec_1.prsa != vindex_1.digw || prsvec_1.prso != oindex_1.shove) { X return ret_val; X } X i = 91; X/* !ASSUME NO GUANO. */ X if (! qhere_(oindex_1.guano, play_1.here)) { X goto L32100; X } X/* !IS IT HERE? */ X/* Computing MIN */ X i__1 = 4, i__2 = findex_1.rvgua + 1; X findex_1.rvgua = min(i__1,i__2); X/* !YES, SET NEW STATE. */ X i = findex_1.rvgua + 91; X/* !GET NASTY REMARK. */ XL32100: X rspeak_(i); X/* !DESCRIBE. */ X return ret_val; X X/* R33-- FALLS ROOM */ X XL33000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(96); X/* !DESCRIBE. */ X i = 97; X/* !ASSUME NO RAINBOW. */ X if (findex_1.rainbf) { X i = 98; X } X/* !GOT ONE? */ X rspeak_(i); X/* !DESCRIBE. */ X return ret_val; X/* RAPPL1, PAGE 10 */ X X/* R34-- LEDGE FUNCTION. LEDGE CAN COLLAPSE. */ X XL34000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(100); X/* !DESCRIBE. */ X i = 102; X/* !ASSUME SAFE ROOM OK. */ X if ((rooms_1.rflag[rindex_1.msafe - 1] & RMUNG) != 0) { X i = 101; X } X rspeak_(i); X/* !DESCRIBE. */ X return ret_val; X X/* R35-- SAFE ROOM. STATE DEPENDS ON WHETHER SAFE BLOWN. */ X XL35000: X if (prsvec_1.prsa != vindex_1.lookw) { X return ret_val; X } X/* !LOOK? */ X rspeak_(104); X/* !DESCRIBE. */ X i = 105; X/* !ASSUME OK. */ X if (findex_1.safef) { X i = 106; X } X/* !BLOWN? */ X rspeak_(i); X/* !DESCRIBE. */ X return ret_val; X X/* R36-- MAGNET ROOM. DESCRIBE, CHECK FOR SPINDIZZY DOOM. */ X XL36000: X if (prsvec_1.prsa != vindex_1.lookw) { X goto L36500; X } X/* !LOOK? */ X rspeak_(107); X/* !DESCRIBE. */ X return ret_val; X XL36500: X if (prsvec_1.prsa != vindex_1.walkiw || ! findex_1.caroff) { X return ret_val; X } X/* !WALKIN ON FLIPPED? */ X if (findex_1.carozf) { X goto L36600; X } X/* !ZOOM? */ X rspeak_(108); X/* !NO, SPIN HIS COMPASS. */ X return ret_val; X XL36600: X i = 58; X/* !SPIN HIS INSIDES. */ X if (play_1.winner != aindex_1.player) { X i = 99; X } X/* !SPIN ROBOT. */ X jigsup_(i); X/* !DEAD. */ X return ret_val; X X/* R37-- CAGE ROOM. IF SOLVED CAGE, MOVE TO OTHER CAGE ROOM. */ X XL37000: X if (findex_1.cagesf) { X f = moveto_(rindex_1.cager, play_1.winner); X } X/* !IF SOLVED, MOVE. */ X return ret_val; X X} /* rappl1_ */ END_OF_FILE if test 20108 -ne `wc -c <'rooms.c'`; then echo shar: \"'rooms.c'\" unpacked with wrong size! fi # end of 'rooms.c' fi if test -f 'villns.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'villns.c'\" else echo shar: Extracting \"'villns.c'\" \(11721 characters\) sed "s/^X//" >'villns.c' <<'END_OF_FILE' X/* TROLLP- TROLL FUNCTION */ X X/*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/ X/* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */ X/* WRITTEN BY R. M. SUPNIK */ X X#include "funcs.h" X#include "vars.h" X Xlogical trollp_(arg) Xinteger arg; X{ X /* System generated locals */ X logical ret_val; X X /* Local variables */ X integer i; X X ret_val = TRUE_; X/* !ASSUME WINS. */ X if (prsvec_1.prsa != vindex_1.fightw) { X goto L1100; X } X/* !FIGHT? */ X if (objcts_1.ocan[oindex_1.axe - 1] == oindex_1.troll) { X goto L10; X } X/* !GOT AXE? NOTHING. */ X i = 433; X/* !ASSUME CANT GET. */ X if (! qhere_(oindex_1.axe, play_1.here)) { X goto L1050; X } X/* !HERE? */ X i = 434; X/* !YES, RECOVER. */ X newsta_(oindex_1.axe, 0, 0, oindex_1.troll, 0); XL1050: X if (qhere_(oindex_1.troll, play_1.here)) { X rspeak_(i); X } X/* !IF PLAYER HERE. */ X return ret_val; X XL1100: X if (prsvec_1.prsa != vindex_1.deadxw) { X goto L1200; X } X/* !DEAD? */ X findex_1.trollf = TRUE_; X/* !PERMIT EXITS. */ X return ret_val; X XL1200: X if (prsvec_1.prsa != vindex_1.outxw) { X goto L1300; X } X/* !OUT? */ X findex_1.trollf = TRUE_; X/* !PERMIT EXITS. */ X objcts_1.oflag1[oindex_1.axe - 1] &= ~ VISIBT; X objcts_1.odesc1[oindex_1.troll - 1] = 435; X/* !TROLL OUT. */ X return ret_val; X XL1300: X if (prsvec_1.prsa != vindex_1.inxw) { X goto L1400; X } X/* !WAKE UP? */ X findex_1.trollf = FALSE_; X/* !FORBID EXITS. */ X objcts_1.oflag1[oindex_1.axe - 1] |= VISIBT; X objcts_1.odesc1[oindex_1.troll - 1] = 436; X/* !TROLL IN. */ X if (qhere_(oindex_1.troll, play_1.here)) { X rspeak_(437); X } X return ret_val; X XL1400: X if (prsvec_1.prsa != vindex_1.frstqw) { X goto L1500; X } X/* !FIRST ENCOUNTER? */ X ret_val = prob_(33, 66); X/* !33% TRUE UNLESS BADLK. */ X return ret_val; X XL1500: X if (prsvec_1.prsa != vindex_1.movew && prsvec_1.prsa != vindex_1.takew && X prsvec_1.prsa != vindex_1.mungw && prsvec_1.prsa != X vindex_1.throww && prsvec_1.prsa != vindex_1.givew) { X goto L2000; X } X if (objcts_1.ocapac[oindex_1.troll - 1] >= 0) { X goto L1550; X } X/* !TROLL OUT? */ X objcts_1.ocapac[oindex_1.troll - 1] = -objcts_1.ocapac[oindex_1.troll - 1] X ; X/* !YES, WAKE HIM. */ X objcts_1.oflag1[oindex_1.axe - 1] |= VISIBT; X findex_1.trollf = FALSE_; X objcts_1.odesc1[oindex_1.troll - 1] = 436; X rspeak_(437); X XL1550: X if (prsvec_1.prsa != vindex_1.takew && prsvec_1.prsa != vindex_1.movew) { X goto L1600; X } X rspeak_(438); X/* !JOKE. */ X return ret_val; X XL1600: X if (prsvec_1.prsa != vindex_1.mungw) { X goto L1700; X } X/* !MUNG? */ X rspeak_(439); X/* !JOKE. */ X return ret_val; X XL1700: X if (prsvec_1.prso == 0) { X goto L10; X } X/* !NO OBJECT? */ X i = 440; X/* !ASSUME THROW. */ X if (prsvec_1.prsa == vindex_1.givew) { X i = 441; X } X/* !GIVE? */ X rspsub_(i, objcts_1.odesc2[prsvec_1.prso - 1]); X/* !TROLL TAKES. */ X if (prsvec_1.prso == oindex_1.knife) { X goto L1900; X } X/* !OBJ KNIFE? */ X newsta_(prsvec_1.prso, 442, 0, 0, 0); X/* !NO, EATS IT. */ X return ret_val; X XL1900: X rspeak_(443); X/* !KNIFE, THROWS IT BACK */ X objcts_1.oflag2[oindex_1.troll - 1] |= FITEBT; X return ret_val; X XL2000: X if (! findex_1.trollf || prsvec_1.prsa != vindex_1.hellow) { X goto L10; X } X rspeak_(366); X/* !TROLL OUT. */ X return ret_val; X XL10: X ret_val = FALSE_; X/* !COULDNT HANDLE IT. */ X return ret_val; X} /* trollp_ */ X X/* CYCLOP- CYCLOPS FUNCTION */ X X/* DECLARATIONS */ X Xlogical cyclop_(arg) Xinteger arg; X{ X /* System generated locals */ X integer i__1, i__2; X logical ret_val; X X /* Local variables */ X integer i; X X ret_val = TRUE_; X/* !ASSUME WINS. */ X if (! findex_1.cyclof) { X goto L100; X } X/* !ASLEEP? */ X if (prsvec_1.prsa != vindex_1.alarmw && prsvec_1.prsa != vindex_1.mungw && X prsvec_1.prsa != vindex_1.hellow && prsvec_1.prsa != X vindex_1.burnw && prsvec_1.prsa != vindex_1.killw && X prsvec_1.prsa != vindex_1.attacw) { X goto L10; X } X findex_1.cyclof = FALSE_; X/* !WAKE CYCLOPS. */ X rspeak_(187); X/* !DESCRIBE. */ X findex_1.rvcyc = abs(findex_1.rvcyc); X objcts_1.oflag2[oindex_1.cyclo - 1] = (objcts_1.oflag2[oindex_1.cyclo - 1] X | FITEBT) & ~ SLEPBT; X return ret_val; X XL100: X if (prsvec_1.prsa == vindex_1.fightw || prsvec_1.prsa == vindex_1.frstqw) X { X goto L10; X } X if (abs(findex_1.rvcyc) <= 5) { X goto L200; X } X/* !ANNOYED TOO MUCH? */ X findex_1.rvcyc = 0; X/* !RESTART COUNT. */ X jigsup_(188); X/* !YES, EATS PLAYER. */ X return ret_val; X XL200: X if (prsvec_1.prsa != vindex_1.givew) { X goto L500; X } X/* !GIVE? */ X if (prsvec_1.prso != oindex_1.food || findex_1.rvcyc < 0) { X goto L300; X } X/* !FOOD WHEN HUNGRY? */ X newsta_(oindex_1.food, 189, 0, 0, 0); X/* !EATS PEPPERS. */ X/* Computing MIN */ X i__1 = -1, i__2 = -findex_1.rvcyc; X findex_1.rvcyc = min(i__1,i__2); X/* !GETS THIRSTY. */ X return ret_val; X XL300: X if (prsvec_1.prso != oindex_1.water) { X goto L400; X } X/* !DRINK WHEN THIRSTY? */ X if (findex_1.rvcyc >= 0) { X goto L350; X } X newsta_(prsvec_1.prso, 190, 0, 0, 0); X/* !DRINKS AND */ X findex_1.cyclof = TRUE_; X/* !FALLS ASLEEP. */ X objcts_1.oflag2[oindex_1.cyclo - 1] = (objcts_1.oflag2[oindex_1.cyclo - 1] X | SLEPBT) & ~ FITEBT; X return ret_val; X XL350: X rspeak_(191); X/* !NOT THIRSTY. */ XL10: X ret_val = FALSE_; X/* !FAILS. */ X return ret_val; X XL400: X i = 192; X/* !ASSUME INEDIBLE. */ X if (prsvec_1.prso == oindex_1.garli) { X i = 193; X } X/* !GARLIC IS JOKE. */ XL450: X rspeak_(i); X/* !DISDAIN IT. */ X if (findex_1.rvcyc < 0) { X --findex_1.rvcyc; X } X if (findex_1.rvcyc >= 0) { X ++findex_1.rvcyc; X } X if (! findex_1.cyclof) { X i__1 = abs(findex_1.rvcyc) + 193; X rspeak_(i__1); X } X return ret_val; X XL500: X i = 0; X/* !ASSUME NOT HANDLED. */ X if (prsvec_1.prsa == vindex_1.hellow) { X goto L450; X } X/* !HELLO IS NO GO. */ X if (prsvec_1.prsa == vindex_1.throww || prsvec_1.prsa == vindex_1.mungw) { X X i = rnd_(2) + 200; X } X if (prsvec_1.prsa == vindex_1.takew) { X i = 202; X } X if (prsvec_1.prsa == vindex_1.tiew) { X i = 203; X } X if (i <= 0) { X goto L10; X } else { X goto L450; X } X/* !SEE IF HANDLED. */ X X} /* cyclop_ */ X X/* THIEFP- THIEF FUNCTION */ X X/* DECLARATIONS */ X Xlogical thiefp_(arg) Xinteger arg; X{ X /* System generated locals */ X integer i__1; X logical ret_val; X X /* Local variables */ X integer i, j; X X ret_val = TRUE_; X/* !ASSUME WINS. */ X if (prsvec_1.prsa != vindex_1.fightw) { X goto L100; X } X/* !FIGHT? */ X if (objcts_1.ocan[oindex_1.still - 1] == oindex_1.thief) { X goto L10; X } X/* !GOT STILLETTO? F. */ X if (qhere_(oindex_1.still, hack_1.thfpos)) { X goto L50; X } X/* !CAN HE RECOVER IT? */ X newsta_(oindex_1.thief, 0, 0, 0, 0); X/* !NO, VANISH. */ X if (qhere_(oindex_1.thief, play_1.here)) { X rspeak_(498); X } X/* !IF HERO, TELL. */ X return ret_val; X XL50: X newsta_(oindex_1.still, 0, 0, oindex_1.thief, 0); X/* !YES, RECOVER. */ X if (qhere_(oindex_1.thief, play_1.here)) { X rspeak_(499); X } X/* !IF HERO, TELL. */ X return ret_val; X XL100: X if (prsvec_1.prsa != vindex_1.deadxw) { X goto L200; X } X/* !DEAD? */ X hack_1.thfact = FALSE_; X/* !DISABLE DEMON. */ X objcts_1.oflag1[oindex_1.chali - 1] |= TAKEBT; X j = 0; X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X/* !CARRYING ANYTHING? */ X/* L125: */ X if (objcts_1.oadv[i - 1] == -oindex_1.thief) { X j = 500; X } X } X rspeak_(j); X/* !TELL IF BOOTY REAPPEARS. */ X X j = 501; X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X/* !LOOP. */ X if (i == oindex_1.chali || i == oindex_1.thief || play_1.here != X rindex_1.treas || ! qhere_(i, play_1.here)) { X goto L135; X } X objcts_1.oflag1[i - 1] |= VISIBT; X rspsub_(j, objcts_1.odesc2[i - 1]); X/* !DESCRIBE. */ X j = 502; X goto L150; X XL135: X if (objcts_1.oadv[i - 1] == -oindex_1.thief) { X newsta_(i, 0, play_1.here, 0, 0); X } XL150: X ; X } X return ret_val; X XL200: X if (prsvec_1.prsa != vindex_1.frstqw) { X goto L250; X } X/* !FIRST ENCOUNTER? */ X ret_val = prob_(20, 75); X return ret_val; X XL250: X if (prsvec_1.prsa != vindex_1.hellow || objcts_1.odesc1[oindex_1.thief - X 1] != 504) { X goto L300; X } X rspeak_(626); X return ret_val; X XL300: X if (prsvec_1.prsa != vindex_1.outxw) { X goto L400; X } X/* !OUT? */ X hack_1.thfact = FALSE_; X/* !DISABLE DEMON. */ X objcts_1.odesc1[oindex_1.thief - 1] = 504; X/* !CHANGE DESCRIPTION. */ X objcts_1.oflag1[oindex_1.still - 1] &= ~ VISIBT; X objcts_1.oflag1[oindex_1.chali - 1] |= TAKEBT; X return ret_val; X XL400: X if (prsvec_1.prsa != vindex_1.inxw) { X goto L500; X } X/* !IN? */ X if (qhere_(oindex_1.thief, play_1.here)) { X rspeak_(505); X } X/* !CAN HERO SEE? */ X hack_1.thfact = TRUE_; X/* !ENABLE DEMON. */ X objcts_1.odesc1[oindex_1.thief - 1] = 503; X/* !CHANGE DESCRIPTION. */ X objcts_1.oflag1[oindex_1.still - 1] |= VISIBT; X if (play_1.here == rindex_1.treas && qhere_(oindex_1.chali, play_1.here) X ) { X objcts_1.oflag1[oindex_1.chali - 1] &= ~ TAKEBT; X } X return ret_val; X XL500: X if (prsvec_1.prsa != vindex_1.takew) { X goto L600; X } X/* !TAKE? */ X rspeak_(506); X/* !JOKE. */ X return ret_val; X XL600: X if (prsvec_1.prsa != vindex_1.throww || prsvec_1.prso != oindex_1.knife || X (objcts_1.oflag2[oindex_1.thief - 1] & FITEBT) != 0) { X goto L700; X } X if (prob_(10, 10)) { X goto L650; X } X/* !THREW KNIFE, 10%? */ X rspeak_(507); X/* !NO, JUST MAKES */ X objcts_1.oflag2[oindex_1.thief - 1] |= FITEBT; X return ret_val; X XL650: X j = 508; X/* !THIEF DROPS STUFF. */ X i__1 = objcts_1.olnt; X for (i = 1; i <= i__1; ++i) { X if (objcts_1.oadv[i - 1] != -oindex_1.thief) { X goto L675; X } X/* !THIEF CARRYING? */ X j = 509; X newsta_(i, 0, play_1.here, 0, 0); XL675: X ; X } X newsta_(oindex_1.thief, j, 0, 0, 0); X/* !THIEF VANISHES. */ X return ret_val; X XL700: X if (prsvec_1.prsa != vindex_1.throww && prsvec_1.prsa != vindex_1.givew || X prsvec_1.prso == 0 || prsvec_1.prso == oindex_1.thief) { X goto L10; X } X if (objcts_1.ocapac[oindex_1.thief - 1] >= 0) { X goto L750; X } X/* !WAKE HIM UP. */ X objcts_1.ocapac[oindex_1.thief - 1] = -objcts_1.ocapac[oindex_1.thief - 1] X ; X hack_1.thfact = TRUE_; X objcts_1.oflag1[oindex_1.still - 1] |= VISIBT; X objcts_1.odesc1[oindex_1.thief - 1] = 503; X rspeak_(510); X XL750: X if (prsvec_1.prso != oindex_1.brick || objcts_1.ocan[oindex_1.fuse - 1] != X oindex_1.brick || cevent_1.ctick[cindex_1.cevfus - 1] == 0) { X goto L800; X } X rspeak_(511); X/* !THIEF REFUSES BOMB. */ X return ret_val; X XL800: X i__1 = -oindex_1.thief; X newsta_(prsvec_1.prso, 0, 0, 0, i__1); X/* !THIEF TAKES GIFT. */ X if (objcts_1.otval[prsvec_1.prso - 1] > 0) { X goto L900; X } X/* !A TREASURE? */ X rspsub_(512, objcts_1.odesc2[prsvec_1.prso - 1]); X return ret_val; X XL900: X rspsub_(627, objcts_1.odesc2[prsvec_1.prso - 1]); X/* !THIEF ENGROSSED. */ X findex_1.thfenf = TRUE_; X return ret_val; X XL10: X ret_val = FALSE_; X return ret_val; X} /* thiefp_ */ END_OF_FILE if test 11721 -ne `wc -c <'villns.c'`; then echo shar: \"'villns.c'\" unpacked with wrong size! fi # end of 'villns.c' fi echo shar: End of archive 8 \(of 12\). cp /dev/null ark8isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 12 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0