      SUBROUTINE FINISH(I)
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
	1 ,IHSTAR,IHT,IHQUEST,IHNUM,ISHIP
      COMMON/HOLLER/IHEOL,IHREAL,IHALPHA,IHS,IHR,IHC,IHK,IHGREEN,IHRED, 
     +IHYELLO,IHDOCKD,IHE,IHF,IHBLANK,IHDOT,IHQUEST,IHP,IHSTAR,IHB
     +,IHT,IHNUM  
	EQUIVALENCE (SHIP,ISHIP)
      ALLDONE=1 
      ICITE=0
      CALL SKIP(3)
      CALL CRAM(15HIT IS STARDATE ) 
      CALL CRAMF(DATE,0,1)
      CALL CRAMDMP(2H .)
      CALL SKIP(1)
      GO TO (100,200,300,400,500,600,700,800,900,1000,1100,5000,1300, 
     + 1400,1500,1600,1700,1800,5000,5000,2100,2200),I    
C--------CASE 1:  GAME HAS BEEN WON 
100	CALL SUCCES
 130  CALL SKIP(1)
      CALL PROUT(22HLIVE LONG AND PROSPER.,22) 
      CALL SCORE
      IF(ICITE .EQ. 0) RETURN
      CALL SKIP(1)
      CALL PROUT(60HDO YOU WANT YOUR "COMMODORE EMERITUS CITATION" PRINT
     CED?                 ,60) 
      IF(JA(DUMMY) .NE. 0) CALL PLAQUE 
      RETURN
C--------CASE 2:  FEDERATION RESOURCES DEPLETED 
 200  CALL PROUT( 
     +   45HYOUR TIME HAS RUN OUT, AND THE FEDERATION HAS,45)
      CALL PROUT(15HBEEN CONQUERED.,15)
      CALL SKIP(1)
      CALL PROUT( 
     +   54HYOUR STARSHIP IS NOW KLINGON PROPERTY, AND YOU ARE PUT,54) 
      CALL PROUT( 
     +   57HON TRIAL AS A WAR CRIMINAL.  ON THE BASIS OF YOUR RECORD,
	1 ,57)
      IF(REMKL*3 .GT. INKLING) GO TO 210
      CALL PROUT( 
     +   51HYOU ARE FOUND GUILTY AND SENTENCED TO DEATH BY SLOW,51)
      CALL PROUT(8HTORTURE.,8)
	GO TO 5100
 210  CALL PROUT(18HYOU ARE ACQUITTED.,18) 
	GO TO 130
C--------CASE 3:  LIFE SUPPORT SYSTEM FAILURE 
 300  CALL PROUT(44HYOUR LIFE SUPPORT RESERVES HAVE RUN OUT, AND,44) 
      CALL PROUT( 
     +   47HYOU DIE OF THIRST, STARVATION AND ASPHYXIATION.,47)
 310  CALL SKIP(1)
      CALL PROUT(37HYOUR STARSHIP IS A DERELICT IN SPACE.,37)
      GO TO 5000
C--------CASE 4:  ENERGY SUPPLY EXHAUSTED 
 400  CALL PROUT(32HYOUR ENERGY SUPPLY IS EXHAUSTED.,32) 
      GO TO 310 
C--------CASE 5:  DEFEATED IN BATTLE
 500  CALL CRAM(4HTHE ) 
      CALL CRAMSHP
      CALL CRAMDMP(30H HAS BEEN DESTROYED IN BATTLE.) 
      CALL SKIP(1)
      CALL PROUT(37HDULCE ET DECORUM EST PRO PATRIA MORI.,37)
      GO TO 5000
C--------CASE 6:  HIT NEGATIVE ENERGY ZONE THREE TIMES
 600  CALL PROUT( 
     +   57HYOU HAVE MADE THREE ATTEMPTS TO CROSS THE NEGATIVE ENERGY
	1 ,57)
      CALL PROUT(35HBARRIER WHICH SURROUNDS THE GALAXY.,35)
      CALL SKIP(1)
      CALL PROUT(31HYOUR NAVIGATION IS ABOMINABLE. ,31)    
	GO TO 5120
