8-Bit Software Online Conversion
:0.$.Fantasy - Listing
10 REM > Fantasy
20*|"
30*|" FANTASY v1.00
40*|"
50*|" by Semprini 14/2/92
60*|" (John Carpenter)
70*|"
80MODE7
100no%=400
110*|" ^ no of locations
120inv%=10
130*|" ^ max no of objects
140DIM inv$(inv%)
150DIM loc$(no%,3)
160title$="Tit-eg"
170PROCinit
180PROCcoff
190PROCedit
200PROCgame
210GOTO190
220
230DEF PROCcoff
240VDU23;8202;0;0;0;0;
250ENDPROC
260DEF PROCcon
270VDU23;8202,1;0;0;0;0;
280ENDPROC
290DEF PROCedit
300CLS
310PROCcoff
320*LOAD F-Edit 7C00
330REPEAT:z$=GET$
340UNTILINSTR("1234567890",z$)
350IFz$="0"THEN ENDPROC
360IFz$="1"THEN PROCed`loc
370IFz$="2"THEN PROCed`att
380IFz$="3"THEN PROCed`tit
390IFz$="7"THEN PROCoscli
400IFz$="8"THEN PROClo`gam
410IFz$="9"THEN PROCsa`gam
420GOTO300
430ENDPROC
440DEF PROCgame
450CLS
460*LOAD F-Game 7C00
470PROCcoff
480REPEAT:x$=GET$
490UNTILINSTR("1234567890",x$)
500IFx$="0"THEN ENDPROC
510IFx$="1"THEN PROCsee`tit
520IFx$="2"THEN PROCsee`loc
530IFx$="3"THEN PROCdie
540IFx$="4"THEN PROCsee`sts
550IFx$="5"THEN PROCfight
560IFx$="6"THEN PROCinv
570IFx$="7"THEN PROCdefault
580IFx$="8"THEN PROClo`sts
590IFx$="9"THEN PROCsa`sts
600GOTO450
610ENDPROC
620DEF PROCdice(n%)
630CLS
640s%=0
650FORq%=1 TO n%
660a%=RND(6)
670PRINT" Dice ";q%;" scored ";a%
680s%=s%+a%
690NEXTq%
700PRINT
710PRINT" Total score ";s%
720PROCreturn
730ENDPROC
740DEF PROCdie
750CLS
760INPUT" How many dice? "die%
770IF die%>100 OR die%<0 THEN ENDPROC
780PROCdice(die%)
790ENDPROC
800DEF PROCreturn
810PRINT'" Press Return ";
820REPEAT UNTILGET=13
830ENDPROC
840DEF PROCoscli
850CLS
860PRINT" OSCLI Commands - Return to
quit"'
870REPEAT
880INPUT"*"oscli$
890OSCLI(oscli$)
900UNTILoscli$=""
910ENDPROC
920DEF PROClo`gam
930CLS
940PRINT" LOAD? Are you sure? (Y/N)"''
" (doing so will result in the loss of"'
" all data)"
950REPEAT:A$=GET$:UNTILINSTR("YyNn",A$
)
960IFINSTR("Nn",A$)THEN ENDPROC
970INPUT" Filename "file$
980IFfile$="" THEN ENDPROC
990CLS
1000PRINT" Please wait..."
1010file%=OPENIN(file$)
1020INPUT#file%,title$
1030FORa%=1TOno%
1040FORb%=1TO3
1050INPUT#file%,loc$(a%,b%)
1060NEXTb%
1070NEXTa%
1080CLOSE#0
1090ENDPROC
1100DEF PROCsee`tit
1110CLS
1120OSCLI"LOAD "+title$+" 7C00"
1130A=GET
1140ENDPROC
1150DEF PROCed`loc
1160CLS
1170PROCcon
1180PRINT" Location Editor v.1.00 "
''
1190PRINT" RETURN to get back to menu"'
'
1200INPUT" Enter location number "l%
1210IFl%<1 OR l%>no% THEN ENDPROC
1220CLS
1230PRINT" LINE 1 :"
1240PRINTloc$(l%,1)
1250PRINTTAB(0,8)" LINE 2 :"
1260PRINTloc$(l%,2)
1270PRINTTAB(0,16)" LINE 3 :"
1280PRINTloc$(l%,3)
1290PRINTTAB(0,24)" Edit which (1-3)
or 0 to quit ";
1300REPEAT:a$=GET$
1310UNTILINSTR("1230",a$)
1320IFa$="0" THEN GOTO 1160
1330PRINTTAB(0,((VAL(a$)-1)*8)+1);
1340FORa=1TO6
1350PRINTSPC(40);
1360NEXTa
1370PRINTTAB(0,24)" Enter new line (r
eturn to abort) ";
1380PRINTTAB(0,((VAL(a$)-1)*8)+1);
1390z$=FNinput(238)
1400IF z$="" THEN GOTO 1160
1410loc$(l%,VAL(a$))=z$
1420GOTO1290
1430ENDPROC
1440DEF PROCsa`gam
1450CLS
1460INPUT" Filename "file$
1470IFfile$="" THEN ENDPROC
1480CLS
1490PRINT" Save Game (Y/N) ? ";
1500REPEATA$=GET$:UNTILINSTR("YyNn",A$)
1510IFINSTR("Nn",A$)THEN ENDPROC
1520CLS
1530PRINT" Please Wait..."
1540file%=OPENOUT(file$)
1550PRINT#file%,title$
1560FORa%=1TOno%
1570FORb%=1TO3
1580PRINT#file%,loc$(a%,b%)
1590NEXTb%
1600NEXTa%
1610CLOSE#0
1620ENDPROC
1630DEF PROCinit
1640name$="Sempyboo the Big"
1650magic%=RND(15)
1660skill%=RND(6)
1670stamina%=RND(24)
1680luck%=RND(12)
1690gold%=0
1700PROCblank
1710c%=1
1720ENDPROC
1730DEF PROCsee`tit
1740CLS
1750OSCLI"LOAD "+title$
1760a=GET
1770ENDPROC
1780DEF PROCed`tit
1790CLS
1800PRINT" Editing the Information /
Title Page"
1810PRINT
1820PRINT" Current filename ";title$
1830PRINT
1840PRINT" To see current title page, g
o to the game menu..for information u
se title page filename TIT-EG (defaul
t)"'
1850PRINT" (Press return to quit)"'
1860INPUT" New filename "t$
1870IFLEN(t$)>7 THEN PRINT" Sorry must
be less than 7 chars long!":GOTO1860
1880IFt$="" THEN ENDPROC
1890title$=t$
1900ENDPROC
1910DEF PROCed`att
1920CLS
1930PRINT" Editing Attributes "''
1940PRINT" Sorry not installed yet!"''
1950PROCreturn
1960ENDPROC
1970DEF PROCsee`loc
1980CLS
1990PRINTloc$(c%,1)
2000PRINTloc$(c%,2)
2010PRINTloc$(c%,3)
2020PRINT
2030INPUT" New location: "q%
2040IF q%<1 OR q%>no% THEN ENDPROC
2050c%=q%
2060GOTO1980
2070ENDPROC
2080 DEF FNinput(length%)
2090 LOCAL total$,key%
2100 REPEAT
2110 key% = GET
2120 IF key%=13 GOTO 2180
2130 IF key%=127 AND LEN(total$)=0 THEN
2110
2140 IF key%=127 VDU8,32,8:total$=L
EFT$(total$,LEN(total$)-1):GOTO2110
2150 IF LEN(total$)=length% GOTO211
0
2160 total$ = total$ + CHR$(key%)
2170 VDU key%
2180 UNTIL key%=13
2190 =total$
2200
2210DEF PROCsa`sts
2220CLS
2230PRINT" Enter filename ";
2240oo$=FNinput(7)
2250CLS
2260PRINT" Save Stats (Y/N) ?";
2270REPEAT:A$=GET$
2280UNTILINSTR("YyNn",A$)
2290IFINSTR("Nn",A$) THEN ENDPROC
2300CLS
2310PRINT" Please wait.."
2320file%=OPENOUT(oo$)
2330PRINT#file%,name$,luck%,magic%,gold
%,skill%,stamina%,c%
2340FORa%=1TOinv%
2350PRINT#file%,inv$(a%)
2360NEXTa%
2370CLOSE#file%
2380ENDPROC
2390DEF PROClo`sts
2400CLS
2410PRINT" Enter filename ";
2420oo$=FNinput(7)
2430CLS
2440PRINT" Load Stats (overwrites curre
nt) (Y/N) ?";
2450REPEAT:A$=GET$
2460UNTILINSTR("YyNn",A$)
2470IFINSTR("Nn",A$) THEN ENDPROC
2480CLS
2490PRINT" Please wait.."
2500file%=OPENIN(oo$)
2510INPUT#file%,name$,luck%,magic%,gold
%,skill%,stamina%,c%
2520FORa%=1TOinv%
2530INPUT#file%,inv$(a%)
2540NEXTa%
2550CLOSE#file%
2560ENDPROC
2570DEF PROCsee`sts
2580CLS
2590PRINT" Stats for Warrior ";name$
2600PRINT
2610PRINT" 1) ";name$
2620PRINT" 2) Luck : ";luck%
2630PRINT" 3) Magic : ";magic%
2640PRINT" 4) Skill : ";skill%
2650PRINT" 5) Stamina : ";stamina%
2660PRINT" 6) Gold : ";gold%
2670PRINT
2680IFstamina%<1 THEN PRINT" You have d
ied!!"'
2690PRINT" Press number to change or 0
to quit"
2700REPEAT:A$=GET$
2710UNTILINSTR("1234560",A$)
2720IFA$="0"THEN ENDPROC
2730PRINTTAB(0,VAL(A$)+1)" "
2740PRINTTAB(0,18)" Enter new value :"
2750IFA$="1"THEN PRINT" ";:name$=FNinpu
t(18)
2760IFA$="2"THEN INPUT" "luck%
2770IFA$="3"THEN INPUT" "magic%
2780IFA$="4"THEN INPUT" "skill%
2790IFA$="5"THEN INPUT" "stamina%
2800IFA$="6"THEN INPUT" "gold%
2810GOTO2580
2820ENDPROC
2830DEF PROCinv
2840CLS
2850PRINT" ";name$;"'s Inventory"
2860PRINT
2870FORa%=1TOinv%
2880PRINT" ";
2890IFa%<10 THEN PRINT"0";
2900PRINT;a%;
2910IFinv$(a%)="" THEN PRINT" <EMPTY>"
ELSE PRINT" ";inv$(a%)
2920NEXTa%
2930INPUTTAB(0,23)" Enter no to chang
e or 0 to quit:"ch%
2940IFch%=0 OR ch%>inv% THEN ENDPROC
2950PRINTTAB(0,23)" Enter new object
name ";
2960PRINTTAB(4,ch%+1)SPC(30)
2970PRINTTAB(3,ch%+1)" ";
2980PROCcon
2990a$=FNinput(30)
3000PROCcoff
3010IFa$="" THEN GOTO 2840
3020inv$(ch%)=a$
3030GOTO2840
3040ENDPROC
3050DEF PROCfight
3060CLS
3070PRINT" Fantasy Combat "''
3080PRINT" For the opponent,enter :"'
3090INPUT" Its skill : "sk%
3100INPUT" Its stamina "st%
3110IF sk%=0 OR st%=0 THEN ENDPROC
3120CLS
3130PRINT" Your stamina ";stamina%
3140PRINT" Its stamina ";st%
3150PROCreturn
3160PROCdice(1)
3170CLS
3180IF s%<skill% THEN st%=st%-RND(skill
%):PRINT" You hit it!" ELSE PRINT" You m
issed it!"
3190IFst%<1 THEN PRINT" YOU KILLED IT!
WELL DONE!":PROCreturn:ENDPROC
3200PROCreturn
3210PROCdice(2)
3220CLS
3230IFs%<sk% THEN stamina%=stamina%-RND
(sk%):PRINT" You've been hit!" ELSE PRIN
T" He missed you!"
3240IF stamina%<1 THEN CLS:PRINT" You
have died...":PROCreturn:ENDPROC
3250PROCreturn
3260GOTO3120
3270ENDPROC
3280DEF PROCblank
3290FORa%=1TOinv%
3300inv$(a%)=""
3310NEXTa%
3320ENDPROC
3330DEF PROCdefault
3340CLS
3350PRINT" Re-set scores?? SURE (Y/N) ?
";
3360REPEAT:A$=GET$:UNTILINSTR("YyNn",A$
)
3370IFINSTR("nN",A$) THEN ENDPROC
3380PROCinit
3390ENDPROC