'  The Wonderful World Of Eamon Main Hall Program
'  Originaly made by Donald Brown for the Apple II system
'                     **        ***          **
'  Converted to MBASIC  for CP/M   and MS-DOS   by Jon Walker
'
' (Fixed to run under QBASIC by Frank Black, 2/97) -Update 04 MAY 2012
'
'   WTYPE: TYPE   WODDS:ODDS OF HIT   WDICE:# OF DICE  WSIDE:# OF SIDES
'   SA(1)-SA(4):SPELL ABILITIES
'   WA(1)-WA(5):WEAPON ABILITIES
'   AE: AMROUR EXPERT.  SEX$: M OR F  GOLD: ON PERSON  BANK: GOLD IN BANK
'   AC: ARMOUR CLASS
'   WNAME$: WEAPON NAME
'   WTYPE: TYPE   WODDS:ODDS OF HIT   WDICE:# OF DICE  WSIDE:# OF SIDES
'
cname$ = "": rc = 0
OPEN "ADVENTUR.ER" FOR INPUT AS #1
INPUT #1, cname$: INPUT #1, rc: CLOSE
'
OPEN "CHARACTE.RS" FOR RANDOM AS #1 LEN = 255
FIELD 1, 255 AS b$
GET #1, rc + 1
GOSUB 30000
GET #1, 1: REC = VAL(b$): CLOSE #1
'
DEF FND$ (x$) = CHR$(ASC(x$) - 32 * ABS(x$ >= "a" AND x$ <= "z"))
DEF FNP (x) = INT(x * RTIO + .5)
q$ = CHR$(34)
'---------------------------------------------------------------------------
' Main Menu
'
Menu:
100 CLS : LOCATE 5
PRINT "As you wander about the hall, you realize you can do one of six things --": PRINT
PRINT "1. Go on an adventure."
PRINT "2. Visit the weapon shop for weapons and/or armour."
PRINT "3. Hire a wizard to teach you some spells."
PRINT "4. Find the banker to deposit or withdraw some gold."
PRINT "5. Examine your abilities."
PRINT "6. Temporarily leave the Universe."
PRINT : PRINT "(Hit the key for your choice, 1-6) "; : GOSUB GetKey1
cmd = INT(VAL(a$)): IF cmd < 1 OR cmd > 6 THEN GOTO Menu
CLS : LOCATE 5: ON cmd GOTO C1, c2, C3, C4, C5, C6
END
'---------------------------------------------------------------------------
' Go on an adventure
'
C1:
1002 OPEN "R", #1, "CHARACTE.RS", 255
1003 FIELD 1, 255 AS b$
1004 LSET b$ = ",,,,"
1005 PUT #1, rc + 1
1006 CLOSE #1
1010 CLS : PRINT : PRINT : PRINT : PRINT "Insert diskette with adventure (or keep this diskette for beginners cave)"
1015 PRINT "in this drive then hit 'C' to continue."
1020 a$ = INKEY$: IF a$ = "" THEN 1020
1021 IF a$ <> "c" AND a$ <> "C" THEN 1020
1030 PRINT
1040 OPEN "I", #1, "EAMON.NAM"
1041 INPUT #1, ADNAME$: INPUT #1, FINM$
1042 CLOSE #1
1050 CLS : PRINT : PRINT : PRINT : PRINT
1052 PRINT "You are about to adventure in "; ADNAME$: PRINT : PRINT
1060 OPEN "O", #1, "FRESHMEA.T"
1062 GOSUB 30600: PRINT #1, rc: PRINT #1, a$
1066 CLOSE #1
1068 RUN FINM$
1070 STOP
'---------------------------------------------------------------------------
' Weapons/Armor shop
'
c2:
PRINT "As you enter the weapon shop, Marcos Cavielli (the owner) comes from out of the"
PRINT "back room and says, "; q$; "Well as I live and breath, if it isn't my old pal,"
PRINT cname$; "!": PRINT
PRINT q$; "So, you want to buy a weapon, sell a weapon, or get some better armour?"
PRINT : PRINT : PRINT "(Hit the key, B S or A) ";
c2 = ch + INT(11 * RND(1) - 5): c2 = c2 + ABS(c2 = 0): RTIO = 10 / c2
2020 f = 0: a$ = INKEY$: a$ = LTRIM$(RTRIM$(UCASE$(a$))): IF a$ = "" THEN 2020
FOR f = 1 TO 3: IF a$ = MID$("BSA", f, 1) THEN tr = f
NEXT: IF tr = 0 THEN GOTO 2020
'
2040 PRINT a$: PRINT : ON tr GOTO 2050, 2220, 2490
'----------------------------------------------------------------------------
' Buy weapon
'
2050 IF wname$(4) = "NONE" THEN 2060
PRINT "Marcos smiles at you and says, "; q$; "Thatsa good, but first you gotta sell me a"
PRINT "weapon.  You know the law--no more than four weapons per person!"; q$
PRINT : PRINT : GOTO 2210
'
2060 REM
PRINT "Marcos smiles at you and says, "; q$; "Good. I gotta the best.  You wanta Axe, Bow,"
PRINT "Mace, Spear, or Sword?"; q$
PRINT : GOSUB 2650: PRINT
PRINT "Marcos says, "; q$; "Well, I just happen to have three "; n$; "S of varying quality."
PRINT "I've got a very good one for "; FNP(2 * bp); "gp, a fair one for "; FNP(bp); "gp, and a kinda shabby one for "; FNP(bp / 2)
PRINT
PRINT "(Hit the key, G F or P) ";
'
2090 q = 0: a$ = INKEY$: a$ = LTRIM$(RTRIM$(UCASE$(a$))): IF a$ = "" THEN 2090
FOR f = 1 TO 3: IF a$ = MID$("GFP", f, 1) THEN q = f
NEXT: IF q = 0 THEN GOTO 2090
2100 PRINT a$: p = bp + bp * ABS(q = 1) - bp / 2 * ABS(q = 3): p = FNP(p)
'
2110 IF p <= gold THEN 2120
2111 PRINT "Marcos shakes a finger at you and says, 'You shouldn't play tricks"
2112 PRINT "on an old friend!  Come back when you gotta more gold or you want"
2113 PRINT "something you can afford.'  He then shoos you out the door": PRINT : GOTO 100
2120 REM
FOR w = 1 TO 4
   IF wname$(w) = n$ THEN n$ = n$ + "#": GOTO 2120
