[comp.sources.games] v06i067: GB - Galactic Bloodshed, an empire-like war game, Patch1

games@tekred.CNA.TEK.COM (05/02/89)

Submitted-by: Robert Chansky <smq@ssyx.ucsc.edu>
Posting-number: Volume 6, Issue 67
Archive-name: GB/Patch1

	[This is the first of three patch files for GB.  All three patch
	 files need to be applied.  This file contains replacement files -
	 i.e. the context diffs wre larger than the full source.  Unshar
	 this file.  The following two files contain context diffs suitable
	 for feeding to patch(1), either directly or after unsharing.
	 Also, contrary to what I previously stated, GB is a multi-player
	 game.  The latest version (on which these patches are based) can
	 be obtained by anon ftp from ssyx.ucsc.edu in the directory pub/games
	 as GB.shar.Z.	-br]

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  files.h shipdata.h patchlevel.h build.c enrol.c land.c
#   launch.c load.c max.c rst.c enroll.dat
# Wrapped by billr@saab on Mon May  1 09:56:59 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'files.h' -a "${1}" != "-c" ; then 
  mv files.h files.h.orig
else
echo shar: Extracting \"'files.h'\" \(961 characters\)
sed "s/^X//" >'files.h' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X */
X
X#ifdef VER_4_3
X
X/*#define PATH(file)	"/home/ssyx/smq/GB/file"*/
X#define PATH(file)	"/usr/games/lib/GB/file"
X
X#else
X#ifdef VER_4_2
X
X/*#define PATH(file)	"/b/f/smq/GB/file"	/* running on different hosts*/
X#define PATH(file)	"/usr/games/lib/GB/file"
X
X# endif
X#endif
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
X
X#define PLAYER_GOD "smq"
X#define PLAYER_GROUP_ID 937
X#define LOCK_ALL "/tmp/Ex29935 "
END_OF_FILE
if test 961 -ne `wc -c <'files.h'`; then
    echo shar: \"'files.h'\" unpacked with wrong size!
fi
# end of 'files.h'
fi
if test -f 'shipdata.h' -a "${1}" != "-c" ; then 
  mv shipdata.h shipdata.h.orig
else
echo shar: Extracting \"'shipdata.h'\" \(2608 characters\)
sed "s/^X//" >'shipdata.h' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X */
X
Xchar Shipltrs[]={ 'p','s','c','b','d','f','g','e','t','S','D','M','%','#',
X		  '+','m','A','C','V','^',' ','E','Y','B','G','[' };
X
Xint Shipdata[NUMSTYPES][NUMABILS] = {
X  /* cargo destcap guns  fuelcap  tech  crew   armr cost  mass  mv sw */
X/*sp*/1,     0,     0,     20,    1,     1,      1,  10,   5,   1, 0,
X/*sh*/10,    2,     1,     20,	  15,    25,     1,  50,   10,  1, 0,
X/*cs*/1,     2,     1,     1,     10,    0,      3,  20,   4,   1, 0,
X/*bt*/35,    200,   10,    100,   140,   70,     10, 500,  20,  1, 0,
X/*de*/10,    100,   5,     80,	  70,    50,     6,  200,  10,  1, 0,
X/*fi*/1,     30,    4,     10,	  65,    1,      40, 80,   5,   1, 0,
X/*cg*/1000,  1000,  1,     1000,  65,    1000,   3,  400,  25,  1, 0,
X/*ex*/1,     1,     1,     30,	  25,    1,      3,  100,  8,   1, 0,
X/*ta*/15,    10,    1,     5000,  65,    50,     3,  400,  20,  1, 0,
X/*st*/5000,  250,   35,    500,   20,    1000,   9,  400,  50,  1, 0,
X/*Dr*/100,   500,   40,    500,   250,   60,     10, 600,  25,  1, 0,
X/*Mi*/5000,  600,   35,    5000,  350,   1000,   20, 500,  20,  1, 0,
X/*Cr*/10000, 10000, 100,   10000, 700,   10000,  50, 400,  10,  1, 0,
X/*GD*/50000, 50000, 50000, 50000, 1000,  50000,  100,100,  1,   1, 0,
X/*sm*/0,     10,    0,     6,     30,    0,      1,  35,   15,  1, 1,
X/*mr*/200,   10,    1,     20,    50,    15,     1,  200,  100, 1, 0,
X/*Ap*/0,     0,     0,     0,     80,    10,     1,  150,  40,  0, 1,
X/*Cd*/0,     0,     0,     1,     40,    0,      1,  20,   5,   1, 0,
X/*VN*/20,    0,     0,     35,    30,    0,      1,  15,   15,  1, 1,
X/*pb*/0,     20,    0,     5,     300,   0,      1,  100,  5,   1, 1,
X/*cd*/0,     10,    0,     0,     250,   0,      1,  25,   6,   0, 1,
X/*AY*/0,     10,    0,     0,     90,    0,      1,  25,   6,   0, 0,
X/*Bw*/0,     10,    0,     0,     80,    0,      1,  25,   6,   0, 1,
X/*Gr*/0,     10,    20,    0,     80,    0,      1,  25,   6,   0, 0,
X/*TD*/1000,  1000,  0,     1000,  220,   1000,   1,  800,  80,  0, 1
X};
X
Xchar *Shipnames[NUMSTYPES] = {
X   "Spore pod",
X   "Shuttle",
X   "Comsat",
X   "Battleship",
X   "Destroyer",
X   "Fighter",
X   "Cargo ship",
X   "Explorer",
X   "Tanker",
X   "Station",
X   "Dreadnaught",
X   "Mithril Ship",
X   "Crystal Ship",
X   "GODSHIP",
X   "Space mine",
X   "Space mirror",
X   "Atmosph processor",
X   "Canister of dust",
X   "V.Neumann machine",
X   "*Planet bomb",
X   "*cloaking device",
X   "*emotion suppressor",
X   "*Amulet of Yendor",
X   "*biological weapon",
X   "*gamma ray laser",
X   "audio-vibatory-\n   physio-molecular\n   transport device"
X};
END_OF_FILE
if test 2608 -ne `wc -c <'shipdata.h'`; then
    echo shar: \"'shipdata.h'\" unpacked with wrong size!
fi
# end of 'shipdata.h'
fi
if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel.h'\"
else
echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
X#define PATCHLEVEL	1
END_OF_FILE
if test 21 -ne `wc -c <'patchlevel.h'`; then
    echo shar: \"'patchlevel.h'\" unpacked with wrong size!
fi
# end of 'patchlevel.h'
fi
if test -f 'build.c' -a "${1}" != "-c" ; then 
  mv build.c build.c.orig
