home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 23
/
023.d81
/
cybermine
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
11KB
|
383 lines
1 rem cybermine adventure
2 rem by alan poole
3 gosub60000
10 gosub8000
97 rem
98 rem *** main loop ***
99 rem
100 gosub1000:gosub3000:gosub4000:gosub2000
110 goto100
997 rem
998 rem *** print description ***
999 rem
1000 print:print"[144]"
1010 m$="you are "+r$(r)+".":gosub2000
1020 ifrc>0thengosub1200
1030 print"";
1040 lm=4:f=0
1050 forl=1to29
1060 ifabs(n%(l))<>rthen1080
1070 iff=0thenm$="things you see:":gosub2000:f=1
1075 m$=n$(l):gosub2000
1080 next:lm=0
1090 return
1200 print
1210 ifrc=1thenm$="the robot is looking at you!":gosub2000
1220 ifrc=2thenm$="the robot is coming this way!":gosub2000
1230 ifrc=3thenm$="the robot is chasing you!":gosub2000
1240 ifrc=4thenm$="the robot got you!":gosub2000:goto4600
1250 return
1997 rem
1998 rem *** output subroutine ***
1999 rem
2000 ifm$=""thenreturn
2010 tt=lm:ifct=1thentt=tt+((ln-len(m$))/2)
2020 printspc(tt);:forll=1tolen(m$):tt$=mid$(m$,ll,1)
2030 iftt$=" "andll<len(m$)andpos(0)>ln-10thengosub2100
2040 printtt$;:next:ifcn=0thenprint
2050 return
2100 ff=0:tt=pos(0):iftt>lnthentt=tt-ln
2110 forlt=ll+1tolen(m$):ifmid$(m$,lt,1)=" "then2130
2120 iflt<len(m$)then2150
2130 iftt+lt-ll<lnthenff=1
2140 lt=255
2150 next:ifff=0thenprint:tt$=""
2160 return
2997 rem
2998 rem *** input command ***
2999 rem
3000 print""
3010 input"what now";c$
3020 ifc$=""then3010
3030 nw=1:forl=1to10:w$(l)="":next
3040 forl=1tolen(c$)
3050 ifmid$(c$,l,1)=" "andnw<10thennw=nw+1:goto3070
3060 w$(nw)=w$(nw)+mid$(c$,l,1)
3070 next
3080 v=0:v$="":n1=0:n1$="":n2=0:n2$=""
3090 forl=1tonw:sl=l:forl2=1to46
3100 ifv$(l2)=left$(w$(l),4)thenv=l2:v$=v$(l2):l=10:l2=46
3110 next:next
3120 ifv=0orsl=nwthenreturn
3130 forl=sl+1tonw:sl=l:forl2=1to29
3140 ifa$(l2)=left$(w$(l),4)thenn1=l2:n1$=a$(l2):l=10:l2=29
3150 next:next
3160 ifn1=0orsl=nwthenreturn
3170 forl=sl+1tonw:forl2=1to29
3180 ifa$(l2)=left$(w$(l),4)thenn2=l2:n2$=a$(l2):l=10:l2=29
3190 next:next
3200 return
3997 rem
3998 rem *** execute command ***
3999 rem
4000 print"";
4010 ifr>12andr<21andrnd(1)<.4andrc=0thenn%(11)=-r
4020 ifv=0thenm$=m1$:return
4030 ifv>12then4050
4040 onvgosub4100,4100,4100,4100,4100,4100,4100,4100,4100,4300,4400,4400
4045 goto4091
4050 ifv>24then4070
4060 onv-12gosub4400,4600,4700,4800,4900,5000,5100,5900,5300,5400,5500,5600
4065 goto4091
4070 ifv>36then4090
4080 onv-24gosub5700,5800,4100,4100,5900,5800,6200,6200,6300,4800,6500,6600
4085 goto4091
4090 onv-36gosub6700,6800,6900,4700,4100,5100,5800,4400,7000,5900
4091 ifrc>0orabs(n%(11))=rthenrc=rc+1:n%(11)=-r
4092 ifr=1thenn%(5)=-1
4093 ifr=2thenn%(5)=-2
4094 ifr=10thenn%(13)=-10
4095 ifr=9thenn%(13)=-9
4097 return
4098 rem
4099 rem go,run,enter,move
4100 ifv=27andr=20then6900
4105 d$=left$(n1$,1):ifv<9thend$=left$(v$,1)
4110 d=-1
4120 ifd$="n"thend=0
4130 ifd$="s"thend=1
4140 ifd$="e"thend=2
4150 ifd$="w"thend=3
4160 ifd=-1or(n1<26andn1>0)then4200
4170 ifc%(r,d)=0then4250
4180 r=c%(r,d):m$=m3$
4190 return
4200 ifr=2andn1=6thend=1:goto4170
4205 ifr=1andn1=1then6700
4210 ifr=3andn1=7then6300
4220 ifr=5andn1=9thend=2:goto4170
4230 ifr=7andn1=10thend=0:goto4170
4235 if(r=2orr=1)andn1=5then5000
4240 m$="i don't understand where you want to go.":return
4250 ifr=2andd=1thenm$="i don't see a door to enter the building.":return
4260 ifr=3andd=2thenm$="the water is in that direction.":return
4270 ifr=10andd=3thenm$="the wall is too high.":return
4280 m$="your path is blocked in that direction.":return
4298 rem
4299 rem inventory
4300 m$="you are carrying:":gosub2000
4310 f=0:lm=4:forl=1to29
4320 ifn%(l)=99thenm$=n$(l):gosub2000:f=1
4330 next:iff=0thenm$="nothing":gosub2000
4340 m$="":lm=0:return
4398 rem
4399 rem look,examine,see,search
4400 ifabs(n%(n1))<>randabs(n%(n1))<>99then4490
4410 ifn1<>1orn%(2)<>0then4420
4415 m$="there is a pillow and a blanket.":n%(2)=1:n%(25)=1:return
4420 ifn1=23andn%(4)=0thenm$="there's a slightly burned book.":n%(4)=22:return
4425 ifn1=3andn%(24)=0thenm$="a clock is here.":n%(24)=1:return
4428 ifn1=24thenm$="it's broken.":return
4430 ifn1=4thenm$="it's a journal with writing in it.":return
4440 ifn1=4then4900
4450 ifn1=6thenm$="there doesn't seem to be an entrance.":return
4460 ifn1<>14then4470
4465 ifps=0thenm$="there is an empty slot in the laser.":gosub2000
4468 m$="there's a switch on top of it":return
4470 ifn1=20thenm$="on the screen is the message 'enter password.'":return
4480 ifn1=5andr=2thenm$="there's a bedroom inside.":return
4482 ifn1=21andn%(22)=0thenm$="there's a sheet of paper.":n%(22)=11:return
4484 ifn1=22thenm$="there's writing on it.":return
4490 m$="you don't see anything special.":return
4598 rem
4599 rem quit
4600 print:print"[156]"
4610 m$="time you have been playing: "
4620 m$=m$+left$(ti$,2)+":"+mid$(ti$,3,2)+":"+right$(ti$,2)
4630 gosub2000:print
4640 m$="do you want to play again? (y or n)":gosub2000
4650 gett$:ift$="y"thenrun
4660 ift$="n"then63000
4670 goto4650
4698 rem
4699 rem get,take
4700 f=0:forl=1tonw:ifw$(l)="all"orleft$(w$(l),4)="ever"thenf=1
4710 next:iffthen4780
4715 ifn1=0thenm$=m1$:return
4720 ifabs(n%(n1))=99thenm$="you already have it!":return
4730 ifabs(n%(n1))<>rthenm$=m2$:return
4735 ifn1=11thenrc=4:goto1240
4740 ifn%(n1)>-1then4750
4742 t=rnd(1):ift<.33thenm$="you can't lift it!":return
4743 ift<.66thenm$="i don't think so.":return
4744 m$="don't be absurd!":return
4750 m$=m3$:n%(n1)=99
4760 return
4780 forl=1to27:ifabs(n%(l))<>rthen4790
4785 n1=l:gosub4720:m$=n$(l)+": "+m$:gosub2000
4790 next:m$="":return
4798 rem
4799 rem drop,lean
4800 ifn%(n1)<>99thenm$="you're not carrying it.":return
4810 m$=m3$:n%(n1)=r
4820 return
4898 rem
4899 rem read
4900 ifabs(n%(n1))<>randn%(n1)<>99thenm$=m2$:return
4910 ifn1=22thenm$="it says: the password is firmare.":return
4915 ifn1=20then4470
4920 ifn1=24then4428
4930 ifn1<>4thenm$="there's nothing to read.":return
4940 m$="journal of commander matthew s. haller":gosub2000
4950 print
4960 m$="65.073.21":gosub2000:cn=1
4970 m$="the robots have taken over the mine. they have already killed"
4980 m$=m$+" several of my men. the only way to stop them is by getting to the"
4985 m$=m$+" power generator, which is deep within the mine, and giving the"
4990 gosub2000:m$=" computer the password. the password is":gosub2000
4995 print:print:m$="the journal ends here.":cn=0:return
4998 rem
4999 rem climb
5000 ifabs(n%(n1))<>randn%(n1)<>99thenm$=m2$:return
5005 ifn1=12andn%(12)=99thenm$="you drop the ladder first.":gosub2000:n%(12)=r
5010 ifn1=12andr<>9andr<>10thenm$="ok, but you didn't get anywhere.":return
5020 ifn1=5andwb=0thenm$="it's shut.":return
5030 ifn1=5andr=2thenm$=m3$:r=1:return
5040 ifn1=5andr=1thenm$=m3$:r=2:return
5050 if(r<>9andr<>10)or(n1<>12andn1<>13)thenm$=m2$:return
5060 ifn%(12)<>rthenm$=m4$:return
5070 m$=m3$+" you climb on top of the wall, put the ladder on the other"
5080 m$=m$+" side and climb down."
5090 ifr=9thenr=10:n%(12)=10:return
5095 r=9:n%(12)=9:return
5098 rem
5099 rem kill
5100 ifn1=11andrc>0thenrc=4:goto1240
5110 m$="it's not alive!":return
5298 rem
5299 rem throw
5300 ifn%(n1)<>99thenm$="you don't have it.":return
5305 n%(n1)=r
5310 ifn1<>8orn2<>5orwb=1orr<>2then5320
5315 m$="smash! the window shatters.":n$(5)="broken window":wb=1:return
5320 ifn2=11andrc>0thenm$="it didn't hurt the robot.":return
5330 if(n2=18andr=20)or(n2=20andr=20)thenm$="it is unharmed.":return
5340 ifn2=19andr=9thenm$="the machines cannot be damaged.":return
5350 m$=m3$+" it drops to the ground.":return
5398 rem
5399 rem eat
5400 m$="don't be ridiculous!":return
5498 rem
5499 rem drink
5500 ifr=3orr=4thenm$="it's very refreshing!":return
5510 m$="i don't see how!":return
5598 rem
5599 rem open
5600 ifn1<>4thenm$="it won't open.":return
5610 m$=m3$:return
5698 rem
5699 rem close
5700 ifn1=4thenm$=m3$:return
5710 m$=m4$:return
5798 rem
5799 rem put,place,insert
5800 ifn1<>16or(n2<>14andn2<>17)then4800
5810 if(n%(16)<>99andn%(16)<>r)or(n%(14)<>99andn%(14)<>r)thenm$=m4$:return
5820 m$="the power pak is now in the laser.":ps=1:n%(16)=0:return
5898 rem
5899 rem break,smash,hit
5900 ifn1=5andn2=8andwb=0andr=2andn%(8)=99then5315
5910 ifabs(n%(n1))<>randn%(n1)<>99thenm$=m2$:return
5915 ifn1=11andrc>0andn2>0thenn2=n1:goto5320
5920 m$="ouch! you hurt your hand, but it didn't break."
5930 ifn1=11a