[comp.sources.games] v10i011: gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Part11/14

billr@saab.CNA.TEK.COM (Bill Randle) (06/02/90)

Submitted-by: VANCLEEF@mps.ohio-state.edu
Posting-number: Volume 10, Issue 11
Archive-name: gb3/Part11
Supersedes: GB2: Volume 7, Issue 44-51



#! /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 11 (of 14)."
# Contents:  Docs/colony.doc Docs/declare.doc Docs/map.doc
#   Docs/newfire.doc Docs/oldgoodies.doc Docs/races.doc
#   client/arrays.h client/keyboard.c server/Makefile.old
#   server/enslave.c server/power.c server/shipdata.h
#   server/telegram.c
# Wrapped by billr@saab on Fri Jun  1 11:53:44 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Docs/colony.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/colony.doc'\"
else
echo shar: Extracting \"'Docs/colony.doc'\" \(3028 characters\)
sed "s/^X//" >'Docs/colony.doc' <<'END_OF_FILE'
Xcolony			Galactic Bloodshed			colony
X
X
XCONCEPT: Colonies and Planetary Maintenance
X
X  To start a colony, you must first build a ship.  Several ships are excellent 
Xfor colony development, but this really depends on your racial characteristics.
XFor example, an explorer can only carry 1 crew member.  If your race has two
Xsexes, you will need two of these ships to start a successful colony.
XShuttles do well for this purpose since they are cheap, but their lack of
Xrange makes them not ideal for interstellar voyages.  Space habitats are very
Xexpensive and require a lot of tech, but they reproduce colonists and
Xresources by themselves, with no outside help.  
X
X   At the beginning of the game it is important to get your race
Xestablished on the several planets in your solar system and get a good
Xresource base, then expand to other solar systems.
X
X   Once your ship is in orbit around the planet you must land it on a sector
Xthere.  Your race has a few sector types that they like; these are listed in
Xyour racial profile.  You should survey a few sectors to see which can
Xactually hold your colony.  Also look for a sector with lots of resources.
X
X   Population of a sector increases (or decreases) toward the sector's
Xmax population value, so take this into account.  A sector that is a
Xwasteland will kill 90% of its population every update.
X
X   Land your ship there, and use load to unload some people.  Congratulations,
Xyou have a new colony.
X
X   Most of the time your colony planets will be less than ideal places to
Xlive.  There are three devices to help you terraform your new planet.  One of
Xthese is the atmosphere processor, which sucks in the atmosphere and converts
Xit to one more suitable to you.  Another device is the space mirror, which
Xcan be built and aimed at a planet to heat it up to a temperature your race
Xprefers.  If your planet is too hot to begin with, a canister of dust
Xlaunched into orbit will absorb sunlight and make it cooler.  This has an
Xadded effect of being able to make a planet inhospitable to another race.
X
X   Efficiency on a sector represents how "built up" the area is.  This number
Xincreases as time goes by, according to how many people are there to do the
Xwork.  Efficiency, in turn, controls how many people the sector can support.
XThe maximum population is the sum of the maximum sector populations of every
Xsector.  As the planet's population increases toward this figure,
Xenvironmental conditions, represented by toxicity, worsen.  Toxicity also
Xaffects the maximum population of the sectors on the planet, sometimes
Xcausing an increased death rate and massive damage to the planet beyond a
Xcertain threshold (85).
X
X   To deal with this you have to build toxic waste canisters.  Each one can
Xhold up to 20 units of waste, but can be built with less.  The canisters, if
Xbreached, add their waste back to the planet.  Even orbiting them will not
Xalleviate this problem; you must send them to another planet (preferably
Xsomeone else's.)
X
XSEE ALSO
X  profile, land, load, build
X
END_OF_FILE
if test 3028 -ne `wc -c <'Docs/colony.doc'`; then
    echo shar: \"'Docs/colony.doc'\" unpacked with wrong size!
fi
# end of 'Docs/colony.doc'
fi
if test -f 'Docs/declare.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/declare.doc'\"
else
echo shar: Extracting \"'Docs/declare.doc'\" \(1705 characters\)
sed "s/^X//" >'Docs/declare.doc' <<'END_OF_FILE'
XDECLARE			Galactic Bloodshed		DECLARE
X
X
XNAME
X  [1] declare -- state relations with other players
X 
XSYNTAX
X      declare <player> <status> 
X
XDESCRIPTION
X
X  The friction between two disparate races competing for the same limited
Xresources may be such that no matter what diplomatic means exist between
Xthem (telegram), conflict may still ensue.  
X
X  To facilitate this, a player may declare his/her race's intentions toward
Xother players in the game, whether allied, neutral, or at war.
X
X  When invoked, a prompt will ask how he wishes his relations to be with that 
Xplayer, and the player number.  This will be in effect until the user changes
Xhis/her mind.
X
X  A player's relation state affects the way a few things happen in the game:
X
X  - If two players share a planet, and they are at war, adjacent sectors will
Xattack each other, extracting casualties on both sides and some damage to the
Xsector.  Attack strength is dependent on the population of a sector, the
Xmobilization, the fighting strength of the race, and the combat readiness of 
Xthe planet.
X  - A ship following another will 'lose sight' of that ship at a certain
Xdistance, if the other ship is not an ally.
X  - Mines look for ships belonging to enemy players.  If it finds one within
X	its trigger radius, it will detonate.
X  - A player is prompted when firing on or boarding (assault) a ship 
X	belonging to an ally.
X  - Allied ships and planets do not return fire.
X  - When bombard is set on a ship, that ship will fire at sectors owned by
X	players the owner is at war with.  If there are no such, it finds
X	players with which the owner is neutral.
X
XYou may declare war, alliance, or neutrality.
X
XSEE ALSO
X  telegram, order, fire, assault
X
END_OF_FILE
if test 1705 -ne `wc -c <'Docs/declare.doc'`; then
    echo shar: \"'Docs/declare.doc'\" unpacked with wrong size!
fi
# end of 'Docs/declare.doc'
fi
if test -f 'Docs/map.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/map.doc'\"
else
echo shar: Extracting \"'Docs/map.doc'\" \(5313 characters\)
sed "s/^X//" >'Docs/map.doc' <<'END_OF_FILE'
XMAP			Galactic Bloodshed			MAP
X
X
XNAME
X  [0] map -- Cartesian coordinate map of planet's surface
X
XSYNOPSIS
X  map <path>
X
XDESCRIPTION
X  The map command gives a sector map of the planet in [path].  If [path]
Xis not a planet, map will instead run orbit (see orbit) with lastx,lasty 
Xboth equal to 0.0 .  A player cannot map a planet that has not yet been 
Xexplored.
X
X
X  These are the different types of terrain:
X
X   '*' -- Unexplored wilderness or undeveloped land
X   '^' -- Mountainous area (more resources, less fertility)
X   '.' -- Area containing water
X   '#' -- Area covered with ice
X   '~' -- Gas (such as might be found on a gas giant planet)
X   '%' -- Wasteland (uninhabitable)
X   ' ' -- (Under certain circumstances the sector may be blank)
X   'o' -- A steel (or whatever) plated sector, much like the planet
X	    Trantor (from Asimov's _Foundation_)
X
X
X  In addition are the designations that map gives the player:
X
X	  Areas owned by your race use 'reverse background' so you
X	  can see the terrain occupied as well.
X
X   '?' -- Area owned by another player where ? is the one's digit
X	  of the players number.
X   'pscbdfgetSDM%#+mACV^ EYBG[' -- a ship of that type is landed on the sector
X   'o' -- Area that has been developed to 100% efficiency (steel plated)
X
X
X
X--------------- THE PLANETS -----------------
X
X  There are four basic types of planets.
X
XEarth-type
X
X   00000000001111111111222222222233333333
X   01234567890123456789012345678901234567
X 1 ######################################
X 2 ############..*...#***##....#####*#.##
X 3 ..#*^*#*.....*.*^^^****#*******#**.*..
X 4 ..*^**.*.......*****.*************.*..
X 5 ..*..*.......**....*..**^^^^******.*..
X 6 ......**......*********..***.***^**.*.
X 7 .....^***.....******^**...*....**^^...
X 8 .....^**........***^*........*...*..*.
X 9 ......^*.........**^*..........**^*...
X10 #..#####...####...##....####...##.*##.
X11 ######################################
X        Sample Earth- type planet
X
X  Continents are generated randomly by the game, and approximate real growth
Xof islands by geologic processes.  On the average, sectors closer to water
Xhave greater fertility than sectors farther away, which have greater 
Xresource deposits.  On the north and south poles of the planet lies ice,
Xprime real estate for certain races.
X
X
XGas Giant Type
X
X  This type of planet is mostly a large ball of gas.
XThey do not have many resources but they are useful; for instance any ship
Xorbiting a gas giant can gain fuel by 'skimming' it's surface of hydrogen
X(provided its race has developed hydrogen fusion for fuel.)  
X
X   000000000011111111112222222222333333333344444444444
X   012345678901234567890123456789012345678901234567890
X 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.~~~~~
X 2 ~~~~~~~~~~.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X 3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~........~~~~~~~~~~~~
X 4 ...................................................
X 5 ~~~~~~~~~~~~~~~~~~~~~~~~~.................~~~~~~~~~
X 6 ~~~~~~.~~~~~~~~~~.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X 7 ~~~~~~~~~~.~~~~~~~~~~~~~~~~~~~.~~~~~~~~~~~.~~~~~~~~
X 8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X 9 ~~~~~~~~~~~~~~~~~~...............~~~~~~~~~~~~~~~~~~
X10 ...................................................
X11 ~~~~~~~~~~~~~~~~~~~~~~~~~~...............~~~~~~~~~~
X12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.~~~~~~~~~~~~~~.~~~~~
X               Sample gasgiant planet
X
X  Notice the narrow bands streaked across the surface; this represents
Xbands of weather across the face of the planet.
X
X
XAirless or Asteroidal Type
X
X  These are planets too small to hold an atmosphere, or have had it
Xstripped off by natural or artificial disaster.  They consist of land
Xand/or mountainous sectors, with high resource deposits and comparatively
Xlow fertility.  Both types contain large craters in them from
Xmeteorite impacts, while asteroidal bodies often appear in unusual shapes
X(i.e. not exactly square).  If the temperature is sufficiently low, ice
Xmay cover the surface.  This is an 'iceball' type planet.
X
X   00000000001111111111222                       000000
X   01234567890123456789012                       012345
X 1 ^^^^^*^^^^^^^*^^^^^^^^^                     1 *^^^*^
X 2 ^^^*^^^^^^^^***^^*^^^^^                     2 ^^^*^^
X 3 *^^^^*****^^^*^^^^^^^**                     3 ^^^^*^
X 4 **^^***^***^^^*^^^*^**^                     4 *^^*^^
X 5 *^^*^******^^^^^^^^^^**                     5 *^^^^^
X 6 *^^^^^****^^*^^^^^*^^^*                     6 ^*^*^*
X 7 ^^*^^^^^^^^^^^^^^^^^^^^
X    Sample Airless type                  Sample Asteroid type
X
X   
X
X   Sectors occupied by your own race are set in 'highlighted' background.
XIf your terminal type does not work with the reverse background, use
X'toggle inverse' to toggle it off. 
X
XYou can use the 'aliens' option to toggle the way alien sectors are
Xdisplayed. The default option is that aliens have their full number
Xprinted out. For example player 9 will have a '9' in each sector
Xoccupied. However player 10 will have the alternate digits '1' and
X'0' displayed. The player may change it so only the one's digit
Xof the number is displayed. Then player 10 will have a '0' in each
Xsector occupied.
X
XUse the 'geography' option to toggle whether or not aliens are displayed
Xat all. The default value is that they are displayed (see above).
X
XSEE ALSO
X  orbit, cs, scope
X
END_OF_FILE
if test 5313 -ne `wc -c <'Docs/map.doc'`; then
    echo shar: \"'Docs/map.doc'\" unpacked with wrong size!
fi
# end of 'Docs/map.doc'
fi
if test -f 'Docs/newfire.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/newfire.doc'\"
else
echo shar: Extracting \"'Docs/newfire.doc'\" \(3023 characters\)
sed "s/^X//" >'Docs/newfire.doc' <<'END_OF_FILE'
XI have implemented a new firing routine. The attitude I took
Xin implementing these changes was minimalistic, i.e. I 
Ximplemented the easiest and most transparent coding for
Xthe changes I wanted to make. What is being run now is a 
Xdebugging version. The damage calculation is completely
Xdeterministic. This is to allow players to judge better
Xwhether they are happy with this implementation, comments are most
Xwelcome !!!
XHere is how it now works.
X
XSHIP - SHIP combat:
X
X      The damage done from one ship to another is calculated in 
X      two steps:
X
X	  effstr = (firing strength) * FAC / (1 + dist/RANGE)
X
X      where   FAC = 2, RANGE = 300This means the strength will
X      fall by a factor of 2 from 0 to 300 distance units.
X
X	 damage = Norm / BODY * (effstr - 2*armor)
X
X      where NORM = 20 and BODY depends on the defending ship. 
X      Here are some BODY values: 
X
X	 f              10
X	 C,d,I,c,t      30
X         B,S            45
X	 O,D,$,H        50
X	 G,A,s,e, ...    5
X
X      For a first shot from some of the combat ships (0 distance,
X      0 damage) this computes to the following damage 
X      percentages:
X
X		    at ship
X              f    d    C    B    O    D
X         f   78   24   22   13   12   11 
X         d   38   10    9    4    4    3 
X	 C   78   24   22   13   12   11 
X	 B  118   37   36   22   20   19 
X	 O  198   64   62   40   36   35 
X	 D  238   77   76   48   44   43 
X
X
X       Retailation as before.
X
XSHIP-PLANET: You are only allowed to fire at a planet when
X       in orbit (distance < 40).
X
XPLANET-PLANET: A common trick used to attack planets was to 
X       waste one sector and then let the planetary defenses
X       work against your own planet by landing and firing from 
X       the planet. The fix to that: The planet may no longer
X       fire on ittself, it may still fire on other planets
X       if you choose to, though.  If you wish to attack a 
X       planet, build ships !!!
X
XPLANET-SHIP: The planet guns will be increased to 40. They had
X       been reduced because of the problem mentioned above. 
X       Note, that planetary defenses are now useful !!!!
X       You can beef up you planet to the point where is will
X       vaporize any ship that attacks it.
X
XSHIP-PLANET: This is now the only way to attack a planet. 
X       Damage is caculated as before, but you may no longer 
X       attack when not in orbit. This was done, so that the
X       attacker may no longer pop into the planetary system and 
X       attack instanteanuously. 
X
XPLANETARY RETALIATION: I am working on something that would 
X       allow the planet to retailiate inelligently. It will
X       determine the attacking ship and fire with a strenght
X       which will do 75% damage on the attacking ship at zero
X       range. This is tricky though, so watch for strnage side-
X       effects.
X
XA note on randomness: Once this is tested, I will implement a 
X       10% variation on all these percentiles.
X
X       Again, comments are welcome, I hope this improves the situation.
X       Godd luck, Wolfgang
END_OF_FILE
if test 3023 -ne `wc -c <'Docs/newfire.doc'`; then
    echo shar: \"'Docs/newfire.doc'\" unpacked with wrong size!
fi
# end of 'Docs/newfire.doc'
fi
if test -f 'Docs/oldgoodies.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/oldgoodies.doc'\"
else
echo shar: Extracting \"'Docs/oldgoodies.doc'\" \(3841 characters\)
sed "s/^X//" >'Docs/oldgoodies.doc' <<'END_OF_FILE'
XReceived: by solana.mps.ohio-state.edu (4.1/1.890401)
X	id AA11924; Thu, 16 Nov 89 06:07:59 EST
XDate: Thu, 16 Nov 89 06:07:59 EST
XFrom: Garret Vancleef <vancleef@pacific.mps.ohio-state.edu>
XMessage-Id: <8911161107.AA11924@solana.mps.ohio-state.edu>
XTo: PZM@mps.ohio-state.edu
XSubject: Re:  Paul and his stupid ideas on GB
XCc: bloch@pacific.mps.ohio-state.edu, menelaos@mps.ohio-state.edu,
X        smq@ucscb.ucsc.edu, vancleef@pacific.mps.ohio-state.edu,
X        wenzel@pacific.mps.ohio-state.edu
XStatus: RO
X
Xwell, HOW we define the capabilities of a ship WILL determine how they
Xare used in combat. i personally feel that fighters should rule a system.
Xit must take a well prepared attack to conquer. if a B or and S or what
Xare 'too vulnerable' to a massive fighter attack, then so be it.
Xbring in your own fighters and attack the other fighters. we have not
Xhad this happen, because everyone favours a top heavy fleet
X(all brute strength, no supports). if this is the way things are to be
Xthen we end up with alot of wasted code and anything else becomes
Xirrelevent (10 B's in favour of 50 f's).
X
XR. Chansky agrees with me. we want people to be creative, not just building
XB's and S's to win a battle. (his original idea of a space station was
Xa vulnerable military installation, not a megolithic attack weapon).
X
Xi suggest you talk to him personally via mail
Xsmq@ucscb.ucsc.edu
X
Xeven though he is kind of busy, he is very interested in everyone's
Xideas.
X
Xbtw, if you like the idea of big ships, don't fuck with VN's too
Xmuch (surprise weapon, the BERSERKERS! are being programmed by him
X- these VN's begin to build D's if you attack them after awhile,
Xthere is a way to stop them though - a secret for now).
X
X
Xwhat i am trying to do is not write code which dictates how to
Xwin a battle or a system or what not, i want players to be able to
Xtry out many different avenues of attack, many which may be completely
Xdifferent than the other. each player has the abiltiy to decide how he wants to
Xarm his fleet.
X
Xi believe that speed, vulnerability, and what not must come into play.
Xhowever, talking about the 'accuracy' of a weapon traveling half the
Xdistance of the solar system has to be seriously taken into consideration.
Xeach target can be. fine. does this assume that the targeted ship doesn't
Xhave tricks of their own (decoys, EW warfare, or what not). the
Xadvantage must NOT be in favor of the attacker. i am convinced that
Xthe range dependencies of the effectiveness of an attack are worthy.
Xotherwise, we don't have a game of guts but a game of numbers.
X
Xeach ship combat ship should have their advantages as well as disadvantages.
Xand the game shouldn't go
X
Xd -> C -> B -> D.
X
Xthe availability of them should, but the eeffectiveness of them should
Xremain consistent. to say that when you can start building B's the C's
Xare obsolete takes them out of the game.
X
Xi think 3 or 4 C's should be able to take a B out.
X
X1941, the great Bismark was destroyed in 1 shot by the H.M.S. Hood
X( a battle cruiser). according the system you guys want, this hsould NEVER HAPPEN.
X
Xwar is not that scientific. anybody that believes it is sadly mistaken.
X
X
Xi think that a well planned f attack should be able to cripple a S.
Xnote the phrase "well planned". not numbers, well planned.
X
Xwithout this, the game is alot like Risk which i personally find
Xuninteresting, the oddss go in favor of the attacker.
X
Xi think a player should have at least 3 or 4:1 odds to be assured a
Xvictory. period. history of war bears this as being true!
X
Xnot that a 1:1 or a 2:1 attack, or a 1:2 or less for that matter, can't
Xbe successful, but the way things are set up, if you have an advantage
Xof 2:1 or even 1.25:1 you can be ASSURED of victory.
X
Xthe way things are set up, people who are even slightly behind give up
Xbecause they KNOW they stand no chance.
X
X-garrett
X
END_OF_FILE
if test 3841 -ne `wc -c <'Docs/oldgoodies.doc'`; then
    echo shar: \"'Docs/oldgoodies.doc'\" unpacked with wrong size!
fi
# end of 'Docs/oldgoodies.doc'
fi
if test -f 'Docs/races.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/races.doc'\"
else
echo shar: Extracting \"'Docs/races.doc'\" \(3627 characters\)
sed "s/^X//" >'Docs/races.doc' <<'END_OF_FILE'
XRACES			Galactic Bloodshed		RACES
X
X
XCONCEPTS
X
X   There are currently 10 programmed racial types, which gives players
Xwhich offers a large variety in capabilities. Of course, no one race
Xis intended to be ideal over another, and players should learn how
Xto optimize their particular choice. There are 8 basic characteristics
Xof each race:
X	1) Mesomorph - A player can request to be a 'mesomorphic'
X		race. These types of critters are characterizes by	
X		a low intelligence. It is usually a good idea to
X		take advantage of the 'technology investment' option
X		to keep pace with more intelligent racial types. They
X		do have the advantage of a much higher fighting ability, 
X		adventurism, birthrate (or 'infection rate' for mesos)
X		and only have 1 sex. They can also take over the
X		bodies of their victims. A well run mesomorphic player
X		can be a formidable foe.
X
X	2) Mass - Each race has a mass. The heavier the individual, the
X		more fuel it usually takes to launch and land them.
X		Heavy creatures may require more fuel to move around than
X		light creatures.
X
X	3) Birthrate - This factor (infection rate for mesos) controls
X		how rapidly the population in the sector will try to
X		adjust toi the maximum support of the sector. High
X		values mean that the populations multiply faster.
X
X	4) Fighting Ability - Higher values mean that the race is more
X		likely to kill an alien than a lower value. Races
X		with lower values will usually need to have larger
X		forces to win in direct combat over a high fighting
X		ability. It is important to note that this effects only
X		land combat and boarding strengths, and not ship to
X		ship fighting.
X
X	5) Intelligence - The raw growth rate of technology is goverened
X		by the race's intelligence. The technology increase per
X		update is IQ/100. Additional technology boosts for a race
X		is controlled by technology investments by the individual
X		planets under the player's control.
X
X	6) Adventurism - This described what percentage of a sector's
X		population wants to move and explore other sectors.
X		High value tend to explore and conquer planets on their
X		own more efficiently. If you have a low value, you can
X		order movements with the 'move' option.
X
X	7) Sexes - Each race has a number of sexes. This represent the
X		minimum population that a sector must have in order to
X		be able to reproduce. Lower values are preferable to high
X		values for colonization efforts.
X
X	8) Metabolism - This value controls how industrious the race. Higher
X		metabolism races will produce resources more rapidly than lower
X		metabolisms.
X
X
XAll of these racial characterics are assigned to 10 different racial types:
X
X				racial type
X
X	1    2    3    4    5    6    7    8    9   10		  (+/-)
X
XMeso?  yes  yes  yes   no   no   no   no   no   no   no		   none
XMass   1.0  1.5  2.0  1.25 1.25 1.25 1.25 1.25 1.25 1.25	   0.25
XBirth  0.7  0.8  0.9  0.4  0.4  0.4  0.4  0.4  0.4  0.4		   0.10
XFight   6    7    8    2    3    3    4    4    5    5		    1
XIntel   80   70   60  190  180  170  160  150  140  120		   20
XAdven  0.9  0.9  0.9  0.3  0.3  0.4  0.4  0.5  0.6  0.7
XSexes   1    1    1   2-4  2-4  2-4  2-4  2-4  2-4  2-4	  scewed to the low end
XMetab  1.3  1.3  1.3  1.0  1.0  1.0  1.0  1.0  1.0  1.0		   0.25
X
X
X   The creation of new races is controlled by the person hosting the
Xgame. Player #1 (the first player enrolled into the game) should 
Xalways be given diety status, as many of the game default operations
Xare places in player #1 control. Other players may be designated
Xas having diety status during the enrollment procedure, but this
Xisn't recommended (or needed in most cases).
X
X
END_OF_FILE
if test 3627 -ne `wc -c <'Docs/races.doc'`; then
    echo shar: \"'Docs/races.doc'\" unpacked with wrong size!