NEXT: w = 0
FOR f = 1 TO 4
   IF wname$(f) = "NONE" THEN w = f: f = 4
NEXT
2140 wname$(w) = n$: wtype(w) = tp: wodds(w) = 10 * (2 - q): wdice(w) = dice: wside(w) = side: gold = gold - p
2150 PRINT "Marcos hands you your weapon and takes the price from you.": PRINT
'
2160 IF gold < FNP(50) THEN 2210
2170 PRINT "He now asks you, "; q$; "Now how about some armour?"; q$
PRINT : PRINT "(Hit Y or N) "; : GOSUB GetKey1
IF a$ <> "Y" AND a$ <> "N" THEN PRINT : GOTO 2170
PRINT a$: PRINT : IF a$ = "N" GOTO 2210 ELSE GOTO 2490
'
2210 REM
PRINT "Marcos smiles and says, "; q$; "Come back again soon!"; q$; " as he shoos you out of his shop."
PRINT : GOSUB GetKey: GOTO 100
'
2220 PRINT : PRINT "Marcos asks you, 'Is this weapon you want to sell me a standard"
2221 PRINT "weapon like I sell?' (Hit Y or N)  ";
2230 a$ = INKEY$: IF a$ = "" THEN 2230 ELSE IF a$ = "y" OR a$ = "Y" THEN 2350
2240 IF a$ <> "n" AND a$ <> "N" THEN 2230
2250 PRINT a$: PRINT : p = INT(50 / RTIO + .5)
2251 PRINT "Marcos says, 'Then I can only give you "; p; " gold pieces for it,"
2252 PRINT "Take it or leave it !'": PRINT : PRINT "(Hit T or L)   ";
2260 a$ = INKEY$: IF a$ = "" THEN 2260 ELSE IF a$ = "L" OR a$ = "l" THEN PRINT a$: PRINT : GOTO 2210
2270 IF a$ <> "t" AND a$ <> "T" THEN 2260
2280 PRINT a$: PRINT : PRINT "Marcos says, 'Okay, what've you got?": PRINT
2281 INPUT "(Enter weapon name) "; a$: a$ = UCASE$(a$): w$ = a$
w = 0
FOR f = 1 TO 4
   IF wname$(f) = w$ THEN w = f
