Source:Character Builder

From Eamon Wiki
Jump to navigation Jump to search
This page is a verbatim reproduction of original source material and should not be edited except for maintenance.
Description

The Applesoft BASIC source code of the Eamon utility program Character Builder.

Source

Eamon Utilities I

Date

October 1983

Author

Don Unrath

License

The use of this item is permitted on the grounds that it's free or in the public domain.

1  REM AAA CHARACTER BUILDER 1
2  REM 
3  REM BY DON UNRATH 312/438-4799
4  REM 
5  REM 
6  REM REV BY THOMAS ZUCHOWSKI
7  REM 10/83
8  REM 
9  REM 
10 DK$ =  CHR$ (4):REC = 1
120  PRINT DK$;"NOMON I,O,C"
130  DIM C(18)
140  HOME : VTAB 4: PRINT "THIS PROGRAM IS TO BE USED TO BUILD": PRINT "EAMON CHARACTERS OF YOUR OWN": PRINT "DESIGN. BEFORE YOU CONTINUE PLEASE"
150  PRINT "INSERT THE EAMON MASTER DISK AND THEN": PRINT "PRESS ANY KEY TO CONTINUE."
160  VTAB 13: PRINT "PLEASE NOTE:": PRINT "FOR ADDITIONAL INFORMATION PLEASE REFER": PRINT "TO THE PLAYER'S MANUAL LOCATED ON THE": PRINT "DUNGEON DESIGNER'S DISK. THIS DISK IS": PRINT "INCLUDED AS PART OF THE EAMON SERIES."
170  GOSUB 1970
180  HOME : PRINT "IF YOUR DISC HAS TOO MANY CHARACTERS": PRINT "STORED ON IT, YOU MAY WISH TO DELETE ": PRINT "ALL OF THEM AND START OVER CLEAN": PRINT : PRINT "DO YOU WISH TO DELETE CURRENT CHARACTERSAND BEGIN WITH A NEW FILE?"
190  INPUT "'Y' OR 'N'   ";AN$
200  IF AN$ = "N" THEN 210
202  IF AN$ <  > "Y" THEN 210
204  PRINT  CHR$ (7): INVERSE : HTAB 5: PRINT "YOU HAVE REQUESTED DELETION OF": HTAB 7: PRINT "THE ENTIRE CHARACTER FILE!": PRINT : NORMAL : PRINT "ARE YOU SURE YOU WANT TO DO THIS ";: INPUT AN$
206  IF AN$ = "Y" THEN  PRINT : PRINT : HTAB 10: PRINT "REINITIALIZING CHARACTER FILE": GOTO 1980
210  ONERR  GOTO 740
220  TEXT : HOME 
230 DK$ =  CHR$ (4):REC = 1
240  HOME : PRINT "LISTING OF CURRENT CHARACTERS": FOR T = 1 TO 400: NEXT T
250 DK$ =  CHR$ (4):REC = 1
260  PRINT DK$;"OPEN CHARACTERS,L150"
270  PRINT DK$;"READ CHARACTERS,R";REC
280  INPUT NAME$: IF NAME$ = "" THEN 700
290  INPUT HD,AG,CH
300  FOR X = 1 TO 4: INPUT SA%(X): NEXT X
310  FOR X = 1 TO 5: INPUT WA%(X): NEXT X
320  INPUT AE
330  INPUT SEX$
340  INPUT GOLD,BANK
350  INPUT AC
360  FOR X = 1 TO 4: INPUT WNAME$(X),WTYPE%(X),WOODS%(X),WDICE%(X),WSIDES%(X): NEXT X
370  PRINT DK$;"CLOSE"
380 EA =  - 5 * (AC / 2 <  >  INT (AC / 2)): IF AC > 1 THEN EA = EA - 10: IF AC > 3 THEN EA = EA - 10: IF AC > 5 THEN EA = EA - 40
390 EA = EA + AE: IF EA > 0 THEN EA = 0
400  IF NAME$ = "" THEN 700
410  HOME 
420  PRINT "CHARACTER NAME: ";NAME$
430  PRINT " "
440  PRINT "SEX ";SEX$; SPC( 3);"GOLD ";GOLD; SPC( 3);" IN BANK ";BANK
450  PRINT " "
460  PRINT "HARDINESS ";HD;"   AGILITY ";AG;"   CHARISMA ";CH
470  PRINT " "
480  PRINT  TAB( 13);"SPELL  ABILITY"
490  PRINT "BLAST ";SA%(1);"  HEAL ";SA%(2);"  SPEED ";SA%(3);"  POWER ";SA%(4)
500  PRINT " ": PRINT  TAB( 13);"WEAPON ABILITY"
510  PRINT "AXE ";WA%(1); SPC( 9);"BOW ";WA%(2); SPC( 9);"CLUB ";WA%(3)
520  PRINT  SPC( 4);"SPEAR ";WA%(4); SPC( 10);"SWORD ";WA%(5)
530  PRINT " "
540  PRINT "ARMOUR: ";: ON  INT (AC / 2) + 1 GOTO 550,560,570,580
550  PRINT "SKIN";: GOTO 590
560  PRINT "LEATHER";: GOTO 590
570  PRINT "CHAIN";: GOTO 590
580  PRINT "PLATE";: GOTO 590
590  PRINT  LEFT$ (" AND SHIELD",1 + 10 * (AC / 2 <  >  INT (AC / 2)));"    AE=";AE;"%"
600  PRINT " "
610  PRINT "WEAPON INFORMATION:"
620  PRINT "NAME         COMPLEXITY  DAM  ODDS"
630  PRINT " "
640  FOR I = 1 TO 4
650  IF WNAME$(I) = "NONE" THEN 680
660  PRINT WNAME$(I); SPC( 17 -  LEN (WNAME$(I)));WODDS%(I);"%"; SPC( 6 - (WODDS%(I) < 0) - ( ABS (WOODS%(I)) > 9) - ( ABS (WODDS%(I)) > 99));WDICE%(I);"D";WSIDES%(I);
670  PRINT  SPC( 3 - (WSIDES%(I) > 9));WODDS%(I) + 2 * AG + EA + WA%(WTYPE%(I));"%"
680  NEXT I
690  VTAB 24: INVERSE : PRINT "PRESS ANY KEY TO CONTINUE  ";: NORMAL : GET A$: PRINT : HOME 
700 REC = REC + 1: GOTO 260
710  HOME : PRINT  CHR$ (4);"PR#0"
720  VTAB 12: HTAB 13: PRINT "END OF PROGRAM"
730  VTAB 22: END 
740  INPUT "DO YOU WISH TO SEE THEM AGAIN? ";AN$
750  IF AN$ = "Y" THEN 250
760  IF AN$ = "N" THEN 780
770  PRINT "PLEASE TYPE 'Y' OR 'N'": GOTO 740
780  POKE 216,0: PRINT "DO YOU WISH TO BUILD YOUR OWN CHARACTER?": INPUT ANS$
790  IF ANS$ = "Y" THEN 820
800  IF ANS$ = "N" THEN 710
810  PRINT "PLEASE TYPE 'Y' OR 'N'": GOTO 780
820  HOME : PRINT "TYPE IN A NAME FOR YOUR NEW CHARACTER!"
830  GOTO 850
840  PRINT "YOUR NAME MUST BE 20 CHARACTERS OR LESS"
850  INPUT NA$
860  IF  LEN (NA$) > 20 THEN 840
870  IF NA$ = "" THEN 850
880  HOME : INVERSE : PRINT "WE WILL NOW BEGIN TO BUILD": PRINT : PRINT NA$: NORMAL : FOR X = 1 TO 1000: NEXT X
890  HOME : INVERSE : PRINT "BUILDING ";NA$: NORMAL : PRINT : PRINT "CHARACTER ATTRIBUTES": PRINT : PRINT "THE THREE ATTRIBUTES OF ANY EAMON": PRINT "CHARACTER ARE HARDINESS,AGILITY, AND": PRINT "CHARISMA.  WHEN RANDOMLY CHOSEN, THE"
900  PRINT "VALUE OF ANY ONE ATTRIBUTE CAN VARY": PRINT "FROM A LOW OF 3 TO A HIGH OF 24.  YOU": PRINT "MAY CHOOSE ANY VALUE YOU PLEASE, BUT": PRINT "WE RECOMMEND THAT THE TOTAL SUM": PRINT "OF THE THREE DOES NOT EXCEED 48."
910  GOSUB 1970
920  PRINT "HARDINESS - HARDINESS RELATES TO THE": PRINT "NUMBER OF POINTS OF DAMAGE YOUR BODY": PRINT "CAN WITHSTAND BEFORE YOU DIE.  IT ALSO": PRINT "RELATES TO HOW MUCH TOTAL WEIGHT": PRINT "YOU CHARACTER CAN CARRY WITH HIM."
930  GOTO 970
940  PRINT " GIVE YOURSELF A BREAK, SELECT A NUMBER": PRINT "GREATER THAN 2!": PRINT : INVERSE : INVERSE : PRINT "YOU WILL NOT BE WARNED AGAIN!!": NORMAL 
950  GOTO 970
960  PRINT "DON'T YOU THINK YOU OVER DOING IT A BIT?": PRINT "HOW ABOUT 50 OR LESS?"
970  PRINT : INPUT "HOW MANY POINTS HARDINESS DO YOU WANT?";C(2)
980  IF C(2) > 50 THEN 960
990  IF C(2) < 3 THEN 940
1000  HOME : PRINT "AGILITY - AGILITY'S MAJOR EFFECT IS HOW": PRINT "LIKELY YOU ARE TO HIT YOUR OPPONENT IN": PRINT "COMBAT.  IT'S ALSO USEFUL IN AVOIDING": PRINT "SPECIAL TRAPS."
1010  GOTO 1030
1020  PRINT "DON'T YOU THINK YOU OVER DOING IT A BIT?": PRINT "HOW ABOUT 50 OR LESS?"
1030  PRINT : INPUT "HOW MANY POINTS AGILITY DO YOU WANT?";C(3)
1040  IF C(3) > 50 THEN 1020
1050  HOME : PRINT "CHARISMA - CHARISMA WILL DETERMINE HOW": PRINT "HOW WELL PEOPLE LIKE YOU. THIS WILL": PRINT "MOST LIKELY SHOW UP AS HOW MANY FRIENDS": PRINT "YOU MAKE OR WHAT PRICES YOU CAN BUY": PRINT "GOODS AND SERVICES FOR."
1060  GOTO 1080
1070  PRINT "DON'T YOU THINK YOU OVER DOING IT A BIT?": PRINT "HOW ABOUT 50 OR LESS?"
1080  PRINT : INPUT "HOW MANY POINTS CHARISMA DO YOU WANT?";C(4)
1090  IF C(4) > 50 THEN 1070
1100  HOME : PRINT "MAGIC - THERE ARE FOUR SPELLS AVAILABLE": PRINT : PRINT : PRINT "BLAST FIRES A BURNING ARROW AT YOUR": PRINT "OPPONENT.": PRINT 
1110  PRINT "HEAL REMOVES HITS FROM THE BODY OF THE": PRINT "PERSON CASTING IT.": PRINT 
1120  PRINT "SPEED WILL DOUBLE THE CASTER'S AGILITY": PRINT "FOR THE NEXT 10 TO 34 TURNS": PRINT 
1130  PRINT "POWER MAY BE YOU MOST USEFUL SPELL AND": PRINT "AND CERTAINLY THE MOST UNCERTAIN.  IT'S": PRINT "A CALL TO THE GODS 'HELP ME'!!": PRINT "WARNING, IT MAY WORK AGAINST YOU!!"
1132  GOSUB 1970
1135  PRINT : PRINT "THE VALUE YOU ASSIGN TO EACH WILL BE": PRINT "YOUR CHANCE TO SUCCESSFULLY CAST THE": PRINT "SPELL ON THE FIRST TRY.  EACH SUCCESSIVETRY HAVLES YOUR CHANGE TO CAST IT."
1140  PRINT : INVERSE : PRINT "ENTER AS A PERCENTAGE THE ABILITY": PRINT " TO CORRECTLY CAST THE SPELL": NORMAL : PRINT 
1150  INPUT "ABILITY TO CAST BLAST  ";C(5)
1160  INPUT "ABILITY TO CAST HEAL   ";C(6)
1170  INPUT "ABILITY TO CAST SPEED  ";C(7)
1180  INPUT "ABILITY TO CAST POWER  ";C(8)
1190  HOME : PRINT "ALL WEAPONS IN THE WORLD OF EAMON CAN BEDIVIDED INTO FIVE TYPES--AXES,BOWS,CLUBSSPEARS, AND SWORDS."
1200  PRINT : PRINT : PRINT "WEAPON EXPERTISE - THE ABILITY TO USE A": PRINT "GIVEN WEAPON. IT IS EXPRESSED AS A VALUE": PRINT : INVERSE : PRINT "NOTE: ": NORMAL : PRINT "YOUR CHANCE OF HITTING YOUR TARGET IS"
1210  PRINT "EQUAL TO TWICE YOUR AGILITY PLUS YOUR": PRINT "EXPERTISE FOR THE WEAPON YOU ARE USING": PRINT "PLUS THE COMPLEXITY OF THAT WEAPON": PRINT 
1215  GOSUB 1970
1220  INVERSE : PRINT "WHAT IS YOUR WEAPON EXPERTISE FOR:": NORMAL : PRINT "(TYPE A VALUE FROM 0 TO 100)": PRINT : PRINT 
1230  INPUT "AXE   ";C(9): IF C(9) > 100 THEN 1230
1240  INPUT "BOW   ";C(10): IF C(10) > 100 THEN 1240
1250  INPUT "CLUB  ";C(11): IF C(11) > 100 THEN 1250
1260  INPUT "SPEAR ";C(12): IF C(12) > 100 THEN 1260
1270  INPUT "SWORD ";C(13): IF C(13) > 100 THEN 1270
1280  HOME : PRINT "ARMOUR EXPERTISE--THE PLAYER ABILITY TO": PRINT "FIGHT WHILE WEARING ARMOUR": PRINT 
1290  INVERSE : PRINT "ARMOUR EXPERTISE GIVEN AS A PER CENT": NORMAL 
1300  PRINT : INPUT C(14)
1305  IF C(14) > 100 THEN 1290
1310  HOME : PRINT "IS YOUR CHARACTER A MALE OR FEMALE?": PRINT "TYPE 'M' OR 'F'"
1320  INPUT SE$
1330  IF SE$ = "M" THEN 1350
1340  IF SE$ <  > "F" THEN 1310
1350  HOME : PRINT "HOW MANY PIECES OF GOLD DO YOU WISH TO": PRINT "HAVE WITH YOU AND HOW MANY IN THE BANK": PRINT 
1360  INPUT "PIECES OF GOLD WITH YOU ";C(15)
1370  INPUT "PIECES OF GOLD IN BANK  ";C(16)
1380  HOME : PRINT "SELECT TYPE OF ARMOUR BY NUMBER"
1390  PRINT "1) NONE"
1400  PRINT "2) LEATHER"
1410  PRINT "3) LEATHER AND SHIELD"
1420  PRINT "4) CHAIN MAIL"
1430  PRINT "5) CHAIN MAIL AND SHIELD"
1440  PRINT "6) PLATE"
1450  PRINT "7) PLATE AND SHIELD": PRINT : PRINT 
1460  INPUT C(17)
1470  IF C(17) > 7 THEN 1380
1480  IF C(17) < 1 THEN 1380
1490  HOME : INVERSE : HTAB (17): PRINT "WEAPONS": NORMAL : PRINT : PRINT : PRINT "IF YOU PREFER, YOU MAY WAIT TO BUY YOUR WEAPONS UNTIL YOU GET BACK TO THE MAIN": PRINT "HALL.  IF YOU WOULD PREFER TO WAIT TYPE A '0'!"
1500  PRINT : PRINT : PRINT "YOU MAY CARRY UP TO FOUR WEAPONS WITH": PRINT "YOU AT ANY ONE TIME.  HOW MANY WEAPONS": PRINT "WOULD YOU LIKE TO BUILD AT THIS TIME?"
1510  INPUT W
1520  IF W = 0 THEN 1730
1530  IF W > 4 THEN 1500
1540  IF W < 0 THEN 1490
1550  FOR B = 1 TO W
1560  HOME : PRINT "NAME OF WEAPON ";B;" ": INPUT WEP$
1570  PRINT 
1580  PRINT "WHAT TYPE OF WEAPON?": PRINT "1) AXE": PRINT "2) BOW   (THIS INCLUDES ALL THROWN": PRINT "          WEAPONS AND GUNS)": PRINT "3) CLUB  (OR BLUNT WEAPONS)": PRINT "4) SPEAR (OR OTHER POLE WEAPONS)": PRINT "5) SWORD": INPUT "INPUT NUMBER";TY
1590  IF TY < 1 THEN 1580
1600  IF TY > 5 THEN 1580
1610  PRINT : PRINT "COMPLEXITY OF WEAPON(GUNS MORE COMPLEX": PRINT "THAN CLUBS)": INPUT "ENTER VALUE 0 TO 100  ";COM
1615  IF COM > 100 THEN 1610
1620  PRINT : PRINT "THE DAMAGE INFLICTED ON AN ENEMY IS": PRINT "DETERMINED BY ROLLING A GIVEN NUMBER OF": PRINT "DICE ONCE AND SUMMING THEM.": PRINT "FOR EXAMPLE, ROLLING 2 FIVE-SIDED DICE": PRINT "CAN INFLICT FROM 2 TO 10 POINTS OF": PRINT "DAMAGE.";
1630  PRINT "  ROLLING ONE EIGHT-SIDED DIE CANINFLICT FROM ONE TO EIGHT POINTS OF": PRINT "DAMAGE."
1640  INPUT "HOW MANY DICE FOR THIS WEAPON   ";DI
1650  PRINT : INPUT "HOW MANY SIDE DIE FOR THIS WEAPON  ";SI
1660  PRINT : PRINT : PRINT WE$;" WILL INFLICT FROM": PRINT DI;" TO ";DI * SI;" POINTS OF DAMAGE"
1670  INPUT "IS THIS CORRECT? ('Y' OR 'N') ";AN$
1680  IF AN$ = "N" THEN 1560
1682  IF AN$ = "Y" THEN 1690
1684  GOTO 1670
1690  HTAB (18): PRINT "GOOD"
1700  GOSUB 1970
1710 WEP$(B) = WEP$:TY(B) = TY:COM(B) = COM:DI(B) = DI:SI(B) = SI
1720  NEXT B
1730  REM   WRITE TO RECORD(REC)
1740  PRINT DK$;"OPEN CHARACTERS,L150"
1750  PRINT DK$;"WRITE CHARACTERS,R0"
1760  PRINT REC
1770  PRINT DK$;"WRITE CHARACTERS,R";REC
1780  PRINT NA$
1790  FOR X = 2 TO 14: PRINT C(X): NEXT X
1800  PRINT SE$
1810  PRINT C(15): PRINT C(16): PRINT C(17)
1820  IF W = 0 THEN 1860
1830  FOR B = 1 TO W: PRINT WEP$(B): PRINT TY(B): PRINT COM(B): PRINT DI(B): PRINT SI(B): NEXT B
1840  FOR F = 1 TO 4 - W: PRINT "NONE": PRINT 0: PRINT 0: PRINT 0: PRINT 0: NEXT F
1850  GOTO 1890
1860 N$ = "NONE"
1870 O = 0
1880  FOR T = 1 TO 4: PRINT N$: PRINT O: PRINT O: PRINT O: PRINT O: NEXT T
1890  PRINT "CLOSE"
1900  PRINT DK$;"CLOSE CHARACTERS"
1910  HOME : PRINT "DO YOU WISH TO REVIEW CURRENT CHARACTERSON THIS DISK?": INPUT "'Y' OR 'N' ";AN$
1920  IF AN$ = "Y" THEN 210
1930  IF AN$ = "N" THEN 1950
1940  GOTO 1910
1950 REC = REC + 1: GOTO 780
1960  PRINT "END"
1970  VTAB 24: INVERSE : PRINT "PRESS ANY KEY TO CONTINUE  ";: NORMAL : GET A$: PRINT : HOME : RETURN 
1980  PRINT DK$;"DELETE CHARACTERS"
1990  PRINT DK$;"OPEN CHARACTERS,L150"
2000  PRINT DK$;"WRITE CHARACTERS,R0"
2010  PRINT 0
2020  PRINT DK$;"CLOSE"
2030  POKE 216,0: GOTO 820