fi
# end of 'Docs/races.doc'
fi
if test -f 'client/arrays.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'client/arrays.h'\"
else
echo shar: Extracting \"'client/arrays.h'\" \(3002 characters\)
sed "s/^X//" >'client/arrays.h' <<'END_OF_FILE'
Xchar           *Novae[16][7] = {
X				"           ",
X				"           ",
X				"           ",
X				"    %*     ",
X				"           ",
X				"           ",
X				"           ",
X
X				"           ",
X				"           ",
X				"     %     ",
X				"    %*%    ",
X				"     %     ",
X				"           ",
X				"           ",
X
X				"           ",
X				"           ",
X				"     %%    ",
X				"   %%*%%   ",
X				"    %%     ",
X				"           ",
X				"           ",
X
X				"           ",
X				"           ",
X				"     %%%   ",
X				"    %*%%%  ",
X				"     %%%   ",
X				"           ",
X				"           ",
X
X				"           ",
X				"           ",
X				"    %%%    ",
X				"   %%*%%%  ",
X				"    %%%%   ",
X				"           ",
X				"           ",
X
X				"           ",
X				"     %     ",
X				"   %%%%    ",
X				"  %%%*%%%  ",
X				"   %%%%%   ",
X				"           ",
X				"           ",
X
X				"           ",
X				"     %     ",
X				"   %%%%%   ",
X				"  %% *%%%  ",
X				"   %%%%%   ",
X				"     %     ",
X				"           ",
X
X				"           ",
X				"     %     ",
X				"  %%%%%%%  ",
X				" %%% * %%% ",
X				"   %%%%%   ",
X				"     %%    ",
X				"           ",
X
X				"           ",
X				"    %%%    ",
X				"  %%%%%%%  ",
X				" %%% * %%% ",
X				"  %%% %%%  ",
X				"    %%%    ",
X				"           ",
X
X				"           ",
X				"    %%%%   ",
X				"  %%% %%%  ",
X				" %%% * %%% ",
X				"  %%% %%%% ",
X				"   %%%%%%  ",
X				"     %%    ",
X
X				"           ",
X				"    %%%%   ",
X				"  %%% %%%  ",
X				" %%% * %%% ",
X				"  %%%  %%% ",
X				"   %%%%%%  ",
X				"     %%    ",
X
X				"     %%    ",
X				"   %%%%%%  ",
X				"  %%   %%% ",
X				" %%% *  %%%",
X				" %%%%  %%% ",
X				"  %%%%%%%% ",
X				"     %%%   ",
X
X				"    %%%%   ",
X				"  %%%%%%%% ",
X				" %%%  % %%%",
X				" %%  *   %%",
X				" %%%    %%%",
X				"  %%%%%% % ",
X				"   % %%%   ",
X
X				"   %%% %%  ",
X				" %%% %% %% ",
X				"%%      %%%",
X				"%%%  * % %%",
X				" % %     %%",
X				" %%% % % % ",
X				"  %%%%%%%  ",
X
X				"%  % % %%  ",
X				"      %  % ",
X				"%%      % %",
X				"%    *   % ",
X				" %        %",
X				" %     % % ",
X				"  % %%%    ",
X
X				"    %  %   ",
X				"          %",
X				"%          ",
X				"     *    %",
X				"%          ",
X				" %        %",
X				"   %   % % "
X};
X
X
X
X
X
Xchar           *Mirror[8][5] = {
X
X				"         ",
X				"         ",
X				"\\=======/",
X				"         ",
X				"         ",
X
X				"   |     ",
X				"   \\     ",
X				"   \\\\    ",
X				"    \\\\   ",
X				"     \\\\__",
X
X				"     /   ",
X				"    ||   ",
X				"    ||   ",
X				"    ||   ",
X				"     \\   ",
X
X				"       __",
X				"     //  ",
X				"    //   ",
X				"    /    ",
X				"   |     ",
X
X				"         ",
X				"         ",
X				"/=======\\",	/* cc thinks this is a quoted
X						 * " w/o the \ */
X				"         ",
X				"         ",
X
X				"__       ",
X				"  \\\\     ",	/* weird stuff again */
X				"   \\\\    ",
X				"    \\\\   ",
X				"     |   ",
X
X				"   \\     ",
X				"   ||    ",
X				"   ||    ",
X				"   ||    ",
X				"   /     ",
X
X				"     |   ",
X				"    //   ",
X				"   //    ",
X				"__//     ",
X				"         "
X
X};
END_OF_FILE
if test 3002 -ne `wc -c <'client/arrays.h'`; then
    echo shar: \"'client/arrays.h'\" unpacked with wrong size!