NEXT
IF w = 0 THEN PRINT "Marcos frowns at you and says, 'You can't sell a weapon you don't own!'": PRINT : GOTO 2210
2290 L = LEFT$(w$, 5) = "SWORD" OR LEFT$(w$, 5) = "SPEAR" OR LEFT$(w$, 4) = "MACE" OR LEFT$(w$, 3) = "BOW" OR LEFT$(w$, 3) = "AXE"
2291 IF L THEN PRINT "Marcos frowns at you and says, 'This is a weapon like I sell, remember!'": GOTO 2420
2300 PRINT "Marcos gives you your money and takes your weapon.": gold = gold + p
2301 FOR x = w TO 4
2302 wname$(x) = wname$(x + 1): wtype(x) = wtype(x + 1): wodds(x) = wodds(x + 1): wdice(x) = wdice(x + 1): wside(x) = wside(x + 1): NEXT x: wname$(4) = "NONE"
2310 PRINT : PRINT "Marcos asks you, 'How about buying a weapon?'": PRINT
2311 PRINT "(Hit Y or N)  ";
2320 a$ = INKEY$: IF a$ = "" THEN 2320 ELSE IF a$ = "Y" OR a$ = "y" THEN PRINT a$: PRINT : GOTO 2050
2330 IF a$ <> "n" AND a$ <> "N" THEN 2320
2340 PRINT a$: PRINT : GOTO 2160
2350 PRINT : PRINT "Marcos asks, 'Well, what weapon you wanta return?'": PRINT : GOSUB 2650: PRINT
2360 W2 = w: w = 0
FOR f = 1 TO 4
   IF LEFT$(wname$(f), LEN(n$)) = n$ THEN w = f
NEXT: IF w = 0 THEN PRINT "Marcos laughs and says, 'You never bought that one from me, remember?'": PRINT : GOTO 2210
2370 bp = bp + bp * ABS(wodds(T) > 5) - bp / 2 * ABS(wodds(T) < -5): p = INT(bp / RTIO + .5): IF p > bp / 4 THEN p = INT(bp / 4 + .5)
2380 PRINT "Marcos examines you weapons and says, 'Well, you've banged it up"
2381 PRINT "a bit, but I can give you "; p; " gold pieces for it, take it or "
2382 PRINT "leave it.'"
2383 PRINT : PRINT "(Hit T or L)  ";
2390 a$ = INKEY$: IF a$ = "" THEN 2390 ELSE IF a$ = "L" OR a$ = "l" THEN PRINT a$: PRINT : GOTO 2210
2400 IF a$ <> "t" AND a$ <> "T" THEN 2390
2410 PRINT a$: PRINT : GOTO 2300
'
2420 PRINT : w$ = UCASE$(w$): w = 0
FOR f = 1 TO 4
IF MID$("ABMS", f, 1) = LEFT$(w$, 1) THEN w = f
NEXT: ON w GOTO 2440, 2450, 2460, 2470
2440 bp = 25: GOTO 2370
2450 bp = 40: GOTO 2370
2460 bp = 20: GOTO 2370
2470 IF MID$(w$, 2, 1) = "P" THEN bp = 25: GOTO 2370
2480 bp = 50: GOTO 2370
'
2490 a2 = INT(ac / 2): SH = ac - a2 * 2: B1 = 25 * ABS(a2 = 1) + 60 * ABS(a2 = 2) + 100 * ABS(a2 = 3): TI = INT(B1 / RTIO + .5)
2491 PRINT "Marcos takes you to the armour section of his shop and shows you"
2492 PRINT "leather armour, chain armour, and plate.": IF TI > B1 * 2 THEN TI = B1 * 2
2500 PRINT : PRINT "He says, 'I can put you in any of these very cheaply. I"
2501 PRINT "need "; FNP(100); " gold pieces for the leather, "; FNP(250);
2502 PRINT "for the chain,"
2503 PRINT "and "; FNP(500); " for the plate.": PRINT
2510 IF TI THEN PRINT "Also I can give you a trade-in on your old armour of "; TI; " gold pieces.": PRINT
2520 PRINT "Well, what will it be?'": PRINT
2521 PRINT "(Hit N for nothing or L C or P)  ";
2530 a = 0: a$ = INKEY$: a$ = LTRIM$(RTRIM$(UCASE$(a$))): IF a$ = "" THEN 2530

