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

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

Submitted-by: VANCLEEF@mps.ohio-state.edu
Posting-number: Volume 10, Issue 13
Archive-name: gb3/Part13
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 13 (of 14)."
# Contents:  Docs/actionpoints.doc Docs/capitol.doc Docs/capture.doc
#   Docs/land.doc Docs/load.doc Docs/mobilize.doc Docs/modify.doc
#   Docs/move.doc Docs/newrepair.doc Docs/read.doc Docs/scope.doc
#   Docs/tactical.doc Docs/technology.doc Makefile
#   client/TinyMUD_copyright.h client/map.c client/ultrix_cpt.h
#   client/util.c client/wrap.c server/TinyMUD_copyright.h
#   server/doturn.h server/files.h server/files_rw.c
#   server/files_rw_update.c server/perm.c server/rand.c
#   server/read_teleg.c server/ship.dat server/sizes.c
#   server/teleg_send.c server/toxicity.c server/ultrix_cpt.h
#   server/welcome.txt server/zoom.c
# Wrapped by billr@saab on Fri Jun  1 11:53:46 1990
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'\" \(1559 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) / 3000 + 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
XFor convenience, here is a list of action points that each of the commands
Xuse:
X
X	0 Action Points -
X		autoreport, survey, cs, help, map, orbit, profile,
X		relation, report, announce, stock, tactical, ship,
X		object, power, page, zoom, exploration.
X
X	1 Action Point -
X		assault, dock, fire, land, launch, load, mobilize,
X		build, name, order, launch, declare, scrap, examine,
X
X	2 Action Points -
X		enslave, technology
X
X
XSEE ALSO
X  cs
X
END_OF_FILE
if test 1559 -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/capitol.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/capitol.doc'\"
else
echo shar: Extracting \"'Docs/capitol.doc'\" \(1107 characters\)
sed "s/^X//" >'Docs/capitol.doc' <<'END_OF_FILE'
XCAPITOL			Galactic Bloodshed			CAPITOL
X
X
XNAME
X  [50] capitol -- designate the new seat of government
X
XSYNOPSIS
X       capitol [#shipnum]
X
XDESCRIPTION
X
X	Your capitol is a "Governmental Center" ship which produces action 
Xpoints as the workings of a government.  It is possible to maintain more than
Xone governmental center in your empire for use as backups in case something
Xshould happen to your capitol (of course, they are very expensive).
X
X	Without a capitol, no AP's will be produced.  Also if the capitol
Xis damaged or understaffed the government will experience a slowdown
Xin proportion to its handicap.  If the capitol is not landed on a planet,
Xaction point production will stop completely until it is again installed
Xon a planet.
X
X	The 50 APs are deducted from wherever scope happens to be at the
Xmoment; this is to facilitate the huge amount that has to be deducted.
X
X	If no argument is specified, the current efficiency of your capitol
Xis displayed.  This is proportional to the number of crew (officials working
Xin the capitol) and the damage of the capitol.
X
X
XSEE ALSO
X  actionpoints, exam <Q>
END_OF_FILE
if test 1107 -ne `wc -c <'Docs/capitol.doc'`; then
    echo shar: \"'Docs/capitol.doc'\" unpacked with wrong size!
fi
# end of 'Docs/capitol.doc'
fi
if test -f 'Docs/capture.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/capture.doc'\"
else
echo shar: Extracting \"'Docs/capture.doc'\" \(999 characters\)
sed "s/^X//" >'Docs/capture.doc' <<'END_OF_FILE'
XCAPTURE			Galactic Bloodshed			CAPTURE
X
X
XNAME
X  capture [1] -- Order population to attempt to seize an alien ship
X		landed in the same sector. 
X
XSYNTAX
X    capture <#shipno> <boarders>
X
XDESCRIPTION
X
X   This command is similar to the 'assault' command and the aggressive
X'move' command. The player designates which landed alien ship he wishes
Xassault. If the sector where the ship is located is occupied by the player, 
Xthe combat strengths of the player (attacker) and alien (defender) are
Xcomputed. The combat strengths depend on number of beings, fighting
Xability, sector mobilizations, sector terrain and technology of the
Xraces as well as ship sizes and armor. The assault is evaluated and casualties 
Xare removed from each defender and attacker.
X
X	Defense strengths of terrain:
X		land  = 1
X		sea   = 1
X		mount = 3    wasted = 0
X		gas   = 2
X		ice   = 2
X		plate = 4
X
X   This command cannot be used on planets that have been enslaved to another
Xplayer.
X
XSEE ALSO
X assault, enslave, relation, move
END_OF_FILE
if test 999 -ne `wc -c <'Docs/capture.doc'`; then
    echo shar: \"'Docs/capture.doc'\" unpacked with wrong size!
fi
# end of 'Docs/capture.doc'
fi
if test -f 'Docs/land.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/land.doc'\"
else
echo shar: Extracting \"'Docs/land.doc'\" \(1010 characters\)
sed "s/^X//" >'Docs/land.doc' <<'END_OF_FILE'
XLAND			Galactic Bloodshed		LAND
X
X
XNAME
X  [1] land -- land a ship
X 
XSYNTAX
X      land <#shipnum> <x,y>
X
XDESCRIPTION
X  This command lands ships on planets.  To do so the ship must be
Xcloser than 10 distance units away from the planet it is orbiting.  Land
Xwill prompt the player for what sector on which to land.
X
X  This maneuver costs an amount of fuel proportional to the mass of the
Xship and the gravitational field of the planet below.  If the ship does not
Xhave enough fuel it will crash.  This will give damage to the planet in
Xproportion to the mass of the ship, the gravitational field of the planet, and
Xthe amount of destructive capacity the ship happens to be carrying.
X
X  A player's ships can not land on sectors on which that player has a
Xcompatibility index of 0; for instance, a race that prefers mountain sectors
Xcannot land on water or gasgiant sectors, and vice versa.  Information on
Xsector compatibility can be found in the profile command.
X
X
XSEE ALSO
X  dock, launch, undock, profile, colony
END_OF_FILE
if test 1010 -ne `wc -c <'Docs/land.doc'`; then
    echo shar: \"'Docs/land.doc'\" unpacked with wrong size!
fi
# end of 'Docs/land.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'\" \(1614 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> <commodity> <amount>
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|c|r|f -- specify destructive potential, crew, 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. If no amount argument is
Xspecify, the maximum available of the commodity will be loaded on board.
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
X  If the ship is docked, and the other ship does not belong to the player,
Xhe/she can only send commodities, not receive them.  He cannot send crew
Xmembers at all (the other's life support is not compatible).
X
END_OF_FILE
if test 1614 -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/mobilize.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/mobilize.doc'\"
else
echo shar: Extracting \"'Docs/mobilize.doc'\" \(1346 characters\)
sed "s/^X//" >'Docs/mobilize.doc' <<'END_OF_FILE'
XMOBILIZE		Galactic Bloodshed			MOBILIZE
X
X
XNAME
X  mobilize [1] -- Increase military mobilization in sectors
X
XSYNOPSIS
X    mobilize <new quota>
X
XDESCRIPTION
X
X  This command sets quotas for mobilization in sectors, for the production
Xof ``destructive capacity'' which represents weapons in GB.
X
X  The ``mobilization'' of a sector represents its military readiness; the
Xgreater the percentage (up to 100), the higher the mobilization.  
XSectors that are mobilized produce quantities of destructive capacity
Xaccording to the degree of mobilization, the amount of population, and the
Xamount of resource deposits in the sector.
X
X  As a side effect, Because the sectors being mobilized have to be hardened
Xand citizens given training in the military arts, the sector will become
Xmuch more resistant to any attack than an un-mobilized one.  
X
X  This command only sets a quota, it does not do any actual work.  
XMobilization will be built up by the citizenry a small amount at a time
X(the rate will be proportional to the population of each sector and
Xthe resource deposits there) as the population works to organize things
Xand set up factories and shelters and so forth.  Each mobilization point
Xon each sector costs 0.01 resource points to produce.  This amount is
Xdeducted from the resource points available on the planet.
X
X
XSEE ALSO
X map, census, fire
END_OF_FILE
if test 1346 -ne `wc -c <'Docs/mobilize.doc'`; then
    echo shar: \"'Docs/mobilize.doc'\" unpacked with wrong size!
fi
# end of 'Docs/mobilize.doc'
fi
if test -f 'Docs/modify.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/modify.doc'\"
else
echo shar: Extracting \"'Docs/modify.doc'\" \(1293 characters\)
sed "s/^X//" >'Docs/modify.doc' <<'END_OF_FILE'
XMODIFY			Galactic Bloodshed			MODIFY
X
X
XNAME
X  modify -- modify attributes of a ship being designed at a factory.
X
XSYNTAX
X  modify <attribute> <value>
X
XDESCRIPTION
X  
X   Once a ship design has been specified for a factory, you may alter
Xthe design attributes to suit your needs. Each attribute is compared to
Xthe 'standard' design and a cost for producing the ship is evaluated
Xbased on these attributes. Specifically, the following attributes may
Xbe altered:
X	armor, guns, size, crew, fuel, cargo, destruct, speed.
X
X   The modify command reports the current cost of producing the ship
Xtype at the factory. Basically, the cost of producing the ship is 
Xdetermined, after evaluating the total 'advantage' and total
X'disadvantage', by
X		(cost) = (base cost) * ( 1 + advantage ) / ( 1 + disadvantage ).
XAn advantage/disadvantage is computed, for each modifiable attribute,
Xby	( (new value) + 1) / ( (standard value) + 1) - 1.
XFor each attribute, if this number is positive it is considered to be an
X'advantage' and if it is negative, the absolute value of it is considered
Xto be a 'disadvantage'.
X
X   A base mass is also computed, the mass of the ship with nothing loaded 
Xon board. Each point of armor has a mass of 1 while each gun and point 
Xof size has a mass of 1/10.
X
X
XSEE ALSO
X	make, build
END_OF_FILE
if test 1293 -ne `wc -c <'Docs/modify.doc'`; then
    echo shar: \"'Docs/modify.doc'\" unpacked with wrong size!
fi
# end of 'Docs/modify.doc'
fi
if test -f 'Docs/move.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/move.doc'\"
else
echo shar: Extracting \"'Docs/move.doc'\" \(1225 characters\)
sed "s/^X//" >'Docs/move.doc' <<'END_OF_FILE'
XMOVE			Galactic Bloodshed			MOVE
X
X
XNAME
X  move [1] -- Move population from one sector to another. 
X
XSYNTAX
X    move <from sector x,y> <to sector x,y> <number of population>
X
XDESCRIPTION
X
X   This command is used to move population from one sector to an adjacent
Xsector. The player enters the origination sector, target sector, and the
Xamount of population to move. If no population argument is given, all
Xpopulation in the original sector will be moved. If the destination
Xsector is occupied by aliens, the combat strengths of the player (attacker) 
Xand alien (defender) are computed. The combat strengths depend on number of 
Xbeings, fighting ability, sector mobilizations, sector terrain and technology 
Xof the races. The assault is evaluated and casualties are removed from
Xeach sector.
X
X   If mesomorphic races are involved in the combat, and are victorious,
Xby either taking the assaulted sector or repulsing an attack, they may
Xabsorb alien bodies, adding to their own numbers.
X
X	Defense strengths of terrain:
X		land  = 1
X		sea   = 1
X		mount = 3    wasted = 0
X		gas   = 2
X		ice   = 2
X		plate = 4
X
X   This command cannot be used on planets that have been enslaved to another
Xplayer.
X
XSEE ALSO
X assault, enslave, relation
END_OF_FILE
if test 1225 -ne `wc -c <'Docs/move.doc'`; then
    echo shar: \"'Docs/move.doc'\" unpacked with wrong size!
fi
# end of 'Docs/move.doc'
fi
if test -f 'Docs/newrepair.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/newrepair.doc'\"
else
echo shar: Extracting \"'Docs/newrepair.doc'\" \(1637 characters\)
sed "s/^X//" >'Docs/newrepair.doc' <<'END_OF_FILE'
X***************************************************************
X
XHere is how the new repair of ships works: 
X   In order to repair x% damage on your ship you need
X
X          0.005  * x * (cost of ship)
X
X   resources on it. If you have those a maximum of 50% 
X   of damage will be repaired in one turn. If you have 
X   less, the damage repairs will be proportionally 
X   decreased. After having calculated how much repair
X   you can afford, the program checks how much crew you
X   have to do it. Again, a fully populated ship will
X   repair at maximum rate, with proportional 
X   decreases when you have fewer people.
X
X   In order to make this feasible, the cargo capacity
X   of the ships has been increased by 1/2 the cost 
X   of the ship. This means that you can repair 100% of 
X   damage (of course you can't repair a destroyed ship)
X   before reloading.
X
X   Sometime in the future, I will set
X   the repair such that a random percentage of damage
X   is inflicted aoutomatically each turn (0-5%). This
X   damage is due to normal wear and tear. You will have 
X   to stockpile your ships sufficiently in order to 
X   keep them in shape and you will have to resupply
X   them whne you send them half across the galaxy.
X   Right now this would be tedious, so i will implement 
X   a 'reful' command, which will 'beam' resources, 
X   destruct and fuel between two ships within 500
X   distance units. It will automatically load 
X   100% of resources, 100% of fuel and 100% of dest
X   from one ship to the other. Wait for news on this
X   it is not operational yet.  Good Luck.
X
X****************************************************************
X
END_OF_FILE
if test 1637 -ne `wc -c <'Docs/newrepair.doc'`; then
    echo shar: \"'Docs/newrepair.doc'\" unpacked with wrong size!
fi
# end of 'Docs/newrepair.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/scope.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/scope.doc'\"
else
echo shar: Extracting \"'Docs/scope.doc'\" \(1663 characters\)
sed "s/^X//" >'Docs/scope.doc' <<'END_OF_FILE'
Xscope			Galactic Bloodshed			scope
X
X
XCONCEPT: scope
X
X  Scope represents the ``operative scope'' of certain commands.  The
Xoperative scope (displayed along with AP's in the user's prompt, and changed
Xwith ``cs'') is similar to the tree-like directory level structure found in
Xmost computer systems, with the ``root'' directory being a ``universe''
Xscope followed by the various stars, followed by the planets orbiting these
Xstars.  The scope can also represent a single ship.
X
X  Commands are affected by the scope in a different manner than that which
Xoperating systems treat their directory structure.  For example, if
Xthe current scope is that of a star, the command ``order'', if given with
Xno arguments, will prompt for orders for each ship orbiting that
Xstar and each planet in that system.  If the scope was the ``universal''
Xscope, order would prompt for each ship everywhere that the player owns.
X
X  Many commands will work very differently, or not at all in certain scopes.
X
X  The syntax of a scope, when prompted for, is thus:
X
X	path = ``:'' | ``#shipnum'' | ``/path'' | ``../path'' | name | 
X		 ``path/name''
X
X  The shell will interpret a ``:'' as meaning the object of the current
Xscope (star, planet, or ship).
X
X  A ``/'' at the beginning of the string represents the root.  It could be
Xfollowed by a star name, or not, to represent the upper, interstellar, level.
X
X  A ``..'' or ``.'' represents the scope just above the current scope.
X
X  ``#shipnum'' represents that ship.  A number by itself will be
Xinterpreted as meaning a star or planet name.
X
X  Specifying a name means to move down to that star or planet.
X
X
XSEE ALSO
X  cs, order, actionpoints
X
END_OF_FILE
if test 1663 -ne `wc -c <'Docs/scope.doc'`; then
    echo shar: \"'Docs/scope.doc'\" unpacked with wrong size!
fi
# end of 'Docs/scope.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'\" \(944 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 or ship types>
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 944 -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/technology.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Docs/technology.doc'\"
else
echo shar: Extracting \"'Docs/technology.doc'\" \(904 characters\)
sed "s/^X//" >'Docs/technology.doc' <<'END_OF_FILE'
XTECHNOLOGY		Galactic Bloodshed			TECHNOLOGY
X
X
XNAME
X  technology [1] -- invest resource production into tech production
X
XSYNTAX
X    technology <resources from this planet per update>
X
XDESCRIPTION
X	This command sets an quota for technological investment.  Each turn,
Xeach race's intelligence/100 is added to its technology.  If your race is
Xdisadvantaged by a low IQ you can balance this discrepancy by investing more
Xof your production into research and development.
X	Each turn the quota is deducted from the planet's production (if
Xthere is enough) and added logarithmically to your race's total tech
Xproduction.  As you increase the quota on one planet, you will notice, the
Xactual tech production increases less and less; thus, it is important to have
Xa wider cultural base (lots of planets) for better tech development.
XThe tech growth per planet is 0.10*log10(1+investment)/turn.
X
XSEE ALSO
X 	profile
END_OF_FILE
if test 904 -ne `wc -c <'Docs/technology.doc'`; then
    echo shar: \"'Docs/technology.doc'\" unpacked with wrong size!
fi
# end of 'Docs/technology.doc'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(1503 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# Top level Makefile for GB by Bill Randle (billr@saab.cna.tek.com)
XMAKE = /bin/make
X
X# destination directories
X# GLIB should match the directory in the PATH macro of server/files.h
XGBIN = /usr/net/games
XGLIB = /usr/net/games/lib/GB
X
X# host and port definitions for network connection. If not defined,
X# defaults in client/GB_client.c and server/config.h will be used.
XHOST = \\\"saab.cna.tek.com\\\"
XPORT = 2010
XHP = -DGB_HOST=$(HOST) -DGB_PORT=$(PORT)
X
X# set UV to -DBSD4_2 for BSD 4.2 derived systems (e.g. SunOS 3.X) that
X# don't have tm_zone as a member of the "tm" struct (see <time.h>),
X# otherwise leave blank.
XUV = -DBSD4_2
X
Xall: GB_client GB_server
X
XGB_client:
X	@echo "cd client; make HP="$(HP)" UV="$(UV)" all"
X	@(cd client; $(MAKE) HP="$(HP)" UV="$(UV)" all)
X
XGB_server:
X	@echo "cd server; make HP="$(HP)" UV="$(UV)" all"
X	@(cd server; $(MAKE) HP="$(HP)" UV="$(UV)" all)
X
Xinstall:
X	$(MAKE) all
X	cp client/GB_client server/GB_enroll $(GBIN)
X	-mkdir $(GLIB) $(GLIB)/Docs
X	cp server/GB_server server/GB_daemon server/mor \
X		server/trav server/fix $(GLIB)
X	cp server/*.dat server/welcome.txt $(GLIB)
X	-cp Docs/* $(GLIB)/Docs
X	-compress $(GLIB)/Docs/*
X	#make clear
X	@echo 'cd server; makeuniv'
X	@(cd server; makeuniv)
X	make chmod
X
Xchmod:
X	cd $(GLIB)
X	chmod ag+xs GB_server GB_daemon
X	chmod g+rw Data/* Data/Tele/*
X	chmod a+r Docs/*
X	chmod g+r *.dat*
X	chmod a+x mor
X
Xclear:
X	@echo "cd client\; make clear"
X	@(cd client; $(MAKE) clear)
X	@echo "cd server\; make clear"
X	@(cd server; $(MAKE) clear)
END_OF_FILE
if test 1503 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'client/TinyMUD_copyright.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'client/TinyMUD_copyright.h'\"
else
echo shar: Extracting \"'client/TinyMUD_copyright.h'\" \(1413 characters\)
sed "s/^X//" >'client/TinyMUD_copyright.h' <<'END_OF_FILE'
X/* -*-C-*-
X
XCopyright (c) 1989 by David Applegate, James Aspnes, Timothy Freeman,
X		   and Bennet Yee.
X
XThis material was developed by the above-mentioned authors.
XPermission to copy this software, to redistribute it, and to use it
Xfor any purpose is granted, subject to the following restrictions and
Xunderstandings.
X
X1. Any copy made of this software must include this copyright notice
Xin full.
X
X2. Users of this software agree to make their best efforts (a) to
Xreturn to the above-mentioned authors any improvements or extensions
Xthat they make, so that these may be included in future releases; and
X(b) to inform the authors of noteworthy uses of this software.
X
X3. All materials developed as a consequence of the use of this
Xsoftware shall duly acknowledge such use, in accordance with the usual
Xstandards of acknowledging credit in academic research.
X
X4. The authors have made no warrantee or representation that the
Xoperation of this software will be error-free, and the authors are
Xunder no obligation to provide any services, by way of maintenance,
Xupdate, or otherwise.
X
X5. In conjunction with products arising from the use of this material,
Xthere shall be no use of the names of the authors, of Carnegie-Mellon
XUniversity, nor of any adaptation thereof in any advertising,
Xpromotional, or sales literature without prior written consent from
Xthe authors and Carnegie-Mellon University in each case. */
X
END_OF_FILE
if test 1413 -ne `wc -c <'client/TinyMUD_copyright.h'`; then
    echo shar: \"'client/TinyMUD_copyright.h'\" unpacked with wrong size!
fi
# end of 'client/TinyMUD_copyright.h'
fi
if test -f 'client/map.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'client/map.c'\"
else
echo shar: Extracting \"'client/map.c'\" \(1430 characters\)
sed "s/^X//" >'client/map.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. Restrictions in
X * GB_copyright.h. 
X *
X * map.c -- display sector map of current planet 
X */
X
X#include "GB_copyright.h"
X#define S_X (stdscr->_maxx - NAMESIZE)
X#define S_Y (stdscr->_maxy - 1)
X#define Midx ((S_X - NAMESIZE)/2.0)
X#define Midy (S_Y /2.0)
X#define DISP_DATA 1
X
X#include <curses.h>
X#include <stdio.h>
X
Xextern char    *index(), *malloc();
Xextern int	have_inv;
X
Xplot_surface(t)
X	char           *t;
X{
X	reg int         x, y;
X	int             stand, show;
X	int             Maxx, Maxy;
X	char           *u, *v;
X
X	clear();
X
X	u = t + 1;
X	/* get planet name */
X
X	v = index(u, ';');
X	*v = 0;
X
X	move(0, 9);
X	printw("`%s'\n   ", u);
X
X	u = v + 1;
X	v = index(u, ';');
X	*v = 0;
X	Maxx = atoi(u);
X
X	u = v + 1;
X	v = index(u, ';');
X	*v = 0;
X	Maxy = atoi(u);
X
X	u = v + 1;
X	v = index(u, ';');
X	*v = 0;
X	show = atoi(u);
X
X	for (x = 0; x < Maxx; x++)
X		printw("%d", x / 10);
X
X	printw("\n   ");
X
X	for (x = 0; x < Maxx; x++)
X		printw("%d", x % 10);
X
X	printw("\n");
X
X	u = v + 1;
X	for (y = 0; y < Maxy; y++) {
X		mvaddch(y + 3, 0, y / 10 + '0');
X		addch(y % 10 + '0');
X		for (x = 0; x < Maxx; x++) {
X
X			if (*u == '0')
X				stand = 0;
X			else
X				stand = 1;
X			u++;
X			if (stand * have_inv)
X				standout();
X			mvaddch(y + 3, x + 3, *u);
X			if (stand * have_inv)
X				standend();
X			u++;
X		}
X	}
X	move(Maxy + 4, 0);
X	refresh();
X}
END_OF_FILE
if test 1430 -ne `wc -c <'client/map.c'`; then
    echo shar: \"'client/map.c'\" unpacked with wrong size!
fi
# end of 'client/map.c'
fi
if test -f 'client/ultrix_cpt.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'client/ultrix_cpt.h'\"
else
echo shar: Extracting \"'client/ultrix_cpt.h'\" \(1574 characters\)
sed "s/^X//" >'client/ultrix_cpt.h' <<'END_OF_FILE'
X/*	@(#)ultrix_cpt.h 1.7 89/09/14 SMI	*/
X
X/* From the XView source distribution */
X/*
X * Ultrix 2.X, SunOS 3.X, BSD 4.2 Compatibility Header File
X *
X * This file provides a limited compatibility with older BSD variants
X * that do not provide macros for dealing with fd sets.
X *
X * BIG NOTE!!! This will only allow fd_sets of N bits , where N is
X * the size of an int.
X *
X */
X
X#ifndef xview_ultrix_compat_DEFINED
X#define xview_ultrix_compat_DEFINED
X
X#ifdef OLD_BSD_FDSETS
X
X#ifndef NBBY
X#define NBBY    8               /* number of bits in a byte */
X#endif
X
X#ifndef NFDBITS
X#define	NFDBITS	(sizeof(int) * NBBY)
X#define I_DEFINED_NFDBITS	/* register the fact that I defined this */
X#endif
X
X#ifndef FD_SETSIZE
X#define FD_SETSIZE	NFDBITS
X#define I_DEFINED_FDSETSIZE	/* register the fact that I defined this */
X#endif
X
X/*
X *	Here we assume that the only use of howmany(x, y) is 
X *	howmany(FD_SETSIZE, NFDBITS). If we defined both FD_SETSIZE and
X * 	NFDBITS, then we already know what howmany(x, y) will be: 1.
X *	If we did not define FD_SETSIZE and NFDBITS, then we'll have
X *	to calculate the value of howmany(x, y).
X */
X
X#if defined(I_DEFINED_FDSETSIZE) && defined(I_DEFINED_NFDBITS)
X#define howmany(x, y)	1
X#else
X#define howmany(x, y)	(((x)+((y)-1))/(y))
X#endif
X
X#define FD_SET(n, p)    ((p)->fds_bits[0] |= (1 << ((n) % NFDBITS)))
X#define FD_CLR(n, p)    ((p)->fds_bits[0] &= ~(1 << ((n) % NFDBITS)))
X#define FD_ISSET(n, p)  ((p)->fds_bits[0] & (1 << ((n) % NFDBITS)))
X#define FD_ZERO(p)      ((p)->fds_bits[0] = 0)
X
X#endif OLD_BSD_FDSETS
X
X#endif ~xview_ultrix_compat_DEFINED
END_OF_FILE
if test 1574 -ne `wc -c <'client/ultrix_cpt.h'`; then
    echo shar: \"'client/ultrix_cpt.h'\" unpacked with wrong size!
fi
# end of 'client/ultrix_cpt.h'
fi
if test -f 'client/util.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'client/util.c'\"
else
echo shar: Extracting \"'client/util.c'\" \(1480 characters\)
sed "s/^X//" >'client/util.c' <<'END_OF_FILE'
X/************************************************************************/
X/* TinyTalk utilities.							 */
X/* */
X/* Version 1.0 [ 1/24/90] : Initial implementation by ABR.		 */
X/* 1.1 [ 1/25/90] : Moved terminal control here.		 */
X/* 1.2 [ 1/25/90] : Modified to set termcap var 'ospeed'.	 */
X/* 1.3 [ 2/ 2/90] : Added comparestr() and hiliting.	 */
X/* 1.4 [ 2/ 5/90] : Added expand_filename() for $#@! UNIX. */
X/* Disable its fancy stuff because there  */
X/* are no shared libraries.		 */
X/* */
X/************************************************************************/
X
X#include "TinyMUD_copyright.h"
X#include "client.h"
X#include <sys/ioctl.h>
X#include <sgtty.h>
X#include <stdio.h>
X
X#ifdef TERMCAP
Xextern short    ospeed;
X#endif
X
Xcbreak_noecho_mode()
X{				/* When we're running... */
X	struct sgttyb   blob;
X
X	if (ioctl(0, TIOCGETP, &blob) == -1)
X		perror("TIOCGETP ioctl");
X	blob.sg_flags |= CBREAK;
X	blob.sg_flags &= ~ECHO;
X	if (ioctl(0, TIOCSETP, &blob) == -1)
X		perror("TIOCSETP ioctl");
X#ifdef TERMCAP
X	ospeed = blob.sg_ospeed;
X#endif
X}
X
Xcooked_echo_mode()
X{				/* When we exit... */
X	struct sgttyb   blob;
X
X	if (ioctl(0, TIOCGETP, &blob) == -1)
X		perror("TIOCGETP ioctl");
X	blob.sg_flags &= ~CBREAK;
X	blob.sg_flags |= ECHO;
X	if (ioctl(0, TIOCSETP, &blob) == -1)
X		perror("TIOCSETP ioctl");
X}
X
Xdie(why, s1, s2, s3, s4)
X	char           *why, *s1, *s2, *s3, *s4;
X{
X	cooked_echo_mode();	/* Reset terminal characteristics. */
X	fprintf(stderr, why, s1, s2, s3, s4);
X	exit(1);
X}
END_OF_FILE
if test 1480 -ne `wc -c <'client/util.c'`; then
    echo shar: \"'client/util.c'\" unpacked with wrong size!
fi
# end of 'client/util.c'
fi
if test -f 'client/wrap.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'client/wrap.c'\"
else
echo shar: Extracting \"'client/wrap.c'\" \(1535 characters\)
sed "s/^X//" >'client/wrap.c' <<'END_OF_FILE'
X/************************************************************************/
X/* TinyTalk word wrapping.						 */
X/* */
X/* Version 1.0 [ 1/24/90] : Initial implementation by ABR.		 */
X/* */
X/************************************************************************/
X
X#include "TinyMUD_copyright.h"
X#include "client.h"
X#include <stdio.h>
X
Xextern char    *rindex();
X
Xstatic int      current_wrap_column;
Xstatic int      default_wrap_column;
X
Xprint_with_wrap(s)
X	char           *s;
X{
X	hugestr         temp;
X	char           *place;
X	int             loc;
X
X	if (current_wrap_column == -1)
X		current_wrap_column = default_wrap_column;
X
X	if ((current_wrap_column == 0) || strlen(s) < current_wrap_column) {
X		puts(s);	/* No wrap. */
X		return;
X	}
X	strcpy(temp, s);
X	do {
X		temp[current_wrap_column] = '\0';
X		place = rindex(temp, ' ');
X		if (place == NULL) {	/* Can't wrap, give up */
X			puts(temp);
X			loc = current_wrap_column;
X		} else {
X			*place = '\0';	/* Terminate string */
X			puts(temp);	/* and output it. */
X			loc = place - temp + 1;
X		}
X		strcpy(temp, s + loc);	/* Rest of string. */
X		strcpy(s, temp);/* Should strip double spaces? */
X	} while (strlen(s) >= current_wrap_column);
X
X	if (strlen(s) != 0) {
X		puts(s);
X	}
X}
X
Xenable_wrap(column)		/* Doesn't just set column, because */
X	int             column;	/* might not have initted keyboard. */
X{
X	current_wrap_column = ((column == 0) ? -1 : column);
X}
X
Xdisable_wrap()
X{
X	current_wrap_column = 0;
X}
X
Xset_default_wrap(column)
X	int             column;
X{
X	default_wrap_column = column;
X}
END_OF_FILE
if test 1535 -ne `wc -c <'client/wrap.c'`; then
    echo shar: \"'client/wrap.c'\" unpacked with wrong size!
fi
# end of 'client/wrap.c'
fi
if test -f 'server/TinyMUD_copyright.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/TinyMUD_copyright.h'\"
else
echo shar: Extracting \"'server/TinyMUD_copyright.h'\" \(1413 characters\)
sed "s/^X//" >'server/TinyMUD_copyright.h' <<'END_OF_FILE'
X/* -*-C-*-
X
XCopyright (c) 1989 by David Applegate, James Aspnes, Timothy Freeman,
X		   and Bennet Yee.
X
XThis material was developed by the above-mentioned authors.
XPermission to copy this software, to redistribute it, and to use it
Xfor any purpose is granted, subject to the following restrictions and
Xunderstandings.
X
X1. Any copy made of this software must include this copyright notice
Xin full.
X
X2. Users of this software agree to make their best efforts (a) to
Xreturn to the above-mentioned authors any improvements or extensions
Xthat they make, so that these may be included in future releases; and
X(b) to inform the authors of noteworthy uses of this software.
X
X3. All materials developed as a consequence of the use of this
Xsoftware shall duly acknowledge such use, in accordance with the usual
Xstandards of acknowledging credit in academic research.
X
X4. The authors have made no warrantee or representation that the
Xoperation of this software will be error-free, and the authors are
Xunder no obligation to provide any services, by way of maintenance,
Xupdate, or otherwise.
X
X5. In conjunction with products arising from the use of this material,
Xthere shall be no use of the names of the authors, of Carnegie-Mellon
XUniversity, nor of any adaptation thereof in any advertising,
Xpromotional, or sales literature without prior written consent from
Xthe authors and Carnegie-Mellon University in each case. */
X
END_OF_FILE
if test 1413 -ne `wc -c <'server/TinyMUD_copyright.h'`; then
    echo shar: \"'server/TinyMUD_copyright.h'\" unpacked with wrong size!
fi
# end of 'server/TinyMUD_copyright.h'
fi
if test -f 'server/doturn.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/doturn.h'\"
else
echo shar: Extracting \"'server/doturn.h'\" \(991 characters\)
sed "s/^X//" >'server/doturn.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 * 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	u_short Thing_add;	
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};
X
XEXTERN struct stinfo Stinfo[NUMSTARS][MAXPLANETS];
X
Xstruct vnbrain {
X	u_short Total_mad;	/* total # of VN's destroyed so far */
X	short Most_mad;	/* player most mad at */
X};
X
XEXTERN struct vnbrain VN_brain;
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};
X
XEXTERN struct sectinfo Sectinfo[MAX_X][MAX_Y];
X
END_OF_FILE
if test 991 -ne `wc -c <'server/doturn.h'`; then
    echo shar: \"'server/doturn.h'\" unpacked with wrong size!
