Sorceror's Castle Adventure

Started by Blacklord, August 13, 2007, 10:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Blacklord

This is written in generic Commodore BASIC :

2 sr$="you have no sword to do it with. oh my! the sorcerer has just"
3 gb$="a gold bar falls out!"
4 d1$="okay. gulp gulp gulk. something seems   different now..."
5 di$="you're not holding it hence it is       impossible to  drink it."
6 co$=chr$(44)
7 x=rnd(-ti):x=0
8 nw$(1)="nice weather we've been having lately."
9 qt$=chr$(34)
10 vt$="the movement of the painting reveals a  vault in the wall. the vault is"
11 print"      sorcerer's castle adventure"
12 vt$=vt$+" locked."
13 print:gt$(1)="wheeee!":gt$(2)="are you enjoying yourself?"
14 sr$=sr$+" killed you!":print"            by greg hassett
15 print:sk$="the sorcerer died and then vanished.    his septor remains."
16 print"    converted to pet by john o'hare"
17 db$="you must supply a direct object."
18 deffnr(q)=int(rnd(1)*q)+1
19 cp=49:s1$="i don't see it here.":s2$="don't be ridiculous.":goto1700
20 goto1500
30 iffnr(85)=20then1170
40 ifzz>2andfnr(100)=50then1240
50 iffnr(27)=8then1330
60 t=t+1:gosub1430:ifvb$="ala"thenifcp=32thencp=17:goto20
65 ifvb$="ala"thenprint"nothing happened.":goto60
70 ifvb=-1and(no>21andno<30)thenvb=1
80 ifno$="jes"thenprint"i see no jester here.":goto60
90 ifvb$="cro"thenif(cp=52orcp=53)thenifcp=53thencp=52:goto20
95 if vb$="cro"thenif(cp=52orcp=53)then20
100 ifvb$="tur"thenprint"you have used"t"turns so far.":goto60
110 ifvb<>30and(vb>10orvb=20orvb=6)andno$=""thenprintdb$:goto60
120 ifvb$="hi"thenprintnw$(fnr(2)):goto60
130 ifno$="gun"thenno=1
140 ifvb=30then1070
150 ifno$="bag"thenno=5
160 ifvb=-1andno<>0and(no<22orno>29)thenprint"you must supply a verb.":goto60
170 ifvb<1andno=0thenprint"i don't know how to "qt$n1$qt$" anything.":goto60
180 ifvb=6and(no$="eve"orno$="all")then200
190 ifno=0andvb>10thenprint"i don't know what a "qt$n1$qt$" is.":goto60
200 onvbgoto210,280,20,350,380,400,460,470,480,490,510,520,550,640,660,740,770
205 onvb-17goto830,840,840,550,920,920,940,950,980,1010,1040,1050,1070
210 if(no<22orno>29)andno$<>""thenprint"i don't know how to do that.":goto60
220 ifno$=""thenprint"where?":goto60
230 ifno>25thenno=no-4
240 no=no-22:ifp(cp,no)=0thenprint"there is no way to go in that direction.":goto60
250 ifcp=1andno=1anddf=0thenprint"the castle door is locked.":goto60
260 ifcp=17andno=1andcf=0thenprint"the crack is too small for you to follow":goto60
270 cp=p(cp,no):goto20
280 ifob(no,0)=-1thenprint"you've already got it!":goto60
290 ifno=0thenprint"whats a "n1$"?":goto60
300 ifob(no,0)<>cpthenprints1$:goto60
310 ifno=17orno=21orno=20orno=16thenprints2$:goto60
320 ifzz+1>7thenprint"you are unable to carry any more.":goto60
330 ifno=9andpf=0thenprintvt$:pf=1:ob(16,0)=cp:ob(9,0)=-1:zz=zz+1:goto60
340 print"okay.":zz=zz+1:ob(no,0)=-1:goto60
350 ifzz=0thenprint"you are emptyhanded.":goto60
360 print"you are holding the following:":fori=1tolo:ifob(i,0)=-1thenprintob$(i)
370 nexti:goto60
380 j=0:fori=1tolo:ifob(i,0)=1thenj=j+ob(i,1)
385 nexti
390 print"out of a maximum of 225 points, you have";j;"points.":ifj<225then60
395 ifj=225then3000
400 ifno<>0andob(no,0)<>-1thenprint"you're not carrying it!":goto60
410 ifno$<>"eve"andno$<>"all"then440
420 ifzz=0thenprint"you're not carrying anything!":goto60
425 fori=1tolo:ifob(i,0)=-1thenob(i,0)=cp
430 nexti:zz=0:print"ok.":goto60
440 ifno=0thenprint"i've never heard of a "n1$".":goto60
450 ob(no,0)=cp:print"dropped.":zz=zz-1:goto60
460 print"sorry, this is your adventure, no mine!":goto60
470 print"":input"press when ready to ***save***   ";a$
473 open 1,1,2,"sorc.castle.data"
475 print"saving.":fori=1tolo:print#1,ob(i,0):nexti:print#1,cp:print#1,t
476 print#1,df;co$;vf;co$;cf;co$;pf;co$;sf;co$;wf;co$;zz
478 close 1:goto20
480 print"":input"press when ready to ***load***   ";a$
482 open 1
485 print"loading":fori=1tolo:input#1,ob(i,0):nexti
486 input#1,cp,t,df,vf,cf,pf,sf,wf,zz
487 close 1:goto20
490 input"do you really want to quit now";qn$:ifleft$(qn$,1)<>"y"then60
495 input"are you sure";q2$:ifleft$(q2$,1)<>"y"thenprint"i didn't think so.":goto60
500 goto1370
510 print"alright...";n1$:goto60
520 ifob(no,0)<>-1thenprintdi$:goto60
530 ifno<>7thenprints2$:goto60
540 printd1$:zz=zz-1:ob(7,0)=0:cf=1:goto60
550 ifno<>31andno<>16andno<>30thenprint"i don't know how to open such a thing.":goto60
560 ifno=16andob(16,0)<>cpthenprint"what vault?":goto60
570 ifno=16andob(2,0)<>-1thenprint"you don't have the key.":goto60
580 ifno=16thenprint"the vault is open":vf=1:ifob(15,0)=0thenprintgb$:ob(15,0)=cp
590 ifno=16then60
600 ifno=31then1140
610 ifcp<>1thenprint"what door?":goto60
620 ifob(2,0)<>-1thenprint"you don't seem to have the key.":goto60
630 print"the door is open.":df=1:goto60
640 ifob(no,0)<>-1thenprint"you are not carrying it.":goto60
650 print"i've known strange people, but attacking"ob$(no);"?":goto60
660 ifno=20then710
670 ifno=17thenprint"what knight ?":goto60
680 ifno=21thenprint"i see no pirate here.":goto60
690 ifob(i,0)<>-1thenprint"you are not currently holding that.":goto60
700 print"it isn't alive!":goto60
710 ifcp<>32thenprint"what sorcerer?":goto60
720 ifob(8,0)<>-1thenprintsr$:fori=1to3000:nexti:goto1370
730 printsk$:ob(14,0)=cp:ob(20,0)=0:goto60
740 ifob(no,0)<>-1thenprint"you don't have that right now.":goto60
750 ifno<>3thenprint"how do you expect to read ";ob$(no);"?":goto60
760 print"it says:  magic word:  alakazam.":goto60
770 ifob(no,0)<>-1andob(no,0)<>cpthenprint"i don't see that here.":goto60
780 ifob(1,0)<>-1thenprint"you don't have a gun!":goto60
790 ifno=17thenprint"the bullet dissolves as it hits the     armor.":goto60
800 print"the golden bullet from the golden pistolvaporizes that."
810 ifob(no,0)=-1thenzz=zz-1
820 ob(no,0)=0:goto60
830 ifob(no,0)=-1thenprints2$
835 print"you're not holding it.":goto60
840 ifno=16orno=30orno=31then870
850 ifob(no,0)<>-1thenprint"you're not holding that to my knowledge.":goto60
860 print"i don't know how to close such a thing.":goto60
870 ifno=16andob(16,0)<>cpthenprint"what wault?":goto60
880 ifno=16thenprint"the vault is closed and locked.":vf=0:goto60
890 ifno=31then1110
900 ifcp<>1thenprint"what door?":goto60
910 print"the door is closed and locked.":df=0:goto60
920 ifob(no,0)<>-1thenprint"you're not holding it.":goto60
930 print"no, these items have to be used on the  next adventure, too.":goto60
940 print"the value of that is"ob(no,1)"points.":goto60
950 ifob(no,0)<>-1thenprint"you don't seem to have it.":goto60
960 ifno<>8thenprint"wow is this fun!":goto60
970 print"whoosh!":goto60
980 ifob(no,0)<>-1thenprint"you're not currently carrying it.":goto60
990 ifno<>8thenprints2$:goto60
1000 print"it is already razor sharp.":goto60
1010 ifob(no,0)<>-1thenprint"tu ne le portes pas(you're not carrying it.":goto60
1020 ifno<>19thenprint"how?":goto60
1030 print"very good! now you can go to the second grade!":goto60
1040 print"try drop.":goto60
1050 print"i can only tell you what is in the room with you, sorry."
1060 print"i cannot find anything.":goto60
1070 ifcp<>44thenprintgt$(fnr(2))
1080 ifcp<>44then60
1090 ifwf=0thenprint"the window is only slightly ajar.":goto60
1100 print"okay...you fall safely in the pile of   leaves.":cp=48
1101 print"you seem to be lost in a forest of      spruce trees.":goto60
1110 ifcp<>44thenprint"what window? i don't see a window!":goto60
1120 ifwf=0thenprint"it is already closed.":goto60
1130 print"having opened it earlier, you find it   impossible to close.":goto60
1140 ifcp<>44thenprint"waht window?":goto60
1150 ifwf=1thenprint"it is already open.":goto60
1160 print"through a great effort, you open the"
1161 print"window, there is a pile of leaves       outside the window.":wf=1:goto60
1170 print"holy moly! a black knight walked in to  kill you!":gosub1430
1180 ifvb<>17orno<>17then1210
1190 ifob(1,0)<>-1thenprint"you have no gun!":goto1210
1200 print"the knight disintigrated.":goto60
1210 print"the knight is running towards you.......";
1220 iffnr(5)=2thenprint"it kills you!":fori=1to3000:nexti:goto1370
1230 print"it misses you
1232 print"and crashes into a wall...wait! he has disappeared!":goto60
1240 print"a pirate just appeared and chartled,"
1250 print"well shiver me timbers! not another one!";
1255 print"har har har, i'll just snatch all this"
1260 print"booty and hide it deep in the maze."
1270 rem
1280 print"with that he takes all of your treasure!"
1290 fori=1tolo:ifob(i,0)<>-1then1320
1300 ifob(i,1)=0then1320
1310 ob(i,0)=fnr(6)+34:zz=zz-1
1320 nexti:goto60
1330 print"jingle jingle jingle!":print"chester the jester pops up and chants,-"
1340 printc$(fnr(8)-1):print" tee hee hee!"
1350 print"and then vanishes in a cloud of pink    smoke."
1360 goto60
1370 print"":j=0:fori=1tolo:ifob(i,0)=1thenj=j+ob(i,1)
1380 nexti
1390 print"out of a maximum of 225 points, you havescored"j"points."
1400 print"hope you had fun!":end
1410 print"whazzat?"
1420 stop
1430 input"**what do you want to do   ";cm$
1435 if cm$=" "then1430
1440 n1$="":v1$="":no=0:vb=0:no$="":vb$=""
1450 cm=len(cm$):fori=1tocm:ifmid$(cm$,i,1)<>" "thenv1$=v1$+mid$(cm$,i,1):nexti
1460 vb$=left$(v1$,3):fori=1tonv:ifvb$(i)=vb$thenvb=i:goto1480
1465 nexti
1470 vb=-1:n1$=v1$:goto1490
1480 iflen(v1$)+1>len(cm$)thenno=0:return
1485 n1$=right$(cm$,len(cm$)-1-len(v1$))
1490 no$=left$(n1$,3):fori=1tonn:ifno$(i)=no$thenno=i:return
1493 nexti
1495 return
1500 print"":print"you're ";p$(cp):fori=1tolo
1510 ifob(i,0)=cpthenprint"*there is ";ob$(i)" here."
1520 nexti
1530 ifcp=1anddf=0thenprint"the door is locked."
1540 ifcp=18andvf=0andob(16,0)=18thenprint"the vault is locked."
1550 ifcp=17andcf=0thenprint"a small crack leads southward."
1560 ifcp=1anddf=1thenprint"the door is open."
1570 ifcp=18andvf=1andob(16,0)=18thenprint"the vault is open."
1580 ifcp=44andwf=0thenprint"the window is slightly ajar."
1590 ifcp=17andcf=1thenprint"a towering hole leads southward."
1600 ifcf=0thenp(17,1)=0
1610 ifcp=44andwf=1thenprint"the window is wide open.  there is a"
1615 ifcp=44andwf=1thenprint"rather large pile of leaves outside the window."
1620 k=0:print"you can go ";:fori=0to3:ifp(cp,i)=0then1650
1630 ifk=1thenprint", ";
1640 printd$(i);:k=1
1650 nexti:ifk=0thenprint"nowhere!"
1660 ifk=1thenprint
1670 p(17,1)=18
1680 print"=======================================":goto30
1690 o=0:return
1700 np=53:lo=35:nn=31:nv=30:dimp(np,3),p$(np),vb$(nv),no$(nn),ob(lo,1),ob$(lo)
1710 p$(1)="outside a medieval castle, the   pavement has  an inscription:"
1711 p$(1)=p$(1)+chr$(13)+"leave all treasure here say 'score'."
1715 data 5,8,3,2,4,7,1,0,6,7,0,1
1720 p$=" side of the castle.":p$(2)="at the west"+p$:p$(3)="at the east"+p$
1730 p$(4)="in a vast forest stretching out  of sight.":data4,2,4,4,53,0,6,1
1740 p$(5)=p$(4):p$(6)=p$(4):data6,6,6,5
1750 p$(7)="at the south"+p$+" there is a tower with a small window in"
1755 p$(7)=p$(7)+" the far, far distance.":data2,0,0,0
1760 p$(8)="in a splendid chamber 30         feet high.":data1,11,0,10
1770 p$(9)="in a damp, musty library.":data0,10,0,0
1780 p$(10)="in the master bedroom.":data9,0,8,0
1790 p$="in a vast corridor stretching outof sight to the ":p$(11)=p$+"south."
1795 data 8,12,14,0
1800 p$(12)=p$+"north and south.":data11,13,15,0
1810 p$(13)=p$+"north.":data12,0,16,17
1820 p$="in a bedroom with a ":p$(14)=p$+"stone floor.":p$(15)=p$+"wooden floor
1825 p$(16)=p$+"dirt floor.":data0,0,0,11,0,0,0,12,0,33,0,13
1830 p$(17)="in a dusty pantry. markings in   the dust read, go south to dungeon.
1835 data 0,18,13,0
1840 p$(18)="in a primitive art gallery.":data17,19,0,19
1850 p$(19)="in a maze of twisty little       passages."
1860 p$(20)="in a twisty maze of little       passages."
1870 p$(21)="in a little maze of twisty       passages."
1880 p$(22)="in a twisting maze of little     passages."
1890 p$(23)="in a little twisty maze of       passages."
1900 data0,20,18,0,20,22,20,19,21,21,22,23,21,22,20,22,21,24,23,23
1910 p$(24)="in the kitchen.":data23,27,25,0,0,27,26,24,29,28,30,25
1920 p$(25)="in the dining room.":p$(26)="in the alcove to the study."
1925 p$(27)="in the office of the sorcerer (?)":data24,0,28,0
1930 p$(28)="in the drawing room.":data0,0,0,27,0,26,0,0,0,31,0,26
1940 p$(29)="in the parlor.":p$(30)="in the study.":p$(31)="in the sitting room."
1950 p$(32)="in the dungeon!":data0,0,0,0,0,0,0,0
1960 fori=1tonp:forj=0to3:readp(i,j):nextj:nexti:p(31,fnr(4)-1)=32
1970 p$(33)="in a primeval conference room.":data16,0,35,0
1980 p$(34)="in the tower. it overlooks a huge"
1981 p$(34)=p$(34)+"kingdom down a monsterous mountain, the grass is greener "
1982 p$(34)=p$(34)+"than green itself.":data0,0,36,0
1990 p$(35)="in a maze of twisty little       passages, all alike."
1995 fori=36to40:p$(i)=p$(35):nexti:data36,35,35,33,38,34,37,35,36,0,39,0,40,39
1996 data39,36,38,37,39,38,41,38,0,0,42,40,0,0
2000 p$(41)="at the brink of a huge pit."
2001 p$(43)="in a barren cubical, with        passages leading off to the"
2002 p$(43)=p$(43)+" north       and south.":p$(42)="in the pit. a good passage"
2003 p$(42)=p$(42)+" exits to the north."
2010 p$(44)="at the end of the castle. you cansee a forest out a small window."
2015 data43,0,41,0,44,42,0,0,0,0,0,0
2020 p$(45)="lost in a dark forest made up    chiefly of spruce trees."
2025 fori=46to48:p$(i)=p$(45):nexti:data45,46,45,49,45,47,46,50,45,51,47,48,50
2026 data48,47,48
2030 p$(49)="on an old path made by horses in mideval times."
2035 p$(51)="in the middle of a clearing, to  the south is a bridge."
2037 p$(52)="on the north side of the bridge."
2038 p$(53)="on the south side of the bridge."
2039 data 0,50,45,0,49,48,46,0,0,52,47,0,51,53
2040 data0,0,52,5,0,0,pis,key,boo,rug,coi,sap,liq,swo,pai,opa,sil,pen,pil,sep
2045 data bar,vau,kni,cup,cro,sor,pir,nor,sou,eas,wes,n,s,e,w,doo,win
2050 datago,get,loo,inv,sco,dro,hel,sav,loa,qui,say,dri,ope,hit,kil,rea,sho,eat
2055 dataclo,loc,unl,des,bre,val,swi,sha,wea,thr,fin,jum
2060 fori=1tonn:readno$(i):nexti:fori=1tonv:readvb$(i):nexti
2070 data a gold pistol,4,10,a set of keys,2,0,a book on sorcery,9,0
2072 data a persian rug,10,15,a bag of coins,3,15,a priceless saphire,14,10
2074 data a flask of liquid,15,0,a golden sword,42,10,a priceless painting,18,15
2080 data a giant opal,22,15,a set of silverware,24,15,a platinum pen,27,5
2082 data a velvet pillow,43,20,the sorcerer's septor,32,50,a gold bar,0,20
2084 data a vault in the wall,0,0,a black knight,0,0,a pewter cup,25,15
2086 data a kings crown,30,10,xxx
2090 data32,0,an evil pirate,0,0
2100 fori=1to21:readob$(i),ob(i,0),ob(i,1):nexti
2110 data north,south,east,west
2120 fori=0to3:readd$(i):nexti
2130 p$(19)=p$(19)+chr$(13)+"a note on the wall reads: this is not   the maze"
2135 p$(19)=p$(19)+" where the pirate hides his     treasure. --gh"
2140 ob$(20)="an evil high sorcerer just    waiting to cast a spell on you."
2150 p$(50)="at the end of the path, with     forest surrounding you in all"
2155 p$(50)=p$(50)+" directions except north, where you were before."
2160 p(50,3)=48:p$(47)=p$(47)+chr$(13)+"to the south there seems to be light."
2170 fori=52to53:p$(i)=p$(i)+chr$(13)+"across the bridge is more forest.":next
2180 p(36,2)=37
2190 c$(0)="pay attention in the maze, to the       wording of the phrase! "
2195 c$(0)=c$(0)+"if you do you'll be un-mazed."
2200 c$(1)="gulp gulp gulp, drink it down, i'm not  such a stupid clown!"
2235 c$(4)=c$(4)+" confront youface to face!"
2240 c$(5)="hocus pocus, alakazam! don't read the   book or you'll be sorry!"
2250 c$(6)="passages that all seem alike can seem   quite different, just hope"
2255 c$(6)=c$(6)+" you're right!"
2260 c$(7)="not all treasure lies under a roof, some might be under a tree!"
2270 goto20
3000 print"  congratulations! you killed the"
3010 print"sorcerer and gathered all the treasures!"
3020 print"you are a terrific adventurer!"
3030 print"do you want to play again? (y/n)"
3040 geta$:ifa$=""then3040
3050 ifa$="y"thenclr:run
3060 ifa$="n"thensys49152
3070 goto3040