FOR f = 1 TO 4
   IF a$ = MID$("NLCP", f, 1) THEN a = f
NEXT: IF a = 0 THEN GOTO 2530

2540 PRINT a$: PRINT : IF a = 1 THEN 2570
2550 p = FNP(100 * ABS(a = 2) + 250 * ABS(a = 3) + 500 * ABS(a = 4)) - TI
2552 IF p > gold THEN PRINT "Marcos frowns when he sees that you do not have enough to pay for your": PRINT "armour and says 'I don't give credit!'": PRINT : GOTO 2630
2560 PRINT "Marcos takes your old armour and your gold and helps you into your"
2561 PRINT "new armour.": PRINT : gold = gold - p: a2 = a - 1
2570 IF SH THEN 2630
2580 PRINT "Marcos smiles and says, 'Now how about a shield?  I can let you"
2582 PRINT "have one for only "; FNP(50); " gold pieces!'": PRINT
2583 PRINT "(Hit Y or N)  ";
2590 a$ = INKEY$: IF a$ = "" THEN 2590 ELSE IF a$ = "n" OR a$ = "N" THEN PRINT a$: PRINT : GOTO 2630
2600 IF a$ <> "y" AND a$ <> "Y" THEN 2590
2610 PRINT a$: PRINT : IF gold < FNP(50) THEN PRINT "When he sees that you do not have enough gold to buy the shield,": PRINT "Marcos frowns and says, 'I'm sorry, but I don't give credit!": PRINT : GOTO 2630
2620 gold = gold - FNP(50): SH = 1: PRINT "Marcos takes your gold and gives you a shield.": PRINT
2630 ac = a2 * 2 + SH: PRINT : GOTO 100
2640 END
'
2650 PRINT "(Hit the key(s), A B M SP or SW)  ";
2660 a$ = INKEY$: IF a$ = "" THEN 2660 ELSE a$ = FND$(a$)
a$ = UCASE$(a$): w = 0
FOR f = 1 TO 4
   IF a$ = MID$("ABMS", f, 1) THEN w = f
NEXT: IF w = 0 THEN GOTO 2660
2670 ON w GOTO 2680, 2690, 2700, 2710
2680 PRINT "AXE": bp = 25: n$ = "AXE": tp = 1: side = 6: GOTO 2750
2690 PRINT "BOW": bp = 40: n$ = "BOW": tp = 2: side = 6: GOTO 2750
2700 PRINT "MACE": bp = 20: n$ = "MACE": tp = 3: side = 4: GOTO 2750
'
2710 PRINT a$;
2715 a$ = INKEY$: IF a$ = "" THEN 2715
a$ = UCASE$(a$)
IF a$ = "P" THEN
  PRINT "PEAR": bp = 25: tp = 4: side = 5: n$ = "SPEAR": GOTO 2750
