[comp.sources.games] v11i042: gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Patch2d

billr@saab.CNA.TEK.COM (Bill Randle) (08/29/90)

Submitted-by: VANCLEEF@mps.ohio-state.edu
Posting-number: Volume 11, Issue 42
Archive-name: gb3/Patch2d
Patch-To: gb3: Volume 10, Issue 1-14



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 4 (of 9)."
# Contents:  Docs/victory.doc patches02a
# Wrapped by billr@saab on Tue Aug 28 08:54:55 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Docs/victory.doc' -a "${1}" != "-c" ; then 
  echo shar: Renaming existing file \"'Docs/victory.doc'\" to \"'Docs/victory.doc.orig'\"
  mv -f 'Docs/victory.doc' 'Docs/victory.doc.orig'
fi
echo shar: Extracting \"'Docs/victory.doc'\" \(2059 characters\)
sed "s/^X//" >'Docs/victory.doc' <<'END_OF_FILE'
X
XNOTE: THIS IS A TENTATIVE IDEA AND HAS NOT BEEN OFFICIALLY
XDECIDED UPON. USE AT YOUR OWN RISK :)
X
X
X  VICTORY CONDITIONS FOR GB
X  =========================
X
X THE RULES:
X ==========
X
X  1) victory conditions are based on the control of systems (idea of 16)
X     a system is controlled by a block, if all occupied sectors belong 
X     to members of the block at that turn.
X
X  2) each block gets 10 Victory Point (VP) for every system it holds every turn
X
X  3) the block wich has more 130% of the VP's of any other block wins the game
X
X
X THE MOTIVATION:
X ===============
X
XSearching for victory contidions (VC), I wanted something that would
Xrelate to the number of planets the block holds. However the number of
Xplanets, the number of sectors, number of resource points, ... all
Xthese things are unsuitable, since they are almost impossible to alter
Xin say a month of playing. Thus whatever counts for VC's has to be a
Xrather small number and has to be somewhat volatile. Also, while
Xgiving them some advantage, it should be possible for a number of
Xsmall players to win against one big one. The scenario I envision
Xallows for this:
X
X1) To remove a system from another player, all you need to do is
Xoccupy one sector in the system. It will not count for you, neither
Xwill it for him. A large player will be hard pressed to constantly
Xfend off 10 small ones, if all they have to do is hold one sector.
X
X2) The core systems of large and small players alike (like most
Xpeoples home systems) will pretty much by default contribute to their 
XVP's. Thats ok. But the size of the system, you luck getting a good ot
Xbad one, will not influence this. 
X
X3) Aside from the core systems there will be a small number of systems
Xwhich tilt the balance. These and only these will be fought for.
XIn order to win you need control of these system, which is hard, but
XALOT easier than winning by say sector numbers ....
X
X4) These crucial systems will be picked strategically (i hope) by the
Xplayers they do not depend on some random initial choice when the
Xgalaxy is created. 
X
X
XWW
END_OF_FILE
if test 2059 -ne `wc -c <'Docs/victory.doc'`; then
    echo shar: \"'Docs/victory.doc'\" unpacked with wrong size!
fi
# end of 'Docs/victory.doc'
if test -f 'patches02a' -a "${1}" != "-c" ; then 
  echo shar: Renaming existing file \"'patches02a'\" to \"'patches02a.orig'\"
  mv -f 'patches02a' 'patches02a.orig'
