; army.seg.s ; Started on 07/04/87 ; for ACOS by -DC- ; flag(6) = create army access ; flag(7) = army commander public start open #1,"i:armies":a=mark(1):close if a create "i:armies" print sc$\"Danger: "sn$" combat area!" print "Seg status: ABANDONED" start on nocar goto no.car if clock(2) print \"["(clock(2)-clock(1))/60":"; if clock(2) 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$"] "; input @1 "Command? " i$:i$=left$(i$,2) if i$="QU" goto link.main if i$="CR" goto create if i$="LI" goto list if i$="JO" goto join if i$="LM" goto lmembers if i$="DE" goto desert if i$="BA" goto bat.log if i$="LO" goto log.off if i$="?" f$="i:army.hlp":gosub show.file:goto start if not flag(7) print \"Invalid entry":goto start if i$="RE" goto remove if i$="AT" goto attack if i$="GI" goto distribute if i$="DI" goto disband if i$="SH" goto show.army if i$="CH" goto change if (i$="KI") and (info(5)) goto kill.army print \"Invalid entry":goto start log.off input @0 \"Ready to log-off? [y/n]: " i$:if i$="Y" link "a:main.seg","termin2" goto start link.main link "a:games.seg","fromsys" no.car link "a:main.seg","term1" show.file setint(1):copy f$:setint(""):return change print \"Change Your Pay"\ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print "Error - No armies found":goto start for b=1 to a:position #1,42,b:input #1,gn,i$,x,x,p1 if gn=un x=b:b=a:next:close:goto ch1 next:close:print "Error - Your army was not found":goto start ch1 print "Current pay is: "p1 input @2 "Change to: "a if (a<1) or (a>999) goto start open #1,"i:armies":position #1,42,x:input #1,gh,i$,p1,p2,gh position #1,42,x:print #1,un,i$,p1,p2,a:close goto start show.army print \"Show Your Army's Status"\ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print "Error - No armies found":goto start for b=1 to a:position #1,42,b:input #1,gn,i$,a1,a2,p1 if gn=un x=b:b=a:next:close:goto show2 next:close:print "Error - Your army was not found":goto start show2 print "Name: "i$\"Wins: "a1" Losses: "a2;:if a1>0 print " "(a1*100)/a2"%"; print \"Current pay: "p1 f$="i:army"+str$(x):open #1,f$:position #1,4,0:input #1,a print "Highest # of soldiers ever recorded: "a-1 a1=0:for b=1 to a:position #1,4,b:input #1,us if (not us) or (us=un) next:goto show3 a1=a1+1:next show3 print "Current number of soliders: "a1; if a1>3 print " (Full)"; a1=0:a2=0:print \\"Soldiers:" for b=1 to a:position #1,4,b:input #1,us if not us next:close:goto start f$="f:u."+str$(us):open #2,f$:position #2,5,2:input #2,bb close #2:open #2,"b:users":position #2,64,us input #2,a$,b$:close #2:print chr$(32,10)a$" "b$" (#"us")" print chr$(32,11)"Having "bb" credits." a1=a1+(bb/10000) a2=a2+(bb-((bb/10000)*10000)) if a2>9999 a1=a1+1:a2=a2+(((bb/10000)*10000)-bb) next:close print \"Total credits: ":if a1 print a1; print right$("000"+str$(a2),4) goto start disband print \"Disband Your Army"\ input @2 "Are you sure? [y/n]: " i$:if i$<>"Y" goto start open #1,"i:armies":position #1,42,0:input #1,a if not a close:print \"Error - No armies found":goto start for b=1 to a:position #1,42,b:input #1,gn,i$,x,x,x if gn=un x=b:b=a:next:close:goto band1 next:close:print \"Error - Your army was not found":goto start band1 flag(7)=0:open #1,"i:armies":position #1,42,x:print #1,"0,EMPTY,0,0":close f$="i:army"+str$(x):kill f$ print \"Your army has been disbanded":goto start bat.log print \"Battle Logs"\ open #1,"i:army.log":input #1,a:close if not a print "No battles to show":goto start print "Last battle was in log #"a bat1 input @2 \"Show log [1-9] #" x:if not x goto start if (x<1) or (x>9) goto start print:f$="i:log"+str$(x):open #1,f$:a=mark(1):close if a print \"Log entry does not exist":goto bat1 gosub show.file:goto bat1 distribute print \"Give Credits to Soldiers"\ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print "Error - No armies created!":goto start for b=1 to a:position #1,42,b:input #1,gn,i$,x,x,x if gn=un x=b:b=a:next:close:goto di1 next:close:print "Error - Your army was not found":goto start di1 f$="f:u."+str$(un):open #1,f$:position #1,5,2:input #1,bb:close a1=0:if (bb<2) and (not flag(4)) and (not info(5)) print "You haven't got enough credits!":goto start f$="i:army"+str$(x):open #1,f$:position #1,4,0:input #1,a for b=1 to a:position #1,4,b:input #1,us:if us a1=a1+1 next:close:if not a1 print "You don't have any soldiers in your army!":goto start a1=a1-1:print "You have "bb" credits, and "a1" soldiers." input @2 "Distribute how many credits? " a:if a<1 goto start if ((a/a1)<2) and (not flag(4)) and (not info(5)) print \"Error - Invalid amount":goto start print \"This gives each soldier "a/a1" credits." print "Hang on..."; i$="f:u."+str$(un):open #1,i$:position #1,5,2:input #1,x if (not flag(4)) and (not info(5)) x=x-a position #1,5,2:print #1,x:close open #1,f$:position #1,4,0:input #1,x for b=1 to x:position #1,4,b:input #1,us if (not us) or (us=un) next:close:print "done":goto start f$="f:u."+str$(us):open #2,f$:position #2,5,2 input #2,bb:bb=bb+(a/a1):if bb>9500 bb=9500 position #2,5,2:print #2,bb:close #2 edit(0):ready "e:gmail":print #msg(us),un print #6,"Letter From -%>Army Headquarters" print #6,"Date Mailed -%>"date$" "time$\ print #6,a1$" "a2$" gave you "a/a1" credits." copy #8,#6:print #msg(us),chr$(4);chr$(0); msg(us)=1:update next:close:print "done":goto start kill.army print \"Kill Army"\ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print "Error - No armies to delete!":goto start for b=1 to a:position #1,42,b:input #1,gn,i$,x,x,x print "#"b"] "i$:next:close input @2 \"Kill army #" x2:if (not x2) or (x2>a) goto start open #1,"i:armies":position #1,42,x2:print #1,"0,EMPTY,0,0":close f$="i:army"+str$(x2):kill f$ print \"Army has been deleted":goto start create print \"Create an Army"\ if not flag(6) print "Unauthorized - Need SysOp approval":goto start f$="f:u."+str$(un):open #1,f$:position #1,5,2:input #1,a:close if (a<100) and (not flag(4)) print "You must have at least 100 credits"\"to create an army.":goto start input @0 "One time only -- Proceed? " i$:if i$<>"Y" goto start if not info(5) flag(6)=0 flag(7)=1:open #1,"i:armies":position #1,42,0:input #1,a if not a a=1:x=a:goto c1 for b=1 to a:position #1,42,b:input #1,a1,i$,a1,a1,a1:if i$="EMPTY" x=b:goto c1 next:a=a+1:x=a c1 position #1,42,0:print #1,a input @3 \"Enter name of army: " i$:if len(i$)>30 print \"Too long, max=30":goto c1 if len(i$)<5 print \"Too small, min=5":goto c1 input "Enter pay for each battle: "p1 position #1,42,x:print #1,un,i$,"0000","0000",p1:close f$="i:army"+str$(x):kill f$:create f$ open #1,f$:position #1,4,0:print #1,"1" position #1,4,1:print #1,un:close print \"Army created... good luck!":goto start remove print \"Remove a User"\ input @2 "User # to remove: " a:if not a goto start open #1,"i:armies":position #1,42,0:input #1,x for b=1 to x:position #1,42,b:input #1,bb,i$,a1,a1,a1:if bb=un gf=b:b=x:next:close:goto r1 next:close print \"Error - Your army was not found!":goto start r1 f$="i:army"+str$(gf):open #1,f$:position #1,4,0:input #1,x for b=1 to x:position #1,4,b:input #1,bb:if bb=a gf=b:b=x:next:goto r2 next:close print \"Error - User # not found":goto start r2 position #1,4,gf:print #1,"0":close:edit(0) ready "e:gmail":print #msg(a),"1"\"Letter From -%>Army Headquarters" print #6,"Date Mailed -%>"date$" "time$\ print #6,"You have been removed from "i$"." copy #8,#6:print #msg(a),chr$(4);chr$(0);:msg(a)=1:update print \"User has been removed":goto start list print \"List Armies"\ print "Name of army"chr$(32,18)"|Wins|Loss|Perc|Pay" if not flag(32) print chr$(45,49):else print p$;chr$(211,49);n$ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print \"No armies created!":goto start for b=1 to a:position #1,42,b:input #1,bb,i$,av,gf,p1 if not gf pt$="100%":goto per pt$=str$((av*100)/gf)+"%" if len(pt$)<4 pt$="000"+pt$:pt$=right$(pt$,4) per a$="0000"+str$(av):a$=right$(a$,4):x$="0000"+str$(gf):x$=right$(x$,4) if i$<>"EMPTY" i$=i$+chr$(32,30):print left$(i$,30)"|"a$"|"x$"|"pt$"|"p1 next:close:goto start join print \"Join an Army"\ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print \"No armies created!":goto start for b=1 to a:position #1,42,b:input #1,gn,i$,x,x,x if i$<>"EMPTY" print "#"b"] "i$ next:close input @2 \"Join #" x:if not x goto start if (x>a) or (x<1) goto start open #1,"i:armies":position #1,42,x:input #1,bb,i$,a,a if i$="EMPTY" close:print \"Error - Invalid selection!":goto start close:f$="i:army"+str$(x) open #1,f$:position #1,4,0:input #1,bb if not bb x=1:position #1,4,0:print #1,x:goto j1 for b=1 to bb:position #1,4,b:input #1,gf if gf=un print \"Error - Already in this army!":b=bb:next:close:goto start if not gf x=b:b=bb:next:goto j1 next:x=bb+1:if x>5 close:print \"Error - This army is full":goto start position #1,4,0:print #1,x j1 if x>5 close:print \"Error - This army is full":goto start position #1,4,x:print #1,un:close ready "e:gmail":edit(0) print #msg(gn),"1"\"Letter From -%>Army Headquarters" print #6,"Date Mailed -%>"date$" "time$\ print #6,a1$" "a2$" (#"un") has joined your army." copy #8,#6:print #msg(gn),chr$(4);chr$(0);:msg(gn)=1:update print \"You have joined "i$:goto start desert print \"Desert an Army"\ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print "No armies created!":goto start for b=1 to a:position #1,42,b:input #1,x,i$,x,x,x if i$<>"EMPTY" print "#"b"] "i$ next:close input @2 \"Desert #" x:if (x<1) or (x>a) goto start open #1,"i:armies":position #1,42,x:input #1,gn,i$,a,a,a:close if i$="EMPTY" print \"Error - Invalid selection":goto start f$="i:army"+str$(x):open #1,f$:position #1,4,0:input #1,a if not a close:print \"Error - Nobody in this army":goto start for b=1 to a:position #1,4,b:input #1,x if x=un x=b:b=a:next:position #1,4,x:print #1,"0":close:goto des1 next:close:print \"Error - You are not in this army":goto start des1 edit(0):ready "e:gmail":print #msg(gn),un print #6,"Letter From -%>Army Headquarters" print #6,"Date Mailed -%>"date$" "time$\ print #6,a1$" "a2$" (#"un") has deserted your army." copy #8,#6:print #msg(gn),chr$(4);chr$(0); msg(gn)=1:update print \"You have been removed from "i$:goto start lmembers print \"List Armies With Members"\ open #1,"i:armies":position #1,42,0:input #1,a if not a close:print "Error - No armies to list!":goto start for b=1 to a:position #1,42,b:input #1,gf,i$,x,x,x if i$="EMPTY" next:close:goto start print "Army #"b": "i$\"General is user #"gf\ setint(1):print " Members:":setint(""):if key(1) b=a:next:close:goto start f$="i:army"+str$(b):open #2,f$:position #2,4,0:input #2,z if not z print "":close #2:next:close:goto start for x=1 to z:position #2,4,x:input #2,gf if not gf next:close #2:print:next:close:goto start close #1:open #1,"b:users":position #1,64,gf input #1,a$,i$:close #1:open #1,"i:armies" if not a$ print chr$(32,11)"<< Deleted >>" if not a$ position #2,4,x:print #2,"0":next:close #2:print:next:close #1:goto start print chr$(32,11)a$" "i$" (#"gf")":next:close #2:print:next:close #1:goto start attack link "a:army2.seg"