else
echo shar: Extracting \"'build.c'\" \(7552 characters\)
sed "s/^X//" >'build.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@ucscb.ucsc.EDU)
X * build -- build a ship
X */
X
X#include "vars.h"
X#include "ships.h"
X#include "races.h"
X#include <curses.h>
X#include <setjmp.h>
X#include <signal.h>
Xextern jmp_buf main_jenv;
Xextern int Ignore_filelocks, God;
Xint build_shdata,build_pdata,build_sectdata;
X
X
Xbuild(APcount, argn,args)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xint j,i,x= -1 ,y= -1 ,shipno, planet_slot,mask;
Xint picked=0;
Xchar shipc;
Xplanettype *planet;
Xsectortype *sect;
Xshiptype s,*dirship;
Xint build_handler();
X
X
X
Xbuild_shdata = build_pdata = build_sectdata = NEUTRAL_FD;
Xsignal(SIGINT, build_handler);
X
X if (Dir.level==LEVEL_PLAN) {
X } else if (Dir.level==LEVEL_SHIP) {
X	openshdata(&build_shdata);
X	if (!getship(build_shdata, &dirship, Dir.shipno)) {
X		printf("Illegal dir value.\n");
X		build_handler();
X	}
X	if (dirship->is_docked) {
X		if (dirship->whatdest==LEVEL_PLAN)
X			printf("This ship is landed.\n");
X		else
X			printf("There is already a ship docked here (#%d).\n",
X					dirship->destshipno);
X		build_handler();
X	}
X } else {
X	printf("You can't build anything here.\n");
X	build_handler();
X }
X
X if (Dir.level==LEVEL_PLAN) {
X	 if (!enufAP(Stars[Dir.snum]->AP, APcount))
X		build_handler();
X } else if (dirship->whatorbits==LEVEL_UNIV) {
X	 if (!enufAP(Sdata.AP, APcount))
X		build_handler();
X } else
X	 if (!enufAP(Stars[dirship->storbits]->AP, APcount))
X		build_handler();
X
X  do {
X   tty_on();
X   printf("What ship type (? for help):");
X   shipc=getchr(); putchr('\n');
X   tty_off();
X   if (shipc=='?') {
X     printf("ltr              ship  carg armr dstcap guns  mass fuelcap mintech cost ^crew\n");
X     for (i=0; i<NUMSTYPES; i++)
X	if (Race->tech >= Shipdata[i][ABIL_TECH] || God)
X	  if ((i==STYPE_POD && Race->Thing) || i!=STYPE_POD)
X	    printf(" %c %18s %5d%5d%7d%5d%6d%8d%8d%5d%6d\n",Shipltrs[i],
X		  Shipnames[i],Shipdata[i][ABIL_CARGO],
X		  Shipdata[i][ABIL_ARMOR],
X		  Shipdata[i][ABIL_DESTCAP],
X		  Shipdata[i][ABIL_GUNS],Shipdata[i][ABIL_MASS],
X		  Shipdata[i][ABIL_FUELCAP],Shipdata[i][ABIL_TECH],
X		  Shipdata[i][ABIL_COST],Shipdata[i][ABIL_MAXCREW] );
X   } else {
X    i=0;
X    while ((Shipltrs[i]!=shipc) && (i<NUMSTYPES)) i++;
X    picked = 1;
X    if (i<0 || i>=NUMSTYPES || (i==STYPE_POD && !Race->Thing) ) {
X	printf("Illegal ship letter.\n");
X	picked = 0;
X    } else if (Race->tech < Shipdata[i][ABIL_TECH]) {
X	printf("You don't have enough technology to build one of those.\n");
X	if (!God)
X		picked = 0;
X    } else if (i==STYPE_MIRROR && Dir.level==LEVEL_PLAN) {
X	printf("You can't build one of those on a planet.\n");
X	picked = 0;
X    }
X   }
X  } while (!picked);
X
X  if (Dir.level==LEVEL_PLAN) {
X      openpdata(&build_pdata);
X      getplanet(build_pdata,&planet,Stars[Dir.snum]->planetpos[Dir.pnum]);
X
X		/* see if the ship can be made on the planet */
X	j = 0;
X	while (planet->shipnums[j++]) ;
X	 if (j<=MAXPSHIPS) {
X		planet_slot = j-1;
X	 } else {
X		printf("too many ships are already here.\n");
X		free(planet);
X		build_handler();
X	 }
X     if (planet->info[Playernum-1].resource < Shipdata[i][ABIL_COST]) {
X	printf("not enough resources in stock.\n");
X	free(planet);
X	build_handler();
X     }
X   } else {
X     if (dirship->resource < Shipdata[i][ABIL_COST]) {
X	printf("not enough resources on this ship.\n");
X	build_handler();
X     }
X   }
X
X     if (Dir.level==LEVEL_PLAN)
X	do {
X
X     	   printf("Build %s on planet %s,", Shipnames[i],
X	   		  		Stars[Dir.snum]->pnames[Dir.pnum] );
X	   GetMapSector(planet, &x, &y);
X
X	   opensectdata(&build_sectdata);
X	   getsector(build_sectdata, &sect, planet->sectormappos+(y*planet->Maxx+x)*sizeof(sectortype) );
X	   close(build_sectdata);
X	   free(sect);
X
X      	} while ( sect->owner != Playernum );
X
X		/* keep people from fucking up the data files */
X	mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
X
X
X 	Bzero(s);
X
X	s.type = i;
X	s.xpos = (float)x;
X	s.ypos = (float)y;
X	/*s.augmented = 0;*/
X	if (s.type==STYPE_POD)
X		s.speed = 1;
X	else
X		s.speed = 2;	/* starting speed default */
X	s.owner = Playernum;
X	/*for (l=0; l < NUMABILS-3; l++)
X		s.abils[l]=Shipdata[i][l];*/
X	s.mass = (float)Shipdata[i][ABIL_MASS];
X	s.fuel = s.destruct = s.resource = 0;
X	s.is_docked = 1;
X	if (Dir.level==LEVEL_PLAN) {
X			/* docked on the planet */
X		s.whatorbits = LEVEL_PLAN;
X		s.whatdest = LEVEL_PLAN;
X		s.deststar = Dir.snum;
X		s.destpnum = Dir.pnum;
X	} else {
X		s.whatdest = LEVEL_SHIP;
X		s.destshipno = Dir.shipno;
X		s.whatorbits = dirship->whatorbits;
X	}
X	s.storbits = Dir.snum;
X	s.pnumorbits = Dir.pnum;
X	s.rad = 0;
X	if (Shipdata[s.type][ABIL_MAXCREW]==0)
X		s.damage = 0;
X	else
X		s.damage = 50;
X
X	if (has_switch(&s)) {
X		s.orders.object.on = 0;
X	}
X	switch (s.type) {
X	    case OTYPE_VN:
X		s.orders.object.number = 1;	/* one of them */
X		s.orders.object.number2 = 1;	/* we have an assignment */
X		s.orders.object.on = 1;
X		break;
X	    case STYPE_MINE:
X		s.orders.object.number = 100;	/* trigger radius */
X		printf("Trigger radius set to 100.\n");
X		break;
X	    case OTYPE_TRANSDEV:
X		printf("Receive OFF.  Change with order.\n");
X		break;
X	    case OTYPE_TERRA:
X		printf("Processor OFF.\n");
X		break;
X	    default:
X		break;
X	}
X
X
X		/* deduct resource cost */
X	if (Dir.level==LEVEL_PLAN)
X		planet->info[Playernum-1].resource -= Shipdata[i][ABIL_COST];
X	else
X		dirship->resource -= Shipdata[i][ABIL_COST];
X
X	  /* load new ship with fuel */
X	if (Dir.level==LEVEL_PLAN) {
X	  if (planet->info[Playernum-1].fuel >= Shipdata[i][ABIL_FUELCAP]) {
X		planet->info[Playernum-1].fuel-=Shipdata[i][ABIL_FUELCAP];
X		s.fuel = (float)Shipdata[i][ABIL_FUELCAP];
X		s.mass += s.fuel*MASS_FUEL;
X		printf("%s Loaded with %.2f fuel.\n",Shipnames[s.type],s.fuel);
X	  } else {
X		s.fuel = 0;
X		printf("No fuel available!\n");
X	  }
X	  /* put crew in ship */
X	  opensectdata(&build_sectdata);
X	  getsector(build_sectdata,&sect,planet->sectormappos+(y*planet->Maxx+x)*sizeof(sectortype));
X	  if (sect->popn > Shipdata[i][ABIL_MAXCREW]) {
X		sect->popn -= Shipdata[i][ABIL_MAXCREW];
X		s.popn = Shipdata[i][ABIL_MAXCREW];
X		s.mass += (float)s.popn*Race->mass;
X		putsector(build_sectdata,sect,planet->sectormappos+(y*planet->Maxx+x)*sizeof(sectortype));
X		printf("Loaded with %d crew members.\n",Shipdata[i][ABIL_MAXCREW]);
X	  } else {
X		s.popn = 1;
X		printf("Only one crewmember available.\n");
X	  }
X	  close(build_sectdata);
X	  free(sect);
X
X	}
X
X		/* check for dead ships in the data files */
X	if (Dir.level==LEVEL_SHIP)
X		Ignore_filelocks = 1;
X	else
X		openshdata(&build_shdata);
X	if ( (shipno = getdeadship(build_shdata)) == -1) {
X			/* otherwise recycle topmost dead ship in data file */
X			/* no dead ships to recycle */
X		shipno = Numships(build_shdata) + 1;
X	}
X
X	printf("Ship #%d is %s %.0f,%.0f.\n",shipno,
X		Dir.level==LEVEL_SHIP ? "at" : "on sector", s.xpos,s.ypos);
X
X	putship(build_shdata,&s,shipno);
X
X		/* Insert ship into planet's orbit (actually landed) */
X	if (Dir.level==LEVEL_PLAN) {
X		planet->shipnums[planet_slot] = shipno;
X		planet->numships++;
X		putplanet(build_pdata,planet,Stars[Dir.snum]->planetpos[Dir.pnum]);
X		close(build_pdata);
X	        free(planet);
X	} else {
X		dirship->is_docked = 1;
X		dirship->whatdest = LEVEL_SHIP;
X		dirship->destshipno = shipno;
X		putship(build_shdata, dirship, Dir.shipno);
X		free(dirship);
X	}
X	close(build_shdata);
X
X    Ignore_filelocks = 0;
X    if (Dir.level==LEVEL_SHIP && dirship->whatorbits==LEVEL_UNIV)
X	    deductAPs(APcount, 0, 1);
X    else
X	    deductAPs(APcount, Dir.snum, 0);
X
X    sigsetmask(mask);
X
X}
X
X
X
Xbuild_handler()
X{
X close(build_shdata );
X close(build_pdata );
X close(build_sectdata );
X Ignore_filelocks = 0;
X longjmp(main_jenv,1);
X}
END_OF_FILE
if test 7552 -ne `wc -c <'build.c'`; then
    echo shar: \"'build.c'\" unpacked with wrong size!
fi
# end of 'build.c'
fi
if test -f 'enrol.c' -a "${1}" != "-c" ; then 
  mv enrol.c enrol.c.orig