fi
# end of 'client/arrays.h'
fi
if test -f 'client/keyboard.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'client/keyboard.c'\"
else
echo shar: Extracting \"'client/keyboard.c'\" \(5153 characters\)
sed "s/^X//" >'client/keyboard.c' <<'END_OF_FILE'
X/************************************************************************/
X/* TinyTalk keyboard handler.						 */
X/* */
X/* Version 1.0 [ 1/24/90] : Initial implementation by ABR.		 */
X/* 1.1 [ 1/25/90] : Added minimal termcap support.		 */
X/* 1.2 [ 1/26/90] : Clean up terminal state on ^C.		 */
X/* */
X/************************************************************************/
X
X#include "TinyMUD_copyright.h"
X#include <signal.h>
X#include <sgtty.h>
X#include <errno.h>
X#include <stdio.h>
X
X#include "client.h"
X
X/* For some odd systems, which don't put this in errno.h. */
X
Xextern int      errno;
X
X#ifdef TERMCAP
Xextern char    *getenv();
Xstatic int      have_clear;
Xstatic char     start_of_line[16], clear_to_eol[16];	/* Warning, short! */
Xstatic char     write_buffer[64];	/* Also rather short.... */
Xstatic char    *write_buffer_ptr;
X#endif
Xint		have_inv = 0;
X
Xstatic int      num_columns;
Xstatic int      current_column;
Xstatic string   keyboard_buffer;
Xstatic int      keyboard_pos;
X
Xsigint_handler()
X{				/* Restore terminal state; cleanup. */
X	die("\n\nInterrupt, exiting.\n");    /* Exit through error handler. */
X}
X
Xsigtstp_handler()
X{				/* Leave terminal alone! */
X	cooked_echo_mode();
X	kill(getpid(), SIGSTOP);
X	cbreak_noecho_mode();
X
X	if (keyboard_pos != 0)		/* If there is input, we want to  */
X		set_refresh_pending();	/* refresh when we start back up. */
X}
X
Xinit_keyboard()
X{
X	struct winsize  size;
X
X	cbreak_noecho_mode();
X
X	ioctl(0, TIOCGWINSZ, &size);
X	num_columns = size.ws_col;
X	if (num_columns <= 20)	/* Suspicious, reset it. */
X		num_columns = 80;
X	set_default_wrap(num_columns);
X
X	keyboard_pos = 0;	/* No input yet. */
X	current_column = 0;	/* Left side of screen. */
X
X	signal(SIGINT, sigint_handler);		/* Control-C. */
X	signal(SIGTSTP, sigtstp_handler);	/* Control-Z. */
X
X#ifdef TERMCAP
X	get_termcap_info();
X#endif
X}
X
X#ifdef TERMCAP
X
Xget_termcap_info()
X{
X	char            blob[1024];	/* As per termcap man page */
X	char           *terminal_name, *temp;
X
X	terminal_name = getenv("TERM");
X	if (terminal_name == NULL) {
X		have_clear = FALSE;
X		return;
X	}
X	if (tgetent(blob, terminal_name) == 1) {
X		temp = start_of_line;
X		if (tgetstr("cr", &temp) == NULL) {
X			start_of_line[0] = '\r';
X			start_of_line[1] = '\0';
X		}
X		temp = clear_to_eol;
X		if (tgetstr("ce", &temp) == NULL)
X			have_clear = FALSE;
X		else
X			have_clear = TRUE;
X		if (tgetstr("so", &temp) == NULL)
X			have_inv = 0;
X		else
X			have_inv = 1;
X	} else			/* Couldn't read termcap entry */
X		have_clear = FALSE;
X}
X
X#endif
X
Xcleanup_keyboard()
X{
X	cooked_echo_mode();
X	signal(SIGTSTP, NULL);
X}
X
Xhandle_keyboard_input()
X{				/* Read input, one char at a time. */
X	char            ch;
X	int             count;
X
X	count = read(0, &ch, 1);/* Read from stdin. */
X	if (count == 0)		/* Huh?  Ignore this. */
X		return;
X
X	if (count == -1) {
X		if (errno == EWOULDBLOCK)
X			return;
X		else
X			die("%% Couldn't read keyboard.\n");
X	}
X	if (ch == '\n') {
X		write(1, &ch, 1);
X		process_buffer();
X		keyboard_pos = 0;
X		current_column = 0;
X	} else {
X		if ((ch == '\010') || (ch == '\177')) {	/* Backspace. */
X			if (keyboard_pos == 0)
X				return;
X
X			keyboard_pos--;
X
X			if (current_column != 0) {    /* Can do BS, SPC, BS. */
X				write(1, "\010 \010", 3);
X				current_column--;
X			} else {
X				current_column = num_columns - 1;
X						/* Wrapped around. */
X				do_refresh();	
X					/* Will redraw the right part. */
X			}
X		} else if ((ch == '\025') || (ch == '\030')) {	/* Cancel line. */
X			keyboard_pos = 0;
X			erase_keyboard_input();
X			current_column = 0;
X		} else if ((ch < ' ') || (keyboard_pos == MAXSTRLEN - 1)) {
X			ch = '\007';	/* Beep! */
X			write(1, &ch, 1);
X		} else {
X			keyboard_buffer[keyboard_pos++] = ch;
X			current_column = (current_column + 1) % num_columns;
X			write(1, &ch, 1);
X		}
X	}
X}
X
Xprocess_buffer()
X{
X	if (keyboard_pos == 0)	/* Nothing typed. */
X		return;
X
X	keyboard_buffer[keyboard_pos] = '\n';
X	transmit(keyboard_buffer, keyboard_pos + 1);
X/*	log_input(keyboard_buffer);*/
X}
X
Xdo_refresh()
X{
X	int             loc;	/* Place to start refresh from */
X	int             modulo;
X
X	modulo = keyboard_pos % num_columns;	/* Number on last line */
X	loc = keyboard_pos - modulo;
X
X	if (modulo != 0)
X		write(1, &keyboard_buffer[loc], modulo);
X
X	clear_refresh_pending();
X}
X
X#ifdef TERMCAP
Xwrite_one(c)
X	char            c;
X{
X	*(write_buffer_ptr++) = c;
X}
X#endif
X
Xerase_keyboard_input()
X{
X#ifdef TERMCAP
X
X	if (have_clear) {	/* Can we use termcap now? */
X		write_buffer_ptr = write_buffer;
X		tputs(start_of_line, 1, write_one);
X		tputs(clear_to_eol, 1, write_one);
X		write(1, write_buffer, write_buffer_ptr - write_buffer);
X		goto end_termcap;
X	}
X	/* Drops through into non-TERMCAP code otherwise... */
X
X#endif
X
X	{
X		int             temp;
X		string          buffer;	/* Should be long enough for 80*3. */
X		char           *ptr;
X
X		temp = current_column;
X		ptr = buffer;
X
X		while (temp != 0) {	/* Erase line, backwards. */
X			*(ptr++) = '\010';
X			*(ptr++) = ' ';
X			*(ptr++) = '\010';
X			temp--;
X		}
X		write(1, buffer, ptr - buffer);
X	}
X#ifdef TERMCAP
Xend_termcap:
X#endif TERMCAP
X
X	if (keyboard_pos != 0)	/* If there is input, schedule a */
X		set_refresh_pending();	/* refresh event. */
X}
END_OF_FILE
if test 5153 -ne `wc -c <'client/keyboard.c'`; then
    echo shar: \"'client/keyboard.c'\" unpacked with wrong size!
