	'      Eamon Adventure #11
	'     -> Tomb of Molinar <-
	'
	'        By Donald Brown
	'
	'  converted to IBM-PC by John Nelson
	'
	'
	DEFINT A-Z
	DECLARE SUB PGPRT (SP, LIT$)
REM $$INCL:'\EAMON\copy\colorrtn.bas'
     ON ERROR GOTO NoColors
     OPEN "EAMCOLOR" FOR INPUT AS #1
     INPUT #1, fgc%
     INPUT #1, bgc%
     INPUT #1, hfg%
     INPUT #1, hbg%
     CLOSE
In.BW:
     ON ERROR GOTO 0
     COLOR fgc%, bgc%
     GOTO Colorset
NoColors:
      fgc% = 7
      bgc% = 0
      hfg% = 0
      hbg% = 7
      RESUME In.BW
Colorset:

    '------- (end of include file) -------    
 ' 
REM $$INCL:'\EAMON\COPY\CHARDEF.BAS'
	' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	'
	'   Module:  CHARDEF.BAS
	'   Eamon Version:  Eamon-QB (or Eamon-PC)
	' ------------------------------------------------------------
	'  Character Definition for Eamon QB/PC
	'        Basic version:  QuickBASIC 4.0, GW-BASIC, QBasic *
	'                        or BASIC 7.0 PDS
	'       uses Field statements for record description
	'       This module will work for QBasic, but QBasic cannot
REM $$INCL:statements, so module must be copied
	'       into programs manually or merged using a utility
	' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	'
TYPE WeaponRec
	Nam             AS STRING * 20
	Wpntyp          AS INTEGER
	Odds            AS INTEGER
	Dice            AS INTEGER
	Sides           AS INTEGER
END TYPE

TYPE CharacterRecord
	Nam             AS STRING * 30
	Hd              AS INTEGER
	Ag              AS INTEGER
	Ch              AS INTEGER
	SA1             AS INTEGER
	SA2             AS INTEGER
	SA3             AS INTEGER
	SA4             AS INTEGER
	WA1             AS INTEGER
	WA2             AS INTEGER
	WA3             AS INTEGER
	WA4             AS INTEGER
	WA5             AS INTEGER
	Sex             AS STRING * 1
	Gold            AS LONG
	Bank            AS LONG
	AE              AS INTEGER
	ArmNam          AS STRING * 20
	ArmHit          AS INTEGER
	Armadj          AS INTEGER
	ShdNam          AS STRING * 20
	ShdHit          AS INTEGER
	ShdAdj          AS INTEGER
	Wpn1Nam         AS STRING * 20
	Wpn1typ         AS INTEGER
	Wpn1Wpntyp      AS INTEGER
	Wpn1odds        AS INTEGER
	Wpn1Dice        AS INTEGER
	Wpn1Sides       AS INTEGER
	Wpn2Nam         AS STRING * 20
	Wpn2typ         AS INTEGER
	Wpn2Wpntyp      AS INTEGER
	Wpn2odds        AS INTEGER
	Wpn2Dice        AS INTEGER
	Wpn2Sides       AS INTEGER
	Wpn3Nam         AS STRING * 20
	Wpn3typ         AS INTEGER
	Wpn3Wpntyp      AS INTEGER
	Wpn3odds        AS INTEGER
	Wpn3Dice        AS INTEGER
	Wpn3Sides       AS INTEGER
	Wpn4Nam         AS STRING * 20
	Wpn4typ         AS INTEGER
	Wpn4Wpntyp      AS INTEGER
	Wpn4odds        AS INTEGER
	Wpn4Dice        AS INTEGER
	Wpn4Sides       AS INTEGER
	Filler          AS STRING * 23
END TYPE
DIM Char AS CharacterRecord
TYPE CharControl
	NbrChar         AS INTEGER
	Filler          AS STRING * 254
END TYPE
DIM CharCtl AS CharControl

    '------- (end of include file) -------    
 ' 
	CLS
	DEF FNR (X) = INT(X * RND(1) + 1)
REM $$INCL:'\EAMON\COPY\READCTL.BAS'
     CLOSE 1
     OPEN "DESC.R0" FOR INPUT AS #1
     INPUT #1, NR
     INPUT #1, NZ
     INPUT #1, NE
     INPUT #1, NM
     INPUT #1, ND
     INPUT #1, MAX.RM
     INPUT #1, MAX.ART
     INPUT #1, MAX.EFF
     INPUT #1, Max.Mon
     INPUT #1, Rm.Len
     INPUT #1, Rmn.Len
     INPUT #1, Mon.Len
     INPUT #1, Art.Len
     INPUT #1, Desc.Len
     INPUT #1, Mon.Flds
     INPUT #1, Art.Flds
     INPUT #1, RM.Flds
     INPUT #1, MN.Len
     INPUT #1, AN.Len
     CLOSE 1
     NA = NZ
     ART.ADJ = MAX.RM
     EFF.ADJ = MAX.RM + MAX.ART
     MON.ADJ = MAX.RM + MAX.ART + MAX.EFF
     EMB.ADJ = MAX.RM + MAX.ART
     INS.ADJ = MAX.RM
     HID.ADJ = MAX.RM * 2 + MAX.ART
     BURY.ADJ = MAX.RM * 3 + MAX.ART

    '------- (end of include file) -------    
 ' 
	TYPE MonsterRecord
		Nam     AS STRING * 20
		Hd      AS INTEGER
		Ag      AS INTEGER
		Fr      AS INTEGER
		Cour    AS INTEGER
		ROOM    AS INTEGER
		Wght    AS INTEGER
		DOdds   AS INTEGER
		Armor   AS INTEGER
		Weapon  AS INTEGER
		OOdds   AS INTEGER
		Dice    AS INTEGER
		Sides   AS INTEGER
	END TYPE
	TYPE RmRecord
		North   AS INTEGER
		South   AS INTEGER
		East    AS INTEGER
		West    AS INTEGER
		Up      AS INTEGER
		Down    AS INTEGER
		Lt      AS INTEGER
	END TYPE
	DIM RmD AS RmRecord
	TYPE ArtifactRecord
		Nam     AS STRING * 20
		Value   AS INTEGER
		typ     AS INTEGER
		Wght    AS INTEGER
		ROOM    AS INTEGER
		Odds    AS INTEGER
		Wpntyp  AS INTEGER
		Dice    AS INTEGER
		Sides   AS INTEGER
	END TYPE
	DIM MONSTER AS MonsterRecord
	DIM Artifact AS ArtifactRecord
	DIM AN$(NA + 6), AD%(NA + 6, 9), V%(NR)
	DIM MON$(12)
	DIM MN$(NM), MD%(NM, 15)
	DIM FD%(3), TD%(3), SA%(4), WA%(5), S2%(4), RD%(6), ART$(8), SY%(4), WY%(5)
	READ NBR.CMD
	DIM Desc AS STRING * 255
	DIM RN AS STRING * 64
	DIM C$(NBR.CMD)
	FOR C = 1 TO NBR.CMD
	READ C$(C)
	NEXT
	R2 = 1
	GOTO Initialize
Main.Loop:
REM ///MAIN LOOP. FIRST GIVE ROOM DESC, THEN GET COMMAND
	PGPRT 1, " "
	IF SPD > 0 THEN
		SPD = SPD - 1:
		IF SPD = 0 THEN
			MD%(0, 2) = MD%(0, 2) / 2
			MD%(0, 10) = MD%(0, 10) - 2 * MD%(0, 2)
			IF RND(1) > .8 THEN PGPRT 2, "Your Speed spell has just expired!"
		END IF
	END IF
	IF INT(V%(ROOM) / 2) = (V%(ROOM) / 2) THEN
		R = ROOM
		GET #2, R, Desc
		A$ = RTRIM$(Desc)
		PGPRT 2, A$
		V%(ROOM) = V%(ROOM) + 1
	ELSE
		GET #3, ROOM, RN
		A$ = RTRIM$(RN):
		PGPRT 2, "You are " + A$
	END IF
	IF ROOM = 11 AND F1 THEN PGPRT 2, "You see a secret passage to the south."
	FOR M = 1 TO NM
	IF MD%(M, 5) = ROOM THEN
		IF MD%(M, 15) = 0 THEN
			GET #2, M + MON.ADJ, Desc
			A$ = RTRIM$(Desc)
			PGPRT 2, A$
			MD%(M, 15) = 1
		ELSE
			PGPRT 2, MN$(M) + " is here."
		END IF
	END IF
	NEXT
	FOR A = 1 TO NZ
	IF AD%(A, 4) = ROOM THEN
		IF AD%(A, 9) = 0 THEN
			GET #2, A + ART.ADJ, Desc
			A$ = RTRIM$(Desc)
			PGPRT 2, A$
			AD%(A, 9) = 1
		ELSE
			PGPRT 2, "You see " + AN$(A) + "."
		END IF
	END IF
	NEXT
	FOR A = A TO NA
	IF AD%(A, 4) = ROOM THEN PGPRT 2, "Your " + AN$(A) + " is here."
	NEXT
Get.Command:
	PGPRT 0, " "
	PGPRT 1, " "
	COLOR hfg%, hbg%
	PRINT " Your Command ";
	COLOR fgc%, bgc%
	LINE INPUT " ", A$
	A$ = LTRIM$(RTRIM$(A$))
	IF A$ = "" THEN A$ = CZ$: LOCATE CSRLIN - 1, 16: PRINT A$
	IF A$ = "" THEN GOTO List.Commands
	A$ = UCASE$(A$)
	IF A$ = "EXIT NOW" THEN GOTO Game.Over
	CZ$ = A$
	V$ = ""
	A = INSTR(A$, " ")
	IF A = 0 THEN A = LEN(A$) + 1
	V$ = LEFT$(A$, A - 1)
	S$ = MID$(A$, A + 1)
	IF V$ = "" THEN V$ = A$: S$ = ""
	S$ = LTRIM$(RTRIM$(S$))
	C = 0
	FOR X = 1 TO 6
	IF LEFT$(UCASE$(C$(X)), LEN(V$)) = V$ THEN C = X
	NEXT
	IF C > 0 THEN GOTO Branch.Rtn
	F = 0
	FOR X = 7 TO NBR.CMD
	IF UCASE$(C$(X)) = V$ THEN C = X: F = 1: X = NBR.CMD: GOTO 270
	IF LEFT$(UCASE$(C$(X)), LEN(V$)) = V$ THEN F = F + 1: C = X
