[comp.sources.games] v05i007: mpss - multi-player Star Trek game, Part01/04

games@tekred.TEK.COM (07/21/88)

Submitted by: Peer Schmitz <peer@cs.kl.ac.uk>
Comp.sources.games: Volume 5, Issue 7
Archive-name: mpss/Part01

	[OK, I learned my lesson with spacewar. I not only compiled this,
	 but verified that it started up and seemed to work.  -br]

#! /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 1 (of 4)."
# Contents:  README MANIFEST mpss.c planets.c torpedo.c
# Wrapped by billr@saab on Wed Jul 20 17:00:24 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(1043 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XMULTI-PLAYER-STAR-TREK, is a brand new
Xaction/chase/adventure game that is guaranteed to bring the load average
Xof any machine to its knees. It runs on DEC-Microvaxes
X(and possibly lots of other UNIX machines) and has so far been
Xrunning under Ultrix V1.2 . It has not been tested on other operating
Xsystems, BUT every effort was made to stick to standard C, so if
Xyou install it and something fails to compile, take a look at it,
Xthe code should be clear and easy to adapt to your system. (Famous Last Words.) 
X
XMPSS is based on the old PDP11/34 Multi Terminal Starwars idea,
Xis however alot better and is based on STAR TREK. A player plays one of
Xover 30 Federation/Klingon/Romulan ships, in a universe with 
Xapproximately 30 planets to explore and much much more. 
XInstallation can be tricky, so read
Xthe INSTALLRULES file and the RULES file when you have decoded
Xthis compressed tar image. Any comments to 
X
X		peer@cs.kl.ac.uk  (JANET)
X
Xplease. This is the first release of this game so should you find
Xany bugs....dont moan....fix them!
X
END_OF_FILE
if test 1043 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(1075 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X InstallRules.ms            4	
X MANIFEST                   1	This shipping list
X Makefile                   3	
X README                     1	
X Rules.ms                   2	
X aliens.c                   4	
X auto.c                     4	
X collision.c                4	
X consoleplots.c             3	
X cross.c                    3	
X cursor.c                   2	
X dock.c                     4	
X files.h                    4	
X header.h                   4	
X keyscan.c                  4	
X main.c                     3	
X makefile.dist              4	
X mpss.c                     1	
X mpssclean.c                4	
X mpssmail                   4	
X newplayer.c                3	
X orbit.c                    3	
X planets.c                  1	
X planets.h                  4	
X processinput.c             2	
X scan.c                     3	
X setupuniverse.c            4	
X ships.c                    3	
X ships.h                    4	
X slave.c                    2	
X torpedo.c                  1	
END_OF_FILE
if test 1075 -ne `wc -c <'MANIFEST'`; then
    echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test -f 'mpss.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mpss.c'\"
else
echo shar: Extracting \"'mpss.c'\" \(895 characters\)
sed "s/^X//" >'mpss.c' <<'END_OF_FILE'
X
X#include <stdio.h>
X#include "files.h"
X
Xmain(argc,argv)
Xint argc;
Xchar *argv[];
X{
Xint i;
Xchar c;
Xchar *tnam;
Xchar terminalfile[14];
X
Xi=umask(000); /*to make sure files are created with the right permissions.*/
X
X
X	if (isatty(1)!=1)
X	{
X	fprintf(stdout,"                  You cannot play from a file\n");
X	exit(0);
X	}
X
X	tnam=(char *)ttyname(1);
X	strcpy(terminalfile,tnam);
X	
X	/*Now make the terminal file rw access for everyone!*/
X
X	if (chmod(terminalfile, 0666)<0)
X	{
X	fprintf(stdout,terminalfile);
X	fprintf(stdout,"                   : cannot chmod your terminal file!!!\n");
X	exit(0);
X	}
X	
X	if (argc==1)
X	execl(SLAVEPROGRAM,"slave",(char *) 0);
X	else
X		{
X		if (argc==2)
X		execl(SLAVEPROGRAM,"slave",argv[1],(char *) 0);
X			else
X			{
X			if (argc==3)
X			execl(SLAVEPROGRAM,"slave",argv[1],argv[2],(char *) 0);
X			else
X			{
X			fprintf(stderr,"Usage: mpss {-i} {-t}\n");
X			exit(0);
X			}
X			}
X		}
X}
END_OF_FILE
if test 895 -ne `wc -c <'mpss.c'`; then
    echo shar: \"'mpss.c'\" unpacked with wrong size!
fi
# end of 'mpss.c'
fi
if test -f 'planets.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'planets.c'\"
else
echo shar: Extracting \"'planets.c'\" \(38410 characters\)
sed "s/^X//" >'planets.c' <<'END_OF_FILE'
X
X/*******************************************************************************
X********************************************************************************
X********************************************************************************
X
XPERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
XTHIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
X
X		P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
X
X
X********************************************************************************
X********************************************************************************
X*******************************************************************************/
X
X#include "planets.h"
X
Xstruct plans plan[] =
X	{
X	0,220,670,
X	"          Spock : We are now orbiting earth sir.         ",
X	"                ***************                          ",
X	"         ********             *********                  ",
X	"         *     Starfleet Command      *                  ",
X	"         *United Federation of Planets*                  ",
X	"         *   Starfleet Headquarters   *                  ",
X	"         ********             *********                  ",
X	"                ***************                          ",
X	"Admiral Nogouchi : Welcome to Starfleet Command Kirk.    ",
X	"Your mission will last for 5 years flying around the     ",
X	"Galaxy to explore new life whereever you can. While you  ",
X	"are doing this, I suggest you blast as many klingons as  ",
X	"you can, as well as any enemies you don't particularily  ",
X	"like. You can beam down to planets and find devices that ",
X	"will improve your ships capabilities or you will         ",
X	"encounter beings that can teach you how to play this game",
X	"properly. Oh yes, before I forget, this time you don't   ",
X	"need to bring back any whales, we still have two from the",
X	"last film.                                               ",
X	"                                Good luck Jim!           ",
X	1,100,788,
X	"  Spock : We are now orbiting my home planet Vulcan Jim. ",
X	"You are standing on a little cliff overlooking the vulcan",
X	"plateau used for their ceremonies. It seems that Spock is",
X	"suffering from pon-farr, the vulcan 7-year mating cycle. ",
X	"As a result Spock needs to get married and this is done  ",
X	"before your eyes in the koon-ut-kal-if-fee ceremony.     ",
X	"The Vulcan high priestess T'Pau then refuses Spock the   ",
X	"right to marriage as he has not yet achieved the vulcan  ",
X	"state of kohlinahr, the symbol of total logic. She does  ",
X	"however cure spock of his pon-farr (how shall not be     ",
X	"revealed here..) and you can beam back up safely.        ",
X	"Jim : That was a close one.   Spock : It would           ",
X	"not have been logical anyways. Imagine if my wife brings ",
X	"me my butties on the bridge.                             ",
X	"However, Tpau gave Spock a phaser blast turbo accelerator",
X	"which will allow your phasers to shoot further by two    ",
X	"Quadrants.                                               ",
X	"                                                         ",
X	"Effect : Phasers shoot 2 positions further.              ",
X	"                                                         ",
X	2,150,500,
X	"Spock : We are above the 3rd planet of the Dagobah system",
X	"You arrive and find nothing but a slimy mudhole of a     ",
X	"place, until a little dwarf approaches you and attempts  ",
X	"to teach you the ways of the force. You try hard but fail",
X	"yet and yet again. This makes your master upset and he   ",
X	"says : 'Always with you, it cannot be done. Hear you     ",
X	"nothing that I say? You must feeeel the force flowing    ",
X	"through you. But beware of the darkside. Once you start  ",
X	"on the dark path, forever will it dominate your destiny.'",
X	"Knowing this you make instant progress and               ",
X	"the little dwarf gives you a playing hint. He says :     ",
X	"if one ship is over a starbase and you are too, if you   ",
X	"lock tractor beams you will lock on to the enemy ship,   ",
X	"not the starbase. With that he vanishes into a puff of   ",
X	"smoke. (as in a good adventure)     /                    ",
X	"                                   /                     ",
X	"                                  /                      ",
X	"Effect : You are now a Jedi.     /                       ",
X	" This is your new weapon-->     /                        ",
X	"                              /_/                        ",
X	3,400,675,
X	"Spock : This is Ceti Alpha 6. Where we left Khan marooned",
X	"You are standing on the planet but Khan and his crew are ",
X	"nowhere to be found. However you do find a  dilithium    ",
X	"crystal reenergizer that will allow you 50 extra units of",
X	"energy. Great Scotts, says Mr. Scott when he sees it, and",
X	"faints instantly. Bones leans over him to check him out, ",
X	"gives him an injection and makes him come alive again.   ",
X	"Jim : Hows the auxilliary power Mr. Scott?-----/|        ",
X	"Scotty :Aye sir, I think it's restored.       / |        ",
X	"    /                                        /  |        ",
X	"   ------------------------------------------   |        ",
X	"   |   dilithium crystal reenergiser o o o o|   |        ",
X	"   |   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ o o o o|   |        ",
X	"   |_______________                  o o o o|   |        ",
X	"   |   qwertyuiop | * *         ___  o o o o|  /         ",
X	"   | asdfghjkl;'\\R|                         | /          ",
X	"   | zxcvbmn,.?Sh |                         |/           ",
X	"   ------------------------------------------            ",
X	"                                                         ",
X	"Effect : You are allowed 50 extra energy units           ",
X	4,410,600,
X	"Spock : This is Ceti Alpha 6. Odd,it is class D : desert.",
X	"Normally Ceti Alpha 6 should be class M, but as you soon ",
X	"discover, a planetary disaster shifted the orbit of the  ",
X	"of the planet and laid waste to entire regions of its    ",
X	"surface. Only then do you realize your mistake..this must",
X	"be Ceti Aplha 5, not 6.'Oh well' you think, and carry on ",
X	"exploring.                                               ",
X	"You find an old cargo container that someone is using as ",
X	"a house. You enter and find the inscription 'Botany Bay' ",
X	"on a belt hanging from a shelf. When you realize whats   ",
X	"happened, Khan and his crew stand behind you. Khan takes ",
X	"your phaser and kills you, Chekov, Spock, Bones, Sulu and",
X	"Uhura. Then the director comes in and changes the script ",
X	"so you could all survive, and he gives you some extra    ",
X	"photon torpedo cargo containers, so you can carry about  ",
X	"three more photon torpedos on your ship.                 ",
X	"                                                         ",
X	"                                                         ",
X	"Effect : Room for 3 more photon torpedos.                ",
X	"                                                         ",
X	5,321,475,
X	"Spock : We are above the planetary space port Far Point. ",
X	"Arriving at the station you receive a warm welcome from  ",
X	"the station co-ordinator. It also seems that what ever   ",
X	"you wish for (ex. a bowl of apples) materializes         ",
X	"instantly.  Spock catches on to this and wishes himself  ",
X	"a turbo charger for the warp engines :  and.......FZAPPPP",
X	"there it is. This baby will boost the speed of our ship  ",
X	"by one warp factor in any direction Spock says. You      ",
X	"realize then that this is not a space port but a living  ",
X	"organism and you set it free. It seems to look like a    ",
X	"giant jelly fish of some kind, and it meets another one  ",
X	"in space. All in all they drift happily ever after.      ",
X	"         ...        ...          *                       ",
X	"  *     .....      ......            _=_                 ",
X	"       ..|||..    ..||||..       ============  (========{",
X	"        / / \\       //\\\\      *        \\ \\  (========{   ",
X	"       / /   \\     //  |\\             __\\_\\___\\/___  *   ",
X	"      / | \\  /\\   //   /\\\\            O__________(       ",
X	"     /  |\\ \\/ \\  //\\  /\\/\\\\                              ",
X	" Effect :Your ship will now fly 1 warp faster than others",
X	6,800,600,
X	"       Spock : We are now orbiting the planet M-113.     ",
X	"You and McCoy beam down and find two archeologists       ",
X	"Robert and Nancy Crater, for whom you have brought       ",
X	"supplies. Then you realise that Nancy is Bones's old     ",
X	"girlfriend. (She calls him Plum) While McCoy and Nancy   ",
X	"hide for a few hours, Robert shows you a new invention   ",
X	"he has made. Its a new matter-antimatter-neutron         ",
X	"accelerator that will increase the power of your         ",
X	"phaser shots by 20 enery units. He gives it to you as    ",
X	"he is very grateful for all the supplies you brought.    ",
X	"Then Nancy and McCoy return. Bones has rather messy      ",
X	"hair and a twinkle in his eye. You decide it best not    ",
X	"to persue the matter and beam back up to the ship.       ",
X	"                   .       .                             ",
X	"                 .   .   .   .                           ",
X	"                 .     .     .                           ",
X	"                  .         .                            ",
X	"                    .     .                              ",
X	"                       .                                 ",
X	"   Effect: Phaser shots power is increased by 20 units.  ",
X	7,708,710,
X	"    Spock : This is Thasus. I am scanning wreckage sir.  ",
X	"What you find here is not a pretty sight. A ship,        ",
X	"totally obliterated from a crash. You search around      ",
X	"for a while and find a device that can read your mind    ",
X	"and work miracles. It makes you a glass of romulan ale   ",
X	"and you soon decide to have a party. While you are       ",
X	"drunk, you wish that your ship had no weapons at all,    ",
X	"and the machine makes this come true. When you sober     ",
X	"up again you receive a message from Mr. Scott who is     ",
X	"still in orbit. He says someone nicked all the photon    ",
X	"torpedos and drained the phaserbanks. You find the       ",
X	"machine and stomp on it. Angrily you beam back up.       ",
X	"                  | |                                    ",
X	"------\\   ../----/   \\----------------|                  ",
X	"       |.. |     |ROM|               /|                  ",
X	"       |---|     |ULA|              / |                  ",
X	"       -----     | N |             /  |                  ",
X	"         |       |Ale|            /   |                  ",
X	"       -----     |___|           /    |                  ",
X	"Effect: Empty phaserbanks and no more torpedos chief.    ",
X	8,170,780,
X	"  Spock:This is Exo III-the last known home of Dr Korby. ",
X	"You arrive at the planet to find out what happened to    ",
X	"Dr. Roger Korby, the Pasteur of archological medicine.   ",
X	"It seems he has created a fleet of androids that         ",
X	"wish to take over the Galaxy. You also find out that     ",
X	"he is Nurse Chapel's fiance. When Nurse Chapel finds     ",
X	"out about his vicious plan, she kills her fiance and     ",
X	"destroys all the androids but one.The remaining robot    ",
X	"is revamped by scotty into a super large phaser bank.    ",
X	"Nurse Chapel escapes with a shock.                       ",
X	"                _____                                    ",
X	"                |. .|o O 0 -------------------------     ",
X	"                |---|      |life? dont't talk to me|     ",
X	"                -----      |  about life.....      |     ",
X	"                  I        -------------------------     ",
X	"              ----I----                                  ",
X	"                  I                                      ",
X	"                 / \\                                     ",
X	"                /   \\                                    ",
X	"Effect:Your Phaser bank can hold 10 more shots!!!!       ",
X	9,432,468,
X	"  Spock : We are now orbiting the planet Tantalus five.  ",
X	"You find a 'progressive' penal colony directed by        ",
X	"Dr. Tristan Adams. Dr. Gelder, an inmate,escapes and     ",
X	"beams aboard the enterprise where he threatens to        ",
X	"take over your ship.Spock beams back to stop him and     ",
X	"manages to apply his vulcan neck pinch while Gelder      ",
X	"is fiddling around with your ships photon-torpedo        ",
X	"control. He has managed to increase the range of the     ",
X	"ships torpedos by 3 quadrants. Spock and Scotty then     ",
X	"transport him back on to the planet, where you take      ",
X	"him and lock him up for good. As the Colony also         ",
X	"serves as a weapons dump, you reenergise your phaser     ",
X	"banks and re-stock your photon torpedos.                 ",
X	"                                                         ",
X	"                                                         ",
X	"Effect : Weapons reenergised; Torpedos Range             ",
X	"             increased by 3 Quadrants.                   ",
X	"                                                         ",
X	"                                                         ",
X	"                                                         ",
X	10,120,120,
X	"Sulu : This is the GENESIS planet, after Khans explosion.",
X	"You find that the entire planet is very unstable. Mr.    ",
X	"Saavik finds an old Photon Torpedo inscribed MARK IV,    ",
X	"which, at closer observation turns out to be Spocks      ",
X	"Coffin. However, it is empty. Then a message arrives ;-  ",
X	"'Sir, a Klingon Battle Cruiser is challenging our orbit  ",
X	"position sir.' Kirk-'Mr. Sulu: cloak, turn her around to ",
X	"271 mark 3, and engage.' Sulu-'Aye Sir'. While your ship ",
X	"and the battle cruiser are fighting it out, you take a   ",
X	"closer look at the coffin and find a note which describes",
X	"the way to an ancient cave concealing phenomenal techno- ",
X	"logies. Mr. Saavik thinks thats what the klingons must be",
X	"after. You arrive at the cave and find an inscription    ",
X	"which reads: What is the greatest of Vulcan Philosophies?",
X	"You say : That the needs of the many, outweigh the needs ",
X	"of the few. Or the one. With that the cave-door slides   ",
X	"open. You enter and find a crystal-harmonizer, a machine ",
X	"that allows you to carry 200 extra energy units on your  ",
X	"ship.You also get 150 pts as Sulu has killed the klingons",
X	"Effect : maxenergy + 200 and score + 150.                ",
X	11,620,620,
X	"Spock : We are now orbiting the planet Taurus II,class M.",
X	"           /   \\___   _______________         ___________",
X	"        __/        \\ /  /ncc 1701.7|         /           ",
X	"       /           /___/uss galileo \\_______/            ",
X	"______/           <__________________\\                   ",
X	"                     |\\         |\\                       ",
X	"                  (###################[                  ",
X	"You find a crippled shuttle from the Enterprise. It looks",
X	"like some cannibals or a really primitive tribe have     ",
X	"painted the shuttle in sign of worship. You enter the    ",
X	"shuttle and manage to find a proton reactor that has been",
X	"put there by someone. This could increase the power of   ",
X	"your photon Torpedos by 300 energy units!! (Which means  ",
X	"it will only take 2 shots to blast a normal player out   ",
X	"of the sky.)You examine the machine hatch in the shuttle ",
X        "and manage to reactivate its life support systems.       ",
X	"You repair the crystal energisers by using the power from",
X	"your phaser pack, and achieve lift off.Your ship however ",
X	"begins to desintigrate and Mr. Scott just manages to beam",
X	"you back with the reactor before the shuttle is lost.    ",
X	12,300,398,
X	"Spock : We are now orbiting the planet Janus VI, class M.",
X	"You find a nonworking mining colony.The miners are scared",
X	"by stonelike creatures that live in the mines. After     ",
X	"injuring one of the creatures, Spock decides to mindmeld ",
X	"with it. He finds out that the creature is called a Horta",
X	"and that the miners have been destroying its silicon eggs",
X	"So McCoy attempts to heal the creature. Kirk- Will it be ",
X	"alright bones? McCoy- For god sake jim, Im a doctor not a",
X	"bricklayer...     Anyways, the miners agree not to touch ",
X	"the eggs and the creature agrees not to scare the miners.",
X	"Finally, out of gratitude the Horta King gives you a     ",
X	"Phaser-selenium-hydro-booster which can increase the     ",
X	"power of phaser shots by 80 units per shot.              ",
X	"                                                         ",
X	"      ________________                          _________",
X	"     /                \\                        /         ",
X	"-----                  \\______-------_________/          ",
X	"           O         O                                   ",
X	"          -+-\\      -+-                                  ",
X	"          / \\/-\\    / \\     ooO  Oo0()oo                 ",
X	13,400,150,
X	"Spock : We are now above the legendary planet Margarethea",
X	"Once here, you quickly find an entrance to a cave, where ",
X	"a nice old man called Slartibartfast shows you the inside",
X	"of Margarethea, the planet which is hollow inside and    ",
X	"produces (and exports) only one luxury commodity:planets.",
X	"He explains strange things about how the mice ordered the",
X	"earth, in the attempt to find the question to the answer ",
X	"42. (First they thought that question might be life the  ",
X	"universe and everything, but, it was not to be.) He also ",
X	"explains how the earth was demolished 5 minutes before   ",
X	"its program was completed by a Vogon constructor fleet   ",
X	"that made way for the new hyperspace bypass to Alpha     ",
X	"Centauri, and then he carried on mumbling about his young",
X	"years on Eroticon VI, and it all got rather boring.      ",
X	"He does however tell you one big hint: He says that the  ",
X	"Encyclopedia Galactica defines STAR TREK as the last good",
X	"invention before the revolution came, so, he says, you   ",
X	"can switch off ion storms by flying warp -1 on the x-axis",
X	"with your ship. He then mumbles on about hoopy frood pan-",
X	"galactic gargle blasters and stuff. You beam back up.    ",
X	14,110,229,
X	"  Spock : We are now orbiting the Forest moon of Endor.  ",
X	"You arrive in a dense tropical forest and are soon       ",
X	"surrounded by teddy bears. They take you to their camp   ",
X	"and introduce you to their God, a golden interpreter     ",
X	"robot of the kind you haven't seen since the clone wars. ",
X	"The robot commands the teddies to leave you alone and he ",
X	"tells you about a secret imperial fortress on the other  ",
X	"side of Endor. You and Spock manage to beam there and    ",
X	"steal a hydro-spanner, which you can use to make your    ",
X	"ship go faster than light. From now on your ship flies   ",
X	"1 warp faster than before.                               ",
X	"While you were at the fortress you could hear two guards ",
X	"talking about the early completion of the death star     ",
X	"and you begin to wonder what this is all about.          ",
X	"Maybe it will help my analysis to examine the second     ",
X	"planet in this system, 10, quadrants east of this one.   ",
X	"Very well Mr. Spock, lets do just that.                  ",
X	"                                                         ",
X	"                                                         ",
X	"                                                         ",
X	15,120,228,
X	"Spock:Fascinating. Its not a planet. Its a Space Station!",
X	"You beam down to the station and plug into the main      ",
X	"data banks. Spock finds out that this Weapon Star is not ",
X	"yet completed and is protected by an energy field        ",
X	"projected from endor, the forest moon with all the teddy ",
X	"bears. He suggests to land a strike team on endor,       ",
X	"disable the shield and damage the station. You ask how he",
X	"got the idea for this brilliant plan and Spock says :    ",
X	"I believe I saw it in a film once. Kirk - You didn't!    ",
X	"Spock- the hell I did! You order Mr. Sulu to command the ",
X	"team, and he sucessfully beams to endor kills the shield ",
X	"and returns to the ship. Spock and you then shoot a nasty",
X	"looking little old man with your phaser, and proclaim    ",
X	"the emperor  is dead. Then a tall dark man with a black  ",
X	"mask on (wheezing heavily) trods along and complains that",
X	"this is not what the script says. Before anybody then    ",
X	"realises whats going on, you leave to beam back..stealing",
X	"a phaser-range-motivator. This makes phasers go two      ",
X	"Quadrants further than before.                           ",
X	"Effect : phaser range increased by two.                  ",
X	16,480,420,
X	"Space lab Regula 1 is orbiting around this dead moon too.",
X	"You arrive at the spacelab Regula, which seems to be     ",
X	"deserted. You therefore decide to use the Space lab      ",
X	"transporters to go deep inside the dead moon, where the  ",
X	"Genesis experiment has been carried out by Dr. C.  Marcus",
X	"There you find your whole family again, as well as a     ",
X	"ginourmous mega cave which grows all types of life forms ",
X	"on an accelerated basis. Saavik asks you how you managed ",
X	"to pass the Kobayashi Maru Scenario and you tell her that",
X	"you had lots of simulator practice on a micro-vax.       ",
X	"After searching the place you finally find a klingon     ",
X	"hiding behind a tree, and you decide to kill him.        ",
X	"All is well, and you get 200 points for that.            ",
X	"%%%%%%%%%%%%                 (-          .               ",
X	"%%%%%%%%%%%%%     .         _|                           ",
X	"%%%%%%%%%%%%%%        ____ /r1\\ ____                .    ",
X	"%%%%%%%%%%%%%%        \\____\\  /_____\\                    ",
X	"%%%%%%%%%%%%%%           .  ||             :             ",
X	"%%%%%%%%%%%%%               --                           ",
X	"%%%%%%%%%%%%                                             ",
X	17,300,225,
X	"Spock : We are now orbiting the remote ice-world of Hoth.",
X	"You arrive and ar in for a bad shock. Its freeeezing here",
X	"and you decide to find shelter in a local cave. There you",
X	"are greeted by a Snow creature, and Spock, you & Sulu    ",
X	"just manage to escape before the monster eats you. You   ",
X	"wander around for many hours until you fall over, half   ",
X	"frozen.Then you suddenly see an apparition of an old man.",
X	"He Says : Jim, you must go to the Dagobah System. There  ",
X	"you will learn from Yoda. With that you faint. Spock how-",
X	"ever,due to his green blood having a lower freezing point",
X	"survives, and finds an old deserted Rebel base. He takes ",
X	"a speeder and manages to fetch you and Sulu before it    ",
X	"gets even too cold for the ship. Inside the complex your ",
X	"communicators begin to work again, and you find a phase  ",
X	"plasma rifle in the 40-50 watt range. If you hook this in",
X	"to the main phaser banks, the power of each phaser blast ",
X	"could be increased by 100 units. You also find an        ",
X	"inscription in the wall:'If thou wishes to become a jedi,",
X	"to Dagobah thou must go, beyond the Mutara Nebula, in the",
X	"Federation Space at 150,500 you too will find thy destiny",
X	18,432,112,
X	"     Spock : We are now orbiting the planet Sirius.      ",
X	"You have beamed into the office building of the Sirius   ",
X	"Cybernetics Corporation, whoose marketing division       ",
X	"strikes you to be a bunch of mindless jerks who'll be the",
X	"first against the wall when the revolution comes again.  ",
X	"Everywhere  people run around with little fishes in their",
X	"ears, and you ask one of them what those are all about.  ",
X	"This, he says, is a Babel Fish, the only useful thing the",
X	"Vogons left us after the revolution, and he says that if ",
X	"you wish to investigate the phenomenon more closely you  ",
X	"should go to Beetlegeuse 5 at 200,290. That is the home  ",
X	"planet of the Babel fish. As for now, I haveto prepare   ",
X	"for the revolution, so leave me alone. Spock-Fascinating,",
X	"that a fish in his ear makes him prepare the very event  ",
X	"that will be his undoing. Sounds just as silly as McCoy  ",
X	"getting one of his emotional attacks.                    ",
X	"With this information,you decide to fly to Beetlegeuse 5.",
X	"                                                         ",
X	"                                                         ",
X	"                                                         ",
X	19,200,290,
X	"Spock : We are now above the little planet Beetlegeuse 5.",
X	"You find yourself inside a dome where a dull voice drones",
X	"'The Babel fish, is small, yellow and leech-like, and    ",
X	"probably the oddest thing in the Universe. It feeds on   ",
X	"brainwave energy and absorbs all unconsious mental freq- ",
X	"uencies from people around it to nourish itself. The     ",
X	"practical upshot of all this is that if you stick one in ",
X	"your ear, you can instantly understand anything said to  ",
X	"you in any form of language.Now, it is such an improbable",
X	"coincidence that anything so minbogglingly useful could  ",
X	"have evolved purely by chance,that some scientists regard",
X	"its existence,as the final proof for the non-existence of",
X	"god. The argument goes something like this : God-I refuse",
X	"to prove that I exist, for proof denies faith,and without",
X	"faith I am nothing.Man-But, the babel fish is a dead give",
X	"away isn't it? It proves that you exist and so therefore,",
X	"by your own arguments, you don't. Q.E.D. Oh, says god, I ",
X	"hadn't thought of that, and vanishes in a puff of logic. ",
X	"Man goes on to prove that black is white and gets killed ",
X	"on the next zebra crossing. You have 50 extra points.    ",
X	20,700,550,
X	"    Spock : We are now orbiting the planet Dantooine.    ",
X	"You see a long vast desert and two suns : Tatoo I & II.  ",
X	"After marching a few hours, you find and old Jawa trans- ",
X	"porter, which looks like a huge metal block running on   ",
X	"chains. It seems to have been ambushed a long long time  ",
X	"ago. You enter its cargo hold and find a sort of junk    ",
X	"yard. In it you find a cargo hold for neutronic weapons  ",
X	"which can easily be modified to hold photon torpedos     ",
X	"and make a new phaserbank. So you can now hold 7 more    ",
X	"photon torpedos and 3 more phaser shots.                 ",
X	"       %%%%%%%%%%%                      %%%%%%           ",
X	"         %%%%%%%                      %%%%%%%%%%         ",
X	"______________________________________%%%%%%%%%%_________",
X	"                      ___________(-                      ",
X	"                     /___/_____ /|                       ",
X	"                     \\-:-|-----| |                       ",
X	"----------------------\\__|_____|/)_____                  ",
X	"                   ___(O=o=o=o=O)_____ \\                 ",
X	"////////////////__/                  \\ \\_________________",
X	"_________----___/                      \\__________-______",
X	21,600,150,
X	"Uhura : I'm receiving a warning beacon, not to beam down.",
X	"So you and the landing party beamed down anyways. Can't  ",
X	"you listen? Well, you find an old, HUGE demolished space ",
X	"craft, that has lots & lots of egg like thingies in its  ",
X	"cargo hold.You find the remains of a dead pilot who seems",
X	"to have died by something from inside him exploding out- ",
X	"wards.You take a closer look at one egg, when it opens at",
X	"the top. You look in and a gory little creature Schlings ",
X	"itself around you. Soon after it comes off your face, and",
X	"you feel fine again, until at dinner time, when your     ",
X	"tummy seems to explode and a little creature comes out.  ",
X	"I'm afraid youv'e blown it. You have lost your entire    ",
X	"score.###################################################",
X	"###################cargo hold############################",
X	" \\______________________________________________________ ",
X	"                                                         ",
X	"           O   O   O   O   O   O   O   O   O             ",
X	"\\           o}                                           ",
X	" \\        -+-U   O   O   O   O   O   O   O   O           ",
X	"  \\_______/_\\____________________________________________",
X	22,800,300,
X	"        Spock : This is Gamma Hydra, Section 14.         ",
X	"You find an old ruin of a house inhabited by Capt. Tyrell",
X	"the Captain of the Kobayashi Maru. He tells you how the  ",
X	"Klingons mined the entire section of Altair six with     ",
X	"Mevisic Mines. When the Kobayashi Maru hit one, it sent a",
X	"distress signal which other ships responded to. When they",
X	"arrived in the neutral zone, all of them were blown out  ",
X	"of the sky. He says that therefore noone ever found him. ",
X	"You now know, how the Kobayashi Maru Scenario ever came  ",
X	"into existence, but you also know that your ship must be ",
X	"in danger. You beam back up to find a klingon battle     ",
X	"ship right in front of your ship.You fire, and damage the",
X	"cruiser fatally. This allows you an extra 50 points.     ",
X	"           _________-o-__________    .                   ",
X	" .       /_________/=O=/_________\\          *            ",
X	"        /===========//===========/\\                      ",
X	"       //|         //           \\\\/|   .        .        ",
X	"      |O/      __ //_            O/                      ",
X	"              /.:::./|                                   ",
X	"               :...:/                        .           ",
X	23,560,400,
X	"Spock:We are orbiting a gas cloud of unknown constituency",
X	"You have beamed into the heart of the cloud, which semms ",
X	"to be run by robot probes.They claim to seek the creator.",
X	"You then find out that the head of the organisation,     ",
X	"V'ger is seeking his creator. You discover that V'ger is ",
X	"the lost space probe Voyager 9, which is damaged and in  ",
X	"search of its own identity.You tell the probe you are the",
X	"creator and mend it. This makes it very happy, and in    ",
X	"front of you a torpedo accelerator which will allow your ",
X	"photon torpedos to travel 1 Quadrant further than usual  ",
X	"materialises.                                            ",
X	"  _________________(- _____________________________      ",
X	"/                __|_                              \\     ",
X	"         _______/ :: \\_______                        \\   ",
X	"         |______|vger|______|                            ",
X	"                \\----/        o   o                      ",
X	"                /    \\       -+- -+-                     ",
X	"               /      \\      / \\ / \\                     ",
X	"---------------------------------------------------------",
X	"                                                         ",
X	24,770,176,
X	"  Spock : We are now orbiting the planet Eden, class M.  ",
X	"You beam down to find a heavens paradise. This is a land ",
X	"where milk and honey flow, fruit grows in abundance, and ",
X	"the sun always shines. The inhabitants seem exeptionally ",
X	"friendly having strange ways of expressing themselves    ",
X	"though. One jumps out at you and says to his neighbor    ",
X	"'Hey look man, new arrivals. Man, I really reach that.'  ",
X	"Possibly a resettlement of ancient Californian           ",
X	"Politicians Spock deduces. One of the inhabitants however",
X	"sees Spock and realises that a long time ago they played ",
X	"in a band together, aboard the Enterprise. He says, Hey  ",
X	"brother, do you remember me? (Spock nodds) Eh, I really  ",
X	"reach that. Come, he says, Ill show you the planets      ",
X	"best kept secret. He takes you to a cave where you find  ",
X	"the largest dilithium crystal storage unit you have ever ",
X	"seen. The friendly alien gives you a few stones and says ",
X	"'Here, to remember our friendship.' With the stones your ",
X	"ship will travel 1 Warp faster in any direction.         ",
X	"                                                         ",
X	"                                                         ",
X        25,600,301,
X	"Spock : We are now orbiting the planet Scalos III Class M",
X	"This is the beginning of your first mission. You find an ",
X	"ancient galactic map which describes the legend of the   ",
X	"lost GENESIS device. Once battled over, this device was  ",
X	"captured by a villain named Khan.Khan died in the year'65",
X	"on board the Reliant in the Mutara Nebula, and it was    ",
X	"assumed that the Genesis torpedo, a device to turn a dead",
X	"planet into a planet supporting life,was destroyed in the",
X	"explosion that created the GENESIS planet in the Nebula. ",
X	"However, the map you find tells about how Khans crew     ",
X	"built a copy of the original torpedo and hid it in an    ",
X	"unknown destination.You contact starfleet command and are",
X	"ordered to investigate the phenomenon.The map speaks of a",
X	"hiding place that contains several technological devices ",
X	"which could improve your ship in ways you never dreamed  ",
X	"possible.The map also points to a planet in the troy star",
X	"group which seems to be in the NE sector of the klingon  ",
X	"empire. It also displays a picture of the device so you  ",
X	"can recognize it.After you read it,the map selfdestructs.",
X	"                                                         ",
X	26,770,770,
X	"  We are now orbiting the 3rd planet of the troy system. ",
X	"It seems the klingons have been here already, and you    ",
X	"find the wreckage of a Romulan shuttle. You enter it     ",
X	"and find a dying romulan commander. He says the klingons ",
X	"thought he knew the whereabouts of the genesis device,   ",
X	"killed his crew and crippled his ship. With his last     ",
X	"breath he types a code on the console and says 'I shall  ",
X	"now reveal to you what was not revealed to the klingon   ",
X	"commander.....' With this, a data chart appears on the   ",
X	"viewscreen saying the device is hidden in a cave in the  ",
X	"depths of a planet in the Neutral zone, 100 Quadrants    ",
X	"west of Gamma Hydra.                                     ",
X	"The key to the cave lies somewhere within the klingon    ",
X	"empire, south of the starbase Kharse.                    ",
X	"He has also activated the ships self- destruct           ",
X	"sequence. You run out of the ship and it blows           ",
X	"up in a neutronic implosion.                             ",
X	"                                                         ",
X	"                                                         ",
X	"                                                         ",
X	27,675,410,
X	"Spock : We are now orbiting the klingon planet Kharse II.",
X	" You find a vast computer complex and enter. You are     ",
X	"surrounded by machines, lights and basically feel pretty ",
X	"small, compared to this vast amount of equipment. You    ",
X	"find a chair, in the middle of the room and sit down. The",
X	"computer says in a droning voice : 'What is thy bidding  ",
X	"my master?' You say 'Tell me the secret of entry to the  ",
X	"genesis cave, 100 quadrants west of gamma hydra.'Ah! says",
X	"the machine, to get that sort of info you must answer a  ",
X	"test question first. Over 2320 years ago, a princess was ",
X	"captured in a Space station. What was the number of her  ",
X	"prisoner cell? Spock- if memory serves, it was detention ",
X	"block AA-23, level 5. Correct, the computer says, and a  ",
X	"dilithium crystal key materialises in front of you. You  ",
X	"want to leave and the computer says- Hey. Just a minute. ",
X	"How did you know that? Spock replies 'I saw it in a film ",
X	"once.'                                                   ",
X	"                                                         ",
X	"                                                         ",
X	"                                                         ",
X        28,700,300,
X	"     Spock : We are now orbiting the planet Talus 4.     ",
X	"You find a sign post which reads :                       ",
X	"           ---------------------------                   ",
X	"           | That way to the cave -> |                   ",
X	"           ---------------------------                   ",
X	"                       |                                 ",
X	"                       |                                 ",
X	"                       |                                 ",
X	"                       |                                 ",
X	" and follow it. You find the cave entrance and place the ",
X	"dilithium key into the keyhole. The door slides open and ",
X	"you find a vast arrangement of technological gizzmos that",
X	"you have never seen before.What all these will do to your",
X	"ship you can find out when you beam back. You also find  ",
X	"the lost genesis torpedo standing in a corner against the",
X	"wall. You radio starfleet command and they say that when ",
X	"you get back you can be promoted to Admiral if you wish. ",
X	"All is well, and your score has doubled.                 ",
X	"                                                         ",
X	"                                                         ",
X	29,480,300,
X	" Spock : We are now orbiting the planet Biro 7. Class M. ",
X	"What you see is quite incredible, in fact you can't      ",
X	"believe your eyes. Have you got any explanations for this",
X	"Spock ? Spock-it seems I recall a theory by Veet Voojagig",
X	"who studied at the University of Maxmegalon and claimed  ",
X	"that somewhere in the cosmos there was a planet entirely,",
X	"devoted to biro lifeforms. And it was to this planet that",
X	"unattended biros would make their way, slipping away     ",
X	"quietly through wormholes in space to a world where they ",
X	"knew they could enjoy a uniquely biro-lifestyle. It      ",
X	"explained the massive loss per day of biros, (writing    ",
X	"devices),sometime during the 20th century.We seem to have",
X	"found the very planet. Before Mr. Voojagig was locked up,",
X	"he suggested to cross biros with coathangers so they     ",
X	"actually begin to multiply rather than dissappear, but   ",
X	"he was never allowed to complete his trials. I'm not     ",
X	"surprised at all, says kirk. And so, with a ton of new   ",
X	"biro pens in your pocket, you beamed back up.            ",
X	"                                                         ",
X	"                                                         "
X	}; /*Phew!*/
END_OF_FILE
if test 38410 -ne `wc -c <'planets.c'`; then
    echo shar: \"'planets.c'\" unpacked with wrong size!
fi
# end of 'planets.c'
fi
if test -f 'torpedo.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'torpedo.c'\"
else
echo shar: Extracting \"'torpedo.c'\" \(8743 characters\)
sed "s/^X//" >'torpedo.c' <<'END_OF_FILE'
X
X/*******************************************************************************
X********************************************************************************
X********************************************************************************
X
XPERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
XTHIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
X
X		P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
X
X
X********************************************************************************
X********************************************************************************
X*******************************************************************************/
X#include "header.h"
X
Xmove_torpedos()
X{
Xint x,y;
Xint hit;
Xstruct torpedo *t,*a;
Xstruct player *p,*h;
Xchar bcstring[57];
X
Xt=tstartlist;
Xwhile (t!=NULL) 
X	{
X	if (t->life==0)
X		{
X		a=t;
X		remove_torpedo_from_list(a);
X		t=t->next;
X		continue;
X		}
Xhit=OFF;
Xt->oldxpos=t->xpos;
Xt->oldypos=t->ypos;
Xt->xpos+=t->xvel;
Xt->ypos+=t->yvel;
Xx=t->xpos;
Xy=t->ypos;
X
Xif ((x<58)||(x>899)||(y<19)||(y>899))
X	{
X	if (x<58) t->xvel=1;
X	if (x>899) t->xvel= -1;
X	if (y<19) t->yvel=1;
X	if (y>899) t->yvel= -1;
X	}
X
Xp=startlist;
X	while ((hit==OFF)&&(p!=NULL))
X	{
X	if ((p->xpos==x)&&(p->ypos==y)) {hit=ON; h=p;}
X	p=p->next;
X	}
X
Xif (hit) 
X	{
X	t->life=0;
X	t->xpos-=t->xvel;
X	t->ypos-=t->yvel;
X	if (t->whofrom != NULL)
X		{
X
X		if (h->stat<12)
X			{
X			plot1(t->whofrom,"        Direct hit on enemy Captain! Well Done!          ");
X			plot2(t->whofrom,"                                                         ");
X			}
X		t->whofrom->score += 10;
X		plotscore(t->whofrom);
X	if (h->id==ROMID || h->id==KLINGID)
X		{
X		i=rand()%100;
X		if (i<25) 
X			{
X			/*take off away from the guy*/
X			h->yvel=h->xvel;
X			h->xvel=1;
X			} else
X			{
X			i=rand()%100;
X			if (i>50)
X				{
X				/*stay and fight*/
X				if (t->whofrom->ypos == h->ypos)
X					{
X					if (t->whofrom->xpos <  h->xpos)
X						fire_torpedo(h,'4',0);
X						else	
X						fire_torpedo(h,'6',0);
X					} else
X					{
X					if (t->whofrom->ypos < h->ypos)
X						{
X						fire_torpedo(h,'1',0);
X						fire_torpedo(h,'2',0);
X						fire_torpedo(h,'3',0);
X						}
X						else	
X						{
X						fire_torpedo(h,'7',0);
X						fire_torpedo(h,'8',0);
X						fire_torpedo(h,'9',0);
X						}
X					}
X				}
X			}
X		}
X	else
X	{
X	switch (h->stat)
X	{
X	case 9 :
X	plot1(h,"   Spock : Sir, stop scanning. We are being attacked!!   ");
X	plot2(h,"                                                         ");
X	break;
X	case 10 :
X	plot1(h,"   Scott to Captain : Sir we are under attack!! better   ");
X	plot2(h,"         beam back up to the ship NOW...                 ");
X	break;
X	case 11 :
X	plot1(h,"   Spock : Sir, Exit Help mode. We are being attacked!!  ");
X	plot2(h,"                                                         ");
X	break;
X	case 12 : break;
X	default :
X	plot1(h,"        Battle Stations...Battle Stations                ");
X	plot2(h,"                                                         ");
X	break;
X	}
X	}
X		if (t->weapon=='+')
X			{
X			if (h->shields)
X				h->energy-=((t->whofrom->photonpower)/2);
X        			else h->energy-=(t->whofrom->photonpower);
X			} else
X			{
X			if (h->shields)
X				h->energy-=((t->whofrom->phaserpower)/2);
X				else h->energy-=(t->whofrom->phaserpower);
X			}
X		h->maxenergy=h->energy+1;
X		plotbattleenergy(h);
X		if (h->stat<7) 
X			plotstatus(h,2);
X		if ((h->energy<1)&&(h->stat<12))
X			{
X			plot1(h,"        You have been blown out of the sky!!!            ");
X			plot2(h,"       Shame the force wasn't with you this time.        ");
X			if (h->reason>0) h->reason= -4;
X			finish(h);
X			t->whofrom->score += 100;
X			plot1(t->whofrom,"        Chekov : Got him!! Bones : He's dead Jim!        ");
X			plot2(t->whofrom,"        Score has been increased by 100 points.          ");
X			plotscore(t->whofrom);
X			} else
X			{
X		if ((h->shields)&&(h->energy<=200)&&(h->energy>0)&&(h->stat<12))
X			{
X			plot1(h,"        Shields Collapsed Captain!!!                     ");
X			plot2(h,"                                                         ");
X			h->shields=OFF;
X			h->id=(char)(h->id+32);
X			plotshields(h);
X			h->chflg=FLAG;
X			}
X			}
X		} else
X		{
X		plot1(h,"   You were hit by a piece of debris from the explosion! ");
X		plot2(h,"         Your energy capability has been lowered.        ");
X		h->energy-=10;
X		h->maxenergy-=10;
X		plotbattleenergy(h);
X		}
X	} else /*hit is off!*/
X	{
X	if ((c=inuniv(x,y))!=NULL)
X		{ 
X		t->life=0;
X		t->xpos-=t->xvel;
X		t->ypos-=t->yvel;
X		if (t->whofrom!=NULL)
X			{
X			j=which_sector(t->xpos,t->ypos,0,0);
X			if (j==2) gethim(t->whofrom,KLINGID);
X			if (j==3) gethim(t->whofrom,ROMID);
X			if (j==4) {
X				  gethim(t->whofrom,ROMID);
X				  gethim(t->whofrom,KLINGID);
X				  }
X			}
X		if (c=='*')
X			{
Xsprintf(bcstring,"       Starbase at quadrant %3d %3d is under attack.     ",x,y);
Xbroadcast(bcstring);
X			}
X		if (c=='O')
X			{
Xsprintf(bcstring,"         Planet at quadrant %3d %3d is under attack.     ",x,y);
Xbroadcast(bcstring);
X			}
X		if (c=='.')
X			{
Xsprintf(bcstring,"           Star at quadrant %3d %3d is under attack.     ",x,y);
Xbroadcast(bcstring);
X			}
X		if (c=='@')
X			{
Xsprintf(bcstring,"Someone is fireing into a Black Hole at quadrant %3d %3d.",x,y);
Xbroadcast(bcstring);
X			}
X		} else --(t->life);
X	}
X	t=t->next;
X	} /*while loop*/
X}
X
Xenter_torpedo(t)
Xstruct torpedo *t;
X{
Xt->next=NULL;
Xif (tstartlist==NULL)
X{
Xtstartlist=t;
Xttaillist=t;
X} else
X{
Xttaillist->next=t;
Xttaillist=t;
X}
X}
X
Xremove_torpedo_from_list(t)
Xstruct torpedo *t;
X{
Xstruct torpedo *a; 
X
Xif (t==tstartlist)
X{
Xa=tstartlist;
Xtstartlist=a->next;
Xif (t==ttaillist) ttaillist=a->next;
X} else
X{
Xa=tstartlist;
Xwhile (a->next!=t) a=a->next;
Xa->next=t->next;
Xif (t==ttaillist) ttaillist=a;
X}
Xfree(t);
X}
X
Xfill_torpedo(cp,c,t)
Xregister struct player *cp;
Xstruct torpedo *t;
Xchar c;
X{
Xif (cp->weaponselect==1) 
X{
Xt->weapon='+';
Xt->xpos=cp->xpos;
Xt->ypos=cp->ypos;
Xswitch(c) {
Xcase '1': 
X t->xvel=cp->xvel-1; t->yvel=cp->yvel-1;
Xbreak;
Xcase '4': 
X t->xvel=cp->xvel-1; t->yvel=cp->yvel;
Xbreak;
Xcase '7': 
X t->xvel=cp->xvel-1; t->yvel=cp->yvel+1;
Xbreak;
Xcase '8': 
X t->xvel=cp->xvel; t->yvel=cp->yvel+1;
Xbreak;
Xcase '9': 
X t->xvel=cp->xvel+1; t->yvel=cp->yvel+1;
Xbreak;
Xcase '6': 
X t->xvel=cp->xvel+1; t->yvel=cp->yvel;
Xbreak;
Xcase '3': 
X t->xvel=cp->xvel+1; t->yvel=cp->yvel-1;
Xbreak;
Xcase '2': 
X t->xvel=cp->xvel; t->yvel=cp->yvel-1;
Xbreak;
Xdefault:t->weapon='X';  
X t->xvel=cp->xvel+1; t->yvel=cp->yvel;
Xbreak;
X}
X} else
X{
Xt->xpos=cp->xpos;
Xt->ypos=cp->ypos;
Xswitch(c) {
Xcase '1':t->weapon='/'; 
X t->xvel=cp->xvel-1; t->yvel=cp->yvel-1;
Xbreak;
Xcase '4':t->weapon='<'; 
X t->xvel=cp->xvel-1; t->yvel=cp->yvel;
Xbreak;
Xcase '7':t->weapon='\\'; 
X t->xvel=cp->xvel-1; t->yvel=cp->yvel+1;
Xbreak;
Xcase '8':t->weapon='^'; 
X t->xvel=cp->xvel; t->yvel=cp->yvel+1;
Xbreak;
Xcase '9':t->weapon='/'; 
X t->xvel=cp->xvel+1; t->yvel=cp->yvel+1;
Xbreak;
Xcase '6':t->weapon='>'; 
X t->xvel=cp->xvel+1; t->yvel=cp->yvel;
Xbreak;
Xcase '3':t->weapon='\\'; 
X t->xvel=cp->xvel+1; t->yvel=cp->yvel-1;
Xbreak;
Xcase '2':t->weapon='v'; 
X t->xvel=cp->xvel; t->yvel=cp->yvel-1;
Xbreak;
Xdefault:t->weapon='X'; 
X t->xvel=cp->xvel+1; t->yvel=cp->yvel;
Xbreak;
X}
X}
X}
X
Xfire_torpedo(cp,c,type)
Xstruct player *cp;
Xchar c;
Xint type;
X{
Xstruct torpedo *t;
Xif (type==0)
X{
Xif (cp->weaponselect==0)
X{
Xif (cp->phaserbanks==0) 
X{
Xplot1(cp,"      Scott to Captain : The Phaser banks are empty!     ");
Xplot2(cp,"                                                         ");
Xreturn(0);
X}
X} else
X{
Xif (cp->photontorpedos==0) 
X{
Xplot1(cp,"  Scott to Captain : We have no more Photon Torpedos!    ");
Xplot2(cp,"                                                         ");
Xreturn(0);
X}
X}
X
Xt=(struct torpedo *)malloc(sizeof(struct torpedo));
Xfill_torpedo(cp,c,t);
Xif ((t->xvel==0)&&(t->yvel==0))
X{
Xplot1(cp,"                                                         ");
Xplot2(cp,"               Weapons must move Captain!!               ");
Xfree(t);
Xreturn(0);
X}
Xif (cp->weaponselect==0)
X{
Xif ((cp->id!=ROMID)&&(cp->id!=KLINGID)) --(cp->phaserbanks);
Xplotphaserbanks(cp);
Xif ((c=='1')||(c=='7')||(c=='9')||(c=='3'))
X  t->life=(cp->phaserreach)/2;
Xelse
X  t->life=cp->phaserreach;
X}
Xelse
X{
Xif ((cp->id!=ROMID)&&(cp->id!=KLINGID))  --(cp->photontorpedos);
Xplotphotontorpedos(cp);
Xif ((c=='1')||(c=='7')||(c=='9')||(c=='3'))
Xt->life=(cp->photonreach)/2;
Xelse
Xt->life=cp->photonreach;
X}
X
Xt->oldxpos=t->xpos;
Xt->oldypos=t->ypos;
Xt->whofrom=cp;
Xif (cp->stat<7) plotstatus(cp,2);
Xplot1(cp,"                 Its away!!!!                            ");
Xplot2(cp,"                                                         ");
X} else
X{
Xt=(struct torpedo *)malloc(sizeof(struct torpedo));
Xcp->xvel=0;
Xcp->yvel=0;
Xfill_torpedo(cp,c,t);
Xt->life=4;
Xt->oldxpos=t->xpos;
Xt->oldypos=t->ypos;
Xt->whofrom=NULL;
X}
Xenter_torpedo(t);
X}
END_OF_FILE
if test 8743 -ne `wc -c <'torpedo.c'`; then
    echo shar: \"'torpedo.c'\" unpacked with wrong size!
fi
# end of 'torpedo.c'
fi
echo shar: End of archive 1 \(of 4\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 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