fi
# end of 'client/keyboard.c'
fi
if test -f 'server/Makefile.old' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/Makefile.old'\"
else
echo shar: Extracting \"'server/Makefile.old'\" \(4643 characters\)
sed "s/^X//" >'server/Makefile.old' <<'END_OF_FILE'
X# Galactic Bloodshed (Robert Chansky, smq@b)
X# Makefile
X
X# what version of UNIX we are running on.
XUV = VER_4_3
X#UV = VER_4_2
X# (the -pipe -g are for development.)
XCFLAGS = -bsd -g
X#CFLAGS = -O -bsd -g
X#CFLAGS = -D$(UV) -pipe -g 
X#CFLAGS = -D$(UV) -O
X
X# objects for shell
XSHOBJS =  getplace.o	\
X	read_teleg.o	\
X	teleg_send.o	\
X	autoreport.o	\
X	order.o	\
X	shootblast.o	\
X	explore.o	\
X	relation.o	\
X	mobiliz.o	\
X	shlmisc.o	\
X	enslave.o	\
X	capitol.o	\
X	toggle.o	\
X	survey.o	\
X	files.o		\
X	zoom.o		\
X	perm.o		\
X	prof.o		\
X	GB_server.o		\
X	name.o		\
X	fire.o		\
X	land.o		\
X	tech.o		\
X	map.o		\
X	max.o		\
X	move.o		\
X	capture.o	\
X	cs.o		\
X	rst.o		\
X	misc.o		\
X	rand.o		\
X	load.o		\
X	scrap.o		\
X	build.o		\
X	orbit.o		\
X	power.o		\
X	launch.o	\
X	declare.o	\
X	examine.o	\
X	toxicity.o	\
X	get4args.o	\
X	files_rw.o	\
X	files_shl.o \
X	moveplanet.o	\
X	autoshoot.o	\
X	doplanet.o	\
X	doturn.o	\
X	VN.o		\
X	doship.o	\
X	dosector.o	\
X	moveship.o
X
X
X# depend on vars.h and races.h
XVROBJS = getplace.o	\
X	autoreport.o	\
X	order.o	\
X	mobiliz.o	\
X	shlmisc.o	\
X	capitol.o	\
X	toggle.o	\
X	enrol.o	\
X	max.o		\
X	move.o		\
X	capture.o	\
X	zoom.o		\
X	toxicity.o	\
X	doplanet.o	\
X	shootblast.o	\
X	autoshoot.o	\
X	moveship.o	\
X	explore.o	\
X	relation.o	\
X	dosector.o	\
X	declare.o	\
X	survey.o	\
X	prof.o		\
X	perm.o		\
X	rst.o		\
X	GB_server.o		\
X	VN.o		\
X	cs.o		\
X	max.o		\
X	map.o		\
X	scrap.o		\
X	name.o		\
X	fire.o		\
X	power.o		\
X	doturn.o	\
X	doship.o	\
X	makeuniv.o	\
X	makeplanet.o
X
X
X# depend on ships.h and vars.h
XSHIPOBJS = autoreport.o	\
X	order.o	\
X	shootblast.o	\
X	makeplanet.o	\
X	enrol.o	\
X	examine.o	\
X	capitol.o	\
X	enslave.o	\
X	relation.o	\
X	capital.o	\
X	survey.o	\
X	launch.o	\
X	build.o		\
X	enrol.o		\
X	fire.o		\
X	land.o		\
X	map.o		\
X	max.o		\
X	move.o		\
X	capture.o	\
X	cs.o		\
X	VN.o		\
X	rst.o		\
X	load.o		\
X	name.o		\
X	prof.o		\
X	scrap.o		\
X	orbit.o		\
X	doturn.o	\
X	doship.o	\
X	doplanet.o	\
X	moveship.o	\
X	autoshoot.o	\
X	moveplanet.o	\
X	files_shl.o
X
X# depend on files.h
XFOBJS =	files_shl.o 	\
X	files_rw.o	\
X	makeuniv.o	\
X	shlmisc.o 	\
X	doturn.o 	\
X	enrol.o 	\
X	files.o		\
X	GB.o 		\
X	build.o		\
X	power.o 	\
X	daemon.o	\
X	examine.o
X
X
X# dont depend on anything
XNOOBJS = get4args.o	\
X	misc.o		\
X	rand.o		\
X	daemon.o	\
X	files_rw.o
X
X# objects for enrol
XEOBJS = enrol.o	\
X	files_shl.o	\
X	files_rw.o		\
X	files.o	\
X	max.o	\
X	perm.o	\
X	rand.o	\
X	shlmisc.o
X
X# objects for fix
XFIXOBJS = fix.o	\
X	files_shl.o	\
X	files_rw.o		\
X	getplace.o	\
X	shlmisc.o	\
X	files.o
X
Xall: GB_server GB_enroll mor GB_daemon makeuniv fix trav
X#trav
X
X# the shell 
XGB_server : ${SHOBJS}
X	cc -o GB_server ${SHOBJS}  -lcurses -ltermcap -lm;
X
X${VROBJS}: races.h vars.h
X${SHIPOBJS}: vars.h ships.h
X${FOBJS}: files.h
Xbuild.o : vars.h ships.h races.h shipdata.h
Xpower.o files_shl.o : power.h
Xdoturn.o doship.o doplanet.o moveship.o moveplanet.o : doturn.h
Xmoveship.o : vars.h ships.h shipdata.h
Xdoturn.o doplanet.o doship.o : power.h
X
X#fix it program
Xfix : ${FIXOBJS}
X	cc -o fix ${FIXOBJS} -lcurses -ltermcap -lm
X
X#sizes : vars.h ships.h races.h
X#	 sizes.c
X
X# make data files program
Xmakeuniv : makeuniv.o makeplanet.o rand.o perm.o
X	cc -o makeuniv makeuniv.o makeplanet.o rand.o perm.o files.o -lm
Xmakeuniv.o : power.h
X
X
X# the daemon (actually it calls the update)
XGB_daemon : daemon.o
X	cc -o GB_daemon daemon.o
X
X# the enrollment program
XGB_enroll : ${EOBJS}
X	cc -o GB_enroll ${EOBJS} -lcurses -ltermcap -lm
Xenrol.o : vars.h ships.h shipdata.h races.h
X
X# more clone
Xmor : more.c
X	cc -g -o mor more.c
X
Xtrav : traverse.o files_rw.o files_shl.o files.o
X	cc -o trav traverse.o files_rw.o files_shl.o files.o
X
Xchmod:
X	chmod ag+xs GB
X	chmod g+rwx Data Data/* Data/Tele/*
X	chmod a+rx Docs Docs/*
X	chmod g+r *.dat*
X	chmod a+x mor
X#	chmod ga+rwx Data Data/* Data/Tele/*
X
Xstart:
X	/bin/rm -f Data/spitup
X	GB_daemon 4 > /dev/null
X
Xclean:
X	/bin/rm -rf GB makeuniv GB_daemon mor *.o core a.out
X
Xclear:
X	/bin/rm -rf *.o core a.out
X
X
X# shar it up for transport.
Xshar:
X	/bin/cp Docs/*.doc* .
X#	-uncompress enroll.dat.Z *.doc*
X	shar README Makefile *.script *.doc *.h *.c planet.list *.dat > GB.shar
X#	-compress enroll.dat
X#	compress GB.shar
X	/bin/rm -f *.doc
X
X# shar up the docs.
Xshardocs:
X	uncompress Docs/*.doc*
X	shar README *.doc* > GBdocs.shar
X	compress Docs/*.doc*
X
X# make the game ftpable by netters.
Xpublic:
X	/bin/cp Docs/* .
X	uncompress enroll.dat.Z 
X	shar -c README Makefile *.doc *.h *.c planet.list *.dat > /tmp/GB.shar
X	compress enroll.dat
X	compress /tmp/GB.shar
X	/bin/cp /tmp/GB.shar.Z /usr/ftp/pub/games
X	/bin/rm -f /tmp/GB.shar.Z
X	chmod a+r /usr/ftp/pub/games/GB.shar.Z
X	/bin/rm -f *.doc
X
X# install the game for public use.
Xinstall:
X	make
X	mkdir Docs
X	mv *.doc Docs
X	compress Docs/* enroll.dat
X	makeuniv < planet.list
X	make chmod
X
END_OF_FILE
if test 4643 -ne `wc -c <'server/Makefile.old'`; then
    echo shar: \"'server/Makefile.old'\" unpacked with wrong size!
fi
# end of 'server/Makefile.old'
fi
if test -f 'server/enslave.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/enslave.c'\"
else
echo shar: Extracting \"'server/enslave.c'\" \(4582 characters\)
sed "s/^X//" >'server/enslave.c' <<'END_OF_FILE'
X/*
X** Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
X** smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
X** Restrictions in GB_copyright.h.
X**  enslave.c -- ENSLAVE the planet below.
X*/
X
X#include "GB_copyright.h"
X#define EXTERN extern
X#include "vars.h"
X#include "ships.h"
X#include "races.h"
X#include "buffers.h"
X#include <signal.h>
X
Xint enslave_shdata,enslave_pdata, enslave_racedata;
X
Xenslave(Playernum, APcount, argn,args)
Xint Playernum;
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xshiptype *s, *s2;
Xplanettype *p;
Xint sh,shipno,i,mask,aliens=0,def=0,attack=0;
Xdouble Dist;
X
Xenslave_shdata = enslave_pdata = NEUTRAL_FD;
X
Xsscanf(args[1]+(args[1][0]=='#'), "%d",&shipno);
X
X  openshdata(&enslave_shdata);
X  if (!getship(enslave_shdata, &s, shipno)) {
X      close_file(enslave_shdata);
X	return;
X  }
X  close_file(enslave_shdata);
X
X  if (s->owner!=Playernum) {
X	DontOwnErr(Playernum,shipno);
X	return; 
X }
X
X  if (testship(Playernum,s, shipno)) {
X	return;
X	}
X
X  if (s->type != STYPE_ASS) {
X	sprintf(buf,"This ship is not an %s.\n", Shipnames[STYPE_ASS]);
X		notify(Playernum, buf);
X	return;
X  }
X  if (s->whatorbits!=LEVEL_PLAN) {
X	sprintf(buf,"%s #%d doesn't orbit a planet.\n", Shipnames[s->type],shipno);
X		notify(Playernum, buf);
X	return;
X  }
X
X  if (!enufAP(Playernum,Stars[s->storbits]->AP[Playernum-1], APcount)) { 
X	return;
X	}
X
Xfree(Race);
Xopenracedata(&enslave_racedata);
Xgetrace(enslave_racedata, &Race, Playernum); 
Xclose_file(enslave_racedata);
X
X openpdata(&enslave_pdata);
X  getplanet(enslave_pdata,&p,Stars[s->storbits]->planetpos[s->pnumorbits]);
Xclose_file(enslave_pdata);
X  if (p->info[Playernum-1].numsectsowned==0) {
X	sprintf(buf,"You don't have a garrison on the planet.\n");
X		notify(Playernum, buf);
X	return;
X  }
X
X	/* add up forces attacking, defending */
X  for (attack=aliens=def=0,i=1; i<MAXPLAYERS; i++) {
X	if (p->info[i-1].numsectsowned && i!=Playernum) {
X		aliens = 1;
X		def += p->info[i-1].destruct;
X	}
X  }
X
X  if (!aliens) {
X	sprintf(buf,"There is no one else on this planet to enslave!\n");
X		notify(Playernum, buf);
X	return;
X  }
X
X  sh = p->ships;
X  openshdata(&enslave_shdata);
X  while (sh) {
X	(void)getship(enslave_shdata, &s2, sh);
X	if (p->info[s2->owner].numsectsowned && s2->owner!=Playernum)
X		def += s2->destruct;
X	else if (s2->owner==Playernum)
X		attack += s2->destruct;
X	sh = s2->nextship;
X	free(s2);
X  }
X  close_file(enslave_shdata);
X
X  deductAPs(Playernum,APcount, s->storbits, 0);
X
X  sprintf(buf,"\nFor successful enslavement this ship and the other ships here\n");
X		notify(Playernum, buf);
X  sprintf(buf,"that are yours must have a weapons\n");
X		notify(Playernum, buf);
X  sprintf(buf,"capacity greater than twice that the enemy can muster, including\n");
X		notify(Playernum, buf);
X  sprintf(buf,"the planet and all ships orbiting it.\n");
X		notify(Playernum, buf);
X  sprintf(buf,"\nTotal forces bearing on %s:   %d\n", prin_ship_orbits(s), attack);
X		notify(Playernum, buf);
X
X    sprintf(telegram_buf,"ALERT!!!\n\nPlanet /%s/%s ", 
X		Stars[s->storbits]->name,
X		Stars[s->storbits]->pnames[s->pnumorbits]);
X 
X  if (def <= 2 * attack) {
X
X	p->slaved_to = Playernum;
X	openpdata(&enslave_pdata);
X  	putplanet(enslave_pdata,p,Stars[s->storbits]->planetpos[s->pnumorbits]);
X  	close_file(enslave_pdata);
X
X	/* send telegs to anyone there */
X	  sprintf(buf,"ENSLAVED by %s #%d!!\n", 
X			Shipnames[s->type], shipno);
X		str_cat(telegram_buf, buf);
X	  sprintf(buf,"All material produced here will be\ndiverted to %s coffers.",
X			Race->name);
X		str_cat(telegram_buf, buf);
X
X	  sprintf(buf,"\nEnslavement successful.  All material produced here will\n");
X		notify(Playernum, buf);
X	  sprintf(buf,"be diverted to %s.\n", Race->name);
X		notify(Playernum, buf);
X	  sprintf(buf,"You must maintain a garrison of 0.1 the population of the\n");
X		notify(Playernum, buf);
X	  sprintf(buf,"planet (at least %.0f); otherwise there is a 50%% chance that\n", p->popn * 0.01);
X		notify(Playernum, buf);
X	  sprintf(buf,"enslaved population will revolt.\n");
X		notify(Playernum, buf);
X
X  } else {
X
X	  sprintf(buf,"repulsed attempt at enslavement by %s #%d!!\n", 
X			Shipnames[s->type], shipno);
X		str_cat(telegram_buf, buf);
X	  sprintf(buf,"Enslavement repulsed, defense/attack Ratio : %d to %d.\n", def, attack);
X		str_cat(telegram_buf, buf);
X
X	  sprintf(buf, "Enslavement repulsed.\n");
X		notify(Playernum, buf);
X	  sprintf(buf, "You needed more weapons bearing on the planet...\n");
X		notify(Playernum, buf);
X  }
X
X
X  for (i=1; i<MAXPLAYERS; i++)
X	if (p->info[i-1].numsectsowned && i!=Playernum)
X		notify(i, telegram_buf);
X
X  free(p);
X
X}
X
X
END_OF_FILE
if test 4582 -ne `wc -c <'server/enslave.c'`; then
    echo shar: \"'server/enslave.c'\" unpacked with wrong size!
