[comp.sources.games.bugs] A minor Conquer bugfix

straney@msudoc.ee.mich-state.edu (Ronald W. DeBry) (02/06/88)

I tried to post this once before, but it disappeared from our machine.
If this is a duplicate, I apologize.

I didn't so much mind having all my goldmines turned into farms; or
even my iron mines.  It was a minor inconvenience, even if the 
Newspaper did say that it only happened in one sector. I even
liked getting scads of new gold and iron deposits (I just figured I
had hired one hell of a good geologist)  

  	        BUT WHEN IT BURNED DOWN ALL MY CITIES,
	   
well, I got a tad upset; hence this, my first attempt at fixing someone
else's program.  If the patch works, and it does here, you now only have the
event happen in one sector.  There might be a more elegant way to break
out of the loops (i.e., without a goto) but that seemed the simplest.  
It also now checks to be sure that any deposits that run out were 
actually being mined at the time, which not only ensures that 
the change has at least some negative impact on the recipient,
it also prevents the embarassment of having your Capitol turned 
into a farm.  A more creative way to do it would be to 
throw in a temporary variable to store the position and value of the 
mine with the largest deposit, or city with the largest population, and
then trash that one.  I also threw in one piddly typo correction
in the bargain.

The game is a blast, someday I might even let someone else play. (Well,
it does have to be thoroughly play tested first, right?)

One play testing note:  I've run into a rebellion of some sort every
game, and its been completely devastating each time. The rebels 
end up with virtually all my cities, usually meaning that they completely
surround my capitol with well-fortified, well-garrisoned cities.
So, I've changed my copy to tone down schisms to 30%, and I might
even go lower.  An occasional bummer is one thing, but to practically
take a player out of the game is another. (either that or you have to
explain to new players that, no, it is actually a bad idea to surround
your capitol with strong cities)


Ron DeBry  Dept. of Zoology, Michigan State University 

______________Cut Here_____________________
*** randevent.c.ol	Tue Feb  2 22:52:46 1988
--- randevent.c	Wed Feb  3 02:30:20 1988
***************
*** 23,29
  /* 12 */  "tornado",
  /* 13 */  "volcano erupts -- all flee and 30% die",
  /* 14 */  "royal wedding (absorb neighbor nation)",
! /* 15 */  "new alloy gives new fighter power)",
  /* 16 */  "royal advisor discovered to be spy -- lose power",
  /* 17 */  "gold strike one sector ",
  /* 18 */  "gold strike one sector ",

--- 23,29 -----
  /* 12 */  "tornado",
  /* 13 */  "volcano erupts -- all flee and 30% die",
  /* 14 */  "royal wedding (absorb neighbor nation)",
! /* 15 */  "new alloy gives new fighter power",
  /* 16 */  "royal advisor discovered to be spy -- lose power",
  /* 17 */  "gold strike one sector ",
  /* 18 */  "gold strike one sector ",
***************
*** 287,293
  		/*gold strike one sector +4-10 gold*/
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  			if(( sct[i][j].owner == country)
! 			&& (sct[i][j].gold != 0))
  				sct[i][j].gold += rand()%7 + 4;
  		break;
  	case 19:

--- 287,293 -----
  		/*gold strike one sector +4-10 gold*/
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  			if(( sct[i][j].owner == country)
! 			&& (sct[i][j].gold != 0)){
  				sct[i][j].gold += rand()%7 + 4;
  				goto Stop;
  			}
***************
*** 289,294
  			if(( sct[i][j].owner == country)
  			&& (sct[i][j].gold != 0))
  				sct[i][j].gold += rand()%7 + 4;
  		break;
  	case 19:
  	case 20:

--- 289,296 -----
  			if(( sct[i][j].owner == country)
  			&& (sct[i][j].gold != 0)){
  				sct[i][j].gold += rand()%7 + 4;
+ 				goto Stop;
+ 			}
  		break;
  	case 19:
  	case 20:
***************
*** 295,301
  		/*gold vein runs out one sector >5 gold =0*/
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  			if(( sct[i][j].owner == country)
! 			&& (sct[i][j].gold >= 5)){
  				sct[i][j].gold =0;
  				sct[i][j].designation = DFARM;
  			}

