home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 23 / 023.d81 / cybermine (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  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=11a