      SUBROUTINE EFTSUB                                                 1275

c	include 'tcommon.for'
	%include tcommon.for

      CALL CHEKDG(5,IR)                                                 1293
      IF(IR.EQ.1.)GO TO 2250                                            1294
C     ...LOOP ON NO. THAT CAN BE FIRED PER STARMINUTE.                  1295
      DO 2400 JJJ=1,IETOFT                                              1296
      IF(EFT(1,1).EQ.0..OR.EFT(1,1).GT.NTSTPS)GO TO 2300                1297
C     ...LOOK FOR PLACE IN TORPS ARRAY.                                 1298
      IF(NTORPS.NE.0)GO TO 2202                                         1299
      NTORPS=30                                                         1300
      NT=1                                                              1301
      GO TO 2203                                                        1302
2202  DO 2201 K=1,NTORPS                                                1303
      IF(TORPS(K,1).EQ.0.)GO TO 2208                                    1304
2201  CONTINUE                                                          1305
      GO TO 2300                                                        1306
2208  NT=K                                                              1307
2203  VPX=COSD(PDEG)*PSP+COSD(EFT(1,2))*ETVEL                           1308
      EFT(1,1)=0.                                                       1309
      VPY=SIND(PDEG)*PSP+SIND(EFT(1,2))*ETVEL                           1310
      MINR=MINR+1                                                       1311
      WRITE(6,2206)MINR                                                 1312
2206  FORMAT(' TORPEDO DECK: TORPEDO ',I2,' LAUNCHED')                  1313
      TORPS(NT,3)=SQRT(VPX*VPX+VPY*VPY)                                 1314
C     ...CHECK IF TORP MOVING AT WARP SPEED.                            1315
      IF(TORPS(NT,3).LT.1.)GO TO 22060                                  1316
      WRITE(6,2204)                                                     1317
2204  FORMAT(' TORPEDO ENTERING HYPERSPACE...DELETED')                  1318
      GO TO 2220                                                        1319
22060 TORPS(NT,1)=XQE+VPX                                               1320
      TORPS(NT,2)=YQE+VPY                                               1321
      VSX=0.                                                            1322
      VSY=0.                                                            1323
      CALL GETBRG(DELTA,VSX,VPX,VSY,VPY,X,Y)                            1324
C     ...PUT BEARING IN -360 TO 0 RANGE.                                1325
      TORPS(NT,4)=DELTA -360.                                           1326
2220  ITFIRE=ITFIRE-1                                                   1327
      IF(ITFIRE.EQ.0)GO TO 2300                                         1328
C     ...MOVE TORPS TO BE FIRED ARRAY DOWN IN CORE.                     1329
      DO 2225    J=1,ITFIRE                                             1330
      EFT(J,1)=EFT(J+1,1)                                               1331
      EFT(J,2)=EFT(J+1,2)                                               1332
2225  CONTINUE                                                          1333
2400  CONTINUE                                                          1334
      GO TO 2300                                                        1335
C     ...DAMAGE CONTROL INHIBITION. DELETE ALL QUEUED FIRINGS.          1336
2250  DO 2260    J=1,ITFIRE                                             1337
2260  EFT(J,1)=0.                                                       1338
      ITORP=ITORP+ITFIRE                                                1339
      ITFIRE=0                                                          1340
2300  RETURN                                                            1341
      END                                                               1342
