      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER NM(102)
      INTEGER SAVEL0
      INTEGER ENTER0,DUPLX$
      INTEGER DUMMY
      INTEGER * 4 READC0
      INTEGER * 4 TM
      SHORTCALL MKONU$
      EXTERNAL LOGOUT
      INTEGER AAAAA0(25)
      INTEGER AAAAB0(5)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAA0/215,229,236,227,239,237,229,160,244,239,160,208,242,23
     *3,237,229,160,205,245,236,244,242,229,235,0/
      DATA AAAAB0/7,-13105,-14385,-10796,-23392/
      CALL RND(INTS(READC0(TM)))
      CALL GETEK0(ECHAR,KCHAR)
      CALL DOARGS(PHANU0)
      IF((PHANU0.NE.1))GOTO 10000
        PHCON0=0
        PHCHE0=0
        PHANT0=2
        CALL GETPH0(NM)
        GOTO 10001
10000   CALL VTPUTL(AAAAA0,3,11)
        CALL GETPL0(NM)
10001 CALL BREAK$(1)
      CALL MKONU$(AAAAB0,LOC(LOGOUT))
      IF((ENTER0(NM).NE.-3))GOTO 10002
        CALL BREAK$(0)
        CALL SWT
10002 SAVEL0=DUPLX$(-1)
      CALL DUPLX$(:140000)
      CURSOR=0
      CALL BUILD0
      CALL PLAYM0
      CALL GOODB0
      CALL CLEAR0
      CALL DUPLX$(SAVEL0)
      CALL BREAK$(0)
      CALL SWT
      END
      INTEGER FUNCTION ALLOC0(DUMMY)
      INTEGER DUMMY
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER P
      INTEGER DSGET
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      ALLOC0=-3
      P=DSGET(2)
      IF((P.NE.0))GOTO 10003
        RETURN
