[comp.sources.games] v08i028: GB2 - Galactic Bloodshed, an empire-like war game [Ver. 1.0], Patch1c

billr@saab.CNA.TEK.COM (Bill Randle) (09/15/89)

Submitted-by: VANCLEEF@mps.ohio-state.edu
Posting-number: Volume 8, Issue 28
Archive-name: GB2/Patch1c
Patch-To: GB2: Volume 7, Issue 44-51


#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 4)."
# Contents:  patches01c
# Wrapped by billr@saab on Fri Sep 15 08:34:48 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches01c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patches01c'\"
else
echo shar: Extracting \"'patches01c'\" \(50119 characters\)
sed "s/^X//" >'patches01c' <<'END_OF_FILE'
X*** ../../GB2/load.c	Thu Jul  6 07:18:13 1989
X--- load.c	Fri Sep 15 07:28:12 1989
X***************
X*** 41,47 ****
X      if (!getship(load_shdata,&s,shipno)) {
X  	load_handler();
X      }
X!     if (s->owner!=Playernum || s->is_dead) {
X  	DontOwnErr(shipno);
X  	printf("(%d)\n",s->owner);
X  	free(s);
X--- 41,47 ----
X      if (!getship(load_shdata,&s,shipno)) {
X  	load_handler();
X      }
X!     if (s->owner!=Playernum || !s->is_alive) {
X  	DontOwnErr(shipno);
X  	printf("(%d)\n",s->owner);
X  	free(s);
X***************
X*** 64,78 ****
X  
X      proc = 0;
X  
X!     if (s->type == OTYPE_TRANSDEV && s->orders.object.number > 0) {
X! 	Locks(1);
X! 	if (!getship(load_shdata,&s2, s->orders.object.number)) {
X  		printf("The hopper seems to be blocked.\n");
X  		load_handler();
X  	}
X- 	Locks(0);
X  
X! 	if (s2->is_dead) {
X  		printf("The target device does not exist.\n");
X  		load_handler();
X  	}
X--- 64,76 ----
X  
X      proc = 0;
X  
X!     if (s->type == OTYPE_TRANSDEV && s->object.number > 0) {
X! 	if (!getship(load_shdata,&s2, s->object.number)) {
X  		printf("The hopper seems to be blocked.\n");
X  		load_handler();
X  	}
X  
X! 	if (!s2->is_alive) {
X  		printf("The target device does not exist.\n");
X  		load_handler();
X  	}
X***************
X*** 101,109 ****
X  	if (s->whatdest==LEVEL_PLAN)
X  		printf("Ship #%d at %.0f,%.0f\n", shipno,s->xpos, s->ypos);
X  	else {
X! 		Locks(1);
X! 		if (!getship(load_shdata, &s2, s->destshipno) || s2->is_dead ||
X! 			!(s2->is_docked && s2->whatdest==LEVEL_SHIP 
X  			  && s2->destshipno==shipno) ) {
X  				/* the ship it was docked with died or
X  				   undocked with it or something. */
X--- 99,108 ----
X  	if (s->whatdest==LEVEL_PLAN)
X  		printf("Ship #%d at %.0f,%.0f\n", shipno,s->xpos, s->ypos);
X  	else {
X! 		if (!getship(load_shdata, &s2, s->destshipno) 
X! 			|| !s2->is_alive 
X! 			|| !s->object.number4 &&
X! 			  !(s2->is_docked && s2->whatdest==LEVEL_SHIP 
X  			  && s2->destshipno==shipno) ) {
X  				/* the ship it was docked with died or
X  				   undocked with it or something. */
X***************
X*** 115,121 ****
X  			printf("ship #%u is not docked.\n", s->destshipno);
X  			load_handler();
X  		}
X- 		Locks(0);
X  		printf("Ship #%d docked with %s #%d\n", shipno, 
X  				Shipnames[s2->type], s->destshipno);
X  		sh = 1;
X--- 114,119 ----
X***************
X*** 359,366 ****
X  
X      putship(load_shdata,s,shipno);
X  
X!     	if (s->type==OTYPE_TRANSDEV && s->orders.object.number > 0) {
X  
X  	   printf("Zap\007!\n");
X  
X  	   	/* send stuff to other ship (could be transport device) */
X--- 357,364 ----
X  
X      putship(load_shdata,s,shipno);
X  
X!     	if (s->type==OTYPE_TRANSDEV && s->object.number > 0) {
X  
X  	   printf("Zap\007!\n");
X  
X  	   	/* send stuff to other ship (could be transport device) */
X***************
X*** 412,418 ****
X           if (s2->owner!=s->owner) {
X  	   teleg_add("", telegram_buf);
X  	   teleg_add("BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #",telegram_buf);
X! 	   sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->orders.object.number);
X  	   teleg_add(buf,telegram_buf);
X  	   teleg_add(bufr,telegram_buf);
X  	   teleg_add(bufd,telegram_buf);
X--- 410,416 ----
X           if (s2->owner!=s->owner) {
X  	   teleg_add("", telegram_buf);
X  	   teleg_add("BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #",telegram_buf);
X! 	   sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->object.number);
X  	   teleg_add(buf,telegram_buf);
X  	   teleg_add(bufr,telegram_buf);
X  	   teleg_add(bufd,telegram_buf);
X***************
X*** 422,428 ****
X           }
X  
X  	    putship(load_shdata,s,shipno);
X! 	   putship(load_shdata, s2, s->orders.object.number);
X  
X  
X      } else if (sh) {
X--- 420,426 ----
X           }
X  
X  	    putship(load_shdata,s,shipno);
X! 	   putship(load_shdata, s2, s->object.number);
X  
X  
X      } else if (sh) {
X***************
X*** 454,460 ****
X           if (s2->owner!=s->owner) {
X  	   teleg_add("", telegram_buf);
X  	   teleg_add("BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #",telegram_buf);
X! 	   sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->orders.object.number);
X  	   teleg_add(buf,telegram_buf);
X  	   teleg_add(bufr,telegram_buf);
X  	   teleg_add(bufd,telegram_buf);
X--- 452,458 ----
X           if (s2->owner!=s->owner) {
X  	   teleg_add("", telegram_buf);
X  	   teleg_add("BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #",telegram_buf);
X! 	   sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->object.number);
X  	   teleg_add(buf,telegram_buf);
X  	   teleg_add(bufr,telegram_buf);
X  	   teleg_add(bufd,telegram_buf);
X*** ../../GB2/makeplanet.c	Wed Jul  5 15:15:31 1989
X--- makeplanet.c	Fri Sep 15 07:28:14 1989
X***************
X*** 69,75 ****
X  	s = &Sector(planet,x,y);
X  	s->des = DES_GAS;	/* for gasgiant */
X  	s->fert = int_rand(35,55);
X! 	s->resource = int_rand(3,20);
X       }
X   if (planet.Maxx > MAP_GASGIANT_BANDMIN) {
X      int nbands;
X--- 69,75 ----
X  	s = &Sector(planet,x,y);
X  	s->des = DES_GAS;	/* for gasgiant */
X  	s->fert = int_rand(35,55);
X! 	s->resource = int_rand(20,40);
X       }
X   if (planet.Maxx > MAP_GASGIANT_BANDMIN) {
X      int nbands;
X***************
X*** 79,86 ****
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(10,24);
X! 	s->resource += int_rand(30,40);
X       }
X      }
X      for (i=0; i<=MAP_ISLANDS*2; i++) {
X--- 79,86 ----
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(20,30);
X! 	s->resource += int_rand(40,60);
X       }
X      }
X      for (i=0; i<=MAP_ISLANDS*2; i++) {
X***************
X*** 88,94 ****
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(12,24);
X      }
X   } else {
X      for (i=0; i<MAP_ISLANDS*2; i++) {
X--- 88,94 ----
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(20,30);
X      }
X   } else {
X      for (i=0; i<MAP_ISLANDS*2; i++) {
X***************
X*** 100,106 ****
X  		s->fert = int_rand(10,21);
X  	} else {
X  		s->des=DES_SEA;
X! 		s->fert=int_rand(10,22);
X  	}
X      }
X    Smashup(&planet,int_rand(2,4),DES_SEA,0,0,0);
X--- 100,106 ----
X  		s->fert = int_rand(10,21);
X  	} else {
X  		s->des=DES_SEA;
X! 		s->fert=int_rand(20,30);
X  	}
X      }
X    Smashup(&planet,int_rand(2,4),DES_SEA,0,0,0);
X*** ../../GB2/map.c	Wed Jul  5 15:15:33 1989
X--- map.c	Fri Sep 15 07:28:16 1989
X***************
X*** 3,13 ****
X--- 3,21 ----
X   *  map.c -- display sector map of current planet
X   */
X  
X+ #define S_X (stdscr->_maxx - NAMESIZE)
X+ #define S_Y (stdscr->_maxy - 1)
X+ #define Midx ((S_X - NAMESIZE)/2.0)
X+ #define Midy (S_Y /2.0)
X+ 
X  #include "vars.h"
X  #include "ships.h"
X  #include "races.h"
X+ #include <curses.h>
X  extern float compatibility();
X+ int owned();
X  char desshow();
X+ char Digits[]={'0','1','2','3','4','5','6','7','8','9'};
X  
X  map(APcount, argn,args)
X  int APcount;
X***************
X*** 18,38 ****
X  planettype *p;
X  placetype where;
X  
X!    Locks(1);
X     where = Getplace(args[1],0);
X!    Locks(0);
X     if (where.err) return;
X  
X     if (where.level==LEVEL_PLAN) {
X    	openpdata(&map_pdata);
X-    	Locks(1);
X    	getplanet(map_pdata,&p,Stars[where.snum]->planetpos[where.pnum]);
X-    	Locks(0);
X    	close(map_pdata);
X! 
X    	show_map(p,1);	/* 1 means display data */
X  
X    	free(p);
X  
X  	if (Stars[where.snum]->stability > 50)
X  		printf("WARNING! This planet's primary is unstable.\n");
X--- 26,46 ----
X  planettype *p;
X  placetype where;
X  
X! 
X     where = Getplace(args[1],0);
X! 
X     if (where.err) return;
X  
X     if (where.level==LEVEL_PLAN) {
X+   
X    	openpdata(&map_pdata);
X    	getplanet(map_pdata,&p,Stars[where.snum]->planetpos[where.pnum]);
X    	close(map_pdata);
X!  
X    	show_map(p,1);	/* 1 means display data */
X  
X    	free(p);
X+ 	printf("\n      `%s' \n\n",Stars[where.snum]->pnames[where.pnum]);
X  
X  	if (Stars[where.snum]->stability > 50)
X  		printf("WARNING! This planet's primary is unstable.\n");
X***************
X*** 50,59 ****
X  planettype *p;
X  register int show;
X  {
X! register int x,y,i,f;
X  int sh,iq,map_sectdata,map_shdata;
X  shiptype *s;
X! char shiplocs[MAX_X][MAX_Y];
X  
X    bzero((char *)shiplocs, sizeof(shiplocs));
X  
X--- 58,67 ----
X  planettype *p;
X  register int show;
X  {
X! register int x,y,i,f,address,owned1;
X  int sh,iq,map_sectdata,map_shdata;
X  shiptype *s;
X! char shiplocs[MAX_X][MAX_Y],dummy;
X  
X    bzero((char *)shiplocs, sizeof(shiplocs));
X  
X***************
X*** 62,68 ****
X    close(map_sectdata);
X  
X    openshdata(&map_shdata);
X-   Locks(1);
X     /* traverse ship list on planet. */
X    sh = p->ships;
X  	iq = 0;
X--- 70,75 ----
X***************
X*** 79,85 ****
X    sh = p->ships;
X    while (sh) {
X        (void)getship(map_shdata,&s, sh);
X!       if (!s->is_dead && s->is_docked && s->whatdest==LEVEL_PLAN &&
X  		s->xpos < p->Maxx && s->xpos >= 0 &&
X  		s->ypos < p->Maxy && s->ypos >= 0 &&
X  		( (s->owner == Playernum) || (iq == 1) ) )
X--- 86,92 ----
X    sh = p->ships;
X    while (sh) {
X        (void)getship(map_shdata,&s, sh);
X!       if (s->is_alive && s->is_docked && s->whatdest==LEVEL_PLAN &&
X  		s->xpos < p->Maxx && s->xpos >= 0 &&
X  		s->ypos < p->Maxy && s->ypos >= 0 &&
X  		( (s->owner == Playernum) || (iq == 1) ) )
X***************
X*** 87,161 ****
X        sh = s->nextship;
X        free(s);
X    }
X-   Locks(0);
X    close(map_shdata);
X  
X  
X!   printf("   ");
X!   for (x=0; x<p->Maxx; x++) 
X! 	printf("%d",x/10);
X!   if (show)
X!   	printf("  Sects %s: %d", Race->Thing ? "covered" : "owned", 
X  			p->info[Playernum-1].numsectsowned);
X!   printf("\n   ");
X!   for (x=0; x<p->Maxx; x++) 
X! 	printf("%d",x%10);
X!   if (show) { 
X! 	int i,f=0;
X! 	  printf("  Aliens:");
X  	  if (p->is_explored || Race->tech >= TECH_EXPLORE) {
X  		  for (i=1; i<MAXPLAYERS; i++)
X  			if (p->info[i-1].numsectsowned && i!=Playernum) {
X  			   f=1;
X! 			   printf("%c%d", isset(Race->atwar,i) ? '*' : ' ', i);
X  			}
X! 		  if (!f) printf("(none)");
X! 	  } else printf("???");
X!   }
X!   putchr('\n');
X  
X!   for (y=0; y<p->Maxy; y++) {
X!      printf("%2d ",y);
X!      for (x=0; x<p->Maxx; x++) {
X! 	if (shiplocs[x][y])
X! 		putchr(shiplocs[x][y]);
X! 	else
X! 	    	putchr(desshow(p, x, y));
X!      }
X!      if (show)
X!        switch (y) {	/* give stockpile info */
X!         case 0: printf("| Combat readiness:  %u", p->info[Playernum-1].comread);
X! 	      break;
X!         case 1: printf("| Compatibility:   %.2f%s",compatibility(p,Race),
X! 			p->conditions[TOXIC] > 50 ? "(TOXIC)" : "");
X! 	      break;
X!         case 3:printf("| Resource stockpile:%u",p->info[Playernum-1].resource);
X! 	      break;
X!         case 4: printf("| Fuel stockpile:    %u",p->info[Playernum-1].fuel);
X! 	      break;
X!         case 5:printf("| Destruct cap:      %u",p->info[Playernum-1].destruct);
X! 	      break;
X!         case 6:printf("| %s:  %u (%u)", Race->Thing ? "Tons of biomass" : 
X! 				"Total Population", p->popn, p->maxpopn);
X! 	      break;
X!         /*case 7: 
X! 	      break;
X!         case 8: 
X! 	      break;
X!         case 9: 
X! 	      break;
X!         case 10: 
X! 	      break;*/
X!         default: printf("|");
X! 	      break;
X!        }
X!   putchr('\n');
X    }
X  
X- 
X  }
X  
X  
X  char desshow(p,x,y)
X  register planettype *p;
X  register int x,y;
X--- 94,181 ----
X        sh = s->nextship;
X        free(s);
X    }
X    close(map_shdata);
X  
X+ clear();
X  
X!   for (y=0; y<2; y++){
X!   for (x=0; x<p->Maxx; x++) {
X! 	if(y==0)address = x/10;
X! 	if(y==1)address = x-10 * (x/10);
X! 	mvaddch(y,x+3,Digits[address]);
X! 		}
X! }
X! 
X!   for (y=0; y<p->Maxy; y++) {
X! 	address = y/10;
X! 	mvaddch(y+2,0,Digits[address]);
X! 	address = y - 10*(y/10);
X! 	mvaddch(y+2,1,Digits[address]);
X!      for (x=0; x<p->Maxx; x++) {
X! 	owned1=owned(p,x,y);
X! 	if (shiplocs[x][y])
X! 		{
X! 		if(owned1)standout();
X! 		mvaddch(y+2,x+3,shiplocs[x][y]);
X! 		if(owned1)standend();
X! 		}
X! 	else
X! 		{
X! 		if(owned1)standout();
X! 	    	mvaddch(y+2,x+3, desshow(p,x,y));
X! 		if(owned1)standend();
X! 		}
X!      }
X! }
X! 
X!      if (show){
X! 
X! 	move(p->Maxy+3,0);
X! 	printw("    Sects %s: %u", Race->Thing ? "covered" : "owned", 
X  			p->info[Playernum-1].numsectsowned);
X! 	  printw("  Aliens:");
X  	  if (p->is_explored || Race->tech >= TECH_EXPLORE) {
X  		  for (i=1; i<MAXPLAYERS; i++)
X  			if (p->info[i-1].numsectsowned && i!=Playernum) {
X  			   f=1;
X! 			   printw("%c%d", isset(Race->atwar,i) ? '*' : ' ', i);
X  			}
X! 		  if (!f) printw("(none)");
X! 	  } else printw("???");
X  
X! 	move(p->Maxy+4,0);
X!        printw("    Mobilization :  %d (%d)", p->info[Playernum-1].comread,
X! 		p->info[Playernum-1].mob_set);
X!        printw("  Compatibility:   %.2f",compatibility(p,Race));
X! if(p->conditions[TOXIC]>50)
X!        printw("    %u percent TOXIC",p->conditions[TOXIC]);
X! 	move(p->Maxy+5,0);
X!       printw("    Resource stockpile:%d",p->info[Playernum-1].resource);
X!        printw("    Fuel stockpile:    %d",p->info[Playernum-1].fuel);
X! 	move(p->Maxy+6,0);
X!        printw("    Destruct cap:      %d",p->info[Playernum-1].destruct);
X!        printw("    %s:  %d (%d)", Race->Thing ? "Tons of biomass" : 
X! 				"Total Population", p->popn, 
X! 		round_rand(.01*(100.-p->conditions[TOXIC])*p->maxpopn) );
X    }
X+ 	move(p->Maxy+7, 0);
X+ 	refresh();
X  
X  }
X+ int owned(p,x,y)
X+ register planettype *p;
X+ register int x,y;
X+ {
X+ register sectortype *s;
X+ register int owned0;
X  
X+ owned0=0;
X+ s = &Sector(*p,x,y);
X  
X+ if(s->owner==Playernum)owned0=1;
X+ return owned0;
X+ }
X+ 
X  char desshow(p,x,y)
X  register planettype *p;
X  register int x,y;
X***************
X*** 170,220 ****
X  if (s->amoeba)
X  	return Shipltrs[OTYPE_AMOEBA];
X  
X  
X- 	/*  owned by you */
X- if (s->owner==Playernum) {
X  
X-    if (Race->Thing)
X- 	return CHAR_OWNED_THING;
X     if (s->is_wasted) 
X! 	return CHAR_OWNED_WASTELAND;
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- 	/* un-owned by anybody */
X- 
X- } else if (!s->owner) {
X-  if (!p->is_explored && Race->tech < TECH_EXPLORE) {
X- 	if ( !( (x>0 && (s-1)->owner==Playernum) ||
X- 	     (x<p->Maxx-1 && (s+1)->owner==Playernum) || 
X- 	     (y>0 && (s-p->Maxx)->owner==Playernum) ||
X- 	     (y<p->Maxy-1 && (s+p->Maxx)->owner==Playernum) ) )
X- 			return CHAR_CLOAKED;
X-  }
X- 
X-  if (s->is_wasted) 
X- 	return(CHAR_WASTELAND);
X- 
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- 
X- 	/* different owner */
X- 
X- } else
X-     return CHAR_DIFFOWNED;
X  
X  }
X--- 190,211 ----
X  if (s->amoeba)
X  	return Shipltrs[OTYPE_AMOEBA];
X  
X+    if (s->owner != Playernum && s->owner > 0)
X+ /*	return CHAR_DIFFOWNED; */
X+ 	return (Digits[s->owner % 10]);
X  
X  
X     if (s->is_wasted) 
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_PLATED: return CHAR_PLATED;
X!      	case DES_ICE: return CHAR_ICE;
X       	default: return('!');
X     }
X  
X  
X  }
X*** ../../GB2/max.c	Wed Jul  5 15:15:34 1989
X--- max.c	Fri Sep 15 07:28:18 1989
X***************
X*** 20,25 ****
X--- 20,26 ----
X  reg sectortype *p;
X  float c;	/* (compatibility) */
X  {
X+ 
X   return
X  	(int)(
X  	     ( powscale(p->eff)*FACTOR_FERT_SUPPORT * p->fert + 1.0) * 
X*** ../../GB2/misc.c	Wed Jul  5 15:15:35 1989
X--- misc.c	Fri Sep 15 07:28:19 1989
X***************
X*** 18,21 ****
X   return (x+5.0) / (x+10.0);
X  }
X  
X- 
X--- 18,20 ----
X*** ../../GB2/moveplanet.c	Wed Jul  5 15:15:37 1989
X--- moveplanet.c	Fri Sep 15 07:28:24 1989
X***************
X*** 48,54 ****
X  
X    sh = planet->ships;
X    while (sh) {
X! 	if ( (ship = ships[sh]) && !ship->is_dead)
X  		/* don't do landed ships */
X  	   if (!(ship->is_docked && ship->whatdest==LEVEL_PLAN)) {
X  		printf(" orb sh #%d\n",sh);
X--- 48,55 ----
X  
X    sh = planet->ships;
X    while (sh) {
X! 	printf("# %d\n",sh);
X! 	if ( (ship = ships[sh]) && ship->is_alive)
X  		/* don't do landed ships */
X  	   if (!(ship->is_docked && ship->whatdest==LEVEL_PLAN)) {
X  		printf(" orb sh #%d\n",sh);
X***************
X*** 57,63 ****
X  	   }
X  	sh = ship->nextship;
X    }
X! 
X  
X    planet->xpos += xadd;
X    planet->ypos += yadd;
X--- 58,64 ----
X  	   }
X  	sh = ship->nextship;
X    }
X! 	printf("**** \n");
X  
X    planet->xpos += xadd;
X    planet->ypos += yadd;
X*** ../../GB2/moveship.c	Wed Jul  5 15:15:38 1989
X--- moveship.c	Fri Sep 15 07:28:27 1989
X***************
X*** 29,37 ****
X  int shipno;
X  shiptype *s;
X  {
X!  double heading,stardist,movedist,truedist,dist,xdest,ydest,sn,cs;
X   char buf[200];
X!  float fuse,mfactor;
X   int destlevel,deststar=0,destpnum=0;
X   bool move_err = 0;
X   shiptype *dsh;
X--- 29,37 ----
X  int shipno;
X  shiptype *s;
X  {
X!  double stardist,movedist,truedist,dist,xdest,ydest,sn,cs;
X   char buf[200];
X!  float fuse,mfactor,heading;
X   int destlevel,deststar=0,destpnum=0;
X   bool move_err = 0;
X   shiptype *dsh;
X***************
X*** 39,48 ****
X   planettype *opl,*dpl;
X  
X  
X-  printf("moving ship #%d\n",shipno);
X  
X!  if (speed_rating(s) && !s->is_docked && !s->is_dead && s->whatdest!=LEVEL_UNIV) {
X  
X      /* subtract fuel from the ship */
X     fuse = FuelConsts[s->speed] * FUEL_USE;
X  
X--- 39,50 ----
X   planettype *opl,*dpl;
X  
X  
X  
X!  if (s->speed && !s->is_docked && s->is_alive && (s->whatdest!=LEVEL_UNIV
X! 		|| s->navigate.on) ) {
X  
X+  printf("moving ship #%d\n",shipno);
X+ 
X      /* subtract fuel from the ship */
X     fuse = FuelConsts[s->speed] * FUEL_USE;
X  
X***************
X*** 60,71 ****
X  	}
X  	return;
X     }
X  
X- 
X  /*******   move the ship towards dest ******/
X  
X  
X  
X     switch (s->whatdest) {
X        case LEVEL_STAR:
X  	 destlevel = LEVEL_STAR;
X--- 62,88 ----
X  	}
X  	return;
X     }
X+ 	if(s->navigate.turns == 0) s->navigate.on = 0; 
X  
X  /*******   move the ship towards dest ******/
X+ 	if(s->navigate.on){   /* follow navigational orders */
X+ 	heading = .0174329252*s->navigate.bearing;
X+    mfactor = .01 * (100 - s->damage) * SpeedConsts[s->speed] * MoveConsts[s->whatorbits] 
X+ 						/ (logscale((int)s->mass) );
X+    	s->fuel -= fuse;
X+    	s->mass -= fuse * MASS_FUEL;
X  
X+ 	sn = sin(heading);
X+ 	cs = cos(heading);
X+    	xdest = sn * mfactor;
X+    	ydest = cs * mfactor;
X  
X+    	s->xpos += xdest;
X+    	s->ypos -= ydest;
X  
X+ 	s->navigate.turns --;
X+ 
X+ } else {  /*		navigate is off            */
X     switch (s->whatdest) {
X        case LEVEL_STAR:
X  	 destlevel = LEVEL_STAR;
X***************
X*** 102,108 ****
X  /*  update new xpos,ypos */
X     heading = atan2( xdest-s->xpos, 
X  	((ydest - s->ypos)==0.0) ? 0.000001 : (ydest-s->ypos) );
X!    mfactor = SpeedConsts[s->speed] * MoveConsts[s->whatorbits] 
X  						/ (logscale((int)s->mass) );
X  
X  
X--- 119,125 ----
X  /*  update new xpos,ypos */
X     heading = atan2( xdest-s->xpos, 
X  	((ydest - s->ypos)==0.0) ? 0.000001 : (ydest-s->ypos) );
X!    mfactor = .01 * (100 - s->damage) * SpeedConsts[s->speed] * MoveConsts[s->whatorbits] 
X  						/ (logscale((int)s->mass) );
X  
X  
X***************
X*** 126,135 ****
X  
X     if (s->whatdest==LEVEL_SHIP && s->owner!=ships[s->destshipno]->owner
X  	&& !isset(races[s->owner]->allied, ships[s->destshipno]->owner)
X!    	   && truedist > SYSTEMSIZE*2.0) {
X  	  /* (an allied ship lets you follow it..) */
X  	  /* we lost sight of the destination ship. */
X! 	  /* should change SYSTEMSIZE*2.0 to calculated gun range.. */
X  	s->whatdest = LEVEL_UNIV;
X  	teleg_add("",telegram_buf);
X     	sprintf(buf,"Telecomm from ship #%d at %s\n\n", 
X--- 143,152 ----
X  
X     if (s->whatdest==LEVEL_SHIP && s->owner!=ships[s->destshipno]->owner
X  	&& !isset(races[s->owner]->allied, ships[s->destshipno]->owner)
X!    	   && truedist > SYSTEMSIZE*4.0) {
X  	  /* (an allied ship lets you follow it..) */
X  	  /* we lost sight of the destination ship. */
X! 	  /* should change SYSTEMSIZE*1.0 to calculated gun range.. */
X  	s->whatdest = LEVEL_UNIV;
X  	teleg_add("",telegram_buf);
X     	sprintf(buf,"Telecomm from ship #%d at %s\n\n", 
X***************
X*** 246,251 ****
X--- 263,270 ----
X  
X   }
X  
X+ } /* if 'destination' orders */
X+ 
X  }
X  
X  
X***************
X*** 263,269 ****
X  int shipno;
X  {
X  
X!  if (!s->is_dead)
X      switch (s->whatorbits) {
X  	case LEVEL_UNIV:
X  		s->nextship = sdata->ships;
X--- 282,288 ----
X  int shipno;
X  {
X  
X!  if (s->is_alive)
X      switch (s->whatorbits) {
X  	case LEVEL_UNIV:
X  		s->nextship = sdata->ships;
X*** ../../GB2/orbit.c	Wed Jul  5 15:15:41 1989
X--- orbit.c	Fri Sep 15 07:28:33 1989
X***************
X*** 19,27 ****
X--- 19,29 ----
X  #define Midx ((S_X - NAMESIZE)/2.0)
X  #define Midy (S_Y /2.0)
X  
X+ 
X  #include "vars.h"
X  #include "ships.h"
X  #include <curses.h>
X+ #include <stdio.h>
X  extern char Shipltrs[];
X  float Lastx, Lasty, Zoom;
X  extern int God;
X***************
X*** 93,101 ****
X         openshdata(&orbit_shdata);
X  
X         while (sh) {
X- 	   Locks(1);
X  	   (void)getship(orbit_shdata, &s, sh);
X- 	   Locks(0);
X  	   if (DontDispNum != sh)
X  	     DispShip(&where, s, sh, NULL );
X  	   sh = s->nextship;
X--- 95,101 ----
X***************
X*** 114,122 ****
X  
X        for (i=0; i<Stars[where.snum]->numplanets; i++) {
X  	 if (DontDispNum!=i) {
X- 	   Locks(1);
X  	   getplanet(orbit_pdata,&p,Stars[where.snum]->planetpos[i]);
X- 	   Locks(0);
X  	   DispPlanet(LEVEL_STAR,p,Stars[where.snum]->pnames[i],DontDispPlanets);
X  	   free(p);
X  	 }
X--- 114,120 ----
X***************
X*** 129,137 ****
X  	if(sh = Stars[where.snum]->ships){
X  	openshdata(&orbit_shdata);
X  	while (sh) {
X- 	   Locks(1);
X  	   (void)getship(orbit_shdata, &s, sh);
X- 	   Locks(0);
X  		if(s->owner == Playernum && s->popn) 
X  			iq = 1; /* you are there to sight, need a crew */
X  		sh = s->nextship;
X--- 127,133 ----
X***************
X*** 145,153 ****
X         openshdata(&orbit_shdata);
X  
X         while (sh) {
X- 	   Locks(1);
X  	   (void)getship(orbit_shdata, &s, sh);
X- 	   Locks(0);
X  	   if (DontDispNum != sh && !(s->owner != Playernum && s->type == STYPE_MINE) ) {
X  
X  		if((s->owner == Playernum) || (iq == 1))
X--- 141,147 ----
X***************
X*** 163,171 ****
X     case LEVEL_PLAN:
X  
X        openpdata(&orbit_pdata);
X-       Locks(1);
X        getplanet(orbit_pdata,&p,Stars[where.snum]->planetpos[where.pnum]);
X-       Locks(0);
X        close(orbit_pdata);
X        DispPlanet(LEVEL_PLAN, p, Stars[where.snum]->pnames[where.pnum], DontDispPlanets);
X  
X--- 157,163 ----
X***************
X*** 176,184 ****
X  	if(sh = p->ships){
X  	openshdata(&orbit_shdata);
X  	while (sh) {
X- 	   Locks(1);
X  	   (void)getship(orbit_shdata, &s, sh);
X- 	   Locks(0);
X  		if(s->owner == Playernum && s->popn)
X  			iq = 1; /* you are there to sight, need a crew */
X  		sh = s->nextship;
X--- 168,174 ----
X***************
X*** 192,200 ****
X        if (!DontDispShips && (sh = p->ships)) {
X         openshdata(&orbit_shdata);
X         while (sh) {
X- 	   Locks(1);
X  	   (void)getship(orbit_shdata, &s, sh);
X- 	   Locks(0);
X  	   if (DontDispNum != sh) {
X  	     	if( !(s->is_docked && s->whatdest==LEVEL_PLAN) ) {
X  		if((s->owner == Playernum) || (iq ==1))
X--- 182,188 ----
X***************
X*** 365,371 ****
X  startype *star;
X  int DontDispStars;
X  {
X!  int x,y;
X   register int x2,y2;
X   float fac;
X   char *c;
X--- 353,360 ----
X  startype *star;
X  int DontDispStars;
X  {
X! planettype *p;
X!  int x,y,i,col,orbit_pdata;
X   register int x2,y2;
X   float fac;
X   char *c;
X***************
X*** 372,378 ****
X  
X   if (level==LEVEL_UNIV) {
X     fac = 1.0;
X!    x = (int)(Midx+(star->xpos-Lastx)*(Midx/UNIVSIZE) / Zoom)*1.1;
X     y = (int)(Midy+(star->ypos-Lasty)*(Midy/UNIVSIZE) / Zoom);
X   } else if (level==LEVEL_STAR) {
X     fac = 1000.0;
X--- 361,367 ----
X  
X   if (level==LEVEL_UNIV) {
X     fac = 1.0;
X!    x = (int)(Midx+(star->xpos-Lastx)*(Midx/UNIVSIZE) / Zoom);
X     y = (int)(Midy+(star->ypos-Lasty)*(Midy/UNIVSIZE) / Zoom);
X   } else if (level==LEVEL_STAR) {
X     fac = 1000.0;
X***************
X*** 383,392 ****
X  	DispArray(x, y, 11,7, Novae[star->nova_stage-1], fac);
X   else if (y>=0 && y<=S_Y && x>=0 && x<=S_X) {
X  	move(y,x);
X  	addch('*');
X  	if (!DontDispStars) {
X  		move(y, x+2);
X! 		addstr(star->name);
X  	}
X   }
X  
X--- 372,393 ----
X  	DispArray(x, y, 11,7, Novae[star->nova_stage-1], fac);
X   else if (y>=0 && y<=S_Y && x>=0 && x<=S_X) {
X  	move(y,x);
X+ /* check to see if any of its planets are colonized by the player */
X+       openpdata(&orbit_pdata);
X+ 	col=0;
X+       for (i=0; i<star->numplanets; i++) {
X+ 	   getplanet(orbit_pdata,&p,star->planetpos[i]);
X+ 	if(p->info[Playernum-1].numsectsowned >0) col =1;
X+ 	   free(p);
X+       }
X+       close(orbit_pdata);
X+ 
X+ 	if(col)standout();
X  	addch('*');
X+ 	if(col)standend();
X  	if (!DontDispStars) {
X  		move(y, x+2);
X! 		addstr	(star->name);
X  	}
X   }
X  
X***************
X*** 409,415 ****
X--- 410,418 ----
X     x = (int)(Midx +(-Lastx)*(Midx/PLORBITSIZE) / Zoom);
X   }
X   if (x>=0 && x<=S_X && y>=0 && y<=S_Y) {
X+ 	if(p->info[Playernum-1].numsectsowned >0)standout();
X  	   mvaddch(y,x,'@');
X+ 	standend();
X  	   if (!DontDispPlanets) {
X  	     addch(' ');
X  	     addstr(name);
X***************
X*** 430,480 ****
X  
X  	"         ",
X  	"         ",
X! 	"\\===m===/",
X  	"         ",
X  	"         ",
X  
X! 	"  |      ",
X! 	"  \\\\     ",
X! 	"    m    ",
X  	"    \\\\   ",
X! 	"      \\__",
X  
X  	"     /   ",
X  	"    ||   ",
X- 	"    m    ",
X  	"    ||   ",
X  	"     \\   ",
X  
X  	"       __",
X  	"     //  ",
X! 	"    m    ",
X! 	"   //    ",
X  	"   |     ",
X  
X  	"         ",
X  	"         ",
X! 	"/===m===\\",	/* cc thinks this is a quoted " w/o the \ */
X  	"         ",
X  	"         ",
X  
X  	"__       ",
X  	"  \\\\     ",	/* weird stuff again */
X! 	"    m    ",
X! 	"     \\\\  ",
X! 	"      |  ",
X  
X  	"   \\     ",
X  	"   ||    ",
X- 	"    m    ",
X  	"   ||    ",
X  	"   /     ",
X  
X! 	"      |  ",
X! 	"     //  ",
X! 	"    m    ",
X  	"__//     ",
X  	"         "
X  };
X  
X  
X--- 433,484 ----
X  
X  	"         ",
X  	"         ",
X! 	"\\=======/",
X  	"         ",
X  	"         ",
X  
X! 	"   |     ",
X! 	"   \\     ",
X! 	"   \\\\    ",
X  	"    \\\\   ",
X! 	"     \\\\__",
X  
X  	"     /   ",
X  	"    ||   ",
X  	"    ||   ",
X+ 	"    ||   ",
X  	"     \\   ",
X  
X  	"       __",
X  	"     //  ",
X! 	"    //   ",
X! 	"    /    ",
X  	"   |     ",
X  
X  	"         ",
X  	"         ",
X! 	"/=======\\",	/* cc thinks this is a quoted " w/o the \ */
X  	"         ",
X  	"         ",
X  
X  	"__       ",
X  	"  \\\\     ",	/* weird stuff again */
X! 	"   \\\\    ", 
X! 	"    \\\\   ",
X! 	"     |   ",
X  
X  	"   \\     ",
X  	"   ||    ",
X  	"   ||    ",
X+ 	"   ||    ",
X  	"   /     ",
X  
X! 	"     |   ",
X! 	"    //   ",
X! 	"   //    ",
X  	"__//     ",
X  	"         "
X+ 
X  };
X  
X  
X***************
X*** 490,496 ****
X   float xt,yt,slope;
X   char *c;
X  
X!  if (ship->is_dead)
X  	return;
X  
X   switch (where->level) {
X--- 494,500 ----
X   float xt,yt,slope;
X   char *c;
X  
X!  if (!ship->is_alive)
X  	return;
X  
X   switch (where->level) {
X***************
X*** 514,539 ****
X   switch (ship->type) {
X  
X    case STYPE_MIRROR:
X!     if (ship->orders.aimed_at.level==LEVEL_STAR) {
X! 	xt = Stars[ship->orders.aimed_at.snum]->xpos;
X! 	yt = Stars[ship->orders.aimed_at.snum]->ypos;
X!     } else if (ship->orders.aimed_at.level==LEVEL_PLAN) {
X  	if (where->level==LEVEL_PLAN && 
X! 			ship->orders.aimed_at.pnum == where->pnum) {  
X  				/* same planet */
X! 		xt = Stars[ship->orders.aimed_at.snum]->xpos + pl->xpos;
X! 		yt = Stars[ship->orders.aimed_at.snum]->ypos + pl->ypos;
X  	} else {	/* different planet */
X  		openpdata(&pdata);
X  		getplanet(pdata,&apl,Stars[where->snum]->planetpos[where->pnum]);
X  		close(pdata);
X! 		xt = Stars[ship->orders.aimed_at.snum]->xpos + apl->xpos;
X! 		yt = Stars[ship->orders.aimed_at.snum]->ypos + apl->ypos;
X  		free(apl);
X  	}
X!     } else if (ship->orders.aimed_at.level==LEVEL_SHIP) {
X  	openshdata(&shipdata);
X! 	if (getship(shipdata,&aship,ship->orders.aimed_at.shipno)) {
X  		xt = aship->xpos;
X  		yt = aship->ypos;
X  	} else
X--- 518,543 ----
X   switch (ship->type) {
X  
X    case STYPE_MIRROR:
X!     if (ship->aimed_at.level==LEVEL_STAR) {
X! 	xt = Stars[ship->aimed_at.snum]->xpos;
X! 	yt = Stars[ship->aimed_at.snum]->ypos;
X!     } else if (ship->aimed_at.level==LEVEL_PLAN) {
X  	if (where->level==LEVEL_PLAN && 
X! 			ship->aimed_at.pnum == where->pnum) {  
X  				/* same planet */
X! 		xt = Stars[ship->aimed_at.snum]->xpos + pl->xpos;
X! 		yt = Stars[ship->aimed_at.snum]->ypos + pl->ypos;
X  	} else {	/* different planet */
X  		openpdata(&pdata);
X  		getplanet(pdata,&apl,Stars[where->snum]->planetpos[where->pnum]);
X  		close(pdata);
X! 		xt = Stars[ship->aimed_at.snum]->xpos + apl->xpos;
X! 		yt = Stars[ship->aimed_at.snum]->ypos + apl->ypos;
X  		free(apl);
X  	}
X!     } else if (ship->aimed_at.level==LEVEL_SHIP) {
X  	openshdata(&shipdata);
X! 	if (getship(shipdata,&aship,ship->aimed_at.shipno)) {
X  		xt = aship->xpos;
X  		yt = aship->ypos;
X  	} else
X***************
X*** 543,604 ****
X      } else
X  	xt = yt = 0.0;
X  
X!     slope = (xt - ship->xpos) / (yt - ship->ypos);
X  
X!     if (yt - ship->ypos > 0) {
X! 	if (slope > 0) {
X! 	   if (slope > 1) {
X! 		if (slope > 2)
X! 			wm = 0;
X! 		else
X! 			wm = 1;
X! 	   } else {
X! 		if (slope > .5)
X! 			wm = 1;
X! 		else
X! 			wm = 2;
X! 	   }
X  	} else {
X! 	   if (slope < -1) {
X! 		if (slope < -2)
X! 			wm = 0;
X! 		else
X! 			wm = 7;
X! 	   } else {
X! 		if (slope < .5)
X! 			wm = 7;
X! 		else
X! 			wm = 6;
X! 	   }
X!     	}
X!     } else {
X! 	if (slope > 0) {
X! 	   if (slope > 1) {
X! 		if (slope > 2)
X! 			wm = 4;
X! 		else
X! 			wm = 5;
X! 	   } else {
X! 		if (slope > .5)
X! 			wm = 5;
X! 		else
X! 			wm = 6;
X! 	   }
X! 	} else {
X! 	   if (slope < -1) {
X! 		if (slope < -2)
X! 			wm = 4;
X! 		else
X! 			wm = 3;
X! 	   } else {
X! 		if (slope < .5)
X! 			wm = 3;
X! 		else
X! 			wm = 2;
X! 	   }
X  	}
X-     }
X  
X      DispArray(x,y, 9,5, Mirror[wm], 
X  			ship->whatorbits==LEVEL_UNIV ? (float)100.0 :
X  			(ship->whatorbits==LEVEL_STAR ? (float)10.0 :
X--- 547,583 ----
X      } else
X  	xt = yt = 0.0;
X  
X!     wm=0;
X  
X!     if(xt == ship->xpos){
X! 		wm=0;
X! 		if(yt > ship->ypos)wm=4;
X  	} else {
X! 		slope = (yt - ship->ypos) / (xt - ship->xpos);
X! 		if(yt == ship->ypos){
X! 			wm=6;
X! 			if(xt > ship->xpos)wm=2;
X! 			}
X! 
X! 		if(yt > ship->ypos) {
X! 			if(slope < -2.414)wm=4;
X! 			if(slope > -2.414)wm=5;
X! 			if(slope > -0.414)wm=6;
X! 			if(slope >  0.000)wm=2;
X! 			if(slope >  0.414)wm=3;
X! 			if(slope >  2.414)wm=4;
X! 			}
X! 		if(yt < ship->ypos) {
X! 			if(slope < -2.414)wm=0;
X! 			if(slope > -2.414)wm=1;
X! 			if(slope > -0.414)wm=2;
X! 			if(slope >  0.000)wm=6;
X! 			if(slope >  0.414)wm=7;
X! 			if(slope >  2.414)wm=0;
X! 			}
X  	}
X  
X+ 
X      DispArray(x,y, 9,5, Mirror[wm], 
X  			ship->whatorbits==LEVEL_UNIV ? (float)100.0 :
X  			(ship->whatorbits==LEVEL_STAR ? (float)10.0 :
X***************
X*** 605,612 ****
X  			(ship->whatorbits==LEVEL_PLAN ? (float)1.0 :0)));
X  				/* (magnification) */
X      if (x>=0 && x<=S_X && y>=0 && y<=S_Y) {
X  	    move(y,x+1);
X! 	    printw("%d",shipno);
X      }
X      break;
X  
X--- 584,593 ----
X  			(ship->whatorbits==LEVEL_PLAN ? (float)1.0 :0)));
X  				/* (magnification) */
X      if (x>=0 && x<=S_X && y>=0 && y<=S_Y) {
X+ 	if(ship->owner==Playernum)standout();
X  	    move(y,x+1);
X! 	    printw("m%d",shipno);
X! 		standend();
X      }
X      break;
X  
X***************
X*** 626,641 ****
X  		   register float fac;
X  	/* make a cloud of Von Neumann machines */
X      if (ship->whatorbits!=LEVEL_UNIV || (ship->owner == Playernum || God)) {
X! 	fac = ship->orders.object.number / 
X  		((ship->whatorbits==LEVEL_UNIV ? 100.0 : 
X  		(ship->whatorbits==LEVEL_STAR ? 30.0 : 4.0)) * Zoom);
X! 	for (n=1; n<=ship->orders.object.number && n<267; n++) {
X  		xa = int_rand(x - (int)fac, x + (int)fac);
X  		ya = int_rand(y - (int)(fac*S_Y/S_X),
X  			      y + (int)(fac*S_Y/S_X));
X  		if (xa>=0 && xa<=S_X && ya>=0 && ya<=S_Y) {
X  			mvaddch(ya,xa, Shipltrs[ship->type]);
X  			printw("%d",shipno);
X  		}
X       	}
X      }
X--- 607,624 ----
X  		   register float fac;
X  	/* make a cloud of Von Neumann machines */
X      if (ship->whatorbits!=LEVEL_UNIV || (ship->owner == Playernum || God)) {
X! 	fac = ship->object.number / 
X  		((ship->whatorbits==LEVEL_UNIV ? 100.0 : 
X  		(ship->whatorbits==LEVEL_STAR ? 30.0 : 4.0)) * Zoom);
X! 	for (n=1; n<=ship->object.number && n<267; n++) {
X  		xa = int_rand(x - (int)fac, x + (int)fac);
X  		ya = int_rand(y - (int)(fac*S_Y/S_X),
X  			      y + (int)(fac*S_Y/S_X));
X  		if (xa>=0 && xa<=S_X && ya>=0 && ya<=S_Y) {
X+ 		if(ship->owner==Playernum)standout();
X  			mvaddch(ya,xa, Shipltrs[ship->type]);
X  			printw("%d",shipno);
X+ 		standend();
X  		}
X       	}
X      }
X***************
X*** 646,653 ****
X--- 629,638 ----
X  	/* other ships can only be seen when in system */
X      if (ship->whatorbits!=LEVEL_UNIV || (ship->owner == Playernum || God))
X         if (x>=0 && x<=S_X && y>=0 && y<=S_Y) {
X+ 		if(ship->owner==Playernum)standout();
X  	    mvaddch(y,x, Shipltrs[ship->type]);
X  	    printw("%d",shipno);
X+ 		standend();
X         }
X      break;
X   }
X*** ../../GB2/order.c	Wed Jul  5 15:15:42 1989
X--- order.c	Fri Sep 15 07:28:38 1989
X***************
X*** 33,39 ****
X  first = 1;
X  prerror = 0;
X  
X- clear(); move(0,0);
X  
X  if (argn>=2) {
X  	if (args[1][0]=='#') { 
X--- 33,38 ----
X***************
X*** 84,92 ****
X    }
X  
X   }
X- 	/* move to bottom of screen */
X-  move(stdscr->_maxy-2,0);
X-  refresh();
X  
X  }
X  
X--- 83,88 ----
X***************
X*** 93,103 ****
X  
X   /* various prompt locations so we don't have to remember the #'s */
X  #define Opromptx 19
X! #define Oprompty 7
X  #define Erry (Oprompty+1)
X  #define Spromptx (25+PLACENAMESIZE)
X  #define Sprompty 2
X! #define Tpromptx Spromptx
X  #define Tprompty 4
X  #define Dprompty 2
X  #define Dpromptx 15
X--- 89,100 ----
X  
X   /* various prompt locations so we don't have to remember the #'s */
X  #define Opromptx 19
X! #define Oprompty 12
X! #define Lprompty 8
X  #define Erry (Oprompty+1)
X  #define Spromptx (25+PLACENAMESIZE)
X  #define Sprompty 2
X! #define Tpromptx 15
X  #define Tprompty 4
X  #define Dprompty 2
X  #define Dpromptx 15
X***************
X*** 104,111 ****
X  #define SWprompty 5
X  #define SWpromptx 2
X  #define Bprompty 6
X  
X- 
X  int give_orders(APcount, shipno, nextship)
X  int APcount;
X  int shipno;
X--- 101,112 ----
X  #define SWprompty 5
X  #define SWpromptx 2
X  #define Bprompty 6
X+ #define Nprompty 3
X+ #define Cpromptx 18
X+ #define Trnpromptx 44
X+ #define Pprompty 7
X+ #define Ppromptx 18
X  
X  int give_orders(APcount, shipno, nextship)
X  int APcount;
X  int shipno;
X***************
X*** 116,121 ****
X--- 117,127 ----
X   int i = 0;
X   shiptype *ship, *oldship, ship2;
X   char c,s[PLACENAMESIZE];
X+ 
X+ clear(); move(0,0);
X+ 	/* move to bottom of screen */
X+  move(stdscr->_maxy-2,0);
X+  refresh();
X   
X   openshdata(&order_shdata);
X   if (!getship(order_shdata,&ship,shipno)) {
X***************
X*** 126,132 ****
X  
X   if (ship->owner==Playernum) {
X   
X!     if (ship->is_dead) {
X  	printw("%s #%d has been destroyed.\n", Shipnames[ship->type], shipno);
X  	i = 1;
X      } else {
X--- 132,138 ----
X  
X   if (ship->owner==Playernum) {
X   
X!     if (!ship->is_alive) {
X  	printw("%s #%d has been destroyed.\n", Shipnames[ship->type], shipno);
X  	i = 1;
X      } else {
X***************
X*** 166,172 ****
X  	}
X  
X  	move(0,0);
X! 	printw("%13s #%-4d at '%s'. (%2d APs)",
X  		Shipnames[ship->type], shipno, prin_ship_orbits(ship),
X  		ship->whatorbits==LEVEL_UNIV ? Sdata.AP[Playernum] : 
X  		Stars[ship->storbits]->AP[Playernum]);
X--- 172,181 ----
X  	}
X  
X  	move(0,0);
X! 	standout();
X! 	printw(" %s ",ship->name);
X! 	standend();
X! 	printw("  (%s) #%-4d at '%s'. (%2d APs)",
X  		Shipnames[ship->type], shipno, prin_ship_orbits(ship),
X  		ship->whatorbits==LEVEL_UNIV ? Sdata.AP[Playernum] : 
X  		Stars[ship->storbits]->AP[Playernum]);
X***************
X*** 181,211 ****
X  			printw("(s)peed: %d\n",ship->speed);
X  		}
X  	}
X  	if (can_aim(ship)) {
X  		was_obj = 1;
X  		move(4,0);
X  	   	printw("(a)imed at: %s", prin_aimed_at(ship));
X  		if (ship->type==STYPE_MIRROR)
X! 		  printw("\n (i)ntensity: %3d",ship->orders.aimed_at.intensity);
X  	} else if (ship->type==OTYPE_TRANSDEV) {
X  		move(Tprompty,Tpromptx-18);
X! 		printw("(t)arget  ship   #%d", ship->orders.object.number);
X  	} else if (ship->type==STYPE_MINE) {
X  		move(Tprompty,Tpromptx-18);
X! 		printw("(t)rigger radius: %d", ship->orders.object.number);
X  	} else if (can_bombard(ship)) {
X  		was_obj = 0;
X  		move(Bprompty,0); clrtoeol();
X! 		if (ship->orders.o.bombard)
X  		   if (ship->whatdest==LEVEL_PLAN)
X! 			printw("(b)OMBARD planet %s", 
X  				ship->whatdest==LEVEL_PLAN ? 
X  				prin_ship_dest(ship) : "" );
X  		   else
X! 			printw("(b)OMBARD ON (no planet specified)");
X  		else
X  			printw("(b)ombard off");
X  	}
X  	if (has_switch(ship)) {
X  		move(SWprompty,SWpromptx);
X  		printw("(o)%s", ship->on ? "n" : "ff");
X--- 190,254 ----
X  			printw("(s)peed: %d\n",ship->speed);
X  		}
X  	}
X+ 	if (can_navigate(ship)) {
X+ 		move(3,0); clrtoeol();
X+ 		if (ship->navigate.on)
X+ 			printw("(n)avigate on:   (c)ourse %3u    (#) of turns %3u",
X+ 				ship->navigate.bearing,
X+ 				ship->navigate.turns);
X+ 		else
X+ 			printw("(n)avigate off");	
X+ 		}
X  	if (can_aim(ship)) {
X  		was_obj = 1;
X  		move(4,0);
X  	   	printw("(a)imed at: %s", prin_aimed_at(ship));
X  		if (ship->type==STYPE_MIRROR)
X! 		  printw("\n (i)ntensity: %3d",ship->aimed_at.intensity);
X  	} else if (ship->type==OTYPE_TRANSDEV) {
X  		move(Tprompty,Tpromptx-18);
X! 		printw("(t)arget  ship   #%d", ship->object.number);
X  	} else if (ship->type==STYPE_MINE) {
X  		move(Tprompty,Tpromptx-18);
X! 		printw("(t)rigger radius: %d", ship->object.number);
X! 		move(Tprompty+1,Tpromptx-18);
X! 		if(!ship->mine.mode)printw("(m)ode: radiation");
X! 		if(ship->mine.mode)printw("(m)ode: explosive");
X  	} else if (can_bombard(ship)) {
X  		was_obj = 0;
X  		move(Bprompty,0); clrtoeol();
X! 		if (ship->bombard)
X  		   if (ship->whatdest==LEVEL_PLAN)
X! 			printw("(b)ombard planet %s", 
X  				ship->whatdest==LEVEL_PLAN ? 
X  				prin_ship_dest(ship) : "" );
X  		   else
X! 			printw("(b)ombard on (no planet specified)");
X  		else
X  			printw("(b)ombard off");
X  	}
X+ 	if (can_bombard(ship) || ship->type==OTYPE_GR) {
X+ 		move(Pprompty,0); clrtoeol();
X+ 		if (ship->protect.on)
X+ 			{
X+ 			printw("(p)rotect ship #%d",ship->protect.ship);
X+ 			clrtoeol();
X+ 		} else {
X+ 			printw("(p)rotect off");
X+ 			clrtoeol();
X+ 			}
X+ 	}
X+ 	if (can_bombard(ship) || ship->type==OTYPE_GR) {
X+ 		move(Lprompty,0); clrtoeol();
X+ 		if (ship->protect.planet)
X+ 			{
X+ 			printw("p(l)anetary defense on");
X+ 			clrtoeol();
X+ 		} else {
X+ 			printw("p(l)anetary defense off");
X+ 			clrtoeol();
X+ 			}
X+ 	}
X  	if (has_switch(ship)) {
X  		move(SWprompty,SWpromptx);
X  		printw("(o)%s", ship->on ? "n" : "ff");
X***************
X*** 220,226 ****
X  			ship->type==STYPE_MIRROR ? "i" : "");
X  	else
X  		printw("%s%s ESC?):", has_switch(ship) ? "o" : "",
X! 			ship->type==STYPE_MINE ? "t" : "", ship->type==OTYPE_TRANSDEV ? "t" : "" );
X  
X       }
X  
X--- 263,271 ----
X  			ship->type==STYPE_MIRROR ? "i" : "");
X  	else
X  		printw("%s%s ESC?):", has_switch(ship) ? "o" : "",
X! 			ship->type==STYPE_MINE ? "t" : "", 
X! 			ship->type==STYPE_MINE ? "m" : "",
X! 			ship->type==OTYPE_TRANSDEV ? "t" : "" );
X  
X       }
X  
X***************
X*** 241,247 ****
X--- 286,371 ----
X  		    Mod=0;
X  		    touchwin(stdscr);
X  		    } break;
X+ 		case 'p':
X+ 			/* toggle protect option */
X+ 		if(can_bombard(ship) || ship->type==OTYPE_GR) {
X+ 			ship->protect.on = !ship->protect.on;
X+ 			move(Pprompty,0);
X+ 			if(ship->protect.on)
X+ 				{
X+ 				printw("(p)rotect s(h)ip #%d",
X+ 				ship->protect.ship); clrtoeol();
X+ 			} else  {
X+ 				printw("(p)rotect off"); clrtoeol();
X+ 				}
X+ 			}
X+ 			break;
X  
X+ 		case 'l':
X+ 			/* toggle protect option */
X+ 		if(can_bombard(ship) || ship->type == OTYPE_GR) {
X+ 			ship->protect.planet = !ship->protect.planet;
X+ 			move(Lprompty,0);
X+ 			if(ship->protect.planet)
X+ 				{
X+ 				printw("p(l)anetary defense on");
X+ 				clrtoeol();
X+ 			} else  {
X+ 				printw("p(l)anetary defense off");
X+ 				clrtoeol();
X+ 				}
X+ 			}
X+ 			break;
X+ 		case 'h':
X+ 		if(ship->protect.on) {	
X+ 			unsigned i;
X+ 			move(Pprompty,Ppromptx); refresh();
X+ 			tty_off();
X+ 		      scanw("%u",&i); 
X+ 		if(i != shipno) 
X+ 			ship->protect.ship = i;
X+ 		else
X+ 			printf("you can't `protect' yourself!\n");
X+ 			tty_on();
X+ 			}
X+ 			break;
X+ 		case 'n':
X+ 			/* toggle navigate option */
X+ 		if(can_navigate(ship)) {
X+ 			ship->navigate.on = !ship->navigate.on;
X+ 			move(Nprompty,0);
X+ 			printw("(n)avigate o%s ",ship->navigate.on ? "n : " : "ff");
X+ 			clrtoeol();
X+ 			if(ship->navigate.on)printw("  (c)ourse %3u    (#) of turns %3u",
X+ 				ship->navigate.bearing,
X+ 				ship->navigate.turns);
X+ 
X+ 			}
X+ 			break;
X+ 
X+ 		case '#':
X+ 			/* set number of turns for navigate option */
X+ 		if(ship->navigate.on) {	
X+ 			unsigned i;
X+ 			move(Nprompty,Trnpromptx+6); refresh();
X+ 			tty_off();
X+ 		      scanw("%u",&i); 
X+ 			ship->navigate.turns = i;
X+ 			tty_on();
X+ 			}
X+ 			break;
X+ 
X+ 		case 'c':
X+ 			/* set course for navigate option */
X+ 		if(ship->navigate.on) {	unsigned i;
X+ 			move(Nprompty,Cpromptx+10); refresh();
X+ 			tty_off();
X+ 		      scanw("%u",&i); 
X+ 			ship->navigate.bearing = i;
X+ 			tty_on();
X+ 			}
X+ 			break;
X+ 
X  		case 'o':
X  			/* on/off switch */
X  		    if (has_switch(ship)) {
X***************
X*** 281,289 ****
X  		      ungetc(c,stdin);
X  		      scanw("%43s",s); 
X  		      move(Erry,0); refresh();
X- 		      Locks(1);
X  		      where = Getplace(s, 1);
X- 		      Locks(0);
X  		      if (!where.err) {
X  			if (where.level==LEVEL_SHIP) {
X  			    	ship->destshipno = where.shipno;
X--- 405,411 ----
X***************
X*** 347,352 ****
X--- 469,483 ----
X  		    } else
X  			makerr(c);
X  		    break;
X+ 		case 'm':
X+ 		    if (ship->type==STYPE_MINE) {
X+ 			move(Tprompty+1,Tpromptx-18);
X+ 			clrtoeol();
X+ 			refresh();
X+ 		if(!ship->mine.mode)printw("(m)ode: radiation");
X+ 		if(ship->mine.mode)printw("(m)ode: explosive");
X+ 		ship->mine.mode = !ship->mine.mode;
X+ 			}
X  
X  		case 't':
X  		    if (ship->type==STYPE_MINE) {
X***************
X*** 353,366 ****
X  			move(Tprompty,Tpromptx); clrtoeol();
X  			refresh(); tty_off();
X  
X! 	ship->orders.object.number = 0;
X  
X! 			scanw("%hd", &ship->orders.object.number);
X  			tty_on();
X! 			if (ship->orders.object.number < 0)
X! 				ship->orders.object.number = 0;
X  			move(Tprompty,Tpromptx);
X! 			printw("%d",ship->orders.object.number); clrtoeol();
X  
X  		    } else if (ship->type==OTYPE_TRANSDEV) {
X  
X--- 484,497 ----
X  			move(Tprompty,Tpromptx); clrtoeol();
X  			refresh(); tty_off();
X  
X! 	ship->object.number = 0;
X  
X! 			scanw("%hd", &ship->object.number);
X  			tty_on();
X! 			if (ship->object.number < 0)
X! 				ship->object.number = 0;
X  			move(Tprompty,Tpromptx);
X! 			printw("%d",ship->object.number); clrtoeol();
X  
X  		    } else if (ship->type==OTYPE_TRANSDEV) {
X  
X***************
X*** 367,378 ****
X  			move(Tprompty,Tpromptx); clrtoeol();
X  			refresh(); tty_off();
X  
X! 	ship->orders.object.number = 0;
X  
X! 			scanw("%hd", &ship->orders.object.number);
X  			tty_on();
X  			move(Tprompty,Tpromptx);
X! 			printw("%d",ship->orders.object.number); clrtoeol();
X  
X  			} else
X  			makerr(c);
X--- 498,509 ----
X  			move(Tprompty,Tpromptx); clrtoeol();
X  			refresh(); tty_off();
X  
X! 	ship->object.number = 0;
X  
X! 			scanw("%hd", &ship->object.number);
X  			tty_on();
X  			move(Tprompty,Tpromptx);
X! 			printw("%d",ship->object.number); clrtoeol();
X  
X  			} else
X  			makerr(c);
X***************
X*** 393,402 ****
X  			  if (pl.err) {
X  				break;
X  			  } else {
X! 				ship->orders.aimed_at.level = pl.level;
X! 				ship->orders.aimed_at.pnum = pl.pnum;
X! 				ship->orders.aimed_at.snum = pl.snum;
X! 				ship->orders.aimed_at.shipno = pl.shipno;
X  				if (ship->type!=OTYPE_TRACT && 
X  						ship->type!=OTYPE_GTELE)
X  					ship->fuel -= FUEL_MANEUVER;
X--- 524,533 ----
X  			  if (pl.err) {
X  				break;
X  			  } else {
X! 				ship->aimed_at.level = pl.level;
X! 				ship->aimed_at.pnum = pl.pnum;
X! 				ship->aimed_at.snum = pl.snum;
X! 				ship->aimed_at.shipno = pl.shipno;
X  				if (ship->type!=OTYPE_TRACT && 
X  						ship->type!=OTYPE_GTELE)
X  					ship->fuel -= FUEL_MANEUVER;
X***************
X*** 423,437 ****
X  			    if ((c=getchr())!='\n') {
X  			      ungetc(c,stdin);
X  			      scanw("%u",&i); 
X! 			      ship->orders.aimed_at.intensity = i;
X  			      Mod=1;
X! 			      if (ship->orders.aimed_at.intensity>100)
X! 				  ship->orders.aimed_at.intensity=100;
X! 			      else if (ship->orders.aimed_at.intensity<0)
X! 				  ship->orders.aimed_at.intensity=0;
X  			    }
X  			    move(5,14);
X! 			    printw("%3d",ship->orders.aimed_at.intensity); 
X  			    tty_on(); 
X  		    } else 
X  			makerr(c);
X--- 554,568 ----
X  			    if ((c=getchr())!='\n') {
X  			      ungetc(c,stdin);
X  			      scanw("%u",&i); 
X! 			      ship->aimed_at.intensity = i;
X  			      Mod=1;
X! 			      if (ship->aimed_at.intensity>100)
X! 				  ship->aimed_at.intensity=100;
X! 			      else if (ship->aimed_at.intensity<0)
X! 				  ship->aimed_at.intensity=0;
X  			    }
X  			    move(5,14);
X! 			    printw("%3d",ship->aimed_at.intensity); 
X  			    tty_on(); 
X  		    } else 
X  			makerr(c);
X***************
X*** 441,449 ****
X  		    if (can_bombard(ship)) {
X  			move(Bprompty,0);
X  			clrtoeol();
X! 			ship->orders.o.bombard = !ship->orders.o.bombard;
X  			Mod=1;
X! 			if (ship->orders.o.bombard)
X  			   if (ship->whatdest==LEVEL_PLAN)
X  				printw("(b)OMBARD planet %s", 
X  					ship->whatdest==LEVEL_PLAN ? 
X--- 572,580 ----
X  		    if (can_bombard(ship)) {
X  			move(Bprompty,0);
X  			clrtoeol();
X! 			ship->bombard = !ship->bombard;
X  			Mod=1;
X! 			if (ship->bombard)
X  			   if (ship->whatdest==LEVEL_PLAN)
X  				printw("(b)OMBARD planet %s", 
X  					ship->whatdest==LEVEL_PLAN ? 
X***************
X*** 469,474 ****
X--- 600,606 ----
X  			printw(" o -- turn object on/off\n");
X  		    if (ship->type==STYPE_MINE)
X  			printw(" t -- trigger radius\n");
X+ 			printw(" m -- change combat mode\n");
X  		    if (ship->type==OTYPE_TRANSDEV)
X  			printw(" t -- transporter target\n");
X  		    if (can_bombard(ship))
X***************
X*** 519,529 ****
X   planettype *p;
X   int plan_give_orders_pdata,Planmod=0;
X  
X-  Locks(1);	/* we are only looking up data unchanged by the shell */
X   openpdata(&plan_give_orders_pdata);
X   getplanet(plan_give_orders_pdata,&p,filepos);
X   close(plan_give_orders_pdata);
X-  Locks(0);
X  
X   sh = p->ships;
X   while (sh)
X--- 651,659 ----
X***************
X*** 562,571 ****
X  {
X   placetype targ;
X  
X!   targ.level = ship->orders.aimed_at.level;
X!   targ.snum = ship->orders.aimed_at.snum;
X!   targ.pnum = ship->orders.aimed_at.pnum;
X!   targ.shipno = ship->orders.aimed_at.shipno;
X    return Dispplace(&targ);
X  }
X  
X--- 692,701 ----
X  {
X   placetype targ;
X  
X!   targ.level = ship->aimed_at.level;
X!   targ.snum = ship->aimed_at.snum;
X!   targ.pnum = ship->aimed_at.pnum;
X!   targ.shipno = ship->aimed_at.shipno;
X    return Dispplace(&targ);
X  }
X  
X***************
X*** 609,615 ****
X  int sdata,pdata;
X  float xf,yf;
X  
X!  str = Stars[s->orders.aimed_at.snum];
X  
X   if (s->is_docked && s->whatdest==LEVEL_PLAN) {
X  	openpdata(&pdata);
X--- 739,745 ----
X  int sdata,pdata;
X  float xf,yf;
X  
X!  str = Stars[s->aimed_at.snum];
X  
X   if (s->is_docked && s->whatdest==LEVEL_PLAN) {
X  	openpdata(&pdata);
X***************
X*** 623,629 ****
X  	yf = s->ypos;
X   }
X  
X!  switch (s->orders.aimed_at.level) {
X  	case LEVEL_UNIV:
X  		move(Erry,0);
X  		printw("There is nothing out here to aim at.");
X--- 753,759 ----
X  	yf = s->ypos;
X   }
X  
X!  switch (s->aimed_at.level) {
X  	case LEVEL_UNIV:
X  		move(Erry,0);
X  		printw("There is nothing out here to aim at.");
X***************
X*** 633,641 ****
X  		printw("Star %s ", prin_aimed_at(s));
X  		if ((dist=sqrt(Distsq(xf, yf, str->xpos, str->ypos))) <= tele_range(Race, s) ) {
X  			openstardata(&sdata);
X! 			getstar(sdata, &str, s->orders.aimed_at.snum);
X  			 setbit(str->explored,Playernum);
X! 			putstar(sdata, str, s->orders.aimed_at.snum);
X  			close(sdata);	/* don't need to care about Stars */
X  			printw("has been surveyed, distance %g.\n",dist);
X  		} else {
X--- 763,771 ----
X  		printw("Star %s ", prin_aimed_at(s));
X  		if ((dist=sqrt(Distsq(xf, yf, str->xpos, str->ypos))) <= tele_range(Race, s) ) {
X  			openstardata(&sdata);
X! 			getstar(sdata, &str, s->aimed_at.snum);
X  			 setbit(str->explored,Playernum);
X! 			putstar(sdata, str, s->aimed_at.snum);
X  			close(sdata);	/* don't need to care about Stars */
X  			printw("has been surveyed, distance %g.\n",dist);
X  		} else {
X***************
X*** 647,657 ****
X  		move(Erry,0);
X  		printw("Planet %s ", prin_aimed_at(s));
X  		openpdata(&pdata);
X! 		getplanet(pdata, &p, str->planetpos[s->orders.aimed_at.pnum]);
X  		if ((dist=sqrt(Distsq(xf, yf, str->xpos+p->xpos, str->ypos+p->ypos))) <= tele_range(Race, s) ) {
X  			setbit(str->explored,Playernum);
X  			p->info[Playernum-1].explored = 1;
X! 			putplanet(pdata, p, str->planetpos[s->orders.aimed_at.pnum]);
X  			free(p);
X  			printw("has been surveyed, distance %g.\n", dist);
X  		} else {
X--- 777,787 ----
X  		move(Erry,0);
X  		printw("Planet %s ", prin_aimed_at(s));
X  		openpdata(&pdata);
X! 		getplanet(pdata, &p, str->planetpos[s->aimed_at.pnum]);
X  		if ((dist=sqrt(Distsq(xf, yf, str->xpos+p->xpos, str->ypos+p->ypos))) <= tele_range(Race, s) ) {
X  			setbit(str->explored,Playernum);
X  			p->info[Playernum-1].explored = 1;
X! 			putplanet(pdata, p, str->planetpos[s->aimed_at.pnum]);
X  			free(p);
X  			printw("has been surveyed, distance %g.\n", dist);
X  		} else {
X*** /dev/null	Fri Sep 15 08:30:02 1989
X--- patchlevel.h	Fri Sep 15 08:33:35 1989
X***************
X*** 0 ****
X--- 1 ----
X+ #define PATCHLEVEL	1
END_OF_FILE
if test 50119 -ne `wc -c <'patches01c'`; then
    echo shar: \"'patches01c'\" unpacked with wrong size!
fi
# end of 'patches01c'
fi
echo shar: End of archive 3 \(of 4\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0