home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch7b < prev    next >
Encoding:
Text File  |  1989-12-21  |  48.3 KB  |  1,635 lines

  1. Subject:  v08i077:  conquer4 - middle earth multi-player game (V4), Patch7b
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: Adam Bryant <adb@cs.bu.edu>
  6. Posting-number: Volume 8, Issue 77
  7. Archive-name: conquer4/Patch7b
  8. Patch-To: conquer4: Volume 6, Issue 83-96
  9.  
  10.  
  11. #!/bin/sh
  12. # this is part 2 of a multipart archive
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file patchV4.7 continued
  15. #
  16. CurArch=2
  17. if test ! -r s2_seq_.tmp
  18. then echo "Please unpack part 1 first!"
  19.      exit 1; fi
  20. ( read Scheck
  21.   if test "$Scheck" != $CurArch
  22.   then echo "Please unpack part $Scheck next!"
  23.        exit 1;
  24.   else exit 0; fi
  25. ) < s2_seq_.tmp || exit 1
  26. echo "x - Continuing file patchV4.7"
  27. sed 's/^X//' << 'SHAR_EOF' >> patchV4.7
  28. X!         if (stat(tmp_mail_name,&fst)==0) {
  29. X!             long now;
  30. X!             now = time(0);
  31. X!             if (now - fst.st_mtime < TIME_DEAD) {
  32. X!                 if (to>=0 && to<NTOTAL) {
  33. X!                     sprintf(line,"Someone is already mailing Nation %s... try again later.", ntn[to].name);
  34. X!                     errormsg(line);
  35. X!                 }
  36. X!                 return(-1);
  37. X!             } else {
  38. X!                 /* remove useless file */
  39. X!                 unlink(tmp_mail_name);
  40. X!             }
  41. X          }
  42. X  #endif /*CONQUER*/
  43. X  #ifdef ADMIN
  44. X***************
  45. X*** 1504,1516 ****
  46. X          return(-1);
  47. X      }
  48. X      mailok=to;
  49. X  }
  50. X  
  51. X  void
  52. X  mailclose(to)
  53. X  {
  54. X-     char line[BIGLTH];
  55. X- 
  56. X      if(mailok==DONEMAIL) return;
  57. X  
  58. X      if(to >= 0) {
  59. X--- 1531,1542 ----
  60. X          return(-1);
  61. X      }
  62. X      mailok=to;
  63. X+     return(0);
  64. X  }
  65. X  
  66. X  void
  67. X  mailclose(to)
  68. X  {
  69. X      if(mailok==DONEMAIL) return;
  70. X  
  71. X      if(to >= 0) {
  72. X***************
  73. X*** 1520,1525 ****
  74. X--- 1546,1552 ----
  75. X  
  76. X  #ifdef CONQUER
  77. X      if((to!=ABORTMAIL)&&(to==mailok)) {
  78. X+         char line[BIGLTH];
  79. X          if (to==NEWSMAIL) {
  80. X              /* send to the current newspaper */
  81. X              sprintf(line,"cat %s >> news%d",tmp_mail_name,TURN-1);
  82. X***************
  83. X*** 1788,1795 ****
  84. X  }
  85. X  
  86. X  #ifdef CONQUER
  87. X- #include    <sys/types.h>
  88. X- #include    <sys/stat.h>
  89. X  extern short xcurs;
  90. X  extern short ycurs;
  91. X  off_t conq_mail_size=0;
  92. X--- 1815,1820 ----
  93. X*** oreports.c    Tue Dec 12 21:19:37 1989
  94. X--- reports.c    Tue Dec 12 21:20:07 1989
  95. X***************
  96. X*** 299,305 ****
  97. X  {
  98. X      short armynum,nvynum;
  99. X      long numship=0L,costsold=0L,numsold=0L;
  100. X!     long nummonst=0L,costmonst=0L,money,chty;
  101. X      int isgod=FALSE;
  102. X  
  103. X      if(country==0) {
  104. X--- 299,305 ----
  105. X  {
  106. X      short armynum,nvynum;
  107. X      long numship=0L,costsold=0L,numsold=0L;
  108. X!     long nummonst=0L,costmonst=0L,money,chty,infmoney;
  109. X      int isgod=FALSE;
  110. X  
  111. X      if(country==0) {
  112. X***************
  113. X*** 330,368 ****
  114. X              numship+=flthold(nvynum);
  115. X  
  116. X      standout();
  117. X!     mvprintw(3,0,  "nation name is......%s",curntn->name);
  118. X      standend();
  119. X!     mvprintw(4,0,  "starting treasury..$%ld",startgold);
  120. X!     mvprintw(5,0,  "number of sectors...%d",spread.sectors);
  121. X      if(curntn->tfood<2*curntn->tciv) standout();
  122. X!     mvprintw(7,0,  "granary holds.....%8ld",curntn->tfood);
  123. X      standend();
  124. X!     mvprintw(8,0, "jewels owned......%8ld",curntn->jewels);
  125. X!     mvprintw(9,0, "metal ore owned...%8ld",curntn->metals);
  126. X!     mvprintw(3,COLS-50, "%8ld people in gold mines.%8ld",spread.ingold,spread.revjewels);
  127. X!     mvprintw(4,COLS-50, "%8ld people in mines......%8ld",spread.inmetal,spread.revmetal);
  128. X!     mvprintw(5,COLS-50, "%8ld people in farms......%8ld",spread.infarm,spread.revfood);
  129. X!     mvprintw(6,COLS-50,"%8ld people in cities.....%8ld",spread.incap,spread.revcap);
  130. X!     mvprintw(7,COLS-50,"%8ld people in towns......%8ld",spread.incity,spread.revcity);
  131. X!     mvprintw(8,COLS-50, "%8ld people elsewhere.....%8ld",spread.inothr,spread.revothr);
  132. X      standout();
  133. X!     mvprintw(9,COLS-50,"%8ld people INCOME........%8ld",spread.civilians,spread.gold - curntn->tgold);
  134. X      standend();
  135. X!     mvprintw(11,COLS-50,"%8ld troops...............%8ld",numsold,costsold);
  136. X!     mvprintw(12,COLS-50,"%8ld monsters.............%8ld",nummonst,costmonst);
  137. X  
  138. X!     mvprintw(13,COLS-50,"%8ld ship holds @ %4d....%8ld",numship,SHIPMAINT,numship*SHIPMAINT);
  139. X!     mvprintw(14,COLS-50,"other expenses this turn......%8ld",startgold-curntn->tgold);
  140. X      standout();
  141. X      money=costmonst+costsold+(numship*SHIPMAINT)+startgold-curntn->tgold;
  142. X!     mvprintw(15,COLS-50,"TOTAL EXPENSES................%8ld",money);
  143. X!     money=spread.gold - curntn->tgold - money;    /* net income */
  144. X      standend();
  145. X!     mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
  146. X      chty = max((money*(long)curntn->charity)/100L,0L);
  147. X!     mvprintw(16,COLS-50,"CHARITY.......................%8ld",chty);
  148. X      standout();
  149. X!     mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money-chty));
  150. X  
  151. X      mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
  152. X      mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
  153. X--- 330,375 ----
  154. X              numship+=flthold(nvynum);
  155. X  
  156. X      standout();
  157. X!     mvprintw(2,0,  "nation name is......%s",curntn->name);
  158. X      standend();
  159. X!     mvprintw(3,0,  "starting treasury..$%ld",startgold);
  160. X!     mvprintw(4,0,  "number of sectors...%d",spread.sectors);
  161. X      if(curntn->tfood<2*curntn->tciv) standout();
  162. X!     mvprintw(6,0,  "granary holds.....%8ld",curntn->tfood);
  163. X      standend();
  164. X!     mvprintw(7,0, "jewels owned......%8ld",curntn->jewels);
  165. X!     mvprintw(8,0, "metal ore owned...%8ld",curntn->metals);
  166. X!     mvprintw(2,COLS-50, "%8ld people in gold mines.%8ld",spread.ingold,spread.revjewels);
  167. X!     mvprintw(3,COLS-50, "%8ld people in mines......%8ld",spread.inmetal,spread.revmetal);
  168. X!     mvprintw(4,COLS-50, "%8ld people in farms......%8ld",spread.infarm,spread.revfood);
  169. X!     mvprintw(5,COLS-50,"%8ld people in cities.....%8ld",spread.incap,spread.revcap);
  170. X!     mvprintw(6,COLS-50,"%8ld people in towns......%8ld",spread.incity,spread.revcity);
  171. X!     mvprintw(7,COLS-50, "%8ld people elsewhere.....%8ld",spread.inothr,spread.revothr);
  172. X      standout();
  173. X!     mvprintw(8,COLS-50,"%8ld people INCOME........%8ld",spread.civilians,spread.gold - curntn->tgold);
  174. X      standend();
  175. X!     mvprintw(10,COLS-50,"%8ld troops...............%8ld",numsold,costsold);
  176. X!     mvprintw(11,COLS-50,"%8ld monsters.............%8ld",nummonst,costmonst);
  177. X  
  178. X!     mvprintw(12,COLS-50,"%8ld ship holds @ %4d....%8ld",numship,SHIPMAINT,numship*SHIPMAINT);
  179. X!     mvprintw(13,COLS-50,"other expenses this turn......%8ld",startgold-curntn->tgold);
  180. X      standout();
  181. X      money=costmonst+costsold+(numship*SHIPMAINT)+startgold-curntn->tgold;
  182. X!     mvprintw(14,COLS-50,"TOTAL EXPENSES................%8ld",money);
  183. X      standend();
  184. X!     money=spread.gold - curntn->tgold - money;    /* net income */
  185. X      chty = max((money*(long)curntn->charity)/100L,0L);
  186. X!     mvprintw(15,COLS-50,"CHARITY.......................%8ld",chty);
  187. X!     mvprintw(16,COLS-50,"NET INCOME....................%8ld",money);
  188. X!     infmoney = startgold + money - chty;
  189. X!     if (infmoney > 1000000L) {
  190. X!         infmoney = (long)(infmoney / (100.0+(float)curntn->inflation/4.0)) * 100L;
  191. X!     } else {
  192. X!         infmoney= (long) (infmoney * 100L) / (100.0 + (float) curntn->inflation/4.0);
  193. X!     }
  194. X!     mvprintw(17,COLS-50,"LOSS DUE TO INFLATION.........%8ld",(startgold + money-chty)-infmoney);
  195. X      standout();
  196. X!     mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",infmoney);
  197. X  
  198. X      mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
  199. X      mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
  200. X***************
  201. X*** 644,650 ****
  202. X                      NADJGAL;
  203. X                      NADJCRW;
  204. X                      NADJHLD;
  205. X!                     if(P_NMOVE>curntn->nvy[newnavy].smove)
  206. X                          curntn->nvy[newnavy].smove=P_NMOVE;
  207. X                      P_NMOVE=0;
  208. X                      NADJMOV;
  209. X--- 651,657 ----
  210. X                      NADJGAL;
  211. X                      NADJCRW;
  212. X                      NADJHLD;
  213. X!                     if(P_NMOVE<curntn->nvy[newnavy].smove)
  214. X                          curntn->nvy[newnavy].smove=P_NMOVE;
  215. X                      P_NMOVE=0;
  216. X                      NADJMOV;
  217. X*** ocombat.c    Tue Dec 12 21:19:34 1989
  218. X--- combat.c    Tue Dec 12 21:20:08 1989
  219. X***************
  220. X*** 633,640 ****
  221. X                  if((ntn[UOWNER(k)].arm[unit[k]].unittyp >= MINLEADER)
  222. X                  &&( ntn[UOWNER(k)].arm[unit[k]].sold == 0))
  223. X                      fprintf(fm," (killed)\n");
  224. X!                 else if((ntn[owner[k]].arm[unit[k]].unittyp == A_MILITIA)
  225. X!                 &&( ntn[owner[k]].arm[unit[k]].sold == 0))
  226. X                  fprintf(fm," (disbanded)\n");
  227. X                  else fputc('\n',fm);
  228. X              }
  229. X--- 633,640 ----
  230. X                  if((ntn[UOWNER(k)].arm[unit[k]].unittyp >= MINLEADER)
  231. X                  &&( ntn[UOWNER(k)].arm[unit[k]].sold == 0))
  232. X                      fprintf(fm," (killed)\n");
  233. X!                 else if((ntn[UOWNER(k)].arm[unit[k]].unittyp == A_MILITIA)
  234. X!                 &&( ntn[UOWNER(k)].arm[unit[k]].sold == 0))
  235. X                  fprintf(fm," (disbanded)\n");
  236. X                  else fputc('\n',fm);
  237. X              }
  238. X*** omove.c    Tue Dec 12 21:19:36 1989
  239. X--- move.c    Tue Dec 12 21:20:08 1989
  240. X***************
  241. X*** 276,286 ****
  242. X                  } else
  243. X                  if(((sct[XREAL][YREAL].designation==DTOWN)
  244. X                  ||(sct[XREAL][YREAL].designation==DCAPITOL)
  245. X!                 ||(sct[XREAL][YREAL].designation==DCITY))){
  246. X                      /* harbor */
  247. X!                     if(P_NMOVE>=4) P_NMOVE-=4;
  248. X                      else {
  249. X!                         errormsg("You need 4 move points for that");
  250. X                          valid=FALSE;
  251. X                          xcurs=oldxcurs;
  252. X                          ycurs=oldycurs;
  253. X--- 276,289 ----
  254. X                  } else
  255. X                  if(((sct[XREAL][YREAL].designation==DTOWN)
  256. X                  ||(sct[XREAL][YREAL].designation==DCAPITOL)
  257. X!                 ||(sct[XREAL][YREAL].designation==DCITY))
  258. X!                 &&(sct[XREAL][YREAL].owner==country
  259. X!                 ||(ntn[SOWN].dstatus[country]!=UNMET&&
  260. X!                 ntn[SOWN].dstatus[country]<=NEUTRAL))) {
  261. X                      /* harbor */
  262. X!                     if(P_NMOVE>=3) P_NMOVE-=3;
  263. X                      else {
  264. X!                         errormsg("You need 3 move points for that");
  265. X                          valid=FALSE;
  266. X                          xcurs=oldxcurs;
  267. X                          ycurs=oldycurs;
  268. X***************
  269. X*** 326,333 ****
  270. X                  P_NMOVE -= abs( movecost[XREAL][YREAL] );
  271. X              }
  272. X  
  273. X!             if(P_NMOVE==0) 
  274. X!                 done=TRUE;
  275. X  
  276. X          } else if(armornvy==AORN){
  277. X              errormsg("ERROR - NOT ARMY OR NAVY");
  278. X--- 329,335 ----
  279. X                  P_NMOVE -= abs( movecost[XREAL][YREAL] );
  280. X              }
  281. X  
  282. X!             if(P_NMOVE==0) done=TRUE;
  283. X  
  284. X          } else if(armornvy==AORN){
  285. X              errormsg("ERROR - NOT ARMY OR NAVY");
  286. X***************
  287. X*** 474,479 ****
  288. X--- 476,494 ----
  289. X          /* if (other owner and unoccupied) or (no owner) you take*/
  290. X          if(((P_ATYPE<MINLEADER)||(P_ASTAT==GENERAL))
  291. X          &&(P_ASOLD>0)){
  292. X+             /*calc enemy soldiers */
  293. X+             total=0;
  294. X+             for(Tnation=0;Tnation<NTOTAL;Tnation++)
  295. X+             if(Tnation!=country)
  296. X+             for(Tarmynum=0;Tarmynum<MAXARM;Tarmynum++)
  297. X+             if((ntn[Tnation].arm[Tarmynum].sold>0)
  298. X+             &&(ntn[Tnation].arm[Tarmynum].xloc==XREAL)
  299. X+             &&(ntn[Tnation].arm[Tarmynum].yloc==YREAL)
  300. X+             &&((curntn->dstatus[Tnation]>=HOSTILE)
  301. X+               ||(ntn[Tnation].dstatus[country]>=HOSTILE))
  302. X+             &&(ntn[Tnation].arm[Tarmynum].stat!=SCOUT)
  303. X+             &&(ntn[Tnation].arm[Tarmynum].unittyp!=A_NINJA))
  304. X+                 total+=ntn[Tnation].arm[Tarmynum].sold;
  305. X              if((groupmen>=TAKESECTOR)&&(SOWN==0 )){
  306. X                  mvaddstr(LINES-2,0,"Taking Unowned Sector");
  307. X                  clrtoeol();
  308. X***************
  309. X*** 573,581 ****
  310. X          refresh();
  311. X          getch();
  312. X      }
  313. X-     whatcansee();
  314. X      redraw=DONE;
  315. X      prep(country,FALSE);
  316. X      makemap();
  317. X      armornvy=AORN;
  318. X      pager=0;
  319. X--- 588,598 ----
  320. X          refresh();
  321. X          getch();
  322. X      }
  323. X      redraw=DONE;
  324. X      prep(country,FALSE);
  325. X+     whatcansee();
  326. X+     move(0,0);
  327. X+     clrtobot();
  328. X      makemap();
  329. X      armornvy=AORN;
  330. X      pager=0;
  331. X*** oupdate.c    Tue Dec 12 21:19:38 1989
  332. X--- update.c    Tue Dec 12 21:20:09 1989
  333. X***************
  334. X*** 12,20 ****
  335. X  
  336. X  #include <ctype.h>
  337. X  #ifndef    XENIX
  338. X  #include <sys/file.h>
  339. X  #else
  340. X! #include    <unistd.h>
  341. X  #endif
  342. X  #include "header.h"
  343. X  #include "data.h"
  344. X--- 12,21 ----
  345. X  
  346. X  #include <ctype.h>
  347. X  #ifndef    XENIX
  348. X+ #include <sys/types.h>
  349. X  #include <sys/file.h>
  350. X  #else
  351. X! #include <unistd.h>
  352. X  #endif
  353. X  #include "header.h"
  354. X  #include "data.h"
  355. X***************
  356. X*** 120,126 ****
  357. X  {
  358. X      register struct s_sector    *sptr = &sct[x][y];
  359. X      int    designation;
  360. X!     int    Attr = 1;
  361. X  
  362. X      designation=sptr->designation;
  363. X      if(sptr->tradegood != TG_none
  364. X--- 121,127 ----
  365. X  {
  366. X      register struct s_sector    *sptr = &sct[x][y];
  367. X      int    designation;
  368. X!     int    Attr = 0;
  369. X  
  370. X      designation=sptr->designation;
  371. X      if(sptr->tradegood != TG_none
  372. X***************
  373. X*** 134,140 ****
  374. X          if(sptr->jewels>=6) Attr+=GOLDATTR*sptr->jewels*2;
  375. X          else    Attr+=GOLDATTR*sptr->jewels;
  376. X      } else if(designation==DFARM){
  377. X!         if(ntn[sptr->owner].tfood <= ntn[sptr->owner].eatrate*(ntn[sptr->owner].tciv*11)/250)
  378. X              Attr+=50*FARMATTR;
  379. X          else Attr+=tofood(sptr,sptr->owner)*FARMATTR;
  380. X      }
  381. X--- 135,141 ----
  382. X          if(sptr->jewels>=6) Attr+=GOLDATTR*sptr->jewels*2;
  383. X          else    Attr+=GOLDATTR*sptr->jewels;
  384. X      } else if(designation==DFARM){
  385. X!         if(ntn[sptr->owner].tfood*250 <= ntn[sptr->owner].eatrate*(ntn[sptr->owner].tciv*11))
  386. X              Attr+=50*FARMATTR;
  387. X          else Attr+=tofood(sptr,sptr->owner)*FARMATTR;
  388. X      }
  389. X***************
  390. X*** 149,157 ****
  391. X  
  392. X      switch(race){
  393. X      case DWARF:
  394. X!         if((designation==DGOLDMINE)&&(sptr->jewels>=4))
  395. X              Attr += DGOLDATTR;
  396. X!         else if((designation==DMINE)&&(sptr->metal>=4))
  397. X              Attr += DMINEATTR;
  398. X          else if(designation==DTOWN) Attr += DTOWNATTR;
  399. X          else if(designation==DCITY) Attr += DCITYATTR;
  400. X--- 150,158 ----
  401. X  
  402. X      switch(race){
  403. X      case DWARF:
  404. X!         if((designation==DGOLDMINE)&&(sptr->jewels>3))
  405. X              Attr += DGOLDATTR;
  406. X!         else if((designation==DMINE)&&(sptr->metal>3))
  407. X              Attr += DMINEATTR;
  408. X          else if(designation==DTOWN) Attr += DTOWNATTR;
  409. X          else if(designation==DCITY) Attr += DCITYATTR;
  410. X***************
  411. X*** 166,174 ****
  412. X          else Attr=0;
  413. X          break;
  414. X      case ELF:
  415. X!         if((designation==DGOLDMINE)&&(sptr->jewels>=4))
  416. X              Attr += EGOLDATTR;
  417. X!         else if((designation==DMINE)&&(sptr->metal>=4))
  418. X              Attr += EMINEATTR;
  419. X          else if(designation==DTOWN) Attr += ECITYATTR;
  420. X          else if(designation==DCITY) Attr += ECITYATTR;
  421. X--- 167,175 ----
  422. X          else Attr=0;
  423. X          break;
  424. X      case ELF:
  425. X!         if((designation==DGOLDMINE)&&(sptr->jewels>3))
  426. X              Attr += EGOLDATTR;
  427. X!         else if((designation==DMINE)&&(sptr->metal>3))
  428. X              Attr += EMINEATTR;
  429. X          else if(designation==DTOWN) Attr += ECITYATTR;
  430. X          else if(designation==DCITY) Attr += ECITYATTR;
  431. X***************
  432. X*** 183,191 ****
  433. X          else Attr=0;
  434. X          break;
  435. X      case HUMAN:
  436. X!         if((designation==DGOLDMINE)&&(sptr->jewels>=4))
  437. X              Attr += HGOLDATTR;
  438. X!         else if((designation==DMINE)&&(sptr->metal>=4))
  439. X              Attr += HMINEATTR;
  440. X          else if(designation==DTOWN) Attr += HCITYATTR;
  441. X          else if(designation==DCITY) Attr += HCITYATTR;
  442. X--- 184,192 ----
  443. X          else Attr=0;
  444. X          break;
  445. X      case HUMAN:
  446. X!         if((designation==DGOLDMINE)&&(sptr->jewels>3))
  447. X              Attr += HGOLDATTR;
  448. X!         else if((designation==DMINE)&&(sptr->metal>3))
  449. X              Attr += HMINEATTR;
  450. X          else if(designation==DTOWN) Attr += HCITYATTR;
  451. X          else if(designation==DCITY) Attr += HCITYATTR;
  452. X***************
  453. X*** 200,208 ****
  454. X          else Attr=0;
  455. X          break;
  456. X      case ORC:
  457. X!         if((designation==DGOLDMINE)&&(sptr->jewels>=4))
  458. X              Attr += OGOLDATTR;
  459. X!         else if((designation==DMINE)&&(sptr->metal>=4))
  460. X              Attr += OMINEATTR;
  461. X          else if(designation==DTOWN) Attr += OCITYATTR;
  462. X          else if(designation==DCITY) Attr += OCITYATTR;
  463. X--- 201,209 ----
  464. X          else Attr=0;
  465. X          break;
  466. X      case ORC:
  467. X!         if((designation==DGOLDMINE)&&(sptr->jewels>3))
  468. X              Attr += OGOLDATTR;
  469. X!         else if((designation==DMINE)&&(sptr->metal>3))
  470. X              Attr += OMINEATTR;
  471. X          else if(designation==DTOWN) Attr += OCITYATTR;
  472. X          else if(designation==DCITY) Attr += OCITYATTR;
  473. X***************
  474. X*** 240,247 ****
  475. X      int    leadflag=FALSE;        /* leader w/o group */
  476. X      int    takesctr=FALSE;     /* takesctr is # unowned sctrs*/
  477. X  
  478. X!     if(P_ASTAT>=NUMSTATUS) return(takesctr);
  479. X!     if(P_AMOVE==0) return(takesctr);
  480. X  
  481. X      /* if leader w/o a group, set leadflag */
  482. X      if((P_ATYPE>=MINLEADER)&&(P_ATYPE<MINMONSTER)&&(P_ASTAT!=GENERAL)) {
  483. X--- 241,247 ----
  484. X      int    leadflag=FALSE;        /* leader w/o group */
  485. X      int    takesctr=FALSE;     /* takesctr is # unowned sctrs*/
  486. X  
  487. X!     if(P_ASTAT>=NUMSTATUS || P_AMOVE==0) return(takesctr);
  488. X  
  489. X      /* if leader w/o a group, set leadflag */
  490. X      if((P_ATYPE>=MINLEADER)&&(P_ATYPE<MINMONSTER)&&(P_ASTAT!=GENERAL)) {
  491. X***************
  492. X*** 264,270 ****
  493. X          &&( curntn->arm[i].stat!=GARRISON )
  494. X          &&( curntn->arm[i].stat!=TRADED )
  495. X          &&( curntn->arm[i].stat<NUMSTATUS ))
  496. X!             sum+=curntn->arm[i].sold;
  497. X      } else    {        /* not leader w/o group */
  498. X          /* use menok as a temp vbl now == men in army */
  499. X          menok=0;
  500. X--- 264,270 ----
  501. X          &&( curntn->arm[i].stat!=GARRISON )
  502. X          &&( curntn->arm[i].stat!=TRADED )
  503. X          &&( curntn->arm[i].stat<NUMSTATUS ))
  504. X!             sum += curntn->arm[i].sold;
  505. X      } else    {        /* not leader w/o group */
  506. X          /* use menok as a temp vbl now == men in army */
  507. X          menok=0;
  508. X***************
  509. X*** 302,312 ****
  510. X          &&( curntn->arm[x].stat!=ONBOARD )
  511. X          &&( curntn->arm[x].stat!=TRADED )
  512. X          &&( curntn->arm[x].stat<NUMSTATUS )){
  513. X!             where-=curntn->arm[x].sold;
  514. X!             if(where > 0) continue;
  515. X!             P_AXLOC=curntn->arm[x].xloc;
  516. X!             P_AYLOC=curntn->arm[x].yloc;
  517. X!             break;
  518. X          }
  519. X          if(x!=MAXARM) for(x=0;x<MAXARM;x++) {
  520. X              if((curntn->arm[x].unittyp<MINLEADER )
  521. X--- 302,312 ----
  522. X          &&( curntn->arm[x].stat!=ONBOARD )
  523. X          &&( curntn->arm[x].stat!=TRADED )
  524. X          &&( curntn->arm[x].stat<NUMSTATUS )){
  525. X!             if ((where-=curntn->arm[x].sold) <= 0) {
  526. X!                 P_AXLOC=curntn->arm[x].xloc;
  527. X!                 P_AYLOC=curntn->arm[x].yloc;
  528. X!                 break;
  529. X!             }
  530. X          }
  531. X          if(x!=MAXARM) for(x=0;x<MAXARM;x++) {
  532. X              if((curntn->arm[x].unittyp<MINLEADER )
  533. X***************
  534. X*** 425,431 ****
  535. X  score()
  536. X  {
  537. X      int x;
  538. X!     printf("\nupdating nations scores\n");
  539. X      for(x=1;x<NTOTAL;x++) if(isntn(ntn[x].active))
  540. X          ntn[x].score += score_one(x);
  541. X  }
  542. X--- 425,431 ----
  543. X  score()
  544. X  {
  545. X      int x;
  546. X!     printf("\nUpdating nation's scores\n");
  547. X      for(x=1;x<NTOTAL;x++) if(isntn(ntn[x].active))
  548. X          ntn[x].score += score_one(x);
  549. X  }
  550. X***************
  551. X*** 435,443 ****
  552. X  /*    CHEAT()                         */
  553. X  /* this routine cheats in favor of npc nations             */
  554. X  /*                                */
  555. X! /* I pride this code... it needs not to cheat to play a good    */
  556. X! /* game.  This routine is the only cheating that it will do,    */
  557. X! /* and it is fairly minor.                    */
  558. X  /****************************************************************/
  559. X  void
  560. X  cheat()
  561. X--- 435,443 ----
  562. X  /*    CHEAT()                         */
  563. X  /* this routine cheats in favor of npc nations             */
  564. X  /*                                */
  565. X! /* I take pride in this code... it needs not to cheat to play a */
  566. X! /* good    game.  This routine is the only cheating that it will    */
  567. X! /* do, and it is fairly minor.                    */
  568. X  /****************************************************************/
  569. X  void
  570. X  cheat()
  571. X***************
  572. X*** 529,535 ****
  573. X  #endif /*XENIX*/
  574. X      int    armynum;
  575. X      int moved,done,loop=0,number=0;
  576. X! 
  577. X      int execed[NTOTAL];
  578. X  
  579. X      check();
  580. X--- 529,535 ----
  581. X  #endif /*XENIX*/
  582. X      int    armynum;
  583. X      int moved,done,loop=0,number=0;
  584. X!     void move_people();
  585. X      int execed[NTOTAL];
  586. X  
  587. X      check();
  588. X***************
  589. X*** 576,582 ****
  590. X              fprintf(fnews,"1.\tthe computer will move for %s\n",curntn->name);
  591. X              if (mailopen( country )!=(-1)) {
  592. X                  fprintf(fm,"Message to %s from CONQUER\n\n",curntn->name);
  593. X!                 fprintf(fm,"The computer moved for you in the %s of Year %d\n",curntn->name,PSEASON(TURN),YEAR(TURN));
  594. X                  mailclose(country);
  595. X              }
  596. X              check();
  597. X--- 576,582 ----
  598. X              fprintf(fnews,"1.\tthe computer will move for %s\n",curntn->name);
  599. X              if (mailopen( country )!=(-1)) {
  600. X                  fprintf(fm,"Message to %s from CONQUER\n\n",curntn->name);
  601. X!                 fprintf(fm,"The computer moved for you in the %s of Year %d\n",PSEASON(TURN),YEAR(TURN));
  602. X                  mailclose(country);
  603. X              }
  604. X              check();
  605. X***************
  606. X*** 670,704 ****
  607. X          for(x=(int)curntn->capx-2;x<=(int)curntn->capx+2;x++)
  608. X              for(y=(int)curntn->capy-2;y<=(int)curntn->capy+2;y++)
  609. X                  if((ONMAP(x,y))&&(attr[x][y]>0)) attr[x][y]+=20;
  610. X  
  611. X- /*MOVE CIVILIANS based on the ratio of attractivenesses
  612. X-  *
  613. X-  * EQUILIBRIUM(1) = A1/(A1+A2) * (P1+P2)
  614. X-  * EQUILIBRIUM(2) = A2/(A1+A2) * (P1+P2)
  615. X-  * MOVE 1/5 of way to equilibrium each turn
  616. X-  * DELTA(1) = (EQUILIBRIUM(1)-P1)/5 = (A1P2-P1A2)/5(A1+A2)
  617. X-  * DELTA(2) = (EQUILIBRIUM(2)-P2)/5 = (A2P1-P2A1)/5(A1+A2) = -DELTA(1)
  618. X-  * ij is refered to as 1, xy as 2
  619. X-  * NOTE AM ADDING 1 to divisor to prevent floating exception errors
  620. X-  */
  621. X-         for(x=0; x<MAPX; x++ ) for(y=0; y<MAPY; y++) {
  622. X- 
  623. X-             sptr = &sct[x][y];
  624. X-             if( sptr->owner != country ) continue;
  625. X-             if( sptr->people == 0 ) continue;
  626. X- 
  627. X-             for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++) 
  628. X-             if(ONMAP(i,j)){
  629. X-                 if( sct[i][j].owner != country)
  630. X-                     continue;
  631. X-                 moved=(sptr->people*attr[i][j]-sct[i][j].people*attr[x][y]);
  632. X-                 moved /= (1+5*(attr[i][j]+attr[x][y]));
  633. X-                 if( moved <= 0 ) continue;
  634. X- 
  635. X-                 sct[i][j].people += moved;
  636. X-                 sptr->people -= moved;
  637. X-             } /* for */
  638. X-         } /* for */
  639. X      } /* for */
  640. X  
  641. X      /*zero out all recalculated values; do not clear god */
  642. X--- 670,677 ----
  643. X          for(x=(int)curntn->capx-2;x<=(int)curntn->capx+2;x++)
  644. X              for(y=(int)curntn->capy-2;y<=(int)curntn->capy+2;y++)
  645. X                  if((ONMAP(x,y))&&(attr[x][y]>0)) attr[x][y]+=20;
  646. X+         move_people();
  647. X  
  648. X      } /* for */
  649. X  
  650. X      /*zero out all recalculated values; do not clear god */
  651. X***************
  652. X*** 810,816 ****
  653. X      printf("distributing captured sectors\n");
  654. X  
  655. X      /*look for any areas where armies alone in sector*/
  656. X!     prep(0,FALSE);
  657. X  
  658. X      for(country=1;country<NTOTAL;country++) 
  659. X      if(ntn[country].active!=INACTIVE){
  660. X--- 783,789 ----
  661. X      printf("distributing captured sectors\n");
  662. X  
  663. X      /*look for any areas where armies alone in sector*/
  664. X!     prep(0,-1);
  665. X  
  666. X      for(country=1;country<NTOTAL;country++) 
  667. X      if(ntn[country].active!=INACTIVE){
  668. X***************
  669. X*** 818,824 ****
  670. X          for(armynum=0;armynum<MAXARM;armynum++)
  671. X  /* cheat in favor of npcs as the create army routines assume 75 man armies */
  672. X          if(P_ATYPE<MINLEADER) {
  673. X!             if((ispc(curntn->active)&&(P_ASOLD>TAKESECTOR))
  674. X              ||((isnotpc(curntn->active))&&(P_ASOLD>75))){
  675. X                  /* may not capture land while on a fleet */
  676. X                  if(P_ASTAT==ONBOARD) continue;
  677. X--- 791,797 ----
  678. X          for(armynum=0;armynum<MAXARM;armynum++)
  679. X  /* cheat in favor of npcs as the create army routines assume 75 man armies */
  680. X          if(P_ATYPE<MINLEADER) {
  681. X!             if((ispc(curntn->active)&&(P_ASOLD>=TAKESECTOR))
  682. X              ||((isnotpc(curntn->active))&&(P_ASOLD>75))){
  683. X                  /* may not capture land while on a fleet */
  684. X                  if(P_ASTAT==ONBOARD) continue;
  685. X***************
  686. X*** 873,879 ****
  687. X                      if (ispc(curntn->active)) {
  688. X                          if(mailopen(country)!=(-1)) {
  689. X                              fprintf(fm,"Message from Conquer\n\n");
  690. X!                             fprintf(fm,"\tYour Scouting Unit %d was captured\n");
  691. X                              fprintf(fm,"\t  by %s military in sector %d,%d\n",
  692. X                                     ntn[occval].name,(int)P_AXLOC,(int)P_AYLOC);
  693. X                              mailclose(country);
  694. X--- 846,852 ----
  695. X                      if (ispc(curntn->active)) {
  696. X                          if(mailopen(country)!=(-1)) {
  697. X                              fprintf(fm,"Message from Conquer\n\n");
  698. X!                             fprintf(fm,"\tYour Scouting Unit %d was captured\n",armynum);
  699. X                              fprintf(fm,"\t  by %s military in sector %d,%d\n",
  700. X                                     ntn[occval].name,(int)P_AXLOC,(int)P_AYLOC);
  701. X                              mailclose(country);
  702. X***************
  703. X*** 1009,1020 ****
  704. X  
  705. X                  printf("depleting nation %s\n",curntn->name);
  706. X                  deplete(country);
  707. X-                 printf("TEMP: done depleting\n");
  708. X              }
  709. X  
  710. X              spreadsheet(country);
  711. X              if ((int)curntn->popularity-2*curntn->inflation < (int)MAXTGVAL) {
  712. X!                 curntn->popularity = min(0,(int)(curntn->popularity-2*curntn->inflation));
  713. X              } else curntn->popularity = (char) MAXTGVAL;
  714. X              curntn->tsctrs = spread.sectors;
  715. X              curntn->tciv=spread.civilians;
  716. X--- 982,992 ----
  717. X  
  718. X                  printf("depleting nation %s\n",curntn->name);
  719. X                  deplete(country);
  720. X              }
  721. X  
  722. X              spreadsheet(country);
  723. X              if ((int)curntn->popularity-2*curntn->inflation < (int)MAXTGVAL) {
  724. X!                 curntn->popularity = max(0,(int)(curntn->popularity-2*curntn->inflation));
  725. X              } else curntn->popularity = (char) MAXTGVAL;
  726. X              curntn->tsctrs = spread.sectors;
  727. X              curntn->tciv=spread.civilians;
  728. X***************
  729. X*** 1024,1034 ****
  730. X              charity=((spread.gold-curntn->tgold)*curntn->charity)/100;
  731. X  
  732. X              if(charity < 0) charity = 0;
  733. X              if(curntn->tciv > 0) charity /= curntn->tciv;
  734. X              else charity = 0;
  735. X  
  736. X-             curntn->tgold = spread.gold - charity;
  737. X- 
  738. X              /* calculate poverty base */
  739. X              if (curntn->tgold < 0L) {
  740. X                  curntn->poverty = 95;
  741. X--- 996,1006 ----
  742. X              charity=((spread.gold-curntn->tgold)*curntn->charity)/100;
  743. X  
  744. X              if(charity < 0) charity = 0;
  745. X+             curntn->tgold = spread.gold - charity;
  746. X+ 
  747. X              if(curntn->tciv > 0) charity /= curntn->tciv;
  748. X              else charity = 0;
  749. X  
  750. X              /* calculate poverty base */
  751. X              if (curntn->tgold < 0L) {
  752. X                  curntn->poverty = 95;
  753. X***************
  754. X*** 1070,1078 ****
  755. X              /* plus maybe an adjustment for jewel production as a ratio */
  756. X              /* for whatever is produced by the country.                 */
  757. X  
  758. X!             /* use charity here for gold lost to inflation */
  759. X!             charity = (curntn->tgold * curntn->inflation )/100;
  760. X!             curntn->tgold -= charity;
  761. X              curntn->metals=spread.metal;
  762. X              curntn->jewels=spread.jewels;
  763. X          }
  764. X--- 1042,1057 ----
  765. X              /* plus maybe an adjustment for jewel production as a ratio */
  766. X              /* for whatever is produced by the country.                 */
  767. X  
  768. X!             /* now find new total gold talons in nations*/
  769. X!             if (curntn->tgold > 1000000L) {
  770. X!                 curntn->tgold = (long)(curntn->tgold /
  771. X!                     (100.0+(float)curntn->inflation/4.0)) * 100L;
  772. X!             } else {
  773. X!                 curntn->tgold = (long) (curntn->tgold * 100L) /
  774. X!                     (100.0 + (float) curntn->inflation/4.0);
  775. X!             }
  776. X! 
  777. X!             /* provide goods production */
  778. X              curntn->metals=spread.metal;
  779. X              curntn->jewels=spread.jewels;
  780. X          }
  781. X***************
  782. X*** 1375,1380 ****
  783. X--- 1354,1360 ----
  784. X      register struct s_sector    *sptr;
  785. X      register int x,y;
  786. X      long xx;
  787. X+     float tempflt;
  788. X      long dead;
  789. X  
  790. X      fprintf(fnews,"2\tWORLD ECONOMY & DECLARATIONS OF WAR\n");
  791. X***************
  792. X*** 1423,1451 ****
  793. X          }
  794. X          /*this state can occur if few people live in cities*/
  795. X          if(curntn->tfood<0) curntn->tfood=0L;
  796. X! #ifdef XENIX
  797. X!         xx = curntn->tfood;
  798. X!         xx *= (100-curntn->spoilrate);
  799. X!         xx /= 100;
  800. X!         curntn->tfood = xx;
  801. X! #else
  802. X!         curntn->tfood *= (100-curntn->spoilrate);
  803. X!         curntn->tfood /= 100;
  804. X! #endif /*XENIX*/
  805. X  
  806. X!         if(curntn->tgold>GOLDTHRESH*curntn->jewels){
  807. X              /* buy jewels off commodities board */
  808. X              xx=curntn->tgold-GOLDTHRESH*curntn->jewels;
  809. X              if (ispc(country)) {
  810. X                  if (mailopen(country)!=(-1)) {
  811. X                      fprintf(fm,"Message from Conquer\n\n");
  812. X!                     fprintf(fm,"Gold imbalance forced your treasury to purchase");
  813. X!                     fprintf(fm,"%ld jewels for %ld gold talons to compensate\n",
  814. X!                         xx*GODJEWL/GODPRICE,xx);
  815. X                      mailclose(country);
  816. X                  }
  817. X              }
  818. X!             curntn->jewels += (xx*GODJEWL/GODPRICE);
  819. X              curntn->tgold  -= xx;
  820. X          }
  821. X  
  822. X--- 1403,1424 ----
  823. X          }
  824. X          /*this state can occur if few people live in cities*/
  825. X          if(curntn->tfood<0) curntn->tfood=0L;
  826. X!         tempflt = (float) curntn->tfood * (100-curntn->spoilrate);
  827. X!         curntn->tfood = (long) (tempflt / 100.0);
  828. X  
  829. X!         if(curntn->tgold > GOLDTHRESH*curntn->jewels){
  830. X              /* buy jewels off commodities board */
  831. X              xx=curntn->tgold-GOLDTHRESH*curntn->jewels;
  832. X              if (ispc(country)) {
  833. X                  if (mailopen(country)!=(-1)) {
  834. X                      fprintf(fm,"Message from Conquer\n\n");
  835. X!                     fprintf(fm,"Gold imbalance forced your treasury to purchase\n");
  836. X!                     fprintf(fm,"%ld jewels for %ld gold talons to compensate.\n",
  837. X!                         xx/GODPRICE*GODJEWL,xx);
  838. X                      mailclose(country);
  839. X                  }
  840. X              }
  841. X!             curntn->jewels += (xx/GODPRICE*GODJEWL);
  842. X              curntn->tgold  -= xx;
  843. X          }
  844. X  
  845. X***************
  846. X*** 1549,1552 ****
  847. X--- 1522,1582 ----
  848. X              break;
  849. X          }
  850. X      }
  851. X+ }
  852. X+ 
  853. X+ /* MOVE CIVILIANS based on the ratio of attractivenesses
  854. X+  *
  855. X+  * EQUILIBRIUM(1) = A1 / (A1 + A2) * (P1 + P2)
  856. X+  * EQUILIBRIUM(2) = A2 / (A1 + A2) * (P1 + P2)
  857. X+  * MOVE 1/5 of way to equilibrium each turn
  858. X+  * DELTA(1) = (EQUILIBRIUM(1) - P1) / 5 =(A1P2 - P1A2) / 5(A1 + A2)
  859. X+  * DELTA(2) = (EQUILIBRIUM(2) - P2) / 5 =(A2P1 - P2A1) / 5(A1 + A2) = -DELTA(1)
  860. X+  * (i, j) is refered to as 1, (x, y) as 2
  861. X+  */
  862. X+ void
  863. X+ move_people()
  864. X+ {
  865. X+     register struct s_sector *sptr;
  866. X+     register int i, j, x, y;
  867. X+     int moved, t_attr;
  868. X+     long **newpop, *curpop;
  869. X+ 
  870. X+     newpop = (long **) m2alloc(MAPX, MAPY, sizeof(long));
  871. X+ 
  872. X+     for (x = 0; x < MAPX; x++)
  873. X+     for (y = 0; y < MAPY; y++)
  874. X+         if (sct[x][y].owner == country)
  875. X+             newpop[x][y] = sct[x][y].people;
  876. X+         else newpop[x][y] = 0;
  877. X+ 
  878. X+     for (x = 0; x < MAPX; x++)
  879. X+     for (y = 0; y < MAPY; y++) {
  880. X+         sptr = &sct[x][y];
  881. X+         if ((sptr->owner == country) && (sptr->people != 0)) {
  882. X+ 
  883. X+             for (t_attr = 0, i = x - 2; i < x + 3; i++)
  884. X+             for (j = y - 2; j < y + 3; j++)
  885. X+             if ((ONMAP(i, j)) && (sct[i][j].owner == country))
  886. X+                 t_attr += attr[i][j];
  887. X+ 
  888. X+             if (t_attr > 0) {
  889. X+                 t_attr *= 5;
  890. X+                 curpop = &newpop[x][y];
  891. X+                 for (i = x - 2; i < x + 3; i++)
  892. X+                 for (j = y - 2; j < y + 3; j++)
  893. X+                 if ((ONMAP(i, j)) && (sct[i][j].owner == country)) {
  894. X+                     moved = sptr->people * attr[i][j];
  895. X+                     if (moved > 0) {
  896. X+                         moved /= t_attr;
  897. X+                         *curpop -= moved;
  898. X+                         newpop[i][j] += moved;
  899. X+                     }
  900. X+                 }
  901. X+             }
  902. X+         }
  903. X+     }
  904. X+     for (x = 0; x < MAPX; x++)
  905. X+     for (y = 0; y < MAPY; y++)
  906. X+     if (sct[x][y].owner == country)
  907. X+         sct[x][y].people = newpop[x][y];
  908. X  }
  909. X*** ocommands.c    Tue Dec 12 21:19:34 1989
  910. X--- commands.c    Tue Dec 12 21:20:09 1989
  911. X***************
  912. X*** 13,22 ****
  913. X  #include "header.h"
  914. X  #include "data.h"
  915. X  #include <ctype.h>
  916. X! 
  917. X! #ifdef SYSMAIL
  918. X  #include <sys/types.h>
  919. X! #endif SYSMAIL
  920. X  extern long conq_mail_size;
  921. X  
  922. X  extern FILE *fexe;            /*execute file pointer*/
  923. X--- 13,23 ----
  924. X  #include "header.h"
  925. X  #include "data.h"
  926. X  #include <ctype.h>
  927. X! #ifdef CONQUER
  928. X  #include <sys/types.h>
  929. X! #include <sys/stat.h>
  930. X! #endif /*CONQUER*/
  931. X! 
  932. X  extern long conq_mail_size;
  933. X  
  934. X  extern FILE *fexe;            /*execute file pointer*/
  935. X***************
  936. X*** 93,108 ****
  937. X          }
  938. X      }
  939. X  
  940. X-     /* have this for now... may be too harsh */
  941. X-     if (desg==DMILL || desg==DGRANARY) {
  942. X-         if((sptr->tradegood != TG_none)
  943. X-         &&(*(tg_stype + sptr->tradegood) != DFARM)
  944. X-         &&(*(tg_stype + sptr->tradegood) != 'x')) {
  945. X-             if(prtflag) errormsg("You can't have one of those here!");
  946. X-             return(FALSE);
  947. X-         }
  948. X-     }
  949. X- 
  950. X      if (desg==DUNIVERSITY || desg==DLUMBERYD) {
  951. X          if((sptr->tradegood != TG_none)
  952. X          &&(*(tg_stype + sptr->tradegood) != desg)
  953. X--- 94,99 ----
  954. X***************
  955. X*** 149,155 ****
  956. X          curntn= &ntn[country];
  957. X  
  958. X          clear_bottom(0);
  959. X!         mvaddstr(LINES-4,0,"SUPER USER: CHANGE (v)egetation, (e)levation, (d)esig, (o)wner, (t)radegood");
  960. X          refresh();
  961. X          switch(getch()){
  962. X          case 'd':
  963. X--- 140,146 ----
  964. X          curntn= &ntn[country];
  965. X  
  966. X          clear_bottom(0);
  967. X!         mvaddstr(LINES-4,0,"SUPER USER: CHANGE (v)eg, (e)lev, (d)esig, (o)wner, (p)op, (t)radegood");
  968. X          refresh();
  969. X          switch(getch()){
  970. X          case 'd':
  971. X***************
  972. X*** 190,197 ****
  973. X              }
  974. X              sptr->vegetation=newdes;
  975. X              if( tofood(sptr,0) < DESFOOD )
  976. X!                 sptr->designation=DNODESIG;
  977. X!             else sptr->designation=newdes;
  978. X              reset_god();
  979. X              return;
  980. X          case 'o':
  981. X--- 181,188 ----
  982. X              }
  983. X              sptr->vegetation=newdes;
  984. X              if( tofood(sptr,0) < DESFOOD )
  985. X!                 sptr->designation=newdes;
  986. X!             else sptr->designation=DNODESIG;
  987. X              reset_god();
  988. X              return;
  989. X          case 'o':
  990. X***************
  991. X*** 201,206 ****
  992. X--- 192,208 ----
  993. X              if (x<NTOTAL) sptr->owner=x;
  994. X              reset_god();
  995. X              return;
  996. X+         case 'p':
  997. X+             if (sptr->altitude == WATER) {
  998. X+                 errormsg("Trying to build a colony of mermen?");
  999. X+                 reset_god();
  1000. X+                 return;
  1001. X+             }
  1002. X+             mvaddstr(LINES-3,7,"new population for sector: ");
  1003. X+             refresh();
  1004. X+             sptr->people = (long) get_number();
  1005. X+             reset_god();
  1006. X+             return;
  1007. X          case 't':
  1008. X              x=TRUE;
  1009. X              while(x==TRUE) {
  1010. X***************
  1011. X*** 635,641 ****
  1012. X              return;
  1013. X          }
  1014. X  
  1015. X!         if( sct[XREAL][YREAL].people < amount * SHIPCREW ){
  1016. X              errormsg("NOT ENOUGH CIVILIANS IN SECTOR");
  1017. X              if(isgod==TRUE) reset_god();
  1018. X              return;
  1019. X--- 637,643 ----
  1020. X              return;
  1021. X          }
  1022. X  
  1023. X!         if( sct[XREAL][YREAL].people < amount * (shipsize+1) * SHIPCREW ){
  1024. X              errormsg("NOT ENOUGH CIVILIANS IN SECTOR");
  1025. X              if(isgod==TRUE) reset_god();
  1026. X              return;
  1027. X***************
  1028. X*** 699,711 ****
  1029. X      /* construct fortification points*/
  1030. X      else if(type=='f'){
  1031. X          /* can only go into debt as much as the nation has jewels */
  1032. X!         if ((curntn->tgold - cost) >= ((-1)*10*curntn->jewels)) {
  1033. X              mvprintw(LINES-2,5,"you build +%d%% fort points for %ld gold",armbonus,cost);
  1034. X              curntn->tgold-=cost;
  1035. X              sct[XREAL][YREAL].fortress++;
  1036. X              INCFORT;
  1037. X              errormsg("");
  1038. X!         } else errormsg("you are broke");
  1039. X      }
  1040. X      else errormsg("invalid input error");
  1041. X  
  1042. X--- 701,715 ----
  1043. X      /* construct fortification points*/
  1044. X      else if(type=='f'){
  1045. X          /* can only go into debt as much as the nation has jewels */
  1046. X!         if (sct[XREAL][YREAL].fortress>11) {
  1047. X!             errormsg("That sector is as impregnable as you can make it");
  1048. X!         } else if ((curntn->tgold - cost) >= ((-1)*10*curntn->jewels)) {
  1049. X              mvprintw(LINES-2,5,"you build +%d%% fort points for %ld gold",armbonus,cost);
  1050. X              curntn->tgold-=cost;
  1051. X              sct[XREAL][YREAL].fortress++;
  1052. X              INCFORT;
  1053. X              errormsg("");
  1054. X!         } else errormsg("you may not spend that much");
  1055. X      }
  1056. X      else errormsg("invalid input error");
  1057. X  
  1058. X***************
  1059. X*** 1038,1043 ****
  1060. X--- 1042,1048 ----
  1061. X      char mesgfile[FILELTH];
  1062. X      char line[LINELTH+1], inpch;
  1063. X      char save[LINELTH][LINELTH+1];
  1064. X+     struct stat fst;
  1065. X  
  1066. X      /*open file; used in mailopen() as well */
  1067. X      sprintf(tempfile,"%s%hd.tmp",msgfile,country);
  1068. X***************
  1069. X*** 1062,1075 ****
  1070. X  
  1071. X      /* check for people sending mail */
  1072. X      sprintf(line,"send.%s%hd",msgfile,country);
  1073. X!     if (access(line,00)==0) {
  1074. X!         /* someone is sending mail to the country */
  1075. X!         (void) unlink (tempfile) ;
  1076. X!         clear_bottom(0);
  1077. X!         errormsg("Someone is sending you mail... please wait.");
  1078. X!         makebottom();
  1079. X!         redraw=DONE;
  1080. X!         return;
  1081. X      }
  1082. X  
  1083. X      /*read in file a line at at time*/
  1084. X--- 1067,1087 ----
  1085. X  
  1086. X      /* check for people sending mail */
  1087. X      sprintf(line,"send.%s%hd",msgfile,country);
  1088. X!     if (stat(line,&fst)==0) {
  1089. X!         long now;
  1090. X!         now = time(0);
  1091. X!         if (now - fst.st_mtime < TIME_DEAD) {
  1092. X!             /* someone is sending mail to the country */
  1093. X!             (void) unlink (tempfile) ;
  1094. X!             clear_bottom(0);
  1095. X!             errormsg("Someone is sending you mail... please wait.");
  1096. X!             makebottom();
  1097. X!             redraw=DONE;
  1098. X!             return;
  1099. X!         } else {
  1100. X!             /* remove useless file */
  1101. X!             (void) unlink(line);
  1102. X!         }
  1103. X      }
  1104. X  
  1105. X      /*read in file a line at at time*/
  1106. X***************
  1107. X*** 1142,1151 ****
  1108. X      char line[BIGLTH];
  1109. X  
  1110. X      /*what nation to send to*/
  1111. X!     clear();
  1112. X!     mvaddstr(0,0,"To send a message to the administrator, send to 'god';");
  1113. X!     mvaddstr(1,0,"To post to the news, send to 'news':");
  1114. X!     mvaddstr(2,0,"Enter the name of the country to send to: ");
  1115. X      refresh();
  1116. X      temp=get_country();
  1117. X  
  1118. X--- 1154,1162 ----
  1119. X      char line[BIGLTH];
  1120. X  
  1121. X      /*what nation to send to*/
  1122. X!     clear_bottom(0);
  1123. X!     mvaddstr(LINES-4,0,"The Conquer Administrator is 'god'; To send to the News use 'news';");
  1124. X!     mvaddstr(LINES-3,0,"Send mail to what nation? ");
  1125. X      refresh();
  1126. X      temp=get_country();
  1127. X  
  1128. X***************
  1129. X*** 1153,1168 ****
  1130. X          strcpy(name,"news");
  1131. X      } else {
  1132. X          /* quick return on bad input */
  1133. X!         if(temp==(-1) || temp>=NTOTAL
  1134. X!           || (!isntn(ntn[temp].active) && temp!=0))
  1135. X!               return;
  1136. X          strcpy(name,ntn[temp].name);    /* find nation name */
  1137. X      }
  1138. X  
  1139. X      if(mailopen( temp )==(-1)) {
  1140. X          return;
  1141. X      }
  1142. X! 
  1143. X  
  1144. X      if(temp != -2) {
  1145. X          if (country==0)
  1146. X--- 1164,1182 ----
  1147. X          strcpy(name,"news");
  1148. X      } else {
  1149. X          /* quick return on bad input */
  1150. X!         if(temp==(-1) || temp>=NTOTAL 
  1151. X!         || (!isntn(ntn[temp].active) && temp!=0)) {
  1152. X!             makebottom();
  1153. X!             return;
  1154. X!         }
  1155. X          strcpy(name,ntn[temp].name);    /* find nation name */
  1156. X      }
  1157. X  
  1158. X      if(mailopen( temp )==(-1)) {
  1159. X+         makebottom();
  1160. X          return;
  1161. X      }
  1162. X!     redraw=FULL;
  1163. X  
  1164. X      if(temp != -2) {
  1165. X          if (country==0)
  1166. X*** oio.c    Tue Dec 12 21:19:35 1989
  1167. X--- io.c    Tue Dec 12 21:20:09 1989
  1168. X***************
  1169. X*** 306,311 ****
  1170. X--- 306,312 ----
  1171. X  } /* readdata() */
  1172. X  
  1173. X  #ifdef CONQUER
  1174. X+ #ifdef XYZZY
  1175. X  /************************************************************************/
  1176. X  /*    OFFMAP()    deal if cursor is off the map            */
  1177. X  /************************************************************************/
  1178. X***************
  1179. X*** 324,330 ****
  1180. X              xcurs+=15;
  1181. X          }
  1182. X      }
  1183. X!     else if(xcurs >= (COLS-23)/2){
  1184. X          if(XREAL<MAPX) {
  1185. X              redraw=PART;
  1186. X              xoffset+=15;
  1187. X--- 325,331 ----
  1188. X              xcurs+=15;
  1189. X          }
  1190. X      }
  1191. X!     else if(xcurs >= SCREEN_X_SIZE-1){
  1192. X          if(XREAL<MAPX) {
  1193. X              redraw=PART;
  1194. X              xoffset+=15;
  1195. X***************
  1196. X*** 340,346 ****
  1197. X          xoffset += xcurs;
  1198. X          xcurs=0;
  1199. X      }
  1200. X!     else if(xcurs >= (COLS-23)/2) {
  1201. X          redraw=PART;
  1202. X          xoffset+=15;
  1203. X          xcurs-=15;
  1204. X--- 341,347 ----
  1205. X          xoffset += xcurs;
  1206. X          xcurs=0;
  1207. X      }
  1208. X!     else if(xcurs >= SCREEN_X_SIZE-1) {
  1209. X          redraw=PART;
  1210. X          xoffset+=15;
  1211. X          xcurs-=15;
  1212. X***************
  1213. X*** 380,385 ****
  1214. X--- 381,387 ----
  1215. X      }
  1216. X      whatcansee();
  1217. X  }
  1218. X+ #endif /* XYZZY */
  1219. X  
  1220. X  /************************************************************************/
  1221. X  /*    CENTERMAP()    - redraws screen so that cursor is centered    */
  1222. X*** omagic.c    Tue Dec 12 21:19:35 1989
  1223. X--- magic.c    Tue Dec 12 21:20:10 1989
  1224. X***************
  1225. X*** 591,609 ****
  1226. X          clear();
  1227. X      }
  1228. X      if(magic(country,MA_MONST)==TRUE) {
  1229. X!     mvprintw((*count)++,0,"  You have a 10 percent chance for %ld Jewels take over other orcs",ORCTAKE);
  1230. X      chance=10;
  1231. X      } else if(magic(country,AV_MONST)==TRUE) {
  1232. X!     mvprintw((*count)++,0,"  You have a 6 percent chance for %ld Jewels take over other orcs",ORCTAKE);
  1233. X      chance=6;
  1234. X      } else if(magic(country,MI_MONST)==TRUE){
  1235. X!     mvprintw((*count)++,0,"  You have a 3 percent chance for %ld Jewels to take over other orcs",ORCTAKE);
  1236. X      chance=3;
  1237. X      }
  1238. X      if(chance==0) return(TRUE);
  1239. X  
  1240. X!     mvaddstr((*count)++,0,"DO YOU WISH TO TAKE OVER AN ORC NPC NATION");
  1241. X!     mvaddstr((*count)++,0,"target cant be unmet, hostile, war, or jihad (enter y or n):");
  1242. X      refresh();
  1243. X      if(getch()=='y'){
  1244. X          done=FALSE;
  1245. X--- 591,609 ----
  1246. X          clear();
  1247. X      }
  1248. X      if(magic(country,MA_MONST)==TRUE) {
  1249. X!     mvprintw((*count)++,0,"You have a 10 percent chance for %ld Jewels take over other orcs",ORCTAKE);
  1250. X      chance=10;
  1251. X      } else if(magic(country,AV_MONST)==TRUE) {
  1252. X!     mvprintw((*count)++,0,"You have a 6 percent chance for %ld Jewels take over other orcs",ORCTAKE);
  1253. X      chance=6;
  1254. X      } else if(magic(country,MI_MONST)==TRUE){
  1255. X!     mvprintw((*count)++,0,"You have a 3 percent chance for %ld Jewels to take over other orcs",ORCTAKE);
  1256. X      chance=3;
  1257. X      }
  1258. X      if(chance==0) return(TRUE);
  1259. X  
  1260. X!     mvaddstr((*count)++,0,"  Target can't be Unmet, Hostile, War, or Jihad");
  1261. X!     mvaddstr((*count)++,0,"DO YOU WISH TO TAKE OVER AN ORC NPC NATION: [ny]");
  1262. X      refresh();
  1263. X      if(getch()=='y'){
  1264. X          done=FALSE;
  1265. X***************
  1266. X*** 620,633 ****
  1267. X              curntn->spellpts-=s_cost;
  1268. X              EDECSPL;
  1269. X              if(( takeover(chance,i)) !=0 )
  1270. X!                 mvprintw((*count)++,0," Successful: %d",i);
  1271. X              else {
  1272. X!                 mvaddstr((*count)++,0," Failed: Nation becomes more hostile");
  1273. X                  curntn->dstatus[i]++;
  1274. X                  EADJDIP(country,i);
  1275. X              }
  1276. X          }
  1277. X-         else mvaddstr((*count)++,0,"  Wrong Race");
  1278. X      }
  1279. X      return(done);
  1280. X  }
  1281. X--- 620,636 ----
  1282. X              curntn->spellpts-=s_cost;
  1283. X              EDECSPL;
  1284. X              if(( takeover(chance,i)) !=0 )
  1285. X!                 mvprintw((*count)++,0,"  Successful: %d",i);
  1286. X              else {
  1287. X!                 mvaddstr((*count)++,0,"  Failed: Nation becomes more hostile");
  1288. X                  curntn->dstatus[i]++;
  1289. X                  EADJDIP(country,i);
  1290. X              }
  1291. X+         } else {
  1292. X+             if (ntn[i].race==ORC) 
  1293. X+                 mvaddstr((*count)++,0,"  Wrong Race");
  1294. X+             else mvaddstr((*count)++,0,"  That Nation is Outside Your Influence");
  1295. X          }
  1296. X      }
  1297. X      return(done);
  1298. X  }
  1299. X***************
  1300. X*** 828,834 ****
  1301. X          county=3;
  1302. X          countx=0;
  1303. X          standout();
  1304. X!         mvaddstr(0,0,"Do you wish to (A)dd or (R)emove a power? ");
  1305. X          refresh();
  1306. X          while (done==FALSE) {
  1307. X              done=TRUE;
  1308. X--- 831,838 ----
  1309. X          county=3;
  1310. X          countx=0;
  1311. X          standout();
  1312. X!         mvaddstr(0,0,"Do you wish to (A)dd or (R)emove a power?");
  1313. X!         clrtoeol();
  1314. X          refresh();
  1315. X          while (done==FALSE) {
  1316. X              done=TRUE;
  1317. X***************
  1318. X*** 870,878 ****
  1319. X          }
  1320. X          else county++;
  1321. X          standout();
  1322. X!         if (remove) mvaddstr(county++,0,"Which power to remove? ");
  1323. X!         else mvaddstr(county++,0,"Which power to add? ");
  1324. X          standend();
  1325. X          refresh();
  1326. X          choice=get_number();
  1327. X          if(choice > 0 && choice <= MAXPOWER) {
  1328. X--- 874,883 ----
  1329. X          }
  1330. X          else county++;
  1331. X          standout();
  1332. X!         if (remove) mvaddstr(county++,0,"Which power to remove?");
  1333. X!         else mvaddstr(county++,0,"Which power to add?");
  1334. X          standend();
  1335. X+         addch(' ');
  1336. X          refresh();
  1337. X          choice=get_number();
  1338. X          if(choice > 0 && choice <= MAXPOWER) {
  1339. X***************
  1340. X*** 888,895 ****
  1341. X                      else exenewmgk(powers[choice-1]);
  1342. X                  }
  1343. X              } else {
  1344. X!                 if (remove) mvaddstr(county++,0," The nation doesn't have that power.");
  1345. X!                 else mvaddstr(county++,0," The nation already has that power.");
  1346. X              }
  1347. X          }
  1348. X          mvaddstr(county++,0,"Do you wish to add or remove another power?");
  1349. X--- 893,900 ----
  1350. X                      else exenewmgk(powers[choice-1]);
  1351. X                  }
  1352. X              } else {
  1353. X!                 if (remove) mvaddstr(county++,0,"The nation doesn't have that power.");
  1354. X!                 else mvaddstr(county++,0,"The nation already has that power.");
  1355. X              }
  1356. X          }
  1357. X          mvaddstr(county++,0,"Do you wish to add or remove another power?");
  1358. X*** odisplay.c    Tue Dec 12 21:19:34 1989
  1359. X--- display.c    Tue Dec 12 21:20:10 1989
  1360. X***************
  1361. X*** 3,15 ****
  1362. X  /*conquer : Copyright (c) 1988 by Ed Barlow.
  1363. X   *  I spent a long time writing this code & I hope that you respect this.
  1364. X   *  I give permission to alter the code, but not to copy or redistribute
  1365. X!  *  it without my explicit permission.    If you alter the code,
  1366. X   *  please document changes and send me a copy, so all can have it.
  1367. X!  *  This code, to the best of my knowledge works well,     but it is my first
  1368. X   *  'C' program and should be treated as such.  I disclaim any
  1369. X!  *  responsibility for the codes actions (use at your own risk).     I guess
  1370. X   *  I am saying "Happy gaming", and am trying not to get sued in the process.
  1371. X!  *                                        Ed
  1372. X   */
  1373. X  
  1374. X  /*include files*/
  1375. X--- 3,15 ----
  1376. X  /*conquer : Copyright (c) 1988 by Ed Barlow.
  1377. X   *  I spent a long time writing this code & I hope that you respect this.
  1378. X   *  I give permission to alter the code, but not to copy or redistribute
  1379. X!  *  it without my explicit permission.  If you alter the code,
  1380. X   *  please document changes and send me a copy, so all can have it.
  1381. X!  *  This code, to the best of my knowledge works well,  but it is my first
  1382. X   *  'C' program and should be treated as such.  I disclaim any
  1383. X!  *  responsibility for the codes actions (use at your own risk).  I guess
  1384. X   *  I am saying "Happy gaming", and am trying not to get sued in the process.
  1385. X!  *                                                Ed
  1386. X   */
  1387. X  
  1388. X  /*include files*/
  1389. X***************
  1390. X*** 410,416 ****
  1391. X  {
  1392. X      if((xcurs<=0)||(ycurs<=0)||(xcurs>=SCREEN_X_SIZE-1)
  1393. X      ||((ycurs>=SCREEN_Y_SIZE-1))||((XREAL)>=MAPX)
  1394. X!      ||((YREAL)>=MAPY)) offmap();
  1395. X      
  1396. X      if(redraw!=DONE) {
  1397. X          if (redraw==FULL) {
  1398. X--- 410,419 ----
  1399. X  {
  1400. X      if((xcurs<=0)||(ycurs<=0)||(xcurs>=SCREEN_X_SIZE-1)
  1401. X      ||((ycurs>=SCREEN_Y_SIZE-1))||((XREAL)>=MAPX)
  1402. X!      ||((YREAL)>=MAPY)) {
  1403. X!       centermap();
  1404. X!       redraw=PART;
  1405. X!     }
  1406. X      
  1407. X      if(redraw!=DONE) {
  1408. X          if (redraw==FULL) {
  1409. X*** omain.c    Tue Dec 12 21:19:35 1989
  1410. X--- main.c    Tue Dec 12 21:20:11 1989
  1411. X***************
  1412. X*** 282,288 ****
  1413. X  #endif OGOD
  1414. X      country=(-1);
  1415. X      for(i=0;i<NTOTAL;i++)
  1416. X!         if(strcmp(name,ntn[i].name)==0) country=i;
  1417. X  
  1418. X      if(country==(-1)) {
  1419. X          fprintf(stderr,"Sorry, name <%s> not found\n",name);
  1420. X--- 282,291 ----
  1421. X  #endif OGOD
  1422. X      country=(-1);
  1423. X      for(i=0;i<NTOTAL;i++)
  1424. X!     if(strcmp(name,ntn[i].name)==0) {
  1425. X!         country=i;
  1426. X!         break;
  1427. X!     }
  1428. X  
  1429. X      if(country==(-1)) {
  1430. X          fprintf(stderr,"Sorry, name <%s> not found\n",name);
  1431. X***************
  1432. X*** 778,784 ****
  1433. X          return(TRUE);
  1434. X          break;
  1435. X      case 'W':    /*message*/
  1436. X-         redraw=FULL;
  1437. X          curntn->tgold -= MOVECOST;
  1438. X          wmessage();
  1439. X          break;
  1440. X--- 781,786 ----
  1441. X***************
  1442. X*** 818,825 ****
  1443. X          if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1444. X              ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid )) break;
  1445. X  #endif
  1446. X!         clear();
  1447. X!         redraw=FULL;
  1448. X          if(country != 0) {
  1449. X          fprintf(fexe,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n",
  1450. X              XNAGOLD ,country,curntn->tgold,"null");
  1451. X--- 820,826 ----
  1452. X          if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1453. X              ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid )) break;
  1454. X  #endif
  1455. X!         clear_bottom(0);
  1456. X          if(country != 0) {
  1457. X          fprintf(fexe,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n",
  1458. X              XNAGOLD ,country,curntn->tgold,"null");
  1459. X***************
  1460. X*** 828,837 ****
  1461. X          fprintf(fexe,"L_NJWLS\t%d \t%d \t%ld \t0 \t0 \t%s\n",
  1462. X              XNARGOLD ,country,curntn->jewels,"null");
  1463. X          } else
  1464. X!         mvaddstr(0,0,"SUPER-USER: YOUR CHANGES WILL NOT BE SAVED IF YOU DO THIS!!!");
  1465. X          standout();
  1466. X!         mvaddstr(2,0,"change login to: ");
  1467. X          standend();
  1468. X          refresh();
  1469. X  
  1470. X          ocountry=country;
  1471. X--- 829,839 ----
  1472. X          fprintf(fexe,"L_NJWLS\t%d \t%d \t%ld \t0 \t0 \t%s\n",
  1473. X              XNARGOLD ,country,curntn->jewels,"null");
  1474. X          } else
  1475. X!         mvaddstr(LINES-4,0,"SUPER-USER: YOUR CHANGES WILL NOT BE SAVED IF YOU DO THIS!!!");
  1476. X          standout();
  1477. X!         mvaddstr(LINES-3,0,"Change login to:");
  1478. X          standend();
  1479. X+         addch(' ');
  1480. X          refresh();
  1481. X  
  1482. X          ocountry=country;
  1483. X***************
  1484. X*** 841,869 ****
  1485. X          if( country==(-1) || country>=NTOTAL
  1486. X          || ( !isactive(ntn[country].active) && country!=0 )) {
  1487. X              country=ocountry;
  1488. X!             errormsg("invalid country");
  1489. X              break;
  1490. X          } 
  1491. X          if(country==ocountry){
  1492. X!             errormsg("same country");
  1493. X              break;
  1494. X          }
  1495. X  
  1496. X          /*get password*/
  1497. X!         mvaddstr(2,0,"what is your nations password:");
  1498. X          refresh();
  1499. X!         getstr(passwd);
  1500. X          strcpy(name,crypt(passwd,SALT));
  1501. X!         if((strncmp(name,curntn->passwd,PASSLTH)!=0)
  1502. X          &&(strncmp(name,ntn[0].passwd,PASSLTH)!=0)){
  1503. X!             errormsg("sorry:  password invalid");
  1504. X              country=ocountry;
  1505. X              break;
  1506. X          }
  1507. X          if(aretheyon()==TRUE) {
  1508. X!             errormsg("sorry:  country is already logged in.");
  1509. X!             refresh();
  1510. X              country=ocountry;
  1511. X              break;
  1512. X          }
  1513. X  
  1514. X--- 843,875 ----
  1515. X          if( country==(-1) || country>=NTOTAL
  1516. X          || ( !isactive(ntn[country].active) && country!=0 )) {
  1517. X              country=ocountry;
  1518. X!             makebottom();
  1519. X              break;
  1520. X          } 
  1521. X          if(country==ocountry){
  1522. X!             errormsg("What?  You are already logged into that nation.");
  1523. X!             makebottom();
  1524. X              break;
  1525. X          }
  1526. X  
  1527. X          /*get password*/
  1528. X!         clear_bottom(0);
  1529. X!         mvaddstr(LINES-4,0,"What is your Nation's Password: ");
  1530. X          refresh();
  1531. X!         (void) get_pass(passwd);
  1532. X          strcpy(name,crypt(passwd,SALT));
  1533. X! 
  1534. X!         if((strncmp(name,ntn[country].passwd,PASSLTH)!=0)
  1535. X          &&(strncmp(name,ntn[0].passwd,PASSLTH)!=0)){
  1536. X!             errormsg("Sorry, Password Invalid.");
  1537. X              country=ocountry;
  1538. X+             makebottom();
  1539. X              break;
  1540. X          }
  1541. X          if(aretheyon()==TRUE) {
  1542. X!             errormsg("Sorry, that Nation is already logged in.");
  1543. X              country=ocountry;
  1544. X+             makebottom();
  1545. X              break;
  1546. X          }
  1547. X  
  1548. X***************
  1549. X*** 886,891 ****
  1550. X--- 892,898 ----
  1551. X          fprintf(stderr,"\n");
  1552. X          roads_this_turn=0;
  1553. X          terror_adj=0;
  1554. X+         move(LINES-3,0);
  1555. X          readdata();
  1556. X          execute(FALSE);
  1557. X  
  1558. X***************
  1559. X*** 901,907 ****
  1560. X          }
  1561. X          xoffset = yoffset = 0;
  1562. X          centermap();
  1563. X!         redraw=PART;
  1564. X          break;
  1565. X      case '?':    /*display help screen*/
  1566. X          redraw=PART;
  1567. X--- 908,914 ----
  1568. X          }
  1569. X          xoffset = yoffset = 0;
  1570. X          centermap();
  1571. X!         redraw=FULL;
  1572. X          break;
  1573. X      case '?':    /*display help screen*/
  1574. X          redraw=PART;
  1575. X*** onpc.c    Tue Dec 12 21:19:36 1989
  1576. X--- npc.c    Tue Dec 12 21:20:11 1989
  1577. X***************
  1578. X*** 129,134 ****
  1579. X--- 129,250 ----
  1580. X          else if( curntn->active==NPC_SAVAGE ) do_savage();
  1581. X          else if( curntn->active==NPC_LIZARD ) do_lizard(); /* update.c */
  1582. X      }
  1583. X+ #ifdef MORE_MONST
  1584. X+     {
  1585. X+     int neededtroops;
  1586. X+     int actualtroops;
  1587. X+     int savages,nomads;
  1588. X+     int i,x,y;
  1589. X+     int nomad_space=1, savage_space=1;
  1590. X+ 
  1591. X+     for(i=1;i<NTOTAL;i++)
  1592. X+         switch(ntn[i].active)
  1593. X+         {
  1594. X+         case NPC_SAVAGE:
  1595. X+         savages=i;
  1596. X+         break;
  1597. X+         case NPC_NOMAD:
  1598. X+         nomads=i;
  1599. X+         break;
  1600. X+         }
  1601. X+ 
  1602. X+                 /* neededarmies is an estimete of
  1603. X+                  * the desired military strength of savages
  1604. X+                  * and nomads. The proportions are based on
  1605. X+                  * npc.c routines. yeuch.
  1606. X+                  */
  1607. X+ 
  1608. X+     neededtroops= ((NUMSECTS)/MONSTER)*( /* number of armies */
  1609. X+                         (5.0/12)*450 + /* nomads */
  1610. X+                         (1.0/4)*250 );    /* savages */
  1611. X+ 
  1612. X+ 
  1613. X+     actualtroops=0;
  1614. X+     for(i=0;i<MAXARM;i++)
  1615. X+         {
  1616. X+         if (ntn[nomads].arm[i].sold > 0)
  1617. X+         actualtroops += ntn[nomads].arm[i].sold;
  1618. X+         if (ntn[savages].arm[i].sold > 0)
  1619. X+         actualtroops += ntn[savages].arm[i].sold;
  1620. X+         }
  1621. X+     
  1622. X+ #ifdef DEBUG
  1623. X+     printf("monsters: need %d have %d\n",neededtroops,actualtroops);
  1624. X+ #endif DEBUG
  1625. X+ 
  1626. X+     neededtroops= neededtroops-actualtroops;
  1627. X+ 
  1628. X+     while(neededtroops>0&& (nomad_space||savage_space))
  1629. SHAR_EOF
  1630. echo "End of part 2"
  1631. echo "File patchV4.7 is continued in part 3"
  1632. echo "3" > s2_seq_.tmp
  1633. exit 0
  1634.  
  1635.