else
echo shar: Extracting \"'enrol.c'\" \(7667 characters\)
sed "s/^X//" >'enrol.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X * enrol.c -- initializes to owner one sector and planet. 
X */
X
X#include "vars.h"
X#include "races.h"
X#include <signal.h>
X#include <strings.h>
X#include <curses.h>
X#include <errno.h>
Xextern int errno;
Xextern char desshow();
X
Xstruct stype {
X	char here;
X	char x,y;
X	int count;
X};
X
X/* compatibility schematic for sectors.  Note that plated sectors are
X   compatible with everything.  */
Xfloat Likes[DES_PLATED+1][DES_PLATED+1] = {
X               /* DES_SEA     DES_LAND   DES_MOUNT  DES_GAS DES_ICE DES_PLATED*/
X/*DES_SEA  */      1.0,        0.0,        0.0,       0.3,     0.05,    1.0,
X/*DES_LAND */      0.0,        1.0,        0.5,       0.0,     0.1,     1.0,
X/*DES_MOUNT*/      0.0,        0.5,        1.0,       0.0,     0.7,     1.0,
X/*DES_GAS  */      0.5,        0.0,        0.0,       1.0,     0.0,     1.0,
X/*DES_ICE  */      0.15,       0.25,       0.7,       0.0,     1.0,     1.0,
X/*DES_PLATED*/     1.0,        1.0,        1.0,       1.0,     1.0,     1.0
X};
X
X
Xenroll(loginname)
Xchar *loginname;
X{
Xint x,y, or;
Xint pnum,star=0,found=0,i,j,enroll_pdata,
X	enroll_sectdata, enroll_stardata,mask,ppref;
Xchar str[100], c;
Xsectortype *sect;
Xstruct stype secttypes[DES_PLATED+1];
Xplanettype *planet;
XFILE *fd;
X
X
Xif ( (Playernum=Numraces()+1) >= MAXPLAYERS) {
X	printf("There are already %d players; No more allowed.\n",Playernum);
X	exit(-1);
X}
X
X
X
X printf("There is still space for player %d.", Playernum);
X printf("\n\tenroll(y/n)\?");
X
X c = getchr(); getchr();
X if (c!='y') {
X	printf("why did you come here, then?\n");
X	endwin();
X	exit(0);
X }
X
X   /* look at enroll screen */
X sprintf(str, "%s %s", PAGER, ENROLL_FL);
X system(str);
X printf("\n  Live on what type planet:(e)arthtype, (g)asgiant, (a)irless? ");
X c = getchr(); getchr();
X switch (c) {
X	case 'e': ppref = TYPE_EARTH;
X		 break;
X	case 'a': ppref = TYPE_AIRLESS;
X		 break;
X	case 'g': ppref = TYPE_GASGIANT;
X		 break;
X	default: printf("Oh well.\n");
X		 exit(-1);
X		 break;
X }
X
X	/* find first planet of right type */
Xstar = 0; found = 0;
Xwhile (!found && star<Sdata.numstars) {
X for (or=i=0; i<howmanybytes(Playernum); i++ )
X	or |= Stars[star]->explored[i];
X	  /* make sure no one has explored the star */
X if (!or) {
X	 pnum = 0;
X	 while (!found && pnum<Stars[star]->numplanets) {
X		printf(" getting st %d pl #%d\n",star, pnum);
X		openpdata(&enroll_pdata);
X		getplanet(enroll_pdata,&planet,Stars[star]->planetpos[pnum]);
X		if (planet->type==ppref) {
X			printf(" yep.\n");
X			found = 1;
X		} else {
X			printf(" nope.\n");
X			close(enroll_pdata);
X			free(planet);
X			pnum++;
X		}
X	 }
X }
X if (!found)
X	 star++;
X}
Xprintf(" star %d, pl %d\n", star,pnum);
X
X
X if (!found) {
X	printf(" Uhoh, there don't seem to be any of that type of planet left.\n");
X	printf("  Try a different one...\n");
X	endwin();
X	exit(0);
X }
X
X Race = Malloc(racetype);
X Bzero(*Race);
X
X tty_off();
X printf("\n\nEnter a name for your race:");
X dots(RNAMESIZE);
X scanf("%[^\n]",str); 
X getchr();
X printf("\n\nwait...\n");
X
X strncpy(Race->name, str, RNAMESIZE);
X
X Race->homelevel = Race->deflevel = LEVEL_PLAN;
X Race->homesystem = Race->defsystem = star;
X Race->homeplanetnum = Race->defplanetnum = pnum;
X
X	/* make conditions preferred by your people set to (more or less) 
X	   those of the planet : higher the concentration of gas, the higher
X	   percentage difference between planet and race */
X for (j=0; j<=OTHER; j++)
X	Race->conditions[j] = planet->conditions[j]; /*+ int_rand( round_rand(-planet->conditions[j]*2.0), round_rand(planet->conditions[j]*2.0) )*/
X
X
X for (i=0; i<MAXPLAYERS; i++)
X   /* messages from autoreport, player #1 are decodable */
X	if (i==Playernum || i==1)
X		Race->translate[i] = 100;	/* you can talk to own race */
X	else
X		Race->translate[i] = 1;
X
X  i = 5; found = 0;
X  tty_on();
X  do {
X	if (i<=0) {
X		printf("Too long.  bye\n");
X		exit(0);
X	}
X
X	Race->tech = 0;
X	Race->overbirthrate = float_rand() * 0.01;
X		/* your race is like "the Thing" */
X	if (Race->Thing = !int_rand(0,10) ) {
X		Race->mass = 1.0;
X		Race->birthrate = float_rand()*0.25 + 0.55;
X		Race->fighters = int_rand(7,9);
X		Race->IQ = int_rand(30,60);
X		Race->nonhomebodies = 0.99;
X		Race->number_sexes = 1;
X		Race->metabolism = float_rand() * 0.25 + 0.52;
X	} else {
X		Race->birthrate = float_rand()*0.25 + 0.25;
X		Race->mass = 0.5 + 1.5 * float_rand();
X		Race->fighters = int_rand(1,3)+int_rand(1,3);
X		Race->IQ = int_rand(103,220);
X		Race->nonhomebodies = 0.70 + float_rand()*0.20;
X		Race->metabolism = float_rand() * 0.25 + 0.875;
X		Race->number_sexes = int_rand(1,int_rand(2,int_rand(3,9)));
X	}
X	clear();
X	move(0,0); 
X	printw("%s\n", Race->Thing ? "MESOMORPHIC" : "");
X	printw("       Birthrate: %.3f\n",Race->birthrate);
X	printw("Fighting ability: %d\n",Race->fighters);
X	printw("              IQ: %d\n",Race->IQ);
X	printw("      Metabolism: %.2f\n",Race->metabolism);
X	printw("    Adventurists: %.2f\n",Race->nonhomebodies);
X	printw("            Mass: %.2f\n",Race->mass);
X	if (!Race->Thing)
X		printw(" Number of sexes: %d (min req'd for colonization)\n",Race->number_sexes);
X	printw("\n\n  (%d re-rolls left) space to reroll:", --i);
X	refresh();
X	if (getchr()!=' ')
X		found = 1;
X   } while (!found);
X
X bzero((char *)secttypes, sizeof(secttypes));
X
X opensectdata(&enroll_sectdata);
X getsmap(enroll_sectdata,Smap,planet->sectormappos,planet->Maxx*planet->Maxy);
X
X printf("\nChoose a primary sector preference.  Your race will prefer to live\non this type of sector.\n");
X
X PermuteSects(planet);
X Getxysect(planet, 0, 0, 1);
X while (Getxysect(planet,&x,&y,0)) {
X	secttypes[Sector(*planet,x,y).des].count++;
X	if (!secttypes[Sector(*planet,x,y).des].here) {
X		secttypes[Sector(*planet,x,y).des].here = 1;
X		secttypes[Sector(*planet,x,y).des].x = x;
X		secttypes[Sector(*planet,x,y).des].y = y;
X	}
X }
X
X Playernum = 1;
X planet->is_explored = 1;
X for (i=DES_SEA; i<=DES_PLATED; i++)
X	if (secttypes[i].here) {
X		Sector(*planet,secttypes[i].x,secttypes[i].y).is_wasted = 0;
X		printf("(%2d): %c  (%d sectors)\n", i,
X		     desshow(planet, secttypes[i].x,secttypes[i].y),
X		     secttypes[i].count);
X	}
X planet->is_explored = 0;
X
X printf("\nchoice: ");
X scanf("%d", &i);
X if (i<DES_SEA || i>DES_PLATED || !secttypes[i].here) {
X	printf("Forget it.\n");
X	endwin();
X	exit(0);
X }
X
X sect = &Sector(*planet,secttypes[i].x,secttypes[i].y);
X Race->likesbest = i;
X for (j=DES_SEA; j<=DES_PLATED; j++)
X	Race->likes[j] = Likes[i][j];
X
X	Playernum = Race->Playernum = Numraces() + 1;
X
X	mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
X
X	putrace(Race);
X
X	planet->info[Playernum-1].numsectsowned = 1;
X	planet->is_explored = 0;
X	planet->info[Playernum-1].explored = 1;
X	/*planet->info[Playernum-1].autorep = 1;*/
X
X
X	sect->owner = Playernum;
X	sect->popn = planet->popn = Race->number_sexes * 5;
X	sect->fert = 100;
X	sect->eff = 10;
X
X	putsector(enroll_sectdata,sect,planet->sectormappos+(secttypes[i].y*planet->Maxx+secttypes[i].x)*sizeof(sectortype));
X	close(enroll_sectdata);
X
X	putplanet(enroll_pdata,planet,Stars[star]->planetpos[pnum-1]);
X	close(enroll_pdata);
X
X		/* make star explored and stuff */
X	openstardata(&enroll_stardata);
X	 getstar(enroll_stardata,&Stars[star],star);
X	  setbit(Stars[star]->explored,Playernum);
X	  setbit(Stars[star]->inhabited,Playernum);
X	  Stars[star]->AP[Playernum] = 5;
X	 putstar(enroll_stardata,Stars[star],star);
X	close(enroll_stardata);
X
X	fd = fopen(PLAYERDATAFL,"a");
X	fprintf(fd,"%s\n",loginname );
X	fclose(fd);
X
X    	sigsetmask(mask);
X
X	printf("You are player %d.\n",Playernum);
X	printf("Your race has been created on sector %d,%d on\n",
X						secttypes[i].x,secttypes[i].y);
X	printf("Planet %d of star %s.\n",pnum+1,Stars[star]->name);
X
X	/* chdir to your new home planet */
X	docommand("cs");
X
X}
END_OF_FILE
if test 7667 -ne `wc -c <'enrol.c'`; then
    echo shar: \"'enrol.c'\" unpacked with wrong size!
