home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch6b < prev    next >
Encoding:
Internet Message Format  |  1989-10-02  |  48.4 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i033:  conquer4 - middle earth multi-player game (V4), Patch6b
  5. Message-ID: <4601@tekred.CNA.TEK.COM>
  6. Date: 21 Sep 89 13:14:31 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1632
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@bu-cs.bu.edu>
  12. Posting-number: Volume 8, Issue 33
  13. Archive-name: conquer4/Patch6b
  14. Patch-To: conquer4: Volume 6, Issue 83-96
  15.  
  16.  
  17. #!/bin/sh
  18. # this is part 2 of a multipart archive
  19. # do not concatenate these parts, unpack them in order with /bin/sh
  20. # file patchV4.6 continued
  21. #
  22. CurArch=2
  23. if test ! -r s2_seq_.tmp
  24. then echo "Please unpack part 1 first!"
  25.      exit 1; fi
  26. ( read Scheck
  27.   if test "$Scheck" != $CurArch
  28.   then echo "Please unpack part $Scheck next!"
  29.        exit 1;
  30.   else exit 0; fi
  31. ) < s2_seq_.tmp || exit 1
  32. sed 's/^X//' << 'SHAR_EOF' >> patchV4.6
  33. X!         }
  34. X  
  35. X          if( TURN!= 1) {
  36. X          curntn->reputation += rand()%8-3;
  37. X***************
  38. X*** 501,522 ****
  39. X          else temp = 0;
  40. X          curntn->farm_ability = min( temp,MAXTGVAL );
  41. X          }
  42. X          temp = (minepts/3 + cityfolk/2 + townfolk/2 + blksmths);
  43. X-         curntn->mine_ability = min( temp,MAXTGVAL );
  44. X          if( magic(country,MINER) )
  45. X!             curntn->mine_ability += 15;
  46. X          if( magic(country,STEEL) )
  47. X!             curntn->mine_ability += 15;
  48. X  
  49. X          temp = cityfolk/2 + townfolk/6 + scholars/2;
  50. X          curntn->knowledge = min( temp,MAXTGVAL );
  51. X  
  52. X          temp = (curntn->wealth + 10*P_EATRATE + clerics + curntn->popularity)/2;
  53. X          curntn->popularity = min( temp,MAXTGVAL );
  54. X  
  55. X-         /* poverty tends 10% to 100-wealth/4 */
  56. X-         curntn->poverty += (100-curntn->wealth/4-curntn->poverty+5)/10;
  57. X- 
  58. X          if(magic(country,SLAVER))    curntn->terror+=PWR_NA;
  59. X          if(magic(country,RELIGION))    curntn->popularity+=PWR_NA;
  60. X          if(magic(country,URBAN)) {
  61. X--- 512,538 ----
  62. X          else temp = 0;
  63. X          curntn->farm_ability = min( temp,MAXTGVAL );
  64. X          }
  65. X+ 
  66. X+         /* calcualte mining ability */
  67. X          temp = (minepts/3 + cityfolk/2 + townfolk/2 + blksmths);
  68. X          if( magic(country,MINER) )
  69. X!             temp += 15;
  70. X          if( magic(country,STEEL) )
  71. X!             temp += 15;
  72. X!         if (temp >= curntn->mine_ability) {
  73. X!             curntn->mine_ability = min( temp,MAXTGVAL );
  74. X!         } else {
  75. X!             curntn->mine_ability -= (curntn->mine_ability - temp)/4;
  76. X!         }
  77. X  
  78. X+         /* calculate knowledge */
  79. X          temp = cityfolk/2 + townfolk/6 + scholars/2;
  80. X          curntn->knowledge = min( temp,MAXTGVAL );
  81. X  
  82. X+         /* find national popularity */
  83. X          temp = (curntn->wealth + 10*P_EATRATE + clerics + curntn->popularity)/2;
  84. X          curntn->popularity = min( temp,MAXTGVAL );
  85. X  
  86. X          if(magic(country,SLAVER))    curntn->terror+=PWR_NA;
  87. X          if(magic(country,RELIGION))    curntn->popularity+=PWR_NA;
  88. X          if(magic(country,URBAN)) {
  89. X***************
  90. X*** 529,535 ****
  91. X              if(curntn->terror > PWR_NA)
  92. X                  curntn->terror-=PWR_NA;
  93. X              else    curntn->terror=0;
  94. X!             curntn->charity+=2;    /* it creeps up */
  95. X          }
  96. X          if(magic(country,KNOWALL))    curntn->knowledge+=PWR_NA;
  97. X          if(magic(country,ARCHITECT)){
  98. X--- 545,554 ----
  99. X              if(curntn->terror > PWR_NA)
  100. X                  curntn->terror-=PWR_NA;
  101. X              else    curntn->terror=0;
  102. X!             if (curntn->charity < 15) {
  103. X!                 /* it creeps up */
  104. X!                 curntn->charity+=2;
  105. X!             }
  106. X          }
  107. X          if(magic(country,KNOWALL))    curntn->knowledge+=PWR_NA;
  108. X          if(magic(country,ARCHITECT)){
  109. X*** oextcmds.c    Wed Sep 20 21:40:55 1989
  110. X--- extcmds.c    Wed Sep 20 21:41:23 1989
  111. X***************
  112. X*** 44,50 ****
  113. X          if (P_ATYPE>=MINLEADER && P_ATYPE<MINMONSTER &&
  114. X          ISCITY(sct[P_AXLOC][P_AYLOC].designation)) addstr(", (R)ule");
  115. X      }
  116. X!     mvprintw(LINES-4, 0, "Extended command:");
  117. X      refresh();
  118. X  
  119. X      switch(getch()) {
  120. X--- 44,50 ----
  121. X          if (P_ATYPE>=MINLEADER && P_ATYPE<MINMONSTER &&
  122. X          ISCITY(sct[P_AXLOC][P_AYLOC].designation)) addstr(", (R)ule");
  123. X      }
  124. X!     mvaddstr(LINES-4, 0, "Extended command:");
  125. X      refresh();
  126. X  
  127. X      switch(getch()) {
  128. X***************
  129. X*** 80,87 ****
  130. X      default:        /* unimplemented? */
  131. X          errormsg("Unimplemented extended command");
  132. X      }
  133. X-     makebottom();
  134. X-     refresh();
  135. X  }
  136. X  
  137. X  /* returns TRUE if uncombinable FALSE if combinable */
  138. X--- 80,85 ----
  139. X*** omakeworl.c    Wed Sep 20 21:40:55 1989
  140. X--- makeworl.c    Wed Sep 20 21:41:24 1989
  141. X***************
  142. X*** 23,29 ****
  143. X  
  144. X  int pwater;        /* percent water in world (0-100) */
  145. X  extern short    country;
  146. X! extern int    numleaders;
  147. X  char datadir[FILELTH];
  148. X  char **area_map;            /*Value Map of Areas*/
  149. X  char **type;
  150. X--- 23,29 ----
  151. X  
  152. X  int pwater;        /* percent water in world (0-100) */
  153. X  extern short    country;
  154. X! extern int    numleaders,remake;
  155. X  char datadir[FILELTH];
  156. X  char **area_map;            /*Value Map of Areas*/
  157. X  char **type;
  158. X***************
  159. X*** 65,70 ****
  160. X--- 65,71 ----
  161. X          curntn->powers = curntn->tciv = curntn->tmil = curntn->score = 0L;
  162. X          curntn->race = TUNKNOWN;
  163. X          curntn->maxmove = 0;
  164. X+         curntn->spellpts = 0;
  165. X          curntn->class = curntn->aplus = curntn->dplus = (short)0;
  166. X          curntn->inflation = curntn->tsctrs = curntn->tships = (short)0;
  167. X      }
  168. X***************
  169. X*** 106,112 ****
  170. X  
  171. X      valid=FALSE;
  172. X      while(valid==FALSE) {            /* password routine */
  173. X!         mvprintw(7,0,"Enter Super-User Password: ");
  174. X          clrtoeol();
  175. X          refresh();
  176. X          i = get_pass(newstring);
  177. X--- 107,113 ----
  178. X  
  179. X      valid=FALSE;
  180. X      while(valid==FALSE) {            /* password routine */
  181. X!         mvaddstr(7,0,"Enter Super-User Password: ");
  182. X          clrtoeol();
  183. X          refresh();
  184. X          i = get_pass(newstring);
  185. X***************
  186. X*** 117,123 ****
  187. X              newerror("Password Too Long");
  188. X              continue;
  189. X          }
  190. X!         mvprintw(7,0,"Reenter Super-User Password: ");
  191. X          clrtoeol();
  192. X          refresh();
  193. X          i = get_pass(passwd);
  194. X--- 118,124 ----
  195. X              newerror("Password Too Long");
  196. X              continue;
  197. X          }
  198. X!         mvaddstr(7,0,"Reenter Super-User Password: ");
  199. X          clrtoeol();
  200. X          refresh();
  201. X          i = get_pass(passwd);
  202. X***************
  203. X*** 130,142 ****
  204. X      
  205. X      /* finally ask for the secondary administrator */
  206. X      mvaddstr(7,0,"You may designate an other user as an alternate \"god\" for this world.");
  207. X!     mvaddstr(8,0,"Enter System Login of alternate user or hit return to continue.");
  208. X      while(TRUE) {
  209. X!         mvaddstr(9,0,"What demi-god shall co-rule this world: ");
  210. X          clrtoeol();
  211. X          refresh();
  212. X          get_nname( newstring );
  213. X!         if (strlen(newstring)==0) {
  214. X              newmsg("God will personally rule this world!!!");
  215. X              sleep(1);
  216. X              (void) strcpy(ntn[0].leader,LOGIN);
  217. X--- 131,155 ----
  218. X      
  219. X      /* finally ask for the secondary administrator */
  220. X      mvaddstr(7,0,"You may designate an other user as an alternate \"god\" for this world.");
  221. X!     mvaddstr(8,0,"Enter a System Login or \"god\" to have none.  [Return for default]");
  222. X! #ifdef REMAKE
  223. X!     if (remake==FALSE) {
  224. X!         (void) strcpy(ntn[0].leader,"god");
  225. X!     } else if (getpwnam(ntn[0].leader)==NULL) {
  226. X!         (void) strcpy(ntn[0].leader,"god");
  227. X!         remake=FALSE;
  228. X!     }
  229. X! #else
  230. X!     (void) strcpy(ntn[0].leader,"god");
  231. X! #endif REMAKE
  232. X      while(TRUE) {
  233. X!         mvprintw(9,0,"What demi-god shall co-rule this world? [%s]: ",ntn[0].leader);
  234. X          clrtoeol();
  235. X          refresh();
  236. X          get_nname( newstring );
  237. X!         if ((strcmp(newstring,"GOD")==0)
  238. X!         ||(strcmp(newstring,"God")==0)
  239. X!         ||(strcmp(newstring,"god")==0)) {
  240. X              newmsg("God will personally rule this world!!!");
  241. X              sleep(1);
  242. X              (void) strcpy(ntn[0].leader,LOGIN);
  243. X***************
  244. X*** 143,151 ****
  245. X              mvaddstr(7,0,"Demi-God: [none]");
  246. X              clrtoeol();
  247. X              break;
  248. X          } else if (strlen(newstring) <= LEADERLTH) {
  249. X              if (getpwnam(newstring)!=NULL) {
  250. X!                 sprintf(tempc,"The demi-god %s may administrate this new world.",newstring);
  251. X                  newmsg(tempc);
  252. X                  (void) strncpy(ntn[0].leader,newstring,LEADERLTH);
  253. X                  mvprintw(7,0,"Demi-God: %s",ntn[0].leader);
  254. X--- 156,185 ----
  255. X              mvaddstr(7,0,"Demi-God: [none]");
  256. X              clrtoeol();
  257. X              break;
  258. X+         }
  259. X+         if (strlen(newstring)==0) {
  260. X+ #ifdef REMAKE
  261. X+             if (remake==FALSE) {
  262. X+ #endif /*REMAKE*/
  263. X+                 newmsg("God will personally rule this world!!!");
  264. X+                 sleep(1);
  265. X+                 (void) strcpy(ntn[0].leader,LOGIN);
  266. X+                 mvaddstr(7,0,"Demi-God: [none]");
  267. X+                 clrtoeol();
  268. X+                 break;
  269. X+ #ifdef REMAKE
  270. X+             } else {
  271. X+                 (void) sprintf(tempc,"The demi-god %s will continue to reign.",ntn[0].leader);
  272. X+                 newmsg(tempc);
  273. X+                 sleep(1);
  274. X+                 mvprintw(7,0,"Demi-God: [%s]",ntn[0].leader);
  275. X+                 clrtoeol();
  276. X+                 break;
  277. X+             }
  278. X+ #endif /*REMAKE*/
  279. X          } else if (strlen(newstring) <= LEADERLTH) {
  280. X              if (getpwnam(newstring)!=NULL) {
  281. X!                 (void) sprintf(tempc,"The demi-god %s may administrate this new world.",newstring);
  282. X                  newmsg(tempc);
  283. X                  (void) strncpy(ntn[0].leader,newstring,LEADERLTH);
  284. X                  mvprintw(7,0,"Demi-God: %s",ntn[0].leader);
  285. X***************
  286. X*** 152,158 ****
  287. X                  clrtoeol();
  288. X                  break;
  289. X              } else {
  290. X!                 sprintf(tempc,"Their is no mortal named %s on this system.",newstring);
  291. X                  newerror(tempc);
  292. X              }
  293. X          } else {
  294. X--- 186,192 ----
  295. X                  clrtoeol();
  296. X                  break;
  297. X              } else {
  298. X!                 (void) sprintf(tempc,"Their is no mortal named %s on this system.",newstring);
  299. X                  newerror(tempc);
  300. X              }
  301. X          } else {
  302. X***************
  303. X*** 722,731 ****
  304. X          }
  305. X      }
  306. X  
  307. X!     mvprintw(13,5,"All manner of creatures were created: big ones, little ones,");
  308. X!     mvprintw(14,0,"fat ones, skinny ones, orange ones, turquois ones, bright blue ones.");
  309. X!     mvprintw(15,0,"WAIT!!!  God has suddenly realized that smurfs were taking things");
  310. X!     mvprintw(16,0,"too far and stopped creating new ones, and placed everybody on the map...");
  311. X      newmsg("Day 5... God decreed that world would be populated");
  312. X      sleep(1);
  313. X      move(14,0);
  314. X--- 756,765 ----
  315. X          }
  316. X      }
  317. X  
  318. X!     mvaddstr(13,5,"All manner of creatures were created: big ones, little ones,");
  319. X!     mvaddstr(14,0,"fat ones, skinny ones, orange ones, turquois ones, bright blue ones.");
  320. X!     mvaddstr(15,0,"WAIT!!!  God has suddenly realized that smurfs were taking things");
  321. X!     mvaddstr(16,0,"too far and stopped creating new ones to place everybody on the map...");
  322. X      newmsg("Day 5... God decreed that world would be populated");
  323. X      sleep(1);
  324. X      move(14,0);
  325. X***************
  326. X*** 1140,1149 ****
  327. X      }
  328. X  
  329. X      cnum=1;
  330. X!     mvprintw(15,0,"ADDING NATIONS:");
  331. X      refresh();
  332. X      xpos = 16;
  333. X!     ypos = 15;
  334. X      while(fgets(line,LINELTH,fp)!=NULL) {
  335. X          /*read and parse a new line*/
  336. X          if(line[0]!='#') {
  337. X--- 1174,1184 ----
  338. X      }
  339. X  
  340. X      cnum=1;
  341. X!     mvaddstr(14,0,"ADDING NATIONS:");
  342. X!     clrtoeol();
  343. X      refresh();
  344. X      xpos = 16;
  345. X!     ypos = 14;
  346. X      while(fgets(line,LINELTH,fp)!=NULL) {
  347. X          /*read and parse a new line*/
  348. X          if(line[0]!='#') {
  349. X*** orandeven.c    Wed Sep 20 21:41:00 1989
  350. X--- randeven.c    Wed Sep 20 21:41:24 1989
  351. X***************
  352. X*** 903,910 ****
  353. X  
  354. X      /*send a message to the country if it is a PC*/
  355. X      if(ispc(ntn[cntry].active)) {
  356. X!         mailopen( cntry );
  357. X!         fprintf(fm,"MESSAGE FROM CONQUER\n");
  358. X          fprintf(fm,"An event occurs within your nation (%s)\n",ntn[cntry].name);
  359. X          fprintf(fm,"%s during the %s of Year %d,\n",event,PSEASON(TURN),YEAR(TURN));
  360. X          if(xloc != -1)
  361. X--- 903,910 ----
  362. X  
  363. X      /*send a message to the country if it is a PC*/
  364. X      if(ispc(ntn[cntry].active)) {
  365. X!         if(mailopen( cntry )!=(-1)) {
  366. X!         fprintf(fm,"MESSAGE FROM CONQUER\n\n");
  367. X          fprintf(fm,"An event occurs within your nation (%s)\n",ntn[cntry].name);
  368. X          fprintf(fm,"%s during the %s of Year %d,\n",event,PSEASON(TURN),YEAR(TURN));
  369. X          if(xloc != -1)
  370. X***************
  371. X*** 912,917 ****
  372. X--- 912,918 ----
  373. X          if(prcnt>0) {
  374. X              fprintf(fm,"Damage was estimated at about %d%% in severity.\n",prcnt);
  375. X          }
  376. X+         }
  377. X      }
  378. X  
  379. X      if(strlen(eventstr)>5) {
  380. X***************
  381. X*** 928,934 ****
  382. X          if(ispc(ntn[cntry].active))
  383. X              fprintf(fm,"\t%s\n",eventstr);
  384. X      }
  385. X!     mailclose();
  386. X  }
  387. X  
  388. X  int
  389. X--- 929,935 ----
  390. X          if(ispc(ntn[cntry].active))
  391. X              fprintf(fm,"\t%s\n",eventstr);
  392. X      }
  393. X!     if(ispc(ntn[cntry].active)) mailclose(cntry);
  394. X  }
  395. X  
  396. X  int
  397. X*** ocexecute.c    Wed Sep 20 21:40:54 1989
  398. X--- cexecute.c    Wed Sep 20 21:41:25 1989
  399. X***************
  400. X*** 194,199 ****
  401. X--- 194,210 ----
  402. X              }
  403. X              sct[x][y].people=armynum;
  404. X              break;
  405. X+         case XSACIV3:    /*Sadjciv3 - incremental people adjust */
  406. X+             /* if you dont own it, put people in your capitol */
  407. X+             if((sct[x][y].owner!=country)&&(country!=0)) {
  408. X+                 sct[curntn->capx][curntn->capy].people+=armynum;
  409. X+                 fprintf(stderr,"SACIV3: <%s> told to put %d civilians in sector %d,%d not owned - placed in capitol\n",curntn->name,armynum,x,y);
  410. X+             }
  411. X+             else
  412. X+             {
  413. X+                 sct[x][y].people+=armynum;
  414. X+             }
  415. X+             break;
  416. X          case XSIFORT:    /*Sincfort*/
  417. X              sct[x][y].fortress++;
  418. X              break;
  419. X***************
  420. X*** 269,274 ****
  421. X--- 280,287 ----
  422. X  void
  423. X  hangup()
  424. X  {
  425. X+     char line[LINELTH];
  426. X+ 
  427. X      if(country==0) writedata();
  428. X      else {
  429. X          fprintf(fexe,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n",
  430. X***************
  431. X*** 281,292 ****
  432. X      /*close file*/
  433. X      fclose(fexe);
  434. X      /*send a message to God*/
  435. X!     mailopen( 0 );
  436. X!     fprintf(fm,"WARNING: Nation %s hungup on me.\n",curntn->name);
  437. X!     mailclose();
  438. X  
  439. X      /* remove the lock file */
  440. X      unlink(fison);
  441. X      /* exit program */
  442. X      exit(FAIL);
  443. X  }
  444. X--- 294,313 ----
  445. X      /*close file*/
  446. X      fclose(fexe);
  447. X      /*send a message to God*/
  448. X!     if(mailopen( 0 )!=(-1)) {
  449. X!         fprintf(fm,"WARNING: Nation %s hungup on me.\n",curntn->name);
  450. X!         mailclose(0);
  451. X!     }
  452. X  
  453. X      /* remove the lock file */
  454. X      unlink(fison);
  455. X+     /* remove any existing mail reading/writing file */
  456. X+     if (mailok!=DONEMAIL) {
  457. X+         extern char tmp_mail_name[];
  458. X+         unlink(tmp_mail_name);
  459. X+     }
  460. X+     sprintf(line,"%s%hd.tmp",msgfile,country);
  461. X+     unlink(line);
  462. X      /* exit program */
  463. X      exit(FAIL);
  464. X  }
  465. X*** oforms.c    Wed Sep 20 21:40:55 1989
  466. X--- forms.c    Wed Sep 20 21:41:25 1989
  467. X***************
  468. X*** 41,48 ****
  469. X      int nationid;          /*current nation id */
  470. X  
  471. X      count2=1;
  472. X      while(done==FALSE) {
  473. X!         clear();
  474. X          standout();
  475. X          mvaddstr(0,(COLS/2)-10,"NATION SCORE SCREEN");
  476. X          standend();
  477. X--- 41,50 ----
  478. X      int nationid;          /*current nation id */
  479. X  
  480. X      count2=1;
  481. X+     clear();
  482. X      while(done==FALSE) {
  483. X!         move(0,0);
  484. X!         clrtobot();
  485. X          standout();
  486. X          mvaddstr(0,(COLS/2)-10,"NATION SCORE SCREEN");
  487. X          standend();
  488. X***************
  489. X*** 94,101 ****
  490. X                  mvprintw(ypos+6,xpos,"%ld",ntn[nationid].score);
  491. X  #ifdef NOSCORE
  492. X                  if(isnpc(ntn[nationid].active))
  493. X!                     mvprintw(ypos+7,xpos,"Yes");
  494. X!                 else mvprintw(ypos+7,xpos,"No");
  495. X                  if (country==0) {
  496. X                      mvprintw(ypos+8,xpos,"%ld",ntn[nationid].tgold);
  497. X                      mvprintw(ypos+9,xpos,"%ld",ntn[nationid].tmil);
  498. X--- 96,103 ----
  499. X                  mvprintw(ypos+6,xpos,"%ld",ntn[nationid].score);
  500. X  #ifdef NOSCORE
  501. X                  if(isnpc(ntn[nationid].active))
  502. X!                     mvaddstr(ypos+7,xpos,"Yes");
  503. X!                 else mvaddstr(ypos+7,xpos,"No");
  504. X                  if (country==0) {
  505. X                      mvprintw(ypos+8,xpos,"%ld",ntn[nationid].tgold);
  506. X                      mvprintw(ypos+9,xpos,"%ld",ntn[nationid].tmil);
  507. X***************
  508. X*** 108,115 ****
  509. X                  mvprintw(ypos+9,xpos,"%ld",ntn[nationid].tciv);
  510. X                  mvprintw(ypos+10,xpos,"%d",ntn[nationid].tsctrs);
  511. X                  if(isnpc(ntn[nationid].active))
  512. X!                     mvprintw(ypos+11,xpos,"Yes");
  513. X!                 else mvprintw(ypos+11,xpos,"No");
  514. X  #endif /* NOSCORE */
  515. X                  count++;
  516. X                  if(count<MAXINSCR && count%MAXINROW==0) {
  517. X--- 110,117 ----
  518. X                  mvprintw(ypos+9,xpos,"%ld",ntn[nationid].tciv);
  519. X                  mvprintw(ypos+10,xpos,"%d",ntn[nationid].tsctrs);
  520. X                  if(isnpc(ntn[nationid].active))
  521. X!                     mvaddstr(ypos+11,xpos,"Yes");
  522. X!                 else mvaddstr(ypos+11,xpos,"No");
  523. X  #endif /* NOSCORE */
  524. X                  count++;
  525. X                  if(count<MAXINSCR && count%MAXINROW==0) {
  526. X***************
  527. X*** 151,161 ****
  528. X          isgod=TRUE;
  529. X          if (get_god()) return;
  530. X      }
  531. X      count2=1;
  532. X      while(1){
  533. X          count=1;
  534. X          offset=0;
  535. X!         clear();
  536. X          standout();
  537. X          mvaddstr(0,(COLS/2)-12,"NATION DIPLOMACY SUMMARY");
  538. X          standend();
  539. X--- 153,165 ----
  540. X          isgod=TRUE;
  541. X          if (get_god()) return;
  542. X      }
  543. X+     clear();
  544. X      count2=1;
  545. X      while(1){
  546. X          count=1;
  547. X          offset=0;
  548. X!         move(0,0);
  549. X!         clrtobot();
  550. X          standout();
  551. X          mvaddstr(0,(COLS/2)-12,"NATION DIPLOMACY SUMMARY");
  552. X          standend();
  553. X***************
  554. X*** 255,261 ****
  555. X                  exit(FAIL);
  556. X              }
  557. X              BRIBENATION;
  558. X-             mailclose();
  559. X  
  560. X              ntn[nation].dstatus[country]--;
  561. X  
  562. X--- 259,264 ----
  563. X***************
  564. X*** 313,328 ****
  565. X              }
  566. X              if((temp<=UNMET)||(temp>JIHAD)
  567. X              ||((isgod==FALSE)&&(temp==UNMET))){
  568. X!                 mvprintw(LINES-1,0,"SORRY, Invalid inputs -- hit return");
  569. X!                 refresh();
  570. X!                 getch();
  571. X                  if(isgod==TRUE) reset_god();
  572. X                  return;
  573. X              }
  574. X  
  575. X!             if(((curntn->dstatus[nation]==TREATY)&&(temp!=TREATY))
  576. X!             ||(( curntn->dstatus[nation]==JIHAD)&&(temp!=JIHAD)))
  577. X                      curntn->tgold -= BREAKJIHAD;
  578. X  
  579. X              curntn->dstatus[nation]=temp;
  580. X              EADJDIP(country,nation);
  581. X--- 316,335 ----
  582. X              }
  583. X              if((temp<=UNMET)||(temp>JIHAD)
  584. X              ||((isgod==FALSE)&&(temp==UNMET))){
  585. X!                 errormsg("SORRY, Invalid inputs -- hit return");
  586. X                  if(isgod==TRUE) reset_god();
  587. X                  return;
  588. X              }
  589. X  
  590. X!             if((curntn->dstatus[nation]==JIHAD)&&(temp!=JIHAD))
  591. X                      curntn->tgold -= BREAKJIHAD;
  592. X+             else if ((curntn->dstatus[nation]==TREATY)&&(temp!=TREATY)) {
  593. X+                 if (ntn[nation].dstatus[country]!=TREATY) {
  594. X+                     errormsg("Non-binding Treaty broken... fee waived.");
  595. X+                 } else {
  596. X+                     curntn->tgold -= BREAKJIHAD;
  597. X+                 }
  598. X+             }
  599. X  
  600. X              curntn->dstatus[nation]=temp;
  601. X              EADJDIP(country,nation);
  602. X***************
  603. X*** 330,340 ****
  604. X              if((temp>HOSTILE)
  605. X              &&(ispc(ntn[nation].active))
  606. X              &&(ntn[nation].dstatus[country]<WAR)) {
  607. X!                 mailopen(nation);
  608. X!                 fprintf(fm,"Message to %s from CONQUER\n",ntn[nation].name);
  609. X!                 fprintf(fm,"    During the %s of Year %d,\n",PSEASON(TURN),YEAR(TURN));
  610. X!                 fprintf(fm,"      %s declared war on you\n",curntn->name);
  611. X!                 mailclose();
  612. X              }
  613. X  
  614. X              /*prevent ron from being sneaky*/
  615. X--- 337,348 ----
  616. X              if((temp>HOSTILE)
  617. X              &&(ispc(ntn[nation].active))
  618. X              &&(ntn[nation].dstatus[country]<WAR)) {
  619. X!                 if(mailopen(nation)!=(-1)) {
  620. X!                     fprintf(fm,"Message to %s from CONQUER\n",ntn[nation].name);
  621. X!                     fprintf(fm,"    During the %s of Year %d,\n",PSEASON(TURN),YEAR(TURN));
  622. X!                     fprintf(fm,"      %s declared war on you\n",curntn->name);
  623. X!                     mailclose(nation);
  624. X!                 }
  625. X              }
  626. X  
  627. X              /*prevent ron from being sneaky*/
  628. X***************
  629. X*** 347,353 ****
  630. X                  if(ntn[i].dstatus[nation]==TREATY){
  631. X                      ntn[i].dstatus[country]=WAR;
  632. X                      EADJDIP(i,country);
  633. X!                     mailopen(country);
  634. X                      fprintf(fm,"Message to %s from %s\n",ntn[country].name,ntn[i].name);
  635. X                      switch( rand()%4 ) {
  636. X                      case 0: fprintf(fm,"You just attacked my friend %s - your loss!!!\n",ntn[nation].name);
  637. X--- 355,361 ----
  638. X                  if(ntn[i].dstatus[nation]==TREATY){
  639. X                      ntn[i].dstatus[country]=WAR;
  640. X                      EADJDIP(i,country);
  641. X!                     if (mailopen(country)==(-1)) {
  642. X                      fprintf(fm,"Message to %s from %s\n",ntn[country].name,ntn[i].name);
  643. X                      switch( rand()%4 ) {
  644. X                      case 0: fprintf(fm,"You just attacked my friend %s - your loss!!!\n",ntn[nation].name);
  645. X***************
  646. X*** 361,367 ****
  647. X                          fprintf(fm,"appropriate counter measures!!! DIE!!!\n");
  648. X                          break;
  649. X                      }
  650. X!                     mailclose();
  651. X                  }
  652. X              }
  653. X          }
  654. X--- 369,376 ----
  655. X                          fprintf(fm,"appropriate counter measures!!! DIE!!!\n");
  656. X                          break;
  657. X                      }
  658. X!                     }
  659. X!                     mailclose(country);
  660. X                  }
  661. X              }
  662. X          }
  663. X***************
  664. X*** 390,397 ****
  665. X      }
  666. X   
  667. X      /* continuous loop */
  668. X-     while(1) {
  669. X      clear();
  670. X      standout();
  671. X      mvaddstr(0,(COLS/2)-10,"NATION STATS SUMMARY");
  672. X      mvprintw(3,0,"nation name is %s",curntn->name);
  673. X--- 399,408 ----
  674. X      }
  675. X   
  676. X      /* continuous loop */
  677. X      clear();
  678. X+     while(1) {
  679. X+     move(0,0);
  680. X+     clrtobot();
  681. X      standout();
  682. X      mvaddstr(0,(COLS/2)-10,"NATION STATS SUMMARY");
  683. X      mvprintw(3,0,"nation name is %s",curntn->name);
  684. X*** omisc.c    Wed Sep 20 21:40:56 1989
  685. X--- misc.c    Wed Sep 20 21:41:25 1989
  686. X***************
  687. X*** 5,10 ****
  688. X--- 5,11 ----
  689. X  #include    "data.h"
  690. X  
  691. X  extern FILE *fnews;
  692. X+ extern short country;
  693. X  
  694. X  extern char *HVegcost, *OVegcost, *EVegcost, *DVegcost, *FVegcost;
  695. X  extern char *HElecost, *OElecost, *EElecost, *DElecost, *FElecost;
  696. X***************
  697. X*** 182,187 ****
  698. X--- 183,190 ----
  699. X              if( (y = ay + dy[i]) < 0 || y >= MAPY )
  700. X                  continue;
  701. X  
  702. X+             if ( movecost[ x ][ y ] < 0 )    /* just in case */
  703. X+                 continue;
  704. X              if( sct[x][y].altitude == PEAK)
  705. X                  continue;
  706. X              if( sct[x][y].altitude == WATER)
  707. X***************
  708. X*** 790,808 ****
  709. X              }
  710. X              P_ASOLD=0;
  711. X              if(ispc(curntn->active)) {
  712. X!                 mailopen(country);
  713. X!                 fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  714. X!                 fprintf(fm,"\tYour %s Army %d disperses into the population\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  715. X!                 mailclose();
  716. X              }
  717. X          } else if(P_ATYPE>=MINMONSTER) {
  718. X              /* disbanding of ALL monsters should take place */
  719. X              P_ASOLD=0;
  720. X              if(ispc(curntn->active)) {
  721. X!                 mailopen(country);
  722. X!                 fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  723. X!                 fprintf(fm,"\tYour %s (unit %d) leaves due to the loss of your jewels.\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  724. X!                 mailclose();
  725. X              }
  726. X          }
  727. X      }
  728. X--- 793,813 ----
  729. X              }
  730. X              P_ASOLD=0;
  731. X              if(ispc(curntn->active)) {
  732. X!                 if (mailopen(country)!=(-1)) {
  733. X!                     fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  734. X!                     fprintf(fm,"\tYour %s Army %d disperses into the population\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  735. X!                     mailclose(country);
  736. X!                 }
  737. X              }
  738. X          } else if(P_ATYPE>=MINMONSTER) {
  739. X              /* disbanding of ALL monsters should take place */
  740. X              P_ASOLD=0;
  741. X              if(ispc(curntn->active)) {
  742. X!                 if (mailopen(country)!=(-1)) {
  743. X!                     fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  744. X!                     fprintf(fm,"\tYour %s (unit %d) leaves due to the loss of your jewels.\n",*(unittype+(P_ATYPE%UTYPE)),armynum);
  745. X!                     mailclose(country);
  746. X!                 }
  747. X              }
  748. X          }
  749. X      }
  750. X***************
  751. X*** 810,818 ****
  752. X      /* check for sectors breaking away -- not capx, capy */
  753. X      if(ispc(curntn->active)) {
  754. X          /* create a summarized mail message of sectors effected */
  755. X!         mailopen(country);
  756. X!         fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  757. X!         fprintf(fm,"Riots and Rebellion flourish:\n");
  758. X      }
  759. X      for(i=0;i<MAPX;i++) for(j=0;j<MAPY;j++)
  760. X      if(sct[i][j].owner==country && (i!=x || j!=y) ) {
  761. X--- 815,824 ----
  762. X      /* check for sectors breaking away -- not capx, capy */
  763. X      if(ispc(curntn->active)) {
  764. X          /* create a summarized mail message of sectors effected */
  765. X!         if (mailopen(country)!=(1)) {
  766. X!             fprintf(fm,"Message to %s from Conquer\n\n",curntn->name);
  767. X!             fprintf(fm,"Riots and Rebellion flourish:\n");
  768. X!         }
  769. X      }
  770. X      for(i=0;i<MAPX;i++) for(j=0;j<MAPY;j++)
  771. X      if(sct[i][j].owner==country && (i!=x || j!=y) ) {
  772. X***************
  773. X*** 838,844 ****
  774. X          }
  775. X      }
  776. X      if(ispc(curntn->active)) {
  777. X!         mailclose();
  778. X      } else if(isnpc(curntn->active)) {
  779. X          if(sct[curntn->capx][curntn->capy].owner==country) {
  780. X              /* reset capitol for npcs */
  781. X--- 844,850 ----
  782. X          }
  783. X      }
  784. X      if(ispc(curntn->active)) {
  785. X!         mailclose(country);
  786. X      } else if(isnpc(curntn->active)) {
  787. X          if(sct[curntn->capx][curntn->capy].owner==country) {
  788. X              /* reset capitol for npcs */
  789. X***************
  790. X*** 912,924 ****
  791. X      if ((x!=curntn->capx)||(y!=curntn->capy)) {
  792. X          /* assign new pseudo capitol */
  793. X          if(ispc(curntn->active)) {
  794. X!             mailopen(country);
  795. X              fprintf(fm,"Message to %s from Conquer\n\n",ntn[country].name);
  796. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  797. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  798. X              fprintf(fm,"\tA temporary headquarters is now in sector %d,%d,\n",x,y);
  799. X              fprintf(fm,"\t but designation of a new Capitol is recommended.\n");
  800. X!             mailclose();
  801. X          }
  802. X          curntn->capx=x;
  803. X          curntn->capy=y;
  804. X--- 918,931 ----
  805. X      if ((x!=curntn->capx)||(y!=curntn->capy)) {
  806. X          /* assign new pseudo capitol */
  807. X          if(ispc(curntn->active)) {
  808. X!             if(mailopen(country)!=(-1)) {
  809. X              fprintf(fm,"Message to %s from Conquer\n\n",ntn[country].name);
  810. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  811. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  812. X              fprintf(fm,"\tA temporary headquarters is now in sector %d,%d,\n",x,y);
  813. X              fprintf(fm,"\t but designation of a new Capitol is recommended.\n");
  814. X!             mailclose(country);
  815. X!             }
  816. X          }
  817. X          curntn->capx=x;
  818. X          curntn->capy=y;
  819. X***************
  820. X*** 925,937 ****
  821. X      } else {
  822. X          /* no new capitol assignment */
  823. X          if(ispc(curntn->active)) {
  824. X!             mailopen(country);
  825. X              fprintf(fm,"Message to %s from Conquer\n\n",ntn[country].name);
  826. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  827. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  828. X              fprintf(fm,"\tNo other land remains.  The destruction\n");
  829. X              fprintf(fm,"\t of your nation seems imminent.\n");
  830. X!             mailclose();
  831. X          }
  832. X      }
  833. X      /* restore */
  834. X--- 932,945 ----
  835. X      } else {
  836. X          /* no new capitol assignment */
  837. X          if(ispc(curntn->active)) {
  838. X!             if(mailopen(country)!=(-1)) {
  839. X              fprintf(fm,"Message to %s from Conquer\n\n",ntn[country].name);
  840. X              fprintf(fm,"\tYour Capitol at sector location %d,%d\n",curntn->capx,curntn->capy);
  841. X              fprintf(fm,"\t was overrun by nation %s.\n\n",ntn[nation].name);
  842. X              fprintf(fm,"\tNo other land remains.  The destruction\n");
  843. X              fprintf(fm,"\t of your nation seems imminent.\n");
  844. X!             mailclose(country);
  845. X!             }
  846. X          }
  847. X      }
  848. X      /* restore */
  849. X***************
  850. X*** 1375,1381 ****
  851. X  
  852. X      /* check for 'god' */
  853. X      if (strcmp("god",name)==0) hold=0;
  854. X!     if (strcmp("news",name)==0) hold= -2;
  855. X  
  856. X      /* check for numbers if name too long */
  857. X      if (hold==NTOTAL) {
  858. X--- 1383,1389 ----
  859. X  
  860. X      /* check for 'god' */
  861. X      if (strcmp("god",name)==0) hold=0;
  862. X!     if (strcmp("news",name)==0) hold= NEWSMAIL;
  863. X  
  864. X      /* check for numbers if name too long */
  865. X      if (hold==NTOTAL) {
  866. X***************
  867. X*** 1454,1485 ****
  868. X  }
  869. X  #endif ADMIN
  870. X  
  871. X! void
  872. X  mailopen(to)
  873. X  {
  874. X      char    line[LINELTH];
  875. X!     if(mailok == TRUE) mailclose();
  876. X  
  877. X!     if (to != -2)
  878. X!         sprintf(line,"%s%d",msgfile,to);
  879. X!     else
  880. X!         sprintf(line,"news%d",TURN -1);    /* -1 so it appears in
  881. X!                            the news now        */
  882. X!     if ((fm=fopen(line,"a+"))==NULL) {
  883. X!         printf("error opening %s",line);
  884. X!         return;
  885. X      }
  886. X!     mailok=TRUE;
  887. X  }
  888. X  
  889. X  void
  890. X! mailclose()
  891. X  {
  892. X!     if(mailok==FALSE) return;
  893. X  
  894. X!     fputs("END\n",fm);
  895. X      fclose(fm);
  896. X!     mailok=FALSE;
  897. X  }
  898. X  
  899. X  #ifdef ADMIN
  900. X--- 1462,1539 ----
  901. X  }
  902. X  #endif ADMIN
  903. X  
  904. X! /* name of the currently open mail file */
  905. X! char tmp_mail_name[LINELTH];
  906. X! 
  907. X! int
  908. X  mailopen(to)
  909. X  {
  910. X      char    line[LINELTH];
  911. X!     if(mailok != DONEMAIL) mailclose(ABORTMAIL);
  912. X  
  913. X!     if (to != NEWSMAIL) {
  914. X! #ifdef CONQUER
  915. X!         /* check if the player is currently reading messages */
  916. X!         sprintf(line,"%s%hd.tmp",msgfile,to);
  917. X!         if (access(line,00)==0) {
  918. X!             if (to>0 && to<NTOTAL) {
  919. X!                 sprintf(line,"Nation %s is reading their mail... try again later.", ntn[to].name);
  920. X!                 errormsg(line);
  921. X!             }
  922. X!             return(-1);
  923. X!         }
  924. X! 
  925. X!         /* otherwise continue; checking for others */
  926. X!         /* this file name is also used in rmessages() */
  927. X!         sprintf(tmp_mail_name,"send.%s%hd",msgfile,to);
  928. X!         if (access(tmp_mail_name,00)==0) {
  929. X!             if (to>=0 && to<NTOTAL)
  930. X!             errormsg("Someone is already sending mail to Nation %s... try again later.", ntn[to].name);
  931. X!             return(-1);
  932. X!         }
  933. X! #endif /*CONQUER*/
  934. X! #ifdef ADMIN
  935. X!         sprintf(tmp_mail_name,"%s%hd",msgfile,to);
  936. X! #endif /*ADMIN*/
  937. X!     } else {
  938. X!         /* send to a location marked by the current player */
  939. X!         sprintf(tmp_mail_name,"send.news%d", country);
  940. X      }
  941. X!     if ((fm=fopen(tmp_mail_name,"a+"))==NULL) {
  942. X!         fprintf(stderr,"error opening %s",tmp_mail_name);
  943. X!         return(-1);
  944. X!     }
  945. X!     mailok=to;
  946. X  }
  947. X  
  948. X  void
  949. X! mailclose(to)
  950. X  {
  951. X!     char line[BIGLTH];
  952. X  
  953. X!     if(mailok==DONEMAIL) return;
  954. X! 
  955. X!     if(to >= 0) {
  956. X!         fputs("END\n",fm);
  957. X!     }
  958. X      fclose(fm);
  959. X! 
  960. X! #ifdef CONQUER
  961. X!     if((to!=ABORTMAIL)&&(to==mailok)) {
  962. X!         if (to==NEWSMAIL) {
  963. X!             /* send to the current newspaper */
  964. X!             sprintf(line,"cat %s >> news%d",tmp_mail_name,TURN-1);
  965. X!         } else {
  966. X!             /* send to the player now */
  967. X!             sprintf(line,"cat %s >> %s%d",tmp_mail_name,msgfile,to);
  968. X!         }
  969. X!         system(line);
  970. X!     }
  971. X!     if (tmp_mail_name!=NULL) {
  972. X!         (void) unlink(tmp_mail_name);
  973. X!     }
  974. X! #endif /*CONQUER*/
  975. X!     mailok=DONEMAIL;
  976. X  }
  977. X  
  978. X  #ifdef ADMIN
  979. X*** oreports.c    Wed Sep 20 21:41:00 1989
  980. X--- reports.c    Wed Sep 20 21:41:26 1989
  981. X***************
  982. X*** 65,74 ****
  983. X              return;
  984. X          }
  985. X      }
  986. X-     count2=0;
  987. X      /*new army screen*/
  988. X      while(done==FALSE) {
  989. X!         clear();
  990. X          armynum=count2;
  991. X          xpos=BUF_COLS;
  992. X          ypos=2;
  993. X--- 65,76 ----
  994. X              return;
  995. X          }
  996. X      }
  997. X      /*new army screen*/
  998. X+     clear();
  999. X+     count2=0;
  1000. X      while(done==FALSE) {
  1001. X!         move(0,0);
  1002. X!         clrtobot();
  1003. X          armynum=count2;
  1004. X          xpos=BUF_COLS;
  1005. X          ypos=2;
  1006. X***************
  1007. X*** 194,200 ****
  1008. X                      /*spys are given a shut up fee */
  1009. X                      mvprintw(LINES-4,0,"Your spy demands %ld talons to remain quiet",
  1010. X                      *(u_encost+(P_ATYPE%UTYPE)) * 2);
  1011. X!                     mvprintw(LINES-3,0,"Pay him off? (y or n)");
  1012. X                      clrtoeol();
  1013. X                      refresh();
  1014. X                      if(getch()=='y'){
  1015. X--- 196,202 ----
  1016. X                      /*spys are given a shut up fee */
  1017. X                      mvprintw(LINES-4,0,"Your spy demands %ld talons to remain quiet",
  1018. X                      *(u_encost+(P_ATYPE%UTYPE)) * 2);
  1019. X!                     mvaddstr(LINES-3,0,"Pay him off? (y or n)");
  1020. X                      clrtoeol();
  1021. X                      refresh();
  1022. X                      if(getch()=='y'){
  1023. X***************
  1024. X*** 208,214 ****
  1025. X                      mvprintw(LINES-4,0,"Your mercenaries demand %ld talons to disband",
  1026. X                      *(u_encost+(P_ATYPE%UTYPE)) * P_ASOLD);
  1027. X      
  1028. X!                     mvprintw(LINES-3,0,"Give them severance pay? (y or n)");
  1029. X                      clrtoeol();
  1030. X                      refresh();
  1031. X                      if(getch()=='y'){
  1032. X--- 210,216 ----
  1033. X                      mvprintw(LINES-4,0,"Your mercenaries demand %ld talons to disband",
  1034. X                      *(u_encost+(P_ATYPE%UTYPE)) * P_ASOLD);
  1035. X      
  1036. X!                     mvaddstr(LINES-3,0,"Give them severance pay? (y or n)");
  1037. X                      clrtoeol();
  1038. X                      refresh();
  1039. X                      if(getch()=='y'){
  1040. X***************
  1041. X*** 497,505 ****
  1042. X          }
  1043. X        }
  1044. X  
  1045. X      count2=0;
  1046. X      while(done==FALSE) {
  1047. X!         clear();
  1048. X          ypos=2;
  1049. X          xpos=BUF_COLS;
  1050. X          count=0;
  1051. X--- 499,509 ----
  1052. X          }
  1053. X        }
  1054. X  
  1055. X+     clear();
  1056. X      count2=0;
  1057. X      while(done==FALSE) {
  1058. X!         move(0,0);
  1059. X!         clrtobot();
  1060. X          ypos=2;
  1061. X          xpos=BUF_COLS;
  1062. X          count=0;
  1063. X***************
  1064. X*** 524,530 ****
  1065. X                  standout();
  1066. X                  mvprintw(ypos,xpos,"%d:",nvynum);
  1067. X                  standend();
  1068. X!                 mvprintw(ypos+1,xpos,"lt/md/hv");
  1069. X                  mvprintw(ypos+2,xpos,"%2hd/%2hd/%2hd",P_NWAR(N_LIGHT),P_NWAR(N_MEDIUM),P_NWAR(N_HEAVY));
  1070. X                  mvprintw(ypos+3,xpos,"%2hd/%2hd/%2hd",P_NMER(N_LIGHT),P_NMER(N_MEDIUM),P_NMER(N_HEAVY));
  1071. X                  mvprintw(ypos+4,xpos,"%2hd/%2hd/%2hd",P_NGAL(N_LIGHT),P_NGAL(N_MEDIUM),P_NGAL(N_HEAVY));
  1072. X--- 528,534 ----
  1073. X                  standout();
  1074. X                  mvprintw(ypos,xpos,"%d:",nvynum);
  1075. X                  standend();
  1076. X!                 mvaddstr(ypos+1,xpos,"lt/md/hv");
  1077. X                  mvprintw(ypos+2,xpos,"%2hd/%2hd/%2hd",P_NWAR(N_LIGHT),P_NWAR(N_MEDIUM),P_NWAR(N_HEAVY));
  1078. X                  mvprintw(ypos+3,xpos,"%2hd/%2hd/%2hd",P_NMER(N_LIGHT),P_NMER(N_MEDIUM),P_NMER(N_HEAVY));
  1079. X                  mvprintw(ypos+4,xpos,"%2hd/%2hd/%2hd",P_NGAL(N_LIGHT),P_NGAL(N_MEDIUM),P_NGAL(N_HEAVY));
  1080. X*** ocombat.c    Wed Sep 20 21:40:54 1989
  1081. X--- combat.c    Wed Sep 20 21:41:26 1989
  1082. X***************
  1083. X*** 35,40 ****
  1084. X--- 35,41 ----
  1085. X  int    xspot,yspot;        /*location of battles*/
  1086. X  int    anation;        /*nation attacking in this fight*/
  1087. X  int    dnation;        /*one nation defending in this fight*/
  1088. X+ int    count=0;                /*number of armies or navies in sector*/
  1089. X  
  1090. X  /************************************************************************/
  1091. X  /*    COMBAT()    run all combat on the map            */
  1092. X***************
  1093. X*** 49,55 ****
  1094. X      int    initialized=FALSE;    /* TRUE if arrays initialized */
  1095. X      short    armynum,nvynum;
  1096. X      int    valid;
  1097. X-     int    count=0;
  1098. X      struct  s_nation *nptr;
  1099. X      struct  army     *aptr;
  1100. X  
  1101. X--- 50,55 ----
  1102. X***************
  1103. X*** 195,201 ****
  1104. X      int    done;
  1105. X      int    i,j,k;
  1106. X      long    asold=0,dsold=0;    /*a's and d's total soldiers*/
  1107. X!     long    astr=0,dstr=0;        /*a's and d's relative strength*/
  1108. X      long    Aloss,Dloss;        /*a's and d's total losses*/
  1109. X      int    PAloss,PDloss;        /*percent a and d loss*/
  1110. X      long    loss;
  1111. X--- 195,201 ----
  1112. X      int    done;
  1113. X      int    i,j,k;
  1114. X      long    asold=0,dsold=0;    /*a's and d's total soldiers*/
  1115. X!     float astr=0,dstr=0;        /*a's and d's relative strength*/
  1116. X      long    Aloss,Dloss;        /*a's and d's total losses*/
  1117. X      int    PAloss,PDloss;        /*percent a and d loss*/
  1118. X      long    loss;
  1119. X***************
  1120. X*** 204,210 ****
  1121. X      short    nvamps=0;        /* number of vampire armies */
  1122. X  
  1123. X      /* determine who is attacker & who is on defenders side?*/
  1124. X!     for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
  1125. X          if(owner[j]==anation) side[j]=ATKR;
  1126. X          else if(owner[j]==dnation) side[j]=DFND;
  1127. X          else if(ntn[anation].dstatus[owner[j]]==JIHAD) side[j]=DFND;
  1128. X--- 204,210 ----
  1129. X      short    nvamps=0;        /* number of vampire armies */
  1130. X  
  1131. X      /* determine who is attacker & who is on defenders side?*/
  1132. X!     for(j=0;j<count;j++) if(owner[j]!=(-1)){
  1133. X          if(owner[j]==anation) side[j]=ATKR;
  1134. X          else if(owner[j]==dnation) side[j]=DFND;
  1135. X          else if(ntn[anation].dstatus[owner[j]]==JIHAD) side[j]=DFND;
  1136. X***************
  1137. X*** 218,224 ****
  1138. X      /*calculate number of troops and assign statuses */
  1139. X      asold=0;
  1140. X      dsold=0;
  1141. X!     for(i=0;i<MGKNUM;i++) if(owner[i]>(-1)) {
  1142. X          /* record troops for all units in sector */
  1143. X          troops[i]=ntn[owner[i]].arm[unit[i]].sold;
  1144. X  
  1145. X--- 218,224 ----
  1146. X      /*calculate number of troops and assign statuses */
  1147. X      asold=0;
  1148. X      dsold=0;
  1149. X!     for(i=0;i<count;i++) if(owner[i]>(-1)) {
  1150. X          /* record troops for all units in sector */
  1151. X          troops[i]=ntn[owner[i]].arm[unit[i]].sold;
  1152. X  
  1153. X***************
  1154. X*** 228,239 ****
  1155. X          &&( ntn[owner[i]].arm[unit[i]].stat < NUMSTATUS )
  1156. X          &&( rand()%100<15 )) {
  1157. X              if( ispc(ntn[owner[i]].active)) {
  1158. X!                 mailopen( owner[i] );
  1159. X!                 fprintf(fm,"Message to %s from Conquer\n",ntn[owner[i]].name);
  1160. X!                 fprintf(fm,"\n  Your %s Army %d Refuses to Fight\n",
  1161. X                    unittype[ntn[owner[i]].arm[unit[i]].unittyp],
  1162. X                    unit[i]);
  1163. X!                 mailclose();
  1164. X              }
  1165. X              retreatside = side[i];
  1166. X              fdxyretreat();
  1167. X--- 228,240 ----
  1168. X          &&( ntn[owner[i]].arm[unit[i]].stat < NUMSTATUS )
  1169. X          &&( rand()%100<15 )) {
  1170. X              if( ispc(ntn[owner[i]].active)) {
  1171. X!                 if (mailopen( owner[i] )!=(-1)) {
  1172. X!                 fprintf(fm,"Message to %s from Conquer\n\n",ntn[owner[i]].name);
  1173. X!                 fprintf(fm,"  Your %s Army %d Refuses to Fight\n",
  1174. X                    unittype[ntn[owner[i]].arm[unit[i]].unittyp],
  1175. X                    unit[i]);
  1176. X!                 mailclose(owner[i]);
  1177. X!                 }
  1178. X              }
  1179. X              retreatside = side[i];
  1180. X              fdxyretreat();
  1181. X***************
  1182. X*** 281,287 ****
  1183. X      else    odds = (asold*100)/dsold;
  1184. X  
  1185. X      /* mercenaries/orcs/goblins might run away */
  1186. X!     for(i=0;i<MGKNUM;i++) if(owner[i]>(-1)) {
  1187. X          if(((( odds > 200 )&&(side[i]==DFND))
  1188. X          ||(( odds < 100 )&&(side[i]==ATKR)))
  1189. X          &&((ntn[owner[i]].arm[unit[i]].unittyp == A_MERCENARY)
  1190. X--- 282,288 ----
  1191. X      else    odds = (asold*100)/dsold;
  1192. X  
  1193. X      /* mercenaries/orcs/goblins might run away */
  1194. X!     for(i=0;i<count;i++) if(owner[i]>(-1)) {
  1195. X          if(((( odds > 200 )&&(side[i]==DFND))
  1196. X          ||(( odds < 100 )&&(side[i]==ATKR)))
  1197. X          &&((ntn[owner[i]].arm[unit[i]].unittyp == A_MERCENARY)
  1198. X***************
  1199. X*** 290,301 ****
  1200. X          &&(ntn[owner[i]].arm[unit[i]].stat < NUMSTATUS)
  1201. X          &&( rand()%100<30 )) {
  1202. X              if( ispc(ntn[owner[i]].active)) {
  1203. X!                 mailopen( owner[i] );
  1204. X!                 fprintf(fm,"Message to %s from Conquer\n",ntn[owner[i]].name);
  1205. X                  fprintf(fm,"  Your %s Army %d Runs Away\n",
  1206. X                    unittype[ntn[owner[i]].arm[unit[i]].unittyp],
  1207. X                    unit[i]);
  1208. X!                 mailclose();
  1209. X              }
  1210. X              retreatside = side[i];
  1211. X              if( side[i] == ATKR ) asold-= troops[i];
  1212. X--- 291,303 ----
  1213. X          &&(ntn[owner[i]].arm[unit[i]].stat < NUMSTATUS)
  1214. X          &&( rand()%100<30 )) {
  1215. X              if( ispc(ntn[owner[i]].active)) {
  1216. X!                 if(mailopen( owner[i] )!=(-1)) {
  1217. X!                 fprintf(fm,"Message to %s from Conquer\n\n",ntn[owner[i]].name);
  1218. X                  fprintf(fm,"  Your %s Army %d Runs Away\n",
  1219. X                    unittype[ntn[owner[i]].arm[unit[i]].unittyp],
  1220. X                    unit[i]);
  1221. X!                 mailclose(owner[i]);
  1222. X!                 }
  1223. X              }
  1224. X              retreatside = side[i];
  1225. X              if( side[i] == ATKR ) asold-= troops[i];
  1226. X***************
  1227. X*** 324,330 ****
  1228. X      /* CALCULATE AVERAGE COMBAT BONUS */
  1229. X      abonus=0;
  1230. X      dbonus=0;
  1231. X!     for(i=0;i<MGKNUM;i++) if(owner[i]>(-1)) {
  1232. X          if(side[i]==ATKR)
  1233. X              abonus += cbonus(i)*troops[i];
  1234. X          else if(side[i]==DFND && ntn[owner[i]].arm[unit[i]].stat!=RULE)
  1235. X--- 326,332 ----
  1236. X      /* CALCULATE AVERAGE COMBAT BONUS */
  1237. X      abonus=0;
  1238. X      dbonus=0;
  1239. X!     for(i=0;i<count;i++) if(owner[i]>(-1)) {
  1240. X          if(side[i]==ATKR)
  1241. X              abonus += cbonus(i)*troops[i];
  1242. X          else if(side[i]==DFND && ntn[owner[i]].arm[unit[i]].stat!=RULE)
  1243. X***************
  1244. X*** 334,340 ****
  1245. X      /*archer bonus if not in fort vs knights/cavalry*/
  1246. X      j=0;
  1247. X      k=0;
  1248. X!     for(i=0;i<MGKNUM;i++) if(owner[i]>(-1))
  1249. X      if(ISCITY(sct[xspot][yspot].designation)){
  1250. X          if((ntn[owner[i]].arm[unit[i]].unittyp == A_CAVALRY)
  1251. X          ||(ntn[owner[i]].arm[unit[i]].unittyp == A_KNIGHT))
  1252. X--- 336,342 ----
  1253. X      /*archer bonus if not in fort vs knights/cavalry*/
  1254. X      j=0;
  1255. X      k=0;
  1256. X!     for(i=0;i<count;i++) if(owner[i]>(-1))
  1257. X      if(ISCITY(sct[xspot][yspot].designation)){
  1258. X          if((ntn[owner[i]].arm[unit[i]].unittyp == A_CAVALRY)
  1259. X          ||(ntn[owner[i]].arm[unit[i]].unittyp == A_KNIGHT))
  1260. X***************
  1261. X*** 342,348 ****
  1262. X          else if(side[i]==DFND) k+=troops[i];
  1263. X      }
  1264. X  
  1265. X!     for(i=0;i<MGKNUM;i++) if(owner[i]>(-1)) {
  1266. X          if(j>0) abonus += (15 * j * troops[i]) / asold;
  1267. X          if(k>0 && dsold>0) dbonus += (15 * k * troops[i]) / dsold;
  1268. X      }
  1269. X--- 344,350 ----
  1270. X          else if(side[i]==DFND) k+=troops[i];
  1271. X      }
  1272. X  
  1273. X!     for(i=0;i<count;i++) if(owner[i]>(-1)) {
  1274. X          if(j>0) abonus += (15 * j * troops[i]) / asold;
  1275. X          if(k>0 && dsold>0) dbonus += (15 * k * troops[i]) / dsold;
  1276. X      }
  1277. X***************
  1278. X*** 351,357 ****
  1279. X      if (dsold>0) dbonus/=dsold;
  1280. X  
  1281. X      /*CALCULATED BONUSES TO WHOLE COMBAT*/
  1282. X!     for(i=0;i<MGKNUM;i++) if(owner[i]>(-1)) {
  1283. X          if(fort_val(&sct[xspot][yspot]) != 0){
  1284. X              /*Catapults add +1%/20 men defending castle (max +10%)*/
  1285. X              if((ntn[owner[i]].arm[unit[i]].unittyp == A_CATAPULT)
  1286. X--- 353,359 ----
  1287. X      if (dsold>0) dbonus/=dsold;
  1288. X  
  1289. X      /*CALCULATED BONUSES TO WHOLE COMBAT*/
  1290. X!     for(i=0;i<count;i++) if(owner[i]>(-1)) {
  1291. X          if(fort_val(&sct[xspot][yspot]) != 0){
  1292. X              /*Catapults add +1%/20 men defending castle (max +10%)*/
  1293. X              if((ntn[owner[i]].arm[unit[i]].unittyp == A_CATAPULT)
  1294. X***************
  1295. X*** 472,478 ****
  1296. X      if(PDloss>100) PDloss = 100;
  1297. X  
  1298. X      Aloss = Dloss = 0;
  1299. X!     for(i=0;i<MGKNUM;i++) if(owner[i]>(-1)){
  1300. X          if(side[i]==ATKR){
  1301. X              if( ntn[owner[i]].arm[unit[i]].unittyp >= MINLEADER) {
  1302. X                  if((rand()%100) < PAloss){ /* kill it */
  1303. X--- 474,480 ----
  1304. X      if(PDloss>100) PDloss = 100;
  1305. X  
  1306. X      Aloss = Dloss = 0;
  1307. X!     for(i=0;i<count;i++) if(owner[i]>(-1)){
  1308. X          if(side[i]==ATKR){
  1309. X              if( ntn[owner[i]].arm[unit[i]].unittyp >= MINLEADER) {
  1310. X                  if((rand()%100) < PAloss){ /* kill it */
  1311. X***************
  1312. X*** 546,557 ****
  1313. X      fprintf(fnews,"4.\tBattle in %d,%d",xspot,yspot);
  1314. X      k = 25;
  1315. X  #endif
  1316. X!     for(j=0;j<MGKNUM;j++) if(UOWNER(j)>(-1)){
  1317. X          done=FALSE;
  1318. X          for(i=0;i<j;i++) if(UOWNER(j)==UOWNER(i)) done=TRUE;
  1319. X          if(done==FALSE) {
  1320. X              loss=NTRL;
  1321. X!             for(i=j;(loss==NTRL||loss==WIMP) && i<MGKNUM;i++)
  1322. X                  if(UOWNER(i)==UOWNER(j)) {
  1323. X                      if(owner[i]<(-1)) loss=WIMP;
  1324. X                      else loss=side[i];
  1325. X--- 548,559 ----
  1326. X      fprintf(fnews,"4.\tBattle in %d,%d",xspot,yspot);
  1327. X      k = 25;
  1328. X  #endif
  1329. X!     for(j=0;j<count;j++) if(UOWNER(j)>(-1)){
  1330. X          done=FALSE;
  1331. X          for(i=0;i<j;i++) if(UOWNER(j)==UOWNER(i)) done=TRUE;
  1332. X          if(done==FALSE) {
  1333. X              loss=NTRL;
  1334. X!             for(i=j;(loss==NTRL||loss==WIMP) && i<count;i++)
  1335. X                  if(UOWNER(i)==UOWNER(j)) {
  1336. X                      if(owner[i]<(-1)) loss=WIMP;
  1337. X                      else loss=side[i];
  1338. X***************
  1339. X*** 574,580 ****
  1340. X      }
  1341. X      fprintf(fnews,"\n");
  1342. X      if(nvamps>0){
  1343. X!         for(i=0;i<MGKNUM;i++) if(owner[i]>(-1)){
  1344. X              if((magic(owner[i],VAMPIRE)==TRUE)
  1345. X              &&(ntn[owner[i]].arm[unit[i]].unittyp==A_ZOMBIE)
  1346. X              &&(ntn[owner[i]].arm[unit[i]].sold > 0))
  1347. X--- 576,582 ----
  1348. X      }
  1349. X      fprintf(fnews,"\n");
  1350. X      if(nvamps>0){
  1351. X!         for(i=0;i<count;i++) if(owner[i]>(-1)){
  1352. X              if((magic(owner[i],VAMPIRE)==TRUE)
  1353. X              &&(ntn[owner[i]].arm[unit[i]].unittyp==A_ZOMBIE)
  1354. X              &&(ntn[owner[i]].arm[unit[i]].sold > 0))
  1355. X***************
  1356. X*** 583,589 ****
  1357. X      }
  1358. X  
  1359. X      /*who is in the battle; but don't send to scared armies */
  1360. X!     for(j=0;j<MGKNUM;j++) if(owner[j]>(-1)){
  1361. X          done=FALSE;
  1362. X  
  1363. X          /*first time your nation appears done=FALSE*/
  1364. X--- 585,591 ----
  1365. X      }
  1366. X  
  1367. X      /*who is in the battle; but don't send to scared armies */
  1368. X!     for(j=0;j<count;j++) if(owner[j]>(-1)){
  1369. X          done=FALSE;
  1370. X  
  1371. X          /*first time your nation appears done=FALSE*/
  1372. X***************
  1373. X*** 592,600 ****
  1374. X          if((done==FALSE)&&(ispc(ntn[owner[j]].active))) {
  1375. X  
  1376. X              loss=NTRL;
  1377. X!             for(i=j;loss==NTRL && i<MGKNUM;i++)
  1378. X                  loss=side[i];
  1379. X!             mailopen( owner[j] );
  1380. X  
  1381. X              fprintf(fm,"BATTLE SUMMARY for sector %d, %d\n",xspot,yspot);
  1382. X              fprintf(fm,"Battle occured during %s of Year %d\n",PSEASON(TURN),YEAR(TURN));
  1383. X--- 594,602 ----
  1384. X          if((done==FALSE)&&(ispc(ntn[owner[j]].active))) {
  1385. X  
  1386. X              loss=NTRL;
  1387. X!             for(i=j;loss==NTRL && i<count;i++)
  1388. X                  loss=side[i];
  1389. X!             if (mailopen( owner[j] )==(-1)) continue;
  1390. X  
  1391. X              fprintf(fm,"BATTLE SUMMARY for sector %d, %d\n",xspot,yspot);
  1392. X              fprintf(fm,"Battle occured during %s of Year %d\n",PSEASON(TURN),YEAR(TURN));
  1393. X***************
  1394. X*** 606,621 ****
  1395. X              else    fprintf(fm,"You are Neutral\n");
  1396. X  
  1397. X              /*detail all participants in battle*/
  1398. X!             for(k=0;k<MGKNUM;k++) if(owner[k]!=(-1)){
  1399. X                  fprintf(fm," %s ",ntn[UOWNER(k)].name);
  1400. X                  if(owner[k]<(-1))
  1401. X                      fprintf(fm,"chickens out: ");
  1402. X                  else if(side[k]==DFND
  1403. X!                 && ntn[UOWNER(k)].arm[unit[k]].stat!=RULE)
  1404. X                      fprintf(fm,"defending: ");
  1405. X                  else if(side[k]==ATKR)
  1406. X                      fprintf(fm,"attacking: ");
  1407. X!                 else fprintf(fm,"neutral: ");
  1408. X                  fprintf(fm,"army %d (%s, men %d, bonus=%d, loss=%d)",
  1409. X                      unit[k],
  1410. X                      unittype[ntn[UOWNER(k)].arm[unit[k]].unittyp%UTYPE],
  1411. X--- 608,629 ----
  1412. X              else    fprintf(fm,"You are Neutral\n");
  1413. X  
  1414. X              /*detail all participants in battle*/
  1415. X!             for(k=0;k<count;k++) if(owner[k]!=(-1)){
  1416. X                  fprintf(fm," %s ",ntn[UOWNER(k)].name);
  1417. X                  if(owner[k]<(-1))
  1418. X                      fprintf(fm,"chickens out: ");
  1419. X                  else if(side[k]==DFND
  1420. X!                 && ntn[owner[k]].arm[unit[k]].stat!=RULE)
  1421. X                      fprintf(fm,"defending: ");
  1422. X                  else if(side[k]==ATKR)
  1423. X                      fprintf(fm,"attacking: ");
  1424. X!                 else if(side[k]==NTRL
  1425. X!                 || (side[k]==DFND
  1426. X!                     && ntn[owner[k]].arm[unit[k]].stat==RULE))
  1427. X!                     fprintf(fm,"neutral: ");
  1428. X!                 else
  1429. X!                     fprintf(fm,"in limbo: ");
  1430. X!             
  1431. X                  fprintf(fm,"army %d (%s, men %d, bonus=%d, loss=%d)",
  1432. X                      unit[k],
  1433. X                      unittype[ntn[UOWNER(k)].arm[unit[k]].unittyp%UTYPE],
  1434. X***************
  1435. X*** 643,649 ****
  1436. X              if(Dloss<dsold)
  1437. X              fprintf(fm,"Additionally, All defenders retreat to %d %d\n",retreatx,retreaty);
  1438. X              }
  1439. X!             mailclose();
  1440. X          }
  1441. X      }
  1442. X      retreat( -1 );
  1443. X--- 651,657 ----
  1444. X              if(Dloss<dsold)
  1445. X              fprintf(fm,"Additionally, All defenders retreat to %d %d\n",retreatx,retreaty);
  1446. X              }
  1447. X!             mailclose(owner[j]);
  1448. X          }
  1449. X      }
  1450. X      retreat( -1 );
  1451. X***************
  1452. X*** 794,800 ****
  1453. X  
  1454. X      if(retreatside == 0) return;
  1455. X  
  1456. X!     for(cnum=0;cnum<MGKNUM;cnum++) if(owner[cnum]>(-1)){
  1457. X          if( unitnum != (-1) ) cnum=unitnum;
  1458. X          if((side[cnum]==ATKR)&&(retreatside==ATKR)){
  1459. X              ntn[owner[cnum]].arm[unit[cnum]].xloc = retreatx;
  1460. X--- 802,808 ----
  1461. X  
  1462. X      if(retreatside == 0) return;
  1463. X  
  1464. X!     for(cnum=0;cnum<count;cnum++) if(owner[cnum]>(-1)){
  1465. X          if( unitnum != (-1) ) cnum=unitnum;
  1466. X          if((side[cnum]==ATKR)&&(retreatside==ATKR)){
  1467. X              ntn[owner[cnum]].arm[unit[cnum]].xloc = retreatx;
  1468. X***************
  1469. X*** 840,846 ****
  1470. X      printf("In Naval Combat....\n");
  1471. X  
  1472. X      /* determine who is attacker & who is on defenders side?*/
  1473. X!     for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
  1474. X          if(owner[j]==anation) side[j]=ATKR;
  1475. X          else if(ntn[anation].dstatus[owner[j]]==JIHAD) side[j]=DFND;
  1476. X          else if(ntn[owner[j]].dstatus[anation]==JIHAD) side[j]=DFND;
  1477. X--- 848,854 ----
  1478. X      printf("In Naval Combat....\n");
  1479. X  
  1480. X      /* determine who is attacker & who is on defenders side?*/
  1481. X!     for(j=0;j<count;j++) if(owner[j]!=(-1)){
  1482. X          if(owner[j]==anation) side[j]=ATKR;
  1483. X          else if(ntn[anation].dstatus[owner[j]]==JIHAD) side[j]=DFND;
  1484. X          else if(ntn[owner[j]].dstatus[anation]==JIHAD) side[j]=DFND;
  1485. X***************
  1486. X*** 864,870 ****
  1487. X        *     MARINE                          1/3
  1488. X       *     others                          4/3
  1489. X       */
  1490. X!     for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
  1491. X          curntn= &ntn[owner[j]];
  1492. X          country= owner[j];
  1493. X          wnum[j]=SHIPS(ntn[country].nvy[unit[j]].warships,N_LIGHT)+
  1494. X--- 872,878 ----
  1495. X        *     MARINE                          1/3
  1496. X       *     others                          4/3
  1497. X       */
  1498. X!     for(j=0;j<count;j++) if(owner[j]!=(-1)){
  1499. X          curntn= &ntn[owner[j]];
  1500. X          country= owner[j];
  1501. X          wnum[j]=SHIPS(ntn[country].nvy[unit[j]].warships,N_LIGHT)+
  1502. X***************
  1503. X*** 1016,1022 ****
  1504. X      if (PDloss>100) PDloss=100;
  1505. X  
  1506. X      /* calculate actual losses */
  1507. X!     for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
  1508. X          curntn= &ntn[owner[j]];
  1509. X          country= owner[j];
  1510. X  
  1511. X--- 1024,1030 ----
  1512. X      if (PDloss>100) PDloss=100;
  1513. X  
  1514. X      /* calculate actual losses */
  1515. X!     for(j=0;j<count;j++) if(owner[j]!=(-1)){
  1516. X          curntn= &ntn[owner[j]];
  1517. X          country= owner[j];
  1518. X  
  1519. X***************
  1520. X*** 1228,1234 ****
  1521. X  #else
  1522. X      fprintf(fnews,"4.\t%d,%d: Naval Battle",xspot,yspot);
  1523. X  #endif
  1524. X!     for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
  1525. X          k=0;
  1526. X          for(i=0;i<j;i++) if(owner[j]==owner[i]) k=1;
  1527. X          if(k==0) {
  1528. X--- 1236,1242 ----
  1529. X  #else
  1530. X      fprintf(fnews,"4.\t%d,%d: Naval Battle",xspot,yspot);
  1531. X  #endif
  1532. X!     for(j=0;j<count;j++) if(owner[j]!=(-1)){
  1533. X          k=0;
  1534. X          for(i=0;i<j;i++) if(owner[j]==owner[i]) k=1;
  1535. X          if(k==0) {
  1536. X***************
  1537. X*** 1241,1247 ****
  1538. X      fprintf(fnews,"\n");
  1539. X  
  1540. X      /*mail results; who is in the battle*/
  1541. X!     for(j=0;j<MGKNUM;j++) if(owner[j]!=(-1)){
  1542. X          done=FALSE;
  1543. X  
  1544. X          /*first time your nation appears done=FALSE*/
  1545. X--- 1249,1255 ----
  1546. X      fprintf(fnews,"\n");
  1547. X  
  1548. X      /*mail results; who is in the battle*/
  1549. X!     for(j=0;j<count;j++) if(owner[j]!=(-1)){
  1550. X          done=FALSE;
  1551. X  
  1552. X          /*first time your nation appears done=FALSE*/
  1553. X***************
  1554. X*** 1248,1254 ****
  1555. X          for(i=0;i<j;i++) if(owner[j]==owner[i]) done=TRUE;
  1556. X  
  1557. X          if((done==FALSE)&&(ispc(ntn[owner[j]].active))) {
  1558. X!             mailopen( owner[j] );
  1559. X  
  1560. X              fprintf(fm,"NAVAL BATTLE in sector %d %d\n",xspot,yspot);
  1561. X              fprintf(fm,"Battle occured during %s of Year %d\n",
  1562. X--- 1256,1262 ----
  1563. X          for(i=0;i<j;i++) if(owner[j]==owner[i]) done=TRUE;
  1564. X  
  1565. X          if((done==FALSE)&&(ispc(ntn[owner[j]].active))) {
  1566. X!             if (mailopen( owner[j] )==(-1)) continue;
  1567. X  
  1568. X              fprintf(fm,"NAVAL BATTLE in sector %d %d\n",xspot,yspot);
  1569. X              fprintf(fm,"Battle occured during %s of Year %d\n",
  1570. X***************
  1571. X*** 1261,1267 ****
  1572. X              else    fprintf(fm,"You are on the Neutral Side\n");
  1573. X  
  1574. X              /*detail all participants in battle*/
  1575. X!             for(k=0;k<MGKNUM;k++) if(owner[k]!=(-1)){
  1576. X                  if(side[k]==DFND)
  1577. X                  fprintf(fm," %s is defender with navy ",ntn[owner[k]].name);
  1578. X                  else if(side[k]==ATKR)
  1579. X--- 1269,1275 ----
  1580. X              else    fprintf(fm,"You are on the Neutral Side\n");
  1581. X  
  1582. X              /*detail all participants in battle*/
  1583. X!             for(k=0;k<count;k++) if(owner[k]!=(-1)){
  1584. X                  if(side[k]==DFND)
  1585. X                  fprintf(fm," %s is defender with navy ",ntn[owner[k]].name);
  1586. X                  else if(side[k]==ATKR)
  1587. X***************
  1588. X*** 1283,1289 ****
  1589. X              show_ships("Defending","sunk",dwsunk,dgsunk,dmsunk);
  1590. X              show_ships("Attacking","captured",awcapt,agcapt,amcapt);
  1591. X              show_ships("Defending","captured",dwcapt,dgcapt,dmcapt);
  1592. X!             mailclose();
  1593. X          }
  1594. X      }
  1595. X      curntn= saventn;
  1596. X--- 1291,1297 ----
  1597. X              show_ships("Defending","sunk",dwsunk,dgsunk,dmsunk);
  1598. X              show_ships("Attacking","captured",awcapt,agcapt,amcapt);
  1599. X              show_ships("Defending","captured",dwcapt,dgcapt,dmcapt);
  1600. X!             mailclose(owner[j]);
  1601. X          }
  1602. X      }
  1603. X      curntn= saventn;
  1604. X***************
  1605. X*** 1302,1308 ****
  1606. X      printf("capture: hdcnt==%d typ==%d spsz==%d to==%d\n",holdcount,
  1607. X            type,shipsize,to);
  1608. X  #endif DEBUG
  1609. X!     for (i=0;holdcount && i<MGKNUM;i++) {
  1610. X          if (owner[i]!=(-1) && side[i]==to) {
  1611. X              curntn= &ntn[owner[i]];
  1612. X              holdcount -= fltwhold(unit[i]);
  1613. X--- 1310,1316 ----
  1614. X      printf("capture: hdcnt==%d typ==%d spsz==%d to==%d\n",holdcount,
  1615. X            type,shipsize,to);
  1616. X  #endif DEBUG
  1617. X!     for (i=0;holdcount && i<count;i++) {
  1618. X          if (owner[i]!=(-1) && side[i]==to) {
  1619. X              curntn= &ntn[owner[i]];
  1620. X              holdcount -= fltwhold(unit[i]);
  1621. X***************
  1622. X*** 1315,1321 ****
  1623. X  #ifdef DEBUG
  1624. X      printf("capture 2: holdcount==%d i==%d\n",holdcount,i);
  1625. X  #endif DEBUG
  1626. X!     if (i==MGKNUM) {
  1627. X          curntn = saventn;
  1628. X          return;
  1629. X      }
  1630. X--- 1323,1329 ----
  1631. X  #ifdef DEBUG
  1632. X      printf("capture 2: holdcount==%d i==%d\n",holdcount,i);
  1633. X  #endif DEBUG
  1634. X!     if (i==count) {
  1635. X          curntn = saventn;
  1636. X          return;
  1637. X      }
  1638. X*** omove.c    Wed Sep 20 21:40:56 1989
  1639. SHAR_EOF
  1640. echo "End of part 2, continue with part 3"
  1641. echo "3" > s2_seq_.tmp
  1642. exit 0
  1643.