END IF
IF a$ <> "W" THEN 2715
PRINT "WORD": bp = 50: n$ = "SWORD": tp = 5: side = 8
2750 dice = 1: RETURN
'---------------------------------------------------------------------------
' Wizard
'
C3:
PRINT "After a few minutes diligent searching you find Hokas Tokas, the old Mage. He"
PRINT "looks at you and says, "; q$; "So you want old Tokey to teach you some magic, heh hey?"
PRINT "Well it'll cost you. Today my fees are:": PRINT
c2 = ch + INT(11 * RND(1) - 5): c2 = c2 + ABS(c2 = 0): RTIO = 10 / c2
PRINT USING "     Blast   ##,### gp"; FNP(3000)
PRINT USING "     Heal    ##,### gp"; FNP(1000)
PRINT USING "     Speed   ##,### gp"; FNP(5000)
PRINT USING "     Power   ##,### gp"; FNP(100)
PRINT : PRINT "Well, which will it be?"; q$: PRINT
Tokas:
PRINT "(Hit the key for your spell, B H S or P) "; : GOSUB GetKey1
sp = 0
FOR f = 1 TO 4
   IF a$ = MID$("BHSP", f, 1) THEN sp = f
NEXT: IF sp = 0 THEN GOTO Tokas
'
LOCATE CSRLIN - 1, 42: ON sp GOTO 3060, 3070, 3080, 3090
3060 PRINT "Blast": p = FNP(3000): GOTO 3100
3070 PRINT "Heal": p = FNP(1000): GOTO 3100
3080 PRINT "Speed": p = FNP(5000): GOTO 3100
3090 PRINT "Power": p = FNP(100)
3100 PRINT
'
IF p > gold THEN
  PRINT "When Hokas sees that you don't have enough to pay him, he stalks to the bar,"
  PRINT "muttering about youngsters who should be turned into frogs."
  GOSUB GetKey: GOTO 100
END IF
'
IF sa(sp) THEN
  PRINT "Hokas says, "; q$; "I ought to take your gold anyway, but haven't you forgotten"
  PRINT "something?  I already taught you that spell!"; q$: PRINT
  PRINT "Shaking his head sadly, he returns to the bar.": GOSUB GetKey: GOTO 100
END IF
'
3120 gold = gold - p: sa(sp) = INT(50 * RND(1) + 26)
PRINT "Hokas teaches you your spell, takes his fee, and returns to his stool on the"
PRINT "bar.  As you walk away you hear him order a double dragon blomb."
GOSUB GetKey: GOTO 100
'---------------------------------------------------------------------------
' Banker
'
C4:
PRINT
PRINT "You have no trouble spotting Shylock McFenney, the local banker, due to his"
PRINT "large belly. You attract his attention, and he comes over to you and says, "; q$; "Well"
PRINT cname$; ", my dear ";
PRINT RTRIM$(MID$("girlboy ", ABS(sex$ = "M") * 4 + 1, 4)); ", ";
PRINT "what a pleasure it is to see you!"; q$
PRINT
PRINT "Do you want to make a deposit or a withdrawl?": PRINT
PRINT "(Hit D for deposit, W for withdrawl)  "; : GOSUB GetKey1
IF a$ <> "D" AND a$ <> "W" THEN GOTO Menu ELSE IF a$ = "D" THEN GOTO Bank2
'
PRINT
PRINT "Shylock says, "; q$; "Well, you have ";
PRINT LTRIM$(RTRIM$(STR$(bank)));
PRINT " gold pieces stored with me.  How many"
PRINT "do you want to take back?"; q$
'
Bank1:
PRINT
LINE INPUT "(Enter the number of gold pieces to withdraw): "; a$: PRINT
mny = INT(VAL(a$))
'
IF mny < 0 OR mny <> VAL(a$) THEN
  PRINT "The banker scowls at you and says, "; q$; "Come, come, you're not making any sense!"
  PRINT "Try again."; q$: PRINT : GOTO Bank1
END IF
'
IF mny > bank THEN
  PRINT "The banker throws a terrible glance and says, "; q$; "That's more than you've got!  You"
  PRINT "know I don't make loans to your kind!"; q$; " With that he looses himself in the crowd."
  GOSUB GetKey: GOTO 100