fi
# end of 'enrol.c'
fi
if test -f 'land.c' -a "${1}" != "-c" ; then 
  mv land.c land.c.orig
else
echo shar: Extracting \"'land.c'\" \(7653 characters\)
sed "s/^X//" >'land.c' <<'END_OF_FILE'
X/*
X** Galactic Bloodshed (Robert Chansky, smq@b)
X**  land.c -- land a ship
X**  also.... dock -- dock a ship w/ another ship 
X**  and..... assault -- a very un-PC version of land
X*/
X
X#include "vars.h"
X#include "ships.h"
X#include "races.h"
X#include <setjmp.h>
X#include <math.h>
X#include <curses.h>
Xextern jmp_buf main_jenv;
X#include <signal.h>
X
Xint land_sectdata,land_shfdata,land_shdata,land_pdata;
Xextern char telegram_buf[AUTO_TELEG_SIZE];
Xextern int Ignore_filelocks;
X
X
Xland(APcount, argn,args, assault)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
Xint assault;	/* unfriendly land */
X{
Xint land_handler();
Xchar c;
Xshiptype *s,*s2;
Xplanettype *p;
Xsectortype *sect;
Xplacetype where;
Xbool cont,planetmod=0,sectmod=0;
Xint shipno,x= -1,y= -1,i;
Xfloat fuel;
Xdouble Dist;
Xchar buf[200];
X
Xland_sectdata = land_shfdata = land_shdata = land_pdata = NEUTRAL_FD;
Xsignal(SIGINT, land_handler);
X
X  if (argn!=2) {
X	printf("%s what ship #", args[0]);
X	scanf("%d",&shipno);
X	getchr();
X  } else {
X	i = (args[1][0]=='#');
X	sscanf(args[1]+i,"%d",&shipno);
X  }
X  openshdata(&land_shdata);
X  if (!getship(land_shdata, &s, shipno)) {
X	land_handler();
X  }
X  if (s->owner!=Playernum) {
X	DontOwnErr(shipno);
X	land_handler();
X  }
X  if (s->rad) {
X	printf("%s is irradiated and inactive.\n",Shipnames[s->type]);
X	land_handler();
X  }
X  if (!enufAP(Stars[s->storbits]->AP, APcount)) 
X	land_handler();
X  if (s->is_docked) {
X	printf("Ship #%d is already docked.\n",shipno);
X	land_handler();
X  }
X
X  printf("%s %s #%d on: ", args[0], Shipnames[s->type], shipno);
X  scanf("%100s", buf);
X  getchr();
X  Ignore_filelocks = 1;
X  where = Getplace(buf, 0);
X  Ignore_filelocks = 0;
X  if (where.err)
X	land_handler();
X
X  if (where.level==LEVEL_SHIP) {
X	free(where.shipptr);
X	Ignore_filelocks = 1;
X	if (!getship(land_shdata, &where.shipptr, where.shipno))
X		land_handler();
X	Ignore_filelocks = 0;
X	if (where.shipptr->is_docked) {
X		printf("ship #%d is already docked.\n",where.shipno);
X		land_handler();
X	}
X	printf("Distance to ship #%d: %.2g.\n", where.shipno,
X  		Dist = sqrt((double)Distsq(where.shipptr->xpos, 
X  		      where.shipptr->ypos, s->xpos, s->ypos ) ) );
X	if (Dist > DIST_TO_LAND) {
X	     printf("Ship #%d must be %.3g or closer to ship #%d.(%.2f).\n",
X			shipno, DIST_TO_LAND, where.shipno, Dist);
X	     land_handler();
X	}
X
X	fuel = 0.05 + Dist * 0.5;
X	printf("This maneuver will take %g fuel (of %.2f.)\n",fuel,s->fuel);
X	if (fuel > s->fuel) {
X		printf("Not enough fuel.\n");
X		land_handler();
X	}
X	s->fuel -= fuel;
X	s->mass -= fuel * MASS_FUEL;
X	s->is_docked = 1;
X	s->whatdest = LEVEL_SHIP;
X	s->destshipno = where.shipno;
X	s->xpos = where.shipptr->xpos + 1.0;
X	s->ypos = where.shipptr->ypos;
X	putship(land_shdata, s, shipno);
X	where.shipptr->is_docked = 1;
X	where.shipptr->whatdest = LEVEL_SHIP;
X	where.shipptr->destshipno = shipno;
X	putship(land_shdata, where.shipptr, where.shipno);
X	close(land_shdata);
X	printf("ship #%d docked.\n",shipno);
X	land_handler();
X  } else 
X    if (where.shipptr->whatorbits!=LEVEL_PLAN) {
X	printf("Huh?\n");
X	land_handler();
X    }
X
X  openpdata(&land_pdata);
X  getplanet(land_pdata, &p, Stars[s->storbits]->planetpos[s->pnumorbits]);
X  
X  printf("Planet /%s/%s has gravity field of %.2f.\n", Stars[s->storbits]->name,
X	Stars[s->storbits]->pnames[s->pnumorbits], gravity(p));
X
X  printf("Distance to planet: %.2f.\n",
X  	Dist = sqrt((double)Distsq(Stars[s->storbits]->xpos + p->xpos, 
X  		      Stars[s->storbits]->ypos + p->ypos, 
X  		      s->xpos, s->ypos ) )
X  	);
X
X  if (Dist > DIST_TO_LAND) {
X     printf("Ship #%d must be %.3g or closer to the planet (%.2f).\n",shipno, DIST_TO_LAND, Dist);
X     land_handler();
X  }
X
X  fuel = 0.05 + logscale(s->mass)*gravity(p) * LAND_GRAV_MASS_FACTOR + assault;
X
X  printf("That maneuver will cost you %.2f fuel (of %.2f).\n",fuel, s->fuel);
X
X  if (s->fuel < fuel) {
X	  tty_on();
X	  printf("NOT ENOUGH FUEL-- continue? (y/n) ");
X	  putchr(c = getchr());
X	  if (c != 'y') {
X		land_handler();
X		tty_off();
X	  }
X  }
X  tty_off();
X
X  cont = 0;
X  do {
X    printf("%s on",(s->fuel < fuel) ? "CRASH" : args[0]);
X    GetMapSector(p, &x, &y);
X    if (assault) {
X	    opensectdata(&land_sectdata);
X	    getsector(land_sectdata,&sect,p->sectormappos+(y*p->Maxx+x)*sizeof(sectortype));
X	    if (sect->owner==Playernum) {
X		printf("You cannot assault your own sector.\n");
X		close(land_sectdata);
X		free(sect);
X	    } else if (sect->popn > 0) {
X		printf("The assaulted sector must have no population.\n");
X		close(land_sectdata);
X		free(sect);
X	    } else 
X		cont = 1;
X    }
X    if (sect->des != Race->likesbest) {
X	printf("Your ship cannot land on a %c sector.\n",desshow(sect));
X	close(land_sectdata);
X	free(sect);
X    }
X  } while (!cont);
X
X  if (s->fuel < fuel) {
X
X	where.level = LEVEL_PLAN;
X	where.snum = s->storbits;
X	where.pnum = s->pnumorbits;
X
X	printf("BO\007OM!! Ship #%d crashes on sector %d,%d with blast radius of %d.\n",
X		shipno, x, y, (int)(s->mass/15+1+s->destruct/3) );
X
X	if (!fork()) {
X		/* fork off a child process to do damage */
X	  blast(where, p, x, y, (int)(s->mass/15+1+s->destruct/3+s->fuel/5), 
X			(int)(s->destruct/3+2) );
X
X	  openshfdata(&land_shfdata);
X	  destroyship(land_shfdata,shipno);	/* kill the ship */
X	  close(land_shfdata);
X
X	  for (i=0; i<MAXPSHIPS && p->shipnums[i]!=shipno; i++)
X		if (p->shipnums[i] == shipno) {
X			planetmod = 1;
X			p->shipnums[i] = 0;
X			p->numships--;
X		}
X	  
X	  deductAPs(APcount, s->storbits, 0);
X	  launch_handler();
X
X	  exit(0);
X	}
X  }
X  s->xpos = (float)x;
X  s->ypos = (float)y;
X
X  s->fuel -= fuel;
X  s->mass -= fuel * MASS_FUEL;
X  s->is_docked = 1;
X  s->whatdest = LEVEL_PLAN;	/* no destination */
X  s->deststar = s->storbits;
X  s->destpnum = s->pnumorbits;
X
X  if (assault) {
X		/* assault on planet increases combat readiness, */
X		/* but only if we aren't already well-established there */
X	if (!p->info[Playernum-1].numsectsowned && p->info[Playernum-1].comread < 50) {
X		p->info[Playernum-1].comread = 100;
X		p->info[Playernum-1].mob_set = 100;
X		sect->mobilization = 100;
X		sect->is_wasted = 0;
X	}
X	sectmod = planetmod = 1;
X	  /* unload some people onto the sector */
X	sect->popn = s->popn-1;
X	sect->owner = Playernum;
X	p->info[Playernum-1].numsectsowned++;
X	s->mass -= (s->popn-1) * Race->mass;
X	s->popn = 1;
X  }
X
X /* } */
X
X  deductAPs(APcount, s->storbits, 0);
X
X  putship(land_shdata, s, shipno);
X  close(land_shdata);
X
X  if (planetmod) {
X	  putplanet(land_pdata,p,Stars[s->storbits]->planetpos[s->pnumorbits]);
X  }
X  close(land_pdata);
X  free(p);
X
X  if (sectmod)
X	  putsector(land_sectdata,sect,p->sectormappos+(y*p->Maxx+x)*sizeof(sectortype));
X  if (assault) {
X	  close(land_sectdata);
X	  free(sect);
X  }
X
X	/* send telegs to anyone there */
X  if (s->whatdest == LEVEL_PLAN) {
X	  teleg_add("",telegram_buf);
X	  if (assault)
X		  sprintf(buf,"BULLETIN!\n\nPlanet /%s/%s ASSAULTED by ship #%d on sector %.0f,%.0f!!\n", Stars[s->storbits]->name,
X			Stars[s->storbits]->pnames[s->pnumorbits], shipno,
X			s->xpos, s->ypos);
X	  else
X		  sprintf(buf,"Bulletin...\n\nShip #%d observed landing on sector %.0f,%.0f,\nplanet /%s/%s.\n",shipno,s->xpos,s->ypos,Stars[s->storbits]->name,
X			Stars[s->storbits]->pnames[s->pnumorbits]);
X	  teleg_add(buf,telegram_buf);
X	  for (i=1; i<MAXPLAYERS; i++)
X		if (p->info[i-1].numsectsowned && i!=Playernum)
X		     teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf);
X  }
X
X  if (s->whatdest==LEVEL_PLAN)
X  	printf("ship #%d landed on planet.\n",shipno);
X  else
X	printf("ship #%d docked.\n",shipno);
X  free(s);
X}
X
X
X
Xland_handler(sig, code, scp)
Xint sig,code;
Xstruct sigcontext *scp;
X{
X close(land_pdata);
X close(land_shdata);
X close(land_sectdata);
X close(land_shfdata);
X Ignore_filelocks = 0;
X longjmp(main_jenv,1);
X}
END_OF_FILE
if test 7653 -ne `wc -c <'land.c'`; then
    echo shar: \"'land.c'\" unpacked with wrong size!
