[comp.sources.games] v03i027: trek73 - computer simulated Star Trek battles, Part06/06

games-request@tekred.TEK.COM (12/18/87)

Submitted by: Jeff Okamoto <okamoto%hpccc@hplabs.HP.COM>
Comp.sources.games: Volume 3, Issue 27
Archive-name: trek73/Part06



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 6 (of 6)."
# Contents:  Makefile man/04.5.t man/05.t man/06.t man/07.t man/08ca.t
#   man/08cl.t man/08dd.t man/08dn.t man/09ca.t man/09cl.t man/09dd.t
#   man/09dn.t man/shipyard.6 src/command.l src/externs.h src/getopt.c
#   src/printships.c src/union.h src/vers.c
# Wrapped by billr@tekred on Thu Dec 17 11:43:40 1987
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f Makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Makefile\"
else
echo shar: Extracting \"Makefile\" \(261 characters\)
sed "s/^X//" >Makefile <<'END_OF_Makefile'
X#
X# Master Makefile for TREK73
X#
XMAKE = make
X
Xall: programs documentation
X
Xprograms:
X	cd src; $(MAKE) all
X
Xdocumentation:
X	cd man; $(MAKE) all
X
Xinstall: all
X	cd src; $(MAKE) install
X	cd man; $(MAKE) install
X
Xclean:
X	cd src; $(MAKE) clean
X	cd man; $(MAKE) clean
END_OF_Makefile
if test 261 -ne `wc -c <Makefile`; then
    echo shar: \"Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/04.5.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/04.5.t\"
else
echo shar: Extracting \"man/04.5.t\" \(1198 characters\)
sed "s/^X//" >man/04.5.t <<'END_OF_man/04.5.t'
X.ce
XDesigner Ships
X.sp
X.PP
XA feature of TREK73 allows you to have more than just the standard
Xfour ship types.
XThe programs
X.I bpv
X(6) and
X.I shipyard
X(6) allows new ship types to be created.
X.I Shipyard
Xin conjunction with the -F and/or -l command line option allows
Xbattle between, say, the Enterprise and the Death Star.
X.PP
XSee the manual pages for
X.I bpv
Xand
X.I shipyard
Xfor more information about designer ships.
X.sp
X.ce
XEnglish Parser
X.PP
XThe latest feature of TREK73 Version 4.0 is the addition of
Xa rudimentary English parser.
XNo longer does the player have to remember what code number
Xcorresponds to what command.
X.PP
XA full list of allowable commands would nearly double
Xthe length of this document.
XSuffice it to say that it was the designers' desire
Xto allow commands to be typed in just as if they would be spoken.
XAn example of a legitimate command would be:
X"Pursue the Albatross at warp 6.5".
XAnother would be:
X"Lock all tubes onto the Devastator".
X.PP
XIf a given phrase does not work, try modifying the words or the
Xorder of the words.
XSome words, especially if they are long, may be abbreviated.
X.PP
XIf all else fails, then bite the bullet and memorize
Xthe command numbers.
X.sp
END_OF_man/04.5.t
if test 1198 -ne `wc -c <man/04.5.t`; then
    echo shar: \"man/04.5.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/05.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/05.t\"
else
echo shar: Extracting \"man/05.t\" \(1820 characters\)
sed "s/^X//" >man/05.t <<'END_OF_man/05.t'
X.ce
XSimple Strategy
X.sp
X.PP
XIf you are a beginner, a simple strategy to follow is:
Xfight only one attacker;
Xpursue him (code 14) at warp factor one;
Xlock on all phasers (code 3);
Xcontinuously take position reports (code 12) and watch his range;
Xwhen he gets within 1000M, fire all phasers (code 1) and
Xkeep on firing when he is in range;
XWhen the enemy is out of range, take damage reports and scans
Xof the enemy (codes 17 and 18).
X.sp
X.PP
XAfter a few trial games using the above strategy, you will
Xwant to become as efficient as the enemy at firing photon
Xtorpedos.
XFinally, when you master launching antimatter probes, you
Xcan designate more than one attacker.
X.sp 3
X.ce
XTrek73's History
X.sp
X.PP
XTrek73 was programmed on a Hewlett-Packard 2000C system by
XWilliam K. Char, Perry Lee, and Dan Gee.
XIn January 1973, Mr. Char started with a few ideas and five
Xmonths later, in May, introduced $SPACE, his first version.
X.sp
X.PP
XSpace had only 14 commands and comprised one 10K program.
XResponse was so great that new ideas flooded in and in June,
Xwork on Trek73 was begun.
XOver 70 recordings of past shows were reviewed to
Xreconstruct dialogue and vessels.
XOn October 8, 1973, Trek73 was introduced.
X.sp
X.PP
XIn 1984, Dave Pare at University of California at San Diego and Chris
XWilliams at the University of California at Berkeley independently
Xtranslated the BASIC code into C to run under BSD UNIX.\**
X.FS
XUNIX is a registered trademark of Bell Laboratories.
X.FE
X.sp
X.PP
XIn April 1985, Jeff Okamoto and Peter Yee, both
Xat the University of California at Berkeley combined the two
Xversions into one, fixing bugs and adding new commands and concepts.
X.sp
X.PP
XIdeas and bug reports should be sent to:
X.br
XARPA: hpccc!okamoto@hplabs.hp.com and yee@ames-orion.arpa
X.br
XUUCP: ..!hplabs!hpccc!okamoto and ..!ames-orion!yee
X.bp
END_OF_man/05.t
if test 1820 -ne `wc -c <man/05.t`; then
    echo shar: \"man/05.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/06.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/06.t\"
