Source:File Dump KQ

From Eamon Wiki
Jump to navigation Jump to search
This page is a verbatim reproduction of original source material and should not be edited except for maintenance.
Description

The Applesoft BASIC source code of the Eamon utility program File Dump KQ.

Source

Eamon Deluxe Conversion Tools

Date

c. 2000

Author

Frank Black

License

The use of this item is permitted on the grounds that it's free or in the public domain.

1  REM 

KNIGHTQUEST --> EAMON DELUXE
DATABASE DUMP
BY FRANK KUNZE

10  TEXT : HOME : PRINT "INSERT KNIGHTQUEST DISK IN DRIVE 1": GET A$: PRINT : HOME 
20 D$ =  CHR$ (4)
30  PRINT D$"OPEN KQ.DESC,D1": PRINT D$"READ KQ.DESC": INPUT NR,NA,NE,NM: PRINT D$"CLOSE": DIM R$(NR),R%(NR,11),A$(NA),A%(NA,8),M$(NM),M%(NM,12)
35  DIM A1%(NA,8),M1%(NM,12)
40  PRINT D$"OPEN KQ.NAME": PRINT D$"READ KQ.NAME": INPUT N$,ND
70  POKE 216,0: PRINT D$"CLOSE"
90  VTAB 7: PRINT "DUMPING:  "N$: PRINT 
100  PRINT "ADD DIRECTIONS TO ROOM NAMES? (Y/N):";: GET A$: PRINT A$
110  IF A$ = "Y" THEN ADD = 1
120  PRINT "ADD 'YOU ARE ' TO ROOM NAMES? (Y/N):";: GET A$: PRINT A$
130  IF A$ = "Y" THEN AY = 1
135  PRINT "ADD PERIODS TO END OF ROOM NAMES?(Y/N):";: GET A$: PRINT A$: IF A$ = "Y" THEN P1 = 1
140  GOSUB 1000: GOSUB 500: GOSUB 5000: END 
500  PRINT D$"OPEN KQ.DESC,L256": RETURN 
1000  REM 

LOAD ROOMS

1010  HOME : FOR R = 1 TO NR:R%(R,11) = 1: NEXT 
1020  PRINT D$"OPEN KQ.ROOMS,L64"
1030  FOR R = 1 TO NR: VTAB 9: PRINT "READING ROOM# "R"/"NR
1040  PRINT D$"READ KQ.ROOMS,R"R: INPUT R$(R): IF AY = 1 THEN R$(R) = "YOU ARE " + R$(R)
1045  IF P1 = 1 THEN R$(R) = R$(R) + "."
1050  FOR X = 1 TO ND: INPUT R%(R,X): NEXT : INPUT R%(R,11)
1054  IF R%(R,11) < 3 THEN R%(R,11) = 0
1055  IF R%(R,11) > 2 THEN R%(R,11) = 1
1060  IF ADD = 1 THEN  GOSUB 21000
1070  NEXT : PRINT D$"CLOSE"
2000  REM 

ARTIFACTS

2010  PRINT D$"OPEN KQ.ART,L128"
2020  FOR A = 1 TO NA: VTAB 10: PRINT "READING ART# "A"/"NA
2030  PRINT D$"READ KQ.ART,R"A: INPUT A$(A)
2040  FOR X = 0 TO 8: INPUT A1%(A,X): NEXT : GOSUB 20500
2050  NEXT : PRINT D$"CLOSE"
3000  REM 

MONSTERS

3010  PRINT D$"OPEN KQ.MON,L128"
3020  FOR M = 1 TO NM: VTAB 11: PRINT "READING MON# "M"/"NM
3030  PRINT D$"READ KQ.MON,R"M: INPUT M$(M): FOR X = 0 TO 12: INPUT M1%(M,X): NEXT : GOSUB 20800
3040  NEXT : PRINT D$"CLOSE": RETURN 
5000  REM 

DUMP TO PRINTER/FILE

5010  GOSUB 20000
5015  HOME : VTAB 5: PRINT "DUMPING FILE............"
5020  PRINT D$"PR#1": PRINT N$: PRINT NR;",";NA;",";NE","NM: PRINT ND: PRINT 6: PRINT 
5040  IF NE > 0 THEN  FOR A = 1 TO NE: PRINT D$"READ KQ.DESC,R"A + 200: INPUT A$: PRINT D$: PRINT : PRINT "E"A: PRINT A$: NEXT 
5050  FOR M = 1 TO NM: PRINT D$"READ KQ.DESC,R"M + 300: INPUT A$: PRINT D$: PRINT : PRINT "M"M
5060  PRINT M$(M): FOR X = 1 TO 11: PRINT M%(M,X)",";: NEXT : PRINT M%(M,12): PRINT A$: NEXT 
5070  FOR A = 1 TO NA: PRINT D$"READ KQ.DESC,R"A + 100: INPUT A$: PRINT D$: PRINT : PRINT "A"A
5080  PRINT A$(A): FOR X = 1 TO 7: PRINT A%(A,X)",";: NEXT : PRINT A%(A,8): PRINT A$: NEXT 
5090  FOR R = 1 TO NR: PRINT D$"READ KQ.DESC,R"R: INPUT A$: PRINT D$: PRINT : PRINT "R"R
5100  PRINT R$(R): FOR X = 1 TO ND: PRINT R%(R,X)",";: NEXT : PRINT R%(R,11): PRINT A$: NEXT 
5110  PRINT D$"PR#0": RETURN 
20000  REM 

