; _ _ _ _ _ _ _ _ _ ;[_][_][_][_][_][_][_][_][_] ; ; The Land of SPUR ; ; (C)opyright 1987 ; Greg W. Davis ; and ; Peripherals Plus ; ; 08/29/87 13:00 ;___________________________ ; v3.0 ; Spur Sub ; Sub-routines Segment ; _ _ _ _ _ _ _ _ _ ;[_][_][_][_][_][_][_][_][_] on nocar goto dropped public show0 public show1 public show2 public show3 public show4 public quit public win if instr("PRAY",i$) goto pray.god if instr("WEAR",i$) goto wear if instr("USE",i$) goto use if instr("EAT",i$) goto eat if instr("DRINK",i$) goto drink if instr("READY",i$) goto rdy.wep if instr("READ",i$) goto rd.book if not instr("CAST",i$) goto linkgame ; ***************** ; * CAST Spells * ; ***************** cast if xs=0 print \"No Spells.":goto linkgame gosub prspell input @2\"Cast which spell number? "a$:if a$="" goto linkgame x=val(a$):if (x<1) or (x>xs) print \"You do not know that spell.":goto linkgame y=(x*4)-3:l=len(xs$):x=val(mid$(xs$,y)) xs=xs-1:if xs=0 then xs$="":goto spl.read if y=1 then xs$=mid$(xs$,5):goto spl.read if (y+4)>l then xs$=left$(xs$,y-1):goto spl.read xs$=left$(xs$,y-1)+mid$(xs$,y+4) spl.read dy$=dx$+"spells" open #1,dy$ position #1,40,x input #1,cb$\q$,q2$,q3,q4 close cst.outc cs=0:b=20-pi:if b<3 then b=3 zz$=rnd$:a=random(b):b=0 if ac2 then ps=ps-c2 goto spl.back cst.wisd if (b=1) and (pw<20) then pw=pw+c2:goto spl.succ if pw=>c2 then pw=pw-c2 goto spl.back cst.dext if (b=1) and (pd<20) then pd=pd+c2:goto spl.succ if pd=>c2 then pd=pd-c2 goto spl.back cst.cons if (b=1) and (pt<20) then pt=pt+c2:goto spl.succ if pt=>c2 then pt=pt-c2 goto spl.back cst.engy if (b=1) and (pe<20) then pe=pe+c2:goto spl.succ if pe=>c2 then pe=pe-c2 goto spl.back cst.intl if (b=1) and (pi<20) then pi=pi+c2:goto spl.succ if pi=>c2 then pi=pi-c2 goto spl.back cst.xfer if b=1 print \' Your gold has been transferred to your bank account.':bh=bh+gh:bl=bl+gl:gh=0:gl=0:goto cst.x2 print \' Spell has backfired. You are now carrying all your gold.':gh=gh+bh:gl=gl+bl:bh=0:bl=0 cst.x2 if bl=>10000 then bl=bl-10000:bh=bh+1 if gl=>10000 then gl=gl-10000:gh=gh+1 goto linkgame cst.plyr if b=2 goto cst.pl2 zz$=rnd$:a=random(10) if a=10 goto win if hp<(xp*25) then hp=hp+c2:goto spl.succ cst.pl2 if hp>c2 then hp=hp-c2 goto spl.back cst.mons if b=2 goto cst.mns2 zz$=rnd$:a=random(10) if a>5 then mw=0:mf=0:md=1:mk=mk+1:goto spl.succ ms=ms-c2:if ms<=0 then ms=0:mw=0:mf=0:md=1:mk=mk+1 if mw print \m$" appears to have weakened." goto spl.succ cst.mns2 ms=ms+c2:print \' The spell appears to have made ':print m$" stronger!" goto spl.back cst.dnlv if b=2 goto cst.dn2 if lc>cl then cl=cl+1:cs=1:goto spl.succ goto spl.fail cst.dn2 if cl<>1 then cl=cl-1:cs=1:goto spl.back goto spl.fail cst.uplv if b=2 goto cst.up2 if cl<>1 then cl=cl-1:cs=1:goto spl.succ goto spl.fail cst.up2 if lc>cl then cl=cl+1:cs=1:goto spl.back goto spl.fail cst.shop if b=2 goto cst.shp2 cl=1:cr=1:di=6:cs=1:goto spl.succ cst.shp2 zz$=rnd$:cr=random(nr):if cr=0 goto cst.shp2 cs=1:goto spl.back cst.spur if cl<>sl print \"SPUR is not on level "cl"!":goto spl.fail cr=sr:cs=1:print \"Prepare thyself...":goto spl.succ cst.aura x=q4/10:if tm=0 then tm=mm+x+c2:else tm=tm+x+c2 goto spl.succ cst.tele print\"To which Level [1-"lc"]: ";:input cl:if (cl<1) or (cl>lc) goto cst.tele if pw<6 goto spl.fail cs=1 spl.succ print \"Spell successful!" spl.link if cs then dy$=dz$+"spur.main":link dy$,"travel3" goto linkgame spl.back print \"Spell Backfired!" goto spl.link spl.fail print \"Spell failed..." goto spl.link ; **************** ; * READ Books * ; **************** rd.book bk=0:print \"These are your books:"\ dy$=dx$+"items" open #1,dy$ for x=1 to xi y=(x*4)-3 a=val(mid$(xi$,y)) position #1,30,a input #1,cb$\n$ if left$(n$,1)="B" print right$(" "+str$(x),3)". - "mid$(n$,3):bk=bk+1 next if not bk print \"You have no Books!!":close:goto linkgame input @2 \"Read which Book? "x if x=0 close:goto linkgame if (x<1) or (x>xi) print \"You don't have that Book!!":close:goto rd.book y=(x*4)-3:a=val(mid$(xi$,y)) position #1,30,a,2 input #1,n$:close if left$(n$,1)<>"B" print \"This is NOT a Book!!":goto linkgame bk$=dx$+"spur.books":edit(0):gosub read.bk if not edit(2) print\"This Book cannot be read!":goto rd.book0 if pw<10 then pw=pw+1 print \"That is all."\:edit(0) if sp gosub bk.spell rd.book0 x$=right$("000"+str$(a),3)+",":y=instr(x$,xi$):l=len(xi$) print \"The book vanishes in a cloud of smoke!" if xt<60 then xt=xt+1:xt$=xt$+x$:goto drp.itm2 xt$=mid$(xt$,5)+x$ goto drp.itm2 read.bk ready bk$ input #msg(a),n$,sp print \n$" reads:"\ copy #6,#8 copy #8,#0 ready dr$:return bk.spell if xs=10 goto bk.sp2 if pi<6 goto bk.sp2 dy$=dx$+"spells":open #1,dy$ position #1,40,sp input #1,cb$\q$,a$:close if (cb$="*") or (cb$="") goto bk.sp2 print\'Ye have read well...... SPELL OF 'q$' learned!' xs=xs+1 a$=right$("000"+str$(sp),3)+"," xs$=xs$+a$ return bk.sp2 print\'Ye have NOT paid close attention to your reading.. Spell not learned!' return drp.itm2 xi=xi-1:if xi=0 then xi$="":goto linkgame if y=1 then xi$=mid$(xi$,5):goto linkgame if (y+4)>l then xi$=left$(xi$,y-1):goto linkgame xi$=left$(xi$,y-1)+mid$(xi$,y+4) goto linkgame ; ******************* ; * READY Weapons * ; ******************* rdy.wep if ps<4 print \' Not enough strength to ready a weapon!':goto linkgame gosub pr.weapons:if xw=0 goto linkgame rdy.wep2 input @2\"Ready which Weapon number? "a$:if a$="" goto linkgame x=val(a$):if (x<1) or (x>xw) print \"You don't have that Weapon!":goto rdy.wep2 y=(x*4)-3:a=val(mid$(xw$,y)) open #1,dy$:position #1,34,a,2 input #1,ws$\ws,wd\wa close if (ws<5) and (pd<6) print' Not dextrous enough to ready this weapon!':goto linkgame wr$=mid$(ws$,3) if xp>1 then ws=((xp+2)*ws)/3 print \"Weapon readied":goto linkgame ; ********** ; * WEAR * ; ********** wear gosub pr.items:if xi=0 goto linkgame wear2 input @2\"Wear which number Item? "a$:if a$="" goto linkgame x=val(a$):if (x<1) or (x>xi) print \"You don't have that item.":goto wear2 y=(x*4)-3:x=val(mid$(xi$,y)) open #1,dy$:position #1,30,x,2 input #1,n$\it:close if left$(n$,1) <> "A" print \"This is not an Armor!":goto linkgame if ar<100 then it=it*10:ar=ar+it:ra=1:if ar>100 then ar=100 ep=ep+1:if pi<8 then pi=pi+1 print \mid$(n$,3)" worn.":gosub clr.item:goto linkgame ; ********* ; * USE * ; ********* use gosub pr.items:if xi=0:goto linkgame use2 input @2\"Use which number Item? "a$:if a$="" goto linkgame x=val(a$):if (x<1) or (x>xi) print \"You don't have that item.":goto use2 y=(x*4)-3:x=val(mid$(xi$,y)) open #1,dy$:position #1,30,x,2 input #1,n$\it:close if left$(n$,1)="P" goto use3 if (left$(n$,1) <> "S") print \"This is not a Usable Item!":goto linkgame ep=ep+1:if pi<8 then pi=pi+1 if sh<100 then it=it*10:sh=sh+it:hs=1:if sh>100 then sh=100 print \mid$(n$,3)" used.":gosub clr.item:goto linkgame use3 ep=ep+1 if cp=0 cp=1:print \"Compass used.":else cp=0:print \"Compass placed in pack." goto linkgame ; ********* ; * EAT * ; ********* eat gosub pr.food:if xf=0 goto linkgame eat2 input @2\"Eat which number Item? "a$:if a$="" goto linkgame x=val(a$):if (x<1) or (x>xf) print \"You don't have that item.":goto eat2 y=(x*4)-3:x=val(mid$(xf$,y)) open #1,dy$:position #1,26,x,2 input #1,gs$\gs:close if left$(gs$,1)<>"F" print \mid$(gs$,3)" cannot be eaten.":goto linkgame a=random(gs):a=a mod 8:if ps<18 then ps=ps+a if hp<(xp*25) then hp=hp+a if ps<15 print \"Your hunger lessens." if ps>14 print \"Your appetite is satisfied.":if (pe>15) and (pt<18) then pt=pt+1 ep=ep+1 gosub clr.food:goto linkgame ; *********** ; * DRINK * ; *********** drink gosub pr.food:if xf=0 goto linkgame drink2 input @2\"Drink which number Item? "a$:if a$="" goto linkgame x=val(a$):if (x<1) or (x>xf) print \"You don't have that item.":goto drink2 y=(x*4)-3:x=val(mid$(xf$,y)) open #1,dy$:position #1,26,x,2 input #1,gs$\gs:close if left$(gs$,1)<>"D" print \mid$(gs$,3)" cannot be drunk.":goto linkgame a=random(gs):a=a mod 6:if pe<18 then pe=pe+a+1 if hp<(xp*25) then hp=hp+a print \"You feel refreshed." if pe>14 print \"...hiccup..." ep=ep+1:if (pe>15) and (ps>15) and (pt<18) then pt=pt+1 gosub clr.food:goto linkgame ; *********************** ; * Clear Subroutines * ; *********************** clr.item xi=xi-1:if xi=0 then xi$="":return l=len(xi$) if y=1 then xi$=mid$(xi$,5):return if (y+4)>l then xi$=left$(xi$,y-1):return xi$=left$(xi$,y-1)+mid$(xi$,y+4) return clr.food xf=xf-1:if xf=0 then xf$="":return l=len(xf$) if y=1 then xf$=mid$(xf$,5):return if (y+4)>l then xf$=left$(xf$,y-1):return xf$=left$(xf$,y-1)+mid$(xf$,y+4) return ; ***************************** ; ** Pray to deity ** ; ***************************** pray.god xj$=str$(pr) print\g$" Deities" print' <1> - Odin <6> - Silmarilian <2> - Ogrian <7> - Clanggedin <3> - Flandal <8> - Bahgtru <4> - Solonor <9> - Tolkien <5> - Arvoreen' input@2\"To Whom doest Thou Pray? :"i$ if i$="" goto linkgame if i$=xj$ then goto pray2.god print' Thou doest not praise Thine own Deity? Thou art a FOOL!!'\ pi=pi-3:if pi<0 then pi=0 goto linkgame pray2.god de=de+1:zz$=rnd$:x=random(5):if de=>x goto pray4.god xj$=rnd$:xj=random(99):if xj<50 goto pray3.god print\"Thy Deity doth not answer."\:goto linkgame pray3.god zz$=rnd$:xj=random(100):if xj<90 goto pray3a print\"Thee hath been faithful." print\" I will grant Thee ONE wish" print ' <1> - Teleport to shoppe. <2> - Heal thy body. ' input\"Your wish :"i$ if i$="1" goto pray5.god if i$="2" goto pray6.god goto pray3.god pray3a if (xj>80) and (xj<91) and (pi<22) pi=pi+3:goto prayend if (xj>70) and (xj<81) and (pe<22) ps=ps+3:goto prayend if (xj>60) and (xj<71) and (pe<22) pe=pe+3:goto prayend if (xj>50) and (xj<61) and (pw<22) pw=pw+3:goto prayend if (xj>40) and (xj<51) and (pd<22) pd=pd+3:goto prayend if (xj>30) and (xj<41) and (pt<22) pt=pt+3:goto prayend if (xj>20) and (xj<31) and (hp<27) hp=hp+3:goto prayend print\' I have heard thy plea, but shall not help Thee now!':de=de-1:goto linkgame pray4.god print\' From above you hear a giant clash!! As the earth shakes from the thunderous explosion. "Thou hast disturbed Me to many times....Do not disturb me any more!"' hp=hp-5:if hp<0 then hp=0 goto linkgame pray5.god di=6:cr=1 dy$=dz$+"spur.main":link dy$,"travel3" pray6.god if hp>=(xp*25) print\"You need not be cured.":goto linkgame hp=hp+3:if hp>(xp*25) then hp=(xp*25) print\' As you stand there in amazement, your deity reaches down and touches you with his mighty finger. "Thou hast been a brave Adventurer, your body has been healed."' goto linkgame prayend print\"Thee hath been heard!":goto linkgame ; ***************************** ; * Display Stats/Inventory * ; ***************************** show0 on nocar goto dropped gosub invent goto linkgame show1 on nocar goto dropped gosub status goto linkgame show2 on nocar goto dropped gosub status goto lnkmain1 show3 on nocar goto dropped gosub invent goto lnkmain1 show4 on nocar goto dropped gosub status goto lnk.duel ; ******************* ; * Player Status * ; ******************* status print \n1$"'s Current Status:"\ g1=gh:g2=gl:gosub prt.gold print "Gold - In Hand:"gd$ g1=bh:g2=bl:gosub prt.gold print " In Bank:"gd$ print \"Experience Pts :"right$(" "+str$(ep),3)" Hit Points :"right$(" "+str$(hp),3) print "Monsters Kills :"right$(" "+str$(mk),3)" Player Level :"right$(" "+str$(xp),3) a=ps*4:print \"Strength: "right$(" "+str$(ps),2)right$(" "+str$(a),4)"% "; a=pt*4:print "Const'n :"right$(" "+str$(pt),2)right$(" "+str$(a),4)"%" a=pi*4:print "Intel : "right$(" "+str$(pi),2)right$(" "+str$(a),4)"% "; a=pd*4:print "Dexterity:"right$(" "+str$(pd),2)right$(" "+str$(a),4)"%" a=pw*4:print "Wisdom : "right$(" "+str$(pw),2)right$(" "+str$(a),4)"% "; a=pe*4:print "Energy :"right$(" "+str$(pe),2)right$(" "+str$(a),4)"%" print \"Shield : "right$(" "+str$(sh),3)"% "; print "Armor : "right$(" "+str$(ar),3)"%" print \"Class : "; if pc=1 print "Alchemist ";:else if pc=2 print "Druid "; if pc=3 print "Fighter ";:else if pc=4 print "Paladin "; if pc=5 print "Ranger ";:else if pc=6 print "Thief "; if pc=7 print "Archer ";:else if pc=8 print "Assassin "; if pc=9 print "Knight "; print " Race: "; if pr=1 print "Human":else if pr=2 print"Ogre" if pr=3 print "Gnome":else if pr=4 print"Elf" if pr=5 print "Hobbit":else if pr=6 print"Hafling" if pr=7 print "Dwarf":else if pr=8 print"Orc" if pr=9 print "Half-Elf" print \"SPUR : ";:if (sr) print "Alive!":else print "Dead..." g1=dh:g2=dl:gosub prt.gold print "Dwarf: ";:if (df) print "Alive! ["gd$" gold]":else print "Dead..." print\"Guild member: ";:if (gn) print"Yes":else print"No ex=clock(1)-ew:print \"Hourglass: "((ev-ex)/60)" mins." goto stat.rtn ; ********************** ; * Player Inventory * ; ********************** invent g1=gh:g2=gl:gosub prt.gold print \"Gold - In Hand:"gd$ print \"Items Carried:" gosub pr.items print \"Rations:" gosub pr.food print \"Weapons:" gosub pr.weapons print \"Spells Known:" gosub prspell stat.rtn on nocar goto drop1 print \"Allies:"\ d$=d1$:d=a1:gosub prally:d$=d2$:d=a2:gosub prally:d$=d3$:d=a3:gosub prally print\"Press [RETURN] "; get.key a=key(0):if a=0 goto get.key print chr$(8,16);chr$(32,16);chr$(8,16) return ; ************************* ; * Display Subroutines * ; ************************* prspell if xs=0 print \"No Spells.":return dy$=dx$+"spells" open #1,dy$ print:for x=1 to xs y=(x*4)-3:a=val(mid$(xs$,y)) position #1,40,a input #1,cb$\q$,q2$,q3,q4 print right$(" "+str$(x),3)". - "; print q$;chr$(32,21-len(q$))" Success: "q3"0%" next:close:return prally if d$="*" return print d$;chr$(32,18-len(d$))" Strength: "d return pr.items if xi=0 print \"No Items.":return dy$=dx$+"items" open #1,dy$ print:for x=1 to xi y=(x*4)-3:a=val(mid$(xi$,y)) position #1,30,a,2 input #1,n$ print right$(" "+str$(x),3)". - "mid$(n$,3) next:close:return pr.food if xf=0 print \"No Rations.":return dy$=dx$+"stores" open #1,dy$ print:for x=1 to xf y=(x*4)-3:a=val(mid$(xf$,y)) position #1,26,a,2 input #1,n$ print right$(" "+str$(x),3)". - "mid$(n$,3) next:close:return pr.weapons if xw=0 print \"No Weapons.":return dy$=dx$+"weapons" open #1,dy$ print:for x=1 to xw y=(x*4)-3:a=val(mid$(xw$,y)) position #1,34,a,2 input #1,n$ print right$(" "+str$(x),3)". - "mid$(n$,3) next:close:return ; *********************** ; * Sound Subroutines * ; *********************** tune pl$="100,109,100,109,134,162,120,162,134,100,90,81,67,81,120,107,120" du$="160,40,40,80,120,120,80,240,120,160,40,40,80,80,40,40,200" tune.1 p=val(pl$):du=val(du$) tone(p,du) a=instr(",",pl$):if a=0 return pl$=mid$(pl$,a+1) a=instr(",",du$):if a=0 return du$=mid$(du$,a+1) goto tune.1 ; ********************** ; * GOLD Subroutines * ; ********************** prt.gold a$=str$(g1):gd$="0000":if g1=0 then gd$=" ":a$=" " gd$=right$(" "+a$,5)+right$(gd$+str$(g2),4) return add.gold gl=gl+g2:if gl=>10000 then gl=gl-10000:gh=gh+1 return tot.gold g1=gh+bh:g2=gl+bl:if g2=>10000 then g2=g2-10000:g1=g1+1 return ; *********************** ; * Award Gold/Allies * ; *********************** quit on nocar goto dropped print \n1$"'s Current Status:" print \"Experience Points: "ep print "Monsters Killed: "mk zz$=rnd$:a=random(ep):a=a/3:if a>0 print \"SPUR awards you "a" gold"\"for your experience.":g2=a:gosub add.gold ally zz$=rnd$:a=random(10) if (a>8) or (a<2) goto ally2 goto ally4 ally2 x=0 print \"Seeking new allies.." dy$=dx$+"allies" open #1,dy$ zz$=rnd$:a=random(ac) if a=0 goto ally3 position #1,26,a input #1,cb$\x1$\x1,x2:if cb$<>"1" goto ally3 x1=(x1+x2)/2:x1=random(x1)+5:x2=a if a1=0 then d1$=x1$:a1=x1:h1=x2:x=1:goto ally3 if a2=0 then d2$=x1$:a2=x1:h2=x2:x=2:goto ally3 if a3=0 then d3$=x1$:a3=x1:h3=x2:x=3:goto ally3 ally3 if x=0 print \"No alliance made.":goto ally4 print \"You have a new ally!"\\"#"x" Name: "x1$" Strength: "x1 position #1,26,a:print #1,0 ally4 close dy$=dz$+"spur.logon" link dy$,"quit1" ; ********************** ; * Check for Winner * ; ********************** win on nocar goto dropped if (sr) print \'A voice echoes... "Thou may not leave MY land until I am defeated!"':goto linkgame if go=1 goto win2 win1 if xi=0 goto nowin for x=1 to xi y=(x*4)-3:a=val(mid$(xi$,y)) if a=og then x=xi:print \"Ye have found the Object I have sought!" next if (a=og) and (go=3) goto win2 if a=og goto win4:else goto nowin win2 gosub tot.gold:gosub chk.obj:if a print \"Ye have found Riches enough to pass through":else goto nowin win4 if sd=1 gosub tune a=0:wn=1:print \"Hold! SPUR will value what you have found.." dy$=dx$+"items" open #1,dy$ if xi=0 close:goto win5 for x=1 to xi y=(x*4)-3 b=val(mid$(xi$,y)) position #1,30,b input #1,cb$\n$\it:if left$(n$,1)="T" then a=(it*5)+a next:close win5 xi=0:xi$="" if a1 gosub win4a:a=a+x if a2 gosub win4a:a=a+x if a3 gosub win4a:a=a+x print \\"SPUR awards you "a" gold for your goods." g1=a:gosub add.gold print \"Prepare for NEW Adventure..." i$="":dw$=dx$+"spur.items":open #1,dw$ position #1,84,pn:print #1,0\i$:close dy$=dx$+"spur.allies" open #1,dy$:position #1,78,pn for i=1 to 3 print #1,"*",0,0 next:close if d1$<>"*" then x=h1:gosub fre.ally if d2$<>"*" then x=h2:gosub fre.ally if d3$<>"*" then x=h3:gosub fre.ally d1$="*":d2$="*":d3$="*":a1=0:a2=0:a3=0:h1=0:h2=0:h3=0 print \"Adding name to CONQUEROR'S list..." dy$=dx$+"spur.winners":open #1,dy$:append #1 print #1,\"Adventurer : "n1$ print #1,"Quest Completed: "date$" "time$ print #1,"Character Level: "xp print #1,"Experience Pts : "ep print #1,"Number of Moves: "mm print #1,"Monster Kills : "mk gosub tot.gold:gosub prt.gold print #1,"Gold Acquired : "gd$\md$ close goto linkmain win4a zz$=rnd$:x=random(100) return nowin print\' An invisible barrier holds you back! A voice comes from the gloom and says: "You have not found the key to SPUR! You may NOT pass through!"' goto linkgame fre.ally dy$=dx$+"allies":open #1,dy$ position #1,26,x print #1,1:close:return ; ******************************** ; * Check Gold Required Amount * ; ******************************** chk.obj a=0 g1=gh+bh:g2=gl+bl:if g2=>10000 then g2=g2-10000:g1=g1+1 if g1>oh then a=1:return if (g1=oh) and (g2=>ol) then a=1 return ; ********************************* ; * Relink to Main Program * ; **************************** linkmain dy$=dz$+"spur.logon" link dy$,"main" lnkmain1 dy$=dz$+"spur.shop" link dy$,"main1" linkgame dy$=dz$+"spur.main" link dy$ lnk.duel dy$=dz$+"spur.duel" link dy$,"duel" drop1 pop dropped dy$=dz$+"spur.logon" link dy$,"quit3"