fi
# end of 'server/doturn.h'
fi
if test -f 'server/files.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/files.h'\"
else
echo shar: Extracting \"'server/files.h'\" \(1089 characters\)
sed "s/^X//" >'server/files.h' <<'END_OF_FILE'
X#ifndef _FILES_H_
X#define _FILES_H_
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
X
X#ifdef __STDC__
X# define PATH(file)	"/Net/pooh/Users/Staff/vancleef/GB/" #file
X# define DFILE(fl)	PATH(Data/) #fl
X#else
X# define PATH(file)	"/usr/net/games/lib/GB/file"
X# define DFILE(fl)	"/usr/net/games/lib/GB/Data/fl"
X#endif
X
X#define PATHLEN		200	/* length of file paths to the game.. */
X
X
X
X#define PAGER		Files[0]
X#define DATADIR		Files[1]
X#define DOCS		Files[2]
X#define EXAM_FL		Files[3]
X#define ENROLL_FL	Files[4]
X#define DO_TURN		Files[5]
X#define STARDATAFL 	Files[6]
X#define SECTORDATAFL 	Files[7]
X#define PLANETDATAFL 	Files[8]
X#define RACEDATAFL 	Files[9]
X#define BLOCKDATAFL	Files[10]
X#define SHIPDATAFL 	Files[11]
X#define SHIPFREEDATAFL 	Files[12]
X#define DUMMYFL		Files[13]
X#define PLAYERDATAFL 	Files[14]
X#define TELEGRAMDIR 	Files[15]
X#define TELEGRAMFL 	Files[16]
X#define POWFL		Files[17]
X#define LOCK_ALL 	Files[18]
X
X#define PROFDATAFL	PATH(spitup)
X
Xextern char *Files[];
X#endif
END_OF_FILE
if test 1089 -ne `wc -c <'server/files.h'`; then
    echo shar: \"'server/files.h'\" unpacked with wrong size!