ADJUST V6.X DATA

20010  FOR R = 1 TO NR: FOR R2 = 1 TO ND: IF R%(R,R2) > 100 AND R%(R,R2) < 200 THEN R%(R,R2) = R%(R,R2) + 900
20020  NEXT : NEXT 
20030  FOR A = 1 TO NA: IF A%(A,4) > 100 AND A%(A,4) < 200 THEN A%(A,4) = A%(A,4) + 900
20040  IF A%(A,4) > 200 AND A%(A,4) < 300 THEN A%(A,4) = A%(A,4) + 1800
20050  IF A%(A,4) > 300 AND A%(A,4) < 400 THEN A%(A,4) = A%(A,4) + 1700
20070  IF A%(A,2) = 6 THEN A%(A,5) = A%(A,6):A%(A,6) = A%(A,7):A%(A,7) = 1:A%(A,8) = 0
20080  NEXT : RETURN 
20500  REM 

CONVT KQ --> EAMON 6

20504  REM ARTIFACT CONVT
20505  IF A1%(A,1) > 100 THEN A1%(A,1) = A1%(A,1) - 100
20510 A%(A,1) = A1%(A,3):A%(A,2) = A1%(A,1):A%(A,3) = A1%(A,2):A%(A,4) = A1%(A,0)
20515  IF A%(A,4) <  - 100 THEN A%(A,4) = A%(A,4) + 99: REM  MAKE 'HIDDEN ON MONSTER' INTO 'CARRIED BY MONSTER'   
20520 A%(A,2) = 1: IF A1%(A,1) = 2 OR A1%(A,1) = 20 THEN A%(A,2) = 2
20530  IF A1%(A,1) = 17 THEN A%(A,2) = 4
20540  IF A1%(A,1) = 5 THEN A%(A,2) = 5
20550  IF A1%(A,1) = 6 OR A1%(A,1) = 22 OR A1%(A,1) = 20 THEN A%(A,2) = 6
20560  IF A1%(A,1) = 8 THEN A%(A,2) = 7
20570  IF A1%(A,1) = 11 THEN A%(A,2) = 8
20580  IF A%(A,2) = 2 THEN A%(A,5) = A1%(A,6):A%(A,6) = A1%(A,5):A%(A,7) = A1%(A,7):A%(A,8) = A1%(A,8)
20590  IF A%(A,2) = 4 THEN A%(A,5) = A1%(A,5)
20600  IF A%(A,2) = 5 THEN A%(A,5) = A1%(A,5)
20610  IF A%(A,2) = 6 THEN A%(A,6) = A1%(A,7)
20620  IF A%(A,2) = 7 THEN A%(A,5) = A1%(A,6):A%(A,6) = A1%(A,7)
20630  IF A%(A,2) = 8 THEN A%(A,5) = A1%(A,7)
20790  RETURN 
20800  REM MONSTER CONVT
20810 M%(M,1) = M1%(M,1):M%(M,2) = M1%(M,2):M%(M,3) = M1%(M,3):M%(M,4) = M1%(M,5)
20820 M%(M,5) = M1%(M,0):M%(M,7) = M1%(M,7):M%(M,8) = M1%(M,8):M%(M,9) = M1%(M,9):M%(M,10) = M1%(M,10):M%(M,11) = M1%(M,11):M%(M,12) = M1%(M,12)
20890  RETURN 
21000  REM 

ADD DIR. TO R. NAMES

21010 SL = 0:PT = 0
21020  FOR X = 1 TO ND: IF R%(R,X) > 0 AND R%(R,X) <  = NR AND PT = 0 THEN PT = 1:R$(R) = R$(R) + "  ("
21030  IF R%(R,X) > 0 AND R%(R,X) <  = NR AND SL = 1 THEN R$(R) = R$(R) + "/"
21040  IF R%(R,X) > 0 AND R%(R,X) <  = NR AND X < 7 THEN R$(R) = R$(R) +  MID$ ("NSEWUD",X,1):SL = 1
21050  IF R%(R,X) > 0 AND R%(R,X) <  = NR AND X > 6 THEN R$(R) = R$(R) +  MID$ ("NENWSESW",(X - 7) * 2 + 1,2):SL = 1
21060  NEXT : IF PT = 1 THEN R$(R) = R$(R) + ")"
21070  RETURN