fi
# end of 'land.c'
fi
if test -f 'launch.c' -a "${1}" != "-c" ; then 
  mv launch.c launch.c.orig
else
echo shar: Extracting \"'launch.c'\" \(3757 characters\)
sed "s/^X//" >'launch.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X *  launch.c -- launch or undock a ship
X */
X
X#include "vars.h"
X#include "ships.h"
X#include <setjmp.h>
Xextern jmp_buf main_jenv;
X#include <signal.h>
X
Xint launch_shdata,launch_pdata;
Xextern int Ignore_filelocks;
X
X
Xlaunch(APcount, argn,args)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xint launch_handler();
Xshiptype *s,*s2;
Xplanettype *p;
Xbool planet=0;
Xint shipno,o;
Xfloat fuel;
X
Xlaunch_shdata = launch_pdata = NEUTRAL_FD;
Xsignal(SIGINT, launch_handler);
X
X  if (argn!=2) {
X	printf("Launch what ship #");
X	scanf("%d",&shipno);
X	getchr();
X  } else {
X	o = (args[1][0]=='#');
X	sscanf(args[1]+o,"%d",&shipno);
X  }
X  openshdata(&launch_shdata);
X  if (!getship(launch_shdata, &s, shipno)) {
X	launch_handler();
X  }
X  if (s->owner!=Playernum) {
X	DontOwnErr(shipno);
X	launch_handler();
X  }
X  if (!can_move(s)) {
X	printf("That cannot be launched.\n");
X	launch_handler();
X  }
X  if (s->rad) {
X	printf("%s irradiated and inactive.\n", Shipnames[s->type]);
X	launch_handler();
X  }
X  if (!s->is_docked) {
X	printf("Ship #%d is not landed or docked.\n",shipno);
X	launch_handler();
X  }
X
X  if (s->whatdest==LEVEL_SHIP) {
X
X  	if (s->whatorbits==LEVEL_UNIV)
X	  if (!enufAP(Sdata.AP, APcount)) 
X		launch_handler();
X	  else
X  		deductAPs(APcount, 0, 1);
X  	else
X	  if (!enufAP(Stars[s->storbits]->AP, APcount)) 
X		launch_handler();
X	  else
X  		deductAPs(APcount, s->storbits, 0);
X	Ignore_filelocks = 1;
X	(void)getship(launch_shdata, &s2, s->destshipno);
X	Ignore_filelocks = 0;
X	s->is_docked = 0;
X	s->whatdest = LEVEL_UNIV;	/* no destination */
X	putship(launch_shdata, s, shipno);
X	s2->is_docked = 0;
X	s2->whatdest = LEVEL_UNIV;
X	putship(launch_shdata, s2, s->destshipno);
X	close(launch_shdata);
X	free(s);
X	free(s2);
X	printf("%s #%d undocked from ship #%d", Shipnames[s->type], shipno, s->destshipno);
X
X  } else {
X	  if (!enufAP(Stars[s->storbits]->AP, APcount)) 
X		launch_handler();
X	  else
X  		deductAPs(APcount, s->storbits, 0);
X
X  s->is_docked = 0;
X  s->whatdest = LEVEL_UNIV;	/* no destination */
X
X
X	/* adjust x,ypos to absolute coords */
X  openpdata(&launch_pdata);
X  getplanet(launch_pdata, &p, Stars[s->storbits]->planetpos[s->pnumorbits]);
X  if (p->is_explored)		/* no alteration of the planet unless this.. */
X  	close(launch_pdata);
X
X  printf("Planet /%s/%s has gravity field of %.2f\n", Stars[s->storbits]->name,
X	Stars[s->storbits]->pnames[s->pnumorbits], gravity(p));
X   /* alter sector location of ship x,y to stellar coords x,y */
X  s->xpos = Stars[s->storbits]->xpos + p->xpos + 
X		(float)int_rand((int)(-DIST_TO_LAND),(int)(DIST_TO_LAND));
X  s->ypos = Stars[s->storbits]->ypos + p->ypos + 
X		(float)int_rand((int)(-DIST_TO_LAND),(int)(DIST_TO_LAND));
X
X   /* subtract fuel from ship */
X  fuel = gravity(p) * s->mass * LAUNCH_GRAV_MASS_FACTOR;
X  if (s->fuel < fuel) {
X	printf("Ship #%d does not have enough fuel! (%.1f)\n",shipno, fuel);
X	launch_handler();
X  }
X  s->fuel -= fuel;
X  s->mass -= fuel * MASS_FUEL;
X
X  deductAPs(APcount, s->storbits, 0);
X
X
X  if (s->type == OTYPE_CANIST)
X	s->orders.object.number = 20;	/* canister dissapates after 20 turns */
X
X  putship(launch_shdata, s, shipno);
X  close(launch_shdata);
X
X  if (!p->is_explored) {
X		/* not yet explored by owner; space exploration causes the
X		   player to see a whole map */
X	p->is_explored = 1;
X  	putplanet(launch_pdata,p,Stars[s->storbits]->planetpos[s->pnumorbits]);
X  	close(launch_pdata);
X  }
X  free(p);
X
X  printf("%s #%d launched from planet,", Shipnames[s->type], shipno);
X  printf(" using %.1f fuel.\n",fuel);
X  if (s->type == OTYPE_CANIST)
X	printf("A thick cloud of dust envelops your planet.\n");
X
X  free(s);
X
X  }
X
X}
X
X
Xlaunch_handler()
X{
X Ignore_filelocks = 0;
X close(launch_pdata);
X close(launch_shdata);
X longjmp(main_jenv,1);
X}
END_OF_FILE
if test 3757 -ne `wc -c <'launch.c'`; then
    echo shar: \"'launch.c'\" unpacked with wrong size!
fi
# end of 'launch.c'
fi
if test -f 'load.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'load.c'\"
  mv load.c load.c.orig
