smile@homxc.UUCP (E.BARLOW) (07/13/88)
Here is patch 2...
*** oldadmin.c Wed Jul 13 09:55:58 1988
--- admin.c Wed Jul 13 09:56:10 1988
*** oldextcmds.c Wed Jul 13 09:55:59 1988
--- extcmds.c Wed Jul 13 09:56:10 1988
***************
*** 78,83
if (armynum < 0 || armynum >= MAXARM ||
army2 < 0 || army2 >= MAXARM ||
armynum == army2 ||
ASTAT == SCOUT ||
ntn[country].arm[army2].stat == SCOUT ||
ATYPE >= MINMONSTER ||
--- 78,87 -----
if (armynum < 0 || armynum >= MAXARM ||
army2 < 0 || army2 >= MAXARM ||
armynum == army2 ||
+ #ifdef TRADE
+ ASTAT == TRADED ||
+ ntn[country].arm[army2].stat == TRADED ||
+ #endif TRADE
ASTAT == SCOUT ||
ntn[country].arm[army2].stat == SCOUT ||
ATYPE >= MINMONSTER ||
***************
*** 102,107
change_status(armynum,new_stat)
int armynum,new_stat;
{
if (armynum < 0 || armynum >= MAXARM || ASTAT==SCOUT) {
errormsg("Selected army not legal");
return;
--- 106,114 -----
change_status(armynum,new_stat)
int armynum,new_stat;
{
+ #ifdef TRADE
+ if (armynum < 0 || armynum >= MAXARM || ASTAT==SCOUT || ASTAT==TRADED) {
+ #else
if (armynum < 0 || armynum >= MAXARM || ASTAT==SCOUT) {
#endif TRADE
errormsg("Selected army not legal");
***************
*** 103,108
int armynum,new_stat;
{
if (armynum < 0 || armynum >= MAXARM || ASTAT==SCOUT) {
errormsg("Selected army not legal");
return;
}
--- 110,116 -----
if (armynum < 0 || armynum >= MAXARM || ASTAT==SCOUT || ASTAT==TRADED) {
#else
if (armynum < 0 || armynum >= MAXARM || ASTAT==SCOUT) {
+ #endif TRADE
errormsg("Selected army not legal");
return;
}
***************
*** 124,131
errormsg("sorry -- army is monster");
return;
}
!
! if(men<0 || armynum < 0 || armynum >= MAXARM || ASOLD < men+25 ) {
errormsg("Selected army too small or illegal");
return;
}
--- 132,142 -----
errormsg("sorry -- army is monster");
return;
}
! #ifdef TRADE
! if(men<0 || armynum < 0 || armynum >= MAXARM || ASOLD < men+25 || ASTAT==TRADED) {
! #else
! if(men<0 || armynum < 0 || armynum >= MAXARM || ASOLD < men+25) {
! #endif TRADE
errormsg("Selected army too small or illegal");
return;
}
*** oldmakeworld.c Wed Jul 13 09:55:55 1988
--- makeworld.c Wed Jul 13 09:56:11 1988
*** oldrandevent.c Wed Jul 13 09:55:56 1988
--- randevent.c Wed Jul 13 09:56:13 1988
*** oldcexecute.c Wed Jul 13 09:56:02 1988
--- cexecute.c Wed Jul 13 09:56:13 1988
***************
*** 15,21
#include "data.h"
extern long startgold;
extern short country;
! extern FILE *fexe;
int
execute()
--- 15,21 -----
#include "data.h"
extern long startgold;
extern short country;
! extern FILE *fexe,*fison;
int
execute()
***************
*** 36,42
/* initialize i_people */
for(x=0;x<MAPX;x++)
! for(y=0;y<MAPX;y++)
if(( sct[x][y].owner == country)&&
((sct[x][y].designation == DCITY)
||( sct[x][y].designation == DCAPITOL)))
--- 36,42 -----
/* initialize i_people */
for(x=0;x<MAPX;x++)
! for(y=0;y<MAPY;y++)
if(( sct[x][y].owner == country)&&
((sct[x][y].designation == DCITY)
||( sct[x][y].designation == DCAPITOL)))
***************
*** 200,205
fputs("END\n",fp);
fclose(fp);
/* exit program */
exit(FAIL);
}
--- 200,207 -----
fputs("END\n",fp);
fclose(fp);
+ /* remove the lock file */
+ unlink(fison);
/* exit program */
exit(FAIL);
}
*** oldforms.c Wed Jul 13 09:55:57 1988
--- forms.c Wed Jul 13 09:56:13 1988
***************
*** 252,258
void
change()
{
! char string[10];
int i, cbonus;
short armynum;
char passwd[8];
--- 252,258 -----
void
change()
{
! char string[10], command[80];
int i, cbonus;
short armynum;
char passwd[8];
***************
*** 284,291
mvprintw(5,(COLS/2), "defense bonus..........+%2d",ntn[country].dplus);
mvprintw(6,(COLS/2), "maximum move rate.......%2d",ntn[country].maxmove);
mvprintw(7,(COLS/2), "reproduction rate......%2d%%",ntn[country].repro);
! mvprintw(9,(COLS/2), "gold talons.....$%8ld",ntn[country].tgold);
! mvprintw(10,(COLS/2),"jewels .........$%8ld",ntn[country].jewels);
mvprintw(11,(COLS/2),"iron & minerals...%8ld",ntn[country].tiron);
if(ntn[country].tfood<2*ntn[country].tciv) standout();
mvprintw(12,(COLS/2),"food in granary...%8ld",ntn[country].tfood);
--- 284,291 -----
mvprintw(5,(COLS/2), "defense bonus..........+%2d",ntn[country].dplus);
mvprintw(6,(COLS/2), "maximum move rate.......%2d",ntn[country].maxmove);
mvprintw(7,(COLS/2), "reproduction rate......%2d%%",ntn[country].repro);
! mvprintw(9,(COLS/2), "gold talons......$%8ld",ntn[country].tgold);
! mvprintw(10,(COLS/2),"jewels ..........$%8ld",ntn[country].jewels);
mvprintw(11,(COLS/2),"iron & minerals...%8ld",ntn[country].tiron);
if(ntn[country].tfood<2*ntn[country].tciv) standout();
mvprintw(12,(COLS/2),"food in granary...%8ld",ntn[country].tfood);
***************
*** 303,309
if(magic(country,VAMPIRE)!=1)
mvaddstr(21,(COLS/2)-14,"HIT 3 TO ADD TO YOUR COMBAT BONUS");
else mvaddstr(21,(COLS/2)-17,"( VAMPIRES MAY NOT ADD TO COMBAT BONUS )");
- if(isgod==TRUE) mvaddstr(22,(COLS/2)-9,"HIT 4 TO DESTROY NATION");
standend();
refresh();
--- 303,308 -----
if(magic(country,VAMPIRE)!=1)
mvaddstr(21,(COLS/2)-14,"HIT 3 TO ADD TO YOUR COMBAT BONUS");
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");
***************
*** 305,310
else mvaddstr(21,(COLS/2)-17,"( VAMPIRES MAY NOT ADD TO COMBAT BONUS )");
if(isgod==TRUE) mvaddstr(22,(COLS/2)-9,"HIT 4 TO DESTROY NATION");
standend();
refresh();
switch(getch()){
--- 304,314 -----
mvaddstr(21,(COLS/2)-14,"HIT 3 TO ADD TO YOUR COMBAT BONUS");
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
standend();
refresh();
switch(getch()){
***************
*** 437,443
refresh();
if(getch()=='y') {
! if ((fnews=fopen(newsfile,"w"))==NULL) {
printf("error opening news file\n");
exit(FAIL);
}
--- 441,447 -----
refresh();
if(getch()=='y') {
! if ((fnews=fopen(newsfile,"a+"))==NULL) {
printf("error opening news file\n");
exit(FAIL);
}
***************
*** 443,448
}
destroy(country);
fclose(fnews);
}
}
break;
--- 447,455 -----
}
destroy(country);
fclose(fnews);
+ sprintf(command,"sort -n -o %s %s ",
+ newsfile, newsfile);
+ system(command);
}
}
break;
***************
*** 446,451
}
}
break;
default:
if(isgod==TRUE) country=0;
return;
--- 453,470 -----
}
}
break;
+ #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 */
+ ntn[country].tgold = (long) i;
+ }
+ break;
+ #endif OGOD
default:
if(isgod==TRUE) country=0;
return;
*** oldmisc.c Wed Jul 13 09:55:54 1988
--- misc.c Wed Jul 13 09:56:13 1988
***************
*** 943,949
} /* switch */
} /* for */
! for(x=0;x<MAPX;x++) for(y=0;y<MAPX;y++){
sptr = &sct[x][y];
if(race==GOD) movecost[x][y] = 0;
--- 943,949 -----
} /* switch */
} /* for */
! for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++){
sptr = &sct[x][y];
if(race==GOD) movecost[x][y] = 0;
*** oldreports.c Wed Jul 13 09:55:58 1988
--- reports.c Wed Jul 13 09:56:13 1988
***************
*** 48,54
standend();
refresh();
country = get_number();
! if(country<0||country>NTOTAL) return;
}
armynum=0;
/*new army screen*/
--- 48,54 -----
standend();
refresh();
country = get_number();
! if(country<0||country>NTOTAL) { country=0; return; }
}
armynum=0;
/*new army screen*/
***************
*** 104,110
clrtoeol();
refresh();
armynum = get_number();
! if((armynum<0)||(armynum>MAXARM)) return;
if(ATYPE<99)
mvaddstr(18,0,"1) CHANGE STATUS, 2) TRANSFER / MERGE, 3) SPLIT ARMY, 4) DISBAND ARMY");
else mvaddstr(18,0,"1) CHANGE STATUS, 4) DISBAND ARMY:");
--- 104,120 -----
clrtoeol();
refresh();
armynum = get_number();
! if((armynum<0)||(armynum>MAXARM)) {
! if (isgod==TRUE) country=0;
! return;
! }
! #ifdef TRADE
! if(ASTAT==TRADED) {
! errormsg("May not change traded army");
! if (isgod==TRUE) country=0;
! return;
! #endif TRADe
! }
if(ATYPE<99)
mvaddstr(18,0,"1) CHANGE STATUS, 2) TRANSFER / MERGE, 3) SPLIT ARMY, 4) DISBAND ARMY");
else mvaddstr(18,0,"1) CHANGE STATUS, 4) DISBAND ARMY:");
***************
*** 109,114
mvaddstr(18,0,"1) CHANGE STATUS, 2) TRANSFER / MERGE, 3) SPLIT ARMY, 4) DISBAND ARMY");
else mvaddstr(18,0,"1) CHANGE STATUS, 4) DISBAND ARMY:");
clrtoeol();
if(isgod==TRUE) mvaddstr(20,0,"5) LOCATION, 6) SOLDIERS:");
refresh();
switch(getch()){
--- 119,125 -----
mvaddstr(18,0,"1) CHANGE STATUS, 2) TRANSFER / MERGE, 3) SPLIT ARMY, 4) DISBAND ARMY");
else mvaddstr(18,0,"1) CHANGE STATUS, 4) DISBAND ARMY:");
clrtoeol();
+ #ifdef OGOD
if(isgod==TRUE) mvaddstr(20,0,"5) LOCATION, 6) SOLDIERS:");
refresh();
switch(getch()){
***************
*** 362,367
standend();
done=TRUE;
refresh();
if(isgod==TRUE) country=0;
return;
}
--- 373,379 -----
standend();
done=TRUE;
refresh();
+ getch();
if(isgod==TRUE) country=0;
return;
}
***************
*** 378,384
mvaddstr(4,0, "merchant :");
mvaddstr(5,0, "x location:");
mvaddstr(6,0, "y location:");
! mvaddstr(7,0,"move left :");
position=5;
count=0;
--- 390,397 -----
mvaddstr(4,0, "merchant :");
mvaddstr(5,0, "x location:");
mvaddstr(6,0, "y location:");
! mvaddstr(7,0, "crew:");
! mvaddstr(8,0,"move left :");
position=5;
count=0;
***************
*** 393,399
mvprintw(4,position,"%d",NMER);
mvprintw(5,position,"%d",NXLOC);
mvprintw(6,position,"%d",NYLOC);
! mvprintw(7,position,"%d",NMOVE);
}
nvynum++;
}
--- 406,413 -----
mvprintw(4,position,"%d",NMER);
mvprintw(5,position,"%d",NXLOC);
mvprintw(6,position,"%d",NYLOC);
! mvprintw(7,position,"%d",NCREW/(NWAR+NMER));
! mvprintw(8,position,"%d",NMOVE);
}
nvynum++;
}
***************
*** 409,414
if (navy=='\n'){
mvaddstr(16,0,"WHAT NAVY DO YOU WANT TO CHANGE:");
clrtoeol();
refresh();
nvynum = get_number();
if((nvynum<0)||(nvynum>MAXNAVY)) return;
--- 423,429 -----
if (navy=='\n'){
mvaddstr(16,0,"WHAT NAVY DO YOU WANT TO CHANGE:");
clrtoeol();
+ #endif OGOD
refresh();
nvynum = get_number();
#ifdef TRADE
***************
*** 411,416
clrtoeol();
refresh();
nvynum = get_number();
if((nvynum<0)||(nvynum>MAXNAVY)) return;
mvaddstr(18,0,"1) TRANSFER / MERGE, 2) SPLIT NAVY, 3) DISBAND NAVY:");
clrtoeol();
--- 426,440 -----
#endif OGOD
refresh();
nvynum = get_number();
+ #ifdef TRADE
+ if (ntn[country].nvy[nvynum].armynum==TRADED) {
+ mvaddstr(23,0,"SORRY - THAT NAVY IS UP FOR TRADE");
+ refresh();
+ getch();
+ if (isgod==TRUE) country=0;
+ return;
+ }
+ #endif TRADE
if((nvynum<0)||(nvynum>MAXNAVY)) return;
mvaddstr(18,0,"1) TRANSFER / MERGE, 2) SPLIT NAVY, 3) DISBAND NAVY:");
clrtoeol();
***************
*** 413,418
nvynum = get_number();
if((nvynum<0)||(nvynum>MAXNAVY)) return;
mvaddstr(18,0,"1) TRANSFER / MERGE, 2) SPLIT NAVY, 3) DISBAND NAVY:");
clrtoeol();
refresh();
switch(getch()){
--- 437,445 -----
#endif TRADE
if((nvynum<0)||(nvynum>MAXNAVY)) return;
mvaddstr(18,0,"1) TRANSFER / MERGE, 2) SPLIT NAVY, 3) DISBAND NAVY:");
+ clrtoeol();
+ #ifdef OGOD
+ if(isgod==TRUE) mvaddstr(19,0,"4) ADJUST SHIPS, 5) LOCATION, 6) CREW");
clrtoeol();
#endif OGOD
refresh();
***************
*** 414,419
if((nvynum<0)||(nvynum>MAXNAVY)) return;
mvaddstr(18,0,"1) TRANSFER / MERGE, 2) SPLIT NAVY, 3) DISBAND NAVY:");
clrtoeol();
refresh();
switch(getch()){
case '1':
--- 441,447 -----
#ifdef OGOD
if(isgod==TRUE) mvaddstr(19,0,"4) ADJUST SHIPS, 5) LOCATION, 6) CREW");
clrtoeol();
+ #endif OGOD
refresh();
switch(getch()){
case '1':
***************
*** 424,429
clrtoeol();
refresh();
nvynum = get_number();
if(nvynum==oldnavy) {
mvprintw(23,0,"SORRY -- SAME NAVY (%d,%d)",nvynum,oldnavy);
refresh();
--- 452,464 -----
clrtoeol();
refresh();
nvynum = get_number();
+ #ifdef TRADE
+ if (ntn[country].nvy[nvynum].armynum==TRADED) {
+ mvaddstr(23,0,"SORRY - THAT NAVY IS UP FOR TRADE");
+ refresh();
+ getch();
+ } else
+ #endif TRADE
if(nvynum==oldnavy) {
mvprintw(23,0,"SORRY -- SAME NAVY (%d,%d)",nvynum,oldnavy);
refresh();
***************
*** 505,510
NMER=0;
NADJSHP;
break;
default:
mvaddstr(21,0,"ERROR : HIT ANY CHAR TO CONTINUE");
clrtoeol();
--- 540,589 -----
NMER=0;
NADJSHP;
break;
+ case '4':
+ if (isgod==TRUE) {
+ /* ADJUST SHIPS */
+ mvaddstr(21,0,"HOW MANY WAR SHIPS: ");
+ refresh();
+ wships = get_number();
+ NWAR = wships;
+ mvaddstr(22,0,"HOW MANY MERCHANT SHIPS: ");
+ refresh();
+ mships = get_number();
+ NMER = mships;
+ NADJSHP;
+ }
+ break;
+ #ifdef OGOD
+ case '5':
+ if (isgod==TRUE) {
+ /*X LOCATION*/
+ mvaddstr(21,0,"WHAT IS THE NEW X LOC: ");
+ refresh();
+ wships = get_number();
+ if (wships>=0 && wships<MAPX)
+ NXLOC=wships;
+ /*Y LOCATION*/
+ mvaddstr(22,0,"WHAT IS THE NEW Y LOC: ");
+ refresh();
+ wships = get_number();
+ if (wships>=0 && wships<MAPY)
+ NYLOC=wships;
+ NADJLOC;
+ }
+ break;
+ case '6':
+ if (isgod==TRUE) {
+ /* ADJUST CREWSIZE */
+ mvaddstr(21,0,"WHAT VALUE FOR CREW PER SHIP: ");
+ refresh();
+ wships = get_number();
+ if (wships>=0 && wships<=SHIPCREW)
+ NCREW = wships*(NMER+NWAR);
+ NADJCRW;
+ }
+ break;
+ #endif OGOD
default:
mvaddstr(21,0,"ERROR : HIT ANY CHAR TO CONTINUE");
clrtoeol();
*** oldcombat.c Wed Jul 13 09:55:53 1988
--- combat.c Wed Jul 13 09:56:14 1988
***************
*** 611,617
for(x= xsctr-1; x<=xsctr+1; x++)
for(y= ysctr-1; y<=ysctr+1; y++) if(ONMAP){
! if(tofood(sct[x][y].vegetation,0)==0) continue;
if(((sct[x][y].owner == nation)
||(ntn[sct[x][y].owner].dstatus[nation] < NEUTRAL))
||(solds_in_sector( x, y, sct[x][y].owner) == 0)){
--- 611,618 -----
for(x= xsctr-1; x<=xsctr+1; x++)
for(y= ysctr-1; y<=ysctr+1; y++) if(ONMAP){
! if(tofood(sct[x][y].vegetation,
! sct[x][y].owner == country ? country : 0)==0) continue;
if(((sct[x][y].owner == nation)
||(ntn[sct[x][y].owner].dstatus[nation] < NEUTRAL))
||(solds_in_sector( x, y, sct[x][y].owner) == 0)){
***************
*** 653,658
int sailor;
char tempmsg[15];
int aship=0,dship=0; /*a's and d's total war ships*/
int asunk=0,dsunk=0; /*a's and d's losses for the round*/
int amsunk=0,dmsunk=0; /*a's and d's msunks for the round*/
register int done,i,j,k;
--- 654,660 -----
int sailor;
char tempmsg[15];
int aship=0,dship=0; /*a's and d's total war ships*/
+ int acrew=0,dcrew=0; /*a's and d's warship crew*/
int asunk=0,dsunk=0; /*a's and d's losses for the round*/
int amsunk=0,dmsunk=0; /*a's and d's msunks for the round*/
int amcapt=0,dmcapt=0; /*a's and d's mcaptures the the round*/
***************
*** 655,660
int aship=0,dship=0; /*a's and d's total war ships*/
int asunk=0,dsunk=0; /*a's and d's losses for the round*/
int amsunk=0,dmsunk=0; /*a's and d's msunks for the round*/
register int done,i,j,k;
/* determine who is attacker & who is on defenders side?*/
--- 657,664 -----
int acrew=0,dcrew=0; /*a's and d's warship crew*/
int asunk=0,dsunk=0; /*a's and d's losses for the round*/
int amsunk=0,dmsunk=0; /*a's and d's msunks for the round*/
+ int amcapt=0,dmcapt=0; /*a's and d's mcaptures the the round*/
+ int akcrew=0,dkcrew=0; /*a's and d's crew losses for the round*/
register int done,i,j,k;
/* determine who is attacker & who is on defenders side?*/
***************
*** 676,681
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
if(side[j]==DFND) {
dship+=ntn[owner[j]].nvy[unit[j]].warships;
}
else if(side[j]==ATKR) {
aship+=ntn[owner[j]].nvy[unit[j]].warships;
--- 680,689 -----
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
if(side[j]==DFND) {
dship+=ntn[owner[j]].nvy[unit[j]].warships;
+ dcrew+=ntn[owner[j]].nvy[unit[j]].crew *
+ ntn[owner[j]].nvy[unit[j]].warships /
+ (ntn[owner[j]].nvy[unit[j]].warships+
+ ntn[owner[j]].nvy[unit[j]].merchant);
}
else if(side[j]==ATKR) {
aship+=ntn[owner[j]].nvy[unit[j]].warships;
***************
*** 679,684
}
else if(side[j]==ATKR) {
aship+=ntn[owner[j]].nvy[unit[j]].warships;
}
}
--- 687,696 -----
}
else if(side[j]==ATKR) {
aship+=ntn[owner[j]].nvy[unit[j]].warships;
+ acrew+=ntn[owner[j]].nvy[unit[j]].crew *
+ ntn[owner[j]].nvy[unit[j]].warships /
+ (ntn[owner[j]].nvy[unit[j]].warships+
+ ntn[owner[j]].nvy[unit[j]].merchant);
}
}
***************
*** 684,689
/*no bonus currently included in this combat*/
/*each warship can do damage 40%; once all warships sunk then all*/
/*sunk are captured merchant*/
sailor=FALSE;
--- 696,705 -----
/*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*/
sailor=FALSE;
***************
*** 689,696
sailor=FALSE;
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)) if(side[j]==ATKR)
if(magic(owner[j],SAILOR)==TRUE) sailor=TRUE;
! if(sailor==TRUE) for(i=0;i<aship;i++) if(rand()%10<=5) dsunk++;
! else for(i=0;i<aship;i++) if(rand()%10<=3) dsunk++;
sailor=FALSE;
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)) if(side[j]==DFND)
--- 705,712 -----
sailor=FALSE;
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)) if(side[j]==ATKR)
if(magic(owner[j],SAILOR)==TRUE) sailor=TRUE;
! if(sailor==TRUE) for(i=0;i<aship;i++) if(acrew*(rand()%100)/100<=50) dsunk++;
! else for(i=0;i<aship;i++) if(acrew*(rand()%100)/100<=30) dsunk++;
sailor=FALSE;
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)) if(side[j]==DFND)
***************
*** 695,702
sailor=FALSE;
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)) if(side[j]==DFND)
if(magic(owner[j],SAILOR)==TRUE) sailor=TRUE;
! if(sailor==TRUE) for(i=0;i<dship;i++) if(rand()%10<=4) asunk++;
! else for(i=0;i<dship;i++) if(rand()%10<=3) asunk++;
#ifdef HIDELOC
fprintf(fnews,"4.\tNaval Battle occurs");
--- 711,718 -----
sailor=FALSE;
for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)) if(side[j]==DFND)
if(magic(owner[j],SAILOR)==TRUE) sailor=TRUE;
! if(sailor==TRUE) for(i=0;i<dship;i++) if(dcrew*(rand()%100)/100<=40) asunk++;
! else for(i=0;i<dship;i++) if(dcrew*(rand()%100)/100<=30) asunk++;
#ifdef HIDELOC
fprintf(fnews,"4.\tNaval Battle occurs");
***************
*** 739,744
ntn[owner[0]].nvy[unit[0]].xloc,
ntn[owner[0]].nvy[unit[0]].yloc,max(0,dsunk-dship));
#endif
for(i=0;i<MGKNUM;i++) if(owner[i]!=(-1)){
if((asunk>0)&&(side[i]==ATKR)){
--- 755,771 -----
ntn[owner[0]].nvy[unit[0]].xloc,
ntn[owner[0]].nvy[unit[0]].yloc,max(0,dsunk-dship));
#endif
+ /*calculate crew losses: all on ships sunk plus percentage*/
+ if (asunk > aship) {
+ akcrew = asunk * SHIPCREW + SHIPCREW*(asunk-aship)*asunk/(asunk+dsunk);
+ amsunk = asunk -aship;
+ } else
+ akcrew = aship * SHIPCREW;
+ if (dsunk > dship) {
+ dkcrew = dsunk * SHIPCREW + SHIPCREW*(dsunk-dship)*dsunk/(dsunk+asunk);
+ dmsunk = dsunk -dship;
+ } else
+ dkcrew = dship * SHIPCREW;
/*work warship and crew losses per navy*/
for(i=0;i<MGKNUM;i++) if(owner[i]!=(-1)){
***************
*** 740,745
ntn[owner[0]].nvy[unit[0]].yloc,max(0,dsunk-dship));
#endif
for(i=0;i<MGKNUM;i++) if(owner[i]!=(-1)){
if((asunk>0)&&(side[i]==ATKR)){
if(asunk > aship ) {
--- 767,773 -----
} else
dkcrew = dship * SHIPCREW;
+ /*work warship and crew losses per navy*/
for(i=0;i<MGKNUM;i++) if(owner[i]!=(-1)){
if((asunk>0)&&(side[i]==ATKR)){
ntn[owner[i]].nvy[unit[i]].crew -= akcrew * ntn[owner[i]].nvy[unit[i]].warships/aship;
***************
*** 742,747
for(i=0;i<MGKNUM;i++) if(owner[i]!=(-1)){
if((asunk>0)&&(side[i]==ATKR)){
if(asunk > aship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
amsunk = asunk - aship;
--- 770,776 -----
/*work warship and crew losses per navy*/
for(i=0;i<MGKNUM;i++) if(owner[i]!=(-1)){
if((asunk>0)&&(side[i]==ATKR)){
+ ntn[owner[i]].nvy[unit[i]].crew -= akcrew * ntn[owner[i]].nvy[unit[i]].warships/aship;
if(asunk > aship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
} else {
***************
*** 744,750
if((asunk>0)&&(side[i]==ATKR)){
if(asunk > aship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
- amsunk = asunk - aship;
} else {
ntn[owner[i]].nvy[unit[i]].warships -= asunk * ntn[owner[i]].nvy[unit[i]].warships/aship;
}
--- 773,778 -----
ntn[owner[i]].nvy[unit[i]].crew -= akcrew * ntn[owner[i]].nvy[unit[i]].warships/aship;
if(asunk > aship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
} else {
ntn[owner[i]].nvy[unit[i]].warships -= asunk * ntn[owner[i]].nvy[unit[i]].warships/aship;
}
***************
*** 750,755
}
}
else if((dsunk>0)&&(side[i]==DFND)){
if(dsunk > dship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
dmsunk = dsunk -dship;
--- 778,784 -----
}
}
else if((dsunk>0)&&(side[i]==DFND)){
+ ntn[owner[i]].nvy[unit[i]].crew -= dkcrew * ntn[owner[i]].nvy[unit[i]].warships/dship;
if(dsunk > dship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
} else {
***************
*** 752,758
else if((dsunk>0)&&(side[i]==DFND)){
if(dsunk > dship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
- dmsunk = dsunk -dship;
} else {
ntn[owner[i]].nvy[unit[i]].warships -= dsunk * ntn[owner[i]].nvy[unit[i]].warships / dship;
}
--- 781,786 -----
ntn[owner[i]].nvy[unit[i]].crew -= dkcrew * ntn[owner[i]].nvy[unit[i]].warships/dship;
if(dsunk > dship ) {
ntn[owner[i]].nvy[unit[i]].warships=0;
} else {
ntn[owner[i]].nvy[unit[i]].warships -= dsunk * ntn[owner[i]].nvy[unit[i]].warships / dship;
}
***************
*** 763,768
if((amsunk>0)&&(side[i]==ATKR)){
if(amsunk >= ntn[owner[i]].nvy[unit[i]].merchant ) {
amsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=amsunk;
--- 791,797 -----
if((amsunk>0)&&(side[i]==ATKR)){
if(amsunk >= ntn[owner[i]].nvy[unit[i]].merchant ) {
amsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
+ amcapt += ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
ntn[owner[i]].nvy[unit[i]].crew=0;
} else {
***************
*** 764,769
if(amsunk >= ntn[owner[i]].nvy[unit[i]].merchant ) {
amsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=amsunk;
amsunk=0;
--- 793,799 -----
amsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
amcapt += ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
+ ntn[owner[i]].nvy[unit[i]].crew=0;
} else {
ntn[owner[i]].nvy[unit[i]].crew-=SHIPCREW*amsunk;
ntn[owner[i]].nvy[unit[i]].merchant-=amsunk;
***************
*** 765,770
amsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=amsunk;
amsunk=0;
}
--- 795,801 -----
ntn[owner[i]].nvy[unit[i]].merchant=0;
ntn[owner[i]].nvy[unit[i]].crew=0;
} else {
+ ntn[owner[i]].nvy[unit[i]].crew-=SHIPCREW*amsunk;
ntn[owner[i]].nvy[unit[i]].merchant-=amsunk;
amcapt += amsunk;
amsunk=0;
***************
*** 766,771
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=amsunk;
amsunk=0;
}
}
--- 797,803 -----
} else {
ntn[owner[i]].nvy[unit[i]].crew-=SHIPCREW*amsunk;
ntn[owner[i]].nvy[unit[i]].merchant-=amsunk;
+ amcapt += amsunk;
amsunk=0;
}
}
***************
*** 772,777
else if((dmsunk>0)&&(side[i]==DFND)){
if(dmsunk >= ntn[owner[i]].nvy[unit[i]].merchant ) {
dmsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=dmsunk;
--- 804,810 -----
else if((dmsunk>0)&&(side[i]==DFND)){
if(dmsunk >= ntn[owner[i]].nvy[unit[i]].merchant ) {
dmsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
+ dmcapt += ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
ntn[owner[i]].nvy[unit[i]].crew=0;
} else {
***************
*** 773,778
if(dmsunk >= ntn[owner[i]].nvy[unit[i]].merchant ) {
dmsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=dmsunk;
dmsunk=0;
--- 806,812 -----
dmsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
dmcapt += ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
+ ntn[owner[i]].nvy[unit[i]].crew=0;
} else {
ntn[owner[i]].nvy[unit[i]].crew-=SHIPCREW*dmsunk;
ntn[owner[i]].nvy[unit[i]].merchant-=dmsunk;
***************
*** 774,779
dmsunk -= ntn[owner[i]].nvy[unit[i]].merchant;
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=dmsunk;
dmsunk=0;
}
--- 808,814 -----
ntn[owner[i]].nvy[unit[i]].merchant=0;
ntn[owner[i]].nvy[unit[i]].crew=0;
} else {
+ ntn[owner[i]].nvy[unit[i]].crew-=SHIPCREW*dmsunk;
ntn[owner[i]].nvy[unit[i]].merchant-=dmsunk;
dmcapt += dmsunk;
dmsunk=0;
***************
*** 775,780
ntn[owner[i]].nvy[unit[i]].merchant=0;
} else {
ntn[owner[i]].nvy[unit[i]].merchant-=dmsunk;
dmsunk=0;
}
}
--- 810,816 -----
} else {
ntn[owner[i]].nvy[unit[i]].crew-=SHIPCREW*dmsunk;
ntn[owner[i]].nvy[unit[i]].merchant-=dmsunk;
+ dmcapt += dmsunk;
dmsunk=0;
}
}
***************
*** 779,784
}
}
}
/*will round continue; does one side wish to withdraw*/
--- 815,831 -----
}
}
}
+ /*distribute captured ships according to navy sizes*/
+ if (asunk >= aship) dmcapt=0;
+ if (dsunk >= dship) amcapt=0;
+ for (i=0; i<MGKNUM; i++) if (owner[i]!=(-1)){
+ if ((dmcapt>0)&&(side[i]==ATKR)){
+ ntn[owner[i]].nvy[unit[i]].merchant += dmcapt * ntn[owner[i]].nvy[unit[i]].warships / (aship - asunk);
+ }
+ if ((amcapt>0)&&(side[i]==DFND)){
+ ntn[owner[i]].nvy[unit[i]].merchant += amcapt * ntn[owner[i]].nvy[unit[i]].warships / (dship - dsunk);
+ }
+ }
/*will round continue; does one side wish to withdraw*/
***************
*** 814,820
}
fprintf(fpmsg,"%s RESULT: Attackers lose %d ships, Defenders lose %d ships\n",ntn[owner[j]].name, asunk,dsunk);
! fprintf(fpmsg,"%s Attackers capture %d merchants, Defenders capture %d merchants\n",ntn[owner[j]].name, dmsunk,amsunk);
fprintf(fpmsg,"END\n");
fclose(fpmsg);
}
--- 861,867 -----
}
fprintf(fpmsg,"%s RESULT: Attackers lose %d ships, Defenders lose %d ships\n",ntn[owner[j]].name, asunk,dsunk);
! fprintf(fpmsg,"%s Attackers capture %d merchants, Defenders capture %d merchants\n",ntn[owner[j]].name, dmcapt,amcapt);
fprintf(fpmsg,"END\n");
fclose(fpmsg);
}
*** oldgetopt.c Wed Jul 13 09:55:58 1988
--- getopt.c Wed Jul 13 09:56:14 1988
*** oldmove.c Wed Jul 13 09:55:58 1988
--- move.c Wed Jul 13 09:56:14 1988
*** oldupdate.c Wed Jul 13 09:55:56 1988
--- update.c Wed Jul 13 09:56:14 1988
***************
*** 33,39
/*run each nation in a random order*/
updexecs();
!
#ifdef LZARD
/* run lizard nations */
updlizards();
--- 33,41 -----
/*run each nation in a random order*/
updexecs();
! #ifdef TRADE
! uptrade();
! #endif
#ifdef LZARD
/* run lizard nations */
updlizards();
***************
*** 714,720
char command[80];
long dead;
! fprintf(fnews,"2\tWORLD FOOD SUPPLY & DECLARATIONS OF WAR\n");
for(country=1;country<MAXNTN;country++) if(ntn[country].active!=0){
/*soldiers eat 2*/
ntn[country].tfood-=ntn[country].tmil*2;
--- 716,722 -----
char command[80];
long dead;
! fprintf(fnews,"2\tWORLD ECONOMY & DECLARATIONS OF WAR\n");
for(country=1;country<MAXNTN;country++) if(ntn[country].active!=0){
/*soldiers eat 2*/
ntn[country].tfood-=ntn[country].tmil*2;
*** oldcommands.c Wed Jul 13 09:56:04 1988
--- commands.c Wed Jul 13 09:56:15 1988
***************
*** 295,300
}
NCREW += (NWAR+NMER) * mnumber;
if(isgod==TRUE) country=0;
return;
}
--- 295,301 -----
}
NCREW += (NWAR+NMER) * mnumber;
+ NADJCRW;
if(isgod==TRUE) country=0;
return;
}
*** oldio.c Wed Jul 13 09:55:56 1988
--- io.c Wed Jul 13 09:56:15 1988
***************
*** 108,115
abrt();
}
close(fd);
- verifydata( __FILE__, __LINE__ );
-
} /* readdata() */
#ifdef ADMIN
--- 108,113 -----
abrt();
}
close(fd);
} /* readdata() */
#ifdef ADMIN
*** oldnewhelp.c Wed Jul 13 09:55:59 1988
--- newhelp.c Wed Jul 13 09:56:15 1988
***************
*** 100,105
#else
fprintf(fp,"s/XORCTAKE/(False)/g\n");
#endif
/* map sectors */
fprintf(fp,"s/ZMOUNTAIN/MOUNTAIN (%c)/g\n",MOUNTAIN);
fprintf(fp,"s/ZHILL/HILL (%c)/g\n",HILL);
--- 100,115 -----
#else
fprintf(fp,"s/XORCTAKE/(False)/g\n");
#endif
+ #ifdef HIDELOC
+ fprintf(fp,"s/XHIDELOC/(True) /g\n");
+ #else
+ fprintf(fp,"s/XHIDELOC/(False)/g\n");
+ #endif
+ #ifdef TRADE
+ fprintf(fp,"s/XTRADE/(True) /g\n");
+ #else
+ fprintf(fp,"s/XTRADE/(False)/g\n");
+ #endif
/* map sectors */
fprintf(fp,"s/ZMOUNTAIN/MOUNTAIN (%c)/g\n",MOUNTAIN);
fprintf(fp,"s/ZHILL/HILL (%c)/g\n",HILL);
***************
*** 143,148
fprintf(fp,"s/XFORTCOST/%ld/g\n",FORTCOST);
fprintf(fp,"s/XWARSHPCOST/%ld/g\n",WARSHPCOST);
fprintf(fp,"s/XMERSHPCOST/%ld/g\n",MERSHPCOST);
fprintf(fp,"s/XSHIPHOLD/%d/g\n",SHIPHOLD);
fprintf(fp,"s/XCITYLIMIT/%d/g\n",CITYLIMIT);
fprintf(fp,"s/XMILRATIO/%d/g\n",MILRATIO);
--- 153,159 -----
fprintf(fp,"s/XFORTCOST/%ld/g\n",FORTCOST);
fprintf(fp,"s/XWARSHPCOST/%ld/g\n",WARSHPCOST);
fprintf(fp,"s/XMERSHPCOST/%ld/g\n",MERSHPCOST);
+ fprintf(fp,"s/XSHIPCREW/%ld/g\n",SHIPCREW);
fprintf(fp,"s/XSHIPHOLD/%d/g\n",SHIPHOLD);
fprintf(fp,"s/XCITYLIMIT/%d/g\n",CITYLIMIT);
fprintf(fp,"s/XMILRATIO/%d/g\n",MILRATIO);
*** olddata.c Wed Jul 13 09:55:59 1988
--- data.c Wed Jul 13 09:56:15 1988
***************
*** 43,49
"trader", "tyrant", "demon", "dragon", "shadow"};
char *races[]= { "GOD","ORC","ELF","DWARF","LIZARD",
"HUMAN","PIRATE","BARBARIAN","NOMAD","UNKNOWN"};
! char *diploname[]= { "UNMET", "CONFEDERACY", "ALLIED", "FRIENDLY",
"NEUTRAL", "HOSTILE", "WAR", "JIHAD"};
char *soldname[]= { "","MARCH","SCOUT","ATTACK","DEFEND","GARRISON"};
--- 43,49 -----
"trader", "tyrant", "demon", "dragon", "shadow"};
char *races[]= { "GOD","ORC","ELF","DWARF","LIZARD",
"HUMAN","PIRATE","BARBARIAN","NOMAD","UNKNOWN"};
! char *diploname[]= { "UNMET", "CONFDRCY", "ALLIED", "FRIENDLY",
"NEUTRAL", "HOSTILE", "WAR", "JIHAD"};
char *soldname[]= { "","MARCH","SCOUT","ATTACK","DEFEND","GARRISON","TRADED"};
***************
*** 45,51
"HUMAN","PIRATE","BARBARIAN","NOMAD","UNKNOWN"};
char *diploname[]= { "UNMET", "CONFEDERACY", "ALLIED", "FRIENDLY",
"NEUTRAL", "HOSTILE", "WAR", "JIHAD"};
! char *soldname[]= { "","MARCH","SCOUT","ATTACK","DEFEND","GARRISON"};
char *unittype[]= {
"Militia", "Goblin", "Orc", "Infantry", "Sailor", "Marines", "Archer",
--- 45,51 -----
"HUMAN","PIRATE","BARBARIAN","NOMAD","UNKNOWN"};
char *diploname[]= { "UNMET", "CONFDRCY", "ALLIED", "FRIENDLY",
"NEUTRAL", "HOSTILE", "WAR", "JIHAD"};
! char *soldname[]= { "","MARCH","SCOUT","ATTACK","DEFEND","GARRISON","TRADED"};
char *unittype[]= {
"Militia", "Goblin", "Orc", "Infantry", "Sailor", "Marines", "Archer",
***************
*** 81,87
175, 150, 500, 500, 1000
};
- #ifdef ADMIN
int unitattack[]=
{ -25, -15, 0, 0, 0, 25, 0,
5, 20, 10, 15, 20, 10, 20,
--- 81,86 -----
175, 150, 500, 500, 1000
};
int unitattack[]=
{ -25, -15, 0, 0, 0, 25, 0,
5, 20, 10, 15, 20, 10, 20,
***************
*** 93,99
5, 20, 50, 40, 50
};
#ifdef ADMIN
- #endif ADMIN
int unitdefend[]=
{
-25, -15, 0, 0, 0, 25, 10,
--- 92,97 -----
5, 20, 50, 40, 50
};
#ifdef ADMIN
int unitdefend[]=
{
-25, -15, 0, 0, 0, 25, 10,
***************
*** 105,112
0, 10, 0, 15, 15,
5, 20, 50, 40, 50
};
- #ifdef ADMIN
- #endif ADMIN
/*ten times the move rate of a unit*/
int unitmove[]=
{
--- 103,108 -----
0, 10, 0, 15, 15,
5, 20, 50, 40, 50
};
/*ten times the move rate of a unit*/
int unitmove[]=
{
***************
*** 165,170
char *helpfile = "help";
char *newsfile = "news";
char *isonfile = "lock";
char *pwrname[] = {
"WARRIOR", "CAPTAIN", "WARLORD", "ARCHER", "CAVALRY", "SAPPER",
--- 161,169 -----
char *helpfile = "help";
char *newsfile = "news";
char *isonfile = "lock";
+ #ifdef TRADE
+ char *tradefile = "commerce";
+ #endif TRADE
char *pwrname[] = {
"WARRIOR", "CAPTAIN", "WARLORD", "ARCHER", "CAVALRY", "SAPPER",
***************
*** 174,180
"BREEDER", "URBAN", "STEEL", "NINJA", "SAILOR", "DEMOCRACY", "ROADS",
/* MAGICAL SKILLS */
"THE_VOID", "KNOWALL", "DESTROYER", "VAMPIRE",
! "SUMMON", "SUGGEST", "WYZARD", "SORCERER"
};
long powers[] = {
--- 173,179 -----
"BREEDER", "URBAN", "STEEL", "NINJA", "SAILOR", "DEMOCRACY", "ROADS",
/* MAGICAL SKILLS */
"THE_VOID", "KNOWALL", "DESTROYER", "VAMPIRE",
! "SUMMON", "WYZARD", "SORCERER", "ERROR"
};
long powers[] = {
*** oldmagic.c Wed Jul 13 09:55:57 1988
--- magic.c Wed Jul 13 09:56:16 1988
***************
*** 144,151
ntn[country].powers|=BREEDER;
return(BREEDER);
}
! else if(ntn[country].active >= 2) return(0L); /*npc nation*/
! else if((newpower==NINJA)
||(newpower==SLAVER)
||(newpower==SAILOR)
||(newpower==DEMOCRACY)
--- 144,152 -----
ntn[country].powers|=BREEDER;
return(BREEDER);
}
! else if(ntn[country].active >= 2) {
! return(0L); /* remaining powers only for pc's */
! } else if((newpower==NINJA)
||(newpower==SLAVER)
||(newpower==SAILOR)
||(newpower==DEMOCRACY)
***************
*** 150,158
||(newpower==SAILOR)
||(newpower==DEMOCRACY)
||(newpower==ROADS)
- ||(newpower==SUMMON)
- ||(newpower==WYZARD)
- ||(newpower==SORCERER)
||(newpower==SAPPER)
||(newpower==ARMOR)
||(newpower==AVIAN)){ /* these powers are only for pc's */
--- 151,156 -----
||(newpower==SAILOR)
||(newpower==DEMOCRACY)
||(newpower==ROADS)
||(newpower==SAPPER)
||(newpower==ARMOR)
||(newpower==AVIAN)){
***************
*** 155,161
||(newpower==SORCERER)
||(newpower==SAPPER)
||(newpower==ARMOR)
! ||(newpower==AVIAN)){ /* these powers are only for pc's */
if(magic(country,newpower)==TRUE) return(0L);
ntn[country].powers|=newpower;
return(newpower);
--- 153,159 -----
||(newpower==ROADS)
||(newpower==SAPPER)
||(newpower==ARMOR)
! ||(newpower==AVIAN)){
if(magic(country,newpower)==TRUE) return(0L);
ntn[country].powers|=newpower;
return(newpower);
***************
*** 160,166
ntn[country].powers|=newpower;
return(newpower);
}
! else return(0L);
}
#ifdef CONQUER
/*form to interactively get a magic power*/
--- 158,175 -----
ntn[country].powers|=newpower;
return(newpower);
}
! else if((newpower==SUMMON)||(newpower==WYZARD)||(newpower==SORCERER)){
! if(magic(country,SUMMON)!=TRUE) {
! ntn[country].powers|=SUMMON;
! return(SUMMON);
! } else if(magic(country,WYZARD)!=TRUE) {
! ntn[country].powers|=WYZARD;
! return(WYZARD);
! } else if(magic(country,SORCERER)!=TRUE) {
! ntn[country].powers|=SORCERER;
! return(SORCERER);
! } else return(0L);
! } else return(0L);
}
#ifdef CONQUER
/*form to interactively get a magic power*/
***************
*** 599,605
orctake(count)
int *count;
{
! int chance=0;
if((*count)>20) {
(*count)=2;
clear();
--- 608,614 -----
orctake(count)
int *count;
{
! int chance=0,done=TRUE,i;
if((*count)>20) {
(*count)=2;
clear();
***************
*** 604,611
(*count)=2;
clear();
}
! if(magic((*count)ry,MA_MONST)==TRUE) {
! mvaddstr((*count)++,0," You have a 10 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=10;
} else if(magic((*count)ry,AV_MONST)==TRUE) {
mvaddstr((*count)++,0," You have a 6 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
--- 613,620 -----
(*count)=2;
clear();
}
! if(magic(country,MA_MONST)==TRUE) {
! mvprintw((*count)++,0," You have a 10 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=10;
} else if(magic(country,AV_MONST)==TRUE) {
mvprintw((*count)++,0," You have a 6 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
***************
*** 607,614
if(magic((*count)ry,MA_MONST)==TRUE) {
mvaddstr((*count)++,0," You have a 10 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=10;
! } else if(magic((*count)ry,AV_MONST)==TRUE) {
! mvaddstr((*count)++,0," You have a 6 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=6;
} else if(magic((*count)ry,MI_MONST)==TRUE){
mvaddstr((*count)++,0," You have a 3 percent chance for %ld Jewels to take over other orcs",TAKEPRICE);
--- 616,623 -----
if(magic(country,MA_MONST)==TRUE) {
mvprintw((*count)++,0," You have a 10 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=10;
! } else if(magic(country,AV_MONST)==TRUE) {
! mvprintw((*count)++,0," You have a 6 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=6;
} else if(magic(country,MI_MONST)==TRUE){
mvprintw((*count)++,0," You have a 3 percent chance for %ld Jewels to take over other orcs",TAKEPRICE);
***************
*** 610,617
} else if(magic((*count)ry,AV_MONST)==TRUE) {
mvaddstr((*count)++,0," You have a 6 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=6;
! } else if(magic((*count)ry,MI_MONST)==TRUE){
! mvaddstr((*count)++,0," You have a 3 percent chance for %ld Jewels to take over other orcs",TAKEPRICE);
chance=3;
}
if(chance==0) return(1);
--- 619,626 -----
} else if(magic(country,AV_MONST)==TRUE) {
mvprintw((*count)++,0," You have a 6 percent chance for %ld Jewels take over other orcs",TAKEPRICE);
chance=6;
! } else if(magic(country,MI_MONST)==TRUE){
! mvprintw((*count)++,0," You have a 3 percent chance for %ld Jewels to take over other orcs",TAKEPRICE);
chance=3;
}
if(chance==0) return(TRUE);
***************
*** 614,620
mvaddstr((*count)++,0," You have a 3 percent chance for %ld Jewels to take over other orcs",TAKEPRICE);
chance=3;
}
! if(chance==0) return(1);
mvprintw((*count)++,0,"DO YOU WISH TO TAKE OVER AN ORC NPC NATION (enter y or n):");
refresh();
--- 623,629 -----
mvprintw((*count)++,0," You have a 3 percent chance for %ld Jewels to take over other orcs",TAKEPRICE);
chance=3;
}
! if(chance==0) return(TRUE);
mvaddstr((*count)++,0,"DO YOU WISH TO TAKE OVER AN ORC NPC NATION (enter y or n):");
refresh();
***************
*** 616,622
}
if(chance==0) return(1);
! mvprintw((*count)++,0,"DO YOU WISH TO TAKE OVER AN ORC NPC NATION (enter y or n):");
refresh();
if(getch()=='y'){
done=FALSE;
--- 625,631 -----
}
if(chance==0) return(TRUE);
! mvaddstr((*count)++,0,"DO YOU WISH TO TAKE OVER AN ORC NPC NATION (enter y or n):");
refresh();
if(getch()=='y'){
done=FALSE;
***************
*** 624,630
refresh();
i=get_number();
if(ntn[i].race==ORC){
! ntn[(*count)ry].jewels-=TAKEPRICE;
if((i=takeover(chance,i))==1)
mvprintw((*count)++,0," Successful: %d",i);
}
--- 633,639 -----
refresh();
i=get_number();
if(ntn[i].race==ORC){
! ntn[country].jewels-=TAKEPRICE;
if((i=takeover(chance,i))==1)
mvprintw((*count)++,0," Successful: %d",i);
}