270 ' LABEL.270
	NEXT
	IF F = 1 THEN GOTO Branch.Rtn
List.Commands:
	PGPRT 2, "Huh? I only understand these commands ---  "
	FOR C = 1 TO NBR.CMD
	PRINT C$(C); SPC(20 - LEN(C$(C)));
	NEXT
	PGPRT INT(NBR.CMD / 4) + 2, " "
	GOTO Get.Command
	IF C$(C) = S$ THEN S$ = V$: V$ = C$(C)
Branch.Rtn:
	ON C GOTO Move.Rtn, Move.Rtn, Move.Rtn, Move.Rtn, Move.Rtn, Move.Rtn, Get.Rtn, Get.Rtn, Drop.Rtn, Look.Rtn, Look.Rtn, Attack.Rtn, Flee.Rtn, Give.Rtn, Inventory.Rtn, Blast.Spell, Heal.Spell, Power.Spell, Speed.Spell, Smile.Rtn, Smile.Rtn,  _
Say.Something, Ready.Weapon, 20000, 24000, 18000
Get.Back:
REM $$INCL:'\EAMON\COPY\NEWBATL.BAS'
    IF TT > 0 THEN TT = TT - 1: GOTO End.Battle
    IF NBTL = 0 THEN GOTO End.Battle
    FOR M = 1 TO NM
        IF MD%(M, 5) = ROOM AND TT = 0 THEN
            MR = FD%(MD%(M, 14)) / TD%(MD%(M, 14)) - FD%(4 - MD%(M, 14)) / TD%(4 - MD%(M, 14)) / 5 + INT(41 * RND(1) - 20)
            IF MD%(M, 4) < MR THEN
                GOSUB Find.Exit
                IF R2 > 0 THEN
                    PGPRT 2, MN$(M) + " flees!"
                    GOSUB MONSTER.LEAVES
                    EXIT FOR
                END IF
            END IF
            IF MD%(M, 14) = 3 THEN
                GOSUB GoodGuys.Attack
            ELSE
                GOSUB BadGuys.Attack
            END IF
        END IF
        NBTL = (FD%(1) < TD%(1))
        IF NBTL = 0 THEN EXIT FOR
    NEXT M
End.Battle:
    IF TT > 0 THEN TT = TT - 1
    GOTO End.Loop
BadGuys.Attack:
    OF = M
    IF TD%(1) = MD%(0, 1) THEN DF = 0: GOSUB Take.a.Swing: RETURN
    DF = -1
    FOR M2 = 1 TO NM
        IF MD%(M2, 5) = ROOM AND MD%(M2, 14) = 3 AND RND(1) < .25 THEN
            DF = M2
            GOSUB Take.a.Swing
            EXIT FOR
        END IF
    NEXT M2
    IF DF < 0 THEN DF = 0: GOSUB Take.a.Swing
    RETURN
GoodGuys.Attack:
    OF = M
    DF = -1
    FOR M2 = 1 TO NM
        IF MD%(M2, 5) = ROOM AND MD%(M2, 14) = 1 THEN
            DF = M2
            GOSUB Take.a.Swing
            EXIT FOR
        END IF
    NEXT M2
    RETURN
End.Loop:

    '------- (end of include file) -------    
 ' 
	GOTO Main.Loop
REM $$INCL:'\EAMON\COPY\MONLEAVE.BAS'
MONSTER.LEAVES:
    MD%(M, 5) = R2
    M2 = MD%(M, 14)
    TD%(M2) = TD%(M2) - MD%(M, 1)
    FD%(M2) = FD%(M2) - MD%(M, 13)
    NBTL = (FD%(1) < TD%(1))
    RETURN

    '------- (end of include file) -------    
 ' 
Initialize:
REM ///INITIALIZE DATA
	GOSUB OPEN.ARTIFACT
	FOR A = 1 TO NA
	GOSUB READ.ARTIFACT
	IF AD%(A, 2) > 1 AND AD%(A, 2) < 4 THEN NW = NW + 1
	NEXT A
	CLOSE 3
	NW = NW + 6
	DIM WN$(NW), WR%(NW), WT%(NW), WC%(NW), WD%(NW), WP%(NW), WS%(NW)
	GOSUB OPEN.MONSTER
	FOR M = 1 TO NM
	GOSUB READ.MONSTER
	NEXT M
	CLOSE 3
REM $$INCL:'\Eamon\COPY\READMEAT.BAS'
    OPEN "MEAT" FOR INPUT AS #2
    INPUT #2, Nbr.Party
    INPUT #2, REC
    INPUT #2, MN$(0)
    INPUT #2, MD%(0, 1)
    INPUT #2, MD%(0, 2)
    INPUT #2, MD%(0, 3)
    CH = MD%(0, 3)
    FOR X = 1 TO 4
    INPUT #2, SA%(X)
    S2%(X) = SA%(X)
    NEXT
    FOR X = 1 TO 5
    INPUT #2, WA%(X)
    NEXT
    INPUT #2, SEX$
    INPUT #2, GOLD&
    INPUT #2, BANK&
    INPUT #2, AE
    INPUT #2, ArmNam$
    INPUT #2, ArmHit
    INPUT #2, ArmAdj
    INPUT #2, ShdNam$
    INPUT #2, ShdHit
    INPUT #2, ShdAdj
    FOR X = 1 TO 4
      INPUT #2, A$
      IF RTRIM$(A$) = "" THEN A$ = "NONE"
      WN$(X) = A$
      INPUT #2, WT%(X)
      INPUT #2, WC%(X)
      INPUT #2, WD%(X)
      INPUT #2, WS%(X)
      IF A$ <> "NONE" THEN
          NA = NA + 1
          AN$(NA) = WN$(X)
          AD%(NA, 2) = 2
          AD%(NA, 3) = 2
          AD%(NA, 4) = -1
          AD%(NA, 5) = WC%(X)
          AD%(NA, 6) = WT%(X)
          AD%(NA, 7) = WD%(X)
          AD%(NA, 8) = WS%(X)
      END IF
    NEXT
    IF ArmHit <> 0 THEN
          WN$(5) = ArmNam$ + " Armor"
          WT%(5) = 1
          WD%(5) = ArmHit
          WC%(5) = ArmAdj
          NA = NA + 1
          MD%(0, 8) = ArmHit
          Armptr = NA
          AN$(NA) = WN$(5)
          AD%(NA, 1) = ArmHit * 15
          AD%(NA, 2) = 11
          AD%(NA, 3) = ArmHit * 2
          AD%(NA, 4) = -1
          AD%(NA, 5) = WC%(X)
          AD%(NA, 6) = WT%(X)
          AD%(NA, 7) = WD%(X)
          AD%(NA, 8) = WS%(X)
    END IF
    IF ShdHit <> 0 THEN
          WN$(6) = ShdNam$ + " Shield"
          WT%(6) = 2
          WD%(6) = ShdHit
          WC%(6) = ShdAdj
          NA = NA + 1
          MD%(0, 8) = MD%(0, 8) + ShdHit
          Shdptr = NA
          AN$(NA) = WN$(6)
          AD%(NA, 1) = ArmHit * 15
          AD%(NA, 2) = 11
          AD%(NA, 3) = ArmHit * 2
          AD%(NA, 4) = -1
          AD%(NA, 5) = WC%(X)
          AD%(NA, 6) = WT%(X)
          AD%(NA, 7) = WD%(X)
          AD%(NA, 8) = WS%(X)
    END IF
    INPUT #2, MastPath$
    CLOSE 2
    EA = -(ArmAdj + ShdAdj)
    MD%(0, 8) = ArmHit + ShdHit
    IF NA > NZ THEN
        MD%(0, 10) = MD%(0, 2) * 2 + WC%(1) + WA%(WT%(1)) + (EA + AE) * ABS(-EA > AE)
        MD%(0, 7) = 0
        MD%(0, 9) = NZ + 1
        MD%(0, 11) = WD%(1)
        MD%(0, 12) = WS%(1)
        MD%(0, 14) = 3
    END IF

    '------- (end of include file) -------    
 ' 
	GOSUB OPEN.DESC
	GOSUB Open.RmNames
	GOSUB Open.Rooms
	FOR S = 1 TO 4
	S2%(S) = SA%(S)
	NEXT
	ROOM = 1
	ND = 6
	R2 = 1
	IF SEX$ = "F" THEN AD%(7, 4) = 0: AD%(8, 4) = 14
	GOTO Move.It
	DATA 26
	DATA North,South,East,West,Up,Down,Get,Take,Drop,Look,Examine,Attack
	DATA Flee,Give,Inventory,Blast,Heal,Power,Speed,Smile,Wave,Say,Ready
	DATA Open,Free,Hit
Game.Over:
	PRINT
	PRINT "(Press any key to continue)   ";
	A$ = INPUT$(1)
	PRINT
	CLOSE
	GOSUB RESTORE.SMITHY
	IF SPD > 0 THEN MD%(0, 2) = MD%(0, 2) / 2
	IF DIE THEN GOTO Get.Master
	FOR W = 1 TO 4
	WN$(W) = "NONE"
	NEXT
	W2 = 1
	FOR A = 1 TO NA
	IF AD%(A, 2) > 1 AND AD%(A, 2) < 4 AND AD%(A, 4) = -1 THEN WN$(W2) = AN$(A): WP%(W2) = A: W2 = W2 + 1: AD%(A, 4) = 0
	NEXT A
	IF W2 < 6 THEN 2300