fi
echo shar: Extracting \"'patches02a'\" \(54235 characters\)
sed "s/^X//" >'patches02a' <<'END_OF_FILE'
X*** /usr/cna/billr/games/gb3/README	Fri Jun  1 11:52:49 1990
X--- README	Thu Aug 23 14:00:15 1990
X***************
X*** 32,38 ****
X  then tells the server to do an update. The default update time is 4 hours, 
X  but you can change that with 'GB_daemon <hours between updates>'. It is a 
X  good idea to make your update times a factor of 24 hours. If you want to
X! force an update just do 'GB_doturn' by itself.
X  
X  Players cannot enroll by themselves in this version. The game's host
X  must do that by running 'GB_enroll' and following the instructions. It
X--- 32,38 ----
X  then tells the server to do an update. The default update time is 4 hours, 
X  but you can change that with 'GB_daemon <hours between updates>'. It is a 
X  good idea to make your update times a factor of 24 hours. If you want to
X! force an update just telnet to the server and enter the update password.
X  
X  Players cannot enroll by themselves in this version. The game's host
X  must do that by running 'GB_enroll' and following the instructions. It
X***************
X*** 71,73 ****
X--- 71,81 ----
X  Bill Randle
X  billr@saab.CNA.TEK.COM
X  6/1/90
X+ 
X+ 
X+ Patchlevel 2 reflects the changes necessary to bring this version up
X+ to level 1.3.1 client and level 2.2.3 server.
X+ 
X+ Bill Randle
X+ billr@saab.CNA.TEK.COM
X+ 8/24/90
X*** /usr/cna/billr/games/gb3/README_ORIG	Wed May 30 15:10:28 1990
X--- README_ORIG	Wed Aug 22 11:42:01 1990
X***************
X*** 1,3 ****
X--- 1,6 ----
X+ (Note: This is the README which came along with GB .975 in April 1989 -
X+ 	It is currently outdated and is included for historical interest only - G.vC)
X+ 
X  
X  	This is a game of interstellar exploration/conquest.  By the time I
X  realized there really wasn't going to be much fighting going on in the game, I
X*** /usr/cna/billr/games/gb3/server/GB_server.c	Thu May 31 10:10:25 1990
X--- server/GB_server.c	Fri Aug 24 15:02:35 1990
X***************
X*** 45,51 ****
X  #include <netinet/in.h>
X  #include <netdb.h>
X  
X! /*#include <time.h>	/* included by <sys/time.h> with bsd */
X  #include <sys/timeb.h>
X  
X  #include <curses.h>
X--- 45,51 ----
X  #include <netinet/in.h>
X  #include <netdb.h>
X  
X! /*#include <time.h>*/
X  #include <sys/timeb.h>
X  
X  #include <curses.h>
X***************
X*** 84,94 ****
X  char start_buf[128];
X  char update_buf[128];
X  
X! static const char *connect_fail = "Connection refused.\n";
X! static const char *create_fail = "Connection refused.\n";
X! static const char *flushed_message = "<Output Flushed>\n";
X! static const char *shutdown_message = "Shutdown ordered by deity - Bye\n";
X! static const char *already_on = "Connection refused.\n";
X  
X  int errno;
X  
X--- 84,93 ----
X  char start_buf[128];
X  char update_buf[128];
X  
X! static char *connect_fail = "Connection refused.\n";
X! static char *flushed_message = "<Output Flushed>\n";
X! static char *shutdown_message = "Shutdown ordered by deity - Bye\n";
X! static char *already_on = "Connection refused.\n";
X  
X  int errno;
X  
X***************
X*** 134,140 ****
X  void welcome_user();
X  void check_connect();
X  void close_sockets();
X! const char *addrout ();
X  void dump_users();
X  void set_signals();
X  struct descriptor_data *new_connection();
X--- 133,139 ----
X  void welcome_user();
X  void check_connect();
X  void close_sockets();
X! char *addrout ();
X  void dump_users();
X  void set_signals();
X  struct descriptor_data *new_connection();
X***************
X*** 180,187 ****
X  {
X  int maim_stardata, s; 
X  int i, j, dummy;
X- #ifdef BSD4_2
X  char zone[16];
X  struct timeval tp;
X  struct timezone tzp;
X  #endif
X--- 179,186 ----
X  {
X  int maim_stardata, s; 
X  int i, j, dummy;
X  char zone[16];
X+ #ifdef BSD4_2
X  struct timeval tp;
X  struct timezone tzp;
X  #endif
X***************
X*** 222,260 ****
X  	}
X  	Putblock(Blocks);
X  
X! Num_races = Numraces();
X! /* compute alliance block power */
X! sprintf(Power_blocks.time, "%2d/%2d/%d %02d:%02d:%02d %s", 
X! 	current_tm->tm_mon+1, current_tm->tm_mday,
X! 	current_tm->tm_year, current_tm->tm_hour,
X! 	current_tm->tm_min, current_tm->tm_sec, zone);
X!  for (i=1; i<=Num_races; i++) {
X! 	dummy=(Blocks[i-1].invite & Blocks[i-1].pledge);
X! 				Power_blocks.members[i-1] = 0;
X! 				Power_blocks.sectors_owned[i-1] = 0;
X! 				Power_blocks.popn[i-1] = 0;
X! 				Power_blocks.ships_owned[i-1] = 0;
X! 				Power_blocks.planets_owned[i-1] = 0;
X! 				Power_blocks.resource[i-1] = 0;
X! 				Power_blocks.fuel[i-1] = 0;
X! 				Power_blocks.destruct[i-1] = 0;
X! 				Power_blocks.VPs[i-1] = 0;
X! 	for(j=1; j<=Num_races; j++) 
X! 			if(isset(dummy, j)){
X! 				Power_blocks.members[i-1] += 1;
X! 				Power_blocks.sectors_owned[i-1] += Power[j-1].sectors_owned;
X! 				Power_blocks.popn[i-1] += Power[j-1].popn;
X! 				Power_blocks.ships_owned[i-1] += Power[j-1].ships_owned;
X! 				Power_blocks.planets_owned[i-1] += Power[j-1].planets_owned;
X! 				Power_blocks.resource[i-1] += Power[j-1].resource;
X! 				Power_blocks.fuel[i-1] += Power[j-1].fuel;
X! 				Power_blocks.destruct[i-1] += Power[j-1].destruct;
X! 				Power_blocks.VPs[i-1] += Blocks[j-1].VPs;
X! 			}
X! 	}
X  
X- 
X- 
X      shovechars (argc==1 ? GB_PORT : atoi (argv[1]) );
X      close_sockets ();
X  printf("Going down.\n");
X--- 221,228 ----
X  	}
X  	Putblock(Blocks);
X  
X! compute_power_blocks();
X  
X      shovechars (argc==1 ? GB_PORT : atoi (argv[1]) );
X      close_sockets ();
X  printf("Going down.\n");
X***************
X*** 363,369 ****
X--- 331,339 ----
X  		return;
X  	    }
X  	} else {
X+ 
X  	    (void) time (&now);
X+ 
X  	    if (FD_ISSET (sock, &input_set)) {
X  		if (!(newd = new_connection (sock))) {
X  		    if (errno != EINTR && errno != EMFILE) {
X***************
X*** 375,384 ****
X  		    maxd = newd->descriptor + 1;
X  		}
X  	    }
X  	    for (d = descriptor_list; d; d = dnext) {
X  		dnext = d->next;
X  		if (FD_ISSET (d->descriptor, &input_set)) {
X! 			d->last_time = now;
X  			if (!process_input (d)) {
X  			    shutdownsock (d);
X  			    continue;
X--- 345,355 ----
X  		    maxd = newd->descriptor + 1;
X  		}
X  	    }
X+ 
X  	    for (d = descriptor_list; d; d = dnext) {
X  		dnext = d->next;
X  		if (FD_ISSET (d->descriptor, &input_set)) {
X! /*			d->last_time = now; */
X  			if (!process_input (d)) {
X  			    shutdownsock (d);
X  			    continue;
X***************
X*** 390,395 ****
X--- 361,367 ----
X  		    }
X  		}
X  	    }
X+ 
X  	}
X      }
X  }
X***************
X*** 460,466 ****
X      }
X  }
X  
X! const char *addrout(a)
X  long a;
X  {
X      static char outbuf[1024];
X--- 432,438 ----
X      }
X  }
X  
X! char *addrout(a)
X  long a;
X  {
X      static char outbuf[1024];
X***************
X*** 536,542 ****
X  }
X  
X  struct text_block *make_text_block(s, n)
X! const char *s;
X  int n;
X  {
X  	struct text_block *p;
X--- 508,514 ----
X  }
X  
X  struct text_block *make_text_block(s, n)
X! char *s;
X  int n;
X  {
X  	struct text_block *p;
X***************
X*** 559,565 ****
X  
X  void add_to_queue(q, b, n)
X  struct text_queue *q;
X! const char *b;
X  int n;
X  {
X      struct text_block *p;
X--- 531,537 ----
X  
X  void add_to_queue(q, b, n)
X  struct text_queue *q;
X! char *b;
X  int n;
X  {
X      struct text_block *p;
X***************
X*** 598,604 ****
X  
X  int queue_write(d, b, n)
X  struct descriptor_data *d;
X! const char *b;
X  int n;
X  {
X      int space;
X--- 570,576 ----
X  
X  int queue_write(d, b, n)
X  struct descriptor_data *d;
X! char *b;
X  int n;
X  {
X      int space;
X***************
X*** 613,619 ****
X  
X  int queue_string(d, s)
X  struct descriptor_data *d;
X! const char *s;
X  {
X      return queue_write (d, s, strlen (s));
X  }
X--- 585,591 ----
X  
X  int queue_string(d, s)
X  struct descriptor_data *d;
X! char *s;
X  {
X      return queue_write (d, s, strlen (s));
X  }
X***************
X*** 646,651 ****
X--- 618,632 ----
X      return 1;
X  }
X  
X+ void force_output()
X+ {
X+ 	struct descriptor_data *d;
X+ 
X+ 	for (d = descriptor_list; d; d = d->next)
X+ 		if (d->connected)
X+ 			process_output(d);
X+ }
X+ 
X  void make_nonblocking(s)
X  int s;
X  {
X***************
X*** 723,733 ****
X  void goodbye_user(d)
X  struct descriptor_data *d;
X  {
X      write (d->descriptor, LEAVE_MESSAGE, strlen (LEAVE_MESSAGE));
X  }
X  
X  char *strsave (s)
X! const char *s;
X  {
X      char *p;
X  
X--- 704,715 ----
X  void goodbye_user(d)
X  struct descriptor_data *d;
X  {
X+ if(d->connected) /* this can happen, especially after updates */
X      write (d->descriptor, LEAVE_MESSAGE, strlen (LEAVE_MESSAGE));
X  }
X  
X  char *strsave (s)
X! char *s;
X  {
X      char *p;
X  
X***************
X*** 740,746 ****
X  
X  void save_command (d, command)
X  struct descriptor_data *d;
X! const char *command;
X  
X  {
X      add_to_queue (&d->input, command, strlen(command)+1);
X--- 722,728 ----
X  
X  void save_command (d, command)
X  struct descriptor_data *d;
X! char *command;
X  
X  {
X      add_to_queue (&d->input, command, strlen(command)+1);
X***************
X*** 783,789 ****
X  
X  void set_userstring (userstring, command)
X  char **userstring;
X! const char *command;
X  {
X      if (*userstring) {
X  	free(*userstring);
X--- 765,771 ----
X  
X  void set_userstring (userstring, command)
X  char **userstring;
X! char *command;
X  {
X      if (*userstring) {
X  	free(*userstring);
X***************
X*** 795,810 ****
X  	*userstring = strsave (command);
X  }
X  
X- #ifdef __STDC__
X- void process_commands(void)
X- #else
X  void process_commands()
X- #endif
X  {
X      int nprocessed;
X      struct descriptor_data *d, *dnext;
X      struct text_block *t;
X  
X      do {
X  	nprocessed = 0;
X  	for (d = descriptor_list; d; d = dnext) {
X--- 777,792 ----
X  	*userstring = strsave (command);
X  }
X  
X  void process_commands()
X  {
X      int nprocessed;
X+ 	long now;
X      struct descriptor_data *d, *dnext;
X      struct text_block *t;
X  
X+ 
X+     (void) time (&now);
X+ 
X      do {
X  	nprocessed = 0;
X  	for (d = descriptor_list; d; d = dnext) {
X***************
X*** 816,825 ****
X--- 798,809 ----
X  		if (!do_command (d, t -> start)) {
X  		    shutdownsock (d);
X  		} else {
X+ 		    d->last_time = now;	/* experimental code */
X  		    d -> input.head = t -> nxt;
X  		    if (!d -> input.head)
X  			d -> input.tail = &d -> input.head;
X  		    free_text_block (t);
X+ 			d->last_time = now;	/* experimental code */
X  		}
X  
X  	    }
X***************
X*** 860,873 ****
X  	if(d->connected) {
X  
X  	openracedata(&server_racedata);
X! 		  getrace(server_racedata, &r, d->Playernum);
X  	close_file(server_racedata);
X  
X!      	sprintf(buf, "%s (%d) logged out.\n", r->name, d->Playernum);
X     	 for(i=1; i<=Numraces(); i++)
X  		if(!Dir[i-1].gag)
X                		notify(i, buf);
X! 			}
X  	goodbye_user (d);
X  	return 0;
X      } else if (!strcmp (args[0], WHO_COMMAND)) {
X--- 844,858 ----
X  	if(d->connected) {
X  
X  	openracedata(&server_racedata);
X! 	getrace(server_racedata, &r, (int)d->Playernum);
X  	close_file(server_racedata);
X  
X!      	sprintf(buf, "%s [%d] logged out.\n", r->name, d->Playernum);
X     	 for(i=1; i<=Numraces(); i++)
X  		if(!Dir[i-1].gag)
X                		notify(i, buf);
X! 	free(r);
X!     }
X  	goodbye_user (d);
X  	return 0;
X      } else if (!strcmp (args[0], WHO_COMMAND)) {
X***************
X*** 889,909 ****
X  			}	
X  	}
X      }
X      return 1;
X  }
X  
X  void check_connect (d, msg)
X  struct descriptor_data *d;
X! const char *msg;
X  {
X      char password[MAX_COMMAND_LEN];
X      reg int i;
X!     int Playernum, Num_races;
X      racetype *r;
X      struct descriptor_data *d0, *dnext;
X- #ifdef BSD4_2
X      char zone[16];
X- #endif
X  
X      parse_connect (msg,  password);
X  
X--- 874,893 ----
X  			}	
X  	}
X      }
X+ 
X      return 1;
X  }
X  
X  void check_connect (d, msg)
X  struct descriptor_data *d;
X! char *msg;
X  {
X      char password[MAX_COMMAND_LEN];
X      reg int i;
X!     int Playernum, Num_races, racefile;
X      racetype *r;
X      struct descriptor_data *d0, *dnext;
X      char zone[16];
X  
X      parse_connect (msg,  password);
X  
X***************
X*** 914,920 ****
X  for (i=1; i<=Num_races; i++)
X  	notify(i, "DOING UPDATE...\n");
X  
X! 
X      clk = time(0);
X      update_tm=localtime(&clk);
X  #ifdef BSD4_2
X--- 898,904 ----
X  for (i=1; i<=Num_races; i++)
X  	notify(i, "DOING UPDATE...\n");
X  
X! force_output();
X      clk = time(0);
X      update_tm=localtime(&clk);
X  #ifdef BSD4_2
X***************
X*** 922,927 ****
X--- 906,925 ----
X  #else
X      strcpy(zone, update_tm->tm_zone);
X  #endif
X+ 
X+ /* if hour is 0, allocate daily login time */
X+ if(!update_tm->tm_hour) {
X+ openracedata(&racefile);
X+     for (i=1; i<=Num_races; i++) {
X+ 	getrace(racefile, &r, i);
X+ 	r->daily = DAILY*60;
X+ 	if(!(update_tm->tm_mday%7))
X+ 	    r->weekly = WEEKLY*60;
X+ 	putrace(racefile, r);
X+     }
X+ close_file(racefile);
X+ }
X+ 
X  sprintf(Power_blocks.time, "%2d/%2d/%d %02d:%02d:%02d %s", 
X  	update_tm->tm_mon+1, update_tm->tm_mday,
X  	update_tm->tm_year, update_tm->tm_hour,
X***************
X*** 930,937 ****
X  	update_tm->tm_mon+1, update_tm->tm_mday,
X  	update_tm->tm_year, update_tm->tm_hour,
X  	update_tm->tm_min, update_tm->tm_sec, zone);
X!     do_turn();
X! 	return;
X  	}
X  
X  
X--- 928,937 ----
X  	update_tm->tm_mon+1, update_tm->tm_mday,
X  	update_tm->tm_year, update_tm->tm_hour,
X  	update_tm->tm_min, update_tm->tm_sec, zone);
X! 
X! 	    do_turn();
X! 
X! return;
X  	}
X  
X  
X***************
X*** 944,950 ****
X  	} else {
X  
X  	openracedata(&server_racedata);
X! 		  getrace(server_racedata, &r, i);
X  	close_file(server_racedata);
X  
X  		  Playernum = r->Playernum;
X--- 944,950 ----
X  	} else {
X  
X  	openracedata(&server_racedata);
X! 	getrace(server_racedata, &r, (int)i);
X  	close_file(server_racedata);
X  
X  		  Playernum = r->Playernum;
X***************
X*** 958,976 ****
X  		}
X  	}
X  
X! 	    fprintf (stderr, "CONNECTED %s(%d) on descriptor %d\n",
X  		     r->name, Playernum, d->descriptor);
X  	    d->connected = 1;
X  	    d->Playernum = Playernum;
X  
X! 		sprintf(buf,"\nLogged in as %s (%d).\n",r->name,Playernum);
X  		notify(Playernum, buf);
X       
X! 		sprintf(buf, "%s (%d) logged on.\n", r->name, Playernum);
X  		for(i=1; i<=Numraces(); i++)
X  	          	if(i != Playernum && !Dir[i-1].gag) notify(i, buf);
X  
X! 	GB_time(Playernum);
X  	if (r->Gov_ship==0) {
X  		sprintf(buf,"You have no Governmental Center.  No action points will be produced\nuntil you build one and designate a capital.\n");
X  		notify(Playernum, buf);
X--- 958,977 ----
X  		}
X  	}
X  
X! 	    fprintf (stderr, "CONNECTED %s [%d] on descriptor %d\n",
X  		     r->name, Playernum, d->descriptor);
X  	    d->connected = 1;
X  	    d->Playernum = Playernum;
X  
X! 		sprintf(buf,"\nLogged in as %s [%d].\n",r->name,Playernum);
X  		notify(Playernum, buf);
X       
X! 		sprintf(buf, "%s [%d] logged on.\n", r->name, Playernum);
X  		for(i=1; i<=Numraces(); i++)
X  	          	if(i != Playernum && !Dir[i-1].gag) notify(i, buf);
X  
X! 	GB_time(Playernum, r, 0);
X! 	if(r->standby) notify(Playernum, "Standing by\n");
X  	if (r->Gov_ship==0) {
X  		sprintf(buf,"You have no Governmental Center.  No action points will be produced\nuntil you build one and designate a capital.\n");
X  		notify(Playernum, buf);
X***************
X*** 978,988 ****
X  		sprintf(buf,"Government Center #%d is active.\n", r->Gov_ship);
X  		notify(Playernum, buf);
X  		}
X! 	}
X  }
X  
X  void parse_connect (msg, pass)
X! const char *msg;
X  char *pass;
X  {
X      char *p;
X--- 979,994 ----
X  		sprintf(buf,"Government Center #%d is active.\n", r->Gov_ship);
X  		notify(Playernum, buf);
X  		}
X! 	if(!r->daily) {
X! 		notify(Playernum, "You have no daily active time left.\n");
X! 		}
X! 
X! 	free(r);
X!     }
X  }
X  
X  void parse_connect (msg, pass)
X! char *msg;
X  char *pass;
X  {
X      char *p;
X***************
X*** 995,1005 ****
X      *p = '\0';
X  }
X  
X- #ifdef __STDC__
X- void close_sockets(void)
X- #else
X  void close_sockets()
X- #endif
X  {
X      struct descriptor_data *d, *dnext;
X  
X--- 1001,1007 ----
X***************
X*** 1013,1034 ****
X      close (sock);
X  }
X  
X- #ifdef __STDC__
X- void emergency_shutdown(void)
X- #else
X  void emergency_shutdown()
X- #endif
X  {
X  	close_sockets();
X  }
X  
X! #ifdef __STDC__
X! int bailout(int sig, int code, struct sigcontext *scp)
X! #else
X! int bailout(sig, code, scp)
X! int sig, code;
X  struct sigcontext *scp;
X- #endif
X  {
X      char message[1024];
X      
X--- 1015,1029 ----
X      close (sock);
X  }
X  
X  void emergency_shutdown()
X  {
X  	close_sockets();
X  }
X  
X! int bailout(sig ,code,scp)
X! int sig;
X! int code;
X  struct sigcontext *scp;
X  {
X      char message[1024];
X      
X***************
X*** 1038,1048 ****
X      return 0;
X  }
X  
X- #ifdef __STDC__
X- int dump_status(void)
X- #else
X  int dump_status()
X- #endif
X  {
X      struct descriptor_data *d;
X      long now;
X--- 1033,1039 ----
X***************
X*** 1053,1061 ****
X  openracedata(&server_racedata);
X      for (d = descriptor_list; d; d = d->next) {
X  	if (d->connected) {
X! 	    getrace(server_racedata, &r, d->Playernum);
X  	    fprintf (stderr, "PLAYING descriptor %d Playernum %s(%d)",
X  		     d->descriptor, r->name, d->Playernum);
X  
X  	    if (d->last_time)
X  		fprintf (stderr, " idle %d seconds\n",
X--- 1044,1053 ----
X  openracedata(&server_racedata);
X      for (d = descriptor_list; d; d = d->next) {
X  	if (d->connected) {
X! 	    getrace(server_racedata, &r, (int)d->Playernum);
X  	    fprintf (stderr, "PLAYING descriptor %d Playernum %s(%d)",
X  		     d->descriptor, r->name, d->Playernum);
X+ 	    free(r);
X  
X  	    if (d->last_time)
X  		fprintf (stderr, " idle %d seconds\n",
X***************
X*** 1087,1120 ****
X  openracedata(&server_racedata);
X      for (d = descriptor_list; d; d = d->next) {
X  	if (d->connected) {
X! 	    getrace(server_racedata, &r, d->Playernum);
X  
X  	    if (d->last_time)
X! 		sprintf (buf, "%20s (%3d)     seconds idle %d\n", r->name, 
X! 			d->Playernum, now - d->last_time);
X  	    else
X! 		sprintf (buf, "%20s (%3d)     idle forever\n", r->name, d->Playernum);
X  	    queue_string (e, buf);
X  	}
X      }
X  close_file(server_racedata);
X  }
X  
X  void process_command(Playernum, command) 
X  /* locate and parse the command for processing */
X  int Playernum;
X  char *command;
X  {
X! int i,argn=0;
X  boolean parse_exit=0;
X  char args[MAXARGS][COMMANDSIZE];
X  char *string, *announcement, *dummy;
X  
X- openracedata(&server_racedata);
X- free(Race);
X- getrace(server_racedata, &Race, Playernum);
X- close_file(server_racedata);
X- 
X  	string=command;	/* make pointers the same */
X  
X  	while (!parse_exit) {
X--- 1079,1129 ----
X  openracedata(&server_racedata);
X      for (d = descriptor_list; d; d = d->next) {
X  	if (d->connected) {
X! 	    getrace(server_racedata, &r, (int)d->Playernum);
X  
X  	    if (d->last_time)
X! 		sprintf (buf, "%20s [%2d] [%d:%d] seconds idle %d %s %s\n", r->name, 
X! 			d->Playernum, r->weekly/60, r->daily/60, now - d->last_time, (r->gag ? "GAG": ""),
X! 			(r->standby ? "STAND BY" : ""));
X  	    else
X! 		sprintf (buf, "%20s [%2d] idle forever\n", r->name, d->Playernum);
X  	    queue_string (e, buf);
X+ 	    free(r);
X+ 	    if((now - d->last_time) > DISCONNECT_TIME)
X+ 		d->connected = 0;
X  	}
X      }
X  close_file(server_racedata);
X  }
X  
X+ int daily_time(r)
X+ racetype *r;
X+ {
X+     struct descriptor_data *d;
X+     long now;
X+     int time_left;
X+ 
X+     time_left = r->daily;
X+     
X+     (void) time (&now);
X+     for (d = descriptor_list; d; d = d->next)
X+ 	if (d->connected && d->last_time && (d->Playernum==r->Playernum)) {
X+ 	    time_left = MAX(0, r->daily - (now - d->last_time));
X+ 	}
X+     return time_left;
X+ }
X+ 
X  void process_command(Playernum, command) 
X  /* locate and parse the command for processing */
X  int Playernum;
X  char *command;
X  {
X! int i, j,argn=0, God, ok, old;
X  boolean parse_exit=0;
X  char args[MAXARGS][COMMANDSIZE];
X  char *string, *announcement, *dummy;
X+ racetype *r;
X  
X  	string=command;	/* make pointers the same */
X  
X  	while (!parse_exit) {
X***************
X*** 1138,1207 ****
X  /* target routine is specified by the first substring, other options 
X  	are the substrings which follow */
X  
X          if (!strncmp(args[0],"announce",i))
X  			announce(Playernum,0,argn,args, 0);
X!          else if (!strncmp(args[0],"allocate",i)) allocateAPs(Playernum,0, argn, args);
X!          else if (!strncmp(args[0],"assault",i)) land(Playernum,1,argn,args,1);
X  	else if (!strncmp(args[0], "autoreport",i)) autoreport(Playernum, 0, argn, args);
X! 	else if (!strncmp(args[0],"build",i)) build(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0], "broadcast", i)) announce(Playernum, 5*(!Race->God), argn, args, 1);
X! 	else if (!strncmp(args[0], "block", i)) block(Playernum, 0, argn, args);
X!          else if (!strncmp(args[0],"capitol",i)) capitol(Playernum,50,argn,args);
X!          else if (!strncmp(args[0],"capture",i)) capture(Playernum,1,argn,args);
X  	else if (!strncmp(args[0], "center", i)) center(Playernum, 0, argn, args);
X  	else if (!strncmp(args[0],"cs",i)) cs(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"declare",i)) declare(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"dock",i)) land(Playernum,0,argn,args,0);
X! 	else if (!strncmp(args[0],"enslave",i)) enslave(Playernum,2,argn,args);
X! 	else if (!strncmp(args[0],"examine",i)) examine(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"explore",i)) exploration(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"fire",i)) fire(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0], "gag", i)) Dir[Playernum-1].gag = !Dir[Playernum-1].gag;
X! 	else if (!strncmp(args[0],"give",i)) give(Playernum,5,argn,args);
X  	else if (!strncmp(args[0], "identify", i)) whois(Playernum, 0, argn, args);
X! 	else if (!strncmp(args[0], "invite", i)) invite(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0],"land",i)) land(Playernum,1,argn,args,0);
X! 	else if (!strncmp(args[0],"launch",i)) launch(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0], "list", i) && Race->God) list(Playernum);
X! 	else if (!strncmp(args[0],"load",i)) load(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"map",i)) map(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"mobilize",i)) mobilize(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"move",i)) move_popn(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"make", i)) make_mod(Playernum, 0, argn, args, 0);
X! 	else if (!strncmp(args[0],"modify", i)) make_mod(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0],"name",i)) name(Playernum,1*(!Race->God),argn,args);
X! 	else if (!strncmp(args[0],"object",i)) rst(Playernum,0,argn,args,4);
X! 	else if (!strncmp(args[0],"orbit",i)) orbit(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"order",i)) order(Playernum,1,argn,args); 
X! 	else if (!strncmp(args[0],"page",i)) page(Playernum, 1*(!Race->God), argn, args);
X!          else if (!strncmp(args[0],"colonies",i)) colonies(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0], "pledge", i)) pledge(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0],"power",i)) power(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"profile",i)) profile(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"relation",i)) relation(Playernum,0,argn,args);
X  	else if (!strncmp(args[0],"read",i)) read_messages(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"reset", i) && Race->God) reload_star_data_base();
X! 	else if (!strncmp(args[0],"report",i)) rst(Playernum,0,argn,args,0);
X! 	else if (!strncmp(args[0],"@@shutdown",i) && Race->God) {
X  		shutdown_flag = 1;
X  		notify(Playernum, "Doing shutdown.\n");
X! 	} else if (!strncmp(args[0],"stock",i)) rst(Playernum,0,argn,args,1);
X! 	else if (!strncmp(args[0],"ship",i)) rst(Playernum,0,argn,args,3);
X! 	else if (!strncmp(args[0],"survey",i)) survey(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0], "send", i)) send_message(Playernum, 1*(!Race->God), argn, args);
X! 	else if (!strncmp(args[0],"scrap",i)) scrap(Playernum,1,argn,args);
X! 	else if(!strncmp(args[0],"tactical",i)) rst(Playernum,0,argn,args,2);
X! /*	else if (!strncmp(args[0],"telegram",i)) telegram(Playernum,0,argn,args); */
X! 	else if(!strncmp(args[0],"technology",i)) technology(Playernum,1,argn,args);
X  	else if (!strncmp(args[0],"toggle",i)) toggle(Playernum,0,argn,args);
X! 	else if(!strncmp(args[0],"toxicity",i)) toxicity(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"transfer",i)) transfer(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"unload",i)) load(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"undock",i)) launch(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0], "uninvite", i)) invite(Playernum, 0, argn, args, 0); 
X! 	else if (!strncmp(args[0], "unpledge", i)) pledge(Playernum, 0, argn, args, 0); 
X!         else if (!strncmp(args[0],"time",i)) GB_time(Playernum);
X! 	else if (!strncmp(args[0],"zoom",i)) zoom(Playernum,0,argn,args);
X  			/* only owning player can use fix */
X  	 else {
X  	       sprintf(buf,"'%s':illegal command error(%d).\n",args[0],*args[0]);
X--- 1147,1252 ----
X  /* target routine is specified by the first substring, other options 
X  	are the substrings which follow */
X  
X+ openracedata(&server_racedata);
X+ getrace(server_racedata, &r, Playernum);
X+ old = r->daily;
X+ God = r->God;
X+ if(!r->standby && r->daily) {
X+ 	r->daily = (short)daily_time(r);
X+ 	putrace(server_racedata, r);
X+ 	}
X+ close_file(server_racedata);
X+ 
X+ ok = ((!r->standby && r->daily) || God);	/* whether or not the player can execture the command */
X+ 
X          if (!strncmp(args[0],"announce",i))
X  			announce(Playernum,0,argn,args, 0);
X!          else if (!strncmp(args[0],"allocate",i) && ok) allocateAPs(Playernum,0, argn, args);
X!          else if (!strncmp(args[0],"assault",i) && ok) dock(Playernum,1,argn,args,1);
X  	else if (!strncmp(args[0], "autoreport",i)) autoreport(Playernum, 0, argn, args);
X! 	else if (!strncmp(args[0],"build",i) && ok) build(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0], "'", i) || !strncmp(args[0], "broadcast", i)) announce(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0], "block", i) && ok) block(Playernum, 0, argn, args);
X!          else if (!strncmp(args[0],"capitol",i) && ok) capitol(Playernum,50,argn,args);
X!          else if (!strncmp(args[0],"capture",i) && ok) capture(Playernum,1,argn,args);
X  	else if (!strncmp(args[0], "center", i)) center(Playernum, 0, argn, args);
X  	else if (!strncmp(args[0],"cs",i)) cs(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"declare",i) && ok) declare(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"detonate",i) && ok) detonate(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"dismount", i) && ok) mount(Playernum, 0, argn, args, 0);
X! 	else if (!strncmp(args[0], "dissolve", i)) dissolve(Playernum, argn, args);
X! 	else if (!strncmp(args[0],"dock",i) && ok) dock(Playernum,0,argn,args,0);
X! 	else if (!strncmp(args[0],"dump",i) && ok) dump(Playernum,10,argn,args,0);
X! 	else if (!strncmp(args[0],"enslave",i) && ok) enslave(Playernum,2,argn,args);
X! 	else if (!strncmp(args[0],"examine",i) && ok) examine(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"explore",i) && ok) exploration(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"fire",i) && ok) fire(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"give",i) && ok) give(Playernum,5,argn,args);
X! 	else if (!strncmp(args[0], "highlight", i)) highlight(Playernum, 0, argn, args);
X  	else if (!strncmp(args[0], "identify", i)) whois(Playernum, 0, argn, args);
X! 	else if (!strncmp(args[0], "invite", i) && ok) invite(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0],"land",i) && ok) land(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"launch",i) && ok) launch(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0], "list", i) && God) list(Playernum);
X! 	else if (!strncmp(args[0],"load",i) && ok) load(Playernum,0,argn,args, 0);
X! 	else if (!strncmp(args[0],"map",i) && ok) map(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"mobilize",i) && ok) mobilize(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"move",i) && ok) move_popn(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"make", i) && ok) make_mod(Playernum, 0, argn, args, 0);
X! 	else if (!strncmp(args[0],"modify", i) && ok) make_mod(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0],"mount", i) && ok) mount(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0],"motto", i) && ok) motto(Playernum, 0, argn, args);
X! 	else if (!strncmp(args[0],"name",i) && ok) name(Playernum, !God,argn,args);
X! 	else if (!strncmp(args[0],"orbit",i) && ok) orbit(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"order",i) && ok) order(Playernum,1,argn,args); 
X! 	else if (!strncmp(args[0],"page",i)) page(Playernum, !God, argn, args);
X!          else if (!strncmp(args[0],"colonies",i) && ok) colonies(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0], "pledge", i) && ok) pledge(Playernum, 0, argn, args, 1);
X! 	else if (!strncmp(args[0],"power",i) && ok) power(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"profile",i) && ok) profile(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"production", i) && ok) production(Playernum, 0, argn, args);
X! 	else if (!strncmp(args[0],"relation",i) && ok) relation(Playernum,0,argn,args);
X  	else if (!strncmp(args[0],"read",i)) read_messages(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"reset", i) && God) {
X! 				for (j=1; j<=Numraces(); j++)
X! 				notify(j, "DOING RESET...\n");
X! 				force_output();
X! 			reload_star_data_base();
X! 			do_reset();
X! 			}
X! 	else if (!strncmp(args[0],"report",i) && ok) rst(Playernum,0,argn,args,0);
X! 	else if (!strncmp(args[0],"repair",i) && ok) repair(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0],"@@shutdown",i) && God) {
X  		shutdown_flag = 1;
X  		notify(Playernum, "Doing shutdown.\n");
X! 	} else if (!strncmp(args[0],"stock",i) && ok) rst(Playernum,0,argn,args,1);
X! 	else if (!strncmp(args[0], "standby", i)) {
X! 		r->standby = !r->standby;
X! 		openracedata(&server_racedata);
X! 		putrace(server_racedata, r);
X! 		close_file(server_racedata);
X! 		if(r->standby) notify(Playernum, "Standing by\n");
X! 		else notify(Playernum, "Returning to active status\n");
X! 	} else if (!strncmp(args[0],"stats",i) && ok) rst(Playernum,0,argn,args,4);
X! 	else if (!strncmp(args[0],"ship",i) && ok) rst(Playernum,0,argn,args,3);
X! 	else if (!strncmp(args[0],"survey",i) && ok) survey(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0], "send", i)) send_message(Playernum, 1*(!God), argn, args);
X! 	else if (!strncmp(args[0],"scrap",i) && ok) scrap(Playernum,1,argn,args);
X! 	else if(!strncmp(args[0],"tactical",i) && ok) rst(Playernum,0,argn,args,2);
X! 	else if(!strncmp(args[0],"technology",i) && ok) technology(Playernum,1,argn,args);
X  	else if (!strncmp(args[0],"toggle",i)) toggle(Playernum,0,argn,args);
X! 	else if(!strncmp(args[0],"toxicity",i) && ok) toxicity(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"transfer",i) && ok) transfer(Playernum,1,argn,args);
X! 	else if (!strncmp(args[0],"unload",i) && ok) load(Playernum,0,argn,args, 1);
X! 	else if (!strncmp(args[0],"undock",i) && ok) launch(Playernum,0,argn,args);
X! 	else if (!strncmp(args[0], "uninvite", i) && ok) invite(Playernum, 0, argn, args, 0); 
X! 	else if (!strncmp(args[0], "unpledge", i) && ok) pledge(Playernum, 0, argn, args, 0); 
X!         else if (!strncmp(args[0],"time",i)) {
X! 			int alloc;
X! 			if(argn > 1) alloc = atoi(args[1]);
X! 			else alloc = 0;
X! 			GB_time(Playernum, r, alloc);
X! 	} else if (!strncmp(args[0],"zoom",i)) zoom(Playernum,0,argn,args);
X  			/* only owning player can use fix */
X  	 else {
X  	       sprintf(buf,"'%s':illegal command error(%d).\n",args[0],*args[0]);
X***************
X*** 1208,1221 ****
X  		notify(Playernum, buf);
X  		}
X  
X! /* send the prompt to the player */
X! 	sprintf(buf, "%s", Dir[Playernum-1].prompt);
X  		notify(Playernum, buf);
X  
X  }
X  
X  void panic(message)
X! const char *message;
X  {
X      FILE *f;
X      int i;
X--- 1253,1272 ----
X  		notify(Playernum, buf);
X  		}
X  
X! /* compute the prompt and send to the player */
X! do_prompt(r);
X! 
X! if(old && !r->daily)
X! 	notify(Playernum, "You're daily time allocation has run out!!!\n");
X! 
X! free(r);
X! sprintf(buf, "%s", Dir[Playernum-1].prompt);
X  		notify(Playernum, buf);
X  
X  }
X  
X  void panic(message)
X! char *message;
X  {
X      FILE *f;
X      int i;
X***************
X*** 1261,1273 ****
X  	strcat(s1, s2);
X  }
X  
X! GB_time(Playernum) /* report back the update status */
X  int Playernum;
X  {
X- #ifdef BSD4_2
X      char zone[16];
X- #endif
X  
X      clk = time(0);
X      current_tm=localtime(&clk);
X  #ifdef BSD4_2
X--- 1312,1325 ----
X  	strcat(s1, s2);
X  }
X  
X! GB_time(Playernum, r, alloc) /* report back the update status */
X  int Playernum;
X+ racetype *r;
X+ int alloc;
X  {
X      char zone[16];
X  
X+ 	if(!alloc) {
X      clk = time(0);
X      current_tm=localtime(&clk);
X  #ifdef BSD4_2
X***************
X*** 1286,1291 ****
X--- 1338,1359 ----
X     notify(Playernum, "No updates since the server was started.\n");
X      /* can happen if you have just started the game up */   
X  notify(Playernum, start_buf);
X+ 
X+ sprintf(buf, "%d/%d weekly/daily minutes of active time remaining.\n", r->weekly/60, r->daily/60);
X+ notify(Playernum, buf);
X+ 	} else if(alloc  > 0) {
X+ 		printf("%d\n", alloc);
X+ 		alloc = MIN(MIN(alloc*60, r->weekly), DAILY*60 - r->daily)/60;
X+ 		r->weekly -= alloc*60;
X+ 		r->daily += alloc*60;
X+ 		sprintf(buf, "%d minutes of weekly allotment allocated.\n", alloc);
X+ 		notify(Playernum, buf);
X+ 	openracedata(&server_racedata);
X+ 	putrace(server_racedata, r);
X+ 	close_file(server_racedata);
X+ 	} else {
X+ 		notify(Playernum, "You can only allocate a positive number of minutes.\n");
X+ 	}
X  }
X  
X  help(e, argn,args)
X***************
X*** 1299,1327 ****
X  	sprintf(buf,"usage: help [topic]\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"    valid topics are:\n  CONCEPTS:\n%s",
X! 		"help     scope    actionpoints       explore    colony\n" );
X  		queue_string(e, buf);
X! 	sprintf(buf,"daemon   races     blocks     quit  	     info\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"\n  COMMANDS:\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"cs       map      survey  orbit      zoom     autoreport\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"toggle   gag	  capitol  allocate\n\n");
X  		queue_string(e, buf);
X! 	sprintf(buf, "announce page    who    time    quit\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"build    ship     stock   report     tactical  order     examine\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"land     launch   dock    undock     load      assault   scrap\n\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"assault  capture  fire    give       move       enslave\n\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"declare  profile  relation    power   explore\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"colonies name     mobilize technology toxicity   transfer\n");
X  		queue_string(e, buf);
X! 	sprintf(buf, "make   modify\n");
X  		queue_string(e, buf); 
X  
X   } else {
X--- 1367,1395 ----
X  	sprintf(buf,"usage: help [topic]\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"    valid topics are:\n  CONCEPTS:\n%s",
X! 		"beginner\nhelp     scope    actionpoints       explore    colony\n" );
X  		queue_string(e, buf);
X! 	sprintf(buf,"daemon   races     blocks     quit  	crystal     lasers	info\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"\n  COMMANDS:\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"cs       map      survey  orbit      zoom     autoreport    production\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"toggle   gag	  capitol  allocate\n\n");
X  		queue_string(e, buf);
X! 	sprintf(buf, "announce page    who    time    standby	quit\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"build    ship     stock   report     tactical  stats order     examine\n");
X  		queue_string(e, buf);
X  	sprintf(buf,"land     launch   dock    undock     load      assault   scrap\n\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"assault  capture  fire    give       move       enslave	repair\n\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"declare  profile  relation    power   explore     detonate\n");
X  		queue_string(e, buf);
X! 	sprintf(buf,"colonies dump  name motto    mobilize technology toxicity   transfer\n");
X  		queue_string(e, buf);
X! 	sprintf(buf, "make   modify    mount\n");
X  		queue_string(e, buf); 
X  
X   } else {
X***************
X*** 1356,1358 ****
X--- 1424,1513 ----
X  if(sbuf.st_size)
X  notify(Playernum, "You have telegram(s) waiting. Use 'read' to read them.\n");
X  }
X+ 
X+ kill_ship(Playernum, ship)
X+ int Playernum;
X+ shiptype *ship;
X+ {
X+ racetype *r;
X+ shiptype *s;
X+ int kill_racedata, kill_shdata, sh;
X+ 
X+ ship->is_alive = 0;
X+ ship->popn = 0;
X+ ship->damage = 100; 
X+ ship->notified = 0;
X+ if(ship->type==OTYPE_GOV) {
X+ 		openracedata(&kill_racedata);
X+ 		getrace(kill_racedata, &r, (int)ship->owner);
X+ 		r->Gov_ship = 0;
X+ 		putrace(kill_racedata, r);
X+ 		close_file(kill_racedata);
X+ 		free(r);
X+ 				}
X+ 
X+ /* undock the stuff docked with it */
X+ if(ship->is_docked && ship->whatdest==LEVEL_SHIP) {
X+ 	openshdata(&kill_shdata);
X+ 	getship(kill_shdata, &s, ship->destshipno);
X+ 	s->is_docked = 0;
X+ 	s->whatdest = LEVEL_UNIV;
X+ 	putship(kill_shdata, s, ship->destshipno);
X+ 	free(s);
X+ }
X+ /* fighters are destroyed if one board a carrier */
X+ if(ship->type==STYPE_CARRIER) {
X+ 	sh=ship->object.number;
X+ 	openshdata(&kill_shdata);
X+ 	while(sh) {
X+ 	(void)getship(kill_shdata, &s, sh);
X+ 	s->is_alive = 0; s->notified = 0;
X+ 	putship(kill_shdata, s, sh);	
X+ 	sh = s->object.number;
X+ 	free(s);
X+ 	}
X+ 	close_file(kill_shdata);
X+ }
X+ 
X+ /* if the ship is a VN, keep track of who killed it */
X+ 	if(ship->type==OTYPE_VN) {
X+ 		ship->object.number3 = Playernum; /* remember who killed it */
X+ 	}
X+ }
X+ 
X+ compute_power_blocks()
X+ {
X+ int i, j, dummy;
X+ Num_races = Numraces();
X+ /* compute alliance block power */
X+ sprintf(Power_blocks.time, "%2d/%2d/%d %02d:%02d:%02d %s", 
X+ 	current_tm->tm_mon+1, current_tm->tm_mday,
X+ 	current_tm->tm_year, current_tm->tm_hour,
X+ 	current_tm->tm_min, current_tm->tm_sec, current_tm->tm_zone);
X+  for (i=1; i<=Num_races; i++) {
X+ 	dummy=(Blocks[i-1].invite & Blocks[i-1].pledge);
X+ 				Power_blocks.members[i-1] = 0;
X+ 				Power_blocks.sectors_owned[i-1] = 0;
X+ 				Power_blocks.popn[i-1] = 0;
X+ 				Power_blocks.ships_owned[i-1] = 0;
X+ 				Power_blocks.resource[i-1] = 0;
X+ 				Power_blocks.fuel[i-1] = 0;
X+ 				Power_blocks.destruct[i-1] = 0;
X+ 				Power_blocks.systems_owned[i-1] = Blocks[i-1].systems_owned;
X+ 				Power_blocks.VPs[i-1] = Blocks[i-1].VPs;
X+ 	for(j=1; j<=Num_races; j++) 
X+ 			if(isset(dummy, j)){
X+ 				Power_blocks.members[i-1] += 1;
X+ 				Power_blocks.sectors_owned[i-1] += Power[j-1].sectors_owned;
X+ 				Power_blocks.popn[i-1] += Power[j-1].popn;
X+ 				Power_blocks.ships_owned[i-1] += Power[j-1].ships_owned;
X+ 				Power_blocks.resource[i-1] += Power[j-1].resource;
X+ 				Power_blocks.fuel[i-1] += Power[j-1].fuel;
X+ 				Power_blocks.destruct[i-1] += Power[j-1].destruct;
X+ 			}
X+ 	}
X+ 
X+ 
X+ }
X+ 
X+ 
X*** /usr/cna/billr/games/gb3/server/doplanet.c	Wed May 30 15:13:01 1990
X--- server/doplanet.c	Thu Aug 23 16:54:48 1990
X***************
X*** 71,76 ****
X--- 71,77 ----
X  int oldplanetpopn, oldplanetmaxpopn;
X  boolean allmod=0,allexp=0;
X  char buf[200]; 
X+ float tech_prod();
X  
X  Sectormappos = planet->sectormappos;
X  check(planet,0);
X***************
X*** 78,84 ****
X  	return 0;	/* no one's here now */
X  
X  if (Stinfo[starnum][planetnum].inhab) {
X- /*	printf(" getting sectmap pos %d\n",planet->sectormappos); */
X  	opensectdata(&sectdata);
X  	getsmap(sectdata,Smap,planet);
X  	close_file(sectdata);
X--- 79,84 ----
X***************
X*** 87,94 ****
X  	bzero((char *)Sectinfo, sizeof(Sectinfo) );
X  }
X  
X- 
X- 
X  check(planet,1);
X    shipno = planet->ships;
X  
X--- 87,92 ----
X***************
X*** 147,163 ****
X  		   {
X  		    sectortype *s;
X  		    s = &Sector(*planet,(int)ship->xpos,(int)ship->ypos);
X! 		    if (s->des != DES_GAS && 
X  			(int_rand(1,100) <= (((100-ship->damage) * 
X  				  ship->popn)/Max_crew(ship)))) {
X  			  /* gas sectors can't be terraformed. */
X  		 	s->des = races[ship->owner-1]->likesbest;
X! 		 	s->eff *= 0.5;
X! 		 	s->mobilization *= 0.5;
X! 		 	s->resource *= 0.7;
X! 		 	/*s->popn *= 0.5;*/	/* ?? not sure bout this */
X  			s->popn = 0;
X! 			s->owner = 0;/* i AM sure about this :) */
X  		 	ship->fuel -= (float)FUEL_COST_TERRA;
X  		 	ship->mass -= FUEL_COST_TERRA*MASS_FUEL;
X  			if (planet->conditions[TOXIC]<100)
X--- 145,160 ----
X  		   {
X  		    sectortype *s;
X  		    s = &Sector(*planet,(int)ship->xpos,(int)ship->ypos);
X! 		    if (s->des !=races[ship->owner-1]->likesbest &&
X! 			s->des != DES_GAS && 
X  			(int_rand(1,100) <= (((100-ship->damage) * 
X  				  ship->popn)/Max_crew(ship)))) {
X  			  /* gas sectors can't be terraformed. */
X  		 	s->des = races[ship->owner-1]->likesbest;
X! 		 	s->eff = 0;
X! 		 	s->mobilization = 0.;
X  			s->popn = 0;
X! 			s->owner = 0;
X  		 	ship->fuel -= (float)FUEL_COST_TERRA;
X  		 	ship->mass -= FUEL_COST_TERRA*MASS_FUEL;
X  			if (planet->conditions[TOXIC]<100)
X***************
X*** 201,208 ****
X  check(planet,2);
X    }
X  
X! 
X!  if (!Stinfo[starnum][planetnum].inhab && 
X       !Stinfo[starnum][planetnum].Thing_add)
X  	return 0;	/* (no one's explored the planet) */
X  
X--- 198,204 ----
X  check(planet,2);
X    }
X  
X! if (!Stinfo[starnum][planetnum].inhab && 
X       !Stinfo[starnum][planetnum].Thing_add)
X  	return 0;	/* (no one's explored the planet) */
X  
X***************
X*** 253,258 ****
X--- 249,255 ----
X  bzero((char *)prod_res, sizeof(prod_res) );
X  bzero((char *)prod_fuel, sizeof(prod_fuel) );
X  bzero((char *)prod_destruct, sizeof(prod_destruct) );
X+ bzero((char *)prod_crystals, sizeof(prod_crystals) );
X  
X  tot_resdep = prod_eff= prod_mob = tot_captured = 0;
X  Claims = 0;
X***************
X*** 267,272 ****
X--- 264,270 ----
X  for (i=1; i<=Num_races; i++) {
X  	Compat[i-1] = compatibility(planet, races[i-1]);
X  	planet->info[i-1].numsectsowned = 0;
X+ 	planet->info[i-1].popn = 0;
X  	populations[i-1] = 0;
X  	prod_fuel[i-1] = 0;
X  	prod_destruct[i-1] = 0;
X***************
X*** 275,285 ****
X  }
X  
X  Getxysect(planet, &x, &y, 1);
X- /*printf(" while %d\n",Getxysect(planet, &x, &y, 1));	/* reset */
X  
X- check(planet,4);
X  while (Getxysect(planet, &x, &y, 0)) {
X         p = &Sector(*planet,x,y);
X  	 if (p->owner) {
X  		/* (all modified; sectors belonging to that player modified) */
X  	    allmod = 1;	
X--- 273,282 ----
X  }
X  
X  Getxysect(planet, &x, &y, 1);
X  
X  while (Getxysect(planet, &x, &y, 0)) {
X         p = &Sector(*planet,x,y);
X+ 
X  	 if (p->owner) {
X  		/* (all modified; sectors belonging to that player modified) */
X  	    allmod = 1;	
X***************
X*** 304,310 ****
X  
X  	      Sectinfo[x][y].done = 1;
X  
X! 	  }
X  
X  
X         	if (p->owner) {
X--- 301,308 ----
X  
X  	      Sectinfo[x][y].done = 1;
X  
X! 	  } else
X! 		p->popn = 0;
X  
X  
X         	if (p->owner) {
X***************
X*** 355,363 ****
X  	}
X       }
X  
X! }
X! check(planet,5);
X  
X  if (allmod) {	/* ( >= 1 inhabited sector on the planet) */
X  
X  check(planet,51);
X--- 353,363 ----
X  	}
X       }
X  
X!    }
X  
X+ 
X+ check(planet,5);
X+ allmod=1;
X  if (allmod) {	/* ( >= 1 inhabited sector on the planet) */
X  
X  check(planet,51);
X***************
X*** 426,437 ****
X  		Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
X  		  sprintf(buf," \nWAR STATUS: %d sectors gained, %d sectors lost.\n", sects_gained[i-1],sects_lost[i-1]);
X  	str_cat(telegram_buf, buf);
X! 	push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
X  	  }
X  
X! 	for (i=1; i<=Num_races; i++)
X  	 if (planet->info[i-1].autorep) {
X- 
X  check(planet,8);
X  /*	  planet->info[i-1].autorep = planet->info[i-1].autorep - 1; */
X  check(planet,85);
X--- 426,439 ----
X  		Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
X  		  sprintf(buf," \nWAR STATUS: %d sectors gained, %d sectors lost.\n", sects_gained[i-1],sects_lost[i-1]);
X  	str_cat(telegram_buf, buf);
X! 	push_message(TELEG_PLAYER_AUTO, i, telegram_buf, COMBAT);
X  	  }
X  
X! 	for (i=1; i<=Num_races; i++) {
X! 		planet->info[i-1].prod_res = prod_res[i-1];
X! 		planet->info[i-1].prod_fuel = prod_fuel[i-1];
X! 		planet->info[i-1].prod_dest = prod_destruct[i-1];
X  	 if (planet->info[i-1].autorep) {
X  check(planet,8);
X  /*	  planet->info[i-1].autorep = planet->info[i-1].autorep - 1; */
X  check(planet,85);
X***************
X*** 445,450 ****
X--- 447,456 ----
X  	  sprintf(buf, "Total      Prod: %dr %df %dd\n", prod_res[i-1], prod_fuel[i-1],
X  			prod_destruct[i-1]);
X  	str_cat(telegram_buf, buf);
X+ 	if(prod_crystals[i-1]) {
X+ 		sprintf(buf, "    %d crystals found\n", prod_crystals[i-1]);
X+ 		str_cat(telegram_buf, buf);
X+ 			}
X  
X  	if(tot_captured) {
X  	  sprintf(buf,"%d sectors captured\n", tot_captured);
X***************
X*** 468,476 ****
X  		str_cat(telegram_buf, buf);
X  	  }
X  
X!  push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
X  
X  	}
X  check(planet,9);
X  
X  	   /* find out who is on this planet, for nova notification */
X--- 474,483 ----
X  		str_cat(telegram_buf, buf);
X  	  }
X  
X!  push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
X  
X  	}
X+ }
X  check(planet,9);
X  
X  	   /* find out who is on this planet, for nova notification */
X***************
X*** 486,492 ****
X  		str_cat(telegram_buf, buf);
X       	     for (i=1; i<=Num_races; i++)
X  		if (planet->info[i-1].numsectsowned) {
X! 		push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
X  		}
X   	}
X  
X--- 493,499 ----
X  		str_cat(telegram_buf, buf);
X       	     for (i=1; i<=Num_races; i++)
X  		if (planet->info[i-1].numsectsowned) {
X! 		push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
X  		}
X   	}
X  
X***************
X*** 498,504 ****
X  	this requires that you be the only one inhabiting the planet */
X  
X  	if (planet->info[i-1].numsectsowned > 0) {
X! 		int aliensects=0,stolenres=0,stolendes=0,stolenfuel=0;
X  		int stuff=0;
X  
X  
X--- 505,512 ----
X  	this requires that you be the only one inhabiting the planet */
X  
X  	if (planet->info[i-1].numsectsowned > 0) {
X! 		int aliensects=0;
X! 		int stolenres=0,stolendes=0,stolenfuel=0, stolencrystals=0;
X  		int stuff=0;
X  
X  
X***************
X*** 508,514 ****
X  			aliensects += planet->info[j-1].numsectsowned;
X  			if(planet->info[j-1].resource >0 ||
X  			   planet->info[j-1].destruct >0 ||
X! 			   planet->info[j-1].fuel > 0.0) stuff=1;
X  			}
X  
X  		if(!aliensects && stuff)
X--- 516,523 ----
X  			aliensects += planet->info[j-1].numsectsowned;
X  			if(planet->info[j-1].resource >0 ||
X  			   planet->info[j-1].destruct >0 ||
X! 			   planet->info[j-1].fuel > 0.0 ||
X! 			   planet->info[j-1].crystals) stuff=1;
X  			}
X  
X  		if(!aliensects && stuff)
X***************
X*** 519,537 ****
X  			  stolenres += planet->info[j-1].resource;
X  			  stolendes += planet->info[j-1].destruct;
X  			  stolenfuel += planet->info[j-1].fuel;
X  			  planet->info[j-1].resource = 0;
X  			  planet->info[j-1].destruct = 0;
X  			  planet->info[j-1].fuel = 0;
X! 			}
X  		planet->info[i-1].resource += stolenres;
X  		planet->info[i-1].destruct += stolendes;
X  		planet->info[i-1].fuel += stolenfuel;
X! /* notify player of recovered stockpiles */
X  	  sprintf(telegram_buf,"****** Report: Planet /%s/%s ******\n\n", 
X  		Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
X! 	  sprintf(buf," %d resources \n %d destruct \n %d fuel recovered from alien stock piles",stolenres,stolendes,stolenfuel);
X  	str_cat(telegram_buf, buf);
X! 	push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
X  			} /*aliensect==0*/
X  		}
X  
X--- 528,549 ----
X  			  stolenres += planet->info[j-1].resource;
X  			  stolendes += planet->info[j-1].destruct;
X  			  stolenfuel += planet->info[j-1].fuel;
X+ 			  stolencrystals += planet->info[j-1].crystals;
X  			  planet->info[j-1].resource = 0;
X  			  planet->info[j-1].destruct = 0;
X  			  planet->info[j-1].fuel = 0;
X! 			  planet->info[j-1].crystals = 0;
X! 		      }
X  		planet->info[i-1].resource += stolenres;
X  		planet->info[i-1].destruct += stolendes;
X  		planet->info[i-1].fuel += stolenfuel;
X! 		planet->info[i-1].crystals += stolencrystals;
X! 		/* notify player of recovered stockpiles */
X  	  sprintf(telegram_buf,"****** Report: Planet /%s/%s ******\n\n", 
X  		Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
X! 	  sprintf(buf," %d resources \n %d destruct \n %d fuel\n %d crystals recovered from alien stock piles",stolenres,stolendes,stolenfuel,stolencrystals);
X  	str_cat(telegram_buf, buf);
X! 	push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
X  			} /*aliensect==0*/
X  		}
X  
X***************
X*** 558,564 ****
X  	else if (planet->conditions[TOXIC] < 0)
X  	   planet->conditions[TOXIC] = 0;
X  
X! 	/* deal with enslaved planets */
X     if (planet->slaved_to) {
X  	if (populations[planet->slaved_to-1] >= planet->popn * 0.001 ||
X  		(Stinfo[starnum][planetnum].intimidated && random()&01) ) {
X--- 570,583 ----
X  	else if (planet->conditions[TOXIC] < 0)
X  	   planet->conditions[TOXIC] = 0;
X  
X! Getxysect(planet, &x, &y, 1);
X! while (Getxysect(planet, &x, &y, 0)) {
X!        p = &Sector(*planet,x,y);
X! 	 if (p->owner)
X! 	     planet->info[p->owner-1].popn += p->popn;
X!  }
X! 
X! /* deal with enslaved planets */
X     if (planet->slaved_to) {
X  	if (populations[planet->slaved_to-1] >= planet->popn * 0.001 ||
X  		(Stinfo[starnum][planetnum].intimidated && random()&01) ) {
X***************
X*** 601,607 ****
X  				p->is_wasted = 1;
X  			   }
X  			}
X! 		}
X  		sprintf(telegram_buf,"NOTICE from planet /%s/%s!\n",
X  				Stars[starnum]->name,
X  				Stars[starnum]->pnames[planetnum]);
X--- 620,629 ----
X  				p->is_wasted = 1;
X  			   }
X  			}
X! 
X! /* also add up the populations while here */
X! 			
X! 		    }
X  		sprintf(telegram_buf,"NOTICE from planet /%s/%s!\n",
X  				Stars[starnum]->name,
X  				Stars[starnum]->pnames[planetnum]);
X***************
X*** 613,622 ****
X  			str_cat(telegram_buf, buf);
X  		for (i=1; i<=Num_races; i++)
X  		  if (planet->info[i-1].numsectsowned && i!=planet->slaved_to) {
X! 			push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
X  			}
X  		 /* send to previous slave holder */
X! 	push_message(TELEG_PLAYER_AUTO, planet->slaved_to, telegram_buf);
X  
X  		planet->slaved_to = 0;
X  		planet->is_sheep = 0;
X--- 635,644 ----
X  			str_cat(telegram_buf, buf);
X  		for (i=1; i<=Num_races; i++)
X  		  if (planet->info[i-1].numsectsowned && i!=planet->slaved_to) {
X! 			push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
X  			}
X  		 /* send to previous slave holder */
X! 	push_message(TELEG_PLAYER_AUTO, planet->slaved_to, telegram_buf, TELEGRAM);
X  
X  		planet->slaved_to = 0;
X  		planet->is_sheep = 0;
X***************
X*** 628,654 ****
X  
X  	  if (planet->info[i-1].numsectsowned) {
X  
X! 	 	if (planet->info[i-1].fuel + prod_fuel[i-1] > 100000)
X! 		  planet->info[i-1].fuel = 100000;
X  		else
X  		  planet->info[i-1].fuel += prod_fuel[i-1];
X  
X! 	 	if (planet->info[i-1].resource + prod_res[i-1] > 100000)
X! 		  planet->info[i-1].resource = 100000;
X  		else
X  		  planet->info[i-1].resource += prod_res[i-1];
X  
X! 	 	if (planet->info[i-1].destruct + prod_destruct[i-1] > 100000)
X! 		  planet->info[i-1].destruct = 100000;
X  		else
X  		  planet->info[i-1].destruct += prod_destruct[i-1];
X  
X!  	   /* do tech investments */
X   	  if (planet->info[i-1].resource >= planet->info[i-1].tech_invest) {
X!  		races[i-1]->tech += 
X!  		   log10(1.0+(double)planet->info[i-1].tech_invest) * TECH_INVEST;
X   		planet->info[i-1].resource -= planet->info[i-1].tech_invest;
X!  	  }
X  
X  	   /* build wc's if it's been ordered */
X  	  if (planet->info[i-1].tox_thresh>0 &&
X--- 650,684 ----
X  
X  	  if (planet->info[i-1].numsectsowned) {
X  
X! 	 	if (planet->info[i-1].fuel + prod_fuel[i-1] > 65567)
X! 		  planet->info[i-1].fuel = 65567;
X  		else
X  		  planet->info[i-1].fuel += prod_fuel[i-1];
X  
X! 	 	if (planet->info[i-1].resource + prod_res[i-1] > 65567)
X! 		  planet->info[i-1].resource = 65567;
X  		else
X  		  planet->info[i-1].resource += prod_res[i-1];
X  
X! 	 	if (planet->info[i-1].destruct + prod_destruct[i-1] > 65567)
X! 		  planet->info[i-1].destruct = 65567;
X  		else
X  		  planet->info[i-1].destruct += prod_destruct[i-1];
X  
X! 		if (planet->info[i-1].crystals + prod_crystals[i-1] > 127)
X! 		  planet->info[i-1].crystals = 127;
X! 		else
X! 		  planet->info[i-1].crystals += prod_crystals[i-1];
X! 
X! 		/* do tech investments */
X   	  if (planet->info[i-1].resource >= planet->info[i-1].tech_invest) {
X! 	      planet->info[i-1].prod_tech =
X! 	      tech_prod((int)planet->info[i-1].tech_invest,
X! 			      (int)planet->info[i-1].popn);
X   		planet->info[i-1].resource -= planet->info[i-1].tech_invest;
X!  		races[i-1]->tech += planet->info[i-1].prod_tech;
X!  	  } else
X! 	      planet->info[i-1].prod_tech;
X  
X  	   /* build wc's if it's been ordered */
X  	  if (planet->info[i-1].tox_thresh>0 &&
X***************
X*** 665,679 ****
X  
X  		s2->armor = Shipdata[OTYPE_TOXWC][ABIL_ARMOR];
X  		s2->guns = Shipdata[OTYPE_TOXWC][ABIL_GUNS];
X- 		s2->size = Shipdata[OTYPE_TOXWC][ABIL_TARGET];
X  		s2->max_crew = Shipdata[OTYPE_TOXWC][ABIL_MAXCREW];
X  		s2->max_resource = Shipdata[OTYPE_TOXWC][ABIL_CARGO];
X  		s2->max_fuel = Shipdata[OTYPE_TOXWC][ABIL_FUELCAP];
X  		s2->max_destruct = Shipdata[OTYPE_TOXWC][ABIL_DESTCAP];
X  		s2->max_speed = Shipdata[OTYPE_TOXWC][ABIL_SPEED];
X! 		s2->base_mass = getmass(s2);
X  		s2->mass = s2->base_mass;
X   		s2->is_alive = 1;
X  		sprintf(s2->name,"Scum%04d",Num_ships);
X  
X  		insert_sh_plan(planet,s2,Num_ships);
X--- 695,711 ----
X  
X  		s2->armor = Shipdata[OTYPE_TOXWC][ABIL_ARMOR];
X  		s2->guns = Shipdata[OTYPE_TOXWC][ABIL_GUNS];
X  		s2->max_crew = Shipdata[OTYPE_TOXWC][ABIL_MAXCREW];
X  		s2->max_resource = Shipdata[OTYPE_TOXWC][ABIL_CARGO];
X  		s2->max_fuel = Shipdata[OTYPE_TOXWC][ABIL_FUELCAP];
X  		s2->max_destruct = Shipdata[OTYPE_TOXWC][ABIL_DESTCAP];
X  		s2->max_speed = Shipdata[OTYPE_TOXWC][ABIL_SPEED];
X! 		s2->build_cost = Shipdata[OTYPE_TOXWC][ABIL_COST];
X! 		s2->size = ship_size(s2);
X!  		s2->base_mass = 1.0; /* a hack */
X  		s2->mass = s2->base_mass;
X   		s2->is_alive = 1;
X+ 		s2->active = 1;
X  		sprintf(s2->name,"Scum%04d",Num_ships);
X  
X  		insert_sh_plan(planet,s2,Num_ships);
X***************
X*** 707,714 ****
X  	Power[i-1].resource += planet->info[i-1].resource;
X  	Power[i-1].destruct += planet->info[i-1].destruct;
X  	Power[i-1].fuel += planet->info[i-1].fuel;
X- 	Power[i-1].planets_owned += !!planet->info[i-1].numsectsowned;
X  	Power[i-1].sectors_owned += planet->info[i-1].numsectsowned;
X  /*	Power[i-1].sum_mob += avg_mob[i-1]; */
X   }
X  
X--- 739,746 ----
X  	Power[i-1].resource += planet->info[i-1].resource;
X  	Power[i-1].destruct += planet->info[i-1].destruct;
X  	Power[i-1].fuel += planet->info[i-1].fuel;
X  	Power[i-1].sectors_owned += planet->info[i-1].numsectsowned;
X+ 	Power[i-1].planets_owned += !!planet->info[i-1].numsectsowned;
X  /*	Power[i-1].sum_mob += avg_mob[i-1]; */
X   }
X  
END_OF_FILE
if test 54235 -ne `wc -c <'patches02a'`; then
    echo shar: \"'patches02a'\" unpacked with wrong size!
fi
# end of 'patches02a'
echo shar: End of archive 4 \(of 9\).
cp /dev/null ark4isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 9 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0