; Ships & Sailors ; Started by -DC- on 02/14/88 ; 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 public no.car public return on nocar goto no.car da=0:vm=15:goto start no.car open #1,"j:user.info":position #1,20,un:print #1,ve,lo,me,fo,ca:close open #1,"f:u."+str$(un):position #1,5,2:print #1,cr:close link "a:main.seg","term1" return return link.main link "a:games.seg","fromsys" center b=(edit(3)/2)-(len(a$)/2):if b<1 b=1 print chr$(32,b); if flag(32) print chr$(15);a$;chr$(14):return print a$: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 sysop print sc$ if flag(32) a$=chr$(32,14)+chr$(14,2):gosub center if flag(32) a$=" "+chr$(14)+" SysOptions "+chr$(15)+" ":gosub center if flag(32) a$=chr$(32,14)+chr$(14,2):gosub center if not flag(32) a$="%> SysOptions <%":gosub center sys.com push sys.com:print\"SysOp command? "; sysop1 gosub get.key if i$="Q" print "Quit":pop:goto start if i$="M" print "Make":goto make.vec if i$="T" print "Terminate":pop:link "a:main.seg","term" if i$="C" print "Create blanks":goto create if i$="J" print "New vec/loc":goto new.loc if i$="F" print "Find ships":goto find if i$="R" print "Restart a user":goto restart if i$<>"?" goto sysop1 print "Commands -" print' [F)ind all ships [M)ake/edit vectors [T)erminate call [C)reate blank vectors [J)ump to a new vector/location [R)estart a user [Q)uit to command' return sys.quit open #1,"j:user.info":position #1,20,un:print #1,ve,lo,me,fo,ca:close open #1,"f:u."+str$(un):position #1,5,2:print #1,cr:close goto link.main restart print \"Restart a User"\ input @2"Enter user #"a:if (a<1) or (a>nu) return open #1,"j:user.info":position #1,20,a:input #1,c,b,x,x,x position #1,20,a:print #1,0,0,0,0,0:close open #1,"j:v"+str$(c):position #1,20,b:print #1," ",0,0,0:close print \"Account has been erased.":return create print \"Create Blank Vectors"\ print "Destroy current all current vectors? ";:gosub get.key if i$<>"Y" print "Hell no!":return print "Yes"\\"Creating vector [00]"; for i=0 to vm:f$="j:v"+str$(i):open #1,f$ print chr$(8,3);right$(("0"+str$(i)),2)"]"; if not mark(1) close:next:print " - Done!":return close:create f$:open #1,f$:for x=0 to 99 position #1,20,x:print #1," ,0,0,0":next:close:next print " - Done!":return make.vec print \"Make/Alter a Vector"\ print "Enter vector: (0-"vm") #";:input @2 b if (b<0) or (b>vm) return a=ve:ve=b:gosub display:ve=a:print \"Enter new vector:"\ print " ";:for i=0 to 9:print " "i;:next:print f$="j:v"+str$(b):create f$:open #1,f$ for i=0 to 99:position #1,20,i:input #1,a$,x,ff,fx:if not a$ a$=" " i$=str$(i):if len(i$)=1 i$="0"+i$ if right$(i$,1)="0" print i$"|"; print a$;chr$(8); make1 gosub get.key:if i$=chr$(13) i=99:next:close:print:return if i$=chr$(21) i$=a$ print i$"|";:if right$(str$(i),1)="9" print position #1,20,i:print #1,i$,x,ff,fx next:close:print \"Vector completed!":return new.user print \"Welcome new captain!" new1 i$=rnd$:ve=random(vm):i$=rnd$:lo=random(99) f$="j:v"+str$(ve):open #1,f$:position #1,20,lo:input #1,i$,x,x:close if i$<>" " goto new1 print \"Your ship will be located at:" print "Vector ["ve"], Location ["lo"]":f$="j:v"+str$(ve) create f$:open #1,f$:position #1,20,lo:print #1,"S",un,0,0:close me=30:fo=20:ca=3:create "j:user.info" open #1,"j:user.info":position #1,20,un:print #1,ve,lo,me,fo,ca:close goto start1 start print sc$ if flag(32) a$=chr$(32,19)+chr$(14,2):gosub center if flag(32) a$=" "+chr$(14)+" Ships & Sailors "+chr$(15)+" ":gosub center if flag(32) a$=chr$(32,19)+chr$(14,2):gosub center if not flag(32) a$="%> Ships & Sailors <%":gosub center if info(5) print\"Goto SysOptions? ";:get i$:print:if i$="Y" goto sysop open #1,"j:user.info":position #1,20,un:input #1,ve,lo,me,fo,ca:close f$="f:u."+str$(un):open #1,f$:position #1,5,2:input #1,cr:close if not me goto new.user open #1,"j:v"+str$(ve):position #1,20,lo:input #1,i$,a,b,c:close if (i$<>"S") or (a<>un) goto locate print \'Your ship is located at: Vector ['ve'], Location ['lo']':goto start1 locate print ' Locating your ship: Vector [00], Location [00]'; for i=0 to vm:f$="j:v"+str$(i):open #1,f$ for x=0 to 99:position #1,20,x:input #1,i$,a,b,b if (a=un) and (i$="S") lo=x:x=99:next:close:ve=i:i=vm:next:print:goto start1 print chr$(8,3);right$(("0"+str$(x+1)),2)"]"; next:close:print chr$(8,18);right$(("0"+str$(i+1)),2)"], Location [00]";:next print chr$(8,18);right$(("0"+str$(vm)),2)"], Location [99]"; print \\"Error - Your ship was not found." print "Restart with a new ship? ";:gosub get.key if i$<>"Y" print "No":goto link.main print "Yes":open #1,"j:user.info":position #1,20,un:print #1,0,0,0,0:close goto start find print \"Find Other Ships"\ print "Vector [00], Location [00]"; for i=0 to vm:open #1,"j:v"+str$(i) for x=0 to 99:position #1,20,x:input #1,i$,b,gf,fx if i$="S" gosub find1 print chr$(8,3);right$(("0"+str$(x+1)),2)"]"; next:close:print chr$(8,18);right$(("0"+str$(i+1)),2)"], Location [00]";:next print chr$(8,18);right$(("0"+str$(vm)),2)"], Location [99]"; print:return find1 open #2,"b:users":position #2,64,b:input #2,d1$,d2$:close #2 if d1$="" position #1,20,x:print #1," ",0,0,0:return print \"Ship owned by "d1$" "d2$" [#"b"] is here."\ print "Vector ["right$(("0"+str$(i)),2)"], Location ["right$(("0"+str$(x)),2)"]";:return start1 if fo<1 print \'"We need food, captain! Crewmen are dying!"' if fo<1 if me<10 me=me-1:goto start2 if fo<1 me=me-random((me/10)*5) start2 if me<1 goto no.crew gosub status:gosub display command push command if clock(2) print \"["(clock(2)-clock(1))/60":";:i$=str$((clock(2)-clock(1)) mod 60):if len(i$)<2 i$="0"+i$ if not clock(2) i$=chr$(13)+"[00:00" print i$"] Command? "; com1 gosub get.key if (i$="J") and (info(5)) print:goto new.loc if (i$="N") and (flag(4)) print "New status!":goto new.stats if i$="Q" print "Quit":pop:goto sys.quit if i$="D" print "Display":goto display if i$="L" print "Status":goto status if (i$="S") and (info(5)) print "SysOptions":pop:goto sysop if i$="M" print "Move":goto move if i$<>"?" goto com1 print 'Menu [D)isplay vector [L)ist status [M)ove ship [Q)uit game' if flag(4) print '[J)ump to new location [N)ew status' return status print \"Status":if flag(32) print p$;chr$(204,6);n$:else print chr$(45,6)\ print "Crew : "me if me<20 a=fo:else a=fo/(me/10) if fo<1 a=0 print "Food : "a" days"\"Credits: "cr\"Cannons: "ca print \"You've been sailing for "da" days this call." return new.stats gosub status:print \"Enter the following:" input \"Crew, food, credits, cannons: "me,fo,cr,ca goto status display f$="j:v"+str$(ve):open #1,f$ if mark(1) close:print \"Error - No data for this vector!":return print \"Vector: ["ve"] Location: ["lo"]"\ print " ";:for i=0 to 9:print " "i;:next:print for i=0 to 99:position #1,20,i input #1,i$,x,x,x:if not i$ i$=" " a$=str$(i):if len(a$)=1 a$="0"+a$ if right$(a$,1)="0" print a$"|"; print i$"|"; if right$(a$,1)="9" print next:close:return no.crew print \"You have no crew left. Your ship drifts to a rock bed and shatters." f$="j:v"+str$(ve):open #1,f$:position #1,20,lo:print #1," ,0,0,0":close open #1,"j:user.info":position #1,20,un:print #1,0,0,0,0:close print ' Your game is over. However, you still own any land that you have conquered during your journey, and can start a new ship and begin again.' print \"Begin a new game? ";:gosub get.key if i$<>"Y" print "No":goto link.main print "Yes":goto start move y=ve print \"Which direction? (N,S,E,W): ";:gosub get.key if not instr(i$,"NSEW") print "Quit":return if i$="N" print "North":x=lo-10:goto north if i$="S" print "South":x=lo+10:goto south if i$="E" print "East":x=lo+1:goto east if i$="W" print "West":x=lo-1 if right$(str$(x),1)="9" x=lo+9:y=ve-1 if x<0 x=9:y=ve-1 goto move1 east if right$(str$(x),1)="0" x=lo-9:y=ve+1 if x>99 x=90:y=ve+1 goto move1 north if x<0 x=x+100:y=ve-10 goto move1 south if x>99 x=x-100:y=ve+10 move1 if (y<0) or (y>vm) print \"Due to shallow waters, you cannot go this direction.":return da=da+1:if me<20 fo=fo-1:else fo=fo-(me/10) f$="j:v"+str$(y):open #1,f$:position #1,20,x:input #1,i$,b,gf,fx:close if i$="T" print sc$:goto town if i$="S" goto ship if i$="." goto land if i$="+" goto con.land if i$="^" goto shallow if i$<>" " print \"What the fuck is '"i$"'? Whatever, you can't go there!":return if (x<0) or (x>99) print \"Fatal Error #1 - Contact -DC-":goto start1 f$="j:v"+str$(ve):open #1,f$:position #1,20,lo:print #1," ,0,0,0":close f$="j:v"+str$(y):open #1,f$:position #1,20,x:print #1,"S",un,0,0:close lo=x:ve=y return con.land open #1,"b:users":position #1,64,b:input #1,d1$,d2$:close if d1$="" open #1,"j:v"+str$(y):position #1,20,x:print #1,".",0,0,0:close if d1$="" print \"This land is marked as owned, but in reality...":goto land print \"You have found land that is owned by "d1$" "d2$"." if b<>un goto con.lnd print \"Update this island? ";:gosub get.key if i$<>"N" print "Yes":goto owned print "No":return con.lnd a=gf:if not a a=random(8)+1 b=fx:if not b b=random(6)+1 print "It looks like it contains "random(a*2)+2" men,"; print " and around "random(b)" cannons." if flag(4) print "[It really has "gf" men and "fx" cannons]" xx=random(2):if xx=2 link "a:ships2.seg" print "Do you wish to attack this land? ";:gosub get.key if i$<>"Y" print "No":return print "Yes!":link "a:ships2.seg" land print \"You have found uninhabited land." if me<11 print "But you don't have enough crew to control it!":return if ca=0 print "But you don't have any cannons to leave on it!":return print ' You can control this land by leaving at least 10 of your crew on the island. The more men you leave, the stronger the forces on the island if some other user'chr$(39)'s ship attempts to battle and take over the island. You must also leave at least one of your cannons on the island.' owned print "You currently have "me" crew members, and "ca" cannons." land1 input @2 "Leave how many men on the island? (0=none): "a if not a return if a<10 print \"You must leave at least 10!":goto land1 if a>me print \"You don't have that many!":goto land1 me=me-a can1 if ca=1 b=1:ca=0:goto can2 input @2 "Leave how many cannons on the land? "b if b=0 print \"You must leave at least one!":goto can1 if b>ca print \"You don't have that many!":goto can1 can2 f$="j:v"+str$(y):open #1,f$:position #1,20,x:print #1,"+",un,a,b:close print \"You now control this island with "a" men, and "b" cannons." return shallow print \"These are shallow waters, you cannot pass through them." return ship open #1,"b:users":position #1,64,b:input #1,d1$,d2$:close if d1$="" open #1,"j:v"+str$(y):position #1,20,x:print #1," ",0,0,0:close if d1$="" print \"Hey! That ship just dissapeared!":return print \"You have found the ship owned by "d1$" "d2$"." if b=un print "How the hell did you manage to get two ships?!?":return a=gf:if not a a=random(7)+1 b=fx:if not b b=random(5)+1 print "It looks like there's about "random(a*2)+2" men on board,"; print " and around "random(b)" cannons." if flag(4) print "[There's really "gf" men, and "fx" cannons]" xx=random(2):if xx=2 link "a:ships2.seg" print "Do you wish to attack this ship? ";:gosub get.key if i$<>"Y" print "No":return print "Yes!":link "a:ships2.seg" new.loc print \"Move to a New Vector/Location"\ input @2 "Enter (vec,loc): "a,b if a>vm print \"Error - Invalid vector.":return if b>99 print \"Error - Invalid location.":return f$="j:v"+str$(a):open #1,f$:position #1,20,b:input #1,i$,x,x,x if i$<>" " print \"Error - This location occupied.":close:goto new.loc position #1,20,b:print #1,"S",un,0,0:close f$="j:v"+str$(ve):open #1,f$:position #1,20,lo:print #1," ,0,0,0":close ve=a:lo=b:return town if (b=un) and (not flag(4)) print ' You were the last captain to visit this town. It is a good idea not to wear out your welcome in any town, so it is best that you go somewhere else.':return open #1,"b:users":position #1,64,b:input #1,d1$,d2$:close print \"This store was last visited by "d1$" "d2$"." i$=rnd$:rn=random(20) i$=rnd$:v=random(99)+5:i$=rnd$:b=random(45)+5 i$=rnd$:z=random(10)+1:i$=rnd$:c=random(999)+99 f$="j:v"+str$(y):open #1,f$:position #1,20,x:print #1,"T",un,0,0:close town1 print \"You have reached a town." print \"Visit: [1) Tavern, [2) Store: ";:gosub get.key:a=val(i$) print a:if (a<1) or (a>2) print \"Leaving town...":goto start1 if a=1 goto tavern setint(1) print ' You enter the small store through a small door. As you look around, you realize that this place is not exactly top of the line merchandise. The shelfs are almost bare, and the place looks deserted. However, there is a clerk at the front of the store, waiting to help you.':setint("") print ' You currently have 'fo' days of food left, and 'ca' cannons. You also have a total of 'cr' credits to spend.' if (v<1) and (z<1) print "This store is sold-out of everything!":goto town1 if v print "The store has "v" days of food for sale, at "b" credits each." if z print "They also have "z" cannons for sale at "c" credits each." if (cr"Y" print "No":goto town1 print "Yes" if cr"F") or (v<1) print "Quit":goto town1 buy.food print i$\:if crv print \"The store doesn't have that much!":goto town2 ww=cr-(b*a):if ww<1 print \"You can't afford that many.":goto town2 cr=ww:fo=fo+a:v=v-a:print \"The clerk gladly makes the transaction." goto town1 buy.cannon print i$\\:if crz print \"The store doesn't have that many!":goto buy.can1 ww=cr-(c*a):if ww<1 print \"You can't afford that many.":goto buy.can1 cr=ww:ca=ca+a:z=z-a:print \"The clerk gladly makes the transaction." goto town1 tavern print' You enter the tavern and see a few tables scattered around the room. Some tables are occupied by ragged seamen, who have obviously been doing this kind of thing for most of their lives. You approach the bar and sit down to make subtle conversation. Within a few hours, you have convinced some of the men that you are truly a captain that can conquer many islands, and find much wealth.'; if rn<2 print ' But the hours grow long, and you decide it is time to set sail once again.':goto town1 print ' Some of the men seem interested in joining you on your journey.' print "And "rn" men wish to join your crew. Do you accept? "; gosub get.key:if i$<>"Y" print "No":goto town1 print "Yes":me=me+rn:rn=0:goto town1