2060 ' LABEL.2060
	CLS
	LOCATE 5, 1
	PRINT "As you start to enter the Main Hall, Lord William Misslefire appears and"
	PRINT "tells you, 'You have too many weapons to keep them all--4 is the limit."
	PRINT
	PRINT "Your weapons are--"
	FOR W = 1 TO W2 - 1
	PRINT SPC(4); W; "--"; WN$(W)
	NEXT
	PRINT
	PRINT "Enter the number of the weapon to sell     (1-"; W2 - 1; ") "
2080 ' LABEL.2080
	LOCATE CSRLIN - 1, 53
	INPUT A$
	W5 = VAL(A$)
	IF W5 < 1 OR W5 > W2 - 1 OR W5 <> INT(W5) THEN 2080
	AD%(WP%(W5), 4) = -1
	WN$(W5) = WN$(W2 - 1)
	WP%(W5) = WP%(W2 - 1)
	W2 = W2 - 1
	IF W2 > 5 THEN 2060
2300 ' LABEL.2300
	FOR W = 1 TO 4
	IF WP%(W) THEN WT%(W) = AD%(WP%(W), 6): WC%(W) = AD%(WP%(W), 5): WD%(W) = AD%(WP%(W), 7): WS%(W) = AD%(WP%(W), 8)
	NEXT W
	CLS
	LOCATE 5, 1
	PRINT "As you deliver your treasures to Sam Slicker, the local buyer for such"
	PRINT "things, he examines your goods and pays you ";
	TP = 0
	FOR A = 1 TO NA
	IF A = ArmPtr OR A = ShdPtr THEN GOTO 2350
	IF AD%(A, 4) <> -1 THEN 2350
	IF AD%(A, 2) <> 0 THEN AD%(A, 1) = AD%(A, 1) * CH / 10
	TP = TP + AD%(A, 1)
2350 ' LABEL.2350
	NEXT A
	PRINT TP; " gold pieces."
	PRINT
	IF MD%(10, 5) <> 0 THEN PGPRT 2, "For calling forth Molinar, the King rewards you with " + STR$(100 * CH) + " gold pieces.": TP = TP + 100 * CH
	IF MD%(10, 5) <> 0 AND MD%(11, 5) <> 0 THEN PGPRT 2, "Molinar kills Monimar, informing you that he was the most evil wizard ever     born.  He agrees not to tell anyone about your goof in freeing him.": MD%(11, 5) = 0
	GOLD& = GOLD& + TP
	IF GOLD& < 0 THEN GOLD& = 0
	PRINT
	PRINT "(HIT ANY KEY TO CONTINUE)  ";
	A$ = INPUT$(1)
	PRINT
Get.Master:  '
	CLS
	LOCATE 5, 1
 '  PRINT "  Insert Eamon Master Diskette, and press <RETURN>  OR     "
 '  PRINT
 '  PRINT "  Enter Path of Master ===> ";
 '  INPUT "", MastPath$
	IF INSTR(MastPath$, ":") = 2 THEN DR$ = LEFT$(MastPath$, 2): MastPath$ = MID$(MastPath$, 3): SHELL DR$
	IF MastPath$ <> "" THEN CHDIR MastPath$
	ON ERROR GOTO Invalid.Path
	IF MD%(11, 5) = 0 THEN 2540
	KILL PATH$ + "CHARACT.DAT"
	OPEN PATH$ + "CHARACT.DAT" FOR RANDOM AS #1 LEN = 256
	NC = 0
	PUT #1, 1, NC
	CLOSE
	DIE = 1
	PGPRT 3, "You released the evil wizard Monimar from his bondage.  His insane"
	PGPRT 1, "  experiments destroy the universe, killing you and everyone else on this      diskette."
2540 ' LABEL.2540
	IF DIE THEN KILL "ADVENT": GOTO 2900
	CLOSE
	GOSUB OPEN.CHARACTERS
	Nam$ = MN$(0)
	Hd = MD%(0, 1)
	Ag = MD%(0, 2)
	GOSUB WRITE.CHARACTER
	CLOSE
	GOSUB RESTORE.MAN.IN.MIRROR
	OPEN PATH$ + "ADVENT" FOR OUTPUT AS #2
	WRITE #2, MN$(0)
	WRITE #2, REC
	CLOSE
2900 ' LABEL.2900
	CLEAR
	RUN "HALL"
Invalid.Path:
	PRINT
	PRINT "Invalid Path, or Master Not Found. Please re-try ..."
	PRINT " (press any key to continue)";
	A$ = INPUT$(1)
	RESUME Get.Master
Move.Rtn:
	IF NBTL <> 0 AND S$ <> "FLEE" THEN PGPRT 2, "You don't want to turn your back here.": GOTO Main.Loop
	R2 = RD%(C)
	IF R2 > MAX.RM THEN GOTO Passage.Blocked
3040 ' LABEL.3040
	IF R2 > 0 THEN GOTO Move.It
REM ///SPECIAL MOVES
	IF R2 = -99 THEN PGPRT 2, "You successfully ride off into the sunset.": GOTO Game.Over
	IF R2 = -17 THEN R2 = 17: GOTO Move.It
	IF R2 = -18 AND AD%(5, 4) = ROOM THEN R2 = 18: GOTO Move.It
	IF R2 = -12 AND F1 THEN R2 = 12: GOTO Move.It
	IF R2 = 0 THEN GOTO Cant.Go
	GOTO Cant.Go
Passage.Blocked:
	PBL = R2 - 100
	IF AD%(PBL, 7) = 0 THEN R2 = AD%(PBL, 5): GOTO 3040
	IF AD%(PBL, 6) = 0 THEN R2 = AD%(PBL, 5): GOTO 3040
	PGPRT 2, "The " + AN$(PBL) + " blocks the way!"
	GOTO Main.Loop
Cant.Go:
	PGPRT 2, "You can't go that way!"
	V%(ROOM) = 0
	GOTO Main.Loop
Move.It:
	IF AD%(7, 4) = ROOM OR AD%(8, 4) = ROOM THEN PGPRT 2, "A lightning bolt strikes you from the walls!": DF = 0: D = 3: S = 10: GOSUB 7635
	IF MD%(9, 5) = ROOM THEN RC = 0
	IF ROOM = 12 AND MD%(11, 5) = ROOM THEN MD%(11, 3) = 0: MD%(11, 14) = 1: R3 = ROOM: GOSUB Chk.Reactions: GOTO Get.Back
	R3 = ROOM
	ROOM = R2
	GOSUB Chk.Reactions
	GOSUB 41400
	NX = 0
	FOR X = 1 TO ND
	IF RD%(X) > 0 AND RD%(X) <= NR THEN NX = NX + 1
	NEXT
	Lt = NL OR LM
	GOTO Main.Loop
Chk.Reactions:
	TD%(1) = 0
	TD%(3) = MD%(0, 1)
	FD%(1) = 0
	FD%(3) = MD%(0, 13)
	FOR M = 1 TO NM
	IF MD%(M, 5) = R3 THEN IF MD%(M, 14) = 3 OR (MD%(M, 14) = 1 AND FNR(200) < MD%(M, 4)) THEN MD%(M, 5) = ROOM: GOTO 3670
	IF MD%(M, 5) <> ROOM THEN 3900
	IF MD%(M, 14) THEN 3670
	Fr = MD%(M, 3)
	IF Fr AND Fr <> 100 THEN Fr = Fr + INT((CH - 10) * 2)
	MD%(M, 14) = 1
	IF Fr > FNR(100) THEN MD%(M, 14) = 2: IF Fr > FNR(100) THEN MD%(M, 14) = 3
3670 ' LABEL.3670
	A = MD%(M, 14)
	FD%(A) = FD%(A) + MD%(M, 13)
	TD%(A) = TD%(A) + MD%(M, 1)
3900 ' LABEL.3900
	NEXT M
	NBTL = (TD%(1) > 0)
	RETURN
Get.Rtn:
	GOSUB Get.Subj
	IF S$ = "ALL" THEN 4160
	IF S$ = "TORCH" THEN PGPRT 2, "All torches are bolted to the wall and cannot be removed.": GOTO Get.Back
	EMB = ROOM + 200
	WH = ROOM
	HA = ROOM
	GOSUB Locate.Artifact
	IF FOUND = 0 THEN PGPRT 2, "I see no " + S$ + " here!": GOTO Main.Loop
	GOSUB Get.Special
	IF GT = 0 THEN GOTO Main.Loop
	IF WT + AD%(A, 3) > 10 * MD%(0, 1) THEN PGPRT 2, "It is too heavy for you.": GOTO Main.Loop
	PGPRT 2, "Got it."
	AD%(A, 4) = -1
	SZ = SZ + AD%(A, 0)
	WT = WT + AD%(A, 3)
	IF AD%(A, 2) = 11 THEN
  IF AD%(A, 6) = 1 AND MD%(0, 8) = 0 THEN GOTO Wear.Armor
  IF AD%(A, 6) = 2 THEN GOTO Use.Shield
	END IF
	IF (AD%(A, 2) < 2 OR AD%(A, 2) > 3) OR MD%(0, 9) <> -1 THEN GOTO Get.Back
	GOTO Ready.Weapon
4160 ' LABEL.4160
	IF AD%(21, 4) = ROOM THEN PGPRT 2, "You shouldn't have done that!": AD%(20, 4) = 0: AD%(21, 4) = 0: MD%(16, 5) = ROOM: R3 = ROOM: GOSUB Chk.Reactions: GOTO Get.Back
	' ---- Get All ----
	FOR A = 1 TO NA
	IF AD%(A, 4) = ROOM THEN
  GOSUB Get.Special
  IF GT THEN
	  IF WT + AD%(A, 3) > 10 * MD%(0, 1) THEN
	PGPRT 2, AN$(A) + " is too heavy."
	  ELSE
	PGPRT 2, AN$(A) + " taken."
	AD%(A, 4) = -1
	WT = WT + AD%(A, 3)
	  END IF
  END IF
	END IF
	NEXT
	GOTO Get.Back
