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

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

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



#! /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:  patches01a
# Wrapped by billr@saab on Mon May  1 10:08:58 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches01a' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches01a'\"
else
echo shar: Extracting \"'patches01a'\" \(50459 characters\)
sed "s/^X//" >'patches01a' <<'END_OF_FILE'
X*** ../../GB/races.h	Wed Apr 26 11:22:21 1989
X--- races.h	Mon May  1 08:21:32 1989
X***************
X*** 17,22 ****
X--- 17,24 ----
X      char deflevel,defsystem,defplanetnum;	/* current default */
X      int Playernum;
X      char name[RNAMESIZE];
X+     float likes[DES_ICE];		/* what territories they like */
X+     char likesbest;
X      percent translate[MAXPLAYERS];	/* translation mod for ea player */
X      char atwar[howmanybytes(MAXPLAYERS)];	/* war */
X      char allied[howmanybytes(MAXPLAYERS)];	/* allies */
X*** ../../GB/tweakables.h	Wed Apr 26 11:22:24 1989
X--- tweakables.h	Mon May  1 08:21:34 1989
X***************
X*** 5,22 ****
X   *	the functions using them are not recompiled so be careful.
X   */
X  
X- /*#define UNIX_VERSION4.3  /* otherwise assumes 4.2 */
X- 
X  #define VERS ".8"		/* game version */
X  
X  #define UPDATE_TIME 3		/* 3 hour  update time */
X- #define PAGER "/usr/ucb/zcat"
X  
X  
X- #include "files.h"
X- 
X- 
X- 
X  #define LOGIN_NAME_SIZE 13
X  
X  #define NUM_TIMES_TO_WAIT_FOR_LOCK 20
X--- 5,15 ----
X***************
X*** 42,60 ****
X  #define OTHER 	  9
X  #define TOXIC	 10
X  
X- #define CHAR_OWNED_LAND 	'x' 
X  #define CHAR_OWNED_THING 	'@' 
X! #define CHAR_UNOWNED_LAND 	'-'
X  #define CHAR_SEA 		'.'
X! #define CHAR_OWNED_SEA 		','
X  #define CHAR_MOUNT 		'^'
X- #define CHAR_OWNED_MOUNT 	'X'
X  #define CHAR_DIFFOWNED 		'?'
X  #define CHAR_PLATED 		'|'
X  #define CHAR_WASTELAND 		'%'
X! #define CHAR_OWNED_WASTELAND 	'#'
X  #define CHAR_GAS 		'~'
X  #define CHAR_CLOAKED 		' '
X  
X  #define NAMESIZE 15
X  #define RNAMESIZE 25
X--- 35,56 ----
X  #define OTHER 	  9
X  #define TOXIC	 10
X  
X  #define CHAR_OWNED_THING 	'@' 
X! #define CHAR_LAND 		'-'
X! #define CHAR_OWNED_LAND 	'x' 
X  #define CHAR_SEA 		'.'
X! #define CHAR_OWNED_SEA 		'x'
X  #define CHAR_MOUNT 		'^'
X  #define CHAR_DIFFOWNED 		'?'
X  #define CHAR_PLATED 		'|'
X  #define CHAR_WASTELAND 		'%'
X! #define CHAR_OWNED_WASTELAND 	'!'
X  #define CHAR_GAS 		'~'
X+ #define CHAR_OWNED_GAS 		'x'
X  #define CHAR_CLOAKED 		' '
X+ #define CHAR_ICE		'#'
X+ #define CHAR_OWNED_ICE		'x'
X+ #define CHAR_OWNED_MOUNT 	'X'
X  
X  #define NAMESIZE 15
X  #define RNAMESIZE 25
X***************
X*** 115,121 ****
X  #define CREAT_UNIV_ITERAT 10
X  #define MAP_ISLANDS 10		/* # of beginning islands for makeuniv */
X  #define MAP_MOUNT_PERCENT 0.22	/* percentage of mountain areas */
X! #define MAP_GASGIANT_BANDMIN 30  /* min size gasgiants that have bands */
X  #define LANDPERCENTAGE 0.45
X  
X  #define GRAV_FACTOR 0.0025	/* not sure as to what this should be*/
X--- 111,117 ----
X  #define CREAT_UNIV_ITERAT 10
X  #define MAP_ISLANDS 10		/* # of beginning islands for makeuniv */
X  #define MAP_MOUNT_PERCENT 0.22	/* percentage of mountain areas */
X! #define MAP_GASGIANT_BANDMIN 20  /* min size gasgiants that have bands */
X  #define LANDPERCENTAGE 0.45
X  
X  #define GRAV_FACTOR 0.0025	/* not sure as to what this should be*/
X***************
X*** 142,154 ****
X  #define SYSTEMGRAVCONST 	0.05
X  
X  
X! #define DIST_TO_LAND 5	/* moveship -- distance ship has to be to land */
X! #define DIST_TO_BURN 50	/* distance from sun needed to destroy ship */
X  
X  
X! #define FACTOR_DAMAGE 		28.0
X! #define FACTOR_DESTPLANET 	0.002
X! #define FACTOR_DAMAGE_DISTANCE 	4.00
X  
X  	/* various compiler options that may save cpu time/disk space */
X  #define SHELL_DOTURN 1			/* put doturn() in shell */
X--- 138,150 ----
X  #define SYSTEMGRAVCONST 	0.05
X  
X  
X! #define DIST_TO_LAND 5.0 /* moveship -- distance ship has to be to land */
X! /*#define DIST_TO_BURN 50	 /* distance from sun needed to destroy ship */
X  
X  
X! #define FACTOR_DAMAGE 		388.0
X! #define FACTOR_DESTPLANET 	1.004
X! #define FACTOR_DAMAGE_DISTANCE 	1.00
X  
X  	/* various compiler options that may save cpu time/disk space */
X  #define SHELL_DOTURN 1			/* put doturn() in shell */
X***************
X*** 169,176 ****
X--- 165,176 ----
X   /* sign,abs val of number */
X  #define sgn(x) ( ((x)>=0) ? (1) : (-1))
X  #define abs(x) ( ( (x)<0) ? -(x) : (x) )
X+ #define MIN(x,y) ( ((x)>(y)) ? (y) : (x) )
X+ #define MAX(x,y) ( ((x)<(y)) ? (y) : (x) )
X   /* positive modulus */
X  #define mod(a,b,dum) ((dum)=(a)%(b),abs(dum))
X+  /* swap two variables */
X+ #define	swap(a, b)  ((a) ^= (b), (b) ^= (a), (a) ^= (b))
X   /* euclidean distance */
X  #define Distsq(x1,y1,x2,y2) ( ((x1)-(x2))*((x1)-(x2)) + \
X  		((y1)-(y2))*((y1)-(y2)) )
X***************
X*** 179,208 ****
X  #define Sector(pl,x,y) (Smap[(x) + (y)*(pl).Maxx])
X  /* adjust temperature to displayed */
X  #define Temp(x) (((int)x)*25)
X- /* tty stuff */
X- #ifdef UV_4.3
X- #   define tty_on() cbreak()
X- #   define tty_off() nocbreak()
X- #else			/* this is 4.2 */
X- #   define tty_on() crmode()
X- #   define tty_off() nocrmode()
X- #endif
X  
X   /* number of AP's to add to each player in ea. system */
X   /*   (look in doturn)  */
X  #define LIMIT_APs 50	/* max # of APs you can have */
X  
X! #define MIN(x,y) ( ((x)>(y)) ? (y) : (x) )
X! #define MAX(x,y) ( ((x)<(y)) ? (y) : (x) )
X! #define TYPE_EARTH 0
X! #define TYPE_ASTEROID 1
X! #define TYPE_AIRLESS 2
X! #define TYPE_GASGIANT 3
X  
X! #define DES_SEA 0
X! #define DES_LAND 1
X! #define DES_MOUNT 2
X! #define DES_GAS 3
X! #define DES_PLATED 4
X! #define MAX_SECT_POPN 9999
X  
X--- 179,199 ----
X  #define Sector(pl,x,y) (Smap[(x) + (y)*(pl).Maxx])
X  /* adjust temperature to displayed */
X  #define Temp(x) (((int)x)*25)
X  
X   /* number of AP's to add to each player in ea. system */
X   /*   (look in doturn)  */
X  #define LIMIT_APs 50	/* max # of APs you can have */
X  
X! #define TYPE_EARTH 	0
X! #define TYPE_ASTEROID 	1
X! #define TYPE_AIRLESS 	2
X! #define TYPE_GASGIANT 	3
X  
X! #define DES_SEA 	0
X! #define DES_LAND 	1
X! #define DES_MOUNT 	2
X! #define DES_GAS 	3
X! #define DES_ICE		4
X! #define DES_PLATED 	5
X  
X+ #define MAX_SECT_POPN 9999
X*** ../../GB/vars.h	Wed Apr 26 11:22:25 1989
X--- vars.h	Mon May  1 08:21:35 1989
X***************
X*** 14,19 ****
X--- 14,20 ----
X  #define Bzero(x)  bzero( (char *)&(x), sizeof(x) )
X  #define Malloc(x) (x *)malloc( sizeof(x) )
X  
X+ #include "files.h"
X  #include "tweakables.h"
X  #include <sys/types.h>
X  #include <sys/file.h>
X*** ../../GB/cs.c	Wed Apr 26 11:22:30 1989
X--- cs.c	Mon May  1 08:21:39 1989
X***************
X*** 113,118 ****
X--- 113,119 ----
X    Dir.snum = where.snum;
X    Dir.pnum = where.pnum;
X    Dir.shipno = where.shipno;
X+   printf(" csing to st %d, pl %d\n",where.snum,where.pnum);
X  
X     /* fix prompt */
X        switch (Dir.level) {
X*** ../../GB/daemon.c	Wed Apr 26 11:22:31 1989
X--- daemon.c	Mon May  1 08:21:40 1989
X***************
X*** 4,9 ****
X--- 4,10 ----
X   */
X  
X  #include "tweakables.h"
X+ #include "files.h"
X  #include <stdio.h>
X  #include <signal.h>
X  #include <time.h>
X*** ../../GB/doplanet.c	Wed Apr 26 11:22:33 1989
X--- doplanet.c	Mon May  1 08:21:43 1989
X***************
X*** 269,275 ****
X  	 /* start a meso colony */
X  	x = int_rand(0,planet->Maxx-1);
X  	y = int_rand(0,planet->Maxy-1);
X! 	Sector(*planet,x,y).des = DES_LAND;	/* cheating. so what. */
X  	Sector(*planet,x,y).popn = 1;
X  	Sector(*planet,x,y).owner = Stinfo[starnum][planetnum].Thing_add;
X  }
X--- 269,276 ----
X  	 /* start a meso colony */
X  	x = int_rand(0,planet->Maxx-1);
X  	y = int_rand(0,planet->Maxy-1);
X! 	Sector(*planet,x,y).des = 
X! 			races[Stinfo[starnum][planetnum].Thing_add]->likesbest;
X  	Sector(*planet,x,y).popn = 1;
X  	Sector(*planet,x,y).owner = Stinfo[starnum][planetnum].Thing_add;
X  }
X***************
X*** 330,336 ****
X  					(!(p-1)->is_wasted || !(p+1)->is_wasted)
X  					&& !random()%5)
X  					p->is_wasted = 0;
X! 	      		} else if (p->des==DES_LAND || p->des==DES_MOUNT) {
X  				if ( y>1 && y<planet->Maxy-2 && 
X  				   ((p-1)->popn || (p+1)->popn)
X  				   && !random()%10)
X--- 331,337 ----
X  					(!(p-1)->is_wasted || !(p+1)->is_wasted)
X  					&& !random()%5)
X  					p->is_wasted = 0;
X! 	      		} else if (p->des==DES_LAND || p->des==DES_MOUNT || p->des==DES_ICE) {
X  				if ( y>1 && y<planet->Maxy-2 && 
X  				   ((p-1)->popn || (p+1)->popn)
X  				   && !random()%10)
X***************
X*** 340,348 ****
X         }
X  
X  	 /* evaporate the oceans on novae */
X!      if (Stars[starnum]->nova_stage && p->des==DES_SEA)
X  
X! 	if ( (x>0 && (p-1)->des==DES_LAND) ||
X  	     (x<planet->Maxx-1 && (p+1)->des==DES_LAND) || 
X  	     (y>0 && (p-planet->Maxx)->des==DES_LAND) ||
X  	     (y<planet->Maxy-1 && (p+planet->Maxx)->des==DES_LAND ) ) {
X--- 341,352 ----
X         }
X  
X  	 /* evaporate the oceans on novae */
X!      if (Stars[starnum]->nova_stage)
X!        if (p->des==DES_ICE)
X! 	   p->des = DES_LAND;
X!        else if (p->des==DES_SEA)
X  
X! 	  if ( (x>0 && (p-1)->des==DES_LAND) ||
X  	     (x<planet->Maxx-1 && (p+1)->des==DES_LAND) || 
X  	     (y>0 && (p-planet->Maxx)->des==DES_LAND) ||
X  	     (y<planet->Maxy-1 && (p+planet->Maxx)->des==DES_LAND ) ) {
X***************
X*** 366,374 ****
X  		 /* sectors have been modified for this player*/
X  		 /* & planet is compatible enough */
X  	     if (planet->info[i-1].numsectsowned && Compat[i] > 40.0)
X! 	       while (!Claims && !allexp && --timer) {
X  		 printf("exploring ... timer=%d\n",timer);
X- 		/*printf("exploring player %d\n",i);*/
X  		o = 1;
X  		Getxysect(planet, &x, &y, 1);
X  		while (!Claims && Getxysect(planet, &x, &y, 0)) {
X--- 370,377 ----
X  		 /* sectors have been modified for this player*/
X  		 /* & planet is compatible enough */
X  	     if (planet->info[i-1].numsectsowned && Compat[i] > 40.0)
X! 	      while (!Claims && !allexp && --timer) {
X  		 printf("exploring ... timer=%d\n",timer);
X  		o = 1;
X  		Getxysect(planet, &x, &y, 1);
X  		while (!Claims && Getxysect(planet, &x, &y, 0)) {
X***************
X*** 375,383 ****
X  			  /* find out if all sectors have been explored */
X  			o &= Sectinfo[x][y].explored[i];
X  			p = &Sector(*planet,x,y);
X! 			if (!p->owner && !p->is_wasted && p->des==DES_LAND && Sectinfo[x][y].explored[i]) {
X! 				 /* (water) explorations have found an island */
X! 				printf("found an island @ %d,%d\n",x,y);
X  				Claims = i;
X  				 /* give them some free people there */
X  				p->popn = races[i]->number_sexes;
X--- 378,386 ----
X  			  /* find out if all sectors have been explored */
X  			o &= Sectinfo[x][y].explored[i];
X  			p = &Sector(*planet,x,y);
X! 			if (!p->owner && !p->is_wasted && p->des==races[i]->likesbest && Sectinfo[x][y].explored[i]) {
X! 				 /*  explorations have found an island */
X! 				printf("found island @ %d,%d\n",x,y);
X  				Claims = i;
X  				 /* give them some free people there */
X  				p->popn = races[i]->number_sexes;
X***************
X*** 410,417 ****
X  	  teleg_add("resource prod.  fuel prod.  weapons prod. mob.pt prod.\n",telegram_buf);
X  	  sprintf(buf,"%12d%12d%15d%13d\n", tot_res, tot_fuel, tot_destruct,tot_mob);
X  	  teleg_add(buf,telegram_buf);
X! 	  sprintf(buf,"resource deposit depletion: %d\n", tot_resdep);
X! 	  teleg_add(buf,telegram_buf);
X  	  teleg_add("total births  (%%)    growth of max popn support  (%%)\n",telegram_buf);
X  	  sprintf(buf,"%9d      (%.2f%%)%23d   (%.2f%%)\n", 
X  		    planet->popn - oldplanetpopn, 
X--- 413,422 ----
X  	  teleg_add("resource prod.  fuel prod.  weapons prod. mob.pt prod.\n",telegram_buf);
X  	  sprintf(buf,"%12d%12d%15d%13d\n", tot_res, tot_fuel, tot_destruct,tot_mob);
X  	  teleg_add(buf,telegram_buf);
X! 	  if (tot_resdep) {
X! 		  sprintf(buf,"resource deposit depletion: %d\n", tot_resdep);
X! 		  teleg_add(buf,telegram_buf);
X! 	  }
X  	  teleg_add("total births  (%%)    growth of max popn support  (%%)\n",telegram_buf);
X  	  sprintf(buf,"%9d      (%.2f%%)%23d   (%.2f%%)\n", 
X  		    planet->popn - oldplanetpopn, 
X***************
X*** 467,474 ****
X  			    sgn(avg_mob[i] - planet->info[i-1].comread);
X   	}
X     }
X!    planet->conditions[TOXIC] = (planet->conditions[TOXIC]*50 + 
X! 		     100.0 * planet->popn / planet->maxpopn) / 51.0;
X  
X   }
X   return allmod;
X--- 472,479 ----
X  			    sgn(avg_mob[i] - planet->info[i-1].comread);
X   	}
X     }
X!    planet->conditions[TOXIC] = (planet->conditions[TOXIC]*30 + 
X! 		     100.0 * planet->popn / planet->maxpopn) / 31.0;
X  
X   }
X   return allmod;
X*** ../../GB/dosector.c	Wed Apr 26 11:22:34 1989
X--- dosector.c	Mon May  1 08:21:44 1989
X***************
X*** 63,69 ****
X  	   if (!s->eff) {
X  		tot_eff += s->eff = 1;
X  	   } else {
X! 	     tot_eff += eff = round_rand(races[s->owner]->metabolism*s->popn*(0.95-logscale(s->eff))*EFF_PROD);
X  		if (s->eff+eff >= 100) {
X  			s->eff=100;	/* dont go past 100%*/
X  			tot_eff -= s->eff+eff-100;
X--- 63,70 ----
X  	   if (!s->eff) {
X  		tot_eff += s->eff = 1;
X  	   } else {
X! 	     /*tot_eff += eff = round_rand(races[s->owner]->metabolism*s->popn*(0.95-logscale(s->eff))*EFF_PROD);*/
X! 	     tot_eff += eff = round_rand(races[s->owner]->metabolism*s->popn*EFF_PROD/100.0);
X  		if (s->eff+eff >= 100) {
X  			s->eff=100;	/* dont go past 100%*/
X  			tot_eff -= s->eff+eff-100;
X***************
X*** 106,114 ****
X  reg int peep;
X  
X     /* peep == number of people who want to move */
X- /*printf("spreading from %d,%d -- ",x,y);*/
X  if (peep = round_rand((float)s->popn * races[s->owner]->nonhomebodies) ) {
X- 	/*printf(" peeple=%d\n",peep);*/
X  
X  #if NO_SLIDING_SCALE_AUTOMOVE
X   if (pl->popn < POPN_MOVE_SCALE_1) {
X--- 107,113 ----
X***************
X*** 151,166 ****
X  	xd=planet->Maxx-1;
X   else if (xd>=planet->Maxx) 
X  	xd=0;
X  	/* check for planetary compatibility */
X!  if (float_rand()*100.0 > Compat[ps->owner]) {
X! 	/*printf("%d,%d incomp -- returning\n",xd,yd);*/
X  	return;
X   }
X  
X!  pd = &Smap[yd*planet->Maxx+xd];
X  
X-  if ((ps->owner==pd->owner) || (pd->des!=DES_SEA && !pd->is_wasted)) {
X- 
X   	if (!pd->owner) {
X  		printf("claiming %d,%d (%d), %d people\n",xd,yd,ps->owner,people);
X          	pd->popn += people;
X--- 150,166 ----
X  	xd=planet->Maxx-1;
X   else if (xd>=planet->Maxx) 
X  	xd=0;
X+ 
X+  pd = &Sector(*planet,xd,yd);
X+ 
X  	/* check for planetary compatibility */
X!  if (float_rand()*100.0 > Compat[ps->owner] * races[ps->owner]->likes[pd->des]) {
X! 	/*printf("%d,%d incomp C %.2f,l %.f-- returning\n",xd,yd,Compat[ps->owner],races[ps->owner]->likes[pd->des]);*/
X  	return;
X   }
X  
X!  if ( (ps->owner==pd->owner || !pd->owner) && !pd->is_wasted) {
X  
X   	if (!pd->owner) {
X  		printf("claiming %d,%d (%d), %d people\n",xd,yd,ps->owner,people);
X          	pd->popn += people;
X***************
X*** 177,188 ****
X  		reg float dfac;
X  
X  		ps->popn -= round_rand(((float)ps->popn * pd->mobilization * 
X! 			planet->info[pd->owner-1].comread + races[pd->owner]->fighters*10)/200.0);
X  		dfac = ( (float)pd->popn * ps->mobilization * 
X! 			planet->info[ps->owner-1].comread + races[pd->owner]->fighters*10)/200.0;
X  		printf(" att %d lost %g people of %d.\n",ps->owner,
X  			((float)ps->popn * pd->mobilization * 
X! 			planet->info[pd->owner-1].comread + races[pd->owner]->fighters*10)/200.0, pd->popn);
X  		if (pd->popn - dfac <= 0.0) {
X  			    /* the invasion was successful */
X  			if (races[ps->owner]->Thing) {
X--- 177,188 ----
X  		reg float dfac;
X  
X  		ps->popn -= round_rand(((float)ps->popn * pd->mobilization * 
X! 			planet->info[pd->owner-1].comread + races[pd->owner]->fighters*20)/200.0);
X  		dfac = ( (float)pd->popn * ps->mobilization * 
X! 			planet->info[ps->owner-1].comread + races[pd->owner]->fighters*20)/200.0;
X  		printf(" att %d lost %g people of %d.\n",ps->owner,
X  			((float)ps->popn * pd->mobilization * 
X! 			planet->info[pd->owner-1].comread + races[pd->owner]->fighters*20)/200.0, pd->popn);
X  		if (pd->popn - dfac <= 0.0) {
X  			    /* the invasion was successful */
X  			if (races[ps->owner]->Thing) {
X***************
X*** 196,203 ****
X  			sects_lost[pd->owner]++;
X  			sects_gained[ps->owner]++;
X  			pd->owner = ps->owner;
X! 			pd->eff *= 0.5;
X! 			pd->mobilization *= 0.25;
X  			tot_captured++;
X  			printf(" sec %d,%d CAPTURED",xd,yd);
X  		} else 
X--- 196,203 ----
X  			sects_lost[pd->owner]++;
X  			sects_gained[ps->owner]++;
X  			pd->owner = ps->owner;
X! 			pd->eff *= 0.75;
X! 			pd->mobilization *= 0.75;
X  			tot_captured++;
X  			printf(" sec %d,%d CAPTURED",xd,yd);
X  		} else 
X***************
X*** 205,211 ****
X  			
X  		printf(" def %d lost %g people of %d,",pd->owner,
X  			((float)pd->popn * ps->mobilization * 
X! 			planet->info[ps->owner-1].comread + races[pd->owner]->fighters*10)/200.0, pd->popn);
X   	}
X     }
X  }
X--- 205,211 ----
X  			
X  		printf(" def %d lost %g people of %d,",pd->owner,
X  			((float)pd->popn * ps->mobilization * 
X! 			planet->info[ps->owner-1].comread + races[pd->owner]->fighters*20)/200.0, pd->popn);
X   	}
X     }
X  }
X*** ../../GB/doship.c	Wed Apr 26 11:22:35 1989
X--- doship.c	Mon May  1 08:21:45 1989
X***************
X*** 205,210 ****
X--- 205,211 ----
X       case STYPE_POD:
X  	if (ship->notified) {
X  		/* we just arrived at this system -- explode */
X+ 		/* or, we are floating in space with no fuel -- just die */
X  		int shfdata;
X  		reg int i,f= -1;
X  		for (i=0; i<MAXSSHIPS && Stars[ship->storbits]->shipnums[i]!=shipno; i++) ;
X***************
X*** 215,225 ****
X  			ship->is_dead = 1;
X  			openshfdata(&shfdata);
X  			destroyship(shfdata, shipno);
X! 			close(shfdata);
X! 			for (i=0; f== -1 && i<Stars[ship->storbits]->numplanets; i++)
X  				if (sqrt((double)Distsq(ship->xpos, ship->ypos,
X  				  Stars[ship->storbits]->xpos + planets[ship->storbits][i]->xpos,
X! 				  Stars[ship->storbits]->ypos + planets[ship->storbits][i]->ypos))/SYSTEMSIZE < float_rand()*2)
X  					f = i;
X  			teleg_add("",telegram_buf);
X  			sprintf(buf, "Bulletin\n\nSpore pod #%d has warmed and exploded.\n",shipno);
X--- 216,227 ----
X  			ship->is_dead = 1;
X  			openshfdata(&shfdata);
X  			destroyship(shfdata, shipno);
X! 			close(shfdata); 
X! 			if (ship->whatorbits==LEVEL_STAR) {
X! 			  for (i=0; f== -1 && i<Stars[ship->storbits]->numplanets; i++)
X  				if (sqrt((double)Distsq(ship->xpos, ship->ypos,
X  				  Stars[ship->storbits]->xpos + planets[ship->storbits][i]->xpos,
X! 				  Stars[ship->storbits]->ypos + planets[ship->storbits][i]->ypos))/SYSTEMSIZE < float_rand())
X  					f = i;
X  			teleg_add("",telegram_buf);
X  			sprintf(buf, "Bulletin\n\nSpore pod #%d has warmed and exploded.\n",shipno);
X***************
X*** 242,247 ****
X--- 244,250 ----
X  			for (i=1; i<=Num_races; i++)
X  				if (i!=ship->owner && isset(Stars[ship->storbits]->inhabited,i))
X  					teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf);
X+ 		      }
X  		}
X  	}
X  	break;
X***************
X*** 274,280 ****
X  	if (ship->orders.object.number2 == 0) {	/* launch if no assignment */
X  	  /* steal some fuel from other players,telegram */
X  		bool f=0;
X! 		for (r=Num_races-1; !f && r>0; r--)
X  		  if (p->info[r-1].fuel >= Shipdata[OTYPE_VN][ABIL_COST]) {
X  			p->info[ship->owner-1].fuel += 
X  					Shipdata[OTYPE_VN][ABIL_FUELCAP];
X--- 277,284 ----
X  	if (ship->orders.object.number2 == 0) {	/* launch if no assignment */
X  	  /* steal some fuel from other players,telegram */
X  		bool f=0;
X! 		if (ship->fuel < Shipdata[OTYPE_VN][ABIL_COST])
X! 		 for (r=1; !f && r<=Num_races; r--)
X  		  if (p->info[r-1].fuel >= Shipdata[OTYPE_VN][ABIL_COST]) {
X  			p->info[ship->owner-1].fuel += 
X  					Shipdata[OTYPE_VN][ABIL_FUELCAP];
X***************
X*** 292,298 ****
X  			   Stars[ship->storbits]->pnames[ship->pnumorbits]);
X  			teleg_add(buf,telegram_buf);
X  	    		teleg_send(TELEG_PLAYER_AUTO, f, telegram_buf);
X- 	    		teleg_send(TELEG_PLAYER_AUTO, 1, telegram_buf);
X  		  /*}*/
X  	    
X  		ship->orders.object.number2 = 0; /* no current assignment */
X--- 296,301 ----
X***************
X*** 306,312 ****
X  		   we are engaged in building up resources/fuel. */
X  		/* steal resources from other players,telegram */
X  		bool f=0;
X! 		for (r=Num_races-1; !f && r>0; r--)
X  		  if (p->info[r-1].resource >= Shipdata[OTYPE_VN][ABIL_COST])
X  			f = r;
X  		if (f) {
X--- 309,315 ----
X  		   we are engaged in building up resources/fuel. */
X  		/* steal resources from other players,telegram */
X  		bool f=0;
X! 		for (r=Num_races; !f && r>0; r--)
X  		  if (p->info[r-1].resource >= Shipdata[OTYPE_VN][ABIL_COST])
X  			f = r;
X  		if (f) {
X***************
X*** 325,332 ****
X  			     Stars[ship->storbits]->pnames[ship->pnumorbits]);
X  			teleg_add(buf,telegram_buf);
X  	    		teleg_send(TELEG_PLAYER_AUTO, f, telegram_buf);
X- 				/* remove */
X- 	    		teleg_send(TELEG_PLAYER_AUTO, 1, telegram_buf);
X  		  /*}*/
X  		/* if no resources to steal, more will be produced in doplanet*/
X  		}
X--- 328,333 ----
X***************
X*** 362,367 ****
X--- 363,369 ----
X  		 	ship->whatdest = LEVEL_STAR;
X  		}
X  		fprintf(stderr,"VN #%d headed for star %d, pl %d.\n",shipno,ship->deststar, ship->destpnum);
X+ 		ship->speed = 1;	/* VN's are very fastidious */
X  		ship->orders.object.number2 = 1;
X  			/* we are assigned to go */
X  	}
X*** ../../GB/examine.c	Wed Apr 26 11:22:37 1989
X--- examine.c	Mon May  1 08:21:50 1989
X***************
X*** 42,48 ****
X      }
X  
X     /* look through ship data file */
X!     for (t=0; t<ship->type; t++)
X         while (fgetc(fd) != '~') ;
X      
X  	/* give report */
X--- 42,48 ----
X      }
X  
X     /* look through ship data file */
X!     for (t=0; t<=ship->type; t++)
X         while (fgetc(fd) != '~') ;
X      
X  	/* give report */
X*** ../../GB/files_rw.c	Wed Apr 26 11:22:37 1989
X--- files_rw.c	Mon May  1 08:21:50 1989
X***************
X*** 12,17 ****
X--- 12,18 ----
X   */
X  
X  #include "tweakables.h"
X+ #include "files.h"
X  #include <sys/file.h>
X  #include <signal.h>
X  #include <errno.h>
X*** ../../GB/fire.c	Wed Apr 26 14:27:19 1989
X--- fire.c	Mon May  1 08:21:52 1989
X***************
X*** 28,33 ****
X--- 28,34 ----
X  sectortype *sect;
X  int dam=0,dam2=0,strength,oldstrength,maxstrength,
X      i,from_firex= -1,from_firey= -1,firex= -1,firey= -1,Numplayersretaliate=0;
X+ float dist;
X  char string[PLACENAMESIZE],buf[100];
X  bool sameplanet = 0, fromplanetmod=0,toplanetmod=0,starmod=0,sdatamod=0;
X  int mask,APdeductstar;
X***************
X*** 262,267 ****
X--- 263,275 ----
X  	/* block kill signals to foil cheaters */
X   mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
X  
X+  dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &dist, &sdatamod,&starmod, &fromplanetmod);
X+  printf("Distance to target: %.0f, maximum distance: %d.\n",dist, SYSTEMSIZE);
X+  if (dam < 0) {
X+ 	printf("Target out of range!\n", SYSTEMSIZE);
X+ 	fire_handler();
X+  }
X+ 
X   if (from.level==LEVEL_SHIP) {
X  			from.shipptr->destruct -= strength;
X  			from.shipptr->mass -= strength*MASS_DESTRUCT;
X***************
X*** 268,278 ****
X   } else if (from.level==LEVEL_PLAN) 
X  			fpl->info[Playernum-1].destruct -= strength;
X  
X-  dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &sdatamod,&starmod, &fromplanetmod);
X-  if (dam < 0) {
X- 	printf("Target out of range!  must be %d or closer.\n", SYSTEMSIZE);
X- 	fire_handler();
X-  }
X  
X    /* enemy retaliates with twice the strength (if he can) */
X  
X--- 276,281 ----
X***************
X*** 298,304 ****
X  
X  	/* enemy fires at shooting sector */
X   if ( !(to.level==LEVEL_SHIP && to.shipptr->is_dead) )
X!  	dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &sdatamod,&starmod, &toplanetmod);
X  
X  
X   if (from.level==LEVEL_PLAN) {
X--- 301,307 ----
X  
X  	/* enemy fires at shooting sector */
X   if ( !(to.level==LEVEL_SHIP && to.shipptr->is_dead) )
X!  	dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &dist, &sdatamod,&starmod, &toplanetmod);
X  
X  
X   if (from.level==LEVEL_PLAN) {
X***************
X*** 352,358 ****
X  
X   close(fire_stardata);
X  
X!  printf("BOOM!!\007  %d%s.\n", dam, 
X  		to.level==LEVEL_SHIP ? 
X  		 (to.shipptr->type==OTYPE_VN ? " Von Neumann machines destroyed"
X  		 : "% damage done") : " sectors destroyed" );
X--- 355,361 ----
X  
X   close(fire_stardata);
X  
X!  printf("BOOM!!\007  %d%s.\n", dam, 
X  		to.level==LEVEL_SHIP ? 
X  		 (to.shipptr->type==OTYPE_VN ? " Von Neumann machines destroyed"
X  		 : "% damage done") : " sectors destroyed" );
X*** ../../GB/fix.c	Wed Apr 26 11:22:40 1989
X--- fix.c	Mon May  1 08:21:53 1989
X***************
X*** 295,300 ****
X--- 295,303 ----
X  	ch = sh->destpnum;
X  	query(CHAR, "what planet dest",0,0,&ch,0,0);
X  	  sh->destpnum = ch;
X+ 	ch = sh->is_dead;
X+ 	query(CHAR, "is dead",0,0,&ch,0,0);
X+ 	  sh->is_dead = ch;
X  	ch = sh->is_docked;
X  	query(CHAR, "is docked",0,0,&ch,0,0);
X  	  sh->is_docked = ch;
X*** ../../GB/getplace.c	Wed Apr 26 11:22:41 1989
X--- getplace.c	Mon May  1 08:21:55 1989
X***************
X*** 44,53 ****
X  			   where.snum = where.shipptr->storbits;
X  			   where.pnum = where.shipptr->pnumorbits;
X  			/* where.shipno already taken care of */
X! 			   printf(" |%s|\n",string);
X! 			   while (isdigit(*string)) {putchr(*string),string++;}
X! 		   	   putchr(*string);
X! 			   printf(" |%s|\n",string);
X  			   if (*string=='/')
X  				 return Getplace2(string+1,&where, ignoreexpl);
X  			   else
X--- 44,51 ----
X  			   where.snum = where.shipptr->storbits;
X  			   where.pnum = where.shipptr->pnumorbits;
X  			/* where.shipno already taken care of */
X! 			   while (isdigit(*string)) 
X! 				string++;
X  			   if (*string=='/')
X  				 return Getplace2(string+1,&where, ignoreexpl);
X  			   else
X*** ../../GB/help.c	Wed Apr 26 11:22:42 1989
X--- help.c	Mon May  1 08:21:55 1989
X***************
X*** 5,10 ****
X--- 5,11 ----
X   */
X  
X  #include "tweakables.h"
X+ #include "files.h"
X  
X  help(APcount, argn,args)
X  int APcount;
X***************
X*** 25,31 ****
X  		"tactical fire     name    mobilize   telegram\n"
X  	      );
X    } else {
X!     sprintf(s,"%s %s/%s.doc*", PAGER, DOCS, args[1] );
X      system(s);
X    }
X  
X--- 26,32 ----
X  		"tactical fire     name    mobilize   telegram\n"
X  	      );
X    } else {
X!     sprintf(s,"%s %s/%s.doc", PAGER, DOCS, args[1] );
X      system(s);
X    }
X  
X*** ../../GB/makeplanet.c	Wed Apr 26 11:22:45 1989
X--- makeplanet.c	Mon May  1 08:22:00 1989
X***************
X*** 13,19 ****
X  planettype Makeplanet(type)
X  int type;
X  {
X! register int x,y;
X  sectortype *s;
X  planettype planet;
X  int i, atmos;
X--- 13,19 ----
X  planettype Makeplanet(type)
X  int type;
X  {
X! reg int x,y;
X  sectortype *s;
X  planettype planet;
X  int i, atmos;
X***************
X*** 54,60 ****
X       for (x=0; x<planet.Maxx; x++) {
X  	s = &Sector(planet,x,y);
X  	s->des = DES_GAS;	/* for gasgiant */
X! 	s->fert=1;
X       }
X   if (planet.Maxx > MAP_GASGIANT_BANDMIN) {
X      int nbands;
X--- 54,61 ----
X       for (x=0; x<planet.Maxx; x++) {
X  	s = &Sector(planet,x,y);
X  	s->des = DES_GAS;	/* for gasgiant */
X! 	s->fert = int_rand(2,15);
X! 	s->resource = int_rand(3,20);
X       }
X   if (planet.Maxx > MAP_GASGIANT_BANDMIN) {
X      int nbands;
X***************
X*** 64,70 ****
X       for (x=0; x<planet.Maxx; x++) {
X  	s = &Sector(planet,x,y);
X  	s->des = DES_SEA;	/* make random bands of water */
X! 	s->fert += int_rand(2,3);
X       }
X      }
X      for (i=0; i<=MAP_ISLANDS*2; i++) {
X--- 65,72 ----
X       for (x=0; x<planet.Maxx; x++) {
X  	s = &Sector(planet,x,y);
X  	s->des = DES_SEA;	/* make random bands of water */
X! 	s->fert += int_rand(2,6);
X! 	s->resource += int_rand(30,40);
X       }
X      }
X      for (i=0; i<=MAP_ISLANDS*2; i++) {
X***************
X*** 72,78 ****
X       x=int_rand(1,planet.Maxx-2);
X  	s = &Sector(planet,x,y);
X  	s->des = DES_SEA;	/* make random spots of water */
X! 	s->fert += int_rand(2,3);
X      }
X   } else {
X      for (i=0; i<MAP_ISLANDS*2; i++) {
X--- 74,80 ----
X       x=int_rand(1,planet.Maxx-2);
X  	s = &Sector(planet,x,y);
X  	s->des = DES_SEA;	/* make random spots of water */
X! 	s->fert += int_rand(2,6);
X      }
X   } else {
X      for (i=0; i<MAP_ISLANDS*2; i++) {
X***************
X*** 80,87 ****
X  	if (random()&01) {
X  		s->des=DES_MOUNT;
X  		s->is_wasted = 1;
X! 		s->resource=int_rand(5,12);
X! 		s->fert=int_rand(5,12);
X  	} else {
X  		s->des=DES_SEA;
X  		s->fert=int_rand(5,12);
X--- 82,89 ----
X  	if (random()&01) {
X  		s->des=DES_MOUNT;
X  		s->is_wasted = 1;
X! 		s->resource += int_rand(9,21);
X! 		s->fert = int_rand(5,21);
X  	} else {
X  		s->des=DES_SEA;
X  		s->fert=int_rand(5,12);
X***************
X*** 109,122 ****
X       for (x=0; x<planet.Maxx; x++) {
X  	s = &Sector(planet,x,y);
X  	s->des = DES_MOUNT;	/* for airless */
X- 	/*s->is_wasted=1;	/* is wasteland */
X  	s->resource=int_rand(25,35);
X! 	s->fert=1;
X       }
X       for (i=0; i<MAP_ISLANDS; i++) {
X  	s = &Sector(planet, int_rand(1,planet.Maxx-2), int_rand(1,planet.Maxy-2));
X  	s->des = DES_LAND;
X! 	s->fert += random()&01;
X  	s->resource+=int_rand(15,22);
X       }
X    Smashup(&planet,6,DES_LAND,5,1,1);	/* make meteor impacts */
X--- 111,124 ----
X       for (x=0; x<planet.Maxx; x++) {
X  	s = &Sector(planet,x,y);
X  	s->des = DES_MOUNT;	/* for airless */
X  	s->resource=int_rand(25,35);
X! 	s->fert=int_rand(0,int_rand(3,10));
X       }
X+ 
X       for (i=0; i<MAP_ISLANDS; i++) {
X  	s = &Sector(planet, int_rand(1,planet.Maxx-2), int_rand(1,planet.Maxy-2));
X  	s->des = DES_LAND;
X! 	s->fert += int_rand(3,17);
X  	s->resource+=int_rand(15,22);
X       }
X    Smashup(&planet,6,DES_LAND,5,1,1);	/* make meteor impacts */
X***************
X*** 138,144 ****
X  	s = &Sector(planet,x,y);
X  	s->des = int_rand(0,3) ? DES_MOUNT : DES_LAND;
X  	s->is_wasted=1;
X! 	s->resource=int_rand(55,85);
X  	s->fert=(char)random()&01;
X       }
X    
X--- 140,146 ----
X  	s = &Sector(planet,x,y);
X  	s->des = int_rand(0,3) ? DES_MOUNT : DES_LAND;
X  	s->is_wasted=1;
X! 	s->resource=int_rand(101,500);
X  	s->fert=(char)random()&01;
X       }
X    
X***************
X*** 175,180 ****
X--- 177,184 ----
X       for (x=0; x<planet.Maxx; x++) {
X  	s = &Sector(planet,x,y);
X  	s->des=DES_SEA;	/* make all water first */
X+ 	s->fert = int_rand(55,79);
X+ 	s->resource = int_rand(20,30);
X       }
X  		/* make first isolated islands */
X    for (i=0; i<=MAP_ISLANDS; i++) {
X***************
X*** 185,192 ****
X       s->fert = int_rand(6,20);
X    }
X  
X!   PermuteSects(&planet);	/* mix up map */
X!   (void)Getxysect(&planet,0,0,1);	/* reset index */
X  
X    landsects=0;
X    while (landsects<=Numlandsects)
X--- 189,196 ----
X       s->fert = int_rand(6,20);
X    }
X  
X!   /*PermuteSects(&planet);	/* mix up map */
X!   /*(void)Getxysect(&planet,0,0,1);	/* reset index */
X  
X    landsects=0;
X    while (landsects<=Numlandsects)
X***************
X*** 195,201 ****
X  
X  
X  		/* make more isolated islands */
X!   for (i=0; i<=MAP_ISLANDS*4; i++) {
X       x=int_rand(0,planet.Maxx-1);
X       y=int_rand(0,planet.Maxy-1);
X       s = &Sector(planet,x,y);
X--- 199,205 ----
X  
X  
X  		/* make more isolated islands */
X!   for (i=0; i<=MAP_ISLANDS*3; i++) {
X       x=int_rand(0,planet.Maxx-1);
X       y=int_rand(0,planet.Maxy-1);
X       s = &Sector(planet,x,y);
X***************
X*** 205,230 ****
X       s->fert = 45;
X    }
X  	/* make some wasteland sectors (polar caps ) */
X  	/* do s pole */
X!   for (y=planet.Maxy; y>=planet.Maxy-4; y--)
X       for (x=0; x<planet.Maxx; x++)
X  	if ( ((y==planet.Maxy-1) && int_rand(0,1)) ||
X! 		((y==planet.Maxy-2) && !int_rand(0,2) && Sector(planet,x,planet.Maxy).is_wasted) ) {
X! 	  Sector(planet,x,y).is_wasted=1;
X! 	  Smap[y*planet.Maxx+x].fert /= 6;
X!      	}
X  	/* do n pole */
X!   for (y=0; y<=3; y++)
X       for (x=0; x<planet.Maxx; x++)
X  	if ( ((y==0) && int_rand(0,1)) ||
X  		((y==1) && !int_rand(0,2) && Smap[x].is_wasted) ) {
X! 	  Smap[y*planet.Maxx+x].is_wasted=1;
X! 	  Smap[y*planet.Maxx+x].fert /= 6;
X!         }
X   }
X! /*###222 [lint] syntax error at or near word "return"%%%*/
X!  return ( planet );
X! /*###223 [lint] syntax error at or near symbol }%%%*/
X  }
X  
X  
X--- 209,231 ----
X       s->fert = 45;
X    }
X  	/* make some wasteland sectors (polar caps ) */
X+ 	/* { already done in Volcano } */
X  	/* do s pole */
X!   /*for (y=planet.Maxy; y>=planet.Maxy-4; y--)
X       for (x=0; x<planet.Maxx; x++)
X  	if ( ((y==planet.Maxy-1) && int_rand(0,1)) ||
X! 		((y==planet.Maxy-2) && !int_rand(0,2) && Sector(planet,x,planet.Maxy-1).is_wasted) ) {
X! 	  Sector(planet,x,y).des= DES_ICE;
X!      	}*/
X  	/* do n pole */
X!   /*for (y=0; y<=3; y++)
X       for (x=0; x<planet.Maxx; x++)
X  	if ( ((y==0) && int_rand(0,1)) ||
X  		((y==1) && !int_rand(0,2) && Smap[x].is_wasted) ) {
X! 	  Smap[y*planet.Maxx+x].des= DES_ICE;
X!         }*/
X   }
X!  return planet;
X  }
X  
X  
X***************
X*** 236,242 ****
X  		/* smash psuedo-meteors into the place */
X  {
X  char r,x,y;
X! register int x2,y2;
X  sectortype *s;
X  
X   while (n--) {
X--- 237,243 ----
X  		/* smash psuedo-meteors into the place */
X  {
X  char r,x,y;
X! reg int x2,y2;
X  sectortype *s;
X  
X   while (n--) {
X***************
X*** 263,269 ****
X  
X  
X  double Distmap(x,y,x2,y2)
X! register int x,y,x2,y2;
X  {
X   return fabs((double)x-x2) / RATIOXY + fabs( (double)y-y2);
X  }
X--- 264,270 ----
X  
X  
X  double Distmap(x,y,x2,y2)
X! reg int x,y,x2,y2;
X  {
X   return fabs((double)x-x2) / RATIOXY + fabs( (double)y-y2);
X  }
X***************
X*** 273,286 ****
X  planettype *pptr;
X  int landsectors,Numlandsects;
X  {
X! int x,y;
X  sectortype *s;
X  
X!   (void)Getxysect(pptr,&x,&y,0);
X!   /*x = int_rand(0,pptr->Maxx-1);
X!   y = int_rand(0,pptr->Maxy-1);*/
X    s = &Sector(*pptr,x,y);
X  
X    if (s->des==DES_SEA) {
X      if (Numneighbors(pptr,x,y,DES_LAND)||Numneighbors(pptr,x,y,DES_MOUNT)) {
X  	s->des=(landsectors>(MAP_MOUNT_PERCENT*Numlandsects))?DES_LAND:DES_MOUNT;
X--- 274,308 ----
X  planettype *pptr;
X  int landsectors,Numlandsects;
X  {
X! reg int x,y;
X  sectortype *s;
X  
X!   x = int_rand(0,pptr->Maxx-1);
X!   y = int_rand(0,pptr->Maxy-1);
X    s = &Sector(*pptr,x,y);
X  
X+     if (y > pptr->Maxy/2) {
X+       if (y==pptr->Maxy-1) {
X+ 	s->des = DES_ICE;
X+ 	return(1);
X+       } else {
X+ 	if ((Sector(*pptr,x,y+1).des==DES_ICE) && 
X+ 		 (int_rand(-50,50)>pptr->conditions[RTEMP])) {
X+ 		s->des = DES_ICE;
X+ 		return(1);
X+ 	}
X+       }
X+     } else {
X+       if (y==0) {
X+ 	s->des = DES_ICE;
X+ 	return(1);
X+       } else if ((Sector(*pptr,x,y-1).des==DES_ICE) && 
X+ 		 (int_rand(-50,50)>pptr->conditions[RTEMP])) {
X+ 		s->des = DES_ICE;
X+ 		return(1);
X+ 	}
X+     }
X+ 
X    if (s->des==DES_SEA) {
X      if (Numneighbors(pptr,x,y,DES_LAND)||Numneighbors(pptr,x,y,DES_MOUNT)) {
X  	s->des=(landsectors>(MAP_MOUNT_PERCENT*Numlandsects))?DES_LAND:DES_MOUNT;
X***************
X*** 298,306 ****
X  /* return # of neighbors of a given designation that a sector has. */
X  int Numneighbors(p,x,y,des)
X  planettype *p;
X! register int x,y,des;
X  {
X! register int d;
X    return (Sector(*p,mod(x-1,p->Maxx,d),y).des==des) + 
X    	 (Sector(*p,mod(x+1,p->Maxx,d),y).des==des) + 
X    	 ((y==0) ? 0 : (Sector(*p,x,y-1).des==des)) + 
X--- 320,328 ----
X  /* return # of neighbors of a given designation that a sector has. */
X  int Numneighbors(p,x,y,des)
X  planettype *p;
X! reg int x,y,des;
X  {
X! reg int d;
X    return (Sector(*p,mod(x-1,p->Maxx,d),y).des==des) + 
X    	 (Sector(*p,mod(x+1,p->Maxx,d),y).des==des) + 
X    	 ((y==0) ? 0 : (Sector(*p,x,y-1).des==des)) + 
X*** ../../GB/makeuniv.c	Wed Apr 26 14:33:56 1989
X--- makeuniv.c	Mon May  1 08:22:01 1989
X***************
X*** 36,43 ****
X   scanf("%d",&lowp);
X   printf("hi # of planets (%d-%d):",lowp,MAXPLANETS-1);
X   scanf("%d",&hip);
X-  printf("approx # of habitable planets:");
X-  scanf("%d",&e);
X   getchr();
X  
X   sprintf(str, "/bin/mkdir %s", DATADIR );
X--- 36,41 ----
X***************
X*** 54,65 ****
X   	Bzero(*Stars[star]);
X   	Star = Stars[star];
X   	Star->numplanets=int_rand(lowp,hip);
X!  	Star->gravity = (float)int_rand(100000,1000000) / 100;
X   	printf("name of star (%d planets):",Star->numplanets);
X  	for (i=0; i<NAMESIZE-4; i++)
X  	   putchr('.');
X  	for (i=0; i<NAMESIZE-4; i++)
X! 	   putchr('\010');
X   	scanf("%10[^\n]",Star->name);
X  	  getchr();
X   	Star->xpos=(float)int_rand(-UNIVSIZE,UNIVSIZE);
X--- 52,63 ----
X   	Bzero(*Stars[star]);
X   	Star = Stars[star];
X   	Star->numplanets=int_rand(lowp,hip);
X!  	Star->gravity = int_rand(10000,100000) / 100.0;
X   	printf("name of star (%d planets):",Star->numplanets);
X  	for (i=0; i<NAMESIZE-4; i++)
X  	   putchr('.');
X  	for (i=0; i<NAMESIZE-4; i++)
X! 	   putchr('\010');
X   	scanf("%10[^\n]",Star->name);
X  	  getchr();
X   	Star->xpos=(float)int_rand(-UNIVSIZE,UNIVSIZE);
X***************
X*** 70,85 ****
X  
X   for (star=0; star<Sdata.numstars; star++) {
X  
X!   Star=Stars[star];
X  
X-   for (i=0; i<=Star->numplanets; i++) 
X- 			types[i] = 200;
X-   e2=e;
X-   while (e2--) {
X-   	types[int_rand(0,Star->numplanets-1)] = TYPE_EARTH;
X-   }
X    for (i=0; i<Star->numplanets; i++)
X! 	if (types[i]!=TYPE_EARTH) types[i]=int_rand(1,3);
X    for (i=0; i<Star->numplanets; i++)  {
X  	sprintf(Star->pnames[i],"%s-%s",Star->name,Romannums[i]);
X  	if (argc==2 && argv[1][1]=='v')
X--- 68,78 ----
X  
X   for (star=0; star<Sdata.numstars; star++) {
X  
X!   Star = Stars[star];
X  
X    for (i=0; i<Star->numplanets; i++)
X! 	types[i]=int_rand(TYPE_EARTH,TYPE_GASGIANT);
X! 
X    for (i=0; i<Star->numplanets; i++)  {
X  	sprintf(Star->pnames[i],"%s-%s",Star->name,Romannums[i]);
X  	if (argc==2 && argv[1][1]=='v')
X***************
X*** 98,107 ****
X  	  for (y=0; y<planet.Maxy; y++) {
X  	   for (x=0; x<planet.Maxx; x++) {
X  	      switch (Smap[y*planet.Maxx+x].des) {
X! 		case DES_LAND: putchr(CHAR_UNOWNED_LAND); break;
X  		case DES_SEA: putchr(CHAR_SEA); break;
X  		case DES_MOUNT: putchr(CHAR_MOUNT); break;
X  		case DES_GAS: putchr(CHAR_GAS); break;
X  	      }
X  	   }
X  	   putchr('\n');
X--- 91,102 ----
X  	  for (y=0; y<planet.Maxy; y++) {
X  	   for (x=0; x<planet.Maxx; x++) {
X  	      switch (Smap[y*planet.Maxx+x].des) {
X! 		case DES_LAND: putchr(CHAR_LAND); break;
X  		case DES_SEA: putchr(CHAR_SEA); break;
X  		case DES_MOUNT: putchr(CHAR_MOUNT); break;
X+ 		case DES_ICE: putchr(CHAR_ICE); break;
X  		case DES_GAS: putchr(CHAR_GAS); break;
X+ 		default: break;
X  	      }
X  	   }
X  	   putchr('\n');
X*** ../../GB/map.c	Wed Apr 26 11:22:47 1989
X--- map.c	Mon May  1 08:22:02 1989
X***************
X*** 150,161 ****
X  	return(CHAR_OWNED_WASTELAND);
X    if (s->VN)
X  	return(Shipltrs[OTYPE_VN]);
X     switch (s->des) {
X!      	case DES_SEA: return(CHAR_OWNED_SEA);
X!      	case DES_LAND: return(Race->Thing ? CHAR_OWNED_THING : CHAR_OWNED_LAND);
X!      	case DES_MOUNT: return(Race->Thing ? CHAR_OWNED_THING : CHAR_OWNED_MOUNT);
X!      	case DES_GAS: return(CHAR_GAS);
X!      	case DES_PLATED: return(CHAR_PLATED);
X       	default: return('!');
X     }
X  
X--- 150,164 ----
X  	return(CHAR_OWNED_WASTELAND);
X    if (s->VN)
X  	return(Shipltrs[OTYPE_VN]);
X+    if (Race->Thing)
X+ 	return CHAR_OWNED_THING;
X     switch (s->des) {
X!      	case DES_SEA: return CHAR_OWNED_SEA;
X!      	case DES_LAND: return CHAR_OWNED_LAND;
X!      	case DES_MOUNT: return CHAR_OWNED_MOUNT;
X!      	case DES_GAS: return CHAR_OWNED_GAS;
X!      	case DES_PLATED: return CHAR_PLATED;
X!      	case DES_ICE: return CHAR_OWNED_ICE;
X       	default: return('!');
X     }
X  
X***************
X*** 175,183 ****
X  	return(CHAR_WASTELAND);
X    switch (s->des) {
X       case DES_SEA: return(CHAR_SEA);
X!      case DES_LAND: return(CHAR_UNOWNED_LAND);
X       case DES_MOUNT: return(CHAR_MOUNT);
X       case DES_GAS: return(CHAR_GAS);
X       case DES_PLATED: return(CHAR_PLATED);
X       default: return('!');
X    }
X--- 178,187 ----
X  	return(CHAR_WASTELAND);
X    switch (s->des) {
X       case DES_SEA: return(CHAR_SEA);
X!      case DES_LAND: return(CHAR_LAND);
X       case DES_MOUNT: return(CHAR_MOUNT);
X       case DES_GAS: return(CHAR_GAS);
X+      case DES_ICE: return CHAR_ICE;
X       case DES_PLATED: return(CHAR_PLATED);
X       default: return('!');
X    }
X*** ../../GB/more.c	Wed Apr 26 11:22:49 1989
X--- more.c	Mon May  1 08:22:05 1989
X***************
X*** 4,11 ****
X  #include <sgtty.h>
X  
X  
X- char *doc_directory = "/b/o/therat/k";
X- 
X  main(c, v)
X  int c;
X  char **v;
X--- 4,9 ----
X***************
X*** 21,27 ****
X  	int fd, pid;
X  	long t;
X  
X! 	sprintf(filename, "%s/%s.Z", doc_directory, s);
X  	/* could stat the file here to make sure it's there */
X  
X  	time(&t);
X--- 19,25 ----
X  	int fd, pid;
X  	long t;
X  
X! 	sprintf(filename, "%s", s);
X  	/* could stat the file here to make sure it's there */
X  
X  	time(&t);
X***************
X*** 105,108 ****
X  
X  	return c;
X  }
X- 
X--- 103,105 ----
X*** ../../GB/moveship.c	Wed Apr 26 11:22:50 1989
X--- moveship.c	Mon May  1 08:22:06 1989
X***************
X*** 91,104 ****
X     	Ddist -= (SYSTEMSIZE - 1.0);
X     else if (s->whatdest==LEVEL_STAR)
X  	Ddist -= PLORBITSIZE - 1.0;
X!    else if (s->whatdest==LEVEL_SHIP && Ddist > SYSTEMSIZE) {
X       if (!s->notified) {
X  	s->notified = 1;
X  	teleg_add("",telegram_buf);
X     	sprintf(buf,"Telecomm from ship #%d at %s\n\n",shipno, 
X! 						prin_ship_orbits(s));
X     	teleg_add(buf,telegram_buf);
X!    	sprintf(buf,"%s #%d cannot find destination ship #%d.\n", 
X  				Shipnames[s->type],shipno,s->destshipno);
X     	teleg_add(buf,telegram_buf);
X     	teleg_send(TELEG_PLAYER_AUTO, s->owner, telegram_buf);
X--- 91,105 ----
X     	Ddist -= (SYSTEMSIZE - 1.0);
X     else if (s->whatdest==LEVEL_STAR)
X  	Ddist -= PLORBITSIZE - 1.0;
X!    else if (s->whatdest==LEVEL_SHIP && Ddist > SYSTEMSIZE * 2.0) {
X       if (!s->notified) {
X  	s->notified = 1;
X+ 	s->whatdest = LEVEL_UNIV;
X  	teleg_add("",telegram_buf);
X     	sprintf(buf,"Telecomm from ship #%d at %s\n\n",shipno, 
X! 				prin_ship_orbits(s));
X     	teleg_add(buf,telegram_buf);
X!    	sprintf(buf,"%s #%d lost sight of destination ship #%d.\n", 
X  				Shipnames[s->type],shipno,s->destshipno);
X     	teleg_add(buf,telegram_buf);
X     	teleg_send(TELEG_PLAYER_AUTO, s->owner, telegram_buf);
X***************
X*** 111,127 ****
X  
X     else if (Ddist > DIST_TO_LAND) {
X     	s->fuel -= fuse;
X-    	printf(" subtracting %f fuel \n",fuse);
X-     		/* subtract the fuel's mass */
X     	s->mass -= fuse * MASS_FUEL;
X  
X  		/* dont overshoot */
X     	xdest = sin(heading) * mfactor;
X-     	if (abs(xdest) > Ddist) 
X- 		xdest = sgn(xdest) * Ddist;
X     	ydest = cos(heading) * mfactor;
X!     	if (abs(ydest) > Ddist) 
X  		ydest = sgn(ydest) * Ddist;
X     	s->xpos += xdest;
X     	s->ypos += ydest;
X     }
X--- 112,126 ----
X  
X     else if (Ddist > DIST_TO_LAND) {
X     	s->fuel -= fuse;
X     	s->mass -= fuse * MASS_FUEL;
X  
X  		/* dont overshoot */
X     	xdest = sin(heading) * mfactor;
X     	ydest = cos(heading) * mfactor;
X!     	if (sqrt(xdest*xdest + ydest*ydest) > Ddist) {
X! 		xdest = sgn(xdest) * Ddist;
X  		ydest = sgn(ydest) * Ddist;
X+ 	}
X     	s->xpos += xdest;
X     	s->ypos += ydest;
X     }
X*** ../../GB/orbit.c	Wed Apr 26 11:22:52 1989
X--- orbit.c	Mon May  1 08:22:07 1989
X***************
X*** 41,47 ****
X  int orbit_shdata,orbit_pdata,orbit_stardata;
X  
X   DontDispPlanets = DontDispShips = DontDispStars = 0;
X-  printf(" orbit:called |%s|\n",args[1]);
X  
X    /* find options, set flags accordingly */
X   for (flag=1; flag<=argn-1; flag++)
X--- 41,46 ----
X***************
X*** 70,76 ****
X     Lasty = Dir.lasty;
X     Zoom = Dir.zoom;
X   } else {
X-    printf(" trying to orbit %s\n",args[argn-1]);
X     where = Getplace(args[argn-1],0);
X     Lastx = Lasty = 0.0;
X     Zoom = 1.0;
X--- 69,74 ----
X***************
X*** 172,178 ****
X  	shipwhere.snum = where.shipptr->storbits;
X  	shipwhere.pnum = where.shipptr->pnumorbits;
X  	sprintf(gs[1],"%s",Dispplace(&shipwhere) );
X- 	printf(" orbiting %s\n",gs[1]);
X  	orbit(0,2,gs);
X  	} break;
X  
X--- 170,175 ----
X*** ../../GB/order.c	Wed Apr 26 14:29:29 1989
X--- order.c	Mon May  1 08:22:09 1989
X***************
X*** 9,20 ****
X  #include <ctype.h>
X  #include <setjmp.h>
X  #include <signal.h>
X  extern jmp_buf main_jenv;
X  
X- extern char *Shipnames[];
X- 
X  char *prin_aimed_at(), *prin_ship_dest();
X  
X  int order_shdata,order_pdata,order_stardata;
X  static bool first,prerror,was_obj = 0;
X  
X--- 9,20 ----
X  #include <ctype.h>
X  #include <setjmp.h>
X  #include <signal.h>
X+ #include <math.h>
X  extern jmp_buf main_jenv;
X  
X  char *prin_aimed_at(), *prin_ship_dest();
X  
X+ extern int Ignore_filelocks;
X  int order_shdata,order_pdata,order_stardata;
X  static bool first,prerror,was_obj = 0;
X  
X***************
X*** 219,227 ****
X       tty_on();
X       do {
X  		  c = getchr();
X!      } while (iscntrl(c) && c!='\033');
X       switch (c) {
X! 		case '\033': { shiptype *tempship;
X  		    tempship = oldship;
X  		    ship = oldship;
X  		    oldship = tempship;
X--- 219,227 ----
X       tty_on();
X       do {
X  		  c = getchr();
X!      } while (iscntrl(c) && c!='');
X       switch (c) {
X! 		case '': { shiptype *tempship;
X  		    tempship = oldship;
X  		    ship = oldship;
X  		    oldship = tempship;
X***************
X*** 246,251 ****
X--- 246,252 ----
X  				case OTYPE_TRANSDEV:
X  					printw("Ready to receive.");
X  					break;
X+ 				default: break;
X  			      }
X  		      }
X  		    }
X***************
X*** 262,273 ****
X  		      ungetc(c,stdin);
X  		      scanw("%43s",s); 
X  		      move(Erry,0); refresh();
X  		      where = Getplace(s, 1);
X  		      if (!where.err) {
X  			    ship->whatdest = where.level;
X  			    ship->deststar = where.snum;
X  			    ship->destpnum = where.pnum;
X! 			    ship->destshipno = where.shipno;
X  		      }
X  		     }
X  		     tty_on();
X--- 263,282 ----
X  		      ungetc(c,stdin);
X  		      scanw("%43s",s); 
X  		      move(Erry,0); refresh();
X+ 		      Ignore_filelocks = 1;
X  		      where = Getplace(s, 1);
X+ 		      Ignore_filelocks = 0;
X  		      if (!where.err) {
X+ 			if (where.level==LEVEL_SHIP) {
X+ 			  /*if (sqrt(Distsq(ship->xpos, ship->ypos, where.shipptr->xpos,where.shipptr->ypos))<SYSTEMSIZE*2.0) {*/
X+ 			    	ship->destshipno = where.shipno;
X+ 				ship->whatdest = LEVEL_SHIP;
X+ 			  /*} else { move(Erry,0); printw("Ship #%d can't find ship #%d.", shipno, where.shipno); }*/
X+ 			} else {
X  			    ship->whatdest = where.level;
X  			    ship->deststar = where.snum;
X  			    ship->destpnum = where.pnum;
X! 			}
X  		      }
X  		     }
X  		     tty_on();
X***************
X*** 517,522 ****
X--- 526,532 ----
X  int sig,code;
X  struct sigcontext *scp;
X  {
X+  Ignore_filelocks = 0;
X   close(order_shdata);
X   close(order_pdata);
X   close(order_stardata);
X*** ../../GB/prof.c	Wed Apr 26 11:22:55 1989
X--- prof.c	Mon May  1 08:22:10 1989
X***************
X*** 40,45 ****
X--- 40,52 ----
X  		Race->conditions[NITROGEN], Race->conditions[SULFUR] );
X    printf("     helium %02d%%     other %02d%%\n", 
X  		Race->conditions[HELIUM], Race->conditions[OTHER]);
X+   printf("Sector type preferences:\n");
X+   printf(" %c %.1f%%      %c %.1f%%\n", CHAR_SEA, Race->likes[DES_SEA]*100,
X+ 	CHAR_GAS, Race->likes[DES_GAS]*100);
X+   printf(" %c %.1f%%      %c %.1f%%\n", CHAR_MOUNT, Race->likes[DES_MOUNT]*100,
X+ 	CHAR_LAND, Race->likes[DES_LAND]*100);
X+   printf(" %c %.1f%%      %c %.1f%%\n", CHAR_ICE, Race->likes[DES_ICE]*100,
X+ 	CHAR_PLATED, Race->likes[DES_PLATED]*100);
X  
X   printf("\nRelations with other races:\nPlayer	relation\n");
X   numraces = Numraces();
X*** ../../GB/rand.c	Wed Apr 26 11:22:56 1989
X--- rand.c	Mon May  1 08:22:11 1989
X***************
X*** 20,32 ****
X  
X  float float_rand()
X  {
X! 	return (-(float)random()/ 2147483648);
X  }
X  
X  int int_rand(low,hi)
X  register int low,hi;
X  {
X!     return( (hi<=low) ? low : (float_rand() * (hi - low + 1)) + low );
X  }
X  
X  
X--- 20,32 ----
X  
X  float float_rand()
X  {
X! 	return random()/ 2147483648.0;
X  }
X  
X  int int_rand(low,hi)
X  register int low,hi;
X  {
X!     return( (hi<=low) ? low : (random() % (hi - low + 1)) + low );
X  }
X  
X  
X*** ../../GB/scrap.c	Wed Apr 26 11:23:00 1989
X--- scrap.c	Mon May  1 08:22:13 1989
X***************
X*** 61,71 ****
X   getplanet(scrap_pdata, &planet, Stars[s->storbits]->planetpos[s->pnumorbits]);
X  
X   scrapval = Shipdata[s->type][ABIL_COST] * .75 + s->resource;
X  
X   tty_on();
X   printf("%s #%d:original cost: %d\n",
X  	Shipnames[s->type], shipno, Shipdata[s->type][ABIL_COST]);
X!  printf("         scrap value%s: %d. Junk (y/n)?",
X  	s->resource ? "(with stockpile) " : "", scrapval);
X  
X   if (getchr()!='y') {
X--- 61,74 ----
X   getplanet(scrap_pdata, &planet, Stars[s->storbits]->planetpos[s->pnumorbits]);
X  
X   scrapval = Shipdata[s->type][ABIL_COST] * .75 + s->resource;
X+  if (s->type==OTYPE_VN)
X+ 	scrapval += (s->orders.object.number-1) * Shipdata[s->type][ABIL_COST];
X  
X   tty_on();
X   printf("%s #%d:original cost: %d\n",
X  	Shipnames[s->type], shipno, Shipdata[s->type][ABIL_COST]);
X!  printf("        %s scrap value%s: %d. Junk (y/n)?", 
X! 	s->type==OTYPE_VN ? "total" : "",
X  	s->resource ? "(with stockpile) " : "", scrapval);
X  
X   if (getchr()!='y') {
X*** ../../GB/shlmisc.c	Wed Apr 26 14:39:13 1989
X--- shlmisc.c	Mon May  1 08:22:14 1989
X***************
X*** 5,10 ****
X--- 5,11 ----
X  
X  #include "vars.h"
X  #include "races.h"
X+ #include <curses.h>
X  #include <signal.h>
X  #include <ctype.h>
X  #include <stdio.h>
X***************
X*** 174,179 ****
X    for (j=0; j<i; j++)
X  	putchar('.');
X    for (j=0; j<i; j++)
X! 	putchar('\010');
X  }
X  
X--- 175,199 ----
X    for (j=0; j<i; j++)
X  	putchar('.');
X    for (j=0; j<i; j++)
X! 	putchar('\010');
X  }
X  
X+ /* tty stuff -- set cbreak mode */
X+ tty_on()
X+ {
X+ #ifdef UV_4.3
X+ 	cbreak();
X+ #else			/* this is 4.2 */
X+  	crmode();
X+ #endif
X+ 
X+ }
X+ 
X+ tty_off()
X+ {
X+ #ifdef UV_4.3
X+ 	nocbreak();
X+ #else			/* this is 4.2 */
X+ 	nocrmode();
X+ #endif
X+ }
X*** ../../GB/shootblast.c	Wed Apr 26 11:23:01 1989
X--- shootblast.c	Mon May  1 08:22:15 1989
X***************
X*** 14,28 ****
X  bool Nuked[MAXPLAYERS];	/* who was nuked on the planet/ship */
X  
X  
X! int shoot(from,to,fpl,tpl,sectorx,sectory,strength, sdatamod,starmod,planetmod)
X  placetype from,*to;
X  planettype *fpl,*tpl;
X  int sectorx,sectory,strength;
X  	/* reported modifications to datafiles */
X  bool *sdatamod,*starmod, *planetmod;
X  {
X  int i;
X! double dist,xfrom,yfrom,xto,yto;
X  double str;
X  float r;
X  
X--- 14,29 ----
X  bool Nuked[MAXPLAYERS];	/* who was nuked on the planet/ship */
X  
X  
X! int shoot(from,to,fpl,tpl,sectorx,sectory,strength, dist, sdatamod,starmod,planetmod)
X  placetype from,*to;
X  planettype *fpl,*tpl;
X  int sectorx,sectory,strength;
X+ float *dist;
X  	/* reported modifications to datafiles */
X  bool *sdatamod,*starmod, *planetmod;
X  {
X  int i;
X! double xfrom,yfrom,xto,yto;
X  double str;
X  float r;
X  
X***************
X*** 42,55 ****
X     yto = to->shipptr->ypos;
X   }
X  
X!  dist = sqrt( (double)Distsq(xfrom, yfrom, xto, yto)) + 50.0;
X! 						/* (adjust for too close) */
X!  if (dist > SYSTEMSIZE) {
X  	 /* out of range */
X  	return -1;
X   } else {
X  
X!      str = (double)strength * FACTOR_DAMAGE / dist;
X       printf(" str = %f, rad = %f\n",str,str*FACTOR_DESTPLANET);
X  
X       r = blast(to, tpl, sectorx, sectory, str * FACTOR_DESTPLANET, str);
X--- 43,55 ----
X     yto = to->shipptr->ypos;
X   }
X  
X!  *dist = sqrt( (double)Distsq(xfrom, yfrom, xto, yto));
X!  if (*dist > SYSTEMSIZE*2.0) {
X  	 /* out of range */
X  	return -1;
X   } else {
X  
X!      str = strength * FACTOR_DAMAGE / (*dist+50.0);
X       printf(" str = %f, rad = %f\n",str,str*FACTOR_DESTPLANET);
X  
X       r = blast(to, tpl, sectorx, sectory, str * FACTOR_DESTPLANET, str);
X*** ../../GB/teleg_send.c	Wed Apr 26 11:23:03 1989
X--- teleg_send.c	Mon May  1 08:22:17 1989
X***************
X*** 5,10 ****
X--- 5,11 ----
X  
X  
X  #include "tweakables.h"
X+ #include "files.h"
X  #include <stdio.h>
X  #include <ctype.h>
X  #include <strings.h>
END_OF_FILE
echo shar: 2 control characters may be missing from \"'patches01a'\"
if test 50459 -ne `wc -c <'patches01a'`; then
    echo shar: \"'patches01a'\" unpacked with wrong size!
fi
# end of 'patches01a'
fi
echo shar: End of shell archive.
exit 0