else
echo shar: Extracting \"'load.c'\" \(8731 characters\)
sed "s/^X//" >'load.c' <<'END_OF_FILE'
X
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X *  load.c -- load/unload stuff
X */
X
X#include "vars.h"
X#include "ships.h"
X#include "races.h"
X#include <curses.h>
X#include <signal.h>
X#include <setjmp.h>
Xextern jmp_buf main_jenv;
Xextern int Ignore_filelocks;
Xextern char telegram_buf[AUTO_TELEG_SIZE];
Xint load_shdata,load_pdata,load_sectdata;
X
X
Xload(APcount, argn,args)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
X{
Xbool jett=0,sh=0;
Xint first=1,proc,Mod=0,lolim,uplim,shipno,amt;
Xchar commod, buf[100],bufr[70],bufd[70],buff[70],bufc[70];
Xshiptype *s,*s2;
Xplanettype *p;
Xsectortype *sect;
Xint load_handler();
X
X    load_shdata = load_pdata = load_sectdata = NEUTRAL_FD;
X    signal(SIGINT, load_handler);
X
X    if (argn==1) {
X      printf("ship #");
X      scanf("%d",&shipno);
X      getchr();
X    } else 
X	shipno = atoi(args[1] + ((args[1][0])=='#') ? 1 : 0);
X
X    openshdata(&load_shdata);
X    if (!getship(load_shdata,&s,shipno)) {
X	load_handler();
X    }
X    if (s->owner!=Playernum || s->is_dead) {
X	DontOwnErr(shipno);
X	printf("(%d)\n",s->owner);
X	free(s);
X	load_handler();
X    }
X    if (s->rad) {
X	printf("%s #%d is irradiated and inactive.\n", Shipnames[s->type],shipno);
X	free(s);
X	load_handler();
X    }
X
X
X   do {
X
X    proc = 0;
X
X    if (s->type == OTYPE_TRANSDEV) {
X	Ignore_filelocks = 1;
X	if (!getship(load_shdata,&s2, s->orders.object.number)) {
X		printf("The hopper seems to be blocked.\n");
X		load_handler();
X	}
X	Ignore_filelocks = 0;
X	if (s2->is_dead) {
X		printf("The target device does not exist.\n");
X		load_handler();
X	}
X	if (s2->type!=OTYPE_TRANSDEV || !s2->orders.object.on) {
X		printf("The target device is not receiving.\n");
X		load_handler();
X	}
X    } else if (!s->is_docked) {
X	if (s->type==OTYPE_TRANSDEV) {
X		printf("It does not seem to work in zero-g environments.\n");
X		load_handler();
X	}
X	printf("%s #%d is not landed.\n",is_object(s)?"object":"ship",shipno);
X      	tty_on();
X	printf("  jettison into open space (y/n)?");
X	jett = 1;
X      	commod=getchr();
X      	tty_off();
X      	if (commod!='y')
X		load_handler();
X    } else {
X	if (s->whatdest==LEVEL_PLAN)
X		printf("Ship #%d at %.2f,%.2f\n", shipno,s->xpos, s->ypos);
X	else {
X		Ignore_filelocks = 1;
X		if (!getship(load_shdata, &s2, s->destshipno) || s2->is_dead ||
X			!(s2->is_docked && s2->whatdest==LEVEL_SHIP) ) {
X				/* the ship it was docked with died or
X				   something. */
X			s->is_docked = 0;
X			s->whatdest = LEVEL_UNIV;
X			putship(load_shdata, &s, shipno);
X			printf("ship is not docked.\n");
X			load_handler();
X		}
X		Ignore_filelocks = 0;
X		printf("Ship #%d docked with %s #%d\n", shipno, 
X				Shipnames[s2->type], s->destshipno);
X		sh = 1;
X	}
X    }
X
X
X    if (!jett && !sh) {
X    	openpdata(&load_pdata);
X    	getplanet(load_pdata,&p,Stars[Dir.snum]->planetpos[Dir.pnum]);
X    }
X
X    if (first) {
X      if (s->whatorbits==LEVEL_UNIV)
X    	if (!enufAP(Sdata.AP, APcount))
X		load_handler();
X      else 
X	if (!enufAP(Stars[s->storbits]->AP, APcount))
X		load_handler();
X    }
X
X
X   do {
X
X    tty_on();
X    printf("%s #%d:(rfdc? q) >", Shipnames[s->type], shipno);
X    commod = getchr();
X    putchr('\n');
X    tty_off();
X
X    if (!jett && !sh && commod=='c') {
X    	opensectdata(&load_sectdata);
X    	getsector(load_sectdata,&sect,p->sectormappos + ( (int)s->ypos*p->Maxx+(int)s->xpos) * sizeof(sectortype) );
X    }
X
X    switch (commod) {
X	case 'c': lolim = - s->popn;
X		  uplim = jett ? 0 : sh ? s2->popn :
X			MIN(sect->popn, 
X				 Shipdata[s->type][ABIL_MAXCREW] - s->popn);
X		  proc = 1;
X		  break;
X	case 'd': lolim = - s->destruct;
X		  uplim = jett ? 0 : sh ? s2->destruct :
X			MIN(p->info[Playernum-1].destruct,
X			         Shipdata[s->type][ABIL_DESTCAP] - s->destruct);
X		  proc = 1;
X		  break;
X	case 'f': lolim = - s->fuel;
X		  uplim = jett ? 0 : sh ? s2->fuel :
X			MIN(p->info[Playernum-1].fuel,
X			         Shipdata[s->type][ABIL_FUELCAP] - s->fuel);
X		  proc = 1;
X		  break;
X	case 'r': lolim = - s->resource;
X		  uplim = jett ? 0 : sh ? s->resource :
X			MIN(p->info[Playernum-1].resource,
X			         Shipdata[s->type][ABIL_CARGO] - s->resource);
X		  proc = 1;
X		  break;
X	case '?': printf("\nship #%3d:\n",shipno);
X		  printf("       res:%u\n       fuel:%.1f\n       crew:%u\n       dest:%u\n", s->xpos,s->ypos, s->resource, s->fuel, s->popn, s->destruct);
X		  if (sh) {
X			printf("docked with %s #%d:\n",s->destshipno);
X			printf("       res:%u\n       fuel:%.1f\n       crew:%u\n       dest:%u\n", s2->xpos,s2->ypos, s2->resource, s2->fuel, s2->popn, s2->destruct);
X		  }
X		  proc = 0;
X		  break;
X	case 'q':
X	case ' ':
X		  load_handler();
X		  break;
X	default:  printf("%c not valid.\n",commod);
X		  proc = 0;
X		  load_handler();
X      }
X     } while (!proc);
X
X      tty_off();
X      amt = uplim + 1;
X      while (amt<lolim || amt>uplim) {
X	  printf("      amount (%d to %d) ",lolim,uplim);
X	  if (scanf("%d",&amt)!=1) 
X		amt=uplim+1;	/* force error */
X	  getchr();
X      }
X    if (amt == 0)
X	 load_handler();
X
X    switch (commod) {
X	case 'c': if (!jett) {
X			if (sh) {
X				s2->popn -= amt;
X				s2->mass -= amt*Race->mass;
X			} else {
X		  	   if (sect->popn==0 && amt<0) {
X				p->info[Playernum-1].numsectsowned++;
X				sect->owner = Playernum;
X				printf("sector %.0f,%.0f COLONIZED.\n",s->xpos,s->ypos);
X		  	   }
X		  	   sect->popn -= (us)amt;
X		  	   p->popn -= amt;
X		  	   if (sect->popn==0) {
X				p->info[Playernum-1].numsectsowned--;
X				sect->owner = 0;
X				printf("sector %.0f,%.0f evacuated.\n",s->xpos,s->ypos);
X		  	   }
X			}
X		  }
X		  printf("crew complement of ship #%d is now %u.\n", 
X			shipno, s->popn+amt);
X		  s->popn += amt;
X		  s->mass += amt*Race->mass;
X		  Mod = 1;
X		  break;
X	case 'd': s->destruct += amt;
X		  s->mass += amt*MASS_DESTRUCT;
X		  if (!jett)
X		  	p->info[Playernum-1].destruct -= amt;
X		  else if (sh) {
X			s2->destruct -= amt;
X			s2->mass -= amt*MASS_DESTRUCT;
X		  }
X		  Mod = 1;
X		  break;
X	case 'f': s->fuel += amt;
X		  s->mass += amt*MASS_FUEL;
X		  if (!jett)
X		  	p->info[Playernum-1].fuel -= amt;
X		  else if (sh) {
X			s2->fuel -= amt;
X			s2->mass -= amt*MASS_FUEL;
X		  }
X		  Mod = 1;
X		  break;
X	case 'r': s->resource += amt;
X		  s->mass += amt*MASS_RESOURCE;
X		  if (!jett)
X		  	p->info[Playernum-1].resource -= amt;
X		  else if (sh) {
X			s2->resource -= amt;
X			s2->mass -= amt*MASS_FUEL;
X		  }
X		  Mod = 1;
X		  break;
X	case 'q':
X	case ' ':
X	case '?':
X	default:
X		break;
X    }
X
X    putship(load_shdata,s,shipno);
X
X    if (s->type==OTYPE_TRANSDEV || sh) {
X	/* send stuff to other transport device */
X	if (s->resource) {
X		printf("Zap! %d resources sent.\n", s->resource);
X		sprintf(bufr, "%d Resources\n",s->resource);
X		s2->mass += s->resource * MASS_RESOURCE;
X		s2->resource += s->resource;
X		s->mass -= s->resource * MASS_RESOURCE;
X		s->resource = 0;
X	} else
X		bufr[0] = '\0';
X	if (s->fuel) {
X		printf("Zap! %g fuel sent.\n", s->fuel);
X		sprintf(buff, "%g Fuel\n",s->fuel);
X		s2->fuel += s->fuel;
X		s2->mass += s->fuel * MASS_FUEL;
X		s->mass -= s->fuel * MASS_FUEL;
X		s->fuel = 0.0;
X	} else
X		buff[0] = '\0';
X	if (s->destruct) {
X		printf("Zap! %d destruct sent.\n", s->destruct);
X		sprintf(bufd, "%d Destruct\n",s->destruct);
X		s2->mass += s->destruct * MASS_DESTRUCT;
X		s2->destruct += s->destruct;
X		s->mass -= s->destruct * MASS_DESTRUCT;
X		s->destruct = 0;
X	} else
X		bufd[0] = '\0';
X	if (s->popn) {
X		printf("Zap! %d popn sent.\n", s->popn);
X		sprintf(bufc, "%d %s\n",s->destruct,Race->Thing?"tons of biomass" : "population");
X		s2->mass += s->popn * Race->mass;
X		s2->popn += s->popn;
X		s->mass -= s->popn * Race->mass;
X		s->popn = 0;
X	} else
X		bufc[0] = '\0';
X	putship(load_shdata,s2,s->orders.object.number);
X
X      if (s2->owner!=s->owner) {
X	teleg_add("", telegram_buf);
X	teleg_add("BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #",telegram_buf);
X	sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->orders.object.number);
X	teleg_add(buf,telegram_buf);
X	teleg_add(bufr,telegram_buf);
X	teleg_add(bufd,telegram_buf);
X	teleg_add(buff,telegram_buf);
X	teleg_add(bufc,telegram_buf);
X	teleg_send(TELEG_PLAYER_AUTO, s2->owner, telegram_buf);
X      }
X    }
X
X
X    if (!jett && !sh) {
X
X      if (commod=='c') {
X	putsector(load_sectdata,sect,p->sectormappos + ( (int)s->ypos*p->Maxx+(int)s->xpos) * sizeof(sectortype) );
X    	close(load_sectdata);
X	free(sect);
X       }
X
X       putplanet(load_pdata,p,Stars[Dir.snum]->planetpos[Dir.pnum]);
X       close(load_pdata);
X       free(p);
X     }
X
X    if (Mod && first) {
X         first = 0;
X         if (s->whatorbits==LEVEL_UNIV)
X		deductAPs(APcount, 0, 1);	/* ded from sdata */
X         else 
X		deductAPs(APcount, s->storbits, 0);
X
X    }
X
X   } while (1);
X
X
X
X}
X
X
X
Xload_handler()
X{
X Ignore_filelocks = 0;
X close(load_shdata);
X close(load_pdata);
X close(load_sectdata);
X longjmp(main_jenv,1);
X}
END_OF_FILE
if test 8731 -ne `wc -c <'load.c'`; then
    echo shar: \"'load.c'\" unpacked with wrong size!