Get.Special:
REM ///INSERT HERE SPECIAL EFFECTS OF PICKING SOMETHING UP
	IF AD%(A, 2) = 11 AND AD%(A, 6) = 1 AND Armptr = 0 THEN
  Armptr = A
  GOSUB Ready.Armor
	END IF
	IF AD%(A, 2) = 11 AND AD%(A, 6) = 2 AND Shdptr = 0 THEN
  Shdptr = A
  GOSUB Ready.Armor
	END IF
	IF A <> 2 THEN GT = -1: RETURN
	PGPRT 2, "As you grab the mirror, you feel yourself being turned inside out. When"
	PGPRT 2, "your vision clears, you find yourself in the mirror."
	MD%(0, 3) = 100
	MD%(0, 4) = 50
	OPEN PATH$ + "MIRROR" FOR OUTPUT AS #1
	PRINT #1, MN$(0)
	PRINT #1, MD%(0, 1)
	PRINT #1, MD%(0, 2)
	PRINT #1, CH
	FOR A = 1 TO 4
	PRINT #1, SA%(A)
	NEXT
	FOR A = 1 TO 5
	PRINT #1, WA%(A)
	NEXT
	PRINT #1, AE
	PRINT #1, SEX$
	PRINT #1, 0
	PRINT #1, BANK&
	PRINT #1, ArmNam$
	PRINT #1, ArmHit
	PRINT #1, ArmAdj
	PRINT #1, ShdNam$
	PRINT #1, ShdHit
	PRINT #1, ShdAdj
	FOR A = 1 TO 4
	PRINT #1, "NONE"
	PRINT #1, 0
	PRINT #1, 0
	PRINT #1, 0
	PRINT #1, 0
	NEXT
	CLOSE
	GOSUB OPEN.MONSTER
	MD%(0, 9) = -1
	MONSTER.Nam = MN$(0)
	MONSTER.Hd = MD%(0, 1)
	MONSTER.Ag = MD%(0, 2)
	MONSTER.Fr = MD%(0, 3)
	MONSTER.Cour = MD%(0, 4)
	MONSTER.ROOM = 8
	MONSTER.Wght = MD%(0, 6)
	MONSTER.DOdds = MD%(0, 7)
	MONSTER.Armor = MD%(0, 8)
	MONSTER.Weapon = MD%(0, 9)
	MONSTER.OOdds = MD%(0, 10)
	MONSTER.Dice = MD%(0, 11)
	MONSTER.Sides = MD%(0, 12)
	PUT #3, 1, MONSTER
	CLOSE
	OPEN "DESC.TXT" FOR RANDOM AS #2 LEN = 256
	OPEN "ARTIF.TXT" FOR RANDOM AS #3 LEN = 128
	FOR A = 1 TO 4
	Artifact.Nam = WN$(A)
	Artifact.Value = 100
	Artifact.typ = 2
	Artifact.Wght = 3
	Artifact.ROOM = 8 * ABS(WN$(A) <> "NONE")
	Artifact.Odds = WC%(A)
	Artifact.Wpntyp = WT%(A)
	Artifact.Dice = WD%(A)
	Artifact.Sides = WS%(A)
	PUT #3, A + 22, Artifact
	Desc = "You see a weapon called a " + WN$(A)
	PUT #2, A + 122, Desc
	NEXT
	Artifact.Nam = WN$(5)
	Artifact.Value = 100
	Artifact.typ = 11
	Artifact.Wght = 3
	IF WN$(5) = "" THEN WN$(5) = "NONE"
	Artifact.ROOM = (8 * ABS(WN$(5) <> "NONE"))
	Artifact.Odds = WC%(5)
	Artifact.Wpntyp = WT%(5)
	Artifact.Dice = WD%(5)
	Artifact.Sides = WS%(5)
	PUT #3, 27, Artifact
	Desc = "You see " + WN$(5)
	PUT #2, 127, Desc
	Artifact.Nam = WN$(6)
	Artifact.Value = 100
	Artifact.typ = 11
	Artifact.Wght = 3
	IF WN$(6) = "" THEN WN$(6) = "NONE"
	Artifact.ROOM = (8 * ABS(WN$(6) <> "NONE"))
	Artifact.Odds = WC%(6)
	Artifact.Wpntyp = WT%(6)
	Artifact.Dice = WD%(6)
	Artifact.Sides = WS%(6)
	PUT #3, 28, Artifact
	LSET Desc = "You see " + WN$(6)
	PUT #2, 128, Desc
	IF GOLD& > 32767 THEN GOLD& = 32767
	Artifact.Nam = "Gold Sack"
	Artifact.Value = GOLD&
	Artifact.typ = 0
	Artifact.Wght = GOLD& / 100
	IF WN$(5) = "" THEN WN$(5) = "NONE"
	Artifact.ROOM = 8
	Artifact.Odds = 0
	Artifact.Wpntyp = 0
	Artifact.Dice = 0
	Artifact.Sides = 0
	PUT #3, 22, Artifact
	Desc = "You see a gold sack with " + STR$(GOLD&) + " pieces."
	PUT #2, 122, Desc
	Desc = "You see a free adventurer named " + MN$(0)
	PUT #2, 301, Desc
	CLOSE
	DIE = -1
	GOTO Game.Over
REM ///RESTORE FILES IF SURVIVES
RESTORE.SMITHY:
	IF MD%(1, 5) = 0 OR DIE THEN RETURN
	GOSUB OPEN.MONSTER
	MONSTER.Nam = "Smithy"
	MONSTER.Hd = 18
	MONSTER.Ag = 16
	MONSTER.Fr = 100
	MONSTER.Cour = 50
	MONSTER.ROOM = 0
	MONSTER.Wght = 0
	MONSTER.DOdds = 0
	MONSTER.Armor = 1
	MONSTER.Weapon = -1
	MONSTER.OOdds = 32
	MONSTER.Dice = 0
	MONSTER.Sides = 0
	PUT #3, 1, MONSTER
	CLOSE 3
	OPEN "DESC.TXT" FOR RANDOM AS #2 LEN = 256
	OPEN "artif.txt" FOR RANDOM AS #3 LEN = 128
	Artifact.Nam = "Axe"
	Artifact.Value = 50
	Artifact.typ = 2
	Artifact.Wght = 3
	Artifact.ROOM = 8
	Artifact.Odds = 10
	Artifact.Wpntyp = 1
	Artifact.Dice = 1
	Artifact.Sides = 6
	PUT #3, 23, Artifact
	Artifact.Nam = "NONE"
	Artifact.Value = 0
	Artifact.typ = 0
	Artifact.Wght = 0
	Artifact.ROOM = 0
	Artifact.Odds = 0
	Artifact.Wpntyp = 0
	Artifact.Dice = 0
	Artifact.Sides = 0
	FOR W = 24 TO 26
	PUT #3, W, Artifact
	NEXT
	Desc = "You see an axe."
	PUT #2, 123, Desc
	Artifact.Nam = "Gold Sack"
	Artifact.Value = 500
	Artifact.typ = 0
	Artifact.Wght = 5
	Artifact.ROOM = 8
	Artifact.Odds = 0
	Artifact.Wpntyp = 0
	Artifact.Dice = 0
	Artifact.Sides = 0
	PUT #3, 22, Artifact
	Desc = "You see a gold sack with 500 gold pieces."
	PUT #2, 122, Desc
	Desc = "You see a free adventurer. He says his name is Smithy."
	PUT #2, 301, Desc
	CLOSE
	IF UCASE$(MN$(1)) = "SMITHY" THEN RETURN
	OPEN "MIRROR" FOR INPUT AS #1
	INPUT #1, NY$
	INPUT #1, Hy
	INPUT #1, Gy
	INPUT #1, Cy
	FOR A = 1 TO 4
	INPUT #1, SY%(A)
	NEXT
	FOR A = 1 TO 5
	INPUT #1, WY%(A)
	NEXT
	INPUT #1, E2, SY$, A, B6&
	INPUT #1, Han$, HAH, HAJ
	INPUT #1, HSN$, HSH, HSJ
	CLOSE
	RETURN
REM ///RESTORE CHARACTER TO CHARACTERS FILE
RESTORE.MAN.IN.MIRROR:
	 IF UCASE$(MN$(1)) = "SMITHY" THEN RETURN
	 OPEN "CHARACT.DAT" FOR RANDOM AS #1 LEN = 256
	 NC = 0
	 GET #1, 1, NC
	 CLOSE 1
	 GOSUB OPEN.CHARACTERS
'    GOSUB READ.CHARACTER    ' commented cause I see no reason for this!
	 A = 0
	 FOR X = 1 TO NC
   GET #1, X + 1, Char
   A$ = RTRIM$(Char.Nam)
   IF LEFT$(A$, 1) = "*" THEN A = X        ' Found a dead guy!
	 NEXT
	 IF A = 0 THEN A = NC + 1: NC = NC + 1: PUT #1, 1, NC
	 Char.Nam = NY$
	 Char.Hd = Hy
	 Char.Ag = Gy
	 Char.CH = Cy
	 Char.SA1 = SY%(1)
	 Char.SA2 = SY%(2)
	 Char.SA3 = SY%(3)
	 Char.SA4 = SY%(4)
	 Char.WA1 = WY%(1)
	 Char.WA2 = WY%(2)
	 Char.WA3 = WY%(3)
	 Char.WA4 = WY%(4)
	 Char.WA5 = WY%(5)
	 Char.AE = E2
	 Char.SEX = SY$
	 Char.GOLD = 0
	 Char.BANK = B6&
