Saturday, October 12, 2019

Basic Program for making a D&D Character

10 RANDOMIZE TIMER
20 GOSUB 150
30 STRENGTH% = TOTAL%
40 GOSUB 150
50 INTELLIGENCE% = TOTAL%
60 GOSUB 150
70 WISDOM% = TOTAL%
80 GOSUB 150
90 DEXTERITY% = TOTAL%
100 GOSUB 150
110 CONSTITUTION% = TOTAL%
120 GOSUB 150
130 CHARISMA% = TOTAL%
140 GOTO 200
150 DICE1% = INT(RND * 6) + 1
160 DICE2% = INT(RND * 6) + 1
170 DICE3% = INT(RND * 6) + 1
180 TOTAL% = DICE1% + DICE2% + DICE3%
190 RETURN
200 PRINT "STR: "; STRENGTH%
210 PRINT "INT: "; INTELLIGENCE%
220 PRINT "WIS: "; WISDOM%
230 PRINT "DEX: "; DEXTERITY%
240 PRINT "CON: "; CONSTITUTION%
250 PRINT "CHR: "; CHARISMA%
260 PRINT
270 PRINT "Choose your Class:"
280 PRINT " 1 Cleric"
290 PRINT " 2 Fighter"
300 PRINT " 3 Magic-User"
310 PRINT " 4 Thief"
320 INPUT CHOICEC%
330 IF CHOICEC% = 1 THEN CLASS$ = "Cleric"
340 IF CHOICEC% = 2 THEN CLASS$ = "Fighter"
350 IF CHOICEC% = 3 THEN CLASS$ = "Magic-User"
360 IF CHOICEC% = 4 THEN CLASS$ = "Theif"
370 PRINT "Choose your Race:"
380 PRINT " 1 Dwarf"
390 PRINT " 2 Elf"
400 PRINT " 3 Halfling"
410 PRINT " 4 Human"
420 INPUT CHOICER%
430 IF CHOICER% = 1 THEN RACE$ = "Dwarf"
440 IF CHOICER% = 2 THEN RACE$ = "Elf"
450 IF CHOICER% = 3 THEN RACE$ = "Halfling"
460 IF CHOICER% = 4 THEN RACE$ = "Human"
470 IF CHOICEC% = 1 THEN HITPOINTS% = 8
480 IF CHOICEC% = 2 THEN HITPOINTS% = 10
490 IF CHOICEC% = 3 THEN HITPOINTS% = 4
500 IF CHOICEC% = 4 THEN HITPOINTS% = 6
510 IF CHOICER% = 1 THEN STRENGTH% = STRENGTH% + 1
515 IF CHOICER% = 1 THEN CHARISMA% = CHARISMA% - 1
520 IF CHOICER% = 2 THEN DEXTERITY% = DEXTERITY% + 1
525 IF CHOICER% = 2 THEN CONSTITUTION% = CONSTITUTION% - 1
530 IF CHOICER% = 3 THEN DEXTERITY% = DEXTERITY% + 1
535 IF CHOICER% = 3 THEN STRENGTH% = STRENGTH% - 1
540 DICE1% = INT(RND * 4) + 1
550 DICE2% = INT(RND * 4) + 1
560 DICE3% = INT(RND * 4) + 1
570 DICE4% = INT(RND * 4) + 1
580 DICE5% = INT(RND * 4) + 1
590 GOLD% = (DICE1% + DICE2% + DICE3% + DICE4% + DICE5%) * 10
600 PRINT: PRINT "What is your Name"
610 INPUT NAME$
620 PRINT
630 PRINT "D&D Character Sheet 1.0"
635 PRINT "------------------------------": PRINT
640 PRINT "Character Name: "; NAME$
650 PRINT "Character Race: "; RACE$
660 PRINT "Character Class: "; CLASS$
670 PRINT "------------------------------"
680 PRINT
690 PRINT "STR: "; STRENGTH%
700 PRINT "INT: "; INTELLIGENCE%
710 PRINT "WIS: "; WISDOM%
720 PRINT "DEX: "; DEXTERITY%
730 PRINT "CON: "; CONSTITUTION%
740 PRINT "CHR: "; CHARISMA%
750 PRINT
760 PRINT "Hit Points: "; HITPOINTS%
770 PRINT
780 PRINT "Gold: "; GOLD%
790 PRINT "------------------------------"
800 PRINT: PRINT "Save Character?"
810 PRINT "1 Yes"
820 PRINT "2 No"
830 INPUT YN%
840 IF YN% = 2 GOTO 1060
850 OPEN NAME$ + ".TXT" FOR OUTPUT AS #1
860 PRINT #1,
870 PRINT #1, "D&D Character Sheet 1.0"
875 PRINT #1, "------------------------------": PRINT #1,
880 PRINT #1, "Character Name: "; NAME$
890 PRINT #1, "Character Race: "; RACE$
900 PRINT #1, "Character Class: "; CLASS$
910 PRINT #1, "------------------------------"
920 PRINT #1,
930 PRINT #1, "STR: "; STRENGTH%
940 PRINT #1, "INT: "; INTELLIGENCE%
950 PRINT #1, "WIS: "; WISDOM%
960 PRINT #1, "DEX: "; DEXTERITY%
970 PRINT #1, "CON: "; CONSTITUTION%
980 PRINT #1, "CHR: "; CHARISMA%
990 PRINT #1,
1000 PRINT #1, "Hit Points: "; HITPOINTS%
1010 PRINT #1,
1020 PRINT #1, "Gold: "; GOLD%
1030 PRINT #1, "------------------------------": PRINT #1,
1040 PRINT #1, "EQUIPMENT:"
1050 CLOSE #1
1060 END

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Mastodon