else
echo shar: Extracting \"man/06.t\" \(1784 characters\)
sed "s/^X//" >man/06.t <<'END_OF_man/06.t'
X.ce
XAPPENDIX 1
X.nf
X.sp 4
X             Secondary Hull                        Primary Hull
X              (engineering)
X                                              -------
X:-----------------------------------------\\   | .5  |      . . . .
X::           N C C - 1 7 0 1 A            |}  |0 / 1|---< . . . . .
X::________________________________________/   |     |      . . . .
X            warp engines     ^                | .5  |      . . . .
X                            +++               |0 / 1|---< . . . . .
X  =====                      | fuel           |     |      . . . .
X   |+|             +       OOOOO reserve      | .5  |      . . . .
X   |+| ---------> +++ ---> OOOOO --- +++ ---> |0 / 1|---< . . . . .
X -------           +       *****              |     |      . . . .
X |     |                   *****       shield | .5  |      . . . .
X -------                     |  \\     control |0 / 1|---< . . . . .
Xdilithium                    *   \\            -------      . . . .
Xcrystal                     ***  +++                       shields
Xgenerator                    *     \\phaser control
X                             |      --------                 : : :
X                             |      |-10/10|-OOOO>. . : : : | : :
X        <***:   <[=====| <---+      |-10/10|-**OO>. . :      : : :
X        probe   launcher     |      |-10/10|-****>
X                             V      |-10/10|-****>
X                       =*******=    -------- phaser banks
X               photon  =*******=
X              torpedo  ===*******
X                tubes  =======*******
X                       =========  *******
X                       =========      *******
X+ Energy unit
XO Matter-anti-matter pod
X* Filled matter-anti-matter pod
X---+++---> Energy transfer
X---***---> Pod transfer
X.fi
X.bp
END_OF_man/06.t
if test 1784 -ne `wc -c <man/06.t`; then
    echo shar: \"man/06.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/07.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/07.t\"
else
echo shar: Extracting \"man/07.t\" \(1309 characters\)
sed "s/^X//" >man/07.t <<'END_OF_man/07.t'
X.ce
XAPPENDIX 2
X.br
X.ce
XHeavy Cruiser
X.nf
X.sp 7
X                                  Shield 2
X                                     |
X                        135            90
X                          \\\\,,,,,,,,''-``,,,,,,,,
X                       ,,''\\   .Phaser.Firing An``,,  45
X                     ,'     \\ \\125              gles`,/
X                   ,'        \\. . Torpedo.          . `,
X   :------------------------\\ \\135_-----_ Fir        .  ,
X   :________________________/   _-   A 1 -_ ing       .  `
X                 |    ||       /        0  \\ Angles   .  |
X          Shield |  ,_^^_____/|      _   7  | .       .  | Shield
X             -180| [          {     (o)   1 } .       .  |0-
X            3    |  `-vv-----\\|      -   -  | .       .  |   1
X                 |    ||       \\        C  /  .       .  |
X   :-----------------------\\    -_   N C _-  .        .  ,
X   :_______________________/      -_____-   .       .   '
X                   `,       /225. . . . . .       .   ,'
X                     `,    /                    .   ,' \\
X                       ``,/ /235. . . . . . . . ,,''   315
X                         /`````````,,_,,''''''''
X                        225            270
X                                     |
X                                          Shield 4
X.fi
X.bp
END_OF_man/07.t
if test 1309 -ne `wc -c <man/07.t`; then
    echo shar: \"man/07.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/08ca.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/08ca.t\"
else
echo shar: Extracting \"man/08ca.t\" \(1320 characters\)
sed "s/^X//" >man/08ca.t <<'END_OF_man/08ca.t'
X.bp
X.ce
XWeapon And Vessel Specifications
X.ce
XHeavy Cruiser Class
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X.ce
XPhasers
X	Number of banks	4
X	Max range	1000 megameters
X	Max spread	90 degrees (45+45)
X	Min spread	20 degrees (10+10)
X	Max hit with 45 degree spread	10
X	Max hit with 10 degree spread	45
X	Loss of shield 1 per hit	hit/4.5
X	Loss of shields 2-3-4 per hit	hit/3
X	Firing angles with engineering	0-125, 235-360 degrees
X	Max charge per bank	10 units
X	Min charge or discharge time	1 sec
X.sp
X.ce
XTubes
X	Number of tubes	6
X	Max range	12,000 megameters
X	max launch speed	warp 12
X	Max time delay	10 seconds
X	Max proximity delay	500M
X	Max explosion radius	500M
X	Max number of pods launched	10
X	Max hit factor	50
X	Loss of shield 1 per hit	hit/3
X	Loss of shields 2-3-4 per hit	hit/2
X	Firing angles with engineering	0-135, 225-360 degrees
X.sp
X.ce
XProbes
X	Number of probe launchers	1
X	Max range	3000M
X	Max launch speed	2
X	Max time delay	15 sec
X	Max proximity delay	any
X	Max explosion radius	50 times number of pods
X	Max pods launched	fuel available
X	Max hit factor	10 times number of pods
X	Loss of shields per hit	same as torpedos
X	Firing angles with engineering	all
X.sp
X.ce
XVessels
X	Max turning rate	55 degrees
X	Max speed	warp 9 [11]
X	Min units burned per warp-second	1 [.75]
X	Crew	450 [350]
X.DE
END_OF_man/08ca.t
if test 1320 -ne `wc -c <man/08ca.t`; then
    echo shar: \"man/08ca.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/08cl.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/08cl.t\"
else
echo shar: Extracting \"man/08cl.t\" \(1321 characters\)
sed "s/^X//" >man/08cl.t <<'END_OF_man/08cl.t'
X.bp
X.ce
XWeapon And Vessel Specifications
X.ce
XLight Cruiser Class
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X.ce
XPhasers
X	Number of banks	4
X	Max range	1000 megameters
X	Max spread	90 degrees (45+45)
X	Min spread	20 degrees (10+10)
X	Max hit with 45 degree spread	10
X	Max hit with 10 degree spread	45
X	Loss of shield 1 per hit	hit/4.5
X	Loss of shields 2-3-4 per hit	hit/3
X	Firing angles with engineering	0-140, 220-360 degrees
X	Max charge per bank	10 units
X	Min charge or discharge time	1 sec
X.sp
X.ce
XTubes
X	Number of tubes	4
X	Max range	12,000 megameters
X	max launch speed	warp 12
X	Max time delay	10 seconds
X	Max proximity delay	500M
X	Max explosion radius	500M
X	Max number of pods launched	10
X	Max hit factor	50
X	Loss of shield 1 per hit	hit/3
X	Loss of shields 2-3-4 per hit	hit/2
X	Firing angles with engineering	0-150, 210-360 degrees
X.sp
X.ce
XProbes
X	Number of probe launchers	1
X	Max range	3000M
X	Max launch speed	2
X	Max time delay	15 sec
X	Max proximity delay	any
X	Max explosion radius	50 times number of pods
X	Max pods launched	fuel available
X	Max hit factor	10 times number of pods
X	Loss of shields per hit	same as torpedos
X	Firing angles with engineering	all
X.sp
X.ce
XVessels
X	Max turning rate	77 degrees
X	Max speed	warp 9 [11]
X	Min units burned per warp-second	.75 [.5]
X	Crew	350 [250]
X.DE
END_OF_man/08cl.t
if test 1321 -ne `wc -c <man/08cl.t`; then
    echo shar: \"man/08cl.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/08dd.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/08dd.t\"
else
echo shar: Extracting \"man/08dd.t\" \(1345 characters\)
sed "s/^X//" >man/08dd.t <<'END_OF_man/08dd.t'
X.ce
XAPPENDIX 3
X.sp 2
X.ce
XWeapon And Vessel Specifications
X.ce
XDestroyer Class Vessel
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X.ce
XPhasers
X	Number of banks	2
X	Max range	1000 megameters
X	Max spread	90 degrees (45+45)
X	Min spread	20 degrees (10+10)
X	Max hit with 45 degree spread	10
X	Max hit with 10 degree spread	45
X	Loss of shield 1 per hit	hit/3
X	Loss of shields 2-3-4 per hit	hit/2
X	Firing angles with engineering	0-150, 210-360 degrees
X	Max charge per bank	10 units
X	Min charge or discharge time	1 sec
X.sp
X.ce
XTubes
X	Number of tubes	4
X	Max range	12,000 megameters
X	max launch speed	warp 12
X	Max time delay	10 seconds
X	Max proximity delay	500M
X	Max explosion radius	500M
X	Max number of pods launched	10
X	Max hit factor	50
X	Loss of shield 1 per hit	hit/2.25
X	Loss of shields 2-3-4 per hit	hit/1.5
X	Firing angles with engineering	0-160, 200-360 degrees
X.sp
X.ce
XProbes
X	Number of probe launchers	1
X	Max range	3000M
X	Max launch speed	2
X	Max time delay	15 sec
X	Max proximity delay	any
X	Max explosion radius	50 times number of pods
X	Max pods launched	fuel available
X	Max hit factor	10 times number of pods
X	Loss of shields per hit	same as torpedos
X	Firing angles with engineering	all
X.sp
X.ce
XVessels
X	Max turning rate	120 degrees
X	Max speed	warp 10 [12]
X	Min units burned per warp-second	.5 [.5]
X	Crew	200 [150]
X.DE
END_OF_man/08dd.t
if test 1345 -ne `wc -c <man/08dd.t`; then
    echo shar: \"man/08dd.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/08dn.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/08dn.t\"
else
echo shar: Extracting \"man/08dn.t\" \(1318 characters\)
sed "s/^X//" >man/08dn.t <<'END_OF_man/08dn.t'
X.bp
X.ce
XWeapon And Vessel Specifications
X.ce
XDreadnought Class
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X.ce
XPhasers
X	Number of banks	6
X	Max range	1000 megameters
X	Max spread	90 degrees (45+45)
X	Min spread	20 degrees (10+10)
X	Max hit with 45 degree spread	10
X	Max hit with 10 degree spread	45
X	Loss of shield 1 per hit	hit/7.5
X	Loss of shields 2-3-4 per hit	hit/5
X	Firing angles with engineering	0-125, 235-360 degrees
X	Max charge per bank	10 units
X	Min charge or discharge time	1 sec
X.sp
X.ce
XTubes
X	Number of tubes	8
X	Max range	12,000 megameters
X	max launch speed	warp 12
X	Max time delay	10 seconds
X	Max proximity delay	500M
X	Max explosion radius	500M
X	Max number of pods launched	10
X	Max hit factor	50
X	Loss of shield 1 per hit	hit/6
X	Loss of shields 2-3-4 per hit	hit/4
X	Firing angles with engineering	0-135, 225-360 degrees
X.sp
X.ce
XProbes
X	Number of probe launchers	1
X	Max range	3000M
X	Max launch speed	2
X	Max time delay	15 sec
X	Max proximity delay	any
X	Max explosion radius	50 times number of pods
X	Max pods launched	fuel available
X	Max hit factor	10 times number of pods
X	Loss of shields per hit	same as torpedos
X	Firing angles with engineering	all
X.sp
X.ce
XVessels
X	Max turning rate	30 degrees
X	Max speed	warp 8 [10]
X	Min units burned per warp-second	2 [1.5]
X	Crew	600 [450]
X.DE
END_OF_man/08dn.t
if test 1318 -ne `wc -c <man/08dn.t`; then
    echo shar: \"man/08dn.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/09ca.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/09ca.t\"
else
echo shar: Extracting \"man/09ca.t\" \(575 characters\)
sed "s/^X//" >man/09ca.t <<'END_OF_man/09ca.t'
X.bp
X.ce
XInitial Settings
X.ce
XHeavy Cruiser Class
X.sp 1
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X	Crew	450 [350]
X	Speed	Warp 1
X	Course	0 [0-360] degrees
X	Engine Efficiency	1 [.75]
X	Fuel Level	150
X	Fuel Capacity	200
X	Regeneration Rate per Second	10
X	Helm Lock	None [None]
X	Phaser Deployment	90, 0, 0, 270
X	Phaser Bank Levels	4 x 10 units
X	Phaser Charge/Discharge Rates	4 x 10 units
X	Shield Drain	4 x 1 units
X	Shield Percentage	4 x 100
X	Torpedo Deployment	120, 60, 0, 0, 300, 240
X	Tube Levels	6 x Zero
X	Total Charged Pods Available	190
X.sp
X.DE
END_OF_man/09ca.t
if test 575 -ne `wc -c <man/09ca.t`; then
    echo shar: \"man/09ca.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/09cl.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/09cl.t\"
else
echo shar: Extracting \"man/09cl.t\" \(562 characters\)
sed "s/^X//" >man/09cl.t <<'END_OF_man/09cl.t'
X.ce
XInitial Settings
X.ce
XLight Cruiser Class
X.sp 1
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X	Crew	350 [250]
X	Speed	Warp 1
X	Course	0 [0-360] degrees
X	Engine Efficiency	.75 [.5]
X	Fuel Level	125
X	Fuel Capacity	175
X	Regeneration Rate per Second	10
X	Helm Lock	None [None]
X	Phaser Deployment	90, 0, 0, 270
X	Phaser Bank Levels	4 x 10 units
X	Phaser Charge/Discharge Rates	4 x 10 units
X	Shield Drain	4 x 1 units
X	Shield Percentage	4 x 100
X	Torpedo Deployment	60, 0, 0, 300
X	Tube Levels	4 x Zero
X	Total Charged Pods Available	190
X.sp
X.DE
END_OF_man/09cl.t
if test 562 -ne `wc -c <man/09cl.t`; then
    echo shar: \"man/09cl.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/09dd.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/09dd.t\"
else
echo shar: Extracting \"man/09dd.t\" \(574 characters\)
sed "s/^X//" >man/09dd.t <<'END_OF_man/09dd.t'
X.bp
X.ce
XAPPENDIX 4
X.sp 2
X.ce
XInitial Settings
X.ce
XDestroyer class
X.sp 1
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X	Crew	200 [150]
X	Speed	Warp 1
X	Course	0 [0-360] degrees
X	Engine Efficiency	.5 [.5]
X	Fuel Level	100
X	Fuel Capacity	150
X	Regeneration Rate per Second	8.0
X	Helm Lock	None [None]
X	Phaser Deployment	0, 0
X	Phaser Bank Levels	2 x 10 units
X	Phaser Charge/Discharge Rates	2 x 10 units
X	Shield Drain	2 x 1 units
X	Shield Percentage	2 x 100
X	Torpedo Deployment	60, 0, 0, 300
X	Tube Levels	4 x Zero
X	Total Charged Pods Available	190
X.sp
X.DE
END_OF_man/09dd.t
if test 574 -ne `wc -c <man/09dd.t`; then
    echo shar: \"man/09dd.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/09dn.t -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/09dn.t\"
else
echo shar: Extracting \"man/09dn.t\" \(587 characters\)
sed "s/^X//" >man/09dn.t <<'END_OF_man/09dn.t'
X.ce
XInitial Settings
X.ce
XDreadnought Class
X.sp 1
X.ce
XEnemy exceptions are enclosed within [brackets]
X.sp
X.DS
X.ta 2.8iR 3.3i
X	Crew	600 [450]
X	Speed	Warp 1
X	Course	0 [0-360] degrees
X	Engine Efficiency	2 [1.5]
X	Fuel Level	200
X	Fuel Capacity	200
X	Regeneration Rate per Second	15
X	Helm Lock	None [None]
X	Phaser Deployment	90, 90, 0, 0, 270, 270
X	Phaser Bank Levels	6 x 10 units
X	Phaser Charge/Discharge Rates	6 x 10 units
X	Shield Drain	4 x 1 units
X	Shield Percentage	4 x 100
X	Torpedo Deployment	120, 60, 60, 0, 0, 300, 300, 240
X	Tube Levels	8 x Zero
X	Total Charged Pods Available	190
X.sp
X.DE
END_OF_man/09dn.t
if test 587 -ne `wc -c <man/09dn.t`; then
    echo shar: \"man/09dn.t\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f man/shipyard.6 -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"man/shipyard.6\"
else
echo shar: Extracting \"man/shipyard.6\" \(841 characters\)
sed "s/^X//" >man/shipyard.6 <<'END_OF_man/shipyard.6'
X.TH SHIPYARD 6 "17 Oct 1986"
X.UC 4
X.SH NAME
Xshipyard - Ship constructor for trek73
X.SH SYNOPSIS
Xshipyard
X.SH DESCRIPTION
X.PP
X.I Shipyard
Xis a program to construct ships that can be used in the game
X.I trek73.
X.PP
XThe user enters in the parameters for his new ship class.
XOnce all of the parameters have been entered, the basic point
Xvalue (BPV) of the ship is printed out, as is its efficiency,
Xturn rate, and maximum speed.
X.PP
XIf these values are acceptable, the ship class is saved into
Xthe user's home directory as
X.I .shipXX
X, where XX is the two-letter designation of the ship's class.
X.SH FILES
X.TP
X$HOME/.trek??	Non-standard class ship
X.SH SEE ALSO
Xtrek73(6)
X.br
XJeff Okamoto,
X.I "The Star Trek Battle Manual"
X.SH AUTHOR
XJeff Okamoto
X.SH BUGS
XHopefully none.
XBug reports should be sent to: ..!hplabs!hpccc!okamoto and ..!ucbvax!yee.
END_OF_man/shipyard.6
if test 841 -ne `wc -c <man/shipyard.6`; then
    echo shar: \"man/shipyard.6\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f src/command.l -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"src/command.l\"
else
echo shar: Extracting \"src/command.l\" \(2296 characters\)
sed "s/^X//" >src/command.l <<'END_OF_src/command.l'
X%p 3000
X%{
X#ident "@(#) TREK73 $Header: command.l,v 1.2 87/10/09 12:20:33 okamoto Exp $"
X/*
X * $Source: /ccc/okamoto/src/trek/src/RCS/command.l,v $
X *
X * $Header: command.l,v 1.2 87/10/09 12:20:33 okamoto Exp $
X *
X * $Log:	command.l,v $
X * Revision 1.2  87/10/09  12:20:33  12:20:33  okamoto (Jeff Okamoto)
X * Added more positions for lex, added some null keywords
X * 
X * Revision 1.1  87/10/09  12:19:51  12:19:51  okamoto (Jeff Okamoto)
X * Initial revision
X */
X	double	atof();
X	char	Input[BUFSIZ];
X	char	*Inptr;
X%}
X
XWS	[ \t]*
X
X%%
X[+-]?[0-9.]+		{ yylval.dval = atof(yytext); return(NUMBER); }
Xabort			{ return(ABORT); }
Xall			{ return(ALL); }
Xat			;
Xcontrol			{ return(CONTROL); }
Xcorbomite{WS}bluff	|
Xcorbomite		{ return(CORB); }
Xturn			|
Xcourse			{ return(COURSE); }
Xdamage{WS}report	|
Xdamage			{ return(DAMAGE); }
Xplay{WS}dead		|
Xdead			{ return(DEAD); }
Xdelay			|
Xfuse			{ return(DELAY); }
Xdemand			{ return(DEMAND); }
Xself-destruct		|
Xself{WS}destruct	|
Xdestruct		{ return(DESTR); }
Xdetonate		{ return(DET); }
Xdisplay			{ return(DISPLAY); }
Xelude			{ return(ELUDE); }
Xengineering		|
Xeng			{ return(ENG); }
Xfire			{ return(FIRE); }
Xhelp			{ return(HELP); }
Xjettison		|
Xjett			{ return(JETT); }
Xlaunch			{ return(LAUNCH); }
Xload			{ return(LOAD); }
Xlock			{ return(LOCK); }
Xonto			;
Xon			;
Xparameters		|
Xparams			|
Xparam			{ return(PARAM); }
Xphasers			|
Xphaser			{ return(PHASER); }
Xpod			|
Xpods			;
Xalter{WS}power		|
Xpower			{ return(POWER); }
Xprobe			{ return(PROBE); }
Xprox			|
Xproximity		{ return(PROXIMITY); }
Xpursue			{ return(PURSUE); }
Xrotate			{ return(ROTATE); }
Xsave			{ return(SAVE); }
Xscan			{ return(SCAN); }
Xspread			{ return(SPREAD); }
Xstatus			{ return(STATUS); }
Xsurrender		{ return(SURREND); }
Xsurvivors{WS}report	|
Xsurvivors		|
Xsurv			{ return(SURV); }
Xtactical		{ return(TACTIC); }
Xthe			;
Xto			;
Xtoward			|
Xtowards			{ return(TOWARD); }
Xphotons			|
Xphoton			|
Xtorpedos		|
Xtorpedo			|
Xtorp			|
Xtorps			|
Xtubes			|
Xtube			{ return(TUBE); }
Xunload			{ return(UNLOAD); }
Xversion			{ return(VERSION); }
Xwarp{WS}factor		|
Xwarp			{ return(WARP); }
Xwith			;
X
X[A-Za-z#]+		{ (void) strcpy( yylval.sval, yytext);
X				return(NAME); }
X{WS}			;
X\n			{ return(-1); }
X.			;
X%%
X
X#undef input
X#undef unput
X
Xinput()
X{
X	int c;
X
X	c = *Inptr++;
X	return (c);
X}
X
Xunput(c)
Xchar c;
X{
X	Inptr--;
X}
END_OF_src/command.l
if test 2296 -ne `wc -c <src/command.l`; then
    echo shar: \"src/command.l\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f src/externs.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"src/externs.h\"
else
echo shar: Extracting \"src/externs.h\" \(2716 characters\)
sed "s/^X//" >src/externs.h <<'END_OF_src/externs.h'
X#ident "@(#) TREK73 $Header: externs.h,v 1.1 87/10/09 11:06:05 okamoto Exp $"
X/*
X * $Source: /ccc/okamoto/src/trek/src/RCS/externs.h,v $
X *
X * $Header: externs.h,v 1.1 87/10/09 11:06:05 okamoto Exp $
X *
X * $Log:	externs.h,v $
X * Revision 1.1  87/10/09  11:06:05  11:06:05  okamoto (Jeff Okamoto)
X * Initial revision
X * 
X */
X/*
X * TREK73: externs.h
X *
X * External declarations for TREK73
X *
X */
X
X/* UNIX include files needed for most (if not all) of the C files */
X#include <stdio.h>
X#ifdef SYSV
X#include <string.h>
X#endif SYSV
X#ifdef BSD
X#include <strings.h>
X#endif BSD
X#include <math.h>
X
X/* UNIX extern declarations of functions used which do not
X   return int plus any extern variable declarations    */
Xextern char	*getenv(), *malloc();
Xextern long	time();
Xextern unsigned	sleep(), alarm();
Xextern void	exit(), free(), perror();
X#ifdef SYSV
Xextern void	srand();
X#endif SYSV
Xextern char	*optarg;
X
X/*
X * Now continue with declarations specific to TREK73
X */
X
X#include "structs.h"
X
Xextern char	*Gets(), *vowelstr();
Xextern char	*sysname[S_NUMSYSTEMS];
Xextern char	*statmsg[S_NUMSYSTEMS + 1];
Xextern char	*feds[];
Xextern char	*options;
X
Xextern float	init_p_turn[MAXPHASERS][MAXPHASERS];
Xextern float	init_t_turn[MAXTUBES][MAXTUBES];
Xextern float	segment, timeperturn;
Xextern float	rectify(), bearing(), round();
X
Xextern char	home[256];
Xextern char	savefile[256];
Xextern char	captain[30];
Xextern char	class[3];
Xextern char	com[30];
Xextern char	com_delay[6];
Xextern char	empire[30];
Xextern char	engineer[30];
Xextern char	foeclass[3];
Xextern char	foename[30];
Xextern char	foerace[30];
Xextern char	foestype[30];
Xextern char	helmsman[30];
Xextern char	nav[30];
Xextern char	racename[20];
Xextern char	savefile[256];
Xextern char	science[30];
Xextern char	sex[20];
Xextern char	shipname[30];
Xextern char	shutup[HIGHSHUTUP];
Xextern char	slots[HIGHSLOT];
Xextern char	title[9];
X
Xextern int	parsit();
Xextern int	cmdarraysize;
Xextern int	corbomite;
Xextern int	defenseless;
Xextern int	enemynum;
Xextern int	global;
Xextern int	high_command;
Xextern int	reengaged;
Xextern int	restart;
Xextern int	shipnum;
Xextern int	silly;
Xextern int	surrender;
Xextern int	surrenderp;
Xextern int	teletype;
Xextern int	terse;
Xextern int	time_delay;
Xextern int	trace;
Xextern char	can_cloak;
Xextern double	e_bpv;
X
Xextern char	Input[BUFSIZ];
Xextern char	*Inptr;
Xextern char	parsed[BUFSIZ];
X
Xextern struct ship_stat	us;
Xextern struct ship_stat	them;
X
Xextern int 	(*strategies[])();
Xextern int	rangefind();
X
Xextern struct cmd		*scancmd(), cmds[];
Xextern struct race_info		aliens[MAXFOERACES];
Xextern struct damage		p_damage, a_damage;
Xextern struct list		*newitem(), head, *tail;
Xextern struct ship		*shiplist[10], *ship_name();
Xextern struct ship_stat		stats[];
END_OF_src/externs.h
if test 2716 -ne `wc -c <src/externs.h`; then
    echo shar: \"src/externs.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f src/getopt.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"src/getopt.c\"
else
echo shar: Extracting \"src/getopt.c\" \(1984 characters\)
sed "s/^X//" >src/getopt.c <<'END_OF_src/getopt.c'
X#ident "@(#) TREK73 $Header: getopt.c,v 1.1 87/10/09 11:07:10 okamoto Exp $"
X/*
X * $Source: /ccc/okamoto/src/trek/src/RCS/getopt.c,v $
X *
X * $Header: getopt.c,v 1.1 87/10/09 11:07:10 okamoto Exp $
X *
X * $Log:	getopt.c,v $
X * Revision 1.1  87/10/09  11:07:10  11:07:10  okamoto (Jeff Okamoto)
X * Initial revision
X * 
X */
X#include <stdio.h>
X
X/*
X**  This is the public-domain AT&T getopt(3) code.  I added the
X**  #ifndef stuff because I include <stdio.h> for the program;
X**  getopt, per se, doesn't need it.  I also added the INDEX/index
X**  hack (the original used strchr, of course).  And, note that
X**  technically the casts in the write(2) calls shouldn't be there.
X*/
X
X#ifndef NULL
X#define NULL	0
X#endif
X#ifndef EOF
X#define EOF	(-1)
X#endif
X#ifndef INDEX
X#define INDEX index
X#endif
X
X
X#define ERR(s, c)	if(opterr){\
X	extern int strlen(), write();\
X	char errbuf[2];\
X	errbuf[0] = c; errbuf[1] = '\n';\
X	(void) write(2, argv[0], (unsigned)strlen(argv[0]));\
X	(void) write(2, s, (unsigned)strlen(s));\
X	(void) write(2, errbuf, 2);}
X
Xextern int strcmp();
Xextern char *INDEX();
X
Xint	opterr = 1;
Xint	optind = 1;
Xint	optopt;
Xchar	*optarg;
X
Xint
Xgetopt(argc, argv, opts)
Xint	argc;
Xchar	**argv, *opts;
X{
X	static int sp = 1;
X	register int c;
X	register char *cp;
X
X	if(sp == 1)
X		if(optind >= argc ||
X		   argv[optind][0] != '-' || argv[optind][1] == '\0')
X			return(EOF);
X		else if(strcmp(argv[optind], "--") == NULL) {
X			optind++;
X			return(EOF);
X		}
X	optopt = c = argv[optind][sp];
X	if(c == ':' || (cp=INDEX(opts, c)) == NULL) {
X		ERR(": illegal option -- ", c);
X		if(argv[optind][++sp] == '\0') {
X			optind++;
X			sp = 1;
X		}
X		return('?');
X	}
X	if(*++cp == ':') {
X		if(argv[optind][sp+1] != '\0')
X			optarg = &argv[optind++][sp+1];
X		else if(++optind >= argc) {
X			ERR(": option requires an argument -- ", c);
X			sp = 1;
X			return('?');
X		} else
X			optarg = argv[optind++];
X		sp = 1;
X	} else {
X		if(argv[optind][++sp] == '\0') {
X			sp = 1;
X			optind++;
X		}
X		optarg = NULL;
X	}
X	return(c);
X}
END_OF_src/getopt.c
if test 1984 -ne `wc -c <src/getopt.c`; then
    echo shar: \"src/getopt.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f src/printships.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"src/printships.c\"
else
echo shar: Extracting \"src/printships.c\" \(1065 characters\)
sed "s/^X//" >src/printships.c <<'END_OF_src/printships.c'
X#ident "@(#) TREK73 $Header: printships.c,v 1.1 87/10/09 11:10:37 okamoto Exp $"
X/*
X * $Source: /ccc/okamoto/src/trek/src/RCS/printships.c,v $
X *
X * $Header: printships.c,v 1.1 87/10/09 11:10:37 okamoto Exp $
X *
X * $Log:	printships.c,v $
X * Revision 1.1  87/10/09  11:10:37  11:10:37  okamoto (Jeff Okamoto)
X * Initial revision
X * 
X */
X/*
X * TREK73: printships.c
X *
X * Print Basic Point Values for all standard ships.
X *
X */
X
X#include <stdio.h>
X#include "externs.h"
X
Xextern struct ship_stat stats[];
X
Xmain()
X{
X	double bpv, efficiency;
X	int turn, max_speed;
X	int i;
X	void calculate();
X
X	for(i=0; i<MAXSHIPCLASS; i++) {
X		calculate(
X		    stats[i].regen,
X		    stats[i].pods,
X		    stats[i].ph_shield,
X		    stats[i].tp_shield,
X		    stats[i].num_phaser + stats[i].num_torp,
X		    stats[i].o_crew,
X		    &bpv,
X		    &efficiency,
X		    &turn,
X		    &max_speed
X		);
X		printf("%s:", stats[i].abbr);
X		printf("\tBPV =\t\t%.2f\n", bpv);
X		printf("\tEfficiency =\t%.2f\n", efficiency);
X		printf("\tTurn =\t\t%d\n", turn);
X		printf("\tMax speed =\t%d\n\n", max_speed);
X	}
X}
END_OF_src/printships.c
if test 1065 -ne `wc -c <src/printships.c`; then
    echo shar: \"src/printships.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f src/union.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"src/union.h\"
else
echo shar: Extracting \"src/union.h\" \(420 characters\)
sed "s/^X//" >src/union.h <<'END_OF_src/union.h'
X#ident "@(#) TREK73 $Header: union.h,v 1.1 87/10/09 11:14:09 okamoto Exp $"
X/*
X * $Source: /ccc/okamoto/src/trek/src/RCS/union.h,v $
X *
X * $Header: union.h,v 1.1 87/10/09 11:14:09 okamoto Exp $
X *
X * $Log:	union.h,v $
X * Revision 1.1  87/10/09  11:14:09  11:14:09  okamoto (Jeff Okamoto)
X * Initial revision
X * 
X */
X/*
X * TREK73: union.h
X *
X * Union for yacc
X */
Xtypedef union {
X	double dval;
X	char sval[20];
X} YYSTYPE;
END_OF_src/union.h
if test 420 -ne `wc -c <src/union.h`; then
    echo shar: \"src/union.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f src/vers.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"src/vers.c\"
else
echo shar: Extracting \"src/vers.c\" \(478 characters\)
sed "s/^X//" >src/vers.c <<'END_OF_src/vers.c'
X#ident "@(#) TREK73 $Header: vers.c,v 1.1 87/10/09 11:13:48 okamoto Exp $"
X/*
X * $Source: /ccc/okamoto/src/trek/src/RCS/vers.c,v $
X *
X * $Header: vers.c,v 1.1 87/10/09 11:13:48 okamoto Exp $
X *
X * $Log:	vers.c,v $
X * Revision 1.1  87/10/09  11:13:48  11:13:48  okamoto (Jeff Okamoto)
X * Initial revision
X * 
X */
X/*
X * TREK73: vers.c
X *
X * version
X */
X
Xvers()
X{
X	extern char version[];
X
X	printf("%s\n", version);
X	printf("Jeff Okamoto, Peter Yee, and Roger Noe\n");
X	return 1;
X}
END_OF_src/vers.c
if test 478 -ne `wc -c <src/vers.c`; then
    echo shar: \"src/vers.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 6 \(of 6\).
cp /dev/null ark6isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 6 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0