'    FOR A = 1 TO 4
'    SWAP SA%(A), SY%(A)
'    NEXT
'    FOR A = 1 TO 5
'    SWAP WA%(A), WY%(A)
'    NEXT
'    SWAP AE, E2
'    SWAP SEX$, SY$
'    GOLD& = 0
'    BANK& = B6&
	 Char.ArmNam = Han$
	 Char.ArmHit = HAH
	 Char.ArmAdj = HAJ
	 Char.ShdNam = HSN$
	 Char.ShdHit = HSH
	 Char.ShdAdj = HSJ
	 Char.Wpn1Nam = "NONE"
	 Char.Wpn1Typ = 0
	 Char.Wpn1WpnTyp = 0
	 Char.Wpn1Odds = 0
	 Char.Wpn1Dice = 0
	 Char.Wpn1Sides = 0
	 Char.Wpn2Nam = "NONE"
	 Char.Wpn2Typ = 0
	 Char.Wpn2WpnTyp = 0
	 Char.Wpn2Odds = 0
	 Char.Wpn2Dice = 0
	 Char.Wpn2Sides = 0
	 Char.Wpn3Nam = "NONE"
	 Char.Wpn3Typ = 0
	 Char.Wpn3WpnTyp = 0
	 Char.Wpn3Odds = 0
	 Char.Wpn3Dice = 0
	 Char.Wpn3Sides = 0
	 Char.Wpn4Nam = "NONE"
	 Char.Wpn4Typ = 0
	 Char.Wpn4WpnTyp = 0
	 Char.Wpn4Odds = 0
	 Char.Wpn4Dice = 0
	 Char.Wpn4Sides = 0
	 PUT #1, A + 1, Char
'    SWAP ArmNam$, HAN$
'    SWAP ArmHit, HAH
'    SWAP ArmAdj, HAJ
'    SWAP ShdNam$, HSN$
'    SWAP ShdHit, HSH
'    SWAP ShdAdj, HSJ
'    FOR A = 1 TO 4
'    WN$(A) = "NONE"
'    WT%(A) = 0
'    WC%(A) = 0
'    WD%(A) = 0
'    WS%(A) = 0
'    NEXT
	SWAP Nam$, NY$
	CLOSE
	RETURN
MONSTER.SEARCH:
REM  >>> MONST SEARCH
	WH = ROOM
	HA = -1
	EMB = ROOM
	FOUND = 0
	SL = LEN(S$)
	FOR X = 1 TO NM
	IF (LEFT$(UCASE$(MN$(X)), SL) = S$ OR RIGHT$(UCASE$(MN$(X)), SL) = S$) AND (MD%(X, 5) = WH OR MD%(X, 5) = HA) THEN FOUND = FOUND + 1: M = X: IF S$ = MN$(X) THEN X = 999
	NEXT
	RETURN
Artifact.Search:
	WH = ROOM
	HA = -1
	EMB = ROOM
Locate.Artifact:
	FOUND = 0
	SL = LEN(S$)
	FOR X = 1 TO NA
	IF (LEFT$(UCASE$(AN$(X)), SL) = S$ OR RIGHT$(UCASE$(AN$(X)), SL) = S$) AND (AD%(X, 4) = WH OR AD%(X, 4) = EMB OR AD%(X, 4) = HA) THEN FOUND = FOUND + 1: A = X: IF S$ = AN$(X) THEN X = 999
	NEXT
	RETURN
Get.Subj:
REM ///ROUTINE TO GET S$ IF NOT PREVIOUSLY SPECIFIED.
	WHILE S$ = ""
	PRINT C$(C); " what";
	INPUT S$
	PGPRT 1, ""
	WEND
	S$ = UCASE$(S$)
	RETURN
Drop.Rtn:
	GOSUB Get.Subj
	IF S$ = "ALL" THEN GOTO Drop.All
	WH = -1
	HA = -1
	EMB = -1
	GOSUB Locate.Artifact
	IF FOUND = 0 THEN PGPRT 2, "You aren't carrying a " + S$ + ".": GOTO Main.Loop
	GOSUB Drop.it
Chk.Wght:
	IF WT > 10 * MD%(0, 1) THEN PGPRT 2, "You suddenly find you cannot carry all of the items you are carrying, and they fall to the ground.": GOTO Drop.All
5060 ' LABEL.5060
	GOTO Get.Back
Drop.All:
	FOR A = 1 TO NA
  IF AD%(A, 4) = -1 AND A <> Armptr THEN
	  GOSUB Drop.it
  END IF
	NEXT A
	WT = 0
	GOTO 5060
Drop.it:
	IF A = Armptr OR A = Shdptr THEN GOSUB DROP.ARMOR
	PGPRT 2, AN$(A) + " dropped.":
	AD%(A, 4) = ROOM
	WT = WT - AD%(A, 3)
	IF A = LS THEN LS = 0: LC = 0: LM = 0: Lt = NL: PGPRT 2, "The " + AN$(A) + " goes out."
	IF A = MD%(0, 9) THEN MD%(0, 9) = -1
	RETURN
DROP.ARMOR:
	IF A = Armptr THEN Armptr = 0
	IF A = Shdptr THEN Shdptr = 0
	MD%(0, 8) = MD%(0, 8) - AD%(A, 7)
	EA = EA + AD%(A, 5)
	W = MD%(0, 9)
	MD%(0, 10) = MD%(0, 2) * 2 + WA%(AD%(W, 6)) + AD%(W, 5) - ((EA + AE) * ABS(-EA > AE))
	RETURN
Ready.Armor:
	MD%(0, 8) = MD%(0, 8) + AD%(A, 7)
	EA = EA - AD%(A, 5)
	W = MD%(0, 9)
	MD%(0, 10) = MD%(0, 2) * 2 + WA%(AD%(W, 6)) + AD%(W, 5) - ((EA + AE) * ABS(-EA > AE))
	RETURN
Look.Rtn:
REM ///LOOK COMMAND
	IF S$ = "COFFIN" AND AD%(5, 4) = ROOM THEN A = 5: GOTO HAVE.ART.TO.LOOK
	IF S$ = "COFFIN" AND AD%(4, 4) = ROOM THEN A = 4: GOTO HAVE.ART.TO.LOOK
	LK = 0
	IF S$ = "" THEN 6150
	GOSUB Artifact.Search
	IF FOUND = 0 THEN 6040
HAVE.ART.TO.LOOK:
	GOSUB Examine.Artifact
	LK = -1
	AD%(A, 9) = 1
	IF AD%(A, 4) = EMB THEN AD%(A, 4) = ROOM
	IF LK THEN GOTO Get.Back
6040 ' LABEL.6040
	GOSUB MONSTER.SEARCH
	IF FOUND = 0 THEN 6060
	GOSUB Examine.Monster
	LK = -1
	IF LK THEN GOTO Get.Back
6060 ' LABEL.6060
	IF S$ <> "" THEN 6150
	FOR X = 1 TO ND
	IF RD%(X) < 0 AND ABS(RD%(X)) <= NR THEN PGPRT 2, "You found a secret passage " + C$(X) + "!": RD%(X) = ABS(RD%(X)): V%(ROOM) = 2
	NEXT
	WH = ROOM + 300
	HA = WH
	EMB = WH
	GOSUB Locate.Artifact
	IF FOUND <> 0 THEN AD%(A, 4) = ROOM: PGPRT 2, "You found something.": GOTO Get.Back
6150 ' LABEL.6150
	V%(ROOM) = V%(ROOM) + 1
	GOTO Get.Back
Examine.Artifact:
	IF A = 4 OR A = 5 THEN PGPRT 2, "You found a secret button!": AD%(6, 4) = ROOM: RETURN
	GET #2, A + 100, Desc
	A$ = RTRIM$(Desc)
	PGPRT 2, A$
	RETURN
Examine.Monster:
	GET #2, M + 300, Desc
	A$ = RTRIM$(Desc)
	PGPRT 2, A$
	LK = -1
	RETURN
' Secret Passage - PUT MESSAGE HERE IF NEEDED
	PGPRT 2, "You found a secret passage " + C$(X) + "!"
	RD%(X) = ABS(RD%(X))
	V%(ROOM) = 2
	RETURN
Attack.Rtn:
	GOSUB Get.Subj
	IF Lt = 0 THEN PGPRT 2, "You swing wild --- nothing hit.": GOTO Get.Back
	GOSUB MONSTER.SEARCH
	IF FOUND = 0 THEN 7150
	GOTO 7290
7150 ' LABEL.7150
	WH = ROOM
	HA = ROOM
	EMB = ROOM + 200
	GOSUB Locate.Artifact
	IF FOUND = 0 THEN PGPRT 2, "Attack who?": GOTO Main.Loop
	IF AD%(A, 2) <> 8 AND AD%(A, 2) <> 4 THEN PGPRT 2, "Are you crazy?!": GOTO Main.Loop
	S = 7
	K = 6
	IF AD%(A, 2) = 4 THEN S = S - 1: K = K - 1
	D2 = 0
	FOR X = 1 TO MD%(0, 11)
	D2 = D2 + FNR(MD%(0, 12))
	NEXT
	AD%(A, S) = AD%(A, S) - D2
	IF AD%(A, S) <= 0 THEN AD%(A, S) = 0: AD%(A, K) = 0: PGPRT 2, "The " + AN$(A) + " shatters!": GOTO Get.Back
	PGPRT 2, "WHAM!! You hit the " + AN$(A) + "!"
	GOTO Get.Back
7290 ' LABEL.7290
	IF MD%(0, 9) = -1 THEN PGPRT 2, "You have no weapon ready!": GOTO Main.Loop
	OF = 0
	DF = M
	GOSUB Take.a.Swing
	IF HIT = 0 THEN 7360
	IF INC THEN W2 = AD%(MD%(0, 9), 6): WA%(W2) = WA%(W2) + 2
	IF -EA <= AE THEN 7360
	IF FNR(100) <= MD%(0, 10) THEN 7360
	A = 2
	IF EA + AE = -1 THEN A = 1
	AE = AE + A
	MD%(0, 10) = MD%(0, 10) + A