fi
# end of 'server/files.h'
fi
if test -f 'server/files_rw.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/files_rw.c'\"
else
echo shar: Extracting \"'server/files_rw.c'\" \(1463 characters\)
sed "s/^X//" >'server/files_rw.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 *  disk input/output routines
X *
X *  Fileread(p, num, file, posn, routine); -- generic file read
X *  Filewrite(p, num, file, posn, routine); -- generic file write
X *
X */
X
X#include "GB_copyright.h"
X#define EXTERN extern
X#include "vars.h"
X#include "files.h"
X#include "buffers.h"
X#include <sys/file.h>
X#include <signal.h>
X#include <errno.h>
Xint sys_nerr;
X
Xextern char *sys_errlist[];
Xextern int errno;
X
Xclose_file(fd)
Xint fd;
X{
X	close(fd);
X}
X
X
X
XFileread(fd, p, num, file, posn)
Xint fd;
Xchar *p;
Xint num;
Xchar *file;
Xint posn;
X{
X int n2, abort = 0;
X
X/* printf(" fread fd=%d,reading %d bytes %s posn %d \n",fd,num,file,posn); */
X
X if (lseek(fd, posn, L_SET) < 0) {
X	perror("file read");
X	return;
X }
X
X if ((n2=read(fd,p,num))!=num) {
X	perror("fileread");
X	printf("fileread: bad # of bytes read from %s (%d != %d).\n",file,n2,num);
X }
X
X}
X
X
X
XFilewrite(fd, p, num, file, posn)
Xint fd;
Xchar *p;
Xint num;
Xchar *file;
Xint posn;
X{
Xint n2;
Xint i;
X
XNum_races=Numraces();
X
X 
X/* printf(" fd =%d writing %d bytes to %s posn %d.\n",fd,num,file,posn); */
X
X if (lseek(fd, posn, L_SET) < 0) {
X	char buf[100];
X	sprintf(buf,"%s: err %d",file,errno);
X	perror(buf);
X	return;
X }
X
X if ((n2=write(fd,p,num))!=num) {
X	char buf[100];
X	sprintf(buf,"%s:bad # of bytes written. (%d!=%d)\n",file,n2,num);
X	perror(buf);
X	return;
X }
X
X}
X
X
X
END_OF_FILE
if test 1463 -ne `wc -c <'server/files_rw.c'`; then
    echo shar: \"'server/files_rw.c'\" unpacked with wrong size!
fi
# end of 'server/files_rw.c'
fi
if test -f 'server/files_rw_update.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/files_rw_update.c'\"
else
echo shar: Extracting \"'server/files_rw_update.c'\" \(1522 characters\)
sed "s/^X//" >'server/files_rw_update.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 *  disk input/output routines
X *
X *  Fileread(p, num, file, posn, routine); -- generic file read
X *  Filewrite(p, num, file, posn, routine); -- generic file write
X *
X */
X
X#include "GB_copyright.h"
X#include "tweakables.h"
X#include "files.h"
X#include <sys/file.h>
X#include <signal.h>
X#include <errno.h>
Xint sys_nerr;
Xchar buf[1024];
Xextern char *sys_errlist[];
Xextern int errno;
X
Xclose_file(fd)
Xint fd;
X{
X	close(fd);
X	return;
X}
X
X
X
XFileread(fd, p, num, file, posn)
Xint fd;
Xchar *p;
Xint num;
Xchar *file;
Xint posn;
X{
X int n2, abort = 0;
X
X/* printf(" fread fd=%d,reading %d bytes %s posn %d \n",fd,num,file,posn); */
X
X if (lseek(fd, posn, L_SET) < 0) {
X	perror("file read");
X	return;
X }
X
X if ((n2=read(fd,p,num))!=num) {
X	perror("fileread");
X	printf("fileread: bad # of bytes read from %s (%d != %d).\n",file,n2,num);
X }
X
X}
X
X
X
XFilewrite(fd, p, num, file, posn)
Xint fd;
Xchar *p;
Xint num;
Xchar *file;
Xint posn;
X{
Xint mask;
Xint n2;
Xint Num_races, i;
X
XNum_races=Numraces();
X
X   mask = sigblock(SIGBLOCKS);
X
X/* printf(" fd =%d writing %d bytes to %s posn %d.\n",fd,num,file,posn); */
X
X if (lseek(fd, posn, L_SET) < 0) {
X	char buf[100];
X	sprintf(buf,"%s: err %d",file,errno);
X	perror(buf);
X	return;
X }
X
X if ((n2=write(fd,p,num))!=num) {
X	char buf[100];
X	sprintf(buf,"%s:bad # of bytes written. (%d!=%d)\n",file,n2,num);
X	perror(buf);
X	return;
X }
X
X   sigsetmask(mask);
X}
X
X
X
END_OF_FILE
if test 1522 -ne `wc -c <'server/files_rw_update.c'`; then
    echo shar: \"'server/files_rw_update.c'\" unpacked with wrong size!
fi
# end of 'server/files_rw_update.c'
fi
if test -f 'server/perm.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/perm.c'\"
else
echo shar: Extracting \"'server/perm.c'\" \(1098 characters\)
sed "s/^X//" >'server/perm.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 * perm.c -- randomly permute a sector list
X */
X
X#include "GB_copyright.h"
X#define EXTERN extern
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 1098 -ne `wc -c <'server/perm.c'`; then
    echo shar: \"'server/perm.c'\" unpacked with wrong size!
fi
# end of 'server/perm.c'
fi
if test -f 'server/rand.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/rand.c'\"
else
echo shar: Extracting \"'server/rand.c'\" \(905 characters\)
sed "s/^X//" >'server/rand.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**   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#include "GB_copyright.h"
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 905 -ne `wc -c <'server/rand.c'`; then
    echo shar: \"'server/rand.c'\" unpacked with wrong size!
fi
# end of 'server/rand.c'
fi
if test -f 'server/read_teleg.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/read_teleg.c'\"
else
echo shar: Extracting \"'server/read_teleg.c'\" \(1240 characters\)
sed "s/^X//" >'server/read_teleg.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**	read_teleg.c -- (try to) read telegrams
X**	 the first byte in each telegram is the sending player #, or 254
X**	 to denote autoreport.  then the time sent, then the message itself,
X**	 terminated by TELEG_DELIM.
X*/
X
X#define EXTERN extern
X#include "GB_copyright.h"
X#include "vars.h"
X#include "buffers.h"
X#include <ctype.h>
X#include <signal.h>
X#include <setjmp.h>
X#include <strings.h>
X#include <errno.h>
Xextern jmp_buf main_jenv;
XFILE *fopen(), *teleg_read_fd;
X
Xchar telegram_file[PATHLEN];
X
Xteleg_read(Playernum)
Xint Playernum;
X{
X    char *p;
X
X    sprintf(telegram_file,"%s.%d", TELEGRAMFL, Playernum);
X    if((teleg_read_fd = fopen(telegram_file, "r")) != 0) {
X	while(fgets(buf, sizeof buf, teleg_read_fd)) {
X	    for(p = buf; *p; p++) if(*p == '\n') {
X		*p = '\0';
X		break;
X	    }
X	str_cat(buf, "\n");
X		notify(Playernum, buf);
X	}
X	fclose(teleg_read_fd);
X  	teleg_read_fd = fopen( telegram_file, "w+" );	/* trunc file */
X	fclose(teleg_read_fd);
X
X
X    } else {
X	sprintf(buf,  "\nTelegram file %s non-existent.\n", telegram_file);
X	notify(Playernum, buf);
X	return;
X	}
X
X  }
X
X
X
END_OF_FILE
if test 1240 -ne `wc -c <'server/read_teleg.c'`; then
    echo shar: \"'server/read_teleg.c'\" unpacked with wrong size!
fi
# end of 'server/read_teleg.c'
fi
if test -f 'server/ship.dat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/ship.dat'\"
else
echo shar: Extracting \"'server/ship.dat'\" \(1164 characters\)
sed "s/^X//" >'server/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 <'server/ship.dat'`; then
    echo shar: \"'server/ship.dat'\" unpacked with wrong size!
fi
# end of 'server/ship.dat'
fi
if test -f 'server/sizes.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/sizes.c'\"
else
echo shar: Extracting \"'server/sizes.c'\" \(973 characters\)
sed "s/^X//" >'server/sizes.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 */
X
X#include "GB_copyright.h"
X#define EXTERN
X#include "vars.h"
X#include "ships.h"
X#include "races.h"
X#include "power.h"
X
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 struct plinfo is %d\n\n",sizeof(struct plinfo));
X printf(" size struct power [15] is %d\n\n",sizeof(Power));
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 973 -ne `wc -c <'server/sizes.c'`; then
    echo shar: \"'server/sizes.c'\" unpacked with wrong size!
fi
# end of 'server/sizes.c'
fi
if test -f 'server/teleg_send.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/teleg_send.c'\"
else
echo shar: Extracting \"'server/teleg_send.c'\" \(1033 characters\)
sed "s/^X//" >'server/teleg_send.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 *	teleg_send.c -- does the work of sending a telegram
X */
X
X#define EXTERN extern
X#include "GB_copyright.h"
X#include "tweakables.h"
X#include "files.h"
X#include "buffers.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
Xpush_message(sender, recpient, msg)
Xint sender;
Xint 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
X sprintf(telefl, "%s.%d",TELEGRAMFL, recpient );
X
X if ((telegram_fd = fopen( telefl, "a" ))==NULL) {
X	perror("teleg_send");
X	return;
X    } else {
X
X  tm = time(0);
X  fprintf( telegram_fd, "%s", ctime(&tm) );
X
X		/* write the telegram */
X  do {
X		fputc(*msg, telegram_fd);
X  } while (*(msg++) != '\0');
X
X  fprintf(telegram_fd, "\n\n");
X  fclose(telegram_fd);
X
X }
X
X}
X
END_OF_FILE
if test 1033 -ne `wc -c <'server/teleg_send.c'`; then
    echo shar: \"'server/teleg_send.c'\" unpacked with wrong size!
fi
# end of 'server/teleg_send.c'
fi
if test -f 'server/toxicity.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/toxicity.c'\"
else
echo shar: Extracting \"'server/toxicity.c'\" \(1374 characters\)
sed "s/^X//" >'server/toxicity.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 * toxicty.c -- change threshold in toxicity to build a wc.
X */
X
X#include "GB_copyright.h"
X#define EXTERN extern
X#include "vars.h"
X#include "races.h"
X#include "buffers.h"
X#include <math.h>
X#include <signal.h>
X#include <ctype.h>
Xint tox_pdata;
X
X
Xtoxicity(Playernum,APcount, argn, args)
Xint Playernum;
Xint APcount, argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xint c,thresh;
Xplanettype *p;
X
Xtox_pdata = NEUTRAL_FD;
X
X	sscanf(args[1], "%d", &thresh);
X
X if (thresh > 100 || thresh < 0) {
X		sprintf(buf,"Illegal value.\n");
X			notify(Playernum, buf);
X		return;
X }
X
Xif (Dir[Playernum-1].level!=LEVEL_PLAN) {
X	sprintf(buf,"scope must be a planet.\n");
X		notify(Playernum, buf);
X	return;
X}
Xif (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount)) {
X	return;
X	}
X
X openpdata(&tox_pdata);
X getplanet(tox_pdata,&p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
X
X p->info[Playernum-1].tox_thresh = thresh;
X putplanet(tox_pdata,p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
Xclose_file(tox_pdata);
X deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0);
X
X sprintf(buf, " New threshold is: %u\n",p->info[Playernum-1].tox_thresh);
X		notify(Playernum, buf);
X
X free(p);
X
X}
X
END_OF_FILE
if test 1374 -ne `wc -c <'server/toxicity.c'`; then
    echo shar: \"'server/toxicity.c'\" unpacked with wrong size!
