Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!mit-eddie!uw-beaver!zephyr.ens.tek.com!tekred!saab!billr From: billr@saab.CNA.TEK.COM (Bill Randle) Newsgroups: comp.sources.games Subject: v08i078: conquer4 - middle earth multi-player game (V4), Patch7c Message-ID: <4997@tekred.CNA.TEK.COM> Date: 22 Dec 89 02:10:05 GMT Sender: nobody@tekred.CNA.TEK.COM Lines: 523 Approved: billr@saab.CNA.TEK.COM Submitted-by: Adam Bryant Posting-number: Volume 8, Issue 78 Archive-name: conquer4/Patch7c Patch-To: conquer4: Volume 6, Issue 83-96 #!/bin/sh # this is part 3 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # file patchV4.7 continued # CurArch=3 if test ! -r s2_seq_.tmp then echo "Please unpack part 1 first!" exit 1; fi ( read Scheck if test "$Scheck" != $CurArch then echo "Please unpack part $Scheck next!" exit 1; else exit 0; fi ) < s2_seq_.tmp || exit 1 echo "x - Continuing file patchV4.7" sed 's/^X//' << 'SHAR_EOF' >> patchV4.7 X+ { X+ #ifdef DEBUG X+ printf("\t need %d monster troops\n",neededtroops); X+ #endif X+ if ( (rand()%8)<5 && nomad_space) X+ { X+ while(!is_habitable((x=(rand()%(MAPX-8))+4), X+ (y=(rand()%(MAPY-8))+4))) X+ ; X+ for(i=0;i= 50 ) ); X+ X+ for(i=0;itmil = 0L; X for(armynum=1;armynum0){ X /* move army back if too far out */ X ok = 0; X+ if (P_ASOLD < MINLEADER && P_ASOLD!=A_MILITIA) { X+ curntn->tmil += P_ASOLD; X+ } X for(x=(int)P_AXLOC-3;x<=(int)P_AXLOC+3;x++) X for(y=(int)P_AYLOC-3;y<=(int)P_AYLOC+3;y++) X if((ONMAP(x,y))&&(sct[x][y].owner==country)) ok=1; X*************** X*** 412,418 **** X P_AYLOC=curntn->capy; X } X X! /* count and verify militia */ X if(P_ATYPE==A_MILITIA) { X /* eliminate invalid militia */ X if(((sct[P_AXLOC][P_AYLOC].designation!=DTOWN) X--- 498,504 ---- X P_AYLOC=curntn->capy; X } X X! /* verify militia */ X if(P_ATYPE==A_MILITIA) { X /* eliminate invalid militia */ X if(((sct[P_AXLOC][P_AYLOC].designation!=DTOWN) X*************** X*** 426,432 **** X sct[P_AXLOC][P_AYLOC].people+=P_ASOLD; X else sct[curntn->capx][curntn->capy].people+=P_ASOLD; X P_ASOLD=0; X! } else militia+=P_ASOLD; X } X X /* set default status */ X--- 512,518 ---- X sct[P_AXLOC][P_AYLOC].people+=P_ASOLD; X else sct[curntn->capx][curntn->capy].people+=P_ASOLD; X P_ASOLD=0; X! } X } X X /* set default status */ X*************** X*** 442,453 **** X break; X } X } X- curntn->tmil -= militia; X X /*make sure enough men in army 0 -- garrison duty in capitol*/ X armynum=0; X! P_ASTAT=GARRISON; X P_ATYPE=defaultunit(country); X P_AXLOC=curntn->capx; X P_AYLOC=curntn->capy; X X--- 528,544 ---- X break; X } X } X X /*make sure enough men in army 0 -- garrison duty in capitol*/ X armynum=0; X! /* find lowest army of non-leader type */ X! while (armynum < MAXARM && (P_ATYPE>=MINLEADER && P_ASOLD>0)) { X! armynum++; X! } X! /* oh well... wipe out army zero; c'est la vie */ X! if (armynum == MAXARM) armynum = 0; X P_ATYPE=defaultunit(country); X+ P_ASTAT=GARRISON; X P_AXLOC=curntn->capx; X P_AYLOC=curntn->capy; X X*************** X*** 470,481 **** X X /*too few soldiers on garrison*/ X /*diff is number to change mil in cap (>0)*/ X! if(curntn->tgold<0L) diff=0; X! else diff = (long) min(ideal-P_ASOLD,(int) (curntn->metals / *(u_enmetal + (P_ATYPE%UTYPE)))); X X diff=(long) min((int) diff, sct[curntn->capx][curntn->capy].people/2L); X X! if(curntn->tgold<0L || curntn->metals<0L) if(diff > 0L) diff=0; X X #ifdef DEBUG X printf("\tadding %d men to garrison (too few men on garrison)\n",diff); X--- 561,572 ---- X X /*too few soldiers on garrison*/ X /*diff is number to change mil in cap (>0)*/ X! diff = (long) min(ideal-P_ASOLD,(int) (curntn->metals / *(u_enmetal + (P_ATYPE%UTYPE)))); X X diff=(long) min((int) diff, sct[curntn->capx][curntn->capy].people/2L); X X! if ((curntn->tgold<0L || curntn->metals<0L) && (diff > 0L)) diff=0L; X! if (sct[curntn->capx][curntn->capy].owner != country) diff=0L; X X #ifdef DEBUG X printf("\tadding %d men to garrison (too few men on garrison)\n",diff); X*************** X*** 690,695 **** X--- 781,787 ---- X for(armynum=0;armynum0)&&(P_ATYPE!=A_MILITIA)&&(P_ATYPE0)&&(P_ATYPE!=A_MILITIA)&&(P_ATYPEtmil)); X if(hunger < P_EATRATE ) { X goldthresh++; X metalthresh++; X--- 1184,1192 ---- X X spreadsheet(country); X X! if (spread.civilians+2*curntn->tmil > 0) { X! hunger = spread.food/((float)(spread.civilians+2*curntn->tmil)); X! } else hunger = 0.0; X if(hunger < P_EATRATE ) { X goldthresh++; X metalthresh++; X*** otrade.c Tue Dec 12 21:19:37 1989 X--- trade.c Tue Dec 12 21:20:12 1989 X*************** X*** 113,119 **** X X /* go through list of commodities */ X for (holdint=0;holdintitemnum) { X tradeerr("Invalid Item Number"); X return; X } X--- 199,206 ---- X inloop=FALSE; X done=FALSE; X break; X! } else if (holdint<1 || holdint>itemnum X! || ntn[natn[holdint - 1]].dstatus[country]==UNMET) { X tradeerr("Invalid Item Number"); X return; X } X*** ocheck.c Tue Dec 12 21:19:34 1989 X--- check.c Tue Dec 12 21:20:12 1989 X*************** X*** 50,65 **** X __file__, __line__, country, i, a->yloc ); X a->yloc = 0; X } X- if( sct[a->xloc][a->yloc].altitude==PEAK ) { X- fprintf( stderr, "file %s: line %d: nation[%d] army[%d] loc=%d,%d (peak)\n", X- __file__,__line__,country,i,a->xloc,a->yloc); X- a->sold = 0; X- } X if( a->stat != ONBOARD && sct[a->xloc][a->yloc].altitude==WATER ) { X fprintf( stderr, "file %s: line %d: nation[%d] army[%d] loc=%d,%d (water) men=%d\n", X __file__,__line__,country,i,a->xloc,a->yloc,a->sold); X a->sold = 0; X } X } /* for */ X X for( i = 0; i < NTOTAL; i++ ) { X--- 50,65 ---- X __file__, __line__, country, i, a->yloc ); X a->yloc = 0; X } X if( a->stat != ONBOARD && sct[a->xloc][a->yloc].altitude==WATER ) { X fprintf( stderr, "file %s: line %d: nation[%d] army[%d] loc=%d,%d (water) men=%d\n", X __file__,__line__,country,i,a->xloc,a->yloc,a->sold); X a->sold = 0; X } X+ if( a->stat == ONBOARD && a->smove > 0) { X+ /* don't echo since this is still getting */ X+ /* set some place someplace I can't find yet */ X+ a->smove = 0; X+ } X } /* for */ X X for( i = 0; i < NTOTAL; i++ ) { X*************** X*** 147,154 **** X int line; X char *file; X { X! /* fprintf(stderr,"file %s line %d\n",file,line); */ X! /* verifydata(file,line); */ X } X #endif DEBUG X X--- 147,154 ---- X int line; X char *file; X { X! fprintf(stderr,"file %s line %d\n",file,line); X! verifydata(file,line); X } X #endif DEBUG X X*************** X*** 158,163 **** X--- 158,164 ---- X # include X # define do_lock(fd) lockf(fd,F_TLOCK,0) X #else X+ # include X # include X # define do_lock(fd) flock(fd,LOCK_EX|LOCK_NB) X #endif X*************** X*** 192,199 **** X exit(FAIL); X } X #else X! if( access( filename, 00 ) == 0 ) { X! hold=TRUE; X } X if (hold==FALSE && keeplock==TRUE) { X /* create lock file */ X--- 193,209 ---- X exit(FAIL); X } X #else X! struct stat fst; X! X! if( stat( filename, &fst ) == 0 ) { X! long now; X! now = time(0); X! if (now - fst.st_mtime < TIME_DEAD*3) { X! hold=TRUE; X! } else { X! /* remove useless file */ X! unlink(filename); X! } X } X if (hold==FALSE && keeplock==TRUE) { X /* create lock file */ X*** otxt5 Tue Dec 12 21:19:38 1989 X--- txt5 Tue Dec 12 21:20:14 1989 X*************** X*** 216,221 **** X--- 216,222 ---- X between 25%-125% of the tax rate [randomly determined] X plus (poverty - 50)/2 and is then adjusted by the ratio of X military to civilians. X+ Money lost due to inflation will be indicated in the budget. X wealth = see elsewhere. X END X ADDITIONAL MODIFIERS TO NATIONAL ATTRIBUTES X*************** X*** 222,234 **** X X MAGIC POWERS ADD OR SUBTRACT 10 FROM POWERS AS FOLLOWS: X SLAVER.....terror ARCHITECT..storerate X! RELIGION...popularity URBAN......-popularity X DEMOCRACY..-terror ROADS......communication X KNOWALL....knowledge DESTROYER..terror X VAMPIRE....terror X X CLASSES ADD 30 TO POWERS AS FOLLOWS: X! kingdom....popularity dragon.....terror X wizard.....knowledge priest.....popularity X pirate.....terror shadow.....terror X warlord....prestige demon......terror X--- 223,235 ---- X X MAGIC POWERS ADD OR SUBTRACT 10 FROM POWERS AS FOLLOWS: X SLAVER.....terror ARCHITECT..storerate X! RELIGION...popularity URBAN......-popularity X DEMOCRACY..-terror ROADS......communication X KNOWALL....knowledge DESTROYER..terror X VAMPIRE....terror X X CLASSES ADD 30 TO POWERS AS FOLLOWS: X! kingdom....popularity dragon.....terror X wizard.....knowledge priest.....popularity X pirate.....terror shadow.....terror X warlord....prestige demon......terror SHAR_EOF echo "File patchV4.7 is complete" chmod 0644 patchV4.7 || echo "restore of patchV4.7 fails" rm -f s2_seq_.tmp echo "You have unpacked the last part" exit 0