100 DEFINT A-Z
110 DEF FNX$(X$)=MID$(X$,INSTR(X$,".")+1)
120 ZM$=SPACE$(254)+"."
130 FOR I=1 TO 10:K$(I)="^F"+RIGHT$(STR$(I),1)
140 KEY I,K$(I)+CHR$(13)
150 NEXT I
160 CLS
170 GOSUB 780
180 '
190 CLS
200 PRINT:PRINT:PRINT"PLEASE ENTER THE DISK WITH DUNGEON FILES ON IT AND HIT RETURN ";:INPUT A$
210 '
220 OPEN "I",#1,"EAMON.ART"
230 INPUT#1,DNZ
240 CLOSE#1
250 '
260 OPEN "I",#1,"EAMON.MON"
270 INPUT#1,DNM
280 CLOSE#1
290 DNA=DNZ-DNM
300 '
310 DIM A(DNA),M(DNM)
320 '
330 '
340 CLS
350 PRINT:PRINT
360 PRINT "MONSTER RECORDS   = ";DNM
370 PRINT "ARTIFACTS RECORDS = ";DNA
380 PRINT:PRINT:PRINT FRE(0);" BYTES OPEN"
390 PRINT:PRINT
400 PRINT"F1. CHOOSE MONSTER DATA"
410 PRINT"F2. CHOOSE ARTIFACT DATA"
420 PRINT
430 PRINT"F3. PRINT DATA"
440 PRINT
450 PRINT"F4. SAVE DATA & QUIT"
460 PRINT"F5. QUIT & DON'T SAVE DATA"
470 PRINT:PRINT
480 PRINT"YOUR CHOICE ";:INPUT A$
490 IF A$=K$(5) THEN CLS:END
500 IF A$=K$(4) THEN GOSUB 1510:CLS:END
510 IF A$=K$(3) THEN GOSUB 520
511 IF A$=K$(2) THEN GOSUB 640
512 IF A$=K$(1) THEN GOSUB 710
515 GOTO 340
520 INPUT"SET PRINTER & HIT RETURN FOR MONSTER/ARTIFACT LIST";A$
521 '
522 LPRINT NA;" ARTIFACTS ON FILE"
525 FOR I=1 TO NA/2
526    LPRINT I,AN$(I);
527    IF I=NA THEN 530
528    LPRINT TAB(45);INT(I+NA/2),AN$(I+INT(NA/2))
530 NEXT I
535 '
540 LPRINT CHR$(12);
541 '
545 LPRINT NM;" MONSTERS ON FILE"
549 FOR I=1 TO NM/2
550    LPRINT I,MN$(I);
551    IF I=NM THEN 560
552    LPRINT TAB(45);INT(I+NM/2),MN$(I+INT(NM/2))
560 NEXT I
570 LPRINT CHR$(12);
580 RETURN
630 '
640 REM GET ARTIFACT DATA
650 FOR I=1 TO DNA
655 IF A(I)=0 THEN GOTO 660
656 PRINT"ARTIFACT #";I;" IS NOW ";A(I);"  (";AN$(A(I));")":PRINT
660 PRINT"ENTER CODE # FOR ARTIFACT (1 -";NA;") #";I;
670 INPUT A$:A=VAL(A$):IF A$="" THEN 690
675 IF A$="Q" OR A$="q" THEN 700
680 IF A>0 AND A<=NA THEN A(I)=A ELSE 660
690 NEXT I
700 RETURN
710 REM GET MONSTER DATA
720 FOR I=1 TO DNM
725 IF M(I)=0 THEN 730
726 PRINT"MONSTER  #";I;" IS NOW ";M(I);"  (";MN$(M(I));")":PRINT
730 PRINT"ENTER CODE # FOR ARTIFACT (1 -";NM;") #";I;
740 INPUT A$:A=VAL(A$):IF A$="" THEN 760
745 IF A$="Q" OR A$="q" THEN 770
750 IF A>0 AND A<=NM THEN M(I)=A ELSE 730
760 NEXT I
770 RETURN
780 REM /// READ IN DATA FILES
790 '
800 '
810 PRINT:PRINT:PRINT:PRINT"   PLEASE WAIT WHILE I LOAD THE DATA."
820 ' ON ERROR GOTO 8760
830 '
840 N$=DR$+"DAMON.ART"
850 OPEN "I",#1,N$
860 N$=DR$+"DAMON.MON"
870 OPEN "I",#2,N$
880 '
890 INPUT#1,NZ
900 INPUT#2,NM
910 '
920 NA=NZ-NM
930 '
940 DIM AN$(NZ),AD(NZ,8),MN$(NM),MD(NM,12)
950 DIM MD$(NM),DMD$(NM),AD$(NZ)
960 '
970 PRINT:PRINT NA;" ARTIFACTS ON FILE."
980 '
990 FOR I=1 TO NA
1000    INPUT#1,AN$(I)
1010    FOR J=1 TO 4
1020       INPUT#1,AD(I,J)
1030    NEXT J
1040    IF AD(I,2)<2 THEN 1080
1050    FOR J=5 TO 8
1060       INPUT#1,AD(I,J)
1070    NEXT J
1080 NEXT I
1090 '
1100 PRINT NM;" MONSTERS ON FILE."
1110 '
1120 FOR I=1 TO NM
1130    INPUT#2,MN$(I)
1140    FOR J=1 TO 12
1150       INPUT#2,MD(I,J)
1160    NEXT J
1170 NEXT I
1180 '
1190 CLOSE#1:CLOSE#2
1200 '
1210 N$=DR$+"DAMON.EFF"
1220 '
1230 OPEN "R",#1,N$,255
1240 FIELD 1,255 AS Z$
1250 IF NA=0 AND NM=0 THEN 1410
1260 FOR I=1 TO NA
1270    GET#1,I
1280    IF Z$=ZM$ THEN AD$(I)="" ELSE AD$(I)=FNX$(Z$)
1290 NEXT I
1300 '
1310 FOR I=1 TO NM
1320    GET#1,NA+I
1330    IF Z$=ZM$ THEN DMD$(I)="" ELSE  DMD$(I)=FNX$(Z$)
1340 NEXT I
1350 '
1360 FOR I=1 TO NM
1370    GET#1,NA+NM+I
1380    IF Z$=ZM$ THEN MD$(I)="" ELSE MD$(I)=FNX$(Z$)
1390 NEXT I
1400 '
1410 CLOSE#1
1420 '
1430 RETURN
1440 CLS
1450 PRINT"ERROR TRYING TO OPEN FILE ";N$
1460 PRINT"MAKE SURE THIS IS A PROPERLY FORMATTED DUNGEON DISK"
1470 STOP
1480 NE=I-1
1490 RESUME 1410
1500 STOP
1510 REM // SAVE DATA
1520 '
1530 CLS
1540 PRINT:PRINT:PRINT"READY TO SAVE DATA TO DRIVE ";DR$;",  HIT RETURN.";:INPUT A$
1550 '
1560 ' ON ERROR GOTO 12760
1570 N$=DR$+"EAMON.ART"
1580 OPEN "O",#1,N$
1590 N$=DR$+"EAMON.MON"
1600 OPEN "O",#2,N$
1610 '
1620 PRINT#1,DNA+DNM
1630 PRINT#2,DNM
1640 '
1650 '
1660 ' /// PRINT OUT ARTIFACT FILE
1670 '
1680 FOR I=1 TO DNA
1690    PRINT#1,AN$(A(I));
1700    A$=""
1710    FOR J=1 TO 4
1720       A$=A$+","+STR$(AD(A(I),J))
1730    NEXT J
1740    IF AD(I,2)<2 THEN 1780
1750    FOR J=5 TO 8
1760       A$=A$+","+STR$(AD(A(I),J))
1770    NEXT J
1780    PRINT#1,A$
1790 NEXT I
1800 '
1810 ' /// PRINT OUT DEAD & MONSTERS
1820 '
1830 FOR I=1 TO DNM
1840    A$=MN$(M(I))
1850    IF MN$(M(I))="" THEN A1$="" ELSE A1$="DEAD "
1860    PRINT#1,A1$;MN$(M(I));",0,0,";STR$(MD(M(I),6));",0"
1870    B9$=""
1880    FOR J=1 TO 12
1890       B9$=B9$+","+STR$(MD(M(I),J))
1900    NEXT J
1910    PRINT#2,MN$(M(I));B9$
1920 NEXT I
1930 '
1940 CLOSE#1:CLOSE#2
1950 '
1960 '
1970 '
1980 '
1990 ' /// PRINT OUT ARTIFACT DESCRIPTIONS, DEAD MONSTER DESCRIPTIONS
2000 '     MONSTER DESCRIPTIONS, AND NO EFFECTS
2010 '
2020 N$=DR$+"EAMON.EFF"
2030 OPEN "O",#1,N$
2040 CLOSE#1
2050 KILL N$
2060 '
2070 OPEN "R",#1,N$,255
2080 FIELD 1,255 AS Z$
2090 '
2100 ' /// PRINT OUT ARTIFACT DESC
2110 '
2120 FOR I=1 TO DNA
2130    RSET Z$="."+AD$(A(I))
2140    PUT#1,I
2150 NEXT I
2160 '
2170 ' /// PRINT OUT DEAD MONSTER DESC.
2180 '
2190 FOR I=1 TO DNM
2200    RSET Z$="."+DMD$(M(I))
2210    PUT#1,DNA+I
2220 NEXT I
2230 '
2240 ' /// PRINT OUT MONSTER DESC.
2250 FOR I=1 TO DNM
2260    RSET Z$="."+MD$(M(I))
2270    PUT#1,DNA+DNM+I
2280 NEXT I
2290 '
2295 LSET Z$=CHR$(30):PUT#1,DNA+DNM+DNM+1
2300 '
2310 '
2320 CLOSE#1
2330 '
2340 RETURN
2350 CLS
2360 PRINT"ERROR TRYING TO OPEN FILE ";N$
2370 PRINT"MAKE SURE THIS IS A PROPERLY FORMATTED DUNGEON DISK"
2380 CLOSE#1:CLOSE#2:CLOSE#3:RESUME 2340
 TO OPEN FILE ";N$
2370 PRINT"MAKE SURE THIS IS A PROPERLY FORMATTED DUNGEON DISK"
2380 CLOSE#