DECLARE SUB delay (N!)
  '                   Eamon-PC
  '
  '        Adventure #2 - Lair of the Minotaur
  '
  '               by Donald Brown
  '
  '        Converted to IBM-PC by John Nelson
  '
    DEFINT A-Z
    DECLARE SUB prtcenter (A$)
    KEY OFF
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) -------    
 ' 
    DIM WA%(5), SA%(4), MD%(1, 15)
    OPEN "MEAT" FOR INPUT AS #2
    INPUT #2, Nbr.Party
    INPUT #2, REC
    INPUT #2, Nam$
    INPUT #2, Hd, Ag, Ch
    FOR X = 1 TO 4
    INPUT #2, A%
    NEXT
    FOR X = 1 TO 5
    INPUT #2, A%
    NEXT
    INPUT #2, SEX$
    CLOSE 2
    Adv.Nam$ = "Lair of the Minotaur"
    IF SEX$ = "M" THEN
        FR.NAME$ = "Larcenous Lil"
        NOM$ = "she"
        FRTYP$ = "girl"
        HIMHER$ = "her"
    ELSE
        FR.NAME$ = "Slippery Sven"
        NOM$ = "he"
        FRTYP$ = "boy"
        HIMHER$ = "him"
    END IF
    CLS
    COLOR hfg%, hbg%
    prtcenter Adv.Nam$
    COLOR fgc%, bgc%
    PRINT
    PRINT
    PRINT "You are in big trouble. You had arranged to meet in the town of Dunderhaven ": PRINT "with your "; FRTYP$; "friend "; FR.NAME$; ". When you arrived in town, you learned that"
    PRINT NOM$; " had come into town flat broke, and had tried to pick up some easy cash ": PRINT "burglarizing a nearby castle. "; CHR$(ASC(NOM$) - 32); MID$(NOM$, 2); " hasn't been seen since."
    PRINT
    PRINT "Checking around, you find out where "; NOM$; " went, and journey to the castle to": PRINT "try to find "; HIMHER$; "."
    PRINT
    PRINT "All seems to be going well, as you sneak into the castle in the dark. As you": PRINT "look around, suddenly the lights come on and you see yourself surrounded by"
    PRINT "bowmen and a fat ugly man on a throne. He sneers at you and says 'Well, boys,": PRINT "another thief! I guess we'll send the scoundrel to meet the first!"
    PRINT "with that, he pulls a lever and the bottom drops out of the floor."
    GOSUB get.key
    LOCATE 24, 28
    PRINT SPC(27);
    PRINT
    FOR X = 1 TO 50
    FOR y = 1 TO 5
    IF X \ 2 = X / 2 THEN PRINT STRING$(4, "_"); "|";  ELSE PRINT STRING$(2, "_"); "|"; STRING$(2, "_");
    NEXT y
    PRINT "]";
    PRINT SPC(27);
    PRINT "[";
    FOR y = 1 TO 5
    IF X \ 2 = X / 2 THEN PRINT STRING$(4, "_"); "|";  ELSE PRINT STRING$(2, "_"); "|"; STRING$(2, "_");
    NEXT y
    SOUND 130 + 12 * X, 1
    delay .125
    NEXT
    PRINT SPC(38); "THUD!"
    SOUND 130, 0
    RUN "MAINPGM"
get.key:
    LOCATE 24, 1
    PRINT STRING$(26, "="); " Press Any Key to Continue "; STRING$(26, "=");
    A$ = ""
    WHILE A$ = ""
    A$ = INKEY$
    WEND
    RETURN

SUB delay (N!)
        Tm! = TIMER
        DO
        LOOP UNTIL Tm! + N! < TIMER
END SUB

DEFSNG A-Z
SUB prtcenter (A$)
        L = LEN(A$)
        PRINT SPC((78 - L) \ 2); A$; SPC((78 - L) \ 2);

END SUB

