games@tekred.TEK.COM (07/29/88)
Submitted by: ihnp4!homxc!smile Comp.sources.games: Volume 5, Issue 54 Archive-name: conquer3/Patch5 #! /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: patches05 # Wrapped by billr@saab on Fri Jul 29 09:06:31 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'patches05' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patches05'\" else echo shar: Extracting \"'patches05'\" \(48426 characters\) sed "s/^X//" >'patches05' <<'END_OF_FILE' X*** onpc.c Thu Jul 28 09:10:33 1988 X--- npc.c Thu Jul 28 09:11:10 1988 X*************** X*** 123,130 X } X } X } X! else { X! /*place a new Nomad army*/ X x=(rand()%(MAPX-8))+4; X y=(rand()%(MAPY-8))+4; X if((rand()%4==0)&&(is_habitable(x,y))) { X X--- 123,130 ----- X } X } X } X! /* place a few new Nomad armies */ X! for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD<=0){ X x=(rand()%(MAPX-8))+4; X y=(rand()%(MAPY-8))+4; X if((rand()%4==0)&&(is_habitable(x,y))) { X*************** X*** 131,137 X AXLOC=x; X AYLOC=y; X ASOLD=100+100*(rand()%10); X! ATYPE=A_INFANTRY; X ASTAT=ATTACK; X } X } X X--- 131,137 ----- X AXLOC=x; X AYLOC=y; X ASOLD=100+100*(rand()%10); X! ATYPE=A_LT_CAV; X ASTAT=ATTACK; X } X if(rand()%3==0) break; X*************** X*** 134,139 X ATYPE=A_INFANTRY; X ASTAT=ATTACK; X } X } X country=NLIZARD; X for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0){ X X--- 134,140 ----- X ATYPE=A_LT_CAV; X ASTAT=ATTACK; X } X+ if(rand()%3==0) break; X } X country=NLIZARD; X for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0){ X*************** X*** 615,621 X { X int goldthresh,ironthresh,citythresh; X int armynum,loop; X! int x,y,i; X long zz; X X #ifdef DEBUG X X--- 616,622 ----- X { X int goldthresh,ironthresh,citythresh; X int armynum,loop; X! int x,y,i,p; X long zz; X X #ifdef DEBUG 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--- 731,741 ----- 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! for(p=S_MIL;p<=E_MIL;p++) if(powers[p]==zz){ X! fprintf(fnews,"1.\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]); X! printf("\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]); X! break; X! } X exenewmgk(zz); X } else if((zz=getmagic(M_MIL))!=0){ X for(p=S_MIL;p<=E_MIL;p++) if(powers[p]==zz){ 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--- 738,748 ----- X } X exenewmgk(zz); X } else if((zz=getmagic(M_MIL))!=0){ X! for(p=S_MIL;p<=E_MIL;p++) if(powers[p]==zz){ X! fprintf(fnews,"1.\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]); X! printf("\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]); X! break; X! } 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 %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--- 751,761 ----- 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! for(p=S_CIV;p<=E_CIV;p++) if(powers[p]==zz){ X! fprintf(fnews,"1.\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[p]); X! printf("\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[p]); X! break; X! } 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 %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--- 759,769 ----- X exenewmgk(zz); X } X else if((zz=getmagic(M_CIV))!=0){ X! for(p=S_CIV;p<=E_CIV;p++) if(powers[p]==zz){ X! fprintf(fnews,"1.\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[zz]); X! printf("\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[zz]); X! break; X! } X exenewmgk(zz); X } X else ntn[country].jewels+=getmgkcost(M_CIV,country); X*** oheader.h Thu Jul 28 09:10:33 1988 X--- header.h Thu Jul 28 09:11:11 1988 X*** odata.h Thu Jul 28 09:10:47 1988 X--- data.h Thu Jul 28 09:11:11 1988 X*************** X*** 426,432 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--- 426,432 ----- 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(),checktrade(); X #endif TRADE X X extern char *crypt(),*strcpy(),*strncpy(),*strcat(),*strncat(); X*** ohelp.txt Thu Jul 28 09:10:49 1988 X--- help.txt Thu Jul 28 09:11:12 1988 X*************** X*** 100,107 X merging 2 armies, splitting armies, and disbanding armies X 'c': administration: Report on nation status and then change name, password, X add to combat bonus, or (if god) destroy a nation. X! 'd': change display: Change display mode. Numbers in gold screens... are X! relative values of the materials. X 'f': fleet report: Report on the status of your fleets. X 'g': group report: As army report, but display will only show those armies X in the current sector. X X--- 100,107 ----- X merging 2 armies, splitting armies, and disbanding armies X 'c': administration: Report on nation status and then change name, password, X add to combat bonus, or (if god) destroy a nation. X! 'd': change display: Change display mode. iron/gold screen #'s are sector X! value. Population screen #'s are the closest 100 people X 'f': fleet report: Report on the status of your fleets. X 'g': group report: As army report, but display will only show those armies X in the current sector. X*************** X*** 318,327 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! in harbor, by using the construct ships command. Movement of X! a fleet is reduced if the crews are not full. Marine or Sailor Armies X can also be carried by navies with warships. Each fleet may carry one army X in addition to any troops that are ferried - who dont count in combat. X Marines add to chances of success in shipboard combat. X X--- 318,326 ----- X Warship XSHIPCREW XWARSHPCOST XSHIPMAINT 0 X Merchant XSHIPCREW XMERSHPCOST XSHIPMAINT XSHIPCP X X! Ships require crews - which both represent men on board and the current level X! of damage. Crew is replaced (repairs) in harbor, via <construct ships>. Fleet X! movement is reduced if the crews are not full. Marine or Sailor Armies X can also be carried by navies with warships. Each fleet may carry one army X in addition to any troops that are ferried - who dont count in combat. X Marines add to chances of success in shipboard combat. X*************** X*** 405,411 X NINJA Can have Ninja units. Spys show enemy troop/civilian strength X exactly (even voids) X SAILOR 1/2 price naval units. Can use marines. +10% ramming. X! DEMOCRACY +10% in combat (moralle) +1 Move +1 repro All units eat double. X ROADS +4 to move if unit starts in your nation. X SLAVER you gain 25% of the populace of *any* sector you take over X END X X--- 404,410 ----- X NINJA Can have Ninja units. Spys show enemy troop/civilian strength X exactly (even voids) X SAILOR 1/2 price naval units. Can use marines. +10% ramming. X! DEMOCRACY +10% in combat (moralle) +1 Move +1 repro All civilians eat double. X ROADS +4 to move if unit starts in your nation. X SLAVER you gain 25% of the populace of *any* sector you take over X END X*************** X*** 499,504 X 180-190 0% 0% 0% 0% 5% 10% 10% 20% 20% 30% 30% 30% 30% 40% 40% X 190+++ 0% 0% 0% 0% 5% 10% 10% 10% 20% 20% 30% 30% 30% 30% 40% X END X FINAL HINTS & OTHER COSTS X X It is important to initially have a reprorate of 9-10% and a move of ~8-9. X X--- 498,536 ----- X 180-190 0% 0% 0% 0% 5% 10% 10% 20% 20% 30% 30% 30% 30% 40% 40% X 190+++ 0% 0% 0% 0% 5% 10% 10% 10% 20% 20% 30% 30% 30% 30% 40% X END X+ MAIL MESSAGE FROM COMBAT X+ X+ The following is a mail message you might recieve after a combat. An X+ explaination of its details follows. X+ X+ BATTLE SUMMARY for sector 22, 29 X+ You are on the Defending Side X+ edland is attacking with army 17 (type Infantry, men 125, bonus=80) X+ edland is attacking with army 23 (type Infantry, men 160, bonus=80) X+ uru is defending with army 9 (type Infantry, men 84, bonus=110) X+ attacking soldiers=285 modified roll=42-> attackers percent loss 30% X+ defending soldiers=84 modified roll=100-> defenders percent loss 70% X+ ODDS are 339 to 100 X+ RESULT: Attackers lose 85 men, Defenders lose 49 men X+ Additionally, All defenders retreat to 21 28 X+ END X+ AN EXAMPLE OF COMBAT X+ X+ A battle occurs in 22,29 (a "good" farm) between your nation "uru" (defender) X+ and "edland". They have 285 infantry vs. 84 of your infantry. Your defensive X+ bonus is +70, their attack bonus is +40. Infantry are +0/+0. A movement bonus X+ goes to both sides = 5*(9-movecost)=+40. Their total bonus is 40+40+=+80. X+ Yours is 70+40=110. This leads to dice modifier of 30 in your favor. X+ They roll 22 which +50-30=42; which on the 3:1 table yields 30% losses X+ you roll 80 which +50-30=100; 200-100 on the 1:3 table yields 70% losses X+ the actual loss is troops * Percent * divisor / (100+plus), where the divisor X+ is the least bonus on any side (better troops die less). For you this leads X+ to 84*70*1.4 / 100*(1.7) = 49 men. for them it leads to 85 men. Despite your X+ awful luck at the dice, you still came out quite well. X+ X+ However, because they did cream you, there was a chance that you were X+ forced to retreat, which you did to 21 28. X+ END X FINAL HINTS & OTHER COSTS X X It is important to initially have a reprorate of 9-10% and a move of ~8-9. X*************** X*** 528,533 X If you have too many people in a given non Town, non capitol sector, X reproduction and production is halved for them. If you have a huge X (>10,000,000) number of people in a sector, they will not reproduce. X END X OPTIONS OF YOUR VERSION X X X--- 560,568 ----- X If you have too many people in a given non Town, non capitol sector, X reproduction and production is halved for them. If you have a huge X (>10,000,000) number of people in a sector, they will not reproduce. X+ X+ WARNING: The Naval Code has been known to be buggy. Please pay attention X+ and send the author notes on discrepancies in the code. X END X OPTIONS OF YOUR VERSION X X*** otrade.c Thu Jul 28 09:10:15 1988 X--- trade.c Thu Jul 28 09:11:13 1988 X*************** X*** 42,48 X #define BUY 1 X #define NODEAL 2 X #define NOSALE 3 X! #define TRADECOST(cost) ((100-cost)/100) /* twenty percent cost normal*/ X X extern short country; X X X--- 42,48 ----- X #define BUY 1 X #define NODEAL 2 X #define NOSALE 3 X! #define TRADECOST(cost) (100-cost)/100 /* twenty percent cost is normal*/ X X extern short country; X X*************** X*** 54,65 X "no available armies", "no available navies"}; X #endif ADMIN X #ifdef CONQUER X! /* Use this when you wish to sell something */ X! char *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 */ X char *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 X--- 54,60 ----- X "no available armies", "no available navies"}; X #endif ADMIN X #ifdef CONQUER X! /* Use this when you wish to bid something */ X char *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ", X "Bid how much iron? ", "Bid how many jewels? ", "What X location? ", X "Bid what army? ", "Bid what navy? "}; X*************** X*** 61,68 X X /* Use this when you wish to place a bid something */ X char *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 X void X trade() X X--- 56,63 ----- X #ifdef CONQUER X /* Use this when you wish to bid something */ X char *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ", X! "Bid how much iron? ", "Bid how many jewels? ", "What X location? ", X! "Bid what army? ", "Bid what navy? "}; X X void X trade() X*************** X*** 121,126 X holdlong, X commodities[type1[holdint]]); X } X mvprintw(count,40,"%9ld %s", X lvar2[holdint], X commodities[type2[holdint]]); X X--- 116,126 ----- X holdlong, X commodities[type1[holdint]]); X } X+ if (type2[holdint]==TDLAND) { X+ mvprintw(count,40,"(food=%2ld) %s", X+ lvar2[holdint], X+ commodities[type2[holdint]]); X+ } else { X mvprintw(count,40,"%9ld %s", X lvar2[holdint], X commodities[type2[holdint]]); X*************** X*** 124,129 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 X--- 124,130 ----- X mvprintw(count,40,"%9ld %s", X lvar2[holdint], X commodities[type2[holdint]]); X+ } X if (count>16) { X standout(); X mvaddstr(21,30,"Hit Any Key to Continue"); X*************** X*** 135,141 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 X--- 136,142 ----- X mvaddstr(0,27,"COMMODITIES EXCHANGE"); X standend(); X mvprintw(2,0," Nation\t\tItem\t\tMinimum Price"); X! count=2; X } X } X } X*************** X*** 141,146 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 X--- 142,148 ----- X } X standout(); X count++; 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*************** X*** 217,223 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 X--- 219,225 ----- 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*************** X*** 256,262 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 X--- 258,264 ----- X tradeerr("Error opening file for trading"); X abrt(); X } X! setaside(country,type2[holdint],holdlong,(int)holdlong,FALSE); X fprintf(tfile, "%d %d %d %d %ld %ld %d\n",BUY, country, holdint, 0, holdlong, holdlong2, 0); X fclose(tfile); X } X*************** X*** 280,286 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 X--- 282,288 ----- X return; X } X X! mvprintw(count++,0,"%s",buylist[holdint]); X refresh(); X /* find out how much commodities */ X holdlong = (long) get_number(); X*************** X*** 357,363 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--- 359,366 ----- X } X } else { X /* find out for what value */ X! mvprintw(count++,0,"Minimum Amount of %s? " X! ,commodities[holdint2]); X refresh(); X holdlong2 = (long) get_number(); X if (holdlong2 == 0L) return; X*************** X*** 364,370 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 X--- 367,373 ----- X } X X /* make sure what was bid is unusable */ X! setaside(country,holdint,holdlong,(int)holdlong,FALSE); X X /* set up output properly */ X if (holdint==TDARMY) { X*************** X*** 416,422 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 X--- 419,425 ----- 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],extra[holdint],FALSE); X /*redraw the commodities board so removal is seen*/ X inloop=FALSE; X done=FALSE; X*************** X*** 486,492 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 X X--- 489,495 ----- 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 food value is %d", entered,temp); X return(temp); X } X X*************** X*** 533,538 X } X return(hold); X } X X /* set aside things that are up for bid */ X void X X--- 536,542 ----- X } X return(hold); X } X+ #endif CONQUER X X /* set aside things that are up for bid */ X void X*************** X*** 536,543 X X /* set aside things that are up for bid */ X void X! setaside(cntry,item,longval) X! int cntry,item; X long longval; X { X switch(item) X X--- 540,547 ----- X X /* set aside things that are up for bid */ X void X! setaside(cntry,item,longval,extint,isup) X! int cntry,item,isup,extint; X long longval; X { X switch(item) X*************** X*** 543,549 X switch(item) X { X case TDGOLD: X! ntn[cntry].tgold -= longval; X break; X case TDFOOD: X ntn[cntry].tfood -= longval; X X--- 547,553 ----- X switch(item) X { X case TDGOLD: X! if (isup==FALSE) ntn[cntry].tgold -= longval; X break; X case TDFOOD: X ntn[cntry].tfood -= longval; X*************** X*** 549,555 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 X--- 553,559 ----- X ntn[cntry].tfood -= longval; X break; X case TDIRON: X! if (isup==FALSE) ntn[cntry].tiron -= longval; X break; X case TDJEWL: X if (isup==FALSE) ntn[cntry].jewels -= longval; X*************** X*** 552,558 X ntn[cntry].tiron -= longval; X break; X case TDJEWL: X! ntn[cntry].jewels -= longval; X break; X case TDLAND: X break; X X--- 556,562 ----- X if (isup==FALSE) ntn[cntry].tiron -= longval; X break; X case TDJEWL: X! if (isup==FALSE) ntn[cntry].jewels -= longval; X break; X case TDLAND: X break; X*************** X*** 557,564 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 X--- 561,568 ----- X case TDLAND: X break; X case TDARMY: X! ntn[cntry].arm[extint].smove = 0; X! ntn[cntry].arm[extint].stat = TRADED; X break; X case TDSHIP: X /* use armynum to hold indicator */ X*************** X*** 562,569 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--- 566,573 ----- X break; X case TDSHIP: X /* use armynum to hold indicator */ X! ntn[cntry].nvy[extint].smove = 0; X! ntn[cntry].nvy[extint].armynum = TRADED; X break; X } X } X*************** X*** 570,577 X X /* regain things that are up for bid */ X void X! takeback(cntry,item,longval) X! int cntry,item; X long longval; X { X switch(item) X X--- 574,581 ----- X X /* regain things that are up for bid */ X void X! takeback(cntry,item,longval,extint,isup) X! int cntry,item,isup,extint; X long longval; X { X switch(item) X*************** X*** 577,583 X switch(item) X { X case TDGOLD: X! ntn[cntry].tgold += longval; X break; X case TDFOOD: X ntn[cntry].tfood += longval; X X--- 581,587 ----- X switch(item) X { X case TDGOLD: X! if (isup==FALSE) ntn[cntry].tgold += longval; X break; X case TDFOOD: X ntn[cntry].tfood += longval; X*************** X*** 583,589 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 X--- 587,593 ----- X ntn[cntry].tfood += longval; X break; X case TDIRON: X! if (isup==FALSE) ntn[cntry].tiron += longval; X break; X case TDJEWL: X if (isup==FALSE) ntn[cntry].jewels += longval; X*************** X*** 586,592 X ntn[cntry].tiron += longval; X break; X case TDJEWL: X! ntn[cntry].jewels += longval; X break; X case TDLAND: X break; X X--- 590,596 ----- X if (isup==FALSE) ntn[cntry].tiron += longval; X break; X case TDJEWL: X! if (isup==FALSE) ntn[cntry].jewels += longval; X break; X case TDLAND: X break; X*************** X*** 591,597 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 X--- 595,601 ----- X case TDLAND: X break; X case TDARMY: X! ntn[cntry].arm[extint].stat = DEFEND; X break; X case TDSHIP: X /* use armynum to hold indicator */ X*************** X*** 595,601 X break; X case TDSHIP: X /* use armynum to hold indicator */ X! ntn[cntry].nvy[(int)longval].armynum = 0; X break; X } X } X X--- 599,605 ----- X break; X case TDSHIP: X /* use armynum to hold indicator */ X! ntn[cntry].nvy[extint].armynum = 0; X break; X } X } X*************** X*** 599,605 X break; X } X } X- #endif CONQUER X X #ifdef ADMIN X /* give things that were purchased from cntry1 to cntry2 */ X X--- 603,608 ----- X break; X } X } X X #ifdef ADMIN X /* give things that were purchased from cntry1 to cntry2 */ X*************** X*** 615,621 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 X--- 618,623 ----- X { X case TDGOLD: X returnval = longval; X ntn[cntry2].tgold += longval * TRADECOST(20); X break; X case TDFOOD: X*************** X*** 619,629 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 X--- 621,628 ----- X ntn[cntry2].tgold += longval * TRADECOST(20); X break; X case TDFOOD: X! returnval = longval; X! ntn[cntry2].tfood += longval * TRADECOST(20); X break; X case TDIRON: X ntn[cntry2].tiron += longval * TRADECOST(20); X*************** X*** 626,636 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 X--- 625,632 ----- X ntn[cntry2].tfood += longval * TRADECOST(20); X break; X case TDIRON: X! ntn[cntry2].tiron += longval * TRADECOST(20); X! returnval = longval; X break; X case TDJEWL: X ntn[cntry2].jewels += longval * TRADECOST(20); X*************** X*** 633,643 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 X--- 629,636 ----- X returnval = longval; X break; X case TDJEWL: X! ntn[cntry2].jewels += longval * TRADECOST(20); X! returnval = longval; X break; X case TDLAND: X if (sct[(int)longval][extra].owner==cntry1) { X*************** X*** 754,760 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 X--- 747,753 ----- 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.\n",cname[count],cname[1],cname[0]); X if (item1<=TDJEWL) X fprintf(fp[count],"%s Nation %s receives %ld %s\n",cname[count],cname[1],lvar1,commodities[item1]); X else if (item1==TDLAND) X*************** X*** 756,762 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 X--- 749,755 ----- X fprintf(fp[count],"%s \n",cname[count]); X fprintf(fp[count],"%s Trade transaction between %s and %s completed.\n",cname[count],cname[1],cname[0]); X if (item1<=TDJEWL) X! fprintf(fp[count],"%s Nation %s receives %ld %s\n",cname[count],cname[1],lvar1,commodities[item1]); X else if (item1==TDLAND) X fprintf(fp[count],"%s Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar1,lvar2); X else if (item1==TDARMY) X*************** X*** 758,764 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 X--- 751,757 ----- X if (item1<=TDJEWL) X fprintf(fp[count],"%s Nation %s receives %ld %s\n",cname[count],cname[1],lvar1,commodities[item1]); X else if (item1==TDLAND) X! fprintf(fp[count],"%s Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar1,lvar2); X else if (item1==TDARMY) X fprintf(fp[count],"%s Nation %s receives army #%ld\n",cname[count],cname[1],lvar1); X else if (item1==TDSHIP) X*************** X*** 760,766 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 X--- 753,759 ----- X else if (item1==TDLAND) X fprintf(fp[count],"%s Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar1,lvar2); X else if (item1==TDARMY) X! fprintf(fp[count],"%s Nation %s receives army #%ld\n",cname[count],cname[1],lvar1); X else if (item1==TDSHIP) X fprintf(fp[count],"%s Nation %s receives navy #%ld\n",cname[count],cname[1],lvar1); X if (item2<=TDJEWL) X*************** X*** 762,768 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 X--- 755,761 ----- X else if (item1==TDARMY) X fprintf(fp[count],"%s Nation %s receives army #%ld\n",cname[count],cname[1],lvar1); X else if (item1==TDSHIP) X! fprintf(fp[count],"%s Nation %s receives navy #%ld\n",cname[count],cname[1],lvar1); X if (item2<=TDJEWL) X fprintf(fp[count],"%s Nation %s receives %ld %s\n",cname[count],cname[0],lvar3,commodities[item2]); X else if (item2==TDLAND) X*************** X*** 764,776 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 X--- 757,770 ----- X else if (item1==TDSHIP) X fprintf(fp[count],"%s Nation %s receives navy #%ld\n",cname[count],cname[1],lvar1); X if (item2<=TDJEWL) X! fprintf(fp[count],"%s Nation %s receives %ld %s\n",cname[count],cname[0],lvar3,commodities[item2]); X! else if (item2==TDLAND) X! fprintf(fp[count],"%s Nation %s receives sector %ld, %ld\n",cname[count],cname[0],lvar3,lvar4); X! else if (item2==TDARMY) X! fprintf(fp[count],"%s Nation %s receives army #%ld\n",cname[count],cname[0],lvar3); X! else if (item2==TDSHIP) X! fprintf(fp[count],"%s Nation %s receives navy #%ld\n",cname[count],cname[0],lvar3); X! fprintf(fp[count],"END\n"); X fclose(fp[count]); X } X } X*************** X*** 783,790 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--- 777,785 ----- X { X int oldcntry=country,returnval=FALSE; X country=cntry; X! if ( (ASTAT!=TRADED) && (ATYPE==A_MERCENARY || ATYPE==A_SEIGE X! || ATYPE==A_CATAPULT || ATYPE==A_ELEPHANT X! || ATYPE>=MINMONSTER) ) returnval=TRUE; X country=oldcntry; X return(returnval); X } X*************** X*** 806,812 X } X X void X! uptrade() X { X FILE *tfile; X int count, itemnum=0, natn[MAXITM]; X X--- 801,807 ----- X } X X void X! checktrade() X { X FILE *tfile; X int count, itemnum=0, natn[MAXITM]; X*************** X*** 811,816 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 X--- 806,842 ----- X FILE *tfile; X int count, itemnum=0, natn[MAXITM]; X int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM]; X+ long lvar1[MAXITM], lvar2[MAXITM]; X+ void takeback(); X+ void setaside(); X+ /* initialize purchase list */ X+ for (count=0; count<MAXITM; count++) { X+ deal[count]=(-1); 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+ if (natn[itemnum]==country) X+ takeback(country,type1[type1[itemnum]],lvar1[type1[itemnum]],extra[type1[itemnum]],TRUE); X+ } else if (deal[itemnum]==SELL) { X+ if (natn[itemnum]==country) X+ setaside(country,type1[itemnum],lvar1[itemnum],extra[itemnum],TRUE); X+ itemnum++; X+ } else if (deal[itemnum]==BUY) { X+ if (natn[itemnum]==country) X+ setaside(country,type2[type1[itemnum]],lvar1[itemnum],(int)lvar1[itemnum],TRUE); X+ } X+ } X+ fclose(tfile); X+ } X+ X #ifdef ADMIN X void X uptrade() X*************** X*** 812,817 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 X--- 838,849 ----- X } X X #ifdef ADMIN X+ void X+ uptrade() X+ { X+ FILE *tfile; X+ int count, itemnum=0, natn[MAXITM]; X+ int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM]; X extern FILE *fnews; X void trademail(); X int whobuy[MAXITM]; X*************** X*** 817,823 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 X--- 849,854 ----- X int whobuy[MAXITM]; X long tradeit(), buy1[MAXITM], buy2[MAXITM]; X long price[MAXITM], gettval(), longval1, longval2; X long lvar1[MAXITM], lvar2[MAXITM]; X void takeback(); X X*************** X*** 819,827 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 X--- 850,856 ----- X long tradeit(), buy1[MAXITM], buy2[MAXITM]; X long price[MAXITM], gettval(), longval1, longval2; X long lvar1[MAXITM], lvar2[MAXITM]; X! void takeback(); X X /* initialize purchase list */ X for (count=0; count<MAXITM; count++) { X*************** X*** 826,832 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--- 855,860 ----- X /* initialize purchase list */ X for (count=0; count<MAXITM; count++) { X deal[count]=(-1); X whobuy[count]=(-1); X price[count]=(-1); X } X*************** X*** 829,835 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 X--- 857,862 ----- X deal[count]=(-1); X whobuy[count]=(-1); X price[count]=(-1); X } X /* open trading file */ X if ((tfile = fopen(tradefile,"r")) == NULL) { X*************** X*** 843,851 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 X--- 870,875 ----- 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 } else if (deal[itemnum]==BUY) { X*************** X*** 848,856 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 X--- 872,877 ----- X deal[type1[itemnum]]=NOSALE; X } else if (deal[itemnum]==SELL) { X itemnum++; X } else if (deal[itemnum]==BUY) { X if (deal[type1[itemnum]]==SELL && X (price[type1[itemnum]] < X*************** X*** 852,861 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 X--- 873,884 ----- X } else if (deal[itemnum]==SELL) { X itemnum++; X } else if (deal[itemnum]==BUY) { X! if (deal[type1[itemnum]]==SELL && X! (price[type1[itemnum]] < X! gettval(natn[type1[itemnum]],natn[itemnum], X! type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]))) { X! deal[type1[itemnum]]=BUY; X! /* highest bid so far */ X price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]); X /* return bid to loser */ X takeback(whobuy[type1[itemnum]], X*************** X*** 857,862 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--- 880,890 ----- X deal[type1[itemnum]]=BUY; X /* highest bid so far */ X price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]); X+ /* return bid to loser */ X+ takeback(whobuy[type1[itemnum]], X+ type2[type1[itemnum]], X+ buy1[type1[itemnum]],extra[type1[itemnum]],FALSE); X+ /* record details of trade */ X buy1[type1[itemnum]]=lvar1[itemnum]; X buy2[type1[itemnum]]=lvar2[itemnum]; X whobuy[type1[itemnum]]=natn[itemnum]; X*************** X*** 860,865 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 X--- 888,898 ----- X buy1[type1[itemnum]]=lvar1[itemnum]; X buy2[type1[itemnum]]=lvar2[itemnum]; X whobuy[type1[itemnum]]=natn[itemnum]; X+ } else { X+ /* return bid */ X+ takeback(whobuy[itemnum], X+ type2[type1[itemnum]], X+ buy1[itemnum],extra[itemnum],FALSE); X } X } X } X*************** X*** 861,870 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 X--- 894,899 ----- X type2[type1[itemnum]], X buy1[itemnum],extra[itemnum],FALSE); X } X } X } X unlink(tfile); X*************** X*** 867,874 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 X--- 896,902 ----- X } X } X } X! unlink(tfile); X /* reopen the file for unsold commodities */ X if ((tfile=fopen(tradefile,"w")) == NULL) { X /* error on opening file */ X*************** X*** 878,884 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 X--- 906,912 ----- 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*************** X*** 883,889 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 X--- 911,917 ----- 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*************** X*** 889,895 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 X--- 917,923 ----- 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.\n", X ntn[natn[count]].name,ntn[whobuy[count]].name,tradefail[type1[count]]); X } else if (longval2==(-1)) { X /* abort due to buyer */ X*************** X*** 894,900 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 X--- 922,928 ----- 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.\n", 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*************** X*** 902,908 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 X--- 930,936 ----- 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\n" 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*************** X*** 911,916 X } X } X fclose(tfile); X- #endif ADMIN X } X #endif TRADE X X--- 939,944 ----- X } X } X fclose(tfile); X } X #endif ADMIN X #endif TRADE X*************** X*** 913,916 X fclose(tfile); X #endif ADMIN X } X #endif TRADE X X--- 940,945 ----- X } X fclose(tfile); X } X+ #endif ADMIN X #endif TRADE X X*************** X*** 914,916 X #endif ADMIN X } X #endif TRADE X X--- 942,945 ----- X } X #endif ADMIN X #endif TRADE X+ X*** opatchlevel.h Thu Jul 28 09:10:14 1988 X--- patchlevel.h Thu Jul 28 09:11:13 1988 X*************** X*** 1,1 X! #define PATCHLEVEL 4 X X--- 1,1 ----- X! #define PATCHLEVEL 5 X*** oMakefile Thu Jul 28 09:10:48 1988 X--- Makefile Thu Jul 28 09:15:57 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,31 ----- X # if they do not use the -d option. X DEFAULT = /c28/smile/game/default X X! # The following CFLAGS should be set by a normal user 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--- 27,33 ----- X # The following CFLAGS should be set by a normal user 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*** 211,217 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 X--- 212,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.c X $(CC) $(CFLAGS) -DCONQUER -c trade.c X tradeA.o: data.h header.h trade.c X $(CC) $(CFLAGS) -DADMIN -c trade.c X*************** X*** 213,218 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 X--- 214,219 ----- X $(CC) $(CFLAGS) -DCONQUER -c commands.c X trade.o: data.h header.h trade.c X $(CC) $(CFLAGS) -DCONQUER -c trade.c X! tradeA.o: data.h header.h trade.c X $(CC) $(CFLAGS) -DADMIN -c trade.c X mv trade.o tradeA.o X X END_OF_FILE if test 48426 -ne `wc -c <'patches05'`; then echo shar: \"'patches05'\" unpacked with wrong size! fi # end of 'patches05' fi echo shar: End of shell archive. exit 0