fi
# end of 'server/enslave.c'
fi
if test -f 'server/power.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/power.c'\"
else
echo shar: Extracting \"'server/power.c'\" \(3730 characters\)
sed "s/^X//" >'server/power.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
X * Restrictions in GB_copyright.h.
X *
X * Galactic Bloodshed (Robert Chansky, smq@ucscb.ucsc.edu)
X * power.c -- display power report
X */
X
X#include "GB_copyright.h"
X#define EXTERN extern
X#include "vars.h"
X#include "races.h"
X#include "power.h"
X#include "buffers.h"
X#include <errno.h>
X#include <time.h>
Xextern int errno;
Xextern struct tm *update_tm;
Xint power_racedata;
X
Xblock(Playernum,APcount, argn,args)
Xint Playernum;
Xint APcount, argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xregister int i,n;
Xint power_fd, p;
Xracetype *r;
Xint dummy;
X
X	  n = Numraces();
X
Xif(argn > 1) {
X
Xp = -1;
X	GetPlayer(args[1], &p, &r);
Xif(p == -1) {
X	notify(Playernum, "No such player,\n");
X	return;
X	}
X
X/* list the players who are in this alliance block */
X	dummy=(Blocks[p-1].invite & Blocks[p-1].pledge);
X
X sprintf(buf,"         ========== %s Power Report ==========\n",
X			Blocks[p-1].name);
X	notify(Playernum, buf);
X  sprintf(buf," #  Name               sects   popn eff mob #shp #plan    res   fuel   dest\n");
X	notify(Playernum, buf);
X
Xopenracedata(&power_racedata);
Xfor(i=1; i<=n; i++)
X	if(isset(dummy, i)) {
X		  getrace(power_racedata, &r,i);
X		  sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u\n",
X			i, r->name,
X			Power[i-1].sectors_owned, Power[i-1].popn, 
X			Power[i-1].sectors_owned ? 
X				(float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
X			Power[i-1].sectors_owned ? 
X				(float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
X			Power[i-1].ships_owned, Power[i-1].planets_owned,
X			Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct);
X		  free(r);
X	notify(Playernum, buf);
X		}
Xclose_file(power_racedata);
X
X	} else {   /* list power report for all the alliance blocks (as of the last update) */
X sprintf(buf,"         ========== Alliance Blocks as of %s ==========\n",
X			Power_blocks.time);
X	notify(Playernum, buf);
X  sprintf(buf," #  Name                 #  sects    popn #shp #plan    res   fuel   dest   VPs\n");
X	notify(Playernum, buf);
X	for(i=1; i<=n; i++) 
X		if(Power_blocks.members[i-1] > 1) {
X		  sprintf(buf,"%2d %-19.19s%3d%7u%8u%5u%6u%7u%7u%7u%7u\n",
X			i, Blocks[i-1].name, Power_blocks.members[i-1],
X			Power_blocks.sectors_owned[i-1], Power_blocks.popn[i-1], 
X			Power_blocks.ships_owned[i-1], Power_blocks.planets_owned[i-1],
X			Power_blocks.resource[i-1], Power_blocks.fuel[i-1],
X			Power_blocks.destruct[i-1], Power_blocks.VPs[i-1]);
X		notify(Playernum, buf);
X		}
X
X	}
X
X}
X
X
X
Xpower(Playernum,APcount, argn,args)
Xint Playernum;
Xint APcount, argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xregister int i,n;
Xint power_fd, p;
Xracetype *r;
X
Xp = -1;
Xif(argn>=2) {
X	GetPlayer(args[1], &p, &r);
Xif(p == -1) {
X	notify(Playernum, "No such player,\n");
X	return;
X	}
X	}
X
Xopenracedata(&power_racedata);
Xfree(Race);
Xgetrace(power_racedata, &Race, Playernum); 
X
X sprintf(buf,"         ========== Galactic Bloodshed Power Report ==========\n");
X	notify(Playernum, buf);
X  sprintf(buf," #  Name               sects   popn eff mob #shp #plan    res   fuel   dest\n");
X	notify(Playernum, buf);
X
X	  n = Numraces();
X	  for (i=1; i<=n; i++) 
X		if(argn < 2 || i==p) {
X		  getrace(power_racedata, &r,i);
X		  sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u\n",
X			i, r->name,
X			Power[i-1].sectors_owned, Power[i-1].popn, 
X			Power[i-1].sectors_owned ? 
X				(float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
X			Power[i-1].sectors_owned ? 
X				(float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
X			Power[i-1].ships_owned, Power[i-1].planets_owned,
X			Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct);
X		  free(r);
X	notify(Playernum, buf);
X	  }
Xclose_file(power_racedata);
X}
END_OF_FILE
if test 3730 -ne `wc -c <'server/power.c'`; then
    echo shar: \"'server/power.c'\" unpacked with wrong size!
