Skip to content

Instantly share code, notes, and snippets.

@bussiere
Created April 21, 2014 09:28
Show Gist options
  • Save bussiere/11137495 to your computer and use it in GitHub Desktop.
Save bussiere/11137495 to your computer and use it in GitHub Desktop.
The code source of DND1 by RIchard Garriott Copyright himself.
DND
-
1
1500 lines
(C)
1977
-
2014 Richard Garriott
79/02/28. 19.27.34.
PROGRAM
DND1
00010 LET J4=1
00030 PRINT
00100 BASE 0
00110 LET X=0
00120 LET J=0
00130 LET K=0
00140 X1=0
00150 LET X3=0
00160 LET J9=RND(CLK(J9))
00170 DIM C(7),C$(7),W(100),D(50,50),P(100),I$(100),B(100,6),B$(100)
00180 DIM E(100),F(100),X5(100),X6(100),X2(1
00),X4(100)
00190 LET G=INT(RND(0)*24+2)
00200 LET H=INT(RND(0)*24+2)
00210 FILE #1="DNG1"
00220 FILE #2="DNG2",#3="DNG3",#4="DNG4",#5="DNG5",#6="DNG6"
00230 RESTORE #4
00240 FILE #7="GMSTR"
00245 RESTORE #7
00250 RESTORE #1
00260 RESTORE #2
00261 RESTORE
#3
00262 RESTORE #4
00263 RESTORE #5
00264 RESTORE #6
00270 DATA "STR","DEX","CON","CHAR","WIS","INT","GOLD"
00280 DATA "SWORD",10,"2
-
H
-
SWORD",15,"DAGGER",3,"MACE",5
00290 DATA "SPEAR",2,"BOW",25,"ARROWS",2,"LEATHER MAIL",15
00300 DATA "CHAIN MAIL",30,"TL
TE MAIL",50,"ROPE",1,"SP
I
KES",1
00310 DATA "FLASK OF OIL",2,"SILVER CROSS",25,"SPARE FOOD",5
00320 PRINT " DUNGEONS AND DRAGONS #1"
00330 PRINT
00340 PRINT "DO YOU NEED INSTUCTIONS ";
00350 INPUT Q$
00360 IF Q$="YES" THEN 01730
00370 IF Q$="Y" THEN 007
20
00380 PRINT "OLD OR NEW GAME";
00390 INPUT Q$
00400 IF Q$="OLD" THEN 01770
00410 PRINT "DUNGEON #";
00420 INPUT D
00421 PRINT "CONTINUES RESET 1=YES,2=NO ";
00422 INPUT J6
00430 REM ROLLING CHAR
I
CTERISTICS
00440 PRINT "PLAYERS NME ";
00450 INPUT N$
0046
0 IF N$<>"SHAVS" THEN 01730
00465 FOR M=1 TO 7
00466 READ C$(M)
00467 NEXT M
00470 FOR M=1 TO 7
00490 FOR N=1 TO 3
00500 LET R=INT(RND(0)*6+1)
00510 LET C(M)=C(M)+R
00520 NEXT N
00530 IF M<>7 THEN 00550
00540 LET C(M)=C(M)*15
00550 REM
00560 PRINT C$(M);"=
";C(M)
00570 NEXT M
00580 PRINT
00590 PRINT "CLASSIFICATION"
00600 PRINT "WHICH DO YOU WANT TO BE"
00610 PRINT "FIGHTER ,CLERIC ,OR WIZARD";
00620 INPUT C$(0)
00625 IF C$(0)<>"NONE" THEN 0630
00626 FOR M7=0 TO 7
00627 LET C(M7)=0
00628 NEXT M7
00629 GO TO
00470
00630 IF C$(0)="FIGHTER" THEN 00770
00640 IF C$(0)="CLERIC" THEN 00810
00650 IF C$(0)="WIZARD" THEN 00790
00660 GO TO 00620
00670 PRINT "BUYING WEAPONS"
00680 PRINT "FAST OR NORM"
00690 INPUT Q3$
00700 PRINT "NUMBER","ITEM","PRICE"
00705 PRINT"
-
1
-
ST
OP"
00710 FOR M=1 TO 15
00720 READ I$(M),P(M)
00725 IF Q3$="FAST" THEN 00740
00730 PRINT M,I$(M),P(M)
00740 NEXT M
00750 GOSUB 01150
00760 GO TO 00830
00770 LET C(0)=INT(RND(0)*8+1)
00780 GO TO 00670
00790 LET C(0)=INT(RND(0)*4+1)
00800 GO TO 00670
00810 L
ET C(0)=INT(RND(0)*6+1)
00820 GO TO 00670
00830 REM
00850 LET X=X+1
00860 INPUT Y
00870 REM
00880 IF Y<0 THEN 01000
00885 IF Y>15 THEN 01000
00890 IF C(7)
-
P(Y)<0 THEN 00970
00900 IF C$(0)="CLERIC" THEN 01290
00910 IF C$(0)="WIZARD" THEN 01350
00920 REM
009
30 LET C(7)=C(7)
-
P(Y)
00940 PRINT "GP= ";C(7)
00950 LET W(X)=Y
00960 GO TO 00830
00970 PRINT "COSTS TOO MUCH"
00980 PRINT "TRY AGAIN ";
00990 GO TO 00860
01000 PRINT "GP= ";C(7)
01010 REM
01020 PRINT "EQ LIST ";
01030 INPUT Q$
01040 IF Q$="NO" THEN 01090
0
1050 FOR M=1 TO X
01060 IF W(M)=0 THEN 01080
01070 PRINT W(M),I$(W(M))
01080 NEXT M
01090 PRINT "YOUR CHARACTERISTICS ARE
;
"
01100 PRINT C$(0)
01101 IF C(0)<>1 THEN 01110
01102 C(0)=2
01110 PRINT "HIT POINTS",C(0)
01120 PRINT
01130 PRINT
01140 GO TO 01400
0
1150 DATA "MAN",1,13,26,1,1,500
01160 DATA "GOBLIN",2,13,24,1,1,600
01170 DATA "TROLL",3,15,35,1,1,1000
01180 DATA "SKELETON",4,22,12,1,1,50
01190 DATA "BALROG",5,18,110,1,1,5000
01200 DATA "OCHRE JELLY",6,11,20,1,1,0
01210 DATA "GREY OOZE",7,11,13,1,1,0
01220 DATA "GNOME",8,13,30,1,1,100
01230 DATA "KOBOLD",9,15,16,1,1,500
01
240 DATA "MUMMY",10,16,30,1,1,1
00
01250 FOR M=1 TO 10
01260 READ B$(M),B(M,1),B(M,2),B(M,3),B(M,4),B(M,5),B(M,6)
01265 B(M,4)=B(M,3)
01267 B(M,5)=B(M,6)
01269 B(M,1)=1
01270 NEXT M
01
280 RETURN
01290 IF Y=4 THEN 00920
01300 IF Y=8 THEN 00920
01310 IF Y=9 THEN 00920
01320 IF Y>10 THEN 00920
01330 PRIT "YOUR A CLERIC YOU CANT USE THAT "
01340 GO TO 00860
01350 IF Y=3 THEN 00920
01360 IF Y=8 THEN 00920
01370 IF Y>1
0 THEN 00920
01380 PRINT "YOUR A WIZARD YOU CANT USE THAT "
01390 GO TO 00860
01400 REM READ DUNGEON AND START GAME
01410 RESTORE #D
1415 PRINT "READING DUNGEON NUM. ";D
01420 FOR M=0 TO 25
01430 FOR N=0 TO 25
01431 D(M,N)=0
01432 IF D=0 THEN 01450
01440 R
EAD #D,D(M,N)
01443 IF D(M,N)<>0 THEN 01450
01445 IF RND(0)<.97 THEN 01447
01446 D(M,N)=7
01447 IF RND(0)<.97 THEN 01450
01448 D(M,N)=8
01450 NEXT N
01460 NEXT M
01470 REM YEA START
01480 PRINT
01490 PRINT
01500 PRINT
01510 PRINT "WELCOME TO DUNGEON #";D
0
1520 PRINT "YOU ARE AT (";G;",";H;")"
01530 PRINT
01540 PRINT "COMANDS LIST",
01541 INPUT Q$
01542 IF Q$<>"YES" THEN 01590
01550 PRINT
01560 PRINT "1=MOVE 2=OPEN DOOR 3=SEARCH FOR TRAPS AND SECRET DOORS"
01570 PRINT "4=SWITCH WEAPON HN HAND 5=FIGHT"
015
80 PRINT "6=LOOK AROUND 7=SAVE GAME 8=USE MAGIC 9=BUY MAGIC"
01585 PRINT"0=PASS 11=BUY H.P."
01590 PRINT "COMMAND=";
01600 INPUT T
01605 IF T=11 THEN 10830
01606 IF T=12 THEN 11000
01610 IF T=1 THEN 02170
01620 IF T=2 THEN 03130
01630 IF T=3 THEN 03430
01640 IF T=4 THEN 03640
01650 IF T=5 THEN 03750
01660 IF T=6 THEN 06390
01670 IF T=7 THEN 06610
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment