[comp.sources.games] v07i051: GB2 - Galactic Bloodshed, an empire-like war game [Ver. 1.0], Part08/08

billr@saab.CNA.TEK.COM (Bill Randle) (07/19/89)

Submitted-by: VANCLEEF@mps.ohio-state.edu
Posting-number: Volume 7, Issue 51
Archive-name: GB2/Part08



#! /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 8 (of 8)."
# Contents:  Docs/actionpoints.doc Docs/assault.doc Docs/autoreport.doc
#   Docs/cs.doc Docs/daemon.doc Docs/dock.doc Docs/examine.doc
#   Docs/explore.doc Docs/fire.doc Docs/fix.doc Docs/god.doc
#   Docs/install.doc Docs/launch.doc Docs/load.doc Docs/makeuniv.doc
#   Docs/message.doc Docs/name.doc Docs/news.doc Docs/read.doc
#   Docs/relation.doc Docs/report.doc Docs/scrap.doc Docs/ship.doc
#   Docs/stock.doc Docs/tactical.doc Docs/telegram.doc Docs/undock.doc
#   Docs/zoom.doc daemon.c doturn.h files.h get4args.c help.c perm.c
#   power.c power.h races.h rand.c relation.c ship.dat sizes.c
#   teleg_send.c traverse.c zoom.c
# Wrapped by billr@saab on Thu Jul  6 07:39:58 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Docs/actionpoints.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/actionpoints.doc'\"
else
echo shar: Extracting \"'Docs/actionpoints.doc'\" \(1142 characters\)
sed "s/^X//" >'Docs/actionpoints.doc' <<'END_OF_FILE'
Xactionpoints		Galactic Bloodshed		actionpoints
X
X
XCONCEPT: actionpoints
X
X  Action Points are built up slowly by the player's presence in a solar
Xsystem.  They are a mechanism to represent the ``bureaucratic grind'' of
Xa star-spanning government.
X
X  Every command uses a certain number of action points; some commands,
Xbeing observatory in nature, use none.  A list can be found in the
X``help'' section of the Galactic Bloodshed docs.
X
X  Each player receives a number of action points, each turn and in each solar
Xsystem he occupies as well as an amount in the ``universal'' scope, according 
Xto the following formula:
X
X  AP[player] = AP[player] + (ships in system) / 10 + 
X			(total system population) / 5000 + 1
X
X  Unless that system has not been explored, in which case the player will get
Xnone.  No player can have more than 99 action points in one system, or the
Xupper universe.
X
X  A player's action points for each system are displayed in his prompt when
Xhis scope is in that system (changed by the ``cs'' command).
X
X  The action point cost of each command can be found just before it's listing 
Xin each document entry.
X
X
XSEE ALSO
X  cs
X
X
END_OF_FILE
if test 1142 -ne `wc -c <'Docs/actionpoints.doc'`; then
    echo shar: \"'Docs/actionpoints.doc'\" unpacked with wrong size!
fi
# end of 'Docs/actionpoints.doc'
fi
if test -f 'Docs/assault.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/assault.doc'\"
else
echo shar: Extracting \"'Docs/assault.doc'\" \(1320 characters\)
sed "s/^X//" >'Docs/assault.doc' <<'END_OF_FILE'
XASSAULT			Galactic Bloodshed		ASSAULT
X
X
XNAME
X  [1] assault -- attempt capture of planet
X 
XSYNTAX
X      assault [#shipnum]
X
XDESCRIPTION
X  This command may be used when a player wishes to capture a planet intact
Xinstead of laying waste to it.  To perform an assault, the ship involved
Xmust be 5 units of distance to it or closer (much like ``land''.)  
X
X  The player will receive a combat readiness bonus of 100 on the disputed 
Xplanet only if he does not have extensive colonies there.  Combat
Xreadiness represents how ready and willing the inhabitants are to fight.  
XOver time, this combat readiness will tend towards the average mobilization 
Xof the sectors each player owns.  The mobilization of the assaulted sector
Xwill be set to 100, as will the mobilization quota (see ``mobilize'').
X
X  Each turn sectors bordered by two opposing players will be contested, both
Xraces will receive casualties in disputed sectors and the winner, if there is
Xone, moving in.  Being possibly outnumbered by the planet's original 
Xinhabitants, the attacking player may have to resort to orbital bombardment
Xbefore the natives wise up and surrender.  (see the section on ``slavery'').
XThis, however, carries it's own price -- sectors may be rendered permanently
Xuninhabitable and of no use to anyone.
X
X
XSEE ALSO
X  enslave, land, fire
X
END_OF_FILE
if test 1320 -ne `wc -c <'Docs/assault.doc'`; then
    echo shar: \"'Docs/assault.doc'\" unpacked with wrong size!
fi
# end of 'Docs/assault.doc'
fi
if test -f 'Docs/autoreport.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/autoreport.doc'\"
else
echo shar: Extracting \"'Docs/autoreport.doc'\" \(838 characters\)
sed "s/^X//" >'Docs/autoreport.doc' <<'END_OF_FILE'
XAUTOREPORT		Galactic Bloodshed		AUTOREPORT
X
X
XNAME
X  [0] autoreport -- designate a report to be sent each turn
X
XSYNOPSIS
X       autoreport [path]
X
XDESCRIPTION
X
X  ``Autoreport'', when used on a planet, will cause a report to be generated
Xeach turn concerning that planet: what resources were used, what had been
Xconstructed, the increase (or decrease) in population, how many sectors had
Xbeen conquered, etc.  If ``path'' is not specified, autoreport will apply
Xitself to the current scope.
X
X  The report generated is sent to the user's telegram file.
X
X  Autoreport is disabled after 7 turns, at which point it must be renewed.
XThis feature is to prevent telegrams from accumulating in the files of players
Xwho never seem to read them.
X
X  If automatic reporting is already designated for that planet, it will be
Xdeactivated from then on.
X
X
END_OF_FILE
if test 838 -ne `wc -c <'Docs/autoreport.doc'`; then
    echo shar: \"'Docs/autoreport.doc'\" unpacked with wrong size!
fi
# end of 'Docs/autoreport.doc'
fi
if test -f 'Docs/cs.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/cs.doc'\"
else
echo shar: Extracting \"'Docs/cs.doc'\" \(514 characters\)
sed "s/^X//" >'Docs/cs.doc' <<'END_OF_FILE'
XCS			Galactic Bloodshed			CS
X
X
XNAME
X  [0] cs -- change scope
X
XSYNOPSIS
X        cs [-d] [path]
X        where path = ``#shipnumber'' | ``:'' | ``/[path]'' | ``..[/path]'' 
X		     | [name]
X
XDESCRIPTION
X  cs changes from the current ``operative scope'' to the specified one.
XIf no scope is specified, cs will change to the ``default scope''.
X  If the ``-d'' option is specified, cs will make [path] the new ``default
Xscope''.
X  You cannot cs into areas that have not yet been explored by you.
X
X
XSEE ALSO
X scope, orbit
END_OF_FILE
if test 514 -ne `wc -c <'Docs/cs.doc'`; then
    echo shar: \"'Docs/cs.doc'\" unpacked with wrong size!
fi
# end of 'Docs/cs.doc'
fi
if test -f 'Docs/daemon.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/daemon.doc'\"
else
echo shar: Extracting \"'Docs/daemon.doc'\" \(872 characters\)
sed "s/^X//" >'Docs/daemon.doc' <<'END_OF_FILE'
X	The Galactic Bloodshed game sequence is controled by a 
X`daemon' program which updates the positions of ships, planets 
Xand stars at a set time interval (usually 1 to 3 hours, set by the
Xgame master). The growth/depletion of the planetary resources, population,
Xfuel and destructive capacity is monitored and updated by this program.
XBetween updates, players may issue commands, construct ships, initiate
Xattacks and do whatever they see fit with the available commands.
X
X	It isn't necessary to be present at all times, since interstellar
Xtravel takes some time, and it takes several iterations of the daemon to
Xgenerate significant changes in planetary status. It is wise, however,
Xto check up on things from time to time to keep yourself from getting
Xoverrun by some hostile race as well as having high toxicity levels from
Xcausing ecological damage to your planets.
X
X
END_OF_FILE
if test 872 -ne `wc -c <'Docs/daemon.doc'`; then
    echo shar: \"'Docs/daemon.doc'\" unpacked with wrong size!
fi
# end of 'Docs/daemon.doc'
fi
if test -f 'Docs/dock.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/dock.doc'\"
else
echo shar: Extracting \"'Docs/dock.doc'\" \(269 characters\)
sed "s/^X//" >'Docs/dock.doc' <<'END_OF_FILE'
X
XDOCK			Galactic Bloodshed		DOCK
X
X
XNAME
X  [1] dock -- land a ship
X  
XSYNTAX
X      dock [#shipnum]
X
XDESCRIPTION
X  This command docks two ships together.   The two ships in question must
Xbe closer than the minimum landing distance.
X
XSEE ALSO
X  land, dock, launch, undock
END_OF_FILE
if test 269 -ne `wc -c <'Docs/dock.doc'`; then
    echo shar: \"'Docs/dock.doc'\" unpacked with wrong size!
fi
# end of 'Docs/dock.doc'
fi
if test -f 'Docs/examine.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/examine.doc'\"
else
echo shar: Extracting \"'Docs/examine.doc'\" \(539 characters\)
sed "s/^X//" >'Docs/examine.doc' <<'END_OF_FILE'
XEXAMINE			Galactic Bloodshed		EXAMINE
X
X
XNAME
X  [1] examine -- look at a ship/object
X
XSYNTAX
X	examine [#shipnum]
X
XDESCRIPTION
X  
X  ``Examine'' gives the user a short paragraph-summary description of a ship or
Xobject and how it can be used.  This command can be applied to any ship or
Xobject in a system where a player has equipment (ships, objects, or a 
Xcolonized planet.)
X
X  This command deducts 1 AP for the time and research spent in examination, 
Xhowever subsequent examinations of the same ship/object use no AP's.
X
X
XSEE ALSO
X build
X
END_OF_FILE
if test 539 -ne `wc -c <'Docs/examine.doc'`; then
    echo shar: \"'Docs/examine.doc'\" unpacked with wrong size!
fi
# end of 'Docs/examine.doc'
fi
if test -f 'Docs/explore.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/explore.doc'\"
else
echo shar: Extracting \"'Docs/explore.doc'\" \(348 characters\)
sed "s/^X//" >'Docs/explore.doc' <<'END_OF_FILE'
XEXPLORE			Galactic Bloodshed		EXPLORE
X
X
XNAME
X  [0] explore -- global survey of explored worlds
X 
XSYNTAX
X      explore
X
XDESCRIPTION
X  This command gives a brief census of all stars and worlds the player 
Xcurrently occupies or has occupied.
X
X  More detailed information about stars/planets can be found using
Xthe 'survey' command.
X
XSEE ALSO
X  survey
END_OF_FILE
if test 348 -ne `wc -c <'Docs/explore.doc'`; then
    echo shar: \"'Docs/explore.doc'\" unpacked with wrong size!
fi
# end of 'Docs/explore.doc'
fi
if test -f 'Docs/fire.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/fire.doc'\"
else
echo shar: Extracting \"'Docs/fire.doc'\" \(1590 characters\)
sed "s/^X//" >'Docs/fire.doc' <<'END_OF_FILE'
XFIRE			Galactic Bloodshed			FIRE
X
X
XNAME
X  [1] fire -- shoot at an enemy planet or ship
X
XSYNOPSIS
X       fire 
X
XDESCRIPTION
X  Fire attempts to use stockpiled destructive capacity from one place,
Xto give damage to another.
X
X  Fire will prompt the user for both.  The damage given is proportional to
Xthe amount of destructive capacity used, and inversely proportional to
Xthe distance between them and the armor class (if the defender is a ship) of
Xthe victim ship.
X
X  If the object being fired upon is a planet fire will prompt for a sector 
Xat which to aim; If the object being fired from is a planet, fire will ask for
Xa sector from which to fire (this must be a sector owned by the player, for
Xthe target will attempt to fire back if it can).  The player will be informed
Xhow badly damaged the target is (if this is a planet, the number of sectors
Xdestroyed.) Badly damaged sectors can be rendered uninhabitable for some time.
XThe blast radius on the target planet is inversely proportional to the 
Xstrength of the shot and the distance between attacker and target.  Sectors
Xthat are mobilized will be damaged to a lesser extent; a 100% mobilized
Xsector will be damaged 1/2 as much as a 0% mobilized sector.
X
X  At this point the target will attempt to fire back at the originating
Xarea (ship or sector) with twice the strength of the attacking player, if
Xit can.  If more then one player inhabits a planet, each player that was
Xaffected by the attack, and does not belong to the attacking player,
Xwill attempt to return fire at twice the attacking strength.
X
X
XSEE ALSO
X  tactical, mobilize
END_OF_FILE
if test 1590 -ne `wc -c <'Docs/fire.doc'`; then
    echo shar: \"'Docs/fire.doc'\" unpacked with wrong size!
fi
# end of 'Docs/fire.doc'
fi
if test -f 'Docs/fix.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/fix.doc'\"
else
echo shar: Extracting \"'Docs/fix.doc'\" \(636 characters\)
sed "s/^X//" >'Docs/fix.doc' <<'END_OF_FILE'
XFIX			Galactic Bloodshed			FIX
X
X
XNAME
X  [0] fix -- alter conditions on planet/race/ship/star (manager only)
X
XSYNOPSIS
X       fix [sectorx,y] ["race"]
X
XDESCRIPTION
X
X  Fix cycles through attributes of a race,planet,ship,star, or sector.  These
Xcan be altered by typing in a number of the appropriate type, or hitting
Xreturn to go to the next attribute.  The manager must "cs" to the object
Xbeing altered.  If the manager wishes to fix a sector, the current scope
Xmust be that planet.  To fix the attributes of a player itself, the manager
Xmust login as that player, and type "fix race".
X
X  This command was included to counteract bugs.
X
X
END_OF_FILE
if test 636 -ne `wc -c <'Docs/fix.doc'`; then
    echo shar: \"'Docs/fix.doc'\" unpacked with wrong size!
fi
# end of 'Docs/fix.doc'
fi
if test -f 'Docs/god.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/god.doc'\"
else
echo shar: Extracting \"'Docs/god.doc'\" \(193 characters\)
sed "s/^X//" >'Docs/god.doc' <<'END_OF_FILE'
XGOD			Galactic Bloodshed			GOD
X
X
XNAME
X  god -- turn off deity privileges
X
XSYNTAX
X  god
X
XDESCRIPTION
X  
X  If the user had deity privileges before, this revokes them, for 
Xdevelopment purposes.
X
END_OF_FILE
if test 193 -ne `wc -c <'Docs/god.doc'`; then
    echo shar: \"'Docs/god.doc'\" unpacked with wrong size!
fi
# end of 'Docs/god.doc'
fi
if test -f 'Docs/install.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/install.doc'\"
else
echo shar: Extracting \"'Docs/install.doc'\" \(295 characters\)
sed "s/^X//" >'Docs/install.doc' <<'END_OF_FILE'
X
X
X
XTo initially install the 'GB' command for executing of this program
Xfrom your area do
X
Xln -s /u2/vancleef/GB/GB
X
Xfrom your home directory. This will create the galactic blooshed 
Xexecution command in your area. Afterwards, you need only do
X
XGB
X
Xto run the program from your home directory.
X
X
END_OF_FILE
if test 295 -ne `wc -c <'Docs/install.doc'`; then
    echo shar: \"'Docs/install.doc'\" unpacked with wrong size!
fi
# end of 'Docs/install.doc'
fi
if test -f 'Docs/launch.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/launch.doc'\"
else
echo shar: Extracting \"'Docs/launch.doc'\" \(526 characters\)
sed "s/^X//" >'Docs/launch.doc' <<'END_OF_FILE'
XLAUNCH			Galactic Bloodshed		LAUNCH
X
X
XNAME
X  [1] launch -- launch a ship
X
XSYNOPSIS
X         launch [#shipnum]
X
XDESCRIPTION
X  This command attempts to launch ships that are landed on planets.  
X
X  To do so a ship must have an amount of fuel proportional to the
Xgravitational field of the planet and the mass of the ship.  If the ship does
Xnot have enough fuel, it will not be able to launch.  The ship must also
Xcontain at least one crew member or be a robotic ship, and must not be
Xirradiated.
X
X
XSEE ALSO
X  undock, land, dock
END_OF_FILE
if test 526 -ne `wc -c <'Docs/launch.doc'`; then
    echo shar: \"'Docs/launch.doc'\" unpacked with wrong size!
fi
# end of 'Docs/launch.doc'
fi
if test -f 'Docs/load.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/load.doc'\"
else
echo shar: Extracting \"'Docs/load.doc'\" \(1287 characters\)
sed "s/^X//" >'Docs/load.doc' <<'END_OF_FILE'
XLOAD			Galactic Bloodshed			LOAD
X
X
XNAME
X  [1] load -- load/unload commodities to/from a ship
X
XSYNTAX
X  load [#shipnum]
X
XDESCRIPTION
X  The load command is used for the resupplying of ships, and the disembarking
Xof colonies.  
X
X  If no arguments are specified, the program will prompt the user for:
X
X  #shipnum -- What ship to load from/to
X
X  d|p|r|f -- specify destructive potential, people, resources, or fuel to load/ 
Xunload.  destructive potential, resources and fuel are taken from that user's
Xstockpiles, while people are taken from the sector the ship is landed on.  If
Xthe ship is docked with another ship and not a planet, the tranfers will be 
Xdirect.
X
X  amt -- the amount to load (if negative, the amount will be subtracted).
XThis must be within certain bounds: the maximum cargo capacity of each ship,
Xunless one or both of the ships are shuttles.  Shuttles are unique in that
Xtheir design allows cargo to be strapped to their hull, and thus they can
Xactually hold more cargo than the maximum.  An overloaded shuttle cannot,
Xhowever, take off or land until it jettisons its excess.
X
X  If the ship is neither landed at a planet nor docked with another vessel,
Xthe player will be prompted whether or not to jettison its cargo / passengers
Xto deep space, never to be recovered.
X
END_OF_FILE
if test 1287 -ne `wc -c <'Docs/load.doc'`; then
    echo shar: \"'Docs/load.doc'\" unpacked with wrong size!
fi
# end of 'Docs/load.doc'
fi
if test -f 'Docs/makeuniv.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/makeuniv.doc'\"
else
echo shar: Extracting \"'Docs/makeuniv.doc'\" \(803 characters\)
sed "s/^X//" >'Docs/makeuniv.doc' <<'END_OF_FILE'
XMAKEUNIV		Galactic Bloodshed		MAKEUNIV
X
X
XNAME
X  makeuniv -- construct data files for ``Galactic Bloodshed''
X
XSYNTAX
X  makeuniv [-v]  { from UNIX shell only }
X
XDESCRIPTION
X  
X  This command constructs the data files used in the game.  The ``-v'' 
Xoption causes makeuniv to print out sector maps and information about planets,
Xsystems, etc. otherwise the construction will be relatively silent.
X
X  Makeuniv asks for the number of stars (which cannot exceed the maximum
Xlisted there without dire consequences), a lower and upper range of planets
Xthat the program will not exceed, and the name of each star system.  The 
Xplanets of each system will be named according to the star and a roman
Xnumeral representing its position, i.e. "Sol/Sol-III".
X
X  Makeuniv will destroy any game previously in operation.
X
END_OF_FILE
if test 803 -ne `wc -c <'Docs/makeuniv.doc'`; then
    echo shar: \"'Docs/makeuniv.doc'\" unpacked with wrong size!
fi
# end of 'Docs/makeuniv.doc'
fi
if test -f 'Docs/message.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/message.doc'\"
else
echo shar: Extracting \"'Docs/message.doc'\" \(580 characters\)
sed "s/^X//" >'Docs/message.doc' <<'END_OF_FILE'
X****************************************************************
X
X6/29/89
XPlease do not abort the program while the program is trying to
Xwork. Be patient! Wierd problems with the data base have
Xbeen found to be the result of this.
X
X6/28/89
XPlease do not specify planets as your destinations for inter-
Xstellar travel. Designate the host star first and after you 
Xarrive at it, THEN specify the planet destination. Otherwise,
Xyou will not arrive! (It gets hung around it.) I will try to 
Xcome up with a fix soon.
X
X****************************************************************
X
X
END_OF_FILE
if test 580 -ne `wc -c <'Docs/message.doc'`; then
    echo shar: \"'Docs/message.doc'\" unpacked with wrong size!
fi
# end of 'Docs/message.doc'
fi
if test -f 'Docs/name.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/name.doc'\"
else
echo shar: Extracting \"'Docs/name.doc'\" \(786 characters\)
sed "s/^X//" >'Docs/name.doc' <<'END_OF_FILE'
XNAME			Galactic Bloodshed		NAME
X
X
XDESCRIPTION
X  [2] name -- rename an object (ship, star, planet)
X
XSYNTAX
X  name [path] [name]
X
XDESCRIPTION
X  ``name'' attempts to rename the specified path to the name.  If
X[path] is a star or planet you must have explored that area; if [path] is
Xa ship you must own that ship.
X
X  If [path] is the word ``race'', name will prompt for a new racial name.
X
X  An additional constraint against the player is that he have more AP's
Xthan any other player in the system in which he is naming (only if the
Xobject is a star or planet).  The AP cost will be deducted from that system,
Xunless the object named is the racial name or a ship in interstellar space,
Xin which case the AP cost will be deducted from the ``universal'' scope.
X
X
XSEE ALSO
X  cs, actionpoints
END_OF_FILE
if test 786 -ne `wc -c <'Docs/name.doc'`; then
    echo shar: \"'Docs/name.doc'\" unpacked with wrong size!
fi
# end of 'Docs/name.doc'
fi
if test -f 'Docs/news.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/news.doc'\"
else
echo shar: Extracting \"'Docs/news.doc'\" \(1298 characters\)
sed "s/^X//" >'Docs/news.doc' <<'END_OF_FILE'
X6/29/89 - For those of you who haven't noticed, you can tell 'map'
X	or 'orbit' to omit the names of ships, stars, or planets
X	to get a look at objects that may be overprinting others
X	so you can see them. do `help map' or `help orbit' to
X	see how to do this.
X
X6/26/89 - When you order ships to go to other systems, do not 
X	specify planet designations until your ships arrive at
X	the star.
X
X6/23/89 - Just a reminder, don't build ships/objects with a `*'
X	designation in front of them. They haven't been programmed
X	and will just be a waste of resources.
X
X6/22/89 - You must load fuel and crew onto an atmospheric processor `A'
X	to get them to work. See help in `build' for details.
X
X6/22/89 - Asteriods have been programmed to produced enhanced amounts of
X	resources due to the easy availability of raw materials on them.
X
X6/22/89 - Cargo ships, shuttle, stations, orbital assualt platforms,
X	and habitats can be used to construct other ships.
X
X6/21/89 - Teletransporter devices '[' are now working.
X
X6/21/89 - Daemon updates are set for 2 hours now. See `help daemon' for
X	details.
X
X6/9/89  - We have installed the new version of Galactic Bloodshed 1.0(osu). 
X	This has superior addressing and whatnot from the previous bug-ridden
X	version. It has several new features. Good luck with this one.
X
END_OF_FILE
if test 1298 -ne `wc -c <'Docs/news.doc'`; then
    echo shar: \"'Docs/news.doc'\" unpacked with wrong size!
fi
# end of 'Docs/news.doc'
fi
if test -f 'Docs/read.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/read.doc'\"
else
echo shar: Extracting \"'Docs/read.doc'\" \(1526 characters\)
sed "s/^X//" >'Docs/read.doc' <<'END_OF_FILE'
XREAD			Galactic Bloodshed		READ
X
X
XNAME
X  [0] read -- read messages from other players
X 
XSYNTAX
X      read
X
XDESCRIPTION
X
X  Read allows the player to look over messages sent to him by the other
Xusers in the game.  The player will be the first 
Xmessage in his mailbox, and the prompt:
X
X1: (br tdmq?):
X
X
X  At the prompt the user may:
X      'b' -- Back up one message
X      'r' -- reread the message
X      't' -- Attempt to Translate this message
X      ' ',<return> -- go to and read next message
X      'd' -- Delete this message
X      'm' -- Give a list of translation modifiers
X      'q' -- Quit this command
X      '?' -- Give this list as help
X
X  'b' will display the message before the current one, if there is one.
X  'r' will print the contents of the message to the screen.  Note that with
Xthe communication difficulties inherent between any two disparate alien 
Xraces, some parts of the message (or even all of it) may be listed as 
Xuntranslateable.
X  'd' will delete the message from the user's files.
X  't' will attempt to translate a message into the user's own language.  This
Xuses resources, equipment and personnel that would otherwise be employed
Xelsewhere, to the tune of 4 resources and 1 Action Point per translation
Xattempt.  The expenditure is deducted from wherever the ``Current Scope'' is
Xat the moment; thus a user can shuffle his expenses around.  This effort will
Xincrease the translation modifier for the sending player (note that this does
Xnot need to be done for each message.)
X  
X
XSEE ALSO
X  telegram
X
END_OF_FILE
if test 1526 -ne `wc -c <'Docs/read.doc'`; then
    echo shar: \"'Docs/read.doc'\" unpacked with wrong size!
fi
# end of 'Docs/read.doc'
fi
if test -f 'Docs/relation.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/relation.doc'\"
else
echo shar: Extracting \"'Docs/relation.doc'\" \(322 characters\)
sed "s/^X//" >'Docs/relation.doc' <<'END_OF_FILE'
XRELATION		Galactic Bloodshed		RELATION
X
X
XNAME
X  [0] relation -- state relations 
X  
XSYNTAX
X      relation
X
XDESCRIPTION
X  This command prints out the relations between the player's race and those
Xof the other players in the game.  It also gives the translation modifiers
Xfor each player.
X
X
XSEE ALSO
X  power, read, declare
X
END_OF_FILE
if test 322 -ne `wc -c <'Docs/relation.doc'`; then
    echo shar: \"'Docs/relation.doc'\" unpacked with wrong size!
fi
# end of 'Docs/relation.doc'
fi
if test -f 'Docs/report.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/report.doc'\"
else
echo shar: Extracting \"'Docs/report.doc'\" \(590 characters\)
sed "s/^X//" >'Docs/report.doc' <<'END_OF_FILE'
XREPORT			Galactic Bloodshed		REPORT
X
X
XNAME
X  [0] report -- navigational ship report
X 
XSYNTAX
X      report [#shipnum]
X
XDESCRIPTION
X  This command allows users to survey their ships.  Where ``stock'' gives
Xinformation about what a ship is carrying, ``report'' will give
Xinformation about where the ship is and where it is going.
X
X  If given with no arguments, ``report'' will start with the current scope
Xand give reports on all ships from there down.
X
X  Additional information about the ship can be obtained with the ``examine'' 
Xcommand.
X
X
XSEE ALSO
X  examine, ship, stock, tactical, scope
X
END_OF_FILE
if test 590 -ne `wc -c <'Docs/report.doc'`; then
    echo shar: \"'Docs/report.doc'\" unpacked with wrong size!
fi
# end of 'Docs/report.doc'
fi
if test -f 'Docs/scrap.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/scrap.doc'\"
else
echo shar: Extracting \"'Docs/scrap.doc'\" \(643 characters\)
sed "s/^X//" >'Docs/scrap.doc' <<'END_OF_FILE'
XSCRAP			Galactic Bloodshed		SCRAP
X
X
XNAME
X  [1] scrap -- junk a ship
X
XSYNTAX
X	scrap [#shipnum]
X
XDESCRIPTION
X  
X  Scrap allows users to reclaim the resources consumed in building
Xa ship or object.  Because of labor costs, only 75% of the original cost of
Xthe ship/object can be reclaimed.
X
X  Upon scrapping the ship, its reclamation value plus any commodities it may
Xhave in its hold, are added to the stockpiles of the planet it is on.
X
X  If the ship is not landed on a planet, no resources may be reclaimed; however,
Xthe ship can self-destruct if it has a self-destruct charge (1 or more 
Xdestructive capacity).
X
XSEE ALSO
X load, stock, build
X
END_OF_FILE
if test 643 -ne `wc -c <'Docs/scrap.doc'`; then
    echo shar: \"'Docs/scrap.doc'\" unpacked with wrong size!
fi
# end of 'Docs/scrap.doc'
fi
if test -f 'Docs/ship.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/ship.doc'\"
else
echo shar: Extracting \"'Docs/ship.doc'\" \(492 characters\)
sed "s/^X//" >'Docs/ship.doc' <<'END_OF_FILE'
X
XSHIP			Galactic Bloodshed		SHIP
X
X
XNAME
X  [0] ship -- ship report
X 
XSYNTAX
X      ship [#shipnum]
X
XDESCRIPTION
X  This command allows users to survey their ships.  It is equivalent to
Xrequesting a stock, report, and tactical report for each ship.  This command
Xuses scoping in the same way the other commands do.  Ship types are detailed
Xin the ``build'' docs.
X
X  Additional information about ships can be obtained with the ``examine'' 
Xcommand.
X
X
X
XSEE ALSO
X  examine, report, tactical, scope
X
END_OF_FILE
if test 492 -ne `wc -c <'Docs/ship.doc'`; then
    echo shar: \"'Docs/ship.doc'\" unpacked with wrong size!
fi
# end of 'Docs/ship.doc'
fi
if test -f 'Docs/stock.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/stock.doc'\"
else
echo shar: Extracting \"'Docs/stock.doc'\" \(385 characters\)
sed "s/^X//" >'Docs/stock.doc' <<'END_OF_FILE'
XSTOCK			Galactic Bloodshed		STOCK
X
X
XNAME
X  [0] stock -- stockpile report
X 
XSYNTAX
X      stock [#shipnum]
X
XDESCRIPTION
X  This command allows users to survey their ships.  It gives basic
Xinformation about cargo and crew.
X
X  If given with no arguments, ``stock'' will start with the current scope
Xand give reports on all ships from there down.
X
X
XSEE ALSO
X  ship, report, tactical, scope
X
END_OF_FILE
if test 385 -ne `wc -c <'Docs/stock.doc'`; then
    echo shar: \"'Docs/stock.doc'\" unpacked with wrong size!
fi
# end of 'Docs/stock.doc'
fi
if test -f 'Docs/tactical.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/tactical.doc'\"
else
echo shar: Extracting \"'Docs/tactical.doc'\" \(930 characters\)
sed "s/^X//" >'Docs/tactical.doc' <<'END_OF_FILE'
XTACTICAL		Galactic Bloodshed			TACTICAL
X
X
XNAME
X  [0] tactical -- tactical ship report
X 
XSYNTAX
X      tactical [#shipnum]
X
XDESCRIPTION
X  This command allows users to survey their ships.  Where ``stock'' and 
X``report'' give information about what the ship is carrying and where it
Xis going, ``tactical'' reports the ship's battle readiness.
X
X  If given with no arguments, ``tactical'' will start with the current scope
Xand give reports on all ships from there down.
X
X  Tactical will first give a ship's combat readiness report, then report on
Xall ships within its range that are not owned by the player.  The command
Xdisplays the range and potential damage of each enemy ship, should it be
Xfired upon by the player's ship with a full broadside of all its guns.  Ships
Xowned by opposing players will only appear on tactical display if they are
Xin the same scope in which tactical is being called.
X
X
XSEE ALSO
X  report, stock, scope
X
END_OF_FILE
if test 930 -ne `wc -c <'Docs/tactical.doc'`; then
    echo shar: \"'Docs/tactical.doc'\" unpacked with wrong size!
fi
# end of 'Docs/tactical.doc'
fi
if test -f 'Docs/telegram.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/telegram.doc'\"
else
echo shar: Extracting \"'Docs/telegram.doc'\" \(1050 characters\)
sed "s/^X//" >'Docs/telegram.doc' <<'END_OF_FILE'
XTELGRAM			Galactic Bloodshed		TELGRAM
X
X
XNAME
X  [2] telegram -- send messages to other players
X 
XSYNTAX
X      telegram [Playername | Playernumber | place]
X
XDESCRIPTION
X  
X  This command allows users to communicate with each other.  The player
Xmust specify who/what they wish to contact, and a message to send to
Xthat player.  To specify a place instead of a single player, the string
Xmust begin with one of the following characters: / : . #  If the string
Xis specified in this way, all players that currently occupy the area 
Xspecified will be sent the telegram.  If the area is a ship, only the owner
Xof that ship will be the recipient.
X
X  Note that the transmission will identify your location to them, so it is
Xexpedient to choose carefully whom you send messages to.
X
X  Note also that with first contact between any two races utterly alien to
Xeach other, there is likely to be communication difficulties between the
Xtwo at first.  The receiving player will have to use valuable resources and
Xequipment to translate your message.
X
XSEE ALSO
X  read
X
END_OF_FILE
if test 1050 -ne `wc -c <'Docs/telegram.doc'`; then
    echo shar: \"'Docs/telegram.doc'\" unpacked with wrong size!
fi
# end of 'Docs/telegram.doc'
fi
if test -f 'Docs/undock.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/undock.doc'\"
else
echo shar: Extracting \"'Docs/undock.doc'\" \(196 characters\)
sed "s/^X//" >'Docs/undock.doc' <<'END_OF_FILE'
XUNDOCK			Galactic Bloodshed		UNDOCK
X
X
XNAME
X  [1] undock -- undock a ship
X
XSYNOPSIS
X         undock [#shipnum]
X
XDESCRIPTION
X  this command is a synonym for launch.
X
X
XSEE ALSO
X  launch, land, dock
X
END_OF_FILE
if test 196 -ne `wc -c <'Docs/undock.doc'`; then
    echo shar: \"'Docs/undock.doc'\" unpacked with wrong size!
fi
# end of 'Docs/undock.doc'
fi
if test -f 'Docs/zoom.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/zoom.doc'\"
else
echo shar: Extracting \"'Docs/zoom.doc'\" \(844 characters\)
sed "s/^X//" >'Docs/zoom.doc' <<'END_OF_FILE'
XZOOM			Galactic Bloodshed		ZOOM
X
X
XNAME
X  [0] zoom -- declare zoom values
X 
XSYNTAX
X      zoom (amount)
X
XDESCRIPTION
X
X  This command allows users to alter the scale used in an orbit display.
XThe lower the number, the larger the display will be.
X
X  ``Amount'' can be specified in one of two ways: a floating-point format,
Xin which case the amount will be the amount given, or an x/y format, in
Xwhich case the amount will be the numerator (x) divided by the denominator (y).
X
X  At a zoom scale of 1.0, the display will be equal to the screen size.  At
Xa scale of greater than 1.0, the display will be smaller than the screen;
Xsmaller than 1.0, and the screen will zoom in to the displayed map.
X
X  Display is centered around the current ``lastx,lasty'' coordinates (see
Xorbit).
X
X  At game start, the zoom value is declared as 1.0.
X
XSEE ALSO
X  orbit
END_OF_FILE
if test 844 -ne `wc -c <'Docs/zoom.doc'`; then
    echo shar: \"'Docs/zoom.doc'\" unpacked with wrong size!
fi
# end of 'Docs/zoom.doc'
fi
if test -f 'daemon.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'daemon.c'\"
else
echo shar: Extracting \"'daemon.c'\" \(1146 characters\)
sed "s/^X//" >'daemon.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X * daemon.c -- sleep for awhile, then do a turn
X */
X
X#include "tweakables.h"
X#include "files.h"
X#include <stdio.h>
X#include <signal.h>
X#include <time.h>
X#include <sys/types.h>
X#include <sys/timeb.h>
X#include <sys/file.h>
X#include <sys/ioctl.h>
X
Xmain()
X{
X struct tm *t;
X long clk;
X int turn=0,update=0,fd2;
X FILE *fd;
X
X if (fork()) exit();		/* detach from shell */
X
X sigblock(SIGHUP|SIGINT|SIGQUIT);  /* ignore signal from owner logging out */
X
X
X  fd2 = open("/dev/tty", O_RDWR);	/* disassociate from tty */
X  ioctl(fd2, TIOCNOTTY, 0);
X  close(fd2);
X
X while (1) {
X
X   clk = time(0);
X   t = localtime(&clk);
X
X   printf("day %d,hour %d,min %d,sec %d\n",
X		t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
X
X   if ( (t->tm_hour % UPDATE_TIME)==0 && update!=t->tm_hour) {
X   	update = t->tm_hour;
X	doturn(0);	/* not from shell */
X	fd = fopen(PROFDATAFL, "a");
X	   clk = time(0);
X	   t = localtime(&clk);
X	fprintf(fd,"turn %d @ day %d,hour %d,min %d,sec %d, time=%d secs\n",
X		turn++, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, 
X		t->tm_min * 60 + t->tm_sec);
X	fclose(fd);
X   } else 
X	sleep(600);
X }
X
X}
END_OF_FILE
if test 1146 -ne `wc -c <'daemon.c'`; then
    echo shar: \"'daemon.c'\" unpacked with wrong size!
fi
# end of 'daemon.c'
fi
if test -f 'doturn.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doturn.h'\"
else
echo shar: Extracting \"'doturn.h'\" \(1235 characters\)
sed "s/^X//" >'doturn.h' <<'END_OF_FILE'
X/*
X * doturn.h -- various turn things we are keeping track of.
X * Galactic Bloodshed by Robert Chansky
X */
X
X
Xstruct stinfo {
X	short temp_add;	/* addition to temperature to each planet */
X	unsigned Thing_add : BITS_MAXPLAYERS;	
X			/* new Thing colony on this planet */
X	unsigned amoeba_add : 1;	/* add amoeba on this planet */
X	unsigned inhab : 1;		/* explored by anybody */
X	unsigned intimidated : 1;	/* assault platform is here */
X} Stinfo[NUMSTARS][MAXPLANETS];
X
Xstruct sectinfo {
X	char explored;		/* sector has been explored */
X	unsigned VN : 1;	/* this sector has a VN */
X	unsigned done : 1;	/* this sector has been updated */
X} Sectinfo[MAX_X][MAX_Y];
X
Xextern char telegram_buf[AUTO_TELEG_SIZE];
Xextern float compatibility();
Xextern shiptype **ships;
Xextern planettype *planets[NUMSTARS][MAXPLANETS];
Xextern racetype *races[MAXPLAYERS];
Xextern us Sdatanumships[MAXPLAYERS];
Xextern ul Sdatapopns[MAXPLAYERS];
Xextern us starnumships[NUMSTARS][MAXPLAYERS];
Xextern ul starpopns[NUMSTARS][MAXPLAYERS];
Xextern float Compat[MAXPLAYERS];
Xextern int Num_races, Num_ships;
Xextern bool StarsInhab[NUMSTARS];
Xextern int tot_resdep, prod_eff, prod_res[MAXPLAYERS],
X	prod_fuel[MAXPLAYERS], prod_destruct[MAXPLAYERS], 
X	tot_captured, prod_mob;
X
END_OF_FILE
if test 1235 -ne `wc -c <'doturn.h'`; then
    echo shar: \"'doturn.h'\" unpacked with wrong size!
fi
# end of 'doturn.h'
fi
if test -f 'files.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'files.h'\"
else
echo shar: Extracting \"'files.h'\" \(1130 characters\)
sed "s/^X//" >'files.h' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X */
X
X
X#ifdef VER_4_3
X
X#  ifdef __STDC__			/* for ansi C compilers */
X#   define PATH(file) "/u2/vancleef/GB" #file
X#  else
X#   define PATH(file) "/u2/vancleef/GB/file"
X#  endif
X
X#else
X# ifdef VER_4_2
X
X#  ifdef __STDC__
X#   define PATH(file) "/u2/vancleef/GB" #file
X#  else
X#   define PATH(file) "/u2/vancleef/GB/file"
X#  endif
X
X# endif
X
X#endif
X
X#define PATHLEN		100	/* length of file paths to the game.. */
X
X#define PAGER		PATH(mor)
X#define DATADIR		PATH(Data)
X#define DOCS		PATH(Docs)
X#define EXAM_FL		PATH(exam.dat)
X#define ENROLL_FL	PATH(enroll.dat)
X
X#define DFILE(fl)	PATH(Data/fl)
X
X#define STARDATAFL 	DFILE(star)
X#define SECTORDATAFL 	DFILE(sector)
X#define PLANETDATAFL 	DFILE(planet)
X#define RACEDATAFL 	DFILE(race)
X#define SHIPDATAFL 	DFILE(ship)
X#define SHIPFREEDATAFL 	DFILE(shipfree)
X#define PLAYERDATAFL 	DFILE(players)
X#define TELEGRAMDIR 	DFILE(Tele)
X#define TELEGRAMFL 	DFILE(Tele/tele)
X#define PROFDATAFL	DFILE(spitup)
X#define POWFL		DFILE(power)
X#define LOCK_ALL 	DFILE(LOCK)
X
X
X#define PLAYER_GOD "vancleef"
X#define GOD_PASSWORD "god"
X#define PLAYER_GROUP_ID 937
X
END_OF_FILE
if test 1130 -ne `wc -c <'files.h'`; then
    echo shar: \"'files.h'\" unpacked with wrong size!
fi
# end of 'files.h'
fi
if test -f 'get4args.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'get4args.c'\"
else
echo shar: Extracting \"'get4args.c'\" \(500 characters\)
sed "s/^X//" >'get4args.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X */
X
Xget4args(s,xl,xh,yl,yh) 
Xchar *s;
Xint *xl,*xh,*yl,*yh;
X{
Xchar *p,s1[17],s2[17];
X  p=s;
X
X  sscanf(p,"%[^,]",s1);
X  while ( (*p!=':') && (*p!=',') ) p++;
X  if (*p==':') {
X	sscanf(s1,"%d:%d",xl,xh);
X  	while (*p!=',') p++;
X  }
X  else if (*p==',') {
X	sscanf(s1,"%d",xl);
X	*xh=(*xl);
X  }
X
X  sscanf(p,"%s",s2);
X  while ( (*p!=':') && (*p!='\0') ) p++;
X  if (*p==':') {
X	sscanf(s2,",%d:%d",yl,yh);
X  }
X  else {
X	sscanf(s2,",%d,",yl);
X	*yh=(*yl);
X  }
X
X}
END_OF_FILE
if test 500 -ne `wc -c <'get4args.c'`; then
    echo shar: \"'get4args.c'\" unpacked with wrong size!
fi
# end of 'get4args.c'
fi
if test -f 'help.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'help.c'\"
else
echo shar: Extracting \"'help.c'\" \(995 characters\)
sed "s/^X//" >'help.c' <<'END_OF_FILE'
X
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X * help.c -- help on certain topics
X */
X
X#include "tweakables.h"
X#include "files.h"
Xextern int God;
X
Xhelp(APcount, argn,args)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
X char s[MAXCOMMSTRSIZE];
X
X if (argn==1) {
X	printf("usage: help [topic]\n");
X	printf("    valid topics are:\n  concepts:\n%s",
X		"help    scope   actionpoints   explore    news    install\n" );
X	printf("daemon\n");
X	printf("\n  commands:\n");
X	printf("cs       map      survey  orbit      zoom      \nautoreport\n\n");
X	printf("build    ship     stock   report     tactical  order     examine\n");
X	printf("land     launch   dock    undock     load      assault   scrap\n\n");
X	printf("assault  fire     enslave\n\n");
X	printf("declare  telegram read    profile    relation    power   explore\n");
X	printf("name     mobilize\n\n");
X	if (God)
X		printf("makeuniv  fix    god\n");
X  } else {
X    sprintf(s,"%s %s/%s*", PAGER, DOCS, args[1] );
X    system(s);
X  }
X
X}
END_OF_FILE
if test 995 -ne `wc -c <'help.c'`; then
    echo shar: \"'help.c'\" unpacked with wrong size!
fi
# end of 'help.c'
fi
if test -f 'perm.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'perm.c'\"
else
echo shar: Extracting \"'perm.c'\" \(951 characters\)
sed "s/^X//" >'perm.c' <<'END_OF_FILE'
X
X
X/*
X * Galactic Bloodshed (Robert Chansky, smq@ucscb.ucsc.edu)
X * perm.c -- randomly permute a sector list
X */
X
X#include "vars.h"
X
Xstruct map {
X	char x,y;
X} xymap[(MAX_X+1) * (MAX_Y+1)];
X
X
X/* make a random list of sectors. */
XPermuteSects(planet)
Xplanettype *planet;
X{
Xregister int i,j,x,y,t;
Xstruct map sw;
X
X  t = planet->Maxy*planet->Maxx;
X
X  for (i=x=y=0; i<t; i++) {
X	xymap[i].x = x;
X	xymap[i].y = y;
X	if (++x >= planet->Maxx)
X		x=0,y++;
X  }
X  for (i=0; i<t; i++) {
X  	sw = xymap[i];
X	xymap[i] = xymap[j = int_rand(0,t - 1)];
X	xymap[j] = sw;
X  }
X
X}
X
X
X/* get the next x,y sector in the list.  if r=1, reset the counter.
X**  increments the counter & returns whether or not this reset it to 0.
X*/
X
Xint Getxysect(p,x,y,r)
Xreg planettype *p;
Xreg int *x,*y,r;
X{
X  static int getxy,max;
X
X  if (r) {
X	getxy = 0;
X	max = p->Maxx * p->Maxy;
X  } else {
X	  *x = xymap[getxy].x;
X	  *y = xymap[getxy].y;
X	  if (++getxy > max)
X		getxy = 0;
X  }
X  return getxy;
X}
END_OF_FILE
if test 951 -ne `wc -c <'perm.c'`; then
    echo shar: \"'perm.c'\" unpacked with wrong size!
fi
# end of 'perm.c'
fi
if test -f 'power.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'power.c'\"
else
echo shar: Extracting \"'power.c'\" \(1181 characters\)
sed "s/^X//" >'power.c' <<'END_OF_FILE'
X
X
X/*
X * Galactic Bloodshed (Robert Chansky, smq@ucscb.ucsc.edu)
X * power.c -- display power report
X */
X
X#include "vars.h"
X#include "races.h"
X#include "power.h"
X#include <errno.h>
Xextern int errno;
Xextern int God;
X
Xpower(APcount, argn,args)
Xint APcount, argn;
Xchar *args[];
X{
Xregister int i,n;
Xint power_fd;
Xracetype *r;
Xstruct power p[MAXPLAYERS];
X
X  if (argn>1) {
X	printf("usage: power\n");
X	return;
X  }
X
X  printf("         ========== Galactic Bloodshed Power Report ==========\n");
X  printf(" #  Name               sects   popn eff mob #shp #plan    res   fuel   dest\n");
X
X  if ( (power_fd = open(POWFL, O_RDONLY, 0777)) < 0) {
X	  perror("open power data");
X  } else {
X	  read(power_fd, (char *)p, sizeof(*p)*MAXPLAYERS);
X	  close(power_fd);
X
X	  n = Numraces();
X	  for (i=1; i<=n; i++) {
X		  getrace(&r,i);
X		  printf("%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u\n", 
X			i, r->name,
X			p[i].sectors_owned, p[i].popn, 
X			p[i].sectors_owned ? 
X				(float)p[i].sum_eff/p[i].sectors_owned : 0.0,
X			p[i].sectors_owned ? 
X				(float)p[i].sum_mob/p[i].sectors_owned : 0.0,
X			p[i].ships_owned, p[i].planets_owned,
X			p[i].resource, p[i].fuel, p[i].destruct);
X		  free(r);
X	  }
X  }
X}
END_OF_FILE
if test 1181 -ne `wc -c <'power.c'`; then
    echo shar: \"'power.c'\" unpacked with wrong size!
fi
# end of 'power.c'
fi
if test -f 'power.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'power.h'\"
else
echo shar: Extracting \"'power.h'\" \(323 characters\)
sed "s/^X//" >'power.h' <<'END_OF_FILE'
X
X
X	/* for power report */
Xstruct power {
X	ul popn;	/* total population */
X	ul resource;	/* total resource in stock */
X	ul fuel;
X	ul destruct;	/* total dest in stock */
X	us ships_owned;	/* # of ships owned */
X	us planets_owned;
X	ul sectors_owned;
X	ul sum_mob;	/* total mobilization */
X	ul sum_eff;	/* total efficiency */
X};
END_OF_FILE
if test 323 -ne `wc -c <'power.h'`; then
    echo shar: \"'power.h'\" unpacked with wrong size!
fi
# end of 'power.h'
fi
if test -f 'races.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'races.h'\"
else
echo shar: Extracting \"'races.h'\" \(888 characters\)
sed "s/^X//" >'races.h' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X */
X
Xstruct race {
X    float tech;		/* technology */
X    float birthrate;
X    float overbirthrate;
X    percent fighters;
X    percent IQ;
X    percent number_sexes;
X    float mass;
X    float metabolism;
X    float nonhomebodies;
X    char conditions[OTHER+1];	/* planetary conditions you like */
X    char homelevel,homesystem,homeplanetnum;	/* home place */
X    char deflevel,defsystem,defplanetnum;	/* current default */
X    int Playernum;
X    char name[RNAMESIZE];
X    float likes[DES_PLATED+1];		/* what territories they like */
X    char likesbest;
X    percent translate[MAXPLAYERS];	/* translation mod for ea player */
X    char atwar[howmanybytes(MAXPLAYERS)];	/* war */
X    char allied[howmanybytes(MAXPLAYERS)];	/* allies */
X    unsigned Thing : 1;			/* your race is like "The Thing" */
X};
X
Xtypedef struct race racetype;
Xracetype *Race;
END_OF_FILE
if test 888 -ne `wc -c <'races.h'`; then
    echo shar: \"'races.h'\" unpacked with wrong size!
fi
# end of 'races.h'
fi
if test -f 'rand.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rand.c'\"
else
echo shar: Extracting \"'rand.c'\" \(765 characters\)
sed "s/^X//" >'rand.c' <<'END_OF_FILE'
X/*
X** Galactic Bloodshed (Robert Chansky, smq@b)
X**   Random number generator
X**
X**	float float_rand() this returns a random number between 0 and 1
X**
X**	int int_rand(low,hi) -	this returns an integer random number
X**				between hi and low, inclusive.
X**
X**	int round_rand(float) - returns float rounded to integer, with
X**				proportional chance of rounding up or
X**				down.
X**
X**	int rposneg() - either -1 or 1
X*/
X
X
Xlong random();
X
X
Xfloat float_rand()
X{
X	return random()/ 2147483648.0;
X}
X
Xint int_rand(low,hi)
Xregister int low,hi;
X{
X    return( (hi<=low) ? low : (random() % (hi - low + 1)) + low );
X}
X
X
Xint round_rand(x)
Xregister float x;
X{
X  return ( (float_rand() > (x-(int)x)) ? (int)x : (int)(x+1) );
X}
X
Xint rposneg()
X{
X  return( (random()%1) ? -1 : 1 );
X}
END_OF_FILE
if test 765 -ne `wc -c <'rand.c'`; then
    echo shar: \"'rand.c'\" unpacked with wrong size!
fi
# end of 'rand.c'
fi
if test -f 'relation.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'relation.c'\"
else
echo shar: Extracting \"'relation.c'\" \(550 characters\)
sed "s/^X//" >'relation.c' <<'END_OF_FILE'
X/* relation.c -- state relations among players 
X *  Galactic Bloodshed -- author:smq@ssyx
X */
X
X#include "vars.h"
X#include "races.h"
X
Xrelation(APcount, argn, args)
Xint APcount, argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xint numraces;
Xreg int i;
Xracetype *r;
X
X numraces = Numraces();
X   for (i=1; i<=numraces; i++)
X	if (i != Race->Playernum) {
X		getrace(&r, i);
X		printf("%2d (%3d%%) %20.20s : %s\n", i, Race->translate[i],
X			r->name,
X			isset( Race->atwar, i) ? "war!" :
X			   isset( Race->allied, i) ? "alliance" :
X			   "neutral" );
X		free(r);
X	}
X
X}
END_OF_FILE
if test 550 -ne `wc -c <'relation.c'`; then
    echo shar: \"'relation.c'\" unpacked with wrong size!
fi
# end of 'relation.c'
fi
if test -f 'ship.dat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ship.dat'\"
else
echo shar: Extracting \"'ship.dat'\" \(1164 characters\)
sed "s/^X//" >'ship.dat' <<'END_OF_FILE'
XSpore pod
X~
XShuttle
X~
XComsat
X~
XBattleship
X~
XDestroyer
X~
XFighter
X~
XCargo ship
X~
X     \_|_/
X    ---|---
X    |     |   
X  \ |  |  | /
X   \|  |  |/ 
X    |     |
X    |     |
X | /   |   \ |
X-+-| --+-- |-+- 
X | \   |   / |
X    |     |
X   /|  |  |\
X  | |  |  | |
X   \|  |  |/
X    |     |
X    -[ _ ]-
X      ^ ^
XExplorer
X~
XTanker
X~
XStation
X~
X       ___     Control center-\\___                  __
X __   /  _|   ____             /   \____      ____  // Phased-meson phalanx
X>==\ / // | =/    \!! !! !! !!/^   /    \=   /    \=   
X\---------------------------------------------------
X   | []  []    []    []   []    [] []  []  []  []|   <-- fighter bays
X/---------------------------------------------------
X>==/=\____/ !! ! !!  !!! ! ! !!!! !! !!  !\____/=
X---        _//
X H2 missles
XOrbital Assault Platform
X~
XDreadnaught
X~
XMithril Ship
X~
XCrystal Ship
X~
XGODSHIP
X~
X    |   
X  \-|-/
X--|-=-|--
X  /-|-\
X    |   
XSpace mine
X~
XSpace mirror
X~
XAtmosphere processor
X~
XCanister of dust
X~
XV.Neumann machine
X~
XPlanet bomb
X~
Xcloaking device
X~
Xemotion suppressor
X~
XAmulet of Yendor
X~
Xbiological weapon
X~
Xgamma ray laser
X~
XSpace Amoeba
X~
Xaudio-vibatory-physio-molecular transport device
X~
END_OF_FILE
if test 1164 -ne `wc -c <'ship.dat'`; then
    echo shar: \"'ship.dat'\" unpacked with wrong size!
fi
# end of 'ship.dat'
fi
if test -f 'sizes.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sizes.c'\"
else
echo shar: Extracting \"'sizes.c'\" \(898 characters\)
sed "s/^X//" >'sizes.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@ssyx)
X */
X
X#include "vars.h"
X#include "ships.h"
X#include "races.h"
X#include "power.h"
Xstruct power P[MAXPLAYERS];
Xmain() {
X printf(" size startype is %d\n",sizeof(startype));
X printf(" size planettype is %d\n",sizeof(planettype));
X printf(" size shiptype is %d\n\n",sizeof(shiptype));
X
X printf(" size racetype is %d\n",sizeof(racetype));
X printf(" size placetype is %d\n",sizeof(placetype));
X printf(" size ordertype is %d\n",sizeof(ordertype));
X printf(" size struct plinfo is %d\n\n",sizeof(struct plinfo));
X printf(" size struct power [15] is %d\n\n",sizeof(P));
X
X printf(" size sectortype is %d\n",sizeof(sectortype));
X
X printf(" size long = %d\n",sizeof(long) );
X printf(" size int = %d\n",sizeof(int) );
X printf(" size short = %d\n",sizeof(short) );
X printf(" size double = %d\n",sizeof(double) );
X printf(" size float = %d\n",sizeof(float) );
X}
END_OF_FILE
if test 898 -ne `wc -c <'sizes.c'`; then
    echo shar: \"'sizes.c'\" unpacked with wrong size!
fi
# end of 'sizes.c'
fi
if test -f 'teleg_send.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'teleg_send.c'\"
else
echo shar: Extracting \"'teleg_send.c'\" \(1466 characters\)
sed "s/^X//" >'teleg_send.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@ssyx)
X *	teleg_send.c -- does the work of sending a telegram
X */
X
X
X#include "tweakables.h"
X#include "files.h"
X#include <stdio.h>
X#include <ctype.h>
X#include <strings.h>
X#include <errno.h>
X#include <signal.h>
X#include <sys/file.h>
X#include <sys/time.h>
Xlong tm;
Xchar *ctime();
X
X
Xteleg_send(sender, recpient, msg)
Xchar sender, recpient;
Xchar *msg;
X{
X char telefl[100],tmbuf[50], numcodes;
X int mask;
X FILE *telegram_fd;
X register int i,t;
X
X mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
X		/* block interrupts from keyboard */
X
X sprintf(telefl, "%s.%d",TELEGRAMFL, recpient );
X if ((telegram_fd = fopen( telefl, "a" ))==NULL) {
X	perror("teleg_send");
X } else {
X
X		/* write player number */
X  fputc(sender, telegram_fd);
X
X
X		/* write current time */
X  tm = time(0);
X  fprintf( telegram_fd, "%s", ctime(&tm) );
X
X		/* write the telegram */
X  do {
X	if (isspace(*msg)) {
X		fprintf(telegram_fd, "%c%c", *msg, int_rand(1,99));
X	} else
X		fputc(*msg, telegram_fd);
X  } while (*(msg++) != '\0');
X
X  fprintf(telegram_fd, "\n%c", TELEG_DELIM);
X  fclose(telegram_fd);
X
X }
X sigsetmask(mask);	/* reset mask */
X
X}
X
X
X
X	/* for autoreport; send '\0' to initialize */
Xteleg_add(string,buf)
Xchar *string,*buf;
X{
Xstatic int telegram_ctr = 0;
X		/* what character of the telegram buffer we're on */
X
X if (*string=='\0') {
X	buf[0] = '\n';
X	telegram_ctr = 1;
X } else {
X    strcpy(buf + telegram_ctr, string);
X    telegram_ctr += strlen(string);
X }
X}
END_OF_FILE
if test 1466 -ne `wc -c <'teleg_send.c'`; then
    echo shar: \"'teleg_send.c'\" unpacked with wrong size!
fi
# end of 'teleg_send.c'
fi
if test -f 'traverse.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'traverse.c'\"
else
echo shar: Extracting \"'traverse.c'\" \(451 characters\)
sed "s/^X//" >'traverse.c' <<'END_OF_FILE'
X#include "vars.h"
X
Xmain()
X{
X int stardata, pdata;
X reg int star,i;
X planettype *p;
X
X openstardata(&stardata);
X getsdata(stardata,&Sdata);
X openpdata(&pdata);
X for (star=0; star<Sdata.numstars; star++) {
X 	getstar(stardata, &Stars[star], star);
X 	for (i=0; i<Stars[star]->numplanets; i++) {
X    	   getplanet(pdata,&p,Stars[star]->planetpos[i]);
X	   printf("st %d pl %d mappos %d\n", star,i, p->sectormappos);
X	}
X }
X close(stardata);
X close(pdata);
X
X}
END_OF_FILE
if test 451 -ne `wc -c <'traverse.c'`; then
    echo shar: \"'traverse.c'\" unpacked with wrong size!
fi
# end of 'traverse.c'
fi
if test -f 'zoom.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'zoom.c'\"
else
echo shar: Extracting \"'zoom.c'\" \(558 characters\)
sed "s/^X//" >'zoom.c' <<'END_OF_FILE'
X
X
X/*
X * Galactic Bloodshed (Robert Chansky, smq@ucscb.ucsc.edu)
X * zoom.c -- zoom in or out for orbit display
X */
X
X#include "vars.h"
X
X
Xzoom(APcount, argn,args)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
X float num,denom;
X
X if (argn!=2) {
X	printf("usage: zoom (amount) or zoom (x/y)\n");
X } else {
X    if (sscanf(args[1], "%f/%f", &num, &denom) == 2) {
X	/* num/denom format */
X	Dir.zoom = num / denom;
X    } else {
X	/* one number */
X	Dir.zoom = num;
X    }
X }
X printf("Zoom value %g, lastx = %g, lasty = %g.\n",Dir.zoom,Dir.lastx,Dir.lasty);
X
X}
END_OF_FILE
if test 558 -ne `wc -c <'zoom.c'`; then
    echo shar: \"'zoom.c'\" unpacked with wrong size!
fi
# end of 'zoom.c'
fi
echo shar: End of archive 8 \(of 8\).
cp /dev/null ark8isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 8 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