home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 23 / 023.d81 / cybermine (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  10.6 KB  |  383 lines

  1. 1 rem cybermine adventure
  2. 2 rem by alan poole
  3. 3 gosub60000
  4. 10 gosub8000
  5. 97 rem
  6. 98 rem *** main loop ***
  7. 99 rem
  8. 100 gosub1000:gosub3000:gosub4000:gosub2000
  9. 110 goto100
  10. 997 rem
  11. 998 rem *** print description ***
  12. 999 rem
  13. 1000 print:print"[144]"
  14. 1010 m$="you are "+r$(r)+".":gosub2000
  15. 1020 ifrc>0thengosub1200
  16. 1030 print"";
  17. 1040 lm=4:f=0
  18. 1050 forl=1to29
  19. 1060 ifabs(n%(l))<>rthen1080
  20. 1070 iff=0thenm$="things you see:":gosub2000:f=1
  21. 1075 m$=n$(l):gosub2000
  22. 1080 next:lm=0
  23. 1090 return
  24. 1200 print
  25. 1210 ifrc=1thenm$="the robot is looking at you!":gosub2000
  26. 1220 ifrc=2thenm$="the robot is coming this way!":gosub2000
  27. 1230 ifrc=3thenm$="the robot is chasing you!":gosub2000
  28. 1240 ifrc=4thenm$="the robot got you!":gosub2000:goto4600
  29. 1250 return
  30. 1997 rem
  31. 1998 rem *** output subroutine ***
  32. 1999 rem
  33. 2000 ifm$=""thenreturn
  34. 2010 tt=lm:ifct=1thentt=tt+((ln-len(m$))/2)
  35. 2020 printspc(tt);:forll=1tolen(m$):tt$=mid$(m$,ll,1)
  36. 2030 iftt$=" "andll<len(m$)andpos(0)>ln-10thengosub2100
  37. 2040 printtt$;:next:ifcn=0thenprint
  38. 2050 return
  39. 2100 ff=0:tt=pos(0):iftt>lnthentt=tt-ln
  40. 2110 forlt=ll+1tolen(m$):ifmid$(m$,lt,1)=" "then2130
  41. 2120 iflt<len(m$)then2150
  42. 2130 iftt+lt-ll<lnthenff=1
  43. 2140 lt=255
  44. 2150 next:ifff=0thenprint:tt$=""
  45. 2160 return
  46. 2997 rem
  47. 2998 rem *** input command ***
  48. 2999 rem
  49. 3000 print""
  50. 3010 input"what now";c$
  51. 3020 ifc$=""then3010
  52. 3030 nw=1:forl=1to10:w$(l)="":next
  53. 3040 forl=1tolen(c$)
  54. 3050 ifmid$(c$,l,1)=" "andnw<10thennw=nw+1:goto3070
  55. 3060 w$(nw)=w$(nw)+mid$(c$,l,1)
  56. 3070 next
  57. 3080 v=0:v$="":n1=0:n1$="":n2=0:n2$=""
  58. 3090 forl=1tonw:sl=l:forl2=1to46
  59. 3100 ifv$(l2)=left$(w$(l),4)thenv=l2:v$=v$(l2):l=10:l2=46
  60. 3110 next:next
  61. 3120 ifv=0orsl=nwthenreturn
  62. 3130 forl=sl+1tonw:sl=l:forl2=1to29
  63. 3140 ifa$(l2)=left$(w$(l),4)thenn1=l2:n1$=a$(l2):l=10:l2=29
  64. 3150 next:next
  65. 3160 ifn1=0orsl=nwthenreturn
  66. 3170 forl=sl+1tonw:forl2=1to29
  67. 3180 ifa$(l2)=left$(w$(l),4)thenn2=l2:n2$=a$(l2):l=10:l2=29
  68. 3190 next:next
  69. 3200 return
  70. 3997 rem
  71. 3998 rem *** execute command ***
  72. 3999 rem
  73. 4000 print"";
  74. 4010 ifr>12andr<21andrnd(1)<.4andrc=0thenn%(11)=-r
  75. 4020 ifv=0thenm$=m1$:return
  76. 4030 ifv>12then4050
  77. 4040 onvgosub4100,4100,4100,4100,4100,4100,4100,4100,4100,4300,4400,4400
  78. 4045 goto4091
  79. 4050 ifv>24then4070
  80. 4060 onv-12gosub4400,4600,4700,4800,4900,5000,5100,5900,5300,5400,5500,5600
  81. 4065 goto4091
  82. 4070 ifv>36then4090
  83. 4080 onv-24gosub5700,5800,4100,4100,5900,5800,6200,6200,6300,4800,6500,6600
  84. 4085 goto4091
  85. 4090 onv-36gosub6700,6800,6900,4700,4100,5100,5800,4400,7000,5900
  86. 4091 ifrc>0orabs(n%(11))=rthenrc=rc+1:n%(11)=-r
  87. 4092 ifr=1thenn%(5)=-1
  88. 4093 ifr=2thenn%(5)=-2
  89. 4094 ifr=10thenn%(13)=-10
  90. 4095 ifr=9thenn%(13)=-9
  91. 4097 return
  92. 4098 rem
  93. 4099 rem  go,run,enter,move
  94. 4100 ifv=27andr=20then6900
  95. 4105 d$=left$(n1$,1):ifv<9thend$=left$(v$,1)
  96. 4110 d=-1
  97. 4120 ifd$="n"thend=0
  98. 4130 ifd$="s"thend=1
  99. 4140 ifd$="e"thend=2
  100. 4150 ifd$="w"thend=3
  101. 4160 ifd=-1or(n1<26andn1>0)then4200
  102. 4170 ifc%(r,d)=0then4250
  103. 4180 r=c%(r,d):m$=m3$
  104. 4190 return
  105. 4200 ifr=2andn1=6thend=1:goto4170
  106. 4205 ifr=1andn1=1then6700
  107. 4210 ifr=3andn1=7then6300
  108. 4220 ifr=5andn1=9thend=2:goto4170
  109. 4230 ifr=7andn1=10thend=0:goto4170
  110. 4235 if(r=2orr=1)andn1=5then5000
  111. 4240 m$="i don't understand where you want to go.":return
  112. 4250 ifr=2andd=1thenm$="i don't see a door to enter the building.":return
  113. 4260 ifr=3andd=2thenm$="the water is in that direction.":return
  114. 4270 ifr=10andd=3thenm$="the wall is too high.":return
  115. 4280 m$="your path is blocked in that direction.":return
  116. 4298 rem
  117. 4299 rem  inventory
  118. 4300 m$="you are carrying:":gosub2000
  119. 4310 f=0:lm=4:forl=1to29
  120. 4320 ifn%(l)=99thenm$=n$(l):gosub2000:f=1
  121. 4330 next:iff=0thenm$="nothing":gosub2000
  122. 4340 m$="":lm=0:return
  123. 4398 rem
  124. 4399 rem  look,examine,see,search
  125. 4400 ifabs(n%(n1))<>randabs(n%(n1))<>99then4490
  126. 4410 ifn1<>1orn%(2)<>0then4420
  127. 4415 m$="there is a pillow and a blanket.":n%(2)=1:n%(25)=1:return
  128. 4420 ifn1=23andn%(4)=0thenm$="there's a slightly burned book.":n%(4)=22:return
  129. 4425 ifn1=3andn%(24)=0thenm$="a clock is here.":n%(24)=1:return
  130. 4428 ifn1=24thenm$="it's broken.":return
  131. 4430 ifn1=4thenm$="it's a journal with writing in it.":return
  132. 4440 ifn1=4then4900
  133. 4450 ifn1=6thenm$="there doesn't seem to be an entrance.":return
  134. 4460 ifn1<>14then4470
  135. 4465 ifps=0thenm$="there is an empty slot in the laser.":gosub2000
  136. 4468 m$="there's a switch on top of it":return
  137. 4470 ifn1=20thenm$="on the screen is the message 'enter password.'":return
  138. 4480 ifn1=5andr=2thenm$="there's a bedroom inside.":return
  139. 4482 ifn1=21andn%(22)=0thenm$="there's a sheet of paper.":n%(22)=11:return
  140. 4484 ifn1=22thenm$="there's writing on it.":return
  141. 4490 m$="you don't see anything special.":return
  142. 4598 rem
  143. 4599 rem  quit
  144. 4600 print:print"[156]"
  145. 4610 m$="time you have been playing:  "
  146. 4620 m$=m$+left$(ti$,2)+":"+mid$(ti$,3,2)+":"+right$(ti$,2)
  147. 4630 gosub2000:print
  148. 4640 m$="do you want to play again? (y or n)":gosub2000
  149. 4650 gett$:ift$="y"thenrun
  150. 4660 ift$="n"then63000
  151. 4670 goto4650
  152. 4698 rem
  153. 4699 rem  get,take
  154. 4700 f=0:forl=1tonw:ifw$(l)="all"orleft$(w$(l),4)="ever"thenf=1
  155. 4710 next:iffthen4780
  156. 4715 ifn1=0thenm$=m1$:return
  157. 4720 ifabs(n%(n1))=99thenm$="you already have it!":return
  158. 4730 ifabs(n%(n1))<>rthenm$=m2$:return
  159. 4735 ifn1=11thenrc=4:goto1240
  160. 4740 ifn%(n1)>-1then4750
  161. 4742 t=rnd(1):ift<.33thenm$="you can't lift it!":return
  162. 4743 ift<.66thenm$="i don't think so.":return
  163. 4744 m$="don't be absurd!":return
  164. 4750 m$=m3$:n%(n1)=99
  165. 4760 return
  166. 4780 forl=1to27:ifabs(n%(l))<>rthen4790
  167. 4785 n1=l:gosub4720:m$=n$(l)+": "+m$:gosub2000
  168. 4790 next:m$="":return
  169. 4798 rem
  170. 4799 rem  drop,lean
  171. 4800 ifn%(n1)<>99thenm$="you're not carrying it.":return
  172. 4810 m$=m3$:n%(n1)=r
  173. 4820 return
  174. 4898 rem
  175. 4899 rem  read
  176. 4900 ifabs(n%(n1))<>randn%(n1)<>99thenm$=m2$:return
  177. 4910 ifn1=22thenm$="it says: the password is firmare.":return
  178. 4915 ifn1=20then4470
  179. 4920 ifn1=24then4428
  180. 4930 ifn1<>4thenm$="there's nothing to read.":return
  181. 4940 m$="journal of commander matthew s. haller":gosub2000
  182. 4950 print
  183. 4960 m$="65.073.21":gosub2000:cn=1
  184. 4970 m$="the robots have taken over the mine. they have already killed"
  185. 4980 m$=m$+" several of my men. the only way to stop them is by getting to the"
  186. 4985 m$=m$+" power generator, which is deep within the mine, and giving the"
  187. 4990 gosub2000:m$=" computer the password. the password is":gosub2000
  188. 4995 print:print:m$="the journal ends here.":cn=0:return
  189. 4998 rem
  190. 4999 rem  climb
  191. 5000 ifabs(n%(n1))<>randn%(n1)<>99thenm$=m2$:return
  192. 5005 ifn1=12andn%(12)=99thenm$="you drop the ladder first.":gosub2000:n%(12)=r
  193. 5010 ifn1=12andr<>9andr<>10thenm$="ok, but you didn't get anywhere.":return
  194. 5020 ifn1=5andwb=0thenm$="it's shut.":return
  195. 5030 ifn1=5andr=2thenm$=m3$:r=1:return
  196. 5040 ifn1=5andr=1thenm$=m3$:r=2:return
  197. 5050 if(r<>9andr<>10)or(n1<>12andn1<>13)thenm$=m2$:return
  198. 5060 ifn%(12)<>rthenm$=m4$:return
  199. 5070 m$=m3$+" you climb on top of the wall, put the ladder on the other"
  200. 5080 m$=m$+" side and climb down."
  201. 5090 ifr=9thenr=10:n%(12)=10:return
  202. 5095 r=9:n%(12)=9:return
  203. 5098 rem
  204. 5099 rem  kill
  205. 5100 ifn1=11andrc>0thenrc=4:goto1240
  206. 5110 m$="it's not alive!":return
  207. 5298 rem
  208. 5299 rem  throw
  209. 5300 ifn%(n1)<>99thenm$="you don't have it.":return
  210. 5305 n%(n1)=r
  211. 5310 ifn1<>8orn2<>5orwb=1orr<>2then5320
  212. 5315 m$="smash! the window shatters.":n$(5)="broken window":wb=1:return
  213. 5320 ifn2=11andrc>0thenm$="it didn't hurt the robot.":return
  214. 5330 if(n2=18andr=20)or(n2=20andr=20)thenm$="it is unharmed.":return
  215. 5340 ifn2=19andr=9thenm$="the machines cannot be damaged.":return
  216. 5350 m$=m3$+" it drops to the ground.":return
  217. 5398 rem
  218. 5399 rem  eat
  219. 5400 m$="don't be ridiculous!":return
  220. 5498 rem
  221. 5499 rem  drink
  222. 5500 ifr=3orr=4thenm$="it's very refreshing!":return
  223. 5510 m$="i don't see how!":return
  224. 5598 rem
  225. 5599 rem  open
  226. 5600 ifn1<>4thenm$="it won't open.":return
  227. 5610 m$=m3$:return
  228. 5698 rem
  229. 5699 rem  close
  230. 5700 ifn1=4thenm$=m3$:return
  231. 5710 m$=m4$:return
  232. 5798 rem
  233. 5799 rem  put,place,insert
  234. 5800 ifn1<>16or(n2<>14andn2<>17)then4800
  235. 5810 if(n%(16)<>99andn%(16)<>r)or(n%(14)<>99andn%(14)<>r)thenm$=m4$:return
  236. 5820 m$="the power pak is now in the laser.":ps=1:n%(16)=0:return
  237. 5898 rem
  238. 5899 rem  break,smash,hit
  239. 5900 ifn1=5andn2=8andwb=0andr=2andn%(8)=99then5315
  240. 5910 ifabs(n%(n1))<>randn%(n1)<>99thenm$=m2$:return
  241. 5915 ifn1=11andrc>0andn2>0thenn2=n1:goto5320
  242. 5920 m$="ouch! you hurt your hand, but it didn't break."
  243. 5930 ifn1=11andrc>0thenrc=4:gosub2000:goto1240
  244. 5940 return
  245. 6198 rem
  246. 6199 rem  shoot,fire
  247. 6200 ifn%(14)<>99thenm$="you don't have a gun.":return
  248. 6210 ifn1=14thent=n1:n1=n2:n2=t
  249. 6220 ifps=0orsf=0thenm$=m5$:return
  250. 6225 ifn1=0thenm$="you have to specify at what you want to shoot.":return
  251. 6230 ifrc=0orn1<>11thenm$="you fire the laser, but no damage is done.":return
  252. 6240 t=rnd(1):ift<.55thenm$="you destroyed the robot!":rc=0:n%(11)=0:return
  253. 6250 ift<.7thenm$="you missed!":return
  254. 6260 ift<.85thenm$="you just barely missed!":return
  255. 6270 m$="you only damaged the robot a little.":return
  256. 6298 rem
  257. 6299 rem  swim
  258. 6300 ifr<>3then6310
  259. 6301 f=0:forl=1to29:ifn%(l)=99thenn%(l)=r:f=1
  260. 6302 next:iffthenm$="you drop everything you are carrying.":gosub2000
  261. 6304 m$=m3$:r=4:ifrc=0thenreturn
  262. 6305 m$=m$+" the robot follows you and is electrocuted."
  263. 6306 m$=m$+" it sinks to the bottom."
  264. 6307 rc=0:n%(11)=0:return
  265. 6310 ifr=4then4100
  266. 6320 m$="you're strange!":return
  267. 6498 rem
  268. 6499 rem  flip
  269. 6500 ifn1<>15or(n%(14)<>99andn%(14)<>r)thenm$=m2$:return
  270. 6510 m$=m3$:ifsf=0thensf=1:return
  271. 6520 sf=0:return
  272. 6598 rem
  273. 6599 rem  jump
  274. 6600 ifr=3then6300
  275. 6610 m$=m5$:return
  276. 6698 rem
  277. 6699 rem  sleep
  278. 6700 m$="i'm not tired.":return
  279. 6798 rem
  280. 6799 rem  pick
  281. 6800 f=0:forl=1tonw:ifw$(l)="up"thenf=1:l=nw
  282. 6810 next:iff=0thenm$=m2$:return
  283. 6820 goto4700
  284. 6898 rem
  285. 6899 rem  type
  286. 6900 ifr<>20thenm$=m2$:return
  287. 6910 f=0:forl=1tonw:ifw$(l)="firmare"thenf=1:l=nw
  288. 6920 next
  289. 6930 iff=0thenm$="the computer responds: wrong password.":return
  290. 6950 print"[159]"
  291. 6960 m$="congratulations!":ct=1:gosub2000:ct=0:print
  292. 6970 m$="all power has been cut off and the killer robots have been stopped."
  293. 6980 gosub2000:m$="you win the game!":gosub2000
  294. 6990 goto4600
  295. 6998 rem
  296. 6999 rem  follow
  297. 7000 ifr=6thenm$=m3$:r=7:return
  298. 7010 ifr=8thenm$=m3$:r=11:return
  299. 7020 m$=m2$:return
  300. 7997 rem
  301. 7998 rem *** initialization ***
  302. 7999 rem
  303. 8000 sys65517:ln=peek(781):ifln=22thenpoke36879,27
  304. 8010 ifln=40thenpoke53280,3:poke53281,1
  305. 8020 print"[147][156]";
  306. 8030 forl=1toln:print"[195]";:next
  307. 8040 m$="cybermine adventure":ct=1:gosub2000
  308. 8050 print:m$="by alan poole":gosub2000:ct=0
  309. 8060 forl=1toln:print"[195]";:next
  310. 8070 dimr$(22),n$(29),a$(29),v$(46),n%(29),c%(22,3)
  311. 8080 m1$="i don't understand.":m2$="you can't."
  312. 8090 m3$="ok.":m4$="how?"
  313. 8100 m5$="nothing happens."
  314. 8110 forl=1to22:readr$(l)
  315. 8120 forl2=0to3:readc%(l,l2)
  316. 8130 next:next
  317. 8135 r$(14)=r$(13):r$(15)=r$(13):r$(16)=r$(13):r$(17)=r$(13):r$(18)=r$(13)
  318. 8136 r$(19)=r$(13)
  319. 8140 forl=1to29:readn$(l),a$(l),n%(l)
  320. 8150 next
  321. 8160 forl=1to46:readv$(l)
  322. 8170 next
  323. 8180 ti$="000000"
  324. 8190 r=5
  325. 8200 print:print:return
  326. 8997 rem
  327. 8998 rem *** data ***
  328. 8999 rem
  329. 9000 datain the commander's apartment,0,0,0,0
  330. 9010 datain front of a building. to the west are some ruins,5,0,0,22
  331. 9020 dataon the west shore of a small lake,6,0,0,0
  332. 9030 dataswimming in the lake,4,4,4,3
  333. 9040 dataon top of a small hill. to the east is a trail. a path goes south
  334. 9045 data0,2,6,21
  335. 9050 dataon a north/south trail,7,3,0,5
  336. 9060 datanext to the entrance to a tunnel,8,6,0,0
  337. 9070 datain the tunnel,11,7,0,0
  338. 9080 datain the robot factory. there are large machines that make the robots
  339. 9090 data0,0,0,0
  340. 9100 datain front of a large wall built by the robots,0,0,11,0
  341. 9110 datain the main office,15,8,12,10
  342. 9120 datain the storage room,0,0,0,11
  343. 9130 datain the twisted tunnels of the mine,16,15,14,13
  344. 9140 data,17,18,17,13
  345. 9150 data,18,11,19,15
  346. 9160 data,18,13,20,15
  347. 9170 data,17,14,18,19
  348. 9180 data,17,15,19,17
  349. 9190 data,18,19,19,18
  350. 9200 datain the control room of the power generator,17,19,13,16
  351. 9204 dataat a dead end in the middle of some huge boulders,0,0,5,0
  352. 9206 dataat the ruins of a building,0,0,2,0
  353. 9210 databed,bed,-1,pillow,pill,0,table,tabl,-1
  354. 9220 dataslightly burned book,book,0,window,wind,-2,building,buil,-2
  355. 9230 datalake,lake,-3,rock,rock,21,trail,trai,-5
  356. 9240 datatunnel,tunn,-7,robot,robo,-7,ladder,ladd,12
  357. 9250 datawall,wall,-10,laser gun,lase,9,switch,swit,0
  358. 9260 datapower pak for laser,powe,15,slot,slot,0,power generator,gene,-20
  359. 9265 datalarge machines,mach,-9,computer terminal,comp,-20,desk,desk,-11
  360. 9270 datasheet of paper,pape,0,ruins,ruin,-22,clock,cloc,0,blanket,blan,0
  361. 9275 data,nort,0,,sout,0,,east,0,,west,0
  362. 9280 datanort,sout,east,west,n,s,e,w,go,inve,look,exam,see,quit,get,drop
  363. 9290 dataread,clim,kill,hit,thro,eat,drin,open,clos,put,ente,run,brea
  364. 9300 datainse,fire,shoo,swim,lean,flip,jump,slee,pick,type,take,move,atta
  365. 9310 dataplac,sear,foll,smas
  366. 60000 nm$="[193]lan [208]oole":pr$="[195]ybermine"
  367. 60005 deffncn(n)=int(19-n/2)
  368. 60010 t$="                         ":c=0:c$="":print"[147]":poke53281,0
  369. 60015 printspc(7)""t$:printspc(7)"                         [146]"
  370. 60020 printtab(fncn(len(pr$)))"[145]"pr$
  371. 60025 printspc(7)""t$:print:printtab(18)"by"
  372. 60030 print:printspc(fncn(len(nm$)))"[158]"nm$""
  373. 60035 print:printspc(12)"[195]opyright 1986"
  374. 60040 print:print:print:print"     [204][207][193][196][211][212][193][210] is not public domain."
  375. 60045 print:print"  [208]lease respect the author's rights."
  376. 60050 print:print"      [208]ress space bar to continue."
  377. 60055 forcc=1to48:getk$:ifk$=" "then60070
  378. 60060 ifcc=1thenprintmid$(c$,c+2,1)"[145][145]";:c=not(c)
  379. 60065 next:goto60050
  380. 60070 printc$chr$(142):return
  381. 63000 rem   connect to l.s.
  382. 63010 load"hello connect",8
  383.