	SUBROUTINE KPHOTON
C*BEGIN COMMON 
      COMMON SNAP,SNAPSHT(247), 
     +   DATE,REMKL,REMCOM,REMBASE,REMRES,REMTIME,STARKL,BASEKL,
     +   KILLK,KILLC,GALAXY(8,8),CX(10),CY(10),BASEQX(5),BASEQY(5), 
     +   NEWSTUF(8,8),PLNETS(10,5),ISX,ISY,NSCREM,NROMKL,NROMREM,
     +   NSCKILL,NPLANKL,ISATB,BATX,BATY,THINGX,THINGY,
     +   QUAD(10,10),KX(20),KY(20),KPOWER(20),KDIST(20),KSTUF(20),  
     +   FUTURE(10),MESSAGE(5,10),
     +   INKLING,INBASE,INRESOR,INCOM,INTIME,INSTAR,INENRG,INSHLD,
     +   INTORPS,INLSR,INDATE,ENERGY,SHLD,SHLDUP,CONDIT,TORPS,SHIP, 
     +   QUADX,QUADY,SECTX,SECTY,WARPFAC,WFACSQ,LSUPRES,DAMAGE(20), 
     +   LENGTH,SKILL,PASSWD,DIST,DIREC,TIME,BASEX,BASEY,DOCKFAC, 
     +   KLHERE,COMHERE,CASUAL,NHELP,NKINKS,STARCH(8,8),
     +   DEVICE(2,14),IDIDIT,GAMEWON,ALIVE,JUSTIN,RESTING,ALLDONE,
     +   DAMFAC,SHLDCHG,NDEVICE,PLNETX,PLNETY,INORBIT,LANDED,IPLANET,
     +   IMINE,ICRYSTL,INPLAN,NENHERE,ISHERE,NEUTZ,IRHERE,ICRAFT,
     +   IENTESC,ISCRAFT,ISCATE,CRYPROB,ICITE,IPHWHO,
     +   CRACKS(12) 
      INTEGER SHLDUP,CONDIT,QUADX,QUADY,SECTX,SECTY,TORPS,
     +   REMKL,REMBASE,SKILL,REMCOM,GALAXY,STARCH,CX,CY, 
     +   SHIP,ALLDONE,BASEQX,BASEQY,BASEX,BASEY,GAMEWON, 
     +   ALIVE,STARKL,BASEKL,CASUAL,COMHERE,RESTING,SNAP,SHLDCHG, 
     +   THINGX,THINGY,BATX,BATY,PLNETX,PLNETY,PLNETS
      REAL KDIST,KPOWER,LSUPRES,INTIME,INRESOR,INDATE,INSHLD,   
     +   INENRG,INLSR 
	BYTE QUAD
	REAL*8 DEVICE,PASSWD
C*END COMMON 
	BYTE IQUAD
      EQUIVALENCE (CRACKS(4),KSHOT) 
C--------ENEMY FIRES PHOTON TORPEDO 
	IX=KX(KSHOT)
	IY=KY(KSHOT)
	STARTX=IX
	STARTY=IY
	DELTX=0.1*(SECTY-STARTY)
	DELTY=0.1*(STARTX-SECTX)
      AC=1.90985932*ATAN2(DELTX,DELTY)
      TEMP=RANF(0)-0.5
      R=TEMP*(1.0+0.001*KPOWER(KSHOT)+RANF(0.))      
      AC=AC+0.25*R
      IQUAD=QUAD(IX,IY) 
      CALL CRMSENA(IQUAD,2,IX,IY) 
      CALL CRAMDMP(22H FIRES PHOTON TORPEDO.  ) 
	KMISF=0
	IF(ABS(TEMP) .GE. 0.45) KMISF=1
	CALL PHOTNT(KMISF, IX, IY, AC)
	IF(ALLDONE.NE.0 .OR. GALAXY(QUADX,QUADY).EQ.1000) RETURN
	IF(REMKL .EQ. 0) CALL FINISH(1)
	RETURN
	END