--- 297,304 -----
  		/*gold vein runs out one sector >5 gold =0*/
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  			if(( sct[i][j].owner == country)
! 			&& (sct[i][j].gold >= 5)
! 			&& (sct[i][j].designation == DGOLDMINE)){
  				sct[i][j].gold =0;
  				sct[i][j].designation = DFARM;
  				goto Stop;
***************
*** 298,303
  			&& (sct[i][j].gold >= 5)){
  				sct[i][j].gold =0;
  				sct[i][j].designation = DFARM;
  			}
  		break;
  	case 21:

--- 301,307 -----
  			&& (sct[i][j].designation == DGOLDMINE)){
  				sct[i][j].gold =0;
  				sct[i][j].designation = DFARM;
+ 				goto Stop;
  			}
  		break;
  	case 21:
***************
*** 342,347
  			&& ( sct[i][j].designation == DCITY)){
  				sct[i][j].designation = DFARM;
  				sct[i][j].people *= .5;
  			}
  		break;
  	case 27:

--- 346,352 -----
  			&& ( sct[i][j].designation == DCITY)){
  				sct[i][j].designation = DFARM;
  				sct[i][j].people *= .5;
+ 				goto Stop;
  			}
  		break;
  	case 27:
***************
*** 370,376
  		/* ores run out */
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  		if(( sct[i][j].owner == country)
! 			&& (sct[i][j].iron >= 5)){
  				sct[i][j].iron =0;
  				sct[i][j].designation = DFARM;
  		}

--- 375,382 -----
  		/* ores run out */
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  		if(( sct[i][j].owner == country)
! 			&& (sct[i][j].iron >= 5)
! 			&& (sct[i][j].designation == DMINE)){
  				sct[i][j].iron =0;
  				sct[i][j].designation = DFARM;
  				goto Stop;
***************
*** 373,378
  			&& (sct[i][j].iron >= 5)){
  				sct[i][j].iron =0;
  				sct[i][j].designation = DFARM;
  		}
  	case 33:
  		/*new architect strengthens castle walls */

--- 379,385 -----
  			&& (sct[i][j].designation == DMINE)){
  				sct[i][j].iron =0;
  				sct[i][j].designation = DFARM;
+ 				goto Stop;
  		}
  	case 33:
  		/*new architect strengthens castle walls */
***************
*** 386,392
  		/*new ores discovered + 4-10 iron*/
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  			if(( sct[i][j].owner == country)
! 			&& (sct[i][j].iron != 0))
  				sct[i][j].iron += rand()%7 + 4;
  		break;
  	case 35:

--- 393,399 -----
  		/*new ores discovered + 4-10 iron*/
  		for (i=0; i<MAPX; i++) for (j=0; j<MAPY; j++)
  			if(( sct[i][j].owner == country)
! 			&& (sct[i][j].iron != 0)){
  				sct[i][j].iron += rand()%7 + 4;
  				goto Stop;
  			}
***************
*** 388,393
  			if(( sct[i][j].owner == country)
  			&& (sct[i][j].iron != 0))
  				sct[i][j].iron += rand()%7 + 4;
  		break;
  	case 35:
  		/*new leader sets up peace*/

--- 395,402 -----
  			if(( sct[i][j].owner == country)
  			&& (sct[i][j].iron != 0)){
  				sct[i][j].iron += rand()%7 + 4;
+ 				goto Stop;
+ 			}
  		break;
  	case 35:
  		/*new leader sets up peace*/
***************
*** 420,426
  		printf("error condition -- illegal random event\n");
  		break;
  	}
! 	if(done==1) fprintf(fnews,"1. \tevent in %s - %s\n"
  		,ntn[country].name,randevents[event]);
  	if(done==1) printf("\t%s -- %s\n"
  		,ntn[country].name,randevents[event]);

--- 429,435 -----
  		printf("error condition -- illegal random event\n");
  		break;
  	}
! Stop:	if(done==1) fprintf(fnews,"1. \tevent in %s - %s\n"
  		,ntn[country].name,randevents[event]);
  	if(done==1) printf("\t%s -- %s\n"
  		,ntn[country].name,randevents[event]);