smile@homxc.UUCP (E.BARLOW) (07/28/88)
Enclosed are conquer v3 patches 4 and 5. lots of minor changes. To make these work right you are going to need to create the file patchlevel.h (if it does not exist right now). this file should be one line and read: #define PATCHLEVEL 3 After that just apply the patches as you normally would. The patchlevel stuff was distributed by the moderator of comp.source.games already. I seem to have messed up in the mailing list. If you do not get personal Email from me, you are not on the mailing list (about 6 people are getting bounced). Please send me a new email address and I can put you on. The Ed. --------------------cut here--------------- *** omakeworld.c Thu Jul 28 09:09:48 1988 --- makeworld.c Thu Jul 28 09:10:58 1988 *************** *** 746,752 ntn[NNOMAD].arm[army2num].yloc=y; ntn[NNOMAD].arm[army2num].stat=ATTACK; ntn[NNOMAD].arm[army2num].sold=100+100*(rand()%15); ! ntn[NNOMAD].arm[army2num].unittyp=A_CAVALRY; if(army2num<MAXARM-1) army2num++; } } --- 746,752 ----- ntn[NNOMAD].arm[army2num].yloc=y; ntn[NNOMAD].arm[army2num].stat=ATTACK; ntn[NNOMAD].arm[army2num].sold=100+100*(rand()%15); ! ntn[NNOMAD].arm[army2num].unittyp=A_LT_CAV; if(army2num<MAXARM-1) army2num++; } } *** orandevent.c Thu Jul 28 09:09:50 1988 --- randevent.c Thu Jul 28 09:10:58 1988 *************** *** 5,10 #include "data.h" #ifdef RANEVENT #ifdef ADMIN extern FILE *fnews; extern short country; --- 5,14 ----- #include "data.h" #ifdef RANEVENT #ifdef ADMIN + char *names[] = { /* must end in single character name */ + "groo","brok","vul","poin","srop","hoga","nobi","bonz","gail", + "lynn","zorb","theed","urda","X" + }; extern FILE *fnews; extern short country; *************** *** 77,82 return(newntn); } /* disolve a certain percent of a nation */ /*returns value of new nation */ int --- 81,106 ----- return(newntn); } + char + getnewmark() + { + char tmpchr; + int done=TRUE,i; + tmpchr='A'-1; + while (done) { + tmpchr++; + done=FALSE; + for (i=0;i<MAXNTN;i++) + if (ntn[i].mark==tmpchr && ntn[i].active>0) + done=TRUE; + if (!done && !isupper(tmpchr)) + done=TRUE; + if (tmpchr=='Z') + done=FALSE; + } + return(tmpchr); + } + /* disolve a certain percent of a nation */ /*returns value of new nation */ int *************** *** 88,95 int split; /* number of sectors split */ int defaultx=(-1), defaulty=(-1), realx=(-1), realy=(-1), dist; int i,j,armynum,narmynum,posi,posj; - int notdone=1; - char tmpchr; split = ntn[target].tsctrs * percent / 100; if (split==0) { --- 112,117 ----- int split; /* number of sectors split */ int defaultx=(-1), defaulty=(-1), realx=(-1), realy=(-1), dist; int i,j,armynum,narmynum,posi,posj; split = ntn[target].tsctrs * percent / 100; if (split==0) { *************** *** 127,139 return(0); } ! strcpy(ntn[new].name,"r-"); ! strncat(ntn[new].name,ntn[target].name,min(NAMELTH-2,strlen(ntn[target].name))); ! for (armynum=0;armynum<MAXNAVY;armynum++) ! if(strcmp(ntn[armynum].name, ntn[new].name)==0) { ! strcpy(eventstr,"no nations available"); ! return(0); ! } #ifdef HIDELOC sprintf(eventstr,"new nation created"); #else --- 149,156 ----- return(0); } ! if(getnewname(new) == 0) return(0); ! #ifdef HIDELOC sprintf(eventstr,"new nation created"); #else *************** *** 163,168 ntn[new].dplus= ntn[target].dplus; ntn[new].location= ntn[target].location; ntn[new].powers= ntn[target].powers; /* make the rebellion's mark some unused uppercase letter */ tmpchr='A'-1; while (notdone) { --- 180,188 ----- ntn[new].dplus= ntn[target].dplus; ntn[new].location= ntn[target].location; ntn[new].powers= ntn[target].powers; + ntn[new].tships= 0; + ntn[new].tsctrs = split; + /* make the rebellion's mark some unused uppercase letter */ ntn[new].mark = getnewmark(); *************** *** 164,182 ntn[new].location= ntn[target].location; ntn[new].powers= ntn[target].powers; /* make the rebellion's mark some unused uppercase letter */ ! tmpchr='A'-1; ! while (notdone) { ! tmpchr++; ! notdone=0; ! for (i=0;i<MAXNTN;i++) ! if (ntn[i].mark==tmpchr && ntn[i].active>0) ! notdone=1; ! if (!notdone && !isalpha(tmpchr)) ! notdone=1; ! if (tmpchr=='Z') ! notdone=0; ! } ! ntn[new].mark= tmpchr; for ( dist=2 ; dist < 10; dist++) if (split > 0) for (i=defaultx-dist; i<defaultx+dist; i++) for (j=defaulty-dist; j<defaulty+dist; j++){ --- 184,191 ----- ntn[new].tsctrs = split; /* make the rebellion's mark some unused uppercase letter */ ! ntn[new].mark = getnewmark(); ! for ( dist=2 ; dist < 10; dist++) if (split > 0) for (i=defaultx-dist; i<defaultx+dist; i++) for (j=defaulty-dist; j<defaulty+dist; j++){ *************** *** 246,251 return(new); } int randomevent() { --- 255,280 ----- return(new); } + getnewname(new) + int new; + { + int done,count,i=0; + + while( strlen(*(names+i)) > 1 ){ + done = TRUE; + for (count=0;count<NTOTAL;count++) + if(strcmp(ntn[count].name, *(names+i))==0) + done = FALSE; + if(done==TRUE) break; + i++; + } + + strcpy(ntn[new].name,*(names+i)); + if(done ==TRUE) return(1); + strcpy(eventstr,"no nations available"); + return(0); + } + int randomevent() { *************** *** 319,324 if(ASOLD == 0) { ASOLD = sct[i][j].people/4; ASTAT = A_MILITIA; sct[i][j].people -= ASOLD; break; } --- 348,355 ----- if(ASOLD == 0) { ASOLD = sct[i][j].people/4; ASTAT = A_MILITIA; + AXLOC = i; + AYLOC = j; sct[i][j].people -= ASOLD; break; } *************** *** 388,394 break; case 14: /*royal wedding (absorb neighbor nation)*/ ! /* takeover ( 100, 0 ); */ done=FALSE; /* something not right.... */ break; case 15: --- 419,425 ----- break; case 14: /*royal wedding (absorb neighbor nation)*/ ! /* takeover ( 100, 0 ); */ /* something not right.... */ done=FALSE; break; *************** *** 390,395 /*royal wedding (absorb neighbor nation)*/ /* takeover ( 100, 0 ); */ done=FALSE; /* something not right.... */ break; case 15: /*new alloy +10% combat (WARRIOR...)*/ --- 421,427 ----- /*royal wedding (absorb neighbor nation)*/ /* takeover ( 100, 0 ); */ /* something not right.... */ + done=FALSE; break; case 15: /*new alloy +10% combat (WARRIOR...)*/ *************** *** 405,410 ntn[country].powers|=WARLORD; exenewmgk(WARLORD); } break; case 16: /*royal advisor is spy -- lose power*/ --- 437,445 ----- ntn[country].powers|=WARLORD; exenewmgk(WARLORD); } + else { /* have all three powers... oh well */ + done=FALSE; + } break; case 16: /*royal advisor is spy -- lose power*/ *************** *** 501,507 ntn[NNOMAD].arm[armynum].sold =400+20*(rand()%50); else /* 200-600 */ ntn[NNOMAD].arm[armynum].sold =200+20*(rand()%20); ! ntn[NNOMAD].arm[armynum].unittyp = A_CAVALRY; ntn[NNOMAD].arm[armynum].stat =ATTACK; done++; } --- 536,542 ----- ntn[NNOMAD].arm[armynum].sold =400+20*(rand()%50); else /* 200-600 */ ntn[NNOMAD].arm[armynum].sold =200+20*(rand()%20); ! ntn[NNOMAD].arm[armynum].unittyp = A_LT_CAV; ntn[NNOMAD].arm[armynum].stat =ATTACK; done++; } *************** *** 543,550 case 30: /*new magician + RANDOM POWER*/ /*buy new powers and/or new weapons*/ if((newpower=getmagic(M_CIV))!=0L){ ! printf("\tnation %s gets magic power number %ld\n",ntn[country].name,newpower); ! fprintf(fnews,"1. \tevent in %s->gets magic power number %ld\n", ntn[country].name,newpower); exenewmgk(newpower); } else done=FALSE; --- 578,587 ----- case 30: /*new magician + RANDOM POWER*/ /*buy new powers and/or new weapons*/ if((newpower=getmagic(M_CIV))!=0L){ ! for(i=S_CIV;i<=E_CIV;i++) if(powers[i]==newpower){ ! printf("\tnation %s gets power %s\n",ntn[country].name,pwrname[newpower]); ! fprintf(fnews,"1. \tevent in %s->gets power %s\n", ntn[country].name,pwrname[newpower]); ! } exenewmgk(newpower); } else done=FALSE; *************** *** 552,559 case 31: /*new magic item + RANDOM POWER*/ /*buy new powers and/or new weapons*/ if((newpower=getmagic(M_MIL))!=0){ ! printf("\tnation %s gets magic power number %ld\n",ntn[country].name,newpower); ! fprintf(fnews,"1. \tevent in %s->gets magic power number %ld\n", ntn[country].name,newpower); exenewmgk(newpower); } else done=FALSE; --- 589,598 ----- case 31: /*new magic item + RANDOM POWER*/ /*buy new powers and/or new weapons*/ if((newpower=getmagic(M_MIL))!=0){ ! for(i=S_MIL;i<=E_MIL;i++) if(powers[i]==newpower){ ! printf("\tnation %s gets power %s\n",ntn[country].name,pwrname[newpower]); ! fprintf(fnews,"1. \tevent in %s->gets power %s\n", ntn[country].name,pwrname[newpower]); ! } exenewmgk(newpower); } else done=FALSE; *** oforms.c Thu Jul 28 09:10:25 1988 --- forms.c Thu Jul 28 09:10:58 1988 *************** *** 257,262 short armynum; char passwd[8]; short isgod=FALSE; if(country==0) { isgod=TRUE; --- 257,266 ----- short armynum; char passwd[8]; short isgod=FALSE; + #ifdef OGOD + FILE *ftmp; + char filename[80]; + #endif OGOD if(country==0) { isgod=TRUE; *************** *** 305,311 else mvaddstr(21,(COLS/2)-17,"( VAMPIRES MAY NOT ADD TO COMBAT BONUS )"); #ifdef OGOD ! if(isgod==TRUE) mvaddstr(22,(COLS/2)-21,"HIT 4 TO DESTROY NATION OR 5 TO CHANGE TREASURY"); #else OGOD if(isgod==TRUE) mvaddstr(22,(COLS/2)-9,"HIT 4 TO DESTROY NATION"); #endif OGOD --- 309,315 ----- else mvaddstr(21,(COLS/2)-17,"( VAMPIRES MAY NOT ADD TO COMBAT BONUS )"); #ifdef OGOD ! if(isgod==TRUE) mvaddstr(22,(COLS/2)-23,"HIT 4 TO DESTROY NATION OR 5 TO CHANGE COMMODITY"); #else OGOD if(isgod==TRUE) mvaddstr(22,(COLS/2)-9,"HIT 4 TO DESTROY NATION"); #endif OGOD *************** *** 456,463 #ifdef OGOD case '5': if (isgod==TRUE) { ! /* adjust treasury */ ! mvaddstr(0,0,"WHAT IS NEW TOTAL OF TREASURY?"); refresh(); i = get_number(); /* as god it will be saved nothing else needed */ --- 460,475 ----- #ifdef OGOD case '5': if (isgod==TRUE) { ! /* open the target country's files */ ! sprintf(filename,"%s%d",exefile,country); ! if ((ftmp=fopen(filename,"a"))==NULL) { ! beep(); ! errormsg("error opening country's file"); ! return; ! } ! /* adjust commodities */ ! mvaddstr(0,0,"CHANGE: 1) Gold 2) Jewels 3) Iron 4) Food ?"); ! clrtoeol(); refresh(); switch(getch()) { case '1': *************** *** 459,467 /* adjust treasury */ mvaddstr(0,0,"WHAT IS NEW TOTAL OF TREASURY?"); refresh(); ! i = get_number(); ! /* as god it will be saved nothing else needed */ ! ntn[country].tgold = (long) i; } break; #endif OGOD --- 471,504 ----- mvaddstr(0,0,"CHANGE: 1) Gold 2) Jewels 3) Iron 4) Food ?"); clrtoeol(); refresh(); ! switch(getch()) { ! case '1': ! mvaddstr(1,0,"WHAT IS NEW VALUE FOR TREASURY? "); ! refresh(); ! ntn[country].tgold = (long) get_number(); ! fprintf(ftmp,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNAGOLD ,country,ntn[country].tgold,"null"); ! break; ! case '2': ! mvaddstr(1,0,"WHAT IS NEW AMOUNT OF JEWELS? "); ! refresh(); ! ntn[country].jewels = (long) get_number(); ! fprintf(ftmp,"L_NJWLS\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNARGOLD ,country,ntn[country].jewels,"null"); ! break; ! case '3': ! mvaddstr(1,0,"WHAT IS NEW AMOUNT OF IRON? "); ! refresh(); ! ntn[country].tiron = (long) get_number(); ! fprintf(ftmp,"L_NIRON\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNAIRON ,country,ntn[country].tiron,"null"); ! break; ! case '4': ! mvaddstr(1,0,"WHAT IS NEW AMOUNT OF FOOD? "); ! refresh(); ! ntn[country].tfood = (long) get_number(); ! break; ! default: ! break; ! } ! fclose(ftmp); } break; #endif OGOD *** oreports.c Thu Jul 28 09:10:26 1988 --- reports.c Thu Jul 28 09:11:00 1988 *************** *** 281,287 void produce() { ! short armynum; int military=0; int isgod=FALSE; --- 281,287 ----- void produce() { ! short armynum,multiplier=1; int military=0; int isgod=FALSE; *************** *** 308,314 mvaddstr(8,0, "FOOD PRODUCTION"); mvprintw(9,0, "granary now holds.........%8ld tons",ntn[country].tfood); mvprintw(10,0, "%8d people in farms..%8ld tons",spread.infarm,spread.food-ntn[country].tfood); ! mvprintw(12,0, "%8d civilians eat....%8d tons",spread.civilians,spread.civilians); mvprintw(13,0, "%8d soldiers eat....%8d tons",military,military*2); mvprintw(15,0, "TOTAL NET FOOD............%8d tons",spread.food-ntn[country].tfood-spread.civilians-military*2); if(spread.food-spread.civilians-military*2<FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100){ --- 308,315 ----- mvaddstr(8,0, "FOOD PRODUCTION"); mvprintw(9,0, "granary now holds.........%8ld tons",ntn[country].tfood); mvprintw(10,0, "%8d people in farms..%8ld tons",spread.infarm,spread.food-ntn[country].tfood); ! if(magic(country,DEMOCRACY)==1) multiplier=2; ! mvprintw(12,0, "%8d civilians eat....%8d tons",spread.civilians,multiplier*spread.civilians); mvprintw(13,0, "%8d soldiers eat....%8d tons",military,military*2); mvprintw(15,0, "TOTAL NET FOOD............%8d tons",spread.food-ntn[country].tfood-multiplier*spread.civilians-military*2); if(spread.food-multiplier*spread.civilians-military*2<FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100){ *************** *** 310,318 mvprintw(10,0, "%8d people in farms..%8ld tons",spread.infarm,spread.food-ntn[country].tfood); mvprintw(12,0, "%8d civilians eat....%8d tons",spread.civilians,spread.civilians); mvprintw(13,0, "%8d soldiers eat....%8d tons",military,military*2); ! mvprintw(15,0, "TOTAL NET FOOD............%8d tons",spread.food-ntn[country].tfood-spread.civilians-military*2); ! if(spread.food-spread.civilians-military*2<FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100){ ! mvprintw(16,0, "TOTAL NEXT YEARS FOOD.....%8ld tons",spread.food-spread.civilians-military*2); } else{ mvprintw(16,0, "TOTAL NEXT YEARS FOOD.....%8ld tons",FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100); --- 311,319 ----- if(magic(country,DEMOCRACY)==1) multiplier=2; mvprintw(12,0, "%8d civilians eat....%8d tons",spread.civilians,multiplier*spread.civilians); mvprintw(13,0, "%8d soldiers eat....%8d tons",military,military*2); ! mvprintw(15,0, "TOTAL NET FOOD............%8d tons",spread.food-ntn[country].tfood-multiplier*spread.civilians-military*2); ! if(spread.food-multiplier*spread.civilians-military*2<FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100){ ! mvprintw(16,0, "TOTAL NEXT YEARS FOOD.....%8ld tons",spread.food-multiplier*spread.civilians-military*2); } else{ mvprintw(16,0, "TOTAL NEXT YEARS FOOD.....%8ld tons",FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100); *************** *** 316,322 } else{ mvprintw(16,0, "TOTAL NEXT YEARS FOOD.....%8ld tons",FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100); ! mvprintw(17,0, "REVENUE FROM EXCESS.......%8ld gold",spread.food-spread.civilians-military*2-FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100); } mvaddstr(8,41, "OTHER PRODUCTION"); --- 317,323 ----- } else{ mvprintw(16,0, "TOTAL NEXT YEARS FOOD.....%8ld tons",FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100); ! mvprintw(17,0, "REVENUE FROM EXCESS.......%8ld gold",spread.food-multiplier*spread.civilians-military*2-FOODTHRESH*(100+ntn[country].repro)*spread.civilians/100); } mvaddstr(8,41, "OTHER PRODUCTION"); *************** *** 346,352 short navy; short oldx,oldy,oldnavy; short done=FALSE; ! int position; int count; /*screen number */ short nvynum=0; /*current ship id */ short wships,mships; --- 347,354 ----- short navy; short oldx,oldy,oldnavy; short done=FALSE; ! int i,j; ! int position,crew; int count; /*screen number */ short nvynum=0; /*current ship id */ short wships,mships; *************** *** 472,477 else if((oldx==NXLOC)&&(oldy==NYLOC)) { NWAR+=ntn[country].nvy[oldnavy].warships; NMER+=ntn[country].nvy[oldnavy].merchant; NADJSHP; if(NMOVE>ntn[country].nvy[oldnavy].smove) NMOVE=ntn[country].nvy[oldnavy].smove; --- 474,480 ----- else if((oldx==NXLOC)&&(oldy==NYLOC)) { NWAR+=ntn[country].nvy[oldnavy].warships; NMER+=ntn[country].nvy[oldnavy].merchant; + NCREW += ntn[country].nvy[oldnavy].crew; NADJSHP; NADJCRW; if(NMOVE>ntn[country].nvy[oldnavy].smove) *************** *** 473,478 NWAR+=ntn[country].nvy[oldnavy].warships; NMER+=ntn[country].nvy[oldnavy].merchant; NADJSHP; if(NMOVE>ntn[country].nvy[oldnavy].smove) NMOVE=ntn[country].nvy[oldnavy].smove; NADJMOV; --- 476,482 ----- NMER+=ntn[country].nvy[oldnavy].merchant; NCREW += ntn[country].nvy[oldnavy].crew; NADJSHP; + NADJCRW; if(NMOVE>ntn[country].nvy[oldnavy].smove) NMOVE=ntn[country].nvy[oldnavy].smove; NADJMOV; *************** *** 479,484 nvynum=oldnavy; NWAR=0; NMER=0; NADJSHP; } else { --- 483,489 ----- nvynum=oldnavy; NWAR=0; NMER=0; + NCREW=0; NADJSHP; NADJCRW; } *************** *** 480,485 NWAR=0; NMER=0; NADJSHP; } else { mvaddstr(23,0,"Navies not together (hit any key) "); --- 485,491 ----- NMER=0; NCREW=0; NADJSHP; + NADJCRW; } else { mvaddstr(23,0,"Navies not together (hit any key) "); *************** *** 501,506 if((wships<=NWAR)&&(mships<=NMER)){ NWAR-=wships; NMER-=mships; NADJSHP; oldnavy=nvynum; oldx=NXLOC; --- 507,515 ----- if((wships<=NWAR)&&(mships<=NMER)){ NWAR-=wships; NMER-=mships; + crew = NCREW * (wships+mships) / (NWAR+NMER); + NCREW -= crew; + NADJCRW; NADJSHP; oldnavy=nvynum; oldx=NXLOC; *************** *** 517,522 NWAR+=wships; NMER+=mships; NADJSHP; } else { NMOVE=ntn[country].nvy[oldnavy].smove; --- 526,533 ----- NWAR+=wships; NMER+=mships; NADJSHP; + NCREW+=crew; + NADJCRW; } else { NMOVE=ntn[country].nvy[oldnavy].smove; *************** *** 524,529 NYLOC=oldy; NWAR=wships; NMER=mships; NADJSHP; NADJLOC; NADJMOV; --- 535,542 ----- NYLOC=oldy; NWAR=wships; NMER=mships; + NCREW=crew; + NADJCRW; NADJSHP; NADJLOC; NADJMOV; *************** *** 536,541 } break; case '3': NWAR=0; NMER=0; NADJSHP; --- 549,561 ----- } break; case '3': + /* DISBAND NAVY */ + i=NXLOC; + j=NYLOC; + if(sct[i][j].altitude == WATER) { + errormsg("Ships need to be on land or in harbor"); + break; + } NWAR=0; NMER=0; sct[i][j].people+=NCREW; *************** *** 538,543 case '3': NWAR=0; NMER=0; NADJSHP; break; case '4': --- 558,567 ----- } NWAR=0; NMER=0; + sct[i][j].people+=NCREW; + NCREW=0; + SADJCIV2; + NADJCRW; NADJSHP; break; case '4': *** ocombat.c Thu Jul 28 09:10:27 1988 --- combat.c Thu Jul 28 09:11:01 1988 *************** *** 348,354 retreatside = 0; if((PDloss > 2* PAloss) - &&(PDloss>=50) &&(odds>150) &&(rand()%4==0)) retreatside=DFND; --- 348,353 ----- retreatside = 0; if((PDloss > 2* PAloss) &&(odds>150) &&(((PDloss>=50)&&(rand()%4==0)) ||(rand()%8))) retreatside=DFND; *************** *** 350,356 if((PDloss > 2* PAloss) &&(PDloss>=50) &&(odds>150) ! &&(rand()%4==0)) retreatside=DFND; if((PAloss > 2* PDloss) &&(PAloss>=50) --- 349,356 ----- if((PDloss > 2* PAloss) &&(odds>150) ! &&(((PDloss>=50)&&(rand()%4==0)) ! ||(rand()%8))) retreatside=DFND; if((PAloss > 2* PDloss) &&(odds<150) *************** *** 353,359 &&(rand()%4==0)) retreatside=DFND; if((PAloss > 2* PDloss) - &&(PAloss>=50) &&(odds<150) &&(rand()%2==0)) retreatside=ATKR; --- 353,358 ----- ||(rand()%8))) retreatside=DFND; if((PAloss > 2* PDloss) &&(odds<150) &&(((PAloss>=50)&&(rand()%2==0)) ||(rand()%6))) retreatside=ATKR; *************** *** 355,361 if((PAloss > 2* PDloss) &&(PAloss>=50) &&(odds<150) ! &&(rand()%2==0)) retreatside=ATKR; if(retreatside!=0) { fdxyretreat(); --- 354,361 ----- if((PAloss > 2* PDloss) &&(odds<150) ! &&(((PAloss>=50)&&(rand()%2==0)) ! ||(rand()%6))) retreatside=ATKR; if(retreatside!=0) { fdxyretreat(); *************** *** 697,704 /*no bonus currently included in this combat*/ /*calculate ability of crew*/ ! acrew = 100*acrew/aship*SHIPCREW; ! dcrew = 100*dcrew/dship*SHIPCREW; /*each warship can do damage 40%; once all warships sunk then all*/ /*sunk are captured merchant*/ --- 697,704 ----- /*no bonus currently included in this combat*/ /*calculate ability of crew*/ ! acrew = 100*acrew/(aship*SHIPCREW); ! dcrew = 100*dcrew/(dship*SHIPCREW); /*each warship can do damage 40%; once all warships sunk then all*/ /*sunk are captured merchant*/ *** omove.c Thu Jul 28 09:10:07 1988 --- move.c Thu Jul 28 09:11:03 1988 *************** *** 108,114 armornvy=AORN; return; } ! else if(AMOVE==0){ errormsg("SORRY: ARMY HAS NO MOVEMENT POINTS"); armornvy=AORN; return; --- 108,114 ----- armornvy=AORN; return; } ! else if((AMOVE==0)&&(ATYPE!=A_MARINES)){ errormsg("SORRY: ARMY HAS NO MOVEMENT POINTS"); armornvy=AORN; return; *************** *** 290,295 valid=FALSE; xcurs=oldxcurs; ycurs=oldycurs; } } else { move(3,0); --- 290,297 ----- valid=FALSE; xcurs=oldxcurs; ycurs=oldycurs; + move(ycurs,xcurs*2); + refresh(); } } else { move(3,0); *** oupdate.c Thu Jul 28 09:10:28 1988 --- update.c Thu Jul 28 09:11:05 1988 *************** *** 360,365 #ifdef CMOVE printf("\tthe computer will move for %s\n",ntn[country].name); fprintf(fnews,"1.\tthe computer will move for %s\n",ntn[country].name); nationrun(); #endif } --- 360,368 ----- #ifdef CMOVE printf("\tthe computer will move for %s\n",ntn[country].name); fprintf(fnews,"1.\tthe computer will move for %s\n",ntn[country].name); + #ifdef TRADE + checktrade(); + #endif TRADE nationrun(); #endif } *************** *** 363,368 nationrun(); #endif } #ifdef NPC /* run npc nations */ if(ntn[country].active>=2) { --- 366,374 ----- nationrun(); #endif } + #ifdef TRADE + else checktrade(); + #endif TRADE #ifdef NPC /* run npc nations */ if(ntn[country].active>=2) { *************** *** 672,677 for(nvynum=0;nvynum<MAXNAVY;nvynum++) { /*update sea sectors*/ if( NMER + NWAR > 0 ) { if(sct[NXLOC][NYLOC].altitude==WATER) { #ifdef STORMS /* --- 678,684 ----- for(nvynum=0;nvynum<MAXNAVY;nvynum++) { /*update sea sectors*/ if( NMER + NWAR > 0 ) { + int holdval; if(sct[NXLOC][NYLOC].altitude==WATER) { #ifdef STORMS /* *************** *** 694,701 } #endif } ! NMOVE = 3 * ntn[country].maxmove * NCREW; ! NMOVE /= ((NWAR+NMER)*SHIPCREW); ntn[country].tships += NWAR + NMER; ntn[country].tgold -= (NWAR + NMER) * SHIPMAINT; } else { --- 701,709 ----- } #endif } ! holdval = 3 * ntn[country].maxmove * NCREW; ! holdval /= ((NWAR+NMER)*SHIPCREW); ! NMOVE = (short)holdval; ntn[country].tships += NWAR + NMER; ntn[country].tgold -= (NWAR + NMER) * SHIPMAINT; } else { *************** *** 722,727 ntn[country].tfood-=ntn[country].tmil*2; /*civilians eat 1*/ ntn[country].tfood-=ntn[country].tciv; /*starve people*/ if(ntn[country].tfood<0) for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) { --- 730,738 ----- ntn[country].tfood-=ntn[country].tmil*2; /*civilians eat 1*/ ntn[country].tfood-=ntn[country].tciv; + if(magic(country,DEMOCRACY)==TRUE) { /* eat 2x as much */ + ntn[country].tfood-=ntn[country].tciv; + } /*starve people*/ if(ntn[country].tfood<0) for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) { *** ocommands.c Thu Jul 28 09:10:29 1988 --- commands.c Thu Jul 28 09:11:06 1988 *************** *** 205,210 if(isgod==TRUE) country=0; return; } if((isgod==FALSE) && (ntn[country].tgold < 0 )) { errormsg("You are broke"); --- 205,214 ----- if(isgod==TRUE) country=0; return; } + if((isgod==FALSE)&&(sct[XREAL][YREAL].people<=500)) { + errormsg("You need over 500 people to construct"); + return; + } if((isgod==FALSE) && (ntn[country].tgold < 0 )) { errormsg("You are broke"); *************** *** 271,277 clrtoeol(); refresh(); mnumber = get_number(); ! cost = (long) mnumber*WARSHPCOST*NWAR + (long) mnumber*MERSHPCOST*NMER; if( ntn[country].tgold < cost ) { errormsg("NOT ENOUGH GOLD"); if(isgod==TRUE) country=0; --- 275,282 ----- clrtoeol(); refresh(); mnumber = get_number(); ! cost = (long) WARSHPCOST*NWAR + (long) MERSHPCOST*NMER; ! cost *= mnumber / SHIPCREW; if( ntn[country].tgold < cost ) { errormsg("NOT ENOUGH GOLD"); if(isgod==TRUE) country=0; *************** *** 308,313 x=nvynum; NWAR=0; NMER=0; NADJSHP; } nvynum++; --- 313,319 ----- x=nvynum; NWAR=0; NMER=0; + NCREW=0; NADJSHP; } nvynum++; *************** *** 321,327 } else mvprintw(LINES-2,30,"raising new fleet %d",nvynum); ! mvprintw(LINES-3,0,"how many merchants:"); refresh(); mnumber = get_number(); --- 327,334 ----- } else mvprintw(LINES-2,30,"raising new fleet %d",nvynum); ! move(LINES-3,0); ! clrtoeol(); mvprintw(LINES-3,0,"how many merchants:"); refresh(); mnumber = get_number(); *************** *** 355,362 if((nvynum>=0)&&(nvynum<MAXNAVY)) { clear_bottom(0); NCREW += (wnumber+mnumber) * SHIPCREW; - mvprintw(LINES-4,0,"constructing %hd warships and %hd merchants (crew now %d)",wnumber,mnumber,NCREW); - sct[XREAL][YREAL].people -= (wnumber+mnumber)*SHIPCREW; ntn[country].tgold -= cost; --- 362,367 ----- if((nvynum>=0)&&(nvynum<MAXNAVY)) { clear_bottom(0); NCREW += (wnumber+mnumber) * SHIPCREW; sct[XREAL][YREAL].people -= (wnumber+mnumber)*SHIPCREW; ntn[country].tgold -= cost; *************** *** 366,371 NWAR+=wnumber; NMER+=mnumber; NMOVE=0; SADJCIV; NADJCRW; NADJSHP; --- 371,378 ----- NWAR+=wnumber; NMER+=mnumber; NMOVE=0; + mvprintw(LINES-4,0,"fleet %d: warships=%hd (total %hd) merchants=%hd (total %hd) (crew=%d)",nvynum,wnumber,NWAR,mnumber,NMER,NCREW); + SADJCIV; NADJCRW; NADJSHP; *************** *** 381,387 } /* construct fortification points*/ else if(type=='f'){ - if(sct[XREAL][YREAL].people>=500) /* can only go into debt as much as the nation has jewels */ if ((ntn[country].tgold - cost) > ((-1)*10*ntn[country].jewels)) { mvprintw(LINES-3,25,"you build +%d%% fort points for %ld gold",armbonus,cost); --- 388,393 ----- } /* construct fortification points*/ else if(type=='f'){ /* can only go into debt as much as the nation has jewels */ if ((ntn[country].tgold - cost) > ((-1)*10*ntn[country].jewels)) { mvprintw(LINES-3,25,"you build +%d%% fort points for %ld gold",armbonus,cost); *************** *** 389,396 sct[XREAL][YREAL].fortress++; INCFORT; errormsg(""); ! } ! else errormsg("need 500 people or you are broke"); } else errormsg("invalid input error"); --- 395,401 ----- sct[XREAL][YREAL].fortress++; INCFORT; errormsg(""); ! } else errormsg("you are broke"); } else errormsg("invalid input error"); *** oio.c Thu Jul 28 09:10:30 1988 --- io.c Thu Jul 28 09:11:06 1988 *************** *** 203,209 int i; int nationid; /*current nation id */ ! printf("id race class score gold military people sectors name\n"); for (nationid=1; nationid<MAXNTN; nationid++) { if(ntn[nationid].active==0) continue; --- 203,209 ----- int i; int nationid; /*current nation id */ ! printf("id name race class score gold military civilians sectors\n"); for (nationid=1; nationid<MAXNTN; nationid++) { if(ntn[nationid].active==0) continue; printf("%2d ",nationid); *************** *** 205,211 printf("id race class score gold military people sectors name\n"); for (nationid=1; nationid<MAXNTN; nationid++) { - if(ntn[nationid].active==0) continue; printf("%d",nationid); for(i=1;i<8;i++) --- 205,210 ----- printf("id name race class score gold military civilians sectors\n"); for (nationid=1; nationid<MAXNTN; nationid++) { if(ntn[nationid].active==0) continue; printf("%2d ",nationid); printf("%9s ",ntn[nationid].name); *************** *** 207,213 for (nationid=1; nationid<MAXNTN; nationid++) { if(ntn[nationid].active==0) continue; ! printf("%d",nationid); for(i=1;i<8;i++) if(ntn[nationid].race==*(races+i)[0]) printf(" %s",*(races+i)); --- 206,213 ----- printf("id name race class score gold military civilians sectors\n"); for (nationid=1; nationid<MAXNTN; nationid++) { if(ntn[nationid].active==0) continue; ! printf("%2d ",nationid); ! printf("%9s ",ntn[nationid].name); for(i=1;i<8;i++) if(ntn[nationid].race==*(races+i)[0]) printf("%6s ",*(races+i)); *************** *** 210,219 printf("%d",nationid); for(i=1;i<8;i++) if(ntn[nationid].race==*(races+i)[0]) ! printf(" %s",*(races+i)); ! if(ntn[nationid].active>=2) printf(" NPC"); ! else printf(" %s",*(Class+ntn[nationid].class)); ! printf(" %ld %ld %ld %ld %d", ntn[nationid].score ,ntn[nationid].tgold ,ntn[nationid].tmil ,ntn[nationid].tciv ,ntn[nationid].tsctrs ); --- 210,219 ----- printf("%9s ",ntn[nationid].name); for(i=1;i<8;i++) if(ntn[nationid].race==*(races+i)[0]) ! printf("%6s ",*(races+i)); ! if(ntn[nationid].active>=2) printf(" NPC "); ! else printf("%8s ",*(Class+ntn[nationid].class)); ! printf("%6ld %8ld %8ld %8ld %5d\n", ntn[nationid].score ,ntn[nationid].tgold ,ntn[nationid].tmil ,ntn[nationid].tciv ,ntn[nationid].tsctrs ); *************** *** 217,223 ntn[nationid].score ,ntn[nationid].tgold ,ntn[nationid].tmil ,ntn[nationid].tciv ,ntn[nationid].tsctrs ); - printf(" %s\n",ntn[nationid].name); } } #endif CONQUER --- 217,222 ----- ntn[nationid].score ,ntn[nationid].tgold ,ntn[nationid].tmil ,ntn[nationid].tciv ,ntn[nationid].tsctrs ); } } #endif CONQUER *** omagic.c Thu Jul 28 09:10:31 1988 --- magic.c Thu Jul 28 09:11:09 1988 *************** *** 206,211 price = getmgkcost(M_CIV,country); if(price > getmgkcost(M_MGK,country)) price = getmgkcost(M_MGK,country); standend(); count=3; --- 206,214 ----- price = getmgkcost(M_CIV,country); if(price > getmgkcost(M_MGK,country)) price = getmgkcost(M_MGK,country); + #ifdef OGOD + if (isgod==TRUE) price=0; + #endif OGOD standend(); count=3; *************** *** 433,438 return(0L); } if(newpower==DEMOCRACY){ ntn[country].repro+=1; ntn[country].dplus+=10; ntn[country].aplus+=10; --- 436,442 ----- return(0L); } if(newpower==DEMOCRACY){ + ntn[country].maxmove+=1; ntn[country].repro+=1; ntn[country].dplus+=10; ntn[country].aplus+=10; *************** *** 545,550 newtype=DRAGON; break; default: break; } --- 549,555 ----- newtype=DRAGON; break; default: + newtype=MAXMONSTER+1; break; } *************** *** 555,560 sleep(2); return(done); } e_cost= (long) *(u_encost+(newtype%200)) * *(unitminsth+(newtype%200)); s_cost= *(u_encost+(newtype%200)); --- 560,569 ----- sleep(2); return(done); } + if (newtype==MAXMONSTER+1) { + /* quick exit */ + return(done); + } e_cost= (long) *(u_encost+(newtype%200)) * *(unitminsth+(newtype%200)); s_cost= *(u_encost+(newtype%200)); *************** *** 784,789 return(0L); } if(oldpower==DEMOCRACY){ ntn[country].repro-=1; ntn[country].dplus-=10; ntn[country].aplus-=10; --- 793,799 ----- return(0L); } if(oldpower==DEMOCRACY){ + ntn[country].maxmove-=1; ntn[country].repro-=1; ntn[country].dplus-=10; ntn[country].aplus-=10; *** onewlogin.c Thu Jul 28 09:10:32 1988 --- newlogin.c Thu Jul 28 09:11:09 1988 *************** *** 225,231 ntn[country].mark= (*ntn[country].name); if (islower(ntn[country].mark)!=FALSE) ! ntn[country].mark= toupper(ntn[country].mark); printf("\ntesting first letter of name (%c) for nation mark...",ntn[country].mark); valid=TRUE; while(valid==TRUE) { --- 225,231 ----- ntn[country].mark= (*ntn[country].name); if (islower(ntn[country].mark)!=FALSE) ! ntn[country].mark= toupper(ntn[country].mark); printf("\ntesting first letter of name (%c) for nation mark...",ntn[country].mark); valid=TRUE; while(valid==TRUE) { *** odisplay.c Thu Jul 28 09:09:40 1988 --- display.c Thu Jul 28 09:11:10 1988 *************** *** 47,53 /*can you see all?*/ if((magic(country,KNOWALL)==1)||(country==0)) { for(x=0;x<SCREEN_X_SIZE;x++) { ! for(y=0;y<(LINES-4);y++) { highlight(x,y); see(x,y); } --- 47,53 ----- /*can you see all?*/ if((magic(country,KNOWALL)==1)||(country==0)) { for(x=0;x<SCREEN_X_SIZE;x++) { ! for(y=0;y<SCREEN_Y_SIZE;y++) { highlight(x,y); see(x,y); } *************** *** 62,68 } /*see as appropriate?*/ else { ! for(x=0;x<SCREEN_X_SIZE;x++) for(y=0;y<(LINES-4);y++) { if(sct[x+xoffset][y+yoffset].owner==country){ for(i=x-LANDSEE;i<=x+LANDSEE;i++){ for(j=y-LANDSEE;j<=y+LANDSEE;j++) { --- 62,69 ----- } /*see as appropriate?*/ else { ! for(x=(-LANDSEE);(x<SCREEN_X_SIZE+LANDSEE)&&(x+xoffset<MAPX);x++) ! for(y=(-LANDSEE);(y<SCREEN_Y_SIZE+LANDSEE)&&(y+yoffset<MAPY);y++) { if(sct[x+xoffset][y+yoffset].owner==country){ for(i=x-LANDSEE;i<=x+LANDSEE;i++){ for(j=y-LANDSEE;j<=y+LANDSEE;j++) { *************** *** 181,187 see(x,y) { int armbonus; ! if((x<0)||(y<0)||(x>COLS-21)||(y>=LINES-4)) return; if(((y+yoffset)<MAPY)&&((x+xoffset)<MAPX)) { if((magic(sct[x+xoffset][y+yoffset].owner,THE_VOID)==TRUE) --- 182,188 ----- see(x,y) { int armbonus; ! if((x<0)||(y<0)||(x>=SCREEN_X_SIZE)||(y>=SCREEN_Y_SIZE)) return; if(((y+yoffset)<MAPY)&&((x+xoffset)<MAPX)) { if((magic(sct[x+xoffset][y+yoffset].owner,THE_VOID)==TRUE) *************** *** 189,197 ||(dismode==DI_PEOP)||(dismode==DI_FOOD)) &&(country!=sct[x+xoffset][y+yoffset].owner) &&(country!=0)) { ! standout(); ! mvaddch(y,2*x,' '); ! standend(); } else { switch(dismode){ case DI_FOOD: /*food */ --- 190,196 ----- ||(dismode==DI_PEOP)||(dismode==DI_FOOD)) &&(country!=sct[x+xoffset][y+yoffset].owner) &&(country!=0)) { ! mvaddch(y,2*x,'?'); } else { switch(dismode){ case DI_FOOD: /*food */ *************** *** 265,271 case DI_PEOP: /*People*/ if (sct[x+xoffset][y+yoffset].altitude==WATER) mvaddch(y,2*x,WATER); ! else if (sct[x+xoffset][y+yoffset].people>=1000) mvaddch(y,2*x,'+'); else if (sct[x+xoffset][y+yoffset].people>=450) mvaddch(y,2*x,'>'); --- 264,270 ----- case DI_PEOP: /*People*/ if (sct[x+xoffset][y+yoffset].altitude==WATER) mvaddch(y,2*x,WATER); ! else if (sct[x+xoffset][y+yoffset].people>=4950) mvaddch(y,2*x,'+'); else if (sct[x+xoffset][y+yoffset].people>=950) mvaddch(y,2*x,'>'); *************** *** 267,273 mvaddch(y,2*x,WATER); else if (sct[x+xoffset][y+yoffset].people>=1000) mvaddch(y,2*x,'+'); ! else if (sct[x+xoffset][y+yoffset].people>=450) mvaddch(y,2*x,'>'); else if (sct[x+xoffset][y+yoffset].people==0) mvaddch(y,2*x,'0'); --- 266,272 ----- mvaddch(y,2*x,WATER); else if (sct[x+xoffset][y+yoffset].people>=4950) mvaddch(y,2*x,'+'); ! else if (sct[x+xoffset][y+yoffset].people>=950) mvaddch(y,2*x,'>'); else mvprintw(y,2*x,"%d",(50+sct[x+xoffset][y+yoffset].people)/100); *************** *** 269,276 mvaddch(y,2*x,'+'); else if (sct[x+xoffset][y+yoffset].people>=450) mvaddch(y,2*x,'>'); - else if (sct[x+xoffset][y+yoffset].people==0) - mvaddch(y,2*x,'0'); else mvprintw(y,2*x,"%d",1+sct[x+xoffset][y+yoffset].people/50); break; --- 268,273 ----- mvaddch(y,2*x,'+'); else if (sct[x+xoffset][y+yoffset].people>=950) mvaddch(y,2*x,'>'); else mvprintw(y,2*x,"%d",(50+sct[x+xoffset][y+yoffset].people)/100); break; *************** *** 272,278 else if (sct[x+xoffset][y+yoffset].people==0) mvaddch(y,2*x,'0'); else ! mvprintw(y,2*x,"%d",1+sct[x+xoffset][y+yoffset].people/50); break; case DI_GOLD: /*Gold*/ if (sct[x+xoffset][y+yoffset].altitude==WATER) --- 269,275 ----- else if (sct[x+xoffset][y+yoffset].people>=950) mvaddch(y,2*x,'>'); else ! mvprintw(y,2*x,"%d",(50+sct[x+xoffset][y+yoffset].people)/100); break; case DI_GOLD: /*Gold*/ if (sct[x+xoffset][y+yoffset].altitude==WATER) *************** *** 339,345 void coffmap() { ! if((xcurs<1)||(ycurs<1)||(xcurs>=SCREEN_X_SIZE) ||((ycurs>=SCREEN_Y_SIZE))||((XREAL)>=MAPX) ||((YREAL)>=MAPY)) offmap(); --- 336,342 ----- void coffmap() { ! if((xcurs<0)||(ycurs<0)||(xcurs>=SCREEN_X_SIZE) ||((ycurs>=SCREEN_Y_SIZE))||((XREAL)>=MAPX) ||((YREAL)>=MAPY)) offmap(); *** omain.c Thu Jul 28 09:10:32 1988 --- main.c Thu Jul 28 09:11:10 1988 *************** *** 208,214 } execute(); #ifdef TRADE ! uptrade(); #endif TRADE if(ntn[country].capx>15) { xcurs=15; --- 208,214 ----- } execute(); #ifdef TRADE ! checktrade(); #endif TRADE if(ntn[country].capx>15) { xcurs=15; *************** *** 661,669 /*print that army to nfound%5*/ mvaddch((nfound%5)*2,COLS-21,'>'); if(selector==(nfound%5)*2) standout(); - /*the mv,for gets the highlighting pretty*/ - move((nfound%5)*2,COLS-10); - for(i=0;i<9;i++) addch(' '); mvprintw((nfound%5)*2,COLS-20,"army %d: %d (%s)",armynum,ASOLD,*(shunittype+(ATYPE%100))); /*the mv,for gets the highlighting pretty*/ --- 661,666 ----- /*print that army to nfound%5*/ mvaddch((nfound%5)*2,COLS-21,'>'); if(selector==(nfound%5)*2) standout(); mvprintw((nfound%5)*2,COLS-20,"army %d: %d (%s)",armynum,ASOLD,*(shunittype+(ATYPE%100))); *************** *** 666,674 for(i=0;i<9;i++) addch(' '); mvprintw((nfound%5)*2,COLS-20,"army %d: %d (%s)",armynum,ASOLD,*(shunittype+(ATYPE%100))); - /*the mv,for gets the highlighting pretty*/ - move((nfound%5)*2+1,COLS-10); - for(i=0;i<9;i++) addch(' '); mvprintw((nfound%5)*2+1,COLS-20," mv:%d st:%s",AMOVE,*(soldname+ASTAT)); standend(); --- 663,668 ----- if(selector==(nfound%5)*2) standout(); mvprintw((nfound%5)*2,COLS-20,"army %d: %d (%s)",armynum,ASOLD,*(shunittype+(ATYPE%100))); mvprintw((nfound%5)*2+1,COLS-20," mv:%d st:%s",AMOVE,*(soldname+ASTAT)); standend(); *************** *** 688,695 /*print a navy*/ mvaddch((nfound%5)*2,COLS-21,'>'); if(selector==(nfound%5)*2) standout(); ! mvprintw((nfound%5)*2,COLS-20,"nvy %d: war:%d mv:%d",nvynum,NWAR,NMOVE); ! mvprintw((nfound%5)*2+1,COLS-20," mer %d crew %d",NMER,NCREW); standend(); } nfound++; --- 682,689 ----- /*print a navy*/ mvaddch((nfound%5)*2,COLS-21,'>'); if(selector==(nfound%5)*2) standout(); ! mvprintw((nfound%5)*2,COLS-20,"nvy %d: war:%d mer:%d",nvynum,NWAR,NMER); ! mvprintw((nfound%5)*2+1,COLS-20," mv:%d crew:%d",NMOVE,NCREW/(NWAR+NMER)); standend(); } nfound++; *** opatchlevel.h Thu Jul 28 09:10:14 1988 --- patchlevel.h Thu Jul 28 09:11:13 1988 *************** *** 1,1 ! #define PATCHLEVEL 3 --- 1,1 ----- ! #define PATCHLEVEL 4