; Ships & Sailors Battle Routines ; Written 03/11/89 by -DC- ; Variables defined: ; ; vm = Total vectors ; ve = Current vector location ; lo = Current location within vector ; me = Crew members ; cr = Captain's credits ; fo = Food supply ; da = Five day count for food ; ca = Cannons on nocar goto no.car goto start no.car pop:link "a:ships.seg","no.car" link.main link "a:ships.seg","return" get.key ww=0:wx=0 get.key1 gf=clock(2) if (gf<>0) and (clock(1)>gf) print \\"[ Time Limit Exceeded ]":pop:goto no.car gf=peek(-16384):if (gf=129) or (gf=150) get i$:print chr$(8);:return gf=key(0):if (gf>96) and (gf<123) gf=gf-32 if (gf>31) or (gf=13) i$=chr$(gf):return ww=ww+1:if flag(33)=0 goto get.key2 wx=wx+1:if wx>16 wx=1 print mid$("!/-\!/-\!\-/!\-/",wx,1);chr$(8); get.key2 if ww=2000 print chr$(7,2); if ww=4000 pop:goto no.car if (not info(0)) and (not info(5)) and (eu<>1) pop:goto no.car goto get.key1 surrender print \d1$" "d2$"'s men wish to surrender. Do you accept? "; gosub get.key:if i$<>"Y" print "No!":su=1:goto fire2 print "Yes":end retreat print "Your men and supplies are low. Do you wish to retreat? "; gosub get.key:if i$<>"Y" print "No":goto fire3 print "Yes":end ; Start of battle start if not info(5) print \"Battle routines are not ready yet.":goto link.main su=0 if xx=2 print \d1$" "d2$"'s men were waiting for you!":goto begin fire1 if su goto fire2 if (fx<1) or (fx>gf) goto surrender fire2 if (ca<1) or (ca>me) goto retreat fire3 for a=1 to ca print "You fire cannon #"a i$=rnd$:b=random(gf) gf=gf-b:if gf<1 gf=0 print "...and kill "b" men, leaving "gf"." if gf=0 a=ca:next:goto battle.end i$=rnd$:b=random(100) if fx=0 goto fire4 if b<75 goto fire4 print "The blast also destroyed one of their cannons!" fx=fx-1:if fx<0 fx=0 fire4 if (a