7360 ' LABEL.7360
REM --- Guardian stops
	IF DF = 9 THEN RC = RC + 1: IF RC = 10 THEN PGPRT 2, "Suddenly the Guardian stops moving!": MD%(DF, 14) = 2: RC = 0: R3 = ROOM: GOSUB Chk.Reactions: GOTO Get.Back
	IF DF = 11 THEN MD%(DF, 3) = 0
	IF MD%(DF, 14) = 1 OR DF = 0 THEN GOTO Get.Back
	MD%(DF, 3) = MD%(DF, 3) / 2
	FOR M = 1 TO NM
	IF MD%(M, 5) = ROOM AND MD%(M, 14) > 1 THEN MD%(M, 14) = 0
	NEXT M
	R3 = ROOM
	GOSUB Chk.Reactions
	GOTO Get.Back
Monster.Get.Gun:
REM ///MONSTER TRIES TO PICK UP WEAPON
	IF MD%(OF, 10) = 0 THEN RETURN
	A = 0
	FOR X = 1 TO NA
	IF AD%(X, 4) = ROOM AND (AD%(X, 2) = 2 OR AD%(X, 2) = 3) THEN A = X: X = NA
	NEXT
	IF A = 0 THEN RETURN
	PGPRT 2, MN$(OF) + " picks up " + AN$(A) + "."
	AD%(A, 4) = 0
	MD%(OF, 9) = A
	MD%(OF, 10) = MD%(OF, 10) + AD%(A, 5)
	MD%(OF, 4) = MD%(OF, 4) * 2
	RETURN
Take.a.Swing:
	HIT = 0
	IF MD%(OF, 9) = -1 THEN GOTO Monster.Get.Gun
	PGPRT 2, MN$(OF) + " attacks " + MN$(DF)
	PRINT " --";
	RL = FNR(100)
	HIT = 0
	IF (RL < 5 OR RL < MD%(OF, 10) - MD%(DF, 7)) AND RL < 96 THEN HIT = -1
	IF HIT THEN 7600
	IF RL < 97 THEN PGPRT 1, "a miss.": RETURN
	PGPRT 1, "a Fumble!"
	Fr = FNR(100)
	IF Fr <= 35 + 40 * ABS(MD%(OF, 9) = 0) THEN PGPRT 1, " fumble recovered.": RETURN
	IF Fr < 76 THEN PGPRT 1, " weapon dropped!": AD%(MD%(OF, 9), 4) = ROOM: MD%(OF, 10) = MD%(OF, 10) - AD%(MD%(OF, 9), 5): MD%(OF, 9) = -1: MD%(OF, 4) = MD%(OF, 4) / 2: RETURN
	IF MD%(OF, 9) > 0 THEN W = MD%(OF, 9): IF AD%(W, 2) = 3 THEN PGPRT 2, "Sparks fly from " + AN$(W) + "!": RETURN
	IF Fr > 95 THEN 7550
	PGPRT 1, " weapon broken!"
	AD%(MD%(OF, 9), 4) = 0
	MD%(OF, 10) = MD%(OF, 10) - AD%(MD%(OF, 9), 5)
	MD%(OF, 9) = -1
	MD%(OF, 4) = MD%(OF, 4) / 2
	IF RND(1) > .5 THEN PGPRT 1, " ": RETURN
	PGPRT 1, " broken weapon hurts user!"
7550 ' LABEL.7550
	IF Fr = 100 THEN 7560
	D = MD%(OF, 11)
	S = MD%(OF, 12)
	DF = OF
	A = 1
	GOTO 7635
7560 ' LABEL.7560
	D = MD%(OF, 11) * 2
	S = MD%(OF, 12)
	DF = OF
	A = 0
	GOTO 7635
7600 ' LABEL.7600
	INC = (FNR(100) > MD%(OF, 10))
	MD%(OF, 10) = MD%(OF, 10) + 2 * ABS(INC)
	IF DF <> 15 OR MD%(OF, 9) <> 10 THEN 7605
	PGPRT 2, "The dragon is bound!"
	MD%(15, 5) = 0
	AD%(27, 4) = ROOM
	R3 = ROOM
	GOTO Chk.Reactions
7605 ' LABEL.7605
	D = MD%(OF, 11)
	S = MD%(OF, 12)
	A = 1
	IF RL > 5 THEN PGPRT 1, "a Hit!": GOTO 7635
	PGPRT 1, "A Critical Hit!"
	R2 = FNR(100)
	IF R2 < 51 THEN A = 0: GOTO 7635
	IF R2 < 86 THEN S = 1.5 * S: GOTO 7635
	IF R2 < 96 THEN D = 2 * D: GOTO 7635
	IF R2 < 100 THEN D = 3 * D: GOTO 7635
	GOTO 7700
7635 ' LABEL.7635
	D2 = 0
	FOR D3 = 1 TO D
	D2 = D2 + FNR(S)
	NEXT
	D2 = D2 - A * MD%(DF, 8)
	IF D2 < 1 THEN PGPRT 1, " blow bounces off armour!": RETURN
	MD%(DF, 13) = MD%(DF, 13) + D2
	IF MD%(DF, 13) >= MD%(DF, 1) THEN 7700
	A = MD%(DF, 14)
	FD%(A) = FD%(A) + D2
7650 ' LABEL.7650
	A$ = MN$(DF)
	ON INT(MD%(DF, 13) * 5 / MD%(DF, 1) + 1) GOTO 7655, 7660, 7665, 7670, 7675
7655 ' LABEL.7655
	PGPRT 1, A$ + " is still in good shape."
	RETURN
7660 ' LABEL.7660
	PGPRT 1, A$ + " is hurting."
	RETURN
7665 ' LABEL.7665
	PGPRT 1, A$ + " is in pain."
	RETURN
7670 ' LABEL.7670
	PGPRT 1, A$ + " is very badly injured!"
	RETURN
7675 ' LABEL.7675
	PGPRT 1, A$ + " is at death's door, knocking loudly!"
	RETURN
7700 ' LABEL.7700
	REM
	PGPRT 2, MN$(DF) + " is dead!"
	A = MD%(DF, 14)
	FD%(A) = FD%(A) + MD%(DF, 1) - MD%(DF, 13) + D2
	MD%(DF, 5) = 0
	FOR AJ = 1 TO NA
	IF AD%(AJ, 4) = -DF - 1 THEN AD%(AJ, 4) = ROOM
	NEXT
	IF MD%(DF, 9) > 0 THEN AD%(MD%(DF, 9), 4) = ROOM: MD%(DF, 10) = MD%(DF, 10) - AD%(MD%(DF, 9), 5): MD%(DF, 9) = -1: MD%(DF, 4) = MD%(DF, 4) / 2
	IF DF = 0 THEN DIE = 1: GOTO Game.Over
	A2 = DF + NZ - NM
	AD%(A2, 4) = ROOM
' PUT DEAD BODY IN ROOM
	RETURN
Flee.Rtn:
	IF NOT NBTL THEN PGPRT 2, "There's no reason to run!": GOTO Main.Loop
	IF NX = 0 THEN PGPRT 2, "There's no place to go!": GOTO Main.Loop
	IF S$ <> "" THEN
  C = 0
  FOR D = 1 TO ND
	  IF S$ = LEFT$(UCASE$(C$(D)), LEN(S$)) THEN C = D: EXIT FOR
  NEXT
  IF C > 0 THEN V$ = S$: S$ = "FLEE": GOTO Move.Rtn
	END IF
	GOSUB Find.Exit
	GOTO Move.It
Find.Exit:
	IF NX = 0 THEN R2 = ROOM: PGPRT 1, " ... but can't find an exit!": RETURN
	D = FNR(ND)
	R2 = RD%(D)
	IF R2 < 1 OR R2 > NR THEN GOTO Find.Exit
	RETURN
Give.Rtn:
9015 ' LABEL.9015
	IF LEFT$(S$, 7) = "MOLINAR" AND AD%(12, 4) = ROOM THEN M = 10: GOTO 9050
	M = 0
	FOR X = 1 TO NM
	IF LEFT$(S$, LEN(MN$(X))) = UCASE$(MN$(X)) AND MD%(X, 5) = ROOM THEN M = X: X = NM
	NEXT
	IF M = 0 THEN PGPRT 1, "": INPUT "Who to give to? ", S$: S$ = UCASE$(S$): GOTO 9015
	IF M > 0 THEN 9050
	PGPRT 2, "Nobody here by that name!"
	GOTO Main.Loop
9050 ' LABEL.9050
	S$ = MID$(S$, LEN(MN$(M)) + 1)
9060 ' LABEL.9060
	IF LEFT$(S$, 1) = " " THEN S$ = MID$(S$, 2): GOTO 9060
9065 ' LABEL.9065
	IF VAL(S$) > 0 THEN 9500
	IF S$ = "" THEN 9090
	A = 0
	FOR X = 1 TO NA
	IF AN$(X) = "" THEN 9080
	IF LEFT$(S$, LEN(AN$(X))) = UCASE$(AN$(X)) AND AD%(X, 4) = -1 THEN A = X: X = NA
9080 ' LABEL.9080
	NEXT
	IF A > 0 THEN 9093
	PGPRT 2, "You aren't carrying a " + LCASE$(S$) + "!"
	GOTO Main.Loop
9090 ' LABEL.9090
	PGPRT 1, ""
	INPUT "What to give? ", S$
	S$ = UCASE$(S$)
	GOTO 9065
9093 ' LABEL.9093
	IF A = 11 AND M <> 10 THEN PGPRT 2, "It is refused!": GOTO Get.Back
	IF M = 10 AND A <> 11 THEN PGPRT 2, "The body does not stir.": GOTO Get.Back
	IF M = 10 AND A = 11 THEN 9600
	IF AD%(A, 2) = 11 AND MD%(M, 8) < AD%(A, 7) THEN
  PGPRT 2, MN$(M) + " gratefully dons the " + AN$(A) + "!"
  MD%(0, 8) = AD%(A, 7)
  AD%(A, 4) = -M - 1
	END IF
	IF A = MD%(0, 9) THEN MD%(0, 9) = -1
	IF A = Armptr OR A = Shdptr THEN GOSUB DROP.ARMOR
	PGPRT 2, "Okay."
	AD%(A, 4) = -M - 1
	MD%(M, 14) = 0
	MD%(M, 3) = MD%(M, 3) * (1 + AD%(A, 1) / 100)
	IF MD%(M, 10) <> 0 AND MD%(M, 9) = -1 THEN MD%(M, 9) = A: MD%(M, 10) = MD%(M, 9) + AD%(A, 5): MD%(M, 4) = 2 * MD%(M, 4)
