Source:Flex Dungeon List

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 Flex Dungeon List, version 2.1

Source

EAG Utilities Disk

Date

6 November 1983

Author

John Nelson, Tom Zuchowski

License

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

1  REM     LIST DUNGEON
2  REM     VERSION 2.1
3  REM     BY JOHN NELSON
4  REM 
5  REM     LINES 97,120,150
6  REM     BY T. ZUCHOWSKI 
7  REM        11/6/83
8  REM 
9  TEXT 
10  PRINT  CHR$ (4);"MAXFILES 5"
20 D$ =  CHR$ (4): HOME : VTAB 5: PRINT "LISTING A DUNGEON DESIGN FOR EAMON": PRINT : PRINT : PRINT "INSERT DISKETTE WITH DUNGEON, THEN PRESS": PRINT "      ANY KEY    ";: POKE  - 16368,0: GET A$: PRINT 
25  ONERR  GOTO 200
30  PRINT : PRINT D$;"OPEN EAMON.NAME": PRINT D$;"READ EAMON.NAME": INPUT DUNGN$: INPUT DR$: PRINT D$;"CLOSE"
35  POKE 216,0
40 ND =  VAL (DR$)
50  PRINT D$"OPEN EAMON.DESC,L256": PRINT D$;"READ EAMON.DESC,R0": INPUT NR,NA,NE,NM: PRINT D$
60  DIM M$(12),M%(12): FOR M = 1 TO 12: READ M$(M): NEXT 
65  DATA   HARD,AGIL,FRIEND,COUR,ROOM,WGHT,D.ODDS,ARMOUR,WEAPON#,O.ODDS,W.DICE,W.SIDES
70  DIM R$(NR),AN$(NA): FOR A = 1 TO 8: READ A$(A): NEXT 
75  FOR D = 1 TO 10: READ DD$(D): NEXT 
80  DATA  VALUE,TYPE,WEIGHT,ROOM,W.COMPLEX,W.TYPE,W.DICE,W.SIDES
85  DATA    NORTH    ,SOUTH    ,EAST     ,WEST     ,UP       ,DOWN     ,NORTHEAST,NORTHWEST,SOUTHEAST,SOUTHWEST
88  PRINT D$"OPEN EAMON.ROOM NAMES,L64"
90  FOR R = 1 TO NR: PRINT D$;"READ EAMON.ROOM NAMES,R";R: INPUT R$(R): NEXT 
92  PRINT D$"CLOSE EAMON.ROOM NAMES"
95  PRINT D$"OPEN EAMON.ARTIFACTS,L128": FOR R = 1 TO NA: PRINT D$"READ EAMON.ARTIFACTS,R";R: INPUT AN$(R): NEXT : PRINT D$"CLOSE EAMON.ARTIFACTS": PRINT D$
97  GOTO 130
100  REM  /// MAIN ROUTINE
120  PRINT : PRINT "(HIT ANY KEY TO RETURN TO MENU)";: GET AN$
130  HOME : PRINT  SPC( 12);"EAMON DUNGEON LIST": PRINT  SPC( 11);"BY JOHN NELSON": VTAB 8: PRINT "SELECT ACTION DESIRED:": PRINT "  1. SET UP PRINTER": PRINT "  2. LIST ROOMS": PRINT "  3. LIST ARTIFACTS": PRINT "  4. LIST EFFECTS"
140  PRINT "  5. LIST MONSTERS": PRINT "  6. TOGGLE PRINTER (NOW "; MID$ ("OFFON ",SW * 3 + 1,3);")": PRINT "  7. QUIT": INPUT "INPUT YOUR CHOICE (1-6):";CH$
150 CH =  VAL (CH$): ON CH GOTO 1000,2000,3000,4000,5000,6000,7000
160  GOTO 130
200 ND = 6: POKE 216,0: GOTO 50
1000  REM   /// SET UP PRINTER
1010  INPUT "WHAT SLOT IS PRINTER IN?";PS: IF PS < 1 OR PS > 7 THEN 1010
1020  IF PS <  >  INT (PS) THEN 1010
1030  GOTO 130
2000  REM   /// LIST ROOMS
2010  INPUT "BEGINNING WITH #(1): ";BEG$
2020  PRINT "ENDING WITH #(";NR;"): ";: INPUT EN$
2030  IF  VAL (BEG$) > NR OR  VAL (BEG$) < 1 THEN BEG$ = "1"
2040  IF  VAL (EN$) > NR OR  VAL (EN$) <  VAL (BEG$) THEN EN$ =  STR$ (NR)
2050 BEG =  VAL (BEG$):EN =  VAL (EN$)
2060  PRINT D$"OPEN EAMON.ROOMS,L64"
2080  IF SW THEN  PRINT D$"PR#";PS
2090  FOR R = BEG TO EN: GOSUB 2100: NEXT 
2095  PRINT D$"CLOSE EAMON.ROOMS": PRINT D$: PRINT D$"PR#0": GOTO 100
2100  PRINT "ROOM # ";R;" [";R$(R);"]": PRINT " ": PRINT "DESC:": PRINT D$;"READ EAMON.DESC,R";R: INPUT A$: GOSUB 8000
2120  PRINT : PRINT "DIRECTIONS MOVED IN--": PRINT D$;"READ EAMON.ROOMS,R";R: FOR D = 1 TO ND: INPUT DR%(D): NEXT 
2130  FOR D = 1 TO ND: PRINT "   ";DD$(D);": "; SPC( (DR%(D) >  = 0) + ( ABS (DR%(D)) < 10));DR%(D); SPC( 5)
2140  IF DR%(D) =  - 99 THEN  PRINT "[EXIT]";: GOTO 2160
2150  IF DR%(D) <  > 0 AND  ABS (DR%(D)) <  = NR THEN  PRINT "[";R$( ABS (DR%(D)));"]";
2160  PRINT : NEXT D: RETURN 
3000  REM   /// LIST ARTIF.
3010  INPUT "BEGINNING WITH ARTIFACT #(1): ";BEG$
3020  PRINT "ENDING WITH ARTIFACT #(";NA;"): ";: INPUT EN$
3030  IF  VAL (BEG$) > NA OR  VAL (BEG$) < 1 THEN BEG$ = "1"
3040  IF  VAL (EN$) > NA OR  VAL (EN$) <  VAL (BEG$) THEN EN$ =  STR$ (NA)
3050 BEG =  VAL (BEG$):EN =  VAL (EN$)
3060  PRINT D$"OPEN EAMON.ARTIFACTS,L128"
3080  IF SW THEN  PRINT D$"PR#";PS
3090  FOR R = BEG TO EN: GOSUB 3500: NEXT 
3095  PRINT D$"CLOSE EAMON.ARTIFACTS": PRINT D$: PRINT D$"PR#0": GOTO 100
3500  PRINT D$;"READ EAMON.ARTIFACTS,R";R: INPUT X$: FOR A = 1 TO 4: INPUT A%(A): NEXT : IF A%(2) > 1 THEN  FOR A = 5 TO 8: INPUT A%(A): NEXT 
3520  PRINT "ARTIFACT # ";R;" [";AN$(R);"]": PRINT " ": PRINT D$;"READ EAMON.DESC,R";100 + R: INPUT A$: PRINT "DESC: ": GOSUB 8000: PRINT " "
3540  FOR A2 = 1 TO 4: PRINT "  ";A$(A2); SPC( 10 -  LEN (A$(A2)));": "; SPC( 6 -  LEN ( STR$ (A%(A2))));A%(A2);
3560  IF A2 = 2 AND A%(2) >  = 0 AND A%(2) <  = 3 THEN  PRINT " ["; MID$ ("SET TREASURE  TREASURE     WEAPON   ODD WEAPON",A%(2) * 12 + 1,12);"]";: GOTO 3580
3570  IF A2 = 4 AND A%(4) > 0 AND A%(4) <  = NR THEN  PRINT " [";R$(A%(4));"]";
3580  PRINT : NEXT A2: IF A%(2) < 2 THEN 3610
3590  FOR A2 = 5 TO 8: PRINT "  ";A$(A2); SPC( 10 -  LEN (A$(A2)));": "; SPC( 6 -  LEN ( STR$ (A%(A2))));A%(A2);: IF A2 = 6 AND A%(6) >  = 1 AND A%(6) <  = 5 THEN  PRINT " ["; MID$ (" AXE  BOW CLUB SPEARSWORD",(A%(6) - 1) * 5 + 1,5);"]";
3600  PRINT : NEXT A2
3610  PRINT " ": PRINT " ": RETURN 
4000  REM   /// LIST EFFECTS
4010  INPUT "BEGINNING WITH #(1): ";BEG$
4020  PRINT "ENDING WITH #(";NE;"): ";: INPUT EN$
4030  IF  VAL (BEG$) > NE OR  VAL (BEG$) < 1 THEN BEG$ = "1"
4040  IF  VAL (EN$) > NE OR  VAL (EN$) <  VAL (BEG$) THEN EN$ =  STR$ (NE)
4050 BEG =  VAL (BEG$):EN =  VAL (EN$)
4080  IF SW THEN  PRINT D$"PR#";PS
4090  FOR R = BEG TO EN: GOSUB 4500: NEXT : PRINT D$
4095  PRINT D$"PR#0": GOTO 100
4500  REM 
4510  PRINT "EFFECT #";R;":": PRINT 
4520  PRINT D$;"READ EAMON.DESC,R";R + 200: INPUT A$: GOSUB 8000
4530  PRINT : PRINT : RETURN 
5000  REM   /// LIST MONSTERS
5010  INPUT "BEGINNING WITH #(1): ";BEG$
5020  PRINT "ENDING WITH #(";NM;"): ";: INPUT EN$
5030  IF  VAL (BEG$) > NM OR  VAL (BEG$) < 1 THEN BEG$ = "1"
5040  IF  VAL (EN$) > NM OR  VAL (EN$) <  VAL (BEG$) THEN EN$ =  STR$ (NM)
5050 BEG =  VAL (BEG$):EN =  VAL (EN$)
5060  PRINT D$"OPEN EAMON.MONSTERS,L128"
5080  IF SW THEN  PRINT D$"PR#";PS
5090  FOR R = BEG TO EN: GOSUB 5500: NEXT 
5095  PRINT D$"CLOSE EAMON.MONSTERS": PRINT D$: PRINT D$"PR#0": GOTO 100
5500  REM  
5510  PRINT D$;"READ EAMON.MONSTERS,R";R: INPUT MN$: FOR M2 = 1 TO 12: INPUT M%(M2): NEXT : PRINT D$;"READ EAMON.DESC,R";R + 300: INPUT A$
5520  PRINT "MONSTER # ";R;" [";MN$;"]": PRINT " ": PRINT "DESC:": GOSUB 8000: PRINT " ": FOR M2 = 1 TO 12: PRINT " ";M$(M2); SPC( 10 -  LEN (M$(M2)));": "; SPC( 6 -  LEN ( STR$ (M%(M2))));M%(M2);
5540  IF M2 = 3 OR M2 = 4 OR M2 = 7 OR M2 = 10 THEN  PRINT " %";
5550  IF M2 = 5 AND M%(5) > 0 AND M%(5) <  = NR THEN  PRINT " [";R$(M%(5));"]";
5560  IF M2 = 9 AND M%(9) =  - 1 THEN  PRINT " [ NO WEAPONS ]"
5570  IF M2 = 9 AND M%(9) = 0 THEN  PRINT " [ NATURAL WEAPONS ]";
5590  IF M2 = 9 AND M%(9) > 0 AND M%(9) < N%(2) THEN  PRINT " [";AN$(M%(9));"]";
5600  PRINT : NEXT M2
5620  PRINT " ": RETURN 
6000  REM  /// TOGGLE PRINTER
6010 SW =  NOT SW
6020  GOTO 100
7000  REM    /// QUIT
7010  PRINT D$"CLOSE": PRINT D$"PR#0": END 
8000  IF  NOT SW THEN  PRINT A$: RETURN 
8010  FOR AZ = 1 TO  LEN (A$) STEP 40: PRINT  MID$ (A$,AZ,40): NEXT : RETURN