' The Wonderful World of Eamon
'
' A computerized fantasy role-playing system origionaly made for
' the Apple computer system by Donald Brown
'
' Programmed for MBASIC by Jon Walker,Video Shop,139 S. Central
' Marshfield, WI 54449
'
' Fixed to run under QBASIC by Frank Black, 2/97
'
' ///Boot up program for Eamon system.
' ///Gets name of player and send to main hall or new players
'
130 CLS : COLOR 7
135 FOR I = 1 TO 24: PRINT : NEXT I
140 PRINT , "**************************************"
150 PRINT , "*                                    *"
160 PRINT , "*    THE WONDERFUL WORLD OF EAMON    *"
165 PRINT , "*            VERSION 1.1             *"
170 PRINT , "*                                    *"
180 PRINT , "*     Original work by Donald        *"
190 PRINT , "*                       Brown        *"
200 PRINT , "*                                    *"
210 PRINT , "*     Converted  by Jon              *"
220 PRINT , "*                   Walker           *"
230 PRINT , "*                                    *"
240 PRINT , "**************************************"
250 PRINT
255 GOSUB 3000
261 PRINT , "**************************************"
262 PRINT , "*                                    *"
263 PRINT , "*    NON COMERCIAL DISTRIBUTION IS   *"
264 PRINT , "*              WELCOME               *"
265 PRINT , "*                                    *"
266 PRINT , "**************************************"
267 PRINT
268 GOSUB 3000
'
OPEN "CHARACTE.RS" FOR RANDOM AS #1 LEN = 255
FIELD 1, 255 AS B$
GET #1, 1
NC = VAL(B$)
'
Intro:
CLS : LOCATE 8: q$ = CHR$(34)
PRINT "     You are in the outer chamber of the hall of the guild of free adventurers."
PRINT "Many men and women are guzzling beer and there is loud singing and laughter."
PRINT "On the north side of the chamber is a cubbyhole with a desk.  Over the desk is"
PRINT "a sign which says 'REGISTER HERE OR ELSE!'."
PRINT
PRINT : PRINT "Do you go over to the desk or join the men drinking the beer?"
PRINT "(Hit 'D' for desk or 'M' for men):"; : GOSUB GetKey1
IF a$ = "D" THEN GOTO Desk
IF a$ <> "M" THEN GOTO Intro
PRINT : PRINT : PRINT
PRINT "     As you go over to the men, you feel a sword being thrust through your back"
PRINT "and you hear someone say, "; q$; "You really must learn to follow directions!"; q$
a$=inkey$
do
loop until inkey$ <> ""
CHDIR "..":CHDIR "..":RUN "MUSEUM"
END
'
'
Desk:
PRINT : PRINT : PRINT
PRINT "     You are greeted there by a burly Irishman who looks at you with a scowl and"
PRINT "asks you, "; q$; "What's your name?"; q$: PRINT : PRINT
'
Desk1:
COLOR 7: LINE INPUT "You give him your name (type it now):"; tname$
PRINT : COLOR 7
'
IF tname$ = "" THEN
  PRINT "     He pulls out a sword and begins to sharpen it  saying, "; q$; "Beware the blood"
  PRINT "stains on the floor.  They belong to a poor lad who came in last week and wonna"
  PRINT "give me his name."; q$: PRINT : PRINT : GOTO Desk1
END IF
'
IF LEN(tname$) > 30 THEN
  PRINT "    He scowls at you and says, "; q$; "Yer name's too long fer me book.  I canna use"
  PRINT "more than thirty letters."; q$: PRINT : PRINT : GOTO Desk1
END IF
'
T1$ = tname$: tname$ = UCASE$(tname$)
PRINT "    He starts to look through his book, muttering to himself about "; q$; "Strange"
PRINT "Saxon names"; q$;
IF T1$ <> tname$ THEN PRINT ", and something about people who don't use caps lock";
PRINT ".": PRINT
'
710 FOR R = 1 TO NC: GET #1, R + 1
720 IF LEFT$(B$, 1) = "," THEN 770
730    FOR I = 1 TO LEN(B$)
740       IF MID$(B$, I, 1) = "," THEN 760
750    NEXT I: PRINT "SYSTEM ERROR, BAD FILE DATA": STOP
760    IF tname$ = LEFT$(B$, I - 1) THEN GOTO Done
770 NEXT R
'
PRINT "    He looks at you and says, 'Yer names na here.  Have ye given it to me"
PRINT "aright?"; q$: PRINT
PRINT "How do you answer (Hit 'Y' or 'N' ) "; : GOSUB GetKey1: PRINT : PRINT
IF a$ <> "Y" THEN
  PRINT "He says, "; q$; "Well try again!"; q$: PRINT : GOTO Desk1
END IF
'
PRINT "    He hits his forehead and says "; q$; "Ah, ye must be new here!  Well, wait just a"
PRINT "minute and I'll bring someone out to take care of ye."; q$: PRINT
GOSUB WriteChar: RUN "NEWGUY"
'
Done:
PRINT "He looks up and says, "; q$; "Ah, here ye be!  Well, go and have fun in the Hall!"; q$
PRINT : GOSUB WriteChar: : RUN "MAINHALL"
'
WriteChar:
OPEN "ADVENTUR.ER" FOR OUTPUT AS #2
  PRINT #2, tname$ + "," + STR$(R)
CLOSE #2: RETURN
'
3000 FOR I = 1 TO 6: PRINT : NEXT I
  zz = CSRLIN: GOSUB GetKey: LOCATE 24: PRINT SPC(40); : LOCATE zz, 1
3270 FOR I = 1 TO 12: PRINT : NEXT I
3280 RETURN
'---------------------------------------------------------------------------
' Get one keypress Subroutine
'
GetKey:
LOCATE 24: PRINT "Press any key to continue...";
GetKey1:
DO
   a = RND
   BS = POS(0)
   CC = CC + 1                           ' CC = Cursor Counter
   IF CC = 180 THEN PRINT "/": LOCATE CSRLIN - 1, BS
   IF CC = 280 THEN PRINT CHR$(179): LOCATE CSRLIN - 1, BS
   IF CC = 380 THEN
      PRINT "\": LOCATE CSRLIN - 1, BS
      CC = 0
      END IF
   a$ = UCASE$(INKEY$)
LOOP UNTIL a$ <> ""
PRINT a$: RETURN