9120 ' LABEL.9120
	R3 = ROOM
	GOSUB Chk.Reactions
	GOTO Chk.Wght
9500 ' LABEL.9500
	IF VAL(S$) > GOLD& THEN PGPRT 2, "You aren't carrying that much gold of your own!": GOTO Get.Back
	GOLD& = INT(GOLD& - VAL(S$))
	MD%(M, 0) = MD%(M, 0) + INT(VAL(S$))
	MD%(M, 14) = 0
	MD%(M, 3) = MD%(M, 3) * (1 + VAL(S$) / 100)
	GOTO 9120
9600 ' LABEL.9600
	AD%(11, 4) = 0
	MD%(10, 5) = ROOM
	PGPRT 2, "The potion awakens Molinar. You tell him the desperate plight of the"
	PGPRT 1, " kingdom. He agrees to go with you and saves the kingdom."
	GOTO Game.Over
Inventory.Rtn:
	PGPRT 2, "You are carrying the following ---"
	FOR A = 1 TO NA
  IF AD%(A, 4) = -1 THEN
	  PRINT " " + AN$(A);
	  IF A = MD%(0, 9) THEN PRINT " (Ready weapon)";
	  IF A = Armptr THEN PRINT " (Worn Armor)";
	  IF A = Shdptr THEN PRINT " (Your Shield)";
	  PGPRT 1, " "
  END IF
	NEXT
	GOTO Get.Back
Blast.Spell:
	GOSUB Get.Subj
	GOSUB MONSTER.SEARCH
	IF FOUND = 0 THEN GOTO Cant.Blast
	S = 1
	GOSUB Cast.Spell
	IF NOT SUC THEN GOTO Get.Back
	PGPRT 2, "Direct Hit!"
	S = 6
	D = 1
	DF = M
	A = 0
	GOSUB 7635
	GOTO Get.Back
Cant.Blast:
	PGPRT 2, "You can't Blast " + S$ + "!"
	GOTO Main.Loop
Cast.Spell:
	SUC = 0
	IF SA%(S) THEN RL = FNR(100): SUC = (((RL < S2%(S)) OR (RL < 5)) AND (RL < 95)): IF RL = 100 THEN GOTO Forget.It
	IF NOT SUC THEN PGPRT 2, "Nothing happened.": RETURN
	RL = FNR(100)
	IF RL > S2%(S) THEN S2%(S) = S2%(S) + 2: SA%(S) = SA%(S) + 2
	S2%(S) = S2%(S) / 2
	RETURN
Forget.It:
	PGPRT 2, "The strain of attempting to cast the spell overloads your brain and you      forget it completely."
	SA%(S) = 0
	RETURN
Heal.Spell:
	S = 2
	GOSUB Cast.Spell
	IF NOT SUC THEN GOTO Get.Back
12020 ' LABEL.12020
	IF MD%(0, 13) THEN PGPRT 2, "Some of your wounds seem to clear up."
	MD%(0, 13) = MD%(0, 13) - FNR(10)
	IF MD%(0, 13) < 0 THEN MD%(0, 13) = 0
	DF = 0
	GOSUB 7650
	GOTO Get.Back
Power.Spell:
	S = 4
	GOSUB Cast.Spell
	IF NOT SUC THEN GOTO Get.Back
	PGPRT 2, "A purple scintillating ray blasts from your eyes and strikes everybody in the room!"
	FOR DF = 1 TO NM
	IF MD%(DF, 5) = ROOM THEN GOSUB 7700
	NEXT DF
	GOTO Get.Back
	IF RR > 60 THEN 13200
	PGPRT 2, "You get the same charge you get out of a heal spell!"
	GOTO 12020
13200 ' LABEL.13200
	IF RR > 90 THEN 13300
	PGPRT 2, "A bluish gas appears beside you."
	FOR A = 1 TO 4
	S2%(A) = SA%(A)
	NEXT
	GOTO Get.Back
13300 ' LABEL.13300
	IF RR = 100 THEN 13500
	PGPRT 2, "All of your weapons fall to the ground."
	FOR A = 1 TO NA
	IF AD%(A, 4) = -1 THEN AD%(A, 4) = ROOM
	NEXT
	MD%(0, 9) = -1
	GOTO Get.Back
13500 ' LABEL.13500
	PGPRT 2, "A fog settles about your mind and you forget everything you have learned   about using weapons and armour."
	AE = 0
	WA%(1) = 5
	WA%(2) = -10
	WA%(3) = 20
	WA%(4) = 10
	WA%(5) = 0
	IF MD%(0, 9) > -1 THEN A = MD%(0, 9): GOTO 17980
	GOTO Get.Back
Speed.Spell:
	S = 3
	GOSUB Cast.Spell
	IF NOT SUC THEN GOTO Get.Back
	IF SPD = 0 THEN MD%(0, 10) = MD%(0, 10) + 2 * MD%(0, 2): MD%(0, 2) = 2 * MD%(0, 2)
	SPD = SPD + FNR(25) + 10
	PGPRT 2, "You can feel the new agility flowing through you!"
	GOTO Get.Back
Smile.Rtn:
	FOR M = 1 TO NM
	IF MD%(M, 5) = ROOM THEN
  ON MD%(M, 14) GOSUB Unfriendly, Nuetral, Friendly
	END IF
	NEXT M
	GOTO Get.Back
Unfriendly:
	IF LEFT$(UCASE$(MN$(M)), 5) = "SNAKE" THEN
  PGPRT 2, MN$(M) + " hisses at you!"
	ELSE
  PGPRT 2, MN$(M) + " growls at you!"
	END IF
	RETURN
Nuetral:
	PGPRT 2, MN$(M) + " ignores you."
	RETURN
Friendly:
	PGPRT 2, MN$(M) + " " + LCASE$(V$) + "s back."
	RETURN
Say.Something:
	GOSUB Get.Subj
	IF S$ = "BLAST" THEN V$ = S$: S$ = "": GOTO Blast.Spell
	IF S$ = "HEAL" THEN GOTO Heal.Spell
	IF S$ = "POWER" THEN GOTO Power.Spell
	IF S$ = "SPEED" THEN GOTO Speed.Spell
	IF S$ <> "EAMON" OR ROOM <> 51 THEN 16900
	PGPRT 2, "Suddenly, the whole world spins around you. When your vision clears, you see that--"
	R3 = ROOM
	ROOM = 1
	GOSUB Chk.Reactions
	GOTO Main.Loop
16900 ' LABEL.16900
	PGPRT 2, "Okay, " + CHR$(34) + S$ + CHR$(34)
	GOTO Get.Back
Ready.Weapon:
	GOSUB Get.Subj
	WH = -1
	HA = -1
	GOSUB Locate.Artifact
	IF FOUND = 0 THEN PGPRT 2, "You aren't carrying it!": GOTO Main.Loop
	IF AD%(A, 2) < 2 OR AD%(A, 2) > 3 THEN PGPRT 2, "That isn't a legal weapon!": GOTO Main.Loop
17980 ' LABEL.17980
	MD%(0, 10) = (EA + AE) * (-EA > AE) + AD%(A, 5) + WA%(AD%(A, 6)) + 2 * MD%(0, 2)
	MD%(0, 9) = A
	MD%(0, 11) = AD%(A, 7)
	MD%(0, 12) = AD%(A, 8)
	PGPRT 2, "Readied."
	GOTO Get.Back
Wear.Armor:
	MD%(0, 8) = AD%(A, 7)
	MD%(0, 10) = (EA + AE) * (-EA > AE) + AD%(A, 5) + WA%(AD%(A, 6)) + 2 * MD%(0, 2)
	PGPRT 2, "You've put on the " + AN$(A) + "."
	GOTO Get.Back
Use.Shield:
	MD%(0, 8) = MD%(0, 8) + AD%(A, 7)
	MD%(0, 10) = (EA + AE) * (-EA > AE) + AD%(A, 5) + WA%(AD%(A, 6)) + 2 * MD%(0, 2)
	PGPRT 2, "You've readied the " + AN$(A) + "."
	GOTO Get.Back
18000 ' LABEL.18000
REM ///HIT COMMAND
	IF NBTL THEN GOTO Move.Rtn
	GOSUB Get.Subj
	IF S$ <> "MIRROR" OR AD%(2, 4) <> ROOM THEN 18100
	PGPRT 2, "You broke the mirror, and a person just stepped out from it!"
	AD%(2, 4) = 0
	AD%(3, 4) = ROOM
	MD%(1, 5) = ROOM
	R3 = ROOM
	GOSUB Chk.Reactions
	GOTO Main.Loop
18100 ' LABEL.18100
	IF RIGHT$(S$, 6) <> "BUTTON" OR AD%(6, 4) <> ROOM THEN PGPRT 2, "Nothing happens.": GOTO Get.Back
	F1 = NOT (F1)
	IF F1 THEN PGPRT 2, "A secret panel in the south wall slides open!": GOTO Get.Back
	PGPRT 2, "The panel slides shut."
	GOTO Get.Back
20000 ' LABEL.20000
REM   >> OPEN
	IF NBTL THEN GOTO Move.Rtn
	IF AD%(4, 4) <> ROOM THEN PGPRT 2, "There's nothing here to open!": GOTO Main.Loop
	AD%(4, 4) = 0
	AD%(5, 4) = ROOM
	GOTO Main.Loop
	GET #2, R + 200, Desc
	A$ = RTRIM$(Desc)
	PGPRT 2, A$
	RETURN
24000 ' LABEL.24000
REM >> FREE
	IF NBTL THEN GOTO Move.Rtn
	GOSUB Get.Subj
	IF S$ <> "DRAGON" OR AD%(27, 4) <> ROOM THEN 24100
	PGPRT 2, "Whatever you say, Boss!"
	AD%(27, 4) = 0
	MD%(15, 4) = ROOM
	R3 = ROOM
	GOSUB Chk.Reactions
	GOTO Get.Back
