Source:Dungeon Edit

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 Dungeon Edit, part of the Eamon Dungeon Designer.

Source

Eamon Dungeon Designer version 7.1

Date

31 January 1995

Author

Donald Brown, John Nelson, Tom Zuchowski

License

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

Other versions

Source:Dungeon Edit 7.1

1  REM    DUNGEON EDIT PROGRAM
2  REM      BY JOHN NELSON
3  REM 
4  REM    ADAPTED FROM DON BROWN'S       DUNGEON EDIT
5  REM    THIS PROGRAM ADDS AND
6  REM    MODIFIES SIX AND TEN
7  REM    DIRECTION DUNGEONS.
8  REM 
9  REM 1/31/95
10  PRINT  CHR$ (4);"MAXFILES 7":SL$ =  STR$ ( PEEK (43626)):DR$ =  STR$ ( PEEK (43624))
30 DK$ =  CHR$ (4): HOME : VTAB 5: PRINT "     EDITING AN ADVENTURE FOR EAMON": PRINT : PRINT "     INSERT DISKETTE WITH ADVENTURE": PRINT : PRINT "     PRESS ANY KEY TO CONTINUE...";: POKE  - 16368,0: GET A$: PRINT 
40  ONERR  GOTO 400
50  PRINT DK$;"OPEN EAMON.NAME": PRINT DK$;"READ EAMON.NAME": INPUT DUNGN$: INPUT ND$: INPUT DV: PRINT DK$;"CLOSE"
60 ND =  VAL (ND$): POKE 216,0
70  PRINT DK$;"OPEN EAMON.ROOMS,L64": PRINT DK$;"OPEN EAMON.ROOM NAMES,L64": PRINT DK$;"OPEN EAMON.MONSTERS,L128": PRINT DK$;"OPEN EAMON.ARTIFACTS,L128": PRINT DK$;"OPEN EAMON.DESC,L256"
80  PRINT DK$;"READ EAMON.DESC,R0": INPUT N%(1),N%(2),N%(3),N%(4): PRINT DK$
90  GOSUB 35000: IF DV < 6 THEN DT = 3:TY$(3) = "ODD WEAPON"
100  IF DV > 6.9 THEN  PRINT  CHR$ (7): PRINT "THIS ADVENTURE DISKETTE IS VERSION 7.X. USE 'DUNGEON EDIT 7.1' TO EDIT THIS     ADVENTURE.": PRINT DK$"CLOSE": END 
140  ONERR  GOTO 60000
150  HOME : FOR T = 1 TO 4: PRINT T$(T);"-";N%(T);"  ";: NEXT : PRINT : VTAB 3: PRINT  TAB( 4);"EDITING ";: INVERSE : PRINT DUNGN$: PRINT  MID$ ("LOCK",1,LK * 4);: NORMAL 
155  PRINT "   ";: INVERSE : PRINT  MID$ ("CONT.ISRT",1,9 * CI): NORMAL 
160  PRINT "YOUR CHOICES ARE--":: PRINT "  1. ADD NEW ROOM,ARTIFACT,EFFECT OR": PRINT "      MONSTER"
170  PRINT 
180  PRINT "  2. EDIT OLD ROOM,ARTIFACT, EFFECT": PRINT "      MONSTER"
190  PRINT 
200  PRINT "  3. LIST NAMES OF ROOMS, ARTIFACT,ETC"
210  PRINT 
220  PRINT "  4. REPLACE OLD ROOM,ARTIFACT OR": PRINT "     MONSTER (WITHOUT VIEWING OLD)"
230  PRINT 
240  PRINT "  5. DUPLICATE A ROOM, ARTIFACT": PRINT "     OR MONSTER"
250  PRINT 
260  PRINT "  6. SPECIAL FUNCTIONS"
270  PRINT 
280  PRINT "  7. QUIT"
290  PRINT : PRINT "ENTER KEY FOR YOUR CHOICE (1-7) ";
300  GET A$: IF A$ =  CHR$ (12) THEN LK =  NOT LK: GOTO 150
305  IF A$ =  CHR$ (9) THEN CI =  NOT CI: GOTO 150
310  IF  VAL (A$) < 1 OR  VAL (A$) > 7 THEN 300
320 C =  VAL (A$): PRINT A$
350  ON C GOTO 1000,2000,3000,4000,5000,6000,7000
400  IF ND$ = "" THEN DV = 4:ND$ = "6": PRINT DK$;"CLOSE": GOTO 60
410 DV = 5: PRINT DK$;"CLOSE": GOTO 60
500  REM  >> SELECT WHAT TO WORK ON
510  VTAB 2: CALL  - 958: PRINT "DO YOU WANT TO ";C$;" A ROOM, ARTIFACT,": PRINT "  EFFECT, OR MONSTER (HIT KEY, RAEM)  ";
520  GET A$: FOR A = 1 TO 4: IF A$ <  >  MID$ ("RAEM",A,1) THEN  NEXT : GOTO 520
530  PRINT A$: RETURN 
600  REM ///ROUTINE TO INPUT I$, HAVING BEEN PASSED I2$
605 I$ = "":H =  PEEK (36):V =  PEEK (37): HTAB 38: VTAB 1: INVERSE : PRINT  MID$ (" I",IS + 1,1): NORMAL : HTAB H + 1: VTAB V + 1
610  PRINT I2$;: CALL  - 958: IF  LEN (I2$) THEN  FOR A = 1 TO  LEN (I2$): PRINT  CHR$ (8);: NEXT 
615  GET A$: IF A$ =  CHR$ (13) THEN  CALL  - 958: PRINT : RETURN 
618  IF A$ =  CHR$ (17) AND LK THEN  POP : POP : GOTO 900
620  IF (A$ >  CHR$ (31) OR A$ =  CHR$ (9) OR (A$ =  CHR$ (21) AND  NOT  LEN (I2$))) AND  LEN (I$) +  LEN (I2$) > 250 THEN  PRINT  CHR$ (7);: GOTO 615
622  IF A$ >  CHR$ (31) AND IS THEN  PRINT A$;:I$ = I$ + A$: GOTO 610
625  IF A$ >  CHR$ (31) THEN  PRINT A$;:I$ = I$ + A$:I2$ =  MID$ (I2$,2): GOTO 615
630  IF A$ =  CHR$ (5) THEN  PRINT I2$;:I$ = I$ + I2$:I2$ = "": GOTO 615
635  IF A$ =  CHR$ (2) AND  LEN (I$) THEN  FOR A = 1 TO  LEN (I$): PRINT  CHR$ (8);: NEXT :I2$ = I$ + I2$:I$ = "": GOTO 615
640  IF A$ =  CHR$ (4) THEN I2$ =  MID$ (I2$,2): GOTO 610
642  IF A$ =  CHR$ (9) AND CI THEN IS =  NOT IS:H =  PEEK (36):V =  PEEK (37): HTAB 39: VTAB 1: INVERSE : PRINT  MID$ (" I",IS + 1,1): NORMAL : HTAB H + 1: VTAB V + 1: GOTO 615
645  IF A$ =  CHR$ (9) THEN I2$ = " " + I2$: GOTO 610
650  IF A$ =  CHR$ (21) AND  LEN (I2$) THEN A$ =  LEFT$ (I2$,1): GOTO 625
655  IF A$ =  CHR$ (21) THEN A$ = " ": GOTO 625
660  IF A$ =  CHR$ (8) AND  LEN (I$) > 1 THEN I2$ =  RIGHT$ (I$,1) + I2$:I$ =  LEFT$ (I$, LEN (I$) - 1): PRINT A$;: GOTO 615
665  IF A$ =  CHR$ (8) AND  LEN (I$) THEN I2$ = I$ + I2$: PRINT A$;: GOTO 600
670  IF A$ =  CHR$ (8) THEN 600
675  IF A$ =  CHR$ (27) THEN  PRINT I2$:I$ = I$ + I2$: RETURN 
680  GOTO 615
700  REM  >> GET NUMBER
710  VTAB 6: CALL  - 958: PRINT "INPUT NUMBER OF ";T$(TY);" TO ";C$
720  PRINT "   (1-";N%(TYPE);: INPUT ")  ";A$:NO =  VAL (A$): IF NO < 1 OR NO > N%(TYPE) + (C$ = "CREATE") OR NO <  >  INT (NO) THEN  POP : GOTO 150
750  RETURN 
800  REM  >> LOCKED <<
810  HOME : ON C GOTO 1020,2020,3010,4020,5020,150,150
890  GOTO 150
900  REM   >> DELETE FROM LOCK
910 LK =  NOT LK: IF C = 1 THEN N%(TYP) = N%(TYP) - 1: GOTO 150
990  GOTO 150
1000  REM  >> ADD ITEM
1010 C$ = "ADD": GOSUB 500:TYPE = A
1020  ON TYPE GOTO 1100,1200,1300,1400
1100  REM  >> ADD ROOM
1110 N%(1) = N%(1) + 1:NO = N%(1):REC = NO
1120 NA$ = "":DE$ = "": FOR D = 1 TO ND:RD%(D) = DD%(D) + NO * (DD%(D) <  > 0): NEXT :LT = DL
1130  GOSUB 11000
1140  GOSUB 31100: GOSUB 18000: IF  NOT LK THEN 150
1150  GOTO 800
1200  REM  >> ADD ARTIFACT
1210 N%(2) = N%(2) + 1:NO = N%(2):REC = NO + 100
1220 NA$ = "":DE$ = "": FOR D = 1 TO AF:AD%(D) = DA%(D): NEXT : FOR X = 1 TO 4:AL$(X + AF) = FM$(FMP%(AD%(2)),X): NEXT 
1230  GOSUB 12000: GOSUB 31200: GOSUB 18000: IF  NOT LK THEN  GOTO 150
1240  GOTO 800
1300  REM  >> ADD EFFECT
1310 N%(3) = N%(3) + 1:NO = N%(3):REC = NO + 200
1320 DE$ = ""
1330  GOSUB 13000: GOSUB 18000: IF  NOT LK THEN  GOTO 150
1340  GOTO 800
1400  REM  >> ADD MONSTER
1410 N%(4) = N%(4) + 1:NO = N%(4):REC = NO + 300
1420 NA$ = "":DE$ = "": FOR D = 1 TO MF:M%(D) = DM%(D): NEXT 
1430  GOSUB 14000: GOSUB 18000: GOSUB 31400: IF  NOT LK THEN  GOTO 150
1440  GOTO 800
2000  REM  >> EDIT OLD ITEM
2010 C$ = "EDIT": GOSUB 500:TYPE = A
2020  ON TYPE GOTO 2100,2200,2300,2400
2100  REM  >> EDIT ROOM
2110  GOSUB 700:REC = NO: GOSUB 21000: GOSUB 20000: GOTO 1130
2200  REM  >> EDIT ARTIFACT
2220  GOSUB 700:REC = NO + 100: GOSUB 20000: GOSUB 22000: FOR X = 1 TO 4:AL$(AF + X) = FML$(FMP%(AD%(2)),X): NEXT 
2230  GOTO 1230
2300  REM  >> EDIT EFFECT
2310  GOSUB 700:REC = NO + 200: GOSUB 20000: GOTO 1330
2400  REM  >> EDIT MONSTER
2410  GOSUB 700:REC = NO + 300: GOSUB 24000: GOSUB 20000: GOTO 1430
3000  REM  >> LIST THINGS
3010 C$ = "LIST": GOSUB 500:TYPE = A: IF N%(TYPE) = 0 THEN  PRINT : INVERSE : PRINT "NONE OF THAT TYPE TO PRINT!": NORMAL : PRINT : PRINT "(HIT ANY KEX TO CONTINUE)  ";: GET A$: PRINT : GOTO 150
3020  IF HC THEN  PRINT DK$;"PR#1"
3030  ON TYPE GOTO 3100,3200,3300,3400
3100 F$ = "EAMON.ROOM NAMES":A$ = "ROOM": GOTO 3500
3200 F$ = "EAMON.ARTIFACTS":A$ = "ARTIFACT": GOTO 3500
3300  TEXT : HOME :LP = 0: PRINT "LISTING ";:A$ = "EFFECT": INVERSE : PRINT A$;"S": NORMAL : PRINT : POKE 34,2: FOR A = 1 TO N%(TYPE):REC = A + 200: GOSUB 20000: PRINT A$;" #";A
3310  IF HC THEN  FOR X = 1 TO  LEN (DE$) STEP 40: PRINT  MID$ (DE$,X,40):LP = LP + 1: NEXT 
3320  IF  NOT HC THEN  PRINT DE$:LP = LP + 1
3330  PRINT : PRINT :LP = LP + 1: IF LP > 12 + 35 * HC THEN  GOSUB 3600
3370  NEXT A: PRINT DK$;"PR#0"
3380  PRINT : PRINT "(HIT ANY KEY TO RETURN TO MENU)  ";: GET A$: PRINT : TEXT : GOTO 150
3400 F$ = "EAMON.MONSTERS":A$ = "MONSTER": GOTO 3500
3500  REM  >> LIST STUFF
3510  TEXT : HOME :LP = 0: PRINT "LISTING ";: INVERSE : PRINT A$;"S": NORMAL : PRINT : POKE 34,2: FOR A = 1 TO N%(TYP): PRINT DK$;"READ ";F$;",R";A: INPUT NA$: PRINT DK$: PRINT A$;"#";A;": ";: INVERSE : PRINT NA$: NORMAL 
3520 LP = LP + 1: IF LP > 19 + 30 * HC THEN  GOSUB 3600
3560  NEXT A: PRINT DK$;"PR#0"
3570  PRINT : PRINT "PRESS ANY KEY TO RETURN TO MENU";: GET A$: PRINT : TEXT : GOTO 150
3600  REM  >> PAGE BREAK
3610 LP = 0: IF HC THEN  PRINT  CHR$ (12);"LISTING ";A$;"S": PRINT : RETURN 
3620  PRINT : PRINT "      (PRESS ANY KEY TO CONTINUE)     ";: POKE  - 16368,0: GET B$: PRINT : VTAB  PEEK (37) - 1: CALL  - 958
3690  RETURN 
4000  REM   >>  REPLACE ITEM
4010 C$ = "REPLACE": GOSUB 500:TYPE = A
4020  ON TYPE GOTO 4100,4200,4300,4400
4100  REM  >> REPLACE ROOM
4110  GOSUB 700: GOTO 1120
4200  REM  >> REPLACE ARTIF.
4210  GOSUB 700:REC = NO + 100: GOTO 1220
4300  REM  >> REPLACE EFFECT
4310  GOSUB 700:REC = NO + 200: GOTO 1320
4400  REM  >> REPLACE MONSTER
4410  GOSUB 700:REC = NO + 300: GOTO 1420
5000  REM  >> DUPLICATE
5010 C$ = "DUPLIC.": GOSUB 500:TYPE = A
5020 C$ = "DUP. FROM": GOSUB 700:FROM = NO:C$ = "CREATE": GOSUB 700:NC = NO
5030  IF NO > N%(TYPE) THEN  PRINT "CREATING A ";T$(TYPE);" FROM ANOTHER.":N%(TYPE) = N%(TYPE) + 1
5040  ON TYPE GOTO 5100,5200,5300,5400
5100  REM  >> DUP. ROOM
5110 NO = FROM:REC = NO: GOSUB 21000: GOSUB 20000:REC = NC:NO = NC: GOTO 1130
5200  REM  >> DUP. ART.
5210 NO = FROM:REC = NO + 100: GOSUB 22000: GOSUB 20000:REC = NC + 100:NO = NC: GOTO 1230
5300  REM  >> DUP. EFF.
5310 NO = FROM:REC = NO + 200: GOSUB 20000:REC = NC + 200: GOSUB 18000
5390  GOTO 150
5400  REM  >> DUP. MONSTER
5410 NO = FROM: GOSUB 24000:REC = NO + 300: GOSUB 20000:REC = NC + 300:NO = NC: GOTO 1430
6000  REM  >> SPECIAL FUNCTIONS
6005  HOME :SF = 9: INVERSE : PRINT "   SELECT FUNCTION OR PRESS <RETURN>   ": NORMAL : PRINT : IF DV < 6 THEN SF = 6
6010  PRINT "  1. GENERATE DEAD BODIES": PRINT 
6015  PRINT "  2. DELETE LAST R,A,E,M": PRINT 
6020  PRINT "  3. ADD TO NBR OF R,A,E,M": PRINT 
6025  PRINT "  4. TOGGLE LOCK MODE (NOW "; MID$ ("OFFON",LK * 3 + 1,3 - LK);")"
6030  PRINT : PRINT "  5. GENERATE DUMMY ARTIFACTS"
6035  PRINT : PRINT "  6. TOGGLE PRINTER (NOW "; MID$ ("OFFON",HC * 3 + 1,3 - HC);")": IF SF < 7 THEN 6040
6038  PRINT : PRINT "  7. CHANGE DEFAULTS": PRINT : PRINT "  8. CHANGE DATA ASSIGNMENTS": PRINT : PRINT "  9. LOAD/SAVE CUSTOMIZED PARAMETERS"
6040  PRINT : PRINT "INPUT YOUR CHOICE (1-";SF;"):";
6045  GET S$: IF S$ =  CHR$ (13) THEN  PRINT : GOTO 150
6050  IF  VAL (S$) < 1 OR  VAL (S$) > SF THEN 6045
6055  HOME : ON  VAL (S$) GOTO 6100,6200,6300,6400,6500,6600,6700,6800,6900
6100  REM  >> GEN. DEAD
6105  VTAB 6: CALL  - 958: PRINT "ALL DEAD BODIES (Y/N):";
6110  GET A$: IF A$ <  > "Y" AND A$ <  > "N" THEN 6110
6120  PRINT A$: IF A$ = "Y" THEN A = N%(2) + 1:M = 1:LA = A + N%(4) - 1: GOTO 34500
6125  INPUT "MONSTER NUMBER TO START ON:";M
6130 A = N%(2) + 1:LA = A + N%(4) - M
6140  GOTO 34500
6200  REM  >> DELETE
6210 C$ = "DELETE": GOSUB 500:N%(A) = N%(A) - 1
6220  GOTO 6000
6300  REM  === INCREMENT
6310 C$ = "INCRMNT": GOSUB 500:N%(A) = N%(A) + 1: GOTO 6000
6400 LK =  NOT LK: GOTO 6000
6500  REM  >> GEN. DUMMY ART.
6510  PRINT 
6520  INPUT "NBR ART. TO GEN:";NA
6530  FOR A = 1 TO NA: PRINT DK$"WRITE EAMON.DESC,R";N%(2) + 101: PRINT "YOU SEE ARTIFACT ";N%(2) + 1;"."
6540  PRINT DK$"WRITE EAMON.ARTIFACTS,R";N%(2) + 1: PRINT "ARTIFACT ";N%(2) + 1: FOR X = 1 TO 8: PRINT 0: NEXT :N%(2) = N%(2) + 1: NEXT 
6560  PRINT DK$: GOTO 150
6600  REM   >> TOGGLE H/C
6610 HC =  NOT HC: GOTO 150
6700  REM  >> CHANGE DEFAULTS
6710  HOME : PRINT  SPC( 12);"CHANGE DEFAULTS": VTAB 6: PRINT "SELECT DEFAULT TO CHANGE:": PRINT : PRINT "   1. ROOM VALUES": PRINT : PRINT "   2. MONSTER VALUES"
6720  PRINT : PRINT "   3. ARTIFACT VALUES": PRINT : PRINT "   4. RETURN TO MAIN MENU": PRINT : PRINT "INPUT YOUR CHOICE (1-4):";
6730  GET A$: IF  VAL (A$) < 1 OR  VAL (A$) > 4 THEN 6730
6740  PRINT A$: ON  VAL (A$) GOTO 15100,15200,15300,150
6800  REM   >> CHANGE DATA ASSIGN
6810  HOME : PRINT  SPC( 08);"CHANGE DATA ASSIGNMENTS": VTAB 6: PRINT "SELECT DATA TYPE:": PRINT "  1. MONSTER DATA": PRINT "  2. ARTIFACT DATA": PRINT "  3. CHANGE FORMAT POINTER": PRINT "  4. CHANGE A FORMAT"
6820  PRINT "  5. ARTIFACT TYPES": PRINT "  6. ADD A FORMAT": PRINT "  7. RETURN TO MAIN MENU": PRINT "INPUT THE NUMBER (1-7):";
6830  GET A$: IF  VAL (A$) < 1 OR  VAL (A$) > 7 THEN 6830
6840  PRINT A$: ON  VAL (A$) GOTO 10100,10200,10300,10400,10500,10600,140
6900  REM  >> LOAD/SAVE PARAM.
6910  HOME : PRINT  SPC( 10);"LOAD/SAVE PARAMETERS": VTAB 6: CALL  - 958: PRINT "SELECT LOAD/SAVE FUNCTION:": PRINT : PRINT "  1. LOAD PARAMETERS": PRINT : PRINT "  2. SAVE PARAMETERS": PRINT : PRINT "  3. RETURN"
6920  PRINT : PRINT "INPUT NUMBER (1-3): ";
6930  GET A$: IF A$ < "1" OR A$ > "3" THEN 6930
6940  PRINT A$: ON  VAL (A$) GOTO 7100,7200,150
7000  REM  >> QUIT
7010  PRINT DK$;"WRITE EAMON.DESC,R0": FOR T = 1 TO 4: PRINT N%(T): NEXT 
7020  PRINT DK$;"CLOSE"
7030  POKE 216,0: END 
7100  REM  >> LOAD PARAM
7110  VTAB 6: CALL  - 958: PRINT "NAME OF PARAMETERS FILE:": PRINT : INPUT "     ===> ";A$
7120  IF  LEFT$ (A$,1) = "?" THEN  PRINT DK$;"CATALOG"; MID$ (A$,2): PRINT : GET A$: PRINT : HOME : GOTO 7100
7130  PRINT DK$;"OPEN ";A$: PRINT DK$"READ ";A$: INPUT AF: FOR X = 1 TO AF: INPUT AL$(X): NEXT : FOR X = 1 TO AF: INPUT DA%(X): NEXT : INPUT NF: FOR F = 1 TO NF: FOR X = 1 TO 4: INPUT FM$(F,X): NEXT : NEXT 
7140  FOR F = 1 TO NF: FOR X = 1 TO 4: INPUT FD%(F,X): NEXT : NEXT : INPUT MF: FOR X = 1 TO MF: INPUT M$(X): NEXT : FOR X = 1 TO MF: INPUT DM%(X): NEXT : INPUT DT: FOR X = 0 TO DT: INPUT TY$(X): NEXT : PRINT DK$;"CLOSE ";A$
7190  GOTO 150
7200  REM  >> SAVE PARAM
7210  VTAB 6: CALL  - 958: PRINT "NAME OF PARAMETERS FILE:": PRINT : INPUT "     ===> ";A$
7220  IF  LEFT$ (A$,1) = "?" THEN  PRINT DK$;"CATALOG"; MID$ (A$,2): PRINT : GET A$: GOTO 7200
7230  PRINT DK$;"OPEN ";A$: PRINT DK$"WRITE ";A$: PRINT AF: FOR X = 1 TO AF: PRINT AL$(X): NEXT : FOR X = 1 TO AF: PRINT DA%(X): NEXT : PRINT NF: FOR F = 1 TO NF: FOR X = 1 TO 4: PRINT FM$(F,X): NEXT : NEXT 
7240  FOR F = 1 TO NF: FOR X = 1 TO 4: PRINT FD%(F,X): NEXT : NEXT : PRINT MF: FOR X = 1 TO MF: PRINT M$(X): NEXT : FOR X = 1 TO MF: PRINT DM%(X): NEXT : PRINT DT: FOR X = 0 TO DT: PRINT TY$(X): NEXT : PRINT DK$;"CLOSE ";A$
7290  GOTO 150
10100  REM  >> MON. DATA ASSIGN
10110  HOME : FOR X = 1 TO MF: PRINT "  ";X;". ";M$(X): NEXT : PRINT "  ";MF + 1;". NEW FIELD": PRINT "  ";MF + 2;". RETURN TO PREVIOUS MENU"
10120  INPUT "INPUT FIELD NUMBER:";A$: IF  VAL (A$) < 1 OR  VAL (A$) > MF + 2 THEN  PRINT "TRY AGAIN, FROGFACE.": GOTO 10120
10125  IF  VAL (A$) = MF + 2 THEN 6800
10130 X =  VAL (A$): PRINT : INPUT "NEW LABEL:";A$: IF A$ = "" AND X = MF THEN MF = MF - 1: GOTO 10100
10140  IF A$ = "" THEN 150
10150 M$(X) = A$: IF X > MF THEN MF = MF + 1
10190  GOTO 10100
10200  REM  >> ARTIF. DATA ASSIGN
10210  HOME : FOR X = 1 TO AF: PRINT "  ";X;". ";AL$(X): NEXT : PRINT "  ";AF + 1;". NEW FIELD": PRINT "  ";AF + 2;". RETURN TO PREVIOUS MENU"
10220  INPUT "INPUT FIELD NUMBER:";A$: IF  VAL (A$) < 1 OR  VAL (A$) > AF + 2 THEN  PRINT "TRY AGAIN, FROGFACE.": GOTO 10220
10225  IF  VAL (A$) = AF + 2 THEN 6800
10230 X =  VAL (A$): PRINT : INPUT "NEW LABEL:";A$: IF A$ = "" AND X = AF THEN AF = AF - 1: GOTO 10200
10240  IF A$ = "" THEN 150
10250 AL$(X) = A$: IF X > AF THEN AF = AF + 1
10290  GOTO 10200
10300  REM   === CHANGE FPTR ===
10310  VTAB 6: CALL  - 958: PRINT "FOR WHICH ARTIFACT TYPE:": FOR X = 0 TO DT: PRINT "   ";X;" = ";TY$(X); MID$ ("..................................",1,20 -  LEN (TY$(X)) * ( LEN (TY$(X)) < 20));FM%(X): NEXT 
10320  PRINT "INPUT NUMBER 0 - ";DT;: INPUT ":";A$
10330  IF  VAL (A$) > DTY OR  VAL (A$) < 0 THEN  VTAB  PEEK (37): GOTO 10320
10335 X =  VAL (A$)
10340  PRINT "NEW POINTER (0-";NF;: INPUT "): ";A$: IF  VAL (A$) < 0 OR  VAL (A$) > NF THEN  VTAB  PEEK (37): GOTO 10340
10350 FMP%(X) =  VAL (A$): GOTO 6800
10400  REM  === CHANGE FORMAT ===
10410  VTAB 6: CALL  - 958: PRINT "INPUT FORMAT NUMBER:";
10420  GET A$: IF A$ < "1" OR A$ >  STR$ (NF) THEN 10420
10430  PRINT A$:F =  VAL (A$)
10440  VTAB 6: CALL  - 958: FOR X = 1 TO 4: PRINT "FIELD ";AF + X;" LABEL:";:I2$ = FM$(F,X): GOSUB 600:FM$(F,X) = I$
10460  PRINT "DEFAULT DATA: ";:I2$ =  STR$ (FD%(F,X)): GOSUB 600: IF  ABS ( VAL (A$)) < 32765 THEN FD%(F,X) =  VAL (I$)
10480  NEXT 
10490  GOTO 6800
10500  REM   >> ART TYPES
10510  HOME : FOR X = 0 TO DT: PRINT "  ";X;". ";TY$(X): NEXT : PRINT "  ";DT + 1;". NEW TYPE": PRINT "  ";DT + 2;". RETURN TO PREVIOUS MENU"
10520  INPUT "INPUT TYPE NUMBER:";A$: IF  VAL (A$) < 0 OR  VAL (A$) > DT + 2 THEN  PRINT "TRY AGAIN, FROGFACE.": GOTO 10520
10530 X =  VAL (A$): IF X = DT + 2 THEN 6800
10540  PRINT : PRINT "NEW TYPE:";:I2$ = TY$(X): GOSUB 600: IF I$ = "" AND X = DT THEN DT = DT - 1: GOTO 10500
10550  IF I$ = "" THEN 150
10560  IF X = DT + 1 THEN DT = DT + 1:TY$(DT) = I$: GOTO 150
10570 TY$(X) = I$
10590  GOTO 10500
10600  REM  === ADD A FORMAT ===
10610  VTAB 6: CALL  - 958
10620 NF = NF + 1: FOR X = 1 TO 4: PRINT "FIELD ";X + AF;" LABEL:";:I2$ = "": GOSUB 600:FML$(NF,X) = I$: PRINT "DEFAULT DATA:";:I2$ = "0": GOSUB 600
10630  IF  ABS ( VAL (I$)) < 32765 THEN FD%(NF,X) =  VAL (I$)
10640  NEXT 
10690  GOTO 6800
11000  REM  >> EDIT ROOM
11010  HOME : PRINT "ENTERING ROOM ";NO: PRINT :I2$ = NA$: PRINT "ENTER ROOM NAME:"
11020  PRINT " ";: GOSUB 600: IF  LEN (I$) > 39 THEN  VTAB 3: HTAB 20: PRINT "TOO LONG!":I2$ = I$: GOTO 11020
11030  VTAB 3: CALL  - 958: PRINT "ROOM NAME:": PRINT " ";: INVERSE : PRINT I$: NORMAL :NA$ = I$: VTAB 6:I2$ = DE$
11040  PRINT "ENTER ROOM DESCRIPTION:": GOSUB 600: VTAB 6: CALL  - 958: PRINT "ROOM DESCRIPTION:": INVERSE : PRINT I$: NORMAL :DE$ = I$: PRINT 
11050  VTAB 13: CALL  - 958: PRINT "FOR EACH DIRECTION,GIVE THE ROOM THAT   THIS ROOM CONNECTS TO (USE ZERO FOR NO  CONNECTION, NEGATIVE NUMBER FOR UNUSUAL THINGS.)"
11055  FOR D = 1 TO ND
11060  PRINT "MOVE ";DD$(D);"...";:I2$ =  STR$ (RD%(D)): GOSUB 600:RD%(D) =  VAL (I$): IF RD%(D) <  >  INT (RD%(D)) OR  STR$ (RD%(D)) <  > I$ THEN  VTAB  PEEK (37): GOTO 11060
11080  NEXT : PRINT "LIGHT (0 = NONE; 1 = NORMAL) ";:I2$ =  STR$ (LT): GOSUB 600:LT =  VAL (I$): RETURN 
12000  REM  >> EDIT ARTIFACT
12010  HOME : PRINT "ENTERING ARTIFACT ";NO:I2$ = NA$: PRINT : PRINT "ENTER ARTIFACT NAME:"
12020  PRINT " ";: GOSUB 600: IF  LEN (I$) > 39 THEN  VTAB 3: HTAB 20: PRINT "TOO LONG!":I2$ = I$: GOTO 1220
12030  VTAB 3: CALL  - 958: PRINT "ARTIFACT NAME:": PRINT " ";: INVERSE : PRINT I$: NORMAL :NA$ = I$: VTAB 6:I2$ = DE$
12040  PRINT "ARTIFACT DESCRIPTION:":I2$ = DE$: GOSUB 600: VTAB 6: CALL  - 958: PRINT "ARTIFACT DESCRIPTION:": INVERSE : PRINT I$: NORMAL :DE$ = I$: PRINT 
12050  FOR D = 1 TO AF + 4: IF D = 2 OR (D = AF + 2 AND AD%(2) > 1 AND AD%(2) < 4) THEN  GOSUB 12200
12060  IF D = 2 THEN PT = AD%(2)
12065  IF AL$(D) = "(NOT USED)" THEN 12080
12068  IF D > AF THEN  IF FMP%(AD%(2)) = 0 THEN 12080
12069  IF D = 4 THEN  PRINT "+100 = INSIDE ARTIF.   +200 = EMBEDDED": PRINT "+300 = HIDDEN IN ROOM   +400 = BURIED": PRINT "-2 > -NM = MONSTER CARRYING IT"
12070  PRINT AL$(D);" : ";:I2$ =  STR$ (AD%(D)): GOSUB 600:AD%(D) =  VAL (I$)
12075  IF D = 2 AND PT <  > AD%(2) THEN  GOSUB 12300
12080  NEXT 
12090  RETURN 
12200  ON D - 1 GOTO 12250,12290,12290,12290,12260
12210  GOTO 12290
12250  FOR X = 0 TO DT STEP 2: PRINT "  ";X;" = ";TYP$(X);: IF X < DT THEN  PRINT  TAB( 22);X + 1;" = ";TYP$(X + 1)
12255  NEXT : PRINT : RETURN 
12260  PRINT "1=AXE, 2=BOW, 3=MACE, 4=SPEAR, 5=SWORD": RETURN 
12290  RETURN 
12300  FOR X = 1 TO 4:AL$(X + AF) = FM$(FMP%(AD%(2)),X): NEXT 
12310  FOR X = 1 TO 4:AD%(AF + X) = FD%(FMP%(AD%(2)),X): NEXT 
12390  RETURN 
13000  REM  >> EDIT EFFECT
13010  PRINT : PRINT "ENTER EFFECT #";NO:I2$ = DE$: GOSUB 600:DE$ = I$: PRINT : RETURN 
14000  REM  >> EDIT MONSTER
14010  HOME : PRINT "ENTERING MONSTER # ";NO: PRINT :I2$ = NA$: PRINT "ENTER NAME:";: GOSUB 600: IF I$ = "" OR  LEN (I$) > 30 THEN 14010
14020 NA$ = I$: PRINT : PRINT "ENTER DESC--":I2$ = DE$: GOSUB 600:DE$ = I$: HOME : PRINT "MONSTER # ";NO;"  ";: INVERSE : PRINT NA$: NORMAL : PRINT 
14040  FOR M = 1 TO MF
14050  PRINT "ENTER ";M$(M);": ";:I2$ =  STR$ (M%(M)): GOSUB 600:M%(M) =  VAL (I$): IF  STR$ (M%(M)) <  > I$ THEN  PRINT  CHR$ (7): VTAB  PEEK (37): GOTO 14050
14060  NEXT 
14070  RETURN 
15100  REM  >> CHG DEF. ROOM
15110  HOME : PRINT "INPUT DEFAULT VALUES DESIRED.": FOR D = 1 TO ND:RD%(D) = DD%(D): NEXT : GOSUB 11055
15120  FOR D = 1 TO ND:DD%(D) = RD%(D): NEXT :DL = LT
15130  GOTO 150
15200  REM  >> CHG DEF. MONST.
15210  HOME : PRINT "ENTER NEW DEFAULT VALUES FOR EACH FIELD.": FOR D = 1 TO MF:M%(D) = DM%(D): NEXT : GOSUB 14040: FOR D = 1 TO MF:DM%(D) = M%(D): NEXT 
15290  GOTO 150
15300  REM  >> CHG DEF. ART.
15310  HOME : PRINT "INPUT NEW DEFAULT VALUES FOR ALL FIELDS.": FOR D = 1 TO AF:AD%(D) = DA%(D): NEXT : GOSUB 12050: FOR D = 1 TO AF:DA%(D) = AD%(D): NEXT 
15320  GOTO 150
18000  REM  >> WRITE DESC
18010  PRINT DK$;"WRITE EAMON.DESC,R";REC: PRINT  CHR$ (34);DE$; CHR$ (34): PRINT DK$: RETURN 
20000  REM  >> READ DESC
20010  PRINT DK$;"READ EAMON.DESC,R";REC: INPUT DE$: PRINT DK$
20020  RETURN 
21000  REM  >> READ ROOM
21010  PRINT DK$;"READ EAMON.ROOM NAMES,R";NO: INPUT NA$: PRINT DK$;"READ EAMON.ROOMS,R";NO: FOR D = 1 TO ND: INPUT RD%(D): NEXT 
21020 LT = 1: IF DV > 5 THEN  INPUT LT
21030  PRINT DK$: RETURN 
22000  REM  >> READ ART.
22010  PRINT DK$;"READ EAMON.ARTIFACTS,R";NO: INPUT NA$: FOR X = 1 TO 4: INPUT AD%(X): NEXT : IF DV > 5 OR AD%(2) > 1 THEN  FOR X = 5 TO 8: INPUT AD%(X): NEXT 
22020  PRINT DK$: RETURN 
24000  REM  >> READ MONSTER
24010  PRINT DK$"READ EAMON.MONSTERS,R";NO: INPUT NA$: FOR D = 1 TO MF: INPUT M%(D): NEXT 
24090  PRINT DK$: RETURN 
31100  REM  >> WRITE ROOM
31110  PRINT DK$;"WRITE EAMON.ROOM NAMES,R";NO: PRINT  CHR$ (34);NA$; CHR$ (34)
31120  PRINT DK$;"WRITE EAMON.ROOMS,R";NO: FOR D = 1 TO ND: PRINT RD%(D): NEXT : PRINT LT: PRINT DK$
31130  RETURN 
31200  REM  >> WRITE ART.
31210  PRINT DK$;"WRITE EAMON.ARTIFACTS,R";NO: PRINT  CHR$ (34);NA$; CHR$ (34): FOR D = 1 TO AF + 4: PRINT AD%(D): NEXT 
31220  PRINT DK$: RETURN 
31400  REM  >> WRITE MONSTER
31410  PRINT DK$;"WRITE EAMON.MONSTERS,R";NO: PRINT  CHR$ (34);NA$; CHR$ (34): FOR M = 1 TO MF: PRINT M%(M): NEXT : PRINT DK$
31420  RETURN 
34500  REM  === GENERATE DEAD
34510  FOR X = A TO LA: PRINT DK$;"READ EAMON.MONSTERS,R";M: INPUT A$: FOR X2 = 1 TO 6: INPUT MD%(X2): NEXT : PRINT DK$:M = M + 1
34515  VTAB 6: CALL  - 958: PRINT "   1. THE DEAD BODY OF ";A$: PRINT : PRINT "   2. THE DEAD BODY OF THE ";A$: PRINT : PRINT "CHOOSE THE CORRECT PHRASE (1-2):";
34518  GET X$: IF X$ < "1" OR X$ > "2" THEN 34518
34519 THE$ =  MID$ ("THE ",1,(X$ = "2") * 4): PRINT X$
34520 NA$ = "DEAD " + A$:DE$ = "YOU SEE THE DEAD BODY OF " + THE$ + A$ + "."
34530  IF  LEN (DE$) > 40 THEN  IF  MID$ (DE$,41,1) <  > " " THEN DE$ =  LEFT$ (DE$,25): FOR S = 26 TO 40:DE$ = DE$ + " ": NEXT :DE$ = DE$ + THE$ + A$ + "."
34535  FOR X2 = 1 TO AF + 4:AD%(X2) = 0: NEXT :AD%(2) = 1:AD%(3) = MD%(6)
34540 REC = X + 100:NO = X: GOSUB 18000:N%(2) = N%(2) + 1
34560  GOSUB 31200: NEXT 
34590  GOTO 150
35000  REM  === SETUP DATA 
35010 CX = 5: FOR T = 1 TO 4: READ T$(T): NEXT 
35011  DATA    ROOM,ARTIF,EFFECT,MONST
35015  READ DT: DIM TYP$(DT + CX): FOR T = 0 TO DT: READ TYP$(T): NEXT 
35016  DATA 10,GOLD,TREASURE,WEAPON,MAG WEAPON,CONTAINER,LIGHT,HEALING,READABLE,DOOR/GATE,KEY,BOUND MONSTER
35018 AF = 4: DIM AL$(AF + 4 + CX),AD%(AF + 4 + CX): FOR T = 1 TO AF: READ AL$(T): NEXT 
35019  DATA VALUE,TYPE,WEIGHT,ROOM
35020  FOR T = 1 TO AF: READ DA%(T): NEXT 
35025  DATA 50,1,5,0: REM ARTIFACT DEFAULTS
35030  FOR D = 1 TO 10: READ DD$(D): NEXT 
35032  DATA  N ,S ,E ,W ,U ,D ,NE,NW,SE,SW
35035  FOR T = 1 TO 10: READ DD%(T): NEXT : READ DL
35040  DATA 0,0,0,0,0,0,0,0,0,0,1: REM DEFAULT ROOM NUMBERS
35050 MF = 12: DIM M$(MF + 5),M%(MF + 5): FOR M = 1 TO MF: READ M$(M): NEXT 
35052  DATA HD,AG,FRIEND,COUR,ROOM,WEIGHT,DEF.ODDS,ARMOUR,WEAPON#,OFF.ODDS,W.DICE,W.SIDES
35060  DIM DM%(MF + 5): FOR M = 1 TO MF: READ DM%(M): NEXT 
35065  DATA  16,16,0,100,0,150,0,0,0,50,1,4: REM MONSTER DEFAULTS
35070  READ NF: DIM FMP%(DT + 5),FML$(DT + 5,4),FD%(DT + 5,4): FOR X = 0 TO DT: READ FMP%(X): NEXT : FOR X = 1 TO NF: FOR F = 1 TO 4: READ FML$(X,F),FD%(X,F): NEXT 
35080  NEXT 
35090  DATA 8
35095  DATA 0,0,1,1,2,3,4,5,6,7,8: REM FORMAT POINTERS
35350  DATA ODDS,10,W.TYPE,3,DICE,1,SIDES,4,KEY#,0,STRENGTH,100,(NOT USED),0,(NOT USED),0
35400  DATA COUNTER,999,(NOT USED),0,(NOT USED),0,(NOT USED),0,CHANCES,100,HEAL AMT,6,NBR USES,5,(NOT USED),0
35450  DATA 1ST EFF.,1,#EFFECTS,1,READABLE,1,(NOT USED),0,ROOM BEYOND,1,KEY#,0,STRENGTH,999,(NOT USED),0
35500  DATA (NOT USED),0,(NOT USED),0,(NOT USED),0,(NOT USED),0
35550  DATA MONSTER#,0,KEY#,0,GUARD#,0,(NOT USED),0
35900  RETURN 
60000  PRINT "FOUND AN ERROR - CODE "; PEEK (222): PRINT "ON LINE # "; PEEK (218) +  PEEK (219) * 256: IF  PEEK (222) = 10 THEN  PRINT "CAN'T SAVE FILE - LOCKED.": END 
61000 D$ =  CHR$ (4): PRINT D$"OPEN EAMON.DESC,L256": PRINT D$"WRITE EAMON.DESC,R0": PRINT N%(1): PRINT N%(2): PRINT N%(3): PRINT N%(4): PRINT D$"CLOSE"