10003 HEADP0(P)=0
      TAILP0(P)=0
      MSGQU0(PLAYER)=P
      ALLOC0=-2
      RETURN
      END
      SUBROUTINE CLEAR0
      INTEGER CODE
      CALL TTY$RS(:40000,CODE)
      RETURN
      END
      INTEGER FUNCTION ENTER0(NM)
      INTEGER NM(1)
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER FD,PFD
      INTEGER JUNK,CODE
      INTEGER MSG(102)
      INTEGER LOCKF0(17)
      INTEGER FINDS0,UNIFO0,ALLOC0
      INTEGER OPEN,MAPFD
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA LOCKF0/189,231,225,237,229,243,189,175,237,245,236,238,225,23
     *7,229,243,0/
      FD=OPEN(LOCKF0,1)
      IF((FD.NE.-3))GOTO 10004
        CALL REMARK('Can''t open database lock file@. Please notify a gu
     *ru.')
        CALL CLOSE(FD)
        ENTER0=-3
        RETURN
10004 PFD=MAPFD(FD)
      IF((PFD.NE.-3))GOTO 10005
        CALL REMARK('Can''t open database lock file@. Please notify a gu
     *ru.')
        CALL CLOSE(FD)
        ENTER0=-3
        RETURN
10005 CALL SEM$OU(PFD,1,DBLOCK,-1,CODE)
      IF((CODE.EQ.0))GOTO 10006
        CALL REMARK('Can''t allocate database lock@. Please notify a gur
     *u.')
        CALL CLOSE(FD)
        ENTER0=-3
        RETURN
10006 CALL CLOSE(FD)
      CALL LOCKDB
      IF((FINDS0(PLAYER).NE.-1))GOTO 10007
        ENTER0=-3
        CALL REMARK('The galaxy is full@. Please try again later@..')
        GOTO 10008
10007   IF((ALLOC0(JUNK).NE.-3))GOTO 10009
          ENTER0=-3
          CALL REMARK('Can''t allocate msg queue@. Please notify a guru@
     *..')
          GOTO 10010
10009     ENTER0=-2
          CALL COMME0(MSG)
          BEARI0(PLAYER)=UNIFO0(0,359)
          XPOSA0(PLAYER)=UNIFO0(0,10000)
          YPOSA0(PLAYER)=UNIFO0(0,10000)
          SHIEL0(PLAYER)=150
          RESER0(PLAYER)=50
          RESEA0(PLAYER)=100
          PHASE0(PLAYER)=50
          TORPE0(PLAYER)=7
          WARPA0(PLAYER)=0
          LOCKE0(PLAYER)=0
          KILLS0(PLAYER)=0
          CALL CTOC(NM,NAMEA0(1,PLAYER),21)
10010 CONTINUE
10008 CALL UNLOC0
      RETURN
      END
      SUBROUTINE EXITG0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER I
      INTEGER MSGP
      INTEGER RECVM0
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
10011 IF((RECVM0(MSGP).EQ.0))GOTO 10012
        IF((REFCO0(MSGP).NE.0))GOTO 10011
          CALL DSFREE(MSGP)
10013 GOTO 10011
10012 CALL DSFREE(MSGQU0(PLAYER))
      XPOSA0(PLAYER)=0
      YPOSA0(PLAYER)=0
      BEARI0(PLAYER)=0
      WARPA0(PLAYER)=0
      PHASE0(PLAYER)=0
      TORPE0(PLAYER)=0
      RESER0(PLAYER)=0
      RESEA0(PLAYER)=0
      SHIEL0(PLAYER)=-1
      KILLS0(PLAYER)=0
      LOCKE0(PLAYER)=0
      MSGQU0(PLAYER)=0
      DO 10014 I=1,21
        NAMEA0(I,PLAYER)=0
10014 CONTINUE
10015 RETURN
      END
      INTEGER FUNCTION FINDS0(SLOT)
      INTEGER SLOT
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER FENCE,I
      INTEGER UNIFO0
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      SLOT=-1
      FINDS0=SLOT
      FENCE=UNIFO0(1,10)
      I=FENCE
      GOTO 10018
10016 CONTINUE
10018 IF((SHIEL0(I).LT.0))GOTO 10017
        I=MOD(I,10)+1
        IF((I.NE.FENCE))GOTO 10016
          RETURN
10017 SLOT=I
      FINDS0=SLOT
      RETURN
      END
      SUBROUTINE GETEK0(ECHAR,KCHAR)
      INTEGER ECHAR,KCHAR
      INTEGER CODE
      CALL ERKL$$(1,ECHAR,KCHAR,CODE)
      IF((CODE.EQ.0))GOTO 10020
        ECHAR=136
        KCHAR=255
10020 RETURN
      END
      SUBROUTINE GETPH0(NAME)
      INTEGER NAME(1)
      INTEGER FD,I,LINE
      INTEGER OPEN,GETLIN,UNIFO0
      INTEGER JUNK(102)
      INTEGER NAMEL0(17)
      INTEGER AAAAC0(5)
      DATA NAMEL0/189,231,225,237,229,243,189,175,237,245,236,238,225,23
     *7,229,243,0/
      DATA AAAAC0/194,239,250,239,0/
      FD=OPEN(NAMEL0,1)
      IF((FD.EQ.-3))GOTO 10021
        I=0
        GOTO 10024
10022   I=I+1
10024   IF((GETLIN(JUNK,FD).EQ.-1))GOTO 10023
        GOTO 10022
10023   IF((I.LE.0))GOTO 10025
          LINE=UNIFO0(1,I)
          CALL REWIND(FD)
          I=1
          GOTO 10028
10026     I=I+1
10028     IF((I.GE.LINE))GOTO 10027
            CALL GETLIN(JUNK,FD)
          GOTO 10026
10027     I=GETLIN(NAME,FD)
          IF(((I.EQ.-1).OR.(I.LE.0)))GOTO 10029
            NAME(I)=0
            CALL CLOSE(FD)
            RETURN
10029   CONTINUE
10025   CALL CLOSE(FD)
10021 CALL CTOC(AAAAC0,NAME,102)
      RETURN
      END
      SUBROUTINE GETPL0(NAME)
      INTEGER NAME(1)
      INTEGER I
      INTEGER AAAAD0(21)
      INTEGER AAAAE0(25)
      DATA AAAAD0/197,238,244,229,242,160,240,236,225,249,233,238,231,16
     *0,238,225,237,229,186,160,0/
      DATA AAAAE0/217,239,245,160,225,242,229,160,232,229,242,229,226,24
     *9,160,228,245,226,226,229,228,160,170,243,0/
      CALL VTUPD(1)
      CALL VTPUTL(AAAAD0,6,1)
      CALL VTENB(6,21,21)
      CALL VTREAD(6,21,0)
      CALL VTENB(6,21,0)
      CALL VTGETL(NAME,6,21,21)
      I=1
      GOTO 10032
10030 I=I+1
10032 IF((NAME(I).EQ.0))GOTO 10031
        IF((NAME(I).GE.160))GOTO 10030
          NAME(I)=160
10033 GOTO 10030
10031 NAME(21)=0
      I=1
      GOTO 10036
10034 I=I+1
10036 IF((NAME(I).EQ.0))GOTO 10035
        IF((NAME(I).LE.160))GOTO 10034
          RETURN
10035 CALL GETPH0(NAME)
      CALL VTPRT(7,1,AAAAE0,NAME)
      CALL VTUPD(0)
      CALL SLEEP$(INTL(2000))
      RETURN
      END
      SUBROUTINE GOODB0
      INTEGER CODE
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAAAF0(27)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAF0/212,232,225,238,235,243,160,230,239,242,160,240,236,22
     *5,249,233,238,231,160,205,245,236,244,242,229,235,0/
      CALL SEM$CL(DBLOCK,CODE)
      CALL SLEEP$(INTL(5000))
      CALL VTCLR(1,1,24,80)
      CALL VTPUTL(AAAAF0,3,11)
      CALL VTUPD(1)
      CALL VTSTOP
      RETURN
      END
      SUBROUTINE ADDTO0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER ADDIT0
      INTEGER CTOI
      INTEGER AAAAG0(19)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAG0/206,239,244,160,229,238,239,245,231,232,160,242,229,24
     *3,229,242,246,229,0/
      ADDIT0=CTOI(COMMA0,CURSOR)
      IF((ADDIT0.NE.0))GOTO 10038
        ADDIT0=RESER0(PLAYER)
10038 ADDIT0=MIN0(ADDIT0,300-RESEA0(PLAYER))
      IF((ADDIT0.GT.0))GOTO 10039
        RETURN
10039   IF((ADDIT0.LE.RESER0(PLAYER)))GOTO 10040
          CALL COMME0(AAAAG0)
          GOTO 10041
10040     RESEA0(PLAYER)=RESEA0(PLAYER)+ADDIT0
          RESER0(PLAYER)=RESER0(PLAYER)-ADDIT0
10041 CONTINUE
      RETURN
      END
      SUBROUTINE ADDTP0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER ADDIT0
      INTEGER CTOI
      INTEGER AAAAH0(19)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAH0/206,239,244,160,229,238,239,245,231,232,160,242,229,24
     *3,229,242,246,229,0/
      ADDIT0=CTOI(COMMA0,CURSOR)
      IF((ADDIT0.NE.0))GOTO 10042
        ADDIT0=RESER0(PLAYER)
10042 ADDIT0=MIN0(ADDIT0,400-SHIEL0(PLAYER))
      IF((ADDIT0.GT.0))GOTO 10043
        RETURN
10043   IF((ADDIT0.LE.RESER0(PLAYER)))GOTO 10044
          CALL COMME0(AAAAH0)
          GOTO 10045
10044     SHIEL0(PLAYER)=SHIEL0(PLAYER)+ADDIT0
          RESER0(PLAYER)=RESER0(PLAYER)-ADDIT0
10045 CONTINUE
      RETURN
      END
      INTEGER FUNCTION ANGLE0(A1,A2)
      INTEGER A1,A2
      INTEGER B
      B=IABS(A1-A2)
      IF((B.LE.180))GOTO 10046
        ANGLE0=360-B
        GOTO 10047
10046   ANGLE0=B
10047 RETURN
      END
      INTEGER FUNCTION BROAD0(MSG)
      INTEGER MSG(1)
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER I
      INTEGER LENGTH
      INTEGER P
      INTEGER DSGET
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      P=DSGET(LENGTH(MSG)+2)
      BROAD0=P
      IF((P.NE.0))GOTO 10048
        RETURN
10048 REFCO0(P)=0
      CALL SCOPY(MSG,1,MSGTE0(P),1)
      I=1
      GOTO 10051
10049 I=I+1
10051 IF((I.GT.10))GOTO 10050
        IF((SHIEL0(I).LT.0))GOTO 10049
          CALL SENDM0(P,I)
10052 GOTO 10049
10050 RETURN
      END
      SUBROUTINE BUYPH0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER ADDIT0
      INTEGER CTOI
      INTEGER AAAAI0(19)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAI0/206,239,244,160,229,238,239,245,231,232,160,242,229,24
     *3,229,242,246,229,0/
      ADDIT0=CTOI(COMMA0,CURSOR)
      IF((ADDIT0.NE.0))GOTO 10053
        ADDIT0=RESER0(PLAYER)
10053 ADDIT0=MIN0(ADDIT0,350-PHASE0(PLAYER))
      IF((ADDIT0.GT.0))GOTO 10054
        RETURN
10054   IF((ADDIT0.LE.RESER0(PLAYER)))GOTO 10055
          CALL COMME0(AAAAI0)
          GOTO 10056
10055     PHASE0(PLAYER)=PHASE0(PLAYER)+ADDIT0
          RESER0(PLAYER)=RESER0(PLAYER)-ADDIT0
10056 CONTINUE
      RETURN
      END
      SUBROUTINE BUYTO0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER ADDIT0,COST
      INTEGER CTOI
      INTEGER AAAAJ0(19)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAJ0/206,239,244,160,229,238,239,245,231,232,160,242,229,24
     *3,229,242,246,229,0/
      ADDIT0=CTOI(COMMA0,CURSOR)
      IF((ADDIT0.NE.0))GOTO 10057
        ADDIT0=RESER0(PLAYER)/10
10057 ADDIT0=MIN0(ADDIT0,15-TORPE0(PLAYER))
      COST=ADDIT0*10
      IF((ADDIT0.GT.0))GOTO 10058
        RETURN
10058   IF((COST.LE.RESER0(PLAYER)))GOTO 10059
          CALL COMME0(AAAAJ0)
          GOTO 10060
10059     TORPE0(PLAYER)=TORPE0(PLAYER)+ADDIT0
          RESER0(PLAYER)=RESER0(PLAYER)-COST
10060 CONTINUE
      RETURN
      END
      SUBROUTINE CHANG0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER WP
      INTEGER CTOI
      INTEGER AAAAK0(13)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAK0/201,236,236,229,231,225,236,160,247,225,242,240,0/
      WP=CTOI(COMMA0,CURSOR)
      IF((WP.GE.0))GOTO 10061
        RETURN
10061   IF((WP.LE.8))GOTO 10062
          CALL COMME0(AAAAK0)
          GOTO 10063
10062     WARPA0(PLAYER)=WP
10063 CONTINUE
      RETURN
      END
      REAL * 8 FUNCTION COSINE(ANGLE)
      INTEGER ANGLE
      REAL * 8 FANGLE
      FANGLE=ANGLE*0.01745329252
      COSINE=DCOS(FANGLE)
      RETURN
      END
      INTEGER FUNCTION CYCLE(COMMB0)
      INTEGER COMMB0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER ENERG0,ENERH0,DISTA0,DELTAX,DELTAY
      INTEGER PROCE0
      REAL * 8 DELTA0
      REAL * 8 SINE,COSINE
      INTEGER AAAAL0(27)
      INTEGER AAAAM0(21)
      INTEGER AAAAN0(36)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAAAL0/170,170,170,170,160,200,249,240,229,242,173,232,249,24
     *0,229,242,160,247,225,242,240,160,170,170,170,170,0/
      DATA AAAAM0/170,170,170,170,160,200,249,240,229,242,160,247,225,24
     *2,240,160,170,170,170,170,0/
      DATA AAAAN0/211,239,242,242,249,172,160,226,245,244,160,249,239,24
     *5,160,232,225,246,229,160,226,229,229,238,160,228,229,243,244,242,
     *239,249,229,228,161,0/
      DELTA0=0002000/1000
      ENERG0=WARPA0(PLAYER)**1.66667*DELTA0*0.1750
      ENERH0=RESEA0(PLAYER)*DELTA0*0.02
      IF((ENERG0.GT.RESER0(PLAYER)+ENERH0))GOTO 10064
        DISTA0=WARPA0(PLAYER)**1.66667*DELTA0*2.60417
        DELTAX=DISTA0*COSINE(BEARI0(PLAYER))
        DELTAY=DISTA0*SINE(BEARI0(PLAYER))
        XPOSA0(PLAYER)=XPOSA0(PLAYER)+DELTAX
        YPOSA0(PLAYER)=YPOSA0(PLAYER)+DELTAY
        IF(((XPOSA0(PLAYER).GE.0).AND.(XPOSA0(PLAYER).LE.10000)))GOTO   
     *   10065
        IF(((YPOSA0(PLAYER).GE.0).AND.(YPOSA0(PLAYER).LE.10000)))GOTO   
     *   10065
          CALL COMME0(AAAAL0)
          ENERG0=ENERG0+10*2
          GOTO 10066
10065     IF(((XPOSA0(PLAYER).LT.0).OR.(XPOSA0(PLAYER).GT.10000)))GOTO  
     *    10068
          IF(((YPOSA0(PLAYER).LT.0).OR.(YPOSA0(PLAYER).GT.10000)))GOTO  
     *    10068
          GOTO 10067
10068       CALL COMME0(AAAAM0)
            ENERG0=ENERG0+10
10067   CONTINUE
10066   XPOSA0(PLAYER)=MOD(XPOSA0(PLAYER)+10000,10000)
        YPOSA0(PLAYER)=MOD(YPOSA0(PLAYER)+10000,10000)
        RESER0(PLAYER)=RESER0(PLAYER)-ENERG0
10064 RESER0(PLAYER)=MIN0(RESER0(PLAYER)+ENERH0,250)
      IF((RESER0(PLAYER).GE.0))GOTO 10069
        SHIEL0(PLAYER)=MAX0(SHIEL0(PLAYER)+RESER0(PLAYER),0)
        RESER0(PLAYER)=0
10069 IF((SHIEL0(PLAYER).LT.0))GOTO 10070
        CYCLE=PROCE0(COMMB0)
        GOTO 10071
10070   CYCLE=-1
        CALL COMME0(AAAAN0)
10071 CALL UPDAT0
      RETURN
      END
      INTEGER FUNCTION DECOD0(COMMA0,CURSOR)
      INTEGER COMMA0(1)
      INTEGER CURSOR
      INTEGER EQUAL
      INTEGER CMD(3)
      INTEGER MAPDN,TYPE
      INTEGER AAAAO0(3)
      INTEGER AAAAP0(3)
      INTEGER AAAAQ0(3)
      INTEGER AAAAR0(3)
      INTEGER AAAAS0(3)
      INTEGER AAAAT0(3)
      INTEGER AAAAU0(3)
      INTEGER AAAAV0(3)
      INTEGER AAAAW0(3)
      INTEGER AAAAX0(3)
      INTEGER AAAAY0(3)
      INTEGER AAAAZ0(3)
      INTEGER AAABA0(3)
      DATA AAAAO0/242,243,0/
      DATA AAAAP0/243,232,0/
      DATA AAAAQ0/240,232,0/
      DATA AAAAR0/240,244,0/
      DATA AAAAS0/247,240,0/
      DATA AAAAT0/227,236,0/
      DATA AAAAU0/229,248,0/
      DATA AAAAV0/230,240,0/
      DATA AAAAW0/230,244,0/
      DATA AAAAX0/237,243,0/
      DATA AAAAY0/240,238,0/
      DATA AAAAZ0/244,245,0/
      DATA AAABA0/236,235,0/
10072 IF((COMMA0(CURSOR).NE.160))GOTO 10073
        CURSOR=CURSOR+(1)
      GOTO 10072
10073 CMD(1)=COMMA0(CURSOR)
      IF((COMMA0(CURSOR).EQ.0))GOTO 10074
        CMD(2)=COMMA0(CURSOR+1)
10074 CMD(3)=0
10075 IF((TYPE(COMMA0(CURSOR)).NE.225))GOTO 10076
        CURSOR=CURSOR+1
      GOTO 10075
10076 IF((EQUAL(CMD,0).NE.1))GOTO 10077
        DECOD0=0
        GOTO 10078
10077   IF((EQUAL(CMD,AAAAO0).NE.1))GOTO 10079
          DECOD0=1
          GOTO 10080
10079     IF((EQUAL(CMD,AAAAP0).NE.1))GOTO 10081
            DECOD0=2
            GOTO 10082
10081       IF((EQUAL(CMD,AAAAQ0).NE.1))GOTO 10083
              DECOD0=3
              GOTO 10084
10083         IF((EQUAL(CMD,AAAAR0).NE.1))GOTO 10085
                DECOD0=4
                GOTO 10086
10085           IF((EQUAL(CMD,AAAAS0).NE.1))GOTO 10087
                  DECOD0=5
                  GOTO 10088
10087             IF((EQUAL(CMD,AAAAT0).NE.1))GOTO 10089
                    DECOD0=6
                    GOTO 10090
10089               IF((EQUAL(CMD,AAAAU0).NE.1))GOTO 10091
                      DECOD0=7
                      GOTO 10092
10091                 IF((EQUAL(CMD,AAAAV0).NE.1))GOTO 10093
                        DECOD0=8
                        GOTO 10094
10093                   IF((EQUAL(CMD,AAAAW0).NE.1))GOTO 10095
                          DECOD0=9
                          GOTO 10096
10095                     IF((EQUAL(CMD,AAAAX0).NE.1))GOTO 10097
                            DECOD0=10
                            GOTO 10098
10097                       IF((EQUAL(CMD,AAAAY0).NE.1))GOTO 10099
                              DECOD0=11
                              GOTO 10100
10099                         IF((EQUAL(CMD,AAAAZ0).NE.1))GOTO 10101
                                DECOD0=12
                                GOTO 10102
10101                           IF((EQUAL(CMD,AAABA0).NE.1))GOTO 10103
                                  DECOD0=13
                                  GOTO 10104
10103                             DECOD0=14
10104                         CONTINUE
10102                       CONTINUE
10100                     CONTINUE
10098                   CONTINUE
10096                 CONTINUE
10094               CONTINUE
10092             CONTINUE
10090           CONTINUE
10088         CONTINUE
10086       CONTINUE
10084     CONTINUE
10082   CONTINUE
10080 CONTINUE
10078 RETURN
      END
      INTEGER FUNCTION DEQUE0(QUEUE)
      INTEGER QUEUE
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DEQUE0=HEADP0(QUEUE)
      IF((DEQUE0.EQ.0))GOTO 10105
        HEADP0(QUEUE)=LINKA0(DEQUE0)
10105 IF((HEADP0(QUEUE).NE.0))GOTO 10106
        TAILP0(QUEUE)=0
10106 RETURN
      END
      SUBROUTINE DOARGS(PHANU0)
      INTEGER PHANU0
      INTEGER ARG(128),TERM(7)
      INTEGER I
      INTEGER GETARG,EQUAL
      INTEGER VTINIT
      INTEGER AAABB0(31)
      DATA AAABB0/244,229,242,237,160,244,249,240,229,160,167,170,243,16
     *7,160,238,239,244,160,243,245,240,240,239,242,244,229,228,170,238,
     *0/
      PHANU0=0
      I=1
      GOTO 10109
10107 I=I+1
10109 IF((GETARG(I,ARG,128).EQ.-1))GOTO 10108
        CALL MAPSTR(ARG,1)
        IF(((ARG(1).NE.173).OR.(ARG(2).NE.0)))GOTO 10107
          PHANU0=1
10110 GOTO 10107
10108 IF((VTINIT(TERM).NE.-3))GOTO 10111
        CALL PRINT(-15,AAABB0,TERM)
        CALL SETERR(1000)
        CALL SWT
10111 RETURN
      END
      INTEGER FUNCTION DONE(COMMB0)
      INTEGER COMMB0
      LOGICAL FLAG
      INTEGER CODE
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      CALL TQUIT$(FLAG)
      IF((.NOT.FLAG))GOTO 10112
      IF((PHANU0.NE.1))GOTO 10112
        DONE=1
        RETURN
10112 IF((.NOT.FLAG))GOTO 10113
        CALL CLEAR0
        COMMB0=0
        CURSOR=0
10113 DONE=0
      RETURN
      END
      SUBROUTINE DSFREE(BLOCK)
      INTEGER BLOCK
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER P0,P,Q
      INTEGER N
      INTEGER CON(10)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      P0=BLOCK-2
      N=MEMAA0(P0+1)
      Q=2
10114   P=MEMAA0(Q+0)
        IF((P.EQ.0))GOTO 10117
        IF((P.GT.P0))GOTO 10117
        GOTO 10115
10115   Q=P
      GOTO 10114
10117 IF((Q+MEMAA0(Q+1).LE.P0))GOTO 10118
        RETURN
10118 IF(((P0+N.NE.P).OR.(P.EQ.0)))GOTO 10119
        N=N+MEMAA0(P+1)
        MEMAA0(P0+0)=MEMAA0(P+0)
        GOTO 10120
10119   MEMAA0(P0+0)=P
10120 IF((Q+MEMAA0(Q+1).NE.P0))GOTO 10121
        MEMAA0(Q+1)=MEMAA0(Q+1)+N
        MEMAA0(Q+0)=MEMAA0(P0+0)
        GOTO 10122
10121   MEMAA0(Q+0)=P0
        MEMAA0(P0+1)=N
10122 RETURN
      END
      INTEGER FUNCTION DSGET(W)
      INTEGER W
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER P,Q,L
      INTEGER N,K
      INTEGER C(10)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      N=W+2
      Q=2
10123   P=MEMAA0(Q+0)
        IF((P.NE.0))GOTO 10124
          DSGET=0
          RETURN
10124   IF((MEMAA0(P+1).LT.N))GOTO 10125
          GOTO 10126
10125   Q=P
      GOTO 10123
10126 K=MEMAA0(P+1)-N
      IF((K.LT.8))GOTO 10127
        MEMAA0(P+1)=K
        L=P+K
        MEMAA0(L+1)=N
        GOTO 10128
10127   MEMAA0(Q+0)=MEMAA0(P+0)
        L=P
10128 DSGET=L+2
      RETURN
      END
      SUBROUTINE ENQUE0(ENTRY,QUEUE)
      INTEGER ENTRY,QUEUE
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER P
      INTEGER AAABC0(38)
      INTEGER AAABD0(37)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABC0/201,238,227,239,238,243,233,243,244,229,238,227,249,16
     *0,233,238,160,237,229,243,243,225,231,229,160,241,245,229,245,229,
     *160,232,229,225,228,229,242,0/
      DATA AAABD0/201,238,227,239,238,243,233,243,244,229,238,227,249,16
     *0,233,238,160,237,229,243,243,225,231,229,160,241,245,229,245,229,
     *160,236,233,238,235,243,0/
      IF((TAILP0(QUEUE).NE.0))GOTO 10129
        IF((HEADP0(QUEUE).EQ.0))GOTO 10130
          CALL ERROR(AAABC0)
10130   TAILP0(QUEUE)=ENTRY
        HEADP0(QUEUE)=ENTRY
        GOTO 10131
10129   P=TAILP0(QUEUE)
        IF((LINKA0(P).EQ.0))GOTO 10132
          CALL ERROR(AAABD0)
10132   LINKA0(P)=ENTRY
        TAILP0(QUEUE)=ENTRY
        LINKA0(ENTRY)=0
10131 RETURN
      END
      SUBROUTINE FIRE(TARGET,DAMAGE)
      INTEGER TARGET,DAMAGE
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAABE0(38)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABE0/163,163,163,163,160,217,239,245,160,231,239,244,160,16
     *7,229,237,160,247,233,244,232,160,244,232,225,244,160,243,232,239,
     *244,161,160,163,163,163,163,0/
      SHIEL0(TARGET)=SHIEL0(TARGET)-(DAMAGE)
      IF((SHIEL0(TARGET).GE.0))GOTO 10133
        CALL COMME0(AAABE0)
        KILLS0(PLAYER)=KILLS0(PLAYER)+1
        CALL HITMSG(PLAYER,TARGET,DAMAGE,1)
        GOTO 10134
10133   CALL HITMSG(PLAYER,TARGET,DAMAGE,0)
10134 RETURN
      END
      SUBROUTINE FIREP0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER NPH,TARGET,RANGE,ANGLE,DAMAGE
      INTEGER CTOI,GETRA0,GETAN0,GETPM0,ANGLE0
      INTEGER AAABF0(33)
      INTEGER AAABG0(25)
      INTEGER AAABH0(25)
      INTEGER AAABI0(21)
      INTEGER AAABJ0(23)
      INTEGER AAABK0(22)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABF0/227,225,238,167,244,160,230,233,242,229,160,244,232,22
     *5,244,160,237,225,238,249,160,225,244,160,239,238,229,160,244,233,
     *237,229,0/
      DATA AAABG0/249,239,245,160,228,239,238,167,244,160,232,225,246,22
     *9,160,244,232,225,244,160,237,225,238,249,0/
      DATA AAABH0/249,239,245,160,227,225,238,167,244,160,243,232,239,23
     *9,244,160,249,239,245,242,243,229,236,230,0/
      DATA AAABI0/240,236,225,249,229,242,160,238,239,244,160,233,238,16
     *0,231,225,236,225,248,249,0/
      DATA AAABJ0/240,236,225,249,229,242,160,233,243,160,239,245,244,16
     *0,239,230,160,242,225,238,231,229,0/
      DATA AAABK0/249,239,245,167,242,229,160,238,239,244,160,230,225,22
     *7,233,238,231,160,232,233,237,0/
      NPH=CTOI(COMMA0,CURSOR)
      TARGET=GETPM0(COMMA0,CURSOR)
      RANGE=GETRA0(PLAYER,TARGET)
      ANGLE=ANGLE0(BEARI0(PLAYER),GETAN0(PLAYER,TARGET))
      IF((NPH.GE.1))GOTO 10135
        RETURN
10135   IF((NPH.LE.100))GOTO 10136
          CALL COMME0(AAABF0)
          GOTO 10137
10136     IF((NPH.LE.PHASE0(PLAYER)))GOTO 10138
            CALL COMME0(AAABG0)
            GOTO 10139
10138       IF((TARGET.NE.PLAYER))GOTO 10140
              CALL COMME0(AAABH0)
              GOTO 10141
10140         IF(((TARGET.LT.1).OR.(TARGET.GT.10)))GOTO 10143
              IF((SHIEL0(TARGET).LT.0))GOTO 10143
              GOTO 10142
10143           CALL COMME0(AAABI0)
                GOTO 10144
10142           IF((RANGE.LE.5000))GOTO 10145
                  CALL COMME0(AAABJ0)
                  GOTO 10146
10145             IF((ANGLE.LE.15))GOTO 10147
                    CALL COMME0(AAABK0)
                    GOTO 10148
10147               DAMAGE=FLOAT(NPH)*FLOAT(5000-RANGE)*FLOAT(15-ANGLE)*
     *1.333E-5+0.5
                    CALL FIRE(TARGET,DAMAGE)
                    PHASE0(PLAYER)=PHASE0(PLAYER)-NPH
10148           CONTINUE
10146         CONTINUE
10144       CONTINUE
10141     CONTINUE
10139   CONTINUE
10137 CONTINUE
      RETURN
      END
      SUBROUTINE FIRET0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER NPT,TARGET,RANGE,DAMAGE
      INTEGER CTOI,GETRA0,GETPM0
      INTEGER AAABL0(33)
      INTEGER AAABM0(25)
      INTEGER AAABN0(26)
      INTEGER AAABO0(21)
      INTEGER AAABP0(23)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABL0/227,225,238,167,244,160,230,233,242,229,160,244,232,22
     *5,244,160,237,225,238,249,160,225,244,160,239,238,229,160,244,233,
     *237,229,0/
      DATA AAABM0/249,239,245,160,228,239,238,167,244,160,232,225,246,22
     *9,160,244,232,225,244,160,237,225,238,249,0/
      DATA AAABN0/249,239,245,160,227,225,238,167,244,160,243,232,239,23
     *9,244,160,249,239,245,242,243,229,236,230,161,0/
      DATA AAABO0/240,236,225,249,229,242,160,238,239,244,160,233,238,16
     *0,231,225,236,225,248,249,0/
      DATA AAABP0/240,236,225,249,229,242,160,233,243,160,239,245,244,16
     *0,239,230,160,242,225,238,231,229,0/
      NPT=CTOI(COMMA0,CURSOR)
      TARGET=GETPM0(COMMA0,CURSOR)
      RANGE=GETRA0(PLAYER,TARGET)
      IF((NPT.GE.1))GOTO 10149
        RETURN
10149   IF((NPT.LE.10))GOTO 10150
          CALL COMME0(AAABL0)
          GOTO 10151
10150     IF((NPT.LE.TORPE0(PLAYER)))GOTO 10152
            CALL COMME0(AAABM0)
            GOTO 10153
10152       IF((TARGET.NE.PLAYER))GOTO 10154
              CALL COMME0(AAABN0)
              GOTO 10155
10154         IF(((TARGET.LT.1).OR.(TARGET.GT.10)))GOTO 10157
              IF((SHIEL0(TARGET).LT.0))GOTO 10157
              GOTO 10156
10157           CALL COMME0(AAABO0)
                GOTO 10158
10156           IF((RANGE.LE.1000))GOTO 10159
                  CALL COMME0(AAABP0)
                  GOTO 10160
10159             DAMAGE=FLOAT(NPT)*FLOAT(1000-RANGE)*0.015+0.5
                  CALL FIRE(TARGET,DAMAGE)
                  TORPE0(PLAYER)=TORPE0(PLAYER)-NPT
10160         CONTINUE
10158       CONTINUE
10155     CONTINUE
10153   CONTINUE
10151 CONTINUE
      RETURN
      END
      INTEGER FUNCTION GETAN0(A,B)
      INTEGER A,B
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      REAL * 8 P1,P2
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      P1=YPOSA0(B)-YPOSA0(A)
      P2=XPOSA0(B)-XPOSA0(A)
      IF(((P1.NE.0).OR.(P2.NE.0)))GOTO 10161
        GETAN0=0
        RETURN
10161 GETAN0=DATAN2(P1,P2)/0.01745329252+0.5
      IF((GETAN0.GE.0))GOTO 10162
        GETAN0=GETAN0+360
10162 RETURN
      END
      INTEGER FUNCTION GETPM0(CMD,I)
      INTEGER CMD(1)
      INTEGER I
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
10163 IF((CMD(I).NE.160))GOTO 10164
        I=I+(1)
      GOTO 10163
10164 IF((CMD(I).LT.225))GOTO 10165
      IF((CMD(I).GT.225+10-1))GOTO 10165
        GETPM0=CMD(I)-225+1
        I=I+(1)
        GOTO 10166
10165   IF((CMD(I).NE.0))GOTO 10167
          GETPM0=LOCKE0(PLAYER)
          GOTO 10168
10167     GETPM0=0
10168 CONTINUE
10166 RETURN
      END
      INTEGER FUNCTION GETRA0(A,B)
      INTEGER A,B
      REAL X
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      X=INTL(XPOSA0(B)-XPOSA0(A))**2+INTL(YPOSA0(B)-YPOSA0(A))**2
      GETRA0=SQRT(X)
      RETURN
      END
      INTEGER FUNCTION GETST0(STR,COMMA0,CURSOR)
      INTEGER STR(1),COMMA0(1)
      INTEGER CURSOR
      INTEGER I
10169 IF((COMMA0(CURSOR).NE.160))GOTO 10170
        CURSOR=CURSOR+(1)
      GOTO 10169
10170 I=1
      GOTO 10173
10171 I=I+1
10173 IF((COMMA0(CURSOR).EQ.0))GOTO 10172
        STR(I)=COMMA0(CURSOR)
        CURSOR=CURSOR+1
      GOTO 10171
10172 STR(I)=0
      GETST0=I-1
      RETURN
      END
      SUBROUTINE HITMSG(AGGRE0,VICTIM,DAMAGE,VICTI0)
      INTEGER AGGRE0,VICTIM,DAMAGE,VICTI0
      INTEGER L
      INTEGER CTOC,ITOC
      INTEGER MSGP
      INTEGER BROAD0
      INTEGER MSG(50)
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAABQ0(19)
      INTEGER AAABR0(25)
      INTEGER AAABS0(13)
      INTEGER AAABT0(13)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABQ0/169,169,169,169,160,248,160,232,233,244,160,249,160,24
     *7,233,244,232,160,0/
      DATA AAABR0/163,163,163,163,160,248,160,196,197,211,212,210,207,21
     *7,197,196,160,249,160,247,233,244,232,160,0/
      DATA AAABS0/160,243,244,242,239,237,243,160,168,168,168,168,0/
      DATA AAABT0/160,243,244,242,239,237,243,160,163,163,163,163,0/
      IF((VICTI0.NE.0))GOTO 10174
        L=CTOC(AAABQ0,MSG,50)+1
        MSG(12)=VICTIM+225-1
        GOTO 10175
10174   L=CTOC(AAABR0,MSG,50)+1
        MSG(18)=VICTIM+225-1
10175 MSG(6)=AGGRE0+225-1
      L=L+ITOC(DAMAGE,MSG(L),5)
      IF((VICTI0.NE.0))GOTO 10176
        CALL CTOC(AAABS0,MSG(L),50-L)
        GOTO 10177
10176   CALL CTOC(AAABT0,MSG(L),50-L)
10177 MSGP=BROAD0(MSG)
      IF((VICTI0.NE.1))GOTO 10178
        CALL SENDM0(MSGP,VICTIM)
10178 RETURN
      END
      SUBROUTINE INPUT0(COMMB0)
      INTEGER COMMB0
      INTEGER C
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      LOGICAL FLAG
      LOGICAL CHKINP
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      IF((PHANU0.NE.1))GOTO 10179
        CALL INPUU0
        COMMB0=1
        RETURN
10179 CONTINUE
10180 IF(((.NOT.CHKINP(FLAG)).OR.(COMMB0.NE.0)))GOTO 10181
        CALL C1IN(C)
        IF((C.NE.ECHAR))GOTO 10182
          IF((CURSOR.LE.0))GOTO 10180
            CURSOR=CURSOR-1
10183     GOTO 10180
10182     IF((C.NE.KCHAR))GOTO 10185
            CURSOR=0
            GOTO 10186
10185       IF((C.NE.138))GOTO 10187
              COMMB0=1
              GOTO 10188
10187         IF(((C.NE.131).OR.(CURSOR.NE.0)))GOTO 10189
                COMMA0(1)=229
                COMMA0(2)=248
                COMMB0=1
                CURSOR=2
                GOTO 10190
10189           IF(((C.GE.160).AND.(C.LE.255)))GOTO 10191
                  GOTO 10192
10191             IF((CURSOR.GE.102-1))GOTO 10193
                    CURSOR=CURSOR+1
                    COMMA0(CURSOR)=C
10193           CONTINUE
10192         CONTINUE
10190       CONTINUE
10188     CONTINUE
10186   CONTINUE
10184 GOTO 10180
10181 COMMA0(CURSOR+1)=0
      RETURN
      END
      SUBROUTINE LOCKDB
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER CODE
      INTEGER AAABU0(35)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABU0/243,229,237,225,240,232,239,242,229,160,247,225,233,24
     *4,160,242,229,241,245,229,243,244,160,238,239,244,160,232,239,238,
     *239,242,229,228,0/
      CALL SEM$WT(DBLOCK,CODE)
      IF((CODE.EQ.0))GOTO 10194
        CALL COMME0(AAABU0)
10194 RETURN
      END
      SUBROUTINE LOCKP0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER GETPM0
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      LOCKE0(PLAYER)=0
10195 IF((COMMA0(CURSOR).NE.160))GOTO 10196
        CURSOR=CURSOR+(1)
      GOTO 10195
10196 IF((COMMA0(CURSOR).EQ.0))GOTO 10197
        LOCKE0(PLAYER)=GETPM0(COMMA0,CURSOR)
10197 RETURN
      END
      SUBROUTINE LOGOUT(CP)
      INTEGER * 4 CP
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER MSG(102)
      INTEGER AAABV0(30)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABV0/236,237,160,168,248,169,160,170,170,160,230,239,242,22
     *7,229,160,236,239,231,231,229,228,160,239,245,244,160,170,170,0/
      CALL CTOC(AAABV0,MSG,102)
      MSG(5)=PLAYER+225-1
      CALL BROAD0(MSG)
      CURSOR=0
      COMMA0(1)=0
      CALL CLEAR0
      SHIEL0(PLAYER)=-1
      RETURN
      END
      INTEGER FUNCTION PERSO0(MSG,I)
      INTEGER MSG(1)
      INTEGER I
      INTEGER LENGTH
      INTEGER P
      INTEGER DSGET
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      P=DSGET(LENGTH(MSG)+2)
      PERSO0=P
      IF((P.NE.0))GOTO 10198
        RETURN
10198 REFCO0(P)=0
      CALL CTOC(MSG,MSGTE0(P),102)
      CALL SENDM0(P,I)
      RETURN
      END
      SUBROUTINE PLAYM0
      INTEGER COMMB0
      INTEGER CYCLE,DONE
      COMMB0=0
10199   CALL INPUT0(COMMB0)
        CALL LOCKDB
        IF((DONE(COMMB0).EQ.1))GOTO 10201
        IF((CYCLE(COMMB0).EQ.-1))GOTO 10201
        GOTO 10200
10201     CALL EXITG0
          CALL UNLOC0
          GOTO 10202
10200   CALL UNLOC0
        CALL SLEEP$(0002000)
      GOTO 10199
10202 RETURN
      END
      INTEGER FUNCTION PROCE0(COMMB0)
      INTEGER COMMB0
      INTEGER CMD
      INTEGER DECOD0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAABW0(16)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABW0/201,236,236,229,231,225,236,160,227,239,237,237,225,23
     *8,228,0/
      PROCE0=-2
      IF((COMMB0.EQ.1))GOTO 10203
        RETURN
10203 CALL COMME0(0)
      CURSOR=1
      CMD=DECOD0(COMMA0,CURSOR)
      GOTO 10204
10206   CALL ADDTO0
        GOTO 10205
10207   CALL ADDTP0
        GOTO 10205
10208   CALL BUYPH0
        GOTO 10205
10209   CALL BUYTO0
        GOTO 10205
10210   CALL CHANG0
        GOTO 10205
10211   CALL VTUPD(1)
        GOTO 10205
10212   PROCE0=-1
        GOTO 10205
10213   CALL FIREP0
        GOTO 10205
10214   CALL FIRET0
        GOTO 10205
10215   CALL SENDG0
        GOTO 10205
10216   CALL SENDP0
        GOTO 10205
10217   CALL TURN
        GOTO 10205
10218   CALL LOCKP0
        GOTO 10205
10219   CALL COMME0(AAABW0)
        GOTO 10205
10220 CONTINUE
10204 GOTO(10206,10207,10208,10209,10210,10211,10212,10213,10214,10215, 
     *    10216,10217,10218,10219),CMD
10205 CURSOR=0
      COMMB0=0
      RETURN
      END
      INTEGER FUNCTION RECVM0(MSGP)
      INTEGER MSGP
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER P
      INTEGER DEQUE0
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      RECVM0=0
      P=DEQUE0(MSGQU0(PLAYER))
      IF((P.NE.0))GOTO 10306
        RETURN
10306 MSGP=MSGPT0(P)
      REFCO0(MSGP)=REFCO0(MSGP)-1
      CALL DSFREE(P)
      RECVM0=MSGP
      RETURN
      END
      SUBROUTINE SENDG0
      INTEGER MSG(102)
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAABX0(8)
      INTEGER AAABY0(22)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABX0/237,243,160,168,248,169,160,0/
      DATA AAABY0/201,160,243,229,229,160,238,239,160,237,229,243,243,22
     *5,231,229,160,232,229,242,229,0/
      CALL CTOC(AAABX0,MSG,102)
      CALL GETST0(MSG(8),COMMA0,CURSOR)
      IF((MSG(8).NE.0))GOTO 10307
        CALL COMME0(AAABY0)
        GOTO 10308
10307   MSG(5)=PLAYER+225-1
        CALL BROAD0(MSG)
10308 RETURN
      END
      INTEGER FUNCTION SENDM0(MSGP,I)
      INTEGER MSGP
      INTEGER I
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER P
      INTEGER DSGET
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      SENDM0=-3
      P=DSGET(2)
      IF((P.NE.0))GOTO 10309
        RETURN
10309 MSGPT0(P)=MSGP
      LINKA0(P)=0
      REFCO0(MSGP)=REFCO0(MSGP)+1
      CALL ENQUE0(P,MSGQU0(I))
      SENDM0=-2
      RETURN
      END
      SUBROUTINE SENDP0
      INTEGER ADDRE0
      INTEGER GETPM0
      INTEGER MSG(102)
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAABZ0(21)
      INTEGER AAACA0(8)
      INTEGER AAACB0(22)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAABZ0/208,236,225,249,229,242,160,238,239,244,160,233,238,16
     *0,231,225,236,225,248,249,0/
      DATA AAACA0/240,238,160,168,248,169,160,0/
      DATA AAACB0/201,160,243,229,229,160,238,239,160,237,229,243,243,22
     *5,231,229,160,232,229,242,229,0/
      ADDRE0=GETPM0(COMMA0,CURSOR)
      IF(((ADDRE0.LT.1).OR.(ADDRE0.GT.10)))GOTO 10311
      IF((SHIEL0(ADDRE0).LT.0))GOTO 10311
      GOTO 10310
10311   CALL COMME0(AAABZ0)
        GOTO 10312
10310   CALL CTOC(AAACA0,MSG,102)
        CALL GETST0(MSG(8),COMMA0,CURSOR)
        IF((MSG(8).NE.0))GOTO 10313
          CALL COMME0(AAACB0)
          GOTO 10314
10313     MSG(5)=PLAYER+225-1
          CALL PERSO0(MSG,ADDRE0)
10314 CONTINUE
10312 RETURN
      END
      REAL * 8 FUNCTION SINE(ANGLE)
      INTEGER ANGLE
      REAL * 8 FANGLE
      FANGLE=ANGLE*0.01745329252
      SINE=DSIN(FANGLE)
      RETURN
      END
      SUBROUTINE TURN
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER ANG,DELTB0,COST,TARGET
      INTEGER CTOI,ANGLE0
      INTEGER GETPM0,GETAN0
      INTEGER AAACC0(16)
      INTEGER AAACD0(19)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAACC0/201,236,236,229,231,225,236,160,226,229,225,242,233,23
     *8,231,0/
      DATA AAACD0/206,239,244,160,229,238,239,245,231,232,160,242,229,24
     *3,229,242,246,229,0/
      TARGET=GETPM0(COMMA0,CURSOR)
      IF((TARGET.EQ.0))GOTO 10315
      IF((SHIEL0(TARGET).LE.0))GOTO 10315
        ANG=GETAN0(PLAYER,TARGET)
        GOTO 10316
10315   ANG=CTOI(COMMA0,CURSOR)
10316 IF(((ANG.GE.0).AND.(ANG.LE.359)))GOTO 10317
        CALL COMME0(AAACC0)
        GOTO 10318
10317   DELTB0=ANGLE0(BEARI0(PLAYER),ANG)
        COST=WARPA0(PLAYER)*DELTB0*.01
        IF((COST.LE.RESER0(PLAYER)))GOTO 10319
          CALL COMME0(AAACD0)
          GOTO 10320
10319     BEARI0(PLAYER)=ANG
          RESER0(PLAYER)=RESER0(PLAYER)-COST
10320 CONTINUE
10318 RETURN
      END
      SUBROUTINE UNLOC0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER CODE
      INTEGER AAACE0(37)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAACE0/243,229,237,225,240,232,239,242,229,160,238,239,244,23
     *3,230,249,160,242,229,241,245,229,243,244,160,238,239,244,160,232,
     *239,238,239,242,229,228,0/
      CALL SEM$NF(DBLOCK,CODE)
      IF((CODE.EQ.0))GOTO 10321
        CALL COMME0(AAACE0)
10321 RETURN
      END
      INTEGER * 4 FUNCTION READC0(CURRE0)
      INTEGER * 4 CURRE0
      INTEGER AR(15)
      CALL TIMDAT(AR,9)
      CURRE0=60*AR(4)+AR(5)
      READC0=CURRE0
      RETURN
      END
      INTEGER FUNCTION UNIFO0(LWB,UPB)
      INTEGER LWB,UPB
      UNIFO0=LWB+(UPB-LWB)*RND(0)
      RETURN
      END
      SUBROUTINE INPUU0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      IF((PHCON0.NE.1))GOTO 10322
        PHTUR0=PHTUR0-1
        IF((PHTUR0.GT.0))GOTO 10323
          PHCON0=0
10323 CONTINUE
10322 IF(((PHCON0.NE.0).OR.(PHCHE0.NE.3)))GOTO 10324
        PHCHE0=1
        CALL SENDA0
        RETURN
10324 CALL DETER0
      GOTO 10325
10327   CALL RUNST0
        GOTO 10326
10328   CALL WAITS0
        GOTO 10326
10329   CALL ATTAC0
        GOTO 10326
10330 CONTINUE
10325 GOTO(10327,10328,10329),PHANT0
10326 RETURN
      END
      SUBROUTINE DETER0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER CLOSE2,CLOSE1,I,DIST,CLOSE0,CLOSF0
      INTEGER PHGET0,UNIFO0
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      IF(((PHCON0.NE.1).OR.(PHVIC0.NE.-1)))GOTO 10427
        PHANT0=2
        RETURN
10427 CLOSE1=0
      CLOSE2=0
      CLOSF0=UNIFO0(800,1300)
      CLOSE0=UNIFO0(1000,2000)
      DO 10428 I=1,10
        IF(((SHIEL0(I).LE.0).OR.(PLAYER.EQ.I)))GOTO 10430
          DIST=PHGET0(PLAYER,I)
          IF((DIST.GE.CLOSE0))GOTO 10431
            CLOSE2=CLOSE2+1
10431     IF((DIST.GE.CLOSF0))GOTO 10432
            CLOSE1=CLOSE1+1
10432   CONTINUE
10430   CONTINUE
10428 CONTINUE
10429 IF((((((PHANT0.NE.3).OR.(SHIEL0(PLAYER).LE.175)).OR.((PHASE0(PLAYE
     *R).LE.0).AND.(TORPE0(PLAYER).LE.0))).OR.(CLOSE2.GE.3)).OR.(CLOSE2.
     *LE.0)))GOTO 10433
        PHANT0=3
        GOTO 10434
10433   IF(((CLOSE2.LE.0).OR.(((CLOSE1.LE.1).AND.(SHIEL0(PLAYER)+RESER0(
     *PLAYER).GE.250)).AND.((PHASE0(PLAYER).GE.50).OR.(TORPE0(PLAYER).GE
     *.5)))))GOTO 10435
          PHANT0=1
          GOTO 10436
10435     IF(((((PHASE0(PLAYER).GE.300).OR.(CLOSE1.NE.0)).AND.(TORPE0(PL
     *AYER).GE.10)).AND.(SHIEL0(PLAYER)+RESER0(PLAYER).GE.250)))GOTO    
     *  10437
            PHANT0=2
            GOTO 10438
10437       PHANT0=3
10438   CONTINUE
10436 CONTINUE
10434 RETURN
      END
      SUBROUTINE RUNST0
      INTEGER I,MINPL0,ANGLE,DIST,MINDI0,REALD0
      INTEGER ITOC,PHGEU0,PHGET0,UNIFO0,COMPA0,GETRA0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAACF0(3)
      INTEGER AAACG0(3)
      INTEGER AAACH0(3)
      INTEGER AAACI0(3)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAACF0/243,232,0/
      DATA AAACG0/244,245,0/
      DATA AAACH0/247,240,0/
      DATA AAACI0/230,244,0/
      MINDI0=20000
      IF(((SHIEL0(PLAYER).GE.150).OR.(RESER0(PLAYER).LE.50)))GOTO 10439
        CALL MAKEC0(AAACF0,RESER0(PLAYER)-25,0)
        RETURN
10439 MINPL0=0
      DO 10440 I=1,10
        IF(((SHIEL0(I).LE.0).OR.(I.EQ.PLAYER)))GOTO 10442
          DIST=PHGET0(PLAYER,I)
          IF((DIST.GE.MINDI0))GOTO 10443
            MINDI0=DIST
            MINPL0=I
10443   CONTINUE
10442   CONTINUE
10440 CONTINUE
10441 IF((MINPL0.NE.0))GOTO 10444
        CALL CONVE0
        RETURN
10444 REALD0=GETRA0(PLAYER,MINPL0)
      ANGLE=PHGEU0(PLAYER,MINPL0)
      IF((COMPA0(BEARI0(PLAYER),ANGLE+180,30).NE.0))GOTO 10445
        CALL MAKEC0(AAACG0,MOD(150+ANGLE+UNIFO0(0,60),360),0)
        GOTO 10446
10445   IF((WARPA0(PLAYER).EQ.8))GOTO 10447
          CALL MAKEC0(AAACH0,8,0)
          GOTO 10448
10447     IF(((REALD0.GE.350).OR.(TORPE0(PLAYER).LE.0)))GOTO 10449
            CALL MAKEC0(AAACI0,MIN0(10,TORPE0(PLAYER)),MINPL0)
            GOTO 10450
10449       CALL MAKEC0(0,0,0)
10450   CONTINUE
10448 CONTINUE
10446 RETURN
      END
      SUBROUTINE WAITS0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAACJ0(3)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAACJ0/247,240,0/
      IF((WARPA0(PLAYER).EQ.0))GOTO 10451
        CALL MAKEC0(AAACJ0,0,0)
        GOTO 10452
10451   CALL CONVE0
10452 RETURN
      END
      SUBROUTINE ATTAC0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER I,MINAN0,DIST,MINDI0,MINPL0,REALD0
      INTEGER PHGEU0,PHGET0,GETRA0
      INTEGER AAACK0(3)
      INTEGER AAACL0(3)
      INTEGER AAACM0(3)
      INTEGER AAACN0(3)
      INTEGER AAACO0(3)
      INTEGER AAACP0(3)
      INTEGER AAACQ0(3)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAACK0/230,244,0/
      DATA AAACL0/240,244,0/
      DATA AAACM0/247,240,0/
      DATA AAACN0/230,240,0/
      DATA AAACO0/244,245,0/
      DATA AAACP0/244,245,0/
      DATA AAACQ0/247,240,0/
      MINDI0=10000*2
      MINPL0=0
      DO 10453 I=1,10
        IF(((SHIEL0(I).LE.0).OR.(PLAYER.EQ.I)))GOTO 10455
          DIST=PHGET0(PLAYER,I)
          IF((DIST.GE.MINDI0))GOTO 10456
            MINDI0=DIST
            MINPL0=I
10456   CONTINUE
10455   CONTINUE
10453 CONTINUE
10454 IF((MINPL0.NE.0))GOTO 10457
        CALL CONVE0
        RETURN
10457 IF((PHCON0.NE.1))GOTO 10458
      IF((PHVIC0.LE.0))GOTO 10458
      IF((SHIEL0(PHVIC0).LT.0))GOTO 10458
      IF((PHVIC0.EQ.PLAYER))GOTO 10458
        MINPL0=PHVIC0
        MINDI0=PHGET0(PLAYER,MINPL0)
10458 REALD0=GETRA0(PLAYER,MINPL0)
      MINAN0=IABS(PHGEU0(PLAYER,MINPL0)-BEARI0(PLAYER))
      IF(((REALD0.GE.350).OR.(TORPE0(PLAYER).LE.0)))GOTO 10459
        CALL MAKEC0(AAACK0,MIN0(10,TORPE0(PLAYER)),MINPL0)
        GOTO 10460
10459   IF(((((REALD0.GE.350).OR.(TORPE0(PLAYER).NE.0)).OR.(SHIEL0(PLAYE
     *R).LE.175)).OR.(RESER0(PLAYER).LE.50)))GOTO 10461
          CALL MAKEC0(AAACL0,MAX0(1,(RESER0(PLAYER)-50)/10),0)
          GOTO 10462
10461     IF(((REALD0.GE.1500).OR.(PHASE0(PLAYER).LE.30)))GOTO 10463
            IF((WARPA0(PLAYER).LE.6))GOTO 10464
              CALL MAKEC0(AAACM0,6,0)
              GOTO 10468
10464         IF((MINAN0.GT.5))GOTO 10466
                CALL MAKEC0(AAACN0,MIN0(100,PHASE0(PLAYER)),MINPL0)
                GOTO 10467
10466           CALL MAKEC0(AAACO0,PHGEU0(PLAYER,MINPL0),0)
10467       CONTINUE
10465       GOTO 10468
10463       IF((MINAN0.LE.5))GOTO 10469
              CALL MAKEC0(AAACP0,PHGEU0(PLAYER,MINPL0),0)
              GOTO 10470
10469         IF((WARPA0(PLAYER).EQ.7))GOTO 10471
                CALL MAKEC0(AAACQ0,7,0)
                GOTO 10472
10471           CALL CONVE0
10472       CONTINUE
10470     CONTINUE
10468   CONTINUE
10462 CONTINUE
10460 RETURN
      END
      SUBROUTINE CONVE0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAACR0(3)
      INTEGER AAACS0(3)
      INTEGER AAACT0(3)
      INTEGER AAACU0(3)
      INTEGER AAACV0(3)
      INTEGER AAACW0(3)
      INTEGER AAACX0(3)
      INTEGER AAACY0(3)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAACR0/242,243,0/
      DATA AAACS0/243,232,0/
      DATA AAACT0/240,244,0/
      DATA AAACU0/240,232,0/
      DATA AAACV0/243,232,0/
      DATA AAACW0/240,244,0/
      DATA AAACX0/240,232,0/
      DATA AAACY0/243,232,0/
      IF((RESEA0(PLAYER).GE.300))GOTO 10473
        CALL MAKEC0(AAACR0,0,0)
        GOTO 10474
10473   IF((SHIEL0(PLAYER).GE.250))GOTO 10475
          CALL MAKEC0(AAACS0,0,0)
          GOTO 10476
10475     IF((TORPE0(PLAYER).GE.10))GOTO 10477
            CALL MAKEC0(AAACT0,0,0)
            GOTO 10478
10477       IF((PHASE0(PLAYER).GE.100))GOTO 10479
              CALL MAKEC0(AAACU0,0,0)
              GOTO 10480
10479         IF((RESER0(PLAYER).GE.101))GOTO 10481
                CALL MAKEC0(0,0,0)
                GOTO 10482
10481           IF((SHIEL0(PLAYER).GE.375))GOTO 10483
                  CALL MAKEC0(AAACV0,RESER0(PLAYER)-100,0)
                  GOTO 10484
10483             IF((TORPE0(PLAYER).GE.15))GOTO 10485
                    CALL MAKEC0(AAACW0,(RESER0(PLAYER)-90)/10,0)
                    GOTO 10486
10485               IF((PHASE0(PLAYER).GE.350))GOTO 10487
                      CALL MAKEC0(AAACX0,RESER0(PLAYER)-100,0)
                      GOTO 10488
10487                 IF((SHIEL0(PLAYER).GE.400))GOTO 10489
                        CALL MAKEC0(AAACY0,RESER0(PLAYER)-100,0)
                        GOTO 10490
10489                   CALL MAKEC0(0,0,0)
10490               CONTINUE
10488             CONTINUE
10486           CONTINUE
10484         CONTINUE
10482       CONTINUE
10480     CONTINUE
10478   CONTINUE
10476 CONTINUE
10474 RETURN
      END
      SUBROUTINE MAKEC0(KIND,AMT,PL)
      INTEGER KIND(1),AMT,PL
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER ITOC,CTOC
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      CURSOR=CTOC(KIND,COMMA0,102)
      IF(((CURSOR.NE.0).AND.(AMT.NE.0)))GOTO 10491
        COMMA0(CURSOR+1)=0
        RETURN
10491 CURSOR=CURSOR+1
      COMMA0(CURSOR)=160
      CURSOR=CURSOR+ITOC(AMT,COMMA0(CURSOR+1),10)
      IF((PL.EQ.0))GOTO 10492
        CURSOR=CURSOR+2
        COMMA0(CURSOR-1)=160
        COMMA0(CURSOR)=PL+225-1
10492 COMMA0(CURSOR+1)=0
      RETURN
      END
      INTEGER FUNCTION COMPA0(A1,A2,TOL)
      INTEGER A1,A2,TOL
      INTEGER DIF
      IF((A1-A2.LE.180))GOTO 10493
        DIF=IABS(A1-A2-360)
        GOTO 10494
10493   IF((A2-A1.LE.180))GOTO 10495
          DIF=IABS(A2-A1-360)
          GOTO 10496
10495     DIF=IABS(A1-A2)
10496 CONTINUE
10494 IF((DIF.GT.TOL))GOTO 10497
        COMPA0=1
        GOTO 10498
10497   COMPA0=0
10498 RETURN
      END
      INTEGER FUNCTION PHGET0(P1,P2)
      INTEGER P1,P2
      INTEGER X1,X2,Y1,Y2,RANGE,RANGE2
      INTEGER GETRA0
      REAL SQRT,FLOAT
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      X1=XPOSA0(P1)
      X2=XPOSA0(P2)
      Y1=YPOSA0(P1)
      Y2=YPOSA0(P2)
      CALL FINDC0(X1,Y1,X2,Y2)
      RANGE=SQRT(FLOAT(X1-X2)**2+FLOAT(Y1-Y2)**2)
      RANGE2=GETRA0(P1,P2)
      IF((RANGE.GE.RANGE2))GOTO 10499
        PHGET0=RANGE
        GOTO 10500
10499   PHGET0=RANGE2
10500 RETURN
      END
      INTEGER FUNCTION PHGEU0(P1,P2)
      INTEGER P1,P2
      INTEGER X1,X2,Y1,Y2,ANG
      INTEGER GETAN0,GETRA0,PHGET0
      REAL ATAN2
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      IF((PHGET0(P1,P2).NE.GETRA0(P1,P2)))GOTO 10501
        PHGEU0=GETAN0(P1,P2)
        RETURN
10501 X1=XPOSA0(P1)
      X2=XPOSA0(P2)
      Y1=YPOSA0(P1)
      Y2=YPOSA0(P2)
      CALL FINDC0(X1,Y1,X2,Y2)
      IF((X1.NE.X2))GOTO 10502
        IF((Y1.NE.Y2))GOTO 10503
          ANG=0
          GOTO 10508
10503     IF((Y1.GE.Y2))GOTO 10505
            ANG=90
            GOTO 10506
10505       IF((Y1.LE.Y2))GOTO 10507
              ANG=270
10507     CONTINUE
10506   CONTINUE
10504   GOTO 10508
10502   ANG=ATAN2(FLOAT(Y2-Y1),FLOAT(X2-X1))*180.0/3.14159
10508 IF((ANG.GE.0))GOTO 10509
        ANG=ANG+360
10509 PHGEU0=ANG
      RETURN
      END
      SUBROUTINE FINDC0(X1,Y1,X2,Y2)
      INTEGER X1,Y1,X2,Y2
      INTEGER Q1,Q2
      INTEGER GETQU0
      INTEGER AAACZ0(46)
      DATA AAACZ0/168,233,238,160,240,232,223,231,229,244,223,225,238,23
     *1,236,229,169,160,227,225,238,167,244,160,232,225,240,240,229,238,
     *186,160,170,233,160,170,233,160,170,233,160,170,233,170,238,0/
      Q1=GETQU0(X1,Y1)
      Q2=GETQU0(X2,Y2)
      IF((Q1.NE.Q2))GOTO 10510
        GOTO 10511
10510   IF((((Q1.NE.2).OR.(Q2.NE.1)).AND.((Q1.NE.3).OR.(Q2.NE.4))))GOTO 
     *     10512
          X1=X1+10000
          GOTO 10513
10512     IF((((Q2.NE.2).OR.(Q1.NE.1)).AND.((Q2.NE.3).OR.(Q1.NE.4))))GOT
     *O 10514
            X2=X2+10000
            GOTO 10515
10514       IF((((Q1.NE.3).OR.(Q2.NE.2)).AND.((Q1.NE.4).OR.(Q2.NE.1))))G
     *OTO 10516
              Y1=Y1+10000
              GOTO 10517
10516         IF((((Q2.NE.3).OR.(Q1.NE.2)).AND.((Q2.NE.4).OR.(Q1.NE.1)))
     *)GOTO 10518
                Y2=Y2+10000
                GOTO 10519
10518           IF(((Q1.NE.3).OR.(Q2.NE.1)))GOTO 10520
                  X1=X1+10000
                  Y1=Y1+10000
                  GOTO 10521
10520             IF(((Q2.NE.3).OR.(Q1.NE.1)))GOTO 10522
                    X2=X2+10000
                    Y2=Y2+10000
                    GOTO 10523
10522               IF(((Q1.NE.2).OR.(Q2.NE.4)))GOTO 10524
                      X1=X1+10000
                      Y2=Y2+10000
                      GOTO 10525
10524                 IF(((Q2.NE.2).OR.(Q1.NE.4)))GOTO 10526
                        X2=X2+10000
                        Y1=Y1+10000
                        GOTO 10527
10526                   CALL PRINT(-15,AAACZ0,X1,Y1,X2,Y2)
10527               CONTINUE
10525             CONTINUE
10523           CONTINUE
10521         CONTINUE
10519       CONTINUE
10517     CONTINUE
10515   CONTINUE
10513 CONTINUE
10511 RETURN
      END
      INTEGER FUNCTION GETQU0(X,Y)
      INTEGER X,Y
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      IF((X.LE.10000/2))GOTO 10528
        IF((Y.LE.10000/2))GOTO 10529
          GETQU0=1
          GOTO 10531
10529     GETQU0=4
10530   GOTO 10531
10528   IF((Y.LE.10000/2))GOTO 10532
          GETQU0=2
          GOTO 10533
10532     GETQU0=3
10533 CONTINUE
10531 RETURN
      END
      SUBROUTINE PHCHF0(BUF)
      INTEGER BUF(1)
      INTEGER I
      INTEGER CTOI
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      IF((BUF(1).NE.240))GOTO 10536
      IF((BUF(2).NE.238))GOTO 10536
      GOTO 10534
10534   IF((PHCON0.NE.0))GOTO 10537
          IF((((((((PHCHE0.NE.0).OR.(BUF(8).NE.233)).OR.(BUF(9).NE.BUF(5
     *))).OR.(BUF(10).NE.244)).OR.(BUF(11).NE.PLAYER+225-1)).OR.(BUF(12)
     *.NE.225)).OR.(BUF(13).NE.0)))GOTO 10538
            PHCHE0=3
            PHALLY=BUF(5)-225+1
            GOTO 10543
10538       IF(((PHCHE0.NE.1).OR.(BUF(5).NE.PHALLY+225-1)))GOTO 10540
              I=8
              IF((PHTASK.NE.CTOI(BUF,I)))GOTO 10541
                PHCON0=1
                PHVIC0=0
                PHCHE0=0
                PHTUR0=300
                GOTO 10542
10541           PHCHE0=0
10542       CONTINUE
10540     CONTINUE
10539     GOTO 10543
10537     IF(((PHCON0.NE.1).OR.(PHALLY+225-1.NE.BUF(5))))GOTO 10544
            IF((BUF(8).NE.193))GOTO 10545
              PHVIC0=BUF(9)-225+1
              GOTO 10546
10545         IF((BUF(8).NE.215))GOTO 10547
                PHVIC0=-1
10547       CONTINUE
10546     CONTINUE
10544   CONTINUE
10543 CONTINUE
10536 RETURN
      END
      SUBROUTINE SENDA0
      INTEGER I,J,K
      INTEGER UNIFO0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER MSG(102)
      INTEGER AAADA0(11)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAADA0/240,238,160,216,160,174,174,174,174,174,0/
      I=UNIFO0(0,9)
      J=UNIFO0(0,9)
      K=UNIFO0(0,9)
      CALL CTOC(AAADA0,MSG,102)
      MSG(4)=PHALLY+225-1
      MSG(6)=176+I
      MSG(7)=176+UNIFO0(0,9)
      MSG(8)=176+J
      MSG(9)=176+UNIFO0(0,9)
      MSG(10)=176+K
      CURSOR=10
      PHTASK=I+J+K-1
      CALL SCOPY(MSG,1,COMMA0,1)
      RETURN
      END
      SUBROUTINE BUILD0
      INTEGER I
      INTEGER LASTT0(9)
      INTEGER LASTU0(10),LASTV0(10),LASTS0(10),USERX(10),USERY(10)
      INTEGER LASTR0(10),LASTA0(10),LASTK0(10),LASTD0(10)
      INTEGER LASTW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTL0,LA
     *STQ0,LASUB0
      INTEGER LASTM0
      INTEGER CURSO0,CURSP0
      INTEGER REMAR0
      INTEGER REMAS0(102)
      COMMON /MTDCOM/LASTU0,LASTV0,LASTR0,LASTA0,LASTK0,LASTD0,LASTL0,LA
     *STW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTQ0,LASUB0,CURSO
     *0,CURSP0,REMAR0,REMAS0,LASTM0,LASTS0,USERX,USERY,LASTT0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER AAADB0(8)
      INTEGER AAADC0(30)
      INTEGER AAADD0(33)
      INTEGER AAADE0(2)
      INTEGER AAADF0(2)
      INTEGER AAADG0(33)
      INTEGER AAADH0(38)
      INTEGER AAADI0(37)
      INTEGER AAADJ0(41)
      INTEGER AAADK0(9)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAADB0/205,245,236,212,242,229,235,0/
      DATA AAADC0/210,225,238,231,229,160,193,238,231,236,229,160,208,23
     *6,225,249,229,242,160,203,233,236,236,243,160,206,225,237,229,0/
      DATA AAADD0/173,173,173,173,173,173,173,173,173,173,173,173,173,17
     *3,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
     *173,173,0/
      DATA AAADE0/252,0/
      DATA AAADF0/252,0/
      DATA AAADG0/173,173,173,173,173,173,173,173,173,173,173,173,173,17
     *3,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
     *173,173,0/
      DATA AAADH0/210,229,243,229,242,246,229,160,160,160,160,160,160,16
     *0,160,160,208,232,225,243,229,242,243,160,160,160,160,160,160,160,
     *160,160,193,238,231,236,229,0/
      DATA AAADI0/210,229,243,229,225,242,227,232,160,160,160,160,160,16
     *0,160,160,212,239,242,240,229,228,239,243,160,160,160,160,160,160,
     *160,160,215,225,242,240,0/
      DATA AAADJ0/211,232,233,229,236,228,243,160,160,160,160,160,160,16
     *0,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,
     *160,160,208,239,243,233,244,233,239,238,0/
      DATA AAADK0/195,239,237,237,225,238,228,186,0/
      CALL VTCLR(1,1,35,100)
      CALL VTPUTL(AAADB0,1,8)
      CALL VTPUTL(AAADC0,1,33)
      CALL VTPUTL(AAADD0,2,1)
      DO 10548 I=1,10
        CALL VTPUTL(AAADE0,13-I,1)
        CALL VTPUTL(AAADF0,13-I,1+30+1)
10548 CONTINUE
10549 CALL VTPUTL(AAADG0,13,1)
      CALL VTPUTL(AAADH0,13+1,1)
      CALL VTPUTL(AAADI0,13+2,1)
      CALL VTPUTL(AAADJ0,13+3,1)
      CALL VTPUTL(AAADK0,13+4,1)
      DO 10550 I=1,10
        LASTU0(I)=0
        LASTV0(I)=0
        LASTS0(I)=0
        LASTD0(I)=0
10550 CONTINUE
10551 LASTT0(1)=0
      LASTW0=-1
      LASTX0=-1
      LASTP0=-1
      LASTY0=-1
      LASTZ0=-1
      LASTB0=-1
      LASUA0=-1
      LASTQ0=-1
      LASUB0=-1
      LASTL0=0
      LASTM0=19
      CURSO0=0
      CURSP0=0
      REMAR0=0
      CALL VTUPD(1)
      RETURN
      END
      SUBROUTINE COMME0(MSG)
      INTEGER MSG(1)
      INTEGER LASTT0(9)
      INTEGER LASTU0(10),LASTV0(10),LASTS0(10),USERX(10),USERY(10)
      INTEGER LASTR0(10),LASTA0(10),LASTK0(10),LASTD0(10)
      INTEGER LASTW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTL0,LA
     *STQ0,LASUB0
      INTEGER LASTM0
      INTEGER CURSO0,CURSP0
      INTEGER REMAR0
      INTEGER REMAS0(102)
      COMMON /MTDCOM/LASTU0,LASTV0,LASTR0,LASTA0,LASTK0,LASTD0,LASTL0,LA
     *STW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTQ0,LASUB0,CURSO
     *0,CURSP0,REMAR0,REMAS0,LASTM0,LASTS0,USERX,USERY,LASTT0
      REMAR0=1
      CALL CTOC(MSG,REMAS0,102)
      RETURN
      END
      SUBROUTINE DISPL0(BUF)
      INTEGER BUF(1)
      INTEGER LASTT0(9)
      INTEGER LASTU0(10),LASTV0(10),LASTS0(10),USERX(10),USERY(10)
      INTEGER LASTR0(10),LASTA0(10),LASTK0(10),LASTD0(10)
      INTEGER LASTW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTL0,LA
     *STQ0,LASUB0
      INTEGER LASTM0
      INTEGER CURSO0,CURSP0
      INTEGER REMAR0
      INTEGER REMAS0(102)
      COMMON /MTDCOM/LASTU0,LASTV0,LASTR0,LASTA0,LASTK0,LASTD0,LASTL0,LA
     *STW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTQ0,LASUB0,CURSO
     *0,CURSP0,REMAR0,REMAS0,LASTM0,LASTS0,USERX,USERY,LASTT0
      IF((LASTM0.LT.24))GOTO 10552
        LASTM0=19
        GOTO 10553
10552   LASTM0=LASTM0+1
10553 CALL VTPUTL(BUF,LASTM0,1)
      RETURN
      END
      SUBROUTINE DISPM0(I)
      INTEGER I
      INTEGER J
      INTEGER C(2)
      INTEGER LASTT0(9)
      INTEGER LASTU0(10),LASTV0(10),LASTS0(10),USERX(10),USERY(10)
      INTEGER LASTR0(10),LASTA0(10),LASTK0(10),LASTD0(10)
      INTEGER LASTW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTL0,LA
     *STQ0,LASUB0
      INTEGER LASTM0
      INTEGER CURSO0,CURSP0
      INTEGER REMAR0
      INTEGER REMAS0(102)
      COMMON /MTDCOM/LASTU0,LASTV0,LASTR0,LASTA0,LASTK0,LASTD0,LASTL0,LA
     *STW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTQ0,LASUB0,CURSO
     *0,CURSP0,REMAR0,REMAS0,LASTM0,LASTS0,USERX,USERY,LASTT0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      LASTS0(I)=0
      C(1)=I+225-1
      DO 10554 J=1,10
        IF((((I.EQ.J).OR.(USERX(I).NE.USERX(J))).OR.(USERY(I).NE.USERY(J
     *))))GOTO 10556
          LASTS0(I)=1
          LASTS0(J)=1
          C(1)=170
10556   CONTINUE
10554 CONTINUE
10555 C(2)=0
      CALL VTPUTL(C,13-USERY(I),USERX(I)+1)
      RETURN
      END
      SUBROUTINE ERASE0(I)
      INTEGER I
      INTEGER J
      INTEGER LASTT0(9)
      INTEGER LASTU0(10),LASTV0(10),LASTS0(10),USERX(10),USERY(10)
      INTEGER LASTR0(10),LASTA0(10),LASTK0(10),LASTD0(10)
      INTEGER LASTW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTL0,LA
     *STQ0,LASUB0
      INTEGER LASTM0
      INTEGER CURSO0,CURSP0
      INTEGER REMAR0
      INTEGER REMAS0(102)
      COMMON /MTDCOM/LASTU0,LASTV0,LASTR0,LASTA0,LASTK0,LASTD0,LASTL0,LA
     *STW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTQ0,LASUB0,CURSO
     *0,CURSP0,REMAR0,REMAS0,LASTM0,LASTS0,USERX,USERY,LASTT0
      INTEGER AAADL0(2)
      DATA AAADL0/160,0/
      CALL VTPUTL(AAADL0,13-LASTV0(I),LASTU0(I)+1)
      IF((LASTS0(I).NE.1))GOTO 10557
        DO 10558 J=1,10
          IF((((I.EQ.J).OR.(LASTU0(J).NE.LASTU0(I))).OR.(LASTV0(J).NE.LA
     *STV0(I))))GOTO 10560
            LASTU0(J)=0
            LASTV0(J)=0
10560     CONTINUE
10558   CONTINUE
10559 CONTINUE
10557 RETURN
      END
      INTEGER FUNCTION GETME0(BUF)
      INTEGER BUF(1)
      INTEGER MSGP
      INTEGER RECVM0
      INTEGER SCOPY
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      IF((RECVM0(MSGP).NE.0))GOTO 10561
        GETME0=-1
        GOTO 10562
10561   GETME0=SCOPY(MSGTE0(MSGP),1,BUF,1)
        IF((REFCO0(MSGP).NE.0))GOTO 10563
          CALL DSFREE(MSGP)
10563 CONTINUE
10562 RETURN
      END
      SUBROUTINE UPDAT0
      INTEGER LASTT0(9)
      INTEGER LASTU0(10),LASTV0(10),LASTS0(10),USERX(10),USERY(10)
      INTEGER LASTR0(10),LASTA0(10),LASTK0(10),LASTD0(10)
      INTEGER LASTW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTL0,LA
     *STQ0,LASUB0
      INTEGER LASTM0
      INTEGER CURSO0,CURSP0
      INTEGER REMAR0
      INTEGER REMAS0(102)
      COMMON /MTDCOM/LASTU0,LASTV0,LASTR0,LASTA0,LASTK0,LASTD0,LASTL0,LA
     *STW0,LASTX0,LASTP0,LASTY0,LASTZ0,LASTB0,LASUA0,LASTQ0,LASUB0,CURSO
     *0,CURSP0,REMAR0,REMAS0,LASTM0,LASTS0,USERX,USERY,LASTT0
      INTEGER XPOSA0(10)
      INTEGER YPOSA0(10)
      INTEGER BEARI0(10)
      INTEGER WARPA0(10)
      INTEGER PHASE0(10)
      INTEGER TORPE0(10)
      INTEGER RESER0(10)
      INTEGER RESEA0(10)
      INTEGER SHIEL0(10)
      INTEGER KILLS0(10)
      INTEGER LOCKE0(10)
      INTEGER MSGQU0(10)
      INTEGER NAMEA0(21,10)
      INTEGER HEADP0(1)
      INTEGER TAILP0(1)
      INTEGER LINKA0(1)
      INTEGER MSGPT0(1)
      INTEGER REFCO0(1)
      INTEGER MSGTE0(1)
      INTEGER MEMAA0(10000)
      COMMON /MULCOM/XPOSA0,YPOSA0,BEARI0,WARPA0,PHASE0,TORPE0,RESER0,RE
     *SEA0,SHIEL0,KILLS0,LOCKE0,MSGQU0,NAMEA0,MEMAA0
      INTEGER PHANT0
      INTEGER PHANU0
      INTEGER PLAYER
      INTEGER ECHAR
      INTEGER KCHAR
      INTEGER CURSOR
      INTEGER COMMA0(102)
      INTEGER PHCON0
      INTEGER PHALLY
      INTEGER PHTUR0
      INTEGER PHVIC0
      INTEGER PHCHE0
      INTEGER PHTASK
      INTEGER DBLOCK
      COMMON /PRIVA0/PHANT0,PHANU0,PLAYER,ECHAR,KCHAR,CURSOR,COMMA0,PHCO
     *N0,PHALLY,PHTUR0,PHVIC0,PHCHE0,PHTASK,DBLOCK
      INTEGER USERR0,USERA0,USERK0,I,J
      INTEGER MESSA0
      INTEGER GETME0,GETRA0,GETAN0,EQUAL
      INTEGER TIMES0(9),BUF(102),CH
      INTEGER AAADM0(4)
      INTEGER AAADN0(4)
      INTEGER AAADO0(4)
      INTEGER AAADP0(3)
      INTEGER AAADQ0(4)
      INTEGER AAADR0(4)
      INTEGER AAADS0(4)
      INTEGER AAADT0(2)
      INTEGER AAADU0(2)
      INTEGER AAADV0(2)
      INTEGER AAADW0(4)
      INTEGER AAADX0(4)
      INTEGER AAADY0(4)
      INTEGER AAADZ0(4)
      INTEGER AAAEA0(4)
      INTEGER AAAEB0(4)
      INTEGER AAAEC0(4)
      INTEGER AAAED0(4)
      INTEGER AAAEE0(4)
      EQUIVALENCE (HEADP0,MEMAA0(1))
      EQUIVALENCE (TAILP0,MEMAA0(2))
      EQUIVALENCE (LINKA0,MEMAA0(1))
      EQUIVALENCE (MSGPT0,MEMAA0(2))
      EQUIVALENCE (REFCO0,MEMAA0(1))
      EQUIVALENCE (MSGTE0,MEMAA0(2))
      DATA AAADM0/170,163,233,0/
      DATA AAADN0/170,163,233,0/
      DATA AAADO0/170,163,233,0/
      DATA AAADP0/170,227,0/
      DATA AAADQ0/170,163,233,0/
      DATA AAADR0/170,163,233,0/
      DATA AAADS0/170,163,233,0/
      DATA AAADT0/160,0/
      DATA AAADU0/170,0/
      DATA AAADV0/160,0/
      DATA AAADW0/170,163,233,0/
      DATA AAADX0/170,163,233,0/
      DATA AAADY0/170,163,233,0/
      DATA AAADZ0/170,163,233,0/
      DATA AAAEA0/170,163,233,0/
      DATA AAAEB0/170,163,233,0/
      DATA AAAEC0/170,163,233,0/
      DATA AAAED0/170,163,233,0/
      DATA AAAEE0/170,163,233,0/
      CALL VTPUTL(COMMA0,17,10)
      IF((REMAR0.NE.1))GOTO 10564
        CALL VTPUTL(REMAS0,18,1)
        CALL VTPAD(100)
        REMAR0=0
        LASTM0=24
        CALL VTCLR(19,1,24,100)
10564 CALL DATE(2,TIMES0)
      TIMES0(6)=0
      IF((EQUAL(TIMES0,LASTT0).NE.0))GOTO 10565
        CALL VTPUTL(TIMES0,1,18)
        CALL CTOC(TIMES0,LASTT0,6)
10565 DO 10566 I=1,10
        IF((SHIEL0(I).LT.0))GOTO 10568
          USERX(I)=INT(XPOSA0(I)*(FLOAT(30)/FLOAT(10000)))+1
          USERY(I)=INT(YPOSA0(I)*(FLOAT(10)/FLOAT(10000)))+1
          GOTO 10569
10568     USERX(I)=0
          USERY(I)=0
10569   CONTINUE
10566 CONTINUE
10567 DO 10570 I=1,10
        IF(((LASTU0(I).EQ.USERX(I)).AND.(LASTV0(I).EQ.USERY(I))))GOTO   
     *   10572
          IF(((LASTU0(I).EQ.0).OR.(LASTV0(I).EQ.0)))GOTO 10573
            CALL ERASE0(I)
10573   CONTINUE
10572   CONTINUE
10570 CONTINUE
10571 DO 10574 I=1,10
        IF(((LASTU0(I).EQ.USERX(I)).AND.(LASTV0(I).EQ.USERY(I))))GOTO   
     *   10576
          IF(((USERX(I).EQ.0).OR.(USERY(I).EQ.0)))GOTO 10577
            CALL DISPM0(I)
10577   CONTINUE
10576   CONTINUE
10574 CONTINUE
10575 DO 10578 I=1,10
        LASTU0(I)=USERX(I)
        LASTV0(I)=USERY(I)
10578 CONTINUE
10579 DO 10580 I=1,10
        IF((SHIEL0(I).LT.0))GOTO 10582
          USERR0=GETRA0(PLAYER,I)
          USERA0=GETAN0(PLAYER,I)
          USERK0=KILLS0(I)
          GOTO 10583
10582     USERR0=-1
          USERA0=-1
          USERK0=-1
10583   IF((LASTD0(I).NE.0))GOTO 10584
          IF((USERR0.NE.-1))GOTO 10585
            GOTO 10587
10585       CALL VTPUTL(NAMEA0(1,I),2+I,58)
            CALL VTPRT(2+I,33,AAADM0,5,USERR0)
            CALL VTPRT(2+I,40,AAADN0,3,USERA0)
            CALL VTPRT(2+I,53,AAADO0,3,KILLS0(I))
            CALL VTPRT(2+I,47,AAADP0,I+225-1)
            LASTD0(I)=1
10586     GOTO 10587
10584     IF((SHIEL0(I).LT.0))GOTO 10588
            IF((USERR0.EQ.LASTR0(I)))GOTO 10589
              CALL VTPRT(2+I,33,AAADQ0,5,USERR0)
10589       IF((USERA0.EQ.LASTA0(I)))GOTO 10590
              CALL VTPRT(2+I,40,AAADR0,3,USERA0)
10590       IF((USERK0.EQ.LASTK0(I)))GOTO 10592
              CALL VTPRT(2+I,53,AAADS0,3,USERK0)
10591       GOTO 10592
10588       CALL VTCLR(2+I,33,2+I,100)
10592   CONTINUE
10587   LASTR0(I)=USERR0
        LASTA0(I)=USERA0
        LASTK0(I)=USERK0
10580 CONTINUE
10581 IF((LOCKE0(PLAYER).EQ.LASTL0))GOTO 10593
        CALL VTPUTL(AAADT0,2+LASTL0,48)
        LASTL0=LOCKE0(PLAYER)
        IF((LOCKE0(PLAYER).LE.0))GOTO 10595
        IF((SHIEL0(LOCKE0(PLAYER)).LT.0))GOTO 10595
          CALL VTPUTL(AAADU0,2+LOCKE0(PLAYER),48)
10594   GOTO 10595
10593   IF((SHIEL0(LOCKE0(PLAYER)).GE.0))GOTO 10596
          CALL VTPUTL(AAADV0,2+LOCKE0(PLAYER),48)
          LOCKE0(PLAYER)=0
10596 CONTINUE
10595 IF((LASTW0.EQ.RESER0(PLAYER)))GOTO 10597
        CALL VTPRT(14,10,AAADW0,4,RESER0(PLAYER))
        LASTW0=RESER0(PLAYER)
10597 IF((LASTX0.EQ.RESEA0(PLAYER)))GOTO 10598
        CALL VTPRT(15,10,AAADX0,4,RESEA0(PLAYER))
        LASTX0=RESEA0(PLAYER)
10598 IF((LASTP0.EQ.PHASE0(PLAYER)))GOTO 10599
        CALL VTPRT(14,26,AAADY0,4,PHASE0(PLAYER))
        LASTP0=PHASE0(PLAYER)
10599 IF((LASTY0.EQ.TORPE0(PLAYER)))GOTO 10600
        CALL VTPRT(15,26,AAADZ0,4,TORPE0(PLAYER))
        LASTY0=TORPE0(PLAYER)
10600 IF((LASTZ0.EQ.SHIEL0(PLAYER)))GOTO 10601
        CALL VTPRT(16,10,AAAEA0,4,SHIEL0(PLAYER))
        LASTZ0=SHIEL0(PLAYER)
10601 IF((LASTB0.EQ.BEARI0(PLAYER)))GOTO 10602
        CALL VTPRT(14,42,AAAEB0,4,BEARI0(PLAYER))
        LASTB0=BEARI0(PLAYER)
10602 IF((LASUA0.EQ.WARPA0(PLAYER)))GOTO 10603
        CALL VTPRT(15,42,AAAEC0,4,WARPA0(PLAYER))
        LASUA0=WARPA0(PLAYER)
10603 IF((LASTQ0.EQ.XPOSA0(PLAYER)))GOTO 10604
        CALL VTPRT(16,42,AAAED0,4,XPOSA0(PLAYER))
        LASTQ0=XPOSA0(PLAYER)
10604 IF((LASUB0.EQ.YPOSA0(PLAYER)))GOTO 10605
        CALL VTPRT(16,47,AAAEE0,4,YPOSA0(PLAYER))
        LASUB0=YPOSA0(PLAYER)
10605 I=1
      GOTO 10608
10606 I=I+1
10608 IF((I.GT.6))GOTO 10607
        IF((GETME0(BUF).NE.-1))GOTO 10609
          GOTO 10607
10609   IF((PHANU0.NE.1))GOTO 10610
          CALL PHCHF0(BUF)
10610   CALL DISPL0(BUF)
      GOTO 10606
10607 CALL VTUPD(0)
      CALL VTCLR(17,10+CURSOR,17,100)
      RETURN
      END
C ---- Long Name Map ----
C phturnsleft                    phtur0
C phvictim                       phvic0
C lastangle                      lasta0
C Bearing                        beari0
C buytorpedos                    buyto0
C decodecommand                  decod0
C phantomstate                   phant0
C personalmessage                perso0
C compareangle                   compa0
C lastmessageused                lastm0
C attackstate                    attac0
C lastuserx                      lastu0
C lastusery                      lastv0
C lastrange                      lastr0
C lastdisplayed                  lastd0
C lasttorps                      lasty0
C Link                           linka0
C goodbye                        goodb0
C firephasers                    firep0
C buyphasers                     buyph0
C commandready                   commb0
C lastpositionx                  lastq0
C Msgtext                        msgte0
C victimsstate                   victi0
C laststar                       lasts0
C lastwarp                       lasua0
C lastpositiony                  lasub0
C remarkchanged                  remar0
C remarktext                     remas0
C userangle                      usera0
C dequeue                        deque0
C getquadrant                    getqu0
C lastshields                    lastz0
C Refcount                       refco0
C addtoshields                   addtp0
C phgetangle                     phgeu0
C changewarp                     chang0
C energyearned                   enerh0
C getangle                       getan0
C convertreserve                 conve0
C getekchars                     getek0
C sendmsg                        sendm0
C lockfile                       lockf0
C anglediff                      angle0
C cursorrow                      curso0
C Headptr                        headp0
C getplayingname                 getpl0
C comment                        comme0
C userrange                      userr0
C distance                       dista0
C getplayer                      getpm0
C aggressor                      aggre0
C runstate                       runst0
C minangle                       minan0
C findclosestwrap                findc0
C Warp                           warpa0
C Msgqueue                       msgqu0
C addition                       addit0
C phgetrange                     phget0
C getphantomname                 getph0
C clearinputbuffer               clear0
C allocatemsgqueue               alloc0
C getrange                       getra0
C makecommand                    makec0
C eraseuser                      erase0
C Shields                        shiel0
C recvmsg                        recvm0
C enqueue                        enque0
C close1range                    closf0
C minplayer                      minpl0
C mindist                        mindi0
C lastresearch                   lastx0
C lastphasers                    lastp0
C cursorcolumn                   cursp0
C Torpedos                       torpe0
C enterplayer                    enter0
C addtoresearch                  addto0
C close2range                    close0
C displaymessage                 displ0
C readclock                      readc0
C updatescreen                   updat0
C lastkills                      lastk0
C private                        priva0
C unlockdb                       unloc0
C Mem                            memaa0
C processcommand                 proce0
C determinestate                 deter0
C exitgame                       exitg0
C waitstate                      waits0
C savelword                      savel0
C getstring                      getst0
C lastreserve                    lastw0
C Locked                         locke0
C Msgptr                         msgpt0
C uniform                        unifo0
C currenttime                    curre0
C Phasers                        phase0
C Research                       resea0
C phcheck                        phche0
C buildscreentemplate            build0
C realdist                       reald0
C energyspent                    energ0
C addressee                      addre0
C Kills                          kills0
C displayuser                    dispm0
C sendgeneralmessage             sendg0
C phcheckmessage                 phchf0
C Xpos                           xposa0
C phcontrolled                   phcon0
C firetorps                      firet0
C inputphcommand                 inpuu0
C lastbearing                    lastb0
C userkills                      userk0
C Ypos                           yposa0
C namelist                       namel0
C inputcommand                   input0
C lockplayer                     lockp0
C sendalliancetask               senda0
C lastlock                       lastl0
C Reserve                        reser0
C Name                           namea0
C playmultrek                    playm0
C broadcastmessage               broad0
C getmessagetext                 getme0
C timestr                        times0
C sendpersonalnote               sendp0
C phantomflag                    phanu0
C command                        comma0
C messageareachanged             messa0
C Tailptr                        tailp0
C deltatime                      delta0
C findslot                       finds0
C deltaangle                     deltb0
C lasttime                       lastt0
