-
Notifications
You must be signed in to change notification settings - Fork 4
/
haunt.bas
175 lines (175 loc) · 7.6 KB
/
haunt.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
1 'HAUNT.BA Barry Gaskins
2 'CLUB 100 Library - 415/939-1246 BBS, 937-5039 NEWSLETTER, 932-8856 VOICE
10 REM Converted to CPC 03/2019 by SRS cpcwiki.eu
100 CLS:PRINT"DO YOU WANT INSTRUCTIONS? (Y/N)":INPUT zz$:IF ZZ$<>"Y" OR ZZ$<>"y" THEN 120
110 GOSUB 170
120 CLEAR:GOSUB 480
130 REM
140 GOSUB 620
150 GOSUB 750
160 GOTO 130
170 REM
190 PRINT" HAUNTED HOUSE"
200 PRINT" BY BARRY GASKINS"
205 PRINT"brought to CPC by SRS 2019"
210 PRINT"ANY KEY TO CONTINUE"
220 CALL &BB18
240 PRINT" HAUNTED HOUSE"
250 PRINT"YOU ARE LOST IN THE WOODS AND ARE AT THE ENTRANCE TO A STRANGE LOOKINGHOUSE.LOOKING FOR HELP AND FOOD YOU"
280 PRINT"DECIDE TO GO IN... SUDDENLY THE DOOR":CALL &BB18
290 PRINT"SLAMS SHUT. YOU HEAR AN EVIL LAUGH AND"
300 PRINT"A VOICE COMMING FROM THE VERY WALLS"
310 PRINT" 'YOU WILL NEVER LEAVE THIS "
320 PRINT"HOUSE. YOU WILL STAY FOREVER TO":CALL &BB18
330 PRINT"WALK ITS ROOMS AND HALLS. HEAR THESE WORDS AND KNOW YOUR "
350 PRINT" DOOM!!!!! HA HA HA HA...."
360 CALL &BB18
380 CLS:PRINT"LOOKING AROUND YOU SEE THAT THERE ARE SEVERAL EXITS BUT NO WINDOWS.MAYBE YOU HAVE A CHANCE?"
410 PRINT"IF YOU TELL ME WHAT YOU WANT TO DO I WILL TELL YOU WHAT IS HAPPENING. AND IF YOU NEED HELP JUST TYPE HELP IN PLACE OF YOUR COMMAND"
450 CALL &BB18
470 RETURN
480 DIM S(13):DIM S$(13):L=1
490 DIM R$(13):DIM E$(13):DIM CO$(14)
500 FOR X=1 TO 13:S(X)=X:READ S$(X):NEXT
510 FOR X=1 TO 13:READ R$(X):NEXT
520 FOR X=1 TO 12:READ E$(X):NEXT
530 FOR X=1 TO 14:READ CO$(X):NEXT
540 RETURN
550 DATA ROPE,SWORD,KEY,BUCKET OF WATER,RUG,WAND,MOLDY FOOD,WINE,KEGS,ASHES,ROCKS,LEAVES,NULL
560 DATA THE DEN,A TROPHY ROOM,THE SERVANTS QUARTERS,THE DINING ROOM,THE KITCHEN,THE CELLAR,A STORAGE ROOM,THE WINE CELLAR,AGING ROOM,A NARROW PASSAGE,A HUGE CAVE,A SMALL CAVE,THE OUTSIDE WORLD
570 DATA SOUTH EAST AND WEST,WEST,NORTH,NORTH,SOUTH AND EAST
580 DATA UP AND EAST,SOUTH,WEST EAST AND NORTH,WEST
590 DATA EAST AND WEST,EAST AND WEST,WEST
600 DATA NORTH,SOUTH,EAST,WEST,UP,DOWN
610 DATA GET,DROP,USE,OFFER,DRINK,SEARCH,ATTACK WITH,INVENTORY
620 CLS:PRINT"YOU ARE IN "R$(L)
630 PRINT"VISIBLE ITEMS: ";
640 FOR X=1 TO 13:IF S(X)=L THEN PRINT S$(X)" ";
650 NEXT:PRINT
660 PRINT"YOU SEE EXITS "E$(L)
670 IF l=6 AND NOTF2 THEN PRINT"THERE IS A GHOST IN THIS ROOM !!!"
680 IF l=10 AND NOTF4 THEN PRINT"A WALL OF FIRE BLOCKS YOUR WAY !!!"
690 IF l=11 AND NOTF5 THEN PRINT"THERE IS A HUGE HUNGRY GIANT IN HERE"
700 IF l=12 THEN PRINT"THERE IS A HOLE IN THE CEILING AND YOU CAN SEE THE OPEN SKY ABOVE !!!"
710 RETURN
720 PRINT"LEGAL COMMANDS ARE:"
730 FOR X=1 TO 6:PRINT" "CO$(X):NEXT:FOR X=7 TO 13:PRINT" "CO$(X)" SOMETHING":NEXT:PRINT" "CO$(14):PRINT
740 PRINT"I ONLY LOOK AT THE FIRST 3 LETTERS OF EACH WORD SO YOU ONLY NEED TO TYPE THE FIRST 3 LETTERS ":GOTO 1890
750 REM
760 INPUT"WHAT DO YOU WANT TO DO ";DO$
770 IF DO$="UP" THEN X=5:GOTO 810
780 IF LEN(DO$)<3 THEN 720
790 FOR X=1 TO 14:IF LEFT$(DO$,3)=LEFT$(CO$(X),3) THEN 810
800 NEXT:GOTO 720
810 IF x<7 THEN 910
820 IF x=14 THEN 1320
830 IF x=7 THEN 1360
840 IF x=8 THEN 1470
850 IF x=9 THEN 1530
860 IF x=11 THEN 1590
870 IF x=10 THEN 1640
880 IF x=12 THEN 1690
890 IF x=13 THEN 1750
900 GOTO 720
910 ONLgoto 920,970,990,1010,1030,1070,1110,1130,1170,1200,1230,1270
920 IF x=1 THEN 1350
930 IF x=2 THEN L=3:RETURN
940 IF x=3 THEN L=2:RETURN
950 IF x=4 THEN L=5:RETURN
960 GOTO 1350
970 IF x=4 THEN L=1:RETURN
980 GOTO 1350
990 IF x=1 THEN L=1:RETURN
1000 GOTO 1350
1010 IF x=1 THEN L=5:RETURN
1020 GOTO 1350
1030 IF x=2 THEN L=4:RETURN
1040 IF x=3 THEN L=1:RETURN
1050 IF x=6 AND F1 THEN L=6:RETURN
1060 GOTO 1350
1070 IF x=3 AND F2 THEN L=8:RETURN
1080 IF x=3 THEN PRINT"THE GHOST BLOCKS YOUR WAY !"
1090 IF x=5 THEN L=5:RETURN
1100 GOTO 1350
1110 IF x=2 THEN L=8:RETURN
1120 GOTO 1350
1130 IF x=1 THEN L=7:RETURN
1140 IF x=3 THEN L=9:RETURN
1150 IF x=4 THEN L=6:RETURN
1160 GOTO 1350
1170 IF x=3 AND F3 THEN L=10:RETURN
1180 IF x=4 THEN L=8:RETURN
1190 GOTO 1350
1200 IF x=3 AND F4 THEN L=11:RETURN
1210 IF x=4 THEN L=9:RETURN
1220 GOTO 1350
1230 IF x=3 AND F5 THEN L=12:RETURN
1240 IF x=4 THEN L=10:RETURN
1250 IF x=3 THEN PRINT"YOU WERE BURNED UP IN THE FIRE":GOTO 1820
1260 GOTO 1350
1270 IF x=4 THEN L=11:RETURN
1280 IF x=5 AND F6 THEN 1300
1290 GOTO 1350
1300 CLS:PRINT"YOU MADE IT OUT ALIVE !!!"
1310 PRINT"GOOD JOB ":END
1320 CLS:PRINT" INVENTORY:"
1330 FOR X=1 TO 13:IF S(X)=0 THEN PRINT S$(X)
1340 NEXT:GOTO 1890
1350 PRINT" YOU CANT GO THAT WAY":GOTO 1890
1360 DO$=DO$+" ":N=LEN(DO$)-1:FOR X=1 TO N:IF LEFT$(DO$,1)=" " THEN X=N
1370 DO$=RIGHT$(DO$,LEN(DO$)-1)
1380 NEXT:IF LEN(DO$)<2 THEN 1430
1390 DO$=LEFT$(DO$,LEN(DO$)-1):IF LEN(DO$)<3 THEN 1430
1400 FOR X=1 TO 13:IF LEFT$(DO$,3)=LEFT$(S$(X),3) THEN 1420
1410 NEXT:GOTO 1430
1420 IF S(X)=L THEN S(X)=0:GOTO 1440
1430 PRINT"I SEE NO "DO$" HERE":GOTO 1890
1440 IF DO$="RUG" AND NOTF1 THEN F1=1:PRINT" THERE WAS A TRAPDOOR UNDER THE RUG !":PRINT:E$(5)="DOWN "+E$(5):GOTO 1890
1450 IF x=9 THEN S(X)=L:PRINT"THE KEGS ARE MUCH TOO BIG TO CARRY":GOTO 1890
1460 RETURN
1470 DO$=DO$+" ":N=LEN(DO$):FOR X=1 TO N:IF LEFT$(DO$,1)=" " THEN X=N
1480 DO$=RIGHT$(DO$,LEN(DO$)-1):NEXT:IF LEN(DO$)<2 THEN 1520
1490 DO$=LEFT$(DO$,LEN(DO$)-1):IF LEN(DO$)<3 THEN 1520
1500 FOR X=1 TO 13:IF LEFT$(DO$,3)=LEFT$(S$(X),3) AND S(X)=0 THEN S(X)=L:RETURN
1510 NEXT
1520 PRINT"YOU DONT HAVE A "DO$:GOTO 1890
1530 REM
1540 GOSUB 1840:IF LEN(DO$)<3 THEN 1580
1550 IF LEFT$(DO$,3)="KEY" AND S(3)=0 AND L=9 AND FO THEN PRINT"YOU OPENED THE KEG TO REVEAL A PASSAGE!":F3=1:E$(9)=E$(9)+" and EAST":GOTO 1890
1560 IF LEFT$(DO$,3)="BUC" AND L=10 AND S(4)=0 THEN PRINT"THE WATER PUT THE FIRE OUT":F4=1:GOTO 1890
1570 IF LEFT$(DO$,3)="ROP" AND (S(1)=0 ORS(1)=L) AND L=12 THEN F6=1:E$(12)=E$(12)+" AND UP":PRINT"YOUR ROPE CATCHES SOMETHING OUTSIDE":GOTO 1890
1580 PRINT"THAT HAD NO USEFUL EFFECT ":GOTO 1890
1590 REM
1600 GOSUB 1840:IF LEN(DO$)<3 THEN 1630
1610 IF LEFT$(DO$,3)="WIN" AND (S(8)=0 OR S(8)=L) THEN PRINT"WHILE YOU WERE DRUNK A TROLL CAME BY AND ATE YOU ":GOTO 1820
1620 IF (LEFT$(DO$,3)="BUC" OR LEFT$(DO$,3)="WAT") AND (S(4)=0 OR S(4)=L) THEN PRINT"THE WATER WAS POISON":GOTO 1820
1630 PRINT"I SEE NOTHING TO DRINK AROUND HERE":GOTO 1890
1640 REM
1650 IF NOT(L=6 OR L=11) THEN PRINT"THERE IS NOBODY HERE TO OFFER ANYTHING":GOTO 1890
1660 IF l=6 THEN PRINT"THE GHOST DOESNT WANT IT":GOTO 1890
1670 GOSUB 1840:IF LEFT$(DO$,3)="WIN" AND S(8)=0 THEN PRINT"THE GIANT DRINKS THE WINE AND FALLS OVER ON THE FLOOR DRUNK":F5=1:GOTO 1890
1680 PRINT"THE GIANT GETS MAD AND THROWS A ROCK AT YOU. ":GOTO 1820
1690 REM
1700 GOSUB 1840
1710 IF LEN(DO$)<3 THEN 1740
1720 IF LEFT$(DO$,3)="RUG" AND L=5 THEN PRINT"THERE WAS A TRAPDOOR UNDER THE RUG !!":E$(5)="DOWN "+E$(5):F1=1:GOTO 1890
1730 IF LEFT$(DO$,3)="KEG" AND L=9 THEN PRINT"YOU FOUND A KEYHOLE IN ONE OF THE KEGS!":FO=1:GOTO 1890
1740 PRINT" THERE IS NOTHING SPECIAL ABOUT THAT":GOTO 1890
1750 REM
1760 DO$=" "+DO$:N=LEN(DO$):FOR X=N TO 1 STEP-1:IF MID$(DO$,X,1)=" " THEN DO$=RIGHT$(DO$,N-X):FOR X=1 TO 13:IF LEFT$(S$(X),3)=LEFT$(DO$,3) THEN 1780
1770 NEXT:GOTO 1810
1780 IF LEFT$(DO$,3)="SWO" AND S(2)=0 AND L=6 THEN F2=1:PRINT"THE GHOST IS DEAD !!!":GOTO 1890
1785 IF LEFT$(DO$,3)="SWO" AND S(2)<>0 THEN 1810
1790 IF l=11 THEN PRINT"THE GIANT GRABBED YOU and SQUEEZED YOU TO DEATH !!!":GOTO 1820
1800 PRINT"THERE IS NOTHING TO ATTACK":GOTO 1890
1810 PRINT"YOU DONT HAVE ONE OF THOSE ":GOTO 1890
1820 PRINT"OH NO .....":PRINT"YOU DIED ":INPUT"DO YOU WANT TO PLAY AGAIN?";A$:IF LEFT$(A$,1)="N" THEN END
1830 GOTO 10
1840 DO$=DO$+" ":N=LEN(DO$)-1:FOR X=1 TON:IF LEFT$(DO$,1)=" " THEN X=N
1850 DO$=RIGHT$(DO$,LEN(DO$)-1)
1860 NEXT:IF LEN(DO$)<2 THEN 1880
1870 DO$=LEFT$(DO$,LEN(DO$)-1):IF LEN(DO$)<3 THEN 1880
1880 RETURN
1890 REM
1900 PRINT"HIT RETURN TO CONTINUE":INPUT zz$
1920 RETURN