C--------CASE 7:  STARSHIP DESTROYED BY ORDINARY NOVA 
 700  CALL PROUT(43HYOUR STARSHIP HAS BEEN DESTROYED BY A NOVA.,43)
 705  CALL PROUT(22HTHAT WAS A GREAT SHOT.,22) 
      GO TO 5000
C--------CASE 8:  STARSHIP DESTROYED BY A SUPERNOVA 
 800  CALL CRAM(4HTHE ) 
      CALL CRAMSHP
      CALL CRAMDMP(31H HAS BEEN FRIED BY A SUPERNOVA.)
      CALL PROUT(31H...NOT EVEN CINDERS REMAIN...   ,31)   
      GO TO 5000
C--------CASE 9:  ABANDON SHIP AFTER ALL STARBASES HAVE BEEN DESTROYED
 900  CALL PROUT( 
     +   53HYOU HAVE BEEN CAPTURED BY THE KLINGONS.  IF YOU STILL,53)
      CALL PROUT( 
     +   53HHAD A STARBASE TO BE RETURNED TO, YOU WOULD HAVE BEEN,53)
      CALL PROUT( 
     +   53HREPATRIATED AND GIVEN ANOTHER CHANCE.  SINCE YOU HAVE,53)
      CALL PROUT( 
     +   56HNO STARBASES, YOU WILL BE MERCILESSLY TORTURED TO DEATH.,56) 
      GO TO 5000
C--------CASE 10:  STARSHIP SELF-DESTRUCTS OR DILITHIUM CRYSTAL EXPLODES. 
 1000 CALL PROUT(63HYOUR STARSHIP IS NOW AN EXPANDING CLOUD OF SUBATOMIC
     + PARTICLES.,63)
      GO TO 5000
C--------CASE 11:  FAILED TO REMATERIALIZE AFTER CALLING FOR HELP 
 1100 CALL PROUT( 
     +   52HSTARBASE WAS UNABLE TO RE-MATERIALIZE YOUR STARSHIP.,52) 
      CALL PROUT(25HSIC TRANSIT GLORIA MUNDI.,25)
      GO TO 5000
C--------CASE 13.  CAPTAIN LOST IN TRANSPORTER BEAM.
 1300 CALL PROUT(36HYOU AND YOUR LANDING PARTY HAVE BEEN    ,36) 
      CALL PROUT(47HCONVERTED TO ENERGY, DISSIPATING THROUGH SPACE.,47)
      GO TO 1410
C--------CASE 14:  MINING PARTY LEFT ON PLANET AFTER TRACTOR BEAM.
 1400 CALL PROUT(41HYOU ARE LEFT WITH YOUR LANDING PARTY ON        ,41)
      CALL PROUT(54HA WILD JUNGLE PLANET INHABITED BY PRIMITIVE CANNIBAL
     CS.       ,54)
      CALL SKIP(1)
      CALL PROUT(42HTHEY ARE VERY FOND OF "CAPTAIN KIRK" SOUP.,42)
 1410 CALL SKIP(1)
      CALL CRAM(29HWITHOUT YOUR LEADERSHIP, THE  )
      CALL CRAMSHP
      CALL CRAMDMP(14H IS DESTROYED.) 
      GO TO 5000
C--------CASE 15:  ENTERPRISE DESTROYS PLANET WITH MINING PARTY ON IT.
 1500 CALL PROUT(33HYOU AND YOUR MINING PARTY PERISH.       ,33) 
      GO TO 705 
C--------CASE 16.  KIRK FRIED BY NOVA WHILE ON PLANET.
 1600 CALL PROUT(41HYOU AND YOUR MINING PARTY ARE ATOMIZED.       ,41) 
      CALL SKIP(1)
      CALL CRAM(31HMR. SPOCK TAKES COMMAND OF THE  )
      CALL CRAMSHP
      CALL CRAMDMP(4H AND)
      CALL PROUT(54HJOINS THE ROMULANS, REIGNING TERROR ON THE FEDERATIO
     CN.     ,54)
      GO TO 5000
