home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-11-27 | 49.7 KB | 1,941 lines |
- /*
- >**** 3meg RAM version ****< Do not alter any part of this window at top!!
- Mega-Wars I v1.2a by Rich Deck (aka The Caretaker) of The Lost City AMIGA BBS
- 313-274-1917 * 313-561-1399 300/1200/2400 baud on both ports
- ==========================================================================
- © 1990 Richard D. Deck. All Rights Reserved. Distribution of this program
- without the expressed written consent of the author is in direct violation
- of strict Copyright laws.
- ==========================================================================
- Note: This program was written for C-Net Amiga and was not intended to run
- on any program BUT C-Net Amiga.
- */
- options results
- signal on error
- signal on syntax
- signal on ioerr
- signal on halt
- Getuser23;Port=Result
- Mem=GetClip('RAM'||Port);Jv=SetClip('RAM'||Port,'')
- Call INITIAL;Call BEGA
- Call LGAME;Quit=0
- Do Until Quit=1
- Call SETCOM
- Sendstring Ques
- Call INPUT
- Call COMMANDS
- End
- Signal Bye
- RAT:
- Arg Z,ZA
- ZB=int(abs(Z)/ZA*1000+.5)/10
- ZC='-';if Z >= 0 then ZC='+'
- if ZB=int(ZB) then ZB=ZB||'.0'
- ZB=ZC||ZB
- drop Z ZA ZC
- return ZB
- TEXT:
- arg Z,ZA
- WA=GetClip('Text.'Z);V=lastpos('%d',WA);t0=words(ZA)
- do while V~=0
- da=word(ZA,t0);if datatype(da,'N')~=1 then da=Up(da)
- if t0=1&left(ZA,1)=' ' then da=' '||da
- WB=left(WA,V-1)||da||right(WA,(length(WA)-V-1));WA=WB
- V=lastpos('%d',WA);t0=t0-1
- end;drop V ZA Z t0 DA
- return WA
- CLOAK_FIND:
- if (DevFnd=0 & random(1,1000,time('s'))>Num.3) then do
- transmit text(162,0) text(163,0) text(164,0)
- DevFnd=Stdt+45
- end
- return
- UP:
- arg ZB
- ch=' .:,&*()\';n1=0
- do i0=2 to length(ZB)
- ZC=right(left(ZB,i0),1)
- if lastpos(ZC,ch)~=0 then n1=1
- else if c2d(ZC)>64&c2d(ZC)<91 then do
- if n1=0 then do
- ZC=d2c(c2d(ZC)+32)
- ZB=left(ZB,i0-1)||ZC||right(ZB,(length(ZB)-i0))
- end
- n1=0
- end
- end;drop n1 ZC CH I0
- return ZB
- NB:
- arg ZS
- ZT=datatype(ZS,'N')
- drop ZS
- return ZT
- PLAYDELAY:
- z1=0;do until GetClip('Playing')~=1
- z1=z1+1;if z1>800 then Jv=SetClip('Playing','')
- end;Jv=SetClip('Playing',1)
- return
- MID:
- arg Schtuff,Strt,Lth
- Schtuff=right(Schtuff,(length(Schtuff)-Strt+1))
- if Lth~= 0 then Schtuff=left(Schtuff,Lth)
- drop Lth Strt
- return Schtuff
- COMPNAME:
- Temp=UName;UName='';do until Temp=''
- s=left(Temp,1);if s='.' then s=''
- else if s=' ' then s='.'
- UName=UName||s
- Temp=right(Temp,(length(Temp)-1))
- end
- return
- FIRSTPOS:
- arg Z,ZA
- ZC=0;ZB=1;do while (ZB <= length(ZA) & ZC=0)
- ZC=lastpos(Z,ZA,ZB);ZB=ZB+1
- end;drop Z ZA ZB
- return ZC
- SDSC:
- arg L0,L1
- Po3=Po3+L0;p1.l1=p1.l1+l0;p2.l1=p2.l1+l0
- z1=0;do until getclip('Sides.'Game)~=1
- if Z1>600 then Jv=SetClip('Sides.'Game,'')
- end;Jv=SetClip('Sides.'Game,1)
- Anz=GetClip('Score.'Game Side)
- l2=word(Anz,L1);l2=l2+l0
- Ant='';do l3=1 to 8
- if l3=l1 then Ant=Ant||l2' '
- else Ant=Ant||word(Anz,l3)' '
- end
- Jv=SetClip('Score.'Game Side,Ant)
- Jv=SetClip('Sides.'Game,'')
- drop l0 l1 l2 l3 Anz Ant
- return 0
- BUF:
- checkio;Anz=result;if (Anz=1 & length(SA)<201) then do
- receive;Anz=result;SA=SA||upper(Anz)||'/'
- end;drop Anz
- return
- INITTAR:
- TAR=0;Cond='\c5Green';drop TGT.
- call PlayIII;if length(String) > 1 then do
- do i=1 to length(string)
- Var=mid(String,i,1);if (Var~=Init & GetClip(Game||Var)~=1) then do
- inn=GetClip('Stats.'Var)
- TX=word(inn,6);TY=word(inn,7);TShip=word(inn,1)
- if ((abs(TX-XC)<=10 & abs(TY-YC)<=10)&(lastpos(Var,Enemy)~=0)) then do
- TAR=TAR+1
- TGT.TAR=TShip' @'||TX||'-'||TY||' '||(TX-XC)||','||(TY-YC)||'; '
- TGT.TAR=TGT.TAR||Rat(word(inn,2),word(inn,3))'%'
- end
- end
- end
- end
- Max=getclip('Planets.'Ene'.0');if Max > 0 then do
- do i=1 to Max
- inn=getclip('Planets.'Ene'.'i)
- if words(inn)=3 then do
- parse var inn TX TY Bds
- if (abs(TX-XC) <= 10 & abs(TY-YC) <= 10) then do
- TAR=TAR + 1
- Dum='';if word(inn,3) > 0 then Dum='('word(inn,3)')'
- TGT.TAR=Ene||' Planet'Dum' @'||TX||'-'||TY||' '||(TX-XC)||','||(TY-YC)
- end
- end
- end
- end
- Max=getclip('Bases.'Ene'.0');if Max > 0 then do
- do i=1 to Max
- inn=getclip('Bases.'Ene'.'i)
- if words(inn)=3 then do
- parse var inn TX TY Egy
- if (abs(TX-XC) <= 10 & abs(TY-YC) <= 10) then do
- TAR=TAR + 1
- TGT.TAR=Ene||' Base @'||TX||'-'||TY||' '||(TX-XC)||','||(TY-YC)||'; '||Rat(Egy,11000)||'%'
- end
- end
- end
- end
- Max=GetClip('Planets.Neu.0');if Max > 0 then do
- do i=1 to Max
- inn=GetClip('Planets.Neu.'i)
- if words(inn)=2 then do;TX=word(inn,1);TY=word(inn,2)
- if (abs(TX-XC) <= 10 & abs(TY-YC) <= 10) then do
- TAR=TAR+1;TGT.TAR='Neu Planet @'||TX||'-'TY' '||(TX-XC)','||(TY-YC)
- end
- end
- end
- end
- if TAR > 0 then Cond='\c7Yellow';if (att=1&TAR>0) then Cond='\c2Red'
- if Dock=1 then Cond=Cond||'\c1+\c3Docked'
- if ClkCtr=1 then Cond=Cond||'\c1+\c4Cloaked'
- return
- ATTA:
- if TAR > 0 then do
- transmit ''
- ok=0;tri=0;do until ok=1
- Jv=random(1,TAR,time('s'));tri=tri+1
- if ((lastpos('Planet',TGT.Jv) ~= 0 | lastpos('Base',TGT.Jv) ~= 0)|tri > 5) then Ok=1
- end
- DA1=abs(55.3/(Shields/MaxS))+random(1,3,time('s'))*0.571
- if Shields < 1 then Da1=Da1 * 3.35
- Da1=int(Da1*10+.5)/10
- if lastpos('Base',TGT.Jv) ~= 0 then Da1=Da1 * 2
- Msg=left(TGT.Jv,(lastpos(' ',TGT.Jv)));Dum=lastpos('+',TGT.Jv)
- if Dum ~= 0 then Msg=Msg||right(TGT.Jv,(length(TGT.Jv)-Dum+1))' '
- Msg=Msg||'makes 'Da1' unit phaser hit on\n1'Ship' @'XC'-'YC', '
- Msh=''
- If (ShdC='raised' & Shields <= 0)|(ShdC='lowered') then
- Energy=int(Energy) - Da1
- else Shields=Shields - (Da1*1.82)
- Msg=Msg||Rat(Shields,MaxS)||'%';Msi=''
- transmit '\n1\c2'Msg;Call SENDMES;att=1;call SHIPEE
- Cond='\c2Red';if Dock=1 then Cond=Cond||'\c1+\c3Docked'
- Z3=(Rat(Shields,MaxS)*random(1,500,time('s')))/100
- if Z3 < 50 then call DAMPICK;sendstring Col
- if Ques~='' then call SETCOM;sendstring Ques
- end
- return
- DELFILE:
- arg Z
- if exists(Z) then address command 'Delete "'Z'"'
- call Open(fng,Z,'W')
- return Z
- CHECKIT:
- arg Z
- getcarrier;if result="FALSE" then Z=1
- else Z=0
- return Z
- RFILE:
- arg Z
- if exists(Path||'tt'TermType'.'Z) then sendfile Path||'tt'TermType'.'Z
- else if exists(Path||Z) then sendfile Path||Z
- else if exists(Z) then sendfile Z
- return 0
- FILEO:
- arg Z
- if exists(Z) then call Open(fnh,Z,'A')
- else call Open(fnh,Z,'W')
- return 0
- FILEM:
- arg Z;ZA=right(Z,1);z1=0
- do until GetClip('Reading.'ZA) ~= 1
- z1=z1+1;if z1>500 then Jv=SetClip('Reading.'ZA,'')
- end
- if GetClip('Message.'ZA) ~= 1 then call Open(fnh,Z,'W')
- else call Open(fnh,Z,'A')
- Jv=SetClip('Reading.'ZA,1);drop ZA
- return 0
- MSGWAIT:
- if GetClip('Message.'Init)=1 then do;z1=0
- do until GetClip('Reading.'Init) ~= 1
- Z1=Z1+1;if Z1>500 then Jv=SetClip('Reading.'Init,'')
- end
- Jv=SetClip('Reading.'Init,1);if exists(PathM'Message.'Init) then do
- transmit '\c3';sendfile PathM'Message.'Init
- drop inn;inn=GetClip('Command.'Init)
- if inn~='INN' & length(compress(inn))>1 then do
- Com=inn;POS=firstpos('/',Com);if POS~=0 then do
- SA=right(Com,length(Com)-POS)
- Com=left(Com,POS-1)
- end
- Jv=SetClip('Command.'Init,'');call COMMANDS
- end
- sendstring Ques;Jv=SetClip('Message.'Init,'')
- end
- end;Jv=SetClip('Reading.'Init,'')
- inn=GetClip('Stats.'Init);Shields=word(inn,2);Energy=word(inn,4)
- if exists('Mail:_olm'Port) then do
- BBSCOMMAND '';Sendstring Ques
- end
- if random(1,1000,time('s'))<Num.2 then call ACHMSG
- return
- ACHMSG:
- if Ach>0 then do
- transmit '\c3'
- do until (Num>0&Num<=Ach)
- Num=random(0,(Ach+15),time('s'))
- end
- transmit text(1,(text(2,0)))
- inn=GetClip('Acherons.'Num)
- transmit inn;ba=getclip('Bases.'Ene'.0');pl=getclip('Planets.'Ene'.0')
- if ba+pl>0 then do
- if ba>0 then do
- Jv=random(1,ba,time('s'))
- data='base';line=getclip('Bases.'Ene'.'Jv)
- end
- else do
- Jv=random(1,pl,time('s'))
- data='planet';line=getclip('Planets.'Ene'.'Jv)
- end
- transmit text(3,(Ene data word(line,1)'-'word(line,2)))
- sendstring Ques
- end
- end
- return
- SETTOG:
- if NB(lev)=1 then lev=1-lev
- else lev=1
- return
- SETCOM:
- if lev~=1 then do
- Tm='';lev=0;if Shields < 1000 then Tm='S'
- if Energy < 1000 then Tm=Tm||'E';if Dock=1 then Tm=Tm||'D'
- if TAR>0 then Tm=Tm||'#'||TAR
- if Tm~='' then Tm=' (\c1'||Tm||left(Cond,3)')'
- Ques=left(Cond,3)||text(5,Tm)||Col
- end
- else Ques=left(Cond,3)||text(6,0)
- Ques=Ques||' '
- return
- INPUT:
- if CheckIt(1)=1 then signal Bye
- Energy=int(Energy*10+.5)/10
- if Energy <= 10 then do
- transmit text(7,Ship);Quit=1
- signal Bye
- end
- if SA ~= '' then do
- Com=SA;POS=firstpos('/',Com)
- if POS ~= 0 then do
- SA=right(Com,length(Com)-POS)
- Com=left(Com,POS-1)
- end
- else SA=''
- if left(Com,1)='<' then Com=LastCom
- transmit '';LastCom=Com
- Ques='';call MSGWAIT;signal DONE
- end
- Is=0;do until Is=1
- if Checkit(1)=1 then signal Bye
- checkio;if result then do;receive
- Com=upper(result);Is=1;Ques=''
- POS=firstpos('/',Com)
- if POS ~= 0 then do
- SA=right(Com,length(Com)-POS)
- Com=left(Com,POS-1)
- end
- if left(Com,1)='<' then Com=LastCom
- end
- call MSGWAIT
- if (TAR > 0)&(random(1,150,(time('S'))) < (TAR*Num.1)) then call ATTA
- end
- DONE:
- inn=GetClip('Stats.'Init);Shields=word(inn,2);Energy=word(inn,4)
- return
- INITIAL:
- Path='PFiles:MWars/'
- PathP=Path'Players/'
- PathG=Path'Games/'
- PathM='RAM:MWars/'
- PathS=Path'Ships/'
- PathT=Path'Text/'
- getuser41;SNbr=Result
- getuser 1;UName=Result;call COMPNAME
- getuser17;Sys=Result
- getuser28;TermType=Result
- getuser22;Calls=Result
- getuser27;Colms=Result
- getuser12;Date=result
- Date=compress(mid(Date,5,6))
- /* Variable Declarations */
- ve='Mega-Wars I v1.2a';BBS='C-Net Amiga' /* "BBS" is your BBS Name */
- OSP=0;DEF=7;GAGL='.';LCH=6;Dock=0;att=0
- do i=1 to 8;p1.i=0.0;p2.i=0.0;end
- do i=1 to 51;form=form||' ';end;form=form||'::'
- LastCom='ST';Col='\c5';SA='SH RA'
- Cloak=0;ClkCtr=0;DevFnd=0
- CShips='LNRSV';EShips='DGHTW'
- if exists(Path'MW.Config') then do
- call open(fnn,Path'MW.Config','R')
- do i=1 to 3
- inn=readln(fnn)
- Num.i=left(inn,(firstpos(';',inn)-1))
- end
- call close fnn
- end
- else do
- Num.1=2.39;Num.2=35;Num.3=800
- end
- if ~exists(PathP||SNbr) then do
- sendfile Path'Information'
- transmit text(14,0)
- call Open(fnn,PathP||SNbr,'W')
- txt='0.0 Cadet 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0'
- Jv=writeln(fnn,txt)
- call close fnn
- end
- call Open(fnn,PathP||SNbr,'R')
- inn=readln(fnn)
- Po3=0.0;Rank=word(inn,2)
- do i=1 to 8;p1.i=word(inn,(2+i))
- a=lastpos('.',p1.i);if a~=0 then do
- if a=length(p1.i) then p1.i=p1.i||'0'
- else if a~=(length(p1.i)-1) then do
- do until a=(length(p1.i)-1)
- p1.i=left(p1.i,(length(p1.i)-1))
- a=lastpos('.',p1.i)
- end
- end
- end
- else p1.i=p1.i||'.0'
- Po3=Po3+p1.i
- end
- if words(inn)~=12 then Ch_Perm=''
- else do
- if word(inn,12)=upper(Date) then Ch_Perm=word(inn,11)
- end
- Rank=compress(Rank)
- call close fnn
- z1=0;do until GetClip('AchDelay')~=1
- z1=z1+1;if z1>50000 then Jv=SetClip('AchDelay','')
- end;Jv=SetClip('AchDelay',1)
- Ach=GetClip('Acherons.0');if Ach<1 then Ach=0
- if Ach=0 then do
- if exists(PathT'sys.Acherons') then do
- call open(fnn,PathT'sys.Acherons','R')
- do until eof(fnn)
- inn=readln(fnn);if words(inn)>1 then do
- Ach=Ach+1;Jv=SetClip('Acherons.'Ach,inn)
- end
- end
- call close fnn
- Jv=SetClip('Acherons.0',Ach)
- end
- end;Jv=SetClip('AchDelay','')
- z1=0;do until GetClip('TextDelay')~=1
- Z1=Z1+1;if z1>70000000 then jv=setclip('TextDelay','')
- end;Jv=setclip('TextDelay',1)
- MxTxt=GetClip('Text.0');if MxTxt<1 then MxTxt=0
- if MxTxt=0 then do
- call open(fnn,PathT'MW.Gametext','R')
- do until eof(fnn)
- inn=readln(fnn);if length(inn)>1 then do
- MxTxt=MxTxt+1;Jv=SetClip('Text.'MxTxt,inn)
- end
- end
- call close fnn
- Jv=SetClip('Text.0',MxTxt)
- end
- Jv=SetClip('TextDelay','')
- do i=1 to 6;Da.i=0;device.i=text((7+i),0);end;TDa=0.0
- if Po3 < 20000.0 then Rk=text(16,0)
- else if Po3 < 110000.0 then Rk=text(17,0)
- else if Po3 < 600000.0 then Rk=text(18,0)
- else Rk=text(19,0)
- if Rk~=Rank then do
- Rank=Rk
- transmit text(20,Rk)
- address command 'Delete "'PathP||SNbr'"'
- call Open(fnn,PathP||SNbr,'W')
- JV=writech(fnn,Po3 Rank' ')
- do i=1 to 8;Jv=writech(fnn,p1.i' ');end;Jv=writeln(fnn,'')
- call close fnn
- end
- return
- INT:
- arg c
- if c=0.0 then c=0
- if c<.0001 then return c
- if datatype(c,w)~=1 then c=trunc(c)
- return c
- RDM:
- do until ((X>0)&(X<76))
- X=random(0,100,(time('S')));X=X-6
- end
- do until ((Y>0)&(Y<76))
- Y=random(0,100,(time('S')));Y=Y-6
- end
- return
- LGAME:
- call SHIPINIT
- Game=1
- if exists(PathG||Game) then do
- transmit text(21,0)
- call PlayIII;if string=Init then call BEGB
- Leave=0;call SPACE
- do until Leave=1
- call RDM;jv=seek(Space,((y-1)*75+x-1),'B')
- inn=readch(Space);if inn='.' then Leave=1
- end
- jv=seek(Space,((y-1)*75+x-1),'B');XC=X;YC=Y
- if writech(Space,Init) < 1 then signal Bye
- OSP=0;call close Space;call SHIPEE;call INITTAR
- end
- else do
- transmit text(22,0) text(23,0)
- if Sys=1 then transmit text(24,0)
- signal Bye
- end
- return
- BYE:
- call close fng
- call close fnn
- call close Space;OSP=0
- drop form
- if XC ~= 'XC' then if (XC+YC) > 1 then do
- call POINTCH;call Open(fnn,PathM||Game,'R')
- jv=seek(fnn,((YC-1)*75+XC-1),'B')
- Jv=writech(fnn,'.')
- call close fnn
- end
- call PlayII
- exit
- LAST:
- LastCom=Com
- return
- COMMANDS:
- Com1=Word(Com,1);NCom=Words(Com)
- if length(Com1) > 2 then Com1=left(Com1,2)
- select
- when Com1='SC' then call SCAN
- when (left(Com1,1)='Q') then Quit=1
- when (Com1='?') then call Menu
- when (Com1='H' | Com1='HE') then sendfile Path'MW.Help'
- when Com1='MO' then call MOVE
- when Com1='ST' then call STATUS
- when Com1='RA' then call RAD
- when Com1='US' then call Playing
- when Com1='TE' then call TELL
- when Com1='SH' then call ShieldC
- when Com1='PO' then call POINTCH
- when Com1='EN' then call ENTRAN
- when Com1='LI' then call LISTING
- when Com1='CA' then call CAPTURE
- when Com1='HI' then call HISCORES
- when Com1='BU' then call BUILD
- when Com1='TA' then call TARGTS
- when Com1='DO' then call DOCKSH
- when Com1='RE' then call REPAIRSH
- when Com1='DA' then call DAMRPT
- when Com1='PH' then call PHASERS
- when Com1='OL' then do
- transmit text(25,0) text(26,0)
- BBSCOMMAND Com;call LAST
- end
- when Com1='IN' then sendfile Path'Information'
- when Com1='ME' then call MEMMAN
- when Com1='TO' then call TORPFI
- when Com1='SE' then call SETTOG
- otherwise BBSCOMMAND Com1
- end
- return
- MENU:
- file=Path||'Sys.Menu'
- if exists(File) then sendfile File
- else do
- file=Path||'tt'||TermType||'.Menu'
- if exists(File) then sendfile File
- end
- return
- SCAN:
- if (Da.4 >= 75) then Jv=Dam(4)
- else do
- call SPACE;Energy=Energy-MveE
- transmit ''
- if NCom < 2 then do
- if Def < 2 | Def > 15 then Def=7
- end
- else do
- Ans=Word(Com,2)
- if NB(Ans) ~=1 then Def=7
- else do
- if Ans < 2 | Ans > 15 then Ans=7
- Def=Ans
- end
- end
- sendstring ' '||left(Cond,3)
- XStart=XC-Def;XEnd=XC+Def
- YStart=YC-Def;YEnd=YC+Def
- if XStart < 1 then XStart=1
- if YStart < 1 then YStart=1
- if XEnd > 75 then XEnd=75
- if YEnd > 75 then YEnd=75
- do i=XStart to XEnd by 2
- sendstring right(i,2)' '
- end;transmit ''
- do Y=YEnd to YStart by -1
- jv=seek(Space,((Y-1)*75+XStart-1),'B')
- inn=readch(Space,((abs(XEnd-XStart))+1))
- sendstring left(Cond,3)||right(Y,2)||' \z1\c6'
- do l=1 to length(inn)
- Jk=mid(inn,l,1);if datatype(Jk,'N')=1 then Jk=word(Junk,Jk)
- sendstring right(Jk,2)
- end
- transmit '\z0 '||left(Cond,3)||right(Y,2)
- checkio;Z=result;if Z=1 then leave
- end
- sendstring ' '||left(Cond,3);do i=XStart to XEnd by 2
- sendstring right(i,2)' '
- end;transmit ''
- end
- OSP=0;call close SPACE
- return
- SPACE:
- if OSP ~= 1 then do
- OSP=1
- call Open(Space,PathM||Game,'R')
- end
- return
- DUH:
- transmit text(27,0)
- return
- UP_POS:
- jv=seek(Space,((YC-1)*75+XC-1),'B')
- VBN=Init;if ClkCtr=1 then VBN=6
- JV=writech(Space,VBN)
- return
- MOVE:
- call SPACE;call LAST;MX=MaxX;MY=MaxY
- if NCom < 3 then signal ASK
- if word(Com,2)='R' then do
- if (words(Com) ~= 4)|(NB(word(Com,3))~=1)|(NB(word(Com,4))~=1) then signal ASK
- TX=Word(Com,3);TY=Word(Com,4)
- if abs(TX) > MaxX then signal DUH
- if abs(TY) > MaxY then signal DUH
- signal OK
- end
- else do
- if words(Com) ~= 3 then signal ASK
- A1=Word(Com,2);A2=Word(Com,3)
- if NB(A1)~=1 | NB(A2)~=1 then signal ASK
- if ((abs(A1-XC) <= MaxX) & (abs(A2-YC) <= MaxY)) then do
- TX=A1-XC;TY=A2-YC;signal OK
- end
- ASK:
- query||text(28,0)||' ';Ans=result
- if NB(Ans) ~= 1 then Ans=0
- if (Ans<1 | abs(XC-Ans) > MaxX) then signal DUH
- else TX=Ans - XC
- query||text(29,0)||' ';Ans=result
- if NB(Ans) ~= 1 then Ans=0
- if (Ans<1 | abs(YC-Ans) > MaxX) then signal DUH
- else TY=Ans - YC
- OK:
- TY=int(TY);TX=int(TX)
- if ((YC+TY > 75) | (YC+TY < 1) | (XC+TX < 1) | (XC+TX > 75)) then do
- transmit text(30,0)
- signal DONE
- end
- if Da.1 ~= 0 then do
- MX=MaxX-int(Da.1/100)
- if MX<1 then MX=0
- if TX>MX|TY>MX then do
- transmit text(31,0)||text(32,MX)
- if MX=0 then transmit text(33,0) text(34,0)
- signal DONE
- end
- end
- Leave=0;do until Leave=1
- jv=seek(Space,((YC+TY-1)*75+XC+TX-1),'B')
- IsOk=1;inn=readch(Space);if inn='.' then Leave=1
- else do
- TY=TY-1;TX=TX-1
- if (YC+TY > 75 | YC+TY < 1 | XC+TX <1 | XC+TX > 75) then do
- transmit text(35,0)
- Leave=1;IsOk=0
- end
- else transmit text(36,0)
- end
- end;if IsOk=0 then signal DONE
- jv=seek(Space,((YC-1)*75+XC-1),'B')
- JV=writech(Space,'.')
- XC=XC + TX;YC=YC + TY
- call UP_POS
- transmit text(37,(Ship XC'-'YC));Dock=0;att=0
- Jv=0;if Shields < 0 then Jv=1
- Energy=Energy - ((abs(TX)*MveE + abs(TY)*MveE)*random(1,4,time('S')))
- if ((abs(TX)+abs(TY))*random(1,3,time('s'))) > 35 then do
- transmit text(38,Col)||text(39,0)
- Da1=int(((random(1,200,time('s'))*.9811)+(Da.1/2))*10+.5)/10
- transmit text(40,Da1) text(41,(Rat(Da1,30)/100))
- Da.1=Da.1+Da1+30
- end
- call ADVST;call SHIPEE;call INITTAR
- DONE:
- OSP=0;call close SPACE
- return
- SHIPINIT:
- call Open(fnn,PathS||Ship,'R')
- inn=readln(fnn);parse var inn Energy MaxS Torps MaxT MaxX MaxY MveE
- Damage=0;Stdt=0;Cond='\c5Green';Radio='On';Shields=MaxS;MaxE=Energy
- ShdC='raised';line=Ship||' On '||Side;MxTo=Torps
- Jv=SetClip('Radio.'Init,line)
- call close fnn
- return
- STATUS:
- transmit left(text(42,0),22)'\q1'Stdt
- transmit left(text(43,0),19)'\q1'Ship||' ('||Rank||')'
- transmit left(text(44,0),19)'\q1'Cond
- transmit left(text(45,0),19)'\q1'XC||'-'||YC
- transmit left(text(46,0),19)'\q1'Torps||text(47,MaxT)
- JV=Energy;if lastpos('.',JV)=0 then JV=JV||'.0'
- transmit left(text(48,0),19)'\q1'JV
- transmit left(text(49,0),19)'\q1'TDa
- transmit left(text(50,0),19)'\q1'Rat(Shields,MaxS)||text(51,Shields)
- transmit left(text(52,0),19)'\q1'Radio
- return
- ERROR:
- x=sigl
- logentry"\z1\c6"||overlay(":: Undefined Error: "||x||" of "ve,form)"\q1"
- logentry"\o1\c3\z2"||overlay(":: Cause: "||errortext(RC),form)"\q1"
- transmit text(53,x) text(54,0)
- signal Bye
- HALT:
- transmit text(55,0)
- signal Bye
- IOERR:
- x=sigl
- logentry'\z1\c6'||overlay(':: I/O Error: '||x||' of 've,form)'\q1'
- logentry'\o1\c3\z2'||overlay(':: Cause: '||errortext(RC),form)'\q1'
- transmit text(56,x) text(54,0)
- signal Bye
- SYNTAX:
- x=sigl
- logentry'\z1\c6'||overlay(':: Syntax Error: '||x||' of '||ve,form)'\q1'
- logentry'\o1\z2\c3'||overlay(':: Cause: '||errortext(RC),form)'\q1'
- transmit text(57,x) text(54,0)
- signal Bye
- ADVST:
- Stdt=Stdt+1
- TDa=0;do i=1 to 6
- if da.i ~= 0 then do
- Da.i=Da.i-30
- if re_now=i then Da.i=Da.i-15
- if Da.i < 1 then do
- Da.i=0
- transmit text(127,0) device.i text(128,0)
- if re_now=i then re_now=0
- end
- TDa=TDa+Da.i
- end
- end
- if Stdt>=DevFnd & DevFnd>0 then do
- transmit text(165,0) text(166,0) text(167,0) text(168,0) text(169,0)
- Cloak=1;DevFnd=-1
- end
- return
- RAD:
- if NCom > 1 then Ans=word(Com,2)
- else do
- query||text(58,0)' ';Ans=result;Ans=upper(Ans)
- end
- select
- when left(Ans,2)='ON' then do
- Radio=text(59,0);GAGL='.';call UPDATE
- end
- when left(Ans,2)='OF' then do
- Radio=text(60,0);GAGL=CShips||EShips
- call UPDATE
- end
- when left(Ans,2)='GA' then do
- if NCom > 2 then Ans=word(Com,3)
- else do
- query||text(62,0)' ';Ans=result;Ans=upper(Result)
- end
- An=left(Ans,1);if c2d(An) ~= 32 then do
- if An='C' then Ans=CShips
- if An='E' then Ans=EShips
- Leave=0;do until Leave=1
- An=left(Ans,1);Ans=right(Ans,length(Ans)-1)
- if lastpos(An,'LNRSVDGHTW') ~= 0 then do
- if GAG ~= 1 then do
- Radio=text(61,0);GAG=1
- end
- Jv=lastpos(An,Radio)
- if Jv < 4 then Radio=Radio||An
- else Radio=left(Radio,Jv-1)||right(Radio,(length(Radio)-Jv))
- end
- if length(Ans) < 1 then Leave=1
- end
- if Radio=text(61,0) then do
- Radio=text(59,0);GAG=0;GAGL='.'
- end
- else do
- GAGL=right(Radio,(length(Radio)-4))
- end
- call Update
- end
- end
- otherwise transmit text(63,0)
- end
- if left(Radio,3) ~= left(text(61,0),3) then GAG=0
- return
- UPDATE:
- line=Ship GAGL Side
- Jv=SetClip('Radio.'Init,line)
- return
- PICKDELAY:
- transmit text(72,0)
- z1=0;do until GetClip('Picking')~=1
- z1=z1+1;if z1>10000 then Jv=SetClip('Picking','')
- end;Jv=SetClip('Picking',1);Pick_Del=1
- return
- BEGA:
- Jv=rfile('Welcome');call BEGC;call HISCORES;call Playing
- call PICKDELAY
- if (Ch_Perm=''|Sys=1) then do
- query||text(130,0)||text(131);Ans=result
- Ans=left(upper(Ans),1)
- end
- else Ans=left(upper(Ch_Perm),1)
- if (Ans ~='E' & Ans ~='C') then signal Bye
- if Ans='E' then do
- choices='DGHTW';Side='Emp';Junk='-- // ++ $$ @ .';Enemy='LNRSV'
- Ene='Coa';data='Kyron Empire'
- end
- else do
- choices='LNRSV';Side='Coa';Junk='++ $$ -- // @ .';Enemy='DGHTW'
- Ene='Emp';data='Coalition'
- end
- transmit text(112,0) data'.'
- File=PathS||'Ships.'||left(Side,1)||Rank
- transmit '';call PlayIII;call open(fnn,File,'R')
- do until eof(fnn)
- inn=readln(fnn);ing=left(upper(inn),1)
- if lastpos(ing,string)=0 & words(inn)=2 then transmit word(inn,1)
- end
- call close fnn
- query||text(65,0)' '
- Ans=Result;Ans=upper(left(Ans,1))
- if lastpos(Ans,choices)=0 then signal Bye
- if lastpos(Ans,string) ~= 0 then signal Bye
- Leave=0;call Open(fnn,File,'R')
- do until Leave=1
- inn=readln(fnn);parse var inn Ship M1
- if left(Ship,1)=Ans then Leave=1
- if eof(fnn) then Leave=1
- end
- call close fnn
- M1=M1+1
- transmit text(66,(Col M1 Ship))
- Init=left(Ship,1)
- call Open(fnn,PathS||'temp.'SNbr,'W')
- call Open(fng,File,'R')
- do i=1 to 5
- inn=readln(fng);parse var inn TShip TM1
- if left(TShip,1)=Init then TM1=M1
- JV=writeln(fnn,compress(TShip) compress(TM1))
- end
- call close fng
- call close fnn
- address command 'Delete "'File'"'
- stuff=PathS'temp.'SNbr'" "'File'"'
- address command 'ReName "'stuff
- call PLAYDELAY
- Jv=FILEO(Path'Playing');Jv=writeln(fnh,Ship Rank Po3 Side UName GAGL)
- call close fnh;do i=1 to 10;end;Jv=SetClip('Playing','')
- Jv=SetClip('Picking','');drop Pick_Del
- return
- HISCORES:
- if ~exists(Path'HiScores') then transmit '\n1\c2Sorry, no High Scores yet.'
- else do
- transmit text(67,0) text(68,0)
- call Open(fnn,Path'HiScores','R');did=0
- do until eof(fnn)
- inn=readln(fnn);if words(inn)=4 then do
- parse var inn HiName Ronk Score HiNbr;did=did+1
- transmit right(did,2)'. 'left(HiName,15) left(Ronk,10) Score
- end
- end
- call close fnn
- end
- sendstring '\q1'
- return
- PLAYING:
- call PLAYDELAY
- if ~exists(Path'Playing') then transmit text(69,0)
- else do
- transmit text(70,0)||text(71,0)
- call open(fnn,Path'Playing','R')
- do until eof(fnn)
- inn=readln(fnn)
- if words(inn)=6 then do
- parse var inn PShip PRank PPo3 PSide PUName PGAG
- transmit left(PShip,9) left(PUName,12) left(PRank,11) PSide' 'PPo3
- end
- end
- call close fnn
- end
- Jv=SetClip('Playing','')
- return
- PLAYII:
- transmit '\n1Leaving 've' to 'BBS'.';drop device. da. tgt. num.
- Jv=SetClip((Game||Init),'')
- if Pick_Del=1 then do
- drop Pick_Del;Jv=SetClip('Picking','')
- end
- address command 'Delete "'PathP||SNbr'"';Jv=SetClip('ReDock.'Init,'')
- if exists(PathM'Message.'Init) then
- address command 'Delete "'PathM'Message.'Init'"'
- Jv=SetClip('Reading.'Init,'');Jv=SetClip('Command.'Init,'')
- Jv=setclip('Radio.'Init,'')
- if Calls > 2 then do
- call UPHI;call open(fnn,PathP||SNbr,'W')
- if Po3>0 then Po3=int(Po3*10+.5)/10;Jv=writech(fnn,Po3 Rank' ')
- do i=1 to 8;Jv=writech(fnn,p1.i' ');end
- Jv=writeln(fnn,Side Date)
- Jv=writeln(fnn,'')
- call close fnn
- end
- Jv=SetClip('Stats.'Init,'');File=Path'Playing';Did=0
- call PLAYDELAY
- if exists(File) then do
- call open(fnn,Path'temp.'SNbr,'W')
- call Open(fng,File,'R')
- do until eof(fng)
- inn=readln(fng)
- if (word(inn,5) ~= UName) & (words(inn)=LCH) then do
- Jv=writeln(fnn,inn);did=1
- end
- end
- call close fng
- call close fnn
- address command 'Delete "'File'"';drop p1. p2.
- if did=0 then do;z1=0
- do until GetClip('Every.'Game)~=1
- z1=z1+1;if z1>4500 then Jv=SetClip('Every.'Game,'')
- end;Jv=SetClip('Every.'Game,1)
- transmit text(72,0);address command 'Delete "'Path'temp.#?" quiet'
- data.1='Coalition.';data.2='Empire.'
- do i=1 to 2;file=PathG||data.i||Game
- call open(fnn,file,'W')
- Jv=writeln(fnn,GetClip('Score.'Game left(data.i,3)))
- call close fnn
- Jv=SetClip('Score.'Game left(data.i,3),'')
- end
- NUM=GETCLIP('Acherons.0');JV=SETCLIP('Acherons.0','')
- if Num>0 then do
- DO I=1 TO NUM
- JV=SETCLIP('Acherons.'i,'')
- END
- end
- NUM=getclip('Text.0');Jv=SetClip('Text.0','')
- do i=1 to num
- Jv=SetClip('Text.'i,'')
- end
- data.1='Bases.Coa';data.2='Bases.Emp'
- data.3='Planets.Coa';data.4='Planets.Emp';data.5='Planets.Neu'
- if exists(PathM||Game) then do
- address command 'Delete "'PathG||Game'"'
- address command 'Copy "'PathM||Game'" "'PathG||Game'"'
- end
- do i=1 to 5
- if getclip(data.i'.0') > 0 then do
- if exists(Path||data.i) then
- address command 'Delete "'Path||data.i'"'
- call Open(fnn,Path||data.i,'W')
- line=GetClip(data.i'.0')
- Jv=writeln(fnn,line)
- do l=1 to getclip(data.i'.0')
- line=GetClip(data.i'.'l)
- Jv=writeln(fnn,line)
- Jv=setclip(data.i"."l,"")
- end
- call close fnn;Jv=setclip(data.i".0","")
- end
- else if exists(Path||data.i) then
- address command 'Delete "'Path||data.i'"'
- end
- address command 'Delete "'left(PathM,(length(PathM)-1))'" all quiet'
- end
- else do
- address command 'ReName "'Path'temp.'SNbr'" "'File'"'
- sendstring '\w1'
- end
- end
- Jv=SetClip('Every.'Game,'');Jv=SetClip('Playing','')
- return
- TELL:
- if NCom ~= 2 then do
- query||text(73,0)' ';Ans=result;Ans=upper(Ans)
- end
- else Ans=word(Com,2)
- An=left(Ans,1);ToWho=An
- select
- when An='C' then ToWho=CShips
- when An='E' then ToWho=EShips
- when An='A' then ToWho=CShips||EShips
- otherwise Jv=1
- end
- ToWho=compress(ToWho)
- if ToWho ~= '' then do;Max=10
- transmit text(74,0)||text(75,Max)||text(76,0)
- lines=0;End=0;do until End=1
- receive;Ans=result
- if left(Ans,1) ~= '/' then do
- lines=lines+1;txt.lines=''||Ans
- if lines >= Max then End=1
- end
- else End=1
- end;transmit ''
- Did=0;call PlayIII;Leave=0;do until Leave=1
- Ans=left(ToWho,1);if (lastpos(Ans,string) ~= 0 & lines > 0) then do
- inn=getclip('Radio.'Ans)
- PInit=Ans;PGAG=word(inn,2);PShip=word(inn,1)
- if ((lastpos(Init,PGAG)=0 | PGag='On') & (Init ~= PInit)) then do
- file=PathM'Message.'PInit
- Jv=FILEM(File)
- JV=writeln(fnh,text(1,(Ship||' ('||UName||')')))
- do i=1 to lines;Jv=writeln(fnh,txt.i);end;Jv=writeln(fnh,'')
- call close fnh;do i=1 to 10;end;Jv=SetClip('Reading.'PInit,'')
- JV=SetClip('Message.'PInit,1)
- transmit text(77,PShip);Did=1
- end
- else
- if PInit ~= Init then
- transmit text(78,PShip)
- end
- ToWho=right(ToWho,(length(ToWho)-1));if length(ToWho) < 1 then Leave=1
- end
- drop txt.
- if Did=0 then transmit text(79,0)
- end
- return
- PLAYIII:
- call PLAYDELAY
- string='';if exists(Path'Playing') then do
- call Open(fnn,Path'Playing','R')
- do until eof(fnn)
- inn=readln(fnn)
- if words(inn)=LCH then string=string||left(inn,1)
- end
- call close fnn
- end
- Jv=SetClip('Playing','')
- return
- DAM:
- arg c
- data='is';if right(device.c,1)='s' then data='are'
- transmit text(80,0) device.c text(81,data)
- drop data c
- return 0
- SHIELDC:
- if Da.6 < 75 then do
- if NCom ~= 2 then do
- query||text(82,0)' ';Ans=upper(Result)
- end
- else Ans=word(Com,2)
- Ans=left(Ans,2);if lastpos(Ans,'RA\LO\CL') ~= 0 then do
- select
- when (Ans='RA' & ShdC~='raised') then do
- if Da.6 > 75 then Jv=Dam(6)
- else do
- Shields=abs(Shields);ShdC='raised'
- end
- end
- when (Ans='LO' & ShdC~='lowered') then do
- Shields=0-(abs(Shields));ShdC='lowered'
- end
- when (Ans='CL' & Cloak=1 & ClkCtr~=1) then do
- Shields=abs(Shields);ClkCtr=1
- Cond=Cond||'\c1+\c4Cloaked'
- transmit text(129,0)
- ShdC='cloaked'
- Jv=SetClip((Game||Init),1)
- end
- otherwise Jv=1
- end
- transmit text(83,ShdC);call SHIPEE
- if lastpos('cloaked',ShdC)=0 then do
- Jv=SetClip((Game||Init),'')
- ClkCtr=0
- end
- end
- else transmit text(84,0)
- call Space
- call UP_POS
- OSP=0;call close Space
- end
- else Jv=Dam(6)
- return
- POINTCH:
- sendstring left(text(93,0),33)
- t1=0;t2=0;t3=0;if Colms > 45 then do
- sendstring right('Coalition',10) right('Empire',10) right(Ship,10)' '
- end
- transmit right('YourTotal',10)'\r0'
- CSc=GetClip('Score.'Game' Coa');ESc=GetClip('Score.'Game' Emp')
- do i=1 to 8
- sendstring left(text((84+i),0),27)
- if Colms>45 then do
- sendstring right(word(CSc,i),10) right(word(ESc,i),10) right(p2.i,10)' '
- t2=t2+word(CSc,i);t3=t3+word(ESc,i)
- end
- transmit right(p1.i,10);t1=t1+p2.i
- end
- sendstring left(text(94,0),30)
- if Colms>45 then sendstring right(t2,10) right(t3,10) right(t1,10)' '
- transmit right(Po3,10)
- Var=0.0;if Stdt>0 then Var=int(T1/Stdt*10+.5)/10
- transmit left(text(95,0),26) right(Var,10)
- drop data. t1 CSc ESc Var Colms t2 t3
- return
- ENTRAN:
- call LAST;if Shields <= 0 then transmit text(96,0)
- else do
- if NCom ~= 2 then do
- query||text(97,0)' ';Ans=upper(Result)
- end
- else Ans=upper(word(Com,2))
- if NB(Ans)=1 then do
- if Ans > 0 then do
- if ((Energy-Ans > 300) & (Shields+Ans <= MaxS)) then do
- Energy=Energy - Ans;Shields=Shields + Ans;call SHIPEE
- transmit text(98,0)
- end
- else transmit text(99,0)
- end
- else do
- if (((Energy-Ans) <= MaxE) & ((Shields+Ans) > 300)) then do
- Energy=Energy - Ans;Shields=Shields + Ans;call ShipEE
- transmit text(98,0)
- end
- else transmit text(99,0)
- end
- end
- else transmit text(100,0)
- end
- return
- BEGB:
- data.1=Path'Planets.Coa';data.2=Path'Planets.Emp'
- data.3=Path'Bases.Coa';data.4=Path'Bases.Emp';data.5=Path'Planets.Neu'
- data.6=PathG||Game;data.7='Coalition.';data.8='Empire.'
- z1=0;do until GetClip('Every.'Game)~=1
- z1=z1+1;if z1>5500 then Jv=SetClip('Every.'Game,'')
- end;Jv=SetClip('Every.'Game,1)
- do i=7 to 8
- file=PathG||data.i||Game
- if exists(file) then do
- call open(fnn,file,'R')
- inn=readln(fnn)
- call close fnn
- Jv=SetClip('Score.'Game' '||left(data.i,3),inn)
- end
- else Jv=SetClip('Score.'Game' '||left(data.i,3),right(text(15,0),31))
- end
- do i=1 to 5
- file=right(data.i,(length(data.i)-lastpos('/',data.i)))
- Jv=SetClip(file'.0',0);if exists(data.i) then do
- call Open(fnn,data.i,'R')
- inn=readln(fnn)
- Jv=setclip(file'.0',inn)
- do l=1 to inn
- ing=readln(fnn)
- Jv=setclip(file||'.'L,ing)
- end
- call close fnn
- end
- end
- address command 'Copy "'data.6'" "'PathM||Game'"'
- Jv=SetClip('Every.'Game,'')
- drop data.
- return
- LISTING:
- if (Da.5 >= 75) then Jv=Dam(5)
- else do
- if NCom=1 then do
- query||text(101,0)' ';Ans=upper(result)
- if words(Ans)=0 then signal LDONE
- Com='LI '||Ans;NCom=words(Com)
- end
- Ant='';Ans='';if NCom=2 then Ans=word(Com,2)
- else if NCom=3 then do
- if left(word(Com,2),2)='CL' then do
- CL=1;Ans=word(Com,3)
- end
- else do
- CL=0;Ans=word(Com,2);Ant=word(Com,3)
- end
- end
- else if NCom=4 then do
- if left(word(NCom,2),2)='CL' then do
- CL=1;Ans=word(Com,3);Ant=word(Com,4)
- end
- else do
- CL=0;Ans=word(Com,2);Ant=word(Com,3)
- end
- end
- else transmit text(102,0)
- if Ans='ENE' then do
- if Side='Coa' then Ans='EMP'
- else Ans='COA'
- end
- if Ans='BA' | Ans='PL' | Ans='SH' then do
- Ant=Ans;Ans='ALL'
- end
- if Ans~='COA' & Ans~='EMP' & Ans~='ALL' & Ans~='NEU' then do
- transmit text(102,0)
- signal LDONE
- end
- data.1='Coa';data.2='Emp';did=-1
- do i=1 to 2
- if ((Ans='ALL') & (Ant='SH' | Ant='') & i=1) then do
- call PlayIII;do until string=''
- Dum=left(string,1)
- inn=getclip('Stats.'Dum)
- if (words(inn)=7 & GetClip(Game||Dum)~=1) then do
- Jv=GetClip('Radio.'Dum);TSide=word(Jv,3)
- if (TSide=Side | (abs(XC-word(inn,6)) <= 15 & abs(YC-word(inn,7)) <=15)) then do
- did=did+1;if did=0 then transmit ''
- sendstring left(word(inn,1),10)' @'right(word(inn,6),2)'-'left(word(inn,7),2)' '
- sendstring right((word(inn,6)-XC),3)||','||right((word(inn,7)-YC),3)||';'
- transmit ' '||Rat(word(inn,2),word(inn,3))||'%'
- end
- end
- string=right(string,(length(string)-1))
- end
- end
- if ((Ans='NEU' | Ans='ALL') & (Ant='PL' | Ant='') & i=1) then do
- did=-1;do l=1 to getclip('Planets.Neu.0')
- inn=GetClip('Planets.Neu.'l)
- if words(inn)=2 then do
- if (abs(XC-word(inn,1)) <= 15 & abs(YC-word(inn,2)) <= 15) then do
- did=did+1;if did=0 then transmit ''
- sendstring 'Neu Planet @'right(word(inn,1),2)'-'left(word(inn,2),2)' '
- transmit right((word(inn,1)-XC),3)||','||right((word(inn,2)-YC),3)
- end
- end
- end
- if did=-1 then transmit text(103,0)
- end
- if ((Ans=upper(data.i) | Ans='ALL') & (Ant='BA' | Ant='') & getclip('Bases.'data.i'.0') > 0) then do
- did=-1
- do l=1 to getclip('Bases.'data.i'.0')
- inn=GetClip('Bases.'data.i'.'l)
- if words(inn)=3 then do
- if (data.i=Side | (abs(XC-word(inn,1)) <= 15 & abs(YC-word(inn,2)) <= 15)) then do
- did=did+1;if did=0 then transmit ''
- sendstring data.i' base @'right(word(inn,1),2)'-'left(word(inn,2),2)' '
- sendstring right((word(inn,1)-XC),3)||','||right((word(inn,2)-YC),3)||';'
- transmit ' 'Rat(word(inn,3),11000)'%'
- end
- end
- end
- if did=-1 then transmit text(104,data.i)
- end
- if ((Ans=upper(data.i) | Ans='ALL') & (Ant='PL' | Ant='') & getclip('Planets.'data.i'.0') > 0) then do
- did=-1
- do l=1 to GetClip('Planets.'data.i'.0')
- inn=GetClip('Planets.'data.i'.'l)
- if words(inn)=3 then do
- if (data.i=Side | (abs(XC-word(inn,1)) <= 15 & abs(YC-word(inn,2)) <= 15)) then do
- did=did+1;if did=0 then transmit ''
- sendstring data.i' planet @'right(word(inn,1),2)'-'left(word(inn,2),2)' '
- sendstring right((word(inn,1)-XC),3)||','||right((word(inn,2)-YC),3)||';'
- transmit ' 'word(inn,3)' builds'
- end
- end
- end
- if did=-1 then transmit text(105,data.i)
- end
- end
- end
- LDONE:
- return
- SENDMES:
- call PlayIII
- do until string=''
- Ans=left(string,1);if Ans ~= Init then do
- inn='';do until words(inn)=7
- inn=GetClip('Stats.'Ans)
- end
- if abs(word(inn,6)-XC) <= 15 & abs(word(inn,7)-YC) <= 15 then do
- FILE=PathM||'Message.'||Ans;Jv=FILEM(file)
- Jv=writeln(fnh,''||Msg);wte=1
- if length(Msh) < 3 then Jv=writeln(fnh,'')
- else Jv=writeln(fnh,Msh)
- end
- else if Msi ~= '' then do;Jv=FILEM(PathM'Message.'Ans)
- Jv=writeln(fnh,Msi);wte=1;end
- call close fnh;do i=1 to 10;end
- Jv=SetClip('Reading.'Ans,'');if wte=1 then do
- wte=0;Jv=SetClip('Message.'Ans,1)
- end
- end
- string=right(string,(length(string)-1))
- end
- return
- CAPTURE:
- call LAST;if NCom ~= 3 then do
- query||text(106,0)' ';Ans=upper(result)
- query||text(107,0)' ';Ant=upper(result)
- NCom=3;Com='CA '||Ans||' '||Ant
- end
- TX=word(Com,2);TY=word(Com,3)
- if (NB(TX) ~= 1 | NB(TY) ~= 1) | (TX < 1 | TY < 1 | TX > 75 | TY > 75) then
- transmit text(108,0)
- else do
- if (abs(XC-TX) > 1 | abs(YC-TY) > 1) then
- transmit text(109,Ship)
- else do
- call SPACE;Jv=Seek(Space,((TY-1)*75+TX-1),'B')
- inn=readch(Space)
- if inn='5' then do
- transmit '\n1'Ship' capturing Neu planet @'TX'-'TY'.'
- XT=TX;YT=TY;data='Planets.Neu';call LOCATE
- Max=GetClip('Planets.Neu.0');Max=Max-1;Jv=SetClip('Planets.Neu.0',Max)
- call DELPOS;call SPACE;Jv=Seek(Space,((TY-1)*75+TX-1),'B')
- Jv=Sdsc(100,4)
- if Side='Coa' then Ans='1'
- else Ans='3'
- Jv=writech(Space,left(Ans,1))
- Max=GetClip('Planets.'Side'.0')
- if Max < 1 then do
- Max=1;Jv=Setclip('Planets.'Side'.0',1)
- end
- else do
- Max=Max+1;Jv=SetClip('Planets.'Side'.0',Max)
- end
- line=TX TY 0
- Jv=SetClip('Planets.'Side'.'Max,line);call INITTAR
- call Cloak_Find
- end
- else do
- if ((inn=3 & Side='Coa')|(inn=1 & Side='Emp')) then do
- I=1;Leave=0;do until Leave=1
- inn=GetClip('Planets.'Ene'.'i)
- if words(inn)=3 then do
- if TX=word(inn,1) & TY=word(inn,2) then do
- if word(inn,3) > 0 then do
- transmit text(110,0)
- Bds=word(inn,3);Bds=Bds-1;att=1
- end
- else do
- transmit text(111,(Ship Ene TX'-'TY));Bds=-1
- Jv=Sdsc(100,4)
- end
- Did=int(random(1,10,time('S')))
- do j=1 to did
- Da1=abs(200/(Shields/MaxS)+random(1,3,time('s'))*0.571)
- if ShdC='lowered' then Da1=Da1 * 1.75
- Da1=int(Da1*10+.5)/10;if Bds > 0 then Is='('||Bds||')';else Is=''
- call BLOW
- Msg=Ene' Planet'Is' @'TX'-'TY' makes 'Da1' unit phaser hit on'
- Msg=Msg||'\n1'Ship' @'XC'-'YC', '||Rat(Shields,MaxS)||'%';Msi=''
- Msh='';transmit '\c2'Msg;call SENDMES;att=1
- end
- Leave=1;if Bds > -1 then do
- line=TX TY Bds
- Jv=SetClip('Planets.'Ene'.'i,line)
- end
- else do
- inn=GetClip('Planets.'Side'.0');if inn < 1 then inn=0
- inn=inn+1;Jv=SetClip('Planets.'Side'.0',inn)
- line=TX TY 0
- Jv=SetClip('Planets.'Side'.'inn,line)
- Max=GetClip('Planets.'Ene'.0');Max=Max-1
- Jv=SetClip('Planets.'Ene'.0',Max)
- do k=i to Max
- t=k+1;inn=GetClip('Planets.'Ene'.'t)
- Jv=SetClip('Planets.'Ene'.'k,inn)
- end
- call SPACE;Jv=seek(Space,((TY-1)*75+TX-1),'B')
- inn=readch(Space,1);Is=4-inn;Jv=seek(Space,((TY-1)*75+TX-1),'B')
- Jv=writech(Space,left(Is,1));call INITTAR
- call Cloak_Find
- end
- end
- end
- if Leave=0 then do
- I=I+1;if I > GetClip('Planets.'Ene'.0') then Leave =1
- end
- end
- end
- end
- end
- end
- OSP=0;call close SPACE
- signal SHIPEE
- SHIPEE:
- line=Ship Shields MaxS Energy MaxE XC YC
- Jv=setclip('Stats.'||Init,line)
- return
- BUILD:
- call LAST;if NCom ~= 3 then do
- query||text(113,0)' ';Ans=upper(result)
- query||text(114,0)' ';Ant=upper(result)
- NCom=3;Com='BU 'Ans' 'Ant
- end
- TX=word(Com,2);TY=word(Com,3)
- if (NB(TX)~=1|NB(TY)~=1|TX<1|TY<1|TY>75|TX>75) then transmit text(115,0)
- else do
- call SPACE
- Jv=seek(Space,((TY-1)*75+TX-1),'B')
- inn=readch(Space)
- if NB(inn) ~= 1 then transmit text(116,0)
- else do
- if (abs(TX-XC) < 2 & abs(TY-YC) < 2) then do
- L=1;Leave=0;do until Leave ~= 0
- if GetClip('Planets.'Side'.0') < 1 then
- Leave=2
- else do
- inn=getclip('Planets.'Side'.'L)
- if word(inn,1)=TX & word(inn,2)=TY then do
- Leave=1;Plc=L
- end
- end
- if Leave=0 then do
- L=L+1;if L > GetClip('Planets.'Side'.0') then Leave=2
- end
- end
- if Leave=2 then transmit text(116,0)
- else do
- inn=GetClip('Planets.'Side'.'Plc)
- Bds=word(inn,3)
- if Bds <= 3 then do
- Bds=Bds+1
- Pd='.';if Bds~=1 then Pd='s.'
- transmit text(117,Bds)||PD;call AdvSt
- line=TX TY Bds
- Jv=setclip('Planets.'Side'.'Plc,line)
- end
- else do
- May=GetClip('Bases.'Side'.0');Max=GetClip('Planets.'Side'.0')
- if May >= 10 then transmit text(118,0)
- else do
- call Cloak_Find
- Max=Max-1;May=May+1
- transmit text(119,(Ship Side' base.'))
- Jv=Sdsc(1000,5)
- data='Planets.'Side;L=Plc
- Jv=SetClip('Planets.'Side'.0',Max);call DELPOS
- Jv=SetClip('Bases.'Side'.0',May)
- line=TX TY 11000
- Jv=SetClip('Bases.'Side'.'May,line)
- call SPACE;Jv=Seek(Space,((TY-1)*75+TX-1),'B')
- Dum=lastpos('$$',Junk);Dum=(Dum-1)/3+1
- Jv=writech(Space,Dum)
- end
- end
- end
- end
- else transmit text(120,Ship)
- end
- end
- OSP=0;call close SPACE
- return
- TARGTS:
- sendstring text(121,0)' ';getchar;Ans=result
- if Ans~='Y' then transmit 'No.'
- else do;transmit 'Yes.\n2Scanning..';call INITTAR;end
- if TAR < 1 then transmit text(122,0)
- else do
- transmit ''
- do i=1 to TAR
- transmit TGT.i
- end
- end
- return
- DOCKSH:
- if (Dock ~= 1)|(GetClip('ReDock.'Init)=1) then do;Jv=SetClip('ReDock.'Init,'')
- data.1='Planets.';data.2='Bases.';L=1;Leave=0;Is=0;Dock=0
- do until Leave=1
- Max=GetClip(data.L||Side'.0');if Max > 0 then do
- Is=0;Pos=1;do until (Is=1)
- inn=GetClip(data.L||Side'.'Pos)
- if words(inn)=3 then do
- if (abs(XC-word(inn,1)) < 2 & abs(YC-word(inn,2)) < 2) then do
- Is=1;Leave=1;Dock=1
- end
- end
- Pos=Pos+1;if Pos > Max then Is=1
- end
- end
- if (Dock=0 & L=1) then L=2
- else Leave=1
- end
- end
- if Dock ~= 1 then transmit text(123,Ship)
- else transmit text(124,0)
- if Dock=1 then do
- Dum=random(1,50,time('s'));Dum=int((Dum*294/22*L)*10+.5)/10
- Energy=Energy + Dum
- if Energy > MaxE then Energy=MaxE
- Shields=abs(Shields) + Dum
- if Shields > MaxS then Shields=MaxS;Torps=MxTo
- call AdvSt;if shdc~='raised' then SA='SH ON/'||SA
- TDa=0
- do i=1 to 6
- if da.i>0 then do
- da.i=da.i-70
- if da.i<1 then do
- da.i=0
- transmit text(127,0) device.i text(128,0)
- if re_now=i then re_now=0
- end
- end
- TDa=TDa+da.i
- end
- end
- signal SHIPEE
- REPAIRSH:
- re_now=0
- call LAST;transmit '';num=0
- do i=1 to 6
- if Da.i > 0 then do
- num=num+1;tm.num=i
- transmit num'. 'left(device.i,18) da.i' units'
- end
- end
- if num=0 then transmit text(125,0)
- else do
- if num>1 then do
- query||text(126,0)
- Ans=result;Ans=upper(Left(Ans,1))
- end
- else Ans='1'
- if Ans>0&Ans<=Num then do
- Z3=tm.Ans;Z1=Rat(da.z3,45)/100
- transmit '\n1Repairs on the 'device.z3' will take 'z1' stardates.'
- query||text(132,0)' ';Ans=result;Ans=upper(left(Ans,1))
- if Ans~='N' then do
- re_now=Z3
- transmit text(133,0)
- end
- end
- end
- signal SHIPEE
- DAMRPT:
- hi=0.0;hd=0;num=0;head=text(134,0)
- do i=1 to 6
- if Da.i ~= 0 then do
- if hd=0 then do;hd=1;transmit Head;end;Z2=Rat(Da.i,30)/100
- tcol='';if re_now=i then do
- tcol='\c1';Z2=Rat(Da.i,45)/100||Col
- end
- transmit left(device.i,18)||left(Da.i,11)||tcol||Z2;num=num+1
- if Z2>hi then hi=Z2
- end
- end
- if hd=0 then transmit '\n1'text(125,Rank)
- else
- if num~=1 then transmit left('Total',18)||left(TDa,11)||hi
- drop tcol num i hi hd head
- return
- PHASERS:
- call LAST;if TAR < 1 then transmit text(135,0)
- else if ClkCtr=1 then transmit text(4,0)
- else if (Da.2 < 75) then do
- Dispurse=500;if NCom=3 then do
- if word(Com,2)='C' then do
- Ans=left(word(com,3),1)
- inn=GetClip('Stats.'Ans)
- if words(inn)=7 then Com='PH 'word(inn,6)' 'word(inn,7)
- else Com='PH'
- end
- else if NB(word(Com,2)) ~= 1 | NB(word(Com,3)) ~= 1 then
- Com='PH'
- end
- else if NCom=4 & word(Com,2)='C' then do
- Ans=left(word(Com,4),1)
- inn=GetClip('Stats.'Ans)
- if words(inn)=7 then do
- Com='PH 'word(inn,6)' 'word(inn,7)
- if NB(word(Com,3))=1 then Dispurse=word(Com,3)
- end
- else Com='PH'
- end
- else if NCom=4 then Dispurse=Word(Com,2)
- else Com='PH'
- if words(Com)=1 then do
- query||text(137,0)' ';Ans=result
- query||text(138,0)' ';Ant=result
- Com='PH 'Ans' 'Ant
- end
- if words(Com)=3 | words(Com)=4 then do
- if words(Com)=3 then do;TX=word(Com,2);TY=word(Com,3);end
- else do;TX=word(Com,3);TY=word(Com,4);Dispurse=word(Com,2);end
- if NB(TX)~=1 | NB(TY)~=1 | NB(Dispurse)~=1 then
- transmit text(139,0)
- else do
- L=1;Leave=0;do until Leave ~= 0
- Dum=lastpos('@',TGT.l);XT=mid(TGT.l,Dum+1,2)
- if right(XT,1)='-' then XT=left(XT,1)
- Dum=firstpos('-',TGT.l);YT=mid(TGT.l,Dum+1,2)
- if right(YT,1)='-' then YT=left(YT,1)
- if TX=XT & TY=YT then Leave=1
- if Leave=0 then do
- L=L+1;if L > TAR then Leave=2
- end
- end
- if Leave=2 then transmit text(136,0)
- else do
- data='';if firstpos('Planet',TGT.L) ~= 0 then data='Planets'
- if firstpos('Base',TGT.L) ~= 0 then data='Bases'
- if data ~= '' then do
- data=data||'.'Ene;call LOCATE
- if Leave=1 then do
- if ShdC='raised' then do
- transmit text(140,0)
- if Dock ~= 1 then Energy=Energy - 200
- end
- if Rank='Cadet'|Rank='Lieutenant' then
- if Dispurse < 200 | Dispurse > 1500 then Dispurse=500
- if Rank='Captain' then
- if Dispurse < 200 | Dispurse > 2500 then Dispurse=500
- if data='Planets.'||Ene then do
- if TEne > 0 then do
- if Dispurse > 750 then
- if Dispurse*(random(1,50,time('S'))/50) > 740 then TEne=TEne-1
- end
- line=word(inn,1) word(inn,2) TEne
- Jv=SetClip(data'.'L,line)
- Da1=int(Dispurse*(random(1,50,time('S'))/50.2)*10+.5)/10
- Jv=Sdsc((0-Da1),8)
- Msg=Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||Da1
- Msg=Msg||' unit phaser hit on\n1'Ene' Planet('TEne') @'XT'-'YT
- Msi='';Msh=''
- att=1;transmit '\c5\n1'Msg;call SENDMES;call ShipEE
- end
- else if data='Bases.'||Ene then do
- Far=((XC-XT)**2 + (YC-YT)**2)
- do i=1 to 10 by .5
- if Far/i < i then leave
- end;Far=i
- Da1=abs((Dispurse/Far)/((TEne+500)/11000)+random(1,800,time('s'))*0.571)
- if Rank=text(19,0) then Da1=Da1 * 2
- Da1=int(Da1*10+.5)/10
- if Da1 > TEne then Da1=TEne
- Jv=Sdsc(Da1,3);TEne=TEne-Da1
- line=XT YT TEne
- Jv=SetClip('Bases.'Ene'.'L,line)
- Msg=Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||Da1
- Msg=Msg||' unit phaser hit on\n1'Ene' base @'XT'-'YT' '
- Is=Rat(TEne,11000);Msg=Msg||Is'%'
- call COMMON
- end
- else do
- transmit '\n1ERROR!';signal DONE
- end
- if Rank='Cadet' then Dispurse=int(Dispurse/1.3)
- if Dock~=1 then Energy=Energy-Dispurse
- end
- end
- else do
- call Space;Jv=seek(Space,((TY-1)*75+TX-1),'B')
- inn=readch(Space)
- if lastpos(inn,Enemy)=0 then transmit text(136,0)
- else do
- Shi=inn;Far=((XC-XT)**2 + (YC-YT)**2)
- do i=1 to 10 by .5
- if Far/i < i then leave
- end;Far=i;Ost=GetClip('Stats.'Shi)
- Osh=word(Ost,2);OMs=word(Ost,3);OEn=word(Ost,4)
- Da1=abs((Dispurse/Far)/((Osh+500)/OMs)+random(1,3,time('s'))*0.571)
- if Rank=text(19,0) then Da1=Da1 * 1.4
- Da1=int(Da1*10+.5)/10
- Da1=Da1/3
- Da2=0;if Da1 > Osh then do
- Da2=abs(Da1-Osh);Da1=Osh
- end;Osh=Osh-Da1;OEn=OEn-Da2
- Jv=Sdsc((Da1+Da2),1)
- Msg=Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||Da1
- Msg=Msg||' unit phaser hit on\n1'word(Ost,1)' @'XT'-'YT' '
- Msg=Msg||Rat(Osh,OMs)'%'
- if Rat(Osh,OMs) < 15 then Msi=text(142,(word(Ost,1)))
- else Msi='';Msh='';att=1
- le=GetClip('Stats.'Shi)
- line=word(le,1) OSh OMs OEn word(le,5) word(le,6) word(le,7)
- Jv=SetClip('Stats.'Shi,line)
- transmit '\c5\n1'Msg||Msh;call SENDMES
- end
- end
- end
- end
- end
- else transmit text(136,0)
- end
- else Jv=Dam(2)
- call INITTAR;OSP=0;call close SPACE;call ShipEE
- return
- UPHI:
- if HighDid~=1 then do
- transmit text(142,0);z1=0;HighDid=1
- do until GetClip('HiScore')~=1
- z1=z1+1;if z1>500 then Jv=SetClip('HiScore','')
- end
- Jv=SetClip('HiScore',1);if exists(Path'HiScores') then do
- call open(fnn,Path'HiScores','R')
- call open(fng,Path'Temp.'SNbr,'W');did=0;yer=0
- do until eof(fnn)
- inn=readln(fnn)
- if words(inn)=4 then do
- if (Po3 >= word(inn,3) & yer=0) then do
- Jv=writeln(fng,UName Rank Po3 SNbr);did=did+1;yer=1
- end
- if ((word(inn,4) ~= SNbr)&(did < 10)) then do
- Jv=writeln(fng,inn);did=did+1
- end
- end
- end
- if (yer=0 & did < 10) then Jv=writeln(fng,UName Rank Po3 SNbr)
- call close fng
- call close fnn
- address command 'delete "'Path'HiScores"'
- address command 'Rename "'Path'Temp.'SNbr'" "'Path'HiScores"'
- end
- else do
- call open(fnn,Path'HiScores','W')
- jv=writeln(fnn,UName Rank Po3 SNbr)
- call close fnn
- end;end;Jv=SetClip('HiScore','')
- return
- TORPFI:
- call Last
- if ClkCtr=1 then transmit text(4,0)
- else if (Da.3 < 75) then do
- if NCom > 2 then do
- if NCom=3 then do
- NT=1;TX=word(Com,2);TY=word(Com,3)
- end
- else if (NCom=4 & word(Com,2) ~= 'C') then do
- NT=word(Com,2);TX=word(Com,3);TY=word(Com,4)
- end
- else if (NCom=4 & word(Com,2)='C') then do
- Ans=left(word(Com,4),1);inn=GetClip('Stats.'Ans)
- if words(inn)=7 then do
- NT=word(Com,3);TX=word(inn,6);TY=word(inn,7)
- end
- else Com='TO'
- end
- else Com='TO'
- end
- else Com='TO'
- if Com='TO' then do
- query||text(137,0)' ';Ans=result
- query||text(138,0)' ';Ant=result
- TX=Ans;TY=Ant;NT=1
- end
- if (NB(TX)~=1|NB(TY)~=1|NB(NT)~=1) then transmit text(143,0)
- else do
- NT=int(abs(NT));if TX < XC then ta=-1
- if TX=XC then ta=0
- if TX > XC then ta=1
- if TY > YC then tb=1
- if TY=YC then tb=0
- if TY < YC then tb=-1
- YT=YC;XT=XC;call SPACE
- if NT > MaxT then NT=MaxT
- if NT > Torps then transmit text(144,0)
- else do
- do i1=1 to NT
- call BUF
- Tmx=0;Tmy=0;Is=0;do until Is~=0
- if YT~=TY then do;YT=YT+tb;Tmy=Tmy+1;end
- if XT~=TX then do;XT=XT+ta;Tmx=Tmx+1;end
- if (((Tmx>10)|(Tmy>10))|((XT<1)|(XT>75)|(YT<1)|(YT>75))) then do
- transmit text(145,(i1 XT'-'YT));Is=1
- end
- else do
- call SPACE;Jv=seek(Space,((YT-1)*75+XT-1),'B');inn=readch(Space,1)
- if (inn~= '.' & inn~='6') then do
- Is=1;txt=text(146,(i1 XT'-'YT))
- if (NB(inn)=1|inn='*') then do
- Var=inn;if NB(Var)=1 then
- Var=word(Junk,inn)
- if var='$$'|var='++' then transmit txt
- else do
- if Var='@' then do
- Da1=abs(450/(120/500)+random(1,800,time('s'))*0.571)
- Da1=int(Da1*10+.5)/10
- Msg='\n1'Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||Da1
- Msg=Msg||' unit torpedo hit on\n1Neu planet @'XT'-'YT
- Msh=text(148,(XT'-'YT))
- data='Planets.Neu';call Locate;Max=GetClip(data'.0');Max=Max-1
- Jv=SetClip(data'.0',Max);call DELPOS
- Jv=Sdsc((0-Da1),8);Msi=''
- transmit '\c5'Msg||Msh;call SENDMES
- Jv=Seek(Space,((YT-1)*75+XT-1),'B');Jv=writech(Space,'.')
- call NEUMAKE;att=1
- end
- else if Var='*' then do
- Da1=abs(1420*random(1,3,time('s'))*0.371)
- Da1=int(Da1*10+.5)/10
- Msg=Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||(Da1/2.2)
- Msg=Msg||' unit torpedo hit on\n1Star @'XT'-'YT
- Msh=text(148,(XT'-'YT))
- Jv=Sdsc(-500,7);Msi=''
- transmit '\n1\c5'Msg||Msh;call SENDMES
- call BLOW
- Jv=Seek(Space,((YT-1)*75+XT-1),'B');Jv=writech(Space,'.')
- Msg='Nova @'XT'-'YT' makes 'Da1' unit energy hit on\n1'
- Msg=Msg||Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'%';Msh=''
- transmit '\n1\c5'Msg||Msh;call SENDMES;att=1
- do until inn='.';call RDM;Jv=Seek(Space,((Y-1)*75+X-1),'B')
- inn=readch(Space);end;Jv=Seek(Space,((Y-1)*75+X-1),'B')
- Jv=writech(Space,'*')
- sev=1;call DAMPICK
- end
- else if Var='//' then do
- data='Bases.'Ene;call LOCATE
- Da1=abs(380/((TEne+500)/11000)+random(1,800,time('s'))*0.571)
- if Rank=text(19,0) then Da1=Da1 * 2
- Da1=int(Da1*10+.5)/10
- if Da1 > TEne then Da1=TEne
- Jv=Sdsc(Da1,3);TEne=TEne-Da1
- line=XT YT TEne
- JV=Setclip('Bases.'Ene'.'L,line)
- Msg=Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||Da1
- Msg=Msg||' unit torpedo hit on\n1'Ene' base @'XT'-'YT' '
- Msg=Msg||Rat(TEne,11000)'%'
- call COMMON;att=1;if dest=1 then do;TX=0;TY=0;end
- end
- else if Var='--' then do
- data='Planets.'Ene;call LOCATE
- Da1=abs(496/(random(1,3,time('s'))/2)*0.771)
- Da1=int(Da1*10+.5)/10
- if Da1 > 500 & TEne > 0 then TEne=TEne-1
- Jv=Sdsc((0-Da1),8)
- line=XT YT TEne
- Jv=SetClip('Planets.'Ene'.'L,line)
- Msg=Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||Da1
- is='';if TEne>0 then Is='('TEne')'
- Msg=Msg||' unit torpedo hit on\n1'Ene' planet'Is' @'XT'-'YT
- Msi='';Msh='';transmit '\n1\c5'Msg;call SendMes;Call ShipEE;att=1
- end
- end
- end
- else do
- if lastpos(inn,choices) ~= 0 then transmit text
- else if lastpos(inn,Enemy) ~=0 then do
- Shi=inn;Ost=GetClip('Stats.'Shi)
- Osh=word(Ost,2);OMs=word(Ost,3);OEn=word(Ost,4)
- Da1=abs(635/((Osh+500)/OMs)+random(1,3,time('s'))*0.571)
- Da1=int(Da1/2.5*10+.5)/10
- z=random(1,100,(time('s')));disp=0
- if z/13=int(z/13) then do
- Da1=0.0;line=GetClip('Command.'inn)
- if compress(line)='' then line=''
- line=line||'MO R -1 0/'
- Jv=SetClip('Command.'Shi,line);disp=1
- end
- Ost=GetClip('Stats.'Shi)
- Osh=word(Ost,2);OMs=word(Ost,3);OEn=word(Ost,4)
- Da2=0;if Da1>Osh then do
- Da2=abs(Da1-Osh);Da1=Osh
- end;Osh=Osh-Da1;OEn=OEn-Da2
- Jv=Sdsc((Da1+Da2),1)
- Msg=Ship' @'XC'-'YC' 'Rat(Shields,MaxS)'% makes '||Da1
- Msg=Msg||' unit torpedo hit on\n1'word(Ost,1)' @'XT'-'YT' '
- Msg=Msg||Rat(Osh,OMs)'%'
- if Rat(Osh,OMs) < 15 then Msi='\n1The 'word(Ost,1)' is near death.'
- else Msi='';Msh=''
- if disp=1 then
- Msh='\n1'word(Ost,1)' displaced to '||(XT-1)||'-'||(YT-1)
- if OEn < 1 then do
- Msi=text(149,(word(Ost,1)))
- Jv=Sdsc(500,2)
- end
- le=GetClip('Stats.'Shi)
- line=word(le,1) Osh OMs OEn word(le,5) word(le,6) word(le,7)
- Jv=SetClip('Stats.'Shi,line);att=1
- transmit '\c5\n1'Msg||Msh||Msi;call SENDMES
- end
- end
- end
- else if (XT=TX&YT=TY) then do
- Is=1;transmit text(145,(i1 XT'-'YT))
- end
- end
- end
- XT=XC;YT=YC;if Dock~=1 then Torps=Torps-1
- end
- end
- end
- end
- else Jv=Dam(3)
- OSP=0;call close SPACE
- signal INITTAR
- BEGC:
- bufferflush;sendstring text(155,0);getchar;transmit ''
- inn='0';if exists(Path'BegVar') then do
- call Open(fnn,Path'BegVar','R')
- inn=readln(fnn)
- call close fnn
- end
- transmit text(156,(Col word(inn,1))) ve'.'
- transmit text(157,word(inn,2))
- Jv=DELFILE(Path'BegVar')
- Tms=word(inn,1);Tms=Tms+1
- Jv=writeln(fng,Tms UName)
- call close fng
- return
- NEUMAKE:
- inn='';call SPACE;do until inn='.'
- call RDM;Jv=seek(Space,((Y-1)*75+X-1),'B')
- inn=readch(Space)
- end
- Jv=seek(Space,((Y-1)*75+x-1),'B')
- Jv=writech(Space,'5');OSP=0;call close SPACE
- inn=GetClip('Planets.Neu.0');if inn < 1 then inn=1;else inn=inn+1
- Jv=SetClip('Planets.Neu.0',inn);line=X Y;Jv=SetClip('Planets.Neu.'inn,line)
- return
- BLOW:
- If (ShdC='raised' & Shields <=0)|(ShdC='lowered') then
- Energy=int(Energy)-Da1
- else Shields=Shields-Da1
- return
- COMMON:
- if rat((TEne+Da1),11000)>92 then Msi=Ene' base @'XT'-'YT' 'Rat(TEne,11000)' is under attack.'
- else Msi=''
- Msh='';if Rat(TEne,11000)<13.6 & TEne >= 20 then Msh='\*1'Path'Critical2\'
- dest=0;if TEne < 20 then do
- call PlayIII;do h=1 to length(string)
- Jv=SetClip('ReDock.'||mid(string,h,1),1);end
- Msh='\*1'Path'Critical1\';dest=1
- Msi=Ene' base @'XT'-'YT' has been destroyed.'
- Max=GetClip('Bases.'Ene'.0')
- Max=Max-1;Jv=SetClip('Bases.'Ene'.0',Max)
- call SPACE;Jv=Seek(Space,((YT-1)*75+XT-1),'B')
- Jv=writech(Space,'.');data='Bases.'Ene;call DELPOS
- call NEUMAKE
- end
- att=1;transmit '\c5\n1'Msg||Msh;call SENDMES
- signal SHIPEE
- MEMMAN:
- Men=Storage();transmit text(158,Mem)||text(159,Men)||text(160,(Mem-Men))
- return
- LOCATE:
- Max=GetClip(data'.0')
- if Max~=0 then do
- L=1;Leave=0;do until Leave~=0
- inn=GetClip(data'.'L)
- if words(Inn) > 1 then do
- if XT=word(inn,1) & YT=word(inn,2) then leave=1
- end
- if leave=0 then do
- L=L+1;if L>Max then Leave=2
- end
- end
- if Leave=2 then transmit text
- else do
- inn=GetClip(data'.'L)
- TEne=word(inn,3)
- end
- end
- else transmit text(136,0)
- return
- DELPOS:
- if ((Max>0)&(L~=Max+1)) then do
- do h=L to Max
- t=H+1;inn=GetClip(data'.'t)
- Jv=SetClip(data'.'h,inn)
- end
- end
- Jv=SetClip(data'.'||(Max+1),'');drop H T
- return Z
- DAMPICK:
- do a1=1 to 5
- a=random(1,6,time('s'))
- end
- if right(device.a,1)='s' then data='ARE';else data='IS'
- transmit '\n1\c4CAPTAIN!!! THE 'upper(device.a) data' DAMAGED!!'
- Da1=((random(1,200,time('s'))*.9811)+(Da.a/2))
- if sev=1 then do
- Da1=Da1*9.62;transmit text(161,0)
- end
- Da1=int(Da1*10+.5)/10
- Da.a=Da.a+Da1;TDa=TDa+Da1;sev=0;sendstring Col
- return
-