Compucolor.org – Virtual Media

Listing of file='QUEST.BAS;01' on disk='vmedia/chip_33-sector.ccvf'

10 REM  CASTLE QUEST 1--BY RICHARD TAUBOLD
15 REM  197 HOLLYBROOK ROAD, ROCHESTER, N.Y.
20 PLOT 15:GOTO 160
25 REM SCROLL
30 LN= LN+ 1:IF LN< Y0+ H0THEN PLOT 3,X0,LN:RETURN
35 A1= CALL (0)
40 PLOT 3,X0,Y0+ H0- 1:PRINT SPC( W0)"":PLOT 3,X0,Y0+ H0- 1
45 RETURN
50 GOSUB 155
55 A6= 28672+ 128* Y0+ X0+ X0:A2= A5+ 2:GOSUB 150
60 A6= 128- W0- W0:A2= A5+ 25:GOSUB 150
65 POKE A5+ 5,H0- 1:POKE A5+ 7,W0* (A3+ 1):POKE A5+ 19,35* (1- A3)
70 RETURN
75 GOSUB 155:RESTORE 80
80 DATA 33,-1,-1,6,-1,14,-1,17,128,0,25,126
85 DATA 17,128,255,25,119,35,-1,13,194,-1,-1
90 DATA 17,-1,-1,25,5,194,-1,-1,201
95 IF A5> 65503THEN A5= A5- 32:GOTO 115
100 FOR I= 1TO 32:READ A1
105 IF A1> = 0AND A1< > PEEK (A5+ I)THEN I= 32:A5= A5- 32
110 NEXT
115 RESTORE 80
120 FOR I= 1TO 32:READ A1:POKE A5+ I,A1- (A1< 0):NEXT
125 A6= A5+ 1:A2= 33283:GOSUB 150
130 A6= A5:A2= A4:GOSUB 150
135 A6= A5+ 6:A2= A5+ 30:GOSUB 150
140 A6= A5+ 8:A2= A5+ 22:GOSUB 150
145 GOTO 170
150 A7= INT (A6/ 256):POKE A2,A6- 256* A7:POKE A2+ 1,A7:RETURN
155 A4= 32940:A5= 256* PEEK (A4+ 1)+ PEEK (A4):RETURN
160 FOR I= 1TO PEEK (33209):X= RND (1):NEXT
165 GOTO 75
170 CLEAR 100
175 DIM RM(20),RT(20),RX(20),DR$(20),SP(6)
180 DEF FN R(R)= INT (R* RND (1))
185 GOTO 225
190 REM  CHARACTER DEAD
195 GOSUB 590
200 IF HC< = 0THEN GOSUB 30:PRINT "YOU DIED!!":GOTO 2890
205 RETURN
210 REM  ERASE SCROLL
215 FOR I= 1TO 10:GOSUB 30:PRINT :NEXT :RETURN
220 REM  START GAME
225 PLOT 8,12,3,0,12:INPUT "TYPE NEW OR OLD GAME  ";X$
230 IF LEFT$ (X$,1)= "O"GOTO 335
235 IF LEFT$ (X$,1)= "N"GOTO 260
240 GOTO 225
245 REM  INITIALIZE
250 X0= 0:Y0= 19:H0= 10:W0= 64:A3= 1:LN= 18:GOSUB 50
255 PLOT 12,27,4:PRINT "LOAD CASTLE.DSP":PLOT  27,27:RETURN
260 GOSUB 250:GOSUB 30:INPUT "CHARACTER NAME (NO SPACES!)= ";C1$
265 C1$= LEFT$ (C1$,15):C$= LEFT$ (C1$,6)
270 GOSUB 30:PRINT :GOSUB 30:PRINT "YOU START LIFE WITH 500 GOLD"
275 GP= 500:CA= 10:AC= 10:EX= 0:DL= 1:DH= 2
280 CL= 1:CQ= 1:WT= 1000+ 100* FN R(10)
285 XP= 0:HP= 30+ FN R(10):C0= 18- CL
290 FOR I= 1TO 6:SP(I)= 0:NEXT
295 CA= AC- SH- AR:GOSUB 490
300 GOSUB 590:GOSUB 505:GOSUB 590:GOSUB 930:GOSUB 700
305 T= .1:LN= 18:GOSUB 30:INPUT "DIFFICULTY LEVEL (1-4)?  ";LV
310 IF LV< 1OR LV> 4GOTO 305
315 XF= 1:IF CL> LV+ 1THEN GOSUB 30:PRINT "TOO EASY--TRY AGAIN":GOTO 305
320 IF CL> LVTHEN XF= LV/ CL
325 GOSUB 800:GOSUB 590:GOTO 375
330 REM  OLD GAME
335 PLOT 8,12:INPUT "ENTER OLD NAME: ";C1$
340 C$= LEFT$ (C1$,6):FILE "R",1,C$,1:GET 1,1,1;C1$[16],WP$[16]
345 GET 1,1,33;CL,WT,SP(1),SP(2),SP(3),SP(4),SP(5),SP(6),WP,HP,AC,GP,EN,SH
350 GET 1,1,89;AR,WA,MW,XP,CQ
355 FILE "C",1
360 PLOT  8:PLOT 27,4:PRINT "DEL ";C$;".RND;1":PLOT 27,27
365 GOSUB 250:GOTO 295
370 REM  RESET SCREEN
375 GOSUB 215
380 X0= 0:Y0= 19:H0= 10:W0= 40:A3= 1:GOSUB 50:LN= 18
385 FOR I= 20TO 29:PLOT 3,42,I:PRINT "                     ":NEXT
390 PLOT 3,42,20:PRINT "COMMANDS:"
395 PLOT 3,44,21:PRINT "1- MOVE TO ROOM"
400 PLOT 3,44,22:PRINT "2- ENTER ROOM"
405 PLOT 3,44,23:PRINT "3- LEAVE ROOM"
410 PLOT 3,44,24:PRINT "4- CAST SPELL"
415 PLOT 3,44,25:PRINT "5- FIGHT"
420 PLOT 3,44,26:PRINT "6- OPEN CHEST"
425 PLOT 3,44,27:PRINT "7- GET TREASURE"
430 PLOT 3,44,28:PRINT "8- DROP TREASURE"
435 PLOT 3,44,29:PRINT "9- QUIT GAME"
440 REM  COMMAND INPUT
445 GOSUB 30:PRINT :GOSUB 30:INPUT "COMMAND? ";Z
450 IF Z< 1OR Z> 9THEN GOSUB 30:PRINT "INVALID":GOTO 445
455 IF Z= 9GOTO 2810
460 ON ZGOSUB 1765,1885,1980,2025,2295,2560,2655,2740
465 IF SQ= 1THEN GOSUB 1135
470 IF T= 0GOTO 1310
475 IF E= 1THEN E= 0:GOTO 385
480 GOTO 445
485 REM  SUPPLIES
490 GOSUB 30:PRINT "SUPPLIES=50 GP"
495 FOR I= 1TO 1000:NEXT :GOSUB 215:GP= GP- 50:GOSUB 30:PRINT :HC= HP:RETURN
500 REM  BUY ARMOR
505 LN= 18
510 GOSUB 30:PRINT "ARMOR:   0-   NONE (CLASS 10)=   0 GP"
515 GOSUB 30:PRINT "         1-LEATHER (CLASS  8)= 100 GP"
520 GOSUB 30:PRINT "         2-  CHAIN (CLASS  6)= 300 GP"
525 GOSUB 30:PRINT "         3-  PLATE (CLASS  4)= 500 GP"
530 GOSUB 30:INPUT "BUY SHIELD=50 GP (Y/N)?  ";X$
535 IF X$= "Y"AND SH= 1THEN GOSUB 30:PRINT "YOU ALREADY HAVE ONE":GOTO 550
540 IF X$= "Y"AND SH= 0THEN GP= GP- 50:EN= EN+ 50:GOSUB 590:SH= 1:GOTO 550
545 IF X$< > "N"GOTO 530
550 GOSUB 30:INPUT "ARMOR TYPE (0,1,2,3)?  ";X:IF X< 0OR X> 3GOTO 550
555 IF X> 0THEN EN= EN- WA
560 IF X= 0GOTO 580
565 IF GP< 200* X- 100THEN GOSUB 30:PRINT "TOO LITTLE GOLD":GOTO 550
570 AC= 10- 2* X:GP= GP- (200* X- 100):WA= 100* X
575 IF X< > 0THEN EN= EN+ WA
580 CA= AC- SH- AR:GOSUB 215:RETURN
585 REM  PRINT DATA
590 C1$= LEFT$ (C1$,15)
595 FOR J= 1TO 18:PLOT 3,43,J:PRINT "                     ":NEXT J
600 PLOT 3,43,1:PRINT "NAME: ";C1$;""
605 PLOT 3,43,2:PRINT "CHAR. LEV: ";CL
610 PLOT 3,43,3:PRINT "LEVEL DOWN:";LV
615 PLOT 3,43,4:PRINT "GOLD PCS:  ";GP
620 PLOT 3,43,5:PRINT "EXPERIENCE:";XP
625 PLOT 3,43,6:PRINT "WT. MAX:   ";WT
630 PLOT 3,43,7:PRINT "ARMOR:     ";CA
635 PLOT 3,43,8:PRINT "HIT PTS:   ";HP
640 PLOT 3,43,9:PRINT "HITS LEFT: ";HC
645 PLOT 3,43,10:PRINT "SPELLS---------"
650 PLOT 3,46,11:PRINT "KNOCK: ";SP(1)
655 PLOT 3,46,12:PRINT "DISPEL:";SP(2)
660 PLOT 3,46,13:PRINT "HEAL:  ";SP(3)
665 PLOT 3,46,14:PRINT "REPEL: ";SP(4)
670 PLOT 3,46,15:PRINT "FLAME: ";SP(5)
675 PLOT 3,46,16:PRINT "SHIELD:";SP(6)
680 PLOT 3,43,17:PRINT "WEAPON: ";WP$
685 PLOT 3,43,18:PRINT "WT CARRIED:  ";EN
690 RETURN
695 REM  BUY SPELLS
700 GOSUB 215
705 LN= 18
710 GOSUB 30:PRINT "SELECT SPELLS:"
715 GOSUB 30:PRINT "  1-KNOCK  = 50 GP"
720 GOSUB 30:PRINT "  2-DISPEL =100 GP"
725 GOSUB 30:PRINT "  3-HEAL   =150 GP"
730 GOSUB 30:PRINT "  4-REPEL  =200 GP"
735 GOSUB 30:PRINT "  5-FLAME  =250 GP"
740 GOSUB 30:PRINT "  6-SHIELD =300 GP"
745 X0= 0:Y0= 27:H0= 3:W0= 64:A3= 1:LN= 26:GOSUB 50
750 GOSUB 30:INPUT "SPELL # (0= DONE) ";X:IF X= 0THEN GOSUB 215:GOTO 785
755 IF X< 1OR X> 6GOTO 750
760 GOSUB 30:INPUT "HOW MANY? ";Y
765 IF X< 1OR X> 6GOTO 750
770 IF Y< 1GOTO 750
775 IF GP- 50* X* Y< 0THEN GOSUB 30:PRINT "TOO LITTLE GOLD":GOTO 750
780 GP= GP- 50* X* Y:SP(X)= SP(X)+ Y:EN= EN+ 10* Y:GOSUB 1430:GOSUB 590:GOTO 750
785 X0= 0:Y0= 19:H0= 10:W0= 64:A3= 1:GOSUB 50:GOSUB 215
790 RETURN
795 REM  SET ROOMS
800 GOSUB 30:PRINT "SETTING UP--PLEASE WAIT"
805 FOR I= 1TO 20
810 RM(I)= 0:RX(I)= 0:RT(I)= 0
815 Y= FN R(20)+ 1:X= FN R(100):IF X< 70THEN RT(I)= Y
820 X= FN R(100):IF RT(I)< > 0AND X< 60THEN GOSUB 885
825 X= FN R(100):IF RT(I)= 0AND X< 40THEN GOSUB 885
830 DR$(I)= "U":X= FN R(100):IF X< 25THEN DR$(I)= "L"
835 Y= FN R(10)+ 1:X= FN R(100):IF X< 30THEN RX(I)= Y
840 IF RT(I)> 0AND RM(I)= 0AND X< 60THEN RX(I)= Y
845 IF RT(I)= 0AND RM(I)> 0AND X< 10THEN RX(I)= 0
850 IF RT(I)> 0AND RX(I)= 0AND RM(I)= 0AND X< 40THEN RX(I)= FN R(4)+ 7
855 IF DR$(I)= "L"AND RX(I)< 3THEN RX(I)= FN R(8)+ 3
860 IF RT(I)= 0AND RX(I)> 6THEN RX(I)= FN R(4)+ 3
865 IF RX(I)= 5OR RX(I)= 6THEN RM(I)= 0
870 NEXT I
875 RETURN
880 REM  LEVEL SET
885 X= FN R(100)+ 1:RM(I)= FN R(10)+ 1
890 IF LV= 1THEN Y= 70:Z= 95
895 IF LV= 2THEN Y= 20:Z= 70
900 IF LV= 3THEN Y= 10:Z= 40
905 IF LV= 4THEN RM(I)= FN R(20)+ 21:RETURN
910 IF X> YTHEN RM(I)= FN R(10)+ 11
915 IF X> ZTHEN RM(I)= FN R(10)+ 21
920 RETURN
925 REM  BUY WEAPONS
930 LN= 18
935 GOSUB 30:PRINT "WEAPON: 0=NO CHANGE"
940 GOSUB 30:PRINT "CHOICE REPLACES CURRENT ONE"
945 GOSUB 30:PRINT "VALUES ARE: DAMAGE/WT/GOLD"
950 GOSUB 30:PRINT "1-SHORT SWORD   (1-6 / 50/ 50)"
955 GOSUB 30:PRINT "2-MACE          (2-7 /100/ 75)"
960 GOSUB 30:PRINT "3-LONG SWORD    (2-8 / 70/100)"
965 GOSUB 30:PRINT "4-BROAD SWORD   (1-10/ 90/150)"
970 GOSUB 30:PRINT "5-BASTARD SWORD (2-12/100/200)"
975 GOSUB 30:INPUT "SELECT ";X
980 IF X< 0OR X> 5GOTO 975
985 IF X> 0THEN WP= X
990 IF WP= 0THEN GOSUB 30:PRINT "FISTS=1-2 PTS":FOR I= 1TO 500:NEXT :RETURN
995 RESTORE 1460:FOR J= 1TO WP:READ WP$,DL,DH,WW,WG:NEXT J
1000 IF X> 0THEN IF GP- WG< 0THEN GOSUB 30:PRINT "TOO LITTLE GOLD":GOTO 975
1005 IF X> 0THEN GP= GP- WG:EN= EN+ WW:GOSUB 1430
1010 REM  CHANGE WEAPON
1015 GOSUB 215:GOSUB 590:LN= 18
1020 RETURN
1025 REM  TRAP #1
1030 GOSUB 30:PRINT "ZAP! THE DOOR SHOCKED YOU!"
1035 X= FN R(10)+ 3:HC= HC- X:GOSUB 195
1040 GOSUB 30:PRINT "DAMAGE=";X;"":RX(T)= 0
1045 RETURN
1050 REM  TRAP #2
1055 GOSUB 30:PRINT "BOOM!! DOOR EXPLODED!"
1060 X= FN R(13)+ 4:HC= HC- X:GOSUB 195
1065 GOSUB 30:PRINT "DAMAGE=";X;"":RX(T)= 0
1070 RETURN
1075 REM  TRAP #3
1080 GOSUB 30:PRINT "DOOR OPENS, ARROWS FLY. PAIN!!"
1085 X= FN R(12)+ 1:HC= HC- X:GOSUB 195
1090 GOSUB 30:PRINT "DAMAGE=";X;"":RX(T)= 0
1095 RETURN
1100 REM  TRAP #4
1105 GOSUB 30:PRINT "AS YOU ENTER YOU ARE"
1110 GOSUB 30:PRINT "STRUCK BY LIGHTNING!"
1115 X= FN R(10)+ 11:HC= HC- X:GOSUB 195
1120 GOSUB 30:PRINT "DAMAGE=";X;"":RX(T)= 0
1125 RETURN
1130 REM  TRAP #5
1135 IF SQ= 1GOTO 1155
1140 GOSUB 30:PRINT "CLICK! THE DOOR LOCKED!":DR$(T)= "L"
1145 GOSUB 30:PRINT "THE WALLS ARE MOVING INWARD!!!"
1150 SQ= 1:POKE 33210,0:POKE 33209,0:RETURN
1155 IF SQ= 1AND PEEK (33210)> = 0AND PEEK (33209)> 15GOTO 1165
1160 RETURN
1165 GOSUB 30:PRINT "YOU ARE VERY THIN AND VERY DEAD!"
1170 HC= 0:SQ= 0:RX(T)= 0:GOSUB 195
1175 RETURN
1180 REM  TRAP #6
1185 GOSUB 30:PRINT "CLICK! THE DOOR LOCKED!":DR$(T)= "L"
1190 GOSUB 30:PRINT "A STRANGE MONSTER APPEARS AND ATTACKS!"
1195 MA= 4:M0= 17- 2* CL:AT= 1:HM= 0:HD= 1+ 2* CL:FOR I= 1TO HD:HM= HM+ FN R(8)+ 1:NEXT
1200 H= HM:D1= 1:D2= 12:SA= 2:MX= 100* HD:V= 1:A= 1:GOSUB 2295
1205 RETURN
1210 REM  TRAP #7
1215 GOSUB 30:PRINT "YOU HEAR A NOISE..."
1220 GOSUB 30:PRINT "A PIT OPENS UP"
1225 GOSUB 30:PRINT "YOU ARE FALLING!!"
1230 X= FN R(6)+ 1:GOSUB 30:PRINT :GOSUB 30:PRINT "YOU CLIMBED OUT"
1235 GOSUB 30:PRINT "WITH DAMAGE=";X;"":RX(T)= 0:HC= HC- X:GOSUB 195
1240 RETURN
1245 REM  TRAP #8
1250 GOSUB 30:PRINT "THE CHEST EXPLODED!":X= FN R(6)+ 7
1255 GOSUB 30:PRINT "DAMAGE=";X;"":HC= HC- X:GOSUB 195:RT(T)= 0
1260 RETURN
1265 REM  TRAP #9
1270 GOSUB 30:PRINT "GASP!! POISON GAS!"
1275 X= FN R(100):IF X> 30+ 10* CLTHEN HC= 0:GOSUB 195
1280 GOSUB 30:PRINT "YOU SURVIVED...THIS TIME":RX(T)= 0
1285 RETURN
1290 REM  TRAP #10
1295 GOSUB 30:PRINT "THE CHEST VANISHED!":RX(T)= 0:RT(T)= 0
1300 RETURN
1305 REM  LEAVE CASTLE/RESTART
1310 FOR I= 20TO 29:PLOT 3,42,I:PRINT "                     ":NEXT
1315 GOSUB 215:XP= XP+ INT (EX* XF):EX= 0:LV= 0:GP= GP+ G1
1320 IF G2> 0THEN FOR I= 1TO G2:GP= GP+ FN R(90)+ 10:NEXT
1325 IF G3> 0THEN FOR I= 1TO G3:GP= GP+ FN R(400)+ 100:NEXT
1330 EN= EN- G1- G2- 25* G3:G1= 0:G2= 0:G3= 0
1335 IF XP> 2000THEN CL= 2
1340 IF XP> 5000THEN CL= 3
1345 IF XP> 10000THEN CL= 4
1350 IF XP> 20000THEN CL= 5:GOSUB 590:GOSUB 30:PRINT "YOU MADE IT TO THE TOP!":GOTO 2960
1355 IF CQ< > CLTHEN HP= HP+ FN R(10)+ 1:CQ= CL
1360 CA= AC- SH- AR:GOSUB 590:GOSUB 30:PRINT "STATS UPDATED"
1365 GOSUB 30:INPUT "RETURN TO CASTLE (Y/N)? ";X$
1370 IF GP< 50THEN GOSUB 30:PRINT "NOT ENOUGH GOLD LEFT":FOR I= 1TO 1000:NEXT :GOTO 2940
1375 IF X$= "Y"GOTO 295
1380 GOTO 2810
1385 REM  LEVEL CHANGE
1390 IF CL< 1THEN HC= 0:GOSUB 195
1395 C0= 18- CL- MW:X= FN R(10):HP= HP- X:HC= HC- X:CQ= CL:GOSUB 590
1400 IF CL= 1THEN XP= 1000
1405 IF CL= 2THEN XP= 3500
1410 IF CL= 3THEN XP= 7500
1415 IF CL= 4THEN XP= 15000
1420 RETURN
1425 REM  OVERWEIGHT
1430 IF EN< = WTTHEN RETURN
1435 GOSUB 30:PRINT "OVERWEIGHT-- DROP SOMETHING":GOSUB 2740
1440 IF EN> WTGOTO 1430
1445 RETURN
1450 REM  WEAPON DATA
1455 REM  NAME/DAMAGE LO,HI/WT/COST
1460 DATA "SHORT SWORD",1,6,50,50
1465 DATA "MACE",2,7,100,75
1470 DATA "LONG SWORD",2,8,70,100
1475 DATA "BROAD SWORD",1,10,90,150
1480 DATA "BASTARD SWORD",2,12,100,200
1485 DATA "MACE+1",3,8,100,0
1490 DATA "SWORD+1",3,9,70,0
1495 DATA "SWORD+2",2,12,90,0
1500 DATA "SWORD+3",5,15,90,0
1505 DATA "SWORD+4",9,16,150,0
1510 DATA "MAGIC RING, -1 TO ARMOR CLASS",0,0,0,0
1515 DATA "MAGIC RING, -2 TO ARMOR CLASS",0,0,0,0
1520 REM  RM/DOOR X,Y/INSIDE X,Y
1525 DATA 1,2,5,1,3,2,7,5,6,3,3,6,8,4,8,4,6,12,5,12
1530 DATA 5,8,15,5,14,6,13,3,11,3,7,8,8,9,9,8,13,15,14,13
1535 DATA 9,21,15,20,13,10,22,8,20,9,11,22,5,19,5,12,19,3,20,2
1540 DATA 13,25,4,26,3,14,25,7,27,7,15,25,13,28,13,16,33,15,34,14
1545 DATA 17,37,12,33,12,18,37,10,33,10,19,37,6,35,7,20,37,2,35,3
1550 REM  MONSTER DATA
1555 REM  M$,HD,MA,M0,AT,D1,D2,SA,MX
1560 DATA  "GIANT ANT",2,3,16,1,1,4,0,100
1565 DATA "GIANT CENTIPEDE",1,9,20,1,1,1,5,120
1570 DATA "GNOLL",2,5,16,1,2,8,0,60
1575 DATA "HOBGOBLIN",1,6,18,1,1,8,0,20
1580 DATA  "PIERCER",2,4,16,1,3,8,0,110
1585 DATA "SKELETON",1,7,19,1,1,6,1,45
1590 DATA "ORC",1,5,18,1,2,7,2,70
1595 DATA "TROGLODYTE",2,5,16,3,1,3,0,190
1600 DATA "ZOMBIE",2,8,16,1,1,8,2,90
1605 DATA "EVIL FIGHTER",1,4,19,1,2,8,0,60
1610 DATA "BUGBEAR",3,5,16,1,2,8,0,80
1615 DATA "GELATINOUS CUBE",4,8,15,1,2,8,2,130
1620 DATA "HARPY",3,7,16,3,1,3,0,190
1625 DATA "HELLHOUND",4,4,15,1,1,10,1,175
1630 DATA "WEREWOLF",4,5,15,1,2,8,6,175
1635 DATA "OGRE",4,5,15,1,1,10,0,130
1640 DATA "CREEPING FUNGUS",3,6,16,1,2,7,3,260
1645 DATA "GIANT SPIDER",4,4,15,1,2,8,5,220
1650 DATA "GIANT RAT",3,5,16,2,1,6,0,160
1655 DATA "GARGOYLE",3,5,15,3,2,4,6,285
1660 DATA "SUBTERRANEAN LIZARD",6,5,13,1,2,12,0,170
1665 DATA "MINOTAUR",6,6,13,2,2,8,0,250
1670 DATA "OCHRE JELLY",5,8,13,1,3,12,1,155
1675 DATA "OWLBEAR",5,5,15,3,1,8,0,320
1680 DATA "TROLL",6,4,13,3,2,5,3,510
1685 DATA "WRAITH",5,4,15,1,1,6,4,440
1690 DATA "WEREBOAR",5,4,15,1,2,12,6,245
1695 DATA "ENCHANTED FIGHTER",6,3,13,1,2,8,0,180
1700 DATA "GIANT",5,4,15,1,3,18,2,270
1705 DATA "GUARDIAN",6,2,12,1,4,16,2,350
1710 DATA "SPECTRE",8,2,13,1,1,8,4,540
1715 DATA "6-HEADED HYDRA",6,5,15,6,1,6,0,640
1720 DATA "FLESH GOLEM",8,9,12,2,2,16,8,555
1725 DATA "OTYUGH",7,3,12,3,2,5,0,350
1730 DATA "BLACK PUDDING",9,6,12,1,3,24,7,355
1735 DATA "CHIMERA",9,5,12,6,1,4,1,625
1740 DATA "BALROG",8,2,12,2,2,7,7,415
1745 DATA "CRYSTALLOX",7,1,13,2,2,12,3,590
1750 DATA "SILVER SKELETON",9,0,12,1,2,8,7,375
1755 DATA "FIRE DEMON",10,0,10,1,11,20,8,525
1760 REM  MOVE
1765 IF U> 0THEN GOSUB 30:PRINT "LEAVE ROOM FIRST":RETURN
1770 GOSUB 30:INPUT "ROOM #? (0=LEAVE CASTLE) ";Z
1775 IF Z< 0OR Z> 20OR Z< > INT (Z)GOTO 1770
1780 IF Z= 0THEN GOSUB 30:INPUT "LEAVE? (GOLD?) (Y/N) ";X$:IF X$= "N"GOTO 1770
1785 IF Z< 0OR Z> 20THEN GOSUB 30:PRINT "INVALID #":GOTO 1770
1790 IF Z= TTHEN GOSUB 30:PRINT "ALREADY THERE":RETURN
1795 D= 0:T= Z
1800 IF FN R(10)< 4THEN GOSUB 1850
1805 IF T= 0THEN PLOT 6,1:PLOT 3,X1,Y1:PLOT 47:PLOT 6,2
1810 IF T= 0THEN GOSUB 30:PRINT "YOU LEFT THE CASTLE":FOR I= 1TO 500:NEXT :RETURN
1815 IF BG= 1THEN PLOT 6,1:PLOT 3,X1,Y1:PLOT 47:PLOT 6,2
1820 RESTORE 1525:FOR I= 1TO T:READ R,X1,Y1,X2,Y2:NEXT
1825 PLOT 6,5:PLOT 3,X1,Y1:PLOT 88:PLOT 6,2:BG= 1
1830 GOSUB 30:PRINT "YOU ARE AT ROOM";R;"":U= 0:V= 0:D= 0
1835 IF DR$(T)= "L"THEN GOSUB 30:PRINT "DOOR LOCKED"
1840 RETURN
1845 REM  WM'S
1850 X= FN R(10)+ 1:X= X+ 10* (LV- 1)
1855 RESTORE 1560:FOR I= 1TO X:READ M$,HD,MA,M0,AT,D1,D2,SA,MX:NEXT
1860 V= 1:W= 1:GOSUB 30:PRINT "YOU ENCOUNTERED A"
1865 GOSUB 30:PRINT "WANDERING ";M$;""
1870 HM= 0:FOR I= 1TO HD:HM= HM+ FN R(8)+ 1:NEXT :H= HM:GOSUB 2295
1875 RETURN
1880 REM  ENTER
1885 IF DR$(T)= "L"THEN GOSUB 30:PRINT "DOOR LOCKED":RETURN
1890 IF T< 1THEN GOSUB 30:PRINT "NOT OUTSIDE A ROOM":RETURN
1895 IF U= 1THEN GOSUB 30:PRINT "ALREADY INSIDE":RETURN
1900 ON RX(T)GOSUB 1030,1055
1905 X= LN:PLOT 6,1,3,X1,Y1:PLOT 47:PLOT 6,5,3,X2,Y2:PLOT 88:LN= X
1910 GOSUB 30:PRINT "YOU ARE INSIDE":U= 1
1915 IF RX(T)= 3THEN GOSUB 1080
1920 IF RX(T)= 4THEN GOSUB 1105
1925 IF RX(T)= 5THEN GOSUB 1135
1930 IF RX(T)= 6THEN GOSUB 1185
1935 IF RT(T)> 0THEN GOSUB 30:PRINT "YOU SEE A CHEST"
1940 IF RM(T)> 0THEN GOSUB 1960
1945 IF RT(T)= 0AND RM(T)= 0THEN GOSUB 30:PRINT "ROOM IS EMPTY"
1950 RETURN
1955 REM  READ MONSTER
1960 RESTORE 1560:FOR I= 1TO RM(T):READ M$,HD,MA,M0,AT,D1,D2,SA,MX:NEXT
1965 GOSUB 30:PRINT "A(AN) ";M$;" IS IN THE ROOM":V= 1
1970 HM= 0:FOR I= 1TO HD:HM= HM+ FN R(8)+ 1:NEXT :H= HM:RETURN
1975 REM  "LEAVE
1980 IF U= 0THEN GOSUB 30:PRINT "NOT IN A ROOM":RETURN
1985 IF DR$(T)= "L"THEN GOSUB 30:PRINT "DOOR LOCKED":RETURN
1990 IF V= 1AND FN R(100)< 25GOTO 2005
1995 IF V= 1THEN W= 1
2000 IF W= 1THEN GOSUB 30:PRINT "MONSTER BLOCKS THE WAY":GOSUB 2295:RETURN
2005 RT(T)= 0:RM(T)= 0:X= LN:SQ= 0:V= 0:W= 0:A= 0:M1= 0:M2= 0:M3= 0:M4= 0:TR= 0
2010 PLOT 3,X2,Y2:PLOT 32:PLOT 6,5,3,X1,Y1:PLOT 88:PLOT 6,2:LN= X:U= 0
2015 GOSUB 30:PRINT "YOU ARE OUTSIDE ROOM";R;"":RETURN
2020 REM  CAST SPELL
2025 IF A= 1THEN GOSUB 30:PRINT "CAN'T CAST A SPELL":RETURN
2030 FOR I= 20TO 29:PLOT 3,42,I:PRINT "                     ":NEXT
2035 PLOT 3,42,20:PRINT "SPELLS:"
2040 PLOT 3,44,21:PRINT "0-(QUIT)"
2045 PLOT 3,44,22:PRINT "1-KNOCK"
2050 PLOT 3,44,23:PRINT "2-DISPEL TRAPS"
2055 PLOT 3,44,24:PRINT "3-HEAL"
2060 PLOT 3,44,25:PRINT "4-REPEL MONSTER"
2065 PLOT 3,44,26:PRINT "5-FLAME"
2070 PLOT 3,44,27:PRINT "6-SHIELD"
2075 GOSUB 30:INPUT "SELECT SPELL # AT RIGHT ";Z
2080 IF Z< 0OR Z> 6OR Z< > INT (Z)GOTO 2075
2085 IF Z= 0GOTO 2105
2090 IF SP(Z)= 0THEN GOSUB 30:PRINT "SPELL NOT AVAILABLE":GOTO 2105
2095 SP(Z)= SP(Z)- 1:EN= EN- 10:ON ZGOSUB 2125,2160,2185,2210,2235,2280
2100 GOSUB 590:IF C= 1THEN RETURN
2105 FOR I= 20TO 29:PLOT 3,42,I:PRINT "                     ":NEXT :E= 1
2110 IF V= 1THEN GOSUB 2295
2115 RETURN
2120 REM  KNOCK
2125 IF FN R(100)> 80GOTO 2145
2130 IF T= 0OR DR$(T)= "U"THEN GOSUB 30:PRINT "NOTHING TO UNLOCK"
2135 IF DR$(T)= "L"THEN DR$(T)= "U":GOSUB 30:PRINT "DOOR UNLOCKED"
2140 RETURN
2145 GOSUB 30:PRINT "SPELL FAILED"
2150 RETURN
2155 REM  DISPEL
2160 IF FN R(100)> 80THEN GOSUB 30:PRINT "SPELL FAILED":RETURN
2165 IF RX(T)= 0THEN GOSUB 30:PRINT "NO TRAPS PRESENT":RETURN
2170 IF RX(T)> 0THEN RX(T)= 0:GOSUB 30:PRINT "TRAP DISARMED":RETURN
2175 RETURN
2180 REM  HEAL
2185 IF FN R(100)> 80THEN GOSUB 30:PRINT "SPELL FAILED":RETURN
2190 HC= HC+ FN R(10)+ 11
2195 IF HC> HPTHEN HC= HP
2200 GOSUB 30:PRINT "YOU FEEL BETTER":RETURN
2205 REM  REPEL
2210 IF V= 0THEN GOSUB 30:PRINT "REPEL WHAT?":RETURN
2215 IF FN R(100)> 80THEN GOSUB 30:PRINT "SPELL FAILED!":RETURN
2220 IF SA= 2OR SA= 7OR SA= 8THEN GOSUB 30:PRINT "MONSTER NOT REPELLED!":RETURN
2225 GOSUB 30:PRINT "MONSTER REPELLED":V= 0:W= 0:A= 0:RETURN
2230 REM  FLAME
2235 IF FN R(100)> 80THEN GOSUB 30:PRINT "ONLY A PUFF OF SMOKE":RETURN
2240 GOSUB 30:PRINT "WHAM!!":X= FN R(10)+ 11
2245 IF V> 0AND SA< > 1THEN HM= HM- X:GOSUB 30:PRINT X;" PTS DAMAGE"
2250 Y= FN R(10)
2255 IF U= 1AND RT(T)> 0AND Y> 6THEN GOSUB 30:PRINT "TREASURE DESTROYED!":RT(T)= 0
2260 IF V= 0THEN GOSUB 30:PRINT "WHAT WERE YOU FIRING AT?":RETURN
2265 IF V> 0AND (SA= 1OR SA= 7)THEN GOSUB 30:PRINT "MONSTER UNAFFECTED!"
2270 RETURN
2275 REM  SHIELD
2280 IF FN R(100)> 80THEN GOSUB 30:PRINT "SPELL FAILED":RETURN
2285 D= 1:GOSUB 30:PRINT "SHIELDED--5 ROUNDS":RETURN
2290 REM  MELEE
2295 RD= 1
2300 IF V= 0THEN GOSUB 30:PRINT "NOTHING TO FIGHT":RETURN
2305 FOR I= 20TO 29:PLOT 3,42,I:PRINT "                     ":NEXT
2310 PLOT 3,42,20:PRINT "MELEE COMMANDS:"
2315 PLOT 3,44,22:PRINT "SPELLS RD.#1 ONLY"
2320 PLOT 3,44,25:PRINT "1-CAST SPELL"
2325 PLOT 3,44,26:PRINT "2-RUN"
2330 PLOT 3,44,27:PRINT "3-ATTACK"
2335 B= 0:GOSUB 30:PRINT :GOSUB 30:PRINT "ROUND";RD;""
2340 GOSUB 30:INPUT "ACTION? ";Z
2345 IF Z< 1OR Z> 3GOTO 2340
2350 ON ZGOSUB 2380,2395,2430
2355 RD= RD+ 1:IF V= 0THEN W= 0:A= 0:RETURN
2360 IF HM< = 0GOTO 2545
2365 IF RD> = 1THEN A= 1
2370 IF B= 1THEN B= 0:GOTO 2305
2375 GOTO 2335
2380 IF RD> 1THEN A= 1
2385 C= 1:GOSUB 2025:B= 1:C= 0:RETURN
2390 REM  RUN
2395 X= FN R(100)
2400 IF U= 1AND DR$(T)= "L"THEN GOSUB 30:PRINT "DOOR LOCKED":GOTO 2470
2405 IF X< 50THEN GOSUB 30:PRINT "YOU ESCAPED!":E= 1:V= 0:W= 0:A= 0:GOTO 2415
2410 GOSUB 30:PRINT "YOU'RE STILL THERE":GOTO 2470
2415 IF U= 1THEN U= 0:PLOT 3,X2,Y2:PLOT 32:PLOT 6,5,3,X1,Y1:PLOT 88:PLOT 6,2
2420 RETURN
2425 REM  YOU ATTACK
2430 X= FN R(20)+ 1
2435 IF SA= 3THEN HM= HM+ 3:IF HM> HTHEN HM= H
2440 IF (SA= 6OR SA= 8)AND WP< 6THEN GOSUB 30:PRINT "ONLY A MAGIC WEAPON HITS":X= - 10
2445 IF X< C0- MATHEN GOSUB 30:PRINT "YOU MISSED":GOTO 2470
2450 X= FN R(DH- DL+ 1)+ DL:HM= HM- X
2455 GOSUB 30:PRINT "YOU HIT--";X;" PT(S)"
2460 IF HM< = 0GOTO 2545
2465 REM  MONSTER ATTACKS
2470 GOSUB 30:PRINT "MONSTER HAS";AT;" ATTACK(S)"
2475 FOR I= 1TO AT
2480 X= FN R(20)+ 1
2485 IF D= 1AND RD< 7THEN GOSUB 30:PRINT "YOU ARE SHIELDED":GOTO 2515
2490 IF X< M0- CATHEN GOSUB 30:PRINT "MONSTER MISSED":GOTO 2515
2495 X= FN R(D2- D1+ 1)+ D1:HC= HC- X
2500 GOSUB 30:PRINT "DAMAGE=";X;"":GOSUB 195
2505 IF SA= 4THEN CL= CL- 1:GOSUB 30:PRINT "YOU JUST LOST 1 LEVEL!":GOSUB 1390:GOSUB 195
2510 IF SA= 5THEN GOSUB 2530
2515 NEXT I
2520 RETURN
2525 REM  POISONED
2530 X= 60+ CL* 5:IF X> FN R(100)THEN GOSUB 30:PRINT "YOU SURVIVED ITS POISON":RETURN
2535 HC= 0:GOSUB 30:PRINT "POISON VENOM!!":GOSUB 195:RETURN
2540 REM  MONSTER DEAD
2545 GOSUB 30:PRINT "MONSTER DEAD (";H;" PTS.)":RM(T)= 0
2550 V= 0:W= 0:A= 0:B= 0:D= 0:EX= EX+ MX+ H* 5:E= 1:RETURN
2555 REM  OPEN CHEST
2560 IF U= 0OR RT(T)= 0THEN GOSUB 30:PRINT "YOU DON'T SEE A CHEST":RETURN
2565 IF V= 0GOTO 2580
2570 W= 1:GOSUB 30:PRINT "MONSTER ATTACKS":GOSUB 2295
2575 RETURN
2580 X= 0:IF RX(T)> 6THEN X= RX(T)- 6
2585 IF TR= 1THEN GOSUB 30:PRINT "CHEST ALREADY OPEN":RETURN
2590 IF RX(T)= 0GOTO 2605
2595 ON XGOSUB 1215,1250,1270,1295
2600 IF RT(T)= 0THEN GOSUB 30:PRINT "TREASURE IS GONE":RETURN
2605 MW$= "":X= FN R(100)
2610 M1= FN R(251)+ 50:GOSUB 30:PRINT "YOU SEE:";M1;" GOLD"
2615 IF X< 20THEN M2= (FN R(5)+ 1)* LV:GOSUB 30:PRINT "";TAB( 8);M2;" GEM(S)"
2620 X= FN R(100)
2625 IF X< 10THEN M3= (FN R(2)+ 1)* LV:GOSUB 30:PRINT "";TAB( 8);M3;" PC(S). OF JEWELRY"
2630 X= FN R(100):Y= FN R(7)+ 6:IF X< 5THEN M4= Y
2635 IF M4> 0THEN RESTORE 1460:FOR I= 1TO M4:READ MW$,X,X,X,X:NEXT
2640 IF M4> 0THEN GOSUB 30:PRINT TAB( 9);"A ";MW$;""
2645 TR= 1:RETURN
2650 REM  GET
2655 IF M1= 0AND M2= 0AND M3= 0AND M4= 0THEN GOSUB 30:PRINT "WHAT TREASURE?":RETURN
2660 IF M4= 0GOTO 2685
2665 GOSUB 30:INPUT "WANT THE MAGIC ITEM (Y/N)? ";X$
2670 IF X$< > "Y"GOTO 2685
2675 GOTO 2715
2680 MW= VAL (RIGHT$ (WP$,1)):C0= 18- CL- MW
2685 EN= EN+ M1+ M2+ 25* M3:CA= AC- SH- AR:M4= 0
2690 G1= G1+ M1:G2= G2+ M2:G3= G3+ M3:GOSUB 590
2695 GOSUB 30:PRINT "TREASURE GOTTEN":M1= 0:M2= 0:M3= 0:RT(T)= 0:TR= 0
2700 IF EN> WTTHEN GOSUB 1430
2705 RETURN
2710 REM  MAGIC ITEM ADD
2715 IF M4= 11THEN AR= 1:GOTO 2685
2720 IF M4= 12THEN AR= 2:GOTO 2685
2725 WP= M4:EN= EN- WW:M4= 0::RESTORE 1460:FOR I= 1TO WP:READ WP$,DL,DH,WW,WG:NEXT :GOSUB 590
2730 EN= EN+ WW:GOSUB 1430:C0= 18- CL- MW:GOTO 2680
2735 REM  DROP
2740 GOSUB 30:PRINT "DROP WHAT?"
2745 GOSUB 30:PRINT "YOU ARE CARRYING:"
2750 GOSUB 30:PRINT G1;" GOLD PCS"
2755 GOSUB 30:PRINT G2;" GEM(S)"
2760 GOSUB 30:PRINT G3;" PC(S) JEWELRY"
2765 GOSUB 30:INPUT "# GOLD TO DROP ";X
2770 GOSUB 30:INPUT "# GEMS TO DROP ";Y
2775 GOSUB 30:INPUT "# JEWELRY TO DROP ";Z
2780 IF X> G1OR Y> G2OR Z> G3THEN GOSUB 30:PRINT "TRY THAT AGAIN":GOTO 2745
2785 G1= G1- X:G2= G2- Y:G3= G3- Z:M1= X:M2= Y:M3= Z:EN= EN- X- Y- 25* Z:GOSUB 590
2790 GOSUB 30:INPUT "DONE (Y/N)? ";X$
2795 IF X$= "N"GOTO 2740
2800 RETURN
2805 REM  QUIT/SAVE
2810 IF U= 1AND DR$(T)= "L"AND SP(1)= 0THEN GOSUB 30:PRINT "YOU STARVED TO DEATH":GOTO 2940
2815 IF T< > 0THEN GOSUB 30:PRINT "LEAVE CASTLE FIRST":GOTO 445
2820 GOSUB 215:LN= 18
2825 GOSUB 30:INPUT "CHOOSE--SAVE GAME OR QUIT? ";X$
2830 IF X$= "Q"THEN PLOT 8,12:GOTO 2940
2835 IF X$< > "S"GOTO 6680
2840 PLOT 8,12,14,3,25,12:PRINT "PLEASE WAIT"
2845 PLOT 3,0,30
2850 FILE "N",C$,1,128,1
2855 FILE "R",1,C$,1
2860 PUT 1,1,1;C1$[16],WP$[16]
2865 PUT 1,1,33;CL,WT,SP(1),SP(2),SP(3),SP(4),SP(5),SP(6),WP,HP,AC,GP,EN,SH
2870 PUT 1,1,89;AR,WA,MW,XP,CQ
2875 FILE "C",1
2880 PLOT 15,8,12:END
2885 REM  CHARACTER DEAD--END
2890 FOR I= 1TO 500:NEXT
2895 PLOT 8,12,6,6
2900 PLOT 2,15,15,242,55,15,80,40,40,40,15,15,255
2905 PLOT 2,80,40,242,80,100,60,115,40,100,40,40,255
2910 PLOT 6,1,14,3,27,9:PRINT "R.I.P."
2915 PLOT 15,6,7
2920 I= LEN (C1$):X$= RIGHT$ (C1$,1)
2925 IF X$= " "THEN I= I- 1:C1$= LEFT$ (C1$,I):GOTO 2920
2930 X= INT ((17- I)/ 2+ 21):PLOT 3,X,12:PRINT C1$
2935 PLOT 3,22,14:PRINT "A NOBLE WARRIOR":PLOT 6,2
2940 PLOT 3,0,30:INPUT "PLAY AGAIN (Y/N)? ";X$
2945 IF X$= "Y"GOTO 165
2950 PLOT 8,12:END
2955 REM  WIN GAME
2960 PLOT 6,103,8,12:PLOT 14,3,22,14:PRINT "CONGRATULATIONS!!!"
2965 FOR I= 1TO 3000:NEXT I:PLOT 6,2,8,12,15:GOTO 2940