100 DEFINT A-Z
101 DEF FNX$(X$)=MID$(X$,INSTR(X$,".")+1)
102 ZM$=SPACE$(254)+"."
105 MEFF=100
110 FOR I=1 TO 10:K$(I)="^F"+RIGHT$(STR$(I),1)
120 KEY I,K$(I)+CHR$(13)
130 NEXT I
140 CLS
150 GOTO 290
160 '
170 '
180 GOTO 1000   :'EDIT ARTIFACTS
185 GOTO 2250   :'PREDEFINED ARTIFACT SELECTION
190 GOTO 4000   :'EDIT ROOMS
200 GOTO 6000   :'EDIT MONSTERS
210 GOTO 8000   :'INPUT FILE DATA
220 GOTO 10000  :'EDIT EFFECTS
230 GOTO 12000  :'SAVE DATA
240 GOTO 31000  :'MAKE UPPERCASE
250 GOTO 38000  :'INPUT STRING
260 GOTO 39000  :'INPUT INTEGER
270 '
280 '
290 '
300 OPEN "I",#1,"WEAPONS.DAT"
310 INPUT#1,NW:DIM W$(NW,2),W(NW,8)
320 FOR I=1 TO NW
330    INPUT#1,W$(I,1),W$(I,2)
340    FOR J=1 TO 8
350    INPUT#1,W(I,J)
360 NEXT J:NEXT I
370 CLOSE#1
371 '
372 DIM DES$(12)
373 OPEN"I",#1,"DESCRIPT.DAT"
374    FOR I=1 TO 12
375    INPUT#1,DES$(I)
376 NEXT I
377 CLOSE#1
378 '
380 CLS
382 DR$="A:"
387 CLS
390 PRINT"DUNGEON DESIGN PROGRAM"
400 PRINT:PRINT"CREATE BY JON WALKER"
410 PRINT
420 FOR I=1 TO 500:NEXT I
430 CLS
440 FKY=-1
445 PRINT TAB(40);FRE(0);" BYTES OPEN"
450 PRINT:PRINT
460 PRINT"DUNGEON DESIGNER MAIN MENU FOR DUNGEON :";ADNAME$
470 PRINT:PRINT"# OF ARTIFACTS =";NA
480 PRINT"# OF MONSTERS  =";NM
490 PRINT"# OF ROOMS     =";NR
500 PRINT:PRINT
510 PRINT"   F1. EDIT ARTIFACTS";TAB(45);"F2. EDIT ROOMS"
520 PRINT
530 PRINT"   F3. EDIT MONSTERS";TAB(45);"F4. EDIT EFFECTS
540 PRINT
550 PRINT"   F5. READ DUNDEON DATA";TAB(45);"F6. SAVE DATA"
560 PRINT
565 PF$="HELP MODE":IF PF=1 THEN PF$="NO HELP MODE"
566 PRINT"   F7. DATA DISK IS DIRVE ";DR$;TAB(45);"F8. ";PF$
570 PRINT
580 PRINT TAB(44);"F10. QUIT"
590 PRINT:PRINT
600 PRINT"    WHICH ";
610 N=4
620 GOSUB 38000
630 IF A$=K$(1) AND NA>0 THEN 1000
640 IF A$=K$(2) AND NR>0 THEN 4000
650 IF A$=K$(3) AND NM>0 THEN 6000
660 IF A$=K$(4) THEN GOSUB 10000:GOTO 430
670 IF A$=K$(5) THEN GOSUB 8000 :GOTO 430
671 IF A$=K$(6) THEN GOSUB 12000:GOTO 430
672 IF A$=K$(7) THEN IF DR$="A:" THEN DR$="B:" ELSE DR$="A:"
673 IF A$=K$(8) THEN IF PF=1 THEN PF=0 ELSE PF=1
675 IF A$=K$(10) THEN CLS:RUN"MENU"
680 GOTO 430
690 '
700 '
1000 CLS
1010 WT$(1)="AXE":WT$(2)="SPEAR":WT$(3)="MACE":WT$(4)="BOW":WT$(5)="SWORD"
1020 TY$(0)=" TREASURE OF SET VALUE":TY$(1)=" TREASURE OF VARIABLE VALUE":TY$(2)=" STANDARD WEAPON":TY$(3)=" SPECIAL WEAPON"
1030 UP=-1:I=1
1040 IF AN$(1)="" THEN 1120
1050 PRINT"ARTIFACTS ON FILE"
1060 PRINT"================="
1070 FOR I=1 TO NA
1080 PRINT USING "&               &    ";AN$(I);
1090 IF I/3=INT(I/3) THEN PRINT
1100 IF AN$(I)="" THEN 1120
1110 NEXT I
1120 ART=I:PRINT:PRINT
1130 PRINT" F1  ADD"
1140 IF AN$(1)<>"" THEN PRINT " F2  EDIT"
1150 PRINT"F10 QUIT":PRINT:PRINT"WHICH  ";
1160 N=3:GOSUB 38000:IF A$="" THEN 1160
1170 IF A$=K$(1) AND AN$(NA)<>"" THEN PRINT"YOU CAN'T ADD ANY MORE!":GOTO 1230
1180 IF A$=K$(1) THEN 1250
1190 IF A$=K$(2) THEN 1650
1200 IF A$=K$(10) THEN 430
1210 '
1220 GOTO 1000
1230 PRINT:PRINT"HIT RETURN TO CONTINUE...";:N=1:GOSUB 38010
1240 GOTO 1000
1250 REM /// ADD NEW ARTIFACTS
1260 CLS
1270 PRINT"F1=PREDEFINED"
1280 PRINT:PRINT"ARTIFACT #";ART
1290 PRINT :PRINT"NAME (RETURN TO QUIT)  ";:N=20:GOSUB 38000:IF A$="" THEN ART=ART-1:GOTO 1000
1300 REM // check for eroneous funct. key input
1310 FOR JJ=2 TO 10:IF A$=K$(JJ) THEN 1260
1320 NEXT JJ
1330 REM // is a weapon chosen by funct. key?
1340 GOT=-1:IF A$=K$(1) THEN GOSUB 2250
1350 IF GOT=0 THEN 1260
1360 IF GOT>0 THEN AD$(ART)=W$(GOT,2):FOR II=1 TO 8:AD(ART,II)=W(GOT,II):NEXT II:AN$(ART)=W$(GOT,1):GOTO 1600
1370 GOSUB 31000
1380 REM // no funct. key weapon chosen.  Get rest of data
1390 AN$(ART)=A$
1400 PRINT:PRINT"DESCRIPTION ";:N=250:GOSUB 38000:IF A$="" THEN 1400
1410 AD$(ART)=A$
1420 PRINT :PRINT"VALUE     ";:N=10:GOSUB 39010:IF A<0 THEN 1420
1430 AD(ART,1)=A
1440 PRINT :PRINT"TYPE  (0=SET VALUE TREAS., 1=VAR. VALUED TREAS., 2=STND WEAP., 3=SPECIAL WEAP.)"
1450 PRINT"        ->";:N=1:GOSUB 39010:IF A<0 OR A>3 THEN 1450
1460 AD(ART,2)=A
1470 PRINT :PRINT"WEIGHT    ";:N=4:GOSUB 39010:IF A<1 THEN 1470
1480 AD(ART,3)=A
1490 PRINT :PRINT"ROOM FOUND (0 -";NR;")";:N=4:GOSUB 39010:IF A<0 OR A>NR THEN 1490
1500 AD(ART,4)=A
1510 IF AD(ART,2)<2 THEN 1620
1520 PRINT:PRINT"COMPLEXITY ";:N=4:GOSUB 39010:AD(ART,5)=A
1530 PRINT:PRINT"TYPE  (1=AXE, 2=SPEAR, 3=MACE, 4=BOW, 5=SWORD)";:N=1:GOSUB 39010:IF A<1 OR A>5 THEN 1530
1540 AD(ART,6)=A
1550 PRINT:PRINT"DICE       ";:N=3:GOSUB 39010:IF A<1 THEN 1550
1560 AD(ART,7)=A
1570 PRINT:PRINT"SIDES      ";:N=3:GOSUB 39010:IF A<1 THEN 1570
1580 AD(ART,8)=A
1590 PRINT
1600 GOSUB 2060
1610 A$=INKEY$
1620 PRINT"ACCEPT ";:N=1:GOSUB 38010:IF A$<>"Y" AND A$<>"y" AND A$<>"" THEN 1260
1630 ART=ART+1:IF ART>NA THEN ART=NA:GOTO 1000
1640 GOTO 1260
1650 REM /// EDIT ARTIFACT
1660 CLS
1670 FOR I=1 TO NA
1680 IF AN$(I)="" THEN 1710
1690 PRINT USING "###.   &                      &";I,AN$(I)
1695 IF I/18=INT(I/18) THEN INPUT"HIT RETURN TO CONTINUE ";A$
1700 NEXT I
1710 PRINT:PRINT
1720 PRINT"EDIT WHICH (0 TO END) ";:N=3:GOSUB 39010
1730 IF A<0 OR A>NA THEN 1720
1740 IF A=0 THEN 1000
1750 IF AN$(A)="" THEN 1660
1760 ART=A
1770 GOSUB 2060
1780 IF AD(ART,2)<2 THEN FOR KK=5 TO 8:AD(ART,KK)=0:NEXT KK
1790 PRINT"EDIT WHICH FIELD (0 TO END) ";:N=1:GOSUB 39010
1800 IF A=0 THEN 1000
1810 IF A>6 AND AD(ART,2)<2 THEN 1770
1820 ON A GOTO 1840,1850,1860,1880,1930,1960,1980,2000,2020,2040
1830 GOTO 1660
1840 PRINT"ENTER NEW NAME        ";:N=30:GOSUB 38010:GOSUB 31000:AN$(ART)=A$:GOTO 1770
1850 PRINT"ENTER NEW DESCRIPTION ":PRINT:N=255:GOSUB 38000:AD$(ART)=A$:GOTO 1770
1860 PRINT"ENTER NEW VALUE      ";:GOSUB 39010:IF A<1 THEN 1770
1870 AD(ART,1)=A:GOTO 1770
1880 PRINT"ENTER NEW TYPE (0=SET $ TREAS, 1=VAR $ TREAS, 2=STND. WEAP,   3=SPECIAL WEAP)"
1890 PRINT"                     ";
1900 GOSUB 39010:IF A<0 OR A>3 THEN 1770
1910 AD(ART,2)=A
1920 GOTO 1770
1930 PRINT"ENTER NEW WEIGHT     ";:GOSUB 39010:IF A<1 THEN 1770
1940 AD(ART,3)=A
1950 GOTO 1770
1960 PRINT"NEW ROOM (0 -";NR;")";:GOSUB 39010:IF A<0 OR A>NR THEN 1770
1970 AD(ART,4)=A:GOTO 1770
1980 PRINT"ENTER NEW COMPLEXITY ";:GOSUB 39010
1990 AD(ART,5)=A:GOTO 1770
2000 PRINT"ENTER NEW WEAP. TYPE (1=AXE, 2=SPEAR, 3=MACE, 4=BOW, 5=SWORD)";:GOSUB 39010:IF A<1 OR A>5 THEN 1770
2010 AD(ART,6)=A:GOTO 1770
2020 PRINT"ENTER NEW WEAP. DICE ";:GOSUB 39010:IF A<0 THEN 1770
2030 AD(ART,7)=A:GOTO 1770
2040 PRINT"ENTER NEW WEAP. SIDE ";:GOSUB 39010:IF A<0 THEN 1770
2050 AD(ART,8)=A:GOTO 1770
2060 REM /// PRINT OUT ARTIFACT
2070 CLS
2080 PRINT "1. NAME       ";AN$(ART)
2090 PRINT "2. DESCRIPTION ":PRINT:PRINT AD$(ART)
2100 PRINT USING "3. VALUE   ###,###";AD(ART,1);:PRINT " GP"
2110 PRINT USING "4. TYPE          #";AD(ART,2);:PRINT TY$(AD(ART,2))
2120 PRINT USING "5. WEIGHT     #### GRONDS";AD(ART,3)
2130 PRINT USING "6. ROOM        ###";AD(ART,4);:PRINT " ";RN$(AD(ART,4))
2140 PRINT
2150 IF AD(ART,2)<2 THEN 2210
2160 PRINT USING "7. COMPLEXITY ####";AD(ART,5);:PRINT " %"
2170 PRINT USING "8. TYPE          #";AD(ART,6);:PRINT " ";WT$(AD(ART,6))
2180 PRINT USING "9. SIDES        ##";AD(ART,7)
2190 PRINT USING "10.DICE         ##";AD(ART,8)
2200 PRINT
2210 RETURN
2220 REM
2230 REM PREDEDFINED ARTIFACTS
2246 '
2250 I9=1
2255 CLS
2256 ON ERROR GOTO 0
2260 FOR I=1 TO 9 STEP 2
2300 '
2305   CK=(I9+I-1)<=NW
2310   IF I9+I-2>NW THEN PRINT:PRINT:GOTO 2400
2311   IF I=1 THEN PRINT" F1.  PREVIOUS ARTIFACT PAGE"TAB(40);:GOTO 2316
2315   PRINT " F";RIGHT$(STR$(I),1);".  ";W$(I9+I-2,1);TAB(40);
2316   IF I=9 THEN PRINT"F10. NEXT ARTIFACT PAGE":GOTO 2326
2317   IF CK THEN PRINT "F";RIGHT$(STR$(I+1),1);".  ";W$(I9+I-1,1) ELSE PRINT
2318 '
2326    IF I=1 THEN PRINT TAB(40);:GOTO 2330
2329    PRINT USING"VALUE = ##,### GP";W(I9+I-2,1);TAB(40);
2330    IF I=9 THEN PRINT:GOTO 2333
2331    IF CK THEN PRINT USING"VALUE = ##,### GP";W(I9+I-1,1) ELSE PRINT
2332 '
2333    IF I=1 THEN PRINT TAB(40);:GOTO 2335
2334    PRINT USING"TYPE # (";W(I9+I-2,2);:PRINT TY$(W(I9+I-2,2));" )";TAB(40);
2335    IF I=9 THEN PRINT:GOTO 2340
2336    IF CK THEN PRINT USING"TYPE # (";W(I9+I-1,2);:PRINT TY$(W(I9+I-1,2));" )" ELSE PRINT
2340 '
2400 PRINT:NEXT I
2410 PRINT"WHICH ";:GOSUB 38000
2420 IF K$(1)=A$  AND I9>1  THEN I9=I9-6:GOTO 2255
2430 IF K$(10)=A$ AND I9<NW THEN I9=I9+6:GOTO 2255
2440 '
2445 IF A$=K$(1) OR A$=K$(10) THEN 2255
2450 GOT=VAL(RIGHT$(A$,1))-10*(A$=K$(10))+I9-2
2452 IF A$="" THEN GOT=0
2455 IF GOT>NW THEN 2255
2460 RETURN
4000 ' NR = # OF ROOMS
4010 ' RM = # OF ROOMS CURRENTLY EDITTED
4020 '
4030 ' RN$(*) = ROOM NAME
4040 ' MAP(*,*) = ROOM MOVES (N,S,E,W,U,D)
4050 '
4055 N$=DR$+"EAMON.DES"
4060 OPEN "R",#1,N$,255
4070 FIELD 1,255 AS B$
4090 '
4100 CLS
4110 PRINT"   F1. ADD ROOMS"
4120 IF RN$(1)<>"" THEN PRINT"   F2. EDIT ROOMS"
4130 PRINT:PRINT:PRINT"  F10. QUIT"
4140 PRINT:PRINT:PRINT"WHICH ";
4150 N=5:GOSUB 38010
4160 IF K$(1)=A$ THEN 4200
4170 IF K$(2)=A$ THEN 4450
4180 IF K$(10)=A$ THEN CLOSE#1:GOTO 430
4190 GOTO 4100
4200 REM /// ADD ROOMS
4210 IF RN$(NR)<>"" THEN PRINT"NO ROOMS LEFT TO FILL.":PRINT:PRINT "HIT RETURN.":GOSUB 38010:GOTO 4100
4220 FOR I=1 TO NR
4230 IF RN$(NR)<>"" THEN NEXT I
4240 RM=I
4250 CLS
4255 IF RM>NR THEN 4100
4260 PRINT:PRINT:PRINT"ADDING ROOM #";RM:PRINT
4270 PRINT:PRINT"Enter room name  :";:N=30:GOSUB 38010:IF A$="" THEN RM=RM-1:GOTO 4100
4280 RN$(RM)=A$
4290 PRINT:PRINT:PRINT"Enter room description ":PRINT:N=253:GOSUB 38010:IF A$="" THEN 4290
4300 RSET B$="."+A$
4310 PUT#1,RM
4320 PRINT:PRINT:PRINT"Enter room moves"
4330 FOR I=1 TO 6
4340 PRINT MID$("NORTH SOUTH EAST  WEST  UP    DOWN ",(I-1)*6+1,5);" ";
4350 GOSUB 39010
4360 IF ABS(A)>NR AND A<>-999 THEN 4340
4370 MAP(RM,I)=A
4380 NEXT I
4390 RM=RM+1
4400 '
4410 GOTO 4250
4420 '
4430 ' EDIT ROOMS
4440 '
4450 R=1
4460 IF RN$(1)="" THEN PRINT "NO ROOMS TO EDIT":PRINT "HIT RETURN":GOSUB 38010:GOTO 4100
4470 CLS
4480 PRINT:PRINT"EDITTING ROOMS"
4490 PRINT:PRINT
4500 PRINT "ROOM NAME :";RN$(R)
4510 PRINT "================================"
4520 PRINT:PRINT "DESCRIPTION":PRINT
4530 GET#1,R:IF B$=ZM$ THEN A$="" ELSE A$=FNX$(B$)
4540 PRINT A$
4550 PRINT "================================"
4560 PRINT:PRINT"ROOM MOVES":PRINT
4570 PRINT "NORTH SOUTH  EAST  WEST   UP  DOWN"
4580 FOR I=1 TO 6:PRINT USING " #### ";MAP(R,I);
4590 NEXT I
4600 PRINT:PRINT:PRINT
4610 PRINT"F1=EDIT  F2=PREVIOUS ROOM  F4=NEXT ROOM  F10=QUIT ";
4620 GOSUB 38010
4630 IF A$=K$(1) THEN 4710
4640 IF A$=K$(2) AND R>1 THEN R=R-1:GOTO 4470
4650 IF A$=K$(4) AND R<NR THEN IF RN$(R+1)<>"" THEN R=R+1:GOTO 4470
4660 IF A$=K$(10) THEN 4100
4670 GOTO 4600
4680 '
4690 ' /// edit room
4700 '
4710 CLS:PRINT"ROOM #";R
4720 PRINT:PRINT
4730 PRINT "ROOM NAME :";RN$(R)
4740 PRINT"ENTER NEW NAME ";:N=30:GOSUB 38010
4750 IF A$<>"" THEN RN$(R)=A$
4760 PRINT "=================================="
4770 PRINT "DESCRIPTION":PRINT
4780 GET#1,R:IF B$=ZM$ THEN A$="" ELSE A$=FNX$(B$)
4790 PRINT A$
4800 PRINT
4810 PRINT"ENTER NEW DESCRIPTION"
4820 PRINT
4830 N=253:GOSUB 38010
4840 IF A$<>"" THEN RSET B$="."+A$:PUT#1,R
4850 PRINT "=================================="
4860 PRINT"ROOM MOVES":PRINT
4870 PRINT "NORTH SOUTH  EAST  WEST   UP  DOWN"
4880 FOR I=1 TO 6:PRINT USING " #### ";MAP(R,I);
4890 NEXT I
4900 PRINT:PRINT
4910 FOR I=1 TO 6
4920 PRINT MID$("NORTH SOUTH EAST  WEST  UP    DOWN ",(I-1)*6+1,5);"  ";
4930 GOSUB 38010
4940 A=MAP(R,I)
4950 IF A$<>"" THEN A=INT(VAL(A$))
4960 IF ABS(A)>NR AND A<>-999 THEN 4920
4970 MAP(R,I)=A
4980 NEXT I
4990 GOTO 4470
5000 '
5010 '
6000 ' monster edit
6010 ' MON = # OF MONSTERS CURRENTLY EDITTED
6020 '
6030 ' MN$(*) = MONSTERS NAME
6040 ' MD$(*) = MONSTER DESCRIPTION
6050 ' MD(*,*) = MONSTER DATA
6051 ' DMD$(*) = DEAD MONSTER DESCRIPTION
6060 '
6070 CLS
6075 ON ERROR GOTO 0
6080 D$="HARDINESS   AGILITY     FRIEND %    COURAGE     ROOM #      WEIGHT      DEF ODDS    ARMOUR      WEAPON #    ODDS TO HIT WEAP. DICE  WEAP. SIDE  "
6090 PRINT"   F1. ADD MONSTERS"
6100 IF MN$(1)<>"" THEN PRINT"   F2. EDIT MONSTERS"
6110 PRINT:PRINT:PRINT"  F10. QUIT"
6120 N=5:GOSUB 38000
6130 IF K$(1)=A$ THEN 6170
6140 IF K$(2)=A$ THEN 6480
6150 IF K$(10)=A$ THEN CLOSE#1:GOTO 430
6160 GOTO 6070
6170 REM /// ADD MONSTER
6180 IF MN$(NM)<>"" THEN PRINT"NO MONSTERS LEFT TO FILL.":PRINT:PRINT "HIT RETURN.":GOSUB 38000:GOTO 6070
6190 FOR I=1 TO NM
6200 IF MN$(I)<>"" THEN NEXT I
6210 MON=I
6220 CLS
6225 IF MON>NM THEN 6070
6230 PRINT"ADDING MONSTER #";MON
6240 PRINT"Enter monster's name ";:N=30:GOSUB 38000:IF A$="" THEN GOTO 6040
6250 GOSUB 31000
6260 MN$(MON)=A$
6270 PRINT"Enter monster's description ":N=253:GOSUB 38000:IF A$="" THEN 6270
6280 MD$(MON)=A$
6281 '
6282 PRINT"Enter monster's dead body description ":N=253:GOSUB 38000:IF A$="" THEN 6282
6283 DMD$(MON)=A$
6290 ' ENTER MONSTERS DATA HERE
6300 PRINT:PRINT"Enter monster's :":PRINT
6310 FOR I=1 TO 12
6311 GOSUB 7000
6320 PRINT USING "## - ";I;
6330 PRINT MID$(D$,(I-1)*12+1,12);"  ";
6340 '
6350 GOSUB 39000
6360 IF I<3 AND (A<3 OR A>24) THEN 6320
6370 IF I<0 THEN 6320
6380 IF I=5 AND A>NR THEN 6320
6390 IF I=8 AND (A>9) THEN 6320
6400 IF I=9 AND A>0 AND A<=NA THEN IF AD(A,2)<2 THEN PRINT"THAT'S NOT A WEAPON!":PRINT:GOSUB 7000:GOTO 6320
6410 MD(MON,I)=A
6420 NEXT I
6430 MON=MON+1
6440 GOTO 6220
6450 '
6460 ' EDIT MONSTER
6470 '
6480 R=1
6490 CLS
6500 PRINT:PRINT"EDITTING MONSTERS"
6510 PRINT:PRINT
6520 PRINT "MONSTER";R;"'S NAME :";MN$(R)
6530 PRINT:PRINT "DESCRIPTION":PRINT
6540 PRINT MD$(R)
6550 PRINT:PRINT:PRINT
6560 PRINT"F1=EDIT  F2=PREVIOUS MONSTER  F4=NEXT MONSTER  F10=QUIT ";
6570 GOSUB 38000
6580 IF A$=K$(1) THEN 6630
6590 IF A$=K$(2) AND R>1 THEN R=R-1:GOTO 6490
6600 IF A$=K$(4) AND R<NM THEN IF MN$(R+1)<>"" THEN R=R+1:GOTO 6490
6610 IF A$=K$(10) THEN 6070
6620 GOTO 6550
6630 CLS:PRINT"MONSTER #";R
6632 '
6640 PRINT
6650 PRINT"Monster's name :";MN$(R)
6660 PRINT"Enter new name ";:N=30:GOSUB 38000
6670 IF A$<>"" THEN MN$(R)=A$
6690 PRINT "Description":PRINT
6700 PRINT MD$(R)
6720 PRINT"Enter new description"
6740 N=253:GOSUB 38000
6750 IF A$<>"" THEN MD$(R)=A$
6751 '
6752 PRINT"Dead body description"
6753 PRINT DMD$(R)
6754 PRINT"Enter new dead body description"
6755 PRINT
6756 N=253:GOSUB 38000
6757 IF A$<>"" THEN DMD$(R)=A$
6760 '  EDIT MONSTER DATA HERE
6770 FOR I=1 TO 12
6780 PRINT "CURRENT   ";MID$(D$,(I-1)*12+1,12);"= ";MD(R,I);
6790 IF I=9 THEN PRINT AN$(MD(R,9))
6800 IF I=5 THEN PRINT RN$(MD(R,5))
6810 IF I<>9 AND I<>5 THEN PRINT
6815 GOSUB 7000
6820 PRINT "ENTER NEW ";MID$(D$,(I-1)*12+1,12);"=> ";
6830 GOSUB 38000
6840 IF A$="" THEN 6920
6850 A=INT(VAL(A$))
6860 IF I<3 AND (A<3 OR A>24) THEN 6820
6870 IF A<0 THEN 6820
6880 IF I=5 AND A>NR THEN 6820
6890 IF I=8 AND (A>9) THEN 6820
6900 IF I=9 AND A>1 AND A<=NA THEN IF AD(A,2)<2 THEN PRINT"THAT'S NOT A WEAPON!":PRINT:GOSUB 7000:GOTO 6820
6910 MD(R,I)=A
6920 NEXT I
6930 GOTO 6490
6990 '
6991 '
6992 '
7000 Y1=CSRLIN
7001 IF PF=1 THEN RETURN
7005 FOR J=1 TO 13:LOCATE 8+J,40:PRINT SPACE$(26);:NEXT J
7010 FOR J=1 TO 10:LOCATE 11+J,40:PRINT MID$(DES$(I),(J-1)*25+1,25);:NEXT J
7020 LOCATE Y1,1
7030 RETURN
8000 REM /// READ IN DATA FILES
8010 '
8020 CLS
8030 PRINT:PRINT:PRINT"INSERT DISK WITH DUNGEON FILES TO BE EDITTED INTO DRIVE ";DR$
8040 PRINT:PRINT:PRINT"THEN HIT RETURN.";:GOSUB 38000
8050 '
8060 ' ON ERROR GOTO 8760
8061 OPEN "I",#1,DR$+"EAMON.NAM"
8062 INPUT #1,ADNAME$
8063 INPUT #1,A$
8064 CLOSE#1
8070 N$=DR$+"EAMON.ART"
8080 OPEN "I",#1,N$
8090 N$=DR$+"EAMON.MON"
8100 OPEN "I",#2,N$
8110 N$=DR$+"EAMON.ROM"
8120 OPEN "I",#3,N$
8130 '
8140 INPUT#1,NZ
8150 INPUT#2,NM
8160 INPUT#3,NR
8170 '
8180 NA=NZ-NM
8190 DIM AN$(NZ),AD(NZ,8),MN$(NM),MD(NM,12),MAP(NR,6)
8200 DIM RN$(NR),MD$(NM),DMD$(NM),AD$(NZ),EFF$(MEFF)
8210 '
8220 FOR I=1 TO NA
8230    INPUT#1,AN$(I)
8240    FOR J=1 TO 4
8250       INPUT#1,AD(I,J)
8260    NEXT J
8270    IF AD(I,2)<2 THEN 8310
8280    FOR J=5 TO 8
8290       INPUT#1,AD(I,J)
8300    NEXT J
8310 NEXT I
8320 '
8330 FOR I=1 TO NM
8340    INPUT#2,MN$(I)
8350    FOR J=1 TO 12
8360       INPUT#2,MD(I,J)
8370    NEXT J
8380 NEXT I
8390 '
8400 CLOSE#1:CLOSE#2
8410 N$=DR$+"ROOM.NAM"
8420 OPEN "R",#1,N$,32
8421 FIELD 1,32 AS NR1$
8430 '
8440 FOR I=1 TO NR
8441    GET#1,I
8442    IF LEFT$(NR1$,3)="   " THEN A$="" ELSE A$=NR1$
8450    RN$(I)=A$
8460    FOR J=1 TO 6
8470       INPUT#3,MAP(I,J)
8480    NEXT J
8490 NEXT I
8500 '
8510 CLOSE#1:CLOSE#3
8520 '
8530 N$=DR$+"EAMON.EFF"
8560 '
8570 OPEN "R",#1,N$,255
8580 FIELD 1,255 AS Z$
8585 IF NA=0 AND NM=0 THEN 8730
8590 FOR I=1 TO NA
8600    GET#1,I
8610    IF Z$=ZM$ THEN AD$(I)="" ELSE AD$(I)=FNX$(Z$)
8620 NEXT I
8621 '
8622 FOR I=1 TO NM
8623    GET#1,NA+I
8624    IF Z$=ZM$ THEN DMD$(I)="" ELSE  DMD$(I)=FNX$(Z$)
8626 NEXT I
8627 '
8630 FOR I=1 TO NM
8640    GET#1,NA+NM+I
8650    IF Z$=ZM$ THEN MD$(I)="" ELSE MD$(I)=FNX$(Z$)
8660 NEXT I
8670 '
8685 NE=0
8690 GET#1,NA+NM+NM+NE+1
8695 IF LEFT$(Z$,1)=CHR$(30) THEN 8730
8696    NE=NE+1
8700    IF Z$=ZM$ THEN EFF$(NE)="" ELSE EFF$(NE)=FNX$(Z$)
8710 GOTO 8690
8720 '
8730 CLOSE#1
8740 '
8750 RETURN
8760 CLS
8770 PRINT"ERROR TRYING TO OPEN FILE ";N$
8780 PRINT"MAKE SURE THIS IS A PROPERLY FORMATTED DUNGEON DISK"
8790 STOP
8800 NE=I-1
8810 RESUME 8730
10000 CLS
10005 N=250
10010 PRINT NE;" EFFECTS ON FILE"
10020 PRINT:PRINT
10030 PRINT"F1.  ADD EFFECT"
10040 PRINT"F2.  CHANGE EFFECT"
10050 PRINT"F3.  LIST EFFECTS"
10055 PRINT
10060 PRINT"F10. QUIT EFFECT EDITOR"
10070 PRINT:PRINT:PRINT"YOUR CHOICE ";:GOSUB 38000
10080 IF A$=K$(10) THEN RETURN
10082 '
10083 IF A$=K$(3) THEN 10300
10084 IF A$=K$(2) THEN 10200
10085 IF A$=K$(1) THEN 10100
10086 GOTO 10000
10090 '
10100 CLS
10105 PRINT"ADDING EFFECT #";NE+1
10110 PRINT:PRINT
10120 PRINT"ENTER EFFECT"
10130 PRINT:GOSUB 38000
10140 IF A$="" THEN 10000
10150 NE=NE+1:EFF$(NE)=A$
10160 GOTO 10100
10199 '
10200 CLS
10210 PRINT"CHANGE WHICH EFFECT ";:GOSUB 38000
10220 IF A$="" OR VAL(A$)=0 THEN 10000
10230 CLS
10235 A=VAL(A$):IF A<0 OR A>NE THEN 10200
10240 PRINT "EFFECT #";A;" READS...":PRINT
10250 PRINT EFF$(A)
10260 PRINT:PRINT
10270 PRINT"ENTER NEW EFFECT":PRINT
10280 GOSUB 38000
10290 EFF$(A)=A$:GOTO 10200
10299 '
10300 CLS
10305 PRINT"List effects to Printer or Screen ";:GOSUB 38000
10306 IF A$="p" THEN A$="P"
10307 IF A$="s" THEN A$="S"
10310 IF A$<>"P" AND A$<>"S" THEN 10300
10320 FOR I=1 TO NE
10330 IF A$="P" THEN LPRINT I;". ";EFF$(I) ELSE PRINT I;". ";EFF$(I)
10340 NEXT I
10350 PRINT:PRINT:PRINT"HIT RETURN TO CONTINUE":GOSUB 38000:GOTO 10000
12000 REM // SAVE DATA
12010 '
12020 CLS
12040 PRINT:PRINT:PRINT"READY TO SAVE DATA TO DRIVE ";DR$;",  HIT RETURN.";:GOSUB 38000
12050 '
12060 ' ON ERROR GOTO 12760
12070 N$=DR$+"EAMON.ART"
12080 OPEN "O",#1,N$
12090 N$=DR$+"EAMON.MON"
12100 OPEN "O",#2,N$
12110 N$=DR$+"EAMON.ROM"
12120 OPEN "O",#3,N$
12130 '
12140 PRINT#1,NA+NM
12150 PRINT#2,NM
12160 PRINT#3,NR
12170 '
12210 '
12211 ' /// PRINT OUT ARTIFACT FILE
12212 '
12220 FOR I=1 TO NA
12230    PRINT#1,AN$(I);
12235    A$=""
12240    FOR J=1 TO 4
12250       A$=A$+","+STR$(AD(I,J))
12260    NEXT J
12270    IF AD(I,2)<2 THEN 12301
12280    FOR J=5 TO 8
12290       A$=A$+","+STR$(AD(I,J))
12300    NEXT J
12301    PRINT#1,A$
12302 NEXT I
12321 '
12322 ' /// PRINT OUT DEAD & MONSTERS
12323 '
12330 FOR I=1 TO NM
12340    A$=MN$(I)
12341    IF MN$(I)="" THEN A1$="" ELSE A1$="DEAD "
12344    PRINT#1,A1$;MN$(I);",0,0,";STR$(MD(I,6));",0"
12349    B9$=""
12350    FOR J=1 TO 12
12360       B9$=B9$+","+STR$(MD(I,J))
12370    NEXT J
12375    PRINT#2,MN$(I);B9$
12376 NEXT I
12377 '
12400 CLOSE#1:CLOSE#2
12401 '
12402 '
12403 ' PRINT OUT ROOM NAME & MAP
12404 '
12410 N$=DR$+"ROOM.NAM"
12420 OPEN "R",#1,N$,32
12421 FIELD 1,32 AS R13$
12430 '
12440 FOR I=1 TO NR
12441    LSET R13$=RN$(I)
12450    PUT#1,I
12455    A$=STR$(MAP(I,1))
12460    FOR J=2 TO 6
12470       A$=A$+","+STR$(MAP(I,J))
12480    NEXT J
12485    PRINT#3,A$
12486 NEXT I
12487 '
12500 '
12510 CLOSE#1:CLOSE#3
12520 '
12521 '
12522 ' /// PRINT OUT ARTIFACT DESCRIPTIONS, DEAD MONSTER DESCRIPTIONS
12523 '     MONSTER DESCRIPTIONS, AND EFFECTS
12524 '
12530 N$=DR$+"EAMON.EFF"
12540 OPEN "O",#1,N$
12550 CLOSE#1
12551 KILL N$
12560 '
12570 OPEN "R",#1,N$,255
12580 FIELD 1,255 AS Z$
12581 '
12582 ' /// PRINT OUT ARTIFACT DESC
12583 '
12590 FOR I=1 TO NA
12600    RSET Z$="."+AD$(I)
12610    PUT#1,I
12615 NEXT I
12616 '
12627 ' /// PRINT OUT DEAD MONSTER DESC.
12628 '
12630 FOR I=1 TO NM
12631    RSET Z$="."+DMD$(I)
12632    PUT#1,NA+I
12634 NEXT I
12653 '
12660 ' /// PRINT OUT MONSTER DESC.
12661 FOR I=1 TO NM
12662    RSET Z$="."+MD$(I)
12663    PUT#1,NA+NM+I
12664 NEXT I
12670 '
12671 '
12672 ' /// PRINT OUT EFFECTS
12680 FOR I=1 TO 100
12685    IF EFF$(I)="" THEN 12712
12690    RSET Z$="."+EFF$(I)
12700    PUT#1,NA+NM+NM+I
12710 NEXT I
12711 '
12712 LSET Z$=CHR$(30)
12713 PUT#1,NA+NM+NM+I
12720 '
12730 CLOSE#1
12740 '
12750 RETURN
12760 CLS
12770 PRINT"ERROR TRYING TO OPEN FILE ";N$
12780 PRINT"MAKE SURE THIS IS A PROPERLY FORMATTED DUNGEON DISK"
12790 CLOSE#1:CLOSE#2:CLOSE#3:RESUME 12750
31000 REM UPPER CASE
31010 A1$=""
31020 FOR I=1 TO LEN(A$)
31030 A2$=MID$(A$,I,1)
31040 IF A2$>="a" AND A2$<="z" THEN A2$=CHR$(ASC(A2$)-32)
31050 A1$=A1$+A2$
31060 NEXT I
31070 A$=A1$
31080 RETURN
31090 '
38000 REM GET A$
38010 A$=INKEY$
38020 A$=""
38030 LINE INPUT A$
38040 IF LEN(A$)>N THEN A$=LEFT$(A$,N)
38050 RETURN
38060 '
39000 REM GET INTEGER A
39010 A$=INKEY$
39020 INPUT A
39030 RETURN
F LEN(A$)>N THEN A$=L