C--------CASE 17.  KIRK FRIED BY SUPERNOVA IN SHUTTLE CRAFT.
 1700 CALL PROUT(51HGALILEO IS INSTANTLY ANNIHILATED BY THE SUPERNOVA.
     C     ,51)    
      GO TO 1600
C--------CASE 18.  SHUTTLE CRAFT CAUGHT IN TRACTOR BEAM.
 1800 CALL PROUT(37HSHUTTLE CRAFT GALILEO IS ALSO CAUGHT,     ,37) 
      CALL PROUT(31HAND BREAKS UP UNDER THE STRAIN.      ,31)
      CALL SKIP(1)
      CALL PROUT(47HYOUR DEBRIS IS SCATTERED FOR MILLIONS OF MILES.,47)
      GO TO 1410
C--------CASE 19.  DEATH RAY CONVERTS CREW INTO MUTANTS.
C--------CASE 21.  BLACK HOLE SWALLOWS SHIP.
 2100 CALL PROUT(51HYOUR SHIP IS DRAWN TO THE CENTER OF THE BLACK HOLE. 
     +  ,51) 
      CALL PROUT(44HYOU ARE CRUSHED INTO EXTREMELY DENSE MATTER.,44) 
      GO TO 5000
C--------CASE 22.  SHIP DESTROYED BY A TORPEDO BOOMERANG
 2200 CALL PROUT(31HYOU ARE POSTHUMOUSLY AWARDED A     ,31)
      CALL PROUT(31HSTARFLEET MARKSMANSHIP AWARD.      ,31) 
      GO TO 705 
C--------DECIDE FINAL OUTCOME OF GAME AFTER YOUR DEATH
 5000 CALL SKIP(1)
      IF(ISHIP .EQ. IHF) ISHIP=0
      IF(ISHIP .EQ. IHE) ISHIP=IHF
      IF(REMKL .EQ. 0) GO TO 5050 
      GOODIES=REMRES/INRESOR
      BADDIES=(REMKL+2.0*REMCOM)/(INKLING+2.0*INCOM)
      ADVANTG=GOODIES/BADDIES 
      IF(ADVANTG .LT. (1.0+0.5*RANF(0))) GO TO 5020 
      CALL PROUT( 
     +   54HAS A RESULT OF YOUR ACTIONS, A TREATY WITH THE KLINGON,54) 
      CALL PROUT( 
     +   52HEMPIRE HAS BEEN SIGNED.  THE TERMS OF THE TREATY ARE,52) 
      IF(ADVANTG .LT. (3.0+RANF(0))) GO TO 5010 
      CALL PROUT(29HFAVOURABLE TO THE FEDERATION.,29) 
      CALL SKIP(1)
      CALL PROUT(16HCONGRATULATIONS.,16) 
      GO TO 5100
 5010 CALL PROUT(38HHIGHLY UNFAVOURABLE TO THE FEDERATION.,38)
      GO TO 5100
 5020 CALL PROUT(33HTHE FEDERATION WILL BE DESTROYED.,33)
	GO TO 5100
C--------STILL ANOTHER CASE--SUCCESSFUL KAMIKAZE TACTICS
 5050 CALL PROUT( 
     +   51HSINCE YOU TOOK THE LAST KLINGON WITH YOU, YOU ARE A,51)
      CALL PROUT( 
     +   51HMARTYR AND A HERO.  SOMEDAY MAYBE THEY'LL ERECT A   ,51) 
      CALL PROUT( 
     +   51HSTATUE IN YOUR MEMORY.  REST IN PEACE, AND TRY NOT  ,51) 
      CALL PROUT(23HTO THINK ABOUT PIGEONS.,23)
      GAMEWON=1 
5100	ALIVE=0 
5120	CALL SCORE
      RETURN
      END 