24100 ' LABEL.24100
	IF LEFT$(S$, 2) <> "LY" OR (AD%(7, 4) <> ROOM AND AD%(8, 4) <> ROOM) THEN 24200
	PGPRT 2, "OK."
	AD%(9, 4) = ROOM
	AD%(7, 4) = 0
	AD%(8, 4) = 0
	MD%(7 + (SEX$ = "F"), 5) = ROOM
	R3 = ROOM
	GOSUB Chk.Reactions
	GOTO Get.Back
24200 ' LABEL.24200
	IF S$ <> "WIZARD" OR AD%(18, 4) <> ROOM THEN PGPRT 2, "I'm not sure how to free it!": GOTO Main.Loop
	PGPRT 2, "OK."
	AD%(18, 4) = 0
	AD%(19, 4) = ROOM
	MD%(11, 5) = ROOM
	R3 = ROOM
	GOSUB Chk.Reactions
	GOTO Main.Loop
REM $$INCL:'\Eamon\COPY\CHARIO.BAS'
        ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        '
        '   Module:  CHARIO.BAS
        '   Eamon Version:  Eamon-QB (or Eamon-PC)
        ' ------------------------------------------------------------
        '  Character File I/O Routines for Eamon QB/PC
        '        Basic version:  QuickBASIC 4.0, GW-BASIC, QBasic *
        '                        or BASIC 7.0 PDS
        '       uses User defined types for record definition
        '       This module will work for QBasic, but QBasic cannot
REM $$INCL:statements, so module must be built
        '       manually or merged using a utility
        ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        '
OPEN.CHARACTERS:
      OPEN "CHARACT.DAT" FOR RANDOM AS #1 LEN = LEN(Char)
      RETURN
READ.NBR.CHARS:
      GET #1, 1, CharCtl
      NC = CharCtl.NbrChar
      IF NC > LOF(1) \ LEN(Char) THEN NC = LOF(1) \ LEN(Char) - 1
      RETURN
READ.CHARACTER:
      GET #1, REC, Char
      Nam$ = RTRIM$(Char.Nam$)
      HD = Char.Hd
      AG = Char.Ag
      CH = Char.Ch
      SA%(1) = Char.SA1
      SA%(2) = Char.SA2
      SA%(3) = Char.SA3
      SA%(4) = Char.SA4
      WA%(1) = Char.WA1
      WA%(2) = Char.WA2
      WA%(3) = Char.WA3
      WA%(4) = Char.WA4
      WA%(5) = Char.WA5
      SEX$ = Char.SEX
      GOLD& = Char.GOLD
      BANK& = Char.BANK
      AE = Char.AE
      ArmNam$ = RTRIM$(Char.ArmNam)
      ArmHit = Char.ArmHit
      ArmAdj = Char.ArmAdj
      ShdNam$ = RTRIM$(Char.ShdNam)
      ShdHit = Char.ShdHit
      ShdAdj = Char.ShdAdj
      WN$(1) = RTRIM$(Char.Wpn1Nam)
      WR%(1) = Char.Wpn1Typ
      WT%(1) = Char.Wpn1WpnTyp
      WC%(1) = Char.Wpn1Odds
      WD%(1) = Char.Wpn1Dice
      WS%(1) = Char.Wpn1Sides
      WN$(2) = RTRIM$(Char.Wpn2Nam)
      WR%(2) = Char.Wpn2Typ
      WT%(2) = Char.Wpn2WpnTyp
      WC%(2) = Char.Wpn2Odds
      WD%(2) = Char.Wpn2Dice
      WS%(2) = Char.Wpn2Sides
      WN$(3) = RTRIM$(Char.Wpn3Nam)
      WR%(3) = Char.Wpn3Typ
      WT%(3) = Char.Wpn3WpnTyp
      WC%(3) = Char.Wpn3Odds
      WD%(3) = Char.Wpn3Dice
      WS%(3) = Char.Wpn3Sides
      WN$(4) = RTRIM$(Char.Wpn4Nam)
      WR%(4) = Char.Wpn4Typ
      WT%(4) = Char.Wpn4WpnTyp
      WC%(4) = Char.Wpn4Odds
      WD%(4) = Char.Wpn4Dice
      WS%(4) = Char.Wpn4Sides
      RETURN
WRITE.CHARACTER:
      Char.Nam = Nam$
      Char.Hd = HD
      Char.Ag = AG
      Char.Ch = CH
      Char.SA1 = SA%(1)
      Char.SA2 = SA%(2)
      Char.SA3 = SA%(3)
      Char.SA4 = SA%(4)
      Char.WA1 = WA%(1)
      Char.WA2 = WA%(2)
      Char.WA3 = WA%(3)
      Char.WA4 = WA%(4)
      Char.WA5 = WA%(5)
      Char.SEX = SEX$
      Char.GOLD = GOLD&
      Char.BANK = BANK&
      Char.AE = AE
      Char.ArmNam = ArmNam$
      Char.ArmHit = ArmHit
      Char.ArmAdj = ArmAdj
      Char.ShdNam = ShdNam$
      Char.ShdHit = ShdHit
      Char.ShdAdj = ShdAdj
      Char.Wpn1Nam = WN$(1)
      Char.Wpn1Typ = WR%(1)
      Char.Wpn1WpnTyp = WT%(1)
      Char.Wpn1Odds = WC%(1)
      Char.Wpn1Dice = WD%(1)
      Char.Wpn1Sides = WS%(1)
      Char.Wpn2Nam = WN$(2)
      Char.Wpn2Typ = WR%(2)
      Char.Wpn2WpnTyp = WT%(2)
      Char.Wpn2Odds = WC%(2)
      Char.Wpn2Dice = WD%(2)
      Char.Wpn2Sides = WS%(2)
      Char.Wpn3Nam = WN$(3)
      Char.Wpn3Typ = WR%(3)
      Char.Wpn3WpnTyp = WT%(3)
      Char.Wpn3Odds = WC%(3)
      Char.Wpn3Dice = WD%(3)
      Char.Wpn3Sides = WS%(3)
      Char.Wpn4Nam = WN$(4)
      Char.Wpn4Typ = WR%(4)
      Char.Wpn4WpnTyp = WT%(4)
      Char.Wpn4Odds = WC%(4)
      Char.Wpn4Dice = WD%(4)
      Char.Wpn4Sides = WS%(4)
      PUT #1, REC, Char
      RETURN
WRITE.NBR.CHARS:
      CharCtl.NbrChar = NC
      PUT #1, 1, CharCtl
      RETURN

    '------- (end of include file) -------    
 ' 
OPEN.DESC:
REM /// open description file
	OPEN "DESC.TXT" FOR RANDOM AS #2 LEN = 256
	RETURN
Open.RmNames:
REM /// open room name file
	OPEN "R", #3, PATH$ + "RMNAMES.TXT", 64
	RETURN
Open.Rooms:
REM /// open rooms file
	OPEN "ROOMS.TXT" FOR RANDOM AS #4 LEN = 64
	RETURN
OPEN.MONSTER:
REM /// open monster file
	OPEN "MONST.TXT" FOR RANDOM AS #3 LEN = 128
	RETURN
OPEN.ARTIFACT:
REM /// Open ARTIFACT FILE
	OPEN "ARTIF.TXT" FOR RANDOM AS #3 LEN = 128
	RETURN
41400 ' LABEL.41400
REM /// read room file (record=room)
	GET #4, ROOM, RmD
	RD%(1) = RmD.North
	RD%(2) = RmD.South
	RD%(3) = RmD.East
	RD%(4) = RmD.West
	RD%(5) = RmD.Up
	RD%(6) = RmD.Down
	NL = RmD.Lt
	RETURN
READ.MONSTER:
	GET #3, M, MONSTER
	MN$(M) = RTRIM$(MONSTER.Nam)
	MD%(M, 1) = MONSTER.Hd
	MD%(M, 2) = MONSTER.Ag
	MD%(M, 3) = MONSTER.Fr
	MD%(M, 4) = MONSTER.Cour
	MD%(M, 5) = MONSTER.ROOM
	MD%(M, 6) = MONSTER.Wght
	MD%(M, 7) = MONSTER.DOdds
	MD%(M, 8) = MONSTER.Armor
	MD%(M, 9) = MONSTER.Weapon
	MD%(M, 10) = MONSTER.OOdds
	MD%(M, 11) = MONSTER.Dice
	MD%(M, 12) = MONSTER.Sides
	RETURN
READ.ARTIFACT:
	GET #3, A, Artifact
	AN$(A) = RTRIM$(Artifact.Nam)
	AD%(A, 1) = Artifact.Value
	AD%(A, 2) = Artifact.typ
	AD%(A, 3) = Artifact.Wght
	AD%(A, 4) = Artifact.ROOM
	AD%(A, 5) = Artifact.Odds
	AD%(A, 6) = Artifact.Wpntyp
	AD%(A, 7) = Artifact.Dice
	AD%(A, 8) = Artifact.Sides
	RETURN

SUB PGPRT (SP, LIT$)
	STATIC LINE.PG
	IF SP = 0 THEN LINE.PG = 0: EXIT SUB
	IF LIT$ = "" THEN LINE.PG = LINE.PG + SP: EXIT SUB
	IF SP > 1 THEN
  FOR X = 1 TO SP - 1
  PRINT
  LINE.PG = LINE.PG + 1
  NEXT
	END IF
	IF LINE.PG > 20 THEN
  PRINT STRING$(25, "-"); " Press Any Key to Continue "; STRING$(25, "-")
  A$ = INPUT$(1)
  LOCATE CSRLIN - 1, 1
  PRINT SPC(79);
  LINE.PG = 0
	END IF
	PRINT LIT$
	LINE.PG = LINE.PG + LEN(LIT$) / 79 + 1


END SUB

