1 REM Dunric's 8K Adventure - Converted from the Commodore 64 on June 23, 2004 2 REM Author: Paul Panks (dunric@gmail.com) 3 REM Revision: 1.08 4 REM Homepage: http://www.geocities.com/dunric/8kadv.html 5 color 4,14:CLS:color 7,14:CLEAR:PRINT"dunric's 8k adventure":color 4,14:print"welcome!":print 10 DIM no$(20), ob$(20), vb$(20), de$(25, 2), m(25, 6), lo(20): vb$(19) = "look": vb$(20) = "save" 15 for x=1 to 25:read de$(x,1):read de$(x,2):next x 20 for x=1 to 18:read vb$(x):next x:for x=7 to 20:read no$(x):next x:for x=7 to 20:read ob$(x):next x 25 for x=1 to 25:for y=1 to 6:read m(x,y):next y:next x:for x=1 to 20:read lo(x):next x 30 no$(1) = "north": no$(2) = "south": no$(3) = "east": no$(4) = "west": no$(5) = "up": no$(6) = "down" 50 rm = 1: ic = 0: lz = 0: hp = 200: dm = 1 51 color 15,14:PRINT "saved game (y/n):";:color 7,14:input"",f$ 52 if f$="y" then print:goto 60 53 if f$="n" then print:goto 70 54 goto 51 60 color 15,14:print"enter filename:";:color 7,14:input "",f$:if len(f$)>8 then print:print"too long!":goto 51 61 open f$+".sav" for input as #2:input #2,na$:input #2,rm:input #2,lz:input #2,lk:input #2,hp:input #2,ic:for x=7 to 20:input #2,lo(x):next x:close 2:print"done!":print:goto 71 70 color 15,14:print"enter your name:";:color 7,14:input "",na$:if len(na$)>8 then print:print"too long!":goto 70 71 for x=1 to 200:next x:cls 75 color 15,14:print de$(rm,1):print de$(rm,2):color 11,14:print"exits:";:for x=1 to 6:if m(rm,x)>0 then print" ";no$(x); 76 next x:print:for x=7 to 20:if lo(x)=rm then color 7,14:print no$(x) 77 NEXT x 80 COLOR 12,14:print">";:COLOR 4,14:input"",a$:color 15,14:if lo(16)=-1 then print:color 7,14:print"congratulations!":COLOR 10,14:for x=1 to 200:next x:print:print"you found the scepter!":end 81 wd$(1)="":wd$(2)="":si=0:yi=0:if len(a$)=1 then goto 100 82 for x=1 to len(a$):if mid$(a$,x,1)=" " then wd$(1)=left$(a$,x-1):si=x+1:yi=1 83 next:gosub 500:if yi=1 then wd$(2)=mid$(a$,si,x) 84 if len(wd$(1))>20 then print"command too complex":goto 80 85 color 15,14:if a$="help" then print"Example: ";:color 7,14:print"use lantern":print:color 15,14:print"Verbs:":print:print"go,get,drop,inventory,use,open,examine,climb,kill,north,":print"south,east,west,up,down,quit,eat,drink,look,save.":goto 80 86 if a$="quit"then cls:COLOR 7,14:print"the end":end 87 v=0:for x=1 to 20:if vb$(x)=wd$(1) then v=x 88 next:if v=0 then print"verb not recognized":print"type ";:color 14,4:print"help";:color 15,14:print" for clues":goto 80 89 n=0:for x=1 to 20:if no$(x)=wd$(2) then n=x 90 next:if n=0 and v<>4 and v<>7 and v<>8 and v>9 and v<17 then print"can't do that":goto 80 95 ON v GOTO 110, 130, 140, 160, 150, 170, 180, 190, 200, 110, 110, 110, 110, 110, 110, 300, 250, 260, 270, 350 99 PRINT "can't do that": goto 80 100 if a$="n" then n=1:goto 110 101 if a$="s" then n=2:goto 110 102 if a$="e" then n=3:goto 110 103 if a$="w" then n=4:goto 110 104 if a$="u" then n=5:goto 110 105 if a$="d" then n=6:goto 110 106 if a$="i" then v=4:goto 160 107 if a$="l" then v=19:goto 75 108 PRINT "what?": goto 80 110 if m(rm,n)=0 then print"can't go that way":goto 80 111 if rm=24 and n=1 and lk=0 then print"cell door is locked":print"i need a key!":goto 80 112 if rm=7 and n=2 and lz=0 then print"too dark to move there":print"i need the lantern turned on!":goto 80 113 if lo(18)=rm then if n=2 then print"the goblin won't let you pass!":goto 80 114 if lo(19)=rm then if n=1 then print"the knight bars passage north!":goto 80 115 if lo(20)=rm then if n=1 then print"the demon hisses 'no scepter!'":goto 80 116 rm = m(rm, n): goto 75 130 if lo(n)=rm and n>6 and n<17 and ic<7 then ic=ic+1:lo(n)=-1:print"taken":goto 80 131 if ic>6 then color 7,14:print"too heavy":color 15,14:print"drop some items!":goto 80 132 PRINT "can't pick that up": goto 80 140 if lo(n)=-1 and n>6 and n<17 then ic=ic-1:lo(n)=rm:print"dropped":goto 80 141 PRINT "can't drop that": goto 80 150 if n=7 and lo(n)=-1 and lz=0 then if lo(8)=-1 then print"lantern flickers on":lz=1:goto 80 151 if n=7 and lo(n)=-1 then print"can't do that":goto 80 152 if n=9 and lo(n)=-1 then if rm=9 then print"the rope catches on a branch":for x=1 to 200:NEXT x:print"you climb up...":rm=8:lo(9)=9:ob$(9)="rope (hanging down)":ic=ic-1:goto 75 153 if n=10 and lo(n)=-1 and lk=0 then if rm=24 then lk=1:print"click! cell door unlocks":goto 80 154 PRINT "can't do that": goto 80 160 if lo(9)=-1 then ob$(9)="coiled rope about 10 feet" 161 ic=0:for x=7 to 16:if lo(x)=-1 then COLOR 10,14:print" ";no$(x):ic=ic+1 162 next:color 4,14:if ic=0 then print"you are empty handed":goto 80 163 goto 80 170 PRINT "can't do that": PRINT "try ";:color 7,14:PRINT"use";:color 15,14:print" instead": goto 80 180 if n=0 then goto 182 181 print ob$(n):goto 80 182 if wd$(2)="fireplace" and rm=4 then print"the fireplace is currently lit":goto 80 183 if wd$(2)="table" then if rm=8 then print"the table has words inscribed":print"words read: '";:color 7,14:PRINT"use key to unlock cell";:color 4,14:PRINT"'":goto 80 184 if wd$(2)="bookshelf" then if rm=8 then print"the bookshelf contains many old books":goto 80 185 if wd$(2)="dresser" and rm=3 then print"it's an ordinary dresser":goto 80 186 if wd$(2)="bed" then if rm=11 or rm=3 then print"the bed looks comfortable":goto 80 187 if wd$(2)="tree" then if rm=9 then print"the tree has low branches":goto 80 188 if wd$(2)="throne" then if rm=22 then print"the throne is missing a scepter":goto 80 189 PRINT "you notice nothing unusual": goto 80 190 if wd$(2)="tree" then if rm<>9 then print"you don't see a tree low enough to climb":goto 80 191 if wd$(2)="tree" then if lo(9)<>-1 then print"you need the rope first":goto 80 192 if wd$(2)="tree" then print"you climb up...":ob$(9)="rope (hanging down)":ic=ic-1:lo(9)=9:for x=1 to 200:next x:rm=8:goto 75 193 PRINT "can't climb that": goto 80 200 randomize timer:mh=int(rnd*n+100)+1:if n<17 then print"you can't kill that":goto 80 201 randomize timer:i=int(rnd*15)+1:dm=1:if lo(11)=-1 then dm=8:color 7,14:print"use dagger":color 4,14:goto 203 202 color 7,14:PRINT "bare hands":color 4,14 203 print">":if i<=5 then print"you missed "no$(n) 204 if i>=6 and i<=10 then print"you hit "no$(n):mh=mh-2*dm 205 if i>=11 and i<=16 then print"you hit "no$(n)" very hard!":mh=mh-5*dm 206 color 7,14:PRINT "your hp";:color 4,14:print":"; hp: COLOR 7,14:PRINT "the "; no$(n);:color 4,14:print ":"; mh 207 print">":color 7,14:input "Press any key to continue...",a$:color 4,14:ac=0:if i=12 or i=13 then if lo(12)=-1 then ac=i:hp=hp+i 208 randomize timer:i=int(rnd*15)+1:if i<=5 then print"the "no$(n)" missed you" 209 if i>=6 and i<=10 then print"the "no$(n)" hit you":hp=hp-2*i 210 if i>=11 and i<=16 and lo(13)<>-1 then print"the "no$(n)" hit you very hard":hp=hp-3*i 211 print">":if mh<1 or mh<0 then color 7,14:print"the "no$(n)" has died":color 10,14:lo(n)=998:print"you killed "no$(n):for x=1 to 200:next x:hp=hp+25:color 4,14:goto 80 212 if hp<1 or hp<0 then color 7,14:print"alas, you have died":color 4,14:for x=1 to 500:next x:print"better luck next time...":end 213 goto 201 250 if n=14 and lo(n)=-1 then print"you eat some food":for x=1 to 200:next x:print"you feel better!":hp=hp+10:goto 80 251 PRINT "can't eat that": goto 80 260 if n=15 and lo(n)=-1 then print"you drink the water":for x=1 to 200:next x:print"you feel refreshed":hp=hp+25:lo(n)=5:ic=ic-1:goto 80 261 PRINT "can't drink that here": goto 80 270 goto 75 300 cls: color 7,14:PRINT "thanks for playing!": color 4,14:END 350 color 15,14:print "saving ";na$;"...":open na$+".sav" for output as #2 351 print #2,na$:print #2,rm:print #2,lz:print #2,lk:print #2,hp:print #2,ic:for x=7 to 20:print #2,lo(x):next x:close 2:print"done!":goto 80 500 if yi=0 then wd$(1)=a$ 501 RETURN 1001 DATA"you are in the tavern","a staircase is visible here" 1002 DATA"you are upstairs in the tavern","a small room lies to the east" 1003 DATA"you are in a small room","a dresser is here, beside a bed" 1004 DATA"you are inside the house","a fireplace burns softly nearby" 1005 DATA"you are at the village well","water rises from depths below" 1006 DATA"you are on a path","a village stands to the north" 1007 DATA"you are in a clearing","a forest grows to the south" 1008 DATA"you are inside a hut","a table is here, beside a bookshelf" 1009 DATA"you are facing an oak tree","it is twisted by age and time" 1010 DATA"you are in the western woods","a cottage is west" 1011 DATA"you are inside the cottage","a bed is here, where you can rest" 1012 DATA"you are in the middle forest","a lake is the to east" 1013 DATA"you are beside the lake","a path heads west into the forest" 1014 DATA"you are at a large hill","it bends south past a small farm" 1015 DATA"you are at the forest edge","the growth is less dense here" 1016 DATA"you are by the castle","a moat stands to the west" 1017 DATA"you are near the castle moat","the drawbridge is down (for now)" 1018 DATA"you are in the main hall","doors line either side of the hallway" 1019 DATA"you are in guest quarters","it is mostly bare save for a bed" 1020 DATA"you are in the guild","some tables are beside a fireplace here" 1021 DATA"you are in the parlor","a library is west and the throne north" 1022 DATA"you are at the throne","a scepter is missing from one side" 1023 DATA"you are in the library","rows of books line tall shelves here" 1024 DATA"you are in the dungeon","it is quite dark in here" 1025 DATA"you are inside a cell","on a table rests some items" 1101 DATA"go","get","drop","inventory","use","open","examine","climb","kill","north","south","east","west","up","down","quit","eat","drink" 1207 DATA"lantern","oil","rope","key" 1211 DATA"dagger","chainmail","robe" 1214 DATA"food","water","scepter" 1217 DATA"villager","goblin","knight" 1220 DATA"demon" 1227 DATA"a brass lantern","a flask of oil","coiled rope about 10 feet","a small key","a fine dagger","a suit of chainmail","an elven robe","some food rations" 1228 DATA"this water makes you thirsty","the jeweled scepter!","a common villager","a menacing goblin","a powerful knight","a hideous demon" 1301 DATA 0,0,0,5,2,0 1302 DATA 0,0,3,0,0,1 1303 DATA 0,0,0,2,0,0 1304 DATA 0,5,0,0,0,0 1305 DATA 4,6,1,0,0,0 1306 DATA 5,7,0,0,0,0 1307 DATA 6,10,0,0,0,0 1308 DATA 0,0,0,0,0,9 1309 DATA 0,12,0,0,0,0 1310 DATA 7,15,12,11,0,0 1311 DATA 0,0,10,0,0,0 1312 DATA 9,14,13,10,0,0 1313 DATA 0,0,0,12,0,0 1314 DATA 12,0,0,0,0,0 1315 DATA 10,0,0,16,0,0 1316 DATA 0,0,15,17,0,0 1317 DATA 18,0,16,0,0,0 1318 DATA 21,17,19,20,0,0 1319 DATA 0,0,0,18,0,0 1320 DATA 0,0,18,0,0,0 1321 DATA 22,18,0,23,0,0 1322 DATA 0,21,0,0,0,0 1323 DATA 0,0,21,0,0,24 1324 DATA 25,0,0,0,23,0 1325 DATA 0,24,0,0,0,0 1401 DATA 89,89,89,89,89,89 1407 DATA 3,3,11,4,11,20,8,1,5 1416 DATA 25,5,10,17,24 1500 END