games@tekred.TEK.COM (07/20/88)
Submitted by: ihnp4!homxc!smile Comp.sources.games: Volume 5, Issue 6 Archive-name: conquer3/Patch3 [This patch contains a set of patches and two new files: trade.c and patchlevel.h (which I took the liberty to include for future reference) that bring conquer3 upto Patchlevel 3. This has already been posted to comp.sources.games.bugs and is posted here for archival purposes. Unshar this file to get the two new files and patches then feed "patches03" to patch. -br] #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: patchlevel.h trade.c patches03 # Wrapped by billr@saab on Tue Jul 19 09:50:58 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'patchlevel.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patchlevel.h'\" else echo shar: Extracting \"'patchlevel.h'\" \(21 characters\) sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE' X#define PATCHLEVEL 3 END_OF_FILE if test 21 -ne `wc -c <'patchlevel.h'`; then echo shar: \"'patchlevel.h'\" unpacked with wrong size! fi # end of 'patchlevel.h' fi if test -f 'trade.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'trade.c'\" else echo shar: Extracting \"'trade.c'\" \(25421 characters\) sed "s/^X//" >'trade.c' <<'END_OF_FILE' X/*conquer : Copyright (c) 1988 by Ed Barlow. X * I spent a long time writing this code & I hope that you respect this. X * I give permission to alter the code, but not to copy or redistribute X * it without my explicit permission. If you alter the code, X * please document changes and send me a copy, so all can have it. X * This code, to the best of my knowledge works well, but it is my first X * 'C' program and should be treated as such. I disclaim any X * responsibility for the codes actions (use at your own risk). I guess X * I am saying "Happy gaming", and am trying not to get sued in the process. X * Ed X */ X X/* X * The following file "trade.c" was written by Adam Bryant who X * gives all rights to this code to Ed Barlow provided that this X * message remains intact. X */ X X/* thanks adam -- Ed */ X X/* trade.c */ X X/*include files*/ X#include "header.h" X#include "data.h" X X#ifdef TRADE X X/* possible commodities */ X#define TDGOLD 0 X#define TDFOOD 1 X#define TDIRON 2 X#define TDJEWL 3 X#define TDLAND 4 X#define TDARMY 5 X#define TDSHIP 6 X X/* constants and indicators */ X#define NUMPRODUCTS 7 X#define MAXITM 30 X#define SELL 0 X#define BUY 1 X#define NODEAL 2 X#define NOSALE 3 X#define TRADECOST(cost) ((100-cost)/100) /* twenty percent cost normal*/ X Xextern short country; X Xchar *commodities[NUMPRODUCTS] = { "Gold", "Food", "Iron", "Jewels", X "Land", "Soldiers", "Ships"}; X#ifdef ADMIN Xchar *tradefail[NUMPRODUCTS] = { "lack of gold", "lack of food", X "lack of iron", "lack of jewels", "land not owned", X "no available armies", "no available navies"}; X#endif ADMIN X#ifdef CONQUER X/* Use this when you wish to sell something */ Xchar *selllist[NUMPRODUCTS] = { "Sell how many gold talons? ", "Sell how much food? ", X "Sell how much iron? ", "Sell how many jewels? ", "What X location? ", X "How many soldiers? ", "How many ships? "}; X X/* Use this when you wish to place a bid something */ Xchar *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ", X "Bid how much iron? ", "Bid how many jewels? ", " ", X "Bid what army? ", "Bid how many ships? "}; X Xvoid Xtrade() X{ X FILE *tfile; X int count, done=FALSE, notopen=FALSE; X int buysell, holdint, holdint2, extint, inloop; X int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM]; X int natn[MAXITM], itemnum, getland(), gettrade(), checkland(); X int tradable(); X long lvar1[MAXITM], lvar2[MAXITM], holdlong, holdlong2, armyvalue(); X void tradeerr(), setaside(), takeback(); X X while (done==FALSE) { X itemnum=0; X done=TRUE; X /* open trading file */ X if ((tfile=fopen(tradefile,"r")) == NULL ) { X notopen=TRUE; X } X /* read in all of the data */ X while (notopen==FALSE && !feof(tfile)) { X fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum], X &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]); X if (deal[itemnum]==NOSALE) { X /* remove item from sales list */ X deal[type1[itemnum]]=NOSALE; X } else if (deal[itemnum]==SELL) { X itemnum++; X } X } X if (notopen==FALSE) fclose(tfile); X clear(); X /* display header */ X standout(); X mvaddstr(0,27,"COMMODITIES EXCHANGE"); X standend(); X count=2; X mvprintw(count,0," Nation\t\tItem\t\tMinimum Price"); X /* go through list of commodities */ X for (holdint=0;holdint<itemnum;holdint++) { X if (deal[holdint]==SELL) { X count++; X mvprintw(count,0,"%2d) %-10s", X holdint+1, X ntn[natn[holdint]].name); X X if (type1[holdint]==TDLAND) { X holdlong = (long) tofood(sct[(int)lvar1[holdint]][extra[holdint]].vegetation,0); X mvprintw(count,20,"(food=%2ld) %s", X holdlong, X commodities[type1[holdint]]); X } else { X holdlong = lvar1[holdint]; X mvprintw(count,20,"%9ld %s", X holdlong, X commodities[type1[holdint]]); X } X mvprintw(count,40,"%9ld %s", X lvar2[holdint], X commodities[type2[holdint]]); X if (count>16) { X standout(); X mvaddstr(21,30,"Hit Any Key to Continue"); X standend(); X refresh(); X getch(); X clear(); X standout(); X mvaddstr(0,27,"COMMODITIES EXCHANGE"); X standend(); X mvprintw(2,0," Nation\t\tItem\t\tMinimum Price"); X count=3; X } X } X } X standout(); X count++; X if (itemnum==0) mvaddstr(count++,0,"Nothing to Buy. Do you wish to (S)ell?"); X else mvaddstr(count++,0,"Do you wish to (B)uy, (S)ell, or (U)nsell?"); X standend(); X refresh(); X inloop=TRUE; X while (inloop==TRUE) switch(getch()) { X case 'b': X case 'B': X if (itemnum==0) break; X buysell=BUY; X mvaddstr(count++,0,"What item number do you want to purchase? "); X refresh(); X holdint = get_number(); X if (holdint<1 || holdint>itemnum) { X tradeerr("Invalid Item Number"); X return; X } X holdint--; X if (deal[holdint]!=SELL) { X tradeerr("Sorry, that item is not on the market."); X return; X } X if (ntn[natn[holdint]].dstatus[country]==UNMET) { X tradeerr("That nation has not been met by you"); X return; X } X if (ntn[natn[holdint]].dstatus[country]>HOSTILE) { X tradeerr("That nation is not doing business with you"); X return; X } X /* obtain bid */ X mvprintw(count++,0,"%s",buylist[type2[holdint]]); X refresh(); X holdlong2 = 0L; X holdlong = (long) get_number(); X /* check for valid bid */ X switch(type2[holdint]) { X case TDGOLD: X if (holdlong < lvar2[holdint]) { X tradeerr("You underbid the minimum."); X buysell=NODEAL; X } else if (holdlong > ntn[country].tgold) { X tradeerr("Not Enough Gold"); X buysell=NODEAL; X } X break; X case TDFOOD: X if (holdlong < lvar2[holdint]) { X tradeerr("You underbid the minimum."); X buysell=NODEAL; X } else if (holdlong > ntn[country].tfood) { X tradeerr("Not Enough Food"); X buysell=NODEAL; X } X break; X case TDIRON: X if (holdlong < lvar2[holdint]) { X tradeerr("You underbid the minimum."); X buysell=NODEAL; X } else if (holdlong > ntn[country].tiron) { X tradeerr("Not Enough Iron"); X buysell=NODEAL; X } X break; X case TDJEWL: X if (holdlong < lvar2[holdint]) { X tradeerr("You underbid the minimum."); X buysell=NODEAL; X } else if (holdlong > ntn[country].jewels) { X tradeerr("Not Enough Jewels"); X buysell=NODEAL; X } X break; X case TDLAND: X mvaddstr(count++,0,"What Y position? "); X refresh(); X holdlong2 = (long) get_number; X if (checkland(BUY,(int)(holdlong),(int)(holdlong2))==NODEAL) { X buysell=NODEAL; X } else if (tofood(sct[(int)holdlong][(int)holdlong2].vegetation,natn[holdint]) < lvar2[holdint]) { X tradeerr("You underbid the minimum"); X buysell=NODEAL; X } X break; X case TDARMY: X if ((int)holdlong > MAXARM) { X tradeerr("Invalid Unit"); X buysell=NODEAL; X } else if (tradable(country,(int)holdlong)==FALSE) { X tradeerr("That unit type is non-tradable."); X buysell=NODEAL; X } else if (armyvalue(country,(int)holdlong) < lvar2[holdint]) { X tradeerr("You underbid the minimum."); X buysell=NODEAL; X } X break; X case TDSHIP: X if ((int)holdlong >= MAXNAVY) { X tradeerr("Invalid Navy"); X buysell=NODEAL; X } else if (ntn[country].nvy[(int)holdlong].merchant+ntn[country].nvy[(int)holdlong].warships < (int)lvar2[holdint]) { X tradeerr("You underbid the minimum."); X buysell=NODEAL; X } X break; X default: X tradeerr("Invalid Commodity"); X buysell=NODEAL; X break; X } X if (buysell==BUY) { X if ( (tfile = fopen(tradefile,"a+"))==NULL) { X tradeerr("Error opening file for trading"); X abrt(); X } X setaside(country,type2[holdint],holdlong); X fprintf(tfile, "%d %d %d %d %ld %ld %d\n",BUY, country, holdint, 0, holdlong, holdlong2, 0); X fclose(tfile); X } X return; X case 's': X case 'S': X /* sell an item */ X /* only allow MAXITM on market */ X if (itemnum>=MAXITM) { X standout(); X if (itemnum==0) mvaddstr(count++,0,"Market Congested. Hit any key to continue"); X else mvaddstr(count++,0,"Market Congested. (B)uy or any key to continue"); X standend(); X refresh(); X break; X } X buysell=SELL; X holdint = gettrade("Selling",&count); X if (holdint==(-1)) { X tradeerr("Invalid Option"); X return; X } X X mvprintw(count++,0,"%s",selllist[holdint]); X refresh(); X /* find out how much commodities */ X holdlong = (long) get_number(); X extint = 0; X if (holdint< TDLAND && holdlong==0L) X return; X X /* check for valid items */ X switch(holdint) { X case TDGOLD: X if (holdlong > ntn[country].tgold) { X tradeerr("Not Enough Gold"); X buysell=NODEAL; X } X break; X case TDFOOD: X if (holdlong > ntn[country].tfood) { X tradeerr("Not Enough Food"); X buysell=NODEAL; X } X break; X case TDIRON: X if (holdlong > ntn[country].tiron) { X tradeerr("Not Enough Iron"); X buysell=NODEAL; X } X break; X case TDJEWL: X if (holdlong > ntn[country].jewels) { X tradeerr("Not Enough Jewels"); X buysell=NODEAL; X } X break; X case TDLAND: X mvprintw(count++,0,"What Y position? "); X refresh(); X extint = get_number(); X buysell = checkland(SELL,(int)holdlong,extint); X break; X case TDARMY: X if (holdlong>=MAXARM || ntn[country].arm[(int)holdlong].sold <= 0) { X tradeerr("Invalid Army"); X buysell=NODEAL; X } else if (tradable(country,(int)holdlong)==FALSE) { X tradeerr("That unit is non-tradable."); X buysell=NODEAL; X } X break; X case TDSHIP: X if (holdlong>=MAXNAVY || ntn[country].nvy[(int)holdlong].merchant + ntn[country].nvy[(int)holdlong].warships <= 0) { X tradeerr("Invalid Navy"); X buysell=NODEAL; X } X break; X default: X tradeerr("Invalid Commodity"); X buysell=NODEAL; X break; X } X /* invalid commodity */ X if (buysell==NODEAL) return; X X /* find out what they want in trade */ X holdint2 = gettrade("In Trade For",&count); X if (holdint2==(-1)) { X tradeerr("Invalid Option"); X return; X } X if (holdint2==TDLAND) { X holdlong2 = (long) getland(&count); X if (holdlong2==(-1L)) { X tradeerr("Invalid Vegetation"); X return; X } X } else { X /* find out for what value */ X mvprintw(count++,0,"Minimum %s",selllist[holdint2]); X refresh(); X holdlong2 = (long) get_number(); X if (holdlong2 == 0L) return; X } X X /* make sure what was bid is unusable */ X setaside(country,holdint,holdlong); X X /* set up output properly */ X if (holdint==TDARMY) { X extint = (int) holdlong; X holdlong = armyvalue(country,(int)holdlong); X } X else if (holdint==TDSHIP) { X extint = (int)holdlong; X holdlong = (long)(ntn[country].nvy[(int)holdlong].merchant + ntn[country].nvy[(int)holdlong].warships); X } X X /* send it out */ X if ( (tfile = fopen(tradefile,"a+"))==NULL) { X tradeerr("Error opening file for trading"); X abrt(); X } X fprintf(tfile, "%d %d %d %d %ld %ld %d\n", SELL, country, holdint, holdint2, holdlong, holdlong2, extint); X fclose(tfile); X inloop=FALSE; X done=FALSE; X break; X case 'u': X case 'U': X /* unsell an item */ X if (itemnum==0) break; X mvaddstr(count++,0,"What item number to remove? "); X refresh(); X holdint = get_number(); X if (holdint==0 || holdint>itemnum) { X tradeerr("Invalid Item Number"); X return; X } X holdint--; X#ifdef OGOD X /* allow god to remove commodities */ X if (country!=0 && country!=natn[holdint]) X#else X if (country != natn[holdint]) X#endif OGOD X { X tradeerr("That is not your item"); X return; X } X X /* remove it from market */ X if ( (tfile = fopen(tradefile,"a+"))==NULL) { X tradeerr("Error opening file for trading"); X abrt(); X } X fprintf(tfile, "%d %d %d %d %ld %ld %d\n", NOSALE, natn[holdint], holdint, 0, 0L, 0L, 0); X fclose(tfile); X takeback(natn[holdint],type1[holdint],lvar1[holdint]); X /*redraw the commodities board so removal is seen*/ X inloop=FALSE; X done=FALSE; X break; X default: X /* return on no choice */ X return; X } X } X} X Xvoid Xtradeerr(mesg) Xchar *mesg; X{ X clear_bottom(0); X standout(); X mvaddstr(21,0,mesg); X standend(); X mvaddstr(22,0,"Hit any key to continue"); X refresh(); X getch(); X} X Xint Xcheckland(tradestat,xspot,yspot) Xint tradestat,xspot,yspot; X{ X int newstat=tradestat; X if (xspot < 0 || xspot > MAPX || yspot > MAPY || yspot < 0) { X tradeerr("That is off the map"); X newstat=NODEAL; X } X else if (sct[xspot][yspot].owner != country) { X tradeerr("You don't own it"); X newstat=NODEAL; X } X else if (ntn[country].capx==xspot && ntn[country].capy==yspot) { X tradeerr("That is your capitol"); X newstat=NODEAL; X } X else if (sct[xspot][yspot].designation == DCITY) { X tradeerr("Towns may not be sold"); X newstat=NODEAL; X } X return(newstat); X} X X/* get minimum foodvalue for land */ Xint Xgetland(count) Xint *count; X{ X int temp; X char entered; X X mvprintw((*count)++,0,"MINIMUM VEGETATION: %c, %c, %c, %c, %c, %c, %c, %c, %c, %c, %c or %c: ", X VOLCANO,DESERT,TUNDRA,BARREN,LT_VEG, X GOOD,WOOD,FOREST,JUNGLE,SWAMP,ICE,NONE); X X refresh(); X entered=getch(); X if(entered!=VOLCANO &&entered!=JUNGLE X &&entered!=DESERT &&entered!=TUNDRA X &&entered!=BARREN &&entered!=LT_VEG X &&entered!=NONE &&entered!=GOOD X &&entered!=WOOD &&entered!=FOREST X &&entered!=SWAMP &&entered!=ICE) temp=(-1); X else temp = tofood(entered,country); X mvprintw((*count)++,0," JUST ENTERED %c so temp is %d", entered,temp); X return(temp); X} X Xint Xgettrade(saletype,count) Xchar *saletype; Xint *count; X{ X int hold=(-1); X X mvprintw((*count)++,0,"%s: (G)old, (F)ood, (I)ron, (J)ewels, (L)and, (A)rmy, (S)hips?",saletype); X refresh(); X switch(getch()) { X case 'g': X case 'G': X hold=TDGOLD; X break; X case 'f': X case 'F': X hold=TDFOOD; X break; X case 'i': X case 'I': X hold=TDIRON; X break; X case 'j': X case 'J': X hold=TDJEWL; X break; X case 'l': X case 'L': X hold=TDLAND; X break; X case 'a': X case 'A': X hold=TDARMY; X break; X case 's': X case 'S': X hold=TDSHIP; X break; X default: X break; X } X return(hold); X} X X/* set aside things that are up for bid */ Xvoid Xsetaside(cntry,item,longval) Xint cntry,item; Xlong longval; X{ X switch(item) X { X case TDGOLD: X ntn[cntry].tgold -= longval; X break; X case TDFOOD: X ntn[cntry].tfood -= longval; X break; X case TDIRON: X ntn[cntry].tiron -= longval; X break; X case TDJEWL: X ntn[cntry].jewels -= longval; X break; X case TDLAND: X break; X case TDARMY: X ntn[cntry].arm[(int)longval].smove = 0; X ntn[cntry].arm[(int)longval].stat = TRADED; X break; X case TDSHIP: X /* use armynum to hold indicator */ X ntn[cntry].nvy[(int)longval].smove = 0; X ntn[cntry].nvy[(int)longval].armynum = TRADED; X break; X } X} X X/* regain things that are up for bid */ Xvoid Xtakeback(cntry,item,longval) Xint cntry,item; Xlong longval; X{ X switch(item) X { X case TDGOLD: X ntn[cntry].tgold += longval; X break; X case TDFOOD: X ntn[cntry].tfood += longval; X break; X case TDIRON: X ntn[cntry].tiron += longval; X break; X case TDJEWL: X ntn[cntry].jewels += longval; X break; X case TDLAND: X break; X case TDARMY: X ntn[cntry].arm[(int)longval].stat = DEFEND; X break; X case TDSHIP: X /* use armynum to hold indicator */ X ntn[cntry].nvy[(int)longval].armynum = 0; X break; X } X} X#endif CONQUER X X#ifdef ADMIN X/* give things that were purchased from cntry1 to cntry2 */ Xlong Xtradeit(cntry1,cntry2,item,longval,extra) Xint cntry1,cntry2,item,extra; Xlong longval; X{ X int unitnum=(-1),unitcount=0; X /* error for -1 returned */ X long returnval=(-1); X switch(item) X { X case TDGOLD: X returnval = longval; X ntn[cntry1].tgold -= longval; X ntn[cntry2].tgold += longval * TRADECOST(20); X break; X case TDFOOD: X if (ntn[cntry1].tfood >= longval) { X returnval = longval; X ntn[cntry1].tfood -= longval; X ntn[cntry2].tfood += longval * TRADECOST(20); X } X break; X case TDIRON: X if (ntn[cntry1].tiron >= longval) { X ntn[cntry1].tiron -= longval; X ntn[cntry2].tiron += longval * TRADECOST(20); X returnval = longval; X } X break; X case TDJEWL: X if (ntn[cntry1].jewels >= longval) { X ntn[cntry1].jewels -= longval; X ntn[cntry2].jewels += longval * TRADECOST(20); X returnval = longval; X } X break; X case TDLAND: X if (sct[(int)longval][extra].owner==cntry1) { X sct[(int)longval][extra].owner = cntry2; X returnval = longval; X } X break; X case TDARMY: X /* find army number for cntry2 */ X /* give army to cntry2 */ X while(unitnum==(-1)&&unitcount<MAXARM) { X if (ntn[cntry2].arm[unitcount].sold<=0) { X /* give army to cntry2 */ X ntn[cntry2].arm[unitcount].sold = ntn[cntry1].arm[extra].sold; X ntn[cntry2].arm[unitcount].unittyp = ntn[cntry1].arm[extra].unittyp; X ntn[cntry2].arm[unitcount].xloc = ntn[cntry2].capx; X ntn[cntry2].arm[unitcount].yloc = ntn[cntry2].capy; X ntn[cntry2].arm[unitcount].stat = DEFEND; X ntn[cntry2].arm[unitcount].smove = 0; X /* remove army from cntry1 */ X ntn[cntry1].arm[extra].sold = 0; X ntn[cntry1].arm[extra].smove = 0; X ntn[cntry1].arm[extra].stat = DEFEND; X unitnum=unitcount; X } X unitcount++; X } X returnval=(long)unitnum; X break; X case TDSHIP: X /* give navy to cntry1 */ X while(unitnum==(-1)&&unitcount<MAXARM){ X if (ntn[cntry2].nvy[unitcount].merchant+ntn[cntry2].nvy[unitcount].warships <= 0) { X /* give navy to cntry2 */ X ntn[cntry2].nvy[unitcount].warships = ntn[cntry1].nvy[extra].warships; X ntn[cntry2].nvy[unitcount].merchant = ntn[cntry1].nvy[extra].merchant; X ntn[cntry2].nvy[unitcount].crew = ntn[cntry1].nvy[extra].crew; X ntn[cntry2].arm[unitcount].xloc = ntn[cntry1].nvy[extra].xloc; X ntn[cntry2].arm[unitcount].yloc = ntn[cntry1].nvy[extra].yloc; X ntn[cntry2].nvy[unitcount].armynum = 0; X ntn[cntry2].nvy[unitcount].smove = 0; X /* remove navy from cntry1 */ X ntn[cntry1].nvy[extra].smove = 0; X ntn[cntry1].nvy[extra].merchant = 0; X ntn[cntry1].nvy[extra].warships = 0; X ntn[cntry1].nvy[extra].crew = 0; X ntn[cntry1].nvy[extra].armynum = 0; X unitnum=unitcount; X } X unitcount++; X } X returnval=(long)unitnum; X break; X } X return(returnval); X} X Xlong Xgettval(cntry1,cntry2,type,longval,extint) Xint cntry1, cntry2, extint; Xlong longval; X{ X int returnval=(-1); X long armyvalue(); X X switch(type) { X case TDGOLD: X case TDFOOD: X case TDIRON: X case TDJEWL: X returnval=longval; X break; X case TDLAND: X if (cntry2!=sct[(int)longval][extint].owner) X returnval=(long)tofood(sct[(int)longval][extint].vegetation,cntry1); X break; X case TDARMY: X if (armyvalue(cntry2,extint)>0) X returnval=armyvalue(cntry2,extint); X break; X case TDSHIP: X if (ntn[cntry2].nvy[extint].merchant+ntn[cntry2].nvy[extint].warships>0) X returnval=(long)(ntn[cntry2].nvy[extint].merchant+ntn[cntry2].nvy[extint].warships); X break; X } X return(returnval); X} X X/* this function sends detailed message to players */ X/* upon completion of a trade */ Xvoid Xtrademail(cntry1,cntry2,item1,item2,lvar1,lvar2,lvar3,lvar4) Xint cntry1,cntry2,item1,item2; Xlong lvar1,lvar2,lvar3,lvar4; X{ X FILE *fp[2]; X int count; X char cname[2][12],filename[2][80]; X X sprintf(filename[0],"%s%d",msgfile,cntry1); X sprintf(filename[1],"%s%d",msgfile,cntry2); X strcpy(cname[0],ntn[cntry1].name); X strcpy(cname[1],ntn[cntry2].name); X X if ((fp[0]=fopen(filename[0],"a+"))==NULL) { X printf("error opening <%s>\n",filename[0]); X abrt(); X } X if ((fp[1]=fopen(filename[1],"a+"))==NULL) { X printf("error opening <%s>\n",filename[1]); X abrt(); X } X X for (count=0;count<2;count++) { X fprintf(fp[count],"%s Message to %s from Conquer Commerce Commision\n",cname[count],cname[count]); X fprintf(fp[count],"%s \n",cname[count]); X fprintf(fp[count],"%s Trade transaction between %s and %s completed.",cname[count],cname[0],cname[1]); X if (item1<=TDJEWL) X fprintf(fp[count],"%s Nation %s receives %ld %s\n",cname[count],cname[0],lvar1,commodities[item1]); X else if (item1==TDLAND) X fprintf(fp[count],"%s Nation %s receives sector %ld, %ld\n",cname[count],cname[0],lvar1,lvar2); X else if (item1==TDARMY) X fprintf(fp[count],"%s Nation %s receives army #%ld\n",cname[count],cname[0],lvar1); X else if (item1==TDSHIP) X fprintf(fp[count],"%s Nation %s receives navy #%ld\n",cname[count],cname[0],lvar1); X if (item2<=TDJEWL) X fprintf(fp[count],"%s Nation %s receives %ld %s\n",cname[count],cname[1],lvar3,commodities[item2]); X else if (item1==TDLAND) X fprintf(fp[count],"%s Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar3,lvar4); X else if (item1==TDARMY) X fprintf(fp[count],"%s Nation %s receives army #%ld\n",cname[count],cname[1],lvar3); X else if (item1==TDSHIP) X fprintf(fp[count],"%s Nation %s receives navy #%ld\n",cname[count],cname[1],lvar3); X fclose(fp[count]); X } X} X#endif ADMIN X X/* routine to determine whether or not an army type is tradable */ Xint Xtradable(cntry,armynum) Xint cntry,armynum; X{ X int oldcntry=country,returnval=FALSE; X country=cntry; X if ( ATYPE==A_MERCENARY || ATYPE==A_SEIGE || ATYPE==A_CATAPULT X || ATYPE==A_ELEPHANT || ATYPE>=MINMONSTER) returnval=TRUE; X country=oldcntry; X return(returnval); X} X X/* routine to determine commercial value of army */ Xlong armyvalue(cntry,unit) Xint cntry,unit; X{ X#ifdef CONQUER X extern int unitattack[]; X#endif CONQUER X long returnval; X X returnval = ntn[cntry].arm[unit].sold*100 + X ntn[cntry].arm[unit].sold * unitattack[ntn[cntry].arm[unit].unittyp%100]; X if (ntn[cntry].arm[unit].unittyp >= MINMONSTER) returnval+=ntn[cntry].arm[unit].sold*10; X returnval/=100; X return(returnval); X} X Xvoid Xuptrade() X{ X FILE *tfile; X int count, itemnum=0, natn[MAXITM]; X int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM]; X#ifdef ADMIN X extern FILE *fnews; X void trademail(); X int whobuy[MAXITM]; X long tradeit(), buy1[MAXITM], buy2[MAXITM]; X long price[MAXITM], gettval(), longval1, longval2; X#endif ADMIN X long lvar1[MAXITM], lvar2[MAXITM]; X#ifdef CONQUER X void setaside(),takeback(); X#endif CONQUER X X /* initialize purchase list */ X for (count=0; count<MAXITM; count++) { X deal[count]=(-1); X#ifdef ADMIN X whobuy[count]=(-1); X price[count]=(-1); X#endif ADMIN X } X /* open trading file */ X if ((tfile = fopen(tradefile,"r")) == NULL) { X /* no commodities - no transactions */ X return; X } X /* read in all of the transactions */ X while(!feof(tfile)) { X fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum], X &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]); X if (deal[itemnum]==NOSALE) { X /* remove item from sales list */ X deal[type1[itemnum]]=NOSALE; X#ifdef CONQUER X if (natn[itemnum]==country) takeback(country,type1[type1[itemnum]],lvar1[type1[itemnum]]); X#endif CONQUER X } else if (deal[itemnum]==SELL) { X itemnum++; X#ifdef CONQUER X if (natn[itemnum]==country) setaside(country,type2[itemnum],lvar1[itemnum]); X#endif CONQUER X } else if (deal[itemnum]==BUY) { X#ifdef ADMIN X if (deal[type1[itemnum]]==SELL) deal[type1[itemnum]]==BUY; X /* check for highest price for item */ X if (price[type1[itemnum]]<gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum])) { X price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]); X buy1[type1[itemnum]]=lvar1[itemnum]; X buy2[type1[itemnum]]=lvar2[itemnum]; X whobuy[type1[itemnum]]=natn[itemnum]; X } X#endif ADMIN X#ifdef CONQUER X if (natn[itemnum]==country) setaside(country,type2[type1[itemnum]],lvar1[itemnum]); X#endif CONQUER X } X } X fclose(tfile); X#ifdef ADMIN X /* reopen the file for unsold commodities */ X if ((tfile=fopen(tradefile,"w")) == NULL) { X /* error on opening file */ X printf("Error opening <%s> for trade update\n",tradefile); X abrt(); X } X X /* compute the trading */ X for (count=0;count<itemnum;count++) { X if (deal[count]==SELL) X /* adjust the displayed value */ X lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]); X /* keep unsold items up for sale */ X if(lvar1[count]>=0) fprintf(tfile,"%d %d %d %d %ld %ld %d\n", deal[count], natn[count],type1[count],type2[count],lvar1[count],lvar2[count],extra[count]); X else if (deal[count]==BUY) { X /* do the trading */ X longval1 = tradeit(natn[count],whobuy[count],type1[count],lvar1[count],extra[count]); X if (longval1!=(-1)) longval2 = tradeit(whobuy[count],natn[count],type2[count],buy1[count],(int)buy2[count]); X if (longval1==(-1)) { X /* abort due to seller */ X fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.", X ntn[natn[count]].name,ntn[whobuy[count]].name,tradefail[type1[count]]); X } else if (longval2==(-1)) { X /* abort due to buyer */ X tradeit(whobuy[count],natn[count],type1[count],longval1,extra[count]); X fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.", X ntn[whobuy[count]].name,ntn[natn[count]].name,tradefail[type2[count]]); X /* place it on the list for next turn */ X /* adjust the displayed value */ X lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]); X if(lvar1[count]>=0) fprintf(tfile,"%d %d %d %d %ld %ld %d\n", SELL, natn[count],type1[count],type2[count],lvar1[count],lvar2[count],extra[count]); X } else { X /* trade completed send mail */ X fprintf(fnews,"2.\tNation %s sells %s to %s for %s" X ,ntn[natn[count]].name,commodities[type1[count]],ntn[whobuy[count]].name,commodities[type2[count]]); X trademail(natn[count],whobuy[count],type1[count], X type2[count],longval1,(long)extra[count], X longval2,buy2[count]); X } X } X } X fclose(tfile); X#endif ADMIN X} X#endif TRADE END_OF_FILE if test 25421 -ne `wc -c <'trade.c'`; then echo shar: \"'trade.c'\" unpacked with wrong size! fi # end of 'trade.c' fi if test -f 'patches03' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patches03'\" else echo shar: Extracting \"'patches03'\" \(31526 characters\) sed "s/^X//" >'patches03' <<'END_OF_FILE' X*** oldnewlogin.c Wed Jul 13 09:55:53 1988 X--- newlogin.c Wed Jul 13 09:56:16 1988 X*************** X*** 223,229 X } X } X X! ntn[country].mark = toupper(*ntn[country].name); X printf("\ntesting first letter of name (%c) for nation mark...",ntn[country].mark); X valid=TRUE; X while(valid==TRUE) { X X--- 223,231 ----- X } X } X X! ntn[country].mark= (*ntn[country].name); X! if (islower(ntn[country].mark)!=FALSE) X! ntn[country].mark= toupper(ntn[country].mark); X printf("\ntesting first letter of name (%c) for nation mark...",ntn[country].mark); X valid=TRUE; X while(valid==TRUE) { X*************** X*** 252,257 X printf("\n'*' is invalid character"); X valid=TRUE; X } X if(valid==TRUE){ X printf("\nplease reenter new national mark for maps:"); X printf("\n (this can be any uppercase character)"); X X--- 254,263 ----- X printf("\n'*' is invalid character"); X valid=TRUE; X } X+ if(valid==FALSE) if(!isupper(ntn[country].mark)) { X+ printf("\nNot an uppercase character"); X+ valid=TRUE; X+ } X if(valid==TRUE){ X printf("\nplease reenter new national mark for maps:"); X printf("\n (this can be any uppercase character)"); X*************** X*** 977,982 X return(2); X case 9: X printf("\ndragons have the magical MAJOR MONSTER power automatically"); X ntn[country].powers|=AV_MONST; X x=AV_MONST; X CHGMGK; X X--- 983,991 ----- X return(2); X case 9: X printf("\ndragons have the magical MAJOR MONSTER power automatically"); X+ ntn[country].powers|=MI_MONST; X+ x=MI_MONST; X+ CHGMGK; X ntn[country].powers|=AV_MONST; X x=AV_MONST; X CHGMGK; X*** olddisplay.c Wed Jul 13 09:55:53 1988 X--- display.c Wed Jul 13 09:56:16 1988 X*** oldmain.c Wed Jul 13 09:56:05 1988 X--- main.c Wed Jul 13 09:56:16 1988 X*************** X*** 207,212 X exit(FAIL); X } X execute(); X if(ntn[country].capx>15) { X xcurs=15; X xoffset= (ntn[country].capx-15); X X--- 207,215 ----- X exit(FAIL); X } X execute(); X+ #ifdef TRADE X+ uptrade(); X+ #endif TRADE X if(ntn[country].capx>15) { X xcurs=15; X xoffset= (ntn[country].capx-15); X*************** X*** 469,474 X diploscrn(); X redraw=TRUE; X break; X case '9': X case 'u': /*move north-east*/ X pager=0; X X--- 472,483 ----- X diploscrn(); X redraw=TRUE; X break; X+ #ifdef TRADE X+ case 'T': /*go to commerce section*/ X+ trade(); X+ redraw=TRUE; X+ break; X+ #endif TRADE X case '9': X case 'u': /*move north-east*/ X pager=0; X*************** X*** 673,679 X found=1; X } X X! if(nfound<4+(pager*5)) for(nvynum=0;nvynum<MAXNAVY;nvynum++){ X if(((NWAR+NMER)!=0)&&(NXLOC==XREAL)&&(NYLOC==YREAL)) { X if((nfound>=pager*5)&&(nfound<=4+(pager*5))) { X /*print a navy*/ X X--- 682,688 ----- X found=1; X } X X! if(nfound<=4+(pager*5)) for(nvynum=0;nvynum<MAXNAVY;nvynum++){ X if(((NWAR+NMER)!=0)&&(NXLOC==XREAL)&&(NYLOC==YREAL)) { X if((nfound>=pager*5)&&(nfound<=4+(pager*5))) { X /*print a navy*/ X*** oldnpc.c Wed Jul 13 09:56:05 1988 X--- npc.c Wed Jul 13 09:56:16 1988 X*************** X*** 730,737 X if(ntn[country].jewels > getmgkcost(M_MIL,country)) { X ntn[country].jewels-=getmgkcost(M_MIL,country); X if((zz=getmagic(M_MIL))!=0){ X! fprintf(fnews,"1.\tnation %s gets combat power number %d\n",ntn[country].name,zz); X! printf("\tnation %s gets combat power number %d\n",ntn[country].name,zz); X exenewmgk(zz); X } else if((zz=getmagic(M_MIL))!=0){ X fprintf(fnews,"1.\tnation %s gets combat power number %d\n",ntn[country].name,zz); X X--- 730,737 ----- X if(ntn[country].jewels > getmgkcost(M_MIL,country)) { X ntn[country].jewels-=getmgkcost(M_MIL,country); X if((zz=getmagic(M_MIL))!=0){ X! fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz); X! printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz); X exenewmgk(zz); X } else if((zz=getmagic(M_MIL))!=0){ X fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz); X*************** X*** 734,741 X printf("\tnation %s gets combat power number %d\n",ntn[country].name,zz); X exenewmgk(zz); X } else if((zz=getmagic(M_MIL))!=0){ X! fprintf(fnews,"1.\tnation %s gets combat power number %d\n",ntn[country].name,zz); X! printf("\tnation %s gets combat power number %d\n",ntn[country].name,zz); X exenewmgk(zz); X } X else ntn[country].jewels+=getmgkcost(M_MIL,country); X X--- 734,741 ----- X printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz); X exenewmgk(zz); X } else if((zz=getmagic(M_MIL))!=0){ X! fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz); X! printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz); X exenewmgk(zz); X } X else ntn[country].jewels+=getmgkcost(M_MIL,country); X*************** X*** 744,751 X if(ntn[country].jewels > getmgkcost(M_CIV,country)) { X ntn[country].jewels-=getmgkcost(M_CIV,country); X if((zz=getmagic(M_CIV))!=0){ X! fprintf(fnews,"1.\tnation %s gets civilian power number %d\n",ntn[country].name,zz); X! printf("\tnation %s gets civilian power number %d\n",ntn[country].name,zz); X exenewmgk(zz); X } X else if((zz=getmagic(M_CIV))!=0){ X X--- 744,751 ----- X if(ntn[country].jewels > getmgkcost(M_CIV,country)) { X ntn[country].jewels-=getmgkcost(M_CIV,country); X if((zz=getmagic(M_CIV))!=0){ X! fprintf(fnews,"1.\tnation %s gets civilian power number %ld\n",ntn[country].name,zz); X! printf("\tnation %s gets civilian power number %ld\n",ntn[country].name,zz); X exenewmgk(zz); X } X else if((zz=getmagic(M_CIV))!=0){ X*************** X*** 749,756 X exenewmgk(zz); X } X else if((zz=getmagic(M_CIV))!=0){ X! fprintf(fnews,"1.\tnation %s gets civilian power number %d\n",ntn[country].name,zz); X! printf("\tnation %s gets civilian power number %d\n",ntn[country].name,zz); X exenewmgk(zz); X } X else ntn[country].jewels+=getmgkcost(M_CIV,country); X X--- 749,756 ----- X exenewmgk(zz); X } X else if((zz=getmagic(M_CIV))!=0){ X! fprintf(fnews,"1.\tnation %s gets civilian power number %ld\n",ntn[country].name,zz); X! printf("\tnation %s gets civilian power number %ld\n",ntn[country].name,zz); X exenewmgk(zz); X } X else ntn[country].jewels+=getmgkcost(M_CIV,country); X*************** X*** 796,802 X for(y=0;y<MAPY;y++) if(ONMAP) X attr[x][y]=1; X for(y=ntn[country].capy+NPCTOOFAR;y<MAPY;y++) X! for(x=0;x<MAPY;x++) if(ONMAP) X attr[x][y]=1; X for(x=0;x<ntn[country].capx-NPCTOOFAR;x++) X for(y=0;y<MAPY;y++) if(ONMAP) X X--- 796,802 ----- X for(y=0;y<MAPY;y++) if(ONMAP) X attr[x][y]=1; X for(y=ntn[country].capy+NPCTOOFAR;y<MAPY;y++) X! for(x=0;x<MAPX;x++) if(ONMAP) X attr[x][y]=1; X for(x=0;x<ntn[country].capx-NPCTOOFAR;x++) X for(y=0;y<MAPY;y++) if(ONMAP) X*************** X*** 802,808 X for(y=0;y<MAPY;y++) if(ONMAP) X attr[x][y]=1; X for(y=0;y<ntn[country].capy-NPCTOOFAR;y++) X! for(x=0;x<MAPY;x++) if(ONMAP) X attr[x][y]=1; X } X X X--- 802,808 ----- X for(y=0;y<MAPY;y++) if(ONMAP) X attr[x][y]=1; X for(y=0;y<ntn[country].capy-NPCTOOFAR;y++) X! for(x=0;x<MAPX;x++) if(ONMAP) X attr[x][y]=1; X } X X*************** X*** 1042,1048 X int line; X { X int armynum; X! for(armynum=0;armynum<MAXARM;armynum++) X if(ASOLD<0) { X printf("ERROR: line %d army %d nation %s soldier %d\n",line,armynum,ntn[country].name,ASOLD); X ASOLD=0; X X--- 1042,1048 ----- X int line; X { X int armynum; X! for(armynum=0;armynum<MAXARM;armynum++){ X if(ASOLD<0) { X printf("ERROR: line %d army %d nation %s soldier %d\n",line,armynum,ntn[country].name,ASOLD); X ASOLD=0; X*************** X*** 1049,1054 X } X if((AXLOC>MAPX)||(AYLOC>MAPY)){ X printf("CHECK ERROR: line %d army %d nation %s loc %d %d\n",line,armynum,ntn[country].name,AXLOC,AYLOC); X } X if(ntn[country].tiron < 0L) X printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron); X X--- 1049,1056 ----- X } X if((AXLOC>MAPX)||(AYLOC>MAPY)){ X printf("CHECK ERROR: line %d army %d nation %s loc %d %d\n",line,armynum,ntn[country].name,AXLOC,AYLOC); X+ AXLOC = ntn[country].capx; X+ AYLOC = ntn[country].capy; X } X } X if(ntn[country].tiron < 0L){ X*************** X*** 1050,1056 X if((AXLOC>MAPX)||(AYLOC>MAPY)){ X printf("CHECK ERROR: line %d army %d nation %s loc %d %d\n",line,armynum,ntn[country].name,AXLOC,AYLOC); X } X! if(ntn[country].tiron < 0L) X printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron); X if(ntn[country].tfood < 0L) X printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood); X X--- 1052,1059 ----- X AXLOC = ntn[country].capx; X AYLOC = ntn[country].capy; X } X! } X! if(ntn[country].tiron < 0L){ X printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron); X ntn[country].tiron = 0; X } X*************** X*** 1052,1058 X } X if(ntn[country].tiron < 0L) X printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron); X! if(ntn[country].tfood < 0L) X printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood); X if(ntn[country].jewels < 0L) X printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels); X X--- 1055,1063 ----- X } X if(ntn[country].tiron < 0L){ X printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron); X! ntn[country].tiron = 0; X! } X! if(ntn[country].tfood < 0L){ X printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood); X ntn[country].tfood = 0; X } X*************** X*** 1054,1060 X printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron); X if(ntn[country].tfood < 0L) X printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood); X! if(ntn[country].jewels < 0L) X printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels); X } X #endif DEBUG X X--- 1059,1067 ----- X } X if(ntn[country].tfood < 0L){ X printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood); X! ntn[country].tfood = 0; X! } X! if(ntn[country].jewels < 0L){ X printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels); X ntn[country].jewels = 0; X } X*************** X*** 1056,1060 X printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood); X if(ntn[country].jewels < 0L) X printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels); X } X #endif DEBUG X X--- 1063,1069 ----- X } X if(ntn[country].jewels < 0L){ X printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels); X+ ntn[country].jewels = 0; X+ } X } X #endif DEBUG X*** oldheader.h Wed Jul 13 09:55:58 1988 X--- header.h Wed Jul 13 09:56:16 1988 X*************** X*** 49,54 X #define MAXNAVY 16 /*maximum number of fleets per nation*/ X X /*THE FOLLOWING SHOULD BE COMMENTED OUT IF YOU DO NOT WANT THE FUNCTION*/ X /*#define HIDELOC /*defined if news is not to report sectors*/ X #define OGOD /*defined if you wish to enhance god mode*/ X /* this gives features like god passwords... */ X X--- 49,55 ----- X #define MAXNAVY 16 /*maximum number of fleets per nation*/ X X /*THE FOLLOWING SHOULD BE COMMENTED OUT IF YOU DO NOT WANT THE FUNCTION*/ X+ #define TRADE /*defined to allow commerce between nations*/ X /*#define HIDELOC /*defined if news is not to report sectors*/ X #define OGOD /*defined if you wish to enhance god mode*/ X /* this gives features like god passwords... */ X*************** X*** 59,65 X #define STORMS /* have storms strike fleets */ X #define VULCANIZE /* add in volcano eruptions.... */ X #define PVULCAN 20 /* % chance of eruption each round (see above)*/ X! /* #define ORCTAKE /* define if want orcs to takeover orc NPCS */ X #define TAKEPRICE 500000L /* price for orc takeover (see above) in jewels */ X #define PMOUNT 20 /* % of land that is mountains */ X #define PSTORM 3 /* % chance that a storm will strike a fleet */ X X--- 60,66 ----- X #define STORMS /* have storms strike fleets */ X #define VULCANIZE /* add in volcano eruptions.... */ X #define PVULCAN 20 /* % chance of eruption each round (see above)*/ X! #define ORCTAKE /* define if want orcs to takeover orc NPCS */ X #define TAKEPRICE 500000L /* price for orc takeover (see above) in jewels */ X #define PMOUNT 20 /* % of land that is mountains */ X #define PSTORM 3 /* % chance that a storm will strike a fleet */ X*************** X*** 84,90 X #define TAXFOOD 40L X #define TAXIRON 60L X #define TAXGOLD 70L X! /*City and Capitol tax rates based on people only (no multipleier)*/ X #define TAXCAP 1000L X #define TAXCITY 750L X X X--- 85,91 ----- X #define TAXFOOD 40L X #define TAXIRON 60L X #define TAXGOLD 70L X! /*Town and Capitol tax rates based on people only (no multiplyer)*/ X #define TAXCAP 1000L X #define TAXCITY 750L X X*** olddata.h Wed Jul 13 09:56:08 1988 X--- data.h Wed Jul 13 09:56:16 1988 X*************** X*** 93,99 X #define SCOUT 2 /*Scouting--will not engage enemy if possible*/ X #define ATTACK 3 /*Attack anybody (Hostile+) within 2 sectors*/ X #define DEFEND 4 /*Defend */ X! #define GARRISON 5 /*Garrison--for a city or Capitol */ X X struct s_sector X { X X--- 93,100 ----- X #define SCOUT 2 /*Scouting--will not engage enemy if possible*/ X #define ATTACK 3 /*Attack anybody (Hostile+) within 2 sectors*/ X #define DEFEND 4 /*Defend */ X! #define GARRISON 5 /*Garrison--for a town or Capitol */ X! #define TRADED 6 /*Indicates an army that has been traded*/ X X struct s_sector X { X*************** X*** 400,405 X extern char *helpfile; X extern char *newsfile; X extern char *isonfile; X X #define abrt() { \ X fprintf(stderr,"\nSerious Error (File %s, Line %d) - Aborting\n",__FILE__,__LINE__); \ X X--- 401,409 ----- X extern char *helpfile; X extern char *newsfile; X extern char *isonfile; X+ #ifdef TRADE X+ extern char *tradefile; X+ #endif TRADE X X #define abrt() { \ X fprintf(stderr,"\nSerious Error (File %s, Line %d) - Aborting\n",__FILE__,__LINE__); \ X*************** X*** 421,426 X extern void readdata(),redesignate(),redomil(),reduce(),rmessage(),score(); X extern void see(),showscore(),update(),updmove(),verifydata(),verify_ntn(); X extern void verify_sct(),wmessage(),writedata(),getdstatus(),exit(); X X extern char *crypt(),*strcpy(),*strncpy(),*strcat(),*strncat(); X X X--- 425,433 ----- X extern void readdata(),redesignate(),redomil(),reduce(),rmessage(),score(); X extern void see(),showscore(),update(),updmove(),verifydata(),verify_ntn(); X extern void verify_sct(),wmessage(),writedata(),getdstatus(),exit(); X+ #ifdef TRADE X+ extern void trade(),uptrade(); X+ #endif TRADE X X extern char *crypt(),*strcpy(),*strncpy(),*strcat(),*strncat(); X X*** oldnewlogin.h Wed Jul 13 09:55:59 1988 X--- newlogin.h Wed Jul 13 09:56:17 1988 X*************** X*** 63,67 X #define NLREPRO 1 X #define NLREPCOST 2 X #define NLMOVE 3 X! #define NLDBLCOST 2 X #define NLMAGIC 2 X X--- 63,67 ----- X #define NLREPRO 1 X #define NLREPCOST 2 X #define NLMOVE 3 X! #define NLDBLCOST 1 X #define NLMAGIC 2 X*** oldnations Wed Jul 13 09:55:56 1988 X--- nations Wed Jul 13 09:56:17 1988 X*************** X*** 41,47 X ######################################################################### X anorian elfwizard E A F 30 40 8 70000 1500 8500 8 2 X bobland dragon O B F 20 0 6 12000 1500 8000 10 9 X- cordoba wizard H C R 10 10 2 30000 1500 8000 8 4 X darboth balrog O D R 0 0 7 70000 1500 9500 8 9 X edland dragon O E R 20 0 8 12000 1500 8500 10 9 X fung elfking E F F 10 40 8 50000 1000 9500 8 2 X X--- 41,46 ----- X ######################################################################### X anorian elfwizard E A F 30 40 8 70000 1500 8500 8 2 X bobland dragon O B F 20 0 6 12000 1500 8000 10 9 X darboth balrog O D R 0 0 7 70000 1500 9500 8 9 X edland dragon O E R 20 0 8 12000 1500 8500 10 9 X fung elfking E F F 10 40 8 50000 1000 9500 8 2 X*************** X*** 47,52 X fung elfking E F F 10 40 8 50000 1000 9500 8 2 X gotho warking H G R 10 10 9 50000 1000 6150 8 4 X hargo king H H R 10 10 9 30000 1500 11000 7 4 X lint elfwizard E L F 20 30 8 50000 1500 7900 10 2 X medal elfpriest E M R 20 0 6 16000 2000 6500 10 9 X noria dwarfduke D N R 10 30 6 50000 1000 10000 8 4 X X--- 46,52 ----- X fung elfking E F F 10 40 8 50000 1000 9500 8 2 X gotho warking H G R 10 10 9 50000 1000 6150 8 4 X hargo king H H R 10 10 9 30000 1500 11000 7 4 X+ jordoba wizard H J R 10 10 2 30000 1500 8000 8 4 X lint elfwizard E L F 20 30 8 50000 1500 7900 10 2 X medal elfpriest E M R 20 0 6 16000 2000 6500 10 9 X noria dwarfduke D N R 10 30 6 50000 1000 10000 8 4 X*** oldMakefile Wed Jul 13 09:55:55 1988 X--- Makefile Wed Jul 13 09:56:17 1988 X*************** X*** 24,30 X # if they do not use the -d option. X DEFAULT = /c28/smile/game/default X X! CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -O X # The following CFLAGS should be used if you wish to debug the game X #CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g X X X--- 24,30 ----- X # if they do not use the -d option. X DEFAULT = /c28/smile/game/default X X! #CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -O X # The following CFLAGS should be used if you wish to debug the game X CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g X X*************** X*** 26,32 X X CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -O X # The following CFLAGS should be used if you wish to debug the game X! #CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g X X # this is the name of the user executable X # the user executable contains commands for the games players X X--- 26,32 ----- X X #CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -O X # The following CFLAGS should be used if you wish to debug the game X! CFLAGS = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g X X # this is the name of the user executable X # the user executable contains commands for the games players X*************** X*** 33,39 X GAME = conquer X # this is the name of the administrative executable X # the administrative executable contains commands for the game super user X! ADMIN = admin X X # This directory is where the executables will be stored X EXEDIR = /c28/smile/game/runv X X--- 33,39 ----- X GAME = conquer X # this is the name of the administrative executable X # the administrative executable contains commands for the game super user X! ADMIN = cadmin X X # This directory is where the executables will be stored X EXEDIR = /c28/smile/game/runv X*************** X*** 48,54 X X # AFILS are files needed for game updating... X AFILS = combat.c cexecute.c io.c admin.c makeworld.c \ X! newlogin.c update.c magic.c npc.c misc.c randevent.c data.c X AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o \ X newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o $(GETOPT) X X X--- 48,54 ----- X X # AFILS are files needed for game updating... X AFILS = combat.c cexecute.c io.c admin.c makeworld.c \ X! newlogin.c update.c magic.c npc.c misc.c randevent.c data.c trade.c X AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o \ X newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o \ X tradeA.o $(GETOPT) X*************** X*** 50,56 X AFILS = combat.c cexecute.c io.c admin.c makeworld.c \ X newlogin.c update.c magic.c npc.c misc.c randevent.c data.c X AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o \ X! newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o $(GETOPT) X X # GFILS are files needed to run a normal interactive game X GFILS = commands.c cexecute.c forms.c io.c main.c move.c \ X X--- 50,57 ----- X AFILS = combat.c cexecute.c io.c admin.c makeworld.c \ X newlogin.c update.c magic.c npc.c misc.c randevent.c data.c trade.c X AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o \ X! newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o \ X! tradeA.o $(GETOPT) X X # GFILS are files needed to run a normal interactive game X GFILS = commands.c cexecute.c forms.c io.c main.c move.c \ X*************** X*** 54,60 X X # GFILS are files needed to run a normal interactive game X GFILS = commands.c cexecute.c forms.c io.c main.c move.c \ X! magic.c misc.c reports.c data.c display.c extcmds.c X GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \ X magic.o misc.o reports.o data.o display.o extcmds.o $(GETOPT) X X X--- 55,61 ----- X X # GFILS are files needed to run a normal interactive game X GFILS = commands.c cexecute.c forms.c io.c main.c move.c \ X! magic.c misc.c reports.c data.c display.c extcmds.c trade.c X GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \ X magic.o misc.o reports.o data.o display.o extcmds.o trade.o $(GETOPT) X X*************** X*** 56,62 X GFILS = commands.c cexecute.c forms.c io.c main.c move.c \ X magic.c misc.c reports.c data.c display.c extcmds.c X GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \ X! magic.o misc.o reports.o data.o display.o extcmds.o $(GETOPT) X X HEADERS=header.h data.h newlogin.h X HELPFILE=help.txt X X--- 57,63 ----- X GFILS = commands.c cexecute.c forms.c io.c main.c move.c \ X magic.c misc.c reports.c data.c display.c extcmds.c trade.c X GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \ X! magic.o misc.o reports.o data.o display.o extcmds.o trade.o $(GETOPT) X X HEADERS=header.h data.h newlogin.h X HELPFILE=help.txt X*************** X*** 125,130 X newhelp X cat $(HELPFILE) | sed -f helpscript > $(HELPOUT) X $(RM) helpscript X cp $(HELPOUT) $(DEFAULT) X X lint: X X--- 126,132 ----- X newhelp X cat $(HELPFILE) | sed -f helpscript > $(HELPOUT) X $(RM) helpscript X+ -mkdir $(DEFAULT) 2>/dev/null X cp $(HELPOUT) $(DEFAULT) X X lint: X*************** X*** 209,211 X $(CC) $(CFLAGS) -DCONQUER -c forms.c X commands.o: data.h header.h commands.c X $(CC) $(CFLAGS) -DCONQUER -c commands.c X X--- 211,218 ----- X $(CC) $(CFLAGS) -DCONQUER -c forms.c X commands.o: data.h header.h commands.c X $(CC) $(CFLAGS) -DCONQUER -c commands.c X+ trade.o: data.h header.h trade.h trade.c X+ $(CC) $(CFLAGS) -DCONQUER -c trade.c X+ tradeA.o: data.h header.h trade.h trade.c X+ $(CC) $(CFLAGS) -DADMIN -c trade.c X+ mv trade.o tradeA.o X*** oldhelp.txt Wed Jul 13 09:55:54 1988 X--- help.txt Wed Jul 13 09:56:17 1988 X*************** X*** 11,17 X 'b': move south west 'S': diplomacy status 'N': read newspaper X 'J': scroll south 'Q': quit (saves changes) 'W': write message X 'K': scroll north 'M': magic 'R': read messages X! 'L': scroll east 'C': construct X 'H': scroll west 'D': draft 'ESC [1-5]': chg status X 'G': go to next army 'ESC +': combine 2 armies X 'F': go to next fleet 'ESC -': split army X X--- 11,17 ----- X 'b': move south west 'S': diplomacy status 'N': read newspaper X 'J': scroll south 'Q': quit (saves changes) 'W': write message X 'K': scroll north 'M': magic 'R': read messages X! 'L': scroll east 'C': construct 'T': trade X 'H': scroll west 'D': draft 'ESC [1-5]': chg status X 'G': go to next army 'ESC +': combine 2 armies X 'F': go to next fleet 'ESC -': split army X*************** X*** 19,34 X END X Welcome to Conquer XVERSION X X! CONQUER is a multi player computer game designed to run under the UNIX X! operating system. In CONQUER, each player is the leader of a nation, X! composed of people (humans, orcs, elves, dwarves), resources, and land. X! Rulers customize their nation at creation by chosing their race and by giving X! their nation special powers (magic, combat factor, location, speed...) X! and resources (civilians, troops, iron, gold...). Play involves building, X! moving, and controlling armies and navies, diplomacy with other players, X! and adjusting economic activity, which is primarily geared to the production X! of gold for your treasury. Iron is needed, however to build ships & armies, X! and food is needed to prevent revolts and keep people alive. X X Command line format: conquer [-maxhps -nNAT -dDIR] X -h print this help text -n NTN run as nation NTN X X--- 19,33 ----- X END X Welcome to Conquer XVERSION X X! CONQUER is a multi player computer game designed to run under the UNIX OS. X! In CONQUER, each player is the leader of a nation, composed of people X! (humans, orcs, elves, dwarves), resources, and land. Rulers customize their X! nation at creation by chosing their race and by giving their nation special X! powers (magic, combat factor, location, speed...) and resources (civilians, X! troops, iron, gold...). Play involves building, moving, and controlling X! armies and navies, diplomacy with other players, and economics, which is X! geared to raising of gold for your treasury, iron for ships & armies, jewels, X! and food to prevent revolts and keep people alive. X X Command line format: conquer [-hs -nNAT -dDIR] X -h print this help text X*************** X*** 30,43 X of gold for your treasury. Iron is needed, however to build ships & armies, X and food is needed to prevent revolts and keep people alive. X X! Command line format: conquer [-maxhps -nNAT -dDIR] X! -h print this help text -n NTN run as nation NTN X! -d DIR run on data in directory DIR -s print out scores X! Command line format: admin [-maxdp] X! -a add new player -m make a world X! -p print a map -x execute program X! -d DIR run on data in directory DIR X! It is suggested that each player set up a shell alias for their game & nation X END X THE WORLD X X X--- 29,42 ----- X geared to raising of gold for your treasury, iron for ships & armies, jewels, X and food to prevent revolts and keep people alive. X X! Command line format: conquer [-hs -nNAT -dDIR] X! -h print this help text X! -s print out scores X! -n NTN run as nation NTN X! -d DIR run on data in directory DIR X! X! Each player should set up a shell alias to run their nation. The Game X! Administrator should read other documentation on using the admin command. X END X THE WORLD X X*************** X*** 136,141 X 'N': newspaper: Briefs you on world happenings. Note: News has 4 pages. X 'P': production: ESTIMATE your nations production statistics X 'S': diplomacy: Allow you to see and alter your diplomatic status. X 'Q': quit: Save your move and quit the game. Note there is no X means supported to quit without saving your moves. X 'R': read mail: Read mail messages X X--- 135,141 ----- X 'N': newspaper: Briefs you on world happenings. Note: News has 4 pages. X 'P': production: ESTIMATE your nations production statistics X 'S': diplomacy: Allow you to see and alter your diplomatic status. X+ 'T': commerce: Allow you to trade with other nations. X 'Q': quit: Save your move and quit the game. Note there is no X means supported to quit without saving your moves. X 'R': read mail: Read mail messages X*************** X*** 315,322 X SHIPS AND SHIP COSTS X X crew build cost maintain cost capacity X! Warship 50 XWARSHPCOST XSHIPMAINT 0 X! Merchant 50 XMERSHPCOST XSHIPMAINT XSHIPCP X X Ships will now have crews - which, in addition to being drafted upon X construction, represent the ships current level of damage and are replaced, X X--- 315,322 ----- X SHIPS AND SHIP COSTS X X crew build cost maintain cost capacity X! Warship XSHIPCREW XWARSHPCOST XSHIPMAINT 0 X! Merchant XSHIPCREW XMERSHPCOST XSHIPMAINT XSHIPCP X X Ships will now have crews - which, in addition to being drafted upon X construction, represent the ships current level of damage and are replaced, X*************** X*** 332,337 X 10 and all their remaining points points for non harbor coastlands. Naval X combat has not been adequately play tested, and Sailor units dont work. X END X MAGIC POWERS X Magic powers differentiate your nation from all the other nations in the X world. There are three types of powers - truely MAGICAL powers, which X X--- 332,355 ----- X 10 and all their remaining points points for non harbor coastlands. Naval X combat has not been adequately play tested, and Sailor units dont work. X END X+ COMMERCE AND TRADING X+ X+ Trading makes it be possible to exchange items between nations. X+ X+ There are seven types of items available for trade: gold, food, iron, X+ jewels, land, soldiers, and ships. To place an item up for trade, X+ the player need only select the sell option on the commerce board. The X+ player will then enter the type and amount of his product followed by the X+ type and minimum amount of what he wants in return. The product will X+ remain on the commerce board until it is purchased or removed by the X+ owner of the product. To purchase an item, a player can just select the X+ item number to purchase and then enter a bid amount. You may only trade X+ mercenary, seige engine, catapult, (summoned) monster, or elephant units. X+ X+ During every update, bids will be resolved and the highest bid for a X+ product will receive the product. There is a 20% administration fee X+ for a trade (i.e. 20% of the traded goods on each side disappear) X+ END X MAGIC POWERS X Magic powers differentiate your nation from all the other nations in the X world. There are three types of powers - truely MAGICAL powers, which X*************** X*** 454,459 X X THE NEXT PAGE IS THE COMBAT RESULTS TABLE X basically the attacker wants a high roll and the defender wants low. X END X 6-1 5-1 4-1 3-1 2-1 3-2 5-4 1-1 4-5 2-3 1-2 1-3 1-4 1-5 1-6 X <--010 20% 40% 50% 60% 70% 80% 90% 100%100%100%110%120%120%130%130% X X--- 472,481 ----- X X THE NEXT PAGE IS THE COMBAT RESULTS TABLE X basically the attacker wants a high roll and the defender wants low. X+ The table is based on a roll between 0 and 200 (it does NOT use true X+ percentages). The number given is the percent loss, which is modified X+ by the armies attack or defensive bonus. Retreats are based on the X+ relative losses taken by a given side. X END X 6-1 5-1 4-1 3-1 2-1 3-2 5-4 1-1 4-5 2-3 1-2 1-3 1-4 1-5 1-6 X <--010 20% 40% 50% 60% 70% 80% 90% 100%100%100%110%120%120%130%130% X*************** X*** 526,532 X Storms XSTORMS Volcanos XVULCANIZE X Npc Nations XNPC PC Automove XCMOVE X Random Events XRANEVENT Orc Takeovers XORCTAKE X! Super God XOGOD X END X ADDITIONAL OPTIONS X X X--- 548,555 ----- X Storms XSTORMS Volcanos XVULCANIZE X Npc Nations XNPC PC Automove XCMOVE X Random Events XRANEVENT Orc Takeovers XORCTAKE X! Super God XOGOD Hidden News XHIDELOC X! Trading XTRADE X END X ADDITIONAL OPTIONS X X*** oldREADME Wed Jul 13 09:55:50 1988 X--- README Wed Jul 13 09:56:17 1988 X*** oldrun Wed Jul 13 09:56:00 1988 X--- run Wed Jul 13 09:56:17 1988 X X END_OF_FILE if test 31526 -ne `wc -c <'patches03'`; then echo shar: \"'patches03'\" unpacked with wrong size! fi # end of 'patches03' fi echo shar: End of shell archive. exit 0