fi
# end of 'server/toxicity.c'
fi
if test -f 'server/ultrix_cpt.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/ultrix_cpt.h'\"
else
echo shar: Extracting \"'server/ultrix_cpt.h'\" \(1574 characters\)
sed "s/^X//" >'server/ultrix_cpt.h' <<'END_OF_FILE'
X/*	@(#)ultrix_cpt.h 1.7 89/09/14 SMI	*/
X
X/* From the XView source distribution */
X/*
X * Ultrix 2.X, SunOS 3.X, BSD 4.2 Compatibility Header File
X *
X * This file provides a limited compatibility with older BSD variants
X * that do not provide macros for dealing with fd sets.
X *
X * BIG NOTE!!! This will only allow fd_sets of N bits , where N is
X * the size of an int.
X *
X */
X
X#ifndef xview_ultrix_compat_DEFINED
X#define xview_ultrix_compat_DEFINED
X
X#ifdef OLD_BSD_FDSETS
X
X#ifndef NBBY
X#define NBBY    8               /* number of bits in a byte */
X#endif
X
X#ifndef NFDBITS
X#define	NFDBITS	(sizeof(int) * NBBY)
X#define I_DEFINED_NFDBITS	/* register the fact that I defined this */
X#endif
X
X#ifndef FD_SETSIZE
X#define FD_SETSIZE	NFDBITS
X#define I_DEFINED_FDSETSIZE	/* register the fact that I defined this */
X#endif
X
X/*
X *	Here we assume that the only use of howmany(x, y) is 
X *	howmany(FD_SETSIZE, NFDBITS). If we defined both FD_SETSIZE and
X * 	NFDBITS, then we already know what howmany(x, y) will be: 1.
X *	If we did not define FD_SETSIZE and NFDBITS, then we'll have
X *	to calculate the value of howmany(x, y).
X */
X
X#if defined(I_DEFINED_FDSETSIZE) && defined(I_DEFINED_NFDBITS)
X#define howmany(x, y)	1
X#else
X#define howmany(x, y)	(((x)+((y)-1))/(y))
X#endif
X
X#define FD_SET(n, p)    ((p)->fds_bits[0] |= (1 << ((n) % NFDBITS)))
X#define FD_CLR(n, p)    ((p)->fds_bits[0] &= ~(1 << ((n) % NFDBITS)))
X#define FD_ISSET(n, p)  ((p)->fds_bits[0] & (1 << ((n) % NFDBITS)))
X#define FD_ZERO(p)      ((p)->fds_bits[0] = 0)
X
X#endif OLD_BSD_FDSETS
X
X#endif ~xview_ultrix_compat_DEFINED
END_OF_FILE
if test 1574 -ne `wc -c <'server/ultrix_cpt.h'`; then
    echo shar: \"'server/ultrix_cpt.h'\" unpacked with wrong size!
fi
# end of 'server/ultrix_cpt.h'
fi
if test -f 'server/welcome.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/welcome.txt'\"
else
echo shar: Extracting \"'server/welcome.txt'\" \(984 characters\)
sed "s/^X//" >'server/welcome.txt' <<'END_OF_FILE'
X
XThe client/server source/docs can be obtained via anon 
X	ftp from 'scam.berkeley.edu' in tmp/GB.
X
XUpdates are running at 6 hour intervals - 12, 6 am/pm PST.
X
X
X'Real game' starting up probably next weekend or the first week of June. 
X	This will have advanced ship customizing capabilities. Since most 
X	of the problems in GB have been ironed out, it might be refreshing 
X	to play without bugs ruining the course of the game.
X
XInterstellar travel will be replaced with hyper-space jumps in the new
X	game (no more need to navigate in deep space). Jumps will
X	be restricted to 'short' distances (between nearest stars)
X	and will cost fuel.
X
X>>>> WELL GUYS <<< I accidentally nuked the data base :(
X	Guess that puts an end to our game (since there is no backup).
X	Log in to read this message periodically this week
X	for details on the new game starting up this weekend.
X	Send e-mail to 'vancleef@pooh.caltech.edu'.
X	I am really sorry about this - oh well...
X
X
XPlease enter your password.
END_OF_FILE
if test 984 -ne `wc -c <'server/welcome.txt'`; then
    echo shar: \"'server/welcome.txt'\" unpacked with wrong size!
fi
# end of 'server/welcome.txt'
fi
if test -f 'server/zoom.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'server/zoom.c'\"
else
echo shar: Extracting \"'server/zoom.c'\" \(955 characters\)
sed "s/^X//" >'server/zoom.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 * zoom.c -- zoom in or out for orbit display
X */
X
X#include "GB_copyright.h"
X#define EXTERN extern
X#include "vars.h"
X#include "buffers.h"
X
X
Xzoom(Playernum,APcount, argn,args)
Xint Playernum;
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
X float num,denom;
Xint i;
X
Xi = (Dir[Playernum-1].level==LEVEL_UNIV);
X
Xif(argn > 1) {
X    if (sscanf(args[1], "%f/%f", &num, &denom) == 2) {
X	/* num/denom format */
X	if (denom==0.0) {
X		sprintf(buf,"Illegal denominator value.\n");
X			notify(Playernum, buf);
X	} else
X		Dir[Playernum-1].zoom[i] = num / denom;
X    } else {
X	/* one number */
X	Dir[Playernum-1].zoom[i] = num;
X    }
X}
X
X sprintf(buf,"Zoom value %g, lastx = %g, lasty = %g.\n",Dir[Playernum-1].zoom[i],
X		Dir[Playernum-1].lastx[i],Dir[Playernum-1].lasty[i]);
X	notify(Playernum, buf);
X}
END_OF_FILE
if test 955 -ne `wc -c <'server/zoom.c'`; then
    echo shar: \"'server/zoom.c'\" unpacked with wrong size!
fi
# end of 'server/zoom.c'
fi
echo shar: End of archive 13 \(of 14\).
cp /dev/null ark13isdone
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