fi
# end of 'server/power.c'
fi
if test -f 'server/shipdata.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/shipdata.h'\"
else
echo shar: Extracting \"'server/shipdata.h'\" \(4421 characters\)
sed "s/^X//" >'server/shipdata.h' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
X * Restrictions in GB.c.
X */
X
Xchar Shipltrs[]={ 'p','s','X','D','B','I','C','d','f','e','H','S','O','c',
X	't','!','+','m',
X	'=','\\','-','a','g','v','V','Q','L','w',':','G','F',
X	'T','&','A','[','R','P'};
X
Xint Shipdata[NUMSTYPES][NUMABILS] = {
X   /*  carg  dest guns fuelcap  tech crw arm trg cst  jmp lnd sw sp dm bd cn st prg*/
X/*SPd*/   1,    1,   0,     20,    1,  1,  0,  2,  10,  0, 1, 0, 2,  0, 0, 0, 0,1,
X/*Shu*/  25,    2,   1,     20,   10,  5,  0,  5,  20,  0, 1, 0, 4,  0, 3, 2, 1,1,
X/*Car*/ 600,  800,  30,   1000,  250, 60,  5, 60, 500,  1, 0, 0, 4, 50, 2, 1, 1,1,
X/*Drn*/ 500,  500,  60,    500,  500, 40, 10, 50, 800,  1, 1, 0, 6, 50, 3, 1, 1,1,
X/*BB */ 235,  400,  30,    200,  200, 30,  7, 50, 400,  1, 1, 0, 6, 50, 3, 1, 1,1,
X/*Int*/ 110,  120,  30,    200,  200, 10,  2, 30, 300,  1, 1, 0, 6, 50, 3, 1, 1,1,
X/*CA */ 165,  300,  20,    120,  150, 20,  5, 30, 200,  1, 1, 0, 6, 50, 3, 1, 1,1,
X/*DD */ 110,  120,  15,     80,  100, 10,  3, 20, 100,  1, 1, 0, 6, 50, 3, 1, 1,1,
X/*FF */   0,   30,  15,      8,  100,  1,  0,  5,  20,  0, 1, 0, 6,  0, 3, 1, 1,1,
X/*Exp*/   0,    15,  5,     35,   20,  2,  1,  5,  40,  1, 1, 0, 6,  0, 3, 0, 1,1,
X/*Hab*/5000,   500, 20,    500,  100,2000, 3, 50,1000,  0, 0, 0, 4, 75, 2, 2, 1,1,
X/*Stn*/5000,   250, 20,    500,  100, 50,  1, 45, 400,  0, 0, 0, 4, 75, 2, 2, 1,1,
X/*OSP*/1400,  1000, 50,   1000,  200,200,  5, 50, 800,  1, 0, 0, 4, 75, 2, 2, 1,1,
X/*Crg*/1000,  1000,  5,   1000,  100,100,  2, 30, 100,  1, 1, 0, 4,  0, 3, 2, 1,1,
X/*Tnk*/  15,    10,  5,   5000,  100, 10,  2, 30, 100,  1, 1, 0, 4,  0, 3, 1, 1,1,
X/*GOD*/20000,20000,20000,20000, 5000,100, 10, 65, 100,  1, 1, 0, 9,  0, 0, 2, 1,1,
X/*SMn*/   0,    50,  0,     20,   50,  0,  1,  5,  25,  0, 1, 1, 4,  0, 1, 0, 0,1,
X   /*  carg   dest guns fuelcap tech crw arm trg  cst jmp lnd sw sp  dm bd cn st*/
X/*mir*/ 200,    10,  1,     20,  100,  5,  0, 80, 100,  0, 0, 0, 2, 75, 2, 0, 1,1,
X/*Stc*/   0,     0,  0,     20,   50,  2,  0,  5,  50,  1, 1, 0, 4,  0, 3, 0, 1,1,
X/*Tsc*/   0,     0,  0,      0,    5,  2,  0,  5,  10,  0, 1, 0, 0,  0, 0, 0, 1,1,
X/*T-R*/   0,     0,  0,   1000,  100,  5,  0,  5, 400,  0, 1, 1, 2,  0, 0, 0, 1,1,
X/*APr*/   0,     0,  0,    200,   50, 10,  1,  5,  80,  0, 1, 1, 0,  0, 0, 0, 1,1,
X/*CD */   0,     1,  0,      1,   40,  0,  0,  5,  20,  0, 1, 0, 2,  0, 0, 0, 0,1,
X/*VN */  20,     1,  0,     50,   80,  0,  1,  5,  30,  0, 1, 1, 2,  0, 0, 0, 0,1,
X/*Bers*/ 50,   500, 40,   1000,10000,  0, 10, 50, 100,  0, 1, 1, 4,  0, 0, 0, 1,1,
X/*Gov*/ 500,   100, 20,   1000,    0, 10, 10, 50,1500,  1, 1, 0, 2, 75, 0, 0, 1,1,
X/*OMCL*/  0,   100, 10,    100,  350,  2,  1,  5, 100,  0, 1, 1, 4,  0, 0, 0, 0,1,
X/*TWC*/   0,     1,  0,     20,   25,  0,  0,  5,  50,  0, 1, 0, 2,  0, 0, 0, 0,1,
X/*Prb*/   0,     1,  0,     20,  200,  0,  0,  3,  20,  1, 1, 0, 9,  0, 1, 0, 1,1,
X   /*  carg   dest guns fuelcap tech crw arm trg  cst jmp ln sw sp  dm bd  cn st*/
X/*GRL */ 50,   120, 40,      0,  100,  5,  3,  5, 100,  0, 1, 0, 0, 50, 0, 0, 1,1,
X/*Fac*/   0,    0,   0,      0,    0, 20,  5, 20,  50,  0, 1, 1, 0, 75, 0, 3, 1,1,
X/*TFD*/   0,     0,  0,    200,   70, 20,  1,  5, 100,  1, 1, 1, 4,  0, 0, 0, 1,1,
X/*BCC*/ 200,    50,  5,      0,99999,  0, 10,  5,   3,  0, 1, 1, 0,  0, 0, 0, 1,0,
X/*BAf*/1000,  1000,  0,   1000,99999,  0, 10,  5,   8,  0, 1, 1, 0,  0, 0, 0, 1,0,
X/*TD */1000,  1000,  0,   1000,  400,100,  0,  1, 600,  0, 1, 1, 0,  0, 0, 0, 1,1,
X/*SRp*/   0,	 0,  0,      0,  100,  0,  0,  1,  10,  0, 1, 0, 0,  0, 0, 0, 1,1,
X/*PDN*/   0,   100, 20,      0,  250, 10,  3, 20, 300,  0, 1, 0, 0, 75, 0, 0, 1,1
X};
X
Xchar *Shipnames[NUMSTYPES] = {
X   "Spore pod",
X   "Shuttle",
X   "Carrier",
X   "Dreadnaught",
X   "Battleship",
X   "Interceptor",
X   "Cruiser",
X   "Destroyer",
X   "Fighter Group",
X   "Explorer",
X   "Habitat",
X   "Station",
X   "Ob Asst Pltfrm",
X   "Cargo Ship",
X   "Tanker",
X   "GODSHIP",
X   "Space Mine",
X   "Space Mirror",
X   "Space Telescope",
X   "Ground Telescope",
X   "* T-R beam",
X   "Atmosph Processor",
X   "Canister of dust",
X   "V.Neumann Machine",
X   "Berserker",
X   "Govrnmnt. Center",
X   "Mind Control Lsr",
X   "Tox Waste Canistr",
X   "Space Probe",
X   "Gamma Ray Laser",
X   "Factory",
X   "Terraform Device",
X   "Bers Cntrl Center",
X   "Bers Autofac",
X   "AVPM Transporter",
X   "Sector Repair",
X   "Planet Def Net"
X};
END_OF_FILE
if test 4421 -ne `wc -c <'server/shipdata.h'`; then
    echo shar: \"'server/shipdata.h'\" unpacked with wrong size!
