The last (or actually first) of the 60000-series routines seems to be character creation and initialization.
First we ask for the player's lucky number which is put in LN
and will be used to generate a random ZZ
.
60000 TEXT : HOME : VTAB (5): INPUT "TYPE THY LUCKY NUMBER.....";Q$:LN = VAL (Q$)
Next we ask for the level of play LP
and repeat until the value is between 1 and 10:
60005 VTAB (7): INPUT "LEVEL OF PLAY (1-10)......";Q$:LP = INT ( VAL (Q$))
60006 IF LP < 1 OR LP > 10 THEN 60005
We generate a random ZZ
based on the player's lucky number LN
.
60010 ZZ = RND ( - ABS (LN))
Here are our stat names. Note they are padded to length 15:
60020 DATA "HIT POINTS.....","STRENGTH.......","DEXTERITY......","STAMINA........","WISDOM.........","GOLD..........."
Next we declare PW()
(item/weapon counts), declare and initialize C$()
(stats names) and declare C()
(stats values):
60025 DIM PW(5)
60030 DIM C$(5): FOR X = 0 TO 5: READ C$(X): NEXT
60040 DIM C(5)
Next we declare M$()
, ML%
and MZ%
:
60041 DIM M$(10),ML%(10,1),MZ%(10,1)
And initialize M$
with the monster names:
60042 DATA "SKELETON","THIEF","GIANT RAT","ORC","VIPER","CARRION CRAWLER","GREMLIN","MIMIC","DAEMON","BALROG"
60043 FOR X = 1 TO 10: READ M$(X): NEXT
Next we initialize the player stats:
60050 FOR X = 0 TO 5:C(X) = INT ( SQR ( RND (1)) * 21 + 4): NEXT X
And display them, asking the player to accept them:
60060 HOME : VTAB (8): FOR X = 0 TO 5: PRINT C$(X),C(X): NEXT : PRINT : PRINT "SHALT THOU PLAY WITH THESE QUALITIES?": HTAB (20): GET Q$: IF Q$ < > "Y" THEN 60050
Finally, we ask if they want to be a fighter or a mage (putting M
or F
in PT$
):
60061 VTAB (15): PRINT : PRINT "AND SHALT THOU BE A FIGHTER OR A MAGE?": HTAB (20): GET PT$
When we're done we go to the routine at 60070 that sets up the item names and GOSUBs to the stat/inventory display and adventure shop. The RETURN in 60075 will effectively act as the RETURN from this routine.
60062 IF PT$ = "M" OR PT$ = "F" THEN 60070
Or, if the class selection was invalid, we ask again:
60063 GOTO 60061