home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.lbl.gov
/
2014.05.ftp.ee.lbl.gov.tar
/
ftp.ee.lbl.gov
/
mtrek.shar.Z
/
mtrek.shar
/
bandit.ftt
< prev
next >
Wrap
Text File
|
1990-04-02
|
2KB
|
96 lines
SUBROUTINE BANDIT
INCLUDE 'LEDFORD.COM/-LI'
INCLUDE 'PLAY.COM/-LI'
INCLUDE 'COMMND.COM/-LI'
INCLUDE 'BUFFER.COM/-LI'
LOGICAL*1 LINE(10)
INTEGER*2 STATE
C DO 10052 IX=1,17
C DO 10054 IY=1,21
C IF((TMP.LT.'1').OR.(TMP.GT.'8'))GOTO 10054
C IF(CLOAK(TMP-'0'))GOTO 10999
C SEE(TMP-"60)=.TRUE.
C GOTO 10054
C10999 CONTINUE
C NEWBUF(IXB,IYB)='.'
C10054 CONTINUE
C10052 CONTINUE
C
C
C CHECK AND UPDATE SHIELDS
C
IF((SHIELD(WHO)+ENERGY(WHO)).GE.4000.)GOTO 10010
IF(ENERGY(WHO).GE.1500.)GOTO 10300
IF(SHIELDS(WHO).LE.0.)GOTO 10300
X=ENERGY(WHO)-1500.
GOTO 10111
10010 CONTINUE
IF(SHIELDS(WHO).GE.1000.)GOTO 10300
X=1000.-SHIELDS(WHO)
10111 ENCODE(10,10200,LINE)X,"15
10200 FORMAT('S',F8.0,A1)
GOTO 10900
10300 CONTINUE
C
C CHECK WARP DRIVE
C
IF(WARP(WHO).GT.0)GOTO 10400
ENCODE(10,10210,LINE)"15
10210 FORMAT('W 5',A1)
GOTO 10900
10400 CONTINUE
GOTO 10999
C X=1.6E37
CC FIND CLOSEST SHIP IN VIEW
C DO 100 I=1,8
C IF(.NOT.SEE(I).OR.(I.EQ.WHO))GOTO 100
C DIST=((XCORD(WHO)-XCORD(I))**2+(YCORD(WHO)-YCORD(I))**2)**0.5
C IF(DIST.GT.X)GOTO 100
C X=DIST
C J=I
C100 CONTINUE
C
CC SET COURSE FOR HIM
C IF((J.EQ.0).OR.(IWTWRP.NE.0))GOTO 400
C COURSE(WHO)=ATAN2((YCORD(J)-YCORD(WHO)),
C $ (XCORD(J)-XCORD(WHO)))*180./3.14159
C IF((X.GT.4.).OR.(TORPS(WHO).LE.0).OR.(IWTTOR.NE.0))GOTO 400
C IWTTOR=5
C LAUNCH(WHO)=COURSE(WHO)
C TORPS(WHO)=TORPS(WHO)-1
C400 CONTINUE
C
CC KEEP MOVING
C IF(WARP(WHO).NE.0.)GOTO 300
C ENERGY(WHO)=ENERGY(WHO)-50.
C PHA(WHO)=COURSE(WHO)
C COURSE(WHO)=COURSE(WHO)+90.
C IF(COURSE(WHO).GT.360.)COURSE(WHO)=COURSE(WHO)-360.
C WARP(WHO)=5.
C IWTWRP=5
C300 CONTINUE
C
10900 CONTINUE
DO 100 I=1,10
CMD(I)=LINE(I)
100 CONTINUE
CNT=10
CALL SETEF(25)
10999 CONTINUE
RETURN
ENTRY BANINT
C
C INIT ROBOT CODE
C
STATE=1
RETURN
END