fi
# end of 'load.c'
fi
if test -f 'max.c' -a "${1}" != "-c" ; then 
  mv max.c max.c.orig
else
echo shar: Extracting \"'max.c'\" \(1570 characters\)
sed "s/^X//" >'max.c' <<'END_OF_FILE'
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X * max() -- return how many people one sector can support
X * Distmap() -- map-oriented distance that does not look square
X * compatibility() -- return how much race is compatible with planet
X * gravity() -- return gravity for planet
X * prin_ship_orbits() -- prints place ship orbits
X */
X
X#include "vars.h"
X#include "races.h"
X#include "ships.h"
X#include <math.h>
X
Xint maxsupport(p)
Xreg sectortype *p;
X{
X return(
X	(int)(powscale(p->eff)*FACTOR_FERT_SUPPORT*p->fert+p->fert + 1)
X       );
X}
X
X
X
Xint Distmap(x,y,x2,y2)
Xreg int x,y,x2,y2;
X{
X return( round_rand(fabs((double)x-x2) + fabs( (double)y-y2)*(RATIOXY*0.5) ) );
X}
X
X
Xfloat compatibility(planet, race)
Xreg planettype *planet;
Xreg racetype *race;
X{
X reg int i,add;
X reg float sum=1.0;
X
X	/* step through and report compatibility of each planetary gas */
X  for (i=TEMP; i<=OTHER; i++) {
X	add = ((float)planet->conditions[i] - race->conditions[i]);
X	sum *= 1.0 - (abs(add)/100.0);
X  }
X  return sum * 100.0; /** planet->conditions[TOXIC]*/
X}
X
X
X
Xfloat gravity(p)
Xplanettype *p;
X{
X return (float)p->Maxx * p->Maxy * GRAV_FACTOR;
X}
X
X
X
Xchar Dispshiporbits_buf[PLACENAMESIZE+13];
X
Xchar *prin_ship_orbits(s)
Xshiptype *s;
X{
X
X  switch (s->whatorbits) {
X	case LEVEL_UNIV:
X		sprintf(Dispshiporbits_buf,"-");
X		break;
X	case LEVEL_STAR:
X		sprintf(Dispshiporbits_buf,"/%s", Stars[s->storbits]->name);
X		break;
X	case LEVEL_PLAN:
X		sprintf(Dispshiporbits_buf,"/%s/%s", 
X			Stars[s->storbits]->name,
X			Stars[s->storbits]->pnames[s->pnumorbits]);
X		break;
X  }
X  return Dispshiporbits_buf;
X}
END_OF_FILE
if test 1570 -ne `wc -c <'max.c'`; then
    echo shar: \"'max.c'\" unpacked with wrong size!
fi
# end of 'max.c'
fi
if test -f 'rst.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rst.c'\"
  mv rst.c rst.c.orig
