home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume6 / conquer4 / patch3c < prev    next >
Internet Message Format  |  1989-07-20  |  59KB

  1. Path: uunet!zephyr!tektronix!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v07i054:  conquer4 - middle earth multi-player game (V4), Patch3c
  5. Message-ID: <4293@tekred.CNA.TEK.COM>
  6. Date: 19 Jul 89 17:58:35 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2144
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@bu-cs.bu.edu>
  12. Posting-number: Volume 7, Issue 54
  13. Archive-name: conquer4/Patch3c
  14. Patch-To: conquer4: Volume 6, Issue 83-97
  15.  
  16.  
  17.  
  18. #!/bin/sh
  19. # this is part 3 of a multipart archive
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file patchV4.03 continued
  22. #
  23. CurArch=3
  24. if test ! -r s2_seq_.tmp
  25. then echo "Please unpack part 1 first!"
  26.      exit 1; fi
  27. ( read Scheck
  28.   if test "$Scheck" != $CurArch
  29.   then echo "Please unpack part $Scheck next!"
  30.        exit 1;
  31.   else exit 0; fi
  32. ) < s2_seq_.tmp || exit 1
  33. sed 's/^X//' << 'SHAR_EOF' >> patchV4.03
  34. X      return(Attr);
  35. X  }
  36. X- 
  37. X  /****************************************************************/
  38. X  /*    ARMYMOVE()                         */
  39. X  /* armymove moves an army... and returns the # of sectors taken    */
  40. X--- 217,222 ----
  41. X***************
  42. X*** 227,232 ****
  43. X--- 226,234 ----
  44. X  int armynum;
  45. X  {
  46. X      long        sum, where;
  47. X+ #ifdef XENIX
  48. X+     register int z;
  49. X+ #endif /*XENIX*/
  50. X      register int    x, y;
  51. X      int    i;
  52. X      long    menok;            /* enough men in the army? */
  53. X***************
  54. X*** 336,348 ****
  55. X                  if((sct[x][y].designation != DCITY)
  56. X                  &&(sct[x][y].designation != DCAPITOL)
  57. X                  &&(sct[x][y].designation != DTOWN)
  58. X!                 &&(sct[x][y].owner==country))
  59. X                      attr[x][y] /= 8;
  60. X! 
  61. X                  if(sct[x][y].owner==0){
  62. X                      sct[x][y].owner=country;
  63. X                      curntn->popularity++;
  64. X                      attr[x][y]/=8;
  65. X                      takesctr++;
  66. X                  }
  67. X          
  68. X--- 338,362 ----
  69. X                  if((sct[x][y].designation != DCITY)
  70. X                  &&(sct[x][y].designation != DCAPITOL)
  71. X                  &&(sct[x][y].designation != DTOWN)
  72. X!                 &&(sct[x][y].owner==country)) {
  73. X! #ifdef XENIX
  74. X!                     z = attr[x][y];
  75. X!                     z /= 8;
  76. X!                     attr[x][y] = z;
  77. X! #else
  78. X                      attr[x][y] /= 8;
  79. X! #endif /*XENIX*/
  80. X!                 }
  81. X                  if(sct[x][y].owner==0){
  82. X                      sct[x][y].owner=country;
  83. X                      curntn->popularity++;
  84. X+ #ifdef XENIX
  85. X+                     z = attr[x][y];
  86. X+                     z /= 8;
  87. X+                     attr[x][y] = z;
  88. X+ #else
  89. X                      attr[x][y]/=8;
  90. X+ #endif /*XENIX*/
  91. X                      takesctr++;
  92. X                  }
  93. X          
  94. X***************
  95. X*** 476,481 ****
  96. X--- 490,496 ----
  97. X  }
  98. X  #endif CHEAT
  99. X  
  100. X+ 
  101. X  /****************************************************************/
  102. X  /*    UPDEXECS()                         */
  103. X  /* update all nations in a random order                */
  104. X***************
  105. X*** 485,492 ****
  106. X  updexecs()
  107. X  {
  108. X      register struct s_sector    *sptr;
  109. X!     register int i, j;
  110. X!     register int x,y;
  111. X      int    armynum;
  112. X      int moved,done,loop=0,number=0;
  113. X  
  114. X--- 500,509 ----
  115. X  updexecs()
  116. X  {
  117. X      register struct s_sector    *sptr;
  118. X!     register int i, j, x, y;
  119. X! #ifdef XENIX
  120. X!     register int z;
  121. X! #endif /*XENIX*/
  122. X      int    armynum;
  123. X      int moved,done,loop=0,number=0;
  124. X  
  125. X***************
  126. X*** 530,535 ****
  127. X--- 547,553 ----
  128. X          /*if execute is 0 and PC nation then they did not move*/
  129. X          if((execute(TRUE)==0)&&(ispc(curntn->active))){
  130. X              printf("\tnation %s did not move\n",curntn->name);
  131. X+ #ifdef NPC
  132. X  #ifdef CMOVE
  133. X              printf("\tthe computer will move for %s\n",curntn->name);
  134. X              fprintf(fnews,"1.\tthe computer will move for %s\n",curntn->name);
  135. X***************
  136. X*** 536,552 ****
  137. X              mailopen( country );
  138. X              fprintf(fm,"the computer moved for you (%s) in %s of Year %d\n",curntn->name,PSEASON(TURN),YEAR(TURN));
  139. X              mailclose();
  140. X!     check();
  141. X              nationrun();
  142. X!     check();
  143. X! #endif CMOVE
  144. X          }
  145. X- #ifdef NPC
  146. X-     check();
  147. X          /* run npc nations */
  148. X          if(isnpc(curntn->active)) {
  149. X              nationrun();
  150. X!     check();
  151. X  #ifdef ORCTAKE
  152. X              /*do npc nation magic*/
  153. X              if(magic(country,MA_MONST)==TRUE) {
  154. X--- 554,569 ----
  155. X              mailopen( country );
  156. X              fprintf(fm,"the computer moved for you (%s) in %s of Year %d\n",curntn->name,PSEASON(TURN),YEAR(TURN));
  157. X              mailclose();
  158. X!             check();
  159. X              nationrun();
  160. X!             check();
  161. X! #endif /*CMOVE*/
  162. X          }
  163. X          /* run npc nations */
  164. X          if(isnpc(curntn->active)) {
  165. X+             check();
  166. X              nationrun();
  167. X!             check();
  168. X  #ifdef ORCTAKE
  169. X              /*do npc nation magic*/
  170. X              if(magic(country,MA_MONST)==TRUE) {
  171. X***************
  172. X*** 560,567 ****
  173. X                  printf("SUCCESSFUL TAKEOVER OF %d by %s",x,curntn->name);
  174. X              }
  175. X  #endif ORCTAKE
  176. X          }
  177. X- #endif NPC
  178. X  
  179. X          /* is leader killed - put nation into dissarray */
  180. X          x = getleader((int)curntn->class) - 1;
  181. X--- 577,584 ----
  182. X                  printf("SUCCESSFUL TAKEOVER OF %d by %s",x,curntn->name);
  183. X              }
  184. X  #endif ORCTAKE
  185. X+ #endif /*NPC*/
  186. X          }
  187. X  
  188. X          /* is leader killed - put nation into dissarray */
  189. X          x = getleader((int)curntn->class) - 1;
  190. X***************
  191. X*** 642,648 ****
  192. X              if(ONMAP(i,j)){
  193. X                  if( sct[i][j].owner != country)
  194. X                      continue;
  195. X!                 moved=(sptr->people*attr[i][j]-sct[i][j].people*attr[x][y])/(1+5*(attr[i][j]+attr[x][y]));
  196. X                  if( moved <= 0 ) continue;
  197. X  
  198. X                  sct[i][j].people += moved;
  199. X--- 659,666 ----
  200. X              if(ONMAP(i,j)){
  201. X                  if( sct[i][j].owner != country)
  202. X                      continue;
  203. X!                 moved=(sptr->people*attr[i][j]-sct[i][j].people*attr[x][y]);
  204. X!                 moved /= (1+5*(attr[i][j]+attr[x][y]));
  205. X                  if( moved <= 0 ) continue;
  206. X  
  207. X                  sct[i][j].people += moved;
  208. X***************
  209. X*** 655,661 ****
  210. X--- 673,685 ----
  211. X      for(country=1;country<NTOTAL;country++) if(isntn(ntn[country].active)){
  212. X          ntn[country].tships=0;
  213. X          ntn[country].tmil=0;
  214. X+ #ifdef XENIX
  215. X+         z = ntn[country].spellpts;
  216. X+         z /= 2;
  217. X+         ntn[country].spellpts = z;
  218. X+ #else
  219. X          if(rand()%4==0) ntn[country].spellpts/=2;
  220. X+ #endif /*XENIX*/
  221. X          if(magic(country,SUMMON)==TRUE) {
  222. X              ntn[country].spellpts+=4;
  223. X              if(magic(country,WYZARD)==TRUE)
  224. X***************
  225. X*** 678,683 ****
  226. X--- 702,710 ----
  227. X  void
  228. X  do_lizard()
  229. X  {
  230. X+ #ifdef XENIX
  231. X+     register int x;
  232. X+ #endif /*XENIX*/
  233. X      register int i, j;
  234. X      int armynum;
  235. X  
  236. X***************
  237. X*** 686,693 ****
  238. X      for(armynum=0;armynum<MAXARM;armynum++)
  239. X      if((P_ASOLD>0)) {
  240. X          P_AMOVE =20;    /* just in case god wants to move them */
  241. X!         P_ASOLD*=102;    /* increase population */
  242. X          P_ASOLD/=100;
  243. X          if(armynum%2==0) {
  244. X              if(P_ASTAT!=SIEGED) P_ASTAT=GARRISON;
  245. X          } else {
  246. X--- 713,727 ----
  247. X      for(armynum=0;armynum<MAXARM;armynum++)
  248. X      if((P_ASOLD>0)) {
  249. X          P_AMOVE =20;    /* just in case god wants to move them */
  250. X!         /* increase population */
  251. X! #ifdef XENIX
  252. X!         x = P_ASOLD * 102;
  253. X!         x /= 100;
  254. X!         P_ASOLD = x;
  255. X! #else
  256. X!         P_ASOLD*=102;
  257. X          P_ASOLD/=100;
  258. X+ #endif /*XENIX*/
  259. X          if(armynum%2==0) {
  260. X              if(P_ASTAT!=SIEGED) P_ASTAT=GARRISON;
  261. X          } else {
  262. X***************
  263. X*** 1333,1340 ****
  264. X--- 1367,1381 ----
  265. X          }
  266. X          /*this state can occur if few people live in cities*/
  267. X          if(curntn->tfood<0) curntn->tfood=0L;
  268. X+ #ifdef XENIX
  269. X+         xx = curntn->tfood;
  270. X+         xx *= (100-curntn->spoilrate);
  271. X+         xx /= 100;
  272. X+         curntn->tfood = xx;
  273. X+ #else
  274. X          curntn->tfood *= (100-curntn->spoilrate);
  275. X          curntn->tfood /= 100;
  276. X+ #endif /*XENIX*/
  277. X  
  278. X          if(curntn->tgold>GOLDTHRESH*curntn->jewels){
  279. X              /* buy jewels off commodities board */
  280. X*** ocommands.c    Tue Jul 18 22:04:40 1989
  281. X--- commands.c    Tue Jul 18 22:05:00 1989
  282. X***************
  283. X*** 53,59 ****
  284. X      &&((desg!=DCAPITOL && sptr->designation==DCITY)
  285. X      ||sptr->designation==DCAPITOL)) {
  286. X          if(prtflag) {
  287. X!             char buf[80];
  288. X              sprintf(buf,"Must first burn down city/capitol (designate as '%c')",DRUIN);
  289. X              errormsg(buf);
  290. X          }
  291. X--- 53,59 ----
  292. X      &&((desg!=DCAPITOL && sptr->designation==DCITY)
  293. X      ||sptr->designation==DCAPITOL)) {
  294. X          if(prtflag) {
  295. X!             char buf[LINELTH+1];
  296. X              sprintf(buf,"Must first burn down city/capitol (designate as '%c')",DRUIN);
  297. X              errormsg(buf);
  298. X          }
  299. X***************
  300. X*** 189,196 ****
  301. X                  return;
  302. X              }
  303. X              sptr->vegetation=newdes;
  304. X!             if(tofood(sptr,0)!=0)
  305. X!                 sptr->designation=newdes;
  306. X              reset_god();
  307. X              return;
  308. X          case 'o':
  309. X--- 189,197 ----
  310. X                  return;
  311. X              }
  312. X              sptr->vegetation=newdes;
  313. X!             if( tofood(sptr,0) < DESFOOD )
  314. X!                 sptr->designation=DNODESIG;
  315. X!             else sptr->designation=newdes;
  316. X              reset_god();
  317. X              return;
  318. X          case 'o':
  319. X***************
  320. X*** 445,451 ****
  321. X  
  322. X              if (P_NCREW==SHIPCREW) {
  323. X                  errormsg("You may only &^#$! repair damaged fleets!!!");
  324. X-                 if(isgod==TRUE) reset_god();
  325. X                  return;
  326. X              }
  327. X              clear_bottom(0);
  328. X--- 446,451 ----
  329. X***************
  330. X*** 458,463 ****
  331. X--- 458,468 ----
  332. X              clrtoeol();
  333. X              refresh();
  334. X              amount = (short) get_number();
  335. X+             if (amount<0) {
  336. X+                 if(isgod==TRUE) reset_god();
  337. X+                 return;
  338. X+             }
  339. X+                     
  340. X  
  341. X              /* find cost of repairs on all ships */
  342. X              cost = 0;
  343. X***************
  344. X*** 600,606 ****
  345. X  
  346. X          /*sanity checks*/
  347. X          if((amount>N_MASK)) amount=0;
  348. X!         if (amount==0)
  349. X          {
  350. X              if(isgod==TRUE) reset_god();
  351. X              return;
  352. X--- 605,611 ----
  353. X  
  354. X          /*sanity checks*/
  355. X          if((amount>N_MASK)) amount=0;
  356. X!         if (amount<=0)
  357. X          {
  358. X              if(isgod==TRUE) reset_god();
  359. X              return;
  360. X***************
  361. X*** 1023,1032 ****
  362. X      int count,msglen;
  363. X      int contd;
  364. X      int done=FALSE;
  365. X!     char tempfile[ 30 ];
  366. X!     char mesgfile[ 30 ];
  367. X!     char line[80], inpch;
  368. X!     char save[50][80];
  369. X  
  370. X      /*open file*/
  371. X      sprintf(tempfile,"%s%hd.tmp",msgfile,country);
  372. X--- 1028,1037 ----
  373. X      int count,msglen;
  374. X      int contd;
  375. X      int done=FALSE;
  376. X!     char tempfile[FILELTH];
  377. X!     char mesgfile[FILELTH];
  378. X!     char line[LINELTH+1], inpch;
  379. X!     char save[LINELTH][LINELTH+1];
  380. X  
  381. X      /*open file*/
  382. X      sprintf(tempfile,"%s%hd.tmp",msgfile,country);
  383. X***************
  384. X*** 1050,1056 ****
  385. X      }
  386. X  
  387. X      /*read in file a line at at time*/
  388. X!     if(fgets(line,80,mesgfp)==NULL) {
  389. X          done=TRUE;
  390. X          redraw=FALSE;
  391. X          clear_bottom(0);
  392. X--- 1055,1061 ----
  393. X      }
  394. X  
  395. X      /*read in file a line at at time*/
  396. X!     if(fgets(line,LINELTH,mesgfp)==NULL) {
  397. X          done=TRUE;
  398. X          redraw=FALSE;
  399. X          clear_bottom(0);
  400. X***************
  401. X*** 1066,1072 ****
  402. X          standout();
  403. X          /*print to end of message*/
  404. X          while(contd==FALSE) {
  405. X!             if(msglen<50) strcpy(save[msglen],line);
  406. X              if(count==LINES-3) {
  407. X                  standout();
  408. X                  mvaddstr(LINES-3,(COLS/2)-8,"--- more ---");
  409. X--- 1071,1077 ----
  410. X          standout();
  411. X          /*print to end of message*/
  412. X          while(contd==FALSE) {
  413. X!             if(msglen<LINELTH) strcpy(save[msglen],line);
  414. X              if(count==LINES-3) {
  415. X                  standout();
  416. X                  mvaddstr(LINES-3,(COLS/2)-8,"--- more ---");
  417. X***************
  418. X*** 1080,1086 ****
  419. X              standend();
  420. X              count++;
  421. X              msglen++;
  422. X!             if(fgets(line,80,mesgfp)==NULL) contd=TRUE;
  423. X              if(strncmp(line,"END",3)==0) contd=TRUE;
  424. X          }
  425. X          standout();
  426. X--- 1085,1091 ----
  427. X              standend();
  428. X              count++;
  429. X              msglen++;
  430. X!             if(fgets(line,LINELTH,mesgfp)==NULL) contd=TRUE;
  431. X              if(strncmp(line,"END",3)==0) contd=TRUE;
  432. X          }
  433. X          standout();
  434. X***************
  435. X*** 1094,1100 ****
  436. X              strcpy(line,"END\n");
  437. X              fputs(line,fptemp);
  438. X          }
  439. X!         if(fgets(line,80,mesgfp)==NULL) done=TRUE;
  440. X      }
  441. X      fclose(mesgfp);
  442. X      fclose(fptemp);
  443. X--- 1099,1105 ----
  444. X              strcpy(line,"END\n");
  445. X              fputs(line,fptemp);
  446. X          }
  447. X!         if(fgets(line,LINELTH,mesgfp)==NULL) done=TRUE;
  448. X      }
  449. X      fclose(mesgfp);
  450. X      fclose(fptemp);
  451. X***************
  452. X*** 1116,1122 ****
  453. X      char name[NAMELTH+1];
  454. X      int temp=(-1);
  455. X      int linedone;
  456. X!     char line[100];
  457. X  
  458. X      /*what nation to send to*/
  459. X      clear();
  460. X--- 1121,1127 ----
  461. X      char name[NAMELTH+1];
  462. X      int temp=(-1);
  463. X      int linedone;
  464. X!     char line[BIGLTH];
  465. X  
  466. X      /*what nation to send to*/
  467. X      clear();
  468. X***************
  469. X*** 1184,1190 ****
  470. X                  refresh();
  471. X                  ch=getch();
  472. X              } else if (ch==' ') {
  473. X!                 refresh();
  474. X                  ch=getch();
  475. X              } else    ch=getch();
  476. X          }
  477. X--- 1189,1195 ----
  478. X                  refresh();
  479. X                  ch=getch();
  480. X              } else if (ch==' ') {
  481. X!                 wrefresh(stdscr);
  482. X                  ch=getch();
  483. X              } else    ch=getch();
  484. X          }
  485. X***************
  486. X*** 1236,1243 ****
  487. X      clrtoeol();
  488. X      refresh();
  489. X      people = get_number();
  490. X!     if((people<0)
  491. X!     ||(people>sct[XREAL][YREAL].people)
  492. X      ||(people*50>curntn->tgold)){
  493. X          errormsg("Sorry...Input error or you do not have the gold talons");
  494. X          makebottom();
  495. X--- 1241,1250 ----
  496. X      clrtoeol();
  497. X      refresh();
  498. X      people = get_number();
  499. X!     if (people <= 0) {
  500. X!         return;
  501. X!     }
  502. X!     if((people>sct[XREAL][YREAL].people)
  503. X      ||(people*50>curntn->tgold)){
  504. X          errormsg("Sorry...Input error or you do not have the gold talons");
  505. X          makebottom();
  506. X***************
  507. X*** 1250,1255 ****
  508. X--- 1257,1265 ----
  509. X      clrtoeol();
  510. X      refresh();
  511. X      i = get_number();
  512. X+     if (i < 0) {
  513. X+         return;
  514. X+     }
  515. X  
  516. X      if((i-(XREAL))>2||(i-(XREAL))<-2) {
  517. X          errormsg("sorry, can only move two sectors");
  518. X***************
  519. X*** 1261,1266 ****
  520. X--- 1271,1279 ----
  521. X      clrtoeol();
  522. X      refresh();
  523. X      j = get_number();
  524. X+     if (j < 0) {
  525. X+         return;
  526. X+     }
  527. X      if((j-(YREAL)>2)||((YREAL)-j>2)) {
  528. X          errormsg("sorry, can only move two sectors");
  529. X      }
  530. X*** oio.c    Tue Jul 18 22:04:41 1989
  531. X--- io.c    Tue Jul 18 22:05:01 1989
  532. X***************
  533. X*** 73,78 ****
  534. X--- 73,96 ----
  535. X      }
  536. X  }
  537. X  #endif ADMIN
  538. X+ #ifdef ADMIN
  539. X+ /************************************************************************/
  540. X+ /*    PR_DESG() - print designations                    */
  541. X+ /************************************************************************/
  542. X+ void
  543. X+ pr_desg()
  544. X+ {
  545. X+     register int X, Y;
  546. X+     fprintf(stderr,"doing print of designations\n");
  547. X+     for(Y=0;Y<MAPY;Y++) {
  548. X+         for(X=0;X<MAPX;X++) {
  549. X+             putc(sct[X][Y].designation,stdout);
  550. X+             
  551. X+         }
  552. X+         putc('\n',stdout);
  553. X+     }
  554. X+ }
  555. X+ #endif ADMIN
  556. X  
  557. X  /************************************************************************/
  558. X  /*    WRITEDATA() - write data to datafile                 */
  559. X***************
  560. X*** 270,276 ****
  561. X      int nationid;     /*current nation id */
  562. X  #ifdef TIMELOG
  563. X      FILE *timefp, *fopen();
  564. X!     char timestr[80];
  565. X  #endif /* TIMELOG */
  566. X  
  567. X      printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
  568. X--- 288,294 ----
  569. X      int nationid;     /*current nation id */
  570. X  #ifdef TIMELOG
  571. X      FILE *timefp, *fopen();
  572. X!     char timestr[LINELTH+1];
  573. X  #endif /* TIMELOG */
  574. X  
  575. X      printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
  576. X***************
  577. X*** 284,301 ****
  578. X  #endif /* TIMELOG */
  579. X      printf("id      name   race    class    align  score    talons military  civilians sect\n");
  580. X      for (nationid=1; nationid<NTOTAL; nationid++) {
  581. X!         if(!isntn(ntn[nationid].active)) continue;
  582. X          printf("%2d ",nationid);
  583. X          printf("%9s ",ntn[nationid].name);
  584. X!         for(i=1;i<8;i++)
  585. X!             if(ntn[nationid].race==*(races+i)[0])
  586. X!                 printf("%6s ",*(races+i));
  587. X!         printf("%8s ",*(Class+ntn[nationid].class));
  588. X!          printf(" %7s ",allignment[npctype(ntn[nationid].active)]);
  589. X!            printf("%6ld  %8ld %8ld   %8ld %4d\n",
  590. X!             ntn[nationid].score ,ntn[nationid].tgold
  591. X!             ,ntn[nationid].tmil ,ntn[nationid].tciv
  592. X!             ,ntn[nationid].tsctrs );
  593. X      }
  594. X  }
  595. X  #endif CONQUER
  596. X--- 302,336 ----
  597. X  #endif /* TIMELOG */
  598. X      printf("id      name   race    class    align  score    talons military  civilians sect\n");
  599. X      for (nationid=1; nationid<NTOTAL; nationid++) {
  600. X!         if(!isactive(ntn[nationid].active)) continue;
  601. X          printf("%2d ",nationid);
  602. X          printf("%9s ",ntn[nationid].name);
  603. X!         /* this check for old 'B' for barbarians; removed eventually */
  604. X!         if (ntn[nationid].race=='B') {
  605. X!             printf("%6s ", "SAVAGE");
  606. X!         } else {
  607. X!             for(i=1;(*(races+i)[0])!='U';i++)
  608. X!                 if(ntn[nationid].race==*(races+i)[0])
  609. X!                     printf("%6s ",*(races+i));
  610. X!         }
  611. X! 
  612. X!         if (isntn(ntn[nationid].active)) {
  613. X!             printf("%8s ",*(Class+ntn[nationid].class));
  614. X!             printf(" %7s ",allignment[npctype(ntn[nationid].active)]);
  615. X!             printf("%6ld  %8ld %8ld   %8ld %4d\n",
  616. X!                   ntn[nationid].score ,ntn[nationid].tgold
  617. X!                   ,ntn[nationid].tmil ,ntn[nationid].tciv
  618. X!                   ,ntn[nationid].tsctrs );
  619. X!         } else {
  620. X!             if (ispeasant(ntn[nationid].active)) {
  621. X!                 printf("%8s  %7s ","Peasant","Neutral");
  622. X!                 /* info not kept track of yet */
  623. X!             } else {
  624. X!                 printf("%8s  %7s ","Monster","Other");
  625. X!             }
  626. X!             printf("%6s  %8s %8s   %8s %4s\n",
  627. X!                   "---","-----","----","-----","--");
  628. X!         }
  629. X      }
  630. X  }
  631. X  #endif CONQUER
  632. X***************
  633. X*** 386,392 ****
  634. X  readmap()
  635. X  {
  636. X      FILE    *mapfile;
  637. X!     char    line[128];
  638. X      register int x,y;
  639. X  
  640. X      /* read in ele.map */
  641. X--- 421,427 ----
  642. X  readmap()
  643. X  {
  644. X      FILE    *mapfile;
  645. X!     char    line[BIGLTH+1];
  646. X      register int x,y;
  647. X  
  648. X      /* read in ele.map */
  649. X***************
  650. X*** 415,421 ****
  651. X      } else fprintf(stderr,"reading vegetation map file from %s\n",line );
  652. X      y=0;
  653. X      while( TRUE ) {
  654. X!         if(fgets( line, 128, mapfile )==NULL) break;
  655. X          for(x=0;x<MAPX;x++) sct[x][y].vegetation = line[x];
  656. X          y++;
  657. X          if(y>=MAPY) break;
  658. X--- 450,456 ----
  659. X      } else fprintf(stderr,"reading vegetation map file from %s\n",line );
  660. X      y=0;
  661. X      while( TRUE ) {
  662. X!         if(fgets( line, BIGLTH, mapfile )==NULL) break;
  663. X          for(x=0;x<MAPX;x++) sct[x][y].vegetation = line[x];
  664. X          y++;
  665. X          if(y>=MAPY) break;
  666. X*** onewhelp.c    Tue Jul 18 22:04:43 1989
  667. X--- newhelp.c    Tue Jul 18 22:05:01 1989
  668. X***************
  669. X*** 44,49 ****
  670. X--- 44,50 ----
  671. X      fprintf(fp,"s/XTRADEPCT/%d/g\n",TRADEPCT);
  672. X      fprintf(fp,"s/XMAXNAVY/%d/g\n",MAXNAVY);
  673. X      fprintf(fp,"s/XBREAKJIHAD/%ld/g\n",BREAKJIHAD);
  674. X+     fprintf(fp,"s/XCONQENV/%s/g\n",ENVIRON_OPTS);
  675. X  
  676. X      /* check all the defined options */
  677. X  #ifdef OGOD
  678. X***************
  679. X*** 74,80 ****
  680. X--- 75,87 ----
  681. X  #endif
  682. X  #ifdef NPC
  683. X      fprintf(fp,"s/XNPC/(True )/g\n");
  684. X+ #ifdef CMOVE
  685. X+     fprintf(fp,"s/XCMOVE/(True )/g\n");
  686. X  #else
  687. X+     fprintf(fp,"s/XCMOVE/(False)/g\n");
  688. X+ #endif
  689. X+ #else
  690. X+     fprintf(fp,"s/XCMOVE/(False)/g\n");
  691. X      fprintf(fp,"s/XNPC/(False)/g\n");
  692. X  #endif
  693. X  #ifdef CHEAT
  694. X***************
  695. X*** 81,91 ****
  696. X      fprintf(fp,"s/XCHEAT/(True )/g\n");
  697. X  #else
  698. X      fprintf(fp,"s/XCHEAT/(False)/g\n");
  699. X- #endif
  700. X- #ifdef CMOVE
  701. X-     fprintf(fp,"s/XCMOVE/(True )/g\n");
  702. X- #else
  703. X-     fprintf(fp,"s/XCMOVE/(False)/g\n");
  704. X  #endif
  705. X  #ifdef RANEVENT
  706. X      fprintf(fp,"s/XRANEVENT/(True )/g\n");
  707. X--- 88,93 ----
  708. X*** odata.c    Tue Jul 18 22:04:40 1989
  709. X--- data.c    Tue Jul 18 22:05:01 1989
  710. X***************
  711. X*** 63,71 ****
  712. X  "King","Baron","Emperor","Prince","Wizard","Mage",
  713. X  "Pope","Bishop","Admiral","Captain","Warlord","Lord",
  714. X  "Demon","Devil","Dragon","Wyrm","Shadow","Nazgul",
  715. X! "Spirit", "Assasin", "Efreet", "Gargoyle", "Wraith",
  716. X! "Hero", "Centaur", "Giant", "Superhero", "Mummy",
  717. X! "Elemental", "Minotaur", "Demon", "Balrog", "Dragon"
  718. X  };
  719. X  
  720. X  #ifdef CONQUER
  721. X--- 63,71 ----
  722. X  "King","Baron","Emperor","Prince","Wizard","Mage",
  723. X  "Pope","Bishop","Admiral","Captain","Warlord","Lord",
  724. X  "Demon","Devil","Dragon","Wyrm","Shadow","Nazgul",
  725. X! "Spirit", "Assasin", "Efreet", "Gargoyl", "Wraith",
  726. X! "Hero", "Centaur", "Giant", "Suphero", "Mummy",
  727. X! "Elmentl", "Mintaur", "Demon", "Balrog", "Dragon"
  728. X  };
  729. X  
  730. X  #ifdef CONQUER
  731. X***************
  732. X*** 251,260 ****
  733. X  
  734. X  #ifdef CONQUER
  735. X  #ifdef SYSMAIL
  736. X! char    sysmail[100];
  737. X  int    sys_mail_status;
  738. X  #endif SYSMAIL
  739. X! char conqmail[100];
  740. X  int    conq_mail_status;
  741. X  #endif CONQUER
  742. X  
  743. X--- 251,260 ----
  744. X  
  745. X  #ifdef CONQUER
  746. X  #ifdef SYSMAIL
  747. X! char    sysmail[FILELTH];
  748. X  int    sys_mail_status;
  749. X  #endif SYSMAIL
  750. X! char conqmail[FILELTH];
  751. X  int    conq_mail_status;
  752. X  #endif CONQUER
  753. X  
  754. X*** omagic.c    Tue Jul 18 22:04:41 1989
  755. X--- magic.c    Tue Jul 18 22:05:01 1989
  756. X***************
  757. X*** 185,191 ****
  758. X  void
  759. X  domagic()
  760. X  {
  761. X!     int count, done=FALSE, loop=0, i,type;
  762. X      long price,x;
  763. X      short isgod=0;
  764. X      if(country==0) {
  765. X--- 185,191 ----
  766. X  void
  767. X  domagic()
  768. X  {
  769. X!     int county, countx, done=FALSE, loop=0, i,type;
  770. X      long price,x;
  771. X      short isgod=0;
  772. X      if(country==0) {
  773. X***************
  774. X*** 196,210 ****
  775. X      while(done==FALSE){
  776. X          done=TRUE;
  777. X          clear();
  778. X!         count=3;
  779. X          redraw=TRUE;
  780. X          standout();
  781. X          mvprintw(0,(COLS/2)-15,"MAGIC POWERS FOR %s",curntn->name);
  782. X!         mvprintw(count++,30,"1) %d military powers: %ld jewels",
  783. X              num_powers(country,M_MIL) ,getmgkcost(M_MIL,country));
  784. X!         mvprintw(count++,30,"2) %d civilian powers: %ld jewels",
  785. X              num_powers(country,M_CIV) ,getmgkcost(M_CIV,country));
  786. X!         mvprintw(count++,30,"3) %d magic powers:    %ld jewels",
  787. X              num_powers(country,M_MGK),getmgkcost(M_MGK,country));
  788. X  
  789. X          price =  getmgkcost(M_MIL,country);
  790. X--- 196,211 ----
  791. X      while(done==FALSE){
  792. X          done=TRUE;
  793. X          clear();
  794. X!         county=3;
  795. X!         countx=0;
  796. X          redraw=TRUE;
  797. X          standout();
  798. X          mvprintw(0,(COLS/2)-15,"MAGIC POWERS FOR %s",curntn->name);
  799. X!         mvprintw(county++,30,"1) %d military powers: %ld jewels",
  800. X              num_powers(country,M_MIL) ,getmgkcost(M_MIL,country));
  801. X!         mvprintw(county++,30,"2) %d civilian powers: %ld jewels",
  802. X              num_powers(country,M_CIV) ,getmgkcost(M_CIV,country));
  803. X!         mvprintw(county++,30,"3) %d magic powers:    %ld jewels",
  804. X              num_powers(country,M_MGK),getmgkcost(M_MGK,country));
  805. X  
  806. X          price =  getmgkcost(M_MIL,country);
  807. X***************
  808. X*** 217,243 ****
  809. X  #endif OGOD
  810. X  
  811. X          standend();
  812. X!         count=3;
  813. X          /*print the powers that you have*/
  814. X          i=0;
  815. X          while( powers[i] != 0 ){
  816. X              if(magic(country,powers[i])==TRUE)
  817. X!             mvprintw(count++,0,"you have power %s",*(pwrname+i));
  818. X              i++;
  819. X          }
  820. X  
  821. X!         if(count<=7) count=8;
  822. X!         else count++;
  823. X          standout();
  824. X!         mvprintw(count++,0,"YOU HAVE %ld JEWELS IN YOUR TREASURY",curntn->jewels);
  825. X          if(price < curntn->jewels){
  826. X!         mvaddstr(count++,0,"DO YOU WISH TO BUY A RANDOM NEW POWER (enter y or n):");
  827. X          standend();
  828. X          refresh();
  829. X-         count++;
  830. X          if(getch()=='y'){
  831. X              done=FALSE;
  832. X!             mvprintw(count++,0,"ENTER SELECTION (1,2,3):");
  833. X              refresh();
  834. X              type = getch() - '0';
  835. X              if(type==M_MIL || type==M_CIV || type==M_MGK){
  836. X--- 218,248 ----
  837. X  #endif OGOD
  838. X  
  839. X          standend();
  840. X!         county=3;
  841. X          /*print the powers that you have*/
  842. X          i=0;
  843. X          while( powers[i] != 0 ){
  844. X              if(magic(country,powers[i])==TRUE)
  845. X!             mvprintw(county++,countx,"you have power %s",*(pwrname+i));
  846. X              i++;
  847. X+             if (county > 18) {
  848. X+                 county=7;
  849. X+                 countx=40;
  850. X+             }
  851. X          }
  852. X  
  853. X!         if(county<=7) county=8;
  854. X!         else if(countx == 40) county = 20;
  855. X!         else county++;
  856. X          standout();
  857. X!         mvprintw(county++,0,"YOU HAVE %ld JEWELS IN YOUR TREASURY",curntn->jewels);
  858. X          if(price < curntn->jewels){
  859. X!         mvaddstr(county++,0,"DO YOU WISH TO BUY A RANDOM NEW POWER (enter y or n):");
  860. X          standend();
  861. X          refresh();
  862. X          if(getch()=='y'){
  863. X              done=FALSE;
  864. X!             mvprintw(county++,0,"ENTER SELECTION (1,2,3):");
  865. X              refresh();
  866. X              type = getch() - '0';
  867. X              if(type==M_MIL || type==M_CIV || type==M_MGK){
  868. X***************
  869. X*** 270,280 ****
  870. X          }
  871. X  #ifdef ORCTAKE
  872. X          if((curntn->race==ORC)&&(curntn->jewels>=ORCTAKE)&&(curntn->spellpts>=TAKEPOINTS))
  873. X!             done |= orctake(&count);
  874. X  #endif ORCTAKE
  875. X  #ifdef OGOD
  876. X          if (isgod==TRUE) {
  877. X!             mvaddstr(count++,0,"GOD: REMOVE A MAGIC POWER? (y or n)");
  878. X              refresh();
  879. X              if (getch()=='y') killmagk();
  880. X          }
  881. X--- 275,285 ----
  882. X          }
  883. X  #ifdef ORCTAKE
  884. X          if((curntn->race==ORC)&&(curntn->jewels>=ORCTAKE)&&(curntn->spellpts>=TAKEPOINTS))
  885. X!             done |= orctake(&county);
  886. X  #endif ORCTAKE
  887. X  #ifdef OGOD
  888. X          if (isgod==TRUE) {
  889. X!             mvaddstr(county++,0,"GOD: REMOVE A MAGIC POWER? (y or n)");
  890. X              refresh();
  891. X              if (getch()=='y') killmagk();
  892. X          }
  893. X***************
  894. X*** 492,498 ****
  895. X      int x,count,i,armynum;
  896. X      long e_cost;
  897. X      int newtype,s_cost;
  898. X!     char line[80],ch;
  899. X  
  900. X      x=0;
  901. X      count=LINES-4;
  902. X--- 497,503 ----
  903. X      int x,count,i,armynum;
  904. X      long e_cost;
  905. X      int newtype,s_cost;
  906. X!     char line[LINELTH+1],ch;
  907. X  
  908. X      x=0;
  909. X      count=LINES-4;
  910. X***************
  911. X*** 809,818 ****
  912. X  /* killmagk: this routine removes a magic power */
  913. X  killmagk()
  914. X  {
  915. X!     int count,choice,i;
  916. X  
  917. X      clear();
  918. X!     count=3;
  919. X      standout();
  920. X      mvprintw(0,(COLS/2)-15,"MAGIC POWERS FOR %s",curntn->name);
  921. X      standend();
  922. X--- 814,824 ----
  923. X  /* killmagk: this routine removes a magic power */
  924. X  killmagk()
  925. X  {
  926. X!     int county,countx,choice,i;
  927. X  
  928. X      clear();
  929. X!     county=3;
  930. X!     countx=0;
  931. X      standout();
  932. X      mvprintw(0,(COLS/2)-15,"MAGIC POWERS FOR %s",curntn->name);
  933. X      standend();
  934. X***************
  935. X*** 819,837 ****
  936. X      i=0;
  937. X      while( powers[i] != 0 ){
  938. X          if(magic(country,powers[i])==TRUE) {
  939. X!             mvprintw(count,0,"%d: power %s",i+1,*(pwrname+i));
  940. X!             count++;
  941. X          }
  942. X          i++;
  943. X      }
  944. X!     count++;
  945. X      standout();
  946. X!     mvaddstr(count++,5," Which power to remove? ");
  947. X      standend();
  948. X      refresh();
  949. X      choice=get_number();
  950. X!     if(choice!=0) {
  951. X!         mvprintw(count++,0," Remove magic #%d? (y or [n])",choice);
  952. X          refresh();
  953. X          if (getch()=='y') {
  954. X              if(magic(country,powers[choice-1])) {
  955. X--- 825,850 ----
  956. X      i=0;
  957. X      while( powers[i] != 0 ){
  958. X          if(magic(country,powers[i])==TRUE) {
  959. X!             mvprintw(county,countx,"%d: power %s",i+1,*(pwrname+i));
  960. X!             county++;
  961. X          }
  962. X          i++;
  963. X+         if (county > 18) {
  964. X+             county = 3;
  965. X+             countx = 40;
  966. X+         }
  967. X      }
  968. X!     if (countx == 40) {
  969. X!       county = 20;
  970. X!     }
  971. X!     else county++;
  972. X      standout();
  973. X!     mvaddstr(county++,5," Which power to remove? ");
  974. X      standend();
  975. X      refresh();
  976. X      choice=get_number();
  977. X!     if(choice > 0) {
  978. X!         mvprintw(county++,0," Remove magic #%d? (y or [n])",choice);
  979. X          refresh();
  980. X          if (getch()=='y') {
  981. X              if(magic(country,powers[choice-1])) {
  982. X***************
  983. X*** 855,861 ****
  984. X  wizardry()
  985. X  {
  986. X      int i,xspt,yspt,choice,armynum,s_cost;
  987. X!     char line[80];
  988. X      void dosummon();
  989. X  
  990. X      clear_bottom(0);
  991. X--- 868,874 ----
  992. X  wizardry()
  993. X  {
  994. X      int i,xspt,yspt,choice,armynum,s_cost;
  995. X!     char line[LINELTH+1];
  996. X      void dosummon();
  997. X  
  998. X      clear_bottom(0);
  999. X*** omain.c    Tue Jul 18 22:04:42 1989
  1000. X--- main.c    Tue Jul 18 22:05:02 1989
  1001. X***************
  1002. X*** 21,27 ****
  1003. X  
  1004. X  extern    int armornvy;
  1005. X  
  1006. X! char    fison[20];
  1007. X  char    *getpass();
  1008. X  struct    s_sector **sct;
  1009. X  struct    s_nation ntn[NTOTAL];    /* player nation stats */
  1010. X--- 21,27 ----
  1011. X  
  1012. X  extern    int armornvy;
  1013. X  
  1014. X! char    fison[FILELTH];
  1015. X  char    *getpass();
  1016. X  struct    s_sector **sct;
  1017. X  struct    s_nation ntn[NTOTAL];    /* player nation stats */
  1018. X***************
  1019. X*** 43,48 ****
  1020. X--- 43,49 ----
  1021. X  short    pager=0;    /* pager for selector 0,1,2,3*/
  1022. X  short    country=0;    /* nation id of owner*/
  1023. X  struct    s_nation    *curntn;
  1024. X+ short    Gaudy=FALSE;
  1025. X  int    owneruid;
  1026. X  
  1027. X  FILE *fexe, *fopen();
  1028. X***************
  1029. X*** 56,63 ****
  1030. X  char    **argv;
  1031. X  {
  1032. X      int geteuid(), getuid(), setuid();
  1033. X!     register int i;
  1034. X!     char name[NAMELTH+1],filename[80];
  1035. X      void srand(),init_hasseen();
  1036. X      int getopt();
  1037. X      char passwd[PASSLTH+1];
  1038. X--- 57,64 ----
  1039. X  char    **argv;
  1040. X  {
  1041. X      int geteuid(), getuid(), setuid();
  1042. X!     register int i,j;
  1043. X!     char name[NAMELTH+1],filename[FILELTH];
  1044. X      void srand(),init_hasseen();
  1045. X      int getopt();
  1046. X      char passwd[PASSLTH+1];
  1047. X***************
  1048. X*** 66,88 ****
  1049. X  #ifdef SYSMAIL
  1050. X      extern char sysmail[];
  1051. X  #endif SYSMAIL
  1052. X!     int sflag=FALSE;
  1053. X  
  1054. X!     char defaultdir[256],tmppass[PASSLTH+1];
  1055. X      struct passwd *getpwnam();
  1056. X      owneruid=getuid();
  1057. X-     strcpy(defaultdir, DEFAULTDIR);
  1058. X      srand((unsigned) time((long *) 0));
  1059. X      strcpy(name,"");
  1060. X  
  1061. X      /* process the command line arguments */
  1062. X!     while((i=getopt(argc,argv,"hn:d:s"))!=EOF) switch(i){
  1063. X      /* process the command line arguments */
  1064. X      case 'h': /* execute help program*/
  1065. X-         if (chdir(defaultdir)) {
  1066. X-             printf("unable to change dir to %s\n",defaultdir);
  1067. X-             exit(FAIL);
  1068. X-         }
  1069. X          initscr();
  1070. X          savetty();
  1071. X          noecho();
  1072. X--- 67,176 ----
  1073. X  #ifdef SYSMAIL
  1074. X      extern char sysmail[];
  1075. X  #endif SYSMAIL
  1076. X!     int sflag=FALSE,l;
  1077. X  
  1078. X!     char defaultdir[BIGLTH],tmppass[PASSLTH+1];
  1079. X!     char cq_opts[BIGLTH];
  1080. X      struct passwd *getpwnam();
  1081. X+ 
  1082. X      owneruid=getuid();
  1083. X      srand((unsigned) time((long *) 0));
  1084. X      strcpy(name,"");
  1085. X+     strcpy(cq_opts,"");
  1086. X  
  1087. X+     /* check conquer options */
  1088. X+     if (getenv(ENVIRON_OPTS)!=NULL) {
  1089. X+         strncpy(cq_opts, getenv(ENVIRON_OPTS), BIGLTH-1);
  1090. X+     }
  1091. X+     if (cq_opts[0] != '\0') {
  1092. X+         l = strlen(cq_opts);
  1093. X+         for(i=0; i<l; i++) {
  1094. X+             switch(cq_opts[i]) {
  1095. X+             case 'G':
  1096. X+                 /* set Gaudy display */
  1097. X+                 Gaudy = TRUE;
  1098. X+                 break;
  1099. X+             case 'N':
  1100. X+             case 'n':
  1101. X+                 /* check for nation name */
  1102. X+                 if (strncmp(cq_opts+i+1,"ation=",6)==0) {
  1103. X+                     i += 7;
  1104. X+                 } else if (strncmp(cq_opts+i+1,"ame=",4)==0) {
  1105. X+                     i += 5;
  1106. X+                 } else {
  1107. X+                     fprintf(stderr,"conquer: invalid environment\n");
  1108. X+                     fprintf(stderr,"\t%s = %s\n",ENVIRON_OPTS,cq_opts);
  1109. X+                     fprintf(stderr,"\texpected <nation=NAME>\n");
  1110. X+                     exit(FAIL);
  1111. X+                 }
  1112. X+                 if (i<l) {
  1113. X+                     /* grab the nation name */
  1114. X+                     for (j=0;j<NAMELTH&&j<l-i&&cq_opts[i+j]!=',';j++) {
  1115. X+                         name[j] = cq_opts[i+j];
  1116. X+                     }
  1117. X+                     name[j]='\0';
  1118. X+                     
  1119. X+                     /* end the parse properly */
  1120. X+                     i += j-1;
  1121. X+                     if (j==NAMELTH) {
  1122. X+                         for (;i<l && cq_opts[i]!=',';i++);
  1123. X+                     }
  1124. X+                 }
  1125. X+                 break;
  1126. X+             case 'D':
  1127. X+             case 'd':
  1128. X+                 /* check for data directory */
  1129. X+                 if (strncmp(cq_opts+i+1,"ata=",4)==0) {
  1130. X+                     i += 5;
  1131. X+                 } else if (strncmp(cq_opts+i+1,"atadir=",7)==0) {
  1132. X+                     i += 8;
  1133. X+                 } else if (strncmp(cq_opts+i+1,"irectory=",9)==0) {
  1134. X+                     i += 10;
  1135. X+                 } else if (strncmp(cq_opts+i+1,"ir=",3)==0) {
  1136. X+                     i += 4;
  1137. X+                 } else {
  1138. X+                     fprintf(stderr,"conquer: invalid environment\n");
  1139. X+                     fprintf(stderr,"\t%s = %s\n",ENVIRON_OPTS,cq_opts);
  1140. X+                     fprintf(stderr,"\texpected <data=NAME>\n");
  1141. X+                     exit(FAIL);
  1142. X+                 }
  1143. X+                 if (i<l) {
  1144. X+                     /* grab the data directory */
  1145. X+                     for (j=0; j<l-i && cq_opts[i+j]!=',';j++) {
  1146. X+                         defaultdir[j] = cq_opts[i+j];
  1147. X+                     }
  1148. X+                     defaultdir[j]='\0';
  1149. X+                     i += j-1;
  1150. X+                 }
  1151. X+                 break;
  1152. X+             case ' ':
  1153. X+             case ',':
  1154. X+                 /* ignore commas and spaces */
  1155. X+                 break;
  1156. X+             default:
  1157. X+                 /* complain */
  1158. X+                 fprintf(stderr,"conquer: invalid environment\n");
  1159. X+                 fprintf(stderr,"\t%s = %s\n",ENVIRON_OPTS,cq_opts);
  1160. X+                 fprintf(stderr,"\tunexpected option <%c>\n",cq_opts[i]);
  1161. X+                 exit(FAIL);
  1162. X+                 break;
  1163. X+             }
  1164. X+          }
  1165. X+     }
  1166. X+ 
  1167. X+     /* set the default data directory */
  1168. X+     if (defaultdir[0] == '\0') {
  1169. X+         strcpy(defaultdir, DEFAULTDIR);
  1170. X+     }
  1171. X+     if (defaultdir[0] != '/') {
  1172. X+         strcpy(cq_opts, defaultdir);
  1173. X+         sprintf(defaultdir, "%s/%s", DEFAULTDIR, cq_opts);
  1174. X+     }
  1175. X+ 
  1176. X      /* process the command line arguments */
  1177. X!     while((i=getopt(argc,argv,"hGn:d:s"))!=EOF) switch(i){
  1178. X      /* process the command line arguments */
  1179. X      case 'h': /* execute help program*/
  1180. X          initscr();
  1181. X          savetty();
  1182. X          noecho();
  1183. X***************
  1184. X*** 93,98 ****
  1185. X--- 181,189 ----
  1186. X          endwin();
  1187. X          putchar('\n');
  1188. X          exit(SUCCESS);
  1189. X+     case 'G':
  1190. X+         Gaudy = TRUE;
  1191. X+         break;
  1192. X      case 'd':
  1193. X          if(optarg[0]!='/') {
  1194. X              sprintf(defaultdir, "%s/%s", DEFAULTDIR, optarg);
  1195. X***************
  1196. X*** 107,113 ****
  1197. X          sflag++;
  1198. X          break;
  1199. X      case '?': /*  print out command line arguments */
  1200. X!         printf("Command line format: %s [-hs -d DIR -nNAT]\n",argv[0]);
  1201. X          printf("\t-n NAT   play as nation NAT\n");
  1202. X          printf("\t-h       print help text\n");
  1203. X          printf("\t-d DIR   to use play different game\n");
  1204. X--- 198,205 ----
  1205. X          sflag++;
  1206. X          break;
  1207. X      case '?': /*  print out command line arguments */
  1208. X!         printf("Command line format: %s [-Ghs -d DIR -nNAT]\n",argv[0]);
  1209. X!         printf("\t-G       gaudily highlight nation in news\n");
  1210. X          printf("\t-n NAT   play as nation NAT\n");
  1211. X          printf("\t-h       print help text\n");
  1212. X          printf("\t-d DIR   to use play different game\n");
  1213. X***************
  1214. X*** 157,171 ****
  1215. X      /* get nation name from command line or by asking user.
  1216. X      *     if you fail give name of administrator of game
  1217. X      */
  1218. X!     if (strlen(name) == 0) {
  1219. X          printf("what nation would you like to be: ");
  1220. X          gets(name);
  1221. X      }
  1222. X  #ifdef OGOD
  1223. X      if(strcmp(name,"god")==0 || strcmp(name,"unowned")==0) {
  1224. X!         if ( owneruid != (getpwnam(LOGIN))->pw_uid ){
  1225. X!             printf("sorry -- you can not login as god\n");
  1226. X!             printf("you need to be logged in as %s\n",LOGIN);
  1227. X              exit(FAIL);
  1228. X          }
  1229. X          strcpy(name,"unowned");
  1230. X--- 249,268 ----
  1231. X      /* get nation name from command line or by asking user.
  1232. X      *     if you fail give name of administrator of game
  1233. X      */
  1234. X!     if (name[0] == '\0') {
  1235. X          printf("what nation would you like to be: ");
  1236. X          gets(name);
  1237. X      }
  1238. X  #ifdef OGOD
  1239. X      if(strcmp(name,"god")==0 || strcmp(name,"unowned")==0) {
  1240. X!         if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1241. X!             (owneruid != (getpwnam(ntn[0].leader))->pw_uid )) {
  1242. X!             printf("Sorry -- you can not login as god\n");
  1243. X!             printf("you need to be logged in as %s",LOGIN);
  1244. X!             if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1245. X!                 printf(" or %s",ntn[0].leader);
  1246. X!             }
  1247. X!             printf("\n");
  1248. X              exit(FAIL);
  1249. X          }
  1250. X          strcpy(name,"unowned");
  1251. X***************
  1252. X*** 179,187 ****
  1253. X          if(strcmp(name,ntn[i].name)==0) country=i;
  1254. X  
  1255. X      if(country==(-1)) {
  1256. X!         printf("name not found\n");
  1257. X!         printf("\nfor rules type <conquer -h>");
  1258. X!         printf("\nfor more information please contact %s\n",OWNER);
  1259. X          return;
  1260. X      } else if(country==0) {
  1261. X          sprintf(filename,"%sadd",isonfile);
  1262. X--- 276,289 ----
  1263. X          if(strcmp(name,ntn[i].name)==0) country=i;
  1264. X  
  1265. X      if(country==(-1)) {
  1266. X!         printf("Sorry, name <%s> not found\n",name);
  1267. X!         printf("\nFor rules type <conquer -h>");
  1268. X!         printf("\nFor information on conquer please contact %s.",OWNER);
  1269. X!         printf("\nTo enter this campaign please send mail to %s", LOGIN);
  1270. X!         if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1271. X!             printf(" or %s",ntn[0].leader);
  1272. X!         }
  1273. X!         printf(".\n");
  1274. X          return;
  1275. X      } else if(country==0) {
  1276. X          sprintf(filename,"%sadd",isonfile);
  1277. X***************
  1278. X*** 203,211 ****
  1279. X          strncpy(passwd,crypt(tmppass,SALT),PASSLTH);
  1280. X          if((strncmp(passwd,curntn->passwd,PASSLTH)!=0)
  1281. X          &&(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)) {
  1282. X!             printf("\nsorry:");
  1283. X!             printf("\nfor rules type <conquer -h>");
  1284. X!             printf("\nfor more information on the system please contact %s\n",OWNER);
  1285. X              exit(FAIL);
  1286. X          }
  1287. X      }
  1288. X--- 305,320 ----
  1289. X          strncpy(passwd,crypt(tmppass,SALT),PASSLTH);
  1290. X          if((strncmp(passwd,curntn->passwd,PASSLTH)!=0)
  1291. X          &&(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)) {
  1292. X!             printf("\nSorry:");
  1293. X!             printf("\nFor rules type <conquer -h>");
  1294. X!             printf("\nFor information on conquer please contact %s.",
  1295. X!                 OWNER);
  1296. X!             printf("\nTo enter this campaign please send mail to %s",
  1297. X!                 LOGIN);
  1298. X!             if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1299. X!                 printf(" or %s",ntn[0].leader);
  1300. X!             }
  1301. X!             printf(".\n");
  1302. X              exit(FAIL);
  1303. X          }
  1304. X      }
  1305. X***************
  1306. X*** 241,248 ****
  1307. X          (void) aretheyon();
  1308. X      } else {
  1309. X          if(curntn->active==INACTIVE) {
  1310. X!             mvprintw(LINES-2,0,"Sorry, for some reason, your country no longer exists.");
  1311. X!             mvprintw(LINES-1,0,"If there is a problem, please contact %s.",OWNER);
  1312. X              beep();
  1313. X              refresh();
  1314. X              getch();
  1315. X--- 350,364 ----
  1316. X          (void) aretheyon();
  1317. X      } else {
  1318. X          if(curntn->active==INACTIVE) {
  1319. X!             mvprintw(LINES-3,0,"Sorry, for some reason, your country no longer exists.");
  1320. X!             mvprintw(LINES-2,0,"If there is a problem, please contact %s.",
  1321. X!                 OWNER);
  1322. X!             mvprintw(LINES-1,0,"To re-enter this campaign please send mail to %s",
  1323. X!                 LOGIN);
  1324. X!             if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1325. X!                 printw(" or %s",ntn[0].leader);
  1326. X!             }
  1327. X!             printw(".");
  1328. X              beep();
  1329. X              refresh();
  1330. X              getch();
  1331. X***************
  1332. X*** 250,256 ****
  1333. X          }
  1334. X          if(aretheyon()==TRUE) {
  1335. X              mvprintw(LINES-2,0,"Sorry, country is already logged in.");
  1336. X!             mvprintw(LINES-1,0,"Please try again later.    ");
  1337. X              beep();
  1338. X              refresh();
  1339. X              getch();
  1340. X--- 366,372 ----
  1341. X          }
  1342. X          if(aretheyon()==TRUE) {
  1343. X              mvprintw(LINES-2,0,"Sorry, country is already logged in.");
  1344. X!             mvprintw(LINES-1,0,"Please try again later.");
  1345. X              beep();
  1346. X              refresh();
  1347. X              getch();
  1348. X***************
  1349. X*** 374,380 ****
  1350. X  void
  1351. X  parse()
  1352. X  {
  1353. X!     char    name[20];
  1354. X      char    passwd[PASSLTH+1];
  1355. X      int    ocountry;
  1356. X  
  1357. X--- 490,496 ----
  1358. X  void
  1359. X  parse()
  1360. X  {
  1361. X!     char    name[LINELTH+1];
  1362. X      char    passwd[PASSLTH+1];
  1363. X      int    ocountry;
  1364. X  
  1365. X***************
  1366. X*** 512,517 ****
  1367. X--- 628,645 ----
  1368. X          curntn->tgold -= MOVECOST;
  1369. X          newspaper();
  1370. X          break;
  1371. X+     case 'o':    /*pick (crsr up)*/
  1372. X+         selector-=2;
  1373. X+         if(selector<0) {
  1374. X+             selector=SCRARM*2-2;
  1375. X+             pager--;
  1376. X+         }
  1377. X+         /*move to last army in current sector*/
  1378. X+         if (pager<0) {
  1379. X+             pager=(units_in_sector(XREAL,YREAL,country)-1)/SCRARM;
  1380. X+             selector=((units_in_sector(XREAL,YREAL,country)-1)%SCRARM)*2;
  1381. X+         }
  1382. X+         break;
  1383. X      case 'p':    /*pick*/
  1384. X          selector+=2;
  1385. X          if(selector>=SCRARM*2) {
  1386. X***************
  1387. X*** 614,620 ****
  1388. X          break;
  1389. X      case 'z':    /*login as new user */
  1390. X  #ifdef OGOD
  1391. X!         if (owneruid != (getpwnam(LOGIN))->pw_uid) break;
  1392. X  #endif
  1393. X          clear();
  1394. X          redraw=TRUE;
  1395. X--- 742,749 ----
  1396. X          break;
  1397. X      case 'z':    /*login as new user */
  1398. X  #ifdef OGOD
  1399. X!         if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1400. X!             (owneruid != (getpwnam(ntn[0].leader))->pw_uid )) break;
  1401. X  #endif
  1402. X          clear();
  1403. X          redraw=TRUE;
  1404. X***************
  1405. X*** 665,671 ****
  1406. X              break;
  1407. X          }
  1408. X  
  1409. X!         if(strcmp(fison,"START")!=0) unlink(fison);
  1410. X  
  1411. X          fclose(fexe);
  1412. X          /* open output for future printing*/
  1413. X--- 794,802 ----
  1414. X              break;
  1415. X          }
  1416. X  
  1417. X!         /* remove old lock file -- new one already made */
  1418. X!         sprintf(fison,"%s%s",isonfile,ocountry);
  1419. X!         unlink(fison);
  1420. X  
  1421. X          fclose(fexe);
  1422. X          /* open output for future printing*/
  1423. X***************
  1424. X*** 949,955 ****
  1425. X      }
  1426. X  
  1427. X      standout();
  1428. X!     if((sptr->owner==0)||(ntn[sptr->owner].active==NPC_BARBARIAN))
  1429. X          mvaddstr(LINES-12,COLS-20,"unowned");
  1430. X      else mvprintw(LINES-12,COLS-20,"owner: %s",ntn[sptr->owner].name);
  1431. X      standend();
  1432. X--- 1080,1086 ----
  1433. X      }
  1434. X  
  1435. X      standout();
  1436. X!     if((sptr->owner==0)||(ntn[sptr->owner].active==NPC_SAVAGE))
  1437. X          mvaddstr(LINES-12,COLS-20,"unowned");
  1438. X      else mvprintw(LINES-12,COLS-20,"owner: %s",ntn[sptr->owner].name);
  1439. X      standend();
  1440. X***************
  1441. X*** 1013,1019 ****
  1442. X  {
  1443. X  #ifdef TIMELOG
  1444. X      FILE *timefp, *fopen();
  1445. X!     char string[80];
  1446. X  #endif /* TIMELOG */
  1447. X  
  1448. X      clear();
  1449. X--- 1144,1150 ----
  1450. X  {
  1451. X  #ifdef TIMELOG
  1452. X      FILE *timefp, *fopen();
  1453. X!     char string[LINELTH+1];
  1454. X  #endif /* TIMELOG */
  1455. X  
  1456. X      clear();
  1457. X***************
  1458. X*** 1082,1088 ****
  1459. X  void
  1460. X  camp_info()
  1461. X  {
  1462. X!     int mercs=0,solds=0,armynum,nvynum;
  1463. X      int numarm=0,numnvy=0,numlead=0;
  1464. X  
  1465. X      clear();
  1466. X--- 1213,1219 ----
  1467. X  void
  1468. X  camp_info()
  1469. X  {
  1470. X!     int mercs=0,solds=0,armynum,nvynum,nontn=0;
  1471. X      int numarm=0,numnvy=0,numlead=0;
  1472. X  
  1473. X      clear();
  1474. X***************
  1475. X*** 1107,1121 ****
  1476. X      for(nvynum=0;nvynum<MAXNAVY;nvynum++) {
  1477. X          if (P_NWSHP!=0||P_NGSHP!=0||P_NMSHP!=0) numnvy++;
  1478. X      }
  1479. X  
  1480. X      /* global information */
  1481. X      mvprintw(7,0,"World Map Size............. %dx%d", MAPX, MAPY);
  1482. X      mvprintw(8,0,"Currently Active Nations... %d", WORLDNTN);
  1483. X!     mvprintw(9,0,"Maximum Active Nations..... %d", NTOTAL-1);
  1484. X!     mvprintw(10,0,"Land displacement to meet.. %d", MEETNTN);
  1485. X      mvprintw(11,0,"Maximum Number of Armies... %d", MAXARM);
  1486. X      mvprintw(12,0,"Maximum Number of Navies... %d", MAXNAVY);
  1487. X!     mvprintw(13,0,"Chance of Scout Capture.... %d%%", PFINDSCOUT);
  1488. X  
  1489. X      /* user information */
  1490. X      mvprintw(7,COLS-40,"Number of Leaders........... %d",numlead);
  1491. X--- 1238,1256 ----
  1492. X      for(nvynum=0;nvynum<MAXNAVY;nvynum++) {
  1493. X          if (P_NWSHP!=0||P_NGSHP!=0||P_NMSHP!=0) numnvy++;
  1494. X      }
  1495. X+     for(armynum=1;armynum<NTOTAL;armynum++) {
  1496. X+         if (ismonst(ntn[armynum].active)) nontn++;
  1497. X+     }
  1498. X  
  1499. X      /* global information */
  1500. X      mvprintw(7,0,"World Map Size............. %dx%d", MAPX, MAPY);
  1501. X      mvprintw(8,0,"Currently Active Nations... %d", WORLDNTN);
  1502. X!     mvprintw(9,0,"Maximum Active Nations..... %d", NTOTAL-nontn-1);
  1503. X!     mvprintw(10,0,"Number of Monster Nations.. %d", nontn);
  1504. X      mvprintw(11,0,"Maximum Number of Armies... %d", MAXARM);
  1505. X      mvprintw(12,0,"Maximum Number of Navies... %d", MAXNAVY);
  1506. X!     mvprintw(13,0,"Land displacement to meet.. %d", MEETNTN);
  1507. X!     mvprintw(14,0,"Chance of Scout Capture.... %d%%", PFINDSCOUT);
  1508. X  
  1509. X      /* user information */
  1510. X      mvprintw(7,COLS-40,"Number of Leaders........... %d",numlead);
  1511. X***************
  1512. X*** 1124,1129 ****
  1513. X--- 1259,1272 ----
  1514. X      mvprintw(10,COLS-40,"Total Soldiers in Nation.... %d",solds);
  1515. X      mvprintw(11,COLS-40,"Current Number of Armies.... %d",numarm);
  1516. X      mvprintw(12,COLS-40,"Current Number of Navies.... %d",numnvy);
  1517. X+ 
  1518. X+     /* other information */
  1519. X+     mvprintw(LINES-6,0,"The Diety: %s", LOGIN);
  1520. X+     if (strcmp(LOGIN,ntn[0].leader)==0) {
  1521. X+         mvprintw(LINES-5,0,"The Demi-God: [none]");
  1522. X+     } else {
  1523. X+         mvprintw(LINES-5,0,"The Demi-God: %s", ntn[0].leader);
  1524. X+     }
  1525. X  
  1526. X      standout();
  1527. X      mvaddstr(LINES-2,COLS/2-13," HIT ANY KEY TO CONTINUE");
  1528. X*** onpc.c    Tue Jul 18 22:04:43 1989
  1529. X--- npc.c    Tue Jul 18 22:05:03 1989
  1530. X***************
  1531. X*** 88,94 ****
  1532. X          curntn = &ntn[country];
  1533. X          if( curntn->active==NPC_NOMAD ) do_nomad();
  1534. X          else if( curntn->active==NPC_PIRATE ) do_pirate();
  1535. X!         else if( curntn->active==NPC_BARBARIAN ) do_barbarian();
  1536. X          else if( curntn->active==NPC_LIZARD ) do_lizard(); /* update.c */
  1537. X      }
  1538. X  }
  1539. X--- 88,94 ----
  1540. X          curntn = &ntn[country];
  1541. X          if( curntn->active==NPC_NOMAD ) do_nomad();
  1542. X          else if( curntn->active==NPC_PIRATE ) do_pirate();
  1543. X!         else if( curntn->active==NPC_SAVAGE ) do_savage();
  1544. X          else if( curntn->active==NPC_LIZARD ) do_lizard(); /* update.c */
  1545. X      }
  1546. X  }
  1547. X***************
  1548. X*** 155,166 ****
  1549. X  }
  1550. X  
  1551. X  void
  1552. X! do_barbarian()
  1553. X  {
  1554. X      short armynum;
  1555. X      int x, y;
  1556. X  
  1557. X!     printf("updating barbarian (nation %d)\n",country);
  1558. X      for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD>0){
  1559. X          P_ASTAT=ATTACK;
  1560. X          if(P_ATYPE<MINLEADER) {
  1561. X--- 155,166 ----
  1562. X  }
  1563. X  
  1564. X  void
  1565. X! do_savage()
  1566. X  {
  1567. X      short armynum;
  1568. X      int x, y;
  1569. X  
  1570. X!     printf("updating savage (nation %d)\n",country);
  1571. X      for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD>0){
  1572. X          P_ASTAT=ATTACK;
  1573. X          if(P_ATYPE<MINLEADER) {
  1574. X***************
  1575. X*** 177,184 ****
  1576. X              /*if owned & unoccupied you take & people flee*/
  1577. X              if( ((sct[x][y].owner == 0)
  1578. X              || (solds_in_sector( x, y, sct[x][y].owner) == 0))
  1579. X!             && (ntn[sct[x][y].owner].active != NPC_BARBARIAN)) {
  1580. X!                 fprintf(fnews,"3.\tbarbarians capture sector %d,%d\n",x,y);
  1581. X                  if(P_ATYPE<MINLEADER) {
  1582. X                      if(sct[x][y].owner!=0) flee(x,y,1,FALSE);
  1583. X                      sct[x][y].owner=country;
  1584. X--- 177,184 ----
  1585. X              /*if owned & unoccupied you take & people flee*/
  1586. X              if( ((sct[x][y].owner == 0)
  1587. X              || (solds_in_sector( x, y, sct[x][y].owner) == 0))
  1588. X!             && (ntn[sct[x][y].owner].active != NPC_SAVAGE)) {
  1589. X!                 fprintf(fnews,"3.\tsavages capture sector %d,%d\n",x,y);
  1590. X                  if(P_ATYPE<MINLEADER) {
  1591. X                      if(sct[x][y].owner!=0) flee(x,y,1,FALSE);
  1592. X                      sct[x][y].owner=country;
  1593. X***************
  1594. X*** 187,193 ****
  1595. X              }
  1596. X          }
  1597. X      }
  1598. X!     /* place a few new Barbarian armies */
  1599. X      for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD<=0){
  1600. X          x=(rand()%(MAPX-8))+4;
  1601. X          y=(rand()%(MAPY-8))+4;
  1602. X--- 187,193 ----
  1603. X              }
  1604. X          }
  1605. X      }
  1606. X!     /* place a few new savage armies */
  1607. X      for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD<=0){
  1608. X          x=(rand()%(MAPX-8))+4;
  1609. X          y=(rand()%(MAPY-8))+4;
  1610. X***************
  1611. X*** 1125,1131 ****
  1612. X--- 1125,1135 ----
  1613. X  void
  1614. X  n_unowned()
  1615. X  {
  1616. X+ #ifdef XENIX
  1617. X+     register int z;
  1618. X+ #else
  1619. X      register int x,y;
  1620. X+ #endif /*XENIX*/
  1621. X  
  1622. X      /* around capitol */
  1623. X      for(x=(int)curntn->capx-4;x<=(int)curntn->capx+4;x++){
  1624. X***************
  1625. X*** 1152,1158 ****
  1626. X                  attr[x][y]+=100;
  1627. X              }
  1628. X              attr[x][y] += 50*tofood(&sct[x][y],country); 
  1629. X!             if(!is_habitable(x,y)) attr[x][y] /= 5;
  1630. X          }
  1631. X      }
  1632. X  }
  1633. X--- 1156,1171 ----
  1634. X                  attr[x][y]+=100;
  1635. X              }
  1636. X              attr[x][y] += 50*tofood(&sct[x][y],country); 
  1637. X! 
  1638. X!             if(!is_habitable(x,y)) {
  1639. X! #ifdef XENIX
  1640. X!                 z = attr[x][y];
  1641. X!                 z /= 5;
  1642. X!                 attr[x][y] = z;
  1643. X! #else
  1644. X!                 attr[x][y] /= 5;
  1645. X! #endif /*XENIX*/
  1646. X!             }
  1647. X          }
  1648. X      }
  1649. X  }
  1650. X*** onewlogin.h    Tue Jul 18 22:04:43 1989
  1651. X--- newlogin.h    Tue Jul 18 22:05:03 1989
  1652. X***************
  1653. X*** 1,67 ****
  1654. X  /*conquer : Copyright (c) 1988 by Ed Barlow. */
  1655. X- /* initial starting stats */
  1656. X  
  1657. X! /*dwarf*/
  1658. X! #define    NLDGOLD        100000L
  1659. X! #define    NLDFOOD        35000L
  1660. X! #define    NLDJEWEL    15000L
  1661. X! #define    NLDMETAL    15000L
  1662. X! #define    NLDCIVIL    6000L
  1663. X! #define    NLDMILIT    1000L
  1664. X! #define    NLDREPRO    4
  1665. X! #define    NLDMMOVE    6
  1666. X! #define    NLDAPLUS    20
  1667. X! #define    NLDDPLUS    20
  1668. X  
  1669. X! /*elf*/
  1670. X! #define    NLEGOLD        100000L
  1671. X! #define    NLEFOOD        35000L
  1672. X! #define    NLEJEWEL    15000L
  1673. X! #define    NLEMETAL    15000L
  1674. X! #define    NLECIVIL    7000L
  1675. X! #define    NLEMILIT    200L
  1676. X! #define    NLEREPRO    5
  1677. X! #define    NLEMMOVE    8
  1678. X! #define    NLEAPLUS    10
  1679. X! #define    NLEDPLUS    40
  1680. X  
  1681. X! /*orc*/
  1682. X! #define    NLOGOLD        1000L
  1683. X! #define    NLOFOOD        35000L
  1684. X! #define    NLOJEWEL    15000L
  1685. X! #define    NLOMETAL    15000L
  1686. X! #define    NLOCIVIL    6000L
  1687. X! #define    NLOMILIT    2000L
  1688. X! #define    NLOREPRO    8
  1689. X! #define    NLOMMOVE    6
  1690. X! #define    NLOAPLUS    0
  1691. X! #define    NLODPLUS    0
  1692. X  
  1693. X! /*human*/
  1694. X! #define    NLHGOLD        1000L
  1695. X! #define    NLHFOOD        35000L
  1696. X! #define    NLHJEWEL    15000L
  1697. X! #define    NLHMETAL    15000L
  1698. X! #define    NLHCIVIL    6000L
  1699. X! #define    NLHMILIT    1000L
  1700. X! #define    NLHREPRO    5
  1701. X! #define    NLHMMOVE    10
  1702. X! #define    NLHAPLUS    15
  1703. X! #define    NLHDPLUS    10
  1704. X  
  1705. X! /* the purchase definitions and/or costs */
  1706. X! #define    NLPOP        1000L
  1707. X! #define    NLGOLD        100000L
  1708. X! #define    NLLOCCOST    1
  1709. X! #define    NLSOLD        900L
  1710. X! #define    NLATTACK    10
  1711. X! #define    NLDEFENCE    10
  1712. X! #define    NLREPRO_ORC    2    /* repro points per NLREPCOST for orcs */
  1713. X! #define    NLREPRO        1    /* repro points per NLREPCOST for others */
  1714. X! #define    NLREPCOST    3
  1715. X! #define    NLMOVE        2
  1716. X! #define    NLDBLCOST    1
  1717. X! #define    NLMAGIC        3
  1718. X! /* get NLEADER leaders for NLEADPT points */
  1719. X! #define    NLEADER        3
  1720. X! #define    NLEADPT        1
  1721. X--- 1,104 ----
  1722. X  /*conquer : Copyright (c) 1988 by Ed Barlow. */
  1723. X  
  1724. X! /*selection defines */
  1725. X! #define CH_PEOPLE    0
  1726. X! #define CH_TREASURY    1
  1727. X! #define CH_LOCATE    2
  1728. X! #define CH_SOLDIERS    3
  1729. X! #define CH_ATTACK    4
  1730. X! #define CH_DEFEND    5
  1731. X! #define CH_REPRO    6
  1732. X! #define CH_MOVEMENT    7
  1733. X! #define CH_MAGIC    8
  1734. X! #define CH_LEADERS    9
  1735. X! #define CH_RAWGOODS    10
  1736. X! /* how many selections there are */
  1737. X! #define CH_NUMBER    11
  1738. X  
  1739. X! /* location defines */
  1740. X! #define NLRANDOM    0
  1741. X! #define NLFAIR        1
  1742. X! #define NLGOOD        2
  1743. X  
  1744. X! /* direction defines */
  1745. X! #define ADDITION    0
  1746. X! #define SUBTRACTION    1
  1747. X  
  1748. X! /* number of units for dwarf nations */
  1749. X! #define NLDGOLD        1
  1750. X! #define NLDRAW        1
  1751. X! #define NLDCIVIL    6
  1752. X! #define NLDMILIT    2
  1753. X! #define NLDREPRO    4
  1754. X! #define NLDMMOVE    6
  1755. X! #define NLDAPLUS    20
  1756. X! #define NLDDPLUS    20
  1757. X  
  1758. X! /* number of units for elf nations */
  1759. X! #define NLEGOLD        1
  1760. X! #define NLERAW        1
  1761. X! #define NLECIVIL    7
  1762. X! #define NLEMILIT    1
  1763. X! #define NLEREPRO    5
  1764. X! #define NLEMMOVE    8
  1765. X! #define NLEAPLUS    10
  1766. X! #define NLEDPLUS    40
  1767. X! 
  1768. X! /* number of units for orc nations */
  1769. X! #define NLOGOLD        0
  1770. X! #define NLORAW        1
  1771. X! #define NLOCIVIL    8
  1772. X! #define NLOMILIT    2
  1773. X! #define NLOREPRO    8
  1774. X! #define NLOMMOVE    6
  1775. X! #define NLOAPLUS    0
  1776. X! #define NLODPLUS    0
  1777. X! 
  1778. X! /* number of units for human nations */
  1779. X! #define NLHGOLD        0
  1780. X! #define NLHRAW        1
  1781. X! #define NLHCIVIL    6
  1782. X! #define NLHMILIT    2
  1783. X! #define NLHREPRO    5
  1784. X! #define NLHMMOVE    10
  1785. X! #define NLHAPLUS    20
  1786. X! #define NLHDPLUS    10
  1787. X! 
  1788. X! /* the following has been placed in the header for clarity in configuration */
  1789. X! /* since newlogin.c is the only file to include this file, there should     */
  1790. X! /* be no problems; even though it is probably not a good idea.              */
  1791. X! 
  1792. X! /* the minimum/maximum levels for each selection */
  1793. X! int Minvalues[]= { 6, 0, 0, 1, 0, 0, 4, 6, 0, 4, 1 };
  1794. X! int Maxvalues[]= { 50, 10, 2, 20, 80, 80, 10, 30, 5, MAXARM/2, 10 };
  1795. X! 
  1796. X! /* the number of points spent on each selection */
  1797. X! int Mcost[]= { 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1 };
  1798. X! 
  1799. X! /* the number of units per cost */
  1800. X! int Munits[]= { 1, 1, 1, 1, 8, 8, 1, 2, 1, 3, 1 };
  1801. X! 
  1802. X! /* The list of corresponding values of each unit */
  1803. X! long Mvalues[]= { 1000L, 100000L, 1L, 1000L, 1L, 1L, 1L,
  1804. X!     1L, 1L, 1L, 30000L };
  1805. X! 
  1806. X! /* values for jewels and metal (food is last in array above) */
  1807. X! #define NLJEWELS    15000L
  1808. X! #define NLMETAL        15000L
  1809. X! 
  1810. X! /* the old definitions */
  1811. X! #define    ONLPOP        1000L
  1812. X! #define    ONLGOLD        100000L
  1813. X! #define    ONLLOCCOST    1
  1814. X! #define    ONLSOLD        900L
  1815. X! #define    ONLATTACK    10
  1816. X! #define    ONLDEFENCE    10
  1817. X! #define    ONLREPRO_ORC    2    /* repro points per ONLREPCOST for orcs */
  1818. X! #define    ONLREPRO    1    /* repro points per ONLREPCOST for others */
  1819. X! #define    ONLREPCOST    3
  1820. X! #define    ONLMOVE        2
  1821. X! #define    ONLDBLCOST    1
  1822. X! #define    ONLMAGIC    3
  1823. X! /* get ONLEADER leaders for ONLEADPT points */
  1824. X! #define    ONLEADER    3
  1825. X! #define    ONLEADPT    1
  1826. X*** otrade.c    Tue Jul 18 22:04:45 1989
  1827. X--- trade.c    Tue Jul 18 22:05:04 1989
  1828. X***************
  1829. X*** 166,171 ****
  1830. X--- 166,172 ----
  1831. X              mvaddstr(count++,0,"What item number do you want to purchase? ");
  1832. X              refresh();
  1833. X              holdint = get_number();
  1834. X+             if (holdint<0) break;
  1835. X              /* check for minor sales */
  1836. X              if (holdint==GETFOOD || holdint==GETMETAL || holdint==GETJEWL) {
  1837. X                  /* strange flow but less control needed */
  1838. X***************
  1839. X*** 216,221 ****
  1840. X--- 217,223 ----
  1841. X              refresh();
  1842. X              holdlong2 = 0L;
  1843. X              holdlong = (long) get_number();
  1844. X+             if (holdlong< 0L) break;
  1845. X              /* check for valid bid */
  1846. X              switch(type2[holdint]) {
  1847. X              case TDGOLD:
  1848. X***************
  1849. X*** 258,263 ****
  1850. X--- 260,266 ----
  1851. X                  mvaddstr(count++,0,"What Y position? ");
  1852. X                  refresh();
  1853. X                  holdlong2 = (long) get_number();
  1854. X+                 if (holdlong2 < 0L) break;
  1855. X                  if (checkland(BUY,(int)(holdlong),(int)(holdlong2))==NODEAL) {
  1856. X                      buysell=NODEAL;
  1857. X                  } else if (tofood( &sct[(int)holdlong][(int)holdlong2],natn[holdint]) < lvar2[holdint]) {
  1858. X***************
  1859. X*** 329,334 ****
  1860. X--- 332,338 ----
  1861. X              refresh();
  1862. X              /* find out how much commodities */
  1863. X              holdlong = (long) get_number();
  1864. X+             if (holdlong < 0) return;
  1865. X              extint = 0;
  1866. X              if (holdint< TDLAND && holdlong==0L)
  1867. X                  return;
  1868. X***************
  1869. X*** 363,368 ****
  1870. X--- 367,376 ----
  1871. X                  mvprintw(count++,0,"What Y position? ");
  1872. X                  refresh();
  1873. X                  extint = get_number();
  1874. X+                 if (extint < 0) {
  1875. X+                     buysell=NODEAL;
  1876. X+                     break;
  1877. X+                 }
  1878. X                  buysell = checkland(SELL,(int)holdlong,extint);
  1879. X                  break;
  1880. X              case TDARMY:
  1881. X***************
  1882. X*** 409,415 ****
  1883. X                      ,commodities[holdint2]);
  1884. X                  refresh();
  1885. X                  holdlong2 = (long) get_number();
  1886. X!                 if (holdlong2 == 0L) return;
  1887. X              }
  1888. X  
  1889. X              /* make sure what was bid is unusable */
  1890. X--- 417,423 ----
  1891. X                      ,commodities[holdint2]);
  1892. X                  refresh();
  1893. X                  holdlong2 = (long) get_number();
  1894. X!                 if (holdlong2 <= 0L) return;
  1895. X              }
  1896. X  
  1897. X              /* make sure what was bid is unusable */
  1898. X***************
  1899. X*** 442,447 ****
  1900. X--- 450,456 ----
  1901. X              mvaddstr(count++,0,"What item number to remove? ");
  1902. X              refresh();
  1903. X              holdint = get_number();
  1904. X+             if (holdint < 0) return;
  1905. X              if (holdint==0 || holdint>itemnum) {
  1906. X                  tradeerr("Invalid Item Number");
  1907. X                  return;
  1908. X***************
  1909. X*** 572,580 ****
  1910. X          break;
  1911. X      case 'f':
  1912. X      case 'F':
  1913. X!         /* hold=TDFOOD; */
  1914. X!         /* temporarily not allow */
  1915. X!         mvaddstr((*count)++,0," Food Trades Suspended");
  1916. X          break;
  1917. X      case 'i':
  1918. X      case 'I':
  1919. X--- 581,587 ----
  1920. X          break;
  1921. X      case 'f':
  1922. X      case 'F':
  1923. X!         hold=TDFOOD;
  1924. X          break;
  1925. X      case 'i':
  1926. X      case 'I':
  1927. X***************
  1928. X*** 594,602 ****
  1929. X          break;
  1930. X      case 's':
  1931. X      case 'S':
  1932. X!         /* hold=TDSHIP; */
  1933. X!         /* temporarily not allow */
  1934. X!         mvaddstr((*count)++,0," Ship Trades Suspended");
  1935. X          break;
  1936. X      default:
  1937. X          break;
  1938. X--- 601,607 ----
  1939. X          break;
  1940. X      case 's':
  1941. X      case 'S':
  1942. X!         hold=TDSHIP;
  1943. X          break;
  1944. X      default:
  1945. X          break;
  1946. X***************
  1947. X*** 797,803 ****
  1948. X  {
  1949. X      FILE *fp[2];
  1950. X      int count;
  1951. X!     char cname[2][12],filename[2][80];
  1952. X  
  1953. X      sprintf(filename[0],"%s%d",msgfile,cntry1);
  1954. X      sprintf(filename[1],"%s%d",msgfile,cntry2);
  1955. X--- 802,808 ----
  1956. X  {
  1957. X      FILE *fp[2];
  1958. X      int count;
  1959. X!     char cname[2][NAMELTH+1],filename[2][FILELTH];
  1960. X  
  1961. X      sprintf(filename[0],"%s%d",msgfile,cntry1);
  1962. X      sprintf(filename[1],"%s%d",msgfile,cntry2);
  1963. X*** ocheck.c    Tue Jul 18 22:04:40 1989
  1964. X--- check.c    Tue Jul 18 22:05:04 1989
  1965. X***************
  1966. X*** 147,153 ****
  1967. X  
  1968. X  #include <fcntl.h>
  1969. X  #ifdef FILELOCK
  1970. X! #include <sys/file.h>
  1971. X  #endif FILELOCK
  1972. X  
  1973. X  /*
  1974. X--- 147,159 ----
  1975. X  
  1976. X  #include <fcntl.h>
  1977. X  #ifdef FILELOCK
  1978. X! #ifdef LOCKF
  1979. X! #    include <unistd.h>
  1980. X! #    define do_lock(fd) lockf(fd,F_TLOCK,0)
  1981. X! #else
  1982. X! #    include <sys/file.h>
  1983. X! #    define do_lock(fd) flock(fd,LOCK_EX|LOCK_NB)
  1984. X! #endif
  1985. X  #endif FILELOCK
  1986. X  
  1987. X  /*
  1988. X***************
  1989. X*** 165,172 ****
  1990. X  #ifdef FILELOCK
  1991. X      int fd;
  1992. X  
  1993. X!     if ((fd=open(filename,O_CREAT,0600))!=(-1)) {
  1994. X!         if(flock(fd, LOCK_EX|LOCK_NB)==(-1)) {
  1995. X              hold=TRUE;
  1996. X          }
  1997. X          /* remove lock after checking */
  1998. X--- 171,178 ----
  1999. X  #ifdef FILELOCK
  2000. X      int fd;
  2001. X  
  2002. X!     if ((fd=open(filename,O_WRONLY|O_CREAT,0600))!=(-1)) {
  2003. X!         if(do_lock(fd)==(-1)) {
  2004. X              hold=TRUE;
  2005. X          }
  2006. X          /* remove lock after checking */
  2007. X*** onavy.c    Tue Jul 18 22:04:43 1989
  2008. X--- navy.c    Tue Jul 18 22:05:04 1989
  2009. X***************
  2010. X*** 441,447 ****
  2011. X              amount=get_number();
  2012. X              if(amount > mhold*P_NPEOP) {
  2013. X                  errormsg("There are not that many on board");
  2014. X!             } else {
  2015. X                  sct[XREAL][YREAL].people += amount;
  2016. X                  P_NPEOP=(unsigned char)((mhold*P_NPEOP-amount)/mhold);
  2017. X                  NADJHLD;
  2018. X--- 441,447 ----
  2019. X              amount=get_number();
  2020. X              if(amount > mhold*P_NPEOP) {
  2021. X                  errormsg("There are not that many on board");
  2022. X!             } else if (amount > 0) {
  2023. X                  sct[XREAL][YREAL].people += amount;
  2024. X                  P_NPEOP=(unsigned char)((mhold*P_NPEOP-amount)/mhold);
  2025. X                  NADJHLD;
  2026. X***************
  2027. X*** 469,475 ****
  2028. X              mvaddstr(LINES-2,0,"Load what army?");
  2029. X              refresh();
  2030. X              armynum = get_number();
  2031. X!             if((armynum<0)||(armynum>=MAXARM)||(P_ASOLD<=0)
  2032. X              ||(loadstat(P_ASTAT)==FALSE)) {
  2033. X                  errormsg("Invalid Army");
  2034. X              } else if((P_AXLOC!=XREAL)||(P_AYLOC!=YREAL)) {
  2035. X--- 469,477 ----
  2036. X              mvaddstr(LINES-2,0,"Load what army?");
  2037. X              refresh();
  2038. X              armynum = get_number();
  2039. X!             if(armynum<0) {
  2040. X!                 ;
  2041. X!             } else if((armynum>=MAXARM)||(P_ASOLD<=0)
  2042. X              ||(loadstat(P_ASTAT)==FALSE)) {
  2043. X                  errormsg("Invalid Army");
  2044. X              } else if((P_AXLOC!=XREAL)||(P_AYLOC!=YREAL)) {
  2045. X***************
  2046. X*** 497,503 ****
  2047. X                  errormsg("Not enough room on fleet");
  2048. X              } else if(sct[XREAL][YREAL].people < amount) {
  2049. X                  errormsg("Not enough people in sector");
  2050. X!             } else {
  2051. X                  sct[XREAL][YREAL].people -= amount;
  2052. X                  P_NPEOP += (unsigned char)(amount / mhold);
  2053. X                  SADJCIV;
  2054. X--- 499,505 ----
  2055. X                  errormsg("Not enough room on fleet");
  2056. X              } else if(sct[XREAL][YREAL].people < amount) {
  2057. X                  errormsg("Not enough people in sector");
  2058. X!             } else if (amount > 0) {
  2059. X                  sct[XREAL][YREAL].people -= amount;
  2060. X                  P_NPEOP += (unsigned char)(amount / mhold);
  2061. X                  SADJCIV;
  2062. X*** otxt0    Tue Jul 18 22:04:45 1989
  2063. X--- txt0    Tue Jul 18 22:05:05 1989
  2064. X***************
  2065. X*** 1,21 ****
  2066. X                         CONQUER COMMAND HELP SCREEN
  2067. X  
  2068. X!     MOVEMENT                 COMMANDS                    ADMINISTRATION
  2069. X! 'h': move west           'a': army report            'p': pick item
  2070. X! 'y': move north-west     'r': redesignate            'd': change display
  2071. X! 'k': move north          'w': cast spells/summon     'c': administration
  2072. X! 'u': move north-east     'm': move selected unit     '?': help screen
  2073. X! 'l': move east           'F': go to next fleet       's': score
  2074. X! 'n': move south-east     'f': fleet report           'B': budget status
  2075. X! 'j': move south          'Z': move people 2 Sectors  'P': production stats
  2076. X! 'b': move south-west     'S': diplomacy status       'N': read newspaper
  2077. X! 'J': scroll south        'Q': quit (saves changes)   'W': write message
  2078. X! 'K': scroll north        'M': magic                  'R': read messages
  2079. X! 'L': scroll east         'C': construct              'T': trade
  2080. X! 'H': scroll west         'D': draft                  't': transport via ship
  2081. X!                          'G': go to next army        'v': version credits
  2082. X!                          'g': group army report      'I': campaign information
  2083. X! 'ctrl-L': redraw                                     'ESC': extra commands 
  2084. X  END
  2085. X                        CONQUER EXTENDED COMMANDS
  2086. X  
  2087. X--- 1,24 ----
  2088. X                         CONQUER COMMAND HELP SCREEN
  2089. X  
  2090. X!      SELECTIVE                 MOVEMENT                   CIVIL
  2091. X! 'o': pick previous unit    'h': move west          'r': redesignate
  2092. X! 'p': pick next unit        'y': move north-west    't': transport via ship
  2093. X! 'G': go to next army       'k': move north         'C': construct
  2094. X! 'F': go to next fleet      'u': move north-east    'D': draft armies
  2095. X! 'm': move selected unit    'l': move east          'Z': move civilians
  2096. X!                            'n': move south-east
  2097. X!        FORMS               'j': move south             COMMUNICATIVE
  2098. X! 'c': administrative        'b': move south-west    'R': read mail messages
  2099. X! 's': world score list      'J': scroll south       'N': read newspaper
  2100. X! 'B': budget status         'K': scroll north       'T': trade with players
  2101. X! 'I': campaign info         'L': scroll east        'W': write mail messages
  2102. X! 'M': magic screen          'H': scroll west
  2103. X! 'P': production status                                   MILITARY
  2104. X! 'S': diplomacy status        MISC COMMANDS         'a': army report
  2105. X!                            'q': quit and save      'f': fleet report
  2106. X!       VISUAL               'v': version credits    'g': group army report
  2107. X! 'd': change display        'Q': quit and save      'w': wizardry commands
  2108. X! 'cntrl-L': redraw          '?': help screens     'ESC': extra commands
  2109. X  END
  2110. X                        CONQUER EXTENDED COMMANDS
  2111. X  
  2112. X***************
  2113. X*** 49,62 ****
  2114. X  of gold for your treasury.  Also, metals are needed to build ships & armies,
  2115. X  and food is needed to prevent revolts and keep people alive.
  2116. X  
  2117. X! Command line format: conquer [-hs -nNAT -dDIR]
  2118. X!                 -h       print this help text
  2119. X!                 -s       print out scores
  2120. X!                 -n NTN   run as nation NTN
  2121. X!                 -d DIR   run on data in directory DIR
  2122. X! It is suggested that each player set up a shell alias for their game & nation
  2123. X  The game administrator should read documentation on using the conqrun command.
  2124. X  END
  2125. X                         CONQUER CURSOR MOVEMENT
  2126. X  
  2127. X                                 NORTH
  2128. X--- 52,102 ----
  2129. X  of gold for your treasury.  Also, metals are needed to build ships & armies,
  2130. X  and food is needed to prevent revolts and keep people alive.
  2131. X  
  2132. X! Command format:  conquer [-Ghs -nNAT -dDIR]
  2133. X!                     -G       highlight name in news (gaudy!)
  2134. X!                     -h       print this help text
  2135. X!                     -s       print out scores
  2136. X!                     -n NTN   run as nation NTN
  2137. X!                     -d DIR   run on data in directory DIR
  2138. X! 
  2139. X  The game administrator should read documentation on using the conqrun command.
  2140. X  END
  2141. X+                     CONQUER ENVIRONMENT VARIABLES
  2142. X+ 
  2143. X+       To facilitate the use of conquer, the environment variable
  2144. X+ XCONQENV has been added to conquer to allow settings of default options
  2145. X+ to conquer.  Just add a line to your .cshrc or .login file with the
  2146. X+ following format:
  2147. X+ 
  2148. X+ setenv XCONQENV "G,nation=MyLand,datadir=this_game"
  2149. X+ 
  2150. X+       If you then type just 'conquer' to enter conquer, it will be
  2151. SHAR_EOF
  2152. echo "End of part 3, continue with part 4"
  2153. echo "4" > s2_seq_.tmp
  2154. exit 0
  2155.