END IF
'
gold = gold + mny: bank = bank - mny
PRINT "The banker hands you your gold and says, "; q$; "That leaves you with ";
PRINT LTRIM$(RTRIM$(STR$(bank))); " gold"
PRINT "peices in my care."; q$; "  He shakes your hand and walks away."
GOSUB GetKey: GOTO 100
'
Bank2:
PRINT "Shylock gets a wide grin on his face and says, "; q$; "Good for you!  How much do you"
PRINT "want to deposit?"; q$
'
Bank3:
PRINT : LINE INPUT "(Enter the amount you want to deposit) "; a$: PRINT
mny = INT(VAL(a$))
'
IF mny < 0 OR VAL(a$) <> mny THEN
  PRINT "The banker scowls at you and says, "; q$; "You're not making sense! Try again."; q$
  GOTO Bank3
END IF
'
IF mny > gold THEN
  PRINT "The banker was very please when you told him the sum, but when he discovered"
  PRINT "that you didn't have that much on you, he walked away, shouting about fools"
  PRINT "who play tricks on a kindly banker."
  GOSUB GetKey: GOTO 100
END IF
'
gold = gold - mny: bank = bank + mny
PRINT "Shylock takes your money, puts it in his bag, listens to it jingle, then thanks"
PRINT "you and walks away."
GOSUB GetKey: GOTO 100
'---------------------------------------------------------------------------
' View Character
'
C5:
CLS : PRINT "You are the "; MID$("mighty fair ", 1 + 7 * ABS(sex$ = "F"), 7);
PRINT cname$; "."
PRINT
PRINT "Your attributes are:": PRINT "  HD="; hd; "  AG="; ag; "  CH="; ch
PRINT
PRINT "You know the following spells--": sm = 0
FOR S = 1 TO 4
   IF sa(S) THEN
     PRINT RTRIM$(MID$("BlastHeal SpeedPower", (S - 1) * 5 + 1, 5));
     PRINT "  "; : sm = -1
   END IF
NEXT: IF NOT sm THEN PRINT "  (No spells)";
'
PRINT : PRINT
PRINT "Your weapon abilities are--"
PRINT "     AXE    BOW   MACE   SPEAR  SWORD": PRINT " ";
FOR w = 1 TO 5
   PRINT USING "  ####%"; wa(w);
NEXT: PRINT : PRINT
'
a2 = INT(ac / 2): PRINT "Armour: ";
PRINT RTRIM$(MID$("Skin   LeatherChain  Plate  ", a2 * 7 + 1, 7));
IF ac > a2 * 2 THEN PRINT " and Shield";
PRINT TAB(30); "AE: "; LTRIM$(RTRIM$(STR$(ae))); "%"
PRINT
PRINT "Gold in hand: "; LTRIM$(RTRIM$(STR$(gold)));
PRINT TAB(25); "Bank: "; LTRIM$(STR$(bank))
PRINT
PRINT "Weapons        Complexity      Damage"
PRINT "-------------------------------------"
FOR w = 1 TO 4
  IF w > 1 AND wname$(w) = "NONE" THEN 5090
  IF wname$(w) = "NONE" THEN PRINT : PRINT "     NO WEAPONS": GOTO 5090
  PRINT wname$(w); TAB(19);
  PRINT LTRIM$(RTRIM$(STR$(wodds(w)))); "%"; : LOCATE CSRLIN, 33
  PRINT LTRIM$(RTRIM$(STR$(wdice(w)))); "D"; LTRIM$(STR$(wside(w)))
