home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume4 / conquer3 / patch3 < prev    next >
Encoding:
Internet Message Format  |  1988-07-19  |  59.8 KB

  1. Path: uunet!tektronix!tekgen!tekred!games
  2. From: games@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v05i006:  conquer3 - middle earth multi-player game (V3), Patch3
  5. Message-ID: <2815@tekred.TEK.COM>
  6. Date: 19 Jul 88 17:24:53 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 1856
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted by: ihnp4!homxc!smile
  12. Comp.sources.games: Volume 5, Issue 6
  13. Archive-name: conquer3/Patch3
  14.  
  15.      [This patch contains a set of patches and two new files: trade.c
  16.      and patchlevel.h (which I took the liberty to include for future
  17.      reference) that bring conquer3 upto Patchlevel 3.
  18.      This has already been posted to comp.sources.games.bugs and is
  19.      posted here for archival purposes. Unshar this file to get the
  20.      two new files and patches then feed "patches03" to patch.  -br]
  21.  
  22. #! /bin/sh
  23. # This is a shell archive.  Remove anything before this line, then unpack
  24. # it by saving it into a file and typing "sh file".  To overwrite existing
  25. # files, type "sh file -c".  You can also feed this as standard input via
  26. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  27. # will see the following message at the end:
  28. #        "End of shell archive."
  29. # Contents:  patchlevel.h trade.c patches03
  30. # Wrapped by billr@saab on Tue Jul 19 09:50:58 1988
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  34. else
  35. echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
  36. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  37. X#define PATCHLEVEL    3
  38. END_OF_FILE
  39. if test 21 -ne `wc -c <'patchlevel.h'`; then
  40.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  41. fi
  42. # end of 'patchlevel.h'
  43. fi
  44. if test -f 'trade.c' -a "${1}" != "-c" ; then 
  45.   echo shar: Will not clobber existing file \"'trade.c'\"
  46. else
  47. echo shar: Extracting \"'trade.c'\" \(25421 characters\)
  48. sed "s/^X//" >'trade.c' <<'END_OF_FILE'
  49. X/*conquer : Copyright (c) 1988 by Ed Barlow.
  50. X *  I spent a long time writing this code & I hope that you respect this.  
  51. X *  I give permission to alter the code, but not to copy or redistribute
  52. X *  it without my explicit permission.  If you alter the code, 
  53. X *  please document changes and send me a copy, so all can have it.  
  54. X *  This code, to the best of my knowledge works well,  but it is my first
  55. X *  'C' program and should be treated as such.  I disclaim any
  56. X *  responsibility for the codes actions (use at your own risk).  I guess
  57. X *  I am saying "Happy gaming", and am trying not to get sued in the process.
  58. X *                                                Ed
  59. X */
  60. X
  61. X/*
  62. X *  The following file "trade.c" was written by Adam Bryant who
  63. X *  gives all rights to this code to Ed Barlow provided that this
  64. X *  message remains intact.
  65. X */
  66. X
  67. X/* thanks adam -- Ed */
  68. X
  69. X/*    trade.c        */
  70. X
  71. X/*include files*/
  72. X#include "header.h"
  73. X#include "data.h"
  74. X
  75. X#ifdef TRADE        
  76. X
  77. X/* possible commodities */
  78. X#define TDGOLD   0
  79. X#define TDFOOD   1
  80. X#define TDIRON   2
  81. X#define TDJEWL   3
  82. X#define TDLAND   4
  83. X#define TDARMY   5
  84. X#define TDSHIP   6
  85. X
  86. X/* constants and indicators */
  87. X#define    NUMPRODUCTS    7
  88. X#define    MAXITM    30
  89. X#define    SELL    0
  90. X#define    BUY    1
  91. X#define    NODEAL    2
  92. X#define    NOSALE    3
  93. X#define TRADECOST(cost)    ((100-cost)/100)    /* twenty percent cost normal*/
  94. X
  95. Xextern short country;
  96. X
  97. Xchar *commodities[NUMPRODUCTS] = { "Gold", "Food", "Iron", "Jewels",
  98. X        "Land", "Soldiers", "Ships"};
  99. X#ifdef ADMIN
  100. Xchar *tradefail[NUMPRODUCTS] = { "lack of gold", "lack of food",
  101. X    "lack of iron", "lack of jewels", "land not owned",
  102. X    "no available armies", "no available navies"};
  103. X#endif ADMIN
  104. X#ifdef CONQUER
  105. X/* Use this when you wish to sell something */
  106. Xchar *selllist[NUMPRODUCTS] = { "Sell how many gold talons? ", "Sell how much food? ",
  107. X    "Sell how much iron? ", "Sell how many jewels? ", "What X location? ",
  108. X    "How many soldiers? ", "How many ships? "};
  109. X
  110. X/* Use this when you wish to place a bid something */
  111. Xchar *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ",
  112. X    "Bid how much iron? ", "Bid how many jewels? ", " ",
  113. X    "Bid what army? ", "Bid how many ships? "};
  114. X
  115. Xvoid
  116. Xtrade()
  117. X{
  118. X    FILE *tfile;
  119. X    int count, done=FALSE, notopen=FALSE;
  120. X    int buysell, holdint, holdint2, extint, inloop;
  121. X    int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM];
  122. X    int natn[MAXITM], itemnum, getland(), gettrade(), checkland();
  123. X    int tradable();
  124. X    long lvar1[MAXITM], lvar2[MAXITM], holdlong, holdlong2, armyvalue();
  125. X    void tradeerr(), setaside(), takeback();
  126. X    
  127. X    while (done==FALSE) {
  128. X        itemnum=0;
  129. X        done=TRUE;
  130. X        /* open trading file */
  131. X        if ((tfile=fopen(tradefile,"r")) == NULL ) {
  132. X            notopen=TRUE;
  133. X        }
  134. X        /* read in all of the data */
  135. X        while (notopen==FALSE && !feof(tfile)) {
  136. X            fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum],
  137. X                &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]);
  138. X            if (deal[itemnum]==NOSALE) {
  139. X                /* remove item from sales list */
  140. X                deal[type1[itemnum]]=NOSALE;
  141. X            } else if (deal[itemnum]==SELL) {
  142. X                itemnum++;
  143. X            }
  144. X        }
  145. X        if (notopen==FALSE) fclose(tfile);
  146. X        clear();
  147. X        /* display header */
  148. X        standout();
  149. X        mvaddstr(0,27,"COMMODITIES EXCHANGE");
  150. X        standend();
  151. X        count=2;
  152. X        mvprintw(count,0,"    Nation\t\tItem\t\tMinimum Price");
  153. X        /* go through list of commodities */
  154. X        for (holdint=0;holdint<itemnum;holdint++) {
  155. X            if (deal[holdint]==SELL) {
  156. X                count++;
  157. X                mvprintw(count,0,"%2d) %-10s",
  158. X                    holdint+1,
  159. X                    ntn[natn[holdint]].name);
  160. X
  161. X                if (type1[holdint]==TDLAND) {
  162. X                    holdlong = (long) tofood(sct[(int)lvar1[holdint]][extra[holdint]].vegetation,0);
  163. X                    mvprintw(count,20,"(food=%2ld) %s",
  164. X                        holdlong,
  165. X                        commodities[type1[holdint]]);
  166. X                } else {
  167. X                    holdlong = lvar1[holdint];
  168. X                    mvprintw(count,20,"%9ld %s",
  169. X                        holdlong,
  170. X                        commodities[type1[holdint]]);
  171. X                }
  172. X                mvprintw(count,40,"%9ld %s",
  173. X                    lvar2[holdint],
  174. X                    commodities[type2[holdint]]);
  175. X                if (count>16) {
  176. X                    standout();
  177. X                    mvaddstr(21,30,"Hit Any Key to Continue");
  178. X                    standend();
  179. X                    refresh();
  180. X                    getch();
  181. X                    clear();
  182. X                    standout();
  183. X                    mvaddstr(0,27,"COMMODITIES EXCHANGE");
  184. X                    standend();
  185. X                    mvprintw(2,0,"    Nation\t\tItem\t\tMinimum Price");
  186. X                    count=3;
  187. X                }
  188. X            }
  189. X        }
  190. X        standout();
  191. X        count++;
  192. X        if (itemnum==0)    mvaddstr(count++,0,"Nothing to Buy.  Do you wish to (S)ell?");
  193. X        else mvaddstr(count++,0,"Do you wish to (B)uy, (S)ell, or (U)nsell?");
  194. X        standend();
  195. X        refresh();
  196. X        inloop=TRUE;
  197. X        while (inloop==TRUE) switch(getch()) {
  198. X        case 'b':
  199. X        case 'B':
  200. X            if (itemnum==0) break;
  201. X            buysell=BUY;
  202. X            mvaddstr(count++,0,"What item number do you want to purchase? ");
  203. X            refresh();
  204. X            holdint = get_number();
  205. X            if (holdint<1 || holdint>itemnum) {
  206. X                tradeerr("Invalid Item Number");
  207. X                return;
  208. X            }
  209. X            holdint--;
  210. X            if (deal[holdint]!=SELL) {
  211. X                tradeerr("Sorry, that item is not on the market.");
  212. X                return;
  213. X            }
  214. X            if (ntn[natn[holdint]].dstatus[country]==UNMET) {
  215. X                tradeerr("That nation has not been met by you");
  216. X                return;
  217. X            }
  218. X            if (ntn[natn[holdint]].dstatus[country]>HOSTILE) {
  219. X                tradeerr("That nation is not doing business with you");
  220. X                return;
  221. X            }
  222. X            /* obtain bid */
  223. X            mvprintw(count++,0,"%s",buylist[type2[holdint]]);
  224. X            refresh();
  225. X            holdlong2 = 0L;
  226. X            holdlong = (long) get_number();
  227. X            /* check for valid bid */
  228. X            switch(type2[holdint]) {
  229. X            case TDGOLD:
  230. X                if (holdlong < lvar2[holdint]) {
  231. X                    tradeerr("You underbid the minimum.");
  232. X                    buysell=NODEAL;
  233. X                } else if (holdlong > ntn[country].tgold) {
  234. X                    tradeerr("Not Enough Gold");
  235. X                    buysell=NODEAL;
  236. X                }
  237. X                break;
  238. X            case TDFOOD:
  239. X                if (holdlong < lvar2[holdint]) {
  240. X                    tradeerr("You underbid the minimum.");
  241. X                    buysell=NODEAL;
  242. X                } else if (holdlong > ntn[country].tfood) {
  243. X                    tradeerr("Not Enough Food");
  244. X                    buysell=NODEAL;
  245. X                }
  246. X                break;
  247. X            case TDIRON:
  248. X                if (holdlong < lvar2[holdint]) {
  249. X                    tradeerr("You underbid the minimum.");
  250. X                    buysell=NODEAL;
  251. X                } else if (holdlong > ntn[country].tiron) {
  252. X                    tradeerr("Not Enough Iron");
  253. X                    buysell=NODEAL;
  254. X                }
  255. X                break;
  256. X            case TDJEWL:
  257. X                if (holdlong < lvar2[holdint]) {
  258. X                    tradeerr("You underbid the minimum.");
  259. X                    buysell=NODEAL;
  260. X                } else if (holdlong > ntn[country].jewels) {
  261. X                    tradeerr("Not Enough Jewels");
  262. X                    buysell=NODEAL;
  263. X                }
  264. X                break;
  265. X            case TDLAND:
  266. X                mvaddstr(count++,0,"What Y position? ");
  267. X                refresh();
  268. X                holdlong2 = (long) get_number;
  269. X                if (checkland(BUY,(int)(holdlong),(int)(holdlong2))==NODEAL) {
  270. X                    buysell=NODEAL;
  271. X                } else if (tofood(sct[(int)holdlong][(int)holdlong2].vegetation,natn[holdint]) < lvar2[holdint]) {
  272. X                    tradeerr("You underbid the minimum");
  273. X                    buysell=NODEAL;
  274. X                }
  275. X                break;
  276. X            case TDARMY:
  277. X                if ((int)holdlong > MAXARM) {
  278. X                    tradeerr("Invalid Unit");
  279. X                    buysell=NODEAL;
  280. X                } else if (tradable(country,(int)holdlong)==FALSE) {
  281. X                    tradeerr("That unit type is non-tradable.");
  282. X                    buysell=NODEAL;
  283. X                } else if (armyvalue(country,(int)holdlong) < lvar2[holdint]) {
  284. X                    tradeerr("You underbid the minimum.");
  285. X                    buysell=NODEAL;
  286. X                }
  287. X                break;
  288. X            case TDSHIP:
  289. X                if ((int)holdlong >= MAXNAVY) {
  290. X                    tradeerr("Invalid Navy");
  291. X                    buysell=NODEAL;
  292. X                } else if (ntn[country].nvy[(int)holdlong].merchant+ntn[country].nvy[(int)holdlong].warships < (int)lvar2[holdint]) {
  293. X                    tradeerr("You underbid the minimum.");
  294. X                    buysell=NODEAL;
  295. X                }
  296. X                break;
  297. X            default:
  298. X                tradeerr("Invalid Commodity");
  299. X                buysell=NODEAL;
  300. X                break;
  301. X            }
  302. X            if (buysell==BUY) {
  303. X                if ( (tfile = fopen(tradefile,"a+"))==NULL) {
  304. X                    tradeerr("Error opening file for trading");
  305. X                    abrt();
  306. X                }
  307. X                setaside(country,type2[holdint],holdlong);
  308. X                fprintf(tfile, "%d %d %d %d %ld %ld %d\n",BUY, country, holdint, 0, holdlong, holdlong2, 0);
  309. X                fclose(tfile);
  310. X            }
  311. X            return;
  312. X        case 's':
  313. X        case 'S':
  314. X            /* sell an item */
  315. X            /* only allow MAXITM on market */
  316. X            if (itemnum>=MAXITM) {
  317. X                standout();
  318. X                if (itemnum==0) mvaddstr(count++,0,"Market Congested.  Hit any key to continue");
  319. X                else mvaddstr(count++,0,"Market Congested.  (B)uy or any key to continue");
  320. X                standend();
  321. X                refresh();
  322. X                break;
  323. X            }
  324. X            buysell=SELL;
  325. X            holdint = gettrade("Selling",&count);
  326. X            if (holdint==(-1)) {
  327. X                tradeerr("Invalid Option");
  328. X                return;
  329. X            }
  330. X
  331. X            mvprintw(count++,0,"%s",selllist[holdint]);
  332. X            refresh();
  333. X            /* find out how much commodities */
  334. X            holdlong = (long) get_number();
  335. X            extint = 0;
  336. X            if (holdint< TDLAND && holdlong==0L)
  337. X                return;
  338. X
  339. X            /* check for valid items */
  340. X            switch(holdint) {
  341. X            case TDGOLD:
  342. X                if (holdlong > ntn[country].tgold) {
  343. X                    tradeerr("Not Enough Gold");
  344. X                    buysell=NODEAL;
  345. X                }
  346. X                break;
  347. X            case TDFOOD:
  348. X                if (holdlong > ntn[country].tfood) {
  349. X                    tradeerr("Not Enough Food");
  350. X                    buysell=NODEAL;
  351. X                }
  352. X                break;
  353. X            case TDIRON:
  354. X                if (holdlong > ntn[country].tiron) {
  355. X                    tradeerr("Not Enough Iron");
  356. X                    buysell=NODEAL;
  357. X                }
  358. X                break;
  359. X            case TDJEWL:
  360. X                if (holdlong > ntn[country].jewels) {
  361. X                    tradeerr("Not Enough Jewels");
  362. X                    buysell=NODEAL;
  363. X                }
  364. X                break;
  365. X            case TDLAND:
  366. X                mvprintw(count++,0,"What Y position? ");
  367. X                refresh();
  368. X                extint = get_number();
  369. X                buysell = checkland(SELL,(int)holdlong,extint);
  370. X                break;
  371. X            case TDARMY:
  372. X                if (holdlong>=MAXARM || ntn[country].arm[(int)holdlong].sold <= 0) {
  373. X                    tradeerr("Invalid Army");
  374. X                    buysell=NODEAL;
  375. X                } else if (tradable(country,(int)holdlong)==FALSE) {
  376. X                    tradeerr("That unit is non-tradable.");
  377. X                    buysell=NODEAL;
  378. X                }
  379. X                break;
  380. X            case TDSHIP:
  381. X                if (holdlong>=MAXNAVY || ntn[country].nvy[(int)holdlong].merchant + ntn[country].nvy[(int)holdlong].warships <= 0) {
  382. X                    tradeerr("Invalid Navy");
  383. X                    buysell=NODEAL;
  384. X                }
  385. X                break;
  386. X            default:
  387. X                tradeerr("Invalid Commodity");
  388. X                buysell=NODEAL;
  389. X                break;
  390. X            }
  391. X            /* invalid commodity */
  392. X            if (buysell==NODEAL) return;
  393. X
  394. X            /* find out what they want in trade */
  395. X            holdint2 = gettrade("In Trade For",&count);
  396. X            if (holdint2==(-1)) {
  397. X                tradeerr("Invalid Option");
  398. X                return;
  399. X            }
  400. X            if (holdint2==TDLAND) {
  401. X                holdlong2 = (long) getland(&count);
  402. X                if (holdlong2==(-1L)) {
  403. X                    tradeerr("Invalid Vegetation");
  404. X                    return;
  405. X                }
  406. X            } else {
  407. X                /* find out for what value */
  408. X                mvprintw(count++,0,"Minimum %s",selllist[holdint2]);
  409. X                refresh();
  410. X                holdlong2 = (long) get_number();
  411. X                if (holdlong2 == 0L) return;
  412. X            }
  413. X
  414. X            /* make sure what was bid is unusable */
  415. X            setaside(country,holdint,holdlong);
  416. X
  417. X            /* set up output properly */
  418. X            if (holdint==TDARMY) {
  419. X                extint = (int) holdlong;
  420. X                holdlong = armyvalue(country,(int)holdlong);
  421. X            }
  422. X            else if (holdint==TDSHIP) {
  423. X                extint = (int)holdlong;
  424. X                holdlong = (long)(ntn[country].nvy[(int)holdlong].merchant + ntn[country].nvy[(int)holdlong].warships);
  425. X            }
  426. X
  427. X            /* send it out */
  428. X            if ( (tfile = fopen(tradefile,"a+"))==NULL) {
  429. X                tradeerr("Error opening file for trading");
  430. X                abrt();
  431. X            }
  432. X            fprintf(tfile, "%d %d %d %d %ld %ld %d\n", SELL, country, holdint, holdint2, holdlong, holdlong2, extint);
  433. X            fclose(tfile);
  434. X            inloop=FALSE;
  435. X            done=FALSE;
  436. X            break;
  437. X        case 'u':
  438. X        case 'U':
  439. X            /* unsell an item */
  440. X            if (itemnum==0) break;
  441. X            mvaddstr(count++,0,"What item number to remove? ");
  442. X            refresh();
  443. X            holdint = get_number();
  444. X            if (holdint==0 || holdint>itemnum) {
  445. X                tradeerr("Invalid Item Number");
  446. X                return;
  447. X            }
  448. X            holdint--;
  449. X#ifdef OGOD
  450. X            /* allow god to remove commodities */
  451. X            if (country!=0 && country!=natn[holdint]) 
  452. X#else 
  453. X            if (country != natn[holdint]) 
  454. X#endif OGOD
  455. X            {
  456. X                tradeerr("That is not your item");
  457. X                return;
  458. X            }
  459. X            
  460. X            /* remove it from market */
  461. X            if ( (tfile = fopen(tradefile,"a+"))==NULL) {
  462. X                tradeerr("Error opening file for trading");
  463. X                abrt();
  464. X            }
  465. X            fprintf(tfile, "%d %d %d %d %ld %ld %d\n", NOSALE, natn[holdint], holdint, 0, 0L, 0L, 0);
  466. X            fclose(tfile);
  467. X            takeback(natn[holdint],type1[holdint],lvar1[holdint]);
  468. X            /*redraw the commodities board so removal is seen*/
  469. X            inloop=FALSE;
  470. X            done=FALSE;
  471. X            break;
  472. X        default:
  473. X            /* return on no choice */
  474. X            return;
  475. X        }
  476. X    }
  477. X}
  478. X
  479. Xvoid
  480. Xtradeerr(mesg)
  481. Xchar *mesg;
  482. X{
  483. X    clear_bottom(0);
  484. X    standout();
  485. X    mvaddstr(21,0,mesg);
  486. X    standend();
  487. X    mvaddstr(22,0,"Hit any key to continue");
  488. X    refresh();
  489. X    getch();
  490. X}
  491. X
  492. Xint
  493. Xcheckland(tradestat,xspot,yspot)
  494. Xint tradestat,xspot,yspot;
  495. X{
  496. X    int newstat=tradestat;
  497. X    if (xspot < 0 || xspot > MAPX || yspot > MAPY || yspot < 0) {
  498. X        tradeerr("That is off the map");
  499. X        newstat=NODEAL;
  500. X    } 
  501. X    else if (sct[xspot][yspot].owner != country) {
  502. X        tradeerr("You don't own it");
  503. X        newstat=NODEAL;
  504. X    }
  505. X    else if (ntn[country].capx==xspot && ntn[country].capy==yspot) {
  506. X        tradeerr("That is your capitol");
  507. X        newstat=NODEAL;
  508. X    }
  509. X    else if (sct[xspot][yspot].designation == DCITY) {
  510. X        tradeerr("Towns may not be sold");
  511. X        newstat=NODEAL;
  512. X    }
  513. X    return(newstat);
  514. X}
  515. X
  516. X/* get minimum foodvalue for land */
  517. Xint
  518. Xgetland(count)
  519. Xint *count;
  520. X{
  521. X    int    temp;
  522. X    char    entered;
  523. X
  524. X    mvprintw((*count)++,0,"MINIMUM VEGETATION: %c, %c, %c, %c, %c, %c, %c, %c, %c, %c, %c or %c: ",
  525. X        VOLCANO,DESERT,TUNDRA,BARREN,LT_VEG,
  526. X        GOOD,WOOD,FOREST,JUNGLE,SWAMP,ICE,NONE);
  527. X
  528. X    refresh();
  529. X    entered=getch();
  530. X    if(entered!=VOLCANO       &&entered!=JUNGLE
  531. X        &&entered!=DESERT &&entered!=TUNDRA
  532. X        &&entered!=BARREN &&entered!=LT_VEG
  533. X        &&entered!=NONE   &&entered!=GOOD
  534. X        &&entered!=WOOD   &&entered!=FOREST
  535. X        &&entered!=SWAMP  &&entered!=ICE) temp=(-1);
  536. X    else temp = tofood(entered,country);
  537. X    mvprintw((*count)++,0," JUST ENTERED %c so temp is %d", entered,temp);
  538. X    return(temp);
  539. X}
  540. X
  541. Xint
  542. Xgettrade(saletype,count)
  543. Xchar *saletype;
  544. Xint *count;
  545. X{
  546. X    int hold=(-1);
  547. X
  548. X    mvprintw((*count)++,0,"%s: (G)old, (F)ood, (I)ron, (J)ewels, (L)and, (A)rmy, (S)hips?",saletype);
  549. X    refresh();
  550. X    switch(getch()) {
  551. X    case 'g':
  552. X    case 'G':
  553. X        hold=TDGOLD;
  554. X        break;
  555. X    case 'f':
  556. X    case 'F':
  557. X        hold=TDFOOD;
  558. X        break;
  559. X    case 'i':
  560. X    case 'I':
  561. X        hold=TDIRON;
  562. X        break;
  563. X    case 'j':
  564. X    case 'J':
  565. X        hold=TDJEWL;
  566. X        break;
  567. X    case 'l':
  568. X    case 'L':
  569. X        hold=TDLAND;
  570. X        break;
  571. X    case 'a':
  572. X    case 'A':
  573. X        hold=TDARMY;
  574. X        break;
  575. X    case 's':
  576. X    case 'S':
  577. X        hold=TDSHIP;
  578. X        break;
  579. X    default:
  580. X        break;
  581. X    }
  582. X    return(hold);
  583. X}
  584. X
  585. X/* set aside things that are up for bid */
  586. Xvoid
  587. Xsetaside(cntry,item,longval)
  588. Xint cntry,item;
  589. Xlong longval;
  590. X{
  591. X    switch(item)
  592. X    {
  593. X    case TDGOLD:
  594. X        ntn[cntry].tgold -= longval;
  595. X        break;
  596. X    case TDFOOD:
  597. X        ntn[cntry].tfood -= longval;
  598. X        break;
  599. X    case TDIRON:
  600. X        ntn[cntry].tiron -= longval;
  601. X        break;
  602. X    case TDJEWL:
  603. X        ntn[cntry].jewels -= longval;
  604. X        break;
  605. X    case TDLAND:
  606. X        break;
  607. X    case TDARMY:
  608. X        ntn[cntry].arm[(int)longval].smove = 0;
  609. X        ntn[cntry].arm[(int)longval].stat = TRADED;
  610. X        break;
  611. X    case TDSHIP:
  612. X        /* use armynum to hold indicator */
  613. X        ntn[cntry].nvy[(int)longval].smove = 0;
  614. X        ntn[cntry].nvy[(int)longval].armynum = TRADED;
  615. X        break;
  616. X    }
  617. X}
  618. X
  619. X/* regain things that are up for bid */
  620. Xvoid
  621. Xtakeback(cntry,item,longval)
  622. Xint cntry,item;
  623. Xlong longval;
  624. X{
  625. X    switch(item)
  626. X    {
  627. X    case TDGOLD:
  628. X        ntn[cntry].tgold += longval;
  629. X        break;
  630. X    case TDFOOD:
  631. X        ntn[cntry].tfood += longval;
  632. X        break;
  633. X    case TDIRON:
  634. X        ntn[cntry].tiron += longval;
  635. X        break;
  636. X    case TDJEWL:
  637. X        ntn[cntry].jewels += longval;
  638. X        break;
  639. X    case TDLAND:
  640. X        break;
  641. X    case TDARMY:
  642. X        ntn[cntry].arm[(int)longval].stat = DEFEND;
  643. X        break;
  644. X    case TDSHIP:
  645. X        /* use armynum to hold indicator */
  646. X        ntn[cntry].nvy[(int)longval].armynum = 0;
  647. X        break;
  648. X    }
  649. X}
  650. X#endif CONQUER
  651. X
  652. X#ifdef ADMIN
  653. X/* give things that were purchased from cntry1 to cntry2 */
  654. Xlong
  655. Xtradeit(cntry1,cntry2,item,longval,extra)
  656. Xint cntry1,cntry2,item,extra;
  657. Xlong longval;
  658. X{
  659. X    int unitnum=(-1),unitcount=0;
  660. X    /* error for -1 returned */
  661. X    long returnval=(-1);
  662. X    switch(item)
  663. X    {
  664. X    case TDGOLD:
  665. X        returnval = longval;
  666. X        ntn[cntry1].tgold -= longval;
  667. X        ntn[cntry2].tgold += longval * TRADECOST(20);
  668. X        break;
  669. X    case TDFOOD:
  670. X        if (ntn[cntry1].tfood >= longval) {
  671. X            returnval = longval;
  672. X            ntn[cntry1].tfood -= longval;
  673. X            ntn[cntry2].tfood += longval * TRADECOST(20);
  674. X        }
  675. X        break;
  676. X    case TDIRON:
  677. X        if (ntn[cntry1].tiron >= longval) {
  678. X            ntn[cntry1].tiron -= longval;
  679. X            ntn[cntry2].tiron += longval * TRADECOST(20);
  680. X            returnval = longval;
  681. X        }
  682. X        break;
  683. X    case TDJEWL:
  684. X        if (ntn[cntry1].jewels >= longval) {
  685. X            ntn[cntry1].jewels -= longval;
  686. X            ntn[cntry2].jewels += longval * TRADECOST(20);
  687. X            returnval = longval;
  688. X        }
  689. X        break;
  690. X    case TDLAND:
  691. X        if (sct[(int)longval][extra].owner==cntry1) {
  692. X            sct[(int)longval][extra].owner = cntry2;
  693. X            returnval = longval;
  694. X        }
  695. X        break;
  696. X    case TDARMY:
  697. X        /* find army number for cntry2 */
  698. X        /* give army to cntry2 */
  699. X        while(unitnum==(-1)&&unitcount<MAXARM) {
  700. X            if (ntn[cntry2].arm[unitcount].sold<=0) {
  701. X                /* give army to cntry2 */
  702. X                ntn[cntry2].arm[unitcount].sold = ntn[cntry1].arm[extra].sold;
  703. X                ntn[cntry2].arm[unitcount].unittyp = ntn[cntry1].arm[extra].unittyp;
  704. X                ntn[cntry2].arm[unitcount].xloc = ntn[cntry2].capx;
  705. X                ntn[cntry2].arm[unitcount].yloc = ntn[cntry2].capy;
  706. X                ntn[cntry2].arm[unitcount].stat = DEFEND;
  707. X                ntn[cntry2].arm[unitcount].smove = 0;
  708. X                /* remove army from cntry1 */
  709. X                ntn[cntry1].arm[extra].sold = 0;
  710. X                ntn[cntry1].arm[extra].smove = 0;
  711. X                ntn[cntry1].arm[extra].stat = DEFEND;
  712. X                unitnum=unitcount;
  713. X            }
  714. X            unitcount++;
  715. X        }
  716. X        returnval=(long)unitnum;
  717. X        break;
  718. X    case TDSHIP:
  719. X        /* give navy to cntry1 */
  720. X        while(unitnum==(-1)&&unitcount<MAXARM){
  721. X            if (ntn[cntry2].nvy[unitcount].merchant+ntn[cntry2].nvy[unitcount].warships <= 0) {
  722. X                /* give navy to cntry2 */
  723. X                ntn[cntry2].nvy[unitcount].warships = ntn[cntry1].nvy[extra].warships;
  724. X                ntn[cntry2].nvy[unitcount].merchant = ntn[cntry1].nvy[extra].merchant;
  725. X                ntn[cntry2].nvy[unitcount].crew = ntn[cntry1].nvy[extra].crew;
  726. X                ntn[cntry2].arm[unitcount].xloc = ntn[cntry1].nvy[extra].xloc;
  727. X                ntn[cntry2].arm[unitcount].yloc = ntn[cntry1].nvy[extra].yloc;
  728. X                ntn[cntry2].nvy[unitcount].armynum = 0;
  729. X                ntn[cntry2].nvy[unitcount].smove = 0;
  730. X                /* remove navy from cntry1 */
  731. X                ntn[cntry1].nvy[extra].smove = 0;
  732. X                ntn[cntry1].nvy[extra].merchant = 0;
  733. X                ntn[cntry1].nvy[extra].warships = 0;
  734. X                ntn[cntry1].nvy[extra].crew = 0;
  735. X                ntn[cntry1].nvy[extra].armynum = 0;
  736. X                unitnum=unitcount;
  737. X            }
  738. X            unitcount++;
  739. X        }
  740. X        returnval=(long)unitnum;
  741. X        break;
  742. X    }
  743. X    return(returnval);
  744. X}
  745. X
  746. Xlong
  747. Xgettval(cntry1,cntry2,type,longval,extint)
  748. Xint cntry1, cntry2, extint;
  749. Xlong longval;
  750. X{
  751. X    int returnval=(-1);
  752. X    long armyvalue();
  753. X
  754. X    switch(type) {
  755. X    case TDGOLD:
  756. X    case TDFOOD:
  757. X    case TDIRON:
  758. X    case TDJEWL:
  759. X        returnval=longval;
  760. X        break;
  761. X    case TDLAND:
  762. X        if (cntry2!=sct[(int)longval][extint].owner)
  763. X        returnval=(long)tofood(sct[(int)longval][extint].vegetation,cntry1);
  764. X        break;
  765. X    case TDARMY:
  766. X        if (armyvalue(cntry2,extint)>0)
  767. X        returnval=armyvalue(cntry2,extint);
  768. X        break;
  769. X    case TDSHIP:
  770. X        if (ntn[cntry2].nvy[extint].merchant+ntn[cntry2].nvy[extint].warships>0)
  771. X        returnval=(long)(ntn[cntry2].nvy[extint].merchant+ntn[cntry2].nvy[extint].warships);
  772. X        break;
  773. X    }
  774. X    return(returnval);
  775. X}
  776. X
  777. X/* this function sends detailed message to players */
  778. X/* upon completion of a trade */
  779. Xvoid
  780. Xtrademail(cntry1,cntry2,item1,item2,lvar1,lvar2,lvar3,lvar4)
  781. Xint cntry1,cntry2,item1,item2;
  782. Xlong lvar1,lvar2,lvar3,lvar4;
  783. X{
  784. X    FILE *fp[2];
  785. X    int count;
  786. X    char cname[2][12],filename[2][80];
  787. X
  788. X    sprintf(filename[0],"%s%d",msgfile,cntry1);
  789. X    sprintf(filename[1],"%s%d",msgfile,cntry2);
  790. X    strcpy(cname[0],ntn[cntry1].name);
  791. X    strcpy(cname[1],ntn[cntry2].name);
  792. X
  793. X    if ((fp[0]=fopen(filename[0],"a+"))==NULL) {
  794. X        printf("error opening <%s>\n",filename[0]);
  795. X        abrt();
  796. X    }
  797. X    if ((fp[1]=fopen(filename[1],"a+"))==NULL) {
  798. X        printf("error opening <%s>\n",filename[1]);
  799. X        abrt();
  800. X    }
  801. X
  802. X    for (count=0;count<2;count++) {
  803. X        fprintf(fp[count],"%s Message to %s from Conquer Commerce Commision\n",cname[count],cname[count]);
  804. X        fprintf(fp[count],"%s \n",cname[count]);
  805. X        fprintf(fp[count],"%s   Trade transaction between %s and %s completed.",cname[count],cname[0],cname[1]);
  806. X        if (item1<=TDJEWL)
  807. X        fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[0],lvar1,commodities[item1]);
  808. X        else if (item1==TDLAND)
  809. X        fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[0],lvar1,lvar2);
  810. X        else if (item1==TDARMY)
  811. X        fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[0],lvar1);
  812. X        else if (item1==TDSHIP)
  813. X        fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[0],lvar1);
  814. X        if (item2<=TDJEWL)
  815. X        fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[1],lvar3,commodities[item2]);
  816. X        else if (item1==TDLAND)
  817. X        fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar3,lvar4);
  818. X        else if (item1==TDARMY)
  819. X        fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[1],lvar3);
  820. X        else if (item1==TDSHIP)
  821. X        fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[1],lvar3);
  822. X        fclose(fp[count]);
  823. X    }
  824. X}
  825. X#endif ADMIN
  826. X
  827. X/* routine to determine whether or not an army type is tradable */
  828. Xint
  829. Xtradable(cntry,armynum)
  830. Xint cntry,armynum;
  831. X{
  832. X    int oldcntry=country,returnval=FALSE;
  833. X    country=cntry;
  834. X    if ( ATYPE==A_MERCENARY || ATYPE==A_SEIGE || ATYPE==A_CATAPULT
  835. X        || ATYPE==A_ELEPHANT || ATYPE>=MINMONSTER) returnval=TRUE;
  836. X    country=oldcntry;
  837. X    return(returnval);
  838. X}
  839. X
  840. X/* routine to determine commercial value of army */
  841. Xlong armyvalue(cntry,unit)
  842. Xint cntry,unit;
  843. X{
  844. X#ifdef CONQUER
  845. X    extern int unitattack[];
  846. X#endif CONQUER
  847. X    long returnval;
  848. X    
  849. X    returnval = ntn[cntry].arm[unit].sold*100 +
  850. X        ntn[cntry].arm[unit].sold * unitattack[ntn[cntry].arm[unit].unittyp%100];
  851. X    if (ntn[cntry].arm[unit].unittyp >= MINMONSTER) returnval+=ntn[cntry].arm[unit].sold*10;
  852. X    returnval/=100;
  853. X    return(returnval);
  854. X}
  855. X
  856. Xvoid
  857. Xuptrade()
  858. X{
  859. X    FILE *tfile;
  860. X    int count, itemnum=0, natn[MAXITM];
  861. X    int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM];
  862. X#ifdef ADMIN
  863. X    extern FILE *fnews;
  864. X    void trademail();
  865. X    int whobuy[MAXITM];
  866. X    long tradeit(), buy1[MAXITM], buy2[MAXITM];
  867. X    long price[MAXITM], gettval(), longval1, longval2;
  868. X#endif ADMIN
  869. X    long lvar1[MAXITM], lvar2[MAXITM];
  870. X#ifdef CONQUER
  871. X    void setaside(),takeback();
  872. X#endif CONQUER
  873. X
  874. X    /* initialize purchase list */
  875. X    for (count=0; count<MAXITM; count++) {
  876. X        deal[count]=(-1);
  877. X#ifdef ADMIN
  878. X        whobuy[count]=(-1);
  879. X        price[count]=(-1);
  880. X#endif ADMIN
  881. X    }
  882. X    /* open trading file */
  883. X    if ((tfile = fopen(tradefile,"r")) == NULL) {
  884. X        /* no commodities - no transactions */
  885. X        return;
  886. X    }
  887. X    /* read in all of the transactions */
  888. X    while(!feof(tfile)) {
  889. X        fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum],
  890. X            &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]);
  891. X        if (deal[itemnum]==NOSALE) {
  892. X            /* remove item from sales list */
  893. X            deal[type1[itemnum]]=NOSALE;
  894. X#ifdef CONQUER
  895. X            if (natn[itemnum]==country) takeback(country,type1[type1[itemnum]],lvar1[type1[itemnum]]);
  896. X#endif CONQUER
  897. X        } else if (deal[itemnum]==SELL) {
  898. X            itemnum++;
  899. X#ifdef CONQUER
  900. X            if (natn[itemnum]==country) setaside(country,type2[itemnum],lvar1[itemnum]);
  901. X#endif CONQUER
  902. X        } else if (deal[itemnum]==BUY) {
  903. X#ifdef ADMIN
  904. X            if (deal[type1[itemnum]]==SELL) deal[type1[itemnum]]==BUY;
  905. X            /* check for highest price for item */
  906. X            if (price[type1[itemnum]]<gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum])) {
  907. X                price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]);
  908. X                buy1[type1[itemnum]]=lvar1[itemnum];
  909. X                buy2[type1[itemnum]]=lvar2[itemnum];
  910. X                whobuy[type1[itemnum]]=natn[itemnum];
  911. X            }
  912. X#endif ADMIN
  913. X#ifdef CONQUER
  914. X            if (natn[itemnum]==country) setaside(country,type2[type1[itemnum]],lvar1[itemnum]);
  915. X#endif CONQUER
  916. X        }
  917. X    }
  918. X    fclose(tfile);
  919. X#ifdef ADMIN
  920. X    /* reopen the file for unsold commodities */
  921. X    if ((tfile=fopen(tradefile,"w")) == NULL) {
  922. X        /* error on opening file */
  923. X        printf("Error opening <%s> for trade update\n",tradefile);
  924. X        abrt();
  925. X    }
  926. X
  927. X    /* compute the trading */
  928. X    for (count=0;count<itemnum;count++) {
  929. X        if (deal[count]==SELL)
  930. X            /* adjust the displayed value */
  931. X            lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]);
  932. X            /* keep unsold items up for sale */
  933. 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]);
  934. X        else if (deal[count]==BUY) {
  935. X            /* do the trading */
  936. X            longval1 = tradeit(natn[count],whobuy[count],type1[count],lvar1[count],extra[count]);
  937. X            if (longval1!=(-1)) longval2 = tradeit(whobuy[count],natn[count],type2[count],buy1[count],(int)buy2[count]);
  938. X            if (longval1==(-1)) {
  939. X                /* abort due to seller */
  940. X                fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.",
  941. X                    ntn[natn[count]].name,ntn[whobuy[count]].name,tradefail[type1[count]]);
  942. X            } else if (longval2==(-1)) {
  943. X                /* abort due to buyer */
  944. X                tradeit(whobuy[count],natn[count],type1[count],longval1,extra[count]);
  945. X                fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.",
  946. X                    ntn[whobuy[count]].name,ntn[natn[count]].name,tradefail[type2[count]]);
  947. X                /* place it on the list for next turn */
  948. X                /* adjust the displayed value */
  949. X                lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]);
  950. 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]);
  951. X            } else {
  952. X                /* trade completed send mail */
  953. X                fprintf(fnews,"2.\tNation %s sells %s to %s for %s"
  954. X                    ,ntn[natn[count]].name,commodities[type1[count]],ntn[whobuy[count]].name,commodities[type2[count]]);
  955. X                trademail(natn[count],whobuy[count],type1[count],
  956. X                    type2[count],longval1,(long)extra[count],
  957. X                    longval2,buy2[count]);
  958. X            }
  959. X        }
  960. X    }
  961. X    fclose(tfile);
  962. X#endif ADMIN
  963. X}
  964. X#endif TRADE
  965. END_OF_FILE
  966. if test 25421 -ne `wc -c <'trade.c'`; then
  967.     echo shar: \"'trade.c'\" unpacked with wrong size!
  968. fi
  969. # end of 'trade.c'
  970. fi
  971. if test -f 'patches03' -a "${1}" != "-c" ; then 
  972.   echo shar: Will not clobber existing file \"'patches03'\"
  973. else
  974. echo shar: Extracting \"'patches03'\" \(31526 characters\)
  975. sed "s/^X//" >'patches03' <<'END_OF_FILE'
  976. X*** oldnewlogin.c    Wed Jul 13 09:55:53 1988
  977. X--- newlogin.c    Wed Jul 13 09:56:16 1988
  978. X***************
  979. X*** 223,229
  980. X              }
  981. X          }
  982. X  
  983. X!         ntn[country].mark = toupper(*ntn[country].name);
  984. X          printf("\ntesting first letter of name (%c) for nation mark...",ntn[country].mark);
  985. X          valid=TRUE;
  986. X          while(valid==TRUE) {
  987. X
  988. X--- 223,231 -----
  989. X              }
  990. X          }
  991. X  
  992. X!         ntn[country].mark= (*ntn[country].name);
  993. X!         if (islower(ntn[country].mark)!=FALSE)
  994. X!           ntn[country].mark= toupper(ntn[country].mark);
  995. X          printf("\ntesting first letter of name (%c) for nation mark...",ntn[country].mark);
  996. X          valid=TRUE;
  997. X          while(valid==TRUE) {
  998. X***************
  999. X*** 252,257
  1000. X                  printf("\n'*' is invalid character");
  1001. X                  valid=TRUE;
  1002. X              }
  1003. X              if(valid==TRUE){
  1004. X                  printf("\nplease reenter new national mark for maps:");
  1005. X                  printf("\n (this can be any uppercase character)");
  1006. X
  1007. X--- 254,263 -----
  1008. X                  printf("\n'*' is invalid character");
  1009. X                  valid=TRUE;
  1010. X              }
  1011. X+             if(valid==FALSE) if(!isupper(ntn[country].mark)) {
  1012. X+                 printf("\nNot an uppercase character");
  1013. X+                 valid=TRUE;
  1014. X+             }
  1015. X              if(valid==TRUE){
  1016. X                  printf("\nplease reenter new national mark for maps:");
  1017. X                  printf("\n (this can be any uppercase character)");
  1018. X***************
  1019. X*** 977,982
  1020. X          return(2);
  1021. X      case 9:
  1022. X          printf("\ndragons have the magical MAJOR MONSTER power automatically");
  1023. X          ntn[country].powers|=AV_MONST;
  1024. X          x=AV_MONST;
  1025. X          CHGMGK;
  1026. X
  1027. X--- 983,991 -----
  1028. X          return(2);
  1029. X      case 9:
  1030. X          printf("\ndragons have the magical MAJOR MONSTER power automatically");
  1031. X+         ntn[country].powers|=MI_MONST;
  1032. X+         x=MI_MONST;
  1033. X+         CHGMGK;
  1034. X          ntn[country].powers|=AV_MONST;
  1035. X          x=AV_MONST;
  1036. X          CHGMGK;
  1037. X*** olddisplay.c    Wed Jul 13 09:55:53 1988
  1038. X--- display.c    Wed Jul 13 09:56:16 1988
  1039. X*** oldmain.c    Wed Jul 13 09:56:05 1988
  1040. X--- main.c    Wed Jul 13 09:56:16 1988
  1041. X***************
  1042. X*** 207,212
  1043. X              exit(FAIL);
  1044. X          }
  1045. X          execute();
  1046. X          if(ntn[country].capx>15) {
  1047. X              xcurs=15;
  1048. X              xoffset= (ntn[country].capx-15);
  1049. X
  1050. X--- 207,215 -----
  1051. X              exit(FAIL);
  1052. X          }
  1053. X          execute();
  1054. X+ #ifdef TRADE
  1055. X+         uptrade();
  1056. X+ #endif TRADE
  1057. X          if(ntn[country].capx>15) {
  1058. X              xcurs=15;
  1059. X              xoffset= (ntn[country].capx-15);
  1060. X***************
  1061. X*** 469,474
  1062. X          diploscrn();
  1063. X          redraw=TRUE;
  1064. X          break;
  1065. X      case '9':
  1066. X      case 'u':    /*move north-east*/
  1067. X          pager=0;
  1068. X
  1069. X--- 472,483 -----
  1070. X          diploscrn();
  1071. X          redraw=TRUE;
  1072. X          break;
  1073. X+ #ifdef TRADE
  1074. X+     case 'T':    /*go to commerce section*/
  1075. X+         trade();
  1076. X+         redraw=TRUE;
  1077. X+         break;
  1078. X+ #endif TRADE
  1079. X      case '9':
  1080. X      case 'u':    /*move north-east*/
  1081. X          pager=0;
  1082. X***************
  1083. X*** 673,679
  1084. X              found=1;
  1085. X      }
  1086. X  
  1087. X!     if(nfound<4+(pager*5)) for(nvynum=0;nvynum<MAXNAVY;nvynum++){
  1088. X          if(((NWAR+NMER)!=0)&&(NXLOC==XREAL)&&(NYLOC==YREAL)) {
  1089. X              if((nfound>=pager*5)&&(nfound<=4+(pager*5))) {
  1090. X                  /*print a navy*/
  1091. X
  1092. X--- 682,688 -----
  1093. X              found=1;
  1094. X      }
  1095. X  
  1096. X!     if(nfound<=4+(pager*5)) for(nvynum=0;nvynum<MAXNAVY;nvynum++){
  1097. X          if(((NWAR+NMER)!=0)&&(NXLOC==XREAL)&&(NYLOC==YREAL)) {
  1098. X              if((nfound>=pager*5)&&(nfound<=4+(pager*5))) {
  1099. X                  /*print a navy*/
  1100. X*** oldnpc.c    Wed Jul 13 09:56:05 1988
  1101. X--- npc.c    Wed Jul 13 09:56:16 1988
  1102. X***************
  1103. X*** 730,737
  1104. X          if(ntn[country].jewels > getmgkcost(M_MIL,country)) {
  1105. X              ntn[country].jewels-=getmgkcost(M_MIL,country);
  1106. X              if((zz=getmagic(M_MIL))!=0){
  1107. X!                 fprintf(fnews,"1.\tnation %s gets combat power number %d\n",ntn[country].name,zz);
  1108. X!                 printf("\tnation %s gets combat power number %d\n",ntn[country].name,zz);
  1109. X                  exenewmgk(zz);
  1110. X              } else if((zz=getmagic(M_MIL))!=0){
  1111. X                  fprintf(fnews,"1.\tnation %s gets combat power number %d\n",ntn[country].name,zz);
  1112. X
  1113. X--- 730,737 -----
  1114. X          if(ntn[country].jewels > getmgkcost(M_MIL,country)) {
  1115. X              ntn[country].jewels-=getmgkcost(M_MIL,country);
  1116. X              if((zz=getmagic(M_MIL))!=0){
  1117. X!                 fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  1118. X!                 printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  1119. X                  exenewmgk(zz);
  1120. X              } else if((zz=getmagic(M_MIL))!=0){
  1121. X                  fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  1122. X***************
  1123. X*** 734,741
  1124. X                  printf("\tnation %s gets combat power number %d\n",ntn[country].name,zz);
  1125. X                  exenewmgk(zz);
  1126. X              } else if((zz=getmagic(M_MIL))!=0){
  1127. X!                 fprintf(fnews,"1.\tnation %s gets combat power number %d\n",ntn[country].name,zz);
  1128. X!                 printf("\tnation %s gets combat power number %d\n",ntn[country].name,zz);
  1129. X                  exenewmgk(zz);
  1130. X              }
  1131. X              else    ntn[country].jewels+=getmgkcost(M_MIL,country);
  1132. X
  1133. X--- 734,741 -----
  1134. X                  printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  1135. X                  exenewmgk(zz);
  1136. X              } else if((zz=getmagic(M_MIL))!=0){
  1137. X!                 fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  1138. X!                 printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  1139. X                  exenewmgk(zz);
  1140. X              }
  1141. X              else    ntn[country].jewels+=getmgkcost(M_MIL,country);
  1142. X***************
  1143. X*** 744,751
  1144. X          if(ntn[country].jewels > getmgkcost(M_CIV,country)) {
  1145. X              ntn[country].jewels-=getmgkcost(M_CIV,country);
  1146. X              if((zz=getmagic(M_CIV))!=0){
  1147. X!                 fprintf(fnews,"1.\tnation %s gets civilian power number %d\n",ntn[country].name,zz);
  1148. X!                 printf("\tnation %s gets civilian power number %d\n",ntn[country].name,zz);
  1149. X                  exenewmgk(zz);
  1150. X              }
  1151. X              else if((zz=getmagic(M_CIV))!=0){
  1152. X
  1153. X--- 744,751 -----
  1154. X          if(ntn[country].jewels > getmgkcost(M_CIV,country)) {
  1155. X              ntn[country].jewels-=getmgkcost(M_CIV,country);
  1156. X              if((zz=getmagic(M_CIV))!=0){
  1157. X!                 fprintf(fnews,"1.\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
  1158. X!                 printf("\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
  1159. X                  exenewmgk(zz);
  1160. X              }
  1161. X              else if((zz=getmagic(M_CIV))!=0){
  1162. X***************
  1163. X*** 749,756
  1164. X                  exenewmgk(zz);
  1165. X              }
  1166. X              else if((zz=getmagic(M_CIV))!=0){
  1167. X!                 fprintf(fnews,"1.\tnation %s gets civilian power number %d\n",ntn[country].name,zz);
  1168. X!                 printf("\tnation %s gets civilian power number %d\n",ntn[country].name,zz);
  1169. X                  exenewmgk(zz);
  1170. X              }
  1171. X              else    ntn[country].jewels+=getmgkcost(M_CIV,country);
  1172. X
  1173. X--- 749,756 -----
  1174. X                  exenewmgk(zz);
  1175. X              }
  1176. X              else if((zz=getmagic(M_CIV))!=0){
  1177. X!                 fprintf(fnews,"1.\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
  1178. X!                 printf("\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
  1179. X                  exenewmgk(zz);
  1180. X              }
  1181. X              else    ntn[country].jewels+=getmgkcost(M_CIV,country);
  1182. X***************
  1183. X*** 796,802
  1184. X          for(y=0;y<MAPY;y++) if(ONMAP)
  1185. X              attr[x][y]=1;
  1186. X      for(y=ntn[country].capy+NPCTOOFAR;y<MAPY;y++)
  1187. X!         for(x=0;x<MAPY;x++) if(ONMAP)
  1188. X              attr[x][y]=1;
  1189. X      for(x=0;x<ntn[country].capx-NPCTOOFAR;x++)
  1190. X          for(y=0;y<MAPY;y++) if(ONMAP)
  1191. X
  1192. X--- 796,802 -----
  1193. X          for(y=0;y<MAPY;y++) if(ONMAP)
  1194. X              attr[x][y]=1;
  1195. X      for(y=ntn[country].capy+NPCTOOFAR;y<MAPY;y++)
  1196. X!         for(x=0;x<MAPX;x++) if(ONMAP)
  1197. X              attr[x][y]=1;
  1198. X      for(x=0;x<ntn[country].capx-NPCTOOFAR;x++)
  1199. X          for(y=0;y<MAPY;y++) if(ONMAP)
  1200. X***************
  1201. X*** 802,808
  1202. X          for(y=0;y<MAPY;y++) if(ONMAP)
  1203. X              attr[x][y]=1;
  1204. X      for(y=0;y<ntn[country].capy-NPCTOOFAR;y++)
  1205. X!         for(x=0;x<MAPY;x++) if(ONMAP)
  1206. X              attr[x][y]=1;
  1207. X  }
  1208. X  
  1209. X
  1210. X--- 802,808 -----
  1211. X          for(y=0;y<MAPY;y++) if(ONMAP)
  1212. X              attr[x][y]=1;
  1213. X      for(y=0;y<ntn[country].capy-NPCTOOFAR;y++)
  1214. X!         for(x=0;x<MAPX;x++) if(ONMAP)
  1215. X              attr[x][y]=1;
  1216. X  }
  1217. X  
  1218. X***************
  1219. X*** 1042,1048
  1220. X  int line;
  1221. X  {
  1222. X      int armynum;
  1223. X!     for(armynum=0;armynum<MAXARM;armynum++)
  1224. X          if(ASOLD<0) {
  1225. X          printf("ERROR: line %d army %d nation %s soldier %d\n",line,armynum,ntn[country].name,ASOLD);
  1226. X          ASOLD=0;
  1227. X
  1228. X--- 1042,1048 -----
  1229. X  int line;
  1230. X  {
  1231. X      int armynum;
  1232. X!     for(armynum=0;armynum<MAXARM;armynum++){
  1233. X          if(ASOLD<0) {
  1234. X          printf("ERROR: line %d army %d nation %s soldier %d\n",line,armynum,ntn[country].name,ASOLD);
  1235. X          ASOLD=0;
  1236. X***************
  1237. X*** 1049,1054
  1238. X          }
  1239. X          if((AXLOC>MAPX)||(AYLOC>MAPY)){
  1240. X          printf("CHECK ERROR: line %d army %d nation %s loc %d %d\n",line,armynum,ntn[country].name,AXLOC,AYLOC);
  1241. X          }
  1242. X      if(ntn[country].tiron < 0L)
  1243. X          printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron);
  1244. X
  1245. X--- 1049,1056 -----
  1246. X          }
  1247. X          if((AXLOC>MAPX)||(AYLOC>MAPY)){
  1248. X          printf("CHECK ERROR: line %d army %d nation %s loc %d %d\n",line,armynum,ntn[country].name,AXLOC,AYLOC);
  1249. X+         AXLOC = ntn[country].capx;
  1250. X+         AYLOC = ntn[country].capy;
  1251. X          }
  1252. X      }
  1253. X      if(ntn[country].tiron < 0L){
  1254. X***************
  1255. X*** 1050,1056
  1256. X          if((AXLOC>MAPX)||(AYLOC>MAPY)){
  1257. X          printf("CHECK ERROR: line %d army %d nation %s loc %d %d\n",line,armynum,ntn[country].name,AXLOC,AYLOC);
  1258. X          }
  1259. X!     if(ntn[country].tiron < 0L)
  1260. X          printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron);
  1261. X      if(ntn[country].tfood < 0L)
  1262. X          printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood);
  1263. X
  1264. X--- 1052,1059 -----
  1265. X          AXLOC = ntn[country].capx;
  1266. X          AYLOC = ntn[country].capy;
  1267. X          }
  1268. X!     }
  1269. X!     if(ntn[country].tiron < 0L){
  1270. X          printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron);
  1271. X          ntn[country].tiron = 0;
  1272. X      }
  1273. X***************
  1274. X*** 1052,1058
  1275. X          }
  1276. X      if(ntn[country].tiron < 0L)
  1277. X          printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron);
  1278. X!     if(ntn[country].tfood < 0L)
  1279. X          printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood);
  1280. X      if(ntn[country].jewels < 0L)
  1281. X          printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels);
  1282. X
  1283. X--- 1055,1063 -----
  1284. X      }
  1285. X      if(ntn[country].tiron < 0L){
  1286. X          printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron);
  1287. X!         ntn[country].tiron = 0;
  1288. X!     }
  1289. X!     if(ntn[country].tfood < 0L){
  1290. X          printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood);
  1291. X          ntn[country].tfood = 0;
  1292. X      }
  1293. X***************
  1294. X*** 1054,1060
  1295. X          printf("ERROR: line %d nation %s iron is %ld\n",line,ntn[country].name,ntn[country].tiron);
  1296. X      if(ntn[country].tfood < 0L)
  1297. X          printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood);
  1298. X!     if(ntn[country].jewels < 0L)
  1299. X          printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels);
  1300. X  }
  1301. X  #endif DEBUG
  1302. X
  1303. X--- 1059,1067 -----
  1304. X      }
  1305. X      if(ntn[country].tfood < 0L){
  1306. X          printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood);
  1307. X!         ntn[country].tfood = 0;
  1308. X!     }
  1309. X!     if(ntn[country].jewels < 0L){
  1310. X          printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels);
  1311. X          ntn[country].jewels = 0;
  1312. X      }
  1313. X***************
  1314. X*** 1056,1060
  1315. X          printf("ERROR: line %d nation %s food is %ld\n",line,ntn[country].name,ntn[country].tfood);
  1316. X      if(ntn[country].jewels < 0L)
  1317. X          printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels);
  1318. X  }
  1319. X  #endif DEBUG
  1320. X
  1321. X--- 1063,1069 -----
  1322. X      }
  1323. X      if(ntn[country].jewels < 0L){
  1324. X          printf("ERROR: line %d nation %s jewels is %ld\n",line,ntn[country].name,ntn[country].jewels);
  1325. X+         ntn[country].jewels = 0;
  1326. X+     }
  1327. X  }
  1328. X  #endif DEBUG
  1329. X*** oldheader.h    Wed Jul 13 09:55:58 1988
  1330. X--- header.h    Wed Jul 13 09:56:16 1988
  1331. X***************
  1332. X*** 49,54
  1333. X  #define MAXNAVY        16    /*maximum number of fleets per nation*/
  1334. X  
  1335. X  /*THE FOLLOWING SHOULD BE COMMENTED OUT IF YOU DO NOT WANT THE FUNCTION*/
  1336. X  /*#define HIDELOC        /*defined if news is not to report sectors*/
  1337. X  #define OGOD        /*defined if you wish to enhance god mode*/
  1338. X              /* this gives features like god passwords... */
  1339. X
  1340. X--- 49,55 -----
  1341. X  #define MAXNAVY        16    /*maximum number of fleets per nation*/
  1342. X  
  1343. X  /*THE FOLLOWING SHOULD BE COMMENTED OUT IF YOU DO NOT WANT THE FUNCTION*/
  1344. X+ #define TRADE        /*defined to allow commerce between nations*/
  1345. X  /*#define HIDELOC        /*defined if news is not to report sectors*/
  1346. X  #define OGOD        /*defined if you wish to enhance god mode*/
  1347. X              /* this gives features like god passwords... */
  1348. X***************
  1349. X*** 59,65
  1350. X  #define STORMS        /* have storms strike fleets */
  1351. X  #define VULCANIZE    /* add in volcano eruptions.... */
  1352. X  #define PVULCAN 20      /* % chance of eruption each round (see above)*/
  1353. X! /* #define ORCTAKE      /* define if want orcs to takeover orc NPCS */
  1354. X  #define TAKEPRICE 500000L /* price for orc takeover (see above) in jewels */
  1355. X  #define PMOUNT 20       /* % of land that is mountains */
  1356. X  #define PSTORM 3        /* % chance that a storm will strike a fleet */
  1357. X
  1358. X--- 60,66 -----
  1359. X  #define STORMS        /* have storms strike fleets */
  1360. X  #define VULCANIZE    /* add in volcano eruptions.... */
  1361. X  #define PVULCAN 20      /* % chance of eruption each round (see above)*/
  1362. X! #define ORCTAKE      /* define if want orcs to takeover orc NPCS */
  1363. X  #define TAKEPRICE 500000L /* price for orc takeover (see above) in jewels */
  1364. X  #define PMOUNT 20       /* % of land that is mountains */
  1365. X  #define PSTORM 3        /* % chance that a storm will strike a fleet */
  1366. X***************
  1367. X*** 84,90
  1368. X  #define TAXFOOD        40L
  1369. X  #define TAXIRON        60L
  1370. X  #define TAXGOLD        70L
  1371. X! /*City and Capitol tax rates based on people only (no multipleier)*/
  1372. X  #define TAXCAP        1000L
  1373. X  #define TAXCITY        750L
  1374. X  
  1375. X
  1376. X--- 85,91 -----
  1377. X  #define TAXFOOD        40L
  1378. X  #define TAXIRON        60L
  1379. X  #define TAXGOLD        70L
  1380. X! /*Town and Capitol tax rates based on people only (no multiplyer)*/
  1381. X  #define TAXCAP        1000L
  1382. X  #define TAXCITY        750L
  1383. X  
  1384. X*** olddata.h    Wed Jul 13 09:56:08 1988
  1385. X--- data.h    Wed Jul 13 09:56:16 1988
  1386. X***************
  1387. X*** 93,99
  1388. X  #define    SCOUT        2    /*Scouting--will not engage enemy if possible*/
  1389. X  #define    ATTACK        3    /*Attack anybody (Hostile+) within 2 sectors*/
  1390. X  #define    DEFEND        4    /*Defend */
  1391. X! #define    GARRISON    5    /*Garrison--for a city or Capitol */
  1392. X  
  1393. X  struct s_sector
  1394. X  {
  1395. X
  1396. X--- 93,100 -----
  1397. X  #define    SCOUT        2    /*Scouting--will not engage enemy if possible*/
  1398. X  #define    ATTACK        3    /*Attack anybody (Hostile+) within 2 sectors*/
  1399. X  #define    DEFEND        4    /*Defend */
  1400. X! #define    GARRISON    5    /*Garrison--for a town or Capitol */
  1401. X! #define TRADED        6    /*Indicates an army that has been traded*/
  1402. X  
  1403. X  struct s_sector
  1404. X  {
  1405. X***************
  1406. X*** 400,405
  1407. X  extern    char    *helpfile;
  1408. X  extern    char    *newsfile;
  1409. X  extern    char    *isonfile;
  1410. X  
  1411. X  #define    abrt() { \
  1412. X  fprintf(stderr,"\nSerious Error (File %s, Line %d) - Aborting\n",__FILE__,__LINE__); \
  1413. X
  1414. X--- 401,409 -----
  1415. X  extern    char    *helpfile;
  1416. X  extern    char    *newsfile;
  1417. X  extern    char    *isonfile;
  1418. X+ #ifdef TRADE
  1419. X+ extern    char    *tradefile;
  1420. X+ #endif TRADE
  1421. X  
  1422. X  #define    abrt() { \
  1423. X  fprintf(stderr,"\nSerious Error (File %s, Line %d) - Aborting\n",__FILE__,__LINE__); \
  1424. X***************
  1425. X*** 421,426
  1426. X  extern    void readdata(),redesignate(),redomil(),reduce(),rmessage(),score();
  1427. X  extern    void see(),showscore(),update(),updmove(),verifydata(),verify_ntn();
  1428. X  extern    void verify_sct(),wmessage(),writedata(),getdstatus(),exit();
  1429. X  
  1430. X  extern    char    *crypt(),*strcpy(),*strncpy(),*strcat(),*strncat();
  1431. X  
  1432. X
  1433. X--- 425,433 -----
  1434. X  extern    void readdata(),redesignate(),redomil(),reduce(),rmessage(),score();
  1435. X  extern    void see(),showscore(),update(),updmove(),verifydata(),verify_ntn();
  1436. X  extern    void verify_sct(),wmessage(),writedata(),getdstatus(),exit();
  1437. X+ #ifdef TRADE
  1438. X+ extern    void trade(),uptrade();
  1439. X+ #endif TRADE
  1440. X  
  1441. X  extern    char    *crypt(),*strcpy(),*strncpy(),*strcat(),*strncat();
  1442. X  
  1443. X*** oldnewlogin.h    Wed Jul 13 09:55:59 1988
  1444. X--- newlogin.h    Wed Jul 13 09:56:17 1988
  1445. X***************
  1446. X*** 63,67
  1447. X  #define    NLREPRO        1
  1448. X  #define    NLREPCOST    2
  1449. X  #define    NLMOVE        3
  1450. X! #define    NLDBLCOST    2
  1451. X  #define    NLMAGIC        2
  1452. X
  1453. X--- 63,67 -----
  1454. X  #define    NLREPRO        1
  1455. X  #define    NLREPCOST    2
  1456. X  #define    NLMOVE        3
  1457. X! #define    NLDBLCOST    1
  1458. X  #define    NLMAGIC        2
  1459. X*** oldnations    Wed Jul 13 09:55:56 1988
  1460. X--- nations    Wed Jul 13 09:56:17 1988
  1461. X***************
  1462. X*** 41,47
  1463. X  #########################################################################
  1464. X  anorian  elfwizard  E A F 30 40  8  70000 1500 8500 8  2
  1465. X  bobland  dragon     O B F 20 0   6  12000  1500 8000 10 9
  1466. X- cordoba  wizard     H C R 10 10  2  30000 1500 8000 8  4
  1467. X  darboth  balrog     O D R 0  0   7  70000 1500 9500 8  9
  1468. X  edland   dragon     O E R 20 0   8  12000  1500 8500 10 9
  1469. X  fung     elfking    E F F 10 40  8  50000 1000 9500 8  2
  1470. X
  1471. X--- 41,46 -----
  1472. X  #########################################################################
  1473. X  anorian  elfwizard  E A F 30 40  8  70000 1500 8500 8  2
  1474. X  bobland  dragon     O B F 20 0   6  12000  1500 8000 10 9
  1475. X  darboth  balrog     O D R 0  0   7  70000 1500 9500 8  9
  1476. X  edland   dragon     O E R 20 0   8  12000  1500 8500 10 9
  1477. X  fung     elfking    E F F 10 40  8  50000 1000 9500 8  2
  1478. X***************
  1479. X*** 47,52
  1480. X  fung     elfking    E F F 10 40  8  50000 1000 9500 8  2
  1481. X  gotho    warking    H G R 10 10  9  50000 1000 6150 8  4
  1482. X  hargo    king       H H R 10 10  9  30000 1500 11000 7 4
  1483. X  lint     elfwizard  E L F 20 30  8  50000 1500 7900 10 2
  1484. X  medal    elfpriest  E M R 20 0   6  16000  2000 6500 10 9
  1485. X  noria    dwarfduke  D N R 10 30  6  50000 1000 10000 8 4
  1486. X
  1487. X--- 46,52 -----
  1488. X  fung     elfking    E F F 10 40  8  50000 1000 9500 8  2
  1489. X  gotho    warking    H G R 10 10  9  50000 1000 6150 8  4
  1490. X  hargo    king       H H R 10 10  9  30000 1500 11000 7 4
  1491. X+ jordoba  wizard     H J R 10 10  2  30000 1500 8000 8  4
  1492. X  lint     elfwizard  E L F 20 30  8  50000 1500 7900 10 2
  1493. X  medal    elfpriest  E M R 20 0   6  16000  2000 6500 10 9
  1494. X  noria    dwarfduke  D N R 10 30  6  50000 1000 10000 8 4
  1495. X*** oldMakefile    Wed Jul 13 09:55:55 1988
  1496. X--- Makefile    Wed Jul 13 09:56:17 1988
  1497. X***************
  1498. X*** 24,30
  1499. X  #    if they do not use the -d option.
  1500. X  DEFAULT = /c28/smile/game/default
  1501. X  
  1502. X! CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  1503. X  #    The following CFLAGS should be used if you wish to debug the game
  1504. X  #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  1505. X  
  1506. X
  1507. X--- 24,30 -----
  1508. X  #    if they do not use the -d option.
  1509. X  DEFAULT = /c28/smile/game/default
  1510. X  
  1511. X! #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  1512. X  #    The following CFLAGS should be used if you wish to debug the game
  1513. X  CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  1514. X  
  1515. X***************
  1516. X*** 26,32
  1517. X  
  1518. X  CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  1519. X  #    The following CFLAGS should be used if you wish to debug the game
  1520. X! #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  1521. X  
  1522. X  #    this is the name of the user executable
  1523. X  #    the user executable contains commands for the games players
  1524. X
  1525. X--- 26,32 -----
  1526. X  
  1527. X  #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  1528. X  #    The following CFLAGS should be used if you wish to debug the game
  1529. X! CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  1530. X  
  1531. X  #    this is the name of the user executable
  1532. X  #    the user executable contains commands for the games players
  1533. X***************
  1534. X*** 33,39
  1535. X  GAME = conquer
  1536. X  #    this is the name of the administrative executable
  1537. X  #    the administrative executable contains commands for the game super user
  1538. X! ADMIN = admin
  1539. X  
  1540. X  #    This directory is where the executables will be stored
  1541. X  EXEDIR = /c28/smile/game/runv
  1542. X
  1543. X--- 33,39 -----
  1544. X  GAME = conquer
  1545. X  #    this is the name of the administrative executable
  1546. X  #    the administrative executable contains commands for the game super user
  1547. X! ADMIN = cadmin
  1548. X  
  1549. X  #    This directory is where the executables will be stored
  1550. X  EXEDIR = /c28/smile/game/runv
  1551. X***************
  1552. X*** 48,54
  1553. X  
  1554. X  # AFILS are files needed for game updating...
  1555. X  AFILS = combat.c cexecute.c io.c admin.c makeworld.c  \
  1556. X! newlogin.c update.c magic.c npc.c misc.c randevent.c data.c
  1557. X  AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o  \
  1558. X  newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o $(GETOPT)
  1559. X  
  1560. X
  1561. X--- 48,54 -----
  1562. X  
  1563. X  # AFILS are files needed for game updating...
  1564. X  AFILS = combat.c cexecute.c io.c admin.c makeworld.c  \
  1565. X! newlogin.c update.c magic.c npc.c misc.c randevent.c data.c trade.c
  1566. X  AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o  \
  1567. X  newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o \
  1568. X  tradeA.o $(GETOPT)
  1569. X***************
  1570. X*** 50,56
  1571. X  AFILS = combat.c cexecute.c io.c admin.c makeworld.c  \
  1572. X  newlogin.c update.c magic.c npc.c misc.c randevent.c data.c
  1573. X  AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o  \
  1574. X! newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o $(GETOPT)
  1575. X  
  1576. X  # GFILS are files needed to run a normal interactive game
  1577. X  GFILS = commands.c cexecute.c forms.c io.c main.c move.c \
  1578. X
  1579. X--- 50,57 -----
  1580. X  AFILS = combat.c cexecute.c io.c admin.c makeworld.c  \
  1581. X  newlogin.c update.c magic.c npc.c misc.c randevent.c data.c trade.c
  1582. X  AOBJS = combat.o cexecuteA.o ioA.o admin.o makeworld.o  \
  1583. X! newlogin.o update.o magicA.o npc.o miscA.o randevent.o dataA.o \
  1584. X! tradeA.o $(GETOPT)
  1585. X  
  1586. X  # GFILS are files needed to run a normal interactive game
  1587. X  GFILS = commands.c cexecute.c forms.c io.c main.c move.c \
  1588. X***************
  1589. X*** 54,60
  1590. X  
  1591. X  # GFILS are files needed to run a normal interactive game
  1592. X  GFILS = commands.c cexecute.c forms.c io.c main.c move.c \
  1593. X! magic.c misc.c reports.c data.c display.c extcmds.c
  1594. X  GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \
  1595. X  magic.o misc.o reports.o data.o display.o extcmds.o $(GETOPT)
  1596. X  
  1597. X
  1598. X--- 55,61 -----
  1599. X  
  1600. X  # GFILS are files needed to run a normal interactive game
  1601. X  GFILS = commands.c cexecute.c forms.c io.c main.c move.c \
  1602. X! magic.c misc.c reports.c data.c display.c extcmds.c trade.c
  1603. X  GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \
  1604. X  magic.o misc.o reports.o data.o display.o extcmds.o trade.o $(GETOPT)
  1605. X  
  1606. X***************
  1607. X*** 56,62
  1608. X  GFILS = commands.c cexecute.c forms.c io.c main.c move.c \
  1609. X  magic.c misc.c reports.c data.c display.c extcmds.c
  1610. X  GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \
  1611. X! magic.o misc.o reports.o data.o display.o extcmds.o $(GETOPT)
  1612. X  
  1613. X  HEADERS=header.h data.h newlogin.h
  1614. X  HELPFILE=help.txt
  1615. X
  1616. X--- 57,63 -----
  1617. X  GFILS = commands.c cexecute.c forms.c io.c main.c move.c \
  1618. X  magic.c misc.c reports.c data.c display.c extcmds.c trade.c
  1619. X  GOBJS = commands.o cexecute.o forms.o io.o main.o move.o \
  1620. X! magic.o misc.o reports.o data.o display.o extcmds.o trade.o $(GETOPT)
  1621. X  
  1622. X  HEADERS=header.h data.h newlogin.h
  1623. X  HELPFILE=help.txt
  1624. X***************
  1625. X*** 125,130
  1626. X      newhelp
  1627. X      cat $(HELPFILE) | sed -f helpscript > $(HELPOUT)
  1628. X      $(RM) helpscript
  1629. X      cp $(HELPOUT) $(DEFAULT)
  1630. X  
  1631. X  lint:
  1632. X
  1633. X--- 126,132 -----
  1634. X      newhelp
  1635. X      cat $(HELPFILE) | sed -f helpscript > $(HELPOUT)
  1636. X      $(RM) helpscript
  1637. X+     -mkdir $(DEFAULT)  2>/dev/null
  1638. X      cp $(HELPOUT) $(DEFAULT)
  1639. X  
  1640. X  lint:
  1641. X***************
  1642. X*** 209,211
  1643. X      $(CC) $(CFLAGS) -DCONQUER -c forms.c
  1644. X  commands.o:    data.h header.h commands.c
  1645. X      $(CC) $(CFLAGS) -DCONQUER -c commands.c
  1646. X
  1647. X--- 211,218 -----
  1648. X      $(CC) $(CFLAGS) -DCONQUER -c forms.c
  1649. X  commands.o:    data.h header.h commands.c
  1650. X      $(CC) $(CFLAGS) -DCONQUER -c commands.c
  1651. X+ trade.o:    data.h header.h trade.h trade.c
  1652. X+     $(CC) $(CFLAGS) -DCONQUER -c trade.c
  1653. X+ tradeA.o:    data.h header.h trade.h trade.c
  1654. X+     $(CC) $(CFLAGS) -DADMIN -c trade.c
  1655. X+     mv trade.o tradeA.o
  1656. X*** oldhelp.txt    Wed Jul 13 09:55:54 1988
  1657. X--- help.txt    Wed Jul 13 09:56:17 1988
  1658. X***************
  1659. X*** 11,17
  1660. X  'b': move south west     'S': diplomacy status       'N': read newspaper
  1661. X  'J': scroll south        'Q': quit (saves changes)   'W': write message
  1662. X  'K': scroll north        'M': magic                  'R': read messages
  1663. X! 'L': scroll east         'C': construct
  1664. X  'H': scroll west         'D': draft              'ESC [1-5]': chg status
  1665. X                       'G': go to next army    'ESC +': combine 2 armies
  1666. X                       'F': go to next fleet   'ESC -': split army
  1667. X
  1668. X--- 11,17 -----
  1669. X  'b': move south west     'S': diplomacy status       'N': read newspaper
  1670. X  'J': scroll south        'Q': quit (saves changes)   'W': write message
  1671. X  'K': scroll north        'M': magic                  'R': read messages
  1672. X! 'L': scroll east         'C': construct              'T': trade
  1673. X  'H': scroll west         'D': draft              'ESC [1-5]': chg status
  1674. X                       'G': go to next army    'ESC +': combine 2 armies
  1675. X                       'F': go to next fleet   'ESC -': split army
  1676. X***************
  1677. X*** 19,34
  1678. X  END
  1679. X                      Welcome to Conquer XVERSION
  1680. X  
  1681. X! CONQUER is a multi player computer game designed to run under the UNIX
  1682. X! operating system.  In CONQUER,  each player is the leader of a nation,
  1683. X! composed of people (humans, orcs, elves, dwarves), resources, and land.
  1684. X! Rulers customize their nation at creation by chosing their race and by giving
  1685. X! their nation special powers (magic, combat factor, location, speed...)
  1686. X! and resources (civilians, troops, iron, gold...).  Play involves building,
  1687. X! moving, and controlling armies and navies, diplomacy with other players,
  1688. X! and adjusting economic activity, which is primarily geared to the production
  1689. X! of gold for your treasury.  Iron is needed, however to build ships & armies,
  1690. X! and food is needed to prevent revolts and keep people alive.
  1691. X  
  1692. X  Command line format: conquer [-maxhps -nNAT -dDIR]
  1693. X      -h       print this help text         -n NTN   run as nation NTN
  1694. X
  1695. X--- 19,33 -----
  1696. X  END
  1697. X                      Welcome to Conquer XVERSION
  1698. X  
  1699. X! CONQUER is a multi player computer game designed to run under the UNIX OS.
  1700. X! In CONQUER,  each player is the leader of a nation, composed of people 
  1701. X! (humans, orcs, elves, dwarves), resources, and land.  Rulers customize their 
  1702. X! nation at creation by chosing their race and by giving their nation special 
  1703. X! powers (magic, combat factor, location, speed...) and resources (civilians, 
  1704. X! troops, iron, gold...).  Play involves building, moving, and controlling 
  1705. X! armies and navies, diplomacy with other players, and economics, which is 
  1706. X! geared to raising of gold for your treasury,  iron for ships & armies, jewels,
  1707. X! and food to prevent revolts and keep people alive.
  1708. X  
  1709. X  Command line format: conquer [-hs -nNAT -dDIR]
  1710. X          -h       print this help text
  1711. X***************
  1712. X*** 30,43
  1713. X  of gold for your treasury.  Iron is needed, however to build ships & armies,
  1714. X  and food is needed to prevent revolts and keep people alive.
  1715. X  
  1716. X! Command line format: conquer [-maxhps -nNAT -dDIR]
  1717. X!     -h       print this help text         -n NTN   run as nation NTN
  1718. X!     -d DIR   run on data in directory DIR    -s       print out scores
  1719. X! Command line format: admin [-maxdp]
  1720. X!     -a       add new player        -m       make a world
  1721. X!     -p       print a map        -x       execute program
  1722. X!     -d DIR   run on data in directory DIR
  1723. X! It is suggested that each player set up a shell alias for their game & nation
  1724. X  END
  1725. X                               THE WORLD
  1726. X  
  1727. X
  1728. X--- 29,42 -----
  1729. X  geared to raising of gold for your treasury,  iron for ships & armies, jewels,
  1730. X  and food to prevent revolts and keep people alive.
  1731. X  
  1732. X! Command line format: conquer [-hs -nNAT -dDIR]
  1733. X!         -h       print this help text
  1734. X!         -s       print out scores
  1735. X!         -n NTN   run as nation NTN
  1736. X!         -d DIR   run on data in directory DIR
  1737. X! 
  1738. X! Each player should set up a shell alias to run their nation.  The Game 
  1739. X! Administrator should read other documentation on using the admin command.
  1740. X  END
  1741. X                               THE WORLD
  1742. X  
  1743. X***************
  1744. X*** 136,141
  1745. X  'N': newspaper:    Briefs you on world happenings.  Note: News has 4 pages.
  1746. X  'P': production:   ESTIMATE your nations production statistics
  1747. X  'S': diplomacy:    Allow you to see and alter your diplomatic status.
  1748. X  'Q': quit:         Save your move and quit the game.  Note there is no
  1749. X                  means supported to quit without saving your moves.
  1750. X  'R': read mail:    Read mail messages
  1751. X
  1752. X--- 135,141 -----
  1753. X  'N': newspaper:    Briefs you on world happenings.  Note: News has 4 pages.
  1754. X  'P': production:   ESTIMATE your nations production statistics
  1755. X  'S': diplomacy:    Allow you to see and alter your diplomatic status.
  1756. X+ 'T': commerce:     Allow you to trade with other nations.
  1757. X  'Q': quit:         Save your move and quit the game.  Note there is no
  1758. X                  means supported to quit without saving your moves.
  1759. X  'R': read mail:    Read mail messages
  1760. X***************
  1761. X*** 315,322
  1762. X              SHIPS AND SHIP COSTS
  1763. X  
  1764. X          crew    build cost    maintain cost    capacity
  1765. X! Warship        50    XWARSHPCOST        XSHIPMAINT        0
  1766. X! Merchant    50    XMERSHPCOST        XSHIPMAINT        XSHIPCP
  1767. X  
  1768. X  Ships will now have crews - which, in addition to being drafted upon
  1769. X  construction, represent the ships current level of damage and are replaced,
  1770. X
  1771. X--- 315,322 -----
  1772. X              SHIPS AND SHIP COSTS
  1773. X  
  1774. X          crew    build cost    maintain cost    capacity
  1775. X! Warship        XSHIPCREW    XWARSHPCOST        XSHIPMAINT        0
  1776. X! Merchant    XSHIPCREW    XMERSHPCOST        XSHIPMAINT        XSHIPCP
  1777. X  
  1778. X  Ships will now have crews - which, in addition to being drafted upon
  1779. X  construction, represent the ships current level of damage and are replaced,
  1780. X***************
  1781. X*** 332,337
  1782. X  10 and all their remaining points points for non harbor coastlands.  Naval 
  1783. X  combat has not been adequately play tested, and Sailor units dont work.
  1784. X  END
  1785. X                               MAGIC POWERS
  1786. X  Magic powers differentiate your nation from all the other nations in the
  1787. X  world.  There are three types of powers - truely MAGICAL powers, which
  1788. X
  1789. X--- 332,355 -----
  1790. X  10 and all their remaining points points for non harbor coastlands.  Naval 
  1791. X  combat has not been adequately play tested, and Sailor units dont work.
  1792. X  END
  1793. X+             COMMERCE AND TRADING
  1794. X+ 
  1795. X+ Trading makes it be possible to exchange items between nations.
  1796. X+ 
  1797. X+ There are seven types of items available for trade:  gold, food, iron,
  1798. X+ jewels, land, soldiers, and ships.  To place an item up for trade,
  1799. X+ the player need only select the sell option on the commerce board.  The
  1800. X+ player will then enter the type and amount of his product followed by the
  1801. X+ type and minimum amount of what he wants in return.  The product will
  1802. X+ remain on the commerce board until it is purchased or removed by the
  1803. X+ owner of the product.  To purchase an item, a player can just select the
  1804. X+ item number to purchase and then enter a bid amount.  You may only trade
  1805. X+ mercenary, seige engine, catapult, (summoned) monster, or elephant units.
  1806. X+ 
  1807. X+ During every update, bids will be resolved and the highest bid for a
  1808. X+ product will receive the product.  There is a 20% administration fee
  1809. X+ for a trade (i.e. 20% of the traded goods on each side disappear)
  1810. X+ END
  1811. X                               MAGIC POWERS
  1812. X  Magic powers differentiate your nation from all the other nations in the
  1813. X  world.  There are three types of powers - truely MAGICAL powers, which
  1814. X***************
  1815. X*** 454,459
  1816. X  
  1817. X  THE NEXT PAGE IS THE COMBAT RESULTS TABLE
  1818. X       basically the attacker wants a high roll and the defender wants low.
  1819. X  END
  1820. 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
  1821. X      <--010     20% 40% 50% 60% 70% 80% 90% 100%100%100%110%120%120%130%130%
  1822. X
  1823. X--- 472,481 -----
  1824. X  
  1825. X  THE NEXT PAGE IS THE COMBAT RESULTS TABLE
  1826. X       basically the attacker wants a high roll and the defender wants low.
  1827. X+          The table is based on a roll between 0 and 200 (it does NOT use true
  1828. X+          percentages).  The number given is the percent loss, which is modified
  1829. X+          by the armies attack or defensive bonus.  Retreats are based on the
  1830. X+          relative losses taken by a given side.
  1831. X  END
  1832. 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
  1833. X      <--010     20% 40% 50% 60% 70% 80% 90% 100%100%100%110%120%120%130%130%
  1834. X***************
  1835. X*** 526,532
  1836. X      Storms        XSTORMS      Volcanos    XVULCANIZE
  1837. X      Npc Nations     XNPC      PC Automove    XCMOVE
  1838. X      Random Events    XRANEVENT      Orc Takeovers    XORCTAKE
  1839. X!     Super God    XOGOD
  1840. X  END
  1841. X                      ADDITIONAL OPTIONS
  1842. X  
  1843. X
  1844. X--- 548,555 -----
  1845. X      Storms        XSTORMS      Volcanos    XVULCANIZE
  1846. X      Npc Nations     XNPC      PC Automove    XCMOVE
  1847. X      Random Events    XRANEVENT      Orc Takeovers    XORCTAKE
  1848. X!     Super God    XOGOD      Hidden News    XHIDELOC
  1849. X!     Trading        XTRADE
  1850. X  END
  1851. X                      ADDITIONAL OPTIONS
  1852. X  
  1853. X*** oldREADME    Wed Jul 13 09:55:50 1988
  1854. X--- README    Wed Jul 13 09:56:17 1988
  1855. X*** oldrun    Wed Jul 13 09:56:00 1988
  1856. X--- run    Wed Jul 13 09:56:17 1988
  1857. X
  1858. X
  1859. END_OF_FILE
  1860. if test 31526 -ne `wc -c <'patches03'`; then
  1861.     echo shar: \"'patches03'\" unpacked with wrong size!
  1862. fi
  1863. # end of 'patches03'
  1864. fi
  1865. echo shar: End of shell archive.
  1866. exit 0
  1867.