smile@mhuxd.UUCP (Edward Barlow) (03/21/88)
*** oldnpc.c Fri Mar 18 17:27:18 1988 --- npc.c Fri Mar 18 17:27:24 1988 *************** *** 26,31 { int armynum,price; int x,y,i,z; prep(); --- 26,32 ----- { int armynum,price; int x,y,i,z; + long zz, getmagic(); prep(); *************** *** 108,114 else { peace=12; /*are they attacking or defending */ ! for(x=0;x<MAXNTN;x++) if(ntn[country].dstatus[x]>HOSTILE){ if(100*(ntn[country].tmil*(ntn[country].aplus+100))/((ntn[country].tmil*(ntn[country].aplus+100))+(ntn[x].tmil*(ntn[x].dplus+100)))>rand()%100){ /*attacker*/ for(armynum=1;armynum<MAXARM;armynum++) --- 109,116 ----- else { peace=12; /*are they attacking or defending */ ! if(ntn[country].tmil==0) defattr(); ! else for(x=0;x<MAXNTN;x++) if(ntn[country].dstatus[x]>HOSTILE){ if(100*(ntn[country].tmil*(ntn[country].aplus+100))/((ntn[country].tmil*(ntn[country].aplus+100))+(ntn[x].tmil*(ntn[x].dplus+100)))>rand()%100){ /*attacker*/ for(armynum=1;armynum<MAXARM;armynum++) *************** *** 162,170 for(armynum=1; armynum<num_powers(country); armynum++ ) price <<= 1; if(ntn[country].jewels > 2 * price) { ! if((z=getmagic())!=0){ ! fprintf(fnews,"2.\tnation %s gets magic power number %d\n",ntn[country].name,z); ! exenewmgk(z); ntn[country].jewels-=price; } else if((z=getmagic())!=0){ --- 164,172 ----- for(armynum=1; armynum<num_powers(country); armynum++ ) price <<= 1; if(ntn[country].jewels > 2 * price) { ! if((zz=getmagic())!=0){ ! fprintf(fnews,"2.\tnation %s gets magic power number %d\n",ntn[country].name,zz); ! exenewmgk(zz); ntn[country].jewels-=price; } else if((zz=getmagic())!=0){ *************** *** 167,175 exenewmgk(z); ntn[country].jewels-=price; } ! else if((z=getmagic())!=0){ ! fprintf(fnews,"2.\tnation %s gets magic power number %d\n",ntn[country].name,z); ! exenewmgk(z); ntn[country].jewels-=price; } else if((z=getmagic())!=0){ --- 169,177 ----- exenewmgk(zz); ntn[country].jewels-=price; } ! else if((zz=getmagic())!=0){ ! fprintf(fnews,"2.\tnation %s gets magic power number %d\n",ntn[country].name,zz); ! exenewmgk(zz); ntn[country].jewels-=price; } else if((zz=getmagic())!=0){ *************** *** 172,180 exenewmgk(z); ntn[country].jewels-=price; } ! else if((z=getmagic())!=0){ ! fprintf(fnews,"2.\tnation %s gets magic power number %d\n",ntn[country].name,z); ! exenewmgk(z); ntn[country].jewels-=price; } } --- 174,182 ----- exenewmgk(zz); ntn[country].jewels-=price; } ! else if((zz=getmagic())!=0){ ! fprintf(fnews,"2.\tnation %s gets magic power number %d\n",ntn[country].name,zz); ! exenewmgk(zz); ntn[country].jewels-=price; } } *************** *** 214,219 ||(sct[x][y].owner==NBARBARIAN) ||(sct[x][y].owner==NPIRATE)) attr[x][y]+=100; if(sct[ntn[country].capy][ntn[country].capy].owner!=country){ attr[ntn[country].capy][ntn[country].capy]=1000; } --- 216,228 ----- ||(sct[x][y].owner==NBARBARIAN) ||(sct[x][y].owner==NPIRATE)) attr[x][y]+=100; + for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) if(sct[x][y].owner!=0){ + if((ntn[country].dstatus[sct[x][y].owner]<WAR) + &&(abs(x-ntn[country].capx)>2) + &&(abs(y-ntn[country].capy)>2)) + attr[x][y]=1; + } + if(sct[ntn[country].capy][ntn[country].capy].owner!=country){ attr[ntn[country].capy][ntn[country].capy]=1000; } *************** *** 307,312 else if(sct[x][y].owner==nation) attr[x][y]+=60; } if(sct[ntn[country].capy][ntn[country].capy].owner!=country){ attr[ntn[country].capy][ntn[country].capy]=1000; } --- 316,330 ----- else if(sct[x][y].owner==nation) attr[x][y]+=60; } + + /* 1 if not aggressive and not within two of capital */ + for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) if(sct[x][y].owner!=0){ + if((ntn[country].dstatus[sct[x][y].owner]<WAR) + &&(abs(x-ntn[country].capx)>2) + &&(abs(y-ntn[country].capy)>2)) + attr[x][y]=1; + } + if(sct[ntn[country].capy][ntn[country].capy].owner!=country){ attr[ntn[country].capy][ntn[country].capy]=1000; } *************** *** 409,414 } } if(sct[ntn[country].capy][ntn[country].capy].owner!=country){ attr[ntn[country].capy][ntn[country].capy]=1000; } --- 427,440 ----- } } + /* 1 if not aggressive and not within two of capital */ + for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) if(sct[x][y].owner!=0){ + if((ntn[country].dstatus[sct[x][y].owner]<WAR) + &&(abs(x-ntn[country].capx)>2) + &&(abs(y-ntn[country].capy)>2)) + attr[x][y]=1; + } + if(sct[ntn[country].capy][ntn[country].capy].owner!=country){ attr[ntn[country].capy][ntn[country].capy]=1000; } *************** *** 566,571 /*move nomads randomly until within 2 of city then attack*/ country=NNOMAD; for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0){ x=AXLOC+rand()%4-2; y=AYLOC+rand()%4-2; if(ONMAP&&(is_habitable(x,y)) --- 592,599 ----- /*move nomads randomly until within 2 of city then attack*/ country=NNOMAD; for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0){ + ASOLD *= 11; + ASOLD /= 10; x=AXLOC+rand()%4-2; y=AYLOC+rand()%4-2; if(ONMAP&&(is_habitable(x,y)) *************** *** 590,596 if((rand()%4==0)&&(is_habitable(x,y))) { AXLOC=x; AYLOC=y; ! ASOLD=100+100*rand()%10; ATYPE=A_INFANTRY; ASTAT=ATTACK; } --- 618,624 ----- if((rand()%4==0)&&(is_habitable(x,y))) { AXLOC=x; AYLOC=y; ! ASOLD=100+100*(rand()%10); ATYPE=A_INFANTRY; ASTAT=ATTACK; } *************** *** 595,600 ASTAT=ATTACK; } } fprintf(fnews,"2.\t%s are updated\n",ntn[NPIRATE].name); /*if pirate fleet within 3 attack if outnumber any fleets */ for(nvynum=0;nvynum<MAXNAVY;nvynum++){ --- 623,634 ----- ASTAT=ATTACK; } } + country=NLIZARD; + for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0){ + ASOLD*=105; + ASOLD/=100; + } + country=NPIRATE; fprintf(fnews,"2.\t%s are updated\n",ntn[NPIRATE].name); /*if pirate fleet within 3 attack if outnumber any fleets */ for(nvynum=0;nvynum<MAXNAVY;nvynum++){ *************** *** 672,677 short x,y,armynum; int i, free, done, ideal; long diff; /*make sure enough men in army 0 -- garrison duty in capital*/ armynum=0; --- 706,712 ----- short x,y,armynum; int i, free, done, ideal; long diff; + int ok; /* code to check and move armies back if they are too far out */ for(armynum=1;armynum<MAXARM;armynum++) if(ASOLD>0){ *************** *** 673,678 int i, free, done, ideal; long diff; /*make sure enough men in army 0 -- garrison duty in capital*/ armynum=0; ASTAT=GARRISON; --- 708,725 ----- long diff; int ok; + /* code to check and move armies back if they are too far out */ + for(armynum=1;armynum<MAXARM;armynum++) if(ASOLD>0){ + ok = 0; + for(x=AXLOC-3;x<=AXLOC+3;x++) + for(y=AYLOC-3;y<=AYLOC+3;y++) + if((ONMAP)&&(sct[x][y].owner==country)) ok=1; + if(ok==0){ + AXLOC=ntn[country].capx; + AYLOC=ntn[country].capy; + } + } + /*make sure enough men in army 0 -- garrison duty in capital*/ armynum=0; ASTAT=GARRISON; *************** *** 827,829 } } } --- 874,877 ----- } } } + *** oldreports.c Fri Mar 18 17:27:18 1988 --- reports.c Fri Mar 18 17:27:24 1988 *************** *** 333,343 else if(sct[xsctr][ysctr].designation==DCITY) incity+= sct[xsctr][ysctr].people; } ! revfood *= TAXFOOD / 100; ! reviron *= TAXIRON / 100; ! revgold *= TAXGOLD / 100; ! revcap = (long) incap * TAXCAP / 100; ! revcity = (long) incity * TAXCITY / 100; if( magic(country,ARCHITECT) ) { revcap *= 2; revcity *= 2; --- 333,343 ----- else if(sct[xsctr][ysctr].designation==DCITY) incity+= sct[xsctr][ysctr].people; } ! revfood *= TAXFOOD / 100L; ! reviron *= TAXIRON / 100L; ! revgold *= TAXGOLD / 100L; ! revcap = (long) incap * TAXCAP / 100L; ! revcity = (long) incity * TAXCITY / 100L; if( magic(country,ARCHITECT) ) { revcap *= 2; revcity *= 2; *************** *** 365,371 mvprintw(10,30,"%5d people in capital: %8ld",incap,revcap); mvprintw(11,30,"%5d people in cities: %8ld",incity,revcity); standout(); ! mvprintw(12,30,"%5ld people TOTAL INCOME: %8ld",ntn[country].tciv,revfood+reviron+revgold+(incap*TAXCAP/100)+(incity*TAXCITY/100)); standend(); if(magic(country,VAMPIRE)!=1) --- 365,371 ----- mvprintw(10,30,"%5d people in capital: %8ld",incap,revcap); mvprintw(11,30,"%5d people in cities: %8ld",incity,revcity); standout(); ! mvprintw(12,30,"%5ld people TOTAL INCOME: %8ld",ntn[country].tciv,(long) revfood+reviron+revgold+(incap*TAXCAP/100L)+(incity*TAXCITY/100L)); standend(); if(magic(country,VAMPIRE)!=1) *************** *** 369,375 standend(); if(magic(country,VAMPIRE)!=1) ! mvprintw(14,30,"%5d troops: %8d",nosold,expsold); else mvprintw(14,30,"%5d troops at 0 each:0",nosold); mvprintw(15,30,"%5d ships at %5d each: %8d",expship,SHIPMAINT,expship*SHIPMAINT); --- 369,375 ----- standend(); if(magic(country,VAMPIRE)!=1) ! mvprintw(14,30,"%5d troops: %8ld",nosold,expsold); else mvprintw(14,30,"%5d troops at 0 each:0",nosold); mvprintw(15,30,"%5d ships at %5d each: %8ld",expship,SHIPMAINT,expship*SHIPMAINT); *************** *** 372,378 mvprintw(14,30,"%5d troops: %8d",nosold,expsold); else mvprintw(14,30,"%5d troops at 0 each:0",nosold); ! mvprintw(15,30,"%5d ships at %5d each: %8d",expship,SHIPMAINT,expship*SHIPMAINT); mvprintw(16,30,"other expenses this turn: %8ld",startgold-ntn[country].tgold); standout(); if(magic(country,VAMPIRE)!=1) { --- 372,378 ----- mvprintw(14,30,"%5d troops: %8ld",nosold,expsold); else mvprintw(14,30,"%5d troops at 0 each:0",nosold); ! mvprintw(15,30,"%5d ships at %5d each: %8ld",expship,SHIPMAINT,expship*SHIPMAINT); mvprintw(16,30,"other expenses this turn: %8ld",startgold-ntn[country].tgold); standout(); if(magic(country,VAMPIRE)!=1) { *************** *** 377,383 standout(); if(magic(country,VAMPIRE)!=1) { mvprintw(17,30,"TOTAL EXPENSES: %8ld",expsold+(expship*SHIPMAINT)+startgold-ntn[country].tgold); ! mvprintw(18,30,"NET INCOME: %8ld",revfood+reviron+revgold+(incap*TAXCAP/100)+(incity*TAXCITY/100)-expsold-(expship*SHIPMAINT)-startgold+ntn[country].tgold); } else { mvprintw(17,30,"TOTAL EXPENSES: %8ld",(expship*SHIPMAINT)+startgold-ntn[country].tgold); mvprintw(18,30,"NET INCOME: %8ld",revfood+reviron+revgold+(incap*TAXCAP/100)+(incity*TAXCITY/100)-(expship*SHIPMAINT)-startgold+ntn[country].tgold); --- 377,383 ----- standout(); if(magic(country,VAMPIRE)!=1) { mvprintw(17,30,"TOTAL EXPENSES: %8ld",expsold+(expship*SHIPMAINT)+startgold-ntn[country].tgold); ! mvprintw(18,30,"NET INCOME: %8ld",(long) revfood+reviron+revgold+(incap*TAXCAP/100L)+(incity*TAXCITY/100L)-expsold-(expship*SHIPMAINT)-startgold+ntn[country].tgold); } else { mvprintw(17,30,"TOTAL EXPENSES: %8ld",(expship*SHIPMAINT)+startgold-ntn[country].tgold); mvprintw(18,30,"NET INCOME: %8ld",(long) revfood+reviron+revgold+(incap*TAXCAP/100L)+(incity*TAXCITY/100L)-(expship*SHIPMAINT)-startgold+ntn[country].tgold); *************** *** 380,386 mvprintw(18,30,"NET INCOME: %8ld",revfood+reviron+revgold+(incap*TAXCAP/100)+(incity*TAXCITY/100)-expsold-(expship*SHIPMAINT)-startgold+ntn[country].tgold); } else { mvprintw(17,30,"TOTAL EXPENSES: %8ld",(expship*SHIPMAINT)+startgold-ntn[country].tgold); ! mvprintw(18,30,"NET INCOME: %8ld",revfood+reviron+revgold+(incap*TAXCAP/100)+(incity*TAXCITY/100)-(expship*SHIPMAINT)-startgold+ntn[country].tgold); } mvaddstr(20,(COLS/2)-13,"HIT 'P' TO SEE PRODUCTION STATS"); --- 380,386 ----- mvprintw(18,30,"NET INCOME: %8ld",(long) revfood+reviron+revgold+(incap*TAXCAP/100L)+(incity*TAXCITY/100L)-expsold-(expship*SHIPMAINT)-startgold+ntn[country].tgold); } else { mvprintw(17,30,"TOTAL EXPENSES: %8ld",(expship*SHIPMAINT)+startgold-ntn[country].tgold); ! mvprintw(18,30,"NET INCOME: %8ld",(long) revfood+reviron+revgold+(incap*TAXCAP/100L)+(incity*TAXCITY/100L)-(expship*SHIPMAINT)-startgold+ntn[country].tgold); } mvaddstr(20,(COLS/2)-13,"HIT 'P' TO SEE PRODUCTION STATS"); *** oldmisc.c Fri Mar 18 17:26:48 1988 --- misc.c Fri Mar 18 17:27:24 1988 *************** *** 7,13 char *memset(); #endif ! int powers[] = { WARRIOR, CAPTAIN, WARLORD, --- 7,13 ----- char *memset(); #endif ! long powers[] = { WARRIOR, CAPTAIN, WARLORD, *************** *** 83,89 register int country; struct army *a; ! for( country = 0; country < 32; country++ ) { nptr = &ntn[country]; if( nptr->tiron < 0.0 ) { --- 83,89 ----- register int country; struct army *a; ! for( country = 0; country < NTOTAL; country++ ) { nptr = &ntn[country]; if( nptr->tiron < 0.0 ) { *************** *** 87,93 nptr = &ntn[country]; if( nptr->tiron < 0.0 ) { ! fprintf( stderr, "file %s: line %d: ntn[%d].tiron = %ld\n", __file__, __line__, country, nptr->tiron ); } --- 87,93 ----- nptr = &ntn[country]; if( nptr->tiron < 0.0 ) { ! fprintf( stderr, "file %s: line %d: nation[%d] iron = %ld\n", __file__, __line__, country, nptr->tiron ); } *************** *** 92,98 } if( nptr->jewels < 0 ) { ! fprintf( stderr, "file %s: line %d: ntn[%d].jewels = %ld\n", __file__, __line__, country, nptr->jewels ); } --- 92,98 ----- } if( nptr->jewels < 0 ) { ! fprintf( stderr, "file %s: line %d: nation[%d] jewels = %ld\n", __file__, __line__, country, nptr->jewels ); } *************** *** 99,105 for( i = 0; i < MAXARM; i++ ) { a = &nptr->arm[i]; if( a->sold < 0 ) { ! fprintf( stderr, "file %s: line %d: ntn[%d].arm[%d].sold = %d\n", __file__, __line__, country, i, nptr->arm[i].sold ); nptr->arm[i].sold = 0; } --- 99,105 ----- for( i = 0; i < MAXARM; i++ ) { a = &nptr->arm[i]; if( a->sold < 0 ) { ! fprintf( stderr, "file %s: line %d: nation[%d] army[%d] sold = %d\n", __file__, __line__, country, i, nptr->arm[i].sold ); nptr->arm[i].sold = 0; } *************** *** 104,110 nptr->arm[i].sold = 0; } if( a->xloc < 0 || a->xloc >= MAPX ) { ! fprintf( stderr, "file %s: line %d: ntn[%d].arm[%d].xloc = %d\n", __file__, __line__, country, i, nptr->arm[i].xloc ); nptr->arm[i].xloc = 0; } --- 104,110 ----- nptr->arm[i].sold = 0; } if( a->xloc < 0 || a->xloc >= MAPX ) { ! fprintf( stderr, "file %s: line %d: nation[%d] army[%d] xlocation = %d\n", __file__, __line__, country, i, nptr->arm[i].xloc ); nptr->arm[i].xloc = 0; } *************** *** 109,115 nptr->arm[i].xloc = 0; } if( a->yloc < 0 || a->yloc >= MAPY ) { ! fprintf( stderr, "file %s: line %d: ntn[%d].arm[%d].yloc = %d\n", __file__, __line__, country, i, nptr->arm[i].yloc ); nptr->arm[i].yloc = 0; } --- 109,115 ----- nptr->arm[i].xloc = 0; } if( a->yloc < 0 || a->yloc >= MAPY ) { ! fprintf( stderr, "file %s: line %d: nation[%d] army[%d] ylocation = %d\n", __file__, __line__, country, i, nptr->arm[i].yloc ); nptr->arm[i].yloc = 0; } *************** *** 115,121 } } /* for */ ! for( i = 0; i < 32; i++ ) { if( nptr->dstatus[i] > JIHAD ) { fprintf( stderr, "file %s: line %d: ntn[%d].dstatus[%d] = %d\n", __file__, __line__, country, i, nptr->dstatus[i] ); --- 115,121 ----- } } /* for */ ! for( i = 0; i < NTOTAL; i++ ) { if( nptr->dstatus[i] > JIHAD ) { fprintf( stderr, "file %s: line %d: nation[%d] diplomatic status with %d = %d\n", __file__, __line__, country, i, nptr->dstatus[i] ); *************** *** 117,123 for( i = 0; i < 32; i++ ) { if( nptr->dstatus[i] > JIHAD ) { ! fprintf( stderr, "file %s: line %d: ntn[%d].dstatus[%d] = %d\n", __file__, __line__, country, i, nptr->dstatus[i] ); nptr->dstatus[i] = WAR; } --- 117,123 ----- for( i = 0; i < NTOTAL; i++ ) { if( nptr->dstatus[i] > JIHAD ) { ! fprintf( stderr, "file %s: line %d: nation[%d] diplomatic status with %d = %d\n", __file__, __line__, country, i, nptr->dstatus[i] ); nptr->dstatus[i] = WAR; } *************** *** 122,128 nptr->dstatus[i] = WAR; } if( nptr->dstatus[i] < UNMET ) { ! fprintf( stderr, "file %s: line %d: ntn[%d].dstatus[%d] = %d\n", __file__, __line__, country, i, nptr->dstatus[i] ); nptr->dstatus[i] = UNMET; } --- 122,128 ----- nptr->dstatus[i] = WAR; } if( nptr->dstatus[i] < UNMET ) { ! fprintf( stderr, "file %s: line %d: nation[%d] diplomatic status with %d = %d\n", __file__, __line__, country, i, nptr->dstatus[i] ); nptr->dstatus[i] = UNMET; } *************** *** 565,571 /* miner */ { 0, 0, 5, 0, 10, 10, 1, 5 }, }; ! int score_one( country ) int country; { --- 565,571 ----- /* miner */ { 0, 0, 5, 0, 10, 10, 1, 5 }, }; ! long score_one( country ) int country; { *** oldrandevent.c Fri Mar 18 17:26:58 1988 --- randevent.c Fri Mar 18 17:27:24 1988 *************** *** 65,71 strcpy(ntn[newntn].leader,"rebel"); strcpy(ntn[newntn].passwd,ntn[0].passwd); ntn[newntn].class=0; ! ntn[newntn].score=0; ntn[newntn].tsctrs=0; ntn[newntn].active=2; return(newntn); --- 65,71 ----- strcpy(ntn[newntn].leader,"rebel"); strcpy(ntn[newntn].passwd,ntn[0].passwd); ntn[newntn].class=0; ! ntn[newntn].score=0L; ntn[newntn].tsctrs=0; ntn[newntn].active=2; return(newntn); *************** *** 192,198 int randomevent() { ! int count, totalscore=0, event, newnation, i, j, armynum; int done; /*if 1 then event happened */ int newpower; --- 192,199 ----- int randomevent() { ! long totalscore=0; ! int count, event, newnation, i, j, armynum; int done; /*if 1 then event happened */ long newpower, getmagic(); *************** *** 194,200 { int count, totalscore=0, event, newnation, i, j, armynum; int done; /*if 1 then event happened */ ! int newpower; printf("RANDOM HAPPENINGS ARE NOW BEING CHECKED\n"); for(country=0;country<MAXNTN;country++) if ( ntn[country].active != 0 ) --- 195,201 ----- long totalscore=0; int count, event, newnation, i, j, armynum; int done; /*if 1 then event happened */ ! long newpower, getmagic(); printf("RANDOM HAPPENINGS ARE NOW BEING CHECKED\n"); for(country=0;country<MAXNTN;country++) if ( ntn[country].active != 0 ) *************** *** 203,209 /* decide what nations get random event */ for(country=0;country<MAXNTN;country++) if (( ntn[country].active != 0 ) ! &&(ntn[country].score > 20) &&((rand()%totalscore) < NORANDEVENTS * ntn[country].score)){ event = rand()%(MAXRANEVENT+1); done=1; --- 204,210 ----- /* decide what nations get random event */ for(country=0;country<MAXNTN;country++) if (( ntn[country].active != 0 ) ! &&(ntn[country].score > 20L) &&((rand()%totalscore) < NORANDEVENTS * ntn[country].score)){ event = rand()%(MAXRANEVENT+1); done=1; *************** *** 344,350 else if((is_habitable(i,j)) && ( sct[i][j].owner == country)) { ntn[NNOMAD].arm[armynum].xloc =i; ntn[NNOMAD].arm[armynum].yloc =j; ! ntn[NNOMAD].arm[armynum].sold =300+200*rand()%10; ntn[NNOMAD].arm[armynum].unittyp = A_CAVALRY; ntn[NNOMAD].arm[armynum].stat =ATTACK; count += 100; --- 345,351 ----- else if((is_habitable(i,j)) && ( sct[i][j].owner == country)) { ntn[NNOMAD].arm[armynum].xloc =i; ntn[NNOMAD].arm[armynum].yloc =j; ! ntn[NNOMAD].arm[armynum].sold =300+200*(rand()%10); ntn[NNOMAD].arm[armynum].unittyp = A_CAVALRY; ntn[NNOMAD].arm[armynum].stat =ATTACK; count += 100; *************** *** 387,394 case 31: /*new magic item + RANDOM POWER*/ /*buy new powers and/or new weapons*/ if((newpower=getmagic())!=0){ ! printf("\tnation %s gets magic power number %d\n",ntn[country].name,newpower); ! fprintf(fnews,"1. \tevent in %s -> gets magic power number %d\n", ntn[country].name,newpower); exenewmgk(newpower); } else done=0; --- 388,395 ----- case 31: /*new magic item + RANDOM POWER*/ /*buy new powers and/or new weapons*/ if((newpower=getmagic())!=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=0; *************** *** 459,464 ASOLD *= (8); ASOLD /= (10); } default: printf("error condition -- illegal random event\n"); break; --- 460,466 ----- ASOLD *= (8); ASOLD /= (10); } + break; default: printf("error condition -- illegal random event\n"); break; *** oldheader.h Fri Mar 18 17:27:18 1988 --- header.h Fri Mar 18 17:27:24 1988 *************** *** 17,22 562 Clubhouse Dr, Middletown NJ 07748 5) you agree to use your best efforts to see that any user of conquer complies with the terms and conditions stated above. 6) The above copyright notice will not be tampered with in any form. --- 17,24 ----- 562 Clubhouse Dr, Middletown NJ 07748 + My home phone is 201-671-2896. Use it sparingly and call + before 11PM if it is important. 5) you agree to use your best efforts to see that any user of conquer complies with the terms and conditions stated above. 6) The above copyright notice will not be tampered with in any form. *************** *** 34,40 /*-------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING-------------*/ ! #define VERSION "version 2.1" /*version number of the game*/ #define SYSV /*comment this line out if on a BSD machine*/ #define PWATER 45 /*percentage of water in the world*/ #define MAPX 48 /*Number of X Sectors on Map (divisible by 8)*/ --- 36,42 ----- /*-------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING-------------*/ ! #define VERSION "version 2.2" /*version number of the game*/ #define SYSV /*comment this line out if on a BSD machine*/ #define PWATER 45 /*percentage of water in the world*/ #define MAPX 48 /*Number of X Sectors on Map (divisible by 8)*/ *************** *** 39,44 #define PWATER 45 /*percentage of water in the world*/ #define MAPX 48 /*Number of X Sectors on Map (divisible by 8)*/ #define MAPY 48 /*Number of Y Sectors on Map (divisible by 8)*/ #define MAXNTN 28 /*number of nations (including player & npc ntns)*/ /*but not including pirates...*/ #define MAXPTS 40 /*points to buy stuff in beginning with*/ --- 41,47 ----- #define PWATER 45 /*percentage of water in the world*/ #define MAPX 48 /*Number of X Sectors on Map (divisible by 8)*/ #define MAPY 48 /*Number of Y Sectors on Map (divisible by 8)*/ + /*MAPX and MAPY must be >= 24*/ #define MAXNTN 28 /*number of nations (including player & npc ntns)*/ /*but not including pirates...*/ #define MAXPTS 40 /*points to buy stuff in beginning with*/ *************** *** 68,76 /*Below taxation rates are in thousand dollars (US 1985) per 100 humans per *point of whatever -- ie 1 person in veg of 9 means produce $70x9=630K *thousand dollars */ ! #define TAXFOOD 100 ! #define TAXIRON 100 ! #define TAXGOLD 100 /*city and capital tax rates based on people only (no multipleier)*/ #define TAXCAP 1000 #define TAXCITY 750 --- 71,79 ----- /*Below taxation rates are in thousand dollars (US 1985) per 100 humans per *point of whatever -- ie 1 person in veg of 9 means produce $70x9=630K *thousand dollars */ ! #define TAXFOOD 100L ! #define TAXIRON 100L ! #define TAXGOLD 100L /*city and capital tax rates based on people only (no multipleier)*/ #define TAXCAP 1000L #define TAXCITY 750L *************** *** 72,79 #define TAXIRON 100 #define TAXGOLD 100 /*city and capital tax rates based on people only (no multipleier)*/ ! #define TAXCAP 1000 ! #define TAXCITY 750 #define SHIPMAINT 1000 /*ship mainatinance cost*/ --- 75,82 ----- #define TAXIRON 100L #define TAXGOLD 100L /*city and capital tax rates based on people only (no multipleier)*/ ! #define TAXCAP 1000L ! #define TAXCITY 750L #define SHIPMAINT 1000L /*ship mainatinance cost*/ *************** *** 75,81 #define TAXCAP 1000 #define TAXCITY 750 ! #define SHIPMAINT 1000 /*ship mainatinance cost*/ #define DESCOST 300L /*cost to redesignatie*/ /*this is also the iron cost for cities*/ --- 78,84 ----- #define TAXCAP 1000L #define TAXCITY 750L ! #define SHIPMAINT 1000L /*ship mainatinance cost*/ #define DESCOST 300L /*cost to redesignatie*/ /*this is also the iron cost for cities*/ *************** *** 79,87 #define DESCOST 300L /*cost to redesignatie*/ /*this is also the iron cost for cities*/ ! #define FORTCOST 1000 /*cost to build a fort point*/ ! #define WARSHPCOST 10000 /*cost to build one warship*/ ! #define MERSHPCOST 20000 /*cost to build one merchant*/ #define SHIPHOLD 300 /*number of humans a merchant can hold*/ #define CITYLIMIT 8 /*% of ntns people in sector before => city*/ #define MILRATIO 5 /*ratio mil:civ for non player countries*/ --- 82,90 ----- #define DESCOST 300L /*cost to redesignatie*/ /*this is also the iron cost for cities*/ ! #define FORTCOST 1000L /*cost to build a fort point*/ ! #define WARSHPCOST 10000L /*cost to build one warship*/ ! #define MERSHPCOST 20000L /*cost to build one merchant*/ #define SHIPHOLD 300 /*number of humans a merchant can hold*/ #define CITYLIMIT 8 /*% of ntns people in sector before => city*/ #define MILRATIO 5 /*ratio mil:civ for non player countries*/ *** olddata.h Fri Mar 18 17:27:19 1988 --- data.h Fri Mar 18 17:27:24 1988 *************** *** 92,101 #define NAMELTH 9 /*one less than the characters in the name*/ #define LEADERLTH 9 /*one less than the characters in the leader*/ - /*IN THE FUTURE ARMIES AND NAVIES SHOULD BE IN THE SAME STRUCTURE (UNITS) - *units could include cavalry, militia, navies, armies, garrisons, and leaders - *struct unit */ - struct navy { short warships; --- 92,97 ----- #define NAMELTH 9 /*one less than the characters in the name*/ #define LEADERLTH 9 /*one less than the characters in the leader*/ struct navy { short warships; *************** *** 103,108 short xloc; short yloc; short smove; }; #define A_MILITIA 0 --- 99,107 ----- short xloc; short yloc; short smove; + short unittyp; /* for future usage */ + short crew; /* for future usage */ + short soldiers; /* for future usage */ }; #define A_MILITIA 0 *************** *** 156,162 short dplus; /* attack plus of all soldiers*/ short maxmove; /* maximum movement of soldiers*/ short repro; /* reproduction rate of nation*/ ! short score; /* score */ long tgold; /* gold in treasury */ long jewels; /* raw amount of gold in treasury */ long tmil; /* total military */ --- 155,161 ----- short dplus; /* attack plus of all soldiers*/ short maxmove; /* maximum movement of soldiers*/ short repro; /* reproduction rate of nation*/ ! long score; /* score */ long tgold; /* gold in treasury */ long jewels; /* raw amount of gold in treasury */ long tmil; /* total military */ *************** *** 234,240 #define DESTRY 25 #define DESTROY fprintf(fexe,"DESTROY \t%d \t%d \t%hd \t0 \t0 \t%s\n",DESTRY,save,country,"null") ! #define CHGMGK fprintf(fexe,"L_MAGIC \t%d \t%hd \t%ld \t%d \t0 \t%s\n",CHG_MGK,country,ntn[country].powers,x,"null") #define I_APLUS fprintf(fexe,"INC_APLUS \t%d \t%hd \t0 \t0 \t0 \t%s\n",INCAPLUS,country,"null") #define I_DPLUS fprintf(fexe,"INC_DPLUS \t%d \t%hd \t0 \t0 \t0 \t%s\n",INCDPLUS,country,"null") #define AADJSTAT fprintf(fexe,"A_STAT \t%d \t%hd \t%d \t%d \t0 \t%s\n",XASTAT,country,armynum,ntn[country].arm[armynum].stat,"null") --- 233,239 ----- #define DESTRY 25 #define DESTROY fprintf(fexe,"DESTROY \t%d \t%d \t%hd \t0 \t0 \t%s\n",DESTRY,save,country,"null") ! #define CHGMGK fprintf(fexe,"L_MAGIC \t%d \t%hd \t%ld \t%ld \t0 \t%s\n",CHG_MGK,country,ntn[country].powers,x,"null") #define I_APLUS fprintf(fexe,"INC_APLUS \t%d \t%hd \t0 \t0 \t0 \t%s\n",INCAPLUS,country,"null") #define I_DPLUS fprintf(fexe,"INC_DPLUS \t%d \t%hd \t0 \t0 \t0 \t%s\n",INCDPLUS,country,"null") #define AADJSTAT fprintf(fexe,"A_STAT \t%d \t%hd \t%d \t%d \t0 \t%s\n",XASTAT,country,armynum,ntn[country].arm[armynum].stat,"null") *************** *** 254,280 #define SADJOWN fprintf(fexe,"S_AOWN \t%d \t%hd \t0 \t%d \t%d \t%s\n",XSAOWN ,country,xcurs+xoffset,ycurs+yoffset,"null") #define EADJDIP fprintf(fexe,"E_ADJ \t%d \t%hd \t%d \t%d \t0 \t%s\n",EDADJ,country,nation,ntn[country].dstatus[nation],"null") ! #define WARRIOR 0x000001 ! #define CAPTAIN 0x000002 ! #define WARLORD 0x000004 ! #define MI_MONST 0x000008 ! #define AV_MONST 0x000010 ! #define MA_MONST 0x000020 ! #define SPY 0x000040 ! #define KNOWALL 0x000080 ! #define DERVISH 0x000100 ! #define DESTROYER 0x000200 ! #define HIDDEN 0x000400 ! #define THE_VOID 0x000800 ! #define ARCHITECT 0x001000 ! #define VAMPIRE 0x002000 ! #define HEALER 0x004000 ! #define MINER 0x008000 ! #define URBAN 0x010000 ! #define STEEL 0x020000 ! #define ARCHER 0x040000 ! #define CAVALRY 0x080000 ! #define BREEDER 0x100000 #define MAXPOWER 21 /* number of powers */ --- 253,279 ----- #define SADJOWN fprintf(fexe,"S_AOWN \t%d \t%hd \t0 \t%d \t%d \t%s\n",XSAOWN ,country,xcurs+xoffset,ycurs+yoffset,"null") #define EADJDIP fprintf(fexe,"E_ADJ \t%d \t%hd \t%d \t%d \t0 \t%s\n",EDADJ,country,nation,ntn[country].dstatus[nation],"null") ! #define WARRIOR 0x000001L ! #define CAPTAIN 0x000002L ! #define WARLORD 0x000004L ! #define MI_MONST 0x000008L ! #define AV_MONST 0x000010L ! #define MA_MONST 0x000020L ! #define SPY 0x000040L ! #define KNOWALL 0x000080L ! #define DERVISH 0x000100L ! #define DESTROYER 0x000200L ! #define HIDDEN 0x000400L ! #define THE_VOID 0x000800L ! #define ARCHITECT 0x001000L ! #define VAMPIRE 0x002000L ! #define HEALER 0x004000L ! #define MINER 0x008000L ! #define URBAN 0x010000L ! #define STEEL 0x020000L ! #define ARCHER 0x040000L ! #define CAVALRY 0x080000L ! #define BREEDER 0x100000L #define MAXPOWER 21 /* number of powers */ *** oldnations Fri Mar 18 17:26:53 1988 --- nations Fri Mar 18 17:27:25 1988 *** oldMakefile Fri Mar 18 17:27:20 1988 --- Makefile Fri Mar 18 17:27:25 1988 *************** *** 3,8 MAKE = /bin/make CC = /bin/cc # This directory is where nations & help will be stored. It is also # the default directory = where players will play if they do not use # the -d option. --- 3,10 ----- MAKE = /bin/make CC = /bin/cc + # This should be installed by "games" or "root" + # This directory is where nations & help will be stored. It is also # the default directory = where players will play if they do not use # the -d option. *************** *** 6,12 # This directory is where nations & help will be stored. It is also # the default directory = where players will play if they do not use # the -d option. ! DEFAULT = /d7/c7913/smile/game/default #CFLAGS = -O CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -O --- 8,14 ----- # This directory is where nations & help will be stored. It is also # the default directory = where players will play if they do not use # the -d option. ! DEFAULT = /c28/smile/game/default #CFLAGS = -O CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -O *************** *** 22,28 LDFLAGS = $(LLDFLAGS) # This directory is where the executable should be stored ! EXECUTABLE = /d7/c7913/smile/game/runv # This directory is where individual Conquer game data will be stored. # Multiple games are now supported. Each should have its own directory. --- 24,30 ----- LDFLAGS = $(LLDFLAGS) # This directory is where the executable should be stored ! EXECUTABLE = /c28/smile/game/runv # This directory is where individual Conquer game data will be stored. # Multiple games are now supported. Each should have its own directory. *************** *** 26,32 # This directory is where individual Conquer game data will be stored. # Multiple games are now supported. Each should have its own directory. ! DATA = /d7/c7913/smile/game/runv/lib OBJ=combat.o commands.o cexecute.o forms.o io.o main.o makeworld.o move.o newlogin.o update.o magic.o npc.o reports.o misc.o randevent.o FILS=combat.c commands.c cexecute.c forms.c io.c main.c makeworld.c move.c newlogin.c update.c magic.c npc.c reports.c misc.c randevent.c --- 28,34 ----- # This directory is where individual Conquer game data will be stored. # Multiple games are now supported. Each should have its own directory. ! DATA = /c28/smile/game/runv/lib OBJ= combat.o commands.o cexecute.o forms.o io.o main.o makeworld.o move.o \ newlogin.o update.o magic.o npc.o reports.o misc.o randevent.o *************** *** 28,35 # Multiple games are now supported. Each should have its own directory. DATA = /d7/c7913/smile/game/runv/lib ! OBJ=combat.o commands.o cexecute.o forms.o io.o main.o makeworld.o move.o newlogin.o update.o magic.o npc.o reports.o misc.o randevent.o ! FILS=combat.c commands.c cexecute.c forms.c io.c main.c makeworld.c move.c newlogin.c update.c magic.c npc.c reports.c misc.c randevent.c HEADERS=header.h data.h SUPT1=nations Makefile help README run man.page SUPT2=execute messages news --- 30,39 ----- # Multiple games are now supported. Each should have its own directory. DATA = /c28/smile/game/runv/lib ! OBJ= combat.o commands.o cexecute.o forms.o io.o main.o makeworld.o move.o \ ! newlogin.o update.o magic.o npc.o reports.o misc.o randevent.o ! FILS=combat.c commands.c cexecute.c forms.c io.c main.c makeworld.c move.c \ ! newlogin.c update.c magic.c npc.c reports.c misc.c randevent.c HEADERS=header.h data.h SUPT1=nations Makefile help README run man.page SUPT2=execute messages news *************** *** 36,41 all: $(OBJ) @echo phew... @echo if the next command does not compile you might also need -ltermcap $(CC) $(CFLAGS) $(LDFLAGS) -o $(EXECUTABLE)/conquer $(OBJ) $(LIBRARIES) @echo YAY! make install if this is your !first! time. This will set up --- 40,46 ----- all: $(OBJ) @echo phew... + - mkdir $(EXECUTABLE) @echo if the next command does not compile you might also need -ltermcap $(CC) $(CFLAGS) $(LDFLAGS) -o $(EXECUTABLE)/conquer $(OBJ) $(LIBRARIES) @echo YAY! make install if this is your !first! time. This will set up *************** *** 55,79 clean: $(RM) shar1 shar2 shar3 *.o core ! install: ! -if test -d $(EXECUTABLE) ; \ ! then echo "EXECUTABLE DIRECTORY OK" ; \ ! else mkdir $(EXECUTABLE) ; \ ! fi ! -if test -d $(DATA) ; \ ! then echo "DATA DIRECTORY OK" ; \ ! else mkdir $(DATA) ; \ ! fi ! -if test -d $(DEFAULT) ; \ ! then echo "DEFAULT DIRECTORY OK" ; \ ! else mkdir $(DEFAULT) ; \ ! fi ! cp help $(DEFAULT)/help ! cp nations $(DEFAULT)/nations ! cp help $(DATA)/help ! cp nations $(DATA)/nations ! cp run $(DATA)/run ! chmod 0777 $(EXECUTABLE) $(DATA) $(EXECUTABLE)/conquer $(EXECUTABLE)/conquer -d$(DATA) -m chmod 0700 $(DATA)/run chmod 0644 $(DATA)/help $(DATA)/news --- 60,74 ----- clean: $(RM) shar1 shar2 shar3 *.o core ! install: all ! chmod 4755 $(EXECUTABLE)/conquer ! chmod 0700 run ! chmod 0644 help run ! - mkdir $(DATA) ! chmod 777 $(DATA) $(EXECUTABLE) ! cp help nations run $(DATA) ! - mkdir $(DEFAULT) ! cp help nations $(DEFAULT) $(EXECUTABLE)/conquer -d$(DATA) -m lint: *************** *** 75,82 cp run $(DATA)/run chmod 0777 $(EXECUTABLE) $(DATA) $(EXECUTABLE)/conquer $(EXECUTABLE)/conquer -d$(DATA) -m - chmod 0700 $(DATA)/run - chmod 0644 $(DATA)/help $(DATA)/news lint: lint -u $(FILS) --- 70,75 ----- - mkdir $(DEFAULT) cp help nations $(DEFAULT) $(EXECUTABLE)/conquer -d$(DATA) -m lint: lint -hvac $(FILS) *************** *** 79,85 chmod 0644 $(DATA)/help $(DATA)/news lint: ! lint -u $(FILS) docs: sed -e "s/^END//g" help | pr --- 72,78 ----- $(EXECUTABLE)/conquer -d$(DATA) -m lint: ! lint -hvac $(FILS) docs: sed -e "s/^END//g" help | pr *************** *** 85,91 sed -e "s/^END//g" help | pr cpio: ! $(RM) core find . -name '*[CrpsEech]' -print | cpio -ocBv > cpiosv shar: $(FILS) --- 78,84 ----- sed -e "s/^END//g" help | pr cpio: ! - $(RM) core find . -name '*[CrpsEech]' -print | cpio -ocBv > cpiosv shar: $(FILS) *************** *** 101,109 mv shar.out shar5 rmshar: ! $(RM) shar1 ! $(RM) shar2 ! $(RM) shar3 ! $(RM) shar4 ! $(RM) shar5 ! --- 94,101 ----- mv shar.out shar5 rmshar: ! - $(RM) shar1 ! - $(RM) shar2 ! - $(RM) shar3 ! - $(RM) shar4 ! - $(RM) shar5 *** oldhelp Fri Mar 18 17:27:20 1988 --- help Fri Mar 18 17:27:25 1988 *************** *** 79,85 10% reproduction ceiling). Orcs are lousy fighters and are led by minor monsters (they start with MINOR MONSTER power). ELF 'E' Great at defense and quick, but few in numbers. They start ! with VOID power, which is perhaps the most potent power in the game, but which costs them an extra distribution point. DWARF 'D' Dwarves are good at combat, but slow and few in numbers. They start with MINER power, which allows them to quickly mine --- 79,85 ----- 10% reproduction ceiling). Orcs are lousy fighters and are led by minor monsters (they start with MINOR MONSTER power). ELF 'E' Great at defense and quick, but few in numbers. They start ! with VOID power, which is perhaps the most potent power in the game, but which costs them an extra distribution point. DWARF 'D' Dwarves are good at combat, but slow and few in numbers. They start with MINER power, which allows them to quickly mine *************** *** 171,177 Note that NPCS only have infantry and garrisons. END ! SHIPS Ships have crews - which can melee and fight. To sail at all, a fleet must have 50 men per warship. Merchants are assumed to be manned --- 171,177 ----- Note that NPCS only have infantry and garrisons. END ! SHIPS (UNIMPLEMENTED) Ships have crews - which can melee and fight. To sail at all, a fleet must have 50 men per warship. Merchants are assumed to be manned *************** *** 269,275 The only method to take an occupied City or Capitol is to be the the only army in the sector when the combat is *over*. ! Ships are more powerful than you might expect. They permit rapid relocation of armies & civilians to strategic points. Their movement is 3x that of a land army and they pay 1 move point per sector (coast lands) and 4 move points in deep water. Naval combat has not been play tested. --- 269,275 ----- The only method to take an occupied City or Capitol is to be the the only army in the sector when the combat is *over*. ! Ships are more powerful than you might expect. They permit rapid relocation of armies & civilians to strategic points. Their movement is 3x that of a land army and they pay 1 move point per sector (coast lands) and 4 move points in deep water. Naval combat has not been play tested. *************** *** 309,315 is converted to gold talons at a rate of 1 per food point. IRON: You need to have iron to draft new military, as per the unit types section. One person produces one iron per point of mineral in ! the sector per turn. An amount of Iron (based on the number of troops you have) can be used to buy +1% in your nations attack or defense. JEWELS: You can have a maximum of 10 talons debt for every jewel point that you mined. After that point, you undergo a TAX REVOLT, --- 309,315 ----- is converted to gold talons at a rate of 1 per food point. IRON: You need to have iron to draft new military, as per the unit types section. One person produces one iron per point of mineral in ! the sector per turn. An amount of Iron (based on the number of troops you have) can be used to buy +1% in your nations attack or defense. JEWELS: You can have a maximum of 10 talons debt for every jewel point that you mined. After that point, you undergo a TAX REVOLT, *************** *** 323,329 MAGIC POWERS WARRIOR/CAPTAIN/WARLORD: +10% each in combat, 1/2 Enlistment cost (MINOR/AVERAGE/MAJOR) MONSTER: (ORCS ONLY) Army 0 fights at +20% per level. ! Monsters have a chance to takeover ORC NPCs at a cost 100K jewels. SPY All enemy troop/civilian strength is shown exactly (even voids) KNOWALL Know all troop strengths and see the whole map (except voids) DERVISH Desert/ICE sectors => 1 move point, vegetation 6, +30% combat in --- 323,329 ----- MAGIC POWERS WARRIOR/CAPTAIN/WARLORD: +10% each in combat, 1/2 Enlistment cost (MINOR/AVERAGE/MAJOR) MONSTER: (ORCS ONLY) Army 0 fights at +20% per level. ! Monsters have a chance to takeover ORC NPCs at a cost 100K jewels. SPY All enemy troop/civilian strength is shown exactly (even voids) KNOWALL Know all troop strengths and see the whole map (except voids) DERVISH Desert/ICE sectors => 1 move point, vegetation 6, +30% combat in *************** *** 351,357 relative values of the materials. 'f': fleet report: Report on the status of your fleets. 'm': move unit: move selected unit. The unit will stop when it runs out ! of move points or runs into an army larger than it. 'p': pick item: allows you to select the next army or navy in the sector. Other commands will operate on that unit. 'r': redesignate: you can change habitable sectors you own to other --- 351,357 ----- relative values of the materials. 'f': fleet report: Report on the status of your fleets. 'm': move unit: move selected unit. The unit will stop when it runs out ! of move points or runs into an army larger than it. 'p': pick item: allows you to select the next army or navy in the sector. Other commands will operate on that unit. 'r': redesignate: you can change habitable sectors you own to other *************** *** 381,387 'N': newspaper: Briefs you on world happenings. Note the News has 4 pages. 'P': production: ESTIMATE your nations production statistics ! 'S': diplomacy: Alloy you to see and alter your diplomatic status. 'Q': quit: Save your move and quit the game. Note there is no means supported to quit without saving your moves. 'R': read mail: Read mail messages --- 381,387 ----- 'N': newspaper: Briefs you on world happenings. Note the News has 4 pages. 'P': production: ESTIMATE your nations production statistics ! 'S': diplomacy: Allow you to see and alter your diplomatic status. 'Q': quit: Save your move and quit the game. Note there is no means supported to quit without saving your moves. 'R': read mail: Read mail messages *** oldREADME Fri Mar 18 17:26:44 1988 --- README Fri Mar 18 17:27:25 1988 *** oldrun Fri Mar 18 17:26:47 1988 --- run Fri Mar 18 17:27:25 1988