5090 REM
NEXT: GOSUB GetKey: GOTO 100
'----------------------------------------------------------------------------
' Leave
'
C6:
PRINT "As you leave the hall, the Irishman comes up to you, slaps you on the back and"
PRINT "says "; q$; "Y'all come back real soon, ya heah?"; q$
'
OPEN "CHARACTE.RS" FOR RANDOM AS #1 LEN = 255
FIELD 1, 255 AS b$
GOSUB 30600
LSET b$ = a$: PUT #1, rc + 1: CLOSE
chdir "..":chdir "..":run "MUSEUM"
END
'
30000 REM
30010 REM  break up record into its needed parts
30020 REM  and damned be he the first to screw up this ordered set!!!
30030 REM
30031 REM HINT: a string of 37 commas will clear all fields!
30040 REM
30050 R$ = b$
30060 u = 1: w = 1: x = 1: Y = 1: IF LEN(R$) = 0 THEN 30560
30070 FOR I = 1 TO 37
30075 a1$ = ""
30080 IF R$ = "" THEN 30555
30090 J = INSTR(R$, ",")
30095 IF J <> 0 THEN a1$ = LEFT$(R$, J - 1): R$ = MID$(R$, J + 1): GOTO 30110
30100 IF J = 0 AND R$ <> "" THEN a1$ = R$: R$ = ""
30110 REM
30120 ON u GOTO 30170, 30180, 30190, 30200, 30210, 30210, 30210, 30210, 30250, 30250
30130 ON u - 10 GOTO 30250, 30250, 30250, 30300, 30310, 30320, 30330, 30340, 30350, 30360
30140 ON u - 20 GOTO 30370, 30380, 30390, 30350, 30360, 30370, 30380, 30390, 30350, 30360
30150 ON u - 30 GOTO 30370, 30380, 30390, 30350, 30360, 30370, 30380, 30390
30160 STOP
30170 cname$ = a1$: GOTO 30550
30180 hd = VAL(a1$): GOTO 30550
30190 ag = VAL(a1$): GOTO 30550
30200 ch = VAL(a1$): GOTO 30550
30210 sa(x) = VAL(a1$): x = x + 1: GOTO 30550
30250 wa(Y) = VAL(a1$): Y = Y + 1: GOTO 30550
30300 ae = VAL(a1$): GOTO 30550
30310 sex$ = a1$: GOTO 30550
30320 gold = VAL(a1$): GOTO 30550
30330 bank = VAL(a1$): GOTO 30550
30340 ac = VAL(a1$): GOTO 30550
30350 wname$(w) = UCASE$(a1$): GOTO 30550
30360 wtype(w) = VAL(a1$): GOTO 30550
30370 wodds(w) = VAL(a1$): GOTO 30550
30380 wdice(w) = VAL(a1$): GOTO 30550
30390 wside(w) = VAL(a1$): w = w + 1: GOTO 30550
30550 u = u + 1
30555 NEXT I
30560 GOTO WepCheck
'----------------------------------------------------------------------------
' Make sure weapons are in correct order to account for sloppy programming
'
WepCheck:
FOR w = 1 TO 4
   IF wname$(w) = "NONE" THEN
     FOR f = 2 TO 4
        IF wname$(f) <> "NONE" AND f > w THEN
          wname$(w) = wname$(f): wtype(w) = wtype(f): wdice(w) = wdice(f)
          wside(w) = wside(f): wname$(f) = "NONE": GOTO WepCheck
        END IF
     NEXT
   END IF
NEXT
RETURN
30570 REM
30580 REM   pack the array with commas
30590 REM
30600 a$ = cname$ + "," + STR$(hd) + "," + STR$(ag) + "," + STR$(ch) + ","
30610 FOR I = 1 TO 4: a$ = a$ + STR$(sa(I)) + ",": NEXT I
30620 FOR I = 1 TO 5: a$ = a$ + STR$(wa(I)) + ",": NEXT I
30630 a$ = a$ + STR$(ae) + "," + sex$ + "," + STR$(gold) + "," + STR$(bank) + "," + STR$(ac)
30640 FOR I = 1 TO 4: a$ = a$ + "," + wname$(I) + ","
30650 a$ = a$ + STR$(wtype(I)) + "," + STR$(wodds(I)) + ","
30660 a$ = a$ + STR$(wdice(I)) + "," + STR$(wside(I))
30670 NEXT I
30680 RETURN
40000 REM
40001 REM *
40002 REM  Apple II and Apple are trademarks of Apple computer co.
40003 REM
40010 REM **
40020 REM   MBASIC and MS-DOS are trademarks of Microsoft
40030 REM
40040 REM ***
40050 REM    CP/M is a trademark of Digital Research
'---------------------------------------------------------------------------
' 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, BS
   IF CC = 280 THEN PRINT CHR$(179); : LOCATE CSRLIN, BS
   IF CC = 380 THEN
      PRINT "\"; : LOCATE CSRLIN, BS
      CC = 0
      END IF
   a$ = UCASE$(INKEY$)
LOOP UNTIL a$ <> ""
PRINT a$: RETURN

