      SUBROUTINE WARP 
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 
	LOGICAL*1 IHS,IHR,IHC,IHK,IHE,IHF,IHBLANK,IHDOT,IHP,IHB
	+ ,IHSTAR,IHT,IHQUEST,IHNUM
      COMMON/HOLLER/IHEOL,IHREAL,IHALPHA,IHS,IHR,IHC,IHK,IHGREEN,IHRED, 
     +IHYELLO,IHDOCKD,IHE,IHF,IHBLANK,IHDOT,IHQUEST,IHP,IHSTAR,IHB
     +,IHT,IHNUM  
1001      IDIDIT=0
      IF(DAMAGE(6) .LE. 10.0) GO TO 2
C--------NO WARP ENGINES
      CALL SKIP(1)
      CALL PROUT(25HWARP ENGINES INOPERATIVE.,25)
      RETURN
2      IF(DAMAGE(6) .EQ. 0.0  .OR.  WARPFAC .LE. 4.0) GO TO 3
      CALL PROUT(52HENGINEER SCOTT:  "SORRY, CAPTAIN.  UNTIL THIS DAMAGE
     +,52) 
      CALL PROUT(43H  IS REPAIRED, I CAN ONLY GIVE YOU WARP 4.",43)
      RETURN
C--------READ IN COURSE AND DISTANCE
 3    CALL GETCD
      IF(DIREC .LT. 0) RETURN 
C--------MAKE SURE STARSHIP HAS ENOUGH ENERGY TO MAKE THE TRIP
      POWER=(DIST+0.05)*WARPFAC*WARPFAC*WARPFAC*(SHLDUP+1)
      IF(POWER .LT. ENERGY) GO TO 10
      CALL SKIP(1)
      CALL PROUT(24H"ENGINEERING TO BRIDGE--,24) 
      IF(SHLDUP.EQ.0 .OR. 0.5*POWER.GT.ENERGY) GO TO 5
      CALL PROUT( 
     +60H  WE HAVEN'T THE ENERGY TO GO THAT FAR WITH THE SHIELDS UP."
	+,60)
      RETURN
 5    IWARP=(ENERGY/(DIST+0.05))**0.3333333333
      IF(IWARP .LE. 0) GO TO 8
      CALL CRAM(
     +   53H  WE HAVEN'T THE ENERGY.  BUT WE COULD DO IT AT WARP )  
      CALL CRAMI(IWARP,0) 
      IF(SHLDUP.NE.0) GO TO 6 
      CALL CRAMDMP(2H.")
      RETURN
 6    CALL CRAMDMP(1H,) 
      CALL PROUT(31H  IF YOU'LL LOWER THE SHIELDS.",31)    
      RETURN
 8    CALL PROUT( 
     +   51H  WE CAN'T DO IT, CAPTAIN.  WE HAVEN'T THE ENERGY.",51)  
      RETURN
C--------MAKE SURE ENOUGH TIME IS LEFT FOR TRIP 
 10   TIME=10.0*DIST/WFACSQ 
      IF(TIME .LT. 0.80*REMTIME) GO TO 20 
      CALL SKIP(1)
      CALL PROUT( 
     +   51HFIRST OFFICER SPOCK:  "CAPTAIN, I COMPUTE THAT SUCH,51)
      CALL CRAM(37H  A TRIP WOULD REQUIRE APPROXIMATELY ) 
      CALL CRAMF(100.0*TIME/REMTIME,0,2)
	CALL CRAMDMP(9H % OF OUR)
      CALL PROMPT( 
     +   48H  REMAINING TIME.  ARE YOU SURE THIS IS WISE?"  ,48) 
      IF(JA(DUMMY) .EQ. 0) RETURN
20	CALL WARPX
      RETURN
	END
