Source:Dungeon Aid
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 Dungeon Aid. |
---|---|
Source | |
Date |
19 February 1984 |
Author | |
License |
The use of this item is permitted on the grounds that it's free or in the public domain. |
1 REM DUNGEON AID PROGRAM
2 REM BY JOHN NELSON
3 REM
4 REM THIS PROGRAM LISTS ANY
5 REM DATA FIELDS FOR ROOMS,
6 REM ARTIFACTS OR MONSTERS
7 REM
8 PRINT CHR$ (4);"MAXFILES 4"
9 REM 2-19-84
10 D$ = CHR$ (4): TEXT :UP$ = CHR$ (10):DN$ = CHR$ (11): IF PEEK ( - 637) < > 255 THEN UP$ = CHR$ (8):DN$ = CHR$ (21)
12 DIM MD%(12),MS%(12)
15 GOSUB 8000
18 ONERR GOTO 20
20 HOME : VTAB 6: PRINT " INSERT EAMON ADVENTURE DISKETTE": PRINT : PRINT SPC( 10);"AND PRESS ANY KEY ...";: GET A$: PRINT
30 PRINT D$"OPEN EAMON.DESC,L256": PRINT D$"READ EAMON.DESC,R0": INPUT NR,NA,NE,NM: PRINT D$
35 POKE 216,0
40 HOME : PRINT SPC( 11);"EAMON DUNGEON AID": PRINT SPC( 12);"BY JOHN NELSON": VTAB 6: HTAB 15: PRINT "PRINT "; MID$ ("OFFON",PRT * 3 + 1,3 - PRT): VTAB 8
45 PRINT "ROOMS:";NR;" ARTIF.:";NA;" EFF:";NE;" MONST:";NM
50 VTAB 10: CALL - 958: PRINT "SELECT ONE OF THE FOLLOWING:": PRINT
60 PRINT " 1. LIST MONSTERS": PRINT : PRINT " 2. LIST ARTIFACTS": PRINT : PRINT " 3. LIST ROOMS": PRINT : PRINT " 4. TOGGLE PRINTER": PRINT
70 PRINT " 5. QUIT"
195 PRINT
200 PRINT "INPUT YOUR CHOICE (1-5):";
210 GET A$: IF VAL (A$) > 5 OR VAL (A$) < 1 THEN 210
15 PRINT A$
220 ON VAL (A$) GOTO 1000,2000,3000,4000,5000
1000 REM /// LIST MONSTER
1005 FOR M = 1 TO 12:MS%(M) = 0: NEXT
1010 VTAB 10: CALL - 958: PRINT "SELECT DATA FIELD TO LIST:"
1020 FOR M = 1 TO 12: PRINT SPC( 7 - LEN ( STR$ (M)));M;". ";ML$(M): NEXT
1030 VTAB 23: HTAB 1: INPUT " INPUT 1-12 OR <RETURN> ";A$: IF A$ = "" THEN A$ = "13"
1035 M = VAL (A$): IF VAL (A$) < 1 OR VAL (A$) > 13 THEN VTAB PEEK (37): GOTO 1030
1040 IF M < 13 THEN VTAB 10 + M: HTAB 10: INVERSE : PRINT ML$(M): NORMAL :MS%(M) = 1: GOTO 1030
1090 REM /// LIST MONSTER
1095 IF PRT THEN PRINT D$"PR#1"
1100 FS = 0: FOR X = 1 TO 12:FS = FS + MS%(X): NEXT : PRINT D$"OPEN EAMON.MONSTERS,L128"
1110 LP = 0: HOME : FOR M = 1 TO NM: PRINT D$"READ EAMON.MONSTERS,R";M: INPUT MN$: FOR M2 = 1 TO 12: INPUT MD%(M2): NEXT M2: PRINT D$
1120 PRINT M;". ";MN$:LP = LP + 1
1130 FOR M2 = 1 TO 12: IF MS%(M2) THEN PRINT " ";ML$(M2);":"; TAB( 20 - LEN ( STR$ (MD%(M2))));MD%(M2):LP = LP + 1
1140 NEXT M2: PRINT :LP = LP + 1: IF LP + FS > 22 AND NOT PRT THEN PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT :LP = 0: HOME
1142 NEXT
1145 PRINT D$"CLOSE"
1148 PRINT D$"PR#0"
1150 PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT : GOTO 40
2000 REM /// LIST ARTIFACTS
2005 FOR A = 1 TO 8:AD%(A) = 0:AS%(A) = 0: NEXT
2010 VTAB 10: CALL - 958: PRINT "SELECT DATA FIELD TO LIST:"
2020 FOR A = 1 TO 8: PRINT SPC( 7 - LEN ( STR$ (A)));A;". ";AL$(A): NEXT
2030 VTAB 19: HTAB 1: INPUT " INPUT 1-8 OR <RETURN> ";A$: IF A$ = "" THEN A$ = "9"
2035 A = VAL (A$): IF A < 1 OR A > 9 THEN VTAB PEEK (37): GOTO 2030
2040 IF A < 9 THEN VTAB 10 + A: HTAB 10: INVERSE :AS%(A) = 1: PRINT AL$(A): NORMAL : GOTO 2030
2080 REM /// READY TO LIST ARTIF
2082 IF PRT THEN PRINT D$"PR#1"
2085 FS = 0: FOR X = 1 TO 8:FS = FS + AS%(X): NEXT : PRINT D$"OPEN EAMON.ARTIFACTS,L128"
2090 LP = 0: HOME : FOR A = 1 TO NA: PRINT D$"READ EAMON.ARTIFACTS,R";A: INPUT AN$: FOR A2 = 1 TO 4: INPUT AD%(A2): NEXT : IF AD%(2) > 1 THEN FOR A2 = 5 TO 8: INPUT AD%(A2): NEXT
2095 PRINT D$
2100 IF LP + FS > 18 AND NOT PRT THEN PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT : HOME :LP = 0
2110 PRINT A;". ";AN$:LP = LP + 1: FOR A2 = 1 TO 4: GOSUB 2500: NEXT
2120 IF AD%(2) > 1 THEN FOR A2 = 5 TO 8: GOSUB 2500: NEXT A2
2130 PRINT : NEXT A: PRINT : PRINT : GOTO 1145
2500 REM /// CHECK AND PRINT
2510 IF NOT AS%(A2) THEN RETURN
2520 PRINT " ";AL$(A2);":"; TAB( 20 - LEN ( STR$ (AD%(A2))));AD%(A2)
2530 LP = LP + 1
2550 RETURN
3000 REM /// LIST ROOMS
3005 PRINT : IF PRT THEN PRINT D$;"PR#1"
3010 PRINT D$"OPEN EAMON.ROOM NAMES,L64": PRINT D$"OPEN EAMON.ROOMS,L64"
3020 LP = 0: HOME : FOR R = 1 TO NR
3030 PRINT D$"READ EAMON.ROOM NAMES,R";R: INPUT RN$: PRINT D$"READ EAMON.ROOMS,R";R: FOR D = 1 TO 6: INPUT RD%(D): NEXT
3040 PRINT D$
3050 PRINT : PRINT "ROOM #";R;" ";RN$:LP = LP + 1
3060 FOR X = 1 TO 6: IF RD%(X) < > 0 THEN PRINT " ";RL$(X);":"; TAB( 20 - LEN ( STR$ (RD%(X))));RD%(X):LP = LP + 1
3070 NEXT : IF LP > 17 AND NOT PRT THEN PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT :LP = 0: HOME
3072 NEXT
3075 PRINT D$"PR#0"
3080 PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT : PRINT D$"CLOSE": GOTO 40
4000 REM === TOGGLE PRT ===
4010 PRT = NOT PRT
4020 HTAB 21: VTAB 6: CALL - 868: PRINT MID$ ("OFFON",PRT * 3 + 1,3 - PRT): VTAB 22: HTAB 25: CALL - 868
4090 GOTO 210
5000 REM /// QUIT
5010 PRINT D$"CLOSE": END
8000 REM /// DATA LABELS
8010 FOR X = 1 TO 6: READ RL$(X): NEXT
8020 DIM ML$(12): FOR X = 1 TO 12: READ ML$(X): NEXT
8030 FOR X = 1 TO 8: READ AL$(X): NEXT
8040 RETURN
8050 DATA NORTH,SOUTH,EAST,WEST,UP,DOWN
8060 DATA HD,AG,FRIEND,COUR,ROOM,WEIGHT,DEF. ODDS,ARMOUR,WEAPON#,OFF.ODDS,W DICE,W SIDES
8070 DATA VALUE,TYPE,WEIGHT,ROOM,W.COMPLEX,W.TYPE,W.DICE,W.SIDES