fi
# end of 'server/shipdata.h'
fi
if test -f 'server/telegram.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/telegram.c'\"
else
echo shar: Extracting \"'server/telegram.c'\" \(3375 characters\)
sed "s/^X//" >'server/telegram.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
X * Restrictions in GB_copyright.h.
X *
X *  telegram.c -- send a telegram to user
X */
X
X#include "GB_copyright.h"
X#include "vars.h"
X#include "races.h"
X#include "ships.h"
X#include <ctype.h>
X#include <signal.h>
X#include <strings.h>
X#include <setjmp.h>
Xextern jmp_buf main_jenv;
Xextern char telegram_buf[AUTO_TELEG_SIZE];
X
Xtelegram(APcount, argn,args)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xracetype *alien;
Xplacetype where;
Xplanettype *pl;
Xint c,i,j,numraces,recp = -1,to_all;
Xboolean Place = 0;
Xchar telefl[100], tbuf[200], tmbuf[40], r[200];
Xint telegram_pdata,telegram_handler();
X
X
X  signal(SIGINT, telegram_handler);
X
Xnumraces = Numraces();
X
X  if (Sdata.AP[Playernum] < APcount) {
X     if (Dir.level==LEVEL_UNIV) {
X	printf("You don't have enough AP's.\n");
X	telegram_handler();
X     } if (!enufAP(Stars[Dir.snum]->AP,APcount) )
X	telegram_handler();
X  }
X
X  if (argn==1) {		/* recipient not specified */
X	printf("To whom/where? ");
X	scanf("%[^\n]",r);
X	getchr();
X  } else
X	strncpy(r,args[1],RNAMESIZE);
X
X  to_all = 0;
X
X  if (r[0] == '/' || r[0]=='#' || r[0]=='.' || r[0]==CHAR_CURR_SCOPE) {
X    Place = 1;
X    where = Getplace(r,1);
X    if (where.err)
X	telegram_handler();
X  } else if(!strcmp(r, "all")) {
X	Place = 1;
X  	to_all = 1;
X  } else {
X    GetPlayer(r, &recp, &alien);
X    if ( recp == -1) {
X	  printf("Player does not exist.\n");
X	  telegram_handler();
X    }
X  }
X
X if(!to_all) printf("Enter telegram for %s,\n  ending with ctrl-D.\n\n", 
X			Place ? Dispplace(&where) : alien->name );
Xelse
X	printf("Enter announcement for all players,\n ending with ctrl-D.\n\n");
X
X  printf("Subject : ");
X  teleg_add("", telegram_buf,0);
X  if (Place) {
X	sprintf(tbuf, " %s received at %s%s.\n",  to_all ? " Announcement" : "Message",
X		to_all ? "" : (where.level==LEVEL_SHIP ? "ship " : ""), to_all ? "" : Dispplace(&where) );
X	teleg_add(tbuf, telegram_buf,0);
X  }
X  i = 0;
X  while ( (c=getchr()) != EOF) {
X	  if (c!='\n') {
X		  ungetc(c,stdin);
X		  scanf("%199[^\n]", tbuf);
X		  getchr();
X		  j = strlen(tbuf);
X	  } else 
X		j=0;
X	  tbuf[j] = '\n'; tbuf[j+1] = '\0';
X	  i += j;
X	  teleg_add(tbuf, telegram_buf,0);
X  	  printf("%d : ",TELEGRAM_SIZE - i );
X  }
X  
X	/* send it */
X
X  if(to_all) {
X	        for (i=1; i<=numraces; i++)
X		     teleg_send(Playernum, i, telegram_buf);
X  			}
Xelse if (!Place)
X	  teleg_send(Playernum, recp, telegram_buf);
X else
X     switch (where.level) {
X	case LEVEL_STAR:
X	        for (i=1; i<=numraces; i++)
X		  if (isset(Stars[where.snum]->inhabited,i))
X		     teleg_send(Playernum, i, telegram_buf);
X		break;
X	case LEVEL_PLAN:
X		openpdata(&telegram_pdata);
X		getplanet(telegram_pdata, &pl, Stars[where.snum]->planetpos[where.pnum]);
X		close_file(telegram_pdata);
X		for (i=1; i<=numraces; i++)
X			if (pl->info[i-1].numsectsowned)
X			     teleg_send(Playernum, i, telegram_buf);
X		break;
X	case LEVEL_SHIP:
X		teleg_send(Playernum, where.shipptr->owner, telegram_buf);
X		break;
X    	case LEVEL_UNIV:
X		printf("Noone there to receive your message!\n");
X		break;
X    }
X
X	/* get rid of ctrl-D problem */
X  clearerr(stdin);
X
X  if (Sdata.AP[Playernum] >= APcount)
X	deductAPs(APcount, 0, 1);
X  else 
X	deductAPs(APcount, Dir.snum, 0);
X
X  printf("\nMessage delivered.\n");
X
X}
X
X
Xtelegram_handler()
X{
X longjmp(main_jenv,1);
X}
END_OF_FILE
if test 3375 -ne `wc -c <'server/telegram.c'`; then
    echo shar: \"'server/telegram.c'\" unpacked with wrong size!
fi
# end of 'server/telegram.c'
fi
echo shar: End of archive 11 \(of 14\).
cp /dev/null ark11isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 14 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0