1   REM     EAMON ADVENTURE #2
2   REM -> THE MINOTAUR'S LAIR <-
3   REM
4   REM     BY DONALD BROWN
5   REM
6   REM  REVISED ADDITION           COMPUTER LEARNING CENTER    LIBRARY 07-09-84
7   REM
8   REM  // Array initializers have to go here, since QuickBasic doesn't like
9   REM  // them being defined before it finds any access to them.
10  OPEN "EAMON.ART" FOR INPUT AS #1: INPUT #1, NA: DIM AN$(NA + 4), AD%(NA + 4, 9): FOR A = 1 TO NA: INPUT #1, AN$(A): FOR A2 = 1 TO 4: INPUT #1, AD%(A, A2): NEXT A2: IF AD%(A, 2) > 1 THEN FOR A2 = 5 TO 8: INPUT #1, AD%(A, A2): NEXT A2
20  NEXT A: CLOSE #1: OPEN "EAMON.MON" FOR INPUT AS #1: INPUT #1, NM: DIM MN$(NM), MD%(NM, 15): FOR A = 1 TO NM: INPUT #1, MN$(A): FOR A2 = 1 TO 12: INPUT #1, MD%(A, A2): NEXT A2, A: CLOSE #1
30   OPEN "MEAT" FOR INPUT AS #1: INPUT #1, MN$(0): INPUT #1, MD%(0, 1): INPUT #1, MD%(0, 2): INPUT #1, CH: FOR A = 1 TO 4: INPUT #1, SA%(A): NEXT: FOR A = 1 TO 5: INPUT #1, WA%(A): NEXT
40   INPUT #1, AE: INPUT #1, SEX$: INPUT #1, GOLD: INPUT #1, BANK: INPUT #1, AC
50  NW = 15: DIM WN$(NW), WT%(NW), WO%(NW), WD%(NW), WP%(NW): FOR A = 1 TO 4: INPUT #1, WN$(A): INPUT #1, WT%(A): INPUT #1, WO%(A): INPUT #1, WD%(A): INPUT #1, WS%(A): NEXT: CLOSE
55   READ NC: DIM C$(NC): FOR C = 1 TO NC: READ C$(C): NEXT
60   DIM V%(96)
65   GOTO 1000
100   REM ///MAIN LOOP. FIRST GIVE ROOM DESC, THEN GET COMMAND
110   PRINT
115   IF SPD THEN SPD = SPD - 1: IF NOT SPD THEN MD%(0, 2) = MD%(0, 2) / 2: MD%(0, 10) = MD%(0, 10) - 2 * MD%(0, 2): IF RND(1) > .8 THEN PRINT "YOUR SPEED SPELL HAS JUST EXPIRED!": PRINT
120   IF ROOM < 89 AND (AD%(1, 4) <> ROOM AND AD%(1, 4) <> -1) THEN PRINT : PRINT "IT IS TOO DARK TO SEE ANYTHING.": GOTO 165
125   IF V%(ROOM) THEN GET #2, ROOM + 1: INPUT #2, A$: PRINT "YOU ARE ": PRINT " "; A$: PRINT
130   IF NOT V%(ROOM) THEN GET #1, ROOM + 1: INPUT #1, A$: PRINT A$: PRINT : V%(ROOM) = -1: IF ROOM = 16 THEN DIE = -1: GOTO 2000
135   FOR M = 1 TO NM: IF MD%(M, 5) = ROOM AND MD%(M, 15) THEN PRINT MN$(M); " IS HERE.": PRINT
140   IF MD%(M, 5) = ROOM AND NOT MD%(M, 15) THEN GET #1, M + 300 + 1: INPUT #1, A$: PRINT A$: MD%(M, 15) = -1: PRINT
145   NEXT M: FOR A = 1 TO NA - WZ: IF AD%(A, 4) = ROOM AND AD%(A, 9) THEN PRINT "YOU SEE "; AN$(A)
150   IF AD%(A, 4) = ROOM AND NOT AD%(A, 9) THEN GET #1, A + 100 + 1: INPUT #1, A$: PRINT A$: AD%(A, 9) = -1: PRINT
155   NEXT A: FOR A = A TO NA: IF AD%(A, 4) = ROOM THEN PRINT "YOUR "; AN$(A) + " IS HERE."
160   NEXT A: V%(ROOM) = -1: IF NOT RZ AND ROOM = 52 THEN PRINT : PRINT E1$: PRINT
165   PRINT : INPUT "  YOUR COMMAND?"; A$
170   IF LEFT$(A$, 1) = " " THEN A$ = MID$(A$, 2): GOTO 170
175   IF A$ = "" THEN A$ = CZ$: LOCATE CSRLIN - 1, 17: PRINT A$
180  CZ$ = A$: FOR A = 2 TO LEN(A$): IF MID$(A$, A, 1) = " " THEN GOTO 185
182  NEXT A
185  V$ = LEFT$(A$, A - 1): S$ = MID$(A$, A + 1)
190   IF LEFT$(S$, 1) = " " THEN S$ = MID$(S$, 2): GOTO 190
193   FOR C = 1 TO NC: IF LEFT$(C$(C), LEN(V$)) = V$ THEN 200
196   NEXT: PRINT : PRINT "HUH? I ONLY UNDERSTAND THESE COMMANDS--    ": FOR C = 1 TO NC: PRINT C$(C); SPACE$(20 - LEN(C$(C))); : NEXT: PRINT : PRINT : GOTO 165
200  V$ = C$(C)
205   ON C GOTO 3000, 3000, 3000, 3000, 4000, 4000, 5000, 6000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000, 15000, 16000, 17000, 18000, 19000, 20000, 20000, 20000, 20000, 21000
300   REM ///COMMANDS RETURN TO HERE
310   IF NOT NBTL THEN 500
320   FOR M = 1 TO NM: IF MD%(M, 5) <> ROOM THEN 490
330  M2 = MD%(M, 14) - ABS((MD%(M, 14) = 2)): MR = FD%(M2) / TD%(M2) * 100 + INT(41 * RND(1) - 20)
340   IF MD%(M, 4) < MR THEN PRINT : PRINT MN$(M); " FLEES OUT AN EXIT.": PRINT : GOSUB 8500: MD%(M, 5) = R2: M2 = MD%(M, 14): TD%(M2) = TD%(M2) - MD%(M, 1): FD%(M2) = FD%(M2) - MD%(M, 13): GOTO 490
345   IF MD%(M, 14) = 2 THEN 490
350   IF MD%(M, 14) = 3 THEN 390
360  OF = M: IF TD%(3) = MD%(0, 1) THEN DF = 0: GOSUB 7500: GOTO 490
365  FLAG = 0
370   FOR M2 = 1 TO NM: IF MD%(M2, 5) = ROOM AND MD%(M2, 14) = 3 AND RND(1) < .25 THEN FLAG = -1: DF = M2: M2 = 200
380   NEXT M2
385   IF FLAG THEN GOSUB 7500: GOTO 490
389   DF = 0: GOSUB 7500: GOTO 490
390  OF = M
395   FLAG = 0
400   FOR M2 = 1 TO NM: IF MD%(M2, 5) = ROOM AND MD%(M2, 14) = 1 THEN FLAG = -1: DF = M2: M2 = 200
410   NEXT M2
415   IF FLAG THEN GOSUB 7500: GOTO 490
490  NBTL = (FD%(1) < TD%(1)): IF NOT NBTL THEN GOTO 500
495  NEXT M
500   REM
900   GOTO 100
1000   REM ///INITIALIZE DATA
1050   IF SEX$ = "F" THEN MN$(9) = "SLIPPERY SVEN"
1060  E1$ = MN$(9) + " IS TIED TO THE ALTAR!"
1070  OPEN "EAMON.DES" FOR RANDOM AS #1 LEN = 256: OPEN "EAMON.RMN" FOR RANDOM AS #2 LEN = 64: OPEN "EAMON.ROM" FOR RANDOM AS #3 LEN = 64
1080   FOR W2 = 1 TO 4: IF WN$(W2) = "NONE" THEN GOTO 1090
1085  NA = NA + 1: AN$(NA) = WN$(W2): AD%(NA, 2) = 2: AD%(NA, 3) = 2: AD%(NA, 4) = -1: AD%(NA, 5) = WO%(W2): AD%(NA, 6) = WT%(W2): AD%(NA, 7) = WD%(W2): AD%(NA, 8) = WS%(W2)
1086  NEXT W2: W2 = 4
1090  WZ = W2: WT = W * WZ
1100   FOR W2 = 1 TO WZ: FOR A = 1 TO NA - WZ: IF AN$(A) = WN$(W2) THEN AN$(A) = AN$(A) + "#": GOTO 1100
1110   NEXT A, W2: EA = 0: MD%(0, 8) = 0: A2 = INT(AC / 2): IF A2 * 2 <> AC THEN MD%(0, 8) = -1: EA = -5
1120   IF A2 THEN MD%(0, 8) = MD%(0, 8) + A2: EA = EA - A2 * 10: IF A2 = 3 THEN MD%(0, 8) = MD%(0, 8) + 2: EA = EA - 30
1130   IF NA > 35 THEN MD%(0, 10) = (EA + AE) * (-EA > AE) + WO%(1) + WA%(WT%(1)) + 2 * MD%(0, 2): MD%(0, 7) = 0: MD%(0, 9) = 36: MD%(0, 11) = WD%(1): MD%(0, 12) = WS%(1): MD%(0, 14) = 3
1150   FOR S = 1 TO 4: S2%(S) = SA%(S): NEXT: ROOM = 1
1900   GOTO 100
1910   DATA  28
1920   DATA   NORTH,SOUTH,EAST,WEST,GET,TAKE,DROP,LOOK,EXAMINE,ATTACK,FLEE,GIVE,INVENTORY,BLAST,HEAL,POWER,SPEED,SMILE,WAVE,SAY,READY,DRINK,ENTER,OPEN,UNLOCK,RELEASE
1930   DATA    FREE,DIG
2000   REM ///DONE WITH GAME
2010   PRINT : PRINT "(HIT ENTER TO CONTINUE)   "; : A$ = INPUT$(1): PRINT
2020   CLOSE : IF SPD THEN MD%(0, 2) = MD%(0, 2) / 2
2030   IF DIE THEN 2500
2040   FOR W = 1 TO 4: WN$(W) = "NONE": NEXT: W2 = 1: FOR A = 1 TO NA: IF AD%(A, 2) > 1 AND AD%(A, 4) = -1 THEN WN$(W2) = AN$(A): WP%(W2) = A: W2 = W2 + 1: AD%(A, 4) = 0
2050   NEXT A: IF W2 < 6 THEN 2300
2060   CLS : LOCATE 5: PRINT "AS YOU START TO ENTER THE MAIN HALL,": PRINT "LORD WILLIAM MISSLEFIRE APPEARS AND": PRINT "TELLS YOU, 'YOU HAVE TOO MANY WEAPONS": PRINT "TO KEEP THEM ALL--4 IS THE LEGAL LIMIT.": PRINT : PRINT "YOUR WEAPONS ARE--"
2070   FOR W = 1 TO W2 - 1: PRINT SPACE$(4); W; "--"; WN$(W): NEXT: PRINT : PRINT "ENTER THE NUMBER OF THE WEAPON TO SELL     (1-"; W2 - 1; ") "
2080   LOCATE CSRLIN - 1, 23: INPUT A$: W5 = VAL(A$): IF W5 < 1 OR W5 > W2 - 1 OR W5 <> INT(W5) THEN 2080
2090  AD%(WP%(W5), 4) = -1: WN$(W5) = WN$(W2 - 1): WP%(W5) = WP%(W2 - 1): W2 = W2 - 1: IF W2 > 5 THEN 2060
2300   FOR W = 1 TO 4: IF WP%(W) THEN WT%(W) = AD%(WP%(W), 6): WO%(W) = AD%(WP%(W), 5): WD%(W) = AD%(WP%(W), 7): WS%(W) = AD%(WP%(W), 8)
2310   NEXT W: CLS : LOCATE 5: PRINT "AS YOU DELIVER YOUR TREASURES TO SAM": PRINT "SLICKER, THE LOCAL BUYER FOR SUCH": PRINT "THINGS, HE EXAMINES YOUR GOODS AND": PRINT "PAYS YOU ";
2320  TP = 0: FOR A = 1 TO NA: IF AD%(A, 4) <> -1 THEN 2350
2330   IF AD%(A, 2) <> 0 THEN AD%(A, 1) = AD%(A, 1) * CH / 10
2340  TP = TP + AD%(A, 1)
2350   NEXT A: PRINT TP; " GOLD PIECES.": PRINT
2360  GOLD = GOLD + TP: PRINT : PRINT "(HIT ANY KEY TO CONTINUE)  "; : A$ = INPUT$(1): PRINT
2500  KILL "MEAT"
2540   IF DIE THEN GOTO 2900
2550   OPEN "MEAT" 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
2560   FOR A = 1 TO 5: PRINT #1, WA%(A): NEXT: PRINT #1, AE: PRINT #1, SEX$: PRINT #1, GOLD: PRINT #1, BANK: PRINT #1, AC: FOR A = 1 TO 4: PRINT #1, WN$(A): PRINT #1, WT%(A): PRINT #1, WO%(A): PRINT #1, WD%(A): PRINT #1, WS%(A): NEXT
2900   END
3000   REM ///MOVE COMMAND
3010   IF NBTL THEN PRINT : PRINT "YOU CAN'T DO THAT WITH UNFRIENDLIES        ABOUT!": PRINT : GOTO 100
3020   FOR D = 1 TO 6: IF LEFT$(V$, 1) = MID$("NSEWUD", D, 1) THEN GOTO 3030
3025   NEXT D
3030   GET #3, ROOM + 1: FOR D2 = 1 TO D: INPUT #3, R2: NEXT
3040   IF R2 > 0 THEN 3500
3050   REM ///SPECIAL MOVES
3060   IF R2 = -99 THEN PRINT : PRINT "YOU SUCCESSFULLY RIDE OFF INTO THE": PRINT "  SUNSET.": GOTO 2000
3070   IF R2 >= 0 THEN 3490
3080   IF AD%(3, 4) = ROOM THEN R2 = -R2: GOTO 3500
3090   IF ROOM = 54 AND AD%(17, 4) = 0 THEN R2 = -R2: GOTO 3500
3490   PRINT : PRINT "YOU CAN'T GO THAT WAY!": V%(ROOM) = 0: GOTO 100
3500  R3 = ROOM: ROOM = R2: GOSUB 3600
3510   IF (R2 > 8 AND R2 < 17) OR (R3 > 8 AND R3 < 17) THEN AD%(3, 4) = ROOM
3520   GOTO 100
3600   REM ///CHECK REACTIONS ON MONSTERS
3610  TD%(1) = 0: TD%(3) = MD%(0, 1): FD%(1) = 0: FD%(3) = MD%(0, 13)
3620   FOR M = 1 TO NM: IF MD%(M, 5) = R3 THEN IF MD%(M, 14) = 3 OR (MD%(M, 14) = -1 AND 200 * RND(1) < MD%(M, 4)) THEN MD%(M, 5) = ROOM: GOTO 3650
3630   IF MD%(M, 5) <> ROOM THEN 3900
3632   IF MD%(M, 14) <> 0 THEN 3650
3635  FR = MD%(M, 3): IF FR AND FR <> 100 THEN FR = FR + INT((CH - 10) / 2)
3640  MD%(M, 14) = 1: IF FR > (100 * RND(1)) THEN MD%(M, 14) = 2: IF FR > (100 * RND(1)) THEN MD%(M, 14) = 3
3650  A = MD%(M, 14): FD%(A) = FD%(A) + MD%(M, 13): TD%(A) = TD%(A) + MD%(M, 1)
3900   NEXT M: NBTL = (TD%(1) > 0): RETURN
4000   REM ///GET COMMAND
4010   GOSUB 4900
4020   IF S$ = "ALL" THEN 4100
4030   IF S$ = "GOLD" THEN S$ = AN$(5)
4040   IF S$ = "SILVER" THEN S$ = AN$(12)
4045   IF S$ = "WATER" AND ROOM > 5 AND ROOM < 28 THEN AD%(5, 4) = ROOM
4050   FOR A = 1 TO NA: IF AN$(A) = S$ AND AD%(A, 4) = ROOM THEN GOTO 4060
4055   NEXT: PRINT : PRINT "I SEE NO "; S$; " HERE!": PRINT : GOTO 100
4060   GOSUB 4200: IF WT + AD%(A, 3) > 10 * MD%(0, 1) THEN PRINT : PRINT "IT IS TOO HEAVY FOR YOU.": PRINT : GOTO 100
4070   PRINT : PRINT "GOT IT.": AD%(A, 4) = -1: WT = WT + AD%(A, 3): PRINT : IF AD%(A, 2) < 2 OR MD%(0, 9) <> -1 THEN 300
4080   GOTO 17000
4100   FOR A = 1 TO NA: IF AD%(A, 4) <> ROOM THEN 4140
4110   GOSUB 4200: IF WT + AD%(A, 3) > 10 * MD%(0, 1) THEN PRINT AN$(A); " IS TOO HEAVY": GOTO 4140
4120   PRINT AN$(A) + " TAKEN.": AD%(A, 4) = -1: WT = WT + AD%(A, 3)
4140   NEXT: PRINT : GOTO 300
4200   IF A <> 10 THEN RETURN
4210   PRINT : PRINT "AS YOU TOUCH THE JEWEL, AN ELECTRIC": PRINT "SHOCK RUNS UP YOUR ARM. YOU HEAR A VOICECHUCKLING AS IT SAY, 'I TOLD YOU NOT TO TOUCH IT!'": PRINT : MD%(0, 13) = MD%(0, 13) + MD%(0, 1) / 2
4220  DF = 0: IF MD%(0, 13) >= MD%(0, 1) THEN 7700
4230   GOTO 7650
4900   IF S$ = "" THEN PRINT : PRINT C$(C); " WHAT"; : INPUT S$: GOTO 4900
4910   RETURN
5000   REM ///DROP COMMAND
5020   IF S$ = "ALL" THEN 5100
5030   FOR A = 1 TO NA: IF AN$(A) = S$ AND AD%(A, 4) = -1 THEN GOTO 5040
5035   NEXT: PRINT : PRINT "YOU AREN'T CARRYING A "; S$: PRINT : GOTO 100
5040   WT = WT - AD%(A, 3): AD%(A, 4) = ROOM: PRINT AN$(A); " DROPPED.": PRINT
5050   IF WT > 10 * MD%(0, 1) THEN PRINT "YOU SUDDENLY FIND YOU CANNOT CARRY ALL  OF THE ITEMS YOU ARE CARRYING, AND THEY ALL FALL TO THE GROUND.": PRINT : GOTO 5100
5060   IF MD%(0, 9) > 0 THEN IF AD%(MD%(0, 9), 4) <> -1 THEN MD%(0, 9) = -1
5070   GOTO 300
5100   FOR A = 1 TO NA: IF AD%(A, 4) = -1 THEN PRINT AN$(A); " DROPPED.": AD%(A, 4) = ROOM
5110   NEXT A: WT = 0: GOTO 5060
6000   REM ///LOOK COMMAND
6020  LK = 0: FOR A = 1 TO NA - WZ: IF AN$(A) = S$ AND (AD%(A, 4) = ROOM OR AD%(A, 4) = -1) THEN GET #1, A + 100 + 1: INPUT #1, A$: PRINT : PRINT A$: PRINT : LK = -1
6030   NEXT A: IF LK THEN 300
6040   FOR A = 1 TO NM: IF MN$(A) = S$ AND MD%(A, 5) = ROOM THEN GET #1, A + 300 + 1: INPUT #1, A$: PRINT : PRINT A$: PRINT : LK = -1
6050   NEXT A: IF LK THEN 300
6060  V%(ROOM) = 0: GOTO 300
7000   REM ///ATTACK COMMAND
7010   GOSUB 4900: IF S$ = "KNIGHT" THEN S$ = MN$(4)
7020   IF S$ = "BUNNY" OR S$ = "RABBIT" THEN S$ = MN$(2)
7030   IF S$ = "EYE" THEN S$ = MN$(3)
7040   FOR M = 1 TO NM: IF S$ = MN$(M) AND MD%(M, 5) = ROOM THEN GOTO 7050
7045   NEXT: PRINT : PRINT "ATTACK WHO?": PRINT : GOTO 100
7050   IF MD%(0, 9) = -1 THEN PRINT : PRINT "YOU HAVE NO WEAPON READY!": PRINT : GOTO 100
7060  OF = 0: DF = M: GOSUB 7500: IF NOT HIT THEN 7130
7080   IF INC THEN W2 = AD%(MD%(0, 9), 6): WA%(W2) = WA%(W2) + 2
7090   IF -EA <= AE THEN 300
7100   IF INT(100 * RND(1) + 1) <= MD%(0, 10) THEN 7130
7110  A = 2: IF EA + AE = -1 THEN A = 1
7120  AE = AE + A: MD%(0, 10) = MD%(0, 10) + A
7130   IF MD%(DF, 14) = -1 OR DF = 0 THEN 300
7140  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
7150   NEXT M: R3 = ROOM: GOSUB 3600: GOTO 300
7400   REM ///MONSTER TRIES TO PICK UP WEAPON
7410   IF MD%(OF, 10) = 0 THEN RETURN
7420   FOR A = 1 TO NA: IF AD%(A, 4) = ROOM AND AD%(A, 2) = 2 THEN GOTO 7430
7425   NEXT: RETURN
7430   PRINT MN$(OF); " PICKS UP "; AN$(A): PRINT : 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
7500  HIT = 0: IF MD%(OF, 9) = -1 THEN RETURN
7505   PRINT MN$(OF); " ATTACKS "; MN$(DF): PRINT " --"; : RL = INT(100 * RND(1) + 1): HIT = 0: IF (RL < 5 OR RL < MD%(OF, 10)) AND RL < 96 THEN HIT = -1
7510   IF HIT THEN 7600
7520   IF RL < 97 THEN PRINT "A MISS.": RETURN
7525   PRINT "A FUMBLE!": FR = INT(100 * RND(1) + 1): IF FR <= 35 + 40 * (NOT MD%(OF, 9)) THEN PRINT "  FUMBLE RECOVERED.": PRINT : RETURN
7530   IF FR < 76 THEN PRINT "  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: PRINT : RETURN
7535   IF FR > 95 THEN 7550
7540   PRINT "  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 PRINT : RETURN
7545   PRINT "  BROKEN WEAPON HURTS USER!"
7550   IF FR = 100 THEN 7560
7555  D = MD%(OF, 11): S = MD%(OF, 12): DF = OF: A = -1: GOTO 7635
7560  D = MD%(OF, 11) * 2: S = MD%(OF, 12): DF = OF: A = 0: GOTO 7635
7600  INC = (INT(100 * RND(1) + 1) > MD%(OF, 10)): MD%(OF, 10) = MD%(OF, 10) + 2 * INC
7605  D = MD%(OF, 11): S = MD%(OF, 12): A = -1: IF RL > 5 THEN PRINT "A HIT!": GOTO 7635
7610   PRINT "A CRITICAL HIT!": R2 = INT(100 * RND(1) + 1): IF R2 < 51 THEN A = 0: GOTO 7635
7615   IF R2 < 86 THEN S = 1.5 * S: GOTO 7635
7620   IF R2 < 96 THEN D = 2 * D: GOTO 7635
7625   IF R2 < 100 THEN D = 3 * D: GOTO 7635
7630   GOTO 7700
7635  D2 = 0: FOR D3 = 1 TO D: D2 = D2 + INT(S * RND(1) + 1): NEXT: D2 = D2 - A * MD%(DF, 8): IF D2 < 1 THEN PRINT "   BLOW BOUNCES OFF ARMOUR": PRINT : RETURN
7640  MD%(DF, 13) = MD%(DF, 13) + D2: IF MD%(DF, 13) >= MD%(DF, 1) THEN 7700
7645  A = MD%(DF, 14): FD%(A) = FD%(A) + D2
7650   PRINT : PRINT MN$(DF); : ON INT(MD%(DF, 13) * 5 / MD%(DF, 1) + 1) GOTO 7655, 7660, 7665, 7670, 7675
7655   PRINT " IS STILL IN GOOD": PRINT "  SHAPE.": RETURN
7660   PRINT " IS HURTING.": RETURN
7665   PRINT " IS IN PAIN.": RETURN
7670   PRINT " IS VERY BADLY INJURED.": RETURN
7675   PRINT " IS AT DEATH'S DOOR,": PRINT "  KNOCKING LOUDLY.": RETURN
7700   PRINT MN$(DF); " IS DEAD!": PRINT : A = MD%(DF, 14): FD%(A) = FD%(A) + MD%(DF, 1) - MD%(DF, 13) + D2: MD%(DF, 5) = 0: A2 = DF + 25: AD%(A2, 4) = ROOM: 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
7720   IF DF = 0 THEN DIE = -1: GOTO 2000
7730   IF (MN$(DF) = "SKELETON" OR MN$(DF) = "HIGH PRIEST") AND AD%(2, 4) = 0 THEN PRINT : PRINT "A SKELETON KEY DROPS FROM HIS CLUTCHES": PRINT : AD%(2, 4) = ROOM
7900   PRINT : RETURN
8000   REM ///FLEE COMMAND
8010   IF NOT NBTL THEN PRINT : PRINT "THERE'S NOTHING TO FLEE FROM!": PRINT : GOTO 100
8020   GOSUB 8500: GOTO 3500
8500   GET #3, ROOM + 1: FOR D = 1 TO 6: INPUT #3, DR%(D): NEXT
8510  R2 = DR%(6 * RND(1) + 1): IF R2 < 1 THEN 8510
8520   RETURN
9000   REM ///GIVE COMMAND
9010  A2 = 1
9020   FOR M = 1 TO NM: IF LEFT$(S$, LEN(MN$(M))) = MN$(M) AND MD%(M, 5) = ROOM THEN 9050
9030   NEXT: IF A2 = 1 THEN A2 = 2: PRINT : INPUT "WHO TO GIVE TO? "; S$: GOTO 9020
9040   PRINT : PRINT "NOBODY HERE BY THAT NAME!": PRINT : GOTO 100
9050  S$ = MID$(S$, LEN(MN$(M)) + 1)
9060   IF LEFT$(S$, 1) = " " THEN S$ = MID$(S$, 2): GOTO 9060
9065   IF VAL(S$) > 0 THEN 9500
9070   FOR A = 1 TO NA: IF LEFT$(S$, LEN(AN$(A))) = AN$(A) AND AD%(A, 4) = -1 THEN 9095
9080   NEXT: IF A2 = 2 THEN A2 = 3: PRINT : INPUT "WHAT TO GIVE? "; S$: GOTO 9065
9090   PRINT : PRINT "YOU AREN'T CARRYING A "; S$; "!": PRINT : GOTO 100
9095   IF A = MD%(0, 9) THEN MD%(0, 9) = -1
9100   PRINT : PRINT "OKAY.": AD%(A, 4) = 0: MD%(M, 14) = 0: MD%(M, 3) = MD%(M, 3) * (1 + AD%(A, 1) / 100)
9110   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  R3 = ROOM: GOSUB 3600: GOTO 5050
9500   IF VAL(S$) > GOLD THEN PRINT : PRINT "YOU AREN'T CARRYING THAT MUCH GOLD OF      YOUR OWN!": PRINT : GOTO 300
9510  GOLD = INT(GOLD - VAL(S$)): MD%(M, 14) = 0: MD%(M, 3) = MD%(M, 3) * (1 + VAL(S$) / 100): GOTO 9120
10000   REM ///INVENTORY COMMAND
10010   PRINT : PRINT "YOU ARE CARRYING THE FOLLOWING--": A0 = 0: FOR A = 1 TO NA: IF AD%(A, 4) = -1 THEN PRINT " "; AN$(A); LEFT$(" (READY WEAPON)", 1 + 20 * ABS(A = MD%(0, 9))): A0 = A0 + 1: IF A0 = 15 THEN PRINT : PRINT  _
"(HIT ANY KEY TO CONTINUE)"; : A$ = INPUT$(1): PRINT : A0 = 0
10020   NEXT: GOTO 300
11000   REM ///BLAST SPELL
11010   GOSUB 4900
11020   FOR M = 1 TO NM: IF S$ = MN$(M) AND MD%(M, 5) = ROOM THEN GOTO 11030
11025   NEXT: PRINT : PRINT "YOU CAN'T BLAST "; S$; "!": PRINT : GOTO 100
11030  S = 1: GOSUB 11500: IF NOT SUC THEN 300
11040   PRINT : PRINT "DIRECT HIT!": PRINT : S = 6: D = 1: DF = M: A = 0: GOSUB 7635: PRINT : GOTO 300
11500  SUC = 0: IF SA%(S) THEN RL = INT(100 * RND(1) + 1): SUC = (((RL < S2%(S)) OR (RL < 5)) AND (RL < 95)): IF RL = 100 THEN 11600
11510   IF NOT SUC THEN PRINT : PRINT "NOTHING HAPPENED.": RETURN
11520  RL = INT(100 * RND(1) + 1): IF RL > S2%(S) THEN S2%(S) = S2%(S) + 2: SA%(S) = SA%(S) + 2
11530  S2%(S) = S2%(S) / 2
11540   RETURN
11600   PRINT : PRINT "THE STRAIN OF ATTEMPTING TO CAST THIS      SPELL OVERLOADS YOUR BRAIN AND YOU      FORGET IT COMPLETELY.": PRINT : SA%(S) = 0: RETURN
12000   REM ///HEAL SPELL
12010  S = 2: GOSUB 11500: IF NOT SUC THEN 300
12020   PRINT : IF MD%(0, 13) THEN PRINT "SOME OF YOUR WOUNDS SEEM TO CLEAR UP.": PRINT
12030  MD%(0, 13) = MD%(0, 13) - INT(10 * RND(1) + 1): IF MD%(0, 13) < 0 THEN MD%(0, 13) = 0
12040  DF = 0: GOSUB 7650: GOTO 300
13000   REM ///POWER SPELL
13010  S = 4: GOSUB 11500: IF NOT SUC THEN 300
13020  RAISE = 0: FOR M = 1 TO NM: M2 = 25 + M: IF AD%(M2, 4) = ROOM OR AD%(M2, 4) = -1 THEN RAISE = -1: PRINT MN$(M); " COMES ALIVE!": AD%(M2, 4) = 0: MD%(M, 5) = ROOM: MD%(M, 13) = 0: WT = WT - AD%(M2, 3)
13030   NEXT M: IF RAISE THEN R3 = ROOM: GOSUB 3600: GOTO 300
13040   FOR A = 1 TO NA: IF AD%(A, 4) = ROOM THEN RAISE = -1: PRINT AN$(A); " VANISHES!": AD%(A, 4) = 0
13050   NEXT A: IF RAISE THEN PRINT : GOTO 300
13060  RR = INT(100 * RND(1) + 1): IF RR < 11 THEN PRINT : PRINT "THE SECTION OF TUNNEL YOU ARE IN ": PRINT "  COLLAPSES AND YOU DIE.": DIE = -1: GOTO 2000
13070   IF RR < 31 THEN PRINT : PRINT "YOU ARE TELEPORTED SOMEWHERE IN THE": PRINT "  DUNGEON": PRINT : R2 = INT(50 * RND(1) + 28): GOTO 3500
13080   IF RR < 86 THEN PRINT : PRINT "YOU HEAR A VERY LOUD SONIC BOOM": PRINT "   THAT ECHOES THROUGH THE TUNNELS.": PRINT : GOTO 300
13090   IF RR > 95 THEN PRINT : PRINT "ALL OF YOUR HITS ARE HEALED.": PRINT : MD%(0, 13) = 0: GOTO 300
13100   GOTO 14020
14000   REM ///SPEED SPELL
14010  S = 3: GOSUB 11500: IF NOT SUC THEN 300
14020   IF NOT SPD THEN MD%(0, 10) = MD%(0, 10) + 2 * MD%(0, 2): MD%(0, 2) = 2 * MD%(0, 2)
14030  SPD = SPD + INT(25 * RND(1) + 10): PRINT : PRINT "YOU CAN FEEL THE NEW AGILITY FLOWING": PRINT "   THROUGH YOU!": PRINT : GOTO 300
15000   REM ///SMILE COMMAND
15010   PRINT : FOR M = 1 TO NM: IF MD%(M, 5) <> ROOM THEN 15100
15020   ON MD%(M, 14) GOTO 15030, 15040, 15050
15030   PRINT MN$(M); " GROWLS AT YOU": GOTO 15100
15040   PRINT MN$(M); " IGNORES YOU": GOTO 15100
15050   PRINT MN$(M); " "; V$; "S BACK": GOTO 15100
15100   NEXT M: PRINT : GOTO 300
16000   REM ///SAY COMMAND
16010   GOSUB 4900
16020   IF S$ = "MAGIC" AND AD%(8, 4) = 0 AND ROOM = AD%(25, 4) THEN PRINT : PRINT "AS YOU SAY THE WORD, THERE IS A SMALL   ERUPTION FROM THE CENTER OF THE STONE   AND AN EMERALD POPS OUT FROM IT.": PRINT : AD%(8, 4) = ROOM: GOTO 300
16030   IF S$ = "BLAST" THEN V$ = S$: S$ = "": GOTO 11000
16040   IF S$ = "HEAL" THEN 12000
16050   IF S$ = "POWER" THEN 13000
16060   IF S$ = "SPEED" THEN 14000
16900   PRINT : PRINT "OKAY, '"; S$; "'": PRINT : GOTO 300
17000   REM ///READY A WEAPON.
17010   GOSUB 4900
17020   FOR A = 1 TO NA: IF AN$(A) = S$ AND AD%(A, 4) = -1 THEN GOTO 17030
17025   NEXT: PRINT : PRINT "YOU AREN'T CARRYING IT!": PRINT : GOTO 100
17030   IF AD%(A, 2) < 2 THEN PRINT : PRINT "THAT ISN'T A WEAPON!": PRINT : GOTO 100
17040  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)
17050   PRINT : PRINT "READIED.": PRINT : GOTO 300
18000   REM ///DRINK COMMAND
18010   GOSUB 4900
18020   IF NBTL THEN 3010
18030   IF S$ <> "WATER" OR RIGHT$(S$, 3) <> "SEA" THEN PRINT : PRINT "A JOB SIMILAR TO GETTING BLOOD FROM A": PRINT "   TURNIP.": PRINT : GOTO 300
18040   IF MD%(5, 4) <> -1 AND MD%(5, 4) <> ROOM AND (ROOM < 6 OR ROOM > 27) THEN PRINT : PRINT "THERE IS NO "; S$; " HERE!": PRINT : GOTO 300
18050   PRINT : PRINT "THE WATER TASTED SALTY, BUT IT DOESN'T     SEEM TO BE POISONOUS.": PRINT : IF AD%(5, 4) THEN AD%(5, 4) = 0
18060   GOTO 300
19000   REM ///ENTER COMMAND
19010   GOSUB 4900
19020   IF NBTL THEN 3010
19030   IF S$ <> "WATER" AND S$ <> "SEA" THEN 19050
19040   PRINT : PRINT "SORRY, BUT I'M AFRAID TO GO INTO THE": PRINT "   WATER WITHOUT MY LIFE PRESERVER!": PRINT : GOTO 300
19050   IF S$ = "BOAT" THEN PRINT : PRINT "OKAY.": PRINT : GOTO 300
19060   PRINT : PRINT "I'M NOT SURE WHAT YOU MEAN BY THAT. TRY    GIVING A DIRECTION TO MOVE.": PRINT : GOTO 100
20000   REM ///OPEN COMMAND
20010   IF NBTL THEN 3010
20020   GOSUB 4900: IF LEFT$(S$, 3) <> "DOO" AND LEFT$(S$, 3) <> "GRA" AND LEFT$(S$, 3) <> "IRO" THEN 20060
20030   IF ROOM <> AD%(17, 4) THEN PRINT : PRINT "IT ISN'T LOCKED!": PRINT : GOTO 300
20040   IF AD%(2, 4) <> -1 THEN PRINT : PRINT "YOU AREN'T CARRYING A KEY TO UNLOCK IT  WITH!": PRINT : GOTO 100
20050   PRINT : PRINT "AS YOU UNLOCK THE IRON GRATE, IT FALLS  INTO DUST.": PRINT : AD%(17, 4) = 0: GOTO 300
20060   FOR A = 0 TO 6: IF LEFT$(S$, 3) = MID$("CHAROPFRILILSVELARSLI", A * 3 + 1, 3) THEN GOTO 20070
20065   NEXT: GOTO 20100
20070   IF RZ OR ROOM <> 52 THEN PRINT : PRINT "HUH? HOW CAN I "; CZ$: PRINT : GOTO 100
20080   IF AD%(2, 4) <> -1 THEN PRINT : PRINT "YOU AREN'T CARRYING A KEY TO DO THAT!": PRINT : GOTO 100
20090  RZ = 1: PRINT : PRINT "YOU FREE "; MN$(9): PRINT : MD%(9, 5) = ROOM: MD%(9, 14) = 3: GOTO 300
20100   IF S$ <> "COFFIN" OR ROOM <> AD%(16, 4) THEN 20200
20110   IF E1 THEN PRINT : PRINT "YOU CAN'T OPEN IT.": PRINT : GOTO 300
20120  E1 = 1: PRINT : PRINT "AS YOU BEGIN TO OPEN THE LID, A SKELETONJUMPS OUT AND ATTACKS YOU AS THE LID    SLAMS BACK SHUT.": PRINT : MD%(1, 5) = ROOM: R3 = ROOM: GOSUB 3600: GOTO 300
20200   PRINT : PRINT "MIND TELLING ME HOW?": PRINT : GOTO 100
21000   REM ///DIG COMMAND
21010   IF NBTL THEN 3010
21020   IF AD%(9, 4) <> -1 THEN PRINT : PRINT "THE GROUND IS TOO HARD TO DIG WITH YOUR HANDS.": PRINT : GOTO 300
21030   IF ROOM <> 27 OR AD%(6, 4) THEN PRINT : PRINT "YOU FIND NOTHING.": PRINT : GOTO 300
21040   PRINT : PRINT "YOU FIND A BAG OF GOLD COINS!": PRINT : AD%(6, 4) = ROOM: GOTO 300

