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 >
Text File  |  1990-04-02  |  2KB  |  96 lines

  1.     SUBROUTINE BANDIT
  2.  
  3.     INCLUDE 'LEDFORD.COM/-LI'
  4.  
  5.     INCLUDE 'PLAY.COM/-LI'
  6.  
  7.     INCLUDE 'COMMND.COM/-LI'
  8.  
  9.     INCLUDE 'BUFFER.COM/-LI'
  10.  
  11.     LOGICAL*1 LINE(10)
  12.     INTEGER*2 STATE
  13.  
  14. C    DO 10052 IX=1,17
  15. C    DO 10054 IY=1,21
  16. C    IF((TMP.LT.'1').OR.(TMP.GT.'8'))GOTO 10054
  17. C    IF(CLOAK(TMP-'0'))GOTO 10999
  18. C    SEE(TMP-"60)=.TRUE.
  19. C    GOTO 10054
  20. C10999    CONTINUE
  21. C    NEWBUF(IXB,IYB)='.'
  22. C10054    CONTINUE
  23. C10052    CONTINUE
  24. C
  25.  
  26. C
  27. C    CHECK AND UPDATE SHIELDS
  28. C
  29.     IF((SHIELD(WHO)+ENERGY(WHO)).GE.4000.)GOTO 10010
  30.     IF(ENERGY(WHO).GE.1500.)GOTO 10300
  31.     IF(SHIELDS(WHO).LE.0.)GOTO 10300
  32.     X=ENERGY(WHO)-1500.
  33.     GOTO 10111
  34. 10010    CONTINUE
  35.     IF(SHIELDS(WHO).GE.1000.)GOTO 10300
  36.     X=1000.-SHIELDS(WHO)
  37. 10111    ENCODE(10,10200,LINE)X,"15
  38. 10200    FORMAT('S',F8.0,A1)
  39.     GOTO 10900
  40. 10300    CONTINUE
  41. C
  42. C    CHECK WARP DRIVE
  43. C
  44.     IF(WARP(WHO).GT.0)GOTO 10400
  45.     ENCODE(10,10210,LINE)"15
  46. 10210    FORMAT('W       5',A1)
  47.     GOTO 10900
  48. 10400    CONTINUE
  49.     GOTO 10999
  50. C    X=1.6E37
  51. CC    FIND CLOSEST SHIP IN VIEW
  52. C    DO 100 I=1,8
  53. C    IF(.NOT.SEE(I).OR.(I.EQ.WHO))GOTO 100
  54. C    DIST=((XCORD(WHO)-XCORD(I))**2+(YCORD(WHO)-YCORD(I))**2)**0.5
  55. C    IF(DIST.GT.X)GOTO 100
  56. C    X=DIST
  57. C    J=I
  58. C100    CONTINUE
  59. C
  60. CC    SET COURSE FOR HIM
  61. C    IF((J.EQ.0).OR.(IWTWRP.NE.0))GOTO 400
  62. C    COURSE(WHO)=ATAN2((YCORD(J)-YCORD(WHO)),
  63. C     $    (XCORD(J)-XCORD(WHO)))*180./3.14159
  64. C    IF((X.GT.4.).OR.(TORPS(WHO).LE.0).OR.(IWTTOR.NE.0))GOTO 400
  65. C    IWTTOR=5
  66. C    LAUNCH(WHO)=COURSE(WHO)
  67. C    TORPS(WHO)=TORPS(WHO)-1
  68. C400    CONTINUE
  69. C
  70. CC    KEEP MOVING
  71. C    IF(WARP(WHO).NE.0.)GOTO 300
  72. C    ENERGY(WHO)=ENERGY(WHO)-50.
  73. C    PHA(WHO)=COURSE(WHO)
  74. C    COURSE(WHO)=COURSE(WHO)+90.
  75. C    IF(COURSE(WHO).GT.360.)COURSE(WHO)=COURSE(WHO)-360.
  76. C    WARP(WHO)=5.
  77. C    IWTWRP=5
  78. C300    CONTINUE
  79.  
  80. C
  81. 10900    CONTINUE
  82.     DO 100 I=1,10
  83.     CMD(I)=LINE(I)
  84. 100    CONTINUE
  85.     CNT=10
  86.     CALL SETEF(25)
  87. 10999    CONTINUE
  88.     RETURN
  89.     ENTRY BANINT
  90. C
  91. C    INIT ROBOT CODE
  92. C
  93.     STATE=1
  94.     RETURN
  95.     END
  96.