else
echo shar: Extracting \"'rst.c'\" \(6461 characters\)
sed "s/^X//" >'rst.c' <<'END_OF_FILE'
X
X/*
X * Galactic Bloodshed (Robert Chansky, smq@b)
X *  ship -- report -- stock -- tactical -- stuff on ship
X */
X
X#define REPORT	0
X#define STOCK	1
X#define TACTICAL 2
X#define SHIP	3
X#define OBJECT	4
X
X#include <math.h>
X#include "vars.h"
X#include "ships.h"
Xextern char Shipltrs[];
Xextern char *prin_ship_dest();
Xextern int God;
Xextern int Ignore_filelocks;
Xstatic bool Object,Ship,Stock,Report,Tactical,first;
X
Xstruct reportdata {
X	shiptype *s;
X	short n;
X	float x,y;
X};
X
Xint Num_ships;
X
Xrst(APcount, argn,args,Rst)
Xint APcount;
Xint argn;
Xchar args[MAXARGS][COMMANDSIZE];
Xint Rst;
X{
X int shdata,shipno;
X reg int i;
X struct reportdata sh[MAXTOTALSHIPS];
X
X Num_ships = 0;
X first = 1;
X switch (Rst) {
X	case REPORT:	Report = 1;
X			Object = Stock = Ship = Tactical = 0;
X			break;
X	case STOCK:	Stock = 1;
X			Object = Report = Ship = Tactical = 0;
X			break;
X	case TACTICAL:	Tactical = 1;
X			Object = Report = Ship = Stock = 0;
X			break;
X	case SHIP:	Ship = Report = Stock = Tactical = 1;
X			Object = 0;
X			break;
X	case OBJECT:	Object = Report = Stock = Tactical = 1;
X			Ship = 0;
X			break;
X }
X
X if (argn==2) {
X   sscanf(args[1] + (*args[1]=='#' ? 1 : 0),"%d",&shipno);
X   openshdata(&shdata);
X   Getrship(shdata,sh, shipno, 0.0, 0.0);
X   close(shdata);
X   ship_report(sh,0);		/* first ship report */
X
X } else
X
X  switch (Dir.level) {
X   case LEVEL_UNIV:
X      if (Sdata.numships) {
X	  openshdata(&shdata);
X	  for (i=0; i<MAXUSHIPS; i++) {
X	    if (Sdata.shipnums[i])
X	      Getrship(shdata,sh, Sdata.shipnums[i],0.0, 0.0);
X	  }
X	  close(shdata);
X      }
X      for (i=0; i<Sdata.numstars; i++)
X        star_getrships(sh,i);
X      for (i=0; i<Num_ships; i++)
X        ship_report(sh,i);
X      break;
X   case LEVEL_STAR:
X      star_getrships(sh,Dir.snum);
X      for (i=0; i<Num_ships; i++)
X        ship_report(sh,i);
X      break;
X   case LEVEL_PLAN:
X      plan_getrships(sh,Stars[Dir.snum]->planetpos[Dir.pnum],Stars[Dir.snum]->xpos,Stars[Dir.snum]->ypos);
X      for (i=0; i<Num_ships; i++)
X        ship_report(sh,i);
X      break;
X   case LEVEL_SHIP:
X      openshdata(&shdata);
X      Getrship(shdata,sh, Dir.shipno,0.0,0.0);
X      close(shdata);
X      ship_report(sh,0);		/* first ship report */
X      break;
X  }
X
X  Free_shiplist(sh);
X
X}
X
X
Xship_report(sh,indx)
Xstruct reportdata sh[];
Xint indx;
X{
X shiptype *s;
X int shipno;
X reg int i;
X placetype where;
X char orb[PLACENAMESIZE];
X float Dist;
X 
X	/* last ship gotten from disk */
X  s = sh[indx].s;
X  shipno = sh[indx].n;
X
X
X	/* a launched canister doesn't show up */
X  if ( !(s->type==OTYPE_CANIST && !s->is_docked) ) {
X
X
X   if (Stock) {
X    if (first) {
X      printf("  #   mass res  ^res  dest ^dest   fuel ^fuel  crew ^crew dock\n");
X      if (!Ship && !Object)
X	      first=0;
X    }
X    /*if (is_object(s) == Object)*/
X     if (s->owner == Playernum || God) {
X      printf("%3d %c%5.1f%4u%6d%6u%6d%7.1f%6d%6u%6d%5s",
X	shipno, Shipltrs[s->type], s->mass,
X	s->resource, Shipdata[s->type][ABIL_CARGO],
X	s->destruct, Shipdata[s->type][ABIL_DESTCAP],
X	s->fuel, Shipdata[s->type][ABIL_FUELCAP],
X	s->popn, Shipdata[s->type][ABIL_MAXCREW],
X	(s->is_docked) ? ((s->whatdest==LEVEL_PLAN) ? "land" : "dock") :"    ");
X      if (s->type==OTYPE_VN) 
X	printf(" * %d",s->orders.object.number);
X      if (s->rad)
X	printf(" INACTIVE(%d)",s->rad);
X      putchr('\n');
X
X    }
X   }
X   if (Report) {
X         if (first) {
X		 printf("  #   own dam dest  fuel land               orbits           destination\n");
X		 if (!Ship && !Object)
X		      first=0;
X	 }
X
X	if (s->owner == Playernum || God) {
X	 /*if (is_object(s) == Object) */
X 	  printf("%3d %c%4u%4u%5u%6.1f%5s %20s %21s",
X		shipno, Shipltrs[s->type],
X		s->owner, s->damage, s->destruct, s->fuel, 
X		(s->is_docked) ? ( (s->whatdest==LEVEL_SHIP) ? "dock" 
X			: "land") : "    ",
X		prin_ship_orbits(s), prin_ship_dest(s) );
X         if (s->type==OTYPE_VN) printf("* %d",s->orders.object.number);
X      if (s->rad)
X	printf(" INACTIVE(%d)",s->rad);
X         putchr('\n');
X
X	}
X   }
X	/* objects dont have a tac display */
X   if (Tactical) {
X	printf("  # typ dest  fuel dam    x,y abs     x,y rel    orbits\n");
X 	where.level = s->whatorbits;
X 	where.snum = s->storbits;
X 	where.pnum = s->pnumorbits;
X	sprintf(orb, "%.30s", Dispplace(&where));
X	printf("%3d  %c%6u%6.1f%4u%7.0f,%-7.0f%7.0f,%-7.0%10s",
X		shipno, Shipltrs[s->type], s->destruct,
X		s->fuel, s->damage, 
X		s->xpos, s->ypos, s->xpos-sh[indx].x, s->ypos-sh[indx].y, orb );
X	if (s->type == OTYPE_VN)
X		printf(" * %d", s->orders.object.number);
X        if (s->rad)
X		printf(" INACTIVE(%d)",s->rad);
X	putchr('\n');
X
X	if (!s->rad && Shipdata[s->type][ABIL_GUNS]) {
X	  printf("Tac display:  # own typ   rng  %dam\n");
X	  for (i=0; i<Num_ships; i++)
X		if (sh[i].s->owner != Playernum && sh[i].n!=shipno &&
X		    (Dist = sqrt(Distsq(s->xpos, s->ypos, sh[i].s->xpos,
X				sh[i].s->ypos))) < SYSTEMSIZE) {
X		   printf("%15d%4d%6.0f%6.0f",
X			sh[i].n, sh[i].s->owner, Shipltrs[sh[i].s->type], 
X			Dist, 0.0 );
X		   if (sh[i].s->type==OTYPE_VN)
X			printf(" * %d", sh[i].s->orders.object.number);
X		   putchr('\n');
X		}
X	}
X   }
X
X
X  }
X
X}
X
X
X
Xplan_getrships(sh,filepos,starx,stary)
Xstruct reportdata sh[];
Xint filepos;
Xfloat starx,stary;
X{
X register int i;
X planettype *p;
X int shdata,pdata;
X
X openpdata(&pdata);
X getplanet(pdata, &p,filepos);
X close(pdata);
X
X if (p->info[Playernum-1].explored) {
X
X   openshdata(&shdata);
X 	for (i=0; i<MAXPSHIPS; i++)
X  	   if (p->shipnums[i])
X		Getrship(shdata, sh, p->shipnums[i], starx, stary);
X   close(shdata);
X }
X free(p);
X}
X
X
Xstar_getrships(sh,snum)
Xstruct reportdata sh[];
Xint snum;
X{
X register int i;
X int shdata;
X
X if (isset(Stars[snum]->inhabited, Playernum)) {
X   openshdata(&shdata);
X   for (i=0; i<MAXSSHIPS; i++)
X     if (Stars[snum]->shipnums[i])
X	Getrship(shdata, sh, Stars[snum]->shipnums[i], Stars[snum]->xpos, 
X		Stars[snum]->ypos);
X   close(shdata);
X   for (i=0; i<Stars[snum]->numplanets; i++)
X     plan_getrships(sh,Stars[snum]->planetpos[i],Stars[snum]->xpos,Stars[snum]->ypos);
X }
X}
X
X
X/* get a ship from the disk and add it to the ship list we're maintaining. */
XGetrship(shdata,sh, shipno,xoff, yoff)
Xint shdata,shipno;
Xstruct reportdata sh[];
Xfloat xoff, yoff;
X{
Xint noerr;
X
X   Ignore_filelocks = 1;
X    noerr = getship(shdata,&sh[Num_ships].s,shipno);
X   Ignore_filelocks = 0;
X   sh[Num_ships].n = shipno;
X   sh[Num_ships].x = xoff;
X   sh[Num_ships].y = yoff;
X  if (noerr)
X	Num_ships++;
X}
X
X
XFree_shiplist(sh)
Xstruct reportdata sh[];
X{
X reg int i;
X
X for (i=0; i<Num_ships; i++)
X	free(sh[i].s);
X}
END_OF_FILE
if test 6461 -ne `wc -c <'rst.c'`; then
    echo shar: \"'rst.c'\" unpacked with wrong size!
fi
# end of 'rst.c'
fi
if test -f 'enroll.dat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'enroll.dat'\"
else
echo shar: Extracting \"'enroll.dat'\" \(2101 characters\)
sed "s/^X//" >'enroll.dat' <<'END_OF_FILE'
X
X
X
X
X
X
X
X
X                         Welcome to
X                Galactic Bloodshed Version 0.8
X                   Written by Robert Chansky
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X        You look around in the slime.  
X
X        Isn't there, you think, something more to life?  
X		Eradicating disease?  Exploring the universe?  A decent Pizza?
X
X        You gather your followers and start on the road
X                        to intelligence, to enlightenment, to purpose...
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X        Choose what type of planet you prefer to live on:
X
X
X                   Earth-type Planet
X           000000000011111111112222222222333333333 
X           012345678901234567890123456789012345678 
X         0 #######################################  <-- Ice (polar cap)
X         1 .##-###.--#^-##-..##---##.----.#...#### 
X         2 ......-.---^^#-^-.------...----.--.-.##
X         3 ..-....---^---^-.---^^--..-------.-....
X         4 ..-...----^----^----^^--.---^----......
X         5 ...-...-.-------^----^-----^^^^--......
X         6 .....---.-----^^--------.-----^--......
X         7 .....---.#-----------.--..-.-----......
X         8 .###...####--------###---......--###...
X         9 #####.#########-#######################  <-- Ice (polar cap)
X
X   
X              Gasgiant Planet                           Airless Planet
X   000000000011111111112222222222333333333          0000000000111111111122
X   012345678901234567890123456789012345678          0123456789012345678901
X 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        0 -^--^^^^^^^^^^-----^--
X 1 .........~~~~~~~~~~~~~~~~~~~~~~~~~.....        1 --^^^^^----^^^^^-^^^^^
X 2 .......................................        2 --^-^^^^^--^^^^^-^--^-
X 3 ~~~~~~~~~~~~~~~~~~~~.........~~~~~~~~~~        3 ---^--^-^^^^^----^----
X 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        4 ^^^^^---^----^^^^^--^-
X 5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        5 -^^^^^-------^^^^--^--
X 6 .......................................        6 --^----^----^---------
X 7 ~~~~~~~~~~~~~~~~~~~~~~~~~~.............
X 8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
X 9 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
X
X  
END_OF_FILE
if test 2101 -ne `wc -c <'enroll.dat'`; then
    echo shar: \"'enroll.dat'\" unpacked with wrong size!
fi
# end of 'enroll.dat'
fi
echo shar: End of shell archive.
exit 0