	SUBROUTINE CRYSTAL
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 
	IF(ICRYSTL .EQ. 1) GO TO 52 
      CALL PROUT(32HNO DILITHIUM CRYSTALS AVAILABLE.   ,32)
      RETURN
 52   IF(ENERGY .LT. 1000.) GO TO 54
      CALL PROUT(66HSPOCK:  "CAPTAIN, STARFLEET REGULATIONS PROHIBIT SUC
     +H AN OPERATION    ,66) 
      CALL PROUT(41H  EXCEPT WHEN CONDITION YELLOW EXISTS."      ,41)
      RETURN
54	CALL PROUT(46HSPOCK:  "CAPTAIN, I MUST WARN YOU THAT LOADING,46)
      CALL PROUT(46H  RAW DILITHIUM CRYSTALS INTO THE SHIP'S POWER,46)
      CALL PROUT(37H  SYSTEM MAY RISK A SEVERE EXPLOSION.,37)
	CALL PROMPT(30H  ARE YOU SURE THIS IS WISE?"       ,30) 
	IF(JA(DUMMY) .EQ. 0) RETURN
	CALL SKIP(1)
      CALL PROUT(45HENGINEERING OFFICER SCOTT:  "(GULP) AYE SIR.",45) 
      CALL PROUT(32H  "MR. SPOCK AND I WILL TRY IT."   ,32)
      CRYPROB=CRYPROB*2.0 
      CALL SKIP(1)
      CALL PROUT(32HSPOCK:  "CRYSTAL IN PLACE, SIR."          ,32) 
      CALL PROUT(31H  "READY TO ACTIVATE CIRCUIT."   ,31)  
      CALL SKIP(1)
      CALL PROUT(42HSCOTTY:  "KEEP YOUR FINGERS CROSSED, SIR!"   ,42)
      CALL SKIP(1)
      IF(RANF(0) .GT. CRYPROB) GO TO 57 
      CALL PROUT(41H  "ACTIVATING NOW! - - NO GOOD!  IT'S***   ,41)  
      CALL PROUT(54H***RED ALERT!  RED A*L******************************      
     +**,54) 
      CALL STARS
      CALL PROUT(54H*****************    KA-BOOM!!!!    ****************      
     C**    ,54) 
	CALL KABOOM
	RETURN
 57   ENERGY = ENERGY +5000.*(1.+0.9*RANF(0)) 
      CALL PROUT(38H  "ACTIVATING NOW! - - THE INSTRUMENTS    ,38)   
      CALL PROUT(36H   ARE GOING CRAZY, BUT I THINK IT'S    ,36)
      CALL PROUT(41H   GOING TO WORK!  CONGRATULATIONS, SIR!"   ,41) 
      RETURN
	END
