[comp.sources.games] v08i034: conquer4 - middle earth multi-player game

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

Submitted-by: Adam Bryant <adb@cs.bu.edu>
Posting-number: Volume 8, Issue 34
Archive-name: conquer4/Patch6c
Patch-To: conquer4: Volume 6, Issue 83-96


#!/bin/sh
# this is part 3 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file patchV4.6 continued
#
CurArch=3
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> patchV4.6
X--- move.c	Wed Sep 20 21:41:27 1989
X***************
X*** 161,167 ****
X  			if(hilmode==3) {
X  				for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
X  					for(j=YREAL-yoffset-1;j<=YREAL-yoffset+1;j++){
X! 						highlight(i,j);
X  						see(i,j);
X  					}
X  				}
X--- 161,167 ----
X  			if(hilmode==3) {
X  				for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
X  					for(j=YREAL-yoffset-1;j<=YREAL-yoffset+1;j++){
X! 						highlight(i,j,hilmode);
X  						see(i,j);
X  					}
X  				}
X***************
X*** 176,182 ****
X  				}
X  			} else for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
X  				for(j=YREAL-yoffset-1;j<=YREAL-yoffset+1;j++){
X! 					highlight(i,j);
X  					see(i,j);
X  				}
X  			}
X--- 176,182 ----
X  				}
X  			} else for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
X  				for(j=YREAL-yoffset-1;j<=YREAL-yoffset+1;j++){
X! 					highlight(i,j,hilmode);
X  					see(i,j);
X  				}
X  			}
X***************
X*** 407,414 ****
X  					done=TRUE;
X  				}
X  			}
X  
X! 			if( done==FALSE ) {
X  			standout();
X  			if(armornvy==ARMY){
X  				mvprintw(LINES-2,0,"MOVESCREEN: move left: %d",P_AMOVE);
X--- 407,415 ----
X  					done=TRUE;
X  				}
X  			}
X+ 		}
X  
X! 		if( done==FALSE ) {
X  			standout();
X  			if(armornvy==ARMY){
X  				mvprintw(LINES-2,0,"MOVESCREEN: move left: %d",P_AMOVE);
X***************
X*** 428,440 ****
X  			for(i=XREAL-1;i<=XREAL+1;i++)
X  			for(j=YREAL-1;j<=YREAL+1;j++) if(ONMAP(i,j))
X  				if(!canbeseen((int)i,(int)j)) {
X! 					highlight(i-xoffset,j-yoffset);
X  					see(i-xoffset,j-yoffset);
X  				}
X- 
X- 			}
X- 			makeside(TRUE);
X  		}
X  		move(ycurs,xcurs*2);
X  		refresh();
X  	}
X--- 429,439 ----
X  			for(i=XREAL-1;i<=XREAL+1;i++)
X  			for(j=YREAL-1;j<=YREAL+1;j++) if(ONMAP(i,j))
X  				if(!canbeseen((int)i,(int)j)) {
X! 					highlight(i-xoffset,j-yoffset,hilmode);
X  					see(i-xoffset,j-yoffset);
X  				}
X  		}
X+ 		makeside(TRUE);
X  		move(ycurs,xcurs*2);
X  		refresh();
X  	}
X***************
X*** 508,514 ****
X  				} else{
X  					flee(XREAL,YREAL,0,FALSE);
X  				}
X! 				mvprintw(LINES-2,0,"TAKING SECTOR");
X  				clrtoeol();
X  				refresh();
X  				sleep(2);
X--- 507,513 ----
X  				} else{
X  					flee(XREAL,YREAL,0,FALSE);
X  				}
X! 				mvaddstr(LINES-2,0,"TAKING SECTOR");
X  				clrtoeol();
X  				refresh();
X  				sleep(2);
X***************
X*** 548,554 ****
X  		return;
X  	} else {
X  		/*else navy*/
X! 		mvprintw(LINES-1,0,"NAVY DONE: ");
X  		clrtoeol();
X  		P_NXLOC=XREAL;
X  		P_NYLOC=YREAL;
X--- 547,553 ----
X  		return;
X  	} else {
X  		/*else navy*/
X! 		mvaddstr(LINES-1,0,"NAVY DONE: ");
X  		clrtoeol();
X  		P_NXLOC=XREAL;
X  		P_NYLOC=YREAL;
X***************
X*** 570,585 ****
X  		if (magic(country,SAILOR)==TRUE) mvused/=2;
X  		if (mvused!=0) mvused= (rand()%mvused);
X  		P_NPEOP = (unsigned char) (P_NPEOP*(LONGTRIP-mvused)/LONGTRIP);
X! 		mvprintw(LINES-1,60,"HIT ANY KEY");
X  		refresh();
X  		getch();
X  	}
X  	whatcansee();
X  	redraw=DONE;
X! 	prep(country,FALSE,TRUE);
X  	makemap();
X  	armornvy=AORN;
X- 	makebottom();
X  	pager=0;
X  	selector=0;
X  }
X--- 569,583 ----
X  		if (magic(country,SAILOR)==TRUE) mvused/=2;
X  		if (mvused!=0) mvused= (rand()%mvused);
X  		P_NPEOP = (unsigned char) (P_NPEOP*(LONGTRIP-mvused)/LONGTRIP);
X! 		mvaddstr(LINES-1,60,"HIT ANY KEY");
X  		refresh();
X  		getch();
X  	}
X  	whatcansee();
X  	redraw=DONE;
X! 	prep(country,FALSE);
X  	makemap();
X  	armornvy=AORN;
X  	pager=0;
X  	selector=0;
X  }
X*** oupdate.c	Wed Sep 20 21:41:01 1989
X--- update.c	Wed Sep 20 21:41:31 1989
X***************
X*** 11,17 ****
X--- 11,21 ----
X   */
X  
X  #include <ctype.h>
X+ #ifndef	XENIX
X  #include <sys/file.h>
X+ #else
X+ #include	<unistd.h>
X+ #endif
X  #include "header.h"
X  #include "data.h"
X  
X***************
X*** 18,24 ****
X  extern FILE *fnews;
X  
X  extern short country;
X! int	dissarray;		/* TRUE if nation in dissarray */
X  int	**attr;			/* sector attractiveness */
X  
X  /****************************************************************/
X--- 22,28 ----
X  extern FILE *fnews;
X  
X  extern short country;
X! int	disarray;		/* TRUE if nation in disarray */
X  int	**attr;			/* sector attractiveness */
X  
X  /****************************************************************/
X***************
X*** 356,362 ****
X  				}
X  				if(sct[x][y].owner==0){
X  					sct[x][y].owner=country;
X! 					curntn->popularity++;
X  #ifdef XENIX
X  					z = attr[x][y];
X  					z /= 8;
X--- 360,366 ----
X  				}
X  				if(sct[x][y].owner==0){
X  					sct[x][y].owner=country;
X! 					if (curntn->popularity<MAXTGVAL) curntn->popularity++;
X  #ifdef XENIX
X  					z = attr[x][y];
X  					z /= 8;
X***************
X*** 394,400 ****
X  				P_AXLOC=x;
X  				P_AYLOC=y;
X  				if(sct[x][y].owner==0){
X! 					curntn->popularity++;
X  					sct[x][y].owner=country;
X  					attr[x][y] = 1;
X  					takesctr++;
X--- 398,404 ----
X  				P_AXLOC=x;
X  				P_AYLOC=y;
X  				if(sct[x][y].owner==0){
X! 					if (curntn->popularity<MAXTGVAL) curntn->popularity++;
X  					sct[x][y].owner=country;
X  					attr[x][y] = 1;
X  					takesctr++;
X***************
X*** 445,451 ****
X  	/* take inventory of countries */
X  	for(x=1;x<NTOTAL;x++) {
X  		sprintf(tempc,"%s%d", exefile, x);
X! 		if (isnpc(ntn[x].active) && access(tempc,F_OK)==0) {
X  			realnpc[x]=TRUE;
X  		} else {
X  			realnpc[x]=FALSE;
X--- 449,455 ----
X  	/* take inventory of countries */
X  	for(x=1;x<NTOTAL;x++) {
X  		sprintf(tempc,"%s%d", exefile, x);
X! 		if (isnpc(ntn[x].active) && access(tempc,00)==0) {
X  			realnpc[x]=TRUE;
X  		} else {
X  			realnpc[x]=FALSE;
X***************
X*** 558,564 ****
X  		printf("updating nation number %d -> %s\n",country,curntn->name);
X  	check();
X  
X! 		dissarray=FALSE;
X  #ifdef TRADE
X  		if(isntn(curntn->active)) checktrade();
X  #endif TRADE
X--- 562,568 ----
X  		printf("updating nation number %d -> %s\n",country,curntn->name);
X  	check();
X  
X! 		disarray=FALSE;
X  #ifdef TRADE
X  		if(isntn(curntn->active)) checktrade();
X  #endif TRADE
X***************
X*** 570,578 ****
X  #ifdef CMOVE
X  			printf("\tthe computer will move for %s\n",curntn->name);
X  			fprintf(fnews,"1.\tthe computer will move for %s\n",curntn->name);
X! 			mailopen( country );
X! 			fprintf(fm,"the computer moved for you (%s) in %s of Year %d\n",curntn->name,PSEASON(TURN),YEAR(TURN));
X! 			mailclose();
X  			check();
X  			nationrun();
X  			check();
X--- 574,584 ----
X  #ifdef CMOVE
X  			printf("\tthe computer will move for %s\n",curntn->name);
X  			fprintf(fnews,"1.\tthe computer will move for %s\n",curntn->name);
X! 			if (mailopen( country )!=(-1)) {
X! 				fprintf(fm,"Message to %s from CONQUER\n\n",curntn->name);
X! 				fprintf(fm,"The computer moved for you in the %s of Year %d\n",curntn->name,PSEASON(TURN),YEAR(TURN));
X! 				mailclose(country);
X! 			}
X  			check();
X  			nationrun();
X  			check();
X***************
X*** 599,614 ****
X  #endif /*NPC*/
X  		}
X  
X! 		/* is leader killed - put nation into dissarray */
X  		x = getleader((int)curntn->class) - 1;
X  		for(armynum=0;armynum<MAXARM;armynum++)
X! 			if(P_ATYPE == x) break;
X  #ifdef DEBUG
X  printf("checking for leader in nation %s: armynum=%d\n",curntn->name,armynum);
X  #endif DEBUG
X  
X! 		if(armynum == MAXARM) {
X! 			dissarray=TRUE;
X  			if(rand()%100 < 30) {	/* new leader takes over */
X  				x++;
X  				for(armynum=0;armynum<MAXARM;armynum++)
X--- 605,623 ----
X  #endif /*NPC*/
X  		}
X  
X! 		/* is leader killed - put nation into disarray */
X! 		disarray=TRUE;
X  		x = getleader((int)curntn->class) - 1;
X  		for(armynum=0;armynum<MAXARM;armynum++)
X! 		if(P_ATYPE == x && P_ASOLD>0) {
X! 			disarray=FALSE;
X! 			break;
X! 		}
X  #ifdef DEBUG
X  printf("checking for leader in nation %s: armynum=%d\n",curntn->name,armynum);
X  #endif DEBUG
X  
X! 		if(disarray == TRUE) {
X  			if(rand()%100 < 30) {	/* new leader takes over */
X  				x++;
X  				for(armynum=0;armynum<MAXARM;armynum++)
X***************
X*** 616,643 ****
X  				if( armynum<MAXARM) {
X  					P_ATYPE=x-1;
X  					P_ASOLD= *(unitminsth+(x-1)%UTYPE);
X! 					dissarray=FALSE;
X  					fprintf(stderr,"new leader in nation %s\n",curntn->name);
X  					fprintf(fnews,"1.\tnation %s has a new leader\n",curntn->name);
X  					if(ispc(curntn->active)){
X! 						mailopen(country);
X! 						fprintf(fm,"MESSAGE FROM CONQUER: YOU HAVE A NEW LEADER\n");
X! 						fprintf(fm,"YOUR TROOPS MAY NOW MOVE NORMALLY\n");
X! 						mailclose();
X  					}
X  				}
X  			}
X! 		} else dissarray=FALSE;
X  
X! 		if( dissarray ==  TRUE) {
X  			fprintf(stderr,"no leader in nation %s\n",curntn->name);
X  			fprintf(fnews,"1.\tnation %s still has no national leader\n",curntn->name);
X  			if(ispc(curntn->active)){
X! 				mailopen(country);
X! 				fprintf(fm,"MESSAGE FROM CONQUER: YOU DONT HAVE A COUNTRY LEADER\n");
X! 				fprintf(fm,"YOUR TROOPS MAY NOT MOVE\n");
X! 				fprintf(fm,"THERE IS A 30%% CHANCE/TURN OF GETTING A NEW ONE \n");
X! 				mailclose();
X  			}
X  		}
X  
X--- 625,656 ----
X  				if( armynum<MAXARM) {
X  					P_ATYPE=x-1;
X  					P_ASOLD= *(unitminsth+(x-1)%UTYPE);
X! 					disarray=FALSE;
X  					fprintf(stderr,"new leader in nation %s\n",curntn->name);
X  					fprintf(fnews,"1.\tnation %s has a new leader\n",curntn->name);
X  					if(ispc(curntn->active)){
X! 						if (mailopen(country)!=(-1)) {
X! 							fprintf(fm,"MESSAGE FROM CONQUER:\n\n");
X! 							fprintf(fm,"YOU HAVE A NEW NATIONAL LEADER.\n");
X! 							fprintf(fm,"YOUR TROOPS MAY NOW MOVE NORMALLY.\n");
X! 							mailclose(country);
X! 						}
X  					}
X  				}
X  			}
X! 		}
X  
X! 		if( disarray ==  TRUE) {
X  			fprintf(stderr,"no leader in nation %s\n",curntn->name);
X  			fprintf(fnews,"1.\tnation %s still has no national leader\n",curntn->name);
X  			if(ispc(curntn->active)){
X! 				if (mailopen(country)!=(-1)) {
X! 					fprintf(fm,"MESSAGE FROM CONQUER\n\n");
X! 					fprintf(fm,"YOU DON'T HAVE A COUNTRY LEADER;\n");
X! 					fprintf(fm,"YOUR TROOPS MAY NOT MOVE\n");
X! 					fprintf(fm,"THERE IS A 30%% CHANCE/TURN OF GETTING A NEW ONE\n");
X! 					mailclose(country);
X! 				}
X  			}
X  		}
X  
X***************
X*** 818,824 ****
X  				sptr = &sct[P_AXLOC][P_AYLOC];
X  				if(sptr->owner==0){
X  					sptr->owner=country;
X! 					curntn->popularity++;
X  				} else if((sptr->owner!=country)
X  				&&(curntn->dstatus[sptr->owner]>=WAR)) {
X  					if(ntn[sptr->owner].race!=curntn->race)
X--- 831,837 ----
X  				sptr = &sct[P_AXLOC][P_AYLOC];
X  				if(sptr->owner==0){
X  					sptr->owner=country;
X! 					if (curntn->popularity<MAXTGVAL) curntn->popularity++;
X  				} else if((sptr->owner!=country)
X  				&&(curntn->dstatus[sptr->owner]>=WAR)) {
X  					if(ntn[sptr->owner].race!=curntn->race)
X***************
X*** 858,876 ****
X  					/* capture the scout */
X  					P_ASOLD=0;
X  					if (ispc(curntn->active)) {
X! 						mailopen(country);
X! 						fprintf(fm,"Message from Conquer\n\n");
X! 						fprintf(fm,"\tYour Scouting Unit %d was captured\n");
X! 						fprintf(fm,"\t  by %s military in sector %d,%d\n",
X! 							ntn[occval].name,(int)P_AXLOC,(int)P_AYLOC);
X! 						mailclose();
X  					}
X  					if (ispc(ntn[occval].active)) {
X! 						mailopen(occval);
X! 						fprintf(fm,"Message from Conquer\n\n");
X! 						fprintf(fm,"\tA Scout from nation %s was captured\n",curntn->name);
X! 						fprintf(fm,"\t  in sector %d,%d.\n",(int)P_AXLOC,(int)P_AYLOC);
X! 						mailclose();
X  					}
X  				}
X  			}
X--- 871,891 ----
X  					/* capture the scout */
X  					P_ASOLD=0;
X  					if (ispc(curntn->active)) {
X! 						if(mailopen(country)!=(-1)) {
X! 							fprintf(fm,"Message from Conquer\n\n");
X! 							fprintf(fm,"\tYour Scouting Unit %d was captured\n");
X! 							fprintf(fm,"\t  by %s military in sector %d,%d\n",
X! 								   ntn[occval].name,(int)P_AXLOC,(int)P_AYLOC);
X! 							mailclose(country);
X! 						}
X  					}
X  					if (ispc(ntn[occval].active)) {
X! 						if(mailopen(occval)!=(-1)) {
X! 							fprintf(fm,"Message from Conquer\n\n");
X! 							fprintf(fm,"\tA Scout from nation %s was captured\n",curntn->name);
X! 							fprintf(fm,"\t  in sector %d,%d.\n",(int)P_AXLOC,(int)P_AYLOC);
X! 							mailclose(occval);
X! 						}
X  					}
X  				}
X  			}
X***************
X*** 998,1004 ****
X  			}
X  
X  			spreadsheet(country);
X! 			curntn->popularity = min(0,(int)(curntn->popularity-2*curntn->inflation));
X  			curntn->tsctrs = spread.sectors;
X  			curntn->tciv=spread.civilians;
X  			curntn->tfood=spread.food;
X--- 1013,1021 ----
X  			}
X  
X  			spreadsheet(country);
X! 			if ((int)curntn->popularity-2*curntn->inflation < (int)MAXTGVAL) {
X! 				curntn->popularity = min(0,(int)(curntn->popularity-2*curntn->inflation));
X! 			} else curntn->popularity = (char) MAXTGVAL;
X  			curntn->tsctrs = spread.sectors;
X  			curntn->tciv=spread.civilians;
X  			curntn->tfood=spread.food;
X***************
X*** 1006,1019 ****
X  			/* take out for charity */
X  			charity=((spread.gold-curntn->tgold)*curntn->charity)/100;
X  
X! 			if(charity > 0) charity = 0;
X  			if(curntn->tciv > 0) charity /= curntn->tciv;
X  			else charity = 0;
X  
X  			curntn->tgold = spread.gold - charity;
X  
X! 			/* give them some benefit of the doubt */
X! 			curntn->popularity += 5*charity;
X  			if(curntn->poverty < (charity+1)/2 )
X  				curntn->poverty = 0;
X  			else	curntn->poverty -= (charity+1)/2;
X--- 1023,1056 ----
X  			/* take out for charity */
X  			charity=((spread.gold-curntn->tgold)*curntn->charity)/100;
X  
X! 			if(charity < 0) charity = 0;
X  			if(curntn->tciv > 0) charity /= curntn->tciv;
X  			else charity = 0;
X  
X  			curntn->tgold = spread.gold - charity;
X  
X! 			/* calculate poverty base */
X! 			if (curntn->tgold < 0L) {
X! 				curntn->poverty = 95;
X! 			} else if (curntn->tciv < 100L) {
X! 				/* give some check on civilians */
X! 				curntn->poverty = (unsigned char)20;
X! 			} else if (curntn->tgold/curntn->tciv < 30L) {
X! 				curntn->poverty = (unsigned char)(95L - curntn->tgold/curntn->tciv);
X! 			} else if (curntn->tgold/curntn->tciv < 80L) {
X! 				curntn->poverty = (unsigned char)(65L - (curntn->tgold/curntn->tciv-30L)/2L);
X! 			} else if (curntn->tgold/curntn->tciv < 120L) {
X! 				curntn->poverty = (unsigned char)(40L - (curntn->tgold/curntn->tciv-80L)/4L);
X! 			} else if (curntn->tgold/curntn->tciv < 200L) {
X! 				curntn->poverty = (unsigned char)(30L - (curntn->tgold/curntn->tciv-120L)/8L);
X! 			} else {
X! 				curntn->poverty = (unsigned char)20;
X! 			}
X! 
X! 			/* charity increase to popularity */
X! 			curntn->popularity = min(curntn->popularity+5*charity,MAXTGVAL);
X! 
X! 			/* charity adjustment to poverty; rounding upward */
X  			if(curntn->poverty < (charity+1)/2 )
X  				curntn->poverty = 0;
X  			else	curntn->poverty -= (charity+1)/2;
X***************
X*** 1027,1040 ****
X  			/* adjustment for military */
X  			if (spread.civilians>0)
X  				curntn->inflation += ((curntn->tmil*100/spread.civilians - 15)/5);
X! 			/* adjustment for debt and/or wealth */
X! 			if(curntn->tgold<75000L) {
X! 				curntn->inflation += (short)(-(curntn->tgold/25000L)+1);
X! 			} else if(curntn->tgold<100000L) {
X! 				curntn->inflation -= 1;
X! 			} else if(curntn->tgold>=200000L) {
X! 				curntn->inflation += (short)(curntn->tgold/100000L-1);
X! 			}
X  			/* plus maybe an adjustment for jewel production as a ratio */
X  			/* for whatever is produced by the country.                 */
X  
X--- 1064,1072 ----
X  			/* adjustment for military */
X  			if (spread.civilians>0)
X  				curntn->inflation += ((curntn->tmil*100/spread.civilians - 15)/5);
X! 			/* adjustment for poverty */
X! 			curntn->inflation += (curntn->poverty-50)/2;
X! 
X  			/* plus maybe an adjustment for jewel production as a ratio */
X  			/* for whatever is produced by the country.                 */
X  
X***************
X*** 1066,1083 ****
X  	if(isntn(ntn[country].active)){
X  		curntn = &ntn[country];
X  
X  		if(ispc(curntn->active)) {
X  		prep( country, TRUE );	/* occ[][] now >0 if leader near */
X  		dfltunit = defaultunit(country);
X  		} else dfltunit = A_INFANTRY;
X  
X- 		dissarray=TRUE;
X- 		for(armynum=0;armynum<MAXARM;armynum++)
X- 			if (P_ATYPE==(getleader(curntn->class)-1) && P_ASOLD>0) {
X- 				dissarray=FALSE;
X- 				break;
X- 			}
X- 
X  		for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD>0) {
X  
X  			A = &curntn->arm[armynum];
X--- 1098,1116 ----
X  	if(isntn(ntn[country].active)){
X  		curntn = &ntn[country];
X  
X+ 		disarray=TRUE;
X+ 		dfltunit=(getleader(curntn->class)-1);
X+ 		for(armynum=0;armynum<MAXARM;armynum++)
X+ 			if (P_ATYPE==dfltunit && P_ASOLD>0) {
X+ 				disarray=FALSE;
X+ 				break;
X+ 			}
X+ 
X  		if(ispc(curntn->active)) {
X  		prep( country, TRUE );	/* occ[][] now >0 if leader near */
X  		dfltunit = defaultunit(country);
X  		} else dfltunit = A_INFANTRY;
X  
X  		for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD>0) {
X  
X  			A = &curntn->arm[armynum];
X***************
X*** 1102,1108 ****
X  
X  			/*add movement to all armies */
X  			/*unitmove is 10 times movement rate*/
X! 			if(dissarray) A->smove=0;
X  			else switch(A->stat) {
X  			case MARCH:
X  				A->smove=(curntn->maxmove * *(unitmove+(AT%UTYPE)))/5;
X--- 1135,1141 ----
X  
X  			/*add movement to all armies */
X  			/*unitmove is 10 times movement rate*/
X! 			if(disarray) A->smove=0;
X  			else switch(A->stat) {
X  			case MARCH:
X  				A->smove=(curntn->maxmove * *(unitmove+(AT%UTYPE)))/5;
X***************
X*** 1215,1227 ****
X  				curntn->jewels -= (long) (*(unitmaint+(AT%UTYPE)));
X  				else {
X  					if(ispc(curntn->active)) {
X! 					mailopen(country);
X! 					fprintf(fm,"Message to %s from Conquer\n",curntn->name);
X! 					fprintf(fm,"\nYour %s (unit %d) leaves due to lack of jewels\n",
X! 						*(unittype+(AT%UTYPE)),armynum);
X! 					mailclose();
X! 					A->sold=0;
X  					}
X  				}
X  			}
X  		}
X--- 1248,1261 ----
X  				curntn->jewels -= (long) (*(unitmaint+(AT%UTYPE)));
X  				else {
X  					if(ispc(curntn->active)) {
X! 					if(mailopen(country)!=(-1)) {
X! 						fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
X! 						fprintf(fm,"Your %s (unit %d) leaves due to lack of jewels\n",
X! 							   *(unittype+(AT%UTYPE)),armynum);
X! 						mailclose(country);
X! 						A->sold=0;
X  					}
X+ 					}
X  				}
X  			}
X  		}
X***************
X*** 1284,1290 ****
X  				}
X  				}
X  #endif
X! 				if(dissarray) P_NMOVE=0;
X  				else P_NMOVE = (fltspeed(nvynum)*P_NCREW)/SHIPCREW;
X  				if(magic(country,SAILOR)==TRUE) P_NMOVE*=2;
X  
X--- 1318,1324 ----
X  				}
X  				}
X  #endif
X! 				if(disarray) P_NMOVE=0;
X  				else P_NMOVE = (fltspeed(nvynum)*P_NCREW)/SHIPCREW;
X  				if(magic(country,SAILOR)==TRUE) P_NMOVE*=2;
X  
X***************
X*** 1312,1322 ****
X  			curntn->name,siegex[army2],siegey[army2]);
X  #endif HIDELOC
X  		if(ispc(curntn->active)) {
X! 			mailopen( country );
X! 			fprintf(fm, "Message to %s from Conquer\n\n",ntn[nation].name);
X! 			fprintf(fm, "\tYou are under siege in sector %d,%d.\n",
X! 				siegex[army2],siegey[army2]);
X! 			mailclose();
X  		}
X  		for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD>0){
X  			if(P_ASTAT!=FLIGHT&&(P_AXLOC==siegex[army2])
X--- 1346,1357 ----
X  			curntn->name,siegex[army2],siegey[army2]);
X  #endif HIDELOC
X  		if(ispc(curntn->active)) {
X! 			if (mailopen( country )!=(-1)) {
X! 				fprintf(fm, "Message to %s from Conquer\n\n",ntn[nation].name);
X! 				fprintf(fm, "\tYou are under siege in sector %d,%d.\n",
X! 					   siegex[army2],siegey[army2]);
X! 				mailclose(country);
X! 			}
X  		}
X  		for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD>0){
X  			if(P_ASTAT!=FLIGHT&&(P_AXLOC==siegex[army2])
X***************
X*** 1376,1388 ****
X  #endif HIDELOC
X  				printf("famine hits town at %d,%d in %s.\n",x,y,curntn->name);
X  				if(ispc(curntn->active)){
X! 				mailopen( country );
X! 				fprintf(fm,"Message to %s from CONQUER\n%s\n",curntn->name,curntn->name);
X! 				fprintf(fm," During the %s of Year %d,\n",PSEASON(TURN),YEAR(TURN));
X! 				fprintf(fm," a famine hit your town at %d,%d.\n",x,y);
X! 				fprintf(fm," %d out of %d people died.\n",dead,sptr->people);
X! 				mailclose();
X  				}
X  			}
X  		}
X  		/*this state can occur if few people live in cities*/
X--- 1411,1424 ----
X  #endif HIDELOC
X  				printf("famine hits town at %d,%d in %s.\n",x,y,curntn->name);
X  				if(ispc(curntn->active)){
X! 				if (mailopen( country )!=(-1)) {
X! 					fprintf(fm,"Message to %s from CONQUER\n\n",curntn->name);
X! 					fprintf(fm,"During the %s of Year %d,\n",PSEASON(TURN),YEAR(TURN));
X! 					fprintf(fm,"a famine hit your town at %d,%d.\n",x,y);
X! 					fprintf(fm,"%d out of %d people died.\n",dead,sptr->people);
X! 					mailclose(country);
X  				}
X+ 				}
X  			}
X  		}
X  		/*this state can occur if few people live in cities*/
X***************
X*** 1400,1405 ****
X--- 1436,1450 ----
X  		if(curntn->tgold>GOLDTHRESH*curntn->jewels){
X  			/* buy jewels off commodities board */
X  			xx=curntn->tgold-GOLDTHRESH*curntn->jewels;
X+ 			if (ispc(country)) {
X+ 				if (mailopen(country)!=(-1)) {
X+ 					fprintf(fm,"Message from Conquer\n\n");
X+ 					fprintf(fm,"Gold imbalance forced your treasury to purchase");
X+ 					fprintf(fm,"%ld jewels for %ld gold talons to compensate\n",
X+ 						xx*GODJEWL/GODPRICE,xx);
X+ 					mailclose(country);
X+ 				}
X+ 			}
X  			curntn->jewels += (xx*GODJEWL/GODPRICE);
X  			curntn->tgold  -= xx;
X  		}
X***************
X*** 1455,1464 ****
X  				P_ASTAT = DEFEND;
X  				P_AMOVE = 2*curntn->maxmove;
X  				if( ispc( ntn[nation].active ) ){
X! 					mailopen( nation );
X! 					fprintf(fm,"Message to %s from Conquer:\n",ntn[nation].name);
X  					fprintf(fm,"\t\tMonster born in your nation!\n");
X! 					mailclose();
X  				}
X  				printf("\tmonster born in nation %s\n",curntn->name); 
X  				break;
X--- 1500,1510 ----
X  				P_ASTAT = DEFEND;
X  				P_AMOVE = 2*curntn->maxmove;
X  				if( ispc( ntn[nation].active ) ){
X! 					if (mailopen( nation )!=(-1)) {
X! 					fprintf(fm,"Message to %s from Conquer:\n\n",ntn[nation].name);
X  					fprintf(fm,"\t\tMonster born in your nation!\n");
X! 					mailclose(nation);
X! 					}
X  				}
X  				printf("\tmonster born in nation %s\n",curntn->name); 
X  				break;
X***************
X*** 1493,1502 ****
X  			P_ASTAT = DEFEND;
X  			P_AMOVE = 2*curntn->maxmove;
X  			if( ispc( ntn[nation].active ) ){
X! 				mailopen( nation );
X! 				fprintf(fm,"Message to %s from Conquer:\n",ntn[nation].name);
X! 				fprintf(fm,"\t\tLeader born in your nation!\n");
X! 				mailclose();
X  			}
X  			printf("\tleader born in nation %s\n",curntn->name); 
X  			break;
X--- 1539,1549 ----
X  			P_ASTAT = DEFEND;
X  			P_AMOVE = 2*curntn->maxmove;
X  			if( ispc( ntn[nation].active ) ){
X! 				if(mailopen( nation )!=(-1)) {
X! 					fprintf(fm,"Message to %s from Conquer:\n\n",ntn[nation].name);
X! 					fprintf(fm,"\t\tLeader born in your nation!\n");
X! 					mailclose(nation);
X! 				}
X  			}
X  			printf("\tleader born in nation %s\n",curntn->name); 
X  			break;
X*** ocommands.c	Wed Sep 20 21:40:54 1989
X--- commands.c	Wed Sep 20 21:41:32 1989
X***************
X*** 195,201 ****
X  			reset_god();
X  			return;
X  		case 'o':
X! 			mvprintw(LINES-3,7,"what nation owner:");
X  			refresh();
X  			x = get_country();
X  			if (x<NTOTAL) sptr->owner=x;
X--- 195,201 ----
X  			reset_god();
X  			return;
X  		case 'o':
X! 			mvaddstr(LINES-3,7,"What nation owner:");
X  			refresh();
X  			x = get_country();
X  			if (x<NTOTAL) sptr->owner=x;
X***************
X*** 314,324 ****
X  
X  	if((newdes!=DTOWN)&&(newdes!=DFORT)&&(newdes!=DCITY)&&(newdes!=DCAPITOL)){
X  		/*decrement treasury*/
X! 		if((newdes==DRUIN)||(newdes==DDEVASTATED)) {
X! 			DEVASTATE(XREAL,YREAL);
X! 		} else{
X! 			sptr->designation=newdes;
X  		}
X  		SADJDES;
X  		if(newdes == DSTOCKADE)
X  			curntn->tgold-=STOCKCOST*(1-isgod);
X--- 314,330 ----
X  
X  	if((newdes!=DTOWN)&&(newdes!=DFORT)&&(newdes!=DCITY)&&(newdes!=DCAPITOL)){
X  		/*decrement treasury*/
X! 		if(newdes==DRUIN) {
X! 			if (sptr->fortress>4) {
X! 				sptr->fortress-=4;
X! 			} else {
X! 				sptr->fortress=0;
X! 			}
X! 		} else if (sptr->designation==DRUIN) {
X! 			curntn->tgold-=REBUILDCOST;
X  		}
X+ 		sptr->designation=newdes;
X+ 
X  		SADJDES;
X  		if(newdes == DSTOCKADE)
X  			curntn->tgold-=STOCKCOST*(1-isgod);
X***************
X*** 684,690 ****
X  			NADJHLD;
X  			NADJLOC;
X  			NADJMOV;
X! 			mvprintw(LINES-2,65,"HIT ANY KEY");
X  			refresh();
X  			getch();
X  
X--- 690,696 ----
X  			NADJHLD;
X  			NADJLOC;
X  			NADJMOV;
X! 			mvaddstr(LINES-2,65,"HIT ANY KEY");
X  			refresh();
X  			getch();
X  
X***************
X*** 881,887 ****
X  		return;
X  	} else if(i_cost > curntn->metals) {
X  		mvprintw(LINES-1,0,"You don't have %ld metal",i_cost);
X! 		mvprintw(LINES-1,COLS-20,"PRESS ANY KEY");
X  		clrtoeol();
X  		refresh();
X  		getch();
X--- 887,893 ----
X  		return;
X  	} else if(i_cost > curntn->metals) {
X  		mvprintw(LINES-1,0,"You don't have %ld metal",i_cost);
X! 		mvaddstr(LINES-1,COLS-20,"PRESS ANY KEY");
X  		clrtoeol();
X  		refresh();
X  		getch();
X***************
X*** 1033,1039 ****
X  	char line[LINELTH+1], inpch;
X  	char save[LINELTH][LINELTH+1];
X  
X! 	/*open file*/
X  	sprintf(tempfile,"%s%hd.tmp",msgfile,country);
X  	if( (fptemp = fopen(tempfile,"w")) == NULL ) {
X  		clear_bottom(0);
X--- 1039,1045 ----
X  	char line[LINELTH+1], inpch;
X  	char save[LINELTH][LINELTH+1];
X  
X! 	/*open file; used in mailopen() as well */
X  	sprintf(tempfile,"%s%hd.tmp",msgfile,country);
X  	if( (fptemp = fopen(tempfile,"w")) == NULL ) {
X  		clear_bottom(0);
X***************
X*** 1046,1065 ****
X  
X  	sprintf(mesgfile,"%s%d",msgfile,country);
X  	if ((mesgfp=fopen(mesgfile,"r"))==NULL) {
X! 	        (void) unlink (tempfile) ;
X  		clear_bottom(0);
X! 		errormsg("no messages");
X  		makebottom();
X  		redraw=DONE;
X  		return;
X  	}
X  
X  	/*read in file a line at at time*/
X  	if(fgets(line,LINELTH,mesgfp)==NULL) {
X  		done=TRUE;
X  		redraw=DONE;
X  		clear_bottom(0);
X! 		errormsg("no messages");
X  		makebottom();
X  	}
X  	if (done==FALSE) clear();
X--- 1052,1083 ----
X  
X  	sprintf(mesgfile,"%s%d",msgfile,country);
X  	if ((mesgfp=fopen(mesgfile,"r"))==NULL) {
X! 		(void) unlink (tempfile) ;
X  		clear_bottom(0);
X! 		errormsg("No Messages");
X  		makebottom();
X  		redraw=DONE;
X  		return;
X  	}
X  
X+ 	/* check for people sending mail */
X+ 	sprintf(line,"send.%s%hd",msgfile,country);
X+ 	if (access(line,00)==0) {
X+ 		/* someone is sending mail to the country */
X+ 		(void) unlink (tempfile) ;
X+ 		clear_bottom(0);
X+ 		errormsg("Someone is sending you mail... please wait.");
X+ 		makebottom();
X+ 		redraw=DONE;
X+ 		return;
X+ 	}
X+ 
X  	/*read in file a line at at time*/
X  	if(fgets(line,LINELTH,mesgfp)==NULL) {
X  		done=TRUE;
X  		redraw=DONE;
X  		clear_bottom(0);
X! 		errormsg("No messages");
X  		makebottom();
X  	}
X  	if (done==FALSE) clear();
X***************
X*** 1120,1137 ****
X  	char ch;
X  	char name[NAMELTH+1];
X  	int temp=(-1);
X! 	int linedone;
X  	char line[BIGLTH];
X  
X  	/*what nation to send to*/
X  	clear();
X! 	mvprintw(0,0,"to send a message to the administrator, send to 'god';");
X! 	mvprintw(1,0,"to post to the news, send to 'news':");
X! 	mvprintw(2,0,"Enter the name of the country to send to:");
X  	refresh();
X  	temp=get_country();
X  
X! 	if( temp == (-2) ) {
X  		strcpy(name,"news");
X  	} else {
X  		/* quick return on bad input */
X--- 1138,1155 ----
X  	char ch;
X  	char name[NAMELTH+1];
X  	int temp=(-1);
X! 	int linedone,dotitles=TRUE;
X  	char line[BIGLTH];
X  
X  	/*what nation to send to*/
X  	clear();
X! 	mvaddstr(0,0,"To send a message to the administrator, send to 'god';");
X! 	mvaddstr(1,0,"To post to the news, send to 'news':");
X! 	mvaddstr(2,0,"Enter the name of the country to send to: ");
X  	refresh();
X  	temp=get_country();
X  
X! 	if( temp == NEWSMAIL ) {
X  		strcpy(name,"news");
X  	} else {
X  		/* quick return on bad input */
X***************
X*** 1141,1179 ****
X  		strcpy(name,ntn[temp].name);	/* find nation name */
X  	}
X  
X! 	mailopen( temp );
X  
X- 	move(0,0);
X- 	clrtoeol();
X- 	move(1,0);
X- 	clrtoeol();
X- 	move(2,0);
X- 	clrtoeol();
X- 	standout();
X- 	if(temp != -2)
X- 		mvprintw(3,(COLS-25)/2,"message to nation %s",name);
X- 	else
X- 		mvprintw(3,(COLS-25)/2,"message to all players");
X- 	mvprintw(LINES-2,(COLS-35)/2,"end with a return on a new line");
X- 	standend();
X  
X- 
X  	if(temp != -2) {
X  		if (country==0)
X! 		fprintf(fm,"Message to %s from GOD (%s of year %d)\n",name,PSEASON(TURN),YEAR(TURN));
X! 		else	fprintf(fm,"Message to %s from %s (%s of year %d)\n",name,curntn->name,PSEASON(TURN),YEAR(TURN));
X  	} else fprintf(fm,"5.----------\n");
X  
X- 	y=6;
X- 	x=0;
X- 	refresh();
X  	while(done==FALSE) {
X  		linedone=FALSE;
X  		ch=' ';
X  		/*read line*/
X  		while(linedone==FALSE){
X  			/* check for delete or backspace */
X! 			if(ch=='\b' || ch=='\177'){
X  				if(x>1) x--;
X  				mvaddch(y,x,' ');
X  				move(y,x);
X--- 1159,1203 ----
X  		strcpy(name,ntn[temp].name);	/* find nation name */
X  	}
X  
X! 	if(mailopen( temp )==(-1)) {
X! 		return;
X! 	}
X  
X  
X  	if(temp != -2) {
X  		if (country==0)
X! 		fprintf(fm,"Message to %s from GOD (%s of year %d)\n\n",name,PSEASON(TURN),YEAR(TURN));
X! 		else	fprintf(fm,"Message to %s from %s (%s of year %d)\n\n",name,curntn->name,PSEASON(TURN),YEAR(TURN));
X  	} else fprintf(fm,"5.----------\n");
X+ 	strcpy(line,"");
X  
X  	while(done==FALSE) {
X+ 		if (dotitles==TRUE) {
X+ 			move(0,0);
X+ 			clrtobot();
X+ 			standout();
X+ 			if(temp != -2)
X+ 				mvprintw(3,(COLS-25)/2,"Message to Nation %s",name);
X+ 			else
X+ 				mvaddstr(3,(COLS-25)/2,"Message to All Players");
X+ 			mvaddstr(LINES-2,(COLS-37)/2,"End with a <Control-D> on a New Line");
X+ 			mvaddstr(LINES-1,(COLS-28)/2,"Hit ESC to Abort the Message");
X+ 			standend();
X+ 			mvaddstr(5,0,line);
X+ 			y=6;
X+ 			x=0;
X+ 			refresh();
X+ 			dotitles=FALSE;
X+ 		}
X  		linedone=FALSE;
X  		ch=' ';
X  		/*read line*/
X  		while(linedone==FALSE){
X  			/* check for delete or backspace */
X! 			switch(ch) {
X! 			case '\b':
X! 			case '\177':
X! 				/* backspace or delete */
X  				if(x>1) x--;
X  				mvaddch(y,x,' ');
X  				move(y,x);
X***************
X*** 1180,1199 ****
X  				line[x]=' ';
X  				refresh();
X  				ch=getch();
X! 			} else if((ch=='\n')||(ch=='\r')) linedone=TRUE;
X! 			else if(isprint(ch)&&(x<65)){
X! 				/*concatonate to end*/
X! 				line[x]=ch;
X! 				mvaddch(y,x,ch);
X! 				x++;
X  				refresh();
X! 				ch=getch();
X! 			} else if (ch=='') {
X  				wrefresh(stdscr);
X  				ch=getch();
X! 			} else	ch=getch();
X  		}
X! 		if((ch!='\n')&&(ch!='\r')) {
X  			mvaddch(y,x,ch);
X  			line[x]=ch;
X  			x++;
X--- 1204,1267 ----
X  				line[x]=' ';
X  				refresh();
X  				ch=getch();
X! 				break;
X! 			case '\n':
X! 			case '\r':
X! 				/* newline or carriage return */
X! 				linedone=TRUE;
X! 				break;
X! 			case '\004':
X! 				/* a control-d was hit */
X! 				if (x==1) {
X! 					linedone=TRUE;
X! 					done=TRUE;
X! 				} else {
X! 					standout();
X! 					mvaddstr(LINES-3,(COLS-37)/2,"Hit [RETURN] Control-D to End Message");
X! 					standend();
X! 					move(y,x);
X! 					refresh();
X! 					ch = getch();
X! 					move(LINES-3,0);
X! 					clrtoeol();
X! 					refresh();
X! 				}
X! 				break;
X! 			case '\033':
X! 				/* escape key was hit */
X! 				mvaddstr(LINES-3,0,"Abort Message? ");
X  				refresh();
X! 				if(getch()=='y') {
X! 					linedone=TRUE;
X! 					done=TRUE;
X! 					temp=ABORTMAIL;
X! 				} else {
X! 					move(LINES-3,0);
X! 					clrtoeol();
X! 					move(y,x);
X! 					refresh();
X! 					ch = getch();
X! 				}
X! 				break;
X! 			case '':
X! 				/* new page -- end of form */
X  				wrefresh(stdscr);
X  				ch=getch();
X! 				break;
X! 			default:
X! 				/* any remaining possibilities */
X! 				if(isprint(ch)&&(x<65)){
X! 					/*concatonate to end*/
X! 					line[x]=ch;
X! 					mvaddch(y,x,ch);
X! 					x++;
X! 					refresh();
X! 				}
X! 				ch=getch();
X! 				break;
X! 			}
X  		}
X! 		if((ch!='\n')&&(ch!='\r')&&(ch!='\033')) {
X  			mvaddch(y,x,ch);
X  			line[x]=ch;
X  			x++;
X***************
X*** 1200,1220 ****
X  		}
X  		line[x]='\0';
X  
X  		/*write to file*/
X! 		if(x<=1) done=TRUE;
X! 		else if (temp != -2) fprintf(fm,"%s\n",line);
X! 		else {
X! 			if (country!=0) fprintf(fm,"5.%-9s:%s\n",curntn->name,line);
X! 			else fprintf(fm,"5.God      :%s\n",line);
X  		}
X- 		x=0;
X- 		y++;
X  	}
X! 	if (temp != -2) mailclose();
X! 	else {
X! 		mailok=FALSE;
X! 		fclose(fm);
X! 	}
X  }
X  
X  /*strategic move of civilians...once only*/
X--- 1268,1296 ----
X  		}
X  		line[x]='\0';
X  
X+ 		/*check for single period */
X+ 		if (strcmp(line," .")==0) done=TRUE;
X+ 
X  		/*write to file*/
X! 		if (done==FALSE) {
X! 			if (temp != -2) fprintf(fm,"%s\n",line);
X! 			else {
X! 				if (country!=0) fprintf(fm,"5.%-9s:%s\n",curntn->name,line);
X! 				else fprintf(fm,"5.God      :%s\n",line);
X! 			}
X! 			x=0;
X! 			y++;
X! 			if (y==LINES-3) {
X! 				standout();
X! 				mvaddstr(LINES-3,0,"Continuing...");
X! 				standend();
X! 				refresh();
X! 				sleep(2);
X! 				dotitles=TRUE;
X! 			}
X  		}
X  	}
X! 	mailclose(temp);
X  }
X  
X  /*strategic move of civilians...once only*/
X***************
X*** 1225,1231 ****
X  	short	i,j;
X  
X  	clear_bottom(0);
X! 	if(sct[XREAL][YREAL].owner!=country){
X  		errormsg("Sorry, you don't own that sector.");
X  		return;
X  	}
X--- 1301,1312 ----
X  	short	i,j;
X  
X  	clear_bottom(0);
X! #ifdef OGOD
X! 	if(sct[XREAL][YREAL].owner!=country && country!=0)
X! #else
X! 	if(sct[XREAL][YREAL].owner!=country)
X! #endif
X! 	{
X  		errormsg("Sorry, you don't own that sector.");
X  		return;
X  	}
X***************
X*** 1274,1280 ****
X  	}
X  	if((j-(YREAL)>2)||((YREAL)-j>2)) {
X  		errormsg("Sorry, your people refuse to move more than two sectors.");
X! 	} else if(sct[i][j].owner!=country){
X  		errormsg("Sorry, you don't own that sector.");
X  	} else if(movecost[i][j]<0){
X  		/*need to check move cost > 0 for sector*/
X--- 1355,1367 ----
X  	}
X  	if((j-(YREAL)>2)||((YREAL)-j>2)) {
X  		errormsg("Sorry, your people refuse to move more than two sectors.");
X! 	}
X! #ifdef OGOD
X! 	else if(sct[i][j].owner!=country && country!=0)
X! #else
X! 	else if(sct[i][j].owner!=country)
X! #endif /*OGOD*/
X! 	{
X  		errormsg("Sorry, you don't own that sector.");
X  	} else if(movecost[i][j]<0){
X  		/*need to check move cost > 0 for sector*/
X*** oio.c	Wed Sep 20 21:40:55 1989
X--- io.c	Wed Sep 20 21:41:32 1989
X***************
X*** 387,407 ****
X  void
X  centermap()
X  {
X!   int xx,yy;
X!   xx=XREAL;
X!   yy=YREAL;
X!   xoffset = xx - (SCREEN_X_SIZE/2);
X!   yoffset = yy - (SCREEN_Y_SIZE/2);
X!   if (xoffset<0)
X!       xoffset=0;
X!   if (yoffset<0)
X!       yoffset=0;
X!   xcurs= xx-xoffset;
X!   ycurs= yy-yoffset;
X!   whatcansee();
X  }
X  
X  /************************************************************************/
X  /*	PRINTSCORE()	- like it says					*/
X  /************************************************************************/
X  void
X--- 387,485 ----
X  void
X  centermap()
X  {
X! 	int xx,yy;
X! 	xx=XREAL;
X! 	yy=YREAL;
X! 	xoffset = xx - (SCREEN_X_SIZE/2);
X! 	yoffset = yy - (SCREEN_Y_SIZE/2);
X! 	if (xoffset<0)
X! 		xoffset=0;
X! 	if (yoffset<0)
X! 		yoffset=0;
X! 	xcurs= xx-xoffset;
X! 	ycurs= yy-yoffset;
X! 	whatcansee();
X  }
X  
X  /************************************************************************/
X+ /*   JUMP_TO()      - move screen position to a specific location       */
X+ /*                    home indicates just go to capitol sector.         */
X+ /************************************************************************/
X+ void
X+ jump_to(home)
X+ 	int home;
X+ {
X+ 	int i,j,done;
X+ 	static int next_ntn;
X+ 
X+ 	/* find location to jump to */
X+ 	if (home) {
X+ 		if (country==0) {
X+ 			/* check if in sequence */
X+ 			if ((XREAL!=ntn[next_ntn].capx)
X+ 			||(YREAL!=ntn[next_ntn].capy)) {
X+ 				next_ntn= 0;
X+ 			}
X+ 			/* find next capitol */
X+ 			done = FALSE;
X+ 			do {
X+ 				next_ntn++;
X+ 				if (next_ntn==NTOTAL) {
X+ 					j = 0;
X+ 					for(i=0;i<NTOTAL;i++)
X+ 					if (isntn(ntn[i].active)) {
X+ 						j = i;
X+ 						i = NTOTAL;
X+ 					}
X+ 					next_ntn = j;
X+ 					done = TRUE;
X+ 				} else {
X+ 					if (isntn(ntn[next_ntn].active)) {
X+ 						done = TRUE;
X+ 					}
X+ 				}
X+ 			} while (done==FALSE);
X+ 			/* default location; or next capitol */
X+ 			if (next_ntn==0) {
X+ 				i = MAPX/2-1;
X+ 				j = MAPY/2-1;
X+ 			} else {
X+ 				i = ntn[next_ntn].capx;
X+ 				j = ntn[next_ntn].capy;
X+ 			}
X+ 		} else {
X+ 			/* go to capitol */
X+ 			i = curntn->capx;
X+ 			j = curntn->capy;
X+ 		}
X+ 	} else {
X+ 		/* entered location */
X+ 		clear_bottom(0);
X+ 		mvaddstr(LINES-3,0,"Jump to what X location? ");
X+ 		refresh();
X+ 		i = get_number();
X+ 		if (i==(-1)) return;
X+ 		if (i>=MAPX) {
X+ 			errormsg("That location is out of this world!");
X+ 			return;
X+ 		}
X+ 		mvaddstr(LINES-2,0,"Jump to what Y location? ");
X+ 		refresh();
X+ 		j = get_number();
X+ 		if (j==(-1)) return;
X+ 		if (j>=MAPY) {
X+ 			errormsg("That location is out of this world!");
X+ 			return;
X+ 		}
X+ 	}
X+ 	/* now center location about given position */
X+ 	xcurs = i;
X+ 	ycurs = j;
X+ 	xoffset = yoffset = 0;
X+ 	centermap();
X+ }
X+ 
X+ /************************************************************************/
X  /*	PRINTSCORE()	- like it says					*/
X  /************************************************************************/
X  void
X***************
X*** 470,477 ****
X  	int svcountry=country;
X  	int slaves=0;
X  	int i,j;
X! 	country=sct[x][y].owner;
X  
X  	if(slaver==TRUE){
X  		slaves= sct[x][y].people/4;
X  		sct[x][y].people-=slaves;
X--- 548,556 ----
X  	int svcountry=country;
X  	int slaves=0;
X  	int i,j;
X! 	int people_to_add;
X  
X+ 	country=sct[x][y].owner;
X  	if(slaver==TRUE){
X  		slaves= sct[x][y].people/4;
X  		sct[x][y].people-=slaves;
X***************
X*** 499,506 ****
X  	for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++)
X  		if(ONMAP(i,j)
X  		&&(ntn[sct[i][j].owner].race==ntn[sct[x][y].owner].race)) {
X! 			sct[i][j].people += sct[x][y].people / count;
X! 			if(isupd==0) SADJCIV2;
X  		}
X  	} else {
X  		sct[x][y].people /= 2;
X--- 578,587 ----
X  	for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++)
X  		if(ONMAP(i,j)
X  		&&(ntn[sct[i][j].owner].race==ntn[sct[x][y].owner].race)) {
X! 			people_to_add = sct[x][y].people / count;
X! 			/* don't show until next turn if player move */
X! 			if(isupd==0) SADJCIV3;
X! 			else	sct[x][y].people += people_to_add;
X  		}
X  	} else {
X  		sct[x][y].people /= 2;
X*** onewhelp.c	Wed Sep 20 21:40:57 1989
X--- newhelp.c	Wed Sep 20 21:41:32 1989
X***************
X*** 46,51 ****
X--- 46,52 ----
X  	fprintf(fp,"s/XBREAKJIHAD/%ld/g\n",BREAKJIHAD);
X  	fprintf(fp,"s/XCONQENV/%s/g\n",ENVIRON_OPTS);
X  	fprintf(fp,"s/XNCITYCOST/%d/g\n",N_CITYCOST);
X+ 	fprintf(fp,"s/XREBUILDCOST/%d/g\n",REBUILDCOST);
X  
X  	/* check all the defined options */
X  #ifdef OGOD
X*** odata.c	Wed Sep 20 21:40:54 1989
X--- data.c	Wed Sep 20 21:41:32 1989
X***************
X*** 247,253 ****
X  struct sprd_sht spread;
X  
X  FILE	*fm;
X! int	mailok=FALSE;
X  
X  #ifdef CONQUER
X  #ifdef SYSMAIL
X--- 247,253 ----
X  struct sprd_sht spread;
X  
X  FILE	*fm;
X! int	mailok=DONEMAIL;
X  
X  #ifdef CONQUER
X  #ifdef SYSMAIL
X*** omagic.c	Wed Sep 20 21:40:55 1989
X--- magic.c	Wed Sep 20 21:41:33 1989
X***************
X*** 197,205 ****
X  		if (get_god()) return;
X  	}
X  
X  	while(done==FALSE){
X  		done=TRUE;
X! 		clear();
X  		county=3;
X  		countx=0;
X  		redraw=FULL;
X--- 197,207 ----
X  		if (get_god()) return;
X  	}
X  
X+ 	clear();
X  	while(done==FALSE){
X  		done=TRUE;
X! 		move(0,0);
X! 		clrtobot();
X  		county=3;
X  		countx=0;
X  		redraw=FULL;
X***************
X*** 242,248 ****
X  			mvaddstr(county++,0,"DO YOU WISH TO CHANGE THIS NATION'S POWERS? [yn]");
X  			standend();
X  			refresh();
X! 			if (getch()=='y') god_magk(FALSE);
X  		} else
X  #endif OGOD
X  		if(price <= curntn->jewels){
X--- 244,250 ----
X  			mvaddstr(county++,0,"DO YOU WISH TO CHANGE THIS NATION'S POWERS? [yn]");
X  			standend();
X  			refresh();
X! 			if (getch()=='y') god_magk();
X  		} else
X  #endif OGOD
X  		if(price <= curntn->jewels){
X***************
X*** 252,258 ****
X  		refresh();
X  		if(getch()=='y'){
X  			done=FALSE;
X! 			mvprintw(county++,0,"ENTER SELECTION (1,2,3):");
X  			refresh();
X  			type = getch() - '0';
X  			if(type==M_MIL || type==M_CIV || type==M_MGK){
X--- 254,260 ----
X  		refresh();
X  		if(getch()=='y'){
X  			done=FALSE;
X! 			mvaddstr(county++,0,"ENTER SELECTION (1,2,3):");
X  			refresh();
X  			type = getch() - '0';
X  			if(type==M_MIL || type==M_CIV || type==M_MGK){
X***************
X*** 821,828 ****
X  	int county,countx,choice;
X  	int remove,i,done=FALSE;
X  
X  	while (done==FALSE) {
X- 		clear();
X  		county=3;
X  		countx=0;
X  		standout();
X--- 823,830 ----
X  	int county,countx,choice;
X  	int remove,i,done=FALSE;
X  
X+ 	clear();
X  	while (done==FALSE) {
X  		county=3;
X  		countx=0;
X  		standout();
X***************
X*** 845,851 ****
X  			}
X  		}
X  		move(0,0);
X! 		clrtoeol();
X  		if (remove)
X  		mvprintw(0,(COLS/2)-15,"CURRENT POWERS FOR %s",curntn->name);
X  		else
X--- 847,853 ----
X  			}
X  		}
X  		move(0,0);
X! 		clrtobot();
X  		if (remove)
X  		mvprintw(0,(COLS/2)-15,"CURRENT POWERS FOR %s",curntn->name);
X  		else
X*** onewlogin.c	Wed Sep 20 21:40:57 1989
X--- newlogin.c	Wed Sep 20 21:41:33 1989
X***************
X*** 113,119 ****
X  		if((i!=x)&&(j!=y)&&(ONMAP(i,j))
X  		&&(sct[i][j].altitude!=WATER)) {
X  			if (rand()%2==0)
X! 			sct[x][y].altitude = CLEAR;
X  
X  			if (rand()%2==0)
X  				sct[i][j].vegetation=WOOD;
X--- 113,119 ----
X  		if((i!=x)&&(j!=y)&&(ONMAP(i,j))
X  		&&(sct[i][j].altitude!=WATER)) {
X  			if (rand()%2==0)
X! 			sct[i][j].altitude = CLEAR;
X  
X  			if (rand()%2==0)
X  				sct[i][j].vegetation=WOOD;
X***************
X*** 136,144 ****
X  	int	ctry;
X  	for( ctry=0; ctry<NTOTAL; ctry++){
X  		if((ctry==0)||(ispc(ntn[ctry].active))){
X! 			mailopen(ctry);
X! 			fprintf(fm,"%s",string);
X! 			mailclose();
X  		}
X  	}
X  }
X--- 136,146 ----
X  	int	ctry;
X  	for( ctry=0; ctry<NTOTAL; ctry++){
X  		if((ctry==0)||(ispc(ntn[ctry].active))){
X! 			if (mailopen(ctry)!=(-1)) {
X! 				fprintf(fm,"Message from Conquer\n\n");
X! 				fprintf(fm,"%s\n",string);
X! 				mailclose(ctry);
X! 			}
X  		}
X  	}
X  }
X***************
X*** 394,400 ****
X  		/*get name*/
X  		while(valid==FALSE) {
X  			valid=TRUE;
X! 			mvprintw(1,0,"Enter a Name for your Country: ");
X  			clrtoeol();
X  			refresh();
X  			get_nname(tempc);
X--- 396,402 ----
X  		/*get name*/
X  		while(valid==FALSE) {
X  			valid=TRUE;
X! 			mvaddstr(1,0,"Enter a Name for your Country: ");
X  			clrtoeol();
X  			refresh();
X  			get_nname(tempc);
X***************
X*** 431,437 ****
X  
X  		valid=FALSE;
X  		while(valid==FALSE) {			/* password routine */
X! 			mvprintw(2,0,"Enter National Password: ");
X  			clrtoeol();
X  			refresh();
X  			i = get_pass(tempc);
X--- 433,439 ----
X  
X  		valid=FALSE;
X  		while(valid==FALSE) {			/* password routine */
X! 			mvaddstr(2,0,"Enter National Password: ");
X  			clrtoeol();
X  			refresh();
X  			i = get_pass(tempc);
X***************
X*** 442,448 ****
X  				newerror("Password Too Long");
X  				continue;
X  			}
X! 			mvprintw(2,0,"Reenter National Password: ");
X  			clrtoeol();
X  			refresh();
X  			i = get_pass(passwd);
X--- 444,450 ----
X  				newerror("Password Too Long");
X  				continue;
X  			}
X! 			mvaddstr(2,0,"Reenter National Password: ");
X  			clrtoeol();
X  			refresh();
X  			i = get_pass(passwd);
X***************
X*** 457,463 ****
X  		valid=FALSE;
X  		while(valid==FALSE) {
X  			valid=TRUE;
X! 			mvprintw(2,0,"Enter the name of your country's leader (Ex. The Ed, Gandalf, Conan)");
X  			clrtoeol();
X  			mvprintw(3,0,"    [maximum %d characters]: ",LEADERLTH);
X  			refresh();
X--- 459,465 ----
X  		valid=FALSE;
X  		while(valid==FALSE) {
X  			valid=TRUE;
X! 			mvaddstr(2,0,"Enter the name of your country's leader (Ex. The Ed, Gandalf, Conan)");
X  			clrtoeol();
X  			mvprintw(3,0,"    [maximum %d characters]: ",LEADERLTH);
X  			refresh();
X***************
X*** 471,477 ****
X  
X  		mvprintw(2,0,"Leader Name: %s", curntn->leader);
X  		clrtoeol();
X! 		mvprintw(3,0,"Enter your Race [ (D)warf (E)lf (H)uman (O)rc ]:");
X  		clrtoeol();
X  		refresh();
X  		valid=FALSE;
X--- 473,479 ----
X  
X  		mvprintw(2,0,"Leader Name: %s", curntn->leader);
X  		clrtoeol();
X! 		mvaddstr(3,0,"Enter your Race [ (D)warf (E)lf (H)uman (O)rc ]:");
X  		clrtoeol();
X  		refresh();
X  		valid=FALSE;
X***************
X*** 482,488 ****
X  			case 'd':
X  				/*MINER POWER INATE TO DWARVES*/
X  				newmsg("Dwarves have MINING skills");
X! 				mvprintw(3,0,"National Race: Dwarf");
X  				clrtoeol();
X  				curntn->powers=MINER;
X  				x=MINER;
X--- 484,490 ----
X  			case 'd':
X  				/*MINER POWER INATE TO DWARVES*/
X  				newmsg("Dwarves have MINING skills");
X! 				mvaddstr(3,0,"National Race: Dwarf");
X  				clrtoeol();
X  				curntn->powers=MINER;
X  				x=MINER;
X***************
X*** 503,509 ****
X  			case 'E':
X  			case 'e':
X  				newmsg("Elves are magically cloaked (VOID power)");
X! 				mvprintw(3,0,"National Race: Elf");
X  				clrtoeol();
X  				curntn->powers=THE_VOID;
X  				x=THE_VOID;
X--- 505,511 ----
X  			case 'E':
X  			case 'e':
X  				newmsg("Elves are magically cloaked (VOID power)");
X! 				mvaddstr(3,0,"National Race: Elf");
X  				clrtoeol();
X  				curntn->powers=THE_VOID;
X  				x=THE_VOID;
X***************
X*** 525,531 ****
X  			case 'o':
X  				/*MINOR MONSTER POWER INATE TO ORCS*/
X  				newmsg("Your leader is a Monster!");
X! 				mvprintw(3,0,"National Race: Orc");
X  				clrtoeol();
X  				curntn->powers=MI_MONST;
X  				x=MI_MONST;
X--- 527,533 ----
X  			case 'o':
X  				/*MINOR MONSTER POWER INATE TO ORCS*/
X  				newmsg("Your leader is a Monster!");
X! 				mvaddstr(3,0,"National Race: Orc");
X  				clrtoeol();
X  				curntn->powers=MI_MONST;
X  				x=MI_MONST;
X***************
X*** 547,553 ****
X  			case 'h':
X  				curntn->race=HUMAN;
X  				newmsg("Humans have the combat skill of a WARRIOR");
X! 				mvprintw(3,0,"National Race: Human");
X  				clrtoeol();
X  				curntn->powers = WARRIOR;
X  				x=WARRIOR;
X--- 549,555 ----
X  			case 'h':
X  				curntn->race=HUMAN;
X  				newmsg("Humans have the combat skill of a WARRIOR");
X! 				mvaddstr(3,0,"National Race: Human");
X  				clrtoeol();
X  				curntn->powers = WARRIOR;
X  				x=WARRIOR;
X***************
X*** 576,582 ****
X  			valid=TRUE;
X  			curntn->active=PC_EVIL;
X  		} else {
X! 			mvprintw(5,0,"Please Enter Alignment [ (G)ood, (N)eutral, (E)vil ]");
X  			refresh();
X  		}
X  		while (valid==FALSE) {
X--- 578,584 ----
X  			valid=TRUE;
X  			curntn->active=PC_EVIL;
X  		} else {
X! 			mvaddstr(5,0,"Please Enter Alignment [ (G)ood, (N)eutral, (E)vil ]");
X  			refresh();
X  		}
X  		while (valid==FALSE) {
X***************
X*** 607,613 ****
X  		curntn->mark = ' ';
X  		while(TRUE) {
X  			temp = 30;
X! 			mvprintw(6,0,"This can be any of the following:");
X  			for (tempc[0]='!';tempc[0]<='~';tempc[0]++) {
X  				if( markok( tempc[0], FALSE ) ) {
X  					temp += 2;
X--- 609,615 ----
X  		curntn->mark = ' ';
X  		while(TRUE) {
X  			temp = 30;
X! 			mvaddstr(6,0,"This can be any of the following:");
X  			for (tempc[0]='!';tempc[0]<='~';tempc[0]++) {
X  				if( markok( tempc[0], FALSE ) ) {
X  					temp += 2;
X***************
X*** 618,624 ****
X  					printw(" %c",tempc[0]);
X  				}
X  			}
X! 			mvprintw(5,0,"Enter National Mark (for maps): ");
X  			clrtoeol();
X  			refresh();
X  			tempc[0] = getch();
X--- 620,626 ----
X  					printw(" %c",tempc[0]);
X  				}
X  			}
X! 			mvaddstr(5,0,"Enter National Mark (for maps): ");
X  			clrtoeol();
X  			refresh();
X  			tempc[0] = getch();
X***************
X*** 651,657 ****
X  				if (curntn->race==ORC) {			
X  					switch(i) {
X  					case CH_MOVEMENT:
X! 						mvprintw(ypos++,COLS/2+5,"  -     --------");
X  						continue;
X  					case CH_REPRO:
X  						x = 2*Munits[i]*Mvalues[i];
X--- 653,659 ----
X  				if (curntn->race==ORC) {			
X  					switch(i) {
SHAR_EOF
echo "End of part 3, continue with part 4"
echo "4" > s2_seq_.tmp
exit 0