home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Glitch Apple Disk Collection
/
2014.glitch.apple.collection.zip
/
indexed
/
TEXT_ADV.DSK
/
ADV.CAVES.bas
next >
Wrap
BASIC Source File
|
2014-09-09
|
8KB
|
198 lines
0 PRINT : GOSUB 1200
1 TI = 0:T4 = 500
4 PRINT : FOR I = 0 TO 39: PRINT "*";: NEXT
5 PRINT
7 GOSUB 2110
19 DIM V$(28),P(1),T(10,4,1),A(10,3),Q(3),S(10)
30 FOR I = 0 TO 10: FOR J = 0 TO 4: FOR K = 0 TO 1: READ T(I,J,K): NEXT K,J,I
36 A(3,0) = 1:A(0,0) = 2:A(6,0) = 3:A(1,0) = 4:A(8,0) = 5:A(1,1) = 6:A(7,0) = 7
37 P(0) = .3:P(1) = .5
40 FOR I = 1 TO 28: READ V$(I): NEXT
100 PRINT : GOSUB 1200
105 GOSUB 1500
107 PRINT
110 N$ = "": INPUT "COMMAND=";D$:H = LEN(D$):TI = TI +1000:KK = KK +1
111 IF LEFT$(D$,1) = " " THEN PRINT "11": GOTO 110
112 FOR I = 1 TO H: IF MID$ (D$,I,1) < >" " THEN NEXT
115 U = 99:B = I: IF I >5 THEN B = 5
116 C$ = LEFT$(D$,B -1): IF I > = H THEN 120
117 B = H -I: IF B >4 THEN B = 4
118 E$ = RIGHT$(D$,H -I):N$ = LEFT$(E$,B)
120 GOSUB 1100
125 IF I = 0 THEN PRINT : PRINT "I DON'T UNDERSTAND ";D$: GOTO 110
126 IF I < >14 THEN 130
127 GOSUB 2000
128 GOTO 398
130 IF I < >13 THEN 133
131 PRINT "OK!": GOSUB 2112
132 GOTO 100
133 IF I < >15 THEN 139
135 PRINT : PRINT "I HOPE YOU HAVE ENJOYED YOUR STAY": GOSUB 2000
137 END
139 O = 6: GOSUB 2183
140 IF B < >4 THEN U = L
143 V = I: IF V >15 THEN 172
144 IF U = 99 THEN F = L
146 GOSUB 1000
148 R = RND(1): IF M <100 THEN L = M: GOTO 390
150 M1 = INT(M/100):M2 = M -M1 *100:M3 = INT(M1/10):M4 = M1 -M3 *10: IF M4 = 0 THEN 160
157 IF R <P(M4 -1) THEN L = M2: GOTO 390
158 IF M3 <50 THEN L = M3: GOTO 390
159 M2 = M3 -50
160 GOSUB 1400
165 GOTO 398
172 IF N$ = "" THEN PRINT : PRINT C$;" WHAT?": GOTO 110
173 C$ = N$: GOSUB 1100
175 IF I = 0 THEN 125
178 O = I -20: IF V < >16 THEN 190
179 IF O = 6 THEN PRINT : PRINT "YOU'RE KIDDING!": GOTO 398
180 IF U < >99 AND O >2 THEN 390
183 GOSUB 2183
184 IF B = 4 AND O = 8 THEN O = 7: GOSUB 2183
185 IF B = 4 THEN PRINT "IF THERE'S A ";E$;" HERE, YOU CAN'T GET IT": GOTO 398
186 O1 = O:O = 0: GOSUB 2193
188 IF C = 4 THEN PRINT : PRINT "YOUR HANDS ARE FULL": GOTO 398
189 O = O1:A(L,B) = 0:Q(C) = O: PRINT : PRINT "OK": GOTO 398
190 IF V < >17 THEN 230
191 GOSUB 2193
193 IF C = 4 AND O = 8 THEN O = 7: GOSUB 2193
196 IF C = 4 THEN 238
197 O1 = O:O = 0: GOSUB 2183
199 IF B = 4 THEN PRINT : PRINT "NO MORE ROOM HERE": GOTO 398
200 I = B:O = O1:A(L,I) = O:Q(C) = 0: IF O < >1 THEN 300
201 O = 6: GOSUB 2183
203 IF B = 4 THEN 390
204 A(L,B) = 0: PRINT : PRINT "AMAZINGLY THE DRAGON IS TERRIFIED OF KITTENS"
205 PRINT " HE HAS FLOWN OFF ELSEWHERE IN THE CAVE "
210 R = INT( RND(1) *10)
215 FOR B = 0 TO 3: IF A(R,B) = 0 THEN 218
216 NEXT
217 GOTO 210
218 IF R = L THEN 210
220 A(R,B) = 6:F = U:U = 99
221 M = RND(1): IF M >0.25 THEN 398
222 PRINT : PRINT "HOWEVER, THE KITTEN HAS RUN OFF SCARED ":A(L,I) = 0
223 M = INT( RND(1) *10): IF M = L OR M = R THEN 223
224 FOR I = 1 TO 3: IF A(M,I) = 0 THEN A(M,I) = 1: GOTO 398
225 NEXT
226 GOTO 223
230 IF V < >18 THEN 250
231 GOSUB 2193
238 IF C = 4 THEN PRINT : PRINT "YOU HAVE NO ";E$: GOTO 398
240 IF O = 2 AND T4 = 500 THEN PRINT : PRINT "THE LAMP IS NOW LIT "
241 T4 = TI/3600 +15:T3 = 0: GOTO 398
245 GOTO 270
250 IF V < >19 THEN 280
255 GOSUB 2183
257 IF B = 4 THEN PRINT "ITS NOT HERE!": GOTO 398
260 IF O = 6 THEN 179
265 IF O = 1 THEN S2 = 0: PRINT "YOU'RE SICK AND I WON'T PLAY ANYMORE!": END
270 PRINT "YOU CAN'T DO THAT!": GOTO 398
280 IF V < >20 THEN 398
285 GOSUB 2193
287 IF C = 4 THEN 270
290 E$ = "OIL":O = 7: GOSUB 2193
291 IF C = 4 THEN 270
292 Q(C) = 8: PRINT : PRINT "THE LAMP IS REFILLED!"
294 IF T4 = 600 THEN T4 = 500: GOTO 398
296 T3 = 0:T4 = TI/3600 +15: GOTO 398
300 IF O < >7 THEN 398
310 A(L,B) = 8: PRINT : PRINT "WHOOPS! SPILLED THE OIL ": GOTO 398
390 IF U = 99 THEN 398
395 IF L < >F THEN PRINT : PRINT "CAN'T YOU SEE THE DRAGON?":L = U
398 IF L = 0 OR F = 0 OR L = 2 THEN 490
400 O = 2: GOSUB 2193
401 IF C < >4 AND T4 <500 THEN 490
402 GOSUB 2183
403 IF B < >4 AND T4 <500 THEN 490
410 L = F: PRINT : PRINT "YOU CAN'T WANDER THE CAVE IN THE DARK!": GOTO 490
490 IF S(L) = 0 THEN S(L) = 1
492 IF T4 >TI/3600 THEN 100
494 IF T3 = 0 THEN PRINT : PRINT "YOUR LAMP IS BURNING LOW":T3 = T4 +5: GOTO 100
496 IF TI/3600 >T3 THEN T4 = 600: PRINT : PRINT "YOUR LAMP HAS GONE OUT!"
499 GOTO 100
1000 M = 1000: FOR I = 0 TO 4
1010 IF T(L,I,0) = V THEN M = T(L,I,1)
1015 IF T(L,I,0) < >0 THEN NEXT
1020 RETURN
1100 I2 = 4:I1 = 28: IF LEN(C$) = 1 THEN I1 = 11:I2 = 1
1105 FOR I = I1 TO 1 STEP -1
1107 IF C$ = LEFT$(V$(I),I2) THEN RETURN
1110 NEXT : RETURN
1200 ON L +1 GOSUB 1205,1212,1222,1232,1242,1252,1262,1272,1282,1292,1302
1202 RETURN
1205 PRINT "YOU ARE AT A NARROW CRACK IN SOME ROCKS"
1206 PRINT "A SIGN SAYS 'THIS WAY IN'": RETURN
1212 PRINT "YOU ARE AT A ROUND PIT. A LEDGE LEADS OFF TO THE S": RETURN
1222 PRINT "LOST IN THE WOODS, ALL DIRECTIONS LOOK ALIKE": RETURN
1232 PRINT "YOU ARE AT A PILE OF RUBBLE AT THE N END OF A LOW"
1233 PRINT "PASSAGE"
1234 PRINT "A SIGN SAYS 'MAGIC MAY WORK HERE'": RETURN
1242 PRINT "YOU ARE IN A LOW E/W CRAWL WAY. FAINT LIGHT CAN"
1243 PRINT "BE SEEN OVERHEAD.": RETURN
1252 PRINT "YOU'RE IN A GREAT HALL. TO THE N A NARROW CRACK CAN"
1253 PRINT "BE SEEN. THERE IS A PASSAGE TO THE E. TO THE S A"
1254 PRINT "CHASM CROSSES THE HALL FROM E TO W.": RETURN
1262 PRINT "YOU'RE IN A ROUND CHAMBER. PASSAGES LEAD SEVERAL WAYS"
1263 PRINT "IN THE CENTER IS A ROCK PILE REACHING THE CEILING": RETURN
1272 PRINT "YOU STAND AT THE N EDGE OF A 3 METER DEEP CHASM"
1273 PRINT "ABOUT 2 METERS WIDE. THE HALL GOES ON BEYOND.": RETURN
1282 PRINT "YOU'RE TEETERING ON THE BRINK OF A 3 METER DEEP"
1283 PRINT "CHASM. A GREAT HALL IS SEEN BEYOND TO THE NORTH."
1284 PRINT "PASSAGES RUN E & W": RETURN
1292 PRINT "YOU'RE AT THE START OF A STEEP,SMOOTH SLIPPERY"
1293 PRINT "RAMP GOING DOWN TO THE S & E. IT LOOKS TOO STEEP"
1294 PRINT "TO CLIMB BACK UP.": RETURN
1302 PRINT "LYING BRUISED AND BLEEDING AT THE FOOT OF A 3"
1303 PRINT "METER HIGH SHEAR WALL, YOU STARE UP AT A DISTANT"
1304 PRINT "ARCHED ROOF AND PONDER YOUR FATE.": RETURN
1400 ON M2 +1 GOSUB 1402,1412,1422
1401 RETURN
1402 PRINT "YOU CAN'T DO THAT HERE!": RETURN
1412 PRINT "THAT DIDN'T WORK THIS TIME!": RETURN
1422 PRINT "THE WALLS ARE TOO SLIPPERY FOR EASY CLIMBING!": RETURN
1500 FOR I = 0 TO 3: IF A(L,I) = 0 THEN 1590
1530 ON A(L,I) GOTO 1540,1545,1550,1555,1560,1565,1570,1575
1535 GOTO 1590
1540 PRINT : PRINT "A CUTE KITTEN SCAMPERS ABOUT UNDER FOOT.": GOTO 1590
1541 GOTO 1590
1545 PRINT : PRINT "AN OIL LAMP IS ON THE GROUND.": GOTO 1590
1550 PRINT : PRINT "A LARGE GOLD NUGGET IS HERE.": GOTO 1590
1555 PRINT : PRINT "A PILE OF SILVER COINS IS STREWN ABOUT.": GOTO 1590
1560 PRINT : PRINT "A RUBY GLEAMS NEARBY.": GOTO 1590
1565 PRINT : PRINT "A LARGE DRAGON BLOCKS YOUR PATH.": GOTO 1590
1570 PRINT : PRINT "A JAR OF OIL STANDS NEARBY.": GOTO 1590
1575 PRINT : PRINT "AN EMPTY JAR LIES ON THE GROUND.": GOTO 1590
1590 NEXT I
1591 FOR I = 1 TO 40: PRINT "-";
1592 NEXT I
1595 RETURN
2000 Z = 0: FOR I = 0 TO 10:Z = Z +S(I) *4: NEXT
2010 FOR I = 0 TO 3: IF A(0,I) = 1 OR (A(0,I) >2 AND A(0,I) <6) THEN Z = Z +14
2012 NEXT : PRINT : PRINT "IN ";KK;" MOVES IN THE CAVE, YOUR SCORE IS ";Z
2015 RETURN
2110 PRINT "EXPLORE A DEEP AND MYSTERIOUS CAVE, BUT WATCH OUT"
2111 PRINT "FOR THE UNEXPECTED!": PRINT
2112 PRINT : PRINT "ENTER COMMANDS SUCH AS -": PRINT " NORTH,UP,IN,GET,DROP,LIGHT,HELP,SCORE,QUIT"
2113 PRINT : FOR I = 1 TO 40: PRINT "*";: NEXT : RETURN
2114 FOR I = 1 TO 50: PRINT "*";
2115 NEXT : RETURN
2183 FOR B = 0 TO 3: IF A(L,B) = O THEN RETURN
2184 NEXT : RETURN
2193 FOR C = 0 TO 3: IF Q(C) = O THEN RETURN
2194 NEXT : RETURN
9010 DATA 10,4,1,2,2,2,3,2,4,2
9011 DATA 2,8,5,6,7,6,9,51203,8,5
9012 DATA 1,02100,2,02100,3,02100,4,02100,0,0
9013 DATA 2,4,6,52109,8,52109,9,51201,0,0
9014 DATA 3,3,4,5,6,0,8,0,11,0
9015 DATA 1,6,2,7,3,4,8,4,9,51108
9016 DATA 1,06205,4,06205,6,1,7,6,8,1
9017 DATA 1,5,5,10,8,10,7,10208,5,10
9018 DATA 3,9,4,1,5,10,8,10,7,10107
9019 DATA 1,8,2,3,5,3,7,3,3,3
9020 DATA 8,52107,9,51104,6,10,7,10,0,0
9100 DATA NORT,SOUT,EAST,WEST,DOWN,UP,JUMP,CLIM,MAGI,IN,OUT,JPO
9101 DATA HELP,SCOR,QUIT,GET,DROP,LIGH,KILL,FILL
9200 DATA KITT,LAMP,GOLD,COIN,RUBY,DRAG,OIL,JAR
9999 END