      SUBROUTINE EPHIT(A1,A2,A3,TMXH,ITYPE,NUM)                         1343

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

      DATA GETHRU/.8/                                                   1366
C     ...PHASER FIRING ROUTINE FOR E AND G.                             1370
      NDX=(ITYPE-3)*9+NUM+1                                             1371
      IF(ICNTL(NDX).EQ.1)GO TO 99                                       1372
      CALL GETBRG(DELV,XQE,A1,YQE,A2,VPX,VPY)                           1373
      DELTA=360.                                                        1374
      IF(EFP(2).EQ.3.)DELTA=180.                                        1375
      DELV=DELTA-PDEG+DELV                                              1376
      IF(DELV.GE.360.)DELV=DELV-360.                                    1377
      IF(DELV.LT.0.)DELV=DELV+360.                                      1378
      IF(DELV.GT.90..AND.DELV.LE.270.)DELV=90.                          1379
      IF(DELV.GT.270.)DELV=360.-DELV                                    1380
      IF(DELV.GE.90.)GO TO 99                                           1381
C     ...CALCULATE STRENGTH OF HIT DEPENDING ON BEARING                 1382
C     ...TO TARGET AND DISTANCE.                                        1383
      DELV=COSD(DELV)*COSD(DELV)*DISTPE*EFP(3)/(VPX*VPX+VPY*VPY)        1384
C     ...MASKING EFFECTS. 80 PERCENT GETS THROUGH ANYWAY                1385
      IF(LEVEL.EQ.1)GO TO 2310                                          1386
      CALL MASKEF(A1,A2,XQE,YQE,VPY)                                    1387
      DELV=DELV-VPY*DELV*GETHRU                                         1388
2310  IF( ITYPE.EQ.4.AND.ICLOAK.EQ.2.AND.NUM.EQ.1)GO TO 2311            1389
      WRITE(6,2314)DELV,LETR(ITYPE),NUM,A1,A2                           1390
2314  FORMAT(1X,F7.1,' UNIT HIT ON ',A1,I1,' AT ',F4.1,',',F4.1)        1391
      GO TO 2315                                                        1392
2311  WRITE(6,2312)DELV,LETR(ITYPE),NUM                                 1393
2312  FORMAT(1X,F7.1,' UNIT HIT ON ',A1,I1)                             1394
2315  A3=A3+DELV                                                        1395
C     ...CHECK IF TOTAL HITS=DESTRUCTION.                               1396
      IF(A3.LT.TMXH)GO TO 100                                           1397
50    CALL DLETE(ITYPE,NUM)                                             1398
      IF(ITYPE.EQ.3)A1=XKL(NUM,1)                                       1399
      IF(ITYPE.EQ.4)A1=XROM(NUM,1)                                      1400
99    RETURN                                                            1401
C     ...HITS AFFECT CREW AND ANY TROOPS ON BOARD ALSO.                 1402
100   IF(ITRMEN(NDX).EQ.0)GO TO 60                                      1403
      IX=RAN(IZZ)*SQRT(DELV)*2.5                                        1404
      IF(IX.GT.ITRMEN(NDX))IX=ITRMEN(NDX)                               1405
      ITRMEN(NDX)=ITRMEN(NDX)-IX                                        1406
      ITKL(NDX-1)=ITKL(NDX-1)+IX                                        1407
60    IF(ITYPE.EQ.4)GO TO 200                                           1408
      IX=RAN(IZZ)*2.5*SQRT(DELV)                                        1409
      XKL(NUM,9)=XKL(NUM,9)-IX                                          1410
      IF(XKL(NUM,9).LE.0.)GO TO 50                                      1411
      JTKL(NUM)=JTKL(NUM)+IX                                            1412
      GO TO 99                                                          1413
200   IX=RAN(IZZ)*2.5*SQRT(DELV)                                        1414
      CREWR(NUM)=CREWR(NUM)-IX                                          1415
      IF(CREWR(NUM).LE.0.)GO TO 50                                      1416
      JTKL(NUM+9)=JTKL(NUM+9)+IX                                        1417
      GO TO 99                                                          1418
      END                                                               1419

115   IF(IDOCK.EQ.2)GO TO 210                                           0525